ipa: Give all components proper names to aid log interpretation
diff --git a/ipa/BSC_MS_ConnectionHandler.ttcn b/ipa/BSC_MS_ConnectionHandler.ttcn
index 0b5f976..a6824c4 100644
--- a/ipa/BSC_MS_ConnectionHandler.ttcn
+++ b/ipa/BSC_MS_ConnectionHandler.ttcn
@@ -27,7 +27,7 @@
/* Callback function from general BSSMAP_Emulation whenever a new incoming
* SCCP connection arrivces. Must create + start a new component */
-private function CreateCallback(ASP_SCCP_N_CONNECT_ind conn_ind)
+private function CreateCallback(ASP_SCCP_N_CONNECT_ind conn_ind, charstring id)
runs on BSSMAP_Emulation_CT return BSSAP_ConnHdlr {
log("Incoming SCCP Connection on BSC ?!?");
self.stop;
diff --git a/ipa/BSC_MS_Simulation.ttcn b/ipa/BSC_MS_Simulation.ttcn
index 24ac4bc..876db82 100644
--- a/ipa/BSC_MS_Simulation.ttcn
+++ b/ipa/BSC_MS_Simulation.ttcn
@@ -22,21 +22,25 @@
var SCCP_PAR_Address g_sccp_addr_own;
var SCCP_PAR_Address g_sccp_addr_remote;
+
+ var charstring g_bsc_num_str;
}
function main(charstring remote_ip, PortNumber remote_port,
charstring local_ip, PortNumber local_port,
MSC_SCCP_MTP3_parameters sccp_pars,
SCCP_PAR_Address sccp_addr_own,
- SCCP_PAR_Address sccp_addr_remote) runs on BSC_CT
+ SCCP_PAR_Address sccp_addr_remote, charstring id) runs on BSC_CT
{
+ var integer i := 0;
+
g_sccp_addr_own := sccp_addr_own;
g_sccp_addr_remote := sccp_addr_remote;
/* create components */
- vc_IPA := IPA_Emulation_CT.create;
- vc_SCCP := SCCP_CT.create;
- vc_BSSMAP := BSSMAP_Emulation_CT.create;
+ vc_IPA := IPA_Emulation_CT.create(id & "-IPA");
+ vc_SCCP := SCCP_CT.create(id & "-SCCP");
+ vc_BSSMAP := BSSMAP_Emulation_CT.create(id & "-BSSMAP");
map(vc_IPA:IPA_PORT, system:IPA_CODEC_PT);
@@ -51,14 +55,16 @@
vc_IPA.start(IPA_Emulation.main_client(remote_ip, remote_port, local_ip, local_port));
vc_SCCP.start(SCCPStart(sccp_pars));
- vc_BSSMAP.start(BSSMAP_Emulation.main(BSC_MS_BssmapOps));
+ vc_BSSMAP.start(BSSMAP_Emulation.main(BSC_MS_BssmapOps, id));
while (true) {
+ /* blocking wait for 5 seconds */
timer T := 5.0;
T.start;
T.timeout;
- f_start_BSC_MS();
- //vc_IPA.MTP3_SP_PORT.send(t_ASP_MTP3_TRANSFERreq_sccp('83'O, 1, 2, 0, '012345'O));
+
+ f_start_BSC_MS(id & "-MS-" & int2str(i));
+ i := i + 1;
}
vc_IPA.done;
@@ -66,11 +72,11 @@
vc_SCCP.done
}
-function f_start_BSC_MS() runs on BSC_CT {
+function f_start_BSC_MS(charstring id) runs on BSC_CT {
var BSC_MS_ConnHdlr vc_conn;
/* start new component */
- vc_conn := BSC_MS_ConnHdlr.create;
+ vc_conn := BSC_MS_ConnHdlr.create(id);
/* connect client BSSAP port to BSSAP dispatcher */
connect(vc_conn:BSSAP, vc_BSSMAP:CLIENT);
/* start component */
diff --git a/ipa/IPA_Test.ttcn b/ipa/IPA_Test.ttcn
index d15c50f..c248a35 100644
--- a/ipa/IPA_Test.ttcn
+++ b/ipa/IPA_Test.ttcn
@@ -103,19 +103,22 @@
function f_init() runs on test_CT {
var integer i;
+ var charstring id;
for (i := 0; i < NUM_MSC; i := i+1) {
f_init_MscState(msc[i], mp_msc_pc +i, mp_bsc_pc, mp_msc_ssn, mp_bsc_ssn);
msc[i].MSC := MSC_CT.create;
- msc[i].MSC.start(MSC_Simulation.main(mp_msc_ip, mp_msc_port + i, msc[i].sccp_pars, msc[i].sccp_addr_own));
+ id := "MSC" & int2str(i);
+ msc[i].MSC.start(MSC_Simulation.main(mp_msc_ip, mp_msc_port + i, msc[i].sccp_pars, msc[i].sccp_addr_own, id));
}
for (i := 0; i < NUM_BSC; i := i+1) {
f_init_BscState(bsc[i], mp_bsc_pc +i, mp_msc_pc, mp_bsc_ssn, mp_msc_ssn);
bsc[i].BSC := BSC_CT.create;
+ id := "BSC" & int2str(i);
bsc[i].BSC.start(BSC_MS_Simulation.main(mp_nat_ip, mp_nat_port, mp_bsc_ip, mp_bsc_port+i,
bsc[i].sccp_pars, bsc[i].sccp_addr_own,
- bsc[i].sccp_addr_peer));
+ bsc[i].sccp_addr_peer, id));
}
}
diff --git a/ipa/MSC_ConnectionHandler.ttcn b/ipa/MSC_ConnectionHandler.ttcn
index 3cb9adb..4206c72 100644
--- a/ipa/MSC_ConnectionHandler.ttcn
+++ b/ipa/MSC_ConnectionHandler.ttcn
@@ -26,11 +26,11 @@
/* Callback function from general BSSMAP_Emulation whenever a new incoming
* SCCP connection arrivces. Must create + start a new component */
-private function CreateCallback(ASP_SCCP_N_CONNECT_ind conn_ind)
+private function CreateCallback(ASP_SCCP_N_CONNECT_ind conn_ind, charstring id)
runs on BSSMAP_Emulation_CT return BSSAP_ConnHdlr {
var MSC_ConnHdlr vc_conn;
/* Create a new BSSAP_ConnHdlr component */
- vc_conn := MSC_ConnHdlr.create;
+ vc_conn := MSC_ConnHdlr.create(g_bssmap_id & "-Conn-" & int2str(conn_ind.connectionId));
/* connect it to the port */
connect(vc_conn:BSSAP, self:CLIENT);
/* start it */
diff --git a/ipa/MSC_Simulation.ttcn b/ipa/MSC_Simulation.ttcn
index 0198350..21596f6 100755
--- a/ipa/MSC_Simulation.ttcn
+++ b/ipa/MSC_Simulation.ttcn
@@ -31,12 +31,12 @@
function main(charstring local_ip, PortNumber local_port,
MSC_SCCP_MTP3_parameters sccp_pars,
- SCCP_PAR_Address sccp_addr_own) runs on MSC_CT
+ SCCP_PAR_Address sccp_addr_own, charstring id) runs on MSC_CT
{
/* create components */
- vc_IPA := IPA_Emulation_CT.create;
- vc_SCCP := SCCP_CT.create;
- vc_BSSMAP := BSSMAP_Emulation_CT.create;
+ vc_IPA := IPA_Emulation_CT.create(id & "-IPA");
+ vc_SCCP := SCCP_CT.create(id & "-SCCP");
+ vc_BSSMAP := BSSMAP_Emulation_CT.create(id & "-BSSMAP");
map(vc_IPA:IPA_PORT, system:IPA_CODEC_PT);
@@ -51,7 +51,7 @@
vc_IPA.start(IPA_Emulation.main_server(local_ip, local_port));
vc_SCCP.start(SCCPStart(sccp_pars));
- vc_BSSMAP.start(BSSMAP_Emulation.main(MSC_BssmapOps));
+ vc_BSSMAP.start(BSSMAP_Emulation.main(MSC_BssmapOps, id & "-BSSMAP"));
/* wait until termination of respective components */
vc_IPA.done;