Change in osmo-ttcn3-hacks[master]: bsc: Add Lb interface support

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Tue Oct 13 08:43:11 UTC 2020


laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/20365 )

Change subject: bsc: Add Lb interface support
......................................................................

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: Id41246f0dd812f7ddee9d920bfd07a4e3aac3504
---
M bsc/BSC_Tests.ttcn
M bsc/MSC_ConnectionHandler.ttcn
M bsc/gen_links.sh
3 files changed, 55 insertions(+), 2 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  fixeria: Looks good to me, but someone else must approve
  Jenkins Builder: Verified



diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index df4b45e..8adf113 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;
@@ -530,8 +532,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;
@@ -605,6 +609,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) */
@@ -1066,6 +1081,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);
 
@@ -3095,6 +3118,7 @@
  ***********************************************************************/
 
 import from RAN_Emulation all;
+import from BSSAP_LE_Emulation all;
 import from RSL_Emulation all;
 import from MSC_ConnectionHandler all;
 
@@ -3115,6 +3139,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 3d6538a..3e58f5a 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;
@@ -430,7 +433,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;
 
@@ -491,6 +494,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),
@@ -503,6 +520,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

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/20365
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Id41246f0dd812f7ddee9d920bfd07a4e3aac3504
Gerrit-Change-Number: 20365
Gerrit-PatchSet: 4
Gerrit-Owner: neels <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20201013/2eef5e0f/attachment.htm>


More information about the gerrit-log mailing list