Change in osmo-ttcn3-hacks[master]: library: fix Repeated Page Info IE in PacketPagingReq

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

fixeria gerrit-no-reply at lists.osmocom.org
Fri Oct 30 22:52:51 UTC 2020


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


Change subject: library: fix Repeated Page Info IE in PacketPagingReq
......................................................................

library: fix Repeated Page Info IE in PacketPagingReq

Change-Id: I39e8e3991cc248602460b7f162a0b57c2925315f
Related: OS#4838
---
M library/RLCMAC_CSN1_Types.ttcn
M library/RLCMAC_Templates.ttcn
M pcu/GPRS_Components.ttcn
M pcu/PCU_Tests.ttcn
4 files changed, 28 insertions(+), 9 deletions(-)



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

diff --git a/library/RLCMAC_CSN1_Types.ttcn b/library/RLCMAC_CSN1_Types.ttcn
index cc1ae22..5ef7c44 100644
--- a/library/RLCMAC_CSN1_Types.ttcn
+++ b/library/RLCMAC_CSN1_Types.ttcn
@@ -416,18 +416,22 @@
 	} with {
 		variant "TAG(ps, presence = '0'B; cs, presence = '1'B)"
 	};
+	type record RepeatedPageInfoItem {
+		BIT1			presence,
+		PageInfo		item
+	} with { variant "PRESENCE(presence = '1'B)" };
+	type record of RepeatedPageInfoItem RepeatedPageInfo;
 	type record PacketPagingReq {
 		PageMode		page_mode,
 		BIT1			persistence_levels_present,
 		PersistenceLevels	persistence_levels optional,
 		BIT1			nln_present,
 		uint2_t			nln optional,
-		BIT1			repeated_pageinfo_present,
-		PageInfo		repeated_pageinfo optional
+		RepeatedPageInfo	repeated_pageinfo optional,
+		BIT1			repeated_pageinfo_term ('0'B)
 	} with {
 		variant (persistence_levels) "PRESENCE(persistence_levels_present = '1'B)"
 		variant (nln) "PRESENCE(nln_present = '1'B)"
-		variant (repeated_pageinfo) "PRESENCE(repeated_pageinfo_present = '1'B)"
 	};
 
 	/* 12.26 Extension Bits IE  */
diff --git a/library/RLCMAC_Templates.ttcn b/library/RLCMAC_Templates.ttcn
index 5bdc17d..edf6516 100644
--- a/library/RLCMAC_Templates.ttcn
+++ b/library/RLCMAC_Templates.ttcn
@@ -642,8 +642,8 @@
 						persistence_levels := *,
 						nln_present := ?,
 						nln := *,
-						repeated_pageinfo_present := ?,
-						repeated_pageinfo := *
+						repeated_pageinfo := *,
+						repeated_pageinfo_term := '0'B
 					}
 				}
 			}
diff --git a/pcu/GPRS_Components.ttcn b/pcu/GPRS_Components.ttcn
index 2807b92..38fcf4e 100644
--- a/pcu/GPRS_Components.ttcn
+++ b/pcu/GPRS_Components.ttcn
@@ -852,11 +852,25 @@
 
 function f_pkt_paging_match_tmsi(in PacketPagingReq req, template GsmTmsi tmsi)
 runs on MS_BTS_IFACE_CT {
-	if (not match(req.repeated_pageinfo.cs.tmsi, tmsi)) {
-		setverdict(fail, "Mobile Identity (TMSI/P-TMSI) mismatch: ",
-			   "expected: ", tmsi, "got: ", req.repeated_pageinfo.cs.tmsi);
+	if (not ispresent(req.repeated_pageinfo)) {
+		setverdict(fail, "Packet Paging Request without MIs?!?");
 		f_shutdown(__BFILE__, __LINE__);
 	}
+
+	for (var integer i := 0; i < lengthof(req.repeated_pageinfo); i := i + 1) {
+		var PageInfo info := req.repeated_pageinfo[i].item;
+		if (not ischosen(info.cs))
+			{ continue; }
+
+		if (match(info.cs.tmsi, tmsi)) {
+			setverdict(pass);
+			return;
+		}
+	}
+
+	setverdict(fail, "Mobile Identity (TMSI/P-TMSI) ", tmsi,
+		   " is not present in ", req.repeated_pageinfo);
+	f_shutdown(__BFILE__, __LINE__);
 }
 
 }
diff --git a/pcu/PCU_Tests.ttcn b/pcu/PCU_Tests.ttcn
index ea3e6ba..4888855 100644
--- a/pcu/PCU_Tests.ttcn
+++ b/pcu/PCU_Tests.ttcn
@@ -1702,7 +1702,8 @@
 
 private function f_pkt_paging_match_imsi(in PacketPagingReq req, hexstring imsi)
 runs on RAW_PCU_Test_CT {
-	var MobileIdentityLV_Paging mi_lv := req.repeated_pageinfo.cs.mobile_identity;
+	var PageInfo info := req.repeated_pageinfo[0].item;
+	var MobileIdentityLV_Paging mi_lv := info.cs.mobile_identity;
 	var MobileIdentityV mi := dec_MobileIdentityV(mi_lv.mobile_id);
 
 	if (mi_lv.len != 8) { /* 8 octets: type of ID (3 bits) + even/odd flag (1 bit) + 15 BCD-encoded digits (60 bits) */

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


More information about the gerrit-log mailing list