Change in ...osmo-ttcn3-hacks[master]: bsc: Only append Osmux IEs in BSSAP AoIP

pespin gerrit-no-reply at lists.osmocom.org
Thu Jun 6 15:16:35 UTC 2019


pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/14387


Change subject: bsc: Only append Osmux IEs in BSSAP AoIP
......................................................................

bsc: Only append Osmux IEs in BSSAP AoIP

Previous to this commit, BSSAP Reset (Ack) messages contained Osmux
Support IE even if transport was SCCPLite, where those IEs are actually
meaningless.

Change-Id: If6cc0f65a0f273297a4523e5d6a7564d966f0aa6
---
M bsc/MSC_ConnectionHandler.ttcn
M library/RAN_Emulation.ttcnpp
2 files changed, 20 insertions(+), 11 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/87/14387/1

diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn
index 3cc8f8a..c7f6495 100644
--- a/bsc/MSC_ConnectionHandler.ttcn
+++ b/bsc/MSC_ConnectionHandler.ttcn
@@ -379,10 +379,12 @@
 private function UnitdataCallback(PDU_BSSAP bssap)
 runs on RAN_Emulation_CT return template PDU_BSSAP {
 	var template PDU_BSSAP resp := omit;
+	var boolean append_osmux_support := g_ran_ops.use_osmux and
+					    (g_ran_ops.transport == BSSAP_TRANSPORT_AoIP);
 
 	/* answer all RESET with a RESET ACK */
-	if (match(bssap, tr_BSSMAP_Reset(g_ran_ops.use_osmux))) {
-		resp := ts_BSSMAP_ResetAck(g_ran_ops.use_osmux);
+	if (match(bssap, tr_BSSMAP_Reset(append_osmux_support))) {
+		resp := ts_BSSMAP_ResetAck(append_osmux_support);
 	}
 
 	return resp;
diff --git a/library/RAN_Emulation.ttcnpp b/library/RAN_Emulation.ttcnpp
index 85ae084..ba018b4 100644
--- a/library/RAN_Emulation.ttcnpp
+++ b/library/RAN_Emulation.ttcnpp
@@ -445,6 +445,11 @@
 type function BssmapUnitdataCallback(PDU_BSSAP bssap)
 runs on RAN_Emulation_CT return template PDU_BSSAP;
 
+private function append_osmux_ie()
+runs on RAN_Emulation_CT return boolean {
+	return g_ran_ops.use_osmux and (g_ran_ops.transport == BSSAP_TRANSPORT_AoIP);
+}
+
 /* handle common Unitdata such as Paging */
 private function CommonBssmapUnitdataCallback(PDU_BSSAP bssap)
 runs on RAN_Emulation_CT return template PDU_BSSAP {
@@ -469,14 +474,15 @@
 private function f_bssap_wait_for_reset() runs on RAN_Emulation_CT {
 	var BSSAP_N_UNITDATA_ind ud_ind;
 	timer T := 20.0;
+	var boolean append_osmux_support := append_osmux_ie();
 
 	T.start;
 	alt {
-	[] BSSAP.receive(tr_BSSAP_UNITDATA_ind(?, ?, tr_BSSMAP_Reset(g_ran_ops.use_osmux))) -> value ud_ind {
+	[] BSSAP.receive(tr_BSSAP_UNITDATA_ind(?, ?, tr_BSSMAP_Reset(append_osmux_support))) -> value ud_ind {
 		BSSAP.send(ts_BSSAP_UNITDATA_req(ud_ind.callingAddress, ud_ind.calledAddress,
-			   ts_BSSMAP_ResetAck(g_ran_ops.use_osmux)));
+			   ts_BSSMAP_ResetAck(append_osmux_support)));
 		}
-	[] as_reset_ack();
+	[] as_reset_ack(append_osmux_support);
 	[] BSSAP.receive {
 		repeat;
 		}
@@ -489,14 +495,15 @@
 
 function f_bssap_reset(SCCP_PAR_Address peer, SCCP_PAR_Address own) runs on RAN_Emulation_CT {
 	timer T := 5.0;
+	var boolean append_osmux_support := append_osmux_ie();
 
-	BSSAP.send(ts_BSSAP_UNITDATA_req(peer, own, ts_BSSMAP_Reset(0, g_ran_ops.use_osmux)));
+	BSSAP.send(ts_BSSAP_UNITDATA_req(peer, own, ts_BSSMAP_Reset(0, append_osmux_support)));
 	T.start;
 	alt {
-	[] BSSAP.receive(tr_BSSAP_UNITDATA_ind(own, peer, tr_BSSMAP_ResetAck(g_ran_ops.use_osmux))) {
+	[] BSSAP.receive(tr_BSSAP_UNITDATA_ind(own, peer, tr_BSSMAP_ResetAck(append_osmux_support))) {
 		log("Received RESET-ACK in response to RESET, we're ready to go!");
 		}
-	[] as_reset_ack();
+	[] as_reset_ack(append_osmux_support);
 	[] BSSAP.receive { repeat };
 	[] T.timeout {
 		setverdict(fail, "Timeout waiting for RESET-ACK after sending RESET");
@@ -728,7 +735,7 @@
 	f_ML3_patch_seq_nr(seq_nr, enc_l3);
 }
 
-private altstep as_reset_ack() runs on RAN_Emulation_CT {
+private altstep as_reset_ack(boolean append_osmux_support := false) runs on RAN_Emulation_CT {
 #ifdef RAN_EMULATION_BSSAP
 	var BSSAP_N_UNITDATA_ind ud_ind;
 #endif
@@ -736,10 +743,10 @@
 	var RANAP_N_UNITDATA_ind rud_ind;
 #endif
 #ifdef RAN_EMULATION_BSSAP
-	[] BSSAP.receive(tr_BSSAP_UNITDATA_ind(?, ?, tr_BSSMAP_Reset(g_ran_ops.use_osmux))) -> value ud_ind {
+	[] BSSAP.receive(tr_BSSAP_UNITDATA_ind(?, ?, tr_BSSMAP_Reset(append_osmux_support))) -> value ud_ind {
 		log("Respoding to inbound RESET with RESET-ACK");
 		BSSAP.send(ts_BSSAP_UNITDATA_req(ud_ind.callingAddress, ud_ind.calledAddress,
-			   ts_BSSMAP_ResetAck(g_ran_ops.use_osmux)));
+			   ts_BSSMAP_ResetAck(append_osmux_support)));
 		repeat;
 	}
 #endif

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/14387
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: If6cc0f65a0f273297a4523e5d6a7564d966f0aa6
Gerrit-Change-Number: 14387
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190606/5b91a94d/attachment.html>


More information about the gerrit-log mailing list