diff --git a/library/Osmocom_Gb_Types.ttcn b/library/Osmocom_Gb_Types.ttcn index 905478537..b82ca3279 100644 --- a/library/Osmocom_Gb_Types.ttcn +++ b/library/Osmocom_Gb_Types.ttcn @@ -946,6 +946,24 @@ octetstring sdu) := { lengthIndicator := { length1 := 4 }, tMSI_Value := int2oct(tmsi, 4) } + private function f_ts_BSSGP_TMSI(template (omit) GsmTmsi tmsi) return template (omit) TMSI_BSSGP { + if (istemplatekind(tmsi, "omit")) { + return omit; + } else { + return ts_BSSGP_TMSI(valueof(tmsi)); + } + } + private function f_tr_BSSGP_TMSI(template GsmTmsi tmsi) return template TMSI_BSSGP { + if (istemplatekind(tmsi, "omit")) { + return omit; + } else if (istemplatekind(tmsi, "*")) { + return *; + } else if (istemplatekind(tmsi, "?")) { + return ?; + } else { + return tr_BSSGP_TMSI(valueof(tmsi)); + } + } function f_bssgp_length_ind(integer len) return LIN2_2a { var LIN2_2a ret; @@ -1828,6 +1846,28 @@ octetstring sdu) := { rac := int2oct(input.rac, 1) } + private function f_ts_BSSGP_RA_ID(template (omit) GSM_Types.RoutingAreaIdentification input) + return template (omit) Routeing_Area { + if (istemplatekind(input, "omit")) { + return omit; + } else { + return ts_BSSGP_RA_ID(valueof(input)); + } + } + + private function f_tr_BSSGP_RA_ID(template GSM_Types.RoutingAreaIdentification input) + return template Routeing_Area { + if (istemplatekind(input, "omit")) { + return omit; + } else if (istemplatekind(input, "*")) { + return *; + } else if (istemplatekind(input, "?")) { + return ?; + } else { + return ts_BSSGP_RA_ID(valueof(input)); + } + } + /* 10.3.6 */ template (value) PDU_BSSGP ts_BSSGP_SUSPEND(GprsTlli tlli, RoutingAreaIdentification ra_id) := { pDU_BSSGP_SUSPEND := { @@ -1944,6 +1984,170 @@ octetstring sdu) := { } } + /* 10.3.12 */ + template (value) PDU_BSSGP ts_BSSGP_DUMMY_PAGING_PS(hexstring imsi, + template (omit) RoutingAreaIdentification ra) := { + pDU_BSSGP_DUMMY_PAGING_PS := { + bssgpPduType := '12'O, + iMSI := ts_BSSGP_IMSI(imsi), + routeing_Area := f_ts_BSSGP_RA_ID(ra), + eDRX_Paremeters := omit + } + } + template (present) PDU_BSSGP tr_BSSGP_DUMMY_PAGING_PS(hexstring imsi, + template RoutingAreaIdentification ra) := { + pDU_BSSGP_DUMMY_PAGING_PS := { + bssgpPduType := '12'O, + iMSI := tr_BSSGP_IMSI(imsi), + routeing_Area := f_tr_BSSGP_RA_ID(ra), + eDRX_Paremeters := omit + } + } + + template (value) Time_Until_Next_Paging_Occasion ts_TimeNextPag(uint8_t mins, uint8_t secs) := { + iEI := '93'O, + ext := '1'B, + lengthIndicator := { + length1 := 2 + }, + minutes := mins, + spare := '00'B, + seconds := secs, + spare2 := '00'B + } + template (present) Time_Until_Next_Paging_Occasion tr_TimeNextPag(template (present) uint8_t mins, + template (present) uint8_t secs) := { + iEI := '93'O, + ext := '1'B, + lengthIndicator := { + length1 := 2 + }, + minutes := mins, + spare := ?, + seconds := secs, + spare2 := ? + } + + /* 10.3.13 */ + template (value) PDU_BSSGP ts_BSSGP_DUMMY_PAGING_PS_RESP(hexstring imsi, uint8_t mins, uint8_t secs) := { + pDU_BSSGP_DUMMY_PAGING_PS_RESPONSE := { + bssgpPduType := '13'O, + iMSI := ts_BSSGP_IMSI(imsi), + time_Until_Next_Paging_Occasion := ts_TimeNextPag(mins, secs) + } + } + template (present) PDU_BSSGP tr_BSSGP_DUMMY_PAGING_PS_RESP(hexstring imsi, + template (present) uint8_t mins, + template (present) uint8_t secs) := { + pDU_BSSGP_DUMMY_PAGING_PS_RESPONSE := { + bssgpPduType := '13'O, + iMSI := tr_BSSGP_IMSI(imsi), + time_Until_Next_Paging_Occasion := tr_TimeNextPag(mins, secs) + } + } + + /* 10.3.14 */ + template (value) PDU_BSSGP ts_BSSGP_PAGING_PS_REJ(hexstring imsi, uint8_t mins, uint8_t secs, + template (omit) GsmTmsi tmsi) := { + pDU_BSSGP_PAGING_PS_REJECT := { + bssgpPduType := '11'O, + iMSI := ts_BSSGP_IMSI(imsi), + pTMSI := f_ts_BSSGP_TMSI(tmsi), + time_Until_Next_Paging_Occasion := ts_TimeNextPag(mins, secs) + } + } + template (present) PDU_BSSGP tr_BSSGP_PAGING_PS_REJ(hexstring imsi, + template (present) uint8_t mins, + template (present) uint8_t secs, + template GsmTmsi tmsi) := { + pDU_BSSGP_PAGING_PS_REJECT := { + bssgpPduType := '11'O, + iMSI := tr_BSSGP_IMSI(imsi), + pTMSI := f_tr_BSSGP_TMSI(tmsi), + time_Until_Next_Paging_Occasion := tr_TimeNextPag(mins, secs) + } + } + + /* 10.3.15 */ + template (value) PDU_BSSGP ts_BSSGP_MS_REG_ENQ(hexstring imsi) := { + pDU_BSSGP_MS_REGISTRATION_ENQUIRY := { + bssgpPduType := '14'O, + iMSI := ts_BSSGP_IMSI(imsi), + mME_Query := omit + } + } + template (present) PDU_BSSGP tr_BSSGP_MS_REG_ENQ(hexstring imsi) := { + pDU_BSSGP_MS_REGISTRATION_ENQUIRY := { + bssgpPduType := '14'O, + iMSI := tr_BSSGP_IMSI(imsi), + mME_Query := * + } + } + + /* 11.3.126 */ + template (value) PLMN_Identity ts_BSSGP_PlmnId(template (value) BcdMccMnc mccmnc) := { + iEI := '96'O, + ext := '1'B, + lengthIndicator := { + length1 := 3 + }, + mccDigit1 := mccmnc[0], + mccDigit2 := mccmnc[1], + mccDigit3 := mccmnc[2], + mncDigit3 := mccmnc[5], + mncDigit1 := mccmnc[3], + mncDigit2 := mccmnc[4] + } + template (present) PLMN_Identity tr_BSSGP_PlmnId(template (present) BcdMccMnc mccmnc) := { + iEI := '96'O, + ext := '1'B, + lengthIndicator := { + length1 := 3 + }, + mccDigit1 := mccmnc[0], + mccDigit2 := mccmnc[1], + mccDigit3 := mccmnc[2], + mncDigit3 := mccmnc[5], + mncDigit1 := mccmnc[3], + mncDigit2 := mccmnc[4] + } + private function f_ts_BSSGP_PlmnId(template (omit) BcdMccMnc mccmnc) + return template (omit) PLMN_Identity { + if (istemplatekind(mccmnc, "omit")) { + return omit; + } else { + return ts_BSSGP_PlmnId(mccmnc); + } + } + private function f_tr_BSSGP_PlmnId(template BcdMccMnc mccmnc) + return template PLMN_Identity { + if (istemplatekind(mccmnc, "omit")) { + return omit; + } else if (istemplatekind(mccmnc, "*")) { + return *; + } else if (istemplatekind(mccmnc, "?")) { + return ?; + } else { + return ts_BSSGP_PlmnId(mccmnc); + } + } + + /* 10.3.16 */ + template (value) PDU_BSSGP ts_BSSGP_MS_REW_ENQ_RESP(hexstring imsi, template (omit) BcdMccMnc mccmnc) := { + pDU_BSSGP_MS_REGISTRATION_ENQUIRY_RESPONSE := { + bssgpPduType := '15'O, + iMSI := ts_BSSGP_IMSI(imsi), + pS_Registered_Operator := f_ts_BSSGP_PlmnId(mccmnc) + } + } + template (present) PDU_BSSGP tr_BSSGP_MS_REW_ENQ_RESP(hexstring imsi, template BcdMccMnc mccmnc) := { + pDU_BSSGP_MS_REGISTRATION_ENQUIRY_RESPONSE := { + bssgpPduType := '15'O, + iMSI := tr_BSSGP_IMSI(imsi), + pS_Registered_Operator := f_tr_BSSGP_PlmnId(mccmnc) + } + } + /* 10.4.1 */ template (value) PDU_BSSGP ts_BSSGP_FLUSH_LL(GprsTlli tlli, template (value) BssgpBvci bvci_old, template (omit) BssgpBvci bvci_new := omit,