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

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">BSSGP_Emulation: Support multiple PTP-BVC within one Entity<br><br>The existing BSSGP_Emulation is built around the assumption that every<br>instance of BSSGP_Emulation only servers one signaling-BVC and one<br>PTP-BVC.  While this is true for osmo-pcu at this point (BTS-colocated<br>PCU), other BSS/PCU implementations differ.<br><br>In general, there can always be any number of PTP BVC (one per cell)<br>next to the signaling BVC (one per BSS).  Let's represent this in<br>BSSGP_Emulation so we can create more comprehensive tests.<br><br>Change-Id: I7e30b4c4e188518a574e082962fba457b3a97ce3<br>---<br>M library/BSSGP_Emulation.ttcnpp<br>M library/Osmocom_Gb_Types.ttcn<br>M pcu/PCU_Tests.default<br>M pcu/PCU_Tests.ttcn<br>M pcu/PCU_Tests_NS.ttcn<br>M pcu/PCU_Tests_SNS.ttcn<br>M pcu/SGSN_Components.ttcn<br>M sgsn/SGSN_Tests.ttcn<br>8 files changed, 1,210 insertions(+), 706 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/library/BSSGP_Emulation.ttcnpp b/library/BSSGP_Emulation.ttcnpp</span><br><span>index c1d297d..81b3c5b 100644</span><br><span>--- a/library/BSSGP_Emulation.ttcnpp</span><br><span>+++ b/library/BSSGP_Emulation.ttcnpp</span><br><span>@@ -1,13 +1,21 @@</span><br><span> module BSSGP_Emulation {</span><br><span> </span><br><span> /* BSSGP Emulation in TTCN-3</span><br><span style="color: hsl(0, 100%, 40%);">- * (C) 2018-2019 Harald Welte <laforge@gnumonks.org></span><br><span style="color: hsl(120, 100%, 40%);">+ * (C) 2018-2020 Harald Welte <laforge@gnumonks.org></span><br><span>  * All rights reserved.</span><br><span>  *</span><br><span>  * Released under the terms of GNU General Public License, Version 2 or</span><br><span>  * (at your option) any later version.</span><br><span>  *</span><br><span>  * SPDX-License-Identifier: GPL-2.0-or-later</span><br><span style="color: hsl(120, 100%, 40%);">+ *</span><br><span style="color: hsl(120, 100%, 40%);">+ * This code implements BSSGP asa hierarchy of components:</span><br><span style="color: hsl(120, 100%, 40%);">+ *  - the main BSSGP_CT which runs on top of a NSE (NS Entity).</span><br><span style="color: hsl(120, 100%, 40%);">+ *    - demultiplex based on BVCI.  BVCI=0 is handled to a user port</span><br><span style="color: hsl(120, 100%, 40%);">+ *  - a per-BVC BSSGP_BVC_CT which runs on top of BSSGP_CT, it handles</span><br><span style="color: hsl(120, 100%, 40%);">+ *    one PTP BVCI (i.e. one cell)</span><br><span style="color: hsl(120, 100%, 40%);">+ *    - demultiplex based on TLLI</span><br><span style="color: hsl(120, 100%, 40%);">+ *  - a per-TLLI BSSGP_Client_CT which runs on top of BSSGP_BVC_CT</span><br><span>  */</span><br><span> </span><br><span> import from General_Types all;</span><br><span>@@ -35,23 +43,43 @@</span><br><span> }</span><br><span> </span><br><span> /***********************************************************************</span><br><span style="color: hsl(0, 100%, 40%);">- * Communication between Client Components and Main Component</span><br><span style="color: hsl(120, 100%, 40%);">+ * Communication between Client Components and per-BVC component</span><br><span>  ***********************************************************************/</span><br><span> </span><br><span> type record BssgpStatusIndication {</span><br><span style="color: hsl(0, 100%, 40%);">-    Nsei            nsei,</span><br><span style="color: hsl(120, 100%, 40%);">+ Nsei            nsei optional,</span><br><span>       BssgpBvci       bvci,</span><br><span>        BvcState        state</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%);">+type record BssgpResetIndication {</span><br><span style="color: hsl(120, 100%, 40%);">+       BssgpBvci       bvci</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%);">+template (value) BssgpStatusIndication</span><br><span style="color: hsl(120, 100%, 40%);">+ts_BssgpStsInd(template (omit) Nsei nsei, template (value) BssgpBvci bvci,</span><br><span style="color: hsl(120, 100%, 40%);">+               template (value) BvcState state) := {</span><br><span style="color: hsl(120, 100%, 40%);">+  nsei := nsei,</span><br><span style="color: hsl(120, 100%, 40%);">+ bvci := bvci,</span><br><span style="color: hsl(120, 100%, 40%);">+ state := state</span><br><span> }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-template BssgpStatusIndication t_BssgpStsInd(template Nsei nsei, template BssgpBvci bvci, template BvcState state) := {</span><br><span style="color: hsl(120, 100%, 40%);">+template (present) BssgpStatusIndication</span><br><span style="color: hsl(120, 100%, 40%);">+tr_BssgpStsInd(template Nsei nsei, template (present) BssgpBvci bvci,</span><br><span style="color: hsl(120, 100%, 40%);">+               template (present) BvcState state) := {</span><br><span>      nsei := nsei,</span><br><span>        bvci := bvci,</span><br><span>        state := state</span><br><span> }</span><br><span> </span><br><span> type enumerated BvcState {</span><br><span style="color: hsl(120, 100%, 40%);">+ /* SGSN role: waiting to be reset by the peer */</span><br><span style="color: hsl(120, 100%, 40%);">+      BVC_S_WAIT_RESET,</span><br><span style="color: hsl(120, 100%, 40%);">+     /* PCU role: waiting for NS_ALIVE_UNBLOCKED */</span><br><span style="color: hsl(120, 100%, 40%);">+        BVC_S_WAIT_NS_ALIVE_UNBLOCKED,</span><br><span style="color: hsl(120, 100%, 40%);">+        /* BVC-BLOCKED state */</span><br><span>      BVC_S_BLOCKED,</span><br><span style="color: hsl(120, 100%, 40%);">+        /* BVC-UNBLOCKED state */</span><br><span>    BVC_S_UNBLOCKED</span><br><span> };</span><br><span> </span><br><span>@@ -103,7 +131,7 @@</span><br><span>              ;</span><br><span> } with { extension "internal" };</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-signature BSSGP_register_client(hexstring imsi, OCT4 tlli, BssgpCellId cell_id);</span><br><span style="color: hsl(120, 100%, 40%);">+signature BSSGP_register_client(hexstring imsi, OCT4 tlli);</span><br><span> signature BSSGP_unregister_client(hexstring imsi);</span><br><span> signature BSSGP_llgmm_assign(OCT4 tlli_old, OCT4 tlli);</span><br><span> </span><br><span>@@ -112,60 +140,506 @@</span><br><span> } with { extension "internal" };</span><br><span> </span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> /***********************************************************************</span><br><span>  * Client Component for a single MS/TLLI</span><br><span style="color: hsl(120, 100%, 40%);">+ ***********************************************************************</span><br><span style="color: hsl(120, 100%, 40%);">+ * This is what most users will want to derive their test cases from. It</span><br><span style="color: hsl(120, 100%, 40%);">+ * provides a set of three different ports (PTP, signaling, procedure)</span><br><span style="color: hsl(120, 100%, 40%);">+ * for (currently up to 3) different Cells.  Those ports are all connected</span><br><span style="color: hsl(120, 100%, 40%);">+ * to one or multiple different per-BVC compoennts, depending on whether</span><br><span style="color: hsl(120, 100%, 40%);">+ * they share the same BSS or not.</span><br><span>  ***********************************************************************/</span><br><span> </span><br><span> type component BSSGP_Client_CT {</span><br><span style="color: hsl(0, 100%, 40%);">-       port BSSGP_PT BSSGP[3];</span><br><span style="color: hsl(0, 100%, 40%);">- port BSSGP_PT BSSGP_SIG[3];</span><br><span style="color: hsl(0, 100%, 40%);">-     port BSSGP_PROC_PT BSSGP_PROC[3];</span><br><span style="color: hsl(120, 100%, 40%);">+     /* one port array for each client; allows talking to up to 3 BVC/Cell (handover, ...) */</span><br><span style="color: hsl(120, 100%, 40%);">+      port BSSGP_PT BSSGP[3];                 /* PTP-BVC */</span><br><span style="color: hsl(120, 100%, 40%);">+ port BSSGP_PT BSSGP_SIG[3];             /* Signaling BVC */</span><br><span style="color: hsl(120, 100%, 40%);">+   port BSSGP_PROC_PT BSSGP_PROC[3];       /* registration / deregistration */</span><br><span> };</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+function f_bssgp_client_register(hexstring imsi, OCT4 tlli, BSSGP_PROC_PT PT := BSSGP_PROC[0])</span><br><span style="color: hsl(120, 100%, 40%);">+runs on BSSGP_Client_CT {</span><br><span style="color: hsl(120, 100%, 40%);">+      PT.call(BSSGP_register_client:{imsi, tlli}) {</span><br><span style="color: hsl(120, 100%, 40%);">+         [] PT.getreply(BSSGP_register_client:{imsi, tlli}) {};</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%);">+function f_bssgp_client_unregister(hexstring imsi, BSSGP_PROC_PT PT := BSSGP_PROC[0])</span><br><span style="color: hsl(120, 100%, 40%);">+runs on BSSGP_Client_CT {</span><br><span style="color: hsl(120, 100%, 40%);">+      PT.call(BSSGP_unregister_client:{imsi}) {</span><br><span style="color: hsl(120, 100%, 40%);">+             [] PT.getreply(BSSGP_unregister_client:{imsi}) {};</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%);">+/* TS 44.064 7.2.1.1 LLGMM-ASSIGN */</span><br><span style="color: hsl(120, 100%, 40%);">+function f_bssgp_client_llgmm_assign(OCT4 tlli_old, OCT4 tlli_new, BSSGP_PROC_PT PT := BSSGP_PROC[0])</span><br><span style="color: hsl(120, 100%, 40%);">+runs on BSSGP_Client_CT {</span><br><span style="color: hsl(120, 100%, 40%);">+        PT.call(BSSGP_llgmm_assign:{tlli_old, tlli_new}) {</span><br><span style="color: hsl(120, 100%, 40%);">+            [] PT.getreply(BSSGP_llgmm_assign:{tlli_old, tlli_new}) {};</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> /***********************************************************************</span><br><span>  * Main Component</span><br><span style="color: hsl(120, 100%, 40%);">+ ***********************************************************************</span><br><span style="color: hsl(120, 100%, 40%);">+ * This component exists once, and it runs on to of the NS_Emulation.</span><br><span style="color: hsl(120, 100%, 40%);">+ * It handles the BVC-RESET for the signaling BVCI, and dispatches messages</span><br><span style="color: hsl(120, 100%, 40%);">+ * to the per-BVC components running above it. Messages are routed by:</span><br><span style="color: hsl(120, 100%, 40%);">+ *  - PTP BVCI in NS header (if non-0)</span><br><span style="color: hsl(120, 100%, 40%);">+ *  - BVCI IE in messages on BVCI=0 in NS header</span><br><span style="color: hsl(120, 100%, 40%);">+ * Messages for which no unique BVC can be identified (like paging without</span><br><span style="color: hsl(120, 100%, 40%);">+ * a BVCI IE set) are broadcast to all BVC components.</span><br><span style="color: hsl(120, 100%, 40%);">+ * We also broadcast state changes (BssgpStatusIndication) and reset events</span><br><span style="color: hsl(120, 100%, 40%);">+ * (BssgpResetIndication) of the signaling BVC to all per-BVC components.</span><br><span>  ***********************************************************************/</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-function BssgpStart(BssgpConfig cfg) runs on BSSGP_CT {</span><br><span style="color: hsl(120, 100%, 40%);">+function BssgpStart(BssgpConfig cfg, charstring id) runs on BSSGP_CT {</span><br><span>  g_cfg := cfg;</span><br><span style="color: hsl(0, 100%, 40%);">-   f_init();</span><br><span style="color: hsl(0, 100%, 40%);">-       f_ScanEvents();</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+     /* create the per-BVC components based on the configuration */</span><br><span style="color: hsl(120, 100%, 40%);">+        for (var integer i := 0; i < lengthof(g_cfg.bvc); i := i+1) {</span><br><span style="color: hsl(120, 100%, 40%);">+              var BssgpBvcConfig bvc_cfg := g_cfg.bvc[i];</span><br><span style="color: hsl(120, 100%, 40%);">+           var charstring bvc_id := id & "-BVCI" & int2str(bvc_cfg.bvci);</span><br><span style="color: hsl(120, 100%, 40%);">+              /* create, connect and start the BVC component */</span><br><span style="color: hsl(120, 100%, 40%);">+             var BSSGP_BVC_CT bvc_ct := BSSGP_BVC_CT.create(bvc_id);</span><br><span style="color: hsl(120, 100%, 40%);">+               connect(bvc_ct:BVC, self:BVC);</span><br><span style="color: hsl(120, 100%, 40%);">+                bvc_ct.start(f_bssgp_bvc_main(bvc_cfg, g_cfg.sgsn_role, bvc_id));</span><br><span style="color: hsl(120, 100%, 40%);">+             /* populate the BVC state table */</span><br><span style="color: hsl(120, 100%, 40%);">+            BvcTable[i] := {</span><br><span style="color: hsl(120, 100%, 40%);">+                      bvci := bvc_cfg.bvci,</span><br><span style="color: hsl(120, 100%, 40%);">+                 cell_id := bvc_cfg.cell_id,</span><br><span style="color: hsl(120, 100%, 40%);">+                   comp_ref := bvc_ct</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%);">+   if (g_cfg.sgsn_role) {</span><br><span style="color: hsl(120, 100%, 40%);">+                /* The SGSN side waits for an inbound BVC-RESET on the signaling BVC */</span><br><span style="color: hsl(120, 100%, 40%);">+               f_sign_change_state(BVC_S_WAIT_RESET);</span><br><span style="color: hsl(120, 100%, 40%);">+        } else {</span><br><span style="color: hsl(120, 100%, 40%);">+              /* The BSS/PCU side waits for an inbound NsStatusIndication to Tx BVC-RESET */</span><br><span style="color: hsl(120, 100%, 40%);">+                f_sign_change_state(BVC_S_WAIT_NS_ALIVE_UNBLOCKED);</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%);">+   /* main loop */</span><br><span style="color: hsl(120, 100%, 40%);">+       f_bssgp_ScanEvents();</span><br><span> }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-private function f_init() runs on BSSGP_CT {</span><br><span style="color: hsl(0, 100%, 40%);">-      /* Connect the UDP socket */</span><br><span style="color: hsl(0, 100%, 40%);">-    f_change_state(BVC_S_BLOCKED);</span><br><span style="color: hsl(0, 100%, 40%);">-}</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(120, 100%, 40%);">+/* master component, exists once per BSSGP instance (NSE) */</span><br><span> type component BSSGP_CT {</span><br><span>   /* UDP ports towards the bottom (IUT) */</span><br><span>     port NS_PT BSCP;</span><br><span style="color: hsl(0, 100%, 40%);">-        /* NS-User SAP towards the user */</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+  /* control by the user */</span><br><span style="color: hsl(120, 100%, 40%);">+     port BSSGP_CT_PROC_PT PROC;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ var BssgpConfig g_cfg;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+      /* Signaling BVC (BVCI=0) */</span><br><span style="color: hsl(120, 100%, 40%);">+  var BvcState g_sign_bvc_state := BVC_S_WAIT_RESET;</span><br><span style="color: hsl(120, 100%, 40%);">+    timer g_T2 := 60.0;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ /* port to per-BVC components */</span><br><span style="color: hsl(120, 100%, 40%);">+      port BSSGP_BVC_SP_PT BVC;</span><br><span style="color: hsl(120, 100%, 40%);">+     /* per-BVC state table */</span><br><span style="color: hsl(120, 100%, 40%);">+     var BvcEntity BvcTable[16];</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%);">+/* one element in the per-BVC state table */</span><br><span style="color: hsl(120, 100%, 40%);">+type record BvcEntity {</span><br><span style="color: hsl(120, 100%, 40%);">+      /* PTP BVCI of this BVC/Cell */</span><br><span style="color: hsl(120, 100%, 40%);">+       BssgpBvci bvci,</span><br><span style="color: hsl(120, 100%, 40%);">+       /* Cell Identity of this cell */</span><br><span style="color: hsl(120, 100%, 40%);">+      BssgpCellId cell_id,</span><br><span style="color: hsl(120, 100%, 40%);">+  /* reference to the per-BVC/cell component */</span><br><span style="color: hsl(120, 100%, 40%);">+ BSSGP_BVC_CT comp_ref</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%);">+/* find the per-BVC component for a given BVCI */</span><br><span style="color: hsl(120, 100%, 40%);">+private function f_comp_for_bvci(BssgpBvci bvci) runs on BSSGP_CT return BSSGP_BVC_CT {</span><br><span style="color: hsl(120, 100%, 40%);">+       var integer i;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+      for (i := 0; i < lengthof(BvcTable); i := i+1) {</span><br><span style="color: hsl(120, 100%, 40%);">+           if (BvcTable[i].bvci == bvci) {</span><br><span style="color: hsl(120, 100%, 40%);">+                       return BvcTable[i].comp_ref;</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%);">+     return null;</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%);">+/* We are in BVC_S_WAIT_RSET state (only happens in SGSN role) */</span><br><span style="color: hsl(120, 100%, 40%);">+altstep as_sig_wait_reset() runs on BSSGP_CT {</span><br><span style="color: hsl(120, 100%, 40%);">+  var NsUnitdataIndication udi;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+       /* Respond to RESET for signalling BVCI 0 */</span><br><span style="color: hsl(120, 100%, 40%);">+  [] BSCP.receive(f_BnsUdInd(tr_BVC_RESET(?, 0, omit), 0)) -> value udi {</span><br><span style="color: hsl(120, 100%, 40%);">+            log("Rx BVC-RESET for Signaling BVCI=0");</span><br><span style="color: hsl(120, 100%, 40%);">+           BSCP.send(f_BnsUdReq(ts_BVC_RESET_ACK(0, omit), 0));</span><br><span style="color: hsl(120, 100%, 40%);">+          f_sign_change_state(BVC_S_UNBLOCKED);</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%);">+   /* work-around for old, buggy libosmogb before Change-Id Ie87820537d6d616da4fd4bbf73eab06e28fda5e1 */</span><br><span style="color: hsl(120, 100%, 40%);">+ [mp_tolerate_bvc_reset_cellid] BSCP.receive(f_BnsUdInd(tr_BVC_RESET(?, 0, g_cfg.bvc[0].cell_id), 0)) -> value udi {</span><br><span style="color: hsl(120, 100%, 40%);">+                log("Rx BVC-RESET for Signaling BVCI=0");</span><br><span style="color: hsl(120, 100%, 40%);">+           BSCP.send(f_BnsUdReq(ts_BVC_RESET_ACK(0, omit), 0));</span><br><span style="color: hsl(120, 100%, 40%);">+          f_sign_change_state(BVC_S_UNBLOCKED);</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%);">+/* We are in BVC_S_UNBLOCKED state */</span><br><span style="color: hsl(120, 100%, 40%);">+altstep as_sig_unblocked() runs on BSSGP_CT {</span><br><span style="color: hsl(120, 100%, 40%);">+  var BSSGP_BVC_CT bvc_comp_ref;</span><br><span style="color: hsl(120, 100%, 40%);">+        var BSSGP_Client_CT vc_conn;</span><br><span style="color: hsl(120, 100%, 40%);">+  var NsUnitdataIndication udi;</span><br><span style="color: hsl(120, 100%, 40%);">+ var NsUnitdataRequest udr;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+  /* Messages PTP BVCI in BVCI field of NS: dispatch by that */</span><br><span style="color: hsl(120, 100%, 40%);">+ [] BSCP.receive(f_BnsUdInd(?, (2..65535))) -> value udi {</span><br><span style="color: hsl(120, 100%, 40%);">+          bvc_comp_ref := f_comp_for_bvci(valueof(udi.bvci));</span><br><span style="color: hsl(120, 100%, 40%);">+           if (isbound(bvc_comp_ref) and bvc_comp_ref != null) {</span><br><span style="color: hsl(120, 100%, 40%);">+                 /* dispatch to BVC component */</span><br><span style="color: hsl(120, 100%, 40%);">+                       BVC.send(udi) to bvc_comp_ref;</span><br><span style="color: hsl(120, 100%, 40%);">+                } else {</span><br><span style="color: hsl(120, 100%, 40%);">+                      setverdict(fail, "Rx BSSGP for unknown PTP BVCI ", udi.bvci, ": ", udi.bssgp);</span><br><span style="color: hsl(120, 100%, 40%);">+                    BSCP.send(f_BnsUdReq(ts_BSSGP_STATUS(udi.bvci, BSSGP_CAUSE_BVCI_UNKNOWN, udi.bssgp), udi.bvci));</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%);">+   /* Messages with BVCI = 0 (Signaling) in BVCI field of NS */</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+        /* Route based on PTP BVCI in payload/IE of signaling PDU */</span><br><span style="color: hsl(120, 100%, 40%);">+  [] BSCP.receive(f_BnsUdInd(?, 0)) -> value udi {</span><br><span style="color: hsl(120, 100%, 40%);">+           var template (omit) BssgpBvci ptp_bvci := f_BSSGP_BVCI_get(udi.bssgp);</span><br><span style="color: hsl(120, 100%, 40%);">+                if (istemplatekind(ptp_bvci, "omit")) {</span><br><span style="color: hsl(120, 100%, 40%);">+                     log("Rx on SIG BVCI without PTP BVCI: broadcasting");</span><br><span style="color: hsl(120, 100%, 40%);">+                       for (var integer i := 0; i < lengthof(BvcTable); i := i+1) {</span><br><span style="color: hsl(120, 100%, 40%);">+                               if (isbound(BvcTable[i].comp_ref) and BvcTable[i].comp_ref != null) {</span><br><span style="color: hsl(120, 100%, 40%);">+                                 BVC.send(udi) to BvcTable[i].comp_ref;</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%);">+             } else {</span><br><span style="color: hsl(120, 100%, 40%);">+                      bvc_comp_ref := f_comp_for_bvci(valueof(ptp_bvci));</span><br><span style="color: hsl(120, 100%, 40%);">+                   if (isbound(bvc_comp_ref) and bvc_comp_ref != null) {</span><br><span style="color: hsl(120, 100%, 40%);">+                         /* dispatch to BVC component */</span><br><span style="color: hsl(120, 100%, 40%);">+                               BVC.send(udi) to bvc_comp_ref;</span><br><span style="color: hsl(120, 100%, 40%);">+                        } else {</span><br><span style="color: hsl(120, 100%, 40%);">+                              setverdict(fail, "Rx SIG BSSGP for unknown PTP BVCI ", ptp_bvci, ": ", udi.bssgp);</span><br><span style="color: hsl(120, 100%, 40%);">+                                BSCP.send(f_BnsUdReq(ts_BSSGP_STATUS(udi.bvci, BSSGP_CAUSE_BVCI_UNKNOWN, udi.bssgp), 0));</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 style="color: hsl(120, 100%, 40%);">+   /* Handle PS-PAGING on SIGN BVCI with no conditional BVCI IE */</span><br><span style="color: hsl(120, 100%, 40%);">+       [] BSCP.receive(f_BnsUdInd(PDU_BSSGP:{pDU_BSSGP_PAGING_PS:=?}, 0)) -> value udi {</span><br><span style="color: hsl(120, 100%, 40%);">+          /* FIXME: use LA, RA or BSS Area to dispatch instead of broadcast */</span><br><span style="color: hsl(120, 100%, 40%);">+          for (var integer i := 0; i < lengthof(BvcTable); i := i+1) {</span><br><span style="color: hsl(120, 100%, 40%);">+                       if (isbound(BvcTable[i].comp_ref) and BvcTable[i].comp_ref != null) {</span><br><span style="color: hsl(120, 100%, 40%);">+                         BVC.send(udi) to BvcTable[i].comp_ref;</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%);">+     /* Handle CS-PAGING on SIGN BVCI with no conditional BVCI IE  */</span><br><span style="color: hsl(120, 100%, 40%);">+      [] BSCP.receive(f_BnsUdInd(PDU_BSSGP:{pDU_BSSGP_PAGING_CS:=?}, 0)) -> value udi {</span><br><span style="color: hsl(120, 100%, 40%);">+          /* FIXME: use LA, RA or BSS Area to dispatch instead of broadcast */</span><br><span style="color: hsl(120, 100%, 40%);">+          for (var integer i := 0; i < lengthof(BvcTable); i := i+1) {</span><br><span style="color: hsl(120, 100%, 40%);">+                       if (isbound(BvcTable[i].comp_ref) and BvcTable[i].comp_ref != null) {</span><br><span style="color: hsl(120, 100%, 40%);">+                         BVC.send(udi) to BvcTable[i].comp_ref;</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 style="color: hsl(120, 100%, 40%);">+   /* per-BVC component sends us something; forward to NS without any validation */</span><br><span style="color: hsl(120, 100%, 40%);">+      [] BVC.receive(NsUnitdataRequest:?) -> value udr {</span><br><span style="color: hsl(120, 100%, 40%);">+         /* patch in the NSEI, as the per-BVC components have no idea about it */</span><br><span style="color: hsl(120, 100%, 40%);">+              udr.nsei := g_cfg.nsei;</span><br><span style="color: hsl(120, 100%, 40%);">+               BSCP.send(udr);</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%);">+/* We are in BVC_S_WAIT_NS_ALIVE_UNBLOCKED (only happens in BSS role) */</span><br><span style="color: hsl(120, 100%, 40%);">+altstep as_sig_wait_ns_alive_unblocked() runs on BSSGP_CT {</span><br><span style="color: hsl(120, 100%, 40%);">+ var NsStatusIndication nsi;</span><br><span style="color: hsl(120, 100%, 40%);">+   [] BSCP.receive(NsStatusIndication:{?,?, complement (NSE_S_ALIVE_UNBLOCKED), NSE_S_ALIVE_UNBLOCKED}) -> value nsi {</span><br><span style="color: hsl(120, 100%, 40%);">+                /* if we just became NS-unblocked, send a BCC-RESET */</span><br><span style="color: hsl(120, 100%, 40%);">+                if (g_cfg.sgsn_role == false) {</span><br><span style="color: hsl(120, 100%, 40%);">+                       BSCP.send(f_BnsUdReq(ts_BVC_RESET(BSSGP_CAUSE_OM_INTERVENTION, 0, omit), 0));</span><br><span style="color: hsl(120, 100%, 40%);">+                 g_T2.start;</span><br><span style="color: hsl(120, 100%, 40%);">+                   /* The BVC_RESET_ACK is handled in the as_sig_allstate() below */</span><br><span style="color: hsl(120, 100%, 40%);">+             }</span><br><span style="color: hsl(120, 100%, 40%);">+             /* Idea: We could send BVC-UNBLOCK here like some SGSN do */</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 style="color: hsl(120, 100%, 40%);">+/* handling of events irrespective of BVC state */</span><br><span style="color: hsl(120, 100%, 40%);">+altstep as_sig_allstate() runs on BSSGP_CT {</span><br><span style="color: hsl(120, 100%, 40%);">+    var BSSGP_Client_CT vc_conn;</span><br><span style="color: hsl(120, 100%, 40%);">+  var NsUnitdataIndication udi;</span><br><span style="color: hsl(120, 100%, 40%);">+ var NsStatusIndication nsi;</span><br><span style="color: hsl(120, 100%, 40%);">+   var ASP_Event evt;</span><br><span style="color: hsl(120, 100%, 40%);">+    var BSSGP_BVC_CT bvc_comp_ref;</span><br><span style="color: hsl(120, 100%, 40%);">+        var BssgpBvci bvci;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ /* Respond to RESET for signalling BVCI 0 */</span><br><span style="color: hsl(120, 100%, 40%);">+  [] BSCP.receive(f_BnsUdInd(tr_BVC_RESET(?, 0, omit), 0)) -> value udi {</span><br><span style="color: hsl(120, 100%, 40%);">+            log("Rx BVC-RESET for Signaling BVCI=0");</span><br><span style="color: hsl(120, 100%, 40%);">+           BSCP.send(f_BnsUdReq(ts_BVC_RESET_ACK(0, omit), 0));</span><br><span style="color: hsl(120, 100%, 40%);">+          for (var integer i := 0; i < sizeof(BvcTable); i := i+1) {</span><br><span style="color: hsl(120, 100%, 40%);">+                 if (isbound(BvcTable[i].comp_ref) and BvcTable[i].comp_ref != null) {</span><br><span style="color: hsl(120, 100%, 40%);">+                         BVC.send(BssgpResetIndication:{0}) to BvcTable[i].comp_ref;</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 style="color: hsl(120, 100%, 40%);">+   /* any BLOCK or UNBLOCK for the SIGNALING BVCI are illegal */</span><br><span style="color: hsl(120, 100%, 40%);">+ [] BSCP.receive(f_BnsUdInd(t_BVC_BLOCK(0, ?), 0)) -> value udi {</span><br><span style="color: hsl(120, 100%, 40%);">+           setverdict(fail, "Rx BVC-BLOCK illegal for BVCI=0: ", udi);</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+     [] BSCP.receive(f_BnsUdInd(t_BVC_UNBLOCK(0), 0)) -> value udi {</span><br><span style="color: hsl(120, 100%, 40%);">+            setverdict(fail, "Rx BVC-UNBLOCK illegal for BVCI=0: ", udi);</span><br><span style="color: hsl(120, 100%, 40%);">+       }</span><br><span style="color: hsl(120, 100%, 40%);">+     [] BSCP.receive(f_BnsUdInd(t_BVC_BLOCK_ACK(0), 0)) -> value udi {</span><br><span style="color: hsl(120, 100%, 40%);">+          setverdict(fail, "Rx BVC-BLOCK-ACK illegal for BVCI=0: ", udi);</span><br><span style="color: hsl(120, 100%, 40%);">+     }</span><br><span style="color: hsl(120, 100%, 40%);">+     [] BSCP.receive(f_BnsUdInd(t_BVC_UNBLOCK_ACK(0), 0)) -> value udi {</span><br><span style="color: hsl(120, 100%, 40%);">+                setverdict(fail, "Rx BVC-UNBLOCK-ACK illegal for BVCI=0: ", udi);</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%);">+   /* Respond to BLOCK for wrong BVCI */</span><br><span style="color: hsl(120, 100%, 40%);">+ [] BSCP.receive(f_BnsUdInd(t_BVC_BLOCK(?, ?), 0)) -> value udi {</span><br><span style="color: hsl(120, 100%, 40%);">+           setverdict(fail, "Rx BVC-BLOCK for unknown BVCI");</span><br><span style="color: hsl(120, 100%, 40%);">+          BSCP.send(f_BnsUdReq(ts_BSSGP_STATUS(0, BSSGP_CAUSE_BVCI_UNKNOWN, udi.bssgp), 0));</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%);">+   /* Respond to RESET with wrong BVCI */</span><br><span style="color: hsl(120, 100%, 40%);">+        [] BSCP.receive(f_BnsUdInd(tr_BVC_RESET(?, ?, ?), 0)) -> value udi {</span><br><span style="color: hsl(120, 100%, 40%);">+               var BssgpBvci ptp_bvci := oct2int(udi.bssgp.pDU_BSSGP_BVC_RESET.bVCI.unstructured_value);</span><br><span style="color: hsl(120, 100%, 40%);">+             setverdict(fail, "Rx BVC-RESET for unknown BVCI ", ptp_bvci);</span><br><span style="color: hsl(120, 100%, 40%);">+               BSCP.send(f_BnsUdReq(ts_BSSGP_STATUS(ptp_bvci, BSSGP_CAUSE_BVCI_UNKNOWN, udi.bssgp), 0));</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%);">+   /* BVC-RESET-ACK for BVCI=0 while T2 is running: Answer to a BVC-RESET we sent earlier */</span><br><span style="color: hsl(120, 100%, 40%);">+     [g_T2.running] BSCP.receive(f_BnsUdInd(tr_BVC_RESET_ACK(0, omit), 0)) -> value udi {</span><br><span style="color: hsl(120, 100%, 40%);">+               log("BVCI(0) Rx BVC-RESET-ACK");</span><br><span style="color: hsl(120, 100%, 40%);">+            g_T2.stop;</span><br><span style="color: hsl(120, 100%, 40%);">+            f_sign_change_state(BVC_S_UNBLOCKED);</span><br><span style="color: hsl(120, 100%, 40%);">+         for (var integer i := 0; i < sizeof(BvcTable); i := i+1) {</span><br><span style="color: hsl(120, 100%, 40%);">+                 if (isbound(BvcTable[i].comp_ref) and BvcTable[i].comp_ref != null) {</span><br><span style="color: hsl(120, 100%, 40%);">+                         BVC.send(BssgpResetIndication:{0}) to BvcTable[i].comp_ref;</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%);">+     [] g_T2.timeout {</span><br><span style="color: hsl(120, 100%, 40%);">+             setverdict(fail, "Timeout waiting for BVC-RESET-ACK on BVCI=0");</span><br><span style="color: hsl(120, 100%, 40%);">+            BSCP.send(f_BnsUdReq(ts_BSSGP_STATUS(udi.bvci, BSSGP_CAUSE_BVCI_UNKNOWN, udi.bssgp), 0));</span><br><span style="color: hsl(120, 100%, 40%);">+             g_T2.start;</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%);">+   /* default case of handling unknown PDUs */</span><br><span style="color: hsl(120, 100%, 40%);">+   [] BSCP.receive(f_BnsUdInd(?, ?)) -> value udi {</span><br><span style="color: hsl(120, 100%, 40%);">+           setverdict(fail, "Rx Unexpected BSSGP PDU ", udi.bssgp,"  in state ", g_sign_bvc_state);</span><br><span style="color: hsl(120, 100%, 40%);">+          BSCP.send(f_BnsUdReq(ts_BSSGP_STATUS(0, BSSGP_CAUSE_PDU_NOT_COMPATIBLE_WITH_PROTOCOL_STATE, udi.bssgp), 0));</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%);">+   /* Forwarding of ASP_Event to per-BVC components */</span><br><span style="color: hsl(120, 100%, 40%);">+   [] BSCP.receive(ASP_Event:?) -> value evt {</span><br><span style="color: hsl(120, 100%, 40%);">+                for (var integer i := 0; i < sizeof(BvcTable); i := i+1) {</span><br><span style="color: hsl(120, 100%, 40%);">+                 if (isbound(BvcTable[i].comp_ref) and BvcTable[i].comp_ref != null) {</span><br><span style="color: hsl(120, 100%, 40%);">+                         BVC.send(evt) to BvcTable[i].comp_ref;</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%);">+     /* Keep NS Status Indicaitons to us; no need to inform per-BVC components [for now?] */</span><br><span style="color: hsl(120, 100%, 40%);">+       [] BSCP.receive(NsStatusIndication:?) -> value nsi { }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   /* Procedure port request to resolve the per-BVC component for a given ptp BVCI */</span><br><span style="color: hsl(120, 100%, 40%);">+    [] PROC.getcall(BSSGP_get_bvci_ct:{?}) -> param(bvci) sender vc_conn {</span><br><span style="color: hsl(120, 100%, 40%);">+             for (var integer i := 0; i < sizeof(BvcTable); i := i+1) {</span><br><span style="color: hsl(120, 100%, 40%);">+                 if (BvcTable[i].bvci == bvci) {</span><br><span style="color: hsl(120, 100%, 40%);">+                               PROC.reply(BSSGP_get_bvci_ct:{bvci} value BvcTable[i].comp_ref) to vc_conn;</span><br><span style="color: hsl(120, 100%, 40%);">+                           return;</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 style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+/* send the highest decoded layer of the message through given port */</span><br><span style="color: hsl(120, 100%, 40%);">+private function f_send_bssgp_dec(BssgpDecoded dec, BSSGP_Client_CT vc_conn, BSSGP_SP_PT pt) {</span><br><span style="color: hsl(120, 100%, 40%);">+#ifdef BSSGP_EM_L3</span><br><span style="color: hsl(120, 100%, 40%);">+    if (ispresent(dec.l3_mt)) {</span><br><span style="color: hsl(120, 100%, 40%);">+           pt.send(dec.l3_mt) to vc_conn;</span><br><span style="color: hsl(120, 100%, 40%);">+        } else if (ispresent(dec.l3_mo)) {</span><br><span style="color: hsl(120, 100%, 40%);">+            pt.send(dec.l3_mo) to vc_conn;</span><br><span style="color: hsl(120, 100%, 40%);">+        } else</span><br><span style="color: hsl(120, 100%, 40%);">+#endif</span><br><span style="color: hsl(120, 100%, 40%);">+        if (ispresent(dec.sndcp)) {</span><br><span style="color: hsl(120, 100%, 40%);">+           pt.send(dec.sndcp) to vc_conn;</span><br><span style="color: hsl(120, 100%, 40%);">+        } else if (ispresent(dec.llc)) {</span><br><span style="color: hsl(120, 100%, 40%);">+              pt.send(dec.llc) to vc_conn;</span><br><span style="color: hsl(120, 100%, 40%);">+  } else {</span><br><span style="color: hsl(120, 100%, 40%);">+              pt.send(dec.bssgp) to vc_conn;</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 style="color: hsl(120, 100%, 40%);">+function f_llc_get_n_u_tx(inout LLC_Entity llc) return uint9_t {</span><br><span style="color: hsl(120, 100%, 40%);">+    var uint9_t ret := llc.n_u_tx_next;</span><br><span style="color: hsl(120, 100%, 40%);">+   llc.n_u_tx_next := llc.n_u_tx_next + 1;</span><br><span style="color: hsl(120, 100%, 40%);">+       return ret;</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%);">+#ifdef BSSGP_EM_L3</span><br><span style="color: hsl(120, 100%, 40%);">+function f_llc_sapi_by_l3_mo(PDU_L3_MS_SGSN l3_mo) return BIT4 {</span><br><span style="color: hsl(120, 100%, 40%);">+        if (ischosen(l3_mo.msgs.gprs_mm)) {</span><br><span style="color: hsl(120, 100%, 40%);">+           return c_LLC_SAPI_LLGMM;</span><br><span style="color: hsl(120, 100%, 40%);">+      } else if (ischosen(l3_mo.msgs.gprs_sm)) {</span><br><span style="color: hsl(120, 100%, 40%);">+            return c_LLC_SAPI_LLGMM;</span><br><span style="color: hsl(120, 100%, 40%);">+      } else if (ischosen(l3_mo.msgs.sms)) {</span><br><span style="color: hsl(120, 100%, 40%);">+                return c_LLC_SAPI_LLSMS;</span><br><span style="color: hsl(120, 100%, 40%);">+      }</span><br><span style="color: hsl(120, 100%, 40%);">+     setverdict(fail, "No LLC SAPI for ", l3_mo);</span><br><span style="color: hsl(120, 100%, 40%);">+        mtc.stop;</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%);">+private function f_llc_sapi_by_l3_mt(PDU_L3_SGSN_MS l3_mt) return BIT4 {</span><br><span style="color: hsl(120, 100%, 40%);">+      if (ischosen(l3_mt.msgs.gprs_mm)) {</span><br><span style="color: hsl(120, 100%, 40%);">+           return c_LLC_SAPI_LLGMM;</span><br><span style="color: hsl(120, 100%, 40%);">+      } else if (ischosen(l3_mt.msgs.gprs_sm)) {</span><br><span style="color: hsl(120, 100%, 40%);">+            return c_LLC_SAPI_LLGMM;</span><br><span style="color: hsl(120, 100%, 40%);">+      } else if (ischosen(l3_mt.msgs.sms)) {</span><br><span style="color: hsl(120, 100%, 40%);">+                return c_LLC_SAPI_LLSMS;</span><br><span style="color: hsl(120, 100%, 40%);">+      }</span><br><span style="color: hsl(120, 100%, 40%);">+     setverdict(fail, "No LLC SAPI for ", l3_mt);</span><br><span style="color: hsl(120, 100%, 40%);">+        mtc.stop;</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+#endif</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+/* main loop of BSSGP_CT */</span><br><span style="color: hsl(120, 100%, 40%);">+private function f_bssgp_ScanEvents() runs on BSSGP_CT {</span><br><span style="color: hsl(120, 100%, 40%);">+ while (true) {</span><br><span style="color: hsl(120, 100%, 40%);">+                alt {</span><br><span style="color: hsl(120, 100%, 40%);">+         [g_sign_bvc_state == BVC_S_WAIT_RESET] as_sig_wait_reset();</span><br><span style="color: hsl(120, 100%, 40%);">+           [g_sign_bvc_state == BVC_S_WAIT_NS_ALIVE_UNBLOCKED] as_sig_wait_ns_alive_unblocked();</span><br><span style="color: hsl(120, 100%, 40%);">+         [g_sign_bvc_state == BVC_S_UNBLOCKED] as_sig_unblocked();</span><br><span style="color: hsl(120, 100%, 40%);">+             [] as_sig_allstate();</span><br><span style="color: hsl(120, 100%, 40%);">+         }</span><br><span style="color: hsl(120, 100%, 40%);">+     } /* while */</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%);">+/* generate a send template. Cannot be a real template as we want to use g_cfg.nsei */</span><br><span style="color: hsl(120, 100%, 40%);">+private function f_BnsUdReq(template PDU_BSSGP pdu, BssgpBvci bvci)</span><br><span style="color: hsl(120, 100%, 40%);">+runs on BSSGP_CT return NsUnitdataRequest {</span><br><span style="color: hsl(120, 100%, 40%);">+  var NsUnitdataRequest udr := {</span><br><span style="color: hsl(120, 100%, 40%);">+                bvci := bvci,</span><br><span style="color: hsl(120, 100%, 40%);">+         nsei := g_cfg.nsei,</span><br><span style="color: hsl(120, 100%, 40%);">+           /* for some weird reason we get "Dynamic test case error: Text encoder: Encoding an</span><br><span style="color: hsl(120, 100%, 40%);">+               * unbound integer value." when trying to send the reocrd rather than the octetstring */</span><br><span style="color: hsl(120, 100%, 40%);">+         //sdu := omit,</span><br><span style="color: hsl(120, 100%, 40%);">+                //bssgp := valueof(pdu)</span><br><span style="color: hsl(120, 100%, 40%);">+               sdu := enc_PDU_BSSGP(valueof(pdu)),</span><br><span style="color: hsl(120, 100%, 40%);">+           bssgp := omit</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+     return udr;</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%);">+/* generate a receive template. Cannot be a real template as we want to use g_cfg.nsei */</span><br><span style="color: hsl(120, 100%, 40%);">+private function f_BnsUdInd(template PDU_BSSGP pdu, template BssgpBvci bvci)</span><br><span style="color: hsl(120, 100%, 40%);">+runs on BSSGP_CT return template (present) NsUnitdataIndication {</span><br><span style="color: hsl(120, 100%, 40%);">+  var template (present) NsUnitdataIndication udi := {</span><br><span style="color: hsl(120, 100%, 40%);">+          bvci := bvci,</span><br><span style="color: hsl(120, 100%, 40%);">+         nsei := g_cfg.nsei,</span><br><span style="color: hsl(120, 100%, 40%);">+           sdu := *,</span><br><span style="color: hsl(120, 100%, 40%);">+             bssgp := pdu</span><br><span style="color: hsl(120, 100%, 40%);">+  }</span><br><span style="color: hsl(120, 100%, 40%);">+     return udi;</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%);">+/* change state of signaling BVCI; notify per-BVC components */</span><br><span style="color: hsl(120, 100%, 40%);">+private function f_sign_change_state(BvcState new_state) runs on BSSGP_CT {</span><br><span style="color: hsl(120, 100%, 40%);">+        if (new_state == g_sign_bvc_state) {</span><br><span style="color: hsl(120, 100%, 40%);">+          return;</span><br><span style="color: hsl(120, 100%, 40%);">+       }</span><br><span style="color: hsl(120, 100%, 40%);">+     log("BVCI(0) State Transition: ", g_sign_bvc_state, " -> ", new_state);</span><br><span style="color: hsl(120, 100%, 40%);">+        g_sign_bvc_state := new_state;</span><br><span style="color: hsl(120, 100%, 40%);">+        for (var integer i := 0; i < sizeof(BvcTable); i := i+1) {</span><br><span style="color: hsl(120, 100%, 40%);">+         if (isbound(BvcTable[i].comp_ref) and BvcTable[i].comp_ref != null) {</span><br><span style="color: hsl(120, 100%, 40%);">+                 BVC.send(ts_BssgpStsInd(g_cfg.nsei, 0, g_sign_bvc_state)) to BvcTable[i].comp_ref;</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 style="color: hsl(120, 100%, 40%);">+/* User wants to get per-BVC component reference from BSSGP_CT */</span><br><span style="color: hsl(120, 100%, 40%);">+signature BSSGP_get_bvci_ct(BssgpBvci bvci) return BSSGP_BVC_CT;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+type port BSSGP_CT_PROC_PT procedure {</span><br><span style="color: hsl(120, 100%, 40%);">+ inout BSSGP_get_bvci_ct</span><br><span style="color: hsl(120, 100%, 40%);">+} with { extension "internal" };</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+/* convenience wrapper function for user */</span><br><span style="color: hsl(120, 100%, 40%);">+function f_bssgp_get_bvci_ct(BssgpBvci bvci, BSSGP_CT_PROC_PT PT) return BSSGP_BVC_CT {</span><br><span style="color: hsl(120, 100%, 40%);">+   var BSSGP_BVC_CT res;</span><br><span style="color: hsl(120, 100%, 40%);">+ PT.call(BSSGP_get_bvci_ct:{bvci}) {</span><br><span style="color: hsl(120, 100%, 40%);">+           [] PT.getreply(BSSGP_get_bvci_ct:{bvci})-> value res {</span><br><span style="color: hsl(120, 100%, 40%);">+                     return res;</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 style="color: hsl(120, 100%, 40%);">+/***********************************************************************</span><br><span style="color: hsl(120, 100%, 40%);">+ * per-BVC (Cell) Component</span><br><span style="color: hsl(120, 100%, 40%);">+ ***********************************************************************</span><br><span style="color: hsl(120, 100%, 40%);">+ * Any number of these components runs on top of the BSSGP_CT, each</span><br><span style="color: hsl(120, 100%, 40%);">+ * representing one PTP BVC within this NSE.  Users (test cases) can</span><br><span style="color: hsl(120, 100%, 40%);">+ * register with TLLI and/or IMSI via the procedure port.</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%);">+/* per-BVC component. Exists once per cell within a BSSGP_CT */</span><br><span style="color: hsl(120, 100%, 40%);">+type component BSSGP_BVC_CT {</span><br><span style="color: hsl(120, 100%, 40%);">+    /* port towards the underlying BSSGP_CT */</span><br><span style="color: hsl(120, 100%, 40%);">+    port BSSGP_BVC_PT BVC;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+      /* BSSGP-User SAP towards the user (Client) */</span><br><span>       port BSSGP_SP_PT BSSGP_SP;</span><br><span>   port BSSGP_SP_PT BSSGP_SP_SIG;</span><br><span>       port BSSGP_PROC_PT BSSGP_PROC;</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-      var BssgpConfig g_cfg;</span><br><span style="color: hsl(120, 100%, 40%);">+        var BssgpBvcConfig g_cfg;</span><br><span style="color: hsl(120, 100%, 40%);">+     var boolean g_sgsn_role;</span><br><span> </span><br><span>         var BvcState g_ptp_bvc_state := BVC_S_BLOCKED;</span><br><span>       timer g_T1 := 15.0;</span><br><span>  timer g_T2 := 60.0;</span><br><span style="color: hsl(120, 100%, 40%);">+   var boolean g_t1_waits_for_block_ack := false;</span><br><span> </span><br><span>   var ClientEntity ClientTable[16];</span><br><span style="color: hsl(0, 100%, 40%);">-}</span><br><span style="color: hsl(120, 100%, 40%);">+};</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-type record length(16) of LLC_Entity LLC_Entities;</span><br><span style="color: hsl(120, 100%, 40%);">+/* port between global BSSGP_CT and per-BVC BSSGP_BVC_CT */</span><br><span style="color: hsl(120, 100%, 40%);">+type port BSSGP_BVC_SP_PT message {</span><br><span style="color: hsl(120, 100%, 40%);">+        in      NsUnitdataRequest;</span><br><span style="color: hsl(120, 100%, 40%);">+    out     ASP_Event,</span><br><span style="color: hsl(120, 100%, 40%);">+            BssgpStatusIndication,</span><br><span style="color: hsl(120, 100%, 40%);">+                BssgpResetIndication,</span><br><span style="color: hsl(120, 100%, 40%);">+         NsUnitdataIndication;</span><br><span style="color: hsl(120, 100%, 40%);">+} with { extension "internal" };</span><br><span style="color: hsl(120, 100%, 40%);">+type port BSSGP_BVC_PT message {</span><br><span style="color: hsl(120, 100%, 40%);">+   in      ASP_Event,</span><br><span style="color: hsl(120, 100%, 40%);">+            BssgpStatusIndication,</span><br><span style="color: hsl(120, 100%, 40%);">+                BssgpResetIndication,</span><br><span style="color: hsl(120, 100%, 40%);">+         NsUnitdataIndication;</span><br><span style="color: hsl(120, 100%, 40%);">+ out     NsUnitdataRequest;</span><br><span style="color: hsl(120, 100%, 40%);">+} with { extension "internal" };</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+/* one element in the per-TLLI state table */</span><br><span> type record ClientEntity {</span><br><span>    OCT4 tlli,</span><br><span>   OCT4 tlli_old optional,</span><br><span>      hexstring imsi,</span><br><span style="color: hsl(0, 100%, 40%);">- BssgpCellId cell_id,</span><br><span>         BSSGP_Client_CT comp_ref,</span><br><span>    /* LLC entities, one for each SAPI */</span><br><span>        LLC_Entity llc[16]</span><br><span> };</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span> type record LLC_Entity {</span><br><span>         boolean sgsn_role,</span><br><span>   /* N(U) on transmit side for next PDU */</span><br><span>@@ -173,6 +647,7 @@</span><br><span>       /* N(U) on receive side, last PDU */</span><br><span>         uint9_t n_u_rx_last optional</span><br><span> };</span><br><span style="color: hsl(120, 100%, 40%);">+type record length(16) of LLC_Entity LLC_Entities;</span><br><span> </span><br><span> function f_llc_create(boolean sgsn_role := false) return LLC_Entities {</span><br><span>        var LLC_Entities llc;</span><br><span>@@ -188,6 +663,19 @@</span><br><span>         n_u_rx_last := -</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+/* configuration of BSSGP_CT */</span><br><span style="color: hsl(120, 100%, 40%);">+type record BssgpConfig {</span><br><span style="color: hsl(120, 100%, 40%);">+ Nsvci nsei,</span><br><span style="color: hsl(120, 100%, 40%);">+   boolean sgsn_role,</span><br><span style="color: hsl(120, 100%, 40%);">+    BssgpBvcConfigs bvc</span><br><span style="color: hsl(120, 100%, 40%);">+};</span><br><span style="color: hsl(120, 100%, 40%);">+/* Configuration of one BVC (Cell) BSSGP_BVC_CT */</span><br><span style="color: hsl(120, 100%, 40%);">+type record BssgpBvcConfig {</span><br><span style="color: hsl(120, 100%, 40%);">+     BssgpBvci bvci,</span><br><span style="color: hsl(120, 100%, 40%);">+       BssgpCellId cell_id,</span><br><span style="color: hsl(120, 100%, 40%);">+  BssgpDecodeDepth depth</span><br><span style="color: hsl(120, 100%, 40%);">+};</span><br><span style="color: hsl(120, 100%, 40%);">+type record of BssgpBvcConfig BssgpBvcConfigs;</span><br><span> type enumerated BssgpDecodeDepth {</span><br><span>     BSSGP_DECODE_DEPTH_BSSGP,</span><br><span>    BSSGP_DECODE_DEPTH_LLC,</span><br><span>@@ -198,83 +686,488 @@</span><br><span> #endif</span><br><span> };</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-type record BssgpConfig {</span><br><span style="color: hsl(0, 100%, 40%);">-   Nsvci nsei,</span><br><span style="color: hsl(0, 100%, 40%);">-     Nsvci bvci,</span><br><span style="color: hsl(0, 100%, 40%);">-     BssgpCellId cell_id,</span><br><span style="color: hsl(0, 100%, 40%);">-    boolean sgsn_role,</span><br><span style="color: hsl(0, 100%, 40%);">-      BssgpDecodeDepth depth</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%);">-function f_BnsUdReq(template PDU_BSSGP pdu, BssgpBvci bvci)</span><br><span style="color: hsl(0, 100%, 40%);">-runs on BSSGP_CT return NsUnitdataRequest {</span><br><span style="color: hsl(0, 100%, 40%);">-  var NsUnitdataRequest udr := {</span><br><span style="color: hsl(0, 100%, 40%);">-          bvci := bvci,</span><br><span style="color: hsl(0, 100%, 40%);">-           nsei := g_cfg.nsei,</span><br><span style="color: hsl(0, 100%, 40%);">-             /* for some weird reason we get "Dynamic test case error: Text encoder: Encoding an</span><br><span style="color: hsl(0, 100%, 40%);">-                 * unbound integer value." when trying to send the reocrd rather than the octetstring */</span><br><span style="color: hsl(0, 100%, 40%);">-           //sdu := omit,</span><br><span style="color: hsl(0, 100%, 40%);">-          //bssgp := valueof(pdu)</span><br><span style="color: hsl(0, 100%, 40%);">-         sdu := enc_PDU_BSSGP(valueof(pdu)),</span><br><span style="color: hsl(0, 100%, 40%);">-             bssgp := omit</span><br><span style="color: hsl(120, 100%, 40%);">+/*</span><br><span style="color: hsl(120, 100%, 40%);">+private function f_tbl_init() runs on BSSGP_BVC_CT {</span><br><span style="color: hsl(120, 100%, 40%);">+       var integer i;</span><br><span style="color: hsl(120, 100%, 40%);">+        for (i := 0; i < sizeof(ImsiTable); i := i+1) {</span><br><span style="color: hsl(120, 100%, 40%);">+            ImsiTable[i] := -;</span><br><span>   }</span><br><span style="color: hsl(0, 100%, 40%);">-       return udr;</span><br><span style="color: hsl(0, 100%, 40%);">-}</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-function f_BnsUdInd(template PDU_BSSGP pdu, template BssgpBvci bvci)</span><br><span style="color: hsl(0, 100%, 40%);">-runs on BSSGP_CT return template NsUnitdataIndication {</span><br><span style="color: hsl(0, 100%, 40%);">-     var template NsUnitdataIndication udi := {</span><br><span style="color: hsl(0, 100%, 40%);">-              bvci := bvci,</span><br><span style="color: hsl(0, 100%, 40%);">-           nsei := g_cfg.nsei,</span><br><span style="color: hsl(0, 100%, 40%);">-             sdu := *,</span><br><span style="color: hsl(0, 100%, 40%);">-               bssgp := pdu</span><br><span style="color: hsl(120, 100%, 40%);">+  for (i := 0; i < sizeof(TlliTable); i := i+1) {</span><br><span style="color: hsl(120, 100%, 40%);">+            TlliTable[i] := -;</span><br><span>   }</span><br><span style="color: hsl(0, 100%, 40%);">-       return udi;</span><br><span> }</span><br><span style="color: hsl(120, 100%, 40%);">+*/</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-private function f_change_state(BvcState new_state) runs on BSSGP_CT {</span><br><span style="color: hsl(0, 100%, 40%);">-  log("BSSGP State Transition: ", g_ptp_bvc_state, " -> ", new_state);</span><br><span style="color: hsl(0, 100%, 40%);">-     g_ptp_bvc_state := new_state;</span><br><span style="color: hsl(0, 100%, 40%);">-   for (var integer i := 0; i < sizeof(ClientTable); i := i+1) {</span><br><span style="color: hsl(0, 100%, 40%);">-                if (isbound(ClientTable[i].comp_ref)) {</span><br><span style="color: hsl(0, 100%, 40%);">-                 BSSGP_SP.send(t_BssgpStsInd(g_cfg.nsei, g_cfg.bvci, g_ptp_bvc_state)) to ClientTable[i].comp_ref;</span><br><span style="color: hsl(120, 100%, 40%);">+private function f_tbl_client_add(hexstring imsi, OCT4 tlli, BSSGP_Client_CT vc_conn)</span><br><span style="color: hsl(120, 100%, 40%);">+runs on BSSGP_BVC_CT {</span><br><span style="color: hsl(120, 100%, 40%);">+      var integer i;</span><br><span style="color: hsl(120, 100%, 40%);">+        for (i := 0; i < sizeof(ClientTable); i := i+1) {</span><br><span style="color: hsl(120, 100%, 40%);">+          if (not isvalue(ClientTable[i].comp_ref)) {</span><br><span style="color: hsl(120, 100%, 40%);">+                   log("Adding Client=", vc_conn, ", IMSI=", imsi, ", TLLI=", tlli, ", index=", i);</span><br><span style="color: hsl(120, 100%, 40%);">+                      ClientTable[i] := {</span><br><span style="color: hsl(120, 100%, 40%);">+                           tlli := tlli,</span><br><span style="color: hsl(120, 100%, 40%);">+                         tlli_old := omit,</span><br><span style="color: hsl(120, 100%, 40%);">+                             imsi := imsi,</span><br><span style="color: hsl(120, 100%, 40%);">+                         comp_ref := vc_conn,</span><br><span style="color: hsl(120, 100%, 40%);">+                          llc := -</span><br><span style="color: hsl(120, 100%, 40%);">+                      };</span><br><span style="color: hsl(120, 100%, 40%);">+                    for (var integer j := 0; j < sizeof(ClientTable[i].llc); j := j+1) {</span><br><span style="color: hsl(120, 100%, 40%);">+                               ClientTable[i].llc[j] := valueof(t_LLC_init(g_sgsn_role));</span><br><span style="color: hsl(120, 100%, 40%);">+                    }</span><br><span style="color: hsl(120, 100%, 40%);">+                     return;</span><br><span>              }</span><br><span>    }</span><br><span style="color: hsl(120, 100%, 40%);">+     testcase.stop("Client Table full");</span><br><span> }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-private function f_sendReset(BssgpBvci bvci) runs on BSSGP_CT {</span><br><span style="color: hsl(120, 100%, 40%);">+private function f_tbl_client_del(hexstring imsi, BSSGP_Client_CT vc_conn) runs on BSSGP_BVC_CT {</span><br><span style="color: hsl(120, 100%, 40%);">+      var integer i;</span><br><span style="color: hsl(120, 100%, 40%);">+        for (i := 0; i < sizeof(ClientTable); i := i+1) {</span><br><span style="color: hsl(120, 100%, 40%);">+          if (isvalue(ClientTable[i].imsi) and ClientTable[i].imsi == imsi) {</span><br><span style="color: hsl(120, 100%, 40%);">+                   if (ClientTable[i].comp_ref != vc_conn) {</span><br><span style="color: hsl(120, 100%, 40%);">+                             setverdict(fail, "Cannot unregister index=", i, " IMSI ", imsi, " registred to ",</span><br><span style="color: hsl(120, 100%, 40%);">+                                          ClientTable[i].comp_ref, " from ", vc_conn);</span><br><span style="color: hsl(120, 100%, 40%);">+                             mtc.stop;</span><br><span style="color: hsl(120, 100%, 40%);">+                     }</span><br><span style="color: hsl(120, 100%, 40%);">+                     log("Removing Client IMSI=", imsi, ", index=", i);</span><br><span style="color: hsl(120, 100%, 40%);">+                        ClientTable[i] := {</span><br><span style="color: hsl(120, 100%, 40%);">+                           tlli := -,</span><br><span style="color: hsl(120, 100%, 40%);">+                            tlli_old := omit,</span><br><span style="color: hsl(120, 100%, 40%);">+                             imsi := ''H,</span><br><span style="color: hsl(120, 100%, 40%);">+                          comp_ref := null,</span><br><span style="color: hsl(120, 100%, 40%);">+                             llc := - };</span><br><span style="color: hsl(120, 100%, 40%);">+                   return;</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%);">+     log("Warning: Could not find client for IMSI ", imsi);</span><br><span style="color: hsl(120, 100%, 40%);">+      return;</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%);">+/* TS 44.064 7.2.1.1 LLGMM-ASSIGN */</span><br><span style="color: hsl(120, 100%, 40%);">+private function f_tbl_client_llgmm_assign(OCT4 tlli_old, OCT4 tlli_new, BSSGP_Client_CT vc_conn)</span><br><span style="color: hsl(120, 100%, 40%);">+runs on BSSGP_BVC_CT {</span><br><span style="color: hsl(120, 100%, 40%);">+ var integer i := f_tbl_idx_by_comp(vc_conn);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+        if (tlli_old == 'FFFFFFFF'O and tlli_new != 'FFFFFFFF'O) {</span><br><span style="color: hsl(120, 100%, 40%);">+            /* TLLI assignment */</span><br><span style="color: hsl(120, 100%, 40%);">+         ClientTable[i].tlli := tlli_new;</span><br><span style="color: hsl(120, 100%, 40%);">+              ClientTable[i].tlli_old := omit;</span><br><span style="color: hsl(120, 100%, 40%);">+      } else if (tlli_old != 'FFFFFFFF'O and tlli_new != 'FFFFFFFF'O) {</span><br><span style="color: hsl(120, 100%, 40%);">+             /* TLLI change: both active */</span><br><span style="color: hsl(120, 100%, 40%);">+                ClientTable[i].tlli := tlli_new;</span><br><span style="color: hsl(120, 100%, 40%);">+              ClientTable[i].tlli_old := tlli_old;</span><br><span style="color: hsl(120, 100%, 40%);">+  } else if (tlli_old != 'FFFFFFFF'O and tlli_new == 'FFFFFFFF'O) {</span><br><span style="color: hsl(120, 100%, 40%);">+             /* TLLI unassignment: old shall be unassigned; new stays */</span><br><span style="color: hsl(120, 100%, 40%);">+           ClientTable[i].tlli_old := omit;</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%);">+private function f_tbl_comp_by_imsi(hexstring imsi) runs on BSSGP_BVC_CT return BSSGP_Client_CT {</span><br><span style="color: hsl(120, 100%, 40%);">+     var integer i;</span><br><span style="color: hsl(120, 100%, 40%);">+        for (i := 0; i < sizeof(ClientTable); i := i+1) {</span><br><span style="color: hsl(120, 100%, 40%);">+          if (isvalue(ClientTable[i].imsi) and isvalue(ClientTable[i].comp_ref)</span><br><span style="color: hsl(120, 100%, 40%);">+             and ClientTable[i].imsi == imsi) {</span><br><span style="color: hsl(120, 100%, 40%);">+                        return ClientTable[i].comp_ref;</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%);">+     setverdict(fail, "Couldn't find Component for IMSI ", imsi);</span><br><span style="color: hsl(120, 100%, 40%);">+    mtc.stop;</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%);">+private function f_tbl_comp_by_tlli(OCT4 tlli) runs on BSSGP_BVC_CT return BSSGP_Client_CT {</span><br><span style="color: hsl(120, 100%, 40%);">+  var integer i;</span><br><span style="color: hsl(120, 100%, 40%);">+        for (i := 0; i < sizeof(ClientTable); i := i+1) {</span><br><span style="color: hsl(120, 100%, 40%);">+          if (isvalue(ClientTable[i].comp_ref) and</span><br><span style="color: hsl(120, 100%, 40%);">+                  (isvalue(ClientTable[i].tlli) and (ClientTable[i].tlli == tlli or</span><br><span style="color: hsl(120, 100%, 40%);">+              isvalue(ClientTable[i].tlli_old) and ClientTable[i].tlli_old == tlli) )) {</span><br><span style="color: hsl(120, 100%, 40%);">+                       return ClientTable[i].comp_ref;</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%);">+     setverdict(fail, "Couldn't find Component for TLLI ", tlli);</span><br><span style="color: hsl(120, 100%, 40%);">+    mtc.stop;</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%);">+private function f_tbl_idx_by_comp(BSSGP_Client_CT comp_ref) runs on BSSGP_BVC_CT return integer {</span><br><span style="color: hsl(120, 100%, 40%);">+    var integer i;</span><br><span style="color: hsl(120, 100%, 40%);">+        for (i := 0; i < sizeof(ClientTable); i := i+1) {</span><br><span style="color: hsl(120, 100%, 40%);">+          if (isvalue(ClientTable[i].comp_ref) and ClientTable[i].comp_ref == comp_ref) {</span><br><span style="color: hsl(120, 100%, 40%);">+                       return i;</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%);">+     setverdict(fail, "Couldn't find Client for Component ", comp_ref);</span><br><span style="color: hsl(120, 100%, 40%);">+      mtc.stop;</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%);">+private function f_tbl_tlli_by_comp(BSSGP_Client_CT comp_ref) runs on BSSGP_BVC_CT return OCT4 {</span><br><span style="color: hsl(120, 100%, 40%);">+      var integer i;</span><br><span style="color: hsl(120, 100%, 40%);">+        for (i := 0; i < sizeof(ClientTable); i := i+1) {</span><br><span style="color: hsl(120, 100%, 40%);">+          if (isvalue(ClientTable[i].tlli) and isvalue(ClientTable[i].comp_ref)</span><br><span style="color: hsl(120, 100%, 40%);">+             and ClientTable[i].comp_ref == comp_ref) {</span><br><span style="color: hsl(120, 100%, 40%);">+                        return ClientTable[i].tlli;</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%);">+     setverdict(fail, "Couldn't find TLLI for Component ", comp_ref);</span><br><span style="color: hsl(120, 100%, 40%);">+        mtc.stop;</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%);">+/* PDU_BSSGP enhanced with LLC and possibly L3 decoded payloads */</span><br><span style="color: hsl(120, 100%, 40%);">+type record BssgpDecoded {</span><br><span style="color: hsl(120, 100%, 40%);">+        PDU_BSSGP bssgp,</span><br><span style="color: hsl(120, 100%, 40%);">+      PDU_LLC llc optional,</span><br><span style="color: hsl(120, 100%, 40%);">+#ifdef BSSGP_EM_L3</span><br><span style="color: hsl(120, 100%, 40%);">+     PDU_L3_MS_SGSN l3_mo optional,</span><br><span style="color: hsl(120, 100%, 40%);">+        PDU_L3_SGSN_MS l3_mt optional,</span><br><span style="color: hsl(120, 100%, 40%);">+#endif</span><br><span style="color: hsl(120, 100%, 40%);">+        PDU_SN sndcp optional</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%);">+/* Decode a PDU_BSSGP into a BssgpDecoded (i.e. with LLC/L3 decoded, as applicable) */</span><br><span style="color: hsl(120, 100%, 40%);">+private function f_dec_bssgp(PDU_BSSGP bssgp) runs on BSSGP_BVC_CT return BssgpDecoded {</span><br><span style="color: hsl(120, 100%, 40%);">+  var BssgpDecoded dec := {</span><br><span style="color: hsl(120, 100%, 40%);">+             bssgp := bssgp,</span><br><span style="color: hsl(120, 100%, 40%);">+               llc := omit,</span><br><span style="color: hsl(120, 100%, 40%);">+#ifdef BSSGP_EM_L3</span><br><span style="color: hsl(120, 100%, 40%);">+              l3_mo := omit,</span><br><span style="color: hsl(120, 100%, 40%);">+                l3_mt := omit,</span><br><span style="color: hsl(120, 100%, 40%);">+#endif</span><br><span style="color: hsl(120, 100%, 40%);">+                sndcp := omit</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%);">+  /* Decode LLC, if it is a PDU that contains LLC */</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 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%);">+   /* Decode SNDCP, if it is a LLC PDU containing user plane data */</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 style="color: hsl(120, 100%, 40%);">+     }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+#ifdef BSSGP_EM_L3</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_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%);">+#endif</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   return dec;</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%);">+private function f_ptp_sendUnblock() runs on BSSGP_BVC_CT {</span><br><span style="color: hsl(120, 100%, 40%);">+ BVC.send(ts_ptp_BnsUdReq(t_BVC_UNBLOCK(g_cfg.bvci), 0));</span><br><span style="color: hsl(120, 100%, 40%);">+      g_t1_waits_for_block_ack := false;</span><br><span style="color: hsl(120, 100%, 40%);">+    g_T1.start;</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%);">+private function f_ptp_sendBlock(BssgpCause cause) runs on BSSGP_BVC_CT {</span><br><span style="color: hsl(120, 100%, 40%);">+   BVC.send(ts_ptp_BnsUdReq(t_BVC_BLOCK(g_cfg.bvci, cause), 0));</span><br><span style="color: hsl(120, 100%, 40%);">+ g_t1_waits_for_block_ack := true;</span><br><span style="color: hsl(120, 100%, 40%);">+     g_T1.start;</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%);">+private function f_ptp_sendStatus(BssgpCause cause, PDU_BSSGP pdu) runs on BSSGP_BVC_CT {</span><br><span style="color: hsl(120, 100%, 40%);">+   /* FIXME: Make sure correct Signaling or PTP BVCI is used! */</span><br><span style="color: hsl(120, 100%, 40%);">+ BVC.send(ts_ptp_BnsUdReq(ts_BSSGP_STATUS(g_cfg.bvci, cause, pdu), g_cfg.bvci));</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%);">+private function f_ptp_sendReset() runs on BSSGP_BVC_CT {</span><br><span>      var PDU_BSSGP pdu;</span><br><span> </span><br><span>       /* The Cell Identifier IE is mandatory in the BVC-RESET PDU sent from BSS to</span><br><span>          * SGSN in order to reset a BVC corresponding to a PTP functional entity. The</span><br><span>         * Cell Identifier IE shall not be used in any other BVC-RESET PDU. */</span><br><span style="color: hsl(0, 100%, 40%);">-  if (g_cfg.sgsn_role) {</span><br><span style="color: hsl(0, 100%, 40%);">-          pdu := valueof(ts_BVC_RESET(BSSGP_CAUSE_OM_INTERVENTION, bvci, omit));</span><br><span style="color: hsl(120, 100%, 40%);">+        if (g_sgsn_role) {</span><br><span style="color: hsl(120, 100%, 40%);">+            pdu := valueof(ts_BVC_RESET(BSSGP_CAUSE_OM_INTERVENTION, g_cfg.bvci, omit));</span><br><span>         } else {</span><br><span style="color: hsl(0, 100%, 40%);">-                pdu := valueof(ts_BVC_RESET(BSSGP_CAUSE_OM_INTERVENTION, bvci, g_cfg.cell_id));</span><br><span style="color: hsl(120, 100%, 40%);">+               pdu := valueof(ts_BVC_RESET(BSSGP_CAUSE_OM_INTERVENTION, g_cfg.bvci, g_cfg.cell_id));</span><br><span>        }</span><br><span style="color: hsl(0, 100%, 40%);">-       log("PDU: ", pdu);</span><br><span style="color: hsl(0, 100%, 40%);">-    log("ENC: ", enc_PDU_BSSGP(pdu));</span><br><span> </span><br><span>      /* BVC-RESET is always sent via the SIGNALLING BVCI, see Table 5.4.1 */</span><br><span style="color: hsl(0, 100%, 40%);">- BSCP.send(f_BnsUdReq(pdu, 0));</span><br><span style="color: hsl(120, 100%, 40%);">+        BVC.send(ts_ptp_BnsUdReq(pdu, 0));</span><br><span>   g_T2.start;</span><br><span>  //f_change_state(BVC_S_WAIT_RESET);</span><br><span> }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-private function f_sendUnblock() runs on BSSGP_CT {</span><br><span style="color: hsl(0, 100%, 40%);">- BSCP.send(f_BnsUdReq(t_BVC_UNBLOCK(g_cfg.bvci), 0));</span><br><span style="color: hsl(0, 100%, 40%);">-    g_T1.start;</span><br><span style="color: hsl(120, 100%, 40%);">+/* PTP-BVC is in BVC_S_BLOCKED state */</span><br><span style="color: hsl(120, 100%, 40%);">+private altstep as_ptp_blocked() runs on BSSGP_BVC_CT {</span><br><span style="color: hsl(120, 100%, 40%);">+ var NsUnitdataIndication udi;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+       [g_T1.running and not g_t1_waits_for_block_ack] BVC.receive(tr_ptp_BnsUdInd(t_BVC_UNBLOCK_ACK(g_cfg.bvci), 0)) {</span><br><span style="color: hsl(120, 100%, 40%);">+              g_T1.stop;</span><br><span style="color: hsl(120, 100%, 40%);">+            f_ptp_change_state(BVC_S_UNBLOCKED);</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%);">+   /* RESET-ACK before T2 timeout: reset successful. In SGSN role, CellID must be present */</span><br><span style="color: hsl(120, 100%, 40%);">+     [g_T2.running and g_sgsn_role] BVC.receive(tr_ptp_BnsUdInd(tr_BVC_RESET_ACK(g_cfg.bvci, g_cfg.cell_id), 0)) -> value udi {</span><br><span style="color: hsl(120, 100%, 40%);">+         g_T2.stop;</span><br><span style="color: hsl(120, 100%, 40%);">+            f_ptp_change_state(BVC_S_UNBLOCKED);</span><br><span style="color: hsl(120, 100%, 40%);">+  }</span><br><span style="color: hsl(120, 100%, 40%);">+     /* RESET-ACK before T2 timeout: reset successful. In BSS role, CellID must be absent */</span><br><span style="color: hsl(120, 100%, 40%);">+       [g_T2.running and not g_sgsn_role] BVC.receive(tr_ptp_BnsUdInd(tr_BVC_RESET_ACK(g_cfg.bvci, omit), 0)) -> value udi {</span><br><span style="color: hsl(120, 100%, 40%);">+              g_T2.stop;</span><br><span style="color: hsl(120, 100%, 40%);">+            f_ptp_change_state(BVC_S_UNBLOCKED);</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%);">+   [] g_T2.timeout {</span><br><span style="color: hsl(120, 100%, 40%);">+             /* BVC-RESET-ACK PDU was not received within T2: retransmit */</span><br><span style="color: hsl(120, 100%, 40%);">+                f_ptp_sendReset();</span><br><span style="color: hsl(120, 100%, 40%);">+    }</span><br><span> }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-private function f_sendBlock(BssgpCause cause) runs on BSSGP_CT {</span><br><span style="color: hsl(0, 100%, 40%);">-     BSCP.send(f_BnsUdReq(t_BVC_BLOCK(g_cfg.bvci, cause), 0));</span><br><span style="color: hsl(0, 100%, 40%);">-       g_T1.start;</span><br><span style="color: hsl(120, 100%, 40%);">+/* PTP-BVC is in UNBLOCKED state */</span><br><span style="color: hsl(120, 100%, 40%);">+private altstep as_ptp_unblocked() runs on BSSGP_BVC_CT {</span><br><span style="color: hsl(120, 100%, 40%);">+   var NsUnitdataIndication udi;</span><br><span style="color: hsl(120, 100%, 40%);">+ var NsStatusIndication nsi;</span><br><span style="color: hsl(120, 100%, 40%);">+   var BSSGP_Client_CT vc_conn;</span><br><span style="color: hsl(120, 100%, 40%);">+  var ASP_Event evt;</span><br><span style="color: hsl(120, 100%, 40%);">+    var PDU_BSSGP bs_pdu;</span><br><span style="color: hsl(120, 100%, 40%);">+ var PDU_LLC llc;</span><br><span style="color: hsl(120, 100%, 40%);">+#ifdef BSSGP_EM_L3</span><br><span style="color: hsl(120, 100%, 40%);">+  var PDU_L3_MS_SGSN l3_mo;</span><br><span style="color: hsl(120, 100%, 40%);">+     var PDU_L3_SGSN_MS l3_mt;</span><br><span style="color: hsl(120, 100%, 40%);">+#endif</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   /* bogus unblock, just respond with ACK */</span><br><span style="color: hsl(120, 100%, 40%);">+    [] BVC.receive(tr_ptp_BnsUdInd(t_BVC_UNBLOCK(g_cfg.bvci), 0)) -> value udi {</span><br><span style="color: hsl(120, 100%, 40%);">+               BVC.send(ts_ptp_BnsUdReq(t_BVC_UNBLOCK_ACK(g_cfg.bvci), 0));</span><br><span style="color: hsl(120, 100%, 40%);">+  }</span><br><span style="color: hsl(120, 100%, 40%);">+     /* Respond to BLOCK with BLOCK-ACK + change state */</span><br><span style="color: hsl(120, 100%, 40%);">+  [] BVC.receive(tr_ptp_BnsUdInd(t_BVC_BLOCK(g_cfg.bvci, ?), 0)) -> value udi {</span><br><span style="color: hsl(120, 100%, 40%);">+              BVC.send(ts_ptp_BnsUdReq(t_BVC_BLOCK_ACK(g_cfg.bvci), 0));</span><br><span style="color: hsl(120, 100%, 40%);">+            g_T1.stop;</span><br><span style="color: hsl(120, 100%, 40%);">+            f_ptp_change_state(BVC_S_BLOCKED);</span><br><span style="color: hsl(120, 100%, 40%);">+    }</span><br><span style="color: hsl(120, 100%, 40%);">+     /* BLOCK-ACK before T1 timeout: mark as blocked */</span><br><span style="color: hsl(120, 100%, 40%);">+    [g_T1.running and g_t1_waits_for_block_ack] BVC.receive(tr_ptp_BnsUdInd(t_BVC_BLOCK_ACK(g_cfg.bvci), 0)) -> value udi {</span><br><span style="color: hsl(120, 100%, 40%);">+            g_T1.stop;</span><br><span style="color: hsl(120, 100%, 40%);">+            f_ptp_change_state(BVC_S_BLOCKED);</span><br><span style="color: hsl(120, 100%, 40%);">+    }</span><br><span style="color: hsl(120, 100%, 40%);">+     /* Re-transmit BLOCK / UNBLOCK on T1 timeout */</span><br><span style="color: hsl(120, 100%, 40%);">+       [not g_t1_waits_for_block_ack] g_T1.timeout {</span><br><span style="color: hsl(120, 100%, 40%);">+         f_ptp_sendUnblock();</span><br><span style="color: hsl(120, 100%, 40%);">+  }</span><br><span style="color: hsl(120, 100%, 40%);">+     [g_t1_waits_for_block_ack] g_T1.timeout {</span><br><span style="color: hsl(120, 100%, 40%);">+             f_ptp_sendBlock(BSSGP_CAUSE_OM_INTERVENTION);</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%);">+   /* simply acknowledge all per-BVC Flow Control Messages */</span><br><span style="color: hsl(120, 100%, 40%);">+    [g_sgsn_role] BVC.receive(tr_ptp_BnsUdInd(tr_BVC_FC_BVC, g_cfg.bvci)) -> value udi {</span><br><span style="color: hsl(120, 100%, 40%);">+               var OCT1 tag := udi.bssgp.pDU_BSSGP_FLOW_CONTROL_BVC.tag.unstructured_Value;</span><br><span style="color: hsl(120, 100%, 40%);">+          BVC.send(ts_ptp_BnsUdReq(t_BVC_FC_BVC_ACK(tag), g_cfg.bvci));</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%);">+ [g_sgsn_role] BVC.receive(tr_ptp_BnsUdInd(t_BVC_FC_MS, g_cfg.bvci)) {</span><br><span style="color: hsl(120, 100%, 40%);">+         BVC.send(ts_ptp_BnsUdReq(t_BVC_FC_MS_ACK, g_cfg.bvci));</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%);">+ /* Any other PTP BSSGP message: If it has TLLI, route to component; otherwise broadcast */</span><br><span style="color: hsl(120, 100%, 40%);">+    [] BVC.receive(tr_ptp_BnsUdInd(?, g_cfg.bvci)) -> value udi {</span><br><span style="color: hsl(120, 100%, 40%);">+              var BssgpDecoded dec := f_dec_bssgp(udi.bssgp);</span><br><span style="color: hsl(120, 100%, 40%);">+               var template OCT4 tlli := f_bssgp_get_tlli(udi.bssgp);</span><br><span style="color: hsl(120, 100%, 40%);">+                if (isvalue(tlli)) {</span><br><span style="color: hsl(120, 100%, 40%);">+                  vc_conn := f_tbl_comp_by_tlli(valueof(tlli));</span><br><span style="color: hsl(120, 100%, 40%);">+                 f_send_bssgp_dec(dec, vc_conn, BSSGP_SP);</span><br><span style="color: hsl(120, 100%, 40%);">+             } else {</span><br><span style="color: hsl(120, 100%, 40%);">+                      log("No TLLI: Broadcasting ", dec);</span><br><span style="color: hsl(120, 100%, 40%);">+                 /* broadcast this message to all components */</span><br><span style="color: hsl(120, 100%, 40%);">+                        // TITAN DOESN'T DO THIS, *SIGH*: "BSSGP_SP.send(dec) to all component;"</span><br><span style="color: hsl(120, 100%, 40%);">+                        for (var integer i := 0; i < sizeof(ClientTable); i := i+1) {</span><br><span style="color: hsl(120, 100%, 40%);">+                              if (isbound(ClientTable[i].comp_ref) and ClientTable[i].comp_ref != null) {</span><br><span style="color: hsl(120, 100%, 40%);">+                                   f_send_bssgp_dec(dec, ClientTable[i].comp_ref, BSSGP_SP);</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 style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   /* Any other SIG BSSGP message: If it has TLLI, route to component; otherwise broadcast */</span><br><span style="color: hsl(120, 100%, 40%);">+    [] BVC.receive(tr_ptp_BnsUdInd(?, 0)) -> value udi {</span><br><span style="color: hsl(120, 100%, 40%);">+               var BssgpDecoded dec := f_dec_bssgp(udi.bssgp);</span><br><span style="color: hsl(120, 100%, 40%);">+               var template OCT4 tlli := f_bssgp_get_tlli(udi.bssgp);</span><br><span style="color: hsl(120, 100%, 40%);">+                if (isvalue(tlli)) {</span><br><span style="color: hsl(120, 100%, 40%);">+                  vc_conn := f_tbl_comp_by_tlli(valueof(tlli));</span><br><span style="color: hsl(120, 100%, 40%);">+                 f_send_bssgp_dec(dec, vc_conn, BSSGP_SP_SIG);</span><br><span style="color: hsl(120, 100%, 40%);">+         } else {</span><br><span style="color: hsl(120, 100%, 40%);">+                      log("No TLLI: Broadcasting ", dec);</span><br><span style="color: hsl(120, 100%, 40%);">+                 /* broadcast this message to all components */</span><br><span style="color: hsl(120, 100%, 40%);">+                        // TITAN DOESN'T DO THIS, *SIGH*: "BSSGP_SP.send(dec) to all component;"</span><br><span style="color: hsl(120, 100%, 40%);">+                        for (var integer i := 0; i < sizeof(ClientTable); i := i+1) {</span><br><span style="color: hsl(120, 100%, 40%);">+                              if (isbound(ClientTable[i].comp_ref) and ClientTable[i].comp_ref != null) {</span><br><span style="color: hsl(120, 100%, 40%);">+                                   f_send_bssgp_dec(dec, ClientTable[i].comp_ref, BSSGP_SP_SIG);</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 style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   /* ConnHdlr sends BSSGP on BVCI=0 port: forward it to BSSGP_CT */</span><br><span style="color: hsl(120, 100%, 40%);">+     [] BSSGP_SP_SIG.receive(PDU_BSSGP:?)-> value bs_pdu sender vc_conn {</span><br><span style="color: hsl(120, 100%, 40%);">+               BVC.send(ts_ptp_BnsUdReq(bs_pdu, 0));</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%);">+   /* ConnHdlr sends BSSGP on BVCI=PTP port: forward it to BSSGP_CT */</span><br><span style="color: hsl(120, 100%, 40%);">+   [] BSSGP_SP.receive(PDU_BSSGP:?)-> value bs_pdu sender vc_conn {</span><br><span style="color: hsl(120, 100%, 40%);">+           BVC.send(ts_ptp_BnsUdReq(bs_pdu, g_cfg.bvci));</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%);">+#ifdef BSSGP_EM_L3</span><br><span style="color: hsl(120, 100%, 40%);">+       /* ConnHdlr sends L3: Encode and send as UL_UD / DL_UD */</span><br><span style="color: hsl(120, 100%, 40%);">+     [g_sgsn_role] BSSGP_SP.receive(PDU_L3_SGSN_MS:?) -> value l3_mt sender vc_conn {</span><br><span style="color: hsl(120, 100%, 40%);">+           var integer idx := f_tbl_idx_by_comp(vc_conn);</span><br><span style="color: hsl(120, 100%, 40%);">+                var octetstring l3_enc := enc_PDU_L3_SGSN_MS(l3_mt);</span><br><span style="color: hsl(120, 100%, 40%);">+          var BIT4 sapi := f_llc_sapi_by_l3_mt(l3_mt);</span><br><span style="color: hsl(120, 100%, 40%);">+          var integer n_u := f_llc_get_n_u_tx(ClientTable[idx].llc[bit2int(sapi)]);</span><br><span style="color: hsl(120, 100%, 40%);">+             var octetstring llc_enc := enc_PDU_LLC(valueof(ts_LLC_UI(l3_enc, sapi, '1'B, n_u)));</span><br><span style="color: hsl(120, 100%, 40%);">+          BVC.send(ts_ptp_BnsUdReq(ts_BSSGP_DL_UD(ClientTable[idx].tlli, llc_enc), g_cfg.bvci));</span><br><span style="color: hsl(120, 100%, 40%);">+        }</span><br><span style="color: hsl(120, 100%, 40%);">+     [not g_sgsn_role] BSSGP_SP.receive(PDU_L3_MS_SGSN:?) -> value l3_mo sender vc_conn {</span><br><span style="color: hsl(120, 100%, 40%);">+               var integer idx := f_tbl_idx_by_comp(vc_conn);</span><br><span style="color: hsl(120, 100%, 40%);">+                var octetstring l3_enc := enc_PDU_L3_MS_SGSN(l3_mo);</span><br><span style="color: hsl(120, 100%, 40%);">+          var BIT4 sapi := f_llc_sapi_by_l3_mo(l3_mo);</span><br><span style="color: hsl(120, 100%, 40%);">+          var integer n_u := f_llc_get_n_u_tx(ClientTable[idx].llc[bit2int(sapi)]);</span><br><span style="color: hsl(120, 100%, 40%);">+             var octetstring llc_enc := enc_PDU_LLC(valueof(ts_LLC_UI(l3_enc, sapi, '1'B, n_u)));</span><br><span style="color: hsl(120, 100%, 40%);">+          BVC.send(ts_ptp_BnsUdReq(ts_BSSGP_UL_UD(ClientTable[idx].tlli, g_cfg.cell_id, llc_enc), g_cfg.bvci));</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+#endif</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   /* ConnHdlr sends raw LLC: Encode and send as UL_UD / DL_UD */</span><br><span style="color: hsl(120, 100%, 40%);">+        [not g_sgsn_role] BSSGP_SP.receive(PDU_LLC:?) -> value llc sender vc_conn {</span><br><span style="color: hsl(120, 100%, 40%);">+                var integer idx := f_tbl_idx_by_comp(vc_conn);</span><br><span style="color: hsl(120, 100%, 40%);">+                var octetstring llc_enc := enc_PDU_LLC(llc);</span><br><span style="color: hsl(120, 100%, 40%);">+          BVC.send(ts_ptp_BnsUdReq(ts_BSSGP_UL_UD(ClientTable[idx].tlli, g_cfg.cell_id, llc_enc), g_cfg.bvci));</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+     [g_sgsn_role] BSSGP_SP.receive(PDU_LLC:?) -> value llc sender vc_conn {</span><br><span style="color: hsl(120, 100%, 40%);">+            var integer idx := f_tbl_idx_by_comp(vc_conn);</span><br><span style="color: hsl(120, 100%, 40%);">+                var octetstring llc_enc := enc_PDU_LLC(llc);</span><br><span style="color: hsl(120, 100%, 40%);">+          BVC.send(ts_ptp_BnsUdReq(ts_BSSGP_DL_UD(ClientTable[idx].tlli, llc_enc), g_cfg.bvci));</span><br><span style="color: hsl(120, 100%, 40%);">+        }</span><br><span> }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-private function f_sendStatus(BssgpCause cause, PDU_BSSGP pdu) runs on BSSGP_CT {</span><br><span style="color: hsl(0, 100%, 40%);">-     /* FIXME: Make sure correct Signaling or PTP BVCI is used! */</span><br><span style="color: hsl(0, 100%, 40%);">-   BSCP.send(f_BnsUdReq(ts_BSSGP_STATUS(g_cfg.bvci, cause, pdu), g_cfg.bvci));</span><br><span style="color: hsl(120, 100%, 40%);">+/* Events permitted in all states */</span><br><span style="color: hsl(120, 100%, 40%);">+private altstep as_ptp_allstate() runs on BSSGP_BVC_CT {</span><br><span style="color: hsl(120, 100%, 40%);">+   var NsUnitdataIndication udi;</span><br><span style="color: hsl(120, 100%, 40%);">+ var BSSGP_Client_CT vc_conn;</span><br><span style="color: hsl(120, 100%, 40%);">+  var OCT4 tlli, tlli_old;</span><br><span style="color: hsl(120, 100%, 40%);">+      var hexstring imsi;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ /* Signaling BVC was reset */</span><br><span style="color: hsl(120, 100%, 40%);">+ [] BVC.receive(BssgpResetIndication:{0}) {</span><br><span style="color: hsl(120, 100%, 40%);">+            if (not g_sgsn_role) {</span><br><span style="color: hsl(120, 100%, 40%);">+                        f_ptp_change_state(BVC_S_BLOCKED);</span><br><span style="color: hsl(120, 100%, 40%);">+                    /* when the BSS side signaling PTP is RESET, all PTP BVC must start the</span><br><span style="color: hsl(120, 100%, 40%);">+                        * reset procedure */</span><br><span style="color: hsl(120, 100%, 40%);">+                 f_ptp_sendReset();</span><br><span style="color: hsl(120, 100%, 40%);">+            } else {</span><br><span style="color: hsl(120, 100%, 40%);">+                      f_ptp_change_state(BVC_S_UNBLOCKED);</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%);">+   /* we are a SGSN: BSS/PCU-originated RESET must have a cell ID */</span><br><span style="color: hsl(120, 100%, 40%);">+     [g_sgsn_role] BVC.receive(tr_ptp_BnsUdInd(tr_BVC_RESET(?, g_cfg.bvci, g_cfg.cell_id), 0)) -> value udi {</span><br><span style="color: hsl(120, 100%, 40%);">+           log("Rx BVC-RESET from BVCI=", g_cfg.bvci);</span><br><span style="color: hsl(120, 100%, 40%);">+         /* Respond to RESET with correct BVCI but without CellID */</span><br><span style="color: hsl(120, 100%, 40%);">+           BVC.send(ts_ptp_BnsUdReq(ts_BVC_RESET_ACK(g_cfg.bvci, omit), 0));</span><br><span style="color: hsl(120, 100%, 40%);">+             /* FIXME: reset all state? What about clients? */</span><br><span style="color: hsl(120, 100%, 40%);">+             f_ptp_change_state(BVC_S_UNBLOCKED);</span><br><span style="color: hsl(120, 100%, 40%);">+  }</span><br><span style="color: hsl(120, 100%, 40%);">+     /* we are a BSS/PCU: SGSN-originated RESET must not have a cell ID */</span><br><span style="color: hsl(120, 100%, 40%);">+ [not g_sgsn_role] BVC.receive(tr_ptp_BnsUdInd(tr_BVC_RESET(?, g_cfg.bvci, omit), 0)) -> value udi {</span><br><span style="color: hsl(120, 100%, 40%);">+                log("Rx BVC-RESET from BVCI=", g_cfg.bvci);</span><br><span style="color: hsl(120, 100%, 40%);">+         /* Respond to RESET with correct BVCI with CellID */</span><br><span style="color: hsl(120, 100%, 40%);">+          BVC.send(ts_ptp_BnsUdReq(ts_BVC_RESET_ACK(g_cfg.bvci, g_cfg.cell_id), 0));</span><br><span style="color: hsl(120, 100%, 40%);">+            /* FIXME: reset all state? What about clients? */</span><br><span style="color: hsl(120, 100%, 40%);">+             f_ptp_change_state(BVC_S_UNBLOCKED);</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%);">+   /* Ignore those for now */</span><br><span style="color: hsl(120, 100%, 40%);">+    [] BVC.receive(ASP_Event:?) { }</span><br><span style="color: hsl(120, 100%, 40%);">+       [] BVC.receive(BssgpStatusIndication:?) { }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ /* catch-all */</span><br><span style="color: hsl(120, 100%, 40%);">+       [] BVC.receive(tr_ptp_BnsUdInd(?, 0)) -> value udi {</span><br><span style="color: hsl(120, 100%, 40%);">+               setverdict(fail, "Received unexpected NS (SIG): ", udi);</span><br><span style="color: hsl(120, 100%, 40%);">+    }</span><br><span style="color: hsl(120, 100%, 40%);">+     [] BVC.receive(tr_ptp_BnsUdInd(?, ?)) -> value udi {</span><br><span style="color: hsl(120, 100%, 40%);">+               setverdict(fail, "Received unexpected NS (PTP): ", udi);</span><br><span style="color: hsl(120, 100%, 40%);">+    }</span><br><span style="color: hsl(120, 100%, 40%);">+     [] BVC.receive {</span><br><span style="color: hsl(120, 100%, 40%);">+              setverdict(fail, "Received unexpected message from BSSGP_CT");</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%);">+   /* registration/deregistration of Clients (per-TLLI components) */</span><br><span style="color: hsl(120, 100%, 40%);">+    [] BSSGP_PROC.getcall(BSSGP_register_client:{?,?}) -> param(imsi, tlli) sender vc_conn {</span><br><span style="color: hsl(120, 100%, 40%);">+           f_tbl_client_add(imsi, tlli, vc_conn);</span><br><span style="color: hsl(120, 100%, 40%);">+                BSSGP_PROC.reply(BSSGP_register_client:{imsi, tlli}) to vc_conn;</span><br><span style="color: hsl(120, 100%, 40%);">+              }</span><br><span style="color: hsl(120, 100%, 40%);">+     [] BSSGP_PROC.getcall(BSSGP_unregister_client:{?}) -> param(imsi) sender vc_conn {</span><br><span style="color: hsl(120, 100%, 40%);">+         f_tbl_client_del(imsi, vc_conn);</span><br><span style="color: hsl(120, 100%, 40%);">+              BSSGP_PROC.reply(BSSGP_unregister_client:{imsi}) to vc_conn;</span><br><span style="color: hsl(120, 100%, 40%);">+          }</span><br><span style="color: hsl(120, 100%, 40%);">+     [] BSSGP_PROC.getcall(BSSGP_llgmm_assign:{?,?}) -> param(tlli_old, tlli) sender vc_conn {</span><br><span style="color: hsl(120, 100%, 40%);">+          f_tbl_client_llgmm_assign(tlli_old, tlli, vc_conn);</span><br><span style="color: hsl(120, 100%, 40%);">+           BSSGP_PROC.reply(BSSGP_llgmm_assign:{tlli_old, tlli}) to vc_conn;</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%);">+/* main loop for per-BVC component */</span><br><span style="color: hsl(120, 100%, 40%);">+private function f_bssgp_bvc_ScanEvents() runs on BSSGP_BVC_CT {</span><br><span style="color: hsl(120, 100%, 40%);">+       while (true) {</span><br><span style="color: hsl(120, 100%, 40%);">+                alt {</span><br><span style="color: hsl(120, 100%, 40%);">+         [g_ptp_bvc_state == BVC_S_BLOCKED] as_ptp_blocked();</span><br><span style="color: hsl(120, 100%, 40%);">+          [g_ptp_bvc_state == BVC_S_UNBLOCKED] as_ptp_unblocked();</span><br><span style="color: hsl(120, 100%, 40%);">+              [] as_ptp_allstate();</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 style="color: hsl(120, 100%, 40%);">+/* main function for per-BVC Component */</span><br><span style="color: hsl(120, 100%, 40%);">+private function f_bssgp_bvc_main(BssgpBvcConfig cfg, boolean sgsn_role, charstring id) runs on BSSGP_BVC_CT {</span><br><span style="color: hsl(120, 100%, 40%);">+     g_cfg := cfg;</span><br><span style="color: hsl(120, 100%, 40%);">+ g_sgsn_role := sgsn_role;</span><br><span style="color: hsl(120, 100%, 40%);">+     f_bssgp_bvc_ScanEvents();</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%);">+template (value) NsUnitdataRequest ts_ptp_BnsUdReq(template (value) PDU_BSSGP pdu, template (value) BssgpBvci bvci) := {</span><br><span style="color: hsl(120, 100%, 40%);">+      bvci := bvci,</span><br><span style="color: hsl(120, 100%, 40%);">+ nsei := 0, // overwritten in BSSGP_CT</span><br><span style="color: hsl(120, 100%, 40%);">+ /* for some weird reason we get "Dynamic test case error: Text encoder: Encoding an</span><br><span style="color: hsl(120, 100%, 40%);">+       * unbound integer value." when trying to send the reocrd rather than the octetstring */</span><br><span style="color: hsl(120, 100%, 40%);">+ //sdu := omit,</span><br><span style="color: hsl(120, 100%, 40%);">+        //bssgp := valueof(pdu)</span><br><span style="color: hsl(120, 100%, 40%);">+       sdu := enc_PDU_BSSGP(valueof(pdu)),</span><br><span style="color: hsl(120, 100%, 40%);">+   bssgp := omit</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%);">+template (present) NsUnitdataIndication tr_ptp_BnsUdInd(template (present) PDU_BSSGP pdu, template (present) BssgpBvci bvci) := {</span><br><span style="color: hsl(120, 100%, 40%);">+ bvci := bvci,</span><br><span style="color: hsl(120, 100%, 40%);">+ nsei := ?,</span><br><span style="color: hsl(120, 100%, 40%);">+    sdu := *,</span><br><span style="color: hsl(120, 100%, 40%);">+     bssgp := pdu</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%);">+/* change state of PTP BVC; broadcast state change to clients */</span><br><span style="color: hsl(120, 100%, 40%);">+private function f_ptp_change_state(BvcState new_state) runs on BSSGP_BVC_CT {</span><br><span style="color: hsl(120, 100%, 40%);">+   if (new_state == g_ptp_bvc_state) {</span><br><span style="color: hsl(120, 100%, 40%);">+           return;</span><br><span style="color: hsl(120, 100%, 40%);">+       }</span><br><span style="color: hsl(120, 100%, 40%);">+     log("BVCI(", g_cfg.bvci, ") State Transition: ", g_ptp_bvc_state, " -> ", new_state);</span><br><span style="color: hsl(120, 100%, 40%);">+        g_ptp_bvc_state := new_state;</span><br><span style="color: hsl(120, 100%, 40%);">+ for (var integer i := 0; i < sizeof(ClientTable); i := i+1) {</span><br><span style="color: hsl(120, 100%, 40%);">+              if (isbound(ClientTable[i].comp_ref) and ClientTable[i].comp_ref != null) {</span><br><span style="color: hsl(120, 100%, 40%);">+                   BSSGP_SP.send(ts_BssgpStsInd(omit, g_cfg.bvci, g_ptp_bvc_state)) to ClientTable[i].comp_ref;</span><br><span style="color: hsl(120, 100%, 40%);">+          }</span><br><span style="color: hsl(120, 100%, 40%);">+     }</span><br><span> }</span><br><span> </span><br><span> /* attempt to extract the TLLI from a BSSGP PDU */</span><br><span>@@ -323,515 +1216,6 @@</span><br><span>    return omit;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-/*</span><br><span style="color: hsl(0, 100%, 40%);">-private function f_tbl_init() runs on BSSGP_CT {</span><br><span style="color: hsl(0, 100%, 40%);">- var integer i;</span><br><span style="color: hsl(0, 100%, 40%);">-  for (i := 0; i < sizeof(ImsiTable); i := i+1) {</span><br><span style="color: hsl(0, 100%, 40%);">-              ImsiTable[i] := -;</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%);">-       for (i := 0; i < sizeof(TlliTable); i := i+1) {</span><br><span style="color: hsl(0, 100%, 40%);">-              TlliTable[i] := -;</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%);">-*/</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-private function f_tbl_client_add(hexstring imsi, OCT4 tlli, BssgpCellId cell_id, BSSGP_Client_CT vc_conn)</span><br><span style="color: hsl(0, 100%, 40%);">-runs on BSSGP_CT {</span><br><span style="color: hsl(0, 100%, 40%);">-        var integer i;</span><br><span style="color: hsl(0, 100%, 40%);">-  for (i := 0; i < sizeof(ClientTable); i := i+1) {</span><br><span style="color: hsl(0, 100%, 40%);">-            if (not isvalue(ClientTable[i].comp_ref)) {</span><br><span style="color: hsl(0, 100%, 40%);">-                     log("Adding Client=", vc_conn, ", IMSI=", imsi, ", TLLI=", tlli, ", index=", i);</span><br><span style="color: hsl(0, 100%, 40%);">-                        ClientTable[i] := {</span><br><span style="color: hsl(0, 100%, 40%);">-                             tlli := tlli,</span><br><span style="color: hsl(0, 100%, 40%);">-                           tlli_old := omit,</span><br><span style="color: hsl(0, 100%, 40%);">-                               imsi := imsi,</span><br><span style="color: hsl(0, 100%, 40%);">-                           cell_id := cell_id,</span><br><span style="color: hsl(0, 100%, 40%);">-                             comp_ref := vc_conn,</span><br><span style="color: hsl(0, 100%, 40%);">-                            llc := -</span><br><span style="color: hsl(0, 100%, 40%);">-                        };</span><br><span style="color: hsl(0, 100%, 40%);">-                      for (var integer j := 0; j < sizeof(ClientTable[i].llc); j := j+1) {</span><br><span style="color: hsl(0, 100%, 40%);">-                         ClientTable[i].llc[j] := valueof(t_LLC_init(g_cfg.sgsn_role));</span><br><span style="color: hsl(0, 100%, 40%);">-                  }</span><br><span style="color: hsl(0, 100%, 40%);">-                       return;</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%);">-       testcase.stop("Client Table full");</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%);">-private function f_tbl_client_del(hexstring imsi, BSSGP_Client_CT vc_conn) runs on BSSGP_CT {</span><br><span style="color: hsl(0, 100%, 40%);">-     var integer i;</span><br><span style="color: hsl(0, 100%, 40%);">-  for (i := 0; i < sizeof(ClientTable); i := i+1) {</span><br><span style="color: hsl(0, 100%, 40%);">-            if (isvalue(ClientTable[i].imsi) and ClientTable[i].imsi == imsi) {</span><br><span style="color: hsl(0, 100%, 40%);">-                     if (ClientTable[i].comp_ref != vc_conn) {</span><br><span style="color: hsl(0, 100%, 40%);">-                               setverdict(fail, "Cannot unregister index=", i, " IMSI ", imsi, " registred to ",</span><br><span style="color: hsl(0, 100%, 40%);">-                                    ClientTable[i].comp_ref, " from ", vc_conn);</span><br><span style="color: hsl(0, 100%, 40%);">-                               mtc.stop;</span><br><span style="color: hsl(0, 100%, 40%);">-                       }</span><br><span style="color: hsl(0, 100%, 40%);">-                       log("Removing Client IMSI=", imsi, ", index=", i);</span><br><span style="color: hsl(0, 100%, 40%);">-                  ClientTable[i] := {</span><br><span style="color: hsl(0, 100%, 40%);">-                             tlli := -,</span><br><span style="color: hsl(0, 100%, 40%);">-                              tlli_old := omit,</span><br><span style="color: hsl(0, 100%, 40%);">-                               imsi := ''H,</span><br><span style="color: hsl(0, 100%, 40%);">-                            cell_id := -,</span><br><span style="color: hsl(0, 100%, 40%);">-                           comp_ref := null,</span><br><span style="color: hsl(0, 100%, 40%);">-                               llc := - };</span><br><span style="color: hsl(0, 100%, 40%);">-                     return;</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%);">-       log("Warning: Could not find client for IMSI ", imsi);</span><br><span style="color: hsl(0, 100%, 40%);">-        return;</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%);">-/* TS 44.064 7.2.1.1 LLGMM-ASSIGN */</span><br><span style="color: hsl(0, 100%, 40%);">-private function f_tbl_client_llgmm_assign(OCT4 tlli_old, OCT4 tlli_new, BSSGP_Client_CT vc_conn)</span><br><span style="color: hsl(0, 100%, 40%);">-runs on BSSGP_CT {</span><br><span style="color: hsl(0, 100%, 40%);">- var integer i := f_tbl_idx_by_comp(vc_conn);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-    if (tlli_old == 'FFFFFFFF'O and tlli_new != 'FFFFFFFF'O) {</span><br><span style="color: hsl(0, 100%, 40%);">-              /* TLLI assignment */</span><br><span style="color: hsl(0, 100%, 40%);">-           ClientTable[i].tlli := tlli_new;</span><br><span style="color: hsl(0, 100%, 40%);">-                ClientTable[i].tlli_old := omit;</span><br><span style="color: hsl(0, 100%, 40%);">-        } else if (tlli_old != 'FFFFFFFF'O and tlli_new != 'FFFFFFFF'O) {</span><br><span style="color: hsl(0, 100%, 40%);">-               /* TLLI change: both active */</span><br><span style="color: hsl(0, 100%, 40%);">-          ClientTable[i].tlli := tlli_new;</span><br><span style="color: hsl(0, 100%, 40%);">-                ClientTable[i].tlli_old := tlli_old;</span><br><span style="color: hsl(0, 100%, 40%);">-    } else if (tlli_old != 'FFFFFFFF'O and tlli_new == 'FFFFFFFF'O) {</span><br><span style="color: hsl(0, 100%, 40%);">-               /* TLLI unassignment: old shall be unassigned; new stays */</span><br><span style="color: hsl(0, 100%, 40%);">-             ClientTable[i].tlli_old := omit;</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%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-private function f_tbl_comp_by_imsi(hexstring imsi) runs on BSSGP_CT return BSSGP_Client_CT {</span><br><span style="color: hsl(0, 100%, 40%);">- var integer i;</span><br><span style="color: hsl(0, 100%, 40%);">-  for (i := 0; i < sizeof(ClientTable); i := i+1) {</span><br><span style="color: hsl(0, 100%, 40%);">-            if (isvalue(ClientTable[i].imsi) and isvalue(ClientTable[i].comp_ref)</span><br><span style="color: hsl(0, 100%, 40%);">-               and ClientTable[i].imsi == imsi) {</span><br><span style="color: hsl(0, 100%, 40%);">-                  return ClientTable[i].comp_ref;</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%);">-       setverdict(fail, "Couldn't find Component for IMSI ", imsi);</span><br><span style="color: hsl(0, 100%, 40%);">-      mtc.stop;</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%);">-private function f_tbl_comp_by_tlli(OCT4 tlli) runs on BSSGP_CT return BSSGP_Client_CT {</span><br><span style="color: hsl(0, 100%, 40%);">-      var integer i;</span><br><span style="color: hsl(0, 100%, 40%);">-  for (i := 0; i < sizeof(ClientTable); i := i+1) {</span><br><span style="color: hsl(0, 100%, 40%);">-            if (isvalue(ClientTable[i].comp_ref) and</span><br><span style="color: hsl(0, 100%, 40%);">-                    (isvalue(ClientTable[i].tlli) and (ClientTable[i].tlli == tlli or</span><br><span style="color: hsl(0, 100%, 40%);">-                isvalue(ClientTable[i].tlli_old) and ClientTable[i].tlli_old == tlli) )) {</span><br><span style="color: hsl(0, 100%, 40%);">-                 return ClientTable[i].comp_ref;</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%);">-       setverdict(fail, "Couldn't find Component for TLLI ", tlli);</span><br><span style="color: hsl(0, 100%, 40%);">-      mtc.stop;</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%);">-private function f_tbl_idx_by_comp(BSSGP_Client_CT comp_ref) runs on BSSGP_CT return integer {</span><br><span style="color: hsl(0, 100%, 40%);">-        var integer i;</span><br><span style="color: hsl(0, 100%, 40%);">-  for (i := 0; i < sizeof(ClientTable); i := i+1) {</span><br><span style="color: hsl(0, 100%, 40%);">-            if (isvalue(ClientTable[i].comp_ref) and ClientTable[i].comp_ref == comp_ref) {</span><br><span style="color: hsl(0, 100%, 40%);">-                 return i;</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%);">-       setverdict(fail, "Couldn't find Client for Component ", comp_ref);</span><br><span style="color: hsl(0, 100%, 40%);">-        mtc.stop;</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%);">-private function f_tbl_tlli_by_comp(BSSGP_Client_CT comp_ref) runs on BSSGP_CT return OCT4 {</span><br><span style="color: hsl(0, 100%, 40%);">-  var integer i;</span><br><span style="color: hsl(0, 100%, 40%);">-  for (i := 0; i < sizeof(ClientTable); i := i+1) {</span><br><span style="color: hsl(0, 100%, 40%);">-            if (isvalue(ClientTable[i].tlli) and isvalue(ClientTable[i].comp_ref)</span><br><span style="color: hsl(0, 100%, 40%);">-               and ClientTable[i].comp_ref == comp_ref) {</span><br><span style="color: hsl(0, 100%, 40%);">-                  return ClientTable[i].tlli;</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%);">-       setverdict(fail, "Couldn't find TLLI for Component ", comp_ref);</span><br><span style="color: hsl(0, 100%, 40%);">-  mtc.stop;</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%);">-private function f_send_bvc_reset_ack(BssgpBvci bvci) runs on BSSGP_CT {</span><br><span style="color: hsl(0, 100%, 40%);">-      /* The Cell Identifier IE is mandatory in the BVC-RESET-ACK PDU sent from BSS to</span><br><span style="color: hsl(0, 100%, 40%);">-         * SGSN in response to reset a BVC corresponding to a PTP functional entity. The Cell</span><br><span style="color: hsl(0, 100%, 40%);">-    * Identifier IE shall not be used in any other BVC-RESET-ACK PDU */</span><br><span style="color: hsl(0, 100%, 40%);">-    if (g_cfg.sgsn_role) {</span><br><span style="color: hsl(0, 100%, 40%);">-          BSCP.send(f_BnsUdReq(ts_BVC_RESET_ACK(bvci, omit), 0));</span><br><span style="color: hsl(0, 100%, 40%);">- } else {</span><br><span style="color: hsl(0, 100%, 40%);">-                BSCP.send(f_BnsUdReq(ts_BVC_RESET_ACK(bvci, g_cfg.cell_id), 0));</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%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-altstep as_allstate() runs on BSSGP_CT {</span><br><span style="color: hsl(0, 100%, 40%);">-      var BSSGP_Client_CT vc_conn;</span><br><span style="color: hsl(0, 100%, 40%);">-    var NsUnitdataIndication udi;</span><br><span style="color: hsl(0, 100%, 40%);">-   var NsStatusIndication nsi;</span><br><span style="color: hsl(0, 100%, 40%);">-     var ASP_Event evt;</span><br><span style="color: hsl(0, 100%, 40%);">-      var hexstring imsi;</span><br><span style="color: hsl(0, 100%, 40%);">-     var OCT4 tlli, tlli_old;</span><br><span style="color: hsl(0, 100%, 40%);">-        var BssgpCellId cell_id;</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-        /* Respond to BLOCK for wrong NSVCI */</span><br><span style="color: hsl(0, 100%, 40%);">-  [] BSCP.receive(f_BnsUdInd(t_BVC_BLOCK(?, ?), 0)) -> value udi {</span><br><span style="color: hsl(0, 100%, 40%);">-             log("Rx BVC-BLOCK for unknown BVCI");</span><br><span style="color: hsl(0, 100%, 40%);">-         f_sendStatus(BSSGP_CAUSE_BVCI_UNKNOWN, udi.bssgp);</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%);">-       /* Respond to RESET with correct BVCI/CellID */</span><br><span style="color: hsl(0, 100%, 40%);">- [] BSCP.receive(f_BnsUdInd(tr_BVC_RESET(?, g_cfg.bvci, g_cfg.cell_id), 0)) -> value udi {</span><br><span style="color: hsl(0, 100%, 40%);">-            log("Rx BVC-RESET for Our BVCI=", g_cfg.bvci);</span><br><span style="color: hsl(0, 100%, 40%);">-                f_send_bvc_reset_ack(g_cfg.bvci);</span><br><span style="color: hsl(0, 100%, 40%);">-               f_change_state(BVC_S_UNBLOCKED);</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%);">-       /* Respond to RESET for signalling BVCI 0 */</span><br><span style="color: hsl(0, 100%, 40%);">-    [] BSCP.receive(f_BnsUdInd(tr_BVC_RESET(?, 0, omit), 0)) -> value udi {</span><br><span style="color: hsl(0, 100%, 40%);">-              log("Rx BVC-RESET for Signaling BVCI=0");</span><br><span style="color: hsl(0, 100%, 40%);">-             f_send_bvc_reset_ack(0);</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%);">-       /* work-around for old, buggy libosmogb before Change-Id Ie87820537d6d616da4fd4bbf73eab06e28fda5e1 */</span><br><span style="color: hsl(0, 100%, 40%);">-   [mp_tolerate_bvc_reset_cellid] BSCP.receive(f_BnsUdInd(tr_BVC_RESET(?, 0, g_cfg.cell_id), 0)) -> value udi {</span><br><span style="color: hsl(0, 100%, 40%);">-         log("Rx BVC-RESET for Signaling BVCI=0");</span><br><span style="color: hsl(0, 100%, 40%);">-             f_send_bvc_reset_ack(0);</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%);">-       /* Respond to RESET with wrong NSEI/NSVCI */</span><br><span style="color: hsl(0, 100%, 40%);">-    [] BSCP.receive(f_BnsUdInd(tr_BVC_RESET(?, ?, ?), 0)) -> value udi {</span><br><span style="color: hsl(0, 100%, 40%);">-         log("Rx BVC-RESET for unknown BVCI");</span><br><span style="color: hsl(0, 100%, 40%);">-         f_sendStatus(BSSGP_CAUSE_BVCI_UNKNOWN, udi.bssgp);</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%);">-       /* default case of handling unknown PDUs */</span><br><span style="color: hsl(0, 100%, 40%);">-     [] BSCP.receive(f_BnsUdInd(?, ?)) -> value udi {</span><br><span style="color: hsl(0, 100%, 40%);">-             log("Rx Unexpected BSSGP PDU ", udi.bssgp," in state ", g_ptp_bvc_state);</span><br><span style="color: hsl(0, 100%, 40%);">-           f_sendStatus(BSSGP_CAUSE_PDU_NOT_COMPATIBLE_WITH_PROTOCOL_STATE, udi.bssgp);</span><br><span style="color: hsl(0, 100%, 40%);">-    }</span><br><span style="color: hsl(0, 100%, 40%);">-       /* Forwarding of ASP_Event and NsStatusIndication to user */</span><br><span style="color: hsl(0, 100%, 40%);">-    [] BSCP.receive(ASP_Event:?) -> value evt {</span><br><span style="color: hsl(0, 100%, 40%);">-          for (var integer i := 0; i < sizeof(ClientTable); i := i+1) {</span><br><span style="color: hsl(0, 100%, 40%);">-                        if (isbound(ClientTable[i].comp_ref)) {</span><br><span style="color: hsl(0, 100%, 40%);">-                         BSSGP_SP.send(evt) to ClientTable[i].comp_ref;</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%);">-               }</span><br><span style="color: hsl(0, 100%, 40%);">-       [] BSCP.receive(NsStatusIndication:?) -> value nsi { </span><br><span style="color: hsl(0, 100%, 40%);">-                /* if we just became NS-unblocked, send a BCC-RESET */</span><br><span style="color: hsl(0, 100%, 40%);">-          if (nsi.old_state != NSE_S_ALIVE_UNBLOCKED and nsi.new_state == NSE_S_ALIVE_UNBLOCKED) {</span><br><span style="color: hsl(0, 100%, 40%);">-                        if (g_cfg.sgsn_role == false) {</span><br><span style="color: hsl(0, 100%, 40%);">-                         f_sendReset(g_cfg.bvci);</span><br><span style="color: hsl(0, 100%, 40%);">-                        }</span><br><span style="color: hsl(0, 100%, 40%);">-                       /* Idea: We could send BVC-UNBLOCK here like some SGSN do */</span><br><span style="color: hsl(0, 100%, 40%);">-            }</span><br><span style="color: hsl(0, 100%, 40%);">-               for (var integer i := 0; i < sizeof(ClientTable); i := i+1) {</span><br><span style="color: hsl(0, 100%, 40%);">-                        if (isbound(ClientTable[i].comp_ref)) {</span><br><span style="color: hsl(0, 100%, 40%);">-                         BSSGP_SP.send(nsi) to ClientTable[i].comp_ref;</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%);">-       }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       [] BSSGP_PROC.getcall(BSSGP_register_client:{?,?,?}) -> param(imsi, tlli, cell_id) sender vc_conn {</span><br><span style="color: hsl(0, 100%, 40%);">-          f_tbl_client_add(imsi, tlli, cell_id, vc_conn);</span><br><span style="color: hsl(0, 100%, 40%);">-         BSSGP_PROC.reply(BSSGP_register_client:{imsi, tlli, cell_id}) to vc_conn;</span><br><span style="color: hsl(0, 100%, 40%);">-               }</span><br><span style="color: hsl(0, 100%, 40%);">-       [] BSSGP_PROC.getcall(BSSGP_unregister_client:{?}) -> param(imsi) sender vc_conn {</span><br><span style="color: hsl(0, 100%, 40%);">-           f_tbl_client_del(imsi, vc_conn);</span><br><span style="color: hsl(0, 100%, 40%);">-                BSSGP_PROC.reply(BSSGP_unregister_client:{imsi}) to vc_conn;</span><br><span style="color: hsl(0, 100%, 40%);">-            }</span><br><span style="color: hsl(0, 100%, 40%);">-       [] BSSGP_PROC.getcall(BSSGP_llgmm_assign:{?,?}) -> param(tlli_old, tlli) sender vc_conn {</span><br><span style="color: hsl(0, 100%, 40%);">-            f_tbl_client_llgmm_assign(tlli_old, tlli, vc_conn);</span><br><span style="color: hsl(0, 100%, 40%);">-             BSSGP_PROC.reply(BSSGP_llgmm_assign:{tlli_old, tlli}) to vc_conn;</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%);">-}</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-altstep as_blocked() runs on BSSGP_CT {</span><br><span style="color: hsl(0, 100%, 40%);">-       [g_T1.running] g_T1.timeout {</span><br><span style="color: hsl(0, 100%, 40%);">-           f_sendUnblock();</span><br><span style="color: hsl(0, 100%, 40%);">-        }</span><br><span style="color: hsl(0, 100%, 40%);">-       [] BSCP.receive(f_BnsUdInd(t_BVC_UNBLOCK_ACK(g_cfg.bvci), 0)) {</span><br><span style="color: hsl(0, 100%, 40%);">-         g_T1.stop;</span><br><span style="color: hsl(0, 100%, 40%);">-              f_change_state(BVC_S_UNBLOCKED);</span><br><span style="color: hsl(0, 100%, 40%);">-        }</span><br><span style="color: hsl(0, 100%, 40%);">-       [not g_cfg.sgsn_role] BSCP.receive(f_BnsUdInd(tr_BVC_RESET_ACK(g_cfg.bvci, omit), 0)) {</span><br><span style="color: hsl(0, 100%, 40%);">-         f_sendUnblock();</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%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-private function f_send_bssgp_dec(BssgpDecoded dec, BSSGP_Client_CT vc_conn, BSSGP_SP_PT pt := BSSGP_SP) runs on BSSGP_CT {</span><br><span style="color: hsl(0, 100%, 40%);">-#ifdef BSSGP_EM_L3</span><br><span style="color: hsl(0, 100%, 40%);">- if (ispresent(dec.l3_mt)) {</span><br><span style="color: hsl(0, 100%, 40%);">-             pt.send(dec.l3_mt) to vc_conn;</span><br><span style="color: hsl(0, 100%, 40%);">-  } else if (ispresent(dec.l3_mo)) {</span><br><span style="color: hsl(0, 100%, 40%);">-              pt.send(dec.l3_mo) to vc_conn;</span><br><span style="color: hsl(0, 100%, 40%);">-  } else</span><br><span style="color: hsl(0, 100%, 40%);">-#endif</span><br><span style="color: hsl(0, 100%, 40%);">-    if (ispresent(dec.sndcp)) {</span><br><span style="color: hsl(0, 100%, 40%);">-             pt.send(dec.sndcp) to vc_conn;</span><br><span style="color: hsl(0, 100%, 40%);">-  } else if (ispresent(dec.llc)) {</span><br><span style="color: hsl(0, 100%, 40%);">-                pt.send(dec.llc) to vc_conn;</span><br><span style="color: hsl(0, 100%, 40%);">-    } else {</span><br><span style="color: hsl(0, 100%, 40%);">-                pt.send(dec.bssgp) to vc_conn;</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%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-altstep as_unblocked() runs on BSSGP_CT {</span><br><span style="color: hsl(0, 100%, 40%);">-     var BSSGP_Client_CT vc_conn;</span><br><span style="color: hsl(0, 100%, 40%);">-    var NsUnitdataIndication udi;</span><br><span style="color: hsl(0, 100%, 40%);">-   var PDU_BSSGP bs_pdu;</span><br><span style="color: hsl(0, 100%, 40%);">-   var PDU_LLC llc;</span><br><span style="color: hsl(0, 100%, 40%);">-#ifdef BSSGP_EM_L3</span><br><span style="color: hsl(0, 100%, 40%);">-      var PDU_L3_MS_SGSN l3_mo;</span><br><span style="color: hsl(0, 100%, 40%);">-       var PDU_L3_SGSN_MS l3_mt;</span><br><span style="color: hsl(0, 100%, 40%);">-#endif</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- /* bogus unblock, just respond with ACK */</span><br><span style="color: hsl(0, 100%, 40%);">-      [] BSCP.receive(f_BnsUdInd(t_BVC_UNBLOCK(g_cfg.bvci), 0)) -> value udi {</span><br><span style="color: hsl(0, 100%, 40%);">-             BSCP.send(f_BnsUdReq(t_BVC_UNBLOCK_ACK(g_cfg.bvci), 0));</span><br><span style="color: hsl(0, 100%, 40%);">-        }</span><br><span style="color: hsl(0, 100%, 40%);">-       /* Respond to BLOCK with BLOCK-ACK + change state */</span><br><span style="color: hsl(0, 100%, 40%);">-    [] BSCP.receive(f_BnsUdInd(t_BVC_BLOCK(g_cfg.bvci, ?), 0)) -> value udi {</span><br><span style="color: hsl(0, 100%, 40%);">-            BSCP.send(f_BnsUdReq(t_BVC_BLOCK_ACK(g_cfg.bvci), 0));</span><br><span style="color: hsl(0, 100%, 40%);">-          g_T1.stop;</span><br><span style="color: hsl(0, 100%, 40%);">-              f_change_state(BVC_S_BLOCKED);</span><br><span style="color: hsl(0, 100%, 40%);">-  }</span><br><span style="color: hsl(0, 100%, 40%);">-       [g_T1.running] g_T1.timeout {</span><br><span style="color: hsl(0, 100%, 40%);">-           f_sendBlock(BSSGP_CAUSE_OM_INTERVENTION);</span><br><span style="color: hsl(0, 100%, 40%);">-       }</span><br><span style="color: hsl(0, 100%, 40%);">-       [] BSCP.receive(f_BnsUdInd(t_BVC_BLOCK_ACK(g_cfg.bvci), 0)) -> value udi {</span><br><span style="color: hsl(0, 100%, 40%);">-           g_T1.stop;</span><br><span style="color: hsl(0, 100%, 40%);">-              f_change_state(BVC_S_BLOCKED);</span><br><span style="color: hsl(0, 100%, 40%);">-  }</span><br><span style="color: hsl(0, 100%, 40%);">-       [] BSCP.receive(f_BnsUdInd(tr_BVC_RESET_ACK(g_cfg.bvci, g_cfg.cell_id), 0)) -> value udi {</span><br><span style="color: hsl(0, 100%, 40%);">-           g_T2.stop;</span><br><span style="color: hsl(0, 100%, 40%);">-              f_change_state(BVC_S_UNBLOCKED);</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%);">-       /* simply acknowledge all Flow Control Messages */</span><br><span style="color: hsl(0, 100%, 40%);">-      [g_cfg.sgsn_role] BSCP.receive(f_BnsUdInd(tr_BVC_FC_BVC, g_cfg.bvci)) -> value udi {</span><br><span style="color: hsl(0, 100%, 40%);">-         var OCT1 tag := udi.bssgp.pDU_BSSGP_FLOW_CONTROL_BVC.tag.unstructured_Value;</span><br><span style="color: hsl(0, 100%, 40%);">-            BSCP.send(f_BnsUdReq(t_BVC_FC_BVC_ACK(tag), g_cfg.bvci));</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%);">-     [g_cfg.sgsn_role] BSCP.receive(f_BnsUdInd(t_BVC_FC_MS, g_cfg.bvci)) {</span><br><span style="color: hsl(0, 100%, 40%);">-           BSCP.send(f_BnsUdReq(t_BVC_FC_MS_ACK, g_cfg.bvci));</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%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-     /* FIXME: CS PAGING: dispatch by IMSI */</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-        /* PS PAGING: dispatch by IMSI */</span><br><span style="color: hsl(0, 100%, 40%);">-       [] BSCP.receive(f_BnsUdInd(tr_BSSGP_PS_PAGING(g_cfg.bvci), g_cfg.bvci)) -> value udi {</span><br><span style="color: hsl(0, 100%, 40%);">-               var hexstring imsi := udi.bssgp.pDU_BSSGP_PAGING_PS.iMSI.digits</span><br><span style="color: hsl(0, 100%, 40%);">-         vc_conn := f_tbl_comp_by_imsi(imsi);</span><br><span style="color: hsl(0, 100%, 40%);">-            f_send_bssgp_dec(f_dec_bssgp(udi.bssgp), vc_conn);</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%);">-       /* Any other PTP BSSGP message: If it has TLLi, route to component; otherwise broadcast */</span><br><span style="color: hsl(0, 100%, 40%);">-      [] BSCP.receive(f_BnsUdInd(?, g_cfg.bvci)) -> value udi {</span><br><span style="color: hsl(0, 100%, 40%);">-            var BssgpDecoded dec := f_dec_bssgp(udi.bssgp);</span><br><span style="color: hsl(0, 100%, 40%);">-         var template OCT4 tlli := f_bssgp_get_tlli(udi.bssgp);</span><br><span style="color: hsl(0, 100%, 40%);">-          if (isvalue(tlli)) {</span><br><span style="color: hsl(0, 100%, 40%);">-                    vc_conn := f_tbl_comp_by_tlli(valueof(tlli));</span><br><span style="color: hsl(0, 100%, 40%);">-                   f_send_bssgp_dec(dec, vc_conn);</span><br><span style="color: hsl(0, 100%, 40%);">-         } else {</span><br><span style="color: hsl(0, 100%, 40%);">-                        log("No TLLI: Broadcasting ", dec);</span><br><span style="color: hsl(0, 100%, 40%);">-                   /* broadcast this message to all components */</span><br><span style="color: hsl(0, 100%, 40%);">-                  // TITAN DOESN'T DO THIS, *SIGH*: "BSSGP_SP.send(dec) to all component;"</span><br><span style="color: hsl(0, 100%, 40%);">-                  for (var integer i := 0; i < sizeof(ClientTable); i := i+1) {</span><br><span style="color: hsl(0, 100%, 40%);">-                                if (isbound(ClientTable[i].comp_ref)) {</span><br><span style="color: hsl(0, 100%, 40%);">-                                 f_send_bssgp_dec(dec, ClientTable[i].comp_ref);</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%);">-               }</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%);">-       /* Any other SIG BSSGP message: If it has TLLi, route to component; otherwise broadcast */</span><br><span style="color: hsl(0, 100%, 40%);">-      [] BSCP.receive(f_BnsUdInd(?, 0)) -> value udi {</span><br><span style="color: hsl(0, 100%, 40%);">-             var BssgpDecoded dec := f_dec_bssgp(udi.bssgp);</span><br><span style="color: hsl(0, 100%, 40%);">-         var template OCT4 tlli := f_bssgp_get_tlli(udi.bssgp);</span><br><span style="color: hsl(0, 100%, 40%);">-          if (isvalue(tlli)) {</span><br><span style="color: hsl(0, 100%, 40%);">-                    vc_conn := f_tbl_comp_by_tlli(valueof(tlli));</span><br><span style="color: hsl(0, 100%, 40%);">-                   f_send_bssgp_dec(dec, vc_conn, BSSGP_SP_SIG);</span><br><span style="color: hsl(0, 100%, 40%);">-           } else {</span><br><span style="color: hsl(0, 100%, 40%);">-                        log("No TLLI: Broadcasting ", dec);</span><br><span style="color: hsl(0, 100%, 40%);">-                   /* broadcast this message to all components */</span><br><span style="color: hsl(0, 100%, 40%);">-                  // TITAN DOESN'T DO THIS, *SIGH*: "BSSGP_SP.send(dec) to all component;"</span><br><span style="color: hsl(0, 100%, 40%);">-                  for (var integer i := 0; i < sizeof(ClientTable); i := i+1) {</span><br><span style="color: hsl(0, 100%, 40%);">-                                if (isbound(ClientTable[i].comp_ref)) {</span><br><span style="color: hsl(0, 100%, 40%);">-                                 f_send_bssgp_dec(dec, ClientTable[i].comp_ref, BSSGP_SP_SIG);</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%);">-               }</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%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       /* ConnHdlr sends BSSGP on BVCI=0 port: forward it to BSSGP Codec Port */</span><br><span style="color: hsl(0, 100%, 40%);">-       [] BSSGP_SP_SIG.receive(PDU_BSSGP:?)-> value bs_pdu sender vc_conn {</span><br><span style="color: hsl(0, 100%, 40%);">-         BSCP.send(f_BnsUdReq(bs_pdu, 0));</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%);">-       /* ConnHdlr sends BSSGP on BVCI=PTP port: forward it to BSSGP Codec Port */</span><br><span style="color: hsl(0, 100%, 40%);">-     [] BSSGP_SP.receive(PDU_BSSGP:?) -> value bs_pdu sender vc_conn {</span><br><span style="color: hsl(0, 100%, 40%);">-            BSCP.send(f_BnsUdReq(bs_pdu, g_cfg.bvci));</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%);">-#ifdef BSSGP_EM_L3</span><br><span style="color: hsl(0, 100%, 40%);">-     /* ConnHdlr sends L3: Encode and send as UL_UD / DL_UD */</span><br><span style="color: hsl(0, 100%, 40%);">-       [g_cfg.sgsn_role] BSSGP_SP.receive(PDU_L3_SGSN_MS:?) -> value l3_mt sender vc_conn {</span><br><span style="color: hsl(0, 100%, 40%);">-         var integer idx := f_tbl_idx_by_comp(vc_conn);</span><br><span style="color: hsl(0, 100%, 40%);">-          var octetstring l3_enc := enc_PDU_L3_SGSN_MS(l3_mt);</span><br><span style="color: hsl(0, 100%, 40%);">-            var BIT4 sapi := f_llc_sapi_by_l3_mt(l3_mt);</span><br><span style="color: hsl(0, 100%, 40%);">-            var integer n_u := f_llc_get_n_u_tx(ClientTable[idx].llc[bit2int(sapi)]);</span><br><span style="color: hsl(0, 100%, 40%);">-               var octetstring llc_enc := enc_PDU_LLC(valueof(ts_LLC_UI(l3_enc, sapi, '1'B, n_u)));</span><br><span style="color: hsl(0, 100%, 40%);">-            BSCP.send(f_BnsUdReq(ts_BSSGP_DL_UD(ClientTable[idx].tlli, llc_enc), g_cfg.bvci));</span><br><span style="color: hsl(0, 100%, 40%);">-      }</span><br><span style="color: hsl(0, 100%, 40%);">-       [not g_cfg.sgsn_role] BSSGP_SP.receive(PDU_L3_MS_SGSN:?) -> value l3_mo sender vc_conn {</span><br><span style="color: hsl(0, 100%, 40%);">-             var integer idx := f_tbl_idx_by_comp(vc_conn);</span><br><span style="color: hsl(0, 100%, 40%);">-          var octetstring l3_enc := enc_PDU_L3_MS_SGSN(l3_mo);</span><br><span style="color: hsl(0, 100%, 40%);">-            var BIT4 sapi := f_llc_sapi_by_l3_mo(l3_mo);</span><br><span style="color: hsl(0, 100%, 40%);">-            var integer n_u := f_llc_get_n_u_tx(ClientTable[idx].llc[bit2int(sapi)]);</span><br><span style="color: hsl(0, 100%, 40%);">-               var octetstring llc_enc := enc_PDU_LLC(valueof(ts_LLC_UI(l3_enc, sapi, '1'B, n_u)));</span><br><span style="color: hsl(0, 100%, 40%);">-            BSCP.send(f_BnsUdReq(ts_BSSGP_UL_UD(ClientTable[idx].tlli, ClientTable[idx].cell_id, llc_enc), g_cfg.bvci));</span><br><span style="color: hsl(0, 100%, 40%);">-    }</span><br><span style="color: hsl(0, 100%, 40%);">-#endif</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- /* ConnHdlr sends raw LLC: Encode and send as UL_UD / DL_UD */</span><br><span style="color: hsl(0, 100%, 40%);">-  [not g_cfg.sgsn_role] BSSGP_SP.receive(PDU_LLC:?) -> value llc sender vc_conn {</span><br><span style="color: hsl(0, 100%, 40%);">-              var integer idx := f_tbl_idx_by_comp(vc_conn);</span><br><span style="color: hsl(0, 100%, 40%);">-          var octetstring llc_enc := enc_PDU_LLC(llc);</span><br><span style="color: hsl(0, 100%, 40%);">-            BSCP.send(f_BnsUdReq(ts_BSSGP_UL_UD(ClientTable[idx].tlli, ClientTable[idx].cell_id, llc_enc), g_cfg.bvci));</span><br><span style="color: hsl(0, 100%, 40%);">-    }</span><br><span style="color: hsl(0, 100%, 40%);">-       [g_cfg.sgsn_role] BSSGP_SP.receive(PDU_LLC:?) -> value llc sender vc_conn {</span><br><span style="color: hsl(0, 100%, 40%);">-          var integer idx := f_tbl_idx_by_comp(vc_conn);</span><br><span style="color: hsl(0, 100%, 40%);">-          var octetstring llc_enc := enc_PDU_LLC(llc);</span><br><span style="color: hsl(0, 100%, 40%);">-            BSCP.send(f_BnsUdReq(ts_BSSGP_DL_UD(ClientTable[idx].tlli, llc_enc), g_cfg.bvci));</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%);">-}</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-function f_llc_get_n_u_tx(inout LLC_Entity llc) return uint9_t {</span><br><span style="color: hsl(0, 100%, 40%);">-      var uint9_t ret := llc.n_u_tx_next;</span><br><span style="color: hsl(0, 100%, 40%);">-     llc.n_u_tx_next := llc.n_u_tx_next + 1;</span><br><span style="color: hsl(0, 100%, 40%);">- return ret;</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%);">-#ifdef BSSGP_EM_L3</span><br><span style="color: hsl(0, 100%, 40%);">-function f_llc_sapi_by_l3_mo(PDU_L3_MS_SGSN l3_mo) return BIT4 {</span><br><span style="color: hsl(0, 100%, 40%);">-  if (ischosen(l3_mo.msgs.gprs_mm)) {</span><br><span style="color: hsl(0, 100%, 40%);">-             return c_LLC_SAPI_LLGMM;</span><br><span style="color: hsl(0, 100%, 40%);">-        } else if (ischosen(l3_mo.msgs.gprs_sm)) {</span><br><span style="color: hsl(0, 100%, 40%);">-              return c_LLC_SAPI_LLGMM;</span><br><span style="color: hsl(0, 100%, 40%);">-        } else if (ischosen(l3_mo.msgs.sms)) {</span><br><span style="color: hsl(0, 100%, 40%);">-          return c_LLC_SAPI_LLSMS;</span><br><span style="color: hsl(0, 100%, 40%);">-        }</span><br><span style="color: hsl(0, 100%, 40%);">-       setverdict(fail, "No LLC SAPI for ", l3_mo);</span><br><span style="color: hsl(0, 100%, 40%);">-  mtc.stop;</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%);">-private function f_llc_sapi_by_l3_mt(PDU_L3_SGSN_MS l3_mt) return BIT4 {</span><br><span style="color: hsl(0, 100%, 40%);">-      if (ischosen(l3_mt.msgs.gprs_mm)) {</span><br><span style="color: hsl(0, 100%, 40%);">-             return c_LLC_SAPI_LLGMM;</span><br><span style="color: hsl(0, 100%, 40%);">-        } else if (ischosen(l3_mt.msgs.gprs_sm)) {</span><br><span style="color: hsl(0, 100%, 40%);">-              return c_LLC_SAPI_LLGMM;</span><br><span style="color: hsl(0, 100%, 40%);">-        } else if (ischosen(l3_mt.msgs.sms)) {</span><br><span style="color: hsl(0, 100%, 40%);">-          return c_LLC_SAPI_LLSMS;</span><br><span style="color: hsl(0, 100%, 40%);">-        }</span><br><span style="color: hsl(0, 100%, 40%);">-       setverdict(fail, "No LLC SAPI for ", l3_mt);</span><br><span style="color: hsl(0, 100%, 40%);">-  mtc.stop;</span><br><span style="color: hsl(0, 100%, 40%);">-}</span><br><span style="color: hsl(0, 100%, 40%);">-#endif</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%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-private function f_ScanEvents() runs on BSSGP_CT {</span><br><span style="color: hsl(0, 100%, 40%);">-      log("matching against ", tr_BVC_RESET(?, g_cfg.bvci, g_cfg.cell_id));</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- while (true) {</span><br><span style="color: hsl(0, 100%, 40%);">-          alt {</span><br><span style="color: hsl(0, 100%, 40%);">-           [g_ptp_bvc_state == BVC_S_BLOCKED] as_blocked();</span><br><span style="color: hsl(0, 100%, 40%);">-                [g_ptp_bvc_state == BVC_S_UNBLOCKED] as_unblocked();</span><br><span style="color: hsl(0, 100%, 40%);">-            [] as_allstate();</span><br><span style="color: hsl(0, 100%, 40%);">-               }</span><br><span style="color: hsl(0, 100%, 40%);">-       } /* while */</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%);">-/* PDU_BSSGP enhanced with LLC and possibly L3 decoded payloads */</span><br><span style="color: hsl(0, 100%, 40%);">-type record BssgpDecoded {</span><br><span style="color: hsl(0, 100%, 40%);">-      PDU_BSSGP bssgp,</span><br><span style="color: hsl(0, 100%, 40%);">-        PDU_LLC llc optional,</span><br><span style="color: hsl(0, 100%, 40%);">-#ifdef BSSGP_EM_L3</span><br><span style="color: hsl(0, 100%, 40%);">- PDU_L3_MS_SGSN l3_mo optional,</span><br><span style="color: hsl(0, 100%, 40%);">-  PDU_L3_SGSN_MS l3_mt optional,</span><br><span style="color: hsl(0, 100%, 40%);">-#endif</span><br><span style="color: hsl(0, 100%, 40%);">-    PDU_SN sndcp optional</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 a PDU_BSSGP into a BssgpDecoded (i.e. with LLC/L3 decoded, as applicable) */</span><br><span style="color: hsl(0, 100%, 40%);">-private function f_dec_bssgp(PDU_BSSGP bssgp) runs on BSSGP_CT return BssgpDecoded {</span><br><span style="color: hsl(0, 100%, 40%);">-        var BssgpDecoded dec := {</span><br><span style="color: hsl(0, 100%, 40%);">-               bssgp := bssgp,</span><br><span style="color: hsl(0, 100%, 40%);">-         llc := omit,</span><br><span style="color: hsl(0, 100%, 40%);">-#ifdef BSSGP_EM_L3</span><br><span style="color: hsl(0, 100%, 40%);">-          l3_mo := omit,</span><br><span style="color: hsl(0, 100%, 40%);">-          l3_mt := omit,</span><br><span style="color: hsl(0, 100%, 40%);">-#endif</span><br><span style="color: hsl(0, 100%, 40%);">-            sndcp := omit</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 LLC, if it is a PDU that contains LLC */</span><br><span style="color: hsl(0, 100%, 40%);">-      if (g_cfg.depth >= BSSGP_DECODE_DEPTH_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%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       /* Decode SNDCP, if it is a LLC PDU containing user plane data */</span><br><span style="color: hsl(0, 100%, 40%);">-       if (g_cfg.depth >= BSSGP_DECODE_DEPTH_SNDCP) {</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(0, 100%, 40%);">-               }</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%);">-#ifdef BSSGP_EM_L3</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 (g_cfg.depth >= BSSGP_DECODE_DEPTH_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(0, 100%, 40%);">-                       }</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%);">-#endif</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- return dec;</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%);">-function f_bssgp_client_register(hexstring imsi, OCT4 tlli, BssgpCellId cell_id, BSSGP_PROC_PT PT := BSSGP_PROC[0])</span><br><span style="color: hsl(0, 100%, 40%);">-runs on BSSGP_Client_CT {</span><br><span style="color: hsl(0, 100%, 40%);">-        PT.call(BSSGP_register_client:{imsi, tlli, cell_id}) {</span><br><span style="color: hsl(0, 100%, 40%);">-          [] PT.getreply(BSSGP_register_client:{imsi, tlli, cell_id}) {};</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%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-function f_bssgp_client_unregister(hexstring imsi, BSSGP_PROC_PT PT := BSSGP_PROC[0])</span><br><span style="color: hsl(0, 100%, 40%);">-runs on BSSGP_Client_CT {</span><br><span style="color: hsl(0, 100%, 40%);">-        PT.call(BSSGP_unregister_client:{imsi}) {</span><br><span style="color: hsl(0, 100%, 40%);">-               [] PT.getreply(BSSGP_unregister_client:{imsi}) {};</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%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-/* TS 44.064 7.2.1.1 LLGMM-ASSIGN */</span><br><span style="color: hsl(0, 100%, 40%);">-function f_bssgp_client_llgmm_assign(OCT4 tlli_old, OCT4 tlli_new, BSSGP_PROC_PT PT := BSSGP_PROC[0])</span><br><span style="color: hsl(0, 100%, 40%);">-runs on BSSGP_Client_CT {</span><br><span style="color: hsl(0, 100%, 40%);">-    PT.call(BSSGP_llgmm_assign:{tlli_old, tlli_new}) {</span><br><span style="color: hsl(0, 100%, 40%);">-              [] PT.getreply(BSSGP_llgmm_assign:{tlli_old, tlli_new}) {};</span><br><span style="color: hsl(0, 100%, 40%);">-     }</span><br><span style="color: hsl(0, 100%, 40%);">-}</span><br><span> </span><br><span> </span><br><span> }</span><br><span>diff --git a/library/Osmocom_Gb_Types.ttcn b/library/Osmocom_Gb_Types.ttcn</span><br><span>index c5b0953..8101712 100644</span><br><span>--- a/library/Osmocom_Gb_Types.ttcn</span><br><span>+++ b/library/Osmocom_Gb_Types.ttcn</span><br><span>@@ -1555,6 +1555,74 @@</span><br><span>    }</span><br><span> </span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+/* extract the BVCI IE of given PDU + return it */</span><br><span style="color: hsl(120, 100%, 40%);">+function f_BSSGP_BVCI_IE_get(PDU_BSSGP pdu) return template (omit) BVCI {</span><br><span style="color: hsl(120, 100%, 40%);">+      select (pdu) {</span><br><span style="color: hsl(120, 100%, 40%);">+        case (PDU_BSSGP:{pDU_BSSGP_FLUSH_LL:=?}) {</span><br><span style="color: hsl(120, 100%, 40%);">+            return pdu.pDU_BSSGP_FLUSH_LL.bVCI_old;</span><br><span style="color: hsl(120, 100%, 40%);">+               }</span><br><span style="color: hsl(120, 100%, 40%);">+     case (PDU_BSSGP:{pDU_BSSGP_FLUSH_LL_ACK:=?}) {</span><br><span style="color: hsl(120, 100%, 40%);">+                return pdu.pDU_BSSGP_FLUSH_LL_ACK.bVCI_new;</span><br><span style="color: hsl(120, 100%, 40%);">+           }</span><br><span style="color: hsl(120, 100%, 40%);">+     case (PDU_BSSGP:{pDU_BSSGP_LLC_DISCARDED:=?}) {</span><br><span style="color: hsl(120, 100%, 40%);">+               return pdu.pDU_BSSGP_LLC_DISCARDED.bVCI;</span><br><span style="color: hsl(120, 100%, 40%);">+              }</span><br><span style="color: hsl(120, 100%, 40%);">+     case (PDU_BSSGP:{pDU_BSSGP_BVC_BLOCK:=?}) {</span><br><span style="color: hsl(120, 100%, 40%);">+           return pdu.pDU_BSSGP_BVC_BLOCK.bVCI;</span><br><span style="color: hsl(120, 100%, 40%);">+          }</span><br><span style="color: hsl(120, 100%, 40%);">+     case (PDU_BSSGP:{pDU_BSSGP_BVC_BLOCK_ACK:=?}) {</span><br><span style="color: hsl(120, 100%, 40%);">+               return pdu.pDU_BSSGP_BVC_BLOCK_ACK.bVCI;</span><br><span style="color: hsl(120, 100%, 40%);">+              }</span><br><span style="color: hsl(120, 100%, 40%);">+     case (PDU_BSSGP:{pDU_BSSGP_BVC_UNBLOCK:=?}) {</span><br><span style="color: hsl(120, 100%, 40%);">+         return pdu.pDU_BSSGP_BVC_UNBLOCK.bVCI;</span><br><span style="color: hsl(120, 100%, 40%);">+                }</span><br><span style="color: hsl(120, 100%, 40%);">+     case (PDU_BSSGP:{pDU_BSSGP_BVC_UNBLOCK_ACK:=?}) {</span><br><span style="color: hsl(120, 100%, 40%);">+             return pdu.pDU_BSSGP_BVC_UNBLOCK_ACK.bVCI;</span><br><span style="color: hsl(120, 100%, 40%);">+            }</span><br><span style="color: hsl(120, 100%, 40%);">+     case (PDU_BSSGP:{pDU_BSSGP_BVC_RESET:=?}) {</span><br><span style="color: hsl(120, 100%, 40%);">+           return pdu.pDU_BSSGP_BVC_RESET.bVCI;</span><br><span style="color: hsl(120, 100%, 40%);">+          }</span><br><span style="color: hsl(120, 100%, 40%);">+     case (PDU_BSSGP:{pDU_BSSGP_BVC_RESET_ACK:=?}) {</span><br><span style="color: hsl(120, 100%, 40%);">+               return pdu.pDU_BSSGP_BVC_RESET_ACK.bVCI;</span><br><span style="color: hsl(120, 100%, 40%);">+              }</span><br><span style="color: hsl(120, 100%, 40%);">+     case (PDU_BSSGP:{pDU_BSSGP_STATUS:=?}) {</span><br><span style="color: hsl(120, 100%, 40%);">+              return pdu.pDU_BSSGP_STATUS.bVCI;</span><br><span style="color: hsl(120, 100%, 40%);">+             }</span><br><span style="color: hsl(120, 100%, 40%);">+     case (PDU_BSSGP:{pDU_BSSGP_PERFORM_LOCATION_REQUEST:=?}) {</span><br><span style="color: hsl(120, 100%, 40%);">+            return pdu.pDU_BSSGP_PERFORM_LOCATION_REQUEST.bVCI;</span><br><span style="color: hsl(120, 100%, 40%);">+           }</span><br><span style="color: hsl(120, 100%, 40%);">+     case (PDU_BSSGP:{pDU_BSSGP_PERFORM_LOCATION_RESPONSE:=?}) {</span><br><span style="color: hsl(120, 100%, 40%);">+           return pdu.pDU_BSSGP_PERFORM_LOCATION_RESPONSE.bVCI;</span><br><span style="color: hsl(120, 100%, 40%);">+          }</span><br><span style="color: hsl(120, 100%, 40%);">+     case (PDU_BSSGP:{pDU_BSSGP_PERFORM_LOCATION_ABORT:=?}) {</span><br><span style="color: hsl(120, 100%, 40%);">+              return pdu.pDU_BSSGP_PERFORM_LOCATION_ABORT.bVCI;</span><br><span style="color: hsl(120, 100%, 40%);">+             }</span><br><span style="color: hsl(120, 100%, 40%);">+     case (PDU_BSSGP:{pDU_BSSGP_POSITION_COMMAND:=?}) {</span><br><span style="color: hsl(120, 100%, 40%);">+            return pdu.pDU_BSSGP_POSITION_COMMAND.bVCI;</span><br><span style="color: hsl(120, 100%, 40%);">+           }</span><br><span style="color: hsl(120, 100%, 40%);">+     case (PDU_BSSGP:{pDU_BSSGP_POSITION_RESPONSE:=?}) {</span><br><span style="color: hsl(120, 100%, 40%);">+           return pdu.pDU_BSSGP_POSITION_RESPONSE.bVCI;</span><br><span style="color: hsl(120, 100%, 40%);">+          }</span><br><span style="color: hsl(120, 100%, 40%);">+     case (PDU_BSSGP:{pDU_BSSGP_PAGING_PS:={?,?,*,{bVCI:=?},*,*,?,*,*}}) {</span><br><span style="color: hsl(120, 100%, 40%);">+         return pdu.pDU_BSSGP_PAGING_PS.paging_Field4.bVCI;</span><br><span style="color: hsl(120, 100%, 40%);">+            }</span><br><span style="color: hsl(120, 100%, 40%);">+     case (PDU_BSSGP:{pDU_BSSGP_PAGING_CS:={?,?,?,{bVCI:=?},*,*,*,*,*}}) {</span><br><span style="color: hsl(120, 100%, 40%);">+         return pdu.pDU_BSSGP_PAGING_CS.paging_Field4.bVCI;</span><br><span style="color: hsl(120, 100%, 40%);">+            }</span><br><span style="color: hsl(120, 100%, 40%);">+     case else {</span><br><span style="color: hsl(120, 100%, 40%);">+           return omit;</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 style="color: hsl(120, 100%, 40%);">+/* extract the BVCI IE of given PDU + convert it to integer value */</span><br><span style="color: hsl(120, 100%, 40%);">+function f_BSSGP_BVCI_get(PDU_BSSGP pdu) return template (omit) BssgpBvci {</span><br><span style="color: hsl(120, 100%, 40%);">+     var template (omit) BVCI bvci_raw := f_BSSGP_BVCI_IE_get(pdu);</span><br><span style="color: hsl(120, 100%, 40%);">+        if (istemplatekind(bvci_raw, "omit")) {</span><br><span style="color: hsl(120, 100%, 40%);">+             return omit;</span><br><span style="color: hsl(120, 100%, 40%);">+  }</span><br><span style="color: hsl(120, 100%, 40%);">+     return oct2int(valueof(bvci_raw.unstructured_value));</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span> </span><br><span> </span><br><span> } with { encode "RAW" };</span><br><span>diff --git a/pcu/PCU_Tests.default b/pcu/PCU_Tests.default</span><br><span>index a2dba4f..9944043 100644</span><br><span>--- a/pcu/PCU_Tests.default</span><br><span>+++ b/pcu/PCU_Tests.default</span><br><span>@@ -10,18 +10,23 @@</span><br><span> [MODULE_PARAMETERS]</span><br><span> SGSN_Components.mp_gb_cfg := {</span><br><span>       nsei := 1234,</span><br><span style="color: hsl(0, 100%, 40%);">-   bvci := 1234,</span><br><span style="color: hsl(0, 100%, 40%);">-   cell_id := {</span><br><span style="color: hsl(0, 100%, 40%);">-            ra_id := {</span><br><span style="color: hsl(0, 100%, 40%);">-                      lai := {</span><br><span style="color: hsl(0, 100%, 40%);">-                                mcc_mnc := '262F42'H, lac := 13135</span><br><span style="color: hsl(120, 100%, 40%);">+    sgsn_role := true,</span><br><span style="color: hsl(120, 100%, 40%);">+    bvc := {</span><br><span style="color: hsl(120, 100%, 40%);">+              {</span><br><span style="color: hsl(120, 100%, 40%);">+                     bvci := 1234,</span><br><span style="color: hsl(120, 100%, 40%);">+                 cell_id := {</span><br><span style="color: hsl(120, 100%, 40%);">+                          ra_id := {</span><br><span style="color: hsl(120, 100%, 40%);">+                                    lai := {</span><br><span style="color: hsl(120, 100%, 40%);">+                                              mcc_mnc := '262F42'H, lac := 13135</span><br><span style="color: hsl(120, 100%, 40%);">+                                    },</span><br><span style="color: hsl(120, 100%, 40%);">+                                    rac := 0</span><br><span style="color: hsl(120, 100%, 40%);">+                              },</span><br><span style="color: hsl(120, 100%, 40%);">+                            cell_id := 20960</span><br><span>                     },</span><br><span style="color: hsl(0, 100%, 40%);">-                      rac := 0</span><br><span style="color: hsl(0, 100%, 40%);">-                },</span><br><span style="color: hsl(0, 100%, 40%);">-              cell_id := 20960</span><br><span style="color: hsl(0, 100%, 40%);">-        },</span><br><span style="color: hsl(0, 100%, 40%);">-      sgsn_role := true</span><br><span style="color: hsl(0, 100%, 40%);">-}</span><br><span style="color: hsl(120, 100%, 40%);">+                    depth := BSSGP_DECODE_DEPTH_BSSGP</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> Osmocom_VTY_Functions.mp_prompt_prefix := "OsmoPCU";</span><br><span> PCUIF_Types.mp_pcuif_version := 10;</span><br><span> StatsD_Checker.mp_enable_stats := true;</span><br><span>diff --git a/pcu/PCU_Tests.ttcn b/pcu/PCU_Tests.ttcn</span><br><span>index f68485a..b2f8b75 100644</span><br><span>--- a/pcu/PCU_Tests.ttcn</span><br><span>+++ b/pcu/PCU_Tests.ttcn</span><br><span>@@ -83,7 +83,7 @@</span><br><span>   cell_id := 20960,</span><br><span>    repeat_time := 5 * 50,</span><br><span>       repeat_count := 3,</span><br><span style="color: hsl(0, 100%, 40%);">-      bvci := mp_gb_cfg.bvci,</span><br><span style="color: hsl(120, 100%, 40%);">+       bvci := mp_gb_cfg.bvc[0].bvci,</span><br><span>       t3142 := 20,</span><br><span>         t3169 := 5,</span><br><span>  t3191 := 5,</span><br><span>@@ -215,12 +215,12 @@</span><br><span>  activate(as_Tguard_RAW());</span><br><span> </span><br><span>       /* Init PCU interface component */</span><br><span style="color: hsl(0, 100%, 40%);">-      vc_PCUIF := RAW_PCUIF_CT.create("PCUIF-" & id);</span><br><span style="color: hsl(120, 100%, 40%);">+ vc_PCUIF := RAW_PCUIF_CT.create("PCUIF");</span><br><span>  connect(vc_PCUIF:MTC, self:PCUIF);</span><br><span>   map(vc_PCUIF:PCU, system:PCU);</span><br><span> </span><br><span>   /* Create one BTS component (we may want more some day) */</span><br><span style="color: hsl(0, 100%, 40%);">-      vc_BTS := RAW_PCU_BTS_CT.create("BTS-" & id);</span><br><span style="color: hsl(120, 100%, 40%);">+   vc_BTS := RAW_PCU_BTS_CT.create("BTS");</span><br><span>    connect(vc_BTS:PCUIF, vc_PCUIF:BTS);</span><br><span>         connect(vc_BTS:TC, self:BTS);</span><br><span> </span><br><span>@@ -239,7 +239,7 @@</span><br><span> }</span><br><span> </span><br><span> testcase TC_pcuif_suspend() runs on RAW_PCU_Test_CT {</span><br><span style="color: hsl(0, 100%, 40%);">-       var octetstring ra_id := enc_RoutingAreaIdentification(mp_gb_cfg.cell_id.ra_id);</span><br><span style="color: hsl(120, 100%, 40%);">+      var octetstring ra_id := enc_RoutingAreaIdentification(mp_gb_cfg.bvc[0].cell_id.ra_id);</span><br><span>      var GprsTlli tlli := 'FFFFFFFF'O;</span><br><span>    timer T;</span><br><span> </span><br><span>@@ -256,7 +256,7 @@</span><br><span> </span><br><span>       T.start(2.0);</span><br><span>        alt {</span><br><span style="color: hsl(0, 100%, 40%);">-   [] BSSGP_SIG[0].receive(tr_BSSGP_SUSPEND(tlli, mp_gb_cfg.cell_id.ra_id)) {</span><br><span style="color: hsl(120, 100%, 40%);">+    [] BSSGP_SIG[0].receive(tr_BSSGP_SUSPEND(tlli, mp_gb_cfg.bvc[0].cell_id.ra_id)) {</span><br><span>            setverdict(pass);</span><br><span>            }</span><br><span>    [] T.timeout {</span><br><span>@@ -890,7 +890,7 @@</span><br><span>         f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), sched_fn);</span><br><span> </span><br><span>     /* receive one message on BSSGP with all aggregated data in payload: */</span><br><span style="color: hsl(0, 100%, 40%);">- BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.cell_id, total_payload));</span><br><span style="color: hsl(120, 100%, 40%);">+  BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.bvc[0].cell_id, total_payload));</span><br><span> }</span><br><span> </span><br><span> /* Verify PCU handles correctly CS1..4 with all possible LLC payload sizes fitting alone in one RLC block */</span><br><span>@@ -936,7 +936,7 @@</span><br><span>   /* DL ACK/NACK sets poll+rrbp requesting PACKET CONTROL ACK */</span><br><span>       f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), sched_fn);</span><br><span>         /* receive one message on BSSGP with all aggregated data in payload: */</span><br><span style="color: hsl(0, 100%, 40%);">- BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.cell_id, payload));</span><br><span style="color: hsl(120, 100%, 40%);">+        BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.bvc[0].cell_id, payload));</span><br><span> </span><br><span>    /* Test sending LLC PDUS of incrementing size */</span><br><span>     var integer max_size := 49;</span><br><span>@@ -962,7 +962,7 @@</span><br><span>            f_ms_tx_ul_block(ms, ul_data);</span><br><span> </span><br><span>           /* receive one message on BSSGP with all aggregated data in payload: */</span><br><span style="color: hsl(0, 100%, 40%);">-         BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.cell_id, payload));</span><br><span style="color: hsl(120, 100%, 40%);">+                BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.bvc[0].cell_id, payload));</span><br><span> </span><br><span>            /* we will receive UL ACK/NACK from time to time, handle it. */</span><br><span>              f_rx_rlcmac_dl_block(dl_block, dl_fn);</span><br><span>@@ -1007,7 +1007,7 @@</span><br><span> </span><br><span>   T.start(0.5);</span><br><span>        alt {</span><br><span style="color: hsl(0, 100%, 40%);">-   [] BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.cell_id, ?)) {</span><br><span style="color: hsl(120, 100%, 40%);">+  [] BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.bvc[0].cell_id, ?)) {</span><br><span>          setverdict(fail, "LLC PDU in Malformed RLC block was forwarded");</span><br><span>          f_shutdown(__BFILE__, __LINE__);</span><br><span>     }</span><br><span>@@ -1082,7 +1082,7 @@</span><br><span>    f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), sched_fn);</span><br><span> </span><br><span>     /* UL block should be received in SGSN */</span><br><span style="color: hsl(0, 100%, 40%);">-       BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.cell_id));</span><br><span style="color: hsl(120, 100%, 40%);">+ BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.bvc[0].cell_id));</span><br><span> </span><br><span>     /* Now SGSN sends some DL data, PCU will page on CCCH (PCH) */</span><br><span>       BSSGP[0].send(ts_BSSGP_DL_UD(ms.tlli, data));</span><br><span>@@ -1172,7 +1172,7 @@</span><br><span>        f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), sched_fn);</span><br><span> </span><br><span>     /* UL block should be received in SGSN */</span><br><span style="color: hsl(0, 100%, 40%);">-       BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.cell_id));</span><br><span style="color: hsl(120, 100%, 40%);">+ BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.bvc[0].cell_id));</span><br><span> </span><br><span>     /* Now SGSN sends some DL data, PCU will page on PACCH */</span><br><span>    BSSGP[0].send(ts_BSSGP_DL_UD(ms.tlli, data));</span><br><span>@@ -1287,7 +1287,7 @@</span><br><span>        f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), sched_fn);</span><br><span> </span><br><span>     /* UL block should be received in SGSN */</span><br><span style="color: hsl(0, 100%, 40%);">-       BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.cell_id));</span><br><span style="color: hsl(120, 100%, 40%);">+ BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.bvc[0].cell_id));</span><br><span> </span><br><span>     f_shutdown(__BFILE__, __LINE__, final := true);</span><br><span> }</span><br><span>@@ -1383,7 +1383,7 @@</span><br><span>         f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), sched_fn);</span><br><span> </span><br><span>     /* receive one message on BSSGP with all aggregated data in payload: */</span><br><span style="color: hsl(0, 100%, 40%);">- BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.cell_id, total_payload));</span><br><span style="color: hsl(120, 100%, 40%);">+  BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.bvc[0].cell_id, total_payload));</span><br><span> }</span><br><span> </span><br><span> /* Verify that if PCU doesn't get an ACK for first DL block after IMM ASS, it</span><br><span>@@ -1581,7 +1581,7 @@</span><br><span>    f_ms_tx_ul_block(ms, ul_data);</span><br><span> </span><br><span>   /* UL block dataA should be received in SGSN */</span><br><span style="color: hsl(0, 100%, 40%);">- BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.cell_id, dataA));</span><br><span style="color: hsl(120, 100%, 40%);">+  BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.bvc[0].cell_id, dataA));</span><br><span> </span><br><span>      /* UL RlcDataBlock(dataB finished, dataC starts and finishes, dataD starts) [BSN=2, CV=1] */</span><br><span>         ul_data := t_RLCMAC_UL_DATA_TLLI(tfi := ms.ul_tbf.tfi,</span><br><span>@@ -1598,8 +1598,8 @@</span><br><span>       f_ms_tx_ul_block(ms, ul_data);</span><br><span> </span><br><span>   /* UL block dataB and dataC should be received in SGSN */</span><br><span style="color: hsl(0, 100%, 40%);">-       BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.cell_id, dataB));</span><br><span style="color: hsl(0, 100%, 40%);">-    BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.cell_id, dataC));</span><br><span style="color: hsl(120, 100%, 40%);">+  BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.bvc[0].cell_id, dataB));</span><br><span style="color: hsl(120, 100%, 40%);">+   BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.bvc[0].cell_id, dataC));</span><br><span> </span><br><span>      /* UL RlcDataBlock(dataD finishes) [BSN=3, CV=0] */</span><br><span>  ul_data := t_RLCMAC_UL_DATA_TLLI(tfi := ms.ul_tbf.tfi,</span><br><span>@@ -1613,7 +1613,7 @@</span><br><span>       f_ms_tx_ul_block(ms, ul_data);</span><br><span> </span><br><span>   /* UL block dataB and dataD should be received in SGSN */</span><br><span style="color: hsl(0, 100%, 40%);">-       BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.cell_id, dataD));</span><br><span style="color: hsl(120, 100%, 40%);">+  BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.bvc[0].cell_id, dataD));</span><br><span> </span><br><span>      f_rx_rlcmac_dl_block_exp_ack_nack(dl_block, sched_fn);</span><br><span>       /* DL ACK/NACK sets poll+rrbp requesting PACKET CONTROL ACK */</span><br><span>@@ -1656,7 +1656,7 @@</span><br><span>       f_ms_tx_ul_data_block_multi(ms, 1, with_tlli := true);</span><br><span> </span><br><span>   /* UL block should be received in SGSN */</span><br><span style="color: hsl(0, 100%, 40%);">-       BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.cell_id));</span><br><span style="color: hsl(120, 100%, 40%);">+ BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.bvc[0].cell_id));</span><br><span> </span><br><span>     acknack_tmpl := tr_RLCMAC_UL_ACK_NACK_GPRS(ms.ul_tbf.tfi,</span><br><span>                                               tr_UlAckNackGprs(ms.tlli,</span><br><span>@@ -1677,7 +1677,7 @@</span><br><span>         f_ms_tx_ul_data_block_multi(ms, 1, with_tlli := false);  /* TODO: send using cs_mcs */</span><br><span> </span><br><span>   /* UL block should be received in SGSN */</span><br><span style="color: hsl(0, 100%, 40%);">-       BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.cell_id));</span><br><span style="color: hsl(120, 100%, 40%);">+ BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.bvc[0].cell_id));</span><br><span> </span><br><span>     f_rx_rlcmac_dl_block_exp_ack_nack(dl_block, sched_fn, acknack_tmpl);</span><br><span>         /* ACK the ACK */</span><br><span>@@ -1811,7 +1811,7 @@</span><br><span> }</span><br><span> </span><br><span> testcase TC_paging_cs_from_sgsn_ptp() runs on RAW_PCU_Test_CT {</span><br><span style="color: hsl(0, 100%, 40%);">-   f_tc_paging_cs_from_sgsn(mp_gb_cfg.bvci);</span><br><span style="color: hsl(120, 100%, 40%);">+     f_tc_paging_cs_from_sgsn(mp_gb_cfg.bvc[0].bvci);</span><br><span> }</span><br><span> </span><br><span> /* Test PS paging over Gb (SGSN->PCU->BTS[CCCH]).</span><br><span>@@ -1858,7 +1858,7 @@</span><br><span> }</span><br><span> </span><br><span> testcase TC_paging_ps_from_sgsn_ptp() runs on RAW_PCU_Test_CT {</span><br><span style="color: hsl(0, 100%, 40%);">-        f_tc_paging_ps_from_sgsn(mp_gb_cfg.bvci);</span><br><span style="color: hsl(120, 100%, 40%);">+     f_tc_paging_ps_from_sgsn(mp_gb_cfg.bvc[0].bvci);</span><br><span> }</span><br><span> </span><br><span> /* Verify osmo-pcu handles DL UNIT_DATA from SGSN with IMSI IE correctly. See OS#4729 */</span><br><span>@@ -1894,7 +1894,7 @@</span><br><span>        f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), sched_fn);</span><br><span> </span><br><span>     /* UL block should be received in SGSN */</span><br><span style="color: hsl(0, 100%, 40%);">-       BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.cell_id));</span><br><span style="color: hsl(120, 100%, 40%);">+ BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.bvc[0].cell_id));</span><br><span> </span><br><span>     /* Now SGSN sends some DL data, PCU will page on CCCH (PCH) */</span><br><span>       BSSGP[0].send(ts_BSSGP_DL_UD(ms.tlli, data, imsi := ts_BSSGP_IMSI(ms.imsi)));</span><br><span>@@ -1953,7 +1953,7 @@</span><br><span>        f_ms_tx_ul_block(ms, ts_RLCMAC_CTRL_ACK(ms.tlli), sched_fn);</span><br><span> </span><br><span>     /* UL block should be received in SGSN */</span><br><span style="color: hsl(0, 100%, 40%);">-       BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.cell_id));</span><br><span style="color: hsl(120, 100%, 40%);">+ BSSGP[0].receive(tr_BSSGP_UL_UD(ms.tlli, mp_gb_cfg.bvc[0].cell_id));</span><br><span> </span><br><span>     /* Now SGSN sends some DL data with an invalid IMSI */</span><br><span>       BSSGP[0].send(ts_BSSGP_DL_UD(ms.tlli, data, imsi := ts_BSSGP_IMSI('1122'H)));</span><br><span>diff --git a/pcu/PCU_Tests_NS.ttcn b/pcu/PCU_Tests_NS.ttcn</span><br><span>index 6a62f29..5ab5f8d 100644</span><br><span>--- a/pcu/PCU_Tests_NS.ttcn</span><br><span>+++ b/pcu/PCU_Tests_NS.ttcn</span><br><span>@@ -55,7 +55,7 @@</span><br><span> </span><br><span>       /* Wait for PCU_VERSION and return INFO_IND */</span><br><span>       PCU.receive(t_SD_PCUIF(g_pcu_conn_id, tr_PCUIF_TXT_IND(0, PCU_VERSION, ?)));</span><br><span style="color: hsl(0, 100%, 40%);">-    /* FIXME: make sure to use parameters from mp_gb_cfg.cell_id in the PCU INFO IND */</span><br><span style="color: hsl(120, 100%, 40%);">+   /* FIXME: make sure to use parameters from mp_gb_cfg.bvc[0].cell_id in the PCU INFO IND */</span><br><span>   var template PCUIF_Message info_ind_msg := ts_PCUIF_INFO_IND(0, info_ind);</span><br><span>   PCU.send(t_SD_PCUIF(g_pcu_conn_id, info_ind_msg));</span><br><span> }</span><br><span>@@ -194,16 +194,16 @@</span><br><span> </span><br><span>  /* Expect BVC-RESET for signaling (0) and ptp BVCI */</span><br><span>        if (mp_tolerate_bvc_reset_cellid) {</span><br><span style="color: hsl(0, 100%, 40%);">-             as_rx_bvc_reset_tx_ack(0, mp_gb_cfg.cell_id, oneshot := true);</span><br><span style="color: hsl(120, 100%, 40%);">+                as_rx_bvc_reset_tx_ack(0, mp_gb_cfg.bvc[0].cell_id, oneshot := true);</span><br><span>        } else {</span><br><span>             as_rx_bvc_reset_tx_ack(0, omit, oneshot := true);</span><br><span>    }</span><br><span style="color: hsl(0, 100%, 40%);">-       as_rx_bvc_reset_tx_ack(mp_gb_cfg.bvci, mp_gb_cfg.cell_id, oneshot := true);</span><br><span style="color: hsl(0, 100%, 40%);">-     as_rx_bvc_unblock_tx_ack(mp_gb_cfg.bvci, oneshot := true);</span><br><span style="color: hsl(120, 100%, 40%);">+    as_rx_bvc_reset_tx_ack(mp_gb_cfg.bvc[0].bvci, mp_gb_cfg.bvc[0].cell_id, oneshot := true);</span><br><span style="color: hsl(120, 100%, 40%);">+     as_rx_bvc_unblock_tx_ack(mp_gb_cfg.bvc[0].bvci, oneshot := true);</span><br><span> </span><br><span>        /* wait for one FLOW-CONTROL BVC and then ACK any further in the future */</span><br><span style="color: hsl(0, 100%, 40%);">-      as_rx_bvc_fc_tx_ack(mp_gb_cfg.bvci, oneshot := true);</span><br><span style="color: hsl(0, 100%, 40%);">-   activate(as_rx_bvc_fc_tx_ack(mp_gb_cfg.bvci));</span><br><span style="color: hsl(120, 100%, 40%);">+        as_rx_bvc_fc_tx_ack(mp_gb_cfg.bvc[0].bvci, oneshot := true);</span><br><span style="color: hsl(120, 100%, 40%);">+  activate(as_rx_bvc_fc_tx_ack(mp_gb_cfg.bvc[0].bvci));</span><br><span>        setverdict(pass);</span><br><span> }</span><br><span> </span><br><span>diff --git a/pcu/PCU_Tests_SNS.ttcn b/pcu/PCU_Tests_SNS.ttcn</span><br><span>index 524d35c..dc4cd82 100644</span><br><span>--- a/pcu/PCU_Tests_SNS.ttcn</span><br><span>+++ b/pcu/PCU_Tests_SNS.ttcn</span><br><span>@@ -187,13 +187,13 @@</span><br><span>      f_outgoing_ns_alive();</span><br><span> </span><br><span>   /* Expect BVC-RESET for signaling (0) and ptp BVCI */</span><br><span style="color: hsl(0, 100%, 40%);">-   as_rx_bvc_reset_tx_ack(0, mp_gb_cfg.cell_id, oneshot := true);</span><br><span style="color: hsl(0, 100%, 40%);">-  as_rx_bvc_reset_tx_ack(mp_gb_cfg.bvci, mp_gb_cfg.cell_id, oneshot := true);</span><br><span style="color: hsl(0, 100%, 40%);">-     as_rx_bvc_unblock_tx_ack(mp_gb_cfg.bvci, oneshot := true);</span><br><span style="color: hsl(120, 100%, 40%);">+    as_rx_bvc_reset_tx_ack(0, mp_gb_cfg.bvc[0].cell_id, oneshot := true);</span><br><span style="color: hsl(120, 100%, 40%);">+ as_rx_bvc_reset_tx_ack(mp_gb_cfg.bvc[0].bvci, mp_gb_cfg.bvc[0].cell_id, oneshot := true);</span><br><span style="color: hsl(120, 100%, 40%);">+     as_rx_bvc_unblock_tx_ack(mp_gb_cfg.bvc[0].bvci, oneshot := true);</span><br><span> </span><br><span>        /* wait for one FLOW-CONTROL BVC and then ACK any further in the future */</span><br><span style="color: hsl(0, 100%, 40%);">-      as_rx_bvc_fc_tx_ack(mp_gb_cfg.bvci, oneshot := true);</span><br><span style="color: hsl(0, 100%, 40%);">-   activate(as_rx_bvc_fc_tx_ack(mp_gb_cfg.bvci));</span><br><span style="color: hsl(120, 100%, 40%);">+        as_rx_bvc_fc_tx_ack(mp_gb_cfg.bvc[0].bvci, oneshot := true);</span><br><span style="color: hsl(120, 100%, 40%);">+  activate(as_rx_bvc_fc_tx_ack(mp_gb_cfg.bvc[0].bvci));</span><br><span>        setverdict(pass);</span><br><span> }</span><br><span> </span><br><span>@@ -220,20 +220,20 @@</span><br><span>   f_outgoing_ns_alive(1);</span><br><span> </span><br><span>  if (sgsn_originated_reset) {</span><br><span style="color: hsl(0, 100%, 40%);">-            f_tx_bvc_reset_rx_ack(0, mp_gb_cfg.cell_id);</span><br><span style="color: hsl(0, 100%, 40%);">-            f_tx_bvc_reset_rx_ack(mp_gb_cfg.bvci, mp_gb_cfg.cell_id);</span><br><span style="color: hsl(120, 100%, 40%);">+             f_tx_bvc_reset_rx_ack(0, mp_gb_cfg.bvc[0].cell_id);</span><br><span style="color: hsl(120, 100%, 40%);">+           f_tx_bvc_reset_rx_ack(mp_gb_cfg.bvc[0].bvci, mp_gb_cfg.bvc[0].cell_id);</span><br><span>      } else {</span><br><span>             /* Expect BVC-RESET for signaling (0) and ptp BVCI */</span><br><span style="color: hsl(0, 100%, 40%);">-           as_rx_bvc_reset_tx_ack(0, mp_gb_cfg.cell_id, oneshot := true);</span><br><span style="color: hsl(0, 100%, 40%);">-          as_rx_bvc_reset_tx_ack(mp_gb_cfg.bvci, mp_gb_cfg.cell_id, oneshot := true);</span><br><span style="color: hsl(120, 100%, 40%);">+           as_rx_bvc_reset_tx_ack(0, mp_gb_cfg.bvc[0].cell_id, oneshot := true);</span><br><span style="color: hsl(120, 100%, 40%);">+         as_rx_bvc_reset_tx_ack(mp_gb_cfg.bvc[0].bvci, mp_gb_cfg.bvc[0].cell_id, oneshot := true);</span><br><span>    }</span><br><span>    /* Expect UNBLOCK for ptp BVCI on signaling NS-VC (idx==0) */</span><br><span style="color: hsl(0, 100%, 40%);">-   as_rx_bvc_unblock_tx_ack(mp_gb_cfg.bvci, oneshot := true);</span><br><span style="color: hsl(120, 100%, 40%);">+    as_rx_bvc_unblock_tx_ack(mp_gb_cfg.bvc[0].bvci, oneshot := true);</span><br><span> </span><br><span>        /* wait for one FLOW-CONTROL BVC and then ACK any further in the future. Flow</span><br><span>         * control happens on the p-t-p BVCI and hence on index 1 */</span><br><span style="color: hsl(0, 100%, 40%);">-    as_rx_bvc_fc_tx_ack(mp_gb_cfg.bvci, oneshot := true, idx := 1);</span><br><span style="color: hsl(0, 100%, 40%);">- activate(as_rx_bvc_fc_tx_ack(mp_gb_cfg.bvci, idx := 1));</span><br><span style="color: hsl(120, 100%, 40%);">+      as_rx_bvc_fc_tx_ack(mp_gb_cfg.bvc[0].bvci, oneshot := true, idx := 1);</span><br><span style="color: hsl(120, 100%, 40%);">+        activate(as_rx_bvc_fc_tx_ack(mp_gb_cfg.bvc[0].bvci, idx := 1));</span><br><span> }</span><br><span> </span><br><span> /* Test full IP-SNS bring-up with two NS-VCs, one sig-only and one user-only */</span><br><span>@@ -270,20 +270,20 @@</span><br><span>  f_outgoing_ns_alive_no_ack(idx := 0);</span><br><span> </span><br><span>    if (sgsn_originated_reset) {</span><br><span style="color: hsl(0, 100%, 40%);">-            f_tx_bvc_reset_rx_ack(0, mp_gb_cfg.cell_id, idx := 1);</span><br><span style="color: hsl(0, 100%, 40%);">-          f_tx_bvc_reset_rx_ack(mp_gb_cfg.bvci, mp_gb_cfg.cell_id, idx := 1);</span><br><span style="color: hsl(120, 100%, 40%);">+           f_tx_bvc_reset_rx_ack(0, mp_gb_cfg.bvc[0].cell_id, idx := 1);</span><br><span style="color: hsl(120, 100%, 40%);">+         f_tx_bvc_reset_rx_ack(mp_gb_cfg.bvc[0].bvci, mp_gb_cfg.bvc[0].cell_id, idx := 1);</span><br><span>    } else {</span><br><span>             /* Expect BVC-RESET for signaling BVCI=0 and ptp BVCI */</span><br><span style="color: hsl(0, 100%, 40%);">-                as_rx_bvc_reset_tx_ack(0, mp_gb_cfg.cell_id, oneshot := true, idx := 1);</span><br><span style="color: hsl(0, 100%, 40%);">-                as_rx_bvc_reset_tx_ack(mp_gb_cfg.bvci, mp_gb_cfg.cell_id, oneshot := true, idx := 1);</span><br><span style="color: hsl(120, 100%, 40%);">+         as_rx_bvc_reset_tx_ack(0, mp_gb_cfg.bvc[0].cell_id, oneshot := true, idx := 1);</span><br><span style="color: hsl(120, 100%, 40%);">+               as_rx_bvc_reset_tx_ack(mp_gb_cfg.bvc[0].bvci, mp_gb_cfg.bvc[0].cell_id, oneshot := true, idx := 1);</span><br><span>  }</span><br><span>    /* Expect UNBLOCK for ptp BVCI on signaling NS-VC (idx==1) */</span><br><span style="color: hsl(0, 100%, 40%);">-   as_rx_bvc_unblock_tx_ack(mp_gb_cfg.bvci, oneshot := true, idx := 1);</span><br><span style="color: hsl(120, 100%, 40%);">+  as_rx_bvc_unblock_tx_ack(mp_gb_cfg.bvc[0].bvci, oneshot := true, idx := 1);</span><br><span> </span><br><span>      /* wait for one FLOW-CONTROL BVC and then ACK any further in the future. Flow</span><br><span>         * control happens on the p-t-p BVCI and hence on index 1 */</span><br><span style="color: hsl(0, 100%, 40%);">-    as_rx_bvc_fc_tx_ack(mp_gb_cfg.bvci, oneshot := true, idx := 2);</span><br><span style="color: hsl(0, 100%, 40%);">- activate(as_rx_bvc_fc_tx_ack(mp_gb_cfg.bvci, idx := 2));</span><br><span style="color: hsl(120, 100%, 40%);">+      as_rx_bvc_fc_tx_ack(mp_gb_cfg.bvc[0].bvci, oneshot := true, idx := 2);</span><br><span style="color: hsl(120, 100%, 40%);">+        activate(as_rx_bvc_fc_tx_ack(mp_gb_cfg.bvc[0].bvci, idx := 2));</span><br><span> }</span><br><span> </span><br><span> /* Test full IP-SNS bring-up with two NS-VCs, one sig-only and one user-only - and where</span><br><span>@@ -322,8 +322,8 @@</span><br><span>   f_outgoing_ns_alive_no_ack(idx := 0);</span><br><span> </span><br><span>    /* Transmit BVC-RESET and expect no ACK*/</span><br><span style="color: hsl(0, 100%, 40%);">-       f_tx_bvc_reset_rx_ack(0, mp_gb_cfg.cell_id, idx := 1, exp_ack := false);</span><br><span style="color: hsl(0, 100%, 40%);">-        f_tx_bvc_reset_rx_ack(mp_gb_cfg.bvci, mp_gb_cfg.cell_id, idx := 1, exp_ack := false);</span><br><span style="color: hsl(120, 100%, 40%);">+ f_tx_bvc_reset_rx_ack(0, mp_gb_cfg.bvc[0].cell_id, idx := 1, exp_ack := false);</span><br><span style="color: hsl(120, 100%, 40%);">+       f_tx_bvc_reset_rx_ack(mp_gb_cfg.bvc[0].bvci, mp_gb_cfg.bvc[0].cell_id, idx := 1, exp_ack := false);</span><br><span> }</span><br><span> </span><br><span> /* Test adding new IP endpoints at runtime */</span><br><span>diff --git a/pcu/SGSN_Components.ttcn b/pcu/SGSN_Components.ttcn</span><br><span>index 4a94c03..2f1fa75 100644</span><br><span>--- a/pcu/SGSN_Components.ttcn</span><br><span>+++ b/pcu/SGSN_Components.ttcn</span><br><span>@@ -20,18 +20,22 @@</span><br><span> modulepar {</span><br><span>      BssgpConfig mp_gb_cfg := {</span><br><span>           nsei := 1234,</span><br><span style="color: hsl(0, 100%, 40%);">-           bvci := 1234,</span><br><span style="color: hsl(0, 100%, 40%);">-           cell_id := {</span><br><span style="color: hsl(0, 100%, 40%);">-                    ra_id := {</span><br><span style="color: hsl(0, 100%, 40%);">-                              lai := {</span><br><span style="color: hsl(0, 100%, 40%);">-                                        mcc_mnc := '262F42'H, lac := 13135</span><br><span style="color: hsl(0, 100%, 40%);">-                              },</span><br><span style="color: hsl(0, 100%, 40%);">-                              rac := 0</span><br><span style="color: hsl(0, 100%, 40%);">-                        },</span><br><span style="color: hsl(0, 100%, 40%);">-                      cell_id := 20960</span><br><span style="color: hsl(0, 100%, 40%);">-                },</span><br><span>           sgsn_role := true,</span><br><span style="color: hsl(0, 100%, 40%);">-              depth := BSSGP_DECODE_DEPTH_BSSGP</span><br><span style="color: hsl(120, 100%, 40%);">+             bvc := {</span><br><span style="color: hsl(120, 100%, 40%);">+                      {</span><br><span style="color: hsl(120, 100%, 40%);">+                             bvci := 1234,</span><br><span style="color: hsl(120, 100%, 40%);">+                         cell_id := {</span><br><span style="color: hsl(120, 100%, 40%);">+                                  ra_id := {</span><br><span style="color: hsl(120, 100%, 40%);">+                                            lai := {</span><br><span style="color: hsl(120, 100%, 40%);">+                                                      mcc_mnc := '262F42'H, lac := 13135</span><br><span style="color: hsl(120, 100%, 40%);">+                                            },</span><br><span style="color: hsl(120, 100%, 40%);">+                                            rac := 0</span><br><span style="color: hsl(120, 100%, 40%);">+                                      },</span><br><span style="color: hsl(120, 100%, 40%);">+                                    cell_id := 20960</span><br><span style="color: hsl(120, 100%, 40%);">+                              },</span><br><span style="color: hsl(120, 100%, 40%);">+                            depth := BSSGP_DECODE_DEPTH_BSSGP</span><br><span style="color: hsl(120, 100%, 40%);">+                     }</span><br><span style="color: hsl(120, 100%, 40%);">+             }</span><br><span>    };</span><br><span> </span><br><span>       NSConfiguration mp_nsconfig := {</span><br><span>@@ -55,6 +59,7 @@</span><br><span> type component bssgp_CT extends BSSGP_Client_CT {</span><br><span>    var NS_CT ns_component;</span><br><span>      var BSSGP_CT bssgp_component;</span><br><span style="color: hsl(120, 100%, 40%);">+ port BSSGP_CT_PROC_PT PROC;</span><br><span>  var boolean g_initialized := false;</span><br><span> }</span><br><span> </span><br><span>@@ -75,16 +80,22 @@</span><br><span>   /* create a new NS component */</span><br><span>      ns_component := NS_CT.create;</span><br><span>        bssgp_component := BSSGP_CT.create;</span><br><span style="color: hsl(0, 100%, 40%);">-     /* connect our BSSGP port to the BSSGP Emulation */</span><br><span style="color: hsl(0, 100%, 40%);">-     connect(self:BSSGP[0], bssgp_component:BSSGP_SP);</span><br><span style="color: hsl(0, 100%, 40%);">-       connect(self:BSSGP_SIG[0], bssgp_component:BSSGP_SP_SIG);</span><br><span style="color: hsl(0, 100%, 40%);">-       connect(self:BSSGP_PROC[0], bssgp_component:BSSGP_PROC);</span><br><span>     /* connect lower-end of BSSGP with BSSGP_CODEC_PORT (maps to NS_PT*/</span><br><span>         connect(bssgp_component:BSCP, ns_component:NS_SP);</span><br><span style="color: hsl(120, 100%, 40%);">+    connect(self:PROC, bssgp_component:PROC);</span><br><span>    ns_component.start(NSStart(mp_nsconfig));</span><br><span style="color: hsl(0, 100%, 40%);">-       bssgp_component.start(BssgpStart(mp_gb_cfg));</span><br><span style="color: hsl(120, 100%, 40%);">+ bssgp_component.start(BssgpStart(mp_gb_cfg, testcasename()));</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-       f_bssgp_client_register(mmctx.imsi, mmctx.tlli, mp_gb_cfg.cell_id);</span><br><span style="color: hsl(120, 100%, 40%);">+   for (var integer i := 0; i < lengthof(mp_gb_cfg.bvc); i := i+1) {</span><br><span style="color: hsl(120, 100%, 40%);">+          var BSSGP_BVC_CT vc_BVC;</span><br><span style="color: hsl(120, 100%, 40%);">+              /* obtain reference for BVC component (created by BssgpStart) */</span><br><span style="color: hsl(120, 100%, 40%);">+              vc_BVC := f_bssgp_get_bvci_ct(mp_gb_cfg.bvc[i].bvci, PROC);</span><br><span style="color: hsl(120, 100%, 40%);">+           /* connect our BSSGP port to the BSSGP Emulation */</span><br><span style="color: hsl(120, 100%, 40%);">+           connect(self:BSSGP[i], vc_BVC:BSSGP_SP);</span><br><span style="color: hsl(120, 100%, 40%);">+              connect(self:BSSGP_SIG[i], vc_BVC:BSSGP_SP_SIG);</span><br><span style="color: hsl(120, 100%, 40%);">+              connect(self:BSSGP_PROC[i], vc_BVC:BSSGP_PROC);</span><br><span style="color: hsl(120, 100%, 40%);">+               f_bssgp_client_register(mmctx.imsi, mmctx.tlli);</span><br><span style="color: hsl(120, 100%, 40%);">+      }</span><br><span> }</span><br><span> </span><br><span> /* Establish BSSGP connection to PCU */</span><br><span>@@ -93,7 +104,7 @@</span><br><span> </span><br><span>       T.start</span><br><span>      alt {</span><br><span style="color: hsl(0, 100%, 40%);">-   [] BSSGP[0].receive(t_BssgpStsInd(?, ?, BVC_S_UNBLOCKED)) { }</span><br><span style="color: hsl(120, 100%, 40%);">+ [] BSSGP[0].receive(tr_BssgpStsInd(*, ?, BVC_S_UNBLOCKED)) { }</span><br><span>       [] BSSGP[0].receive { repeat; }</span><br><span>      [] T.timeout {</span><br><span>               setverdict(fail, "Timeout establishing BSSGP connection");</span><br><span>diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn</span><br><span>index 8a87ee2..53ecdff 100644</span><br><span>--- a/sgsn/SGSN_Tests.ttcn</span><br><span>+++ b/sgsn/SGSN_Tests.ttcn</span><br><span>@@ -130,9 +130,11 @@</span><br><span>     }</span><br><span> };</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+const integer NUM_BVC_PER_NSE := 1;</span><br><span> type record GbInstance {</span><br><span>         NS_CT vc_NS,</span><br><span>         BSSGP_CT vc_BSSGP,</span><br><span style="color: hsl(120, 100%, 40%);">+    BSSGP_BVC_CT vc_BSSGP_BVC[NUM_BVC_PER_NSE],</span><br><span>  BssgpConfig cfg</span><br><span> };</span><br><span> </span><br><span>@@ -154,6 +156,9 @@</span><br><span>      /* only to get events from IPA underneath GSUP */</span><br><span>    port IPA_CTRL_PT GSUP_IPA_EVENT;</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+  /* only needed at start to get the per-BVC references */</span><br><span style="color: hsl(120, 100%, 40%);">+      port BSSGP_CT_PROC_PT PROC;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>        var GTP_Emulation_CT vc_GTP;</span><br><span> </span><br><span>     port TELNETasp_PT SGSNVTY;</span><br><span>@@ -223,7 +228,13 @@</span><br><span>    connect(gb.vc_BSSGP:BSCP, gb.vc_NS:NS_SP);</span><br><span> </span><br><span>       gb.vc_NS.start(NSStart(mp_nsconfig[offset]));</span><br><span style="color: hsl(0, 100%, 40%);">-   gb.vc_BSSGP.start(BssgpStart(gb.cfg));</span><br><span style="color: hsl(120, 100%, 40%);">+        gb.vc_BSSGP.start(BssgpStart(gb.cfg, testcasename()));</span><br><span style="color: hsl(120, 100%, 40%);">+        /* resolve the per-BVC component references */</span><br><span style="color: hsl(120, 100%, 40%);">+        for (var integer i := 0; i < lengthof(gb.cfg.bvc); i := i+1) {</span><br><span style="color: hsl(120, 100%, 40%);">+             connect(self:PROC, gb.vc_BSSGP:PROC);</span><br><span style="color: hsl(120, 100%, 40%);">+         gb.vc_BSSGP_BVC[i] := f_bssgp_get_bvci_ct(gb.cfg.bvc[i].bvci, PROC);</span><br><span style="color: hsl(120, 100%, 40%);">+          disconnect(self:PROC, gb.vc_BSSGP:PROC);</span><br><span style="color: hsl(120, 100%, 40%);">+      }</span><br><span> }</span><br><span> </span><br><span> private function f_init_gsup(charstring id) runs on test_CT {</span><br><span>@@ -297,45 +308,63 @@</span><br><span>  g_initialized := true;</span><br><span>       g_gb[0].cfg := {</span><br><span>             nsei := 96,</span><br><span style="color: hsl(0, 100%, 40%);">-             bvci := 196,</span><br><span style="color: hsl(0, 100%, 40%);">-            cell_id := {</span><br><span style="color: hsl(0, 100%, 40%);">-                    ra_id := {</span><br><span style="color: hsl(0, 100%, 40%);">-                              lai := {</span><br><span style="color: hsl(0, 100%, 40%);">-                                        mcc_mnc := mcc_mnc, lac := 13135},</span><br><span style="color: hsl(0, 100%, 40%);">-                                      rac := 0</span><br><span style="color: hsl(0, 100%, 40%);">-                                },</span><br><span style="color: hsl(0, 100%, 40%);">-                      cell_id := 20960</span><br><span style="color: hsl(0, 100%, 40%);">-                },</span><br><span>           sgsn_role := false,</span><br><span style="color: hsl(0, 100%, 40%);">-             depth := BSSGP_DECODE_DEPTH_L3</span><br><span style="color: hsl(120, 100%, 40%);">+                bvc := {</span><br><span style="color: hsl(120, 100%, 40%);">+                      {</span><br><span style="color: hsl(120, 100%, 40%);">+                             bvci := 196,</span><br><span style="color: hsl(120, 100%, 40%);">+                          cell_id := {</span><br><span style="color: hsl(120, 100%, 40%);">+                                  ra_id := {</span><br><span style="color: hsl(120, 100%, 40%);">+                                            lai := {</span><br><span style="color: hsl(120, 100%, 40%);">+                                                      mcc_mnc := mcc_mnc,</span><br><span style="color: hsl(120, 100%, 40%);">+                                                   lac := 13135</span><br><span style="color: hsl(120, 100%, 40%);">+                                          },</span><br><span style="color: hsl(120, 100%, 40%);">+                                            rac := 0</span><br><span style="color: hsl(120, 100%, 40%);">+                                      },</span><br><span style="color: hsl(120, 100%, 40%);">+                                    cell_id := 20960</span><br><span style="color: hsl(120, 100%, 40%);">+                              },</span><br><span style="color: hsl(120, 100%, 40%);">+                            depth := 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>    };</span><br><span>   g_gb[1].cfg := {</span><br><span>             nsei := 97,</span><br><span style="color: hsl(0, 100%, 40%);">-             bvci := 210,</span><br><span style="color: hsl(0, 100%, 40%);">-            cell_id := {</span><br><span style="color: hsl(0, 100%, 40%);">-                    ra_id := {</span><br><span style="color: hsl(0, 100%, 40%);">-                              lai := {</span><br><span style="color: hsl(0, 100%, 40%);">-                                        mcc_mnc := mcc_mnc, lac := 13200},</span><br><span style="color: hsl(0, 100%, 40%);">-                                      rac := 0</span><br><span style="color: hsl(0, 100%, 40%);">-                                },</span><br><span style="color: hsl(0, 100%, 40%);">-                      cell_id := 20961</span><br><span style="color: hsl(0, 100%, 40%);">-                },</span><br><span>           sgsn_role := false,</span><br><span style="color: hsl(0, 100%, 40%);">-             depth := BSSGP_DECODE_DEPTH_L3</span><br><span style="color: hsl(120, 100%, 40%);">+                bvc := {</span><br><span style="color: hsl(120, 100%, 40%);">+                      {</span><br><span style="color: hsl(120, 100%, 40%);">+                             bvci := 210,</span><br><span style="color: hsl(120, 100%, 40%);">+                          cell_id := {</span><br><span style="color: hsl(120, 100%, 40%);">+                                  ra_id := {</span><br><span style="color: hsl(120, 100%, 40%);">+                                            lai := {</span><br><span style="color: hsl(120, 100%, 40%);">+                                                      mcc_mnc := mcc_mnc,</span><br><span style="color: hsl(120, 100%, 40%);">+                                                   lac := 13200</span><br><span style="color: hsl(120, 100%, 40%);">+                                          },</span><br><span style="color: hsl(120, 100%, 40%);">+                                            rac := 0</span><br><span style="color: hsl(120, 100%, 40%);">+                                      },</span><br><span style="color: hsl(120, 100%, 40%);">+                                    cell_id := 20961</span><br><span style="color: hsl(120, 100%, 40%);">+                              },</span><br><span style="color: hsl(120, 100%, 40%);">+                            depth := 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>    };</span><br><span>   g_gb[2].cfg := {</span><br><span>             nsei := 98,</span><br><span style="color: hsl(0, 100%, 40%);">-             bvci := 220,</span><br><span style="color: hsl(0, 100%, 40%);">-            cell_id := {</span><br><span style="color: hsl(0, 100%, 40%);">-                    ra_id := {</span><br><span style="color: hsl(0, 100%, 40%);">-                              lai := {</span><br><span style="color: hsl(0, 100%, 40%);">-                                        mcc_mnc := mcc_mnc, lac := 13300},</span><br><span style="color: hsl(0, 100%, 40%);">-                                      rac := 0</span><br><span style="color: hsl(0, 100%, 40%);">-                                },</span><br><span style="color: hsl(0, 100%, 40%);">-                      cell_id := 20962</span><br><span style="color: hsl(0, 100%, 40%);">-                },</span><br><span>           sgsn_role := false,</span><br><span style="color: hsl(0, 100%, 40%);">-             depth := BSSGP_DECODE_DEPTH_L3</span><br><span style="color: hsl(120, 100%, 40%);">+                bvc := {</span><br><span style="color: hsl(120, 100%, 40%);">+                      {</span><br><span style="color: hsl(120, 100%, 40%);">+                             bvci := 220,</span><br><span style="color: hsl(120, 100%, 40%);">+                          cell_id := {</span><br><span style="color: hsl(120, 100%, 40%);">+                                  ra_id := {</span><br><span style="color: hsl(120, 100%, 40%);">+                                            lai := {</span><br><span style="color: hsl(120, 100%, 40%);">+                                                      mcc_mnc := mcc_mnc,</span><br><span style="color: hsl(120, 100%, 40%);">+                                                   lac := 13300</span><br><span style="color: hsl(120, 100%, 40%);">+                                          },</span><br><span style="color: hsl(120, 100%, 40%);">+                                            rac := 0</span><br><span style="color: hsl(120, 100%, 40%);">+                                      },</span><br><span style="color: hsl(120, 100%, 40%);">+                                    cell_id := 20962</span><br><span style="color: hsl(120, 100%, 40%);">+                              },</span><br><span style="color: hsl(120, 100%, 40%);">+                            depth := 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>    };</span><br><span> </span><br><span>       f_init_vty();</span><br><span>@@ -413,7 +442,11 @@</span><br><span>                 tlli := f_gprs_tlli_random(),</span><br><span>                tlli_old := omit,</span><br><span>            ra := omit,</span><br><span style="color: hsl(0, 100%, 40%);">-             bssgp_cell_id := { gb[0].cfg.cell_id, gb[1].cfg.cell_id, gb[2].cfg.cell_id },</span><br><span style="color: hsl(120, 100%, 40%);">+         bssgp_cell_id := {</span><br><span style="color: hsl(120, 100%, 40%);">+                    gb[0].cfg.bvc[0].cell_id,</span><br><span style="color: hsl(120, 100%, 40%);">+                     gb[1].cfg.bvc[0].cell_id,</span><br><span style="color: hsl(120, 100%, 40%);">+                     gb[2].cfg.bvc[0].cell_id</span><br><span style="color: hsl(120, 100%, 40%);">+              },</span><br><span>           rnc_send_initial_ue := true,</span><br><span>                 vec := omit,</span><br><span>                 net := net_pars,</span><br><span>@@ -428,15 +461,18 @@</span><br><span>     }</span><br><span> </span><br><span>        vc_conn := BSSGP_ConnHdlr.create(id);</span><br><span style="color: hsl(0, 100%, 40%);">-   connect(vc_conn:BSSGP[0], gb[0].vc_BSSGP:BSSGP_SP);</span><br><span style="color: hsl(0, 100%, 40%);">-     connect(vc_conn:BSSGP_SIG[0], gb[0].vc_BSSGP:BSSGP_SP_SIG);</span><br><span style="color: hsl(0, 100%, 40%);">-     connect(vc_conn:BSSGP_PROC[0], gb[0].vc_BSSGP:BSSGP_PROC);</span><br><span style="color: hsl(0, 100%, 40%);">-      connect(vc_conn:BSSGP[1], gb[1].vc_BSSGP:BSSGP_SP);</span><br><span style="color: hsl(0, 100%, 40%);">-     connect(vc_conn:BSSGP_SIG[1], gb[1].vc_BSSGP:BSSGP_SP_SIG);</span><br><span style="color: hsl(0, 100%, 40%);">-     connect(vc_conn:BSSGP_PROC[1], gb[1].vc_BSSGP:BSSGP_PROC);</span><br><span style="color: hsl(0, 100%, 40%);">-      connect(vc_conn:BSSGP[2], gb[2].vc_BSSGP:BSSGP_SP);</span><br><span style="color: hsl(0, 100%, 40%);">-     connect(vc_conn:BSSGP_SIG[2], gb[2].vc_BSSGP:BSSGP_SP_SIG);</span><br><span style="color: hsl(0, 100%, 40%);">-     connect(vc_conn:BSSGP_PROC[2], gb[2].vc_BSSGP:BSSGP_PROC);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+  connect(vc_conn:BSSGP[0], gb[0].vc_BSSGP_BVC[0]:BSSGP_SP);</span><br><span style="color: hsl(120, 100%, 40%);">+    connect(vc_conn:BSSGP_SIG[0], gb[0].vc_BSSGP_BVC[0]:BSSGP_SP_SIG);</span><br><span style="color: hsl(120, 100%, 40%);">+    connect(vc_conn:BSSGP_PROC[0], gb[0].vc_BSSGP_BVC[0]:BSSGP_PROC);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   connect(vc_conn:BSSGP[1], gb[1].vc_BSSGP_BVC[0]:BSSGP_SP);</span><br><span style="color: hsl(120, 100%, 40%);">+    connect(vc_conn:BSSGP_SIG[1], gb[1].vc_BSSGP_BVC[0]:BSSGP_SP_SIG);</span><br><span style="color: hsl(120, 100%, 40%);">+    connect(vc_conn:BSSGP_PROC[1], gb[1].vc_BSSGP_BVC[0]:BSSGP_PROC);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   connect(vc_conn:BSSGP[2], gb[2].vc_BSSGP_BVC[0]:BSSGP_SP);</span><br><span style="color: hsl(120, 100%, 40%);">+    connect(vc_conn:BSSGP_SIG[2], gb[2].vc_BSSGP_BVC[0]:BSSGP_SP_SIG);</span><br><span style="color: hsl(120, 100%, 40%);">+    connect(vc_conn:BSSGP_PROC[2], gb[2].vc_BSSGP_BVC[0]:BSSGP_PROC);</span><br><span> </span><br><span>        /* FIXME: support multiple RNCs */</span><br><span>   if (g_ranap_enable) {</span><br><span>@@ -470,7 +506,7 @@</span><br><span>  llc := f_llc_create(false);</span><br><span> </span><br><span>      /* register with BSSGP core */</span><br><span style="color: hsl(0, 100%, 40%);">-  f_bssgp_client_register(g_pars.imsi, g_pars.tlli, g_pars.bssgp_cell_id[0]);</span><br><span style="color: hsl(120, 100%, 40%);">+   f_bssgp_client_register(g_pars.imsi, g_pars.tlli);</span><br><span>   /* tell GSUP dispatcher to send this IMSI to us */</span><br><span>   f_create_gsup_expect(hex2str(g_pars.imsi));</span><br><span>  /* tell GTP dispatcher to send this IMSI to us */</span><br><span>@@ -1091,7 +1127,7 @@</span><br><span> </span><br><span>        /* Simulate a foreign IMSI */</span><br><span>        g_pars.imsi := '001010123456789'H;</span><br><span style="color: hsl(0, 100%, 40%);">-      f_bssgp_client_register(g_pars.imsi, g_pars.tlli, g_pars.bssgp_cell_id[0]);</span><br><span style="color: hsl(120, 100%, 40%);">+   f_bssgp_client_register(g_pars.imsi, g_pars.tlli);</span><br><span> </span><br><span>       g_pars.net.expect_auth := false;</span><br><span> </span><br><span>@@ -2344,7 +2380,7 @@</span><br><span>         f_bssgp_client_unregister(g_pars.imsi);</span><br><span>      /* Simulate a foreign IMSI */</span><br><span>        g_pars.imsi := '001010123456700'H;</span><br><span style="color: hsl(0, 100%, 40%);">-      f_bssgp_client_register(g_pars.imsi, g_pars.tlli, g_pars.bssgp_cell_id[0]);</span><br><span style="color: hsl(120, 100%, 40%);">+   f_bssgp_client_register(g_pars.imsi, g_pars.tlli);</span><br><span> </span><br><span>       /* there is no auth */</span><br><span>       g_pars.net.expect_auth := false;</span><br><span>@@ -2522,7 +2558,7 @@</span><br><span> </span><br><span>         log("rau complete unregistering");</span><br><span>         f_bssgp_client_unregister(g_pars.imsi);</span><br><span style="color: hsl(0, 100%, 40%);">- f_bssgp_client_register(g_pars.imsi, g_pars.tlli, g_pars.bssgp_cell_id[1], BSSGP_PROC[1]);</span><br><span style="color: hsl(120, 100%, 40%);">+    f_bssgp_client_register(g_pars.imsi, g_pars.tlli, BSSGP_PROC[1]);</span><br><span> </span><br><span>        log("sending second RAU via different RA");</span><br><span>        f_routing_area_update(f_cellid_to_RAI(g_pars.bssgp_cell_id[1]), 1);</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/20452">change 20452</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/+/20452"/><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: I7e30b4c4e188518a574e082962fba457b3a97ce3 </div>
<div style="display:none"> Gerrit-Change-Number: 20452 </div>
<div style="display:none"> Gerrit-PatchSet: 4 </div>
<div style="display:none"> Gerrit-Owner: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-Reviewer: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>