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

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">BSSGP_Emulation: add BssgpDecodeDepth<br><br>Make the decoding level (BSSGP, LLC, SNDCP, L3) configurable, so the<br>existing PCU tests, that expect messages only decoded to the BSSGP<br>level, can pass again. Move the SNDCP decoding in f_dec_bssgp above the<br>L3 decoding, so f_dec_bssgp goes through the layers in the reverse order<br>of f_send_bssgp_dec.<br><br>I have verified, that all testsuites using the BSSGP Emulation (SGSN,<br>PCU, PCU-SNS) are still working with this patch.<br><br>Related: OS#4180<br>Fixes: 955aa94504510139a12d223071cf49ef90788a3d ("BSSGP_Emulation: Abandon "BssgpDecoded" intermediate structure")<br>Change-Id: I8f76385528c1de98c557cee451c0e0dfd182b605<br>---<br>M library/BSSGP_Emulation.ttcn<br>M pcu/PCU_Tests.ttcn<br>M sgsn/SGSN_Tests.ttcn<br>3 files changed, 38 insertions(+), 19 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/library/BSSGP_Emulation.ttcn b/library/BSSGP_Emulation.ttcn</span><br><span>index 44946c1..e3023ed 100644</span><br><span>--- a/library/BSSGP_Emulation.ttcn</span><br><span>+++ b/library/BSSGP_Emulation.ttcn</span><br><span>@@ -164,11 +164,19 @@</span><br><span>         n_u_rx_last := -</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+type enumerated BssgpDecodeDepth {</span><br><span style="color: hsl(120, 100%, 40%);">+ BSSGP_DECODE_DEPTH_BSSGP,</span><br><span style="color: hsl(120, 100%, 40%);">+     BSSGP_DECODE_DEPTH_LLC,</span><br><span style="color: hsl(120, 100%, 40%);">+       BSSGP_DECODE_DEPTH_SNDCP,</span><br><span style="color: hsl(120, 100%, 40%);">+     BSSGP_DECODE_DEPTH_L3</span><br><span style="color: hsl(120, 100%, 40%);">+};</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> type record BssgpConfig {</span><br><span>     Nsvci nsei,</span><br><span>  Nsvci bvci,</span><br><span>  BssgpCellId cell_id,</span><br><span style="color: hsl(0, 100%, 40%);">-    boolean sgsn_role</span><br><span style="color: hsl(120, 100%, 40%);">+     boolean sgsn_role,</span><br><span style="color: hsl(120, 100%, 40%);">+    BssgpDecodeDepth depth</span><br><span> };</span><br><span> </span><br><span> function f_BnsUdReq(template PDU_BSSGP pdu, BssgpBvci bvci)</span><br><span>@@ -706,25 +714,32 @@</span><br><span>      };</span><br><span> </span><br><span>       /* Decode LLC, if it is a PDU that contains LLC */</span><br><span style="color: hsl(0, 100%, 40%);">-      if (ischosen(bssgp.pDU_BSSGP_DL_UNITDATA)) {</span><br><span style="color: hsl(0, 100%, 40%);">-            dec.llc := dec_PDU_LLC(bssgp.pDU_BSSGP_DL_UNITDATA.lLC_PDU.lLC_PDU);</span><br><span style="color: hsl(0, 100%, 40%);">-    } else if (ischosen(bssgp.pDU_BSSGP_UL_UNITDATA)) {</span><br><span style="color: hsl(0, 100%, 40%);">-             dec.llc := dec_PDU_LLC(bssgp.pDU_BSSGP_UL_UNITDATA.lLC_PDU.lLC_PDU);</span><br><span style="color: hsl(0, 100%, 40%);">-    }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       /* Decode L3, if it is a LLC PDU containing L3 */</span><br><span style="color: hsl(0, 100%, 40%);">-       if (isvalue(dec.llc) and match(dec.llc, tr_LLC_UI_L3)) {</span><br><span style="color: hsl(0, 100%, 40%);">-                if (g_cfg.sgsn_role) {</span><br><span style="color: hsl(0, 100%, 40%);">-                  dec.l3_mo := dec_PDU_L3_MS_SGSN(dec.llc.pDU_LLC_UI.information_field_UI);</span><br><span style="color: hsl(0, 100%, 40%);">-               } else {</span><br><span style="color: hsl(0, 100%, 40%);">-                        dec.l3_mt := dec_PDU_L3_SGSN_MS(dec.llc.pDU_LLC_UI.information_field_UI);</span><br><span style="color: hsl(120, 100%, 40%);">+     if (g_cfg.depth >= BSSGP_DECODE_DEPTH_LLC) {</span><br><span style="color: hsl(120, 100%, 40%);">+               if (ischosen(bssgp.pDU_BSSGP_DL_UNITDATA)) {</span><br><span style="color: hsl(120, 100%, 40%);">+                  dec.llc := dec_PDU_LLC(bssgp.pDU_BSSGP_DL_UNITDATA.lLC_PDU.lLC_PDU);</span><br><span style="color: hsl(120, 100%, 40%);">+          } else if (ischosen(bssgp.pDU_BSSGP_UL_UNITDATA)) {</span><br><span style="color: hsl(120, 100%, 40%);">+                   dec.llc := dec_PDU_LLC(bssgp.pDU_BSSGP_UL_UNITDATA.lLC_PDU.lLC_PDU);</span><br><span>                 }</span><br><span>    }</span><br><span> </span><br><span>        /* Decode SNDCP, if it is a LLC PDU containing user plane data */</span><br><span style="color: hsl(0, 100%, 40%);">-       if (isvalue(dec.llc) and match(dec.llc, tr_LLC_UI_USER)) {</span><br><span style="color: hsl(0, 100%, 40%);">-              dec.sndcp := dec_PDU_SN(dec.llc.pDU_LLC_UI.information_field_UI);</span><br><span style="color: hsl(120, 100%, 40%);">+     if (g_cfg.depth >= BSSGP_DECODE_DEPTH_SNDCP) {</span><br><span style="color: hsl(120, 100%, 40%);">+             if (isvalue(dec.llc) and match(dec.llc, tr_LLC_UI_USER)) {</span><br><span style="color: hsl(120, 100%, 40%);">+                    dec.sndcp := dec_PDU_SN(dec.llc.pDU_LLC_UI.information_field_UI);</span><br><span style="color: hsl(120, 100%, 40%);">+             }</span><br><span>    }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   /* Decode L3, if it is a LLC PDU containing L3 */</span><br><span style="color: hsl(120, 100%, 40%);">+     if (g_cfg.depth >= BSSGP_DECODE_DEPTH_L3) {</span><br><span style="color: hsl(120, 100%, 40%);">+                if (isvalue(dec.llc) and match(dec.llc, tr_LLC_UI_L3)) {</span><br><span style="color: hsl(120, 100%, 40%);">+                      if (g_cfg.sgsn_role) {</span><br><span style="color: hsl(120, 100%, 40%);">+                                dec.l3_mo := dec_PDU_L3_MS_SGSN(dec.llc.pDU_LLC_UI.information_field_UI);</span><br><span style="color: hsl(120, 100%, 40%);">+                     } else {</span><br><span style="color: hsl(120, 100%, 40%);">+                              dec.l3_mt := dec_PDU_L3_SGSN_MS(dec.llc.pDU_LLC_UI.information_field_UI);</span><br><span style="color: hsl(120, 100%, 40%);">+                     }</span><br><span style="color: hsl(120, 100%, 40%);">+             }</span><br><span style="color: hsl(120, 100%, 40%);">+     }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>  return dec;</span><br><span> }</span><br><span> </span><br><span>diff --git a/pcu/PCU_Tests.ttcn b/pcu/PCU_Tests.ttcn</span><br><span>index a88dfed..0f43f28 100644</span><br><span>--- a/pcu/PCU_Tests.ttcn</span><br><span>+++ b/pcu/PCU_Tests.ttcn</span><br><span>@@ -44,7 +44,8 @@</span><br><span>                        },</span><br><span>                   cell_id := 20960</span><br><span>             },</span><br><span style="color: hsl(0, 100%, 40%);">-              sgsn_role := true</span><br><span style="color: hsl(120, 100%, 40%);">+             sgsn_role := true,</span><br><span style="color: hsl(120, 100%, 40%);">+            depth := BSSGP_DECODE_DEPTH_BSSGP</span><br><span>    };</span><br><span> </span><br><span>       NSConfiguration mp_nsconfig := {</span><br><span>diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn</span><br><span>index db7d54b..b68df85 100644</span><br><span>--- a/sgsn/SGSN_Tests.ttcn</span><br><span>+++ b/sgsn/SGSN_Tests.ttcn</span><br><span>@@ -286,7 +286,8 @@</span><br><span>                          },</span><br><span>                   cell_id := 20960</span><br><span>             },</span><br><span style="color: hsl(0, 100%, 40%);">-              sgsn_role := false</span><br><span style="color: hsl(120, 100%, 40%);">+            sgsn_role := false,</span><br><span style="color: hsl(120, 100%, 40%);">+           depth := BSSGP_DECODE_DEPTH_L3</span><br><span>       };</span><br><span>   g_gb[1].cfg := {</span><br><span>             nsei := 97,</span><br><span>@@ -299,7 +300,8 @@</span><br><span>                            },</span><br><span>                   cell_id := 20961</span><br><span>             },</span><br><span style="color: hsl(0, 100%, 40%);">-              sgsn_role := false</span><br><span style="color: hsl(120, 100%, 40%);">+            sgsn_role := false,</span><br><span style="color: hsl(120, 100%, 40%);">+           depth := BSSGP_DECODE_DEPTH_L3</span><br><span>       };</span><br><span>   g_gb[2].cfg := {</span><br><span>             nsei := 98,</span><br><span>@@ -312,7 +314,8 @@</span><br><span>                            },</span><br><span>                   cell_id := 20962</span><br><span>             },</span><br><span style="color: hsl(0, 100%, 40%);">-              sgsn_role := false</span><br><span style="color: hsl(120, 100%, 40%);">+            sgsn_role := false,</span><br><span style="color: hsl(120, 100%, 40%);">+           depth := BSSGP_DECODE_DEPTH_L3</span><br><span>       };</span><br><span> </span><br><span>       f_init_vty();</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15377">change 15377</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/+/15377"/><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: I8f76385528c1de98c557cee451c0e0dfd182b605 </div>
<div style="display:none"> Gerrit-Change-Number: 15377 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: osmith <osmith@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: laforge <laforge@gnumonks.org> </div>
<div style="display:none"> Gerrit-Reviewer: lynxis lazus <lynxis@fe80.eu> </div>
<div style="display:none"> Gerrit-Reviewer: osmith <osmith@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>