diff options
Diffstat (limited to 'library/Osmocom_Gb_Types.ttcn')
-rw-r--r-- | library/Osmocom_Gb_Types.ttcn | 2720 |
1 files changed, 2421 insertions, 299 deletions
diff --git a/library/Osmocom_Gb_Types.ttcn b/library/Osmocom_Gb_Types.ttcn index bd2de109..c387ea3d 100644 --- a/library/Osmocom_Gb_Types.ttcn +++ b/library/Osmocom_Gb_Types.ttcn @@ -5,6 +5,7 @@ module Osmocom_Gb_Types { import from General_Types all; import from Osmocom_Types all; + import from Misc_Helpers all; import from GSM_Types all; import from BSSGP_Types all import from NS_Types all @@ -14,6 +15,16 @@ module Osmocom_Gb_Types { type uint16_t Nsei; type uint16_t BssgpBvci; + template (present) BssgpBvci t_BssgpBvciUser := complement (0); + + type enumerated OsmoNsDialect { + NS2_DIALECT_UNDEF ('00'H), + NS2_DIALECT_STATIC_ALIVE ('01'H), + NS2_DIALECT_STATIC_RESETBLOCK ('02'H), + NS2_DIALECT_IPACCESS ('03'H), + NS2_DIALECT_SNS ('04'H) + }; + /* TS 48.016 10.3.7 */ type enumerated NsPduType { NS_PDUT_NS_UNITDATA ('00000000'B), @@ -55,7 +66,7 @@ module Osmocom_Gb_Types { NS_CAUSE_BVCI_UNKNOWN_AT_NSE ('00000101'B), NS_CAUSE_SEMANTICALLY_INCORRECT_PDU ('00001000'B), NS_CAUSE_PDU_NOT_COMPATIBLE_WITH_PROTOCOL_STATE ('00001010'B), - NS_CAUSE_PROTOCOL_ERROR_UNSPEIFIED ('00001011'B), + NS_CAUSE_PROTOCOL_ERROR_UNSPECIFIED ('00001011'B), NS_CAUSE_INVALID_ESSENTIAL_IE ('00001100'B), NS_CAUSE_MISSING_ESSENTIAL_IE ('00001101'B), NS_CAUSE_INVALID_NR_OF_IPv4_ENDPOINTS ('00001110'B), @@ -150,17 +161,6 @@ module Osmocom_Gb_Types { return ret; } - private function f_oct_or_wc(template integer inp, integer len) return template octetstring { - if (istemplatekind(inp, "omit")) { - return omit; - } else if (istemplatekind(inp, "*")) { - return *; - } else if (istemplatekind(inp, "?")) { - return ?; - } - return int2oct(valueof(inp), len); - } - template (value) NS_VCI ts_NS_IE_NSVCI(Nsvci nsvci) := { iEI := '01'O, ext := '1'B, @@ -175,7 +175,7 @@ module Osmocom_Gb_Types { lengthIndicator := { length1 := 2 }, - nS_VCI := f_oct_or_wc(nsvci, 2) + nS_VCI := int2oct_tmpl(nsvci, 2) } template (value) NSEI_NS ts_NS_IE_NSEI(Nsei nsei) := { @@ -192,7 +192,7 @@ module Osmocom_Gb_Types { lengthIndicator := { length1 := 2 }, - nSEI := f_oct_or_wc(nsei, 2) + nSEI := int2oct_tmpl(nsei, 2) } template (value) IP4_Element ts_SNS_IPv4(charstring ip, integer udp_port, @@ -229,6 +229,40 @@ module Osmocom_Gb_Types { return e; } + template (value) IP6_Element ts_SNS_IPv6(charstring ip, integer udp_port, + uint8_t sig_weight := 1, uint8_t data_weight := 1) := { + ipAddress := f_inet6_addr(ip), + uDP_Port := int2oct(udp_port, 2), + signallingWeight := int2oct(sig_weight, 1), + dataWeight := int2oct(data_weight, 1) + } + function tr_SNS_IPv6(template charstring ip, template integer udp_port, + template uint8_t sig_weight := ?, template uint8_t data_weight := ?) + return template IP6_Element { + var template IP6_Element e; + if (istemplatekind(ip, "?")) { + e.ipAddress := ?; + } else { + e.ipAddress := f_inet6_addr(valueof(ip)); + } + if (istemplatekind(udp_port, "?")) { + e.uDP_Port := ?; + } else { + e.uDP_Port := int2oct(valueof(udp_port), 2); + } + if (istemplatekind(sig_weight, "?")) { + e.signallingWeight := ?; + } else { + e.signallingWeight := int2oct(valueof(sig_weight), 1); + } + if (istemplatekind(data_weight, "?")) { + e.dataWeight := ?; + } else { + e.dataWeight := int2oct(valueof(data_weight), 1); + } + return e; + } + template (value) PDU_NS ts_NS_RESET(NsCause cause, Nsvci nsvci, Nsei nsei) := { pDU_NS_Reset := { @@ -358,7 +392,15 @@ octetstring sdu) := { pDU_NS_Unitdata := { nsPduType := '00'O, nS_SDU_ControlBits := bits, - bVCI := f_oct_or_wc(bvci, 2), + bVCI := int2oct_tmpl(bvci, 2), + nS_SDU := sdu + } + } + template PDU_NS tr_NS_UNITDATA_User(template NS_SDU_ControlBits bits, template octetstring sdu) := { + pDU_NS_Unitdata := { + nsPduType := '00'O, + nS_SDU_ControlBits := bits, + bVCI := complement ('0000'O), nS_SDU := sdu } } @@ -419,7 +461,7 @@ octetstring sdu) := { } template MaxNumberOfNSVCs tr_SNS_IE_MaxNumOfNSVCs(template uint16_t num) := { iEI := '07'O, - maxNumberOfNSVCs := f_oct_or_wc(num, 2) + maxNumberOfNSVCs := int2oct_tmpl(num, 2) } template (value) PDU_NS ts_SNS_SIZE(Nsei nsei, boolean rst_flag := true, @@ -486,6 +528,10 @@ octetstring sdu) := { var template ListofIP4Elements r; if (istemplatekind(elem, "omit")) { return omit; + } else if (istemplatekind(elem, "*")) { + return *; + } else if (istemplatekind(elem, "?")) { + return ?; } else { r := { iEI := '05'O, @@ -523,6 +569,8 @@ octetstring sdu) := { return omit; } else if (istemplatekind(elem, "*")) { return *; + } else if (istemplatekind(elem, "?")) { + return ?; } else { r := { iEI := '06'O, @@ -537,7 +585,7 @@ octetstring sdu) := { } template (value) PDU_NS ts_SNS_CONFIG(Nsei nsei, boolean end_flag, - template (omit) IP4_Elements v4, + template (omit) IP4_Elements v4 := omit, template (omit) IP6_Elements v6 := omit) := { pDU_SNS_Config := { nsPduType := '0F'O, @@ -548,7 +596,7 @@ octetstring sdu) := { } } template PDU_NS tr_SNS_CONFIG(template Nsei nsei, template boolean end_flag, - template IP4_Elements v4, + template IP4_Elements v4 := omit, template IP6_Elements v6 := omit) := { pDU_SNS_Config := { nsPduType := '0F'O, @@ -677,6 +725,14 @@ octetstring sdu) := { } } + template PDU_NS tr_SNS(template Nsei nsei) := ( tr_SNS_SIZE(nsei), + tr_SNS_SIZE_ACK(nsei, *), + tr_SNS_CONFIG(nsei, ?, *, *), + tr_SNS_CONFIG_ACK(nsei, *), + tr_SNS_ADD(nsei, ?, *, *), + tr_SNS_DEL(nsei, ?, *, *), + tr_SNS_CHG_WEIGHT(nsei, ?, *, *), + tr_SNS_ACK(nsei, ?, *, *, *) ) @@ -688,6 +744,11 @@ octetstring sdu) := { CellIdentity cell_id } with { variant "" }; + template (value) BssgpCellId ts_BssgpCellId(template (value) RoutingAreaIdentification rai, CellIdentity cell_id) := { + ra_id := rai, + cell_id := cell_id + }; + type enumerated BssgpCause { BSSGP_CAUSE_PROC_OVERLOAD ('00'H), BSSGP_CAUSE_EQUIMENT_FAILURE ('01'H), @@ -733,14 +794,161 @@ octetstring sdu) := { BSSGP_CAUSE_NOT_ALL_REQUESTED_PFC_CREATED ('3c'H) } with { variant "FIELDLENGTH(8)" }; + private function tr_FLUSH_ACTION(template OCT1 act) + return template Flush_Action { + var template Flush_Action r; + if (istemplatekind(act, "omit")) { + return omit; + } else if (istemplatekind(act, "*")) { + return *; + } else { + r := { + iEI := '0C'O, + ext := '1'B, + lengthIndicator := { + length1 := 1 + }, + actionValue := act + } + return r; + } + } + template (value) Flush_Action ts_FLUSH_ACTION(template (value) OCT1 act) := { + iEI := '0C'O, + ext := '1'B, + lengthIndicator := { + length1 := 1 + }, + actionValue := act + } + + private function tr_NO_OCT_AFF(template integer oct_aff) + return template Number_of_octets_affected { + var template Number_of_octets_affected r; + if (istemplatekind(oct_aff, "omit")) { + return omit; + } else if (istemplatekind(oct_aff, "*")) { + return *; + } else { + r := { + iEI := '25'O, + ext := '1'B, + lengthIndicator := { + length1 := 3 + }, + number_of_octets_transfered_or_deleted := int2oct_tmpl(oct_aff, 3) + } + return r; + } + } + template (value) Number_of_octets_affected ts_NO_OCT_AFF(template (value) integer oct_aff) := { + iEI := '25'O, + ext := '1'B, + lengthIndicator := { + length1 := 3 + }, + number_of_octets_transfered_or_deleted := int2oct(valueof(oct_aff), 3) + } + + private function tr_LLC_FRAMES_DISCARDED(template integer frames_discarded) + return template LLC_Frames_Discarded { + var template LLC_Frames_Discarded r; + if (istemplatekind(frames_discarded, "omit")) { + return omit; + } else if (istemplatekind(frames_discarded, "*")) { + return *; + } else { + r := { + iEI := '0F'O, + ext := '1'B, + lengthIndicator := { + length1 := 1 + }, + number_of_frames_discarded := int2hex_tmpl(frames_discarded, 2) + } + return r; + } + } + template (value) LLC_Frames_Discarded ts_LLC_FRAMES_DISCARDED(template (value) integer frames_discarded) := { + iEI := '0F'O, + ext := '1'B, + lengthIndicator := { + length1 := 1 + }, + number_of_frames_discarded := int2hex(valueof(frames_discarded), 2) + } + - template BVCI t_BSSGP_BVCI(template BssgpBvci bvci) := { + private function tr_BSSGP_BVCI(template BssgpBvci bvci) + return template BVCI { + var template BVCI r; + if (istemplatekind(bvci, "omit")) { + return omit; + } else if (istemplatekind(bvci, "*")) { + return *; + } else { + r := { + iEI := '04'O, + ext := '1'B, + lengthIndicator := { + length1 := 2 + }, + unstructured_value := int2oct_tmpl(bvci, 2) + } + return r; + } + } + template (value) BVCI ts_BSSGP_BVCI(template (value) BssgpBvci bvci) := { iEI := '04'O, ext := '1'B, lengthIndicator := { length1 := 2 }, - unstructured_value := f_oct_or_wc(bvci, 2) + unstructured_value := int2oct(valueof(bvci), 2) + } + private function f_ts_BSSGP_BVCI(template (omit) BssgpBvci bvci) + return template (omit) BVCI { + if (istemplatekind(bvci, "omit")) { + return omit; + } else { + return ts_BSSGP_BVCI(valueof(bvci)); + } + } + + private function t_BSSGP_NSEI(template Nsei nsei) + return template NSEI_BSSGP { + var template NSEI_BSSGP r; + if (istemplatekind(nsei, "omit")) { + return omit; + } else if (istemplatekind(nsei, "*")) { + return *; + } else { + r := { + iEI:= '3E'O, + ext := '1'B, + lengthIndicator := { + length1 := 2 + }, + nSEI := int2oct_tmpl(nsei, 2) + } + return r; + } + } + template (value) NSEI_BSSGP ts_BSSGP_NSEI(template (value) Nsei nsei) := { + iEI:= '3E'O, + ext := '1'B, + lengthIndicator := { + length1 := 2 + }, + nSEI := int2oct(valueof(nsei), 2) + } + private function f_ts_BSSGP_NSEI(template (omit) Nsei nsei) + return template (omit) NSEI_BSSGP { + if (istemplatekind(nsei, "omit")) { + return omit; + } else { + return ts_BSSGP_NSEI(valueof(nsei)); + } } template (value) TLLI_BSSGP ts_BSSGP_TLLI(template (value) GprsTlli tlli) := { @@ -751,7 +959,7 @@ octetstring sdu) := { }, tLLI_Value := tlli } - template TLLI_BSSGP tr_BSSGP_TLLI(template GprsTlli tlli) := { + template (present) TLLI_BSSGP tr_BSSGP_TLLI(template (present) GprsTlli tlli) := { iEI := '1F'O, ext := '1'B, lengthIndicator := { @@ -759,6 +967,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, @@ -777,7 +1001,7 @@ octetstring sdu) := { suspend_Reference_Number_value := susp_ref } - template IMSI_BSSGP tr_BSSGP_IMSI(template hexstring imsi) := { + template (present) IMSI_BSSGP tr_BSSGP_IMSI(template (present) hexstring imsi) := { iEI := '0D'O, ext := '1'B, lengthIndicator := ?, @@ -786,7 +1010,7 @@ octetstring sdu) := { digits := imsi } - template IMSI_BSSGP ts_BSSGP_IMSI(hexstring imsi) := { + template (value) IMSI_BSSGP ts_BSSGP_IMSI(hexstring imsi) := { iEI := '0D'O, ext := '1'B, lengthIndicator := { length1 := 0 /* overwritten */ }, @@ -794,6 +1018,29 @@ 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, + ext := '1'B, + lengthIndicator := { length1 := 4 }, + tMSI_Value := int2oct(tmsi, 4) + } template TMSI_BSSGP ts_BSSGP_TMSI(GsmTmsi tmsi) := { iEI := '20'O, @@ -801,6 +1048,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; @@ -813,7 +1078,7 @@ octetstring sdu) := { } template LLC_PDU ts_BSSGP_LLC_PDU(octetstring pdu) := { - iEI := '0D'O, + iEI := '0E'O, ext := '1'B, lengthIndicator := f_bssgp_length_ind(lengthof(pdu)), lLC_PDU := pdu @@ -838,7 +1103,7 @@ octetstring sdu) := { } return ret; } - function t_BSSGP_CAUSE(template BssgpCause cause) return template Cause_BSSGP { + function tr_BSSGP_CAUSE(template BssgpCause cause) return template Cause_BSSGP { var template Cause_BSSGP ret; ret.iEI := '07'O; ret.ext := '1'B; @@ -851,7 +1116,7 @@ octetstring sdu) := { return ret; } - function t_BSSGP_IE_CellId(template BssgpCellId cid) return template Cell_Identifier { + function tr_BSSGP_IE_CellId(template BssgpCellId cid) return template Cell_Identifier { var template Cell_Identifier ret := { iEI := '08'O, ext := '1'B, @@ -883,93 +1148,182 @@ octetstring sdu) := { ret.mncDigit2 := cid.ra_id.lai.mcc_mnc[5]; } if (isvalue(cid.ra_id.lai.lac)) { - ret.lac := f_oct_or_wc(cid.ra_id.lai.lac, 2); + ret.lac := int2oct_tmpl(cid.ra_id.lai.lac, 2); } } if (isvalue(cid) and isvalue(cid.ra_id)) { - ret.rac := f_oct_or_wc(cid.ra_id.rac, 1); + ret.rac := int2oct_tmpl(cid.ra_id.rac, 1); } if (isvalue(cid)) { - ret.cI_value := f_oct_or_wc(cid.cell_id, 2); + ret.cI_value := int2oct_tmpl(cid.cell_id, 2); } return ret; } + template (value) Cell_Identifier ts_BSSGP_IE_CellId(template (value) BssgpCellId cid) := { + iEI := '08'O, + ext := '1'B, + lengthIndicator := { length1 := 8 }, + mccDigit1 := cid.ra_id.lai.mcc_mnc[0], + mccDigit2 := cid.ra_id.lai.mcc_mnc[1], + mccDigit3 := cid.ra_id.lai.mcc_mnc[2], + mncDigit3 := cid.ra_id.lai.mcc_mnc[3], + mncDigit1 := cid.ra_id.lai.mcc_mnc[4], + mncDigit2 := cid.ra_id.lai.mcc_mnc[5], + lac := int2oct(valueof(cid.ra_id.lai.lac), 2), + rac := int2oct(valueof(cid.ra_id.rac), 1), + cI_value := int2oct(valueof(cid.cell_id), 2) + } + function f_ts_BSSGP_IE_CellId(template (omit) BssgpCellId cid) return template (omit) Cell_Identifier { + if (istemplatekind(cid, "omit")) { + return omit; + } else { + return ts_BSSGP_IE_CellId(valueof(cid)); + } + } + + template (value) Tag ts_BSSGP_IE_Tag(OCT1 tag) := { + iEI := '1E'O, + ext := '1'B, + lengthIndicator := { + length1 := 1 + }, + unstructured_Value := tag + } + template (present) Tag tr_BSSGP_IE_Tag(template (present) OCT1 tag) := { + iEI := '1E'O, + ext := '1'B, + lengthIndicator := { + length1 := 1 + }, + unstructured_Value := tag + } + + template (value) RA_Cap_UPD_CAUSE ts_BSSGP_IE_RACU_Cause(template (value) OCT1 cause) := { + iEI := '1A'O, + ext := '1'B, + lengthIndicator := { + length1 := 1 + }, + rA_CAP_UPD_Cause_value := cause + } + + template (present) RA_Cap_UPD_CAUSE tr_BSSGP_IE_RACU_Cause(template (present) OCT1 cause) := { + iEI := '1A'O, + ext := '1'B, + lengthIndicator := { + length1 := 1 + }, + rA_CAP_UPD_Cause_value := cause + } + + /* 10.4.12 */ template PDU_BSSGP ts_BVC_RESET(BssgpCause cause, BssgpBvci bvci, - template BssgpCellId cell_id) := { + template (omit) BssgpCellId cell_id) := { pDU_BSSGP_BVC_RESET := { bssgpPduType := '22'O, - bVCI := t_BSSGP_BVCI(bvci), + bVCI := ts_BSSGP_BVCI(bvci), cause := ts_BSSGP_CAUSE(cause), - cell_Identifier := t_BSSGP_IE_CellId(cell_id), + cell_Identifier := f_ts_BSSGP_IE_CellId(cell_id), feature_bitmap := omit, extended_Feature_Bitmap := omit } } - template PDU_BSSGP tr_BVC_RESET(template BssgpCause cause, template BssgpBvci bvci, template BssgpCellId cell_id) := { pDU_BSSGP_BVC_RESET := { bssgpPduType := '22'O, - bVCI := t_BSSGP_BVCI(bvci), - cause := t_BSSGP_CAUSE(cause), - cell_Identifier := t_BSSGP_IE_CellId(cell_id), + bVCI := tr_BSSGP_BVCI(bvci), + cause := tr_BSSGP_CAUSE(cause), + cell_Identifier := tr_BSSGP_IE_CellId(cell_id), feature_bitmap := *, extended_Feature_Bitmap := * } } - template PDU_BSSGP ts_BVC_RESET_ACK(BssgpBvci bvci, template BssgpCellId cell_id) := { + /* 10.4.13 */ + template PDU_BSSGP ts_BVC_RESET_ACK(BssgpBvci bvci, template (omit) BssgpCellId cell_id) := { pDU_BSSGP_BVC_RESET_ACK := { bssgpPduType := '23'O, - bVCI := t_BSSGP_BVCI(bvci), - cell_Identifier := t_BSSGP_IE_CellId(cell_id), + bVCI := ts_BSSGP_BVCI(bvci), + cell_Identifier := f_ts_BSSGP_IE_CellId(cell_id), feature_bitmap := omit, extended_Feature_Bitmap := omit } } - template PDU_BSSGP tr_BVC_RESET_ACK(template BssgpBvci bvci, template BssgpCellId cell_id) := { pDU_BSSGP_BVC_RESET_ACK := { bssgpPduType := '23'O, - bVCI := t_BSSGP_BVCI(bvci), - cell_Identifier := t_BSSGP_IE_CellId(cell_id), + bVCI := tr_BSSGP_BVCI(bvci), + cell_Identifier := tr_BSSGP_IE_CellId(cell_id), feature_bitmap := *, extended_Feature_Bitmap := * } } - template PDU_BSSGP t_BVC_UNBLOCK(template BssgpBvci bvci) := { + /* 10.4.10 */ + template (present) PDU_BSSGP tr_BVC_UNBLOCK(template (present) BssgpBvci bvci) := { pDU_BSSGP_BVC_UNBLOCK := { bssgpPduType := '24'O, - bVCI := t_BSSGP_BVCI(bvci) + bVCI := tr_BSSGP_BVCI(bvci) + } + } + template (value) PDU_BSSGP ts_BVC_UNBLOCK(template (value) BssgpBvci bvci) := { + pDU_BSSGP_BVC_UNBLOCK := { + bssgpPduType := '24'O, + bVCI := ts_BSSGP_BVCI(bvci) } } - template PDU_BSSGP t_BVC_UNBLOCK_ACK(template BssgpBvci bvci) := { + /* 10.4.11 */ + template (present) PDU_BSSGP tr_BVC_UNBLOCK_ACK(template (present) BssgpBvci bvci) := { + pDU_BSSGP_BVC_UNBLOCK_ACK := { + bssgpPduType := '25'O, + bVCI := tr_BSSGP_BVCI(bvci) + } + } + template (value) PDU_BSSGP ts_BVC_UNBLOCK_ACK(template (value) BssgpBvci bvci) := { pDU_BSSGP_BVC_UNBLOCK_ACK := { bssgpPduType := '25'O, - bVCI := t_BSSGP_BVCI(bvci) + bVCI := ts_BSSGP_BVCI(bvci) } } - template PDU_BSSGP t_BVC_BLOCK(template BssgpBvci bvci, template BssgpCause cause) := { + /* 10.4.8 */ + template (present) PDU_BSSGP tr_BVC_BLOCK(template (present) BssgpBvci bvci, + template (present) BssgpCause cause) := { pDU_BSSGP_BVC_BLOCK := { bssgpPduType := '20'O, - bVCI := t_BSSGP_BVCI(bvci), - cause := t_BSSGP_CAUSE(cause) + bVCI := tr_BSSGP_BVCI(bvci), + cause := tr_BSSGP_CAUSE(cause) + } + } + template (value) PDU_BSSGP ts_BVC_BLOCK(template (value) BssgpBvci bvci, + template (value) BssgpCause cause) := { + pDU_BSSGP_BVC_BLOCK := { + bssgpPduType := '20'O, + bVCI := ts_BSSGP_BVCI(bvci), + cause := ts_BSSGP_CAUSE(cause) } } - template PDU_BSSGP t_BVC_BLOCK_ACK(template BssgpBvci bvci) := { + /* 10.4.9 */ + template (present) PDU_BSSGP tr_BVC_BLOCK_ACK(template (present) BssgpBvci bvci) := { + pDU_BSSGP_BVC_BLOCK_ACK := { + bssgpPduType := '21'O, + bVCI := tr_BSSGP_BVCI(bvci) + } + } + template (value) PDU_BSSGP ts_BVC_BLOCK_ACK(template (value) BssgpBvci bvci) := { pDU_BSSGP_BVC_BLOCK_ACK := { bssgpPduType := '21'O, - bVCI := t_BSSGP_BVCI(bvci) + bVCI := ts_BSSGP_BVCI(bvci) } } - template PDU_BSSGP t_BVC_FC_BVC(uint16_t bmax, uint16_t bucket_leak_rate, + /* 10.4.4 */ + template (value) PDU_BSSGP ts_BVC_FC_BVC(uint16_t bmax, uint16_t bucket_leak_rate, uint16_t bmax_default_ms, uint16_t r_default_ms, OCT1 tag) := { pDU_BSSGP_FLOW_CONTROL_BVC := { bssgpPduType := '26'O, @@ -987,7 +1341,7 @@ octetstring sdu) := { lengthIndicator := { length1 := 2 }, - bmax := f_oct_or_wc(bmax, 2) + bmax := int2oct(bmax, 2) }, bucket_Leak_Rate := { iEI := '03'O, @@ -995,7 +1349,7 @@ octetstring sdu) := { lengthIndicator := { length1 := 2 }, - r_Value := f_oct_or_wc(bucket_leak_rate, 2) + r_Value := int2oct(bucket_leak_rate, 2) }, bmax_default_MS := { iEI := '01'O, @@ -1003,7 +1357,7 @@ octetstring sdu) := { lengthIndicator := { length1 := 2 }, - bmax := f_oct_or_wc(bmax_default_ms, 2) + bmax := int2oct(bmax_default_ms, 2) }, r_default_MS := { iEI := '1C'O, @@ -1011,7 +1365,7 @@ octetstring sdu) := { lengthIndicator := { length1 := 2 }, - r_default_MS_value := f_oct_or_wc(r_default_ms, 2) + r_default_MS_value := int2oct(r_default_ms, 2) }, bucket_Full_Ratio := omit, bVC_Measurement := omit, @@ -1039,7 +1393,7 @@ octetstring sdu) := { lengthIndicator := { length1 := 2 }, - bmax := f_oct_or_wc(bmax, 2) + bmax := int2oct_tmpl(bmax, 2) }, bucket_Leak_Rate := { iEI := '03'O, @@ -1047,7 +1401,7 @@ octetstring sdu) := { lengthIndicator := { length1 := 2 }, - r_Value := f_oct_or_wc(bucket_leak_rate, 2) + r_Value := int2oct_tmpl(bucket_leak_rate, 2) }, bmax_default_MS := { iEI := '01'O, @@ -1055,7 +1409,7 @@ octetstring sdu) := { lengthIndicator := { length1 := 2 }, - bmax := f_oct_or_wc(bmax_default_ms, 2) + bmax := int2oct_tmpl(bmax_default_ms, 2) }, r_default_MS := { iEI := '1C'O, @@ -1063,7 +1417,7 @@ octetstring sdu) := { lengthIndicator := { length1 := 2 }, - r_default_MS_value := f_oct_or_wc(r_default_ms, 2) + r_default_MS_value := int2oct_tmpl(r_default_ms, 2) }, bucket_Full_Ratio := *, bVC_Measurement := *, @@ -1071,26 +1425,146 @@ octetstring sdu) := { } } - template PDU_BSSGP t_BVC_FC_BVC_ACK(template OCT1 tag) := { + /* 10.4.5 */ + template (present) PDU_BSSGP tr_BVC_FC_BVC_ACK(template (present) OCT1 tag) := { pDU_BSSGP_FLOW_CONTROL_BVC_ACK := { bssgpPduType := '27'O, tag := { iEI := '1E'O, ext := '1'B, lengthIndicator := { + length1 := 1 + }, + unstructured_Value := tag + } + } + } + template (value) PDU_BSSGP ts_BVC_FC_BVC_ACK(template (value) OCT1 tag) := { + pDU_BSSGP_FLOW_CONTROL_BVC_ACK := { + bssgpPduType := '27'O, + tag := { + iEI := '1E'O, + ext := '1'B, + lengthIndicator := { + length1 := 1 + }, + unstructured_Value := tag + } + } + } + + /* 10.4.6 */ + template (value) PDU_BSSGP ts_BVC_FC_MS(GprsTlli tlli, uint16_t bmax, uint16_t bucket_leak_rate, + OCT1 tag) := { + pDU_BSSGP_FLOW_CONTROL_MS := { + bssgpPduType := '28'O, + tLLI := ts_BSSGP_TLLI(tlli), + tag := { + iEI := '1E'O, + ext := '1'B, + lengthIndicator := { + length1 := 1 + }, + unstructured_Value := tag + }, + mS_Bucket_Size := { + iEI := '12'O, + ext := '1'B, + lengthIndicator := { + length1 := 2 + }, + bmax := int2oct(bmax, 2) + }, + bucket_Leak_Rate := { + iEI := '03'O, + ext := '1'B, + lengthIndicator := { length1 := 2 }, + r_Value := int2oct(bucket_leak_rate, 2) + }, + bucket_Full_Ratio := omit, + flow_Control_Granularity := omit + } + } + template (present) PDU_BSSGP tr_BVC_FC_MS(template (present) GprsTlli tlli := ?, + template (present) uint16_t bmax := ?, + template (present) uint16_t bucket_leak_rate := ?, + template (present) OCT1 tag := ?) := { + pDU_BSSGP_FLOW_CONTROL_MS := { + bssgpPduType := '28'O, + tLLI := tr_BSSGP_TLLI(tlli), + tag := { + iEI := '1E'O, + ext := '1'B, + lengthIndicator := { + length1 := 1 + }, + unstructured_Value := tag + }, + mS_Bucket_Size := { + iEI := '12'O, + ext := '1'B, + lengthIndicator := { + length1 := 2 + }, + bmax := int2oct_tmpl(bmax, 2) + }, + bucket_Leak_Rate := { + iEI := '03'O, + ext := '1'B, + lengthIndicator := { + length1 := 2 + }, + r_Value := int2oct_tmpl(bucket_leak_rate, 2) + }, + bucket_Full_Ratio := *, + flow_Control_Granularity := * + } + } + + /* 10.4.7 */ + template (value) PDU_BSSGP ts_BVC_FC_MS_ACK(template (value) GprsTlli tlli, + template (value) OCT1 tag) := { + + pDU_BSSGP_FLOW_CONTROL_MS_ACK := { + bssgpPduType := '29'O, + tLLI := ts_BSSGP_TLLI(tlli), + tag := { + iEI := '1E'O, + ext := '1'B, + lengthIndicator := { + length1 := 1 + }, + unstructured_Value := tag + } + } + } + template (present) PDU_BSSGP tr_BVC_FC_MS_ACK(template (present) GprsTlli tlli, + template (present) OCT1 tag := ?) := { + + pDU_BSSGP_FLOW_CONTROL_MS_ACK := { + bssgpPduType := '29'O, + tLLI := tr_BSSGP_TLLI(tlli), + tag := { + iEI := '1E'O, + ext := '1'B, + lengthIndicator := { + length1 := 1 + }, unstructured_Value := tag } } } - template PDU_BSSGP ts_BSSGP_STATUS(template BssgpBvci bvci, template BssgpCause cause, - PDU_BSSGP pdu) := { + /* 10.4.14 */ + template (value) PDU_BSSGP ts_BSSGP_STATUS(template (omit) BssgpBvci bvci, + template (value) BssgpCause cause, + PDU_BSSGP pdu) := { pDU_BSSGP_STATUS := { bssgpPduType := '41'O, - cause := t_BSSGP_CAUSE(cause), - bVCI := t_BSSGP_BVCI(bvci), + cause := ts_BSSGP_CAUSE(cause), + bVCI := f_ts_BSSGP_BVCI(bvci), pDU_in_Error := { iEI := '15'O, ext := '1'B, @@ -1101,13 +1575,12 @@ octetstring sdu) := { } } } - - template PDU_BSSGP tr_BSSGP_STATUS(template BVCI bvci := ?, template BssgpCause cause := ?, + template PDU_BSSGP tr_BSSGP_STATUS(template BssgpBvci bvci := ?, template BssgpCause cause := ?, template octetstring pdu := ?) := { pDU_BSSGP_STATUS := { bssgpPduType := '41'O, - cause := t_BSSGP_CAUSE(cause), - bVCI := bvci, + cause := tr_BSSGP_CAUSE(cause), + bVCI := tr_BSSGP_BVCI(bvci), pDU_in_Error := { iEI := '15'O, ext := '1'B, @@ -1170,6 +1643,48 @@ octetstring sdu) := { }, presenceBitMSRACap := '0'B }; + template (present) MSRACapabilityValuesRecord_BSSGP + tr_RaCapRec_BSSGP(template (present) BIT4 att := '0001'B /* E-GSM */, template MultislotCap_GPRS_BSSGP mscap_gprs := *, + template MultislotCap_EGPRS_BSSGP mscap_egprs := *) := { + mSRACapabilityValues := { + mSRACapabilityValuesExclude1111 := { + accessTechnType := att, /* E-GSM */ + accessCapabilities := { + lengthIndicator := ?, /* overwritten */ + accessCapabilities := { + rfPowerCapability := '001'B, /* FIXME */ + presenceBitA5 := ?, + a5bits := *, + esind := '1'B, + psbit := '0'B, + vgcs := '0'B, + vbs := '0'B, + presenceBitMultislot := '1'B, + multislotcap := { + presenceBitHscsd := '0'B, + hscsdmultislotclass := omit, + presenceBitGprs := ?, + gprsmultislot := mscap_gprs, + presenceBitSms := '0'B, + multislotCap_SMS := omit, + multislotCapAdditionsAfterRel97 := { + presenceBitEcsdmulti := '0'B, + ecsdmultislotclass := *, + presenceBitEgprsmulti := ?, + multislotCap_EGPRS := mscap_egprs, + presenceBitDtmGprsmulti := ?, + multislotCapdtmgprsmultislotsubclass := * + } + }, + accessCapAdditionsAfterRel97 := * + }, + spare_bits := * + } + } + }, + presenceBitMSRACap := '0'B + }; + template QoS_Profile_V t_defaultQos := { peak_Bit_Rate := int2oct(80, 2), @@ -1180,7 +1695,7 @@ octetstring sdu) := { peakBitRateGranularity := '00'B } - template QoS_Profile ts_QoS_TLV(template QoS_Profile_V qos) := { + template (value) QoS_Profile ts_QoS_TLV(template (value) QoS_Profile_V qos) := { iEI := '18'O, ext := '1'B, lengthIndicator := { length1 := 3 }, @@ -1192,13 +1707,13 @@ octetstring sdu) := { peakBitRateGranularity := qos.peakBitRateGranularity } - template PDU_Lifetime t_DefaultLifetime(uint16_t delay := 65535) := { + template (value) PDU_Lifetime t_DefaultLifetime(uint16_t delay := 65535) := { iEI := '16'O, ext := '1'B, lengthIndicator := { length1 := 2 }, - delay_Value := f_oct_or_wc(delay, 2) + delay_Value := int2oct(delay, 2) } template DRX_Parameters t_defaultDRXparam := { @@ -1219,7 +1734,7 @@ octetstring sdu) := { return omit; } else { ret := { - iEI := '00'O, + iEI := '13'O, ext := '1'B, lengthIndicator := { length1 := 1 @@ -1230,7 +1745,23 @@ octetstring sdu) := { } } - template PDU_BSSGP ts_BSSGP_DL_UD(GprsTlli tlli, octetstring pdu, + function tr_BSSGP_IE_MSRAcap(template MSRadioAccessCapabilityV_BSSGP racap) return template MS_Radio_Access_Capability { + var template MS_Radio_Access_Capability ret; + if (istemplatekind(racap, "omit")) { + return omit; + } else { + ret := { + iEI := '13'O, + ext := ?, + lengthIndicator := ?, + mSRadioAccessCapabilityV_BSSGP := racap + } + return ret; + } + } + + /* 10.2.1 */ + template (value) PDU_BSSGP ts_BSSGP_DL_UD(GprsTlli tlli, octetstring pdu, template (omit) MSRadioAccessCapabilityV_BSSGP racap := omit, template (omit) IMSI_BSSGP imsi := omit) := { pDU_BSSGP_DL_UNITDATA := { @@ -1261,17 +1792,17 @@ octetstring sdu) := { initialLLC_PDU := omit } } - - template PDU_BSSGP tr_BSSGP_DL_UD := { + template (present) PDU_BSSGP tr_BSSGP_DL_UD(template (present) GprsTlli tlli, template (present) octetstring pdu, + template IMSI_BSSGP imsi := omit) := { pDU_BSSGP_DL_UNITDATA := { bssgpPduType := '00'O, - tLLI_current := ?, + tLLI_current := tlli, qoS_Profile := ?, pDU_Lifetime := ?, mS_Radio_Access_Capability := *, priority := *, dRX_Parameters := *, - iMSI := *, + iMSI := imsi, tLLI_old := *, pFI := *, lSA_Information := *, @@ -1287,17 +1818,18 @@ octetstring sdu) := { old_Routing_Area_Identification := *, attach_Indicator := *, alignment_octets := *, - lLC_PDU := tr_BSSGP_LLC_PDU, + lLC_PDU := tr_BSSGP_LLC_PDU(pdu), initialLLC_PDU := * } } - template PDU_BSSGP ts_BSSGP_UL_UD(GprsTlli tlli, BssgpCellId cell_id, octetstring payload) := { + /* 10.2.2 */ + template (value) PDU_BSSGP ts_BSSGP_UL_UD(GprsTlli tlli, BssgpCellId cell_id, octetstring payload) := { pDU_BSSGP_UL_UNITDATA := { bssgpPduType := '01'O, tLLI := tlli, qoS_Profile := t_defaultQos, - cell_Identifier := t_BSSGP_IE_CellId(cell_id), + cell_Identifier := ts_BSSGP_IE_CellId(cell_id), pFI := omit, lSA_Identifier_List := omit, redirect_Attempt_Flag := omit, @@ -1310,14 +1842,13 @@ octetstring sdu) := { lLC_PDU := ts_BSSGP_LLC_PDU(payload) } } - template PDU_BSSGP tr_BSSGP_UL_UD(template GprsTlli tlli := ?, template BssgpCellId cell_id := ?, template octetstring payload := ?) := { pDU_BSSGP_UL_UNITDATA := { bssgpPduType := '01'O, tLLI := tlli, qoS_Profile := ?, - cell_Identifier := t_BSSGP_IE_CellId(cell_id), + cell_Identifier := tr_BSSGP_IE_CellId(cell_id), pFI := *, lSA_Identifier_List := *, redirect_Attempt_Flag := *, @@ -1331,13 +1862,14 @@ octetstring sdu) := { } } + /* 10.3.2 */ template PDU_BSSGP tr_BSSGP_CS_PAGING(BssgpBvci bvci) := { pDU_BSSGP_PAGING_CS := { bssgpPduType := '07'O, iMSI := ?, dRX_Parameters := ?, paging_Field4 := { - bVCI := t_BSSGP_BVCI(bvci) + bVCI := ts_BSSGP_BVCI(bvci) }, tLLI := *, channel_needed := *, @@ -1346,14 +1878,13 @@ octetstring sdu) := { global_CN_Id := * } } - - template PDU_BSSGP ts_BSSGP_CS_PAGING_IMSI(BssgpBvci bvci, hexstring imsi) := { + template (value) PDU_BSSGP ts_BSSGP_CS_PAGING_IMSI(BssgpBvci bvci, hexstring imsi) := { pDU_BSSGP_PAGING_CS := { bssgpPduType := '07'O, iMSI := ts_BSSGP_IMSI(imsi), dRX_Parameters := t_defaultDRXparam, paging_Field4 := { - bVCI := t_BSSGP_BVCI(bvci) + bVCI := ts_BSSGP_BVCI(bvci) }, tLLI := omit, channel_needed := omit, @@ -1362,14 +1893,13 @@ octetstring sdu) := { global_CN_Id := omit } } - - template PDU_BSSGP ts_BSSGP_CS_PAGING_PTMSI(BssgpBvci bvci, hexstring imsi, GsmTmsi tmsi) := { + template (value) PDU_BSSGP ts_BSSGP_CS_PAGING_PTMSI(BssgpBvci bvci, hexstring imsi, GsmTmsi tmsi) := { pDU_BSSGP_PAGING_CS := { bssgpPduType := '07'O, iMSI := ts_BSSGP_IMSI(imsi), dRX_Parameters := t_defaultDRXparam, paging_Field4 := { - bVCI := t_BSSGP_BVCI(bvci) + bVCI := ts_BSSGP_BVCI(bvci) }, tLLI := omit, channel_needed := omit, @@ -1379,13 +1909,14 @@ octetstring sdu) := { } } + /* 10.3.1 */ template PDU_BSSGP tr_BSSGP_PS_PAGING(template BssgpBvci bvci) := { pDU_BSSGP_PAGING_PS := { bssgpPduType := '06'O, iMSI := ?, dRX_Parameters := *, paging_Field4 := { - bVCI := t_BSSGP_BVCI(bvci) + bVCI := tr_BSSGP_BVCI(bvci) }, pFI := *, aBQP := *, @@ -1394,14 +1925,13 @@ octetstring sdu) := { eDRX_Paremeters := * } } - - template PDU_BSSGP ts_BSSGP_PS_PAGING_IMSI(BssgpBvci bvci, hexstring imsi) := { + template (value) PDU_BSSGP ts_BSSGP_PS_PAGING_IMSI(BssgpBvci bvci, hexstring imsi) := { pDU_BSSGP_PAGING_PS := { bssgpPduType := '06'O, iMSI := ts_BSSGP_IMSI(imsi), dRX_Parameters := omit, paging_Field4 := { - bVCI := t_BSSGP_BVCI(bvci) + bVCI := ts_BSSGP_BVCI(bvci) }, pFI := omit, aBQP := omit, @@ -1410,14 +1940,13 @@ octetstring sdu) := { eDRX_Paremeters := omit } } - - template PDU_BSSGP ts_BSSGP_PS_PAGING_PTMSI(BssgpBvci bvci, hexstring imsi, GsmTmsi tmsi) := { + template (value) PDU_BSSGP ts_BSSGP_PS_PAGING_PTMSI(BssgpBvci bvci, hexstring imsi, GsmTmsi tmsi) := { pDU_BSSGP_PAGING_PS := { bssgpPduType := '06'O, iMSI := ts_BSSGP_IMSI(imsi), dRX_Parameters := omit, paging_Field4 := { - bVCI := t_BSSGP_BVCI(bvci) + bVCI := ts_BSSGP_BVCI(bvci) }, pFI := omit, aBQP := omit, @@ -1427,7 +1956,45 @@ octetstring sdu) := { } } - template (value) Routeing_Area ts_BSSGP_RA_ID(RoutingAreaIdentification input) := { + template (value) Paging_Field4 ts_BssgpP4BssArea := { + bSS_Area_Indication := { + iEI := '02'O, + ext := '1'B, + lengthIndicator := { + length1 := 1 + }, + bSS_indicator := '00'O + } + } + + template (value) Paging_Field4 ts_BssgpP4LAC(GSM_Types.LocationAreaIdentification lai) := { + location_Area := ts_BSSGP_LA_ID(lai) + } + + template (value) Paging_Field4 ts_BssgpP4RAC(GSM_Types.RoutingAreaIdentification rai) := { + routeing_Area := ts_BSSGP_RA_ID(rai) + } + + template (value) Paging_Field4 ts_BssgpP4Bvci(BssgpBvci bvci) := { + bVCI := ts_BSSGP_BVCI(bvci) + } + + template (value) Location_Area ts_BSSGP_LA_ID(GSM_Types.LocationAreaIdentification input) := { + iEI := '10'O, + ext := '1'B, + lengthIndicator := { + length1 := 5 + }, + mccDigit1 := input.mcc_mnc[0], + mccDigit2 := input.mcc_mnc[1], + mccDigit3 := input.mcc_mnc[2], + mncDigit3 := input.mcc_mnc[3], + mncDigit1 := input.mcc_mnc[4], + mncDigit2 := input.mcc_mnc[5], + lac := int2oct(input.lac, 2) + } + + template (value) Routeing_Area ts_BSSGP_RA_ID(GSM_Types.RoutingAreaIdentification input) := { iEI := '1B'O, ext := '1'B, lengthIndicator := { @@ -1443,6 +2010,29 @@ 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 := { bssgpPduType := '0B'O, @@ -1450,7 +2040,7 @@ octetstring sdu) := { routeing_Area := ts_BSSGP_RA_ID(ra_id) } } - template PDU_BSSGP tr_BSSGP_SUSPEND(template GprsTlli tlli, RoutingAreaIdentification ra_id) := { + template PDU_BSSGP tr_BSSGP_SUSPEND(template (present) GprsTlli tlli, RoutingAreaIdentification ra_id) := { pDU_BSSGP_SUSPEND := { bssgpPduType := '0B'O, tLLI := tr_BSSGP_TLLI(tlli), @@ -1458,6 +2048,7 @@ octetstring sdu) := { } } + /* 10.3.7 */ template (value) PDU_BSSGP ts_BSSGP_SUSPEND_ACK(GprsTlli tlli, RoutingAreaIdentification ra_id, template (value) OCT1 susp_ref) := { pDU_BSSGP_SUSPEND_ACK := { @@ -1477,6 +2068,7 @@ octetstring sdu) := { } } + /* 10.3.8 */ template (value) PDU_BSSGP ts_BSSGP_SUSPEND_NACK(GprsTlli tlli, RoutingAreaIdentification ra_id, template (omit) BssgpCause cause) := { pDU_BSSGP_SUSPEND_NACK := { @@ -1492,12 +2084,12 @@ octetstring sdu) := { bssgpPduType := '0D'O, tLLI := tr_BSSGP_TLLI(tlli), routeing_Area := ts_BSSGP_RA_ID(ra_id), - cause := t_BSSGP_CAUSE(cause) + cause := tr_BSSGP_CAUSE(cause) } } - + /* 10.3.9 */ template (value) PDU_BSSGP ts_BSSGP_RESUME(GprsTlli tlli, RoutingAreaIdentification ra_id, OCT1 susp_ref) := { pDU_BSSGP_RESUME := { @@ -1507,7 +2099,7 @@ octetstring sdu) := { suspend_Reference_Number := ts_BSSGP_SUSP_REF(susp_ref) } } - template PDU_BSSGP tr_BSSGP_RESUME(template GprsTlli tlli, RoutingAreaIdentification ra_id, + template PDU_BSSGP tr_BSSGP_RESUME(template (present) GprsTlli tlli, RoutingAreaIdentification ra_id, template OCT1 susp_ref) := { pDU_BSSGP_RESUME := { bssgpPduType := '0E'O, @@ -1517,6 +2109,7 @@ octetstring sdu) := { } } + /* 10.3.10 */ template (value) PDU_BSSGP ts_BSSGP_RESUME_ACK(GprsTlli tlli, RoutingAreaIdentification ra_id) := { pDU_BSSGP_RESUME_ACK := { @@ -1525,7 +2118,7 @@ octetstring sdu) := { routeing_Area := ts_BSSGP_RA_ID(ra_id) } } - template PDU_BSSGP tr_BSSGP_RESUME_ACK(template GprsTlli tlli, + template PDU_BSSGP tr_BSSGP_RESUME_ACK(template (present) GprsTlli tlli, RoutingAreaIdentification ra_id) := { pDU_BSSGP_RESUME_ACK := { bssgpPduType := '0F'O, @@ -1534,6 +2127,7 @@ octetstring sdu) := { } } + /* 10.3.11 */ template (value) PDU_BSSGP ts_BSSGP_RESUME_NACK(GprsTlli tlli, RoutingAreaIdentification ra_id, template (omit) BssgpCause cause) := { pDU_BSSGP_RESUME_NACK := { @@ -1543,213 +2137,1741 @@ octetstring sdu) := { cause := ts_BSSGP_CAUSE(cause) } } - template PDU_BSSGP tr_BSSGP_RESUME_NACK(template GprsTlli tlli, + template PDU_BSSGP tr_BSSGP_RESUME_NACK(template (present) GprsTlli tlli, RoutingAreaIdentification ra_id, template BssgpCause cause) := { pDU_BSSGP_RESUME_NACK := { bssgpPduType := '10'O, tLLI := tr_BSSGP_TLLI(tlli), routeing_Area := ts_BSSGP_RA_ID(ra_id), - cause := t_BSSGP_CAUSE(cause) - } - } - - -/* PDU permitted on PTP BVC only (TS 48.018 Section 5.4.1) */ -template (present) PDU_BSSGP tr_BSSGP_PERMITTED_PTP_ONLY := ( - {pDU_BSSGP_DL_UNITDATA := ?}, - {pDU_BSSGP_UL_UNITDATA := ?}, - {pDU_BSSGP_RA_CAPABILITY := ?}, - {pDU_BSSGP_RA_CAPABILITY_UPDATE := ?}, - {pDU_BSSGP_RA_CAPABILITY_UPDATE_ACK := ?}, - {pDU_BSSGP_RADIO_STATUS := ?}, - {pDU_BSSGP_FLOW_CONTROL_BVC := ?}, - {pDU_BSSGP_FLOW_CONTROL_BVC_ACK := ?}, - {pDU_BSSGP_FLOW_CONTROL_MS := ?}, - {pDU_BSSGP_FLOW_CONTROL_MS_ACK := ?}, - {pDU_BSSGP_FLOW_CONTROL_PFC := ?}, - {pDU_BSSGP_FLOW_CONTROL_PFC_ACK := ?}, - {pDU_BSSGP_DOWNLOAD_BSS_PFC := ?}, - {pDU_BSSGP_CREATE_BSS_PFC := ?}, - {pDU_BSSGP_CREATE_BSS_PFC_ACK := ?}, - {pDU_BSSGP_CREATE_BSS_PFC_NACK := ?}, - {pDU_BSSGP_MODIFY_BSS_PFC := ?}, - {pDU_BSSGP_MODIFY_BSS_PFC_ACK := ?}, - {pDU_BSSGP_DELETE_BSS_PFC := ?}, - {pDU_BSSGP_DELETE_BSS_PFC_ACK := ?}, - {pDU_BSSGP_DELETE_BSS_PFC_REQ := ?}, - {pDU_BSSGP_PS_HANDOVER_REQUIRED := ?}, - {pDU_BSSGP_PS_HANDOVER_REQUIRED_ACK := ?}, - {pDU_BSSGP_PS_HANDOVER_REQUIRED_NACK := ?}, - {pDU_BSSGP_PS_HANDOVER_REQUEST := ?}, - {pDU_BSSGP_PS_HANDOVER_REQUEST_ACK := ?}, - {pDU_BSSGP_PS_HANDOVER_REQUEST_NACK := ?}, - {pDU_BSSGP_PS_HANDOVER_COMPLETE := ?}, - {pDU_BSSGP_PS_HANDOVER_COMPLETE_ACK := ?}, - {pDU_BSSGP_PS_HANDOVER_CANCEL := ?} -); - -template (present) PDU_BSSGP tr_BSSGP_PERMITTED_PTP := ( - tr_BSSGP_PERMITTED_PTP_ONLY, - {pDU_BSSGP_PAGING_PS := ?}, - {pDU_BSSGP_PAGING_CS := ?}, - {pDU_BSSGP_STATUS := ?} -); - -/* PDU permitted on Signaling BVC only (TS 48.018 Section 5.4.1) */ -template (present) PDU_BSSGP tr_BSSGP_PERMITTED_SIGN_ONLY := ( - {pDU_BSSGP_SUSPEND := ?}, - {pDU_BSSGP_SUSPEND_ACK := ?}, - {pDU_BSSGP_SUSPEND_NACK := ?}, - {pDU_BSSGP_RESUME := ?}, - {pDU_BSSGP_RESUME_ACK := ?}, - {pDU_BSSGP_RESUME_NACK := ?}, - {pDU_BSSGP_FLUSH_LL := ?}, - {pDU_BSSGP_FLUSH_LL_ACK := ?}, - {pDU_BSSGP_LLC_DISCARDED := ?}, - {pDU_BSSGP_BVC_BLOCK := ?}, - {pDU_BSSGP_BVC_BLOCK_ACK := ?}, - {pDU_BSSGP_BVC_UNBLOCK := ?}, - {pDU_BSSGP_BVC_UNBLOCK_ACK := ?}, - {pDU_BSSGP_BVC_RESET := ?}, - {pDU_BSSGP_BVC_RESET_ACK := ?}, - {pDU_BSSGP_SGSN_INVOKE_TRACE := ?}, - {pDU_BSSGP_PERFORM_LOCATION_REQUEST := ?}, - {pDU_BSSGP_PERFORM_LOCATION_RESPONSE := ?}, - {pDU_BSSGP_PERFORM_LOCATION_ABORT := ?}, - {pDU_BSSGP_POSITION_COMMAND := ?}, - {pDU_BSSGP_POSITION_RESPONSE := ?}, - {pDU_BSSGP_RAN_INFORMATION := ?}, - {pDU_BSSGP_RAN_INFORMATION_REQUEST := ?}, - {pDU_BSSGP_RAN_INFORMATION_ACK := ?}, - {pDU_BSSGP_RAN_INFORMATION_ERROR := ?}, - {pDU_BSSGP_RAN_INFORMATION_APPLICATION_ERROR := ?}, - {pDU_BSSGP_MBMS_SESSION_START_REQUEST := ?}, - {pDU_BSSGP_MBMS_SESSION_START_RESPONSE := ?}, - {pDU_BSSGP_MBMS_SESSION_STOP_REQUEST := ?}, - {pDU_BSSGP_MBMS_STOP_RESPONSE := ?}, - {pDU_BSSGP_SESSION_UPDATE_REQUEST := ?}, - {pDU_BSSGP_SESSION_UPDATE_RESPONSE := ?} -); - -template (present) PDU_BSSGP tr_BSSGP_PERMITTED_SIGN := ( - tr_BSSGP_PERMITTED_SIGN_ONLY, - {pDU_BSSGP_PAGING_PS := ?}, - {pDU_BSSGP_PAGING_CS := ?}, - {pDU_BSSGP_SUSPEND := ?}, - {pDU_BSSGP_STATUS := ?} -); - -/* PDU permitted on PTM BVC only (TS 48.018 Section 5.4.1) */ -template (present) PDU_BSSGP tr_BSSGP_PERMITTED_PTM_ONLY := ( - {pDU_BSSGP_DL_MBMS_UNITDATA := ?}, - {pDU_BSSGP_UL_MBMS_UNITDATA := ?} -); - -template (present) PDU_BSSGP tr_BSSGP_PERMITTED_PTM := ( - tr_BSSGP_PERMITTED_PTM_ONLY, - {pDU_BSSGP_STATUS := ?} -); - - -/* Template for any PTP BVCI IE */ -template (present) BVCI tr_BSSGP_IE_PtpBvci := { - iEI := '04'O, - ext := '1'B, - lengthIndicator := { - length1 := 2 - }, - unstructured_value := complement ('0000'O, '0001'O) -} - -/* message on signaling PTP but containing a ptp BVC */ -/* -template PDU_BSSGP tr_BSSGP_SIG_FOR_PTP(template Bvci bvci) := ( - {pDU_BSSGP_FLUSH_LL:{?,?,tr_BSSGP_IE_PtpBvci, *, *}}, - {pDU_BSSGP_FLUSH_LL_ACK:{?,?,?,tr_BSSGP_IE_PtpBvci, ?, *}}, - {pDU_BSSGP_LLC_DISCARDED:{?,?,?,tr_BSSGP_IE_PtpBvci, ?, *}}, - {pDU_BSSGP_BVC_BLOCK:{?,tr_BSSGP_IE_PtpBvci, ?}}, - {pDU_BSSGP_BVC_BLOCK_ACK:{?,tr_BSSGP_IE_PtpBvci}}, - {pDU_BSSGP_BVC_UNBLOCK:{?,tr_BSSGP_IE_PtpBvci}}, - {pDU_BSSGP_BVC_UNBLOCK_ACK:{?,tr_BSSGP_IE_PtpBvci}}, - {pDU_BSSGP_BVC_RESET:{?,tr_BSSGP_IE_PtpBvci,?,*,*,*}}, - {pDU_BSSGP_BVC_RESET_ACK:{?,tr_BSSGP_IE_PtpBvci,*,*,*}}, - {pDU_BSSGP_STATUS:{?,?,tr_BSSGP_IE_PtpBvci,*}}, - {pDU_BSSGP_PERFORM_LOCATION_REQUEST:{?,?,?,*,tr_BSSGP_IE_PtpBvci,?,?,?,*,*,*,*,*,*,*,*,*}}, - {pDU_BSSGP_PERFORM_LOCATION_RESPONSE:{?,?,tr_BSSGP_IE_PtpBvci,*,*,*,*,*,*}}, - {pDU_BSSGP_PERFORM_LOCATION_ABORT:{?,?,tr_BSSGP_IE_PtpBvci,?}}, - {pDU_BSSGP_POSITION_COMMAND:{ -); -*/ - -/* extract the BVCI IE of given PDU + return it */ -function f_BSSGP_BVCI_IE_get(PDU_BSSGP pdu) return template (omit) BVCI { - select (pdu) { - case (PDU_BSSGP:{pDU_BSSGP_FLUSH_LL:=?}) { - return pdu.pDU_BSSGP_FLUSH_LL.bVCI_old; - } - case (PDU_BSSGP:{pDU_BSSGP_FLUSH_LL_ACK:=?}) { - return pdu.pDU_BSSGP_FLUSH_LL_ACK.bVCI_new; - } - case (PDU_BSSGP:{pDU_BSSGP_LLC_DISCARDED:=?}) { - return pdu.pDU_BSSGP_LLC_DISCARDED.bVCI; - } - case (PDU_BSSGP:{pDU_BSSGP_BVC_BLOCK:=?}) { - return pdu.pDU_BSSGP_BVC_BLOCK.bVCI; - } - case (PDU_BSSGP:{pDU_BSSGP_BVC_BLOCK_ACK:=?}) { - return pdu.pDU_BSSGP_BVC_BLOCK_ACK.bVCI; - } - case (PDU_BSSGP:{pDU_BSSGP_BVC_UNBLOCK:=?}) { - return pdu.pDU_BSSGP_BVC_UNBLOCK.bVCI; - } - case (PDU_BSSGP:{pDU_BSSGP_BVC_UNBLOCK_ACK:=?}) { - return pdu.pDU_BSSGP_BVC_UNBLOCK_ACK.bVCI; - } - case (PDU_BSSGP:{pDU_BSSGP_BVC_RESET:=?}) { - return pdu.pDU_BSSGP_BVC_RESET.bVCI; - } - case (PDU_BSSGP:{pDU_BSSGP_BVC_RESET_ACK:=?}) { - return pdu.pDU_BSSGP_BVC_RESET_ACK.bVCI; - } - case (PDU_BSSGP:{pDU_BSSGP_STATUS:=?}) { - return pdu.pDU_BSSGP_STATUS.bVCI; - } - case (PDU_BSSGP:{pDU_BSSGP_PERFORM_LOCATION_REQUEST:=?}) { - return pdu.pDU_BSSGP_PERFORM_LOCATION_REQUEST.bVCI; - } - case (PDU_BSSGP:{pDU_BSSGP_PERFORM_LOCATION_RESPONSE:=?}) { - return pdu.pDU_BSSGP_PERFORM_LOCATION_RESPONSE.bVCI; - } - case (PDU_BSSGP:{pDU_BSSGP_PERFORM_LOCATION_ABORT:=?}) { - return pdu.pDU_BSSGP_PERFORM_LOCATION_ABORT.bVCI; - } - case (PDU_BSSGP:{pDU_BSSGP_POSITION_COMMAND:=?}) { - return pdu.pDU_BSSGP_POSITION_COMMAND.bVCI; - } - case (PDU_BSSGP:{pDU_BSSGP_POSITION_RESPONSE:=?}) { - return pdu.pDU_BSSGP_POSITION_RESPONSE.bVCI; - } - case (PDU_BSSGP:{pDU_BSSGP_PAGING_PS:={?,?,*,{bVCI:=?},*,*,?,*,*}}) { - return pdu.pDU_BSSGP_PAGING_PS.paging_Field4.bVCI; - } - case (PDU_BSSGP:{pDU_BSSGP_PAGING_CS:={?,?,?,{bVCI:=?},*,*,*,*,*}}) { - return pdu.pDU_BSSGP_PAGING_CS.paging_Field4.bVCI; - } - case else { - return omit; + cause := tr_BSSGP_CAUSE(cause) + } + } + + /* 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(valueof(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(valueof(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, + template (omit) Nsei nsei := omit) := { + pDU_BSSGP_FLUSH_LL := { + bssgpPduType := '2A'O, + tLLI := ts_BSSGP_TLLI(tlli), + bVCI_old := ts_BSSGP_BVCI(bvci_old), + bVCI_new := f_ts_BSSGP_BVCI(bvci_new), + nSEI := f_ts_BSSGP_NSEI(nsei) + } + } + template PDU_BSSGP tr_BSSGP_FLUSH_LL(template (present) GprsTlli tlli, template BssgpBvci bvci_old, + template (omit) BssgpBvci bvci_new := omit, + template (omit) Nsei nsei := omit) := { + pDU_BSSGP_FLUSH_LL := { + bssgpPduType := '2A'O, + tLLI := tr_BSSGP_TLLI(tlli), + bVCI_old := tr_BSSGP_BVCI(bvci_old), + bVCI_new := f_ts_BSSGP_BVCI(bvci_new), + nSEI := f_ts_BSSGP_NSEI(nsei) + } + } + + /* 10.4.2 */ + template (value) PDU_BSSGP ts_BSSGP_FLUSH_LL_ACK(GprsTlli tlli, template (value) OCT1 act, + template (value) integer oct_affected, + template (omit) BssgpBvci bvci_new := omit, + template (omit) Nsei nsei := omit) := { + pDU_BSSGP_FLUSH_LL_ACK := { + bssgpPduType := '2B'O, + tLLI := ts_BSSGP_TLLI(tlli), + flush_Action := ts_FLUSH_ACTION(act), + bVCI_new := f_ts_BSSGP_BVCI(bvci_new), + number_of_octets_affected := ts_NO_OCT_AFF(oct_affected), + nSEI := f_ts_BSSGP_NSEI(nsei) + } + } + template PDU_BSSGP tr_BSSGP_FLUSH_LL_ACK(template (present) GprsTlli tlli, template OCT1 act, + template integer oct_affected, + template (omit) BssgpBvci bvci_new := omit, + template (omit) Nsei nsei := omit) := { + pDU_BSSGP_FLUSH_LL_ACK := { + bssgpPduType := '2B'O, + tLLI := tr_BSSGP_TLLI(tlli), + flush_Action := tr_FLUSH_ACTION(act), + bVCI_new := f_ts_BSSGP_BVCI(bvci_new), + number_of_octets_affected := tr_NO_OCT_AFF(oct_affected), + nSEI := f_ts_BSSGP_NSEI(nsei) + } + } + + /* 10.4.3 */ + template (value) PDU_BSSGP ts_BSSGP_LLC_DISCARDED(GprsTlli tlli, template (value) integer frames_discarded, + template (value) BssgpBvci bvci, + template (value) integer oct_deleted) := { + pDU_BSSGP_LLC_DISCARDED := { + bssgpPduType := '2C'O, + tLLI := ts_BSSGP_TLLI(tlli), + lLC_Frames_Discarded := ts_LLC_FRAMES_DISCARDED(frames_discarded), + bVCI := ts_BSSGP_BVCI(bvci), + number_of_octets_deleted := ts_NO_OCT_AFF(oct_deleted), + pFI := omit + } + } + template PDU_BSSGP tr_BSSGP_LLC_DISCARDED(template (present) GprsTlli tlli, template integer frames_discarded, + template BssgpBvci bvci, + template integer oct_deleted) := { + pDU_BSSGP_LLC_DISCARDED := { + bssgpPduType := '2C'O, + tLLI := tr_BSSGP_TLLI(tlli), + lLC_Frames_Discarded := tr_LLC_FRAMES_DISCARDED(frames_discarded), + bVCI := tr_BSSGP_BVCI(bvci), + number_of_octets_deleted := tr_NO_OCT_AFF(oct_deleted), + pFI := * + } + } + + /* 10.2.3 */ + template (value) PDU_BSSGP ts_BSSGP_RA_CAP(GprsTlli tlli, + template (omit) MSRadioAccessCapabilityV_BSSGP racap := omit) := { + pDU_BSSGP_RA_CAPABILITY := { + bssgpPduType := '02'O, + tLLI := ts_BSSGP_TLLI(tlli), + mS_Radio_Access_Capability := ts_BSSGP_IE_MSRAcap_omit(racap) + } + } + template (present) PDU_BSSGP tr_BSSGP_RA_CAP(template (present) GprsTlli tlli, + template MSRadioAccessCapabilityV_BSSGP racap) := { + pDU_BSSGP_RA_CAPABILITY := { + bssgpPduType := '02'O, + tLLI := tr_BSSGP_TLLI(tlli), + mS_Radio_Access_Capability := tr_BSSGP_IE_MSRAcap(racap) + } + } + + + /* 10.3.3 */ + template (value) PDU_BSSGP ts_BSSGP_RA_CAP_UPD(GprsTlli tlli, OCT1 tag) := { + pDU_BSSGP_RA_CAPABILITY_UPDATE := { + bssgpPduType := '08'O, + tLLI := ts_BSSGP_TLLI(tlli), + tag := ts_BSSGP_IE_Tag(tag) + } + } + template (present) PDU_BSSGP tr_BSSGP_RA_CAP_UPD(template (present) GprsTlli tlli, + template (present) OCT1 tag) := { + pDU_BSSGP_RA_CAPABILITY_UPDATE := { + bssgpPduType := '08'O, + tLLI := tr_BSSGP_TLLI(tlli), + tag := tr_BSSGP_IE_Tag(tag) + } + } + + + /* 10.3.4 */ + template (value) PDU_BSSGP + ts_BSSGP_RA_CAP_UPD_ACK(GprsTlli tlli, OCT1 tag, template (value) OCT1 cause, + template (omit) MSRadioAccessCapabilityV_BSSGP racap := omit) := { + pDU_BSSGP_RA_CAPABILITY_UPDATE_ACK := { + bssgpPduType := '09'O, + tLLI := ts_BSSGP_TLLI(tlli), + tag := ts_BSSGP_IE_Tag(tag), + iMSI := omit, + rA_Cap_UPDATE_CAUSE := ts_BSSGP_IE_RACU_Cause(cause), + mS_Radio_Access_Capability := ts_BSSGP_IE_MSRAcap_omit(racap) + } + } + template (present) PDU_BSSGP + tr_BSSGP_RA_CAP_UPD_ACK(template (present) GprsTlli tlli, template (present) OCT1 tag, template (present) OCT1 cause, + template MSRadioAccessCapabilityV_BSSGP racap := omit) := { + pDU_BSSGP_RA_CAPABILITY_UPDATE_ACK := { + bssgpPduType := '09'O, + tLLI := tr_BSSGP_TLLI(tlli), + tag := tr_BSSGP_IE_Tag(tag), + iMSI := omit, + rA_Cap_UPDATE_CAUSE := tr_BSSGP_IE_RACU_Cause(cause), + mS_Radio_Access_Capability := tr_BSSGP_IE_MSRAcap(racap) } } -} -/* extract the BVCI IE of given PDU + convert it to integer value */ -function f_BSSGP_BVCI_get(PDU_BSSGP pdu) return template (omit) BssgpBvci { - var template (omit) BVCI bvci_raw := f_BSSGP_BVCI_IE_get(pdu); - if (istemplatekind(bvci_raw, "omit")) { + type enumerated BssgpRadioCause { + BSSGP_RADIO_CAUSE_CONTACT_LOST ('00'H), + BSSGP_RADIO_CAUSE_LINK_QUAL_INSUFF ('01'H), + BSSGP_RADIO_CAUSE_CELL_RESEL_ORDERED ('02'H), + BSSGP_RADIO_CAUSE_CELL_RESEL_PREPARE ('03'H), + BSSGP_RADIO_CAUSE_CELL_RESEL_FAILURE ('04'H) + } with { variant "FIELDLENGTH(8)" }; + + function ts_BSSGP_RADIO_CAUSE(template (omit) BssgpRadioCause cause) return template (omit) Radio_Cause { + var template (omit) Radio_Cause ret; + if (istemplatekind(cause, "omit")) { + ret := omit; + } else { + ret.iEI := '19'O; + ret.ext := '1'B; + ret.lengthIndicator := { length1 := 1 }; + ret.radio_Cause_Value := int2oct(enum2int(valueof(cause)), 1); + } + return ret; + } + function tr_BSSGP_RADIO_CAUSE(template BssgpRadioCause cause) return template (present) Radio_Cause { + var template (present) Radio_Cause ret; + ret.iEI := '19'O; + ret.ext := '1'B; + ret.lengthIndicator := { length1 := 1 }; + if (isvalue(cause)) { + ret.radio_Cause_Value := int2oct(enum2int(valueof(cause)), 1); + } else { + ret.radio_Cause_Value := ? + } + return ret; + } + + /* 10.3.5 */ + template (value) PDU_BSSGP + 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 := 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 GprsTlli tlli, template (present) BssgpRadioCause cause, + template GsmTmsi tmsi := *, template hexstring imsi := *) := { + pDU_BSSGP_RADIO_STATUS := { + bssgpPduType := '0a'O, + 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) + } + } + + /* 10.4.15 */ + template (value) PDU_BSSGP + ts_BSSGP_INVOKE_TRACE(OCT1 eq_trace, OCT2 ref) := { + pDU_BSSGP_SGSN_INVOKE_TRACE := { + bssgpPduType := '40'O, + traceType := { + iEI := '22'O, + ext := '1'B, + lengthIndicator := { + length1 := 1 + }, + equipment_Trace := eq_trace + }, + traceReference := { + iEI := '21'O, + ext := '1'B, + lengthIndicator := { + length1 := 2 + }, + trace_Reference := ref + }, + triggerId := omit, + mobileId := omit, + omcId := omit, + transactionId := omit + } + } + template (present) PDU_BSSGP + tr_BSSGP_INVOKE_TRACE(template (present) OCT1 eq_trace, template (present) OCT2 ref) := { + pDU_BSSGP_SGSN_INVOKE_TRACE := { + bssgpPduType := '40'O, + traceType := { + iEI := '22'O, + ext := '1'B, + lengthIndicator := { + length1 := 1 + }, + equipment_Trace := eq_trace + }, + traceReference := { + iEI := '21'O, + ext := '1'B, + lengthIndicator := { + length1 := 2 + }, + trace_Reference := ref + }, + triggerId := *, + mobileId := *, + omcId := *, + transactionId := * + } + } + + /* 10.4.36 */ + template (value) PDU_BSSGP + ts_OVERLOAD(template (value) BIT1 priority_class) := { + pDU_BSSGP_OVERLOAD := { + bssgpPduType := '42'O, + priority_Class_Indicator := { + iEI := '8f'O, + ext := '1'B, + lengthIndicator := { + length1 := 1 + }, + priority_Class_Indicator_Value := priority_class, + spare := '0000000'B + } + } + } + template (present) PDU_BSSGP + tr_OVERLOAD(template (present) BIT1 priority_class) := { + pDU_BSSGP_OVERLOAD := { + bssgpPduType := '42'O, + priority_Class_Indicator := { + iEI := '8f'O, + ext := '1'B, + lengthIndicator := { + length1 := 1 + }, + priority_Class_Indicator_Value := priority_class, + spare := '0000000'B + } + } + } + + /* 3GPP TS 48.018 11.3.61 */ + const OCT1 RIM_APP_ID_NACC := '01'O; + const OCT1 RIM_APP_ID_SI3 := '02'O; + const OCT1 RIM_APP_ID_MBMS_DATA_CH := '03'O; + const OCT1 RIM_APP_ID_SON_TRANSF := '04'O; + const OCT1 RIM_APP_ID_UTRA_SI := '05'O; + template (value) RIM_Application_Identity ts_RIM_Application_Identity(OCT1 app_id) := { + iEI := '4B'O, + ext := '1'B, + lengthIndicator := { + length1 := 1 + }, + rIMApplicationIdentity := app_id + } + template RIM_Application_Identity tr_RIM_Application_Identity(template OCT1 app_id := ?) := { + iEI := '4B'O, + ext := '1'B, + lengthIndicator := { + length1 := 1 + }, + rIMApplicationIdentity := app_id + } + + /* 3GPP TS 48.018 11.3.62 */ + template (value) RIM_Sequence_Number ts_RIM_Sequence_Number(integer seq) := { + iEI := '4C'O, + ext := '1'B, + lengthIndicator := { + length1 := 4 + }, + rIMSequenceNumber := int2oct(seq, 4) + } + function tr_RIM_Sequence_Number(template integer seq := ?) return template RIM_Sequence_Number { + var template RIM_Sequence_Number ret; + ret.iEI := '4C'O; + ret.ext := '1'B; + ret.lengthIndicator := { length1 := 4 }; + if (istemplatekind(seq, "*")) { + ret.rIMSequenceNumber := *; + } else if (istemplatekind(seq, "?")) { + ret.rIMSequenceNumber := ?; + } else { + ret.rIMSequenceNumber := int2oct(valueof(seq), 4); + } + return ret; + } + + /* 3GPP TS 48.018 11.3.62a.1 */ + template (value) RAN_Information_Request_RIM_Container + ts_RAN_Information_Request_RIM_Container(template (value) RIM_Application_Identity app_id, + template (value) RIM_Sequence_Number seq, + template (value) RIM_PDU_Indications ind, + template (omit) RIM_Protocol_Version_Number ver := omit, + template (omit) RAN_Information_Request_Application_Container app_cont := omit, + template (omit) SON_Transfer_Application_Identity_TLV son_app_id := omit) := { + iEI := '57'O, + ext := '1'B, + lengthIndicator := { + length1 := 0 /* overwritten */ + }, + rIM_Application_Identity := app_id, + rIM_Sequence_Number := seq, + rIM_PDU_Indications := ind, + rIM_Protocol_Version_Number := ver, + application_Container := app_cont, + sON_Transfer_Application_Identity_TLV := son_app_id + } + template RAN_Information_Request_RIM_Container + tr_RAN_Information_Request_RIM_Container(template RIM_Application_Identity app_id := ?, + template RIM_Sequence_Number seq := ?, + template RIM_PDU_Indications ind := ?, + template RIM_Protocol_Version_Number ver := *, + template RAN_Information_Request_Application_Container app_cont := *, + template SON_Transfer_Application_Identity_TLV son_app_id := *) := { + iEI := '57'O, + ext := '1'B, + lengthIndicator := { + length1 := ? + }, + rIM_Application_Identity := app_id, + rIM_Sequence_Number := seq, + rIM_PDU_Indications := ind, + rIM_Protocol_Version_Number := ver, + application_Container := app_cont, + sON_Transfer_Application_Identity_TLV := son_app_id + } + + + /* 3GPP TS 48.018 11.3.62a.2 */ + template (value) RAN_Information_RIM_Container + ts_RAN_Information_RIM_Container(template (value) RIM_Application_Identity app_id, + template (value) RIM_Sequence_Number seq, + template (value) RIM_PDU_Indications ind, + template (omit) RIM_Protocol_Version_Number ver := omit, + template (omit) ApplContainer_or_ApplErrContainer app_cont_or_app_err := omit, + template (omit) SON_Transfer_Application_Identity_TLV son_app_id := omit) := { + + iEI := '58'O, + ext := '1'B, + lengthIndicator := { + length1 := 0 /* overwritten */ + }, + rIM_Application_Identity := app_id, + rIM_Sequence_Number := seq, + rIM_PDU_Indications := ind, + rIM_Protocol_Version_Number := ver, + applContainer_or_ApplErrContainer := app_cont_or_app_err, + sON_Transfer_Application_Identity := son_app_id + } + template RAN_Information_RIM_Container + tr_RAN_Information_RIM_Container(template RIM_Application_Identity app_id := ?, + template RIM_Sequence_Number seq := ?, + template RIM_PDU_Indications ind := ?, + template RIM_Protocol_Version_Number ver := omit, + template ApplContainer_or_ApplErrContainer app_cont_or_app_err := omit, + template SON_Transfer_Application_Identity_TLV son_app_id := omit) := { + + iEI := '58'O, + ext := '1'B, + lengthIndicator := { + length1 := ? + }, + rIM_Application_Identity := app_id, + rIM_Sequence_Number := seq, + rIM_PDU_Indications := ind, + rIM_Protocol_Version_Number := ver, + applContainer_or_ApplErrContainer := app_cont_or_app_err, + sON_Transfer_Application_Identity := son_app_id + } + template (value) ApplContainer_or_ApplErrContainer + tsu_ApplContainer_or_ApplErrContainer_NACC(template (value) ApplContainer_or_ApplErrContainer_NACC cont) := { + nacc := cont + } + template ApplContainer_or_ApplErrContainer + tru_ApplContainer_or_ApplErrContainer_NACC(template ApplContainer_or_ApplErrContainer_NACC cont := ?) := { + nacc := cont + } + template (value) ApplContainer_or_ApplErrContainer + tsu_ApplContainer_or_ApplErrContainer_SI3(template (value) ApplContainer_or_ApplErrContainer_SI3 cont) := { + si3 := cont + } + template (value) ApplContainer_or_ApplErrContainer + tsu_ApplContainer_or_ApplErrContainer_MBMS_data_channel(template (value) ApplContainer_or_ApplErrContainer_MBMS_data_channel cont) := { + mBMS_data_channel := cont + } + template (value) ApplContainer_or_ApplErrContainer_NACC + tsu_ApplContainer_NACC(template (value) BssgpCellId cid, boolean psi_type, integer si_psi_num, octetstring si_psi) := { + application_Container := ts_RAN_Information_Application_Container_NACC(cid, psi_type, si_psi_num, si_psi) + } + template ApplContainer_or_ApplErrContainer_NACC + tru_ApplContainer_NACC(template BssgpCellId cid := ?, template boolean psi_type := ?, template integer si_psi_num := ?, template octetstring si_psi := ?) := { + application_Container := tr_RAN_Information_Application_Container_NACC(cid, psi_type, si_psi_num, si_psi) + } + template (value) ApplContainer_or_ApplErrContainer_NACC + tsu_ApplErrContainer_NACC(template (value) BssgpCellId cid, + integer cause, + template (value) Application_Container_IE_NACC app_cont) := { + application_Error_Container := ts_Application_Error_Container_NACC(cid, cause, app_cont) + } + template (value) ApplContainer_or_ApplErrContainer_SI3 + tsu_ApplContainer_SI3(template (value) BssgpCellId cid, template (value) SI3 si3) := { + application_Container := ts_RAN_Information_Application_Container_SI3(cid, si3) + } + template (value) ApplContainer_or_ApplErrContainer_SI3 + tsu_ApplErrContainer_SI3(template (value) BssgpCellId cid, + integer cause, + template (value) Application_Container_IE_SI3 app_cont) := { + application_Error_Container := ts_Application_Error_Container_SI3(cid, cause, app_cont) + } + template (value) ApplContainer_or_ApplErrContainer_MBMS_data_channel + tsu_ApplContainer_MBMS_data_channel(template (value) BssgpCellId cid, octetstring data_ch_report) := { + application_Container := ts_RAN_Information_Application_Container_MBMS_data_channel(cid, data_ch_report) + } + template (value) ApplContainer_or_ApplErrContainer_MBMS_data_channel + tsu_ApplErrContainer_MBMS_data_channel(template (value) BssgpCellId cid, + integer cause, + template (value) Application_Container_IE_MBMS_data_channel app_cont) := { + application_Error_Container := ts_Application_Error_Container_MBMS_data_channel(cid, cause, app_cont) + } + + /* 3GPP TS 48.018 11.3.62a.3 */ + template (value) RAN_Information_Ack_RIM_Container + ts_RAN_Information_Ack_RIM_Container(template (value) RIM_Application_Identity app_id, + template (value) RIM_Sequence_Number seq, + template (omit) RIM_Protocol_Version_Number ver := omit, + template (omit) SON_Transfer_Application_Identity_TLV son_app_id := omit) := { + iEI := '5A'O, + ext := '1'B, + lengthIndicator := { + length1 := 0 /* overwritten */ + }, + rIM_Application_Identity := app_id, + rIM_Sequence_Number := seq, + rIM_Protocol_Version_Number := ver, + sON_Transfer_Application_Identity := son_app_id + } + template RAN_Information_Ack_RIM_Container + tr_RAN_Information_Ack_RIM_Container(template RIM_Application_Identity app_id := ?, + template RIM_Sequence_Number seq := ?, + template RIM_Protocol_Version_Number ver := omit, + template SON_Transfer_Application_Identity_TLV son_app_id := omit) := { + iEI := '5A'O, + ext := '1'B, + lengthIndicator := { + length1 := ? + }, + rIM_Application_Identity := app_id, + rIM_Sequence_Number := seq, + rIM_Protocol_Version_Number := ver, + sON_Transfer_Application_Identity := son_app_id + } + + /* 3GPP TS 48.018 11.3.62a.4 */ + template (value) RAN_Information_Error_RIM_Container + ts_RAN_Information_Error_RIM_Container(template (value) RIM_Application_Identity app_id, + template (value) Cause_BSSGP cause, + template (omit) RIM_Protocol_Version_Number ver := omit, + PDU_BSSGP pdu, + template (omit) SON_Transfer_Application_Identity_TLV son_app_id := omit) := { + iEI := '5B'O, + ext := '1'B, + lengthIndicator := { + length1 := 0 /* overwritten */ + }, + rIM_Application_Identity := app_id, + rIM_cause := cause, + rIM_Protocol_Version_Number := ver, + pDU_in_Error:= { + iEI := '15'O, + ext := '1'B, + lengthIndicator := { + length1 := 0 /* overwritten */ + }, + erroneous_BSSGP_PDU := enc_PDU_BSSGP(pdu) + }, + sON_Transfer_Application_Identity := son_app_id + } + template RAN_Information_Error_RIM_Container + tr_RAN_Information_Error_RIM_Container(template RIM_Application_Identity app_id := ?, + template Cause_BSSGP cause := ?, + template RIM_Protocol_Version_Number ver := omit, + template octetstring pdu := ?, + template SON_Transfer_Application_Identity_TLV son_app_id := omit) := { + iEI := '5B'O, + ext := '1'B, + lengthIndicator := { + length1 := ? + }, + rIM_Application_Identity := app_id, + rIM_cause := cause, + rIM_Protocol_Version_Number := ver, + pDU_in_Error:= { + iEI := '15'O, + ext := '1'B, + lengthIndicator := { + length1 := ? + }, + erroneous_BSSGP_PDU := pdu + }, + sON_Transfer_Application_Identity := son_app_id + } + + /* 3GPP TS 48.018 11.3.62a.5 */ + template (value) RAN_Information_Application_Error_RIM_Container + ts_RAN_Information_Application_Error_RIM_Container(template (value) RIM_Application_Identity app_id, + template (value) RIM_Sequence_Number seq, + template (value) RIM_PDU_Indications ind, + template (omit) RIM_Protocol_Version_Number ver := omit, + template (value) Application_Error_Container cont, + template (omit) SON_Transfer_Application_Identity_TLV son_app_id := omit) := { + iEI := '59'O, + ext := '1'B, + lengthIndicator := { + length1 := 0 /* overwritten */ + }, + rIM_Application_Identity := app_id, + rIM_Sequence_Number := seq, + rIM_PDU_Indications := ind, + rIM_Protocol_Version_Number := ver, + application_Error_Container := cont, + sON_Transfer_Application_Identity := son_app_id + } + template RAN_Information_Application_Error_RIM_Container + tr_RAN_Information_Application_Error_RIM_Container(template RIM_Application_Identity app_id := ?, + template RIM_Sequence_Number seq := ?, + template RIM_PDU_Indications ind := ?, + template RIM_Protocol_Version_Number ver := omit, + template Application_Error_Container cont := ?, + template SON_Transfer_Application_Identity_TLV son_app_id := omit) := { + iEI := '59'O, + ext := '1'B, + lengthIndicator := { + length1 := ? + }, + rIM_Application_Identity := app_id, + rIM_Sequence_Number := seq, + rIM_PDU_Indications := ind, + rIM_Protocol_Version_Number := ver, + application_Error_Container := cont, + sON_Transfer_Application_Identity := son_app_id + } + + + /* 3GPP TS 48.018 11.3.63.1 */ + template (value) RAN_Information_Request_Application_Container + tsu_RAN_Information_Request_Application_Container_NACC(template (value) BssgpCellId cid) := { + nacc := ts_RAN_Information_Request_Application_Container_NACC(cid) + } + template (value) RAN_Information_Request_Application_Container + tsu_RAN_Information_Request_Application_Container_SI3(template (value) BssgpCellId cid) := { + si3 := ts_RAN_Information_Request_Application_Container_SI3(cid) + } + template (value) RAN_Information_Request_Application_Container + tsu_RAN_Information_Request_Application_Container_MBMS_data_channel(template (value) BssgpCellId cid) := { + mBMS_data_channel := ts_RAN_Information_Request_Application_Container_MBMS_data_channel(cid) + } + + /* NOTE: The type description of reporting_Cell_Identifier in chapter 11.3.63.1, version V10.6.0 (2012-07) of + * 3GPP TS 48.018 clearly states: "Reporting Cell Identifier: This field is encoded as the Cell Identifier + * defined in sub-clause 11.3.9". However this seems to be an error in the specification, because the + * specifiction in Table 11.3.63.1.1 already has a length field an an IEI defined. Keeping the IEI and lenght + * of the BSSGP cell identifier in addition would no make sense. Also in the chapters below the specifiction + * of the IEs are similar and there it says "Reporting Cell Identifier: This field is encoded as the value + * part of the Cell Identifier IE defined in sub-clause 11.3.9, not including IEI and Length Indicator.", + * which actually makes sense. */ + + /* 3GPP TS 48.018 11.3.63.1.1 */ + template (value) RAN_Information_Request_Application_Container_NACC + ts_RAN_Information_Request_Application_Container_NACC(template (value) BssgpCellId cid) := { + iEI := '4D'O, + ext := '1'B, + lengthIndicator := { + length1 := 0 /* overwritten */ + }, + reporting_Cell_Identifier := ts_Cell_Identifier_V(cid) + } + template RAN_Information_Request_Application_Container_NACC + tr_RAN_Information_Request_Application_Container_NACC(template BssgpCellId cid := ?) := { + iEI := '4D'O, + ext := '1'B, + lengthIndicator := { + length1 := ? + }, + reporting_Cell_Identifier := tr_Cell_Identifier_V(cid) + } + + /* 3GPP TS 48.018 11.3.63.1.2 */ + template (value) RAN_Information_Request_Application_Container_SI3 + ts_RAN_Information_Request_Application_Container_SI3(template (value) BssgpCellId cid) := { + iEI := '4D'O, + ext := '1'B, + lengthIndicator := { + length1 := 0 /* overwritten */ + }, + reporting_Cell_Identifier := ts_Cell_Identifier_V(cid) + } + + /* 3GPP TS 48.018 11.3.63.1.3 */ + template (value) RAN_Information_Request_Application_Container_MBMS_data_channel + ts_RAN_Information_Request_Application_Container_MBMS_data_channel(template (value) BssgpCellId cid) := { + iEI := '4D'O, + ext := '1'B, + lengthIndicator := { + length1 := 0 /* overwritten */ + }, + reporting_Cell_Identifier := ts_Cell_Identifier_V(cid) + } + + /* 3GPP TS 48.018 11.3.63.2.1 */ + template (value) RAN_Information_Application_Container_NACC + ts_RAN_Information_Application_Container_NACC(template (value) BssgpCellId cid, boolean psi_type, integer si_psi_num, octetstring si_psi) := { + iEI := '4E'O, + ext := '1'B, + lengthIndicator := { + length1 := 0 /* overwritten */ + }, + reporting_Cell_Identifier := ts_Cell_Identifier_V(cid), + typeBit := bool2bit(psi_type), + number_of_SI_PSI := int2bit(si_psi_num, 7), + sI_PSI := si_psi + } + function tr_RAN_Information_Application_Container_NACC(template BssgpCellId cid := ?, template boolean psi_type := ?, + template integer si_psi_num := ?, template octetstring si_psi := ?) + return template RAN_Information_Application_Container_NACC { + var template RAN_Information_Application_Container_NACC ret; + ret.iEI := '4E'O; + ret.ext := '1'B; + ret.lengthIndicator := { length1 := ? }; + ret.reporting_Cell_Identifier := tr_Cell_Identifier_V(cid); + if (istemplatekind(psi_type, "*")) { + ret.typeBit := *; + } else if (istemplatekind(psi_type, "?")) { + ret.typeBit := ?; + } else { + ret.typeBit := bool2bit(valueof(psi_type)); + } + if (istemplatekind(si_psi_num, "*")) { + ret.number_of_SI_PSI := *; + } else if (istemplatekind(si_psi_num, "?")) { + ret.number_of_SI_PSI := ?; + } else { + ret.number_of_SI_PSI := int2bit(valueof(si_psi_num), 7); + } + ret.sI_PSI := si_psi; + return ret; + } + + /* 3GPP TS 48.018 11.3.63.2.2 */ + template (value) RAN_Information_Application_Container_SI3 + ts_RAN_Information_Application_Container_SI3(template (value) BssgpCellId cid, template (value) SI3 si3) := { + iEI := '4E'O, + ext := '1'B, + lengthIndicator := { + length1 := 0 /* overwritten */ + }, + reporting_Cell_Identifier := ts_Cell_Identifier_V(cid), + sI3 := si3 + } + + /* 3GPP TS 48.018 11.3.63.2.3 */ + template (value) RAN_Information_Application_Container_MBMS_data_channel + ts_RAN_Information_Application_Container_MBMS_data_channel(template (value) BssgpCellId cid, octetstring data_ch_report) := { + iEI := '4E'O, + ext := '1'B, + lengthIndicator := { + length1 := 0 /* overwritten */ + }, + reporting_Cell_Identifier := ts_Cell_Identifier_V(cid), + mBMS_data_channel_report := data_ch_report + } + + + /* 3GPP TS 48.018 11.3.64 */ + template (value) Application_Error_Container + tsu_Application_Error_Container_NACC(template (value) BssgpCellId cid, + integer cause, + template (value) Application_Container_IE_NACC app_cont) := { + nacc := ts_Application_Error_Container_NACC(cid, cause, app_cont) + } + template Application_Error_Container + rsu_Application_Error_Container_NACC(template BssgpCellId cid := ?, + template integer cause := ?, + template Application_Container_IE_NACC app_cont := ?) := { + nacc := tr_Application_Error_Container_NACC(cid, cause, app_cont) + } + template (value) Application_Error_Container + tsu_Application_Error_Container_SI3(template (value) BssgpCellId cid, + integer cause, + template (value) Application_Container_IE_SI3 app_cont) := { + si3 := ts_Application_Error_Container_SI3(cid, cause, app_cont) + } + template (value) Application_Error_Container + tsu_Application_Error_Container_MBMS_data_channel(template (value) BssgpCellId cid, + integer cause, + template (value) Application_Container_IE_MBMS_data_channel app_cont) := { + mBMS_data_channel := ts_Application_Error_Container_MBMS_data_channel(cid, cause, app_cont) + } + + /* 3GPP TS 48.018 11.3.64.1 */ + template (value) Application_Error_Container_NACC + ts_Application_Error_Container_NACC(template (value) BssgpCellId cid, + integer cause, + template (value) Application_Container_IE_NACC app_cont) := { + iEI := '56'O, + ext := '1'B, + lengthIndicator := { + length1 := 0 /* overwritten */ + }, + nACC_cause := int2oct(cause, 1), + erroneousApplicationContainer := app_cont + } + function tr_Application_Error_Container_NACC(template BssgpCellId cid := ?, + template integer cause := ?, + template Application_Container_IE_NACC app_cont := ?) + return template Application_Error_Container_NACC { + var template Application_Error_Container_NACC ret; + ret.iEI := '56'O; + ret.ext := '1'B; + ret.lengthIndicator := { length1 := ? }; + ret.erroneousApplicationContainer := app_cont; + if (istemplatekind(cause, "*")) { + ret.nACC_cause := *; + } else if (istemplatekind(cause, "?")) { + ret.nACC_cause := ?; + } else { + ret.nACC_cause := int2oct(valueof(cause), 1); + } + return ret; + } + + template (value) Application_Container_IE_NACC + tsu_Application_Container_IE_NACC_req(template (value) BssgpCellId cid) := { + rAN_Information_Request_Application_Container := ts_RAN_Information_Request_Application_Container_NACC(cid) + } + template Application_Container_IE_NACC + rsu_Application_Container_IE_NACC_req(template BssgpCellId cid := ?) := { + rAN_Information_Request_Application_Container := tr_RAN_Information_Request_Application_Container_NACC(cid) + } + template (value) Application_Container_IE_NACC + tsu_Application_Container_IE_NACC(template (value) BssgpCellId cid, boolean psi_type, integer si_psi_num, octetstring si_psi) := { + rAN_Information_Application_Container := ts_RAN_Information_Application_Container_NACC(cid, psi_type, si_psi_num, si_psi) + } + + /* 3GPP TS 48.018 11.3.64.2 */ + template (value) Application_Error_Container_SI3 + ts_Application_Error_Container_SI3(template (value) BssgpCellId cid, + integer cause, + template (value) Application_Container_IE_SI3 app_cont) := { + iEI := '56'O, + ext := '1'B, + lengthIndicator := { + length1 := 0 /* overwritten */ + }, + sI3_cause := int2oct(cause, 1), + erroneousApplicationContainer := app_cont + } + template (value) Application_Container_IE_SI3 + tsu_Application_Container_IE_SI3_req(template (value) BssgpCellId cid) := { + rAN_Information_Request_Application_Container := ts_RAN_Information_Request_Application_Container_SI3(cid) + } + template (value) Application_Container_IE_SI3 + tsu_Application_Container_IE_SI3(template (value) BssgpCellId cid, template (value) SI3 si3) := { + rAN_Information_Application_Container := ts_RAN_Information_Application_Container_SI3(cid, si3) + } + + /* 3GPP TS 48.018 11.3.64.3 */ + template (value) Application_Error_Container_MBMS_data_channel + ts_Application_Error_Container_MBMS_data_channel(template (value) BssgpCellId cid, + integer cause, + template (value) Application_Container_IE_MBMS_data_channel app_cont) := { + iEI := '56'O, + ext := '1'B, + lengthIndicator := { + length1 := 0 /* overwritten */ + }, + mBMS_data_channel_cause := int2oct(cause, 1), + erroneousApplicationContainer := app_cont + } + template (value) Application_Container_IE_MBMS_data_channel + tsu_Application_Container_IE_MBMS_data_channel_req(template (value) BssgpCellId cid) := { + rAN_Information_Request_Application_Container := ts_RAN_Information_Request_Application_Container_MBMS_data_channel(cid) + } + template (value) Application_Container_IE_MBMS_data_channel + tsu_Application_Container_IE_MBMS_data_channel(template (value) BssgpCellId cid, octetstring data_ch_report) := { + rAN_Information_Application_Container := ts_RAN_Information_Application_Container_MBMS_data_channel(cid, data_ch_report) + } + + + /* 3GPP TS 44.018 10.5.1.3 -> 3GPP TS 24.008 10.5.1.3 */ + function t_LocationAreaIdentification(template BssgpCellId cid) return template BSSGP_Types.LocationAreaIdentification { + var template BSSGP_Types.LocationAreaIdentification ret := { + mccDigit1 := ?, + mccDigit2 := ?, + mccDigit3 := ?, + mncDigit3 := ?, + mncDigit1 := ?, + mncDigit2 := ?, + lac := ? + } + if (istemplatekind(cid, "omit")) { + return omit; + } else if (istemplatekind(cid, "*")) { + return *; + } else if (istemplatekind(cid, "?")) { + return ?; + } + if (isvalue(cid) and isvalue(cid.ra_id) and isvalue(cid.ra_id.lai)) { + if (isvalue(cid.ra_id.lai.mcc_mnc)) { + ret.mccDigit1 := cid.ra_id.lai.mcc_mnc[0]; + ret.mccDigit2 := cid.ra_id.lai.mcc_mnc[1]; + ret.mccDigit3 := cid.ra_id.lai.mcc_mnc[2]; + ret.mncDigit3 := cid.ra_id.lai.mcc_mnc[3]; + ret.mncDigit1 := cid.ra_id.lai.mcc_mnc[4]; + ret.mncDigit2 := cid.ra_id.lai.mcc_mnc[5]; + } + if (isvalue(cid.ra_id.lai.lac)) { + ret.lac := int2oct_tmpl(cid.ra_id.lai.lac, 2); + } + } + return ret; + } + + /* 3GPP TS 44.018 10.5.2.11 */ + template (value) ControlChannelDescription ts_ControlChannelDescription(integer ccch_conf, + integer bs_ag_blks_res, + boolean att, + boolean mscr, + integer bs_pa_mfrms, + BIT2 cbq3, + integer t3212) := { + cCCH_Conf := int2bit(ccch_conf, 3), + bS_AG_BLKS_RES := int2bit(bs_ag_blks_res, 3), + aTT := bool2bit(att), + mSCR := bool2bit(mscr), + bS_PA_MFRMS := int2bit(bs_pa_mfrms, 3), + spare1 := '00'B, + cBQ3 := cbq3, + spare2 := '0'B, + t3212 := int2oct(t3212, 1) + } + + /* 3GPP TS 44.018 10.5.2.3 */ + template (value) CellOptions ts_CellOptions(integer radio_link_timeout, + BIT3 dtx, + boolean pwrc) := { + radioLinkTimeout := int2bit(radio_link_timeout, 4), + dTX1 := dtx[0] & dtx[1], + pWRC := bool2bit(pwrc), + dtx2 := dtx[2] + } + + /* 3GPP TS 44.018 10.5.2.4 */ + template (value) CellSelectionParameters ts_CellSelectionParameters(integer ms_txpwr_max_cch, + integer cell_reselection_hysteresis, + integer rxlev_access_min, + boolean neci, + boolean acs) := { + mS_TXPWR_MAX_CCH := int2bit(ms_txpwr_max_cch, 5), + cellReselectHysterisis := int2bit(cell_reselection_hysteresis, 3), + rXLEV_Access_Min := int2bit(rxlev_access_min, 6), + nECI := bool2bit(neci), + aCS := bool2bit(acs) + } + + /* 3GPP TS 44.018 10.5.2.29 */ + template (value) RACHControlParameters ts_RACHControlParameters(boolean re, + boolean cell_barr_access, + integer tx_integer, + integer max_retrans, + integer ac_15_to_8, + integer ac_7_to_0) := { + rE := bool2bit(re), + cellBarrAccess := bool2bit(cell_barr_access), + tX_Integer := int2bit(tx_integer, 4), + maxRetrans := int2bit(max_retrans, 2), + aC_15_to_8 := int2oct(ac_15_to_8, 1), + aC_7_to_0 := int2oct(ac_7_to_0, 1) + } + + /* 3GPP TS 44.018 9.1.35 */ + template (value) SI3 ts_SI3(integer cell_id, + template (value) BSSGP_Types.LocationAreaIdentification lai, + template (value) ControlChannelDescription cch_descr, + template (value) CellOptions cell_opt, + template (value) CellSelectionParameters cell_sel_par, + template (value) RACHControlParameters rach_ctrl_par, + OCT4 rest_octets) := { + sI3MessageType := '1B'O, + cellIdentity := int2oct(cell_id, 2), + locationAreaIdentification := lai, + controlChannelDescription := cch_descr, + cellOptions := cell_opt, + cellSelectionParameters := cell_sel_par, + rACHControlParameters := rach_ctrl_par, + sI3RestOctets := rest_octets + } + + + /* 3GPP TS 48.018 11.3.65 */ + const BIT3 RIM_PDU_TYPE_STOP := '000'B; + const BIT3 RIM_PDU_TYPE_SING_REP := '001'B; + const BIT3 RIM_PDU_TYPE_MULT_REP := '010'B; + template (value) RIM_PDU_Indications ts_RIM_PDU_Indications(boolean ack, BIT3 type_ext) := { + iEI := '4F'O, + ext := '1'B, + lengthIndicator := { + length1 := 1 + }, + ack := bool2bit(ack), + pDU_Type_Extension := type_ext, + reserved := '0000'B + } + function tr_RIM_PDU_Indications(template boolean ack := ?, template BIT3 type_ext := ?) return template RIM_PDU_Indications { + var template RIM_PDU_Indications ret; + ret.iEI := '4F'O; + ret.ext := '1'B; + ret.lengthIndicator := { length1 := 1 }; + if (istemplatekind(ack, "*")) { + ret.ack := *; + } else if (istemplatekind(ack, "?")) { + ret.ack := ?; + } else { + ret.ack := bool2bit(valueof(ack)); + } + if (istemplatekind(type_ext, "*")) { + ret.pDU_Type_Extension := *; + } else if (istemplatekind(type_ext, "?")) { + ret.pDU_Type_Extension := ?; + } else { + ret.pDU_Type_Extension := valueof(type_ext); + } + ret.reserved := '0000'B; + return ret; + } + + /* 3GPP TS 48.018 11.3.67 */ + template (value) RIM_Protocol_Version_Number ts_RIM_Protocol_Version_Number(integer ver) := { + iEI := '55'O, + ext := '1'B, + lengthIndicator := { + length1 := 1 + }, + rIMProtocolVersionNumber := int2oct(ver, 1) + } + function tr_RIM_Protocol_Version_Number(template integer ver := ?) return template RIM_Protocol_Version_Number { + var template RIM_Protocol_Version_Number ret; + ret.iEI := '55'O; + ret.ext := '1'B; + ret.lengthIndicator := { length1 := 1 }; + if (istemplatekind(ver, "*")) { + ret.rIMProtocolVersionNumber := *; + } else if (istemplatekind(ver, "?")) { + ret.rIMProtocolVersionNumber := ?; + } else { + ret.rIMProtocolVersionNumber := int2oct(valueof(ver), 1); + } + return ret; + } + + /* 3GPP TS 48.018 11.3.70 */ + const HEX1 RIM_ADDR_GERAN_CELL_ID := '0'H; + const HEX1 RIM_ADDR_UTRAN_RNC_ID := '1'H; + const HEX1 RIM_ADDR_EUTRAN_NODEB_ID := '2'H; + const HEX1 RIM_ADDR_EHRPD_SECTOR_ID := '3'H; + template (value) RIM_Routing_Information ts_RIM_Routing_Information(HEX1 addr_discr, template (value) RIM_Routing_Address addr) := { + iEI := '54'O, + ext := '1'B, + lengthIndicator := { + length1 := 0 /* overwritten */ + }, + rIMRoutingAddressDiscriminator := addr_discr, + spare := '0'H, + rIM_Routing_Address := addr + } + template RIM_Routing_Information tr_RIM_Routing_Information(template HEX1 addr_discr := ?, template RIM_Routing_Address addr := ?) := { + iEI := '54'O, + ext := '1'B, + lengthIndicator := { + length1 := ? + }, + rIMRoutingAddressDiscriminator := addr_discr, + spare := '0'H, + rIM_Routing_Address := addr + } + + template RIM_Routing_Address t_RIM_Routing_Address_cid(template BssgpCellId cid := ?) := { + cell_Identifier := tr_Cell_Identifier_V(cid) + } + template RIM_Routing_Address t_RIM_Routing_Address_rncid(template BssgpCellId cid := ?, template integer rnc_id := ?) := { + globalRNCID := t_GlobalRNC_ID_BSSGP(cid, rnc_id) + } + template RIM_Routing_Address t_RIM_Routing_Address_enbid(template BssgpCellId cid := ?, template integer tac := ?, template octetstring gnbid := ?) := { + eNB_Identifier := t_ENB_Identifier_V(cid, tac, gnbid) + } + template RIM_Routing_Address t_RIM_Routing_Address_sector(template octetstring sector := ?) := { + eHRPD_SectorID := sector + } + + function tr_Cell_Identifier_V(template BssgpCellId cid) return template Cell_Identifier_V { + var template Cell_Identifier_V ret := { + mccDigit1 := ?, + mccDigit2 := ?, + mccDigit3 := ?, + mncDigit3 := ?, + mncDigit1 := ?, + mncDigit2 := ?, + lac := ?, + rac := ?, + cI_value := ? + } + if (istemplatekind(cid, "omit")) { + return omit; + } else if (istemplatekind(cid, "*")) { + return *; + } else if (istemplatekind(cid, "?")) { + return ?; + } + if (isvalue(cid) and isvalue(cid.ra_id) and isvalue(cid.ra_id.lai)) { + if (isvalue(cid.ra_id.lai.mcc_mnc)) { + ret.mccDigit1 := cid.ra_id.lai.mcc_mnc[0]; + ret.mccDigit2 := cid.ra_id.lai.mcc_mnc[1]; + ret.mccDigit3 := cid.ra_id.lai.mcc_mnc[2]; + ret.mncDigit3 := cid.ra_id.lai.mcc_mnc[3]; + ret.mncDigit1 := cid.ra_id.lai.mcc_mnc[4]; + ret.mncDigit2 := cid.ra_id.lai.mcc_mnc[5]; + } + if (isvalue(cid.ra_id.lai.lac)) { + ret.lac := int2oct_tmpl(cid.ra_id.lai.lac, 2); + } + } + if (isvalue(cid) and isvalue(cid.ra_id)) { + ret.rac := int2oct_tmpl(cid.ra_id.rac, 1); + } + if (isvalue(cid)) { + ret.cI_value := int2oct_tmpl(cid.cell_id, 2); + } + return ret; + } + template (value) Cell_Identifier_V ts_Cell_Identifier_V(template (value) BssgpCellId cid) := { + mccDigit1 := cid.ra_id.lai.mcc_mnc[0], + mccDigit2 := cid.ra_id.lai.mcc_mnc[1], + mccDigit3 := cid.ra_id.lai.mcc_mnc[2], + mncDigit3 := cid.ra_id.lai.mcc_mnc[3], + mncDigit1 := cid.ra_id.lai.mcc_mnc[4], + mncDigit2 := cid.ra_id.lai.mcc_mnc[5], + lac := int2oct(valueof(cid.ra_id.lai.lac), 2), + rac := int2oct(valueof(cid.ra_id.rac), 1), + cI_value := int2oct(valueof(cid.cell_id), 2) + } + + function t_GlobalRNC_ID_BSSGP(template BssgpCellId cid, template integer rnc_id) return template GlobalRNC_ID_BSSGP { + var template GlobalRNC_ID_BSSGP ret := { + mccDigit1 := ?, + mccDigit2 := ?, + mccDigit3 := ?, + mncDigit3 := ?, + mncDigit1 := ?, + mncDigit2 := ?, + lac := ?, + rac := ?, + spare := ?, + rNC_ID := ? + } + if (istemplatekind(cid, "omit") and istemplatekind(rnc_id, "omit")) { + return omit; + } else if (istemplatekind(cid, "*") and istemplatekind(rnc_id, "*")) { + return *; + } else if (istemplatekind(cid, "?") and istemplatekind(rnc_id, "?")) { + return ?; + } + if (isvalue(cid) and isvalue(cid.ra_id) and isvalue(cid.ra_id.lai)) { + if (isvalue(cid.ra_id.lai.mcc_mnc)) { + ret.mccDigit1 := cid.ra_id.lai.mcc_mnc[0]; + ret.mccDigit2 := cid.ra_id.lai.mcc_mnc[1]; + ret.mccDigit3 := cid.ra_id.lai.mcc_mnc[2]; + ret.mncDigit3 := cid.ra_id.lai.mcc_mnc[3]; + ret.mncDigit1 := cid.ra_id.lai.mcc_mnc[4]; + ret.mncDigit2 := cid.ra_id.lai.mcc_mnc[5]; + } + if (isvalue(cid.ra_id.lai.lac)) { + ret.lac := int2oct_tmpl(cid.ra_id.lai.lac, 2); + } + } + if (isvalue(cid) and isvalue(cid.ra_id)) { + ret.rac := int2oct_tmpl(cid.ra_id.rac, 1); + } + if (isvalue(rnc_id)) { + ret.spare := '0'H; + ret.rNC_ID := rnc_id; + } + + return ret; + } + + function t_ENB_Identifier_V(template BssgpCellId cid, template integer tac, template octetstring gnbid) return template ENB_Identifier_V { + var template ENB_Identifier_V ret := { + mccDigit1 := ?, + mccDigit2 := ?, + mccDigit3 := ?, + mncDigit3 := ?, + mncDigit1 := ?, + mncDigit2 := ?, + tac := ?, + globaleNBID := ? + } + if (istemplatekind(cid, "omit") and istemplatekind(tac, "omit") and istemplatekind(gnbid, "omit")) { + return omit; + } else if (istemplatekind(cid, "*") and istemplatekind(tac, "*") and istemplatekind(gnbid, "*")) { + return *; + } else if (istemplatekind(cid, "?") and istemplatekind(tac, "?") and istemplatekind(gnbid, "?")) { + return ?; + } + if (isvalue(cid) and isvalue(cid.ra_id) and isvalue(cid.ra_id.lai)) { + if (isvalue(cid.ra_id.lai.mcc_mnc)) { + ret.mccDigit1 := cid.ra_id.lai.mcc_mnc[0]; + ret.mccDigit2 := cid.ra_id.lai.mcc_mnc[1]; + ret.mccDigit3 := cid.ra_id.lai.mcc_mnc[2]; + ret.mncDigit3 := cid.ra_id.lai.mcc_mnc[3]; + ret.mncDigit1 := cid.ra_id.lai.mcc_mnc[4]; + ret.mncDigit2 := cid.ra_id.lai.mcc_mnc[5]; + } + } + if (isvalue(tac)) { + ret.tac := int2oct(valueof(tac), 2); + } + if (isvalue(gnbid)) { + ret.globaleNBID := gnbid; + } + + return ret; + } + + /* 3GPP TS 48.018 11.3.108 */ + template (value) SON_Transfer_Application_Identity_TLV ts_SON_Transfer_Application_Identity_TLV(template (value) octetstring app_id) := { + iEI := '84'O, + ext := '1'B, + lengthIndicator := { + length1 := 0 /* overwritten */ + }, + sON_Transfer_Application_Identity := app_id + } + + + /* 3GPP TS 48.018 10.6.1 */ + template (value) PDU_BSSGP + ts_RAN_INFORMATION_REQUEST(template (value) RIM_Routing_Information dst, + template (value) RIM_Routing_Information src, + template (value) RAN_Information_Request_RIM_Container cont) := { + pDU_BSSGP_RAN_INFORMATION_REQUEST := { + bssgpPduType := '71'O, + destination_Cell_Identifier := dst, + source_Cell_Identifier := src, + rIM_Container := cont + } + } + template PDU_BSSGP + tr_RAN_INFORMATION_REQUEST(template RIM_Routing_Information dst := ?, + template RIM_Routing_Information src := ?, + template RAN_Information_Request_RIM_Container cont := ?) := { + pDU_BSSGP_RAN_INFORMATION_REQUEST := { + bssgpPduType := '71'O, + destination_Cell_Identifier := dst, + source_Cell_Identifier := src, + rIM_Container := cont + } + } + + /* 3GPP TS 48.018 10.6.2 */ + template (value) PDU_BSSGP + ts_PDU_BSSGP_RAN_INFORMATION(template (value) RIM_Routing_Information dst, + template (value) RIM_Routing_Information src, + template (value) RAN_Information_RIM_Container cont) := { + pDU_BSSGP_RAN_INFORMATION := { + bssgpPduType := '70'O, + destination_Cell_Identifier := dst, + source_Cell_Identifier := src, + rIM_Container := cont + } + } + template PDU_BSSGP + tr_PDU_BSSGP_RAN_INFORMATION(template RIM_Routing_Information dst := ?, + template RIM_Routing_Information src := ?, + template RAN_Information_RIM_Container cont := ?) := { + pDU_BSSGP_RAN_INFORMATION := { + bssgpPduType := '70'O, + destination_Cell_Identifier := dst, + source_Cell_Identifier := src, + rIM_Container := cont + } + } + + /* 3GPP TS 48.018 10.6.3 */ + template (value) PDU_BSSGP + ts_PDU_BSSGP_RAN_INFORMATION_ACK(template (value) RIM_Routing_Information dst, + template (value) RIM_Routing_Information src, + template (value) RAN_Information_Ack_RIM_Container cont) := { + pDU_BSSGP_RAN_INFORMATION_ACK := { + bssgpPduType := '72'O, + destination_Cell_Identifier := dst, + source_Cell_Identifier := src, + rIM_Container := cont + } + } + template PDU_BSSGP + tr_PDU_BSSGP_RAN_INFORMATION_ACK(template RIM_Routing_Information dst := ?, + template RIM_Routing_Information src := ?, + template RAN_Information_Ack_RIM_Container cont := ?) := { + pDU_BSSGP_RAN_INFORMATION_ACK := { + bssgpPduType := '72'O, + destination_Cell_Identifier := dst, + source_Cell_Identifier := src, + rIM_Container := cont + } + } + + /* 3GPP TS 48.018 10.6.4 */ + template (value) PDU_BSSGP + ts_PDU_BSSGP_RAN_INFORMATION_ERROR(template (value) RIM_Routing_Information dst, + template (value) RIM_Routing_Information src, + template (value) RAN_Information_Error_RIM_Container cont) := { + pDU_BSSGP_RAN_INFORMATION_ERROR := { + bssgpPduType := '73'O, + destination_Cell_Identifier := dst, + source_Cell_Identifier := src, + rIM_Container := cont + } + } + template PDU_BSSGP + tr_PDU_BSSGP_RAN_INFORMATION_ERROR(template RIM_Routing_Information dst := ?, + template RIM_Routing_Information src := ?, + template RAN_Information_Error_RIM_Container cont := ?) := { + pDU_BSSGP_RAN_INFORMATION_ERROR := { + bssgpPduType := '73'O, + destination_Cell_Identifier := dst, + source_Cell_Identifier := src, + rIM_Container := cont + } + } + + /* 3GPP TS 48.018 10.6.5 */ + template (value) PDU_BSSGP + ts_PDU_BSSGP_RAN_INFORMATION_APPLICATION_ERROR(template (value) RIM_Routing_Information dst, + template (value) RIM_Routing_Information src, + template (value) RAN_Information_Application_Error_RIM_Container cont) := { + pDU_BSSGP_RAN_INFORMATION_APPLICATION_ERROR := { + bssgpPduType := '74'O, + destination_Cell_Identifier := dst, + source_Cell_Identifier := src, + rIM_Container := cont + } + } + template PDU_BSSGP + tr_PDU_BSSGP_RAN_INFORMATION_APPLICATION_ERROR(template RIM_Routing_Information dst := ?, + template RIM_Routing_Information src := ?, + template RAN_Information_Application_Error_RIM_Container cont := ?) := { + pDU_BSSGP_RAN_INFORMATION_APPLICATION_ERROR := { + bssgpPduType := '74'O, + destination_Cell_Identifier := dst, + source_Cell_Identifier := src, + rIM_Container := cont + } + } + + /* PDU permitted on PTP BVC only (TS 48.018 Section 5.4.1) */ + template (present) PDU_BSSGP tr_BSSGP_PERMITTED_PTP_ONLY := ( + {pDU_BSSGP_DL_UNITDATA := ?}, + {pDU_BSSGP_UL_UNITDATA := ?}, + {pDU_BSSGP_RA_CAPABILITY := ?}, + {pDU_BSSGP_RA_CAPABILITY_UPDATE := ?}, + {pDU_BSSGP_RA_CAPABILITY_UPDATE_ACK := ?}, + {pDU_BSSGP_RADIO_STATUS := ?}, + {pDU_BSSGP_FLOW_CONTROL_BVC := ?}, + {pDU_BSSGP_FLOW_CONTROL_BVC_ACK := ?}, + {pDU_BSSGP_FLOW_CONTROL_MS := ?}, + {pDU_BSSGP_FLOW_CONTROL_MS_ACK := ?}, + {pDU_BSSGP_FLOW_CONTROL_PFC := ?}, + {pDU_BSSGP_FLOW_CONTROL_PFC_ACK := ?}, + {pDU_BSSGP_DOWNLOAD_BSS_PFC := ?}, + {pDU_BSSGP_CREATE_BSS_PFC := ?}, + {pDU_BSSGP_CREATE_BSS_PFC_ACK := ?}, + {pDU_BSSGP_CREATE_BSS_PFC_NACK := ?}, + {pDU_BSSGP_MODIFY_BSS_PFC := ?}, + {pDU_BSSGP_MODIFY_BSS_PFC_ACK := ?}, + {pDU_BSSGP_DELETE_BSS_PFC := ?}, + {pDU_BSSGP_DELETE_BSS_PFC_ACK := ?}, + {pDU_BSSGP_DELETE_BSS_PFC_REQ := ?}, + {pDU_BSSGP_PS_HANDOVER_REQUIRED := ?}, + {pDU_BSSGP_PS_HANDOVER_REQUIRED_ACK := ?}, + {pDU_BSSGP_PS_HANDOVER_REQUIRED_NACK := ?}, + {pDU_BSSGP_PS_HANDOVER_REQUEST := ?}, + {pDU_BSSGP_PS_HANDOVER_REQUEST_ACK := ?}, + {pDU_BSSGP_PS_HANDOVER_REQUEST_NACK := ?}, + {pDU_BSSGP_PS_HANDOVER_COMPLETE := ?}, + {pDU_BSSGP_PS_HANDOVER_COMPLETE_ACK := ?}, + {pDU_BSSGP_PS_HANDOVER_CANCEL := ?} + ); + + template (present) PDU_BSSGP tr_BSSGP_PERMITTED_PTP := ( + tr_BSSGP_PERMITTED_PTP_ONLY, + {pDU_BSSGP_PAGING_PS := ?}, + {pDU_BSSGP_PAGING_CS := ?}, + {pDU_BSSGP_STATUS := ?} + ); + + /* PDU permitted on Signaling BVC only (TS 48.018 Section 5.4.1) */ + template (present) PDU_BSSGP tr_BSSGP_PERMITTED_SIGN_ONLY := ( + {pDU_BSSGP_SUSPEND := ?}, + {pDU_BSSGP_SUSPEND_ACK := ?}, + {pDU_BSSGP_SUSPEND_NACK := ?}, + {pDU_BSSGP_RESUME := ?}, + {pDU_BSSGP_RESUME_ACK := ?}, + {pDU_BSSGP_RESUME_NACK := ?}, + {pDU_BSSGP_FLUSH_LL := ?}, + {pDU_BSSGP_FLUSH_LL_ACK := ?}, + {pDU_BSSGP_LLC_DISCARDED := ?}, + {pDU_BSSGP_BVC_BLOCK := ?}, + {pDU_BSSGP_BVC_BLOCK_ACK := ?}, + {pDU_BSSGP_BVC_UNBLOCK := ?}, + {pDU_BSSGP_BVC_UNBLOCK_ACK := ?}, + {pDU_BSSGP_BVC_RESET := ?}, + {pDU_BSSGP_BVC_RESET_ACK := ?}, + {pDU_BSSGP_SGSN_INVOKE_TRACE := ?}, + {pDU_BSSGP_PERFORM_LOCATION_REQUEST := ?}, + {pDU_BSSGP_PERFORM_LOCATION_RESPONSE := ?}, + {pDU_BSSGP_PERFORM_LOCATION_ABORT := ?}, + {pDU_BSSGP_POSITION_COMMAND := ?}, + {pDU_BSSGP_POSITION_RESPONSE := ?}, + {pDU_BSSGP_RAN_INFORMATION := ?}, + {pDU_BSSGP_RAN_INFORMATION_REQUEST := ?}, + {pDU_BSSGP_RAN_INFORMATION_ACK := ?}, + {pDU_BSSGP_RAN_INFORMATION_ERROR := ?}, + {pDU_BSSGP_RAN_INFORMATION_APPLICATION_ERROR := ?}, + {pDU_BSSGP_MBMS_SESSION_START_REQUEST := ?}, + {pDU_BSSGP_MBMS_SESSION_START_RESPONSE := ?}, + {pDU_BSSGP_MBMS_SESSION_STOP_REQUEST := ?}, + {pDU_BSSGP_MBMS_STOP_RESPONSE := ?}, + {pDU_BSSGP_SESSION_UPDATE_REQUEST := ?}, + {pDU_BSSGP_SESSION_UPDATE_RESPONSE := ?} + ); + + template (present) PDU_BSSGP tr_BSSGP_PERMITTED_SIGN := ( + tr_BSSGP_PERMITTED_SIGN_ONLY, + {pDU_BSSGP_PAGING_PS := ?}, + {pDU_BSSGP_PAGING_CS := ?}, + {pDU_BSSGP_SUSPEND := ?}, + {pDU_BSSGP_STATUS := ?} + ); + + /* PDU permitted on PTM BVC only (TS 48.018 Section 5.4.1) */ + template (present) PDU_BSSGP tr_BSSGP_PERMITTED_PTM_ONLY := ( + {pDU_BSSGP_DL_MBMS_UNITDATA := ?}, + {pDU_BSSGP_UL_MBMS_UNITDATA := ?} + ); + + template (present) PDU_BSSGP tr_BSSGP_PERMITTED_PTM := ( + tr_BSSGP_PERMITTED_PTM_ONLY, + {pDU_BSSGP_STATUS := ?} + ); + + + /* Template for any PTP BVCI IE */ + template (present) BVCI tr_BSSGP_IE_PtpBvci := { + iEI := '04'O, + ext := '1'B, + lengthIndicator := { + length1 := 2 + }, + unstructured_value := complement ('0000'O, '0001'O) + } + + /* message on signaling PTP but containing a ptp BVC */ + /* + template PDU_BSSGP tr_BSSGP_SIG_FOR_PTP(template Bvci bvci) := ( + {pDU_BSSGP_FLUSH_LL:{?,?,tr_BSSGP_IE_PtpBvci, *, *}}, + {pDU_BSSGP_FLUSH_LL_ACK:{?,?,?,tr_BSSGP_IE_PtpBvci, ?, *}}, + {pDU_BSSGP_LLC_DISCARDED:{?,?,?,tr_BSSGP_IE_PtpBvci, ?, *}}, + {pDU_BSSGP_BVC_BLOCK:{?,tr_BSSGP_IE_PtpBvci, ?}}, + {pDU_BSSGP_BVC_BLOCK_ACK:{?,tr_BSSGP_IE_PtpBvci}}, + {pDU_BSSGP_BVC_UNBLOCK:{?,tr_BSSGP_IE_PtpBvci}}, + {pDU_BSSGP_BVC_UNBLOCK_ACK:{?,tr_BSSGP_IE_PtpBvci}}, + {pDU_BSSGP_BVC_RESET:{?,tr_BSSGP_IE_PtpBvci,?,*,*,*}}, + {pDU_BSSGP_BVC_RESET_ACK:{?,tr_BSSGP_IE_PtpBvci,*,*,*}}, + {pDU_BSSGP_STATUS:{?,?,tr_BSSGP_IE_PtpBvci,*}}, + {pDU_BSSGP_PERFORM_LOCATION_REQUEST:{?,?,?,*,tr_BSSGP_IE_PtpBvci,?,?,?,*,*,*,*,*,*,*,*,*}}, + {pDU_BSSGP_PERFORM_LOCATION_RESPONSE:{?,?,tr_BSSGP_IE_PtpBvci,*,*,*,*,*,*}}, + {pDU_BSSGP_PERFORM_LOCATION_ABORT:{?,?,tr_BSSGP_IE_PtpBvci,?}}, + {pDU_BSSGP_POSITION_COMMAND:{ + ); + */ + + /* extract the BVCI IE of given PDU + return it */ + function f_BSSGP_BVCI_IE_get(PDU_BSSGP pdu) return template (omit) BVCI { + select (pdu) { + case (PDU_BSSGP:{pDU_BSSGP_FLUSH_LL:=?}) { + return pdu.pDU_BSSGP_FLUSH_LL.bVCI_old; + } + case (PDU_BSSGP:{pDU_BSSGP_FLUSH_LL_ACK:=?}) { + return pdu.pDU_BSSGP_FLUSH_LL_ACK.bVCI_new; + } + case (PDU_BSSGP:{pDU_BSSGP_LLC_DISCARDED:=?}) { + return pdu.pDU_BSSGP_LLC_DISCARDED.bVCI; + } + case (PDU_BSSGP:{pDU_BSSGP_BVC_BLOCK:=?}) { + return pdu.pDU_BSSGP_BVC_BLOCK.bVCI; + } + case (PDU_BSSGP:{pDU_BSSGP_BVC_BLOCK_ACK:=?}) { + return pdu.pDU_BSSGP_BVC_BLOCK_ACK.bVCI; + } + case (PDU_BSSGP:{pDU_BSSGP_BVC_UNBLOCK:=?}) { + return pdu.pDU_BSSGP_BVC_UNBLOCK.bVCI; + } + case (PDU_BSSGP:{pDU_BSSGP_BVC_UNBLOCK_ACK:=?}) { + return pdu.pDU_BSSGP_BVC_UNBLOCK_ACK.bVCI; + } + case (PDU_BSSGP:{pDU_BSSGP_BVC_RESET:=?}) { + return pdu.pDU_BSSGP_BVC_RESET.bVCI; + } + case (PDU_BSSGP:{pDU_BSSGP_BVC_RESET_ACK:=?}) { + return pdu.pDU_BSSGP_BVC_RESET_ACK.bVCI; + } + case (PDU_BSSGP:{pDU_BSSGP_STATUS:=?}) { + return pdu.pDU_BSSGP_STATUS.bVCI; + } + case (PDU_BSSGP:{pDU_BSSGP_PERFORM_LOCATION_REQUEST:=?}) { + return pdu.pDU_BSSGP_PERFORM_LOCATION_REQUEST.bVCI; + } + case (PDU_BSSGP:{pDU_BSSGP_PERFORM_LOCATION_RESPONSE:=?}) { + return pdu.pDU_BSSGP_PERFORM_LOCATION_RESPONSE.bVCI; + } + case (PDU_BSSGP:{pDU_BSSGP_PERFORM_LOCATION_ABORT:=?}) { + return pdu.pDU_BSSGP_PERFORM_LOCATION_ABORT.bVCI; + } + case (PDU_BSSGP:{pDU_BSSGP_POSITION_COMMAND:=?}) { + return pdu.pDU_BSSGP_POSITION_COMMAND.bVCI; + } + case (PDU_BSSGP:{pDU_BSSGP_POSITION_RESPONSE:=?}) { + return pdu.pDU_BSSGP_POSITION_RESPONSE.bVCI; + } + case (PDU_BSSGP:{pDU_BSSGP_PAGING_PS:={?,?,*,{bVCI:=?},*,*,?,*,*}}) { + return pdu.pDU_BSSGP_PAGING_PS.paging_Field4.bVCI; + } + case (PDU_BSSGP:{pDU_BSSGP_PAGING_CS:={?,?,?,{bVCI:=?},*,*,*,*,*}}) { + return pdu.pDU_BSSGP_PAGING_CS.paging_Field4.bVCI; + } + } return omit; } - return oct2int(valueof(bvci_raw.unstructured_value)); -} + /* extract the BVCI IE of given PDU + convert it to integer value */ + function f_BSSGP_BVCI_get(PDU_BSSGP pdu) return template (omit) BssgpBvci { + var template (omit) BVCI bvci_raw := f_BSSGP_BVCI_IE_get(pdu); + if (istemplatekind(bvci_raw, "omit")) { + return omit; + } + return oct2int(valueof(bvci_raw.unstructured_value)); + } + + /* 3GPP TS 23.003 2.6 */ + type enumerated TlliType { + TLLI_LOCAL, + TLLI_FOREIGN, + TLLI_RANDOM, + TLLI_AUXILIARY, + TLLI_RESERVED, + TLLI_G_RNTI, + TLLI_RAND_G_RNTI + } + + /* 3GPP TS 23.003 2.6 */ + function f_gprs_tlli_type(OCT4 tlli) return TlliType { + var bitstring tllib := oct2bit(tlli); + if (substr(tllib, 0, 2) == '11'B) { + return TLLI_LOCAL; + } else if (substr(tllib, 0, 2) == '10'B) { + return TLLI_FOREIGN; + } else if (substr(tllib, 0, 5) == '01111'B) { + return TLLI_RANDOM; + } else if (substr(tllib, 0, 4) == '0110'B) { + return TLLI_RESERVED; + } else if (substr(tllib, 0, 3) == '010'B) { + return TLLI_RESERVED; + } else if (substr(tllib, 0, 4) == '0000'B) { + return TLLI_G_RNTI; + } else if (substr(tllib, 0, 4) == '0001'B) { + return TLLI_RAND_G_RNTI; + } else { + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, + log2str("Unknonw TLLI Type ", tllib)); + return TLLI_LOCAL; + } + } + + /* build a TLLI of specified type from the given (P)TMSI */ + function f_gprs_tlli_from_tmsi(OCT4 tmsi, TlliType tlli_type) return OCT4 { + var bitstring tmsi_bits := oct2bit(tmsi); + var bitstring prefix; + select (tlli_type) { + case (TLLI_LOCAL) { prefix := '11'B } + case (TLLI_FOREIGN) { prefix := '01111'B } + case (TLLI_RANDOM) { prefix := '0110'B } + case (TLLI_RESERVED) { prefix := '010'B } + case (TLLI_G_RNTI) { prefix := '0000'B } + case (TLLI_RAND_G_RNTI) { prefix := '0001'B } + case else { + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, + log2str("Unknonw TLLI Type ", tlli_type)); + return '00000000'O; + } + } + return bit2oct(prefix & substr(tmsi_bits, lengthof(prefix), 32-lengthof(prefix))); + } + + function f_gprs_tlli_random() return OCT4 { + var OCT4 tlli := f_rnd_octstring(4); + return tlli or4b 'c0000000'O; + } } with { encode "RAW" }; |