Change in osmo-ttcn3-hacks[master]: library/GSM_RR_Types.ttcn: fix: apply BYTEORDER(last) to field 'ext_ra'

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
Mon Apr 27 16:56:42 UTC 2020


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


Change subject: library/GSM_RR_Types.ttcn: fix: apply BYTEORDER(last) to field 'ext_ra'
......................................................................

library/GSM_RR_Types.ttcn: fix: apply BYTEORDER(last) to field 'ext_ra'

By default, the BYTEORDER for BIT1..N sub-types is set to 'first'.
This may result in incorrect decoding of bit-fields located on the
boundary of two octets. For example:

  IA Rest Octets
    L... .... = First Discriminator Bit: Low
    .H.. .... = Second Discriminator Bit: High
    ..0. .... = Discriminator bit: EGPRS Packet Uplink Assignment
    ...0 .... = Downlink/Uplink: EGPRS Packet Uplink Assignment
    EGPRS Packet Uplink Assignment
      .... 0001  1... .... = Extended_RA: 3  // <------------ (!)
      .0.. .... = Access Technologies Request: Not Present
      ..1. .... = TFI/Multiblock: TFI Assignment Present
      ...0 0000 = TFI_Assignment: 0

As can be seen, the field 'Extended_RA' in this particular case
occupies 4 LSBs of the first octet and 1 MSB of the second. So
instead of '00011'B, TITAN's RAW codec decodes '10001'B.

Unfortunaly there is no way to use BYTEORDER(last) to the whole
record or the whole file, so we may run into a similar problem
with basically any other field of size >= 2 (BIT2..N). Let's
fix at least 'ext_ra' for now as it's to be checked in the
test cases introduced in the follow up changes.

For more details, see:

https://www.eclipse.org/forums/index.php/m/1826511/
https://bugs.eclipse.org/bugs/show_bug.cgi?id=562488

Change-Id: I481a40daef3eed4a3daa687ad87c4128a13181b4
---
M library/GSM_RR_Types.ttcn
1 file changed, 4 insertions(+), 0 deletions(-)



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

diff --git a/library/GSM_RR_Types.ttcn b/library/GSM_RR_Types.ttcn
index 5478754..9f56afd 100644
--- a/library/GSM_RR_Types.ttcn
+++ b/library/GSM_RR_Types.ttcn
@@ -409,6 +409,8 @@
 		variant (r99) "CSN.1 L/H"
 		variant (presence) "PRESENCE(r99 = '1'B)" /* H */
 		variant (ext_ra) "PRESENCE(presence = '1'B)"
+		/* See https://bugs.eclipse.org/bugs/show_bug.cgi?id=562488#c1 */
+		variant (ext_ra) "BYTEORDER(last)"
 	};
 	type union PacketUlDlAssignUnion {
 		PacketUlAssign		ul,
@@ -631,6 +633,8 @@
 		variant (ats)	"PRESENCE(ats_present = '1'B)"
 		variant (dynamic)	"PRESENCE(presence = '1'B)"
 		variant (multiblock)	"PRESENCE(presence = '0'B)"
+		/* See https://bugs.eclipse.org/bugs/show_bug.cgi?id=562488#c1 */
+		variant (ext_ra)	"BYTEORDER(last)"
 	};
 
 	type octetstring MblkDlAss;	/* TODO */

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/17958
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: I481a40daef3eed4a3daa687ad87c4128a13181b4
Gerrit-Change-Number: 17958
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <axilirator at gmail.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200427/ff8fe1b6/attachment.htm>


More information about the gerrit-log mailing list