aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2020-11-16 08:56:15 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2020-11-16 08:56:15 +0100
commit17b2f2fb09bf5d20246d21ba52c2c3e5d6f883c2 (patch)
tree138a9fb0a3fa1270c8960d2b9978aa1219de5c15
parent51ee0325b85c4b6ed48651076046bd12308c09fb (diff)
downloadODR-EDI2EDI-17b2f2fb09bf5d20246d21ba52c2c3e5d6f883c2.tar.gz
ODR-EDI2EDI-17b2f2fb09bf5d20246d21ba52c2c3e5d6f883c2.tar.bz2
ODR-EDI2EDI-17b2f2fb09bf5d20246d21ba52c2c3e5d6f883c2.zip
common a676d57: EDI output: Make Transport Addressing optional
-rw-r--r--lib/edioutput/EDIConfig.h1
-rw-r--r--lib/edioutput/PFT.cpp10
-rw-r--r--lib/edioutput/PFT.h5
3 files changed, 9 insertions, 7 deletions
diff --git a/lib/edioutput/EDIConfig.h b/lib/edioutput/EDIConfig.h
index ca76322..4f1df97 100644
--- a/lib/edioutput/EDIConfig.h
+++ b/lib/edioutput/EDIConfig.h
@@ -68,6 +68,7 @@ struct configuration_t {
bool dump = false; // dump a file with the EDI packets
bool verbose = false;
bool enable_pft = false; // Enable protection and fragmentation
+ bool enable_transport_header = true; // Sets Addr, Source and Dest in PFT
unsigned int tagpacket_alignment = 0;
std::vector<std::shared_ptr<destination_t> > destinations;
unsigned int dest_port = 0; // common destination port, because it's encoded in the transport layer
diff --git a/lib/edioutput/PFT.cpp b/lib/edioutput/PFT.cpp
index 371d36f..1e3d4da 100644
--- a/lib/edioutput/PFT.cpp
+++ b/lib/edioutput/PFT.cpp
@@ -233,7 +233,6 @@ std::vector< PFTFragment > PFT::Assemble(AFPacket af_packet)
vector< vector<uint8_t> > pft_fragments; // These contain PF headers
const bool enable_RS = (m_m > 0);
- const bool enable_transport = true;
unsigned int findex = 0;
@@ -276,7 +275,7 @@ std::vector< PFTFragment > PFT::Assemble(AFPacket af_packet)
plen |= 0x8000; // Set FEC bit
}
- if (enable_transport) {
+ if (m_transport_header) {
plen |= 0x4000; // Set ADDR bit
}
@@ -288,11 +287,10 @@ std::vector< PFTFragment > PFT::Assemble(AFPacket af_packet)
packet.push_back(zero_pad); // RSz
}
- if (enable_transport) {
+ if (m_transport_header) {
// Source (16 bits)
- uint16_t addr_source = 0;
- packet.push_back(addr_source >> 8);
- packet.push_back(addr_source & 0xFF);
+ packet.push_back(m_addr_source >> 8);
+ packet.push_back(m_addr_source & 0xFF);
// Dest (16 bits)
packet.push_back(m_dest_port >> 8);
diff --git a/lib/edioutput/PFT.h b/lib/edioutput/PFT.h
index 502aa39..1019915 100644
--- a/lib/edioutput/PFT.h
+++ b/lib/edioutput/PFT.h
@@ -71,7 +71,10 @@ class PFT
unsigned int m_dest_port = 12000; // Destination port for transport header
uint16_t m_pseq = 0;
size_t m_num_chunks = 0;
- bool m_verbose = 0;
+ bool m_verbose = false;
+
+ bool m_transport_header = false;
+ const uint16_t m_addr_source = 0;
};
}