BSSGP_Emulation: Only add CellId to BVC-RESET[-ACK] conditionally

We always used to include the CellID IE, but 3GPP TS 48.018 is
actually quite specific about when it should be present and when not.

Change-Id: Iffd023f0272c9ccb087bdd225fcfb08424a46bdf
This commit is contained in:
Harald Welte 2020-09-14 16:07:26 +02:00
parent 18ed23cda5
commit c967d0e6f2
1 changed files with 25 additions and 5 deletions

View File

@ -236,8 +236,17 @@ private function f_change_state(BvcState new_state) runs on BSSGP_CT {
}
}
private function f_sendReset() runs on BSSGP_CT {
var PDU_BSSGP pdu := valueof(ts_BVC_RESET(BSSGP_CAUSE_OM_INTERVENTION, g_cfg.bvci, g_cfg.cell_id));
private function f_sendReset(BssgpBvci bvci) runs on BSSGP_CT {
var PDU_BSSGP pdu;
/* The Cell Identifier IE is mandatory in the BVC-RESET PDU sent from BSS to
* SGSN in order to reset a BVC corresponding to a PTP functional entity. The
* Cell Identifier IE shall not be used in any other BVC-RESET PDU. */
if (g_cfg.sgsn_role) {
pdu := valueof(ts_BVC_RESET(BSSGP_CAUSE_OM_INTERVENTION, bvci, omit));
} else {
pdu := valueof(ts_BVC_RESET(BSSGP_CAUSE_OM_INTERVENTION, bvci, g_cfg.cell_id));
}
log("PDU: ", pdu);
log("ENC: ", enc_PDU_BSSGP(pdu));
@ -435,6 +444,17 @@ private function f_tbl_tlli_by_comp(BSSGP_Client_CT comp_ref) runs on BSSGP_CT r
mtc.stop;
}
private function f_send_bvc_reset_ack(BssgpBvci bvci) runs on BSSGP_CT {
/* The Cell Identifier IE is mandatory in the BVC-RESET-ACK PDU sent from BSS to
* SGSN in response to reset a BVC corresponding to a PTP functional entity. The Cell
* Identifier IE shall not be used in any other BVC-RESET-ACK PDU */
if (g_cfg.sgsn_role) {
BSCP.send(f_BnsUdReq(ts_BVC_RESET_ACK(bvci, omit), 0));
} else {
BSCP.send(f_BnsUdReq(ts_BVC_RESET_ACK(bvci, g_cfg.cell_id), 0));
}
}
altstep as_allstate() runs on BSSGP_CT {
var BSSGP_Client_CT vc_conn;
var NsUnitdataIndication udi;
@ -453,14 +473,14 @@ altstep as_allstate() runs on BSSGP_CT {
/* Respond to RESET with correct BVCI/CellID */
[] BSCP.receive(f_BnsUdInd(tr_BVC_RESET(?, g_cfg.bvci, g_cfg.cell_id), 0)) -> value udi {
log("Rx BVC-RESET for Our BVCI=", g_cfg.bvci);
BSCP.send(f_BnsUdReq(ts_BVC_RESET_ACK(g_cfg.bvci, g_cfg.cell_id), 0));
f_send_bvc_reset_ack(g_cfg.bvci);
f_change_state(BVC_S_UNBLOCKED);
}
/* Respond to RESET for signalling BVCI 0 */
[] BSCP.receive(f_BnsUdInd(tr_BVC_RESET(?, 0, g_cfg.cell_id), 0)) -> value udi {
log("Rx BVC-RESET for Signaling BVCI=0");
BSCP.send(f_BnsUdReq(ts_BVC_RESET_ACK(0, g_cfg.cell_id), 0));
f_send_bvc_reset_ack(0);
}
/* Respond to RESET with wrong NSEI/NSVCI */
@ -486,7 +506,7 @@ altstep as_allstate() runs on BSSGP_CT {
/* if we just became NS-unblocked, send a BCC-RESET */
if (nsi.old_state != NSE_S_ALIVE_UNBLOCKED and nsi.new_state == NSE_S_ALIVE_UNBLOCKED) {
if (g_cfg.sgsn_role == false) {
f_sendReset();
f_sendReset(g_cfg.bvci);
}
/* Idea: We could send BVC-UNBLOCK here like some SGSN do */
}