From 3c90515272695e82e3de92e9d14b2493b71b9abd Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Thu, 26 Nov 2020 20:56:09 +0100 Subject: [PATCH] BSSGP_Emulation: Send BssgpResetIndication when PTP BVC are being reset This notifies the user via the MGMT port about the fact that an inbound BVC-RESET procedure just happened. Change-Id: I54d0d5e0e06a330a90dfb1da06062d65022efe81 --- gbproxy/GBProxy_Tests.ttcn | 3 +++ library/BSSGP_Emulation.ttcnpp | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/gbproxy/GBProxy_Tests.ttcn b/gbproxy/GBProxy_Tests.ttcn index df3217499..78eb3896e 100644 --- a/gbproxy/GBProxy_Tests.ttcn +++ b/gbproxy/GBProxy_Tests.ttcn @@ -384,6 +384,9 @@ function f_init() runs on test_CT { [] SGSN_MGMT.receive(BssgpStatusIndication:{*, ?, ?}) { repeat; } + [] SGSN_MGMT.receive(BssgpResetIndication:?) { + repeat; + } [] SGSN_MGMT.receive { setverdict(fail, "Received unexpected message on SGSN_MGMT"); mtc.stop; diff --git a/library/BSSGP_Emulation.ttcnpp b/library/BSSGP_Emulation.ttcnpp index 2fa588bca..c39adaa25 100644 --- a/library/BSSGP_Emulation.ttcnpp +++ b/library/BSSGP_Emulation.ttcnpp @@ -1157,6 +1157,9 @@ private altstep as_ptp_handle_inbound_reset() runs on BSSGP_BVC_CT { /* we are a SGSN: BSS/PCU-originated RESET must have a cell ID */ [g_sgsn_role] BVC.receive(tr_ptp_BnsUdInd(tr_BVC_RESET(?, g_cfg.bvci, g_cfg.cell_id), 0)) -> value udi { log("Rx BVC-RESET from BVCI=", g_cfg.bvci); + if (MGMT.checkstate("Connected")) { + MGMT.send(BssgpResetIndication:{g_cfg.bvci}); + } /* Respond to RESET with correct BVCI but without CellID */ BVC.send(ts_ptp_BnsUdReq(ts_BVC_RESET_ACK(g_cfg.bvci, omit), 0, g_bvc_lsp)); /* FIXME: reset all state? What about clients? */ @@ -1165,6 +1168,9 @@ private altstep as_ptp_handle_inbound_reset() runs on BSSGP_BVC_CT { /* we are a BSS/PCU: SGSN-originated RESET must not have a cell ID */ [not g_sgsn_role] BVC.receive(tr_ptp_BnsUdInd(tr_BVC_RESET(?, g_cfg.bvci, omit), 0)) -> value udi { log("Rx BVC-RESET from BVCI=", g_cfg.bvci); + if (MGMT.checkstate("Connected")) { + MGMT.send(BssgpResetIndication:{g_cfg.bvci}); + } /* Respond to RESET with correct BVCI with CellID */ BVC.send(ts_ptp_BnsUdReq(ts_BVC_RESET_ACK(g_cfg.bvci, g_cfg.cell_id), 0, g_bvc_lsp)); /* FIXME: reset all state? What about clients? */