Osmocom_Gb_Types: Extend RADIO-STATUS templates

RADIO-STATUS can occur with TLLI, but also with P-TMSI or IMSI.
Update our templates accordingly while keeping backwards compatibility.

Related: OS#4951
Change-Id: I1119e50e457b02d52e7c2c26a8b8039bf2118296
This commit is contained in:
Harald Welte 2021-01-17 11:10:30 +01:00
parent 650bd72849
commit 112bc1469a
1 changed files with 43 additions and 8 deletions

View File

@ -897,6 +897,22 @@ octetstring sdu) := {
},
tLLI_Value := tlli
}
private function f_ts_BSSGP_TLLI(template (omit) GprsTlli tlli) return template (omit) TLLI_BSSGP {
if (istemplatekind(tlli, "omit")) {
return omit;
} else {
return ts_BSSGP_TLLI(valueof(tlli));
}
}
private function f_tr_BSSGP_TLLI(template GprsTlli tlli) return template TLLI_BSSGP {
if (istemplatekind(tlli, "omit")) {
return omit;
} else if (istemplatekind(tlli, "*")) {
return *;
} else {
return tr_BSSGP_TLLI(valueof(tlli));
}
}
template (value) Suspend_Reference_Number ts_BSSGP_SUSP_REF(template (value) OCT1 susp_ref) := {
iEI := '1D'O,
@ -932,6 +948,22 @@ octetstring sdu) := {
oddevenIndicator := f_hex_is_odd_length(imsi),
digits := imsi
}
private function f_ts_BSSGP_IMSI(template (omit) hexstring imsi) return template (omit) IMSI_BSSGP {
if (istemplatekind(imsi, "omit")) {
return omit;
} else {
return ts_BSSGP_IMSI(valueof(imsi));
}
}
private function f_tr_BSSGP_IMSI(template hexstring imsi) return template IMSI_BSSGP {
if (istemplatekind(imsi, "omit")) {
return omit;
} else if (istemplatekind(imsi, "*")) {
return *;
} else {
return tr_BSSGP_IMSI(imsi);
}
}
template (present) TMSI_BSSGP tr_BSSGP_TMSI(GsmTmsi tmsi) := {
iEI := '20'O,
@ -2324,22 +2356,25 @@ octetstring sdu) := {
/* 10.3.5 */
template (value) PDU_BSSGP
ts_BSSGP_RADIO_STATUS(GprsTlli tlli, template (value) BssgpRadioCause cause) := {
ts_BSSGP_RADIO_STATUS(template (omit) GprsTlli tlli, template (value) BssgpRadioCause cause,
template (omit) GsmTmsi tmsi := omit,
template (omit) hexstring imsi := omit) := {
pDU_BSSGP_RADIO_STATUS := {
bssgpPduType := '0a'O,
tLLI := ts_BSSGP_TLLI(tlli),
tMSI := omit,
iMSI := omit,
tLLI := f_ts_BSSGP_TLLI(tlli),
tMSI := f_ts_BSSGP_TMSI(tmsi),
iMSI := f_ts_BSSGP_IMSI(imsi),
radio_Cause := ts_BSSGP_RADIO_CAUSE(cause)
}
}
template (present) PDU_BSSGP
tr_BSSGP_RADIO_STATUS(template (present) GprsTlli tlli, template (present) BssgpRadioCause cause) := {
tr_BSSGP_RADIO_STATUS(template GprsTlli tlli, template (present) BssgpRadioCause cause,
template GsmTmsi tmsi := *, template hexstring imsi := *) := {
pDU_BSSGP_RADIO_STATUS := {
bssgpPduType := '0a'O,
tLLI := ts_BSSGP_TLLI(tlli),
tMSI := omit,
iMSI := omit,
tLLI := f_tr_BSSGP_TLLI(tlli),
tMSI := f_tr_BSSGP_TMSI(tmsi),
iMSI := f_tr_BSSGP_IMSI(imsi),
radio_Cause := tr_BSSGP_RADIO_CAUSE(cause)
}
}