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
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);
}