<p>fixeria has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/17958">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">library/GSM_RR_Types.ttcn: fix: apply BYTEORDER(last) to field 'ext_ra'<br><br>By default, the BYTEORDER for BIT1..N sub-types is set to 'first'.<br>This may result in incorrect decoding of bit-fields located on the<br>boundary of two octets. For example:<br><br>  IA Rest Octets<br>    L... .... = First Discriminator Bit: Low<br>    .H.. .... = Second Discriminator Bit: High<br>    ..0. .... = Discriminator bit: EGPRS Packet Uplink Assignment<br>    ...0 .... = Downlink/Uplink: EGPRS Packet Uplink Assignment<br>    EGPRS Packet Uplink Assignment<br>      .... 0001  1... .... = Extended_RA: 3  // <------------ (!)<br>      .0.. .... = Access Technologies Request: Not Present<br>      ..1. .... = TFI/Multiblock: TFI Assignment Present<br>      ...0 0000 = TFI_Assignment: 0<br><br>As can be seen, the field 'Extended_RA' in this particular case<br>occupies 4 LSBs of the first octet and 1 MSB of the second. So<br>instead of '00011'B, TITAN's RAW codec decodes '10001'B.<br><br>Unfortunaly there is no way to use BYTEORDER(last) to the whole<br>record or the whole file, so we may run into a similar problem<br>with basically any other field of size >= 2 (BIT2..N). Let's<br>fix at least 'ext_ra' for now as it's to be checked in the<br>test cases introduced in the follow up changes.<br><br>For more details, see:<br><br>https://www.eclipse.org/forums/index.php/m/1826511/<br>https://bugs.eclipse.org/bugs/show_bug.cgi?id=562488<br><br>Change-Id: I481a40daef3eed4a3daa687ad87c4128a13181b4<br>---<br>M library/GSM_RR_Types.ttcn<br>1 file changed, 4 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/58/17958/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/library/GSM_RR_Types.ttcn b/library/GSM_RR_Types.ttcn</span><br><span>index 5478754..9f56afd 100644</span><br><span>--- a/library/GSM_RR_Types.ttcn</span><br><span>+++ b/library/GSM_RR_Types.ttcn</span><br><span>@@ -409,6 +409,8 @@</span><br><span>             variant (r99) "CSN.1 L/H"</span><br><span>          variant (presence) "PRESENCE(r99 = '1'B)" /* H */</span><br><span>          variant (ext_ra) "PRESENCE(presence = '1'B)"</span><br><span style="color: hsl(120, 100%, 40%);">+                /* See https://bugs.eclipse.org/bugs/show_bug.cgi?id=562488#c1 */</span><br><span style="color: hsl(120, 100%, 40%);">+             variant (ext_ra) "BYTEORDER(last)"</span><br><span>         };</span><br><span>   type union PacketUlDlAssignUnion {</span><br><span>           PacketUlAssign          ul,</span><br><span>@@ -631,6 +633,8 @@</span><br><span>            variant (ats)   "PRESENCE(ats_present = '1'B)"</span><br><span>             variant (dynamic)       "PRESENCE(presence = '1'B)"</span><br><span>                variant (multiblock)    "PRESENCE(presence = '0'B)"</span><br><span style="color: hsl(120, 100%, 40%);">+         /* See https://bugs.eclipse.org/bugs/show_bug.cgi?id=562488#c1 */</span><br><span style="color: hsl(120, 100%, 40%);">+             variant (ext_ra)        "BYTEORDER(last)"</span><br><span>  };</span><br><span> </span><br><span>       type octetstring MblkDlAss;     /* TODO */</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/17958">change 17958</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/17958"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-ttcn3-hacks </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I481a40daef3eed4a3daa687ad87c4128a13181b4 </div>
<div style="display:none"> Gerrit-Change-Number: 17958 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: fixeria <axilirator@gmail.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>