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
changes/28/20128/7
Harald Welte 2 years ago
parent 3dd8355d7d
commit 847a77e32f
  1. 14
      library/NS_Emulation.ttcnpp
  2. 5
      library/NS_Provider_FR.ttcn
  3. 2
      library/NS_Provider_IPL4.ttcn

@ -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
}

@ -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));

@ -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);

Loading…
Cancel
Save