[MERGED] osmo-iuh[master]: ranap: make X.213 NSAP 160 bits long, zero padded

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Thu Feb 2 04:04:39 UTC 2017


Neels Hofmeyr has submitted this change and it was merged.

Change subject: ranap: make X.213 NSAP 160 bits long, zero padded
......................................................................


ranap: make X.213 NSAP 160 bits long, zero padded

For IPv4 addresses, only 56bit of X.213 NSAP are used. The sysmocell5000
accepts such a field that is 56bits long, but the ip.access nano3G does not
(and crashes instead). Both work when zero-padded to 160bits size.

So far we used to send the IPv4 address as "raw" 32bits to the nano3G to avoid
the crash. With this zero padding we no longer need such a workaround and can
use identical config for both cells.

Change-Id: I070bbfe887ab93d08322df30571050a381d082d5
---
M src/ranap_msg_factory.c
M src/tests/test-ranap.ok
2 files changed, 16 insertions(+), 12 deletions(-)



diff --git a/src/ranap_msg_factory.c b/src/ranap_msg_factory.c
index cd2ddfc..4634a07 100644
--- a/src/ranap_msg_factory.c
+++ b/src/ranap_msg_factory.c
@@ -639,7 +639,7 @@
 	unsigned int len;
 
 	if (use_x213_nsap) {
-		len = 7;
+		len = 160/8;
 		buf = CALLOC(len, sizeof(uint8_t));
 		buf[0] = 0x35;	/* AFI For IANA ICP */
 		buf[1] = 0x00;	/* See A.5.2.1.2.7 of X.213 */
diff --git a/src/tests/test-ranap.ok b/src/tests/test-ranap.ok
index dc959eb..bd44d33 100644
--- a/src/tests/test-ranap.ok
+++ b/src/tests/test-ranap.ok
@@ -90,8 +90,9 @@
     <firstValue>
         78 02 CD 80 10 2F A7 20 2F A8 00 00 F4 4C 08 0A 
         02 80 00 51 40 00 27 20 28 14 00 67 40 00 00 22 
-        28 14 00 3C 40 00 00 00 50 3D 02 00 02 0D C0 35 
-        00 01 0A 0B 0C 0D 40 09 26 00 00
+        28 14 00 3C 40 00 00 00 50 3D 02 00 02 27 C0 35 
+        00 01 0A 0B 0C 0D 00 00 00 00 00 00 00 00 00 00 
+        00 00 00 40 09 26 00 00
     </firstValue>
     <secondCriticality><ignore/></secondCriticality>
     <secondValue>00</secondValue>
@@ -100,14 +101,15 @@
     <id>54</id>
     <criticality><ignore/></criticality>
     <value>
-        00 00 01 00 35 00 3B 78 02 CD 80 10 2F A7 20 2F 
+        00 00 01 00 35 00 48 78 02 CD 80 10 2F A7 20 2F 
         A8 00 00 F4 4C 08 0A 02 80 00 51 40 00 27 20 28 
         14 00 67 40 00 00 22 28 14 00 3C 40 00 00 00 50 
-        3D 02 00 02 0D C0 35 00 01 0A 0B 0C 0D 40 09 26 
-        00 00 40 01 00
+        3D 02 00 02 27 C0 35 00 01 0A 0B 0C 0D 00 00 00 
+        00 00 00 00 00 00 00 00 00 00 40 09 26 00 00 40 
+        01 00
     </value>
 </RANAP_IE>
-00 00 00 4c 00 00 01 00 36 40 45 00 00 01 00 35 00 3b 78 02 cd 80 10 2f a7 20 2f a8 00 00 f4 4c 08 0a 02 80 00 51 40 00 27 20 28 14 00 67 40 00 00 22 28 14 00 3c 40 00 00 00 50 3d 02 00 02 0d c0 35 00 01 0a 0b 0c 0d 40 09 26 00 00 40 01 00 
+00 00 00 59 00 00 01 00 36 40 52 00 00 01 00 35 00 48 78 02 cd 80 10 2f a7 20 2f a8 00 00 f4 4c 08 0a 02 80 00 51 40 00 27 20 28 14 00 67 40 00 00 22 28 14 00 3c 40 00 00 00 50 3d 02 00 02 27 c0 35 00 01 0a 0b 0c 0d 00 00 00 00 00 00 00 00 00 00 00 00 00 40 09 26 00 00 40 01 00 
 
 ==> RAB ASSIGNMENT COMMAND (DATA)
 <RANAP_ProtocolIE-FieldPair>
@@ -116,7 +118,8 @@
     <firstValue>
         38 04 12 DE 18 69 FF 80 0C 34 FF 00 1F 40 08 06 
         08 9E 00 00 00 00 B1 40 05 60 01 8C BA 7F 00 00 
-        10 6E 35 00 01 1A 1B 1C 1D 00 11 22 33 44
+        11 3E 35 00 01 1A 1B 1C 1D 00 00 00 00 00 00 00 
+        00 00 00 00 00 00 00 11 22 33 44
     </firstValue>
     <secondCriticality><ignore/></secondCriticality>
     <secondValue>78 1C 00 00 00 00</secondValue>
@@ -125,13 +128,14 @@
     <id>54</id>
     <criticality><ignore/></criticality>
     <value>
-        00 00 01 00 35 00 2E 38 04 12 DE 18 69 FF 80 0C 
+        00 00 01 00 35 00 3B 38 04 12 DE 18 69 FF 80 0C 
         34 FF 00 1F 40 08 06 08 9E 00 00 00 00 B1 40 05 
-        60 01 8C BA 7F 00 00 10 6E 35 00 01 1A 1B 1C 1D 
-        00 11 22 33 44 40 06 78 1C 00 00 00 00
+        60 01 8C BA 7F 00 00 11 3E 35 00 01 1A 1B 1C 1D 
+        00 00 00 00 00 00 00 00 00 00 00 00 00 00 11 22 
+        33 44 40 06 78 1C 00 00 00 00
     </value>
 </RANAP_IE>
-00 00 00 44 00 00 01 00 36 40 3d 00 00 01 00 35 00 2e 38 04 12 de 18 69 ff 80 0c 34 ff 00 1f 40 08 06 08 9e 00 00 00 00 b1 40 05 60 01 8c ba 7f 00 00 10 6e 35 00 01 1a 1b 1c 1d 00 11 22 33 44 40 06 78 1c 00 00 00 00 
+00 00 00 51 00 00 01 00 36 40 4a 00 00 01 00 35 00 3b 38 04 12 de 18 69 ff 80 0c 34 ff 00 1f 40 08 06 08 9e 00 00 00 00 b1 40 05 60 01 8c ba 7f 00 00 11 3e 35 00 01 1a 1b 1c 1d 00 00 00 00 00 00 00 00 00 00 00 00 00 00 11 22 33 44 40 06 78 1c 00 00 00 00 
 
 ==> RESET CMD
 <RANAP_IE>

-- 
To view, visit https://gerrit.osmocom.org/1648
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I070bbfe887ab93d08322df30571050a381d082d5
Gerrit-PatchSet: 3
Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Holger Freyther <holger at freyther.de>
Gerrit-Reviewer: Jenkins Builder


More information about the gerrit-log mailing list