laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/21629 )

Change subject: bssgp: Introduce "GLOBAL" port for PTP BVC
......................................................................

bssgp: Introduce "GLOBAL" port for PTP BVC

There are some messages/procedures on a PTP BVC which are not related
to one specific TLLI, but affect the whole PTP BVC.  First and foremost
that is the FLOW-CONTROL-BVC. Let's check if the user is interested in
handling those internally (by connecting to the GLOBAL port).  If not,
fall back to acknowledging all incoing FC-BVC and ignoring all ACKs.

Related: OS#4891
Change-Id: Ib80a6a522dbcb33fd0e7bd31a73ef28fdc636f57
---
M library/BSSGP_Emulation.ttcnpp
1 file changed, 24 insertions(+), 8 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/library/BSSGP_Emulation.ttcnpp b/library/BSSGP_Emulation.ttcnpp
index ebe9f45..633eee2 100644
--- a/library/BSSGP_Emulation.ttcnpp
+++ b/library/BSSGP_Emulation.ttcnpp
@@ -698,7 +698,10 @@
        /* port to a management instance */
        port BSSGP_BVC_MGMT_SP_PT MGMT;

-       /* BSSGP-User SAP towards the user (Client) */
+       /* per-BVC global port for e.g. BVC Flow Control */
+       port BSSGP_SP_PT GLOBAL;
+
+       /* BSSGP-User SAP towards the user (per-TLLI, Client) */
        port BSSGP_SP_PT BSSGP_SP;
        port BSSGP_SP_PT BSSGP_SP_SIG;
        port BSSGP_PROC_PT BSSGP_PROC;
@@ -1119,16 +1122,24 @@

        [] as_ptp_handle_inbound_reset();

-       /* simply acknowledge all per-BVC Flow Control Messages */
        [g_sgsn_role] BVC.receive(tr_ptp_BnsUdInd(tr_BVC_FC_BVC, g_cfg.bvci)) 
-> value udi {
-               var OCT1 tag := 
udi.bssgp.pDU_BSSGP_FLOW_CONTROL_BVC.tag.unstructured_Value;
-               BVC.send(ts_ptp_BnsUdReq(t_BVC_FC_BVC_ACK(tag), g_cfg.bvci, 
g_bvc_lsp));
+               if (GLOBAL.checkstate("Connected")) {
+                       GLOBAL.send(udi.bssgp);
+               } else {
+                       /* simply acknowledge all per-BVC Flow Control Messages 
*/
+                       var OCT1 tag := 
udi.bssgp.pDU_BSSGP_FLOW_CONTROL_BVC.tag.unstructured_Value;
+                       BVC.send(ts_ptp_BnsUdReq(t_BVC_FC_BVC_ACK(tag), 
g_cfg.bvci, g_bvc_lsp));
+               }
        }
-/*
-       [g_sgsn_role] BVC.receive(tr_ptp_BnsUdInd(t_BVC_FC_MS, g_cfg.bvci)) {
-               BVC.send(ts_ptp_BnsUdReq(t_BVC_FC_MS_ACK, g_cfg.bvci));
+
+       [not g_sgsn_role] BVC.receive(tr_ptp_BnsUdInd(t_BVC_FC_BVC_ACK(?), 
g_cfg.bvci)) -> value udi {
+               if (GLOBAL.checkstate("Connected")) {
+                       GLOBAL.send(udi.bssgp);
+               } else {
+                       /* ignore any incoming flow control ACK */
+               }
        }
-*/
+
        /* Any other PTP BSSGP message: If it has TLLI, route to component; 
otherwise broadcast */
        [] BVC.receive(tr_ptp_BnsUdInd(?, g_cfg.bvci)) -> value udi {
                var BssgpDecoded dec := f_dec_bssgp(udi.bssgp);
@@ -1221,6 +1232,11 @@
                BVC.send(ts_ptp_BnsUdReq(ts_BSSGP_DL_UD(tlli, llc_enc), 
g_cfg.bvci, oct2int(tlli)));
        }

+       /* Testcase sends us BSSGP on global port */
+       [] GLOBAL.receive(PDU_BSSGP:?)-> value bs_pdu sender vc_conn {
+               BVC.send(ts_ptp_BnsUdReq(bs_pdu, g_cfg.bvci, g_bvc_lsp));
+       }
+
        [] MGMT.receive(BssgpBlockRequest:?) -> value bbr {
                f_ptp_sendBlock(bbr.cause);
                }

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/21629
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ib80a6a522dbcb33fd0e7bd31a73ef28fdc636f57
Gerrit-Change-Number: 21629
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <lafo...@osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <lafo...@osmocom.org>
Gerrit-MessageType: merged

Reply via email to