Change in ...osmo-ttcn3-hacks[master]: BSSGP_Emulation: add BssgpDecodeDepth

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/.

osmith gerrit-no-reply at lists.osmocom.org
Mon Sep 2 07:22:54 UTC 2019


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


Change subject: BSSGP_Emulation: add BssgpDecodeDepth
......................................................................

BSSGP_Emulation: add BssgpDecodeDepth

Make the decoding level (BSSGP, LLC, SNDCP, L3) configurable, so the
existing PCU tests, that expect messages only decoded to the BSSGP
level, can pass again. Move the SNDCP decoding in f_dec_bssgp above the
L3 decoding, so f_dec_bssgp goes through the layers in the reverse order
of f_send_bssgp_dec.

I have verified, that all testsuites using the BSSGP Emulation (SGSN,
PCU, PCU-SNS) are still working with this patch.

Related: OS#4180
Fixes: 955aa94504510139a12d223071cf49ef90788a3d ("BSSGP_Emulation: Abandon "BssgpDecoded" intermediate structure")
Change-Id: I8f76385528c1de98c557cee451c0e0dfd182b605
---
M library/BSSGP_Emulation.ttcn
M pcu/PCU_Tests.ttcn
M sgsn/SGSN_Tests.ttcn
3 files changed, 38 insertions(+), 19 deletions(-)



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

diff --git a/library/BSSGP_Emulation.ttcn b/library/BSSGP_Emulation.ttcn
index 44946c1..e3023ed 100644
--- a/library/BSSGP_Emulation.ttcn
+++ b/library/BSSGP_Emulation.ttcn
@@ -164,11 +164,19 @@
 	n_u_rx_last := -
 }
 
+type enumerated BssgpDecodeDepth {
+	BSSGP_DECODE_DEPTH_BSSGP,
+	BSSGP_DECODE_DEPTH_LLC,
+	BSSGP_DECODE_DEPTH_SNDCP,
+	BSSGP_DECODE_DEPTH_L3
+};
+
 type record BssgpConfig {
 	Nsvci nsei,
 	Nsvci bvci,
 	BssgpCellId cell_id,
-	boolean sgsn_role
+	boolean sgsn_role,
+	BssgpDecodeDepth depth
 };
 
 function f_BnsUdReq(template PDU_BSSGP pdu, BssgpBvci bvci)
@@ -706,25 +714,32 @@
 	};
 
 	/* Decode LLC, if it is a PDU that contains LLC */
-	if (ischosen(bssgp.pDU_BSSGP_DL_UNITDATA)) {
-		dec.llc := dec_PDU_LLC(bssgp.pDU_BSSGP_DL_UNITDATA.lLC_PDU.lLC_PDU);
-	} else if (ischosen(bssgp.pDU_BSSGP_UL_UNITDATA)) {
-		dec.llc := dec_PDU_LLC(bssgp.pDU_BSSGP_UL_UNITDATA.lLC_PDU.lLC_PDU);
-	}
-
-	/* Decode L3, if it is a LLC PDU containing L3 */
-	if (isvalue(dec.llc) and match(dec.llc, tr_LLC_UI_L3)) {
-		if (g_cfg.sgsn_role) {
-			dec.l3_mo := dec_PDU_L3_MS_SGSN(dec.llc.pDU_LLC_UI.information_field_UI);
-		} else {
-			dec.l3_mt := dec_PDU_L3_SGSN_MS(dec.llc.pDU_LLC_UI.information_field_UI);
+	if (g_cfg.depth >= BSSGP_DECODE_DEPTH_LLC) {
+		if (ischosen(bssgp.pDU_BSSGP_DL_UNITDATA)) {
+			dec.llc := dec_PDU_LLC(bssgp.pDU_BSSGP_DL_UNITDATA.lLC_PDU.lLC_PDU);
+		} else if (ischosen(bssgp.pDU_BSSGP_UL_UNITDATA)) {
+			dec.llc := dec_PDU_LLC(bssgp.pDU_BSSGP_UL_UNITDATA.lLC_PDU.lLC_PDU);
 		}
 	}
 
 	/* Decode SNDCP, if it is a LLC PDU containing user plane data */
-	if (isvalue(dec.llc) and match(dec.llc, tr_LLC_UI_USER)) {
-		dec.sndcp := dec_PDU_SN(dec.llc.pDU_LLC_UI.information_field_UI);
+	if (g_cfg.depth >= BSSGP_DECODE_DEPTH_SNDCP) {
+		if (isvalue(dec.llc) and match(dec.llc, tr_LLC_UI_USER)) {
+			dec.sndcp := dec_PDU_SN(dec.llc.pDU_LLC_UI.information_field_UI);
+		}
 	}
+
+	/* Decode L3, if it is a LLC PDU containing L3 */
+	if (g_cfg.depth >= BSSGP_DECODE_DEPTH_L3) {
+		if (isvalue(dec.llc) and match(dec.llc, tr_LLC_UI_L3)) {
+			if (g_cfg.sgsn_role) {
+				dec.l3_mo := dec_PDU_L3_MS_SGSN(dec.llc.pDU_LLC_UI.information_field_UI);
+			} else {
+				dec.l3_mt := dec_PDU_L3_SGSN_MS(dec.llc.pDU_LLC_UI.information_field_UI);
+			}
+		}
+	}
+
 	return dec;
 }
 
diff --git a/pcu/PCU_Tests.ttcn b/pcu/PCU_Tests.ttcn
index a88dfed..0f43f28 100644
--- a/pcu/PCU_Tests.ttcn
+++ b/pcu/PCU_Tests.ttcn
@@ -44,7 +44,8 @@
 			},
 			cell_id := 20960
 		},
-		sgsn_role := true
+		sgsn_role := true,
+		depth := BSSGP_DECODE_DEPTH_BSSGP
 	};
 
 	NSConfiguration mp_nsconfig := {
diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn
index db7d54b..b68df85 100644
--- a/sgsn/SGSN_Tests.ttcn
+++ b/sgsn/SGSN_Tests.ttcn
@@ -286,7 +286,8 @@
 				},
 			cell_id := 20960
 		},
-		sgsn_role := false
+		sgsn_role := false,
+		depth := BSSGP_DECODE_DEPTH_L3
 	};
 	g_gb[1].cfg := {
 		nsei := 97,
@@ -299,7 +300,8 @@
 				},
 			cell_id := 20961
 		},
-		sgsn_role := false
+		sgsn_role := false,
+		depth := BSSGP_DECODE_DEPTH_L3
 	};
 	g_gb[2].cfg := {
 		nsei := 98,
@@ -312,7 +314,8 @@
 				},
 			cell_id := 20962
 		},
-		sgsn_role := false
+		sgsn_role := false,
+		depth := BSSGP_DECODE_DEPTH_L3
 	};
 
 	f_init_vty();

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15377
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: I8f76385528c1de98c557cee451c0e0dfd182b605
Gerrit-Change-Number: 15377
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190902/a078b1d2/attachment.htm>


More information about the gerrit-log mailing list