Supply ctor with logger instead of fetching

master
David Rupprecht 3 years ago committed by David Rupprecht
parent 24e52d6291
commit 9172059078

@ -23,7 +23,7 @@ gnb_stack_nr::gnb_stack_nr() : task_sched{512, 128}, thread("gNB"), rlc_logger(s
m_pdcp.reset(new pdcp_nr(&task_sched, "PDCP-NR")); m_pdcp.reset(new pdcp_nr(&task_sched, "PDCP-NR"));
m_rrc.reset(new rrc_nr(&task_sched)); m_rrc.reset(new rrc_nr(&task_sched));
m_sdap.reset(new sdap()); m_sdap.reset(new sdap());
m_gw.reset(new srsue::gw()); m_gw.reset(new srsue::gw(srslog::fetch_basic_logger("GW")));
// m_gtpu.reset(new srsenb::gtpu()); // m_gtpu.reset(new srsenb::gtpu());
ue_task_queue = task_sched.make_task_queue(); ue_task_queue = task_sched.make_task_queue();

@ -43,7 +43,7 @@ struct gw_args_t {
class gw : public gw_interface_stack, public srsran::thread class gw : public gw_interface_stack, public srsran::thread
{ {
public: public:
gw(); gw(srslog::basic_logger& logger_);
int init(const gw_args_t& args_, stack_interface_gw* stack); int init(const gw_args_t& args_, stack_interface_gw* stack);
void stop(); void stop();

@ -38,7 +38,7 @@ class rrc_interface_nas;
class nas : public nas_interface_rrc, public srsran::timer_callback, public nas_base class nas : public nas_interface_rrc, public srsran::timer_callback, public nas_base
{ {
public: public:
explicit nas(srsran::task_sched_handle task_sched_); explicit nas(srslog::basic_logger& logger_, srsran::task_sched_handle task_sched_);
virtual ~nas(); virtual ~nas();
int init(usim_interface_nas* usim_, rrc_interface_nas* rrc_, gw_interface_nas* gw_, const nas_args_t& args_); int init(usim_interface_nas* usim_, rrc_interface_nas* rrc_, gw_interface_nas* gw_, const nas_args_t& args_);
void stop(); void stop();

@ -35,7 +35,7 @@ namespace srsue {
class nas_5g : public nas_base, public nas_5g_interface_rrc_nr, public nas_5g_interface_procedures class nas_5g : public nas_base, public nas_5g_interface_rrc_nr, public nas_5g_interface_procedures
{ {
public: public:
explicit nas_5g(srsran::task_sched_handle task_sched_); explicit nas_5g(srslog::basic_logger& logger_, srsran::task_sched_handle task_sched_);
virtual ~nas_5g(); virtual ~nas_5g();
int init(usim_interface_nas* usim_, rrc_nr_interface_nas_5g* rrc_nr_, gw_interface_nas* gw_, const nas_args_t& cfg_); int init(usim_interface_nas* usim_, rrc_nr_interface_nas_5g* rrc_nr_, gw_interface_nas* gw_, const nas_args_t& cfg_);
void stop(); void stop();

@ -28,7 +28,7 @@ namespace srsue {
class nas_base class nas_base
{ {
public: public:
nas_base(const std::string& type_); nas_base(srslog::basic_logger& logger_);
// PCAP // PCAP
void start_pcap(srsran::nas_pcap* pcap_) { pcap = pcap_; } void start_pcap(srsran::nas_pcap* pcap_) { pcap = pcap_; }

@ -187,7 +187,7 @@ public:
class nas_test : public srsue::nas class nas_test : public srsue::nas
{ {
public: public:
nas_test(srsran::task_sched_handle t) : srsue::nas(t) {} nas_test(srsran::task_sched_handle t) : srsue::nas(srslog::fetch_basic_logger("NAS"), t) {}
bool is_registered() override { return false; } bool is_registered() override { return false; }
}; };

@ -50,7 +50,7 @@ ue_stack_lte::ue_stack_lte() :
rrc_nr(&task_sched), rrc_nr(&task_sched),
pdcp(&task_sched, "PDCP"), pdcp(&task_sched, "PDCP"),
pdcp_nr(&task_sched, "PDCP-NR"), pdcp_nr(&task_sched, "PDCP-NR"),
nas(&task_sched), nas(srslog::fetch_basic_logger("NAS", false), &task_sched),
thread("STACK"), thread("STACK"),
task_sched(512, 64), task_sched(512, 64),
tti_tprof("tti_tprof", "STCK", TTI_STAT_PERIOD) tti_tprof("tti_tprof", "STCK", TTI_STAT_PERIOD)

@ -29,7 +29,7 @@
namespace srsue { namespace srsue {
gw::gw() : thread("GW"), logger(srslog::fetch_basic_logger("GW", false)), tft_matcher(logger) {} gw::gw(srslog::basic_logger& logger_) : thread("GW"), logger(logger_), tft_matcher(logger) {}
int gw::init(const gw_args_t& args_, stack_interface_gw* stack_) int gw::init(const gw_args_t& args_, stack_interface_gw* stack_)
{ {

@ -34,8 +34,8 @@ namespace srsue {
* NAS * NAS
********************************************************************/ ********************************************************************/
nas::nas(srsran::task_sched_handle task_sched_) : nas::nas(srslog::basic_logger& logger_, srsran::task_sched_handle task_sched_) :
nas_base("NAS"), nas_base(logger_),
plmn_searcher(this), plmn_searcher(this),
task_sched(task_sched_), task_sched(task_sched_),
t3402(task_sched_.get_unique_timer()), t3402(task_sched_.get_unique_timer()),

@ -36,8 +36,8 @@ namespace srsue {
* NAS 5G (NR) * NAS 5G (NR)
********************************************************************/ ********************************************************************/
nas_5g::nas_5g(srsran::task_sched_handle task_sched_) : nas_5g::nas_5g(srslog::basic_logger& logger_, srsran::task_sched_handle task_sched_) :
nas_base("NAS-5G"), nas_base(logger_),
task_sched(task_sched_), task_sched(task_sched_),
t3502(task_sched_.get_unique_timer()), t3502(task_sched_.get_unique_timer()),
t3510(task_sched_.get_unique_timer()), t3510(task_sched_.get_unique_timer()),

@ -14,7 +14,7 @@
using namespace srsran; using namespace srsran;
namespace srsue { namespace srsue {
nas_base::nas_base(const std::string& type_) : logger(srslog::fetch_basic_logger(type_)) {} nas_base::nas_base(srslog::basic_logger& logger_) : logger(logger_) {}
int nas_base::parse_security_algorithm_list(std::string algorithm_string, bool* algorithm_caps) int nas_base::parse_security_algorithm_list(std::string algorithm_string, bool* algorithm_caps)
{ {

@ -33,7 +33,7 @@ int gw_test()
gw_args.log.gw_level = "debug"; gw_args.log.gw_level = "debug";
gw_args.log.gw_hex_limit = 100000; gw_args.log.gw_hex_limit = 100000;
test_stack_dummy stack; test_stack_dummy stack;
srsue::gw gw; srsue::gw gw(srslog::fetch_basic_logger("GW"));
gw.init(gw_args, &stack); gw.init(gw_args, &stack);
uint32_t eps_bearer_id = 5; uint32_t eps_bearer_id = 5;

@ -49,8 +49,8 @@ int amf_attach_request_test(srsran::nas_pcap* pcap)
nas_cfg.ea5g = "0,1,2,3"; nas_cfg.ea5g = "0,1,2,3";
test_stack_dummy<srsue::nas_5g> stack(&pdcp_dummy); test_stack_dummy<srsue::nas_5g> stack(&pdcp_dummy);
srsue::nas_5g nas_5g(&stack.task_sched); srsue::nas_5g nas_5g(srslog::fetch_basic_logger("NAS-5G"), &stack.task_sched);
srsue::gw gw; srsue::gw gw(srslog::fetch_basic_logger("GW"));
if (pcap != nullptr) { if (pcap != nullptr) {
nas_5g.start_pcap(pcap); nas_5g.start_pcap(pcap);

@ -59,8 +59,8 @@ int mme_attach_request_test()
nas_cfg.apn_name = "test123"; nas_cfg.apn_name = "test123";
test_stack_dummy<srsue::nas> stack(&pdcp_dummy); test_stack_dummy<srsue::nas> stack(&pdcp_dummy);
srsue::nas nas(&stack.task_sched); srsue::nas nas(srslog::fetch_basic_logger("NAS"), &stack.task_sched);
srsue::gw gw; srsue::gw gw(srslog::fetch_basic_logger("GW"));
nas.init(&usim, &rrc_dummy, &gw, nas_cfg); nas.init(&usim, &rrc_dummy, &gw, nas_cfg);
rrc_dummy.init(&nas); rrc_dummy.init(&nas);
@ -124,7 +124,7 @@ int security_command_test()
usim.init(&args); usim.init(&args);
{ {
srsue::nas nas(&stack.task_sched); srsue::nas nas(srslog::fetch_basic_logger("NAS"), &stack.task_sched);
nas_args_t cfg; nas_args_t cfg;
cfg.eia = "1,2,3"; cfg.eia = "1,2,3";
cfg.eea = "0,1,2,3"; cfg.eea = "0,1,2,3";
@ -179,7 +179,7 @@ int esm_info_request_test()
usim.init(&args); usim.init(&args);
{ {
srsue::nas nas(&stack.task_sched); srsue::nas nas(srslog::fetch_basic_logger("NAS-5G"), &stack.task_sched);
nas_args_t cfg; nas_args_t cfg;
cfg.apn_name = "srsran"; cfg.apn_name = "srsran";
cfg.apn_user = "srsuser"; cfg.apn_user = "srsuser";
@ -223,7 +223,7 @@ int dedicated_eps_bearer_test()
srsue::usim usim(srslog::fetch_basic_logger("USIM")); srsue::usim usim(srslog::fetch_basic_logger("USIM"));
usim.init(&args); usim.init(&args);
srsue::nas nas(&stack.task_sched); srsue::nas nas(srslog::fetch_basic_logger("NAS"), &stack.task_sched);
nas_args_t cfg = {}; nas_args_t cfg = {};
cfg.force_imsi_attach = true; // make sure we get a fresh security context cfg.force_imsi_attach = true; // make sure we get a fresh security context
cfg.eia = "1,2,3"; cfg.eia = "1,2,3";

@ -61,7 +61,7 @@ int ue::init(const all_args_t& args_)
return SRSRAN_ERROR; return SRSRAN_ERROR;
} }
std::unique_ptr<gw> gw_ptr(new gw()); std::unique_ptr<gw> gw_ptr(new gw(srslog::fetch_basic_logger("GW")));
if (!gw_ptr) { if (!gw_ptr) {
srsran::console("Error creating a GW instance.\n"); srsran::console("Error creating a GW instance.\n");
return SRSRAN_ERROR; return SRSRAN_ERROR;
@ -123,7 +123,7 @@ int ue::init(const all_args_t& args_)
std::unique_ptr<srsue::ue_stack_nr> nr_stack(new srsue::ue_stack_nr()); std::unique_ptr<srsue::ue_stack_nr> nr_stack(new srsue::ue_stack_nr());
std::unique_ptr<srsran::radio_null> nr_radio(new srsran::radio_null); std::unique_ptr<srsran::radio_null> nr_radio(new srsran::radio_null);
std::unique_ptr<srsue::ue_phy_base> nr_phy; std::unique_ptr<srsue::ue_phy_base> nr_phy;
std::unique_ptr<gw> gw_ptr(new gw()); std::unique_ptr<gw> gw_ptr(new gw(srslog::fetch_basic_logger("GW")));
// Init layers // Init layers
if (nr_radio->init(args.rf, nullptr)) { if (nr_radio->init(args.rf, nullptr)) {

Loading…
Cancel
Save