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 */ |
| 385 | type uint7_t RSL_Cause; |
| 386 | type record RSL_IE_Cause { |
Harald Welte | 6efa8e3 | 2017-12-09 22:34:06 +0100 | [diff] [blame] | 387 | uint8_t len, |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 388 | uint1_t e, |
| 389 | RSL_Cause cause, |
| 390 | octetstring cause_ext optional |
Harald Welte | 6efa8e3 | 2017-12-09 22:34:06 +0100 | [diff] [blame] | 391 | } with { variant (len) "LENGTHTO(e,cause,cause_ext)" } |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 392 | |
| 393 | template RSL_IE_Cause ts_RSL_IE_Cause(RSL_Cause cause) := { |
Harald Welte | 6efa8e3 | 2017-12-09 22:34:06 +0100 | [diff] [blame] | 394 | len := 0, /* overwritten */ |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 395 | e := 0, |
| 396 | cause := cause, |
| 397 | cause_ext := omit |
| 398 | } |
| 399 | |
| 400 | /* 9.3.40 */ |
| 401 | type enumerated RSL_ChanNeeded { |
| 402 | RSL_CHANNEED_ANY ('00'B), |
| 403 | RSL_CHANNEED_SDCCH ('01'B), |
| 404 | RSL_CHANNEED_TCH_F ('10'B), |
| 405 | RSL_CHANNEED_TCH_ForH ('11'B) |
Harald Welte | 51d7410 | 2017-12-10 23:05:02 +0100 | [diff] [blame] | 406 | } with { variant "FIELDLENGTH(2)" }; |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 407 | type record RSL_IE_ChanNeeded { |
| 408 | uint6_t reserved, |
| 409 | RSL_ChanNeeded chan_needed |
| 410 | } |
| 411 | |
| 412 | /* 9.3.53 */ |
| 413 | type record RSL_IE_MultirateCtrl { |
| 414 | uint3_t spare, |
| 415 | boolean od, |
| 416 | boolean pre, |
| 417 | uint2_t rae, |
| 418 | boolean tfo |
| 419 | } |
| 420 | |
| 421 | type enumerated RSL_IE_SysinfoType { |
| 422 | RSL_SYSTEM_INFO_8 ('00000000'B), |
| 423 | RSL_SYSTEM_INFO_1 ('00000001'B), |
| 424 | RSL_SYSTEM_INFO_2 ('00000010'B), |
| 425 | RSL_SYSTEM_INFO_3 ('00000011'B), |
| 426 | RSL_SYSTEM_INFO_4 ('00000100'B), |
| 427 | RSL_SYSTEM_INFO_5 ('00000101'B), |
| 428 | RSL_SYSTEM_INFO_6 ('00000110'B), |
| 429 | RSL_SYSTEM_INFO_7 ('00000111'B), |
| 430 | RSL_SYSTEM_INFO_16 ('00001000'B), |
| 431 | RSL_SYSTEM_INFO_17 ('00001001'B), |
| 432 | RSL_SYSTEM_INFO_2bis ('00001010'B), |
| 433 | RSL_SYSTEM_INFO_2ter ('00001011'B), |
| 434 | RSL_SYSTEM_INFO_5bis ('00001101'B), |
| 435 | RSL_SYSTEM_INFO_5ter ('00001110'B), |
| 436 | RSL_SYSTEM_INFO_10 ('00001111'B), |
| 437 | RSL_EXT_MEAS_ORDER ('01000111'B), |
| 438 | RSL_MEAS_INFO ('01001000'B), |
| 439 | RSL_SYSTEM_INFO_13 ('00101000'B), |
| 440 | RSL_ERIC_SYSTEM_INFO_13 ('00001100'B), |
| 441 | RSL_SYSTEM_INFO_2quater ('00101001'B), |
| 442 | RSL_SYSTEM_INFO_9 ('00101010'B), |
| 443 | RSL_SYSTEM_INFO_18 ('00101011'B), |
| 444 | RSL_SYSTEM_INFO_19 ('00101100'B), |
| 445 | RSL_SYSTEM_INFO_20 ('00101101'B) |
| 446 | } with { variant "FIELDLENGTH(8)" } |
| 447 | |
| 448 | /* union of all IE bodies */ |
| 449 | type union RSL_IE_Body { |
| 450 | RslChannelNr chan_nr, |
| 451 | RslLinkId link_id, |
Harald Welte | 15bb5b5 | 2017-12-07 17:52:04 +0100 | [diff] [blame] | 452 | RSL_L16V l3_info, |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 453 | RSL_LV rlm_cause, |
| 454 | uint8_t release_mode, |
| 455 | RSL_IE_ActivationType act_type, |
| 456 | RSL_IE_ChannelMode chan_mode, |
| 457 | uint8_t handover_ref, |
| 458 | RSL_IE_BS_Power bs_power, |
| 459 | RSL_IE_MS_Power ms_power, |
| 460 | uint8_t timing_adv, |
| 461 | RSL_IE_MultirateCtrl multirate_ctrl, |
| 462 | RSL_IE_FrameNumber frame_nr, |
| 463 | RSL_IE_Cause cause, |
| 464 | uint8_t access_delay, |
Harald Welte | d5f521e | 2017-12-07 17:53:06 +0100 | [diff] [blame] | 465 | RSL_IE_RachLoad rach_load, |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 466 | uint8_t meas_res_nr, |
| 467 | RSL_IE_L1Info l1_info, |
| 468 | RSL_IE_SysinfoType sysinfo_type, |
| 469 | uint16_t paging_load, |
| 470 | uint8_t paging_group, |
| 471 | RSL_IE_ChanNeeded chan_needed, |
| 472 | RSL_IE_StartingTime starting_time, |
| 473 | RSL_IE_RequestRef req_ref, |
| 474 | RSL_LV full_imm_ass_info, |
Harald Welte | fff6930 | 2017-12-07 17:53:42 +0100 | [diff] [blame] | 475 | RSL_LV ms_identity, |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 476 | |
| 477 | RSL_LV other |
| 478 | } |
| 479 | |
| 480 | type record RSL_IE { |
| 481 | RSL_IE_Type iei, |
| 482 | RSL_IE_Body body |
| 483 | } with { variant (body) "CROSSTAG( |
| 484 | chan_nr, iei = RSL_IE_CHAN_NR; |
| 485 | link_id, iei = RSL_IE_LINK_IDENT; |
| 486 | l3_info, iei = RSL_IE_L3_INFO; |
| 487 | rlm_cause, iei = RSL_IE_RLM_CAUSE; |
| 488 | release_mode, iei = RSL_IE_RELEASE_MODE; |
| 489 | act_type, iei = RSL_IE_ACT_TYPE; |
| 490 | chan_mode, iei = RSL_IE_CHAN_MODE; |
| 491 | handover_ref, iei = RSL_IE_HANDO_REF; |
| 492 | bs_power, iei = RSL_IE_BS_POWER; |
| 493 | ms_power, iei = RSL_IE_MS_POWER; |
| 494 | timing_adv, iei = RSL_IE_TIMING_ADVANCE; |
| 495 | multirate_ctrl, iei = RSL_IE_MR_CONTROL; |
| 496 | |
| 497 | frame_nr, iei = RSL_IE_FRAME_NUMBER; |
| 498 | cause, iei = RSL_IE_CAUSE; |
| 499 | access_delay, iei = RSL_IE_ACCESS_DELAY; |
Harald Welte | d5f521e | 2017-12-07 17:53:06 +0100 | [diff] [blame] | 500 | rach_load, iei = RSL_IE_RACH_LOAD; |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 501 | meas_res_nr, iei = RSL_IE_MEAS_RES_NR; |
| 502 | l1_info, iei = RSL_IE_L1_INFO; |
| 503 | sysinfo_type, iei = RSL_IE_SYSINFO_TYPE; |
| 504 | paging_load, iei = RSL_IE_PAGING_LOAD; |
| 505 | paging_group, iei = RSL_IE_PAGING_GROUP; |
| 506 | chan_needed, iei = RSL_IE_CHAN_NEEDED; |
| 507 | starting_time, iei = RSL_IE_STARTNG_TIME; |
| 508 | |
| 509 | req_ref, iei = RSL_IE_REQ_REFERENCE; |
Harald Welte | fff6930 | 2017-12-07 17:53:42 +0100 | [diff] [blame] | 510 | full_imm_ass_info, iei = RSL_IE_FULL_IMM_ASS_INFO; |
| 511 | ms_identity, iei = RSL_IE_MS_IDENTITY; |
| 512 | other, iei = RSL_IE_FULL_BCCH_INFO; |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 513 | |
| 514 | other, OTHERWISE; |
| 515 | )" }; |
| 516 | |
| 517 | template RSL_IE t_RSL_IE(template RSL_IE_Body body) := { |
| 518 | iei := RSL_IE_CHAN_NR, /* overwritten? */ |
| 519 | body := body |
| 520 | } |
| 521 | |
Harald Welte | c287775 | 2017-12-07 17:54:35 +0100 | [diff] [blame] | 522 | template RSL_IE tr_RSL_IE(template RSL_IE_Body body) := { |
| 523 | iei := ?, /* overwritten? */ |
| 524 | body := body |
| 525 | } |
| 526 | |
| 527 | |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 528 | type record of RSL_IE RSL_IE_List; |
| 529 | |
| 530 | type record RSL_Message { |
| 531 | RSL_MessageDiscriminator msg_disc, |
| 532 | RSL_MessageType msg_type, |
| 533 | RSL_IE_List ies optional |
| 534 | } |
| 535 | |
| 536 | external function enc_RSL_Message(in RSL_Message msg) return octetstring |
| 537 | with { extension "prototype(convert) encode(RAW)" }; |
| 538 | external function dec_RSL_Message(in octetstring stream) return RSL_Message |
| 539 | with { extension "prototype(convert) decode(RAW)" }; |
| 540 | |
Harald Welte | bc330be | 2017-12-09 00:56:36 +0100 | [diff] [blame] | 541 | template RSL_Message tr_RSL_MsgDiscType(template RSL_MessageDiscriminator m_disc, |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 542 | RSL_MessageType m_type) := { |
| 543 | msg_disc := m_disc, |
| 544 | msg_type := m_type, |
| 545 | ies := * |
| 546 | } |
| 547 | |
Harald Welte | 4a26736 | 2017-12-09 17:49:32 +0100 | [diff] [blame] | 548 | template RSL_Message ts_RSL_MsgDiscType(template RSL_MessageDiscriminator m_disc, |
| 549 | template RSL_MessageType msg_type, |
| 550 | template RSL_IE_List ies := omit) := { |
| 551 | msg_disc := m_disc, |
| 552 | msg_type := msg_type, |
| 553 | ies := ies |
| 554 | } |
| 555 | |
Harald Welte | bc330be | 2017-12-09 00:56:36 +0100 | [diff] [blame] | 556 | template RSL_Message tr_RSL_MsgType(template RSL_MessageType msg_type) := { |
| 557 | msg_disc := ?, |
| 558 | msg_type := msg_type, |
| 559 | ies := * |
| 560 | } |
| 561 | |
| 562 | /* Common Channel Management */ |
| 563 | template RSL_Message tr_RSL_MsgTypeC(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := { |
| 564 | msg_disc := { RSL_MDISC_CCHAN, ? } |
| 565 | } |
| 566 | |
| 567 | /* RLL */ |
| 568 | template RSL_Message tr_RSL_MsgTypeR(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := { |
| 569 | msg_disc := { RSL_MDISC_RLL, true } |
| 570 | } |
| 571 | |
| 572 | /* Dedicated Channel Management */ |
| 573 | template RSL_Message tr_RSL_MsgTypeD(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := { |
| 574 | msg_disc := { RSL_MDISC_DCHAN, ? } |
| 575 | } |
| 576 | |
| 577 | /* Dedicated Channel Management */ |
| 578 | template RSL_Message tr_RSL_MsgTypeT(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := { |
| 579 | msg_disc := { RSL_MDISC_TRX_MGMT, ? } |
| 580 | } |
| 581 | |
| 582 | |
| 583 | /* dedicated channel or RLL */ |
| 584 | template RSL_Message tr_RSL_MsgTypeDR(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := { |
| 585 | msg_disc := ({RSL_MDISC_DCHAN,?}, {RSL_MDISC_RLL,true}) |
| 586 | } |
| 587 | |
| 588 | |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 589 | /* 8.3.1 BSC -> BTS */ |
| 590 | template RSL_Message ts_RSL_DATA_REQ(RslChannelNr chan_nr, RslLinkId link_id, octetstring l3_info) := { |
| 591 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, true), |
| 592 | msg_type := RSL_MT_DATA_REQ, |
| 593 | ies :={ |
| 594 | t_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
| 595 | t_RSL_IE(RSL_IE_Body:{link_id := link_id}), |
Harald Welte | 15bb5b5 | 2017-12-07 17:52:04 +0100 | [diff] [blame] | 596 | t_RSL_IE(RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)}) |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 597 | } |
| 598 | } |
| 599 | |
| 600 | /* 8.3.2 BTS -> BSC */ |
| 601 | template RSL_Message ts_RSL_DATA_IND(RslChannelNr chan_nr, RslLinkId link_id, octetstring l3_info) := { |
| 602 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, true), |
| 603 | msg_type := RSL_MT_DATA_IND, |
| 604 | ies :={ |
| 605 | t_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
| 606 | t_RSL_IE(RSL_IE_Body:{link_id := link_id}), |
Harald Welte | 15bb5b5 | 2017-12-07 17:52:04 +0100 | [diff] [blame] | 607 | t_RSL_IE(RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)}) |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 608 | } |
| 609 | } |
| 610 | |
| 611 | /* 8.3.3 BTS -> BSC */ |
| 612 | template RSL_Message ts_RSL_ERROR_IND(RslChannelNr chan_nr, RslLinkId link_id, RSL_Cause cause) := { |
| 613 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false), |
| 614 | msg_type := RSL_MT_ERROR_IND, |
| 615 | ies :={ |
| 616 | t_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
| 617 | t_RSL_IE(RSL_IE_Body:{link_id := link_id}), |
| 618 | t_RSL_IE(RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)}) |
| 619 | } |
| 620 | } |
| 621 | |
| 622 | /* 8.3.6 BTS -> BSC */ |
| 623 | template RSL_Message ts_RSL_EST_IND(RslChannelNr chan_nr, RslLinkId link_id, octetstring l3_info) := { |
| 624 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false), |
| 625 | msg_type := RSL_MT_EST_IND, |
| 626 | ies := { |
| 627 | t_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
| 628 | t_RSL_IE(RSL_IE_Body:{link_id := link_id}), |
Harald Welte | 15bb5b5 | 2017-12-07 17:52:04 +0100 | [diff] [blame] | 629 | t_RSL_IE(RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)}) |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 630 | } |
| 631 | } |
| 632 | |
| 633 | /* 8.3.7 BSC -> BTS */ |
| 634 | template RSL_Message ts_RSL_REL_REQ(RslChannelNr chan_nr, RslLinkId link_id) := { |
| 635 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false), |
| 636 | msg_type := RSL_MT_REL_REQ, |
| 637 | ies :={ |
| 638 | t_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
| 639 | t_RSL_IE(RSL_IE_Body:{link_id := link_id}) |
| 640 | } |
| 641 | } |
Harald Welte | e8a5ab1 | 2017-12-09 22:34:57 +0100 | [diff] [blame] | 642 | template RSL_Message tr_RSL_REL_REQ(template RslChannelNr chan_nr, |
| 643 | template RslLinkId link_id) := { |
| 644 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false), |
| 645 | msg_type := RSL_MT_REL_REQ, |
| 646 | ies :={ |
| 647 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
| 648 | tr_RSL_IE(RSL_IE_Body:{link_id := link_id}), |
| 649 | * |
| 650 | } |
| 651 | } |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 652 | |
| 653 | /* 8.3.8 BTS -> BSC */ |
| 654 | template RSL_Message ts_RSL_REL_CONF(RslChannelNr chan_nr, RslLinkId link_id) := { |
| 655 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false), |
| 656 | msg_type := RSL_MT_REL_CONF, |
| 657 | ies :={ |
| 658 | t_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
| 659 | t_RSL_IE(RSL_IE_Body:{link_id := link_id}) |
| 660 | } |
| 661 | } |
| 662 | |
| 663 | /* 8.3.9 BTS -> BSC */ |
| 664 | template RSL_Message ts_RSL_REL_IND(RslChannelNr chan_nr, RslLinkId link_id) := { |
| 665 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false), |
| 666 | msg_type := RSL_MT_REL_IND, |
| 667 | ies :={ |
| 668 | t_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
| 669 | t_RSL_IE(RSL_IE_Body:{link_id := link_id}) |
| 670 | } |
| 671 | } |
| 672 | |
| 673 | /* 8.3.10 BSC -> BTS */ |
| 674 | template RSL_Message ts_RSL_UNITDATA_REQ(RslChannelNr chan_nr, RslLinkId link_id, octetstring l3_info) |
| 675 | modifies ts_RSL_DATA_REQ := { |
| 676 | msg_type := RSL_MT_UNIT_DATA_REQ |
| 677 | } |
| 678 | |
| 679 | /* 8.3.11 BTS -> BSC */ |
| 680 | template RSL_Message ts_RSL_UNITDATA_IND(RslChannelNr chan_nr, RslLinkId link_id, octetstring l3_info) |
| 681 | modifies ts_RSL_DATA_IND := { |
| 682 | msg_type := RSL_MT_UNIT_DATA_IND |
| 683 | } |
| 684 | |
| 685 | |
| 686 | /* DEDICATED CANNEL MANAGEMENT MESSAGES */ |
| 687 | |
| 688 | /* 8.4.1 BSC -> BTS */ |
| 689 | template RSL_Message ts_RSL_CHAN_ACT(RslChannelNr chan_nr, RSL_IE_ChannelMode mode) := { |
| 690 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
| 691 | msg_type := RSL_MT_CHAN_ACTIV, |
| 692 | ies :={ |
| 693 | t_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
| 694 | t_RSL_IE(RSL_IE_Body:{act_type := t_RSL_IE_ActType}), |
| 695 | t_RSL_IE(RSL_IE_Body:{chan_mode := mode}) |
| 696 | /* lots of optional IEs */ |
| 697 | } |
| 698 | } |
| 699 | |
| 700 | /* 8.4.2 BTS -> BSC */ |
| 701 | template RSL_Message ts_RSL_CHAN_ACT_ACK(RslChannelNr chan_nr, GsmFrameNumber fn) := { |
| 702 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
| 703 | msg_type := RSL_MT_CHAN_ACTIV_ACK, |
| 704 | ies :={ |
| 705 | t_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
| 706 | t_RSL_IE(RSL_IE_Body:{frame_nr := ts_RSL_IE_FrameNumber(fn)}) |
| 707 | } |
| 708 | } |
| 709 | |
| 710 | /* 8.4.3 BTS -> BSC */ |
| 711 | template RSL_Message ts_RSL_CHAN_ACT_NACK(RslChannelNr chan_nr, RSL_Cause cause) := { |
| 712 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
| 713 | msg_type := RSL_MT_CHAN_ACTIV_NACK, |
| 714 | ies :={ |
| 715 | t_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
| 716 | t_RSL_IE(RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)}) |
| 717 | } |
| 718 | } |
| 719 | |
| 720 | /* 8.4.4 BTS -> BSC */ |
| 721 | template RSL_Message ts_RSL_CONN_FAIL_IND(RslChannelNr chan_nr, RSL_Cause cause) := { |
| 722 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
| 723 | msg_type := RSL_MT_CONN_FAIL, |
| 724 | ies :={ |
| 725 | t_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
| 726 | t_RSL_IE(RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)}) |
| 727 | } |
| 728 | } |
| 729 | |
Harald Welte | e8a5ab1 | 2017-12-09 22:34:57 +0100 | [diff] [blame] | 730 | /* 8.4.5 BSC -> BTS */ |
| 731 | template RSL_Message tr_RSL_DEACT_SACCH(template RslChannelNr chan_nr) := { |
| 732 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
| 733 | msg_type := RSL_MT_DEACTIVATE_SACCH, |
| 734 | ies := { |
| 735 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}) |
| 736 | } |
| 737 | } |
| 738 | |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 739 | /* 8.4.11 BTS -> BSC */ |
| 740 | template RSL_Message ts_RSL_MODE_MODIFY_NACK(RslChannelNr chan_nr, RSL_Cause cause) |
| 741 | modifies ts_RSL_CHAN_ACT_NACK := { |
| 742 | msg_type := RSL_MT_MODE_MODIFY_NACK |
| 743 | } |
| 744 | |
Harald Welte | 4a26736 | 2017-12-09 17:49:32 +0100 | [diff] [blame] | 745 | /* 8.4.19 BTS -> BSC */ |
| 746 | template RSL_Message ts_RSL_RF_CHAN_REL_ACK(RslChannelNr chan_nr) := |
| 747 | ts_RSL_MsgDiscType(ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
| 748 | RSL_MT_RF_CHAN_REL_ACK, |
| 749 | { t_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}) }); |
| 750 | |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 751 | /* COMMON CHANNEL MANAGEMENT MESSAGES */ |
| 752 | |
Harald Welte | 7ae9314 | 2017-12-07 17:56:15 +0100 | [diff] [blame] | 753 | /* 8.5.2 BTS -> BSC */ |
| 754 | template RSL_Message ts_RSL_RACH_LOAD_IND(uint16_t slot_ct, uint16_t busy_ct, uint16_t acc_ct) := { |
| 755 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false), |
| 756 | msg_type := RSL_MT_CCCH_LOAD_IND, |
| 757 | ies := { |
| 758 | t_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_RACH(0)}), |
| 759 | t_RSL_IE(RSL_IE_Body:{rach_load := ts_RSL_IE_RachLoad(slot_ct, busy_ct, acc_ct)}) |
| 760 | } |
| 761 | } |
| 762 | template RSL_Message ts_RSL_PAGING_LOAD_IND(uint16_t buffer_space) := { |
| 763 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false), |
| 764 | msg_type := RSL_MT_CCCH_LOAD_IND, |
| 765 | ies := { |
| 766 | t_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(0)}), |
| 767 | t_RSL_IE(RSL_IE_Body:{paging_load := buffer_space}) |
| 768 | } |
| 769 | } |
| 770 | |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 771 | /* 8.5.3 BTS -> BSC */ |
Harald Welte | 101fbed | 2017-12-07 17:56:38 +0100 | [diff] [blame] | 772 | 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] | 773 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false), |
| 774 | msg_type := RSL_MT_CHAN_RQD, |
| 775 | ies := { |
| 776 | t_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_RACH(0)}), |
Harald Welte | 101fbed | 2017-12-07 17:56:38 +0100 | [diff] [blame] | 777 | t_RSL_IE(RSL_IE_Body:{req_ref := ts_RSL_IE_ReqRef(ra, fn)}), |
| 778 | t_RSL_IE(RSL_IE_Body:{access_delay := acc_del}) |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 779 | } |
| 780 | } |
| 781 | |
| 782 | /* 8.5.4 BTS -> BSC */ |
| 783 | template RSL_Message ts_DELETE_IND(RslChannelNr chan_nr, octetstring imm_ass) := { |
| 784 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false), |
| 785 | msg_type := RSL_MT_DELETE_IND, |
| 786 | ies := { |
| 787 | t_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
| 788 | t_RSL_IE(RSL_IE_Body:{full_imm_ass_info := ts_RSL_LV(imm_ass)}) |
| 789 | } |
| 790 | } |
| 791 | |
Harald Welte | c287775 | 2017-12-07 17:54:35 +0100 | [diff] [blame] | 792 | /* 8.5.5 BSC -> BTS */ |
| 793 | template RSL_Message tr_RSL_PAGING_CMD(template octetstring identity, template uint3_t tn := ?) := { |
| 794 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false), |
| 795 | msg_type := RSL_MT_PAGING_CMD, |
| 796 | ies := { |
| 797 | tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(tn)}), |
| 798 | tr_RSL_IE(RSL_IE_Body:{paging_group := ?}), |
Harald Welte | 51d7410 | 2017-12-10 23:05:02 +0100 | [diff] [blame] | 799 | tr_RSL_IE(RSL_IE_Body:{ms_identity := tr_RSL_LV(identity)}), |
Harald Welte | c287775 | 2017-12-07 17:54:35 +0100 | [diff] [blame] | 800 | * /* opt: channel needed, eMLPP prio */ |
| 801 | } |
| 802 | } |
| 803 | |
| 804 | /* 8.5.6 BSC -> BTS */ |
| 805 | template RSL_Message tr_RSL_IMM_ASSIGN(template uint3_t tn := ?) := { |
| 806 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false), |
| 807 | msg_type := RSL_MT_IMMEDIATE_ASSIGN_CMD, |
| 808 | ies := { |
| 809 | tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(tn)}), |
| 810 | tr_RSL_IE(RSL_IE_Body:{full_imm_ass_info := ?}) |
| 811 | } |
| 812 | } |
| 813 | |
| 814 | |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 815 | /* 8.6.4 BTS -> BSC */ |
| 816 | template RSL_Message ts_RSL_ERROR_REPORT(RSL_Cause cause) := { |
| 817 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false), |
| 818 | msg_type := RSL_MT_ERROR_IND, |
| 819 | ies := { |
| 820 | t_RSL_IE(RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)}) |
| 821 | } |
| 822 | } |
| 823 | |
| 824 | } with { encode "RAW" ; variant "FIELDORDER(msb)" } |