<p>laforge <strong>submitted</strong> this change.</p><p><a href="https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/21034">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Jenkins Builder: Verified
  fixeria: Looks good to me, approved
  laforge: Looks good to me, but someone else must approve

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">pcu: Implement check for expected (M)CS in received data block<br><br>Change-Id: Ibdc63f6b695c08e4ddf5894c22767d07acf21311<br>---<br>M pcu/GPRS_Components.ttcn<br>1 file changed, 8 insertions(+), 3 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/pcu/GPRS_Components.ttcn b/pcu/GPRS_Components.ttcn</span><br><span>index f9697a1..234d910 100644</span><br><span>--- a/pcu/GPRS_Components.ttcn</span><br><span>+++ b/pcu/GPRS_Components.ttcn</span><br><span>@@ -902,7 +902,10 @@</span><br><span>                f_shutdown(__BFILE__, __LINE__);</span><br><span>     }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-   /* TODO: check exp_cs */</span><br><span style="color: hsl(120, 100%, 40%);">+      if (not match(data_block.cs, exp_cs)) {</span><br><span style="color: hsl(120, 100%, 40%);">+               setverdict(fail, "Failed to match ", data_block.cs, " vs exp ", exp_cs);</span><br><span style="color: hsl(120, 100%, 40%);">+          f_shutdown(__BFILE__, __LINE__);</span><br><span style="color: hsl(120, 100%, 40%);">+      }</span><br><span> }</span><br><span> </span><br><span> /* This function does what could probably be done with templates */</span><br><span>@@ -934,8 +937,10 @@</span><br><span>             f_shutdown(__BFILE__, __LINE__);</span><br><span>     }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-   /* TODO: Check exp_cs. In the case of EGPRS, first check mac_hdr.header_type and then decode CPS = exp_cs based on mac_hdr.header_type.</span><br><span style="color: hsl(0, 100%, 40%);">-         See wireshark's egprs_Header_type1_coding_puncturing_scheme_to_mcs. */</span><br><span style="color: hsl(120, 100%, 40%);">+    if (not match(data_block.mcs, exp_cs)) {</span><br><span style="color: hsl(120, 100%, 40%);">+              setverdict(fail, "Failed to match ", data_block.mcs, " vs exp ", exp_cs);</span><br><span style="color: hsl(120, 100%, 40%);">+         f_shutdown(__BFILE__, __LINE__);</span><br><span style="color: hsl(120, 100%, 40%);">+      }</span><br><span> }</span><br><span> </span><br><span> /* High level (task specific) helper for receiving and matching GPRS/EGPRS data blocks */</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/21034">change 21034</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/+/21034"/><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: Ibdc63f6b695c08e4ddf5894c22767d07acf21311 </div>
<div style="display:none"> Gerrit-Change-Number: 21034 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>