GSUP_Types: Add support for GSUP_IE_RAT_TYPE

Depends: libosmocore I93850710ab55a605bf61b95063a69682a2899bb1
Change-Id: I5d899fc6f6d4cf6123609b596022a853561f35f5
This commit is contained in:
Harald Welte 2019-08-22 12:40:03 +02:00 committed by laforge
parent 53050cdac4
commit 8eebb6cf10
1 changed files with 46 additions and 6 deletions

View File

@ -43,6 +43,7 @@ type enumerated GSUP_IEI {
OSMO_GSUP_AUTS_IE ('26'O),
OSMO_GSUP_RES_IE ('27'O),
OSMO_GSUP_CN_DOMAIN_IE ('28'O),
OSMO_GSUP_RAT_TYPE_IE ('29'O),
OSMO_GSUP_SESSION_ID_IE ('30'O),
OSMO_GSUP_SESSION_STATE_IE ('31'O),
@ -232,11 +233,21 @@ type record GSUP_IE {
cause_rr, tag = OSMO_GSUP_CAUSE_RR_IE;
cause_bssap, tag = OSMO_GSUP_CAUSE_BSSAP_IE;
cause_sm, tag = OSMO_GSUP_CAUSE_SM_IE;
rat_type, tag = OSMO_GSUP_RAT_TYPE_IE;
)"
};
type record of GSUP_IE GSUP_IEs;
type enumerated GSUP_RatType {
RAT_TYPE_UNKNOWN (0),
RAT_TYPE_GERAN_A (1),
RAT_TYPE_UTRAN_Iu (2),
RAT_TYPE_EUTRAN_SGs (3)
} with { variant "FIELDLENGTH(8)" };
type record of GSUP_RatType GSUP_RatTypes;
type union GSUP_IeValue {
hexstring imsi,
integer cause,
@ -287,7 +298,9 @@ type union GSUP_IeValue {
OCT1 cause_rr,
OCT1 cause_bssap,
OCT1 cause_sm
OCT1 cause_sm,
GSUP_RatTypes rat_type
};
type record GSUP_PDU {
@ -433,6 +446,12 @@ template GSUP_IMEI tr_GSUP_IMEI(template hexstring digits) := {
template (value) GSUP_PDU ts_GSUP_SAI_REQ(hexstring imsi) :=
ts_GSUP(OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST, { valueof(ts_GSUP_IE_IMSI(imsi)) });
template (value) GSUP_PDU ts_GSUP_SAI_REQ_EPS(hexstring imsi) :=
ts_GSUP(OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST, {
valueof(ts_GSUP_IE_IMSI(imsi)),
valueof(ts_GSUP_IE_RAT_TYPE({RAT_TYPE_EUTRAN_SGs}))
});
template GSUP_PDU tr_GSUP_SAI_REQ(template hexstring imsi) :=
tr_GSUP_IMSI(OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST, imsi);
@ -1105,6 +1124,23 @@ template (value) GSUP_IE ts_GSUP_IE_AN_APDU(GSUP_AN_APDU an_apdu) := {
}
}
template (present) GSUP_IE tr_GSUP_IE_RAT_TYPE(template (present) GSUP_RatTypes ratt) := {
tag := OSMO_GSUP_RAT_TYPE_IE,
len := ?,
val := {
rat_type := ratt
}
}
template (value) GSUP_IE ts_GSUP_IE_RAT_TYPE(GSUP_RatTypes ratt) := {
tag := OSMO_GSUP_RAT_TYPE_IE,
len := 0, /* overwritten */
val := {
rat_type := ratt
}
}
private function f_gen_ts_ss_ies(
hexstring imsi,
OCT4 sid,
@ -1486,14 +1522,18 @@ template GSUP_PDU tr_GSUP_MO_READY_FOR_SM_ERR(
}
);
function f_gsup_find_ie(GSUP_PDU msg, GSUP_IEI iei, out GSUP_IeValue ret) return boolean {
for (var integer i := 0; i < sizeof(msg.ies); i := i+1) {
if (msg.ies[i].tag == iei) {
ret := msg.ies[i].val;
function f_gsup_find_nested_ie(GSUP_IEs ies, GSUP_IEI iei, out GSUP_IeValue ret) return boolean {
for (var integer i := 0; i < sizeof(ies); i := i+1) {
if (ies[i].tag == iei) {
ret := ies[i].val;
return true;
}
}
return false;
return false;
}
function f_gsup_find_ie(GSUP_PDU msg, GSUP_IEI iei, out GSUP_IeValue ret) return boolean {
return f_gsup_find_nested_ie(msg.ies, iei, ret);
}
template GSUP_AN_APDU t_GSUP_AN_APDU(