summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2020-12-09 11:58:23 +0100
committerHarald Welte <laforge@osmocom.org>2020-12-09 15:31:30 +0100
commit71449b0a13d33b8004ab210e90538ad42dc06154 (patch)
tree164f36a7c335ef06941951142b1119f4cc3b2bf5
parent27a70cc45386c01bc7fe98df06bc6db1ad20e352 (diff)
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
-rw-r--r--library/BSSGP_Emulation.ttcnpp32
1 files changed, 24 insertions, 8 deletions
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 @@ type component BSSGP_BVC_CT {
/* 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 @@ private altstep as_ptp_unblocked() runs on BSSGP_BVC_CT {
[] 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 @@ private altstep as_ptp_unblocked() runs on BSSGP_BVC_CT {
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);
}