From 844994f2cd5f0203c839e9ee0958fca73fc2de04 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sun, 4 Aug 2019 12:49:28 +0200 Subject: [PATCH] [ENB] Fix enabling of MAC pcap file when using [pcap] enable = true filename = /tmp/enb.pcap in enb.conf, there is no pcap file created. The problem is somewhere in the way how arguments are handled. pcap.enable is properly parsed into args.pcap. However, later on, lte_stack->init(args.stack, rrc_cfg, lte_phy.get()) only passes args.stack down the road, not args.pcap. enb_stack_lte::init() then basically uses args.stack.pcap and not args.pcap, and the latter appears always false. Let's remove pcap_args_t from all_args and only use the instance in stack_args_t. Closes: #359 --- srsenb/hdr/enb.h | 1 - srsenb/src/main.cc | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/srsenb/hdr/enb.h b/srsenb/hdr/enb.h index 45592e401..7ef46f1a1 100644 --- a/srsenb/hdr/enb.h +++ b/srsenb/hdr/enb.h @@ -101,7 +101,6 @@ struct all_args_t { enb_args_t enb; enb_files_t enb_files; srslte::rf_args_t rf; - pcap_args_t pcap; log_args_t log; gui_args_t gui; general_args_t general; diff --git a/srsenb/src/main.cc b/srsenb/src/main.cc index fbf0e1077..e4b9b40e8 100644 --- a/srsenb/src/main.cc +++ b/srsenb/src/main.cc @@ -97,8 +97,8 @@ void parse_args(all_args_t *args, int argc, char* argv[]) { ("rf.time_adv_nsamples", bpo::value(&args->rf.time_adv_nsamples)->default_value("auto"), "Transmission time advance") ("rf.burst_preamble_us", bpo::value(&args->rf.burst_preamble)->default_value("auto"), "Transmission time advance") - ("pcap.enable", bpo::value(&args->pcap.enable)->default_value(false), "Enable MAC packet captures for wireshark") - ("pcap.filename", bpo::value(&args->pcap.filename)->default_value("ue.pcap"), "MAC layer capture filename") + ("pcap.enable", bpo::value(&args->stack.pcap.enable)->default_value(false), "Enable MAC packet captures for wireshark") + ("pcap.filename", bpo::value(&args->stack.pcap.filename)->default_value("ue.pcap"), "MAC layer capture filename") ("gui.enable", bpo::value(&args->gui.enable)->default_value(false), "Enable GUI plots")