bscnat: Refactor MSC side code to allow different actions per test
Each test can now plug in different acctions to be done by the emulated
MSC, by passing a BssmapCreateCallback RAN_Emaulation callback to
f_init(). Old hardcoded behaviour (main()) is renamed and used in
laready existing tests.
New infrastructure provides a generic BssmapCreateCallback taking care
of required boilerplate, so new tests/users only need to define a new
callback calling that generic one with a function pointer where all test
logic is implemented.
Change-Id: Ic429420d0d95b6aacb6e5c44031b49c942ed544d
diff --git a/bsc-nat/MSC_Simulation.ttcn b/bsc-nat/MSC_Simulation.ttcn
index bc47f89..14229cc 100755
--- a/bsc-nat/MSC_Simulation.ttcn
+++ b/bsc-nat/MSC_Simulation.ttcn
@@ -38,7 +38,8 @@
function main(charstring local_ip, PortNumber local_port,
MSC_SCCP_MTP3_parameters sccp_pars,
- SCCP_PAR_Address sccp_addr_own, charstring id) runs on MSC_CT
+ SCCP_PAR_Address sccp_addr_own,
+ BssmapCreateCallback cb, charstring id) runs on MSC_CT
{
/* create components */
vc_IPA := IPA_Emulation_CT.create(id & "-IPA");
@@ -64,7 +65,10 @@
vc_IPA.start(IPA_Emulation.main_server(local_ip, local_port));
vc_SCCP.start(SCCPStart(sccp_pars));
- vc_BSSMAP.start(RAN_Emulation.main(MSC_ConnectionHandler.MSC_RanOps, id & "-BSSMAP"));
+
+ var RanOps ranops := MSC_ConnectionHandler.MSC_RanOps;
+ ranops.create_cb := cb;
+ vc_BSSMAP.start(RAN_Emulation.main(ranops, id & "-BSSMAP"));
/* wait until termination of respective components */
vc_IPA.done;