Change in osmo-ttcn3-hacks[master]: BSSGP_Emulation: reo-rder altsteps of per-NSE component

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
Fri Nov 27 18:14:25 UTC 2020


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


Change subject: BSSGP_Emulation: reo-rder altsteps of per-NSE component
......................................................................

BSSGP_Emulation: reo-rder altsteps of per-NSE component

the existing ordering of altsteps unfortunately caused some
receive clauses never to be hit, as they are only in the default
altstep, while more generic receive clauses are already in the
state-specific altsteps.

Let's introduce an as_allstate_pre() and an as_allstate_post() to
solve this ordering problem.

Change-Id: Icc4da95833557931d6685826fb30bdc60bf460c1
---
M library/BSSGP_Emulation.ttcnpp
1 file changed, 67 insertions(+), 26 deletions(-)



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

diff --git a/library/BSSGP_Emulation.ttcnpp b/library/BSSGP_Emulation.ttcnpp
index a6bdbb5..a65dd87 100644
--- a/library/BSSGP_Emulation.ttcnpp
+++ b/library/BSSGP_Emulation.ttcnpp
@@ -397,14 +397,65 @@
 
 }
 
-/* handling of events irrespective of BVC state */
-altstep as_sig_allstate() runs on BSSGP_CT {
+/* handling of events irrespective of BVC state (before state-specific handling) */
+altstep as_sig_allstate_pre() runs on BSSGP_CT {
+	var NsUnitdataIndication udi;
+
+	/* Respond to RESET for signalling BVCI 0 */
+	[] BSCP.receive(f_BnsUdInd(tr_BVC_RESET(?, 0, omit), 0)) -> value udi {
+		log("Rx BVC-RESET for Signaling BVCI=0");
+		if (MGMT.checkstate("Connected")) {
+			MGMT.send(BssgpResetIndication:{0});
+		}
+		BSCP.send(f_BnsUdReq(ts_BVC_RESET_ACK(0, omit), 0, 0));
+		for (var integer i := 0; i < sizeof(BvcTable); i := i+1) {
+			if (isbound(BvcTable[i].comp_ref) and BvcTable[i].comp_ref != null) {
+				BVC.send(BssgpResetIndication:{0}) to BvcTable[i].comp_ref;
+			}
+		}
+	}
+
+	/* any BLOCK or UNBLOCK for the SIGNALING BVCI are illegal */
+	[] BSCP.receive(f_BnsUdInd(t_BVC_BLOCK(0, ?), 0)) -> value udi {
+		setverdict(fail, "Rx BVC-BLOCK illegal for BVCI=0: ", udi);
+	}
+	[] BSCP.receive(f_BnsUdInd(t_BVC_UNBLOCK(0), 0)) -> value udi {
+		setverdict(fail, "Rx BVC-UNBLOCK illegal for BVCI=0: ", udi);
+	}
+	[] BSCP.receive(f_BnsUdInd(t_BVC_BLOCK_ACK(0), 0)) -> value udi {
+		setverdict(fail, "Rx BVC-BLOCK-ACK illegal for BVCI=0: ", udi);
+	}
+	[] BSCP.receive(f_BnsUdInd(t_BVC_UNBLOCK_ACK(0), 0)) -> value udi {
+		setverdict(fail, "Rx BVC-UNBLOCK-ACK illegal for BVCI=0: ", udi);
+	}
+
+	/* BVC-RESET-ACK for BVCI=0 while T2 is running: Answer to a BVC-RESET we sent earlier */
+	[g_T2.running] BSCP.receive(f_BnsUdInd(tr_BVC_RESET_ACK(0, omit), 0)) -> value udi {
+		log("BVCI(0) Rx BVC-RESET-ACK");
+		g_T2.stop;
+		f_sign_change_state(BVC_S_UNBLOCKED);
+		for (var integer i := 0; i < sizeof(BvcTable); i := i+1) {
+			if (isbound(BvcTable[i].comp_ref) and BvcTable[i].comp_ref != null) {
+				BVC.send(BssgpResetIndication:{0}) to BvcTable[i].comp_ref;
+			}
+		}
+	}
+	[] g_T2.timeout {
+		setverdict(fail, "Timeout waiting for BVC-RESET-ACK on BVCI=0");
+		BSCP.send(f_BnsUdReq(ts_BSSGP_STATUS(udi.bvci, BSSGP_CAUSE_BVCI_UNKNOWN, udi.bssgp), 0, 0));
+		g_T2.start;
+	}
+}
+
+/* handling of events irrespective of BVC state (after state-specific handling) */
+altstep as_sig_allstate_post() runs on BSSGP_CT {
 	var BSSGP_Client_CT vc_conn;
 	var NsUnitdataIndication udi;
 	var NsStatusIndication nsi;
 	var ASP_Event evt;
 	var BSSGP_BVC_CT bvc_comp_ref;
 	var BssgpBvci bvci;
+	var BssgpResetRequest brr;
 
 	/* Respond to RESET for signalling BVCI 0 */
 	[] BSCP.receive(f_BnsUdInd(tr_BVC_RESET(?, 0, omit), 0)) -> value udi {
@@ -447,29 +498,6 @@
 		BSCP.send(f_BnsUdReq(ts_BSSGP_STATUS(ptp_bvci, BSSGP_CAUSE_BVCI_UNKNOWN, udi.bssgp), 0, 0));
 	}
 
-	/* BVC-RESET-ACK for BVCI=0 while T2 is running: Answer to a BVC-RESET we sent earlier */
-	[g_T2.running] BSCP.receive(f_BnsUdInd(tr_BVC_RESET_ACK(0, omit), 0)) -> value udi {
-		log("BVCI(0) Rx BVC-RESET-ACK");
-		g_T2.stop;
-		f_sign_change_state(BVC_S_UNBLOCKED);
-		for (var integer i := 0; i < sizeof(BvcTable); i := i+1) {
-			if (isbound(BvcTable[i].comp_ref) and BvcTable[i].comp_ref != null) {
-				BVC.send(BssgpResetIndication:{0}) to BvcTable[i].comp_ref;
-			}
-		}
-	}
-	[] g_T2.timeout {
-		setverdict(fail, "Timeout waiting for BVC-RESET-ACK on BVCI=0");
-		BSCP.send(f_BnsUdReq(ts_BSSGP_STATUS(udi.bvci, BSSGP_CAUSE_BVCI_UNKNOWN, udi.bssgp), 0, 0));
-		g_T2.start;
-	}
-
-	/* default case of handling unknown PDUs */
-	[] BSCP.receive(f_BnsUdInd(?, ?)) -> value udi {
-		setverdict(fail, "Rx Unexpected BSSGP PDU ", udi.bssgp,"  in state ", g_sign_bvc_state);
-		BSCP.send(f_BnsUdReq(ts_BSSGP_STATUS(0, BSSGP_CAUSE_PDU_NOT_COMPATIBLE_WITH_PROTOCOL_STATE, udi.bssgp), 0, 0));
-	}
-
 	/* Forwarding of ASP_Event to per-BVC components */
 	[] BSCP.receive(ASP_Event:?) -> value evt {
 		for (var integer i := 0; i < sizeof(BvcTable); i := i+1) {
@@ -494,6 +522,17 @@
 			}
 		}
 	}
+
+	/* default case of handling unknown PDUs */
+	[] BSCP.receive(f_BnsUdInd(?, ?)) -> value udi {
+		setverdict(fail, "Rx Unexpected BSSGP PDU ", udi.bssgp,"  in state ", g_sign_bvc_state);
+		BSCP.send(f_BnsUdReq(ts_BSSGP_STATUS(0, BSSGP_CAUSE_PDU_NOT_COMPATIBLE_WITH_PROTOCOL_STATE, udi.bssgp), 0, 0));
+	}
+
+	[] MGMT.receive(BssgpResetRequest:?) -> value brr {
+		BSCP.send(f_BnsUdReq(ts_BVC_RESET(brr.cause, 0, omit), 0, 0));
+		g_T2.start;
+		}
 }
 
 /* send the highest decoded layer of the message through given port */
@@ -552,9 +591,11 @@
 	while (true) {
 		alt {
 		[g_sign_bvc_state == BVC_S_WAIT_RESET] as_sig_wait_reset();
+		[] as_sig_allstate_pre();
 		[g_sign_bvc_state == BVC_S_WAIT_NS_ALIVE_UNBLOCKED] as_sig_wait_ns_alive_unblocked();
 		[g_sign_bvc_state == BVC_S_UNBLOCKED] as_sig_unblocked();
-		[] as_sig_allstate();
+		[g_sign_bvc_state == BVC_S_WAIT_RESET] as_sig_wait_reset();
+		[] as_sig_allstate_post();
 		}
 	} /* while */
 }

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/21389
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: Icc4da95833557931d6685826fb30bdc60bf460c1
Gerrit-Change-Number: 21389
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20201127/8f2ffdb2/attachment.htm>


More information about the gerrit-log mailing list