diff --git a/lib/test/rlc/rlc_stress_test.cc b/lib/test/rlc/rlc_stress_test.cc index 141419d07..b1ea4ba29 100644 --- a/lib/test/rlc/rlc_stress_test.cc +++ b/lib/test/rlc/rlc_stress_test.cc @@ -26,12 +26,10 @@ #include #include -#define MIN_SDU_SIZE (5) -#define MAX_SDU_SIZE (1500) - #include "srsran/common/mac_pcap.h" #include "srsran/mac/mac_sch_pdu_nr.h" +static std::unique_ptr pcap_handle = nullptr; /*********************** * MAC tester class ***********************/ @@ -80,7 +78,7 @@ void mac_dummy::run_tx_tti(srsue::rlc_interface_mac* tx_rlc, // Create PDU unique buffer srsran::unique_byte_buffer_t pdu = srsran::make_byte_buffer(); if (!pdu) { - printf("Fatal Error: Could not allocate PDU in mac_reader::run_thread\n"); + printf("Fatal Error: Could not allocate PDU in %s\n", __FUNCTION__); exit(-1); } @@ -135,7 +133,7 @@ void mac_dummy::run_rx_tti(srsue::rlc_interface_mac* tx_rlc, rx_rlc->write_pdu(lcid, pdu->msg, pdu_len); // Write PCAP - write_pdu_to_pcap(is_dl, 4, pdu->msg, pdu_len); // Only handles NR rat + write_pdu_to_pcap(pcap_handle, is_dl, 4, pdu->msg, pdu_len); // Only handles NR rat if (is_dl) { pcap->write_dl_ccch(pdu->msg, pdu_len); } else { diff --git a/lib/test/rlc/rlc_stress_test.h b/lib/test/rlc/rlc_stress_test.h index bb99d948b..a904586ac 100644 --- a/lib/test/rlc/rlc_stress_test.h +++ b/lib/test/rlc/rlc_stress_test.h @@ -27,11 +27,12 @@ #include "srsran/common/mac_pcap.h" #include "srsran/mac/mac_sch_pdu_nr.h" -static std::unique_ptr pcap_handle = nullptr; -namespace bpo = boost::program_options; - -inline int write_pdu_to_pcap(const bool is_dl, const uint32_t lcid, const uint8_t* payload, const uint32_t len) +inline int write_pdu_to_pcap(const std::unique_ptr& pcap_handle, + const bool is_dl, + const uint32_t lcid, + const uint8_t* payload, + const uint32_t len) { const uint32_t PCAP_CRNTI = 0x1001; const uint32_t PCAP_TTI = 666; @@ -78,6 +79,7 @@ typedef struct { void parse_args(stress_test_args_t* args, int argc, char* argv[]) { + namespace bpo = boost::program_options; // Command line only options bpo::options_description general("General options");