BSSAP_Adapter: De-couple from BSC-testing MSC_ConnectionHandler
... and pave the way from using it on the other side in MSC testing
Change-Id: I0095f7d24dd8b24f759e4c74a4e7856ec4503ed2
diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index 0080fe0..880b693 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -237,7 +237,11 @@
/* Call a function of our 'parent component' BSSAP_Adapter_CT to start the
* MSC-side BSSAP emulation */
- f_bssap_init("VirtMSC", handler_mode);
+ if (handler_mode) {
+ f_bssap_init("VirtMSC", MSC_BssmapOps);
+ } else {
+ f_bssap_init("VirtMSC", omit);
+ }
f_ipa_ctrl_start(ctrl, mp_bsc_ip, mp_bsc_ctrl_port, 0);
for (i := 0; i < nr_bts; i := i+1) {
diff --git a/bsc/BSSAP_Adapter.ttcn b/bsc/BSSAP_Adapter.ttcn
index 4268b29..98a30d8 100644
--- a/bsc/BSSAP_Adapter.ttcn
+++ b/bsc/BSSAP_Adapter.ttcn
@@ -24,8 +24,6 @@
import from BSSMAP_Templates all;
import from BSSMAP_Emulation all;
-import from MSC_ConnectionHandler all;
-
type component BSSAP_Adapter_CT {
/* component references */
var M3UA_CT vc_M3UA;
@@ -85,14 +83,14 @@
}
-function f_bssap_init(charstring id, boolean handler_mode := false) runs on BSSAP_Adapter_CT
+function f_bssap_init(charstring id, template BssmapOps ops) runs on BSSAP_Adapter_CT
{
init_pars();
/* create components */
vc_M3UA := M3UA_CT.create(id & "-M3UA");
vc_SCCP := SCCP_CT.create(id & "-SCCP");
- if (handler_mode) {
+ if (isvalue(ops)) {
vc_BSSMAP := BSSMAP_Emulation_CT.create(id & "-BSSMAP");
}
@@ -100,7 +98,7 @@
/* connect MTP3 service provider (M3UA) to lower side of SCCP */
connect(vc_M3UA:MTP3_SP_PORT, vc_SCCP:MTP3_SCCP_PORT);
- if (handler_mode) {
+ if (isvalue(ops)) {
connect(vc_BSSMAP:BSSAP, vc_SCCP:SCCP_SP_PORT);
} else {
/* connect BSSNAP dispatcher to upper side of SCCP */
@@ -109,8 +107,8 @@
vc_M3UA.start(f_M3UA_Emulation(mp_sctp_addr));
vc_SCCP.start(SCCPStart(g_sccp_pars));
- if (handler_mode) {
- vc_BSSMAP.start(BSSMAP_Emulation.main(MSC_BssmapOps, ""));
+ if (isvalue(ops)) {
+ vc_BSSMAP.start(BSSMAP_Emulation.main(valueof(ops), ""));
}
}