summaryrefslogtreecommitdiffstats
path: root/src/DabMux.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2016-02-05 12:12:02 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2016-02-05 12:12:02 +0100
commit90cb5392cd7f6f623529d62988bc4afdde011820 (patch)
tree6f2d4b57c64d6f2023e92913aaa179d0eadc3e92 /src/DabMux.cpp
parentc21be14dd5cb7b8aa338c3eecd87fc996e1f5430 (diff)
downloaddabmux-90cb5392cd7f6f623529d62988bc4afdde011820.tar.gz
dabmux-90cb5392cd7f6f623529d62988bc4afdde011820.tar.bz2
dabmux-90cb5392cd7f6f623529d62988bc4afdde011820.zip
Change EDI configuration for multi-output
Diffstat (limited to 'src/DabMux.cpp')
-rw-r--r--src/DabMux.cpp31
1 files changed, 19 insertions, 12 deletions
diff --git a/src/DabMux.cpp b/src/DabMux.cpp
index 18fee19..19f11fe 100644
--- a/src/DabMux.cpp
+++ b/src/DabMux.cpp
@@ -318,14 +318,18 @@ int main(int argc, char *argv[])
if (outputuid == "edi") {
#if HAVE_OUTPUT_EDI
ptree pt_edi = pt_outputs.get_child("edi");
+ for (auto pt_edi_dest : pt_edi.get_child("destinations")) {
+ edi_destination_t dest;
+ dest.dest_addr = pt_edi_dest.second.get<string>("destination");
+ dest.ttl = pt_edi_dest.second.get<unsigned int>("ttl", 1);
- edi_conf.enabled = true;
+ dest.source_addr = pt_edi_dest.second.get<string>("source", "");
+ dest.source_port = pt_edi_dest.second.get<unsigned int>("sourceport");
+
+ edi_conf.destinations.push_back(dest);
+ }
- edi_conf.dest_addr = pt_edi.get<string>("destination");
edi_conf.dest_port = pt_edi.get<unsigned int>("port");
- edi_conf.source_addr = pt_edi.get<string>("source", "");
- edi_conf.source_port = pt_edi.get<unsigned int>("sourceport");
- edi_conf.ttl = pt_edi.get<unsigned int>("ttl", 1);
edi_conf.dump = pt_edi.get<bool>("dump");
edi_conf.enable_pft = pt_edi.get<bool>("enable_pft");
@@ -429,14 +433,17 @@ int main(int argc, char *argv[])
printOutputs(outputs);
#if HAVE_OUTPUT_EDI
- if (edi_conf.enabled) {
- etiLog.level(info) << "EDI to " << edi_conf.dest_addr << ":" << edi_conf.dest_port;
- if (not edi_conf.source_addr.empty()) {
- etiLog.level(info) << " source " << edi_conf.source_addr;
- etiLog.level(info) << " ttl " << edi_conf.ttl;
- }
- etiLog.level(info) << " source port " << edi_conf.source_port;
+ if (edi_conf.enabled()) {
+ etiLog.level(info) << "EDI";
etiLog.level(info) << " verbose " << edi_conf.verbose;
+ for (auto& edi_dest : edi_conf.destinations) {
+ etiLog.level(info) << " to " << edi_dest.dest_addr << ":" << edi_conf.dest_port;
+ if (not edi_dest.source_addr.empty()) {
+ etiLog.level(info) << " source " << edi_dest.source_addr;
+ etiLog.level(info) << " ttl " << edi_dest.ttl;
+ }
+ etiLog.level(info) << " source port " << edi_dest.source_port;
+ }
}
#endif