bsc: Add Lb interface support
This introduces the Lb interface stack, which allows BSC_Tests.ttcn
to emulate a SMLC towards the BSC.
In accordance with https://osmocom.org/projects/cellular-infrastructure/wiki/Point_Codes
we use 0.23.6 as point code for emulating the SMLC.
Change-Id: I854618cc08de1a716784f52542a4df3c7f7ad900
diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index dce9ae9..ffc92ad 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -28,6 +28,8 @@
import from BSSAP_Types all;
import from RAN_Adapter all;
+import from BSSAP_LE_Adapter all;
+import from BSSAP_LE_CodecPort all;
import from BSSAP_CodecPort all;
import from BSSMAP_Templates all;
import from IPA_Emulation all;
@@ -480,8 +482,10 @@
var StatsD_Checker_CT vc_STATSD;
var RAN_Adapter g_bssap[NUM_MSC];
+ var BSSAP_LE_Adapter g_bssap_le;
/* for old legacy-tests only */
port BSSAP_CODEC_PT BSSAP;
+ port BSSAP_LE_CODEC_PT BSSAP_LE;
/* are we initialized yet */
var boolean g_initialized := false;
@@ -553,6 +557,17 @@
}
};
+ BSSAP_LE_Configuration mp_bssap_le_cfg := {
+ sccp_service_type := "mtp3_itu",
+ sctp_addr := { 23908, "127.0.0.1", 2905, "127.0.0.1" },
+ own_pc := 6, /* 0.0.6 SMLC emulation */
+ own_ssn := 252, /* SMLC side SSN */
+ peer_pc := 187, /* 0.23.3 osmo-bsc */
+ peer_ssn := 250, /* BSC side SSN */
+ sio := '83'O,
+ rctx := 6
+ };
+
/* Whether to enable osmux tests. Can be dropped completely and enable
unconditionally once new version of osmo-bsc is released (current
version: 1.4.1) */
@@ -928,6 +943,14 @@
}
}
+ if (handler_mode) {
+ f_bssap_le_adapter_init(g_bssap_le, mp_bssap_le_cfg, "VirtSMLC", SMLC_BssapLeOps);
+ } else {
+ f_bssap_le_adapter_init(g_bssap_le, mp_bssap_le_cfg, "VirtSMLC", omit);
+ connect(self:BSSAP_LE, g_bssap_le.vc_SCCP:SCCP_SP_PORT);
+ }
+ f_bssap_le_adapter_start(g_bssap_le);
+
/* start the test with exactly all enabled MSCs allowed to attach */
f_vty_msc_allow_attach(BSCVTY, allow_attach);
@@ -2878,6 +2901,7 @@
***********************************************************************/
import from RAN_Emulation all;
+import from BSSAP_LE_Emulation all;
import from RSL_Emulation all;
import from MSC_ConnectionHandler all;
@@ -2898,6 +2922,7 @@
connect(vc_conn:RSL2_PROC, bts[2].rsl.vc_RSL:RSL_PROC);
}
connect(vc_conn:BSSAP, g_bssap[bssap_idx].vc_RAN:CLIENT);
+ connect(vc_conn:BSSAP_LE, g_bssap_le.vc_BSSAP_LE:CLIENT);
connect(vc_conn:MGCP, vc_MGCP:MGCP_CLIENT);
connect(vc_conn:MGCP_MULTI, vc_MGCP:MGCP_CLIENT_MULTI);
connect(vc_conn:STATSD_PROC, vc_STATSD:STATSD_PROC);
diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn
index bf96eff..f02cfb4 100644
--- a/bsc/MSC_ConnectionHandler.ttcn
+++ b/bsc/MSC_ConnectionHandler.ttcn
@@ -19,6 +19,9 @@
import from SCCPasp_Types all;
import from BSSAP_Types all;
import from RAN_Emulation all;
+import from BSSAP_LE_Emulation all;
+import from BSSAP_LE_Types all;
+import from BSSMAP_LE_Templates all;
import from BSSMAP_Templates all;
import from IPL4asp_Types all;
@@ -411,7 +414,7 @@
/* this component represents a single subscriber connection at the MSC.
* There is a 1:1 mapping between SCCP connections and RAN_ConnHdlr components.
* We inherit all component variables, ports, functions, ... from RAN_ConnHdlr */
-type component MSC_ConnHdlr extends RAN_ConnHdlr, RSL_DchanHdlr, MGCP_ConnHdlr, StatsD_ConnHdlr {
+type component MSC_ConnHdlr extends RAN_ConnHdlr, RSL_DchanHdlr, MGCP_ConnHdlr, BSSAP_LE_ConnHdlr, StatsD_ConnHdlr {
/* SCCP Connecction Identifier for the underlying SCCP connection */
var integer g_sccp_conn_id;
@@ -470,6 +473,20 @@
return resp;
}
+/* Callback function from general BSSAP_LE_Emulation whenever a connectionless
+ * BSSAP_LE message arrives. Can return a PDU_BSSAP_LE that should be sent in return */
+private function BSSAP_LE_UnitdataCallback(PDU_BSSAP_LE bssap)
+runs on BSSAP_LE_Emulation_CT return template PDU_BSSAP_LE {
+ var template PDU_BSSAP_LE resp := omit;
+
+ /* answer all RESET with a RESET ACK */
+ if (match(bssap, tr_BSSMAP_LE_Reset)) {
+ resp := ts_BSSMAP_LE_ResetAck;
+ }
+
+ return resp;
+}
+
const RanOps MSC_RanOps := {
create_cb := refers(RAN_Emulation.ExpectedCreateCallback),
unitdata_cb := refers(UnitdataCallback),
@@ -482,6 +499,15 @@
sccp_addr_peer := omit
}
+const BssapLeOps SMLC_BssapLeOps := {
+ create_cb := refers(BSSAP_LE_Emulation.ExpectedCreateCallback),
+ unitdata_cb := refers(BSSAP_LE_UnitdataCallback),
+ decode_dtap := false,
+ role_ms := false,
+ sccp_addr_local := omit,
+ sccp_addr_peer := omit
+}
+
const MGCPOps MSC_MGCPOps := {
create_cb := refers(MGCP_Emulation.ExpectedCreateCallback),
unitdata_cb := refers(MGCP_Emulation.DummyUnitdataCallback)
diff --git a/bsc/gen_links.sh b/bsc/gen_links.sh
index 02e093d..f316509 100755
--- a/bsc/gen_links.sh
+++ b/bsc/gen_links.sh
@@ -70,7 +70,9 @@
FILES="Misc_Helpers.ttcn General_Types.ttcn Osmocom_Types.ttcn GSM_Types.ttcn Osmocom_VTY_Functions.ttcn Native_Functions.ttcn Native_FunctionDefs.cc IPA_Types.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc IPA_Emulation.ttcnpp L3_Templates.ttcn BSSMAP_Templates.ttcn RAN_Emulation.ttcnpp RLCMAC_CSN1_Templates.ttcn RLCMAC_CSN1_Types.ttcn GSM_RR_Types.ttcn RSL_Types.ttcn RSL_Emulation.ttcn MGCP_Emulation.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn MGCP_CodecPort.ttcn MGCP_CodecPort_CtrlFunct.ttcn MGCP_CodecPort_CtrlFunctDef.cc BSSAP_CodecPort.ttcn RAN_Adapter.ttcnpp Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn Osmocom_CTRL_Adapter.ttcn RTP_CodecPort.ttcn RTP_CodecPort_CtrlFunct.ttcn RTP_CodecPort_CtrlFunctDef.cc RTP_Emulation.ttcn IuUP_Types.ttcn IuUP_EncDec.cc IuUP_Emulation.ttcn SCCP_Templates.ttcn IPA_Testing.ttcn GSM_SystemInformation.ttcn GSM_RestOctets.ttcn "
FILES+="CBSP_Types.ttcn CBSP_Templates.ttcn "
FILES+="CBSP_CodecPort.ttcn CBSP_CodecPort_CtrlFunct.ttcn CBSP_CodecPort_CtrlFunctdef.cc CBSP_Adapter.ttcn "
-FILES+="StatsD_Types.ttcn StatsD_CodecPort.ttcn StatsD_CodecPort_CtrlFunct.ttcn StatsD_CodecPort_CtrlFunctdef.cc StatsD_Checker.ttcn"
+FILES+="StatsD_Types.ttcn StatsD_CodecPort.ttcn StatsD_CodecPort_CtrlFunct.ttcn StatsD_CodecPort_CtrlFunctdef.cc StatsD_Checker.ttcn "
+FILES+="BSSAP_LE_CodecPort.ttcn BSSAP_LE_Emulation.ttcn BSSAP_LE_Types.ttcn BSSAP_LE_Adapter.ttcn BSSLAP_Types.ttcn BSSMAP_LE_Templates.ttcn "
+
gen_links $DIR $FILES
ignore_pp_results