aboutsummaryrefslogtreecommitdiffstats
path: root/lib/edioutput
diff options
context:
space:
mode:
Diffstat (limited to 'lib/edioutput')
-rw-r--r--lib/edioutput/EDIConfig.h3
-rw-r--r--lib/edioutput/PFT.cpp1
-rw-r--r--lib/edioutput/PFT.h5
-rw-r--r--lib/edioutput/TagItems.cpp6
-rw-r--r--lib/edioutput/TagItems.h2
-rw-r--r--lib/edioutput/Transport.cpp6
6 files changed, 11 insertions, 12 deletions
diff --git a/lib/edioutput/EDIConfig.h b/lib/edioutput/EDIConfig.h
index 4f1df97..647d77e 100644
--- a/lib/edioutput/EDIConfig.h
+++ b/lib/edioutput/EDIConfig.h
@@ -44,6 +44,7 @@ struct destination_t {
// Can represent both unicast and multicast destinations
struct udp_destination_t : public destination_t {
std::string dest_addr;
+ unsigned int dest_port = 0;
std::string source_addr;
unsigned int source_port = 0;
unsigned int ttl = 10;
@@ -68,10 +69,8 @@ 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
unsigned int latency_frames = 0; // if nonzero, enable interleaver with a latency of latency_frames * 24ms
bool enabled() const { return destinations.size() > 0; }
diff --git a/lib/edioutput/PFT.cpp b/lib/edioutput/PFT.cpp
index 1e3d4da..b2f07e0 100644
--- a/lib/edioutput/PFT.cpp
+++ b/lib/edioutput/PFT.cpp
@@ -55,7 +55,6 @@ PFT::PFT() { }
PFT::PFT(const configuration_t &conf) :
m_k(conf.chunk_len),
m_m(conf.fec),
- m_dest_port(conf.dest_port),
m_pseq(0),
m_num_chunks(0),
m_verbose(conf.verbose)
diff --git a/lib/edioutput/PFT.h b/lib/edioutput/PFT.h
index 1019915..4d138c5 100644
--- a/lib/edioutput/PFT.h
+++ b/lib/edioutput/PFT.h
@@ -68,13 +68,14 @@ class PFT
private:
unsigned int m_k = 207; // length of RS data word
unsigned int m_m = 3; // number of fragments that can be recovered if lost
- 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 = false;
- bool m_transport_header = false;
+ // Transport header is always deactivated
+ const bool m_transport_header = false;
const uint16_t m_addr_source = 0;
+ const unsigned int m_dest_port = 0;
};
}
diff --git a/lib/edioutput/TagItems.cpp b/lib/edioutput/TagItems.cpp
index 9746469..739adfa 100644
--- a/lib/edioutput/TagItems.cpp
+++ b/lib/edioutput/TagItems.cpp
@@ -212,8 +212,8 @@ std::vector<uint8_t> TagDSTI::Assemble()
packet.push_back(0);
packet.push_back(0);
- uint8_t dfctl = dflc % 250;
- uint8_t dfcth = dflc / 250;
+ uint8_t dfctl = dlfc % 250;
+ uint8_t dfcth = dlfc / 250;
uint16_t dstiHeader = dfctl | (dfcth << 8) | (rfadf << 13) | (atstf << 14) | (stihf << 15);
@@ -254,7 +254,7 @@ std::vector<uint8_t> TagDSTI::Assemble()
packet[6] = (taglength >> 8) & 0xFF;
packet[7] = taglength & 0xFF;
- dflc = (dflc+1) % 5000;
+ dlfc = (dlfc+1) % 5000;
/*
std::cerr << "TagItem dsti, packet.size " << packet.size() << std::endl;
diff --git a/lib/edioutput/TagItems.h b/lib/edioutput/TagItems.h
index 5c81b01..f24dc44 100644
--- a/lib/edioutput/TagItems.h
+++ b/lib/edioutput/TagItems.h
@@ -147,7 +147,7 @@ class TagDSTI : public TagItem
bool stihf = false;
bool atstf = false; // presence of atst data
bool rfadf = false;
- uint16_t dflc = 0; // modulo 5000 frame counter
+ uint16_t dlfc = 0; // modulo 5000 frame counter
// STI Header (optional)
uint8_t stat = 0;
diff --git a/lib/edioutput/Transport.cpp b/lib/edioutput/Transport.cpp
index fa7588a..cfed9ec 100644
--- a/lib/edioutput/Transport.cpp
+++ b/lib/edioutput/Transport.cpp
@@ -38,7 +38,7 @@ void configuration_t::print() const
etiLog.level(info) << " verbose " << verbose;
for (auto edi_dest : destinations) {
if (auto udp_dest = dynamic_pointer_cast<edi::udp_destination_t>(edi_dest)) {
- etiLog.level(info) << " UDP to " << udp_dest->dest_addr << ":" << dest_port;
+ etiLog.level(info) << " UDP to " << udp_dest->dest_addr << ":" << udp_dest->dest_port;
if (not udp_dest->source_addr.empty()) {
etiLog.level(info) << " source " << udp_dest->source_addr;
etiLog.level(info) << " ttl " << udp_dest->ttl;
@@ -148,7 +148,7 @@ void Sender::write(const TagPacket& tagpacket)
for (auto& dest : m_conf.destinations) {
if (const auto& udp_dest = dynamic_pointer_cast<edi::udp_destination_t>(dest)) {
Socket::InetAddress addr;
- addr.resolveUdpDestination(udp_dest->dest_addr, m_conf.dest_port);
+ addr.resolveUdpDestination(udp_dest->dest_addr, udp_dest->dest_port);
udp_sockets.at(udp_dest.get())->send(edi_frag, addr);
}
@@ -176,7 +176,7 @@ void Sender::write(const TagPacket& tagpacket)
for (auto& dest : m_conf.destinations) {
if (const auto& udp_dest = dynamic_pointer_cast<edi::udp_destination_t>(dest)) {
Socket::InetAddress addr;
- addr.resolveUdpDestination(udp_dest->dest_addr, m_conf.dest_port);
+ addr.resolveUdpDestination(udp_dest->dest_addr, udp_dest->dest_port);
if (af_packet.size() > 1400 and not m_udp_fragmentation_warning_printed) {
fprintf(stderr, "EDI Output: AF packet larger than 1400,"