From 847a77e32fada86da0e647179f7b69c23a3304eb Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Mon, 14 Sep 2020 12:55:47 +0200 Subject: NS_Emulation: pass around string idenifier for components created We want to see useful identification for components in the log, and hence must be giving every component a name at create() time. Change-Id: I0fe650243953e4d85161684865acd0354b2e465f --- library/NS_Emulation.ttcnpp | 14 +++++++------- library/NS_Provider_FR.ttcn | 5 +++-- library/NS_Provider_IPL4.ttcn | 2 +- 3 files changed, 11 insertions(+), 10 deletions(-) (limited to 'library') diff --git a/library/NS_Emulation.ttcnpp b/library/NS_Emulation.ttcnpp index ee25d3e3..5fb2aa67 100644 --- a/library/NS_Emulation.ttcnpp +++ b/library/NS_Emulation.ttcnpp @@ -85,25 +85,25 @@ module NS_Emulation { out NsUnitdataRequest; } with { extension "internal" }; - function NSStart(NSConfiguration init_config) runs on NS_CT { + function NSStart(NSConfiguration init_config, charstring id := testcasename()) runs on NS_CT { config := init_config; - f_init(); + f_init(id & "-NSemu"); f_ScanEvents(); } - private function f_init() runs on NS_CT { + private function f_init(charstring id) runs on NS_CT { var Result res; if (ischosen(config.provider.ip)) { /* Connect the UDP socket */ - vc_NSP_IP := NS_Provider_IPL4_CT.create; + vc_NSP_IP := NS_Provider_IPL4_CT.create(id & "-provIP"); connect(self:NSCP, vc_NSP_IP:NSE); - vc_NSP_IP.start(NS_Provider_IPL4.main(config)); + vc_NSP_IP.start(NS_Provider_IPL4.main(config, id)); #ifdef NS_EMULATION_FR } else if (ischosen(config.provider.fr)) { - vc_NSP_FR := NS_Provider_FR_CT.create; + vc_NSP_FR := NS_Provider_FR_CT.create(id & "-provFR"); connect(self:NSCP, vc_NSP_FR:NSE); - vc_NSP_FR.start(NS_Provider_FR.main(config)); + vc_NSP_FR.start(NS_Provider_FR.main(config, id)); #endif } diff --git a/library/NS_Provider_FR.ttcn b/library/NS_Provider_FR.ttcn index afa27d9e..5387b0fe 100644 --- a/library/NS_Provider_FR.ttcn +++ b/library/NS_Provider_FR.ttcn @@ -27,11 +27,12 @@ type component NS_Provider_FR_CT extends NS_Provider_CT, FR_Client_CT { var boolean pvc_active := false; }; -function main(NSConfiguration config) runs on NS_Provider_FR_CT system af_packet { +function main(NSConfiguration config, charstring id) runs on NS_Provider_FR_CT system af_packet { /* start Frame Relay Emulation */ - vc_FREMU := FR_Emulation_CT.create(); + vc_FREMU := FR_Emulation_CT.create(id & "-FRemu"); var Q933em_Config q933_cfg := valueof(ts_Q933em_Config(ats_is_user := not config.role_sgsn, bidirectional := false)); + q933_cfg.T391 := 1.0; map(vc_FREMU:FR, system:AF_PACKET) param (config.provider.fr.netdev); vc_FREMU.start(FrameRelay_Emulation.main(q933_cfg)); diff --git a/library/NS_Provider_IPL4.ttcn b/library/NS_Provider_IPL4.ttcn index f1fda6cd..3b9fcaf3 100644 --- a/library/NS_Provider_IPL4.ttcn +++ b/library/NS_Provider_IPL4.ttcn @@ -23,7 +23,7 @@ type component NS_Provider_IPL4_CT extends NS_Provider_CT { var integer g_conn_id := -1; }; -function main(NSConfiguration config) runs on NS_Provider_IPL4_CT { +function main(NSConfiguration config, charstring id) runs on NS_Provider_IPL4_CT { /* connect socket */ map(self:IPL4, system:IPL4); -- cgit v1.2.3