Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 1 | module RSL_Types { |
| 2 | |
| 3 | import from General_Types all; |
| 4 | import from Osmocom_Types all; |
| 5 | import from GSM_Types all; |
| 6 | |
| 7 | /* Section 9.1 */ |
| 8 | type enumerated RSL_MessageGroup { |
| 9 | RSL_MDISC_RESERVED ('0000000'B), |
| 10 | RSL_MDISC_RLL ('0000001'B), |
| 11 | RSL_MDISC_DCHAN ('0000100'B), |
| 12 | RSL_MDISC_CCHAN ('0000110'B), |
| 13 | RSL_MDISC_TRX_MGMT ('0001000'B), |
| 14 | RSL_MDISC_LCS ('0010000'B), |
| 15 | RSL_MDISC_IPACCESS ('0111111'B) |
| 16 | } with { variant "FIELDLENGTH(7)" }; |
| 17 | |
| 18 | /* Section 9.1 */ |
| 19 | type record RSL_MessageDiscriminator { |
| 20 | RSL_MessageGroup msg_group, |
| 21 | boolean transparent |
| 22 | } with { variant "FIELDORDER(msb)" }; |
| 23 | |
| 24 | template RSL_MessageDiscriminator ts_RSL_MsgDisc(RSL_MessageGroup mg, boolean t := true) := { |
| 25 | msg_group := mg, |
| 26 | transparent := t |
| 27 | } |
| 28 | |
| 29 | /* Section 9.2 */ |
| 30 | type enumerated RSL_MessageType { |
| 31 | /* Radio Link Layer Management */ |
| 32 | RSL_MT_DATA_REQ ('00000001'B), |
| 33 | RSL_MT_DATA_IND ('00000010'B), |
| 34 | RSL_MT_ERROR_IND ('00000011'B), |
| 35 | RSL_MT_EST_REQ ('00000100'B), |
| 36 | RSL_MT_EST_CONF ('00000101'B), |
| 37 | RSL_MT_EST_IND ('00000110'B), |
| 38 | RSL_MT_REL_REQ ('00000111'B), |
| 39 | RSL_MT_REL_CONF ('00001000'B), |
| 40 | RSL_MT_REL_IND ('00001001'B), |
| 41 | RSL_MT_UNIT_DATA_REQ ('00001010'B), |
| 42 | RSL_MT_UNIT_DATA_IND ('00001011'B), |
| 43 | |
| 44 | /* non-standard below */ |
| 45 | RSL_MT_SUSP_REQ ('00001100'B), |
| 46 | RSL_MT_SUSP_CONF ('00001101'B), |
| 47 | RSL_MT_RES_REQ ('00001110'B), |
| 48 | RSL_MT_RECON_REQ ('00001111'B), |
| 49 | |
| 50 | /* Common Channel Management / TRX Management */ |
| 51 | RSL_MT_BCCH_INFO ('00010001'B), |
Harald Welte | 319be82 | 2017-12-07 17:50:26 +0100 | [diff] [blame] | 52 | RSL_MT_CCCH_LOAD_IND ('00010010'B), |
| 53 | RSL_MT_CHAN_RQD ('00010011'B), |
| 54 | RSL_MT_DELETE_IND ('00010100'B), |
| 55 | RSL_MT_PAGING_CMD ('00010101'B), |
| 56 | RSL_MT_IMMEDIATE_ASSIGN_CMD ('00010110'B), |
| 57 | RSL_MT_SMS_BC_REQ ('00010111'B), |
| 58 | RSL_MT_CHAN_CONF ('00011000'B), /* non-standard element */ |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 59 | /* empty */ |
| 60 | RSL_MT_RF_RES_IND ('00011001'B), |
Harald Welte | 319be82 | 2017-12-07 17:50:26 +0100 | [diff] [blame] | 61 | RSL_MT_SACCH_FILL ('00011010'B), |
| 62 | RSL_MT_OVERLOAD ('00011011'B), |
| 63 | RSL_MT_ERROR_REPORT ('00011100'B), |
| 64 | RSL_MT_SMS_BC_CMD ('00011101'B), |
| 65 | RSL_MT_CBCH_LOAD_IND ('00011110'B), |
| 66 | RSL_MT_NOT_CMD ('00011111'B), |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 67 | |
| 68 | /* Dedicate Channel Management */ |
| 69 | RSL_MT_CHAN_ACTIV ('00100001'B), |
Harald Welte | 319be82 | 2017-12-07 17:50:26 +0100 | [diff] [blame] | 70 | RSL_MT_CHAN_ACTIV_ACK ('00100010'B), |
| 71 | RSL_MT_CHAN_ACTIV_NACK ('00100011'B), |
| 72 | RSL_MT_CONN_FAIL ('00100100'B), |
| 73 | RSL_MT_DEACTIVATE_SACCH ('00100101'B), |
| 74 | RSL_MT_ENCR_CMD ('00100110'B), |
| 75 | RSL_MT_HANDO_DET ('00100111'B), |
| 76 | RSL_MT_MEAS_RES ('00101000'B), |
| 77 | RSL_MT_MODE_MODIFY_REQ ('00101001'B), |
| 78 | RSL_MT_MODE_MODIFY_ACK ('00101010'B), |
| 79 | RSL_MT_MODE_MODIFY_NACK ('00101011'B), |
| 80 | RSL_MT_PHY_CONTEXT_REQ ('00101100'B), |
| 81 | RSL_MT_PHY_CONTEXT_CONF ('00101101'B), |
| 82 | RSL_MT_RF_CHAN_REL ('00101110'B), |
| 83 | RSL_MT_MS_POWER_CONTROL ('00101111'B), |
| 84 | RSL_MT_BS_POWER_CONTROL ('00110000'B), /* 0x30 */ |
| 85 | RSL_MT_PREPROC_CONFIG ('00110001'B), |
| 86 | RSL_MT_PREPROC_MEAS_RES ('00110010'B), |
| 87 | RSL_MT_RF_CHAN_REL_ACK ('00110011'B), |
| 88 | RSL_MT_SACCH_INFO_MODIFY('00110100'B), |
| 89 | RSL_MT_TALKER_DET ('00110101'B), |
| 90 | RSL_MT_LISTENER_DET ('00110110'B), |
| 91 | RSL_MT_REMOTE_CODEC_CONF_REP ('00110111'B), |
| 92 | RSL_MT_RTD_REP ('00111000'B), |
| 93 | RSL_MT_PRE_HANDO_NOTIF ('00111001'B), |
| 94 | RSL_MT_MR_CODEC_MOD_REQ ('00111010'B), |
| 95 | RSL_MT_MR_CODEC_MOD_ACK ('00111011'B), |
| 96 | RSL_MT_MR_CODEC_MOD_NACK ('00111100'B), |
| 97 | RSL_MT_MR_CODEC_MOD_PER ('00111101'B), |
| 98 | RSL_MT_TFO_REP ('00111110'B), |
| 99 | RSL_MT_TFO_MOD_REQ ('00111111'B), /* 0x3f */ |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 100 | |
| 101 | RSL_MT_LOCATION_INFO ('01000001'B), |
| 102 | |
| 103 | /* ip.access specific RSL message types */ |
| 104 | RSL_MT_IPAC_DIR_RETR_ENQ ('01000000'B), |
| 105 | |
| 106 | RSL_MT_IPAC_PDCH_ACT ('01001000'B), |
Harald Welte | 319be82 | 2017-12-07 17:50:26 +0100 | [diff] [blame] | 107 | RSL_MT_IPAC_PDCH_ACT_ACK ('01001001'B), |
| 108 | RSL_MT_IPAC_PDCH_ACT_NACK ('01001010'B), |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 109 | RSL_MT_IPAC_PDCH_DEACT ('01001011'B), |
Harald Welte | 319be82 | 2017-12-07 17:50:26 +0100 | [diff] [blame] | 110 | RSL_MT_IPAC_PDCH_DEACT_ACK ('01001100'B), |
| 111 | RSL_MT_IPAC_PDCH_DEACT_NACK ('01001101'B), |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 112 | |
| 113 | RSL_MT_IPAC_CONNECT_MUX ('01010000'B), |
| 114 | RSL_MT_IPAC_CONNECT_MUX_ACK, |
| 115 | RSL_MT_IPAC_CONNECT_MUX_NACK, |
| 116 | RSL_MT_IPAC_BIND_MUX, |
| 117 | RSL_MT_IPAC_BIND_MUX_ACK, |
| 118 | RSL_MT_IPAC_BIND_MUX_NACK, |
| 119 | RSL_MT_IPAC_DISC_MUX, |
| 120 | RSL_MT_IPAC_DISC_MUX_ACK, |
| 121 | RSL_MT_IPAC_DISC_MUX_NACK, |
| 122 | RSL_MT_IPAC_MEAS_PREPROC_DFT ('01100000'B), |
| 123 | RSL_MT_IPAC_HO_CAN_ENQ, |
| 124 | RSL_MT_IPAC_HO_CAN_RES, |
| 125 | RSL_MT_IPAC_CRCX, |
| 126 | RSL_MT_IPAC_CRCX_ACK, |
| 127 | RSL_MT_IPAC_CRCX_NACK, |
| 128 | RSL_MT_IPAC_MDCX, |
| 129 | RSL_MT_IPAC_MDCX_ACK, |
| 130 | RSL_MT_IPAC_MDCX_NACK, |
| 131 | RSL_MT_IPAC_DLCX_IND, |
| 132 | RSL_MT_IPAC_DLCX, |
| 133 | RSL_MT_IPAC_DLCX_ACK, |
| 134 | RSL_MT_IPAC_DLCX_NACK |
| 135 | } with { variant "FIELDLENGTH(8)" }; |
| 136 | |
| 137 | /*! RSL Information Element Identifiers (Chapter 9.3) */ |
| 138 | type enumerated RSL_IE_Type { |
| 139 | RSL_IE_CHAN_NR ('00000001'B), |
Harald Welte | 319be82 | 2017-12-07 17:50:26 +0100 | [diff] [blame] | 140 | RSL_IE_LINK_IDENT ('00000010'B), |
| 141 | RSL_IE_ACT_TYPE ('00000011'B), |
| 142 | RSL_IE_BS_POWER ('00000100'B), |
| 143 | RSL_IE_CHAN_IDENT ('00000101'B), |
| 144 | RSL_IE_CHAN_MODE ('00000110'B), |
| 145 | RSL_IE_ENCR_INFO ('00000111'B), |
| 146 | RSL_IE_FRAME_NUMBER ('00001000'B), |
| 147 | RSL_IE_HANDO_REF ('00001001'B), |
| 148 | RSL_IE_L1_INFO ('00001010'B), |
| 149 | RSL_IE_L3_INFO ('00001011'B), |
| 150 | RSL_IE_MS_IDENTITY ('00001100'B), |
| 151 | RSL_IE_MS_POWER ('00001101'B), |
| 152 | RSL_IE_PAGING_GROUP ('00001110'B), |
| 153 | RSL_IE_PAGING_LOAD ('00001111'B), |
| 154 | RSL_IE_PYHS_CONTEXT ('00010000'B), |
| 155 | RSL_IE_ACCESS_DELAY ('00010001'B), |
| 156 | RSL_IE_RACH_LOAD ('00010010'B), |
| 157 | RSL_IE_REQ_REFERENCE ('00010011'B), |
| 158 | RSL_IE_RELEASE_MODE ('00010100'B), |
| 159 | RSL_IE_RESOURCE_INFO ('00010101'B), |
| 160 | RSL_IE_RLM_CAUSE ('00010110'B), |
| 161 | RSL_IE_STARTNG_TIME ('00010111'B), |
| 162 | RSL_IE_TIMING_ADVANCE ('00011000'B), |
| 163 | RSL_IE_UPLINK_MEAS ('00011001'B), |
| 164 | RSL_IE_CAUSE ('00011010'B), |
| 165 | RSL_IE_MEAS_RES_NR ('00011011'B), |
| 166 | RSL_IE_MSG_ID ('00011100'B), |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 167 | /* reserved */ |
| 168 | RSL_IE_SYSINFO_TYPE ('00011110'B), |
Harald Welte | 319be82 | 2017-12-07 17:50:26 +0100 | [diff] [blame] | 169 | RSL_IE_MS_POWER_PARAM ('00011111'B), |
| 170 | RSL_IE_BS_POWER_PARAM ('00100000'B), |
| 171 | RSL_IE_PREPROC_PARAM ('00100001'B), |
| 172 | RSL_IE_PREPROC_MEAS ('00100010'B), |
| 173 | RSL_IE_IMM_ASS_INFO ('00100011'B),/* Phase 1 (3.6.0), later Full below */ |
| 174 | RSL_IE_SMSCB_INFO ('00100100'B), |
| 175 | RSL_IE_MS_TIMING_OFFSET ('00100101'B), |
| 176 | RSL_IE_ERR_MSG ('00100110'B), |
| 177 | RSL_IE_FULL_BCCH_INFO ('00100111'B), |
| 178 | RSL_IE_CHAN_NEEDED ('00101000'B), |
| 179 | RSL_IE_CB_CMD_TYPE ('00101001'B), |
| 180 | RSL_IE_SMSCB_MSG ('00101010'B), |
| 181 | RSL_IE_FULL_IMM_ASS_INFO ('00101011'B), |
| 182 | RSL_IE_SACCH_INFO ('00101100'B), |
| 183 | RSL_IE_CBCH_LOAD_INFO ('00101101'B), |
| 184 | RSL_IE_SMSCB_CHAN_INDICATOR ('00101110'B), |
| 185 | RSL_IE_GROUP_CALL_REF ('00101111'B), |
| 186 | RSL_IE_CHAN_DESC ('00110000'B), |
| 187 | RSL_IE_NCH_DRX_INFO ('00110001'B), |
| 188 | RSL_IE_CMD_INDICATOR ('00110010'B), |
| 189 | RSL_IE_EMLPP_PRIO ('00110011'B), |
| 190 | RSL_IE_UIC ('00110100'B), |
| 191 | RSL_IE_MAIN_CHAN_REF ('00110101'B), |
| 192 | RSL_IE_MR_CONFIG ('00110110'B), |
| 193 | RSL_IE_MR_CONTROL ('00110111'B), |
| 194 | RSL_IE_SUP_CODEC_TYPES ('00111000'B), |
| 195 | RSL_IE_CODEC_CONFIG ('00111001'B), |
| 196 | RSL_IE_RTD ('00111010'B), |
| 197 | RSL_IE_TFO_STATUS ('00111011'B), |
| 198 | RSL_IE_LLP_APDU ('00111100'B), |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 199 | |
| 200 | /* ip.access */ |
| 201 | RSL_IE_IPAC_SRTP_CONFIG ('11100000'B), |
Harald Welte | 319be82 | 2017-12-07 17:50:26 +0100 | [diff] [blame] | 202 | RSL_IE_IPAC_PROXY_UDP ('11100001'B), |
| 203 | RSL_IE_IPAC_BSCMPL_TOUT ('11100010'B), |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 204 | |
| 205 | RSL_IE_IPAC_REMOTE_IP ('11110000'B), |
Harald Welte | 319be82 | 2017-12-07 17:50:26 +0100 | [diff] [blame] | 206 | RSL_IE_IPAC_REMOTE_PORT ('11110001'B), |
| 207 | RSL_IE_IPAC_RTP_PAYLOAD ('11110010'B), |
| 208 | RSL_IE_IPAC_LOCAL_PORT ('11110011'B), |
| 209 | RSL_IE_IPAC_SPEECH_MODE ('11110100'B), |
| 210 | RSL_IE_IPAC_LOCAL_IP ('11110101'B), |
| 211 | RSL_IE_IPAC_CONN_STAT ('11110110'B), |
| 212 | RSL_IE_IPAC_HO_C_PARMS ('11110111'B), |
| 213 | RSL_IE_IPAC_CONN_ID ('11111000'B), |
| 214 | RSL_IE_IPAC_RTP_CSD_FMT ('11111001'B), |
| 215 | RSL_IE_IPAC_RTP_JIT_BUF ('11111010'B), |
| 216 | RSL_IE_IPAC_RTP_COMPR ('11111011'B), |
| 217 | RSL_IE_IPAC_RTP_PAYLOAD2 ('11111100'B), |
| 218 | RSL_IE_IPAC_RTP_MPLEX ('11111101'B), |
| 219 | RSL_IE_IPAC_RTP_MPLEX_ID ('11111110'B) |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 220 | } with { variant "FIELDLENGTH(8)" }; |
| 221 | |
| 222 | type record RSL_LV { |
| 223 | uint8_t len, |
| 224 | octetstring payload |
| 225 | } with { variant (len) "LENGTHTO(payload)" } |
| 226 | |
| 227 | template RSL_LV ts_RSL_LV(template octetstring pl) := { |
| 228 | len := 0, |
| 229 | payload := pl |
| 230 | } |
| 231 | |
Harald Welte | 51d7410 | 2017-12-10 23:05:02 +0100 | [diff] [blame] | 232 | template RSL_LV tr_RSL_LV(template octetstring pl) := { |
| 233 | len := ?, |
| 234 | payload := pl |
| 235 | } |
| 236 | |
Harald Welte | 15bb5b5 | 2017-12-07 17:52:04 +0100 | [diff] [blame] | 237 | type record RSL_L16V { |
| 238 | uint16_t len, |
| 239 | octetstring payload |
| 240 | } with { variant (len) "LENGTHTO(payload)" } |
| 241 | |
| 242 | template RSL_L16V ts_RSL_L16V(template octetstring pl) := { |
| 243 | len := 0, |
| 244 | payload := pl |
| 245 | } |
| 246 | |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 247 | type record RSL_IE_V { |
| 248 | uint8_t val |
| 249 | } |
| 250 | |
| 251 | /* 9.3.3 */ |
| 252 | type record RSL_IE_ActivationType { |
| 253 | boolean reactivation, |
| 254 | uint4_t reserved, |
| 255 | uint3_t a_bits |
| 256 | } |
| 257 | |
| 258 | template RSL_IE_ActivationType t_RSL_IE_ActType := { |
| 259 | reactivation := false, |
| 260 | reserved := 0, |
| 261 | a_bits := 0 /* related to immediate assignment */ |
| 262 | } |
| 263 | |
| 264 | /* 9.3.6 */ |
| 265 | type enumerated RSL_SpeechDataInd { |
| 266 | RSL_SPDI_SPEECH ('00000001'B), |
| 267 | RSL_SPDI_DATA ('00000010'B), |
| 268 | RSL_SPDI_SIGN ('00000011'B) |
| 269 | } with { variant "FIELDLENGTH(8)" }; |
| 270 | type enumerated RSL_ChanRateType { |
| 271 | RSL_CHRT_SDCCH ('00000001'B), |
| 272 | RSL_CHRT_TCH_F ('00001000'B), |
| 273 | RSL_CHRT_TCH_H ('00001001'B), |
| 274 | RSL_CHRT_TCH_F_BD_MSLOT ('00001010'B), |
| 275 | RSL_CHRT_TCH_F_DL_MSLOT ('00011010'B), |
| 276 | RSL_CHRT_TCH_F_GROUP ('00011000'B), |
| 277 | RSL_CHRT_TCH_H_GROUP ('00011001'B), |
| 278 | RSL_CHRT_TCH_F_BCAST ('00101000'B), |
| 279 | RSL_CHRT_TCH_H_BCAST ('00101001'B) |
| 280 | } with { variant "FIELDLENGTH(8)" }; |
| 281 | type enumerated RSL_SpeechAlgo { |
| 282 | RSL_CMOD_NO_RESOURCE ('00000000'B), |
| 283 | RSL_CMOD_SP_GSM1 ('00000001'B), |
| 284 | RSL_CMOD_SP_GSM2 ('00010001'B), |
| 285 | RSL_CMOD_SP_GSM3 ('00100001'B), |
| 286 | RSL_CMOD_SP_GSM4 ('00110001'B), |
| 287 | RSL_CMOD_SP_GSM5 ('00001001'B), |
| 288 | RSL_CMOD_SP_GSM6 ('00001101'B) |
| 289 | } with { variant "FIELDLENGTH(8)" }; |
| 290 | type record RSL_IE_ChannelMode { |
Harald Welte | 8f2c21d | 2017-12-07 17:52:40 +0100 | [diff] [blame] | 291 | uint8_t len, |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 292 | BIT6 reserved, |
| 293 | boolean dtx_d, |
| 294 | boolean dtx_u, |
| 295 | RSL_SpeechDataInd spd_ind, |
| 296 | RSL_ChanRateType ch_rate_type, |
| 297 | RSL_SpeechAlgo coding_alg_rate |
Harald Welte | 8f2c21d | 2017-12-07 17:52:40 +0100 | [diff] [blame] | 298 | } with { variant (len) "LENGTHTO(reserved,dtx_d,dtx_u,spd_ind,ch_rate_type,coding_alg_rate)" } |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 299 | |
| 300 | template RSL_IE_ChannelMode ts_RSL_ChanMode_SIGN := { |
Harald Welte | 8f2c21d | 2017-12-07 17:52:40 +0100 | [diff] [blame] | 301 | len := 0, /* overwritten */ |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 302 | reserved := '000000'B, |
| 303 | dtx_d := false, |
| 304 | dtx_u := false, |
| 305 | spd_ind := RSL_SPDI_SIGN, |
| 306 | ch_rate_type := RSL_CHRT_SDCCH, |
| 307 | coding_alg_rate := RSL_CMOD_NO_RESOURCE |
| 308 | } |
| 309 | |
| 310 | template RSL_IE_ChannelMode ts_RSL_ChanMode(RSL_ChanRateType t, RSL_SpeechAlgo alg) := { |
Harald Welte | 8f2c21d | 2017-12-07 17:52:40 +0100 | [diff] [blame] | 311 | len := 0, /* overwritten */ |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 312 | reserved := '000000'B, |
| 313 | dtx_d := false, |
| 314 | dtx_u := false, |
| 315 | spd_ind := RSL_SPDI_SPEECH, |
| 316 | ch_rate_type := t, |
| 317 | coding_alg_rate := alg |
| 318 | } |
| 319 | |
| 320 | /* 9.3.4 */ |
| 321 | type record RSL_IE_BS_Power { |
| 322 | uint1_t reserved, |
| 323 | boolean epc, |
| 324 | boolean fpc, |
| 325 | uint5_t power_level |
| 326 | } |
| 327 | |
| 328 | /* 9.3.8 */ |
| 329 | type record RSL_IE_FrameNumber { |
| 330 | uint5_t t1_p, |
| 331 | uint6_t t3, |
| 332 | uint5_t t2 |
| 333 | } |
| 334 | type RSL_IE_FrameNumber RSL_IE_StartingTime; |
| 335 | |
| 336 | /* 9.3.10 */ |
| 337 | type record RSL_IE_L1Info { |
| 338 | uint5_t ms_power_lvl, |
| 339 | boolean fpc, |
| 340 | uint2_t reserved, |
| 341 | uint8_t actual_ta |
| 342 | } |
| 343 | |
| 344 | /* 9.3.13 */ |
| 345 | type record RSL_IE_MS_Power { |
| 346 | uint2_t reserved, |
| 347 | boolean fpc_epc, |
| 348 | uint5_t power_level |
| 349 | } |
| 350 | |
Harald Welte | d5f521e | 2017-12-07 17:53:06 +0100 | [diff] [blame] | 351 | /* 9.3.18 */ |
| 352 | type record RSL_IE_RachLoad { |
| 353 | uint8_t len, |
| 354 | uint16_t slot_count, |
| 355 | uint16_t busy_count, |
| 356 | uint16_t access_count |
| 357 | } with { variant (len) "LENGTHTO(slot_count,busy_count,access_count)" } |
| 358 | |
| 359 | template RSL_IE_RachLoad ts_RSL_IE_RachLoad(uint16_t slot, uint16_t busy, uint16_t acc) := { |
| 360 | len := 0, /* overwritten */ |
| 361 | slot_count := slot, |
| 362 | busy_count := busy, |
| 363 | access_count := acc |
| 364 | } |
| 365 | |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 366 | /* 9.3.19 */ |
| 367 | type record RSL_IE_RequestRef { |
| 368 | OCT1 ra, |
| 369 | RSL_IE_FrameNumber frame_nr |
| 370 | } |
| 371 | |
| 372 | /* 3GPP TS 44.018 / 10.5.2.38 Starting Time */ |
| 373 | template RSL_IE_FrameNumber ts_RSL_IE_FrameNumber(GsmFrameNumber fn) := { |
| 374 | t1_p := (fn / 1326) mod 32, |
| 375 | t3 := fn mod 51, |
| 376 | t2 := fn mod 26 |
| 377 | } |
| 378 | |
| 379 | template RSL_IE_RequestRef ts_RSL_IE_ReqRef(OCT1 ra, GsmFrameNumber frame_nr) := { |
| 380 | ra := ra, |
| 381 | frame_nr := ts_RSL_IE_FrameNumber(frame_nr) |
| 382 | } |
| 383 | |
| 384 | /* 9.3.26 */ |
Harald Welte | a8ed906 | 2017-12-14 09:46:01 +0100 | [diff] [blame] | 385 | type enumerated RSL_Cause { |
| 386 | /* normal event */ |
| 387 | RSL_ERR_RADIO_IF_FAIL ('00'O), |
| 388 | RSL_ERR_RADIO_LINK_FAIL ('01'O), |
| 389 | RSL_ERR_HANDOVER_ACC_FAIL ('02'O), |
| 390 | RSL_ERR_TALKER_ACC_FAIL ('03'O), |
| 391 | RSL_ERR_OM_INTERVENTION ('07'O), |
| 392 | RSL_ERR_NORMAL_UNSPEC ('0f'O), |
| 393 | RSL_ERR_T_MSRFPCI_EXP ('18'O), |
| 394 | /* resource unavailable */ |
| 395 | RSL_ERR_EQUIPMENT_FAIL ('20'O), |
| 396 | RSL_ERR_RR_UNAVAIL ('21'O), |
| 397 | RSL_ERR_TERR_CH_FAIL ('22'O), |
| 398 | RSL_ERR_CCCH_OVERLOAD ('23'O), |
| 399 | RSL_ERR_ACCH_OVERLOAD ('24'O), |
| 400 | RSL_ERR_PROCESSOR_OVERLOAD ('25'O), |
| 401 | RSL_ERR_BTS_NOT_EQUIPPED ('27'O), |
| 402 | RSL_ERR_REMOTE_TRAU_FAILURE ('28'O), |
| 403 | RSL_ERR_NOTIF_OVERFLOW ('29'O), |
| 404 | RSL_ERR_RES_UNAVAIL ('2f'O), |
| 405 | /* service or option not available */ |
| 406 | RSL_ERR_TRANSC_UNAVAIL ('30'O), |
| 407 | RSL_ERR_SERV_OPT_UNAVAIL ('3f'O), |
| 408 | /* service or option not implemented */ |
| 409 | RSL_ERR_ENCR_UNIMPL ('40'O), |
| 410 | RSL_ERR_SERV_OPT_UNIMPL ('4f'O), |
| 411 | /* invalid message */ |
| 412 | RSL_ERR_RCH_ALR_ACTV_ALLOC ('50'O), |
| 413 | RSL_ERR_INVALID_MESSAGE ('5f'O), |
| 414 | /* protocol error */ |
| 415 | RSL_ERR_MSG_DISCR ('60'O), |
| 416 | RSL_ERR_MSG_TYPE ('61'O), |
| 417 | RSL_ERR_MSG_SEQ ('62'O), |
| 418 | RSL_ERR_IE_ERROR ('63'O), |
| 419 | RSL_ERR_MAND_IE_ERROR ('64'O), |
| 420 | RSL_ERR_OPT_IE_ERROR ('65'O), |
| 421 | RSL_ERR_IE_NONEXIST ('66'O), |
| 422 | RSL_ERR_IE_LENGTH ('67'O), |
| 423 | RSL_ERR_IE_CONTENT ('68'O), |
| 424 | RSL_ERR_PROTO ('6f'O), |
| 425 | /* interworking */ |
| 426 | RSL_ERR_INTERWORKING ('7f'O) |
| 427 | }; |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 428 | type record RSL_IE_Cause { |
Harald Welte | 6efa8e3 | 2017-12-09 22:34:06 +0100 | [diff] [blame] | 429 | uint8_t len, |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 430 | uint1_t e, |
| 431 | RSL_Cause cause, |
| 432 | octetstring cause_ext optional |
Harald Welte | 6efa8e3 | 2017-12-09 22:34:06 +0100 | [diff] [blame] | 433 | } with { variant (len) "LENGTHTO(e,cause,cause_ext)" } |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 434 | |
| 435 | template RSL_IE_Cause ts_RSL_IE_Cause(RSL_Cause cause) := { |
Harald Welte | 6efa8e3 | 2017-12-09 22:34:06 +0100 | [diff] [blame] | 436 | len := 0, /* overwritten */ |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 437 | e := 0, |
| 438 | cause := cause, |
| 439 | cause_ext := omit |
| 440 | } |
| 441 | |
| 442 | /* 9.3.40 */ |
| 443 | type enumerated RSL_ChanNeeded { |
| 444 | RSL_CHANNEED_ANY ('00'B), |
| 445 | RSL_CHANNEED_SDCCH ('01'B), |
| 446 | RSL_CHANNEED_TCH_F ('10'B), |
| 447 | RSL_CHANNEED_TCH_ForH ('11'B) |
Harald Welte | 51d7410 | 2017-12-10 23:05:02 +0100 | [diff] [blame] | 448 | } with { variant "FIELDLENGTH(2)" }; |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 449 | type record RSL_IE_ChanNeeded { |
| 450 | uint6_t reserved, |
| 451 | RSL_ChanNeeded chan_needed |
| 452 | } |
| 453 | |
| 454 | /* 9.3.53 */ |
| 455 | type record RSL_IE_MultirateCtrl { |
| 456 | uint3_t spare, |
| 457 | boolean od, |
| 458 | boolean pre, |
| 459 | uint2_t rae, |
| 460 | boolean tfo |
| 461 | } |
| 462 | |
| 463 | type enumerated RSL_IE_SysinfoType { |
| 464 | RSL_SYSTEM_INFO_8 ('00000000'B), |
| 465 | RSL_SYSTEM_INFO_1 ('00000001'B), |
| 466 | RSL_SYSTEM_INFO_2 ('00000010'B), |
| 467 | RSL_SYSTEM_INFO_3 ('00000011'B), |
| 468 | RSL_SYSTEM_INFO_4 ('00000100'B), |
| 469 | RSL_SYSTEM_INFO_5 ('00000101'B), |
| 470 | RSL_SYSTEM_INFO_6 ('00000110'B), |
| 471 | RSL_SYSTEM_INFO_7 ('00000111'B), |
| 472 | RSL_SYSTEM_INFO_16 ('00001000'B), |
| 473 | RSL_SYSTEM_INFO_17 ('00001001'B), |
| 474 | RSL_SYSTEM_INFO_2bis ('00001010'B), |
| 475 | RSL_SYSTEM_INFO_2ter ('00001011'B), |
| 476 | RSL_SYSTEM_INFO_5bis ('00001101'B), |
| 477 | RSL_SYSTEM_INFO_5ter ('00001110'B), |
| 478 | RSL_SYSTEM_INFO_10 ('00001111'B), |
| 479 | RSL_EXT_MEAS_ORDER ('01000111'B), |
| 480 | RSL_MEAS_INFO ('01001000'B), |
| 481 | RSL_SYSTEM_INFO_13 ('00101000'B), |
| 482 | RSL_ERIC_SYSTEM_INFO_13 ('00001100'B), |
| 483 | RSL_SYSTEM_INFO_2quater ('00101001'B), |
| 484 | RSL_SYSTEM_INFO_9 ('00101010'B), |
| 485 | RSL_SYSTEM_INFO_18 ('00101011'B), |
| 486 | RSL_SYSTEM_INFO_19 ('00101100'B), |
| 487 | RSL_SYSTEM_INFO_20 ('00101101'B) |
| 488 | } with { variant "FIELDLENGTH(8)" } |
| 489 | |
| 490 | /* union of all IE bodies */ |
| 491 | type union RSL_IE_Body { |
| 492 | RslChannelNr chan_nr, |
| 493 | RslLinkId link_id, |
Harald Welte | 15bb5b5 | 2017-12-07 17:52:04 +0100 | [diff] [blame] | 494 | RSL_L16V l3_info, |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 495 | RSL_LV rlm_cause, |
| 496 | uint8_t release_mode, |
| 497 | RSL_IE_ActivationType act_type, |
| 498 | RSL_IE_ChannelMode chan_mode, |
| 499 | uint8_t handover_ref, |
| 500 | RSL_IE_BS_Power bs_power, |
| 501 | RSL_IE_MS_Power ms_power, |
| 502 | uint8_t timing_adv, |
| 503 | RSL_IE_MultirateCtrl multirate_ctrl, |
| 504 | RSL_IE_FrameNumber frame_nr, |
| 505 | RSL_IE_Cause cause, |
| 506 | uint8_t access_delay, |
Harald Welte | d5f521e | 2017-12-07 17:53:06 +0100 | [diff] [blame] | 507 | RSL_IE_RachLoad rach_load, |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 508 | uint8_t meas_res_nr, |
| 509 | RSL_IE_L1Info l1_info, |
| 510 | RSL_IE_SysinfoType sysinfo_type, |
| 511 | uint16_t paging_load, |
| 512 | uint8_t paging_group, |
| 513 | RSL_IE_ChanNeeded chan_needed, |
| 514 | RSL_IE_StartingTime starting_time, |
| 515 | RSL_IE_RequestRef req_ref, |
| 516 | RSL_LV full_imm_ass_info, |
Harald Welte | fff6930 | 2017-12-07 17:53:42 +0100 | [diff] [blame] | 517 | RSL_LV ms_identity, |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 518 | |
| 519 | RSL_LV other |
| 520 | } |
| 521 | |
| 522 | type record RSL_IE { |
| 523 | RSL_IE_Type iei, |
| 524 | RSL_IE_Body body |
| 525 | } with { variant (body) "CROSSTAG( |
| 526 | chan_nr, iei = RSL_IE_CHAN_NR; |
| 527 | link_id, iei = RSL_IE_LINK_IDENT; |
| 528 | l3_info, iei = RSL_IE_L3_INFO; |
| 529 | rlm_cause, iei = RSL_IE_RLM_CAUSE; |
| 530 | release_mode, iei = RSL_IE_RELEASE_MODE; |
| 531 | act_type, iei = RSL_IE_ACT_TYPE; |
| 532 | chan_mode, iei = RSL_IE_CHAN_MODE; |
| 533 | handover_ref, iei = RSL_IE_HANDO_REF; |
| 534 | bs_power, iei = RSL_IE_BS_POWER; |
| 535 | ms_power, iei = RSL_IE_MS_POWER; |
| 536 | timing_adv, iei = RSL_IE_TIMING_ADVANCE; |
| 537 | multirate_ctrl, iei = RSL_IE_MR_CONTROL; |
| 538 | |
| 539 | frame_nr, iei = RSL_IE_FRAME_NUMBER; |
| 540 | cause, iei = RSL_IE_CAUSE; |
| 541 | access_delay, iei = RSL_IE_ACCESS_DELAY; |
Harald Welte | d5f521e | 2017-12-07 17:53:06 +0100 | [diff] [blame] | 542 | rach_load, iei = RSL_IE_RACH_LOAD; |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 543 | meas_res_nr, iei = RSL_IE_MEAS_RES_NR; |
| 544 | l1_info, iei = RSL_IE_L1_INFO; |
| 545 | sysinfo_type, iei = RSL_IE_SYSINFO_TYPE; |
| 546 | paging_load, iei = RSL_IE_PAGING_LOAD; |
| 547 | paging_group, iei = RSL_IE_PAGING_GROUP; |
| 548 | chan_needed, iei = RSL_IE_CHAN_NEEDED; |
| 549 | starting_time, iei = RSL_IE_STARTNG_TIME; |
| 550 | |
| 551 | req_ref, iei = RSL_IE_REQ_REFERENCE; |
Harald Welte | fff6930 | 2017-12-07 17:53:42 +0100 | [diff] [blame] | 552 | full_imm_ass_info, iei = RSL_IE_FULL_IMM_ASS_INFO; |
| 553 | ms_identity, iei = RSL_IE_MS_IDENTITY; |
| 554 | other, iei = RSL_IE_FULL_BCCH_INFO; |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 555 | |
| 556 | other, OTHERWISE; |
| 557 | )" }; |
| 558 | |
Harald Welte | 735dd07 | 2017-12-12 14:55:17 +0100 | [diff] [blame] | 559 | /* For some reason the TTCN-3 RAW codec cannot automatically figure out the IEI |
| 560 | * that it needs to set for a given union-choice (body). So we have to explicitly |
| 561 | * specify the IEI by the caller :( */ |
| 562 | template RSL_IE t_RSL_IE(RSL_IE_Type iei, template RSL_IE_Body body) := { |
| 563 | iei := iei, |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 564 | body := body |
| 565 | } |
| 566 | |
Harald Welte | c287775 | 2017-12-07 17:54:35 +0100 | [diff] [blame] | 567 | template RSL_IE tr_RSL_IE(template RSL_IE_Body body) := { |
| 568 | iei := ?, /* overwritten? */ |
| 569 | body := body |
| 570 | } |
| 571 | |
| 572 | |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 573 | type record of RSL_IE RSL_IE_List; |
| 574 | |
| 575 | type record RSL_Message { |
| 576 | RSL_MessageDiscriminator msg_disc, |
| 577 | RSL_MessageType msg_type, |
| 578 | RSL_IE_List ies optional |
| 579 | } |
| 580 | |
| 581 | external function enc_RSL_Message(in RSL_Message msg) return octetstring |
| 582 | with { extension "prototype(convert) encode(RAW)" }; |
| 583 | external function dec_RSL_Message(in octetstring stream) return RSL_Message |
| 584 | with { extension "prototype(convert) decode(RAW)" }; |
| 585 | |
Harald Welte | bc330be | 2017-12-09 00:56:36 +0100 | [diff] [blame] | 586 | template RSL_Message tr_RSL_MsgDiscType(template RSL_MessageDiscriminator m_disc, |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 587 | RSL_MessageType m_type) := { |
| 588 | msg_disc := m_disc, |
| 589 | msg_type := m_type, |
| 590 | ies := * |
| 591 | } |
| 592 | |
Harald Welte | 4a26736 | 2017-12-09 17:49:32 +0100 | [diff] [blame] | 593 | template RSL_Message ts_RSL_MsgDiscType(template RSL_MessageDiscriminator m_disc, |
| 594 | template RSL_MessageType msg_type, |
| 595 | template RSL_IE_List ies := omit) := { |
| 596 | msg_disc := m_disc, |
| 597 | msg_type := msg_type, |
| 598 | ies := ies |
| 599 | } |
| 600 | |
Harald Welte | bc330be | 2017-12-09 00:56:36 +0100 | [diff] [blame] | 601 | template RSL_Message tr_RSL_MsgType(template RSL_MessageType msg_type) := { |
| 602 | msg_disc := ?, |
| 603 | msg_type := msg_type, |
| 604 | ies := * |
| 605 | } |
| 606 | |
| 607 | /* Common Channel Management */ |
| 608 | template RSL_Message tr_RSL_MsgTypeC(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := { |
| 609 | msg_disc := { RSL_MDISC_CCHAN, ? } |
| 610 | } |
| 611 | |
| 612 | /* RLL */ |
| 613 | template RSL_Message tr_RSL_MsgTypeR(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := { |
| 614 | msg_disc := { RSL_MDISC_RLL, true } |
| 615 | } |
| 616 | |
| 617 | /* Dedicated Channel Management */ |
| 618 | template RSL_Message tr_RSL_MsgTypeD(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := { |
| 619 | msg_disc := { RSL_MDISC_DCHAN, ? } |
| 620 | } |
| 621 | |
| 622 | /* Dedicated Channel Management */ |
| 623 | template RSL_Message tr_RSL_MsgTypeT(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := { |
| 624 | msg_disc := { RSL_MDISC_TRX_MGMT, ? } |
| 625 | } |
| 626 | |
| 627 | |
| 628 | /* dedicated channel or RLL */ |
| 629 | template RSL_Message tr_RSL_MsgTypeDR(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := { |
| 630 | msg_disc := ({RSL_MDISC_DCHAN,?}, {RSL_MDISC_RLL,true}) |
| 631 | } |
| 632 | |
| 633 | |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 634 | /* 8.3.1 BSC -> BTS */ |
| 635 | template RSL_Message ts_RSL_DATA_REQ(RslChannelNr chan_nr, RslLinkId link_id, octetstring l3_info) := { |
| 636 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, true), |
| 637 | msg_type := RSL_MT_DATA_REQ, |
| 638 | ies :={ |
Harald Welte | 735dd07 | 2017-12-12 14:55:17 +0100 | [diff] [blame] | 639 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 640 | t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}), |
| 641 | t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)}) |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 642 | } |
| 643 | } |
| 644 | |
| 645 | /* 8.3.2 BTS -> BSC */ |
| 646 | template RSL_Message ts_RSL_DATA_IND(RslChannelNr chan_nr, RslLinkId link_id, octetstring l3_info) := { |
| 647 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, true), |
| 648 | msg_type := RSL_MT_DATA_IND, |
| 649 | ies :={ |
Harald Welte | 735dd07 | 2017-12-12 14:55:17 +0100 | [diff] [blame] | 650 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 651 | t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}), |
| 652 | t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)}) |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 653 | } |
| 654 | } |
| 655 | |
| 656 | /* 8.3.3 BTS -> BSC */ |
| 657 | template RSL_Message ts_RSL_ERROR_IND(RslChannelNr chan_nr, RslLinkId link_id, RSL_Cause cause) := { |
| 658 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false), |
| 659 | msg_type := RSL_MT_ERROR_IND, |
| 660 | ies :={ |
Harald Welte | 735dd07 | 2017-12-12 14:55:17 +0100 | [diff] [blame] | 661 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 662 | t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}), |
| 663 | t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)}) |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 664 | } |
| 665 | } |
| 666 | |
| 667 | /* 8.3.6 BTS -> BSC */ |
| 668 | template RSL_Message ts_RSL_EST_IND(RslChannelNr chan_nr, RslLinkId link_id, octetstring l3_info) := { |
| 669 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false), |
| 670 | msg_type := RSL_MT_EST_IND, |
| 671 | ies := { |
Harald Welte | 735dd07 | 2017-12-12 14:55:17 +0100 | [diff] [blame] | 672 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 673 | t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}), |
| 674 | t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)}) |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 675 | } |
| 676 | } |
| 677 | |
| 678 | /* 8.3.7 BSC -> BTS */ |
| 679 | template RSL_Message ts_RSL_REL_REQ(RslChannelNr chan_nr, RslLinkId link_id) := { |
| 680 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false), |
| 681 | msg_type := RSL_MT_REL_REQ, |
| 682 | ies :={ |
Harald Welte | 735dd07 | 2017-12-12 14:55:17 +0100 | [diff] [blame] | 683 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 684 | t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}) |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 685 | } |
| 686 | } |
Harald Welte | e8a5ab1 | 2017-12-09 22:34:57 +0100 | [diff] [blame] | 687 | template RSL_Message tr_RSL_REL_REQ(template RslChannelNr chan_nr, |
| 688 | template RslLinkId link_id) := { |
| 689 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false), |
| 690 | msg_type := RSL_MT_REL_REQ, |
| 691 | ies :={ |
| 692 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
| 693 | tr_RSL_IE(RSL_IE_Body:{link_id := link_id}), |
| 694 | * |
| 695 | } |
| 696 | } |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 697 | |
| 698 | /* 8.3.8 BTS -> BSC */ |
| 699 | template RSL_Message ts_RSL_REL_CONF(RslChannelNr chan_nr, RslLinkId link_id) := { |
| 700 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false), |
| 701 | msg_type := RSL_MT_REL_CONF, |
| 702 | ies :={ |
Harald Welte | 735dd07 | 2017-12-12 14:55:17 +0100 | [diff] [blame] | 703 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 704 | t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}) |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 705 | } |
| 706 | } |
| 707 | |
| 708 | /* 8.3.9 BTS -> BSC */ |
| 709 | template RSL_Message ts_RSL_REL_IND(RslChannelNr chan_nr, RslLinkId link_id) := { |
| 710 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false), |
| 711 | msg_type := RSL_MT_REL_IND, |
| 712 | ies :={ |
Harald Welte | 735dd07 | 2017-12-12 14:55:17 +0100 | [diff] [blame] | 713 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 714 | t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}) |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 715 | } |
| 716 | } |
| 717 | |
| 718 | /* 8.3.10 BSC -> BTS */ |
| 719 | template RSL_Message ts_RSL_UNITDATA_REQ(RslChannelNr chan_nr, RslLinkId link_id, octetstring l3_info) |
| 720 | modifies ts_RSL_DATA_REQ := { |
| 721 | msg_type := RSL_MT_UNIT_DATA_REQ |
| 722 | } |
| 723 | |
| 724 | /* 8.3.11 BTS -> BSC */ |
| 725 | template RSL_Message ts_RSL_UNITDATA_IND(RslChannelNr chan_nr, RslLinkId link_id, octetstring l3_info) |
| 726 | modifies ts_RSL_DATA_IND := { |
| 727 | msg_type := RSL_MT_UNIT_DATA_IND |
| 728 | } |
| 729 | |
| 730 | |
| 731 | /* DEDICATED CANNEL MANAGEMENT MESSAGES */ |
| 732 | |
| 733 | /* 8.4.1 BSC -> BTS */ |
| 734 | template RSL_Message ts_RSL_CHAN_ACT(RslChannelNr chan_nr, RSL_IE_ChannelMode mode) := { |
| 735 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
| 736 | msg_type := RSL_MT_CHAN_ACTIV, |
| 737 | ies :={ |
Harald Welte | 735dd07 | 2017-12-12 14:55:17 +0100 | [diff] [blame] | 738 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 739 | t_RSL_IE(RSL_IE_ACT_TYPE, RSL_IE_Body:{act_type := t_RSL_IE_ActType}), |
| 740 | t_RSL_IE(RSL_IE_CHAN_MODE, RSL_IE_Body:{chan_mode := mode}) |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 741 | /* lots of optional IEs */ |
| 742 | } |
| 743 | } |
| 744 | |
| 745 | /* 8.4.2 BTS -> BSC */ |
| 746 | template RSL_Message ts_RSL_CHAN_ACT_ACK(RslChannelNr chan_nr, GsmFrameNumber fn) := { |
| 747 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
| 748 | msg_type := RSL_MT_CHAN_ACTIV_ACK, |
| 749 | ies :={ |
Harald Welte | 735dd07 | 2017-12-12 14:55:17 +0100 | [diff] [blame] | 750 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 751 | t_RSL_IE(RSL_IE_FRAME_NUMBER, RSL_IE_Body:{frame_nr := ts_RSL_IE_FrameNumber(fn)}) |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 752 | } |
| 753 | } |
| 754 | |
| 755 | /* 8.4.3 BTS -> BSC */ |
| 756 | template RSL_Message ts_RSL_CHAN_ACT_NACK(RslChannelNr chan_nr, RSL_Cause cause) := { |
| 757 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
| 758 | msg_type := RSL_MT_CHAN_ACTIV_NACK, |
| 759 | ies :={ |
Harald Welte | 735dd07 | 2017-12-12 14:55:17 +0100 | [diff] [blame] | 760 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 761 | t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)}) |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 762 | } |
| 763 | } |
| 764 | |
| 765 | /* 8.4.4 BTS -> BSC */ |
| 766 | template RSL_Message ts_RSL_CONN_FAIL_IND(RslChannelNr chan_nr, RSL_Cause cause) := { |
| 767 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
| 768 | msg_type := RSL_MT_CONN_FAIL, |
| 769 | ies :={ |
Harald Welte | 735dd07 | 2017-12-12 14:55:17 +0100 | [diff] [blame] | 770 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 771 | t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)}) |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 772 | } |
| 773 | } |
| 774 | |
Harald Welte | e8a5ab1 | 2017-12-09 22:34:57 +0100 | [diff] [blame] | 775 | /* 8.4.5 BSC -> BTS */ |
| 776 | template RSL_Message tr_RSL_DEACT_SACCH(template RslChannelNr chan_nr) := { |
| 777 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
| 778 | msg_type := RSL_MT_DEACTIVATE_SACCH, |
| 779 | ies := { |
| 780 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}) |
| 781 | } |
| 782 | } |
| 783 | |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 784 | /* 8.4.11 BTS -> BSC */ |
| 785 | template RSL_Message ts_RSL_MODE_MODIFY_NACK(RslChannelNr chan_nr, RSL_Cause cause) |
| 786 | modifies ts_RSL_CHAN_ACT_NACK := { |
| 787 | msg_type := RSL_MT_MODE_MODIFY_NACK |
| 788 | } |
| 789 | |
Harald Welte | 4a26736 | 2017-12-09 17:49:32 +0100 | [diff] [blame] | 790 | /* 8.4.19 BTS -> BSC */ |
| 791 | template RSL_Message ts_RSL_RF_CHAN_REL_ACK(RslChannelNr chan_nr) := |
| 792 | ts_RSL_MsgDiscType(ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
| 793 | RSL_MT_RF_CHAN_REL_ACK, |
Harald Welte | 735dd07 | 2017-12-12 14:55:17 +0100 | [diff] [blame] | 794 | { t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}) }); |
Harald Welte | 4a26736 | 2017-12-09 17:49:32 +0100 | [diff] [blame] | 795 | |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 796 | /* COMMON CHANNEL MANAGEMENT MESSAGES */ |
| 797 | |
Harald Welte | 7ae9314 | 2017-12-07 17:56:15 +0100 | [diff] [blame] | 798 | /* 8.5.2 BTS -> BSC */ |
| 799 | template RSL_Message ts_RSL_RACH_LOAD_IND(uint16_t slot_ct, uint16_t busy_ct, uint16_t acc_ct) := { |
| 800 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false), |
| 801 | msg_type := RSL_MT_CCCH_LOAD_IND, |
| 802 | ies := { |
Harald Welte | 735dd07 | 2017-12-12 14:55:17 +0100 | [diff] [blame] | 803 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := t_RslChanNr_RACH(0)}), |
| 804 | t_RSL_IE(RSL_IE_RACH_LOAD, RSL_IE_Body:{rach_load := ts_RSL_IE_RachLoad(slot_ct, busy_ct, acc_ct)}) |
Harald Welte | 7ae9314 | 2017-12-07 17:56:15 +0100 | [diff] [blame] | 805 | } |
| 806 | } |
| 807 | template RSL_Message ts_RSL_PAGING_LOAD_IND(uint16_t buffer_space) := { |
| 808 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false), |
| 809 | msg_type := RSL_MT_CCCH_LOAD_IND, |
| 810 | ies := { |
Harald Welte | 735dd07 | 2017-12-12 14:55:17 +0100 | [diff] [blame] | 811 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(0)}), |
| 812 | t_RSL_IE(RSL_IE_PAGING_LOAD, RSL_IE_Body:{paging_load := buffer_space}) |
Harald Welte | 7ae9314 | 2017-12-07 17:56:15 +0100 | [diff] [blame] | 813 | } |
| 814 | } |
| 815 | |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 816 | /* 8.5.3 BTS -> BSC */ |
Harald Welte | 101fbed | 2017-12-07 17:56:38 +0100 | [diff] [blame] | 817 | template RSL_Message ts_RSL_CHAN_RQD(OCT1 ra, GsmFrameNumber fn, uint8_t acc_del := 0) := { |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 818 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false), |
| 819 | msg_type := RSL_MT_CHAN_RQD, |
| 820 | ies := { |
Harald Welte | 735dd07 | 2017-12-12 14:55:17 +0100 | [diff] [blame] | 821 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := t_RslChanNr_RACH(0)}), |
| 822 | t_RSL_IE(RSL_IE_REQ_REFERENCE, RSL_IE_Body:{req_ref := ts_RSL_IE_ReqRef(ra, fn)}), |
| 823 | t_RSL_IE(RSL_IE_ACCESS_DELAY, RSL_IE_Body:{access_delay := acc_del}) |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 824 | } |
| 825 | } |
| 826 | |
| 827 | /* 8.5.4 BTS -> BSC */ |
| 828 | template RSL_Message ts_DELETE_IND(RslChannelNr chan_nr, octetstring imm_ass) := { |
| 829 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false), |
| 830 | msg_type := RSL_MT_DELETE_IND, |
| 831 | ies := { |
Harald Welte | 735dd07 | 2017-12-12 14:55:17 +0100 | [diff] [blame] | 832 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 833 | t_RSL_IE(RSL_IE_FULL_IMM_ASS_INFO, RSL_IE_Body:{full_imm_ass_info := ts_RSL_LV(imm_ass)}) |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 834 | } |
| 835 | } |
| 836 | |
Harald Welte | c287775 | 2017-12-07 17:54:35 +0100 | [diff] [blame] | 837 | /* 8.5.5 BSC -> BTS */ |
| 838 | template RSL_Message tr_RSL_PAGING_CMD(template octetstring identity, template uint3_t tn := ?) := { |
| 839 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false), |
| 840 | msg_type := RSL_MT_PAGING_CMD, |
| 841 | ies := { |
| 842 | tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(tn)}), |
| 843 | tr_RSL_IE(RSL_IE_Body:{paging_group := ?}), |
Harald Welte | 51d7410 | 2017-12-10 23:05:02 +0100 | [diff] [blame] | 844 | tr_RSL_IE(RSL_IE_Body:{ms_identity := tr_RSL_LV(identity)}), |
Harald Welte | c287775 | 2017-12-07 17:54:35 +0100 | [diff] [blame] | 845 | * /* opt: channel needed, eMLPP prio */ |
| 846 | } |
| 847 | } |
| 848 | |
| 849 | /* 8.5.6 BSC -> BTS */ |
| 850 | template RSL_Message tr_RSL_IMM_ASSIGN(template uint3_t tn := ?) := { |
| 851 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false), |
| 852 | msg_type := RSL_MT_IMMEDIATE_ASSIGN_CMD, |
| 853 | ies := { |
| 854 | tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(tn)}), |
| 855 | tr_RSL_IE(RSL_IE_Body:{full_imm_ass_info := ?}) |
| 856 | } |
| 857 | } |
| 858 | |
| 859 | |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 860 | /* 8.6.4 BTS -> BSC */ |
| 861 | template RSL_Message ts_RSL_ERROR_REPORT(RSL_Cause cause) := { |
| 862 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false), |
| 863 | msg_type := RSL_MT_ERROR_IND, |
| 864 | ies := { |
Harald Welte | 735dd07 | 2017-12-12 14:55:17 +0100 | [diff] [blame] | 865 | t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)}) |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 866 | } |
| 867 | } |
| 868 | |
| 869 | } with { encode "RAW" ; variant "FIELDORDER(msb)" } |