Change in osmo-ttcn3-hacks[master]: Ensure BcdMccMnc is encoded as 24.008 10.5.5.15

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

lynxis lazus gerrit-no-reply at lists.osmocom.org
Fri Apr 12 14:42:17 UTC 2019


lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/13619


Change subject: Ensure BcdMccMnc is encoded as 24.008 10.5.5.15
......................................................................

Ensure BcdMccMnc is encoded as 24.008 10.5.5.15

PCU is using BcdMccMnc as it's encoded as 24.008.
But SGSN code is using it as it would be byte by byte
sorted.

Fixes: OS#3878
Change-Id: Ie8f67f16f18e4c5090bc5a4c46a866a7e7e00206
---
M library/L3_Common.ttcn
M library/Osmocom_Gb_Types.ttcn
M sgsn/SGSN_Tests.ttcn
3 files changed, 9 insertions(+), 7 deletions(-)



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

diff --git a/library/L3_Common.ttcn b/library/L3_Common.ttcn
index 57db6b3..01f0a34 100644
--- a/library/L3_Common.ttcn
+++ b/library/L3_Common.ttcn
@@ -106,9 +106,9 @@
 		  rai.mccDigit1
 		& rai.mccDigit2
 		& rai.mccDigit3
+		& rai.mncDigit3
 		& rai.mncDigit1
-		& rai.mncDigit2
-		& rai.mncDigit3;
+		& rai.mncDigit2;
 	return plmn;
 }
 
diff --git a/library/Osmocom_Gb_Types.ttcn b/library/Osmocom_Gb_Types.ttcn
index 95d3028..55a2816 100644
--- a/library/Osmocom_Gb_Types.ttcn
+++ b/library/Osmocom_Gb_Types.ttcn
@@ -868,8 +868,8 @@
 				ret.mccDigit2 := cid.ra_id.lai.mcc_mnc[1];
 				ret.mccDigit3 := cid.ra_id.lai.mcc_mnc[2];
 				ret.mncDigit3 := cid.ra_id.lai.mcc_mnc[3];
-				ret.mncDigit2 := cid.ra_id.lai.mcc_mnc[5];
 				ret.mncDigit1 := cid.ra_id.lai.mcc_mnc[4];
+				ret.mncDigit2 := cid.ra_id.lai.mcc_mnc[5];
 			}
 			if (isvalue(cid.ra_id.lai.lac)) {
 				ret.lac := f_oct_or_wc(cid.ra_id.lai.lac, 2);
diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn
index 8b639e6..74cdece 100644
--- a/sgsn/SGSN_Tests.ttcn
+++ b/sgsn/SGSN_Tests.ttcn
@@ -137,15 +137,16 @@
 };
 
 private function f_cellid_to_RAI(in BssgpCellId cell_id) return RoutingAreaIdentificationV {
+	/* mcc_mnc is encoded as of 24.008 10.5.5.15 */
 	var BcdMccMnc mcc_mnc := cell_id.ra_id.lai.mcc_mnc;
 
         var RoutingAreaIdentificationV ret := {
                 mccDigit1 := mcc_mnc[0],
                 mccDigit2 := mcc_mnc[1],
                 mccDigit3 := mcc_mnc[2],
-                mncDigit3 := mcc_mnc[5],
-                mncDigit1 := mcc_mnc[3],
-                mncDigit2 := mcc_mnc[4],
+                mncDigit3 := mcc_mnc[3],
+                mncDigit1 := mcc_mnc[4],
+                mncDigit2 := mcc_mnc[5],
                 lac := int2oct(cell_id.ra_id.lai.lac, 16),
                 rac := int2oct(cell_id.ra_id.rac, 8)
         }
@@ -225,7 +226,8 @@
 }
 
 
-function f_init(BcdMccMnc mcc_mnc := '26242F'H) runs on test_CT {
+/* mcc_mnc is 24.008 10.5.5.15 encoded. 262 42 */
+function f_init(BcdMccMnc mcc_mnc := '262F42'H) runs on test_CT {
 	if (g_initialized == true) {
 		return;
 	}

-- 
To view, visit https://gerrit.osmocom.org/13619
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie8f67f16f18e4c5090bc5a4c46a866a7e7e00206
Gerrit-Change-Number: 13619
Gerrit-PatchSet: 1
Gerrit-Owner: lynxis lazus <lynxis at fe80.eu>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190412/f2326e95/attachment.htm>


More information about the gerrit-log mailing list