Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 1 | module RSL_Types { |
| 2 | |
Harald Welte | 35bb716 | 2018-01-03 21:07:52 +0100 | [diff] [blame] | 3 | /* GSUP_Types, defining abstract TTCN-3 data types for the A-bis RSL protocol. |
| 4 | * |
| 5 | * RSL is a 3GPP standard protocol used between BTS and BSC in a GSM network. |
| 6 | * |
| 7 | * (C) 2017 by Harald Welte <laforge@gnumonks.org> |
| 8 | * All rights reserved. |
| 9 | * |
| 10 | * Released under the terms of GNU General Public License, Version 2 or |
| 11 | * (at your option) any later version. |
| 12 | */ |
| 13 | |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 14 | import from General_Types all; |
| 15 | import from Osmocom_Types all; |
| 16 | import from GSM_Types all; |
| 17 | |
| 18 | /* Section 9.1 */ |
| 19 | type enumerated RSL_MessageGroup { |
| 20 | RSL_MDISC_RESERVED ('0000000'B), |
| 21 | RSL_MDISC_RLL ('0000001'B), |
| 22 | RSL_MDISC_DCHAN ('0000100'B), |
| 23 | RSL_MDISC_CCHAN ('0000110'B), |
| 24 | RSL_MDISC_TRX_MGMT ('0001000'B), |
| 25 | RSL_MDISC_LCS ('0010000'B), |
| 26 | RSL_MDISC_IPACCESS ('0111111'B) |
| 27 | } with { variant "FIELDLENGTH(7)" }; |
| 28 | |
| 29 | /* Section 9.1 */ |
| 30 | type record RSL_MessageDiscriminator { |
| 31 | RSL_MessageGroup msg_group, |
| 32 | boolean transparent |
| 33 | } with { variant "FIELDORDER(msb)" }; |
| 34 | |
| 35 | template RSL_MessageDiscriminator ts_RSL_MsgDisc(RSL_MessageGroup mg, boolean t := true) := { |
| 36 | msg_group := mg, |
| 37 | transparent := t |
| 38 | } |
| 39 | |
| 40 | /* Section 9.2 */ |
| 41 | type enumerated RSL_MessageType { |
| 42 | /* Radio Link Layer Management */ |
| 43 | RSL_MT_DATA_REQ ('00000001'B), |
| 44 | RSL_MT_DATA_IND ('00000010'B), |
| 45 | RSL_MT_ERROR_IND ('00000011'B), |
| 46 | RSL_MT_EST_REQ ('00000100'B), |
| 47 | RSL_MT_EST_CONF ('00000101'B), |
| 48 | RSL_MT_EST_IND ('00000110'B), |
| 49 | RSL_MT_REL_REQ ('00000111'B), |
| 50 | RSL_MT_REL_CONF ('00001000'B), |
| 51 | RSL_MT_REL_IND ('00001001'B), |
| 52 | RSL_MT_UNIT_DATA_REQ ('00001010'B), |
| 53 | RSL_MT_UNIT_DATA_IND ('00001011'B), |
| 54 | |
| 55 | /* non-standard below */ |
| 56 | RSL_MT_SUSP_REQ ('00001100'B), |
| 57 | RSL_MT_SUSP_CONF ('00001101'B), |
| 58 | RSL_MT_RES_REQ ('00001110'B), |
| 59 | RSL_MT_RECON_REQ ('00001111'B), |
| 60 | |
| 61 | /* Common Channel Management / TRX Management */ |
| 62 | RSL_MT_BCCH_INFO ('00010001'B), |
Harald Welte | 319be82 | 2017-12-07 17:50:26 +0100 | [diff] [blame] | 63 | RSL_MT_CCCH_LOAD_IND ('00010010'B), |
| 64 | RSL_MT_CHAN_RQD ('00010011'B), |
| 65 | RSL_MT_DELETE_IND ('00010100'B), |
| 66 | RSL_MT_PAGING_CMD ('00010101'B), |
| 67 | RSL_MT_IMMEDIATE_ASSIGN_CMD ('00010110'B), |
| 68 | RSL_MT_SMS_BC_REQ ('00010111'B), |
| 69 | RSL_MT_CHAN_CONF ('00011000'B), /* non-standard element */ |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 70 | /* empty */ |
| 71 | RSL_MT_RF_RES_IND ('00011001'B), |
Harald Welte | 319be82 | 2017-12-07 17:50:26 +0100 | [diff] [blame] | 72 | RSL_MT_SACCH_FILL ('00011010'B), |
| 73 | RSL_MT_OVERLOAD ('00011011'B), |
| 74 | RSL_MT_ERROR_REPORT ('00011100'B), |
| 75 | RSL_MT_SMS_BC_CMD ('00011101'B), |
| 76 | RSL_MT_CBCH_LOAD_IND ('00011110'B), |
| 77 | RSL_MT_NOT_CMD ('00011111'B), |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 78 | |
| 79 | /* Dedicate Channel Management */ |
| 80 | RSL_MT_CHAN_ACTIV ('00100001'B), |
Harald Welte | 319be82 | 2017-12-07 17:50:26 +0100 | [diff] [blame] | 81 | RSL_MT_CHAN_ACTIV_ACK ('00100010'B), |
| 82 | RSL_MT_CHAN_ACTIV_NACK ('00100011'B), |
| 83 | RSL_MT_CONN_FAIL ('00100100'B), |
| 84 | RSL_MT_DEACTIVATE_SACCH ('00100101'B), |
| 85 | RSL_MT_ENCR_CMD ('00100110'B), |
| 86 | RSL_MT_HANDO_DET ('00100111'B), |
| 87 | RSL_MT_MEAS_RES ('00101000'B), |
| 88 | RSL_MT_MODE_MODIFY_REQ ('00101001'B), |
| 89 | RSL_MT_MODE_MODIFY_ACK ('00101010'B), |
| 90 | RSL_MT_MODE_MODIFY_NACK ('00101011'B), |
| 91 | RSL_MT_PHY_CONTEXT_REQ ('00101100'B), |
| 92 | RSL_MT_PHY_CONTEXT_CONF ('00101101'B), |
| 93 | RSL_MT_RF_CHAN_REL ('00101110'B), |
| 94 | RSL_MT_MS_POWER_CONTROL ('00101111'B), |
| 95 | RSL_MT_BS_POWER_CONTROL ('00110000'B), /* 0x30 */ |
| 96 | RSL_MT_PREPROC_CONFIG ('00110001'B), |
| 97 | RSL_MT_PREPROC_MEAS_RES ('00110010'B), |
| 98 | RSL_MT_RF_CHAN_REL_ACK ('00110011'B), |
| 99 | RSL_MT_SACCH_INFO_MODIFY('00110100'B), |
| 100 | RSL_MT_TALKER_DET ('00110101'B), |
| 101 | RSL_MT_LISTENER_DET ('00110110'B), |
| 102 | RSL_MT_REMOTE_CODEC_CONF_REP ('00110111'B), |
| 103 | RSL_MT_RTD_REP ('00111000'B), |
| 104 | RSL_MT_PRE_HANDO_NOTIF ('00111001'B), |
| 105 | RSL_MT_MR_CODEC_MOD_REQ ('00111010'B), |
| 106 | RSL_MT_MR_CODEC_MOD_ACK ('00111011'B), |
| 107 | RSL_MT_MR_CODEC_MOD_NACK ('00111100'B), |
| 108 | RSL_MT_MR_CODEC_MOD_PER ('00111101'B), |
| 109 | RSL_MT_TFO_REP ('00111110'B), |
| 110 | RSL_MT_TFO_MOD_REQ ('00111111'B), /* 0x3f */ |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 111 | |
| 112 | RSL_MT_LOCATION_INFO ('01000001'B), |
| 113 | |
| 114 | /* ip.access specific RSL message types */ |
| 115 | RSL_MT_IPAC_DIR_RETR_ENQ ('01000000'B), |
| 116 | |
| 117 | RSL_MT_IPAC_PDCH_ACT ('01001000'B), |
Harald Welte | 319be82 | 2017-12-07 17:50:26 +0100 | [diff] [blame] | 118 | RSL_MT_IPAC_PDCH_ACT_ACK ('01001001'B), |
| 119 | RSL_MT_IPAC_PDCH_ACT_NACK ('01001010'B), |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 120 | RSL_MT_IPAC_PDCH_DEACT ('01001011'B), |
Harald Welte | 319be82 | 2017-12-07 17:50:26 +0100 | [diff] [blame] | 121 | RSL_MT_IPAC_PDCH_DEACT_ACK ('01001100'B), |
| 122 | RSL_MT_IPAC_PDCH_DEACT_NACK ('01001101'B), |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 123 | |
| 124 | RSL_MT_IPAC_CONNECT_MUX ('01010000'B), |
Harald Welte | f307500 | 2017-12-16 22:31:41 +0100 | [diff] [blame] | 125 | RSL_MT_IPAC_CONNECT_MUX_ACK ('01010001'B), |
| 126 | RSL_MT_IPAC_CONNECT_MUX_NACK ('01010010'B), |
| 127 | RSL_MT_IPAC_BIND_MUX ('01010011'B), |
| 128 | RSL_MT_IPAC_BIND_MUX_ACK ('01010100'B), |
| 129 | RSL_MT_IPAC_BIND_MUX_NACK ('01010101'B), |
| 130 | RSL_MT_IPAC_DISC_MUX ('01010110'B), |
| 131 | RSL_MT_IPAC_DISC_MUX_ACK ('01010111'B), |
| 132 | RSL_MT_IPAC_DISC_MUX_NACK ('01011000'B), |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 133 | RSL_MT_IPAC_MEAS_PREPROC_DFT ('01100000'B), |
Harald Welte | f307500 | 2017-12-16 22:31:41 +0100 | [diff] [blame] | 134 | RSL_MT_IPAC_HO_CAN_ENQ ('01100001'B), |
| 135 | RSL_MT_IPAC_HO_CAN_RES ('01100010'B), |
| 136 | RSL_MT_IPAC_CRCX ('01110000'B), |
| 137 | RSL_MT_IPAC_CRCX_ACK ('01110001'B), |
| 138 | RSL_MT_IPAC_CRCX_NACK ('01110010'B), |
| 139 | RSL_MT_IPAC_MDCX ('01110011'B), |
| 140 | RSL_MT_IPAC_MDCX_ACK ('01110100'B), |
| 141 | RSL_MT_IPAC_MDCX_NACK ('01110101'B), |
| 142 | RSL_MT_IPAC_DLCX_IND ('01110110'B), |
| 143 | RSL_MT_IPAC_DLCX ('01110111'B), |
| 144 | RSL_MT_IPAC_DLCX_ACK ('01111000'B), |
| 145 | RSL_MT_IPAC_DLCX_NACK ('01111001'B) |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 146 | } with { variant "FIELDLENGTH(8)" }; |
| 147 | |
| 148 | /*! RSL Information Element Identifiers (Chapter 9.3) */ |
| 149 | type enumerated RSL_IE_Type { |
| 150 | RSL_IE_CHAN_NR ('00000001'B), |
Harald Welte | 319be82 | 2017-12-07 17:50:26 +0100 | [diff] [blame] | 151 | RSL_IE_LINK_IDENT ('00000010'B), |
| 152 | RSL_IE_ACT_TYPE ('00000011'B), |
| 153 | RSL_IE_BS_POWER ('00000100'B), |
| 154 | RSL_IE_CHAN_IDENT ('00000101'B), |
| 155 | RSL_IE_CHAN_MODE ('00000110'B), |
| 156 | RSL_IE_ENCR_INFO ('00000111'B), |
| 157 | RSL_IE_FRAME_NUMBER ('00001000'B), |
| 158 | RSL_IE_HANDO_REF ('00001001'B), |
| 159 | RSL_IE_L1_INFO ('00001010'B), |
| 160 | RSL_IE_L3_INFO ('00001011'B), |
| 161 | RSL_IE_MS_IDENTITY ('00001100'B), |
| 162 | RSL_IE_MS_POWER ('00001101'B), |
| 163 | RSL_IE_PAGING_GROUP ('00001110'B), |
| 164 | RSL_IE_PAGING_LOAD ('00001111'B), |
| 165 | RSL_IE_PYHS_CONTEXT ('00010000'B), |
| 166 | RSL_IE_ACCESS_DELAY ('00010001'B), |
| 167 | RSL_IE_RACH_LOAD ('00010010'B), |
| 168 | RSL_IE_REQ_REFERENCE ('00010011'B), |
| 169 | RSL_IE_RELEASE_MODE ('00010100'B), |
| 170 | RSL_IE_RESOURCE_INFO ('00010101'B), |
| 171 | RSL_IE_RLM_CAUSE ('00010110'B), |
| 172 | RSL_IE_STARTNG_TIME ('00010111'B), |
| 173 | RSL_IE_TIMING_ADVANCE ('00011000'B), |
| 174 | RSL_IE_UPLINK_MEAS ('00011001'B), |
| 175 | RSL_IE_CAUSE ('00011010'B), |
| 176 | RSL_IE_MEAS_RES_NR ('00011011'B), |
| 177 | RSL_IE_MSG_ID ('00011100'B), |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 178 | /* reserved */ |
| 179 | RSL_IE_SYSINFO_TYPE ('00011110'B), |
Harald Welte | 319be82 | 2017-12-07 17:50:26 +0100 | [diff] [blame] | 180 | RSL_IE_MS_POWER_PARAM ('00011111'B), |
| 181 | RSL_IE_BS_POWER_PARAM ('00100000'B), |
| 182 | RSL_IE_PREPROC_PARAM ('00100001'B), |
| 183 | RSL_IE_PREPROC_MEAS ('00100010'B), |
| 184 | RSL_IE_IMM_ASS_INFO ('00100011'B),/* Phase 1 (3.6.0), later Full below */ |
| 185 | RSL_IE_SMSCB_INFO ('00100100'B), |
| 186 | RSL_IE_MS_TIMING_OFFSET ('00100101'B), |
| 187 | RSL_IE_ERR_MSG ('00100110'B), |
| 188 | RSL_IE_FULL_BCCH_INFO ('00100111'B), |
| 189 | RSL_IE_CHAN_NEEDED ('00101000'B), |
| 190 | RSL_IE_CB_CMD_TYPE ('00101001'B), |
| 191 | RSL_IE_SMSCB_MSG ('00101010'B), |
| 192 | RSL_IE_FULL_IMM_ASS_INFO ('00101011'B), |
| 193 | RSL_IE_SACCH_INFO ('00101100'B), |
| 194 | RSL_IE_CBCH_LOAD_INFO ('00101101'B), |
| 195 | RSL_IE_SMSCB_CHAN_INDICATOR ('00101110'B), |
| 196 | RSL_IE_GROUP_CALL_REF ('00101111'B), |
| 197 | RSL_IE_CHAN_DESC ('00110000'B), |
| 198 | RSL_IE_NCH_DRX_INFO ('00110001'B), |
| 199 | RSL_IE_CMD_INDICATOR ('00110010'B), |
| 200 | RSL_IE_EMLPP_PRIO ('00110011'B), |
| 201 | RSL_IE_UIC ('00110100'B), |
| 202 | RSL_IE_MAIN_CHAN_REF ('00110101'B), |
| 203 | RSL_IE_MR_CONFIG ('00110110'B), |
| 204 | RSL_IE_MR_CONTROL ('00110111'B), |
| 205 | RSL_IE_SUP_CODEC_TYPES ('00111000'B), |
| 206 | RSL_IE_CODEC_CONFIG ('00111001'B), |
| 207 | RSL_IE_RTD ('00111010'B), |
| 208 | RSL_IE_TFO_STATUS ('00111011'B), |
| 209 | RSL_IE_LLP_APDU ('00111100'B), |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 210 | |
| 211 | /* ip.access */ |
| 212 | RSL_IE_IPAC_SRTP_CONFIG ('11100000'B), |
Harald Welte | 319be82 | 2017-12-07 17:50:26 +0100 | [diff] [blame] | 213 | RSL_IE_IPAC_PROXY_UDP ('11100001'B), |
| 214 | RSL_IE_IPAC_BSCMPL_TOUT ('11100010'B), |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 215 | |
| 216 | RSL_IE_IPAC_REMOTE_IP ('11110000'B), |
Harald Welte | 319be82 | 2017-12-07 17:50:26 +0100 | [diff] [blame] | 217 | RSL_IE_IPAC_REMOTE_PORT ('11110001'B), |
| 218 | RSL_IE_IPAC_RTP_PAYLOAD ('11110010'B), |
| 219 | RSL_IE_IPAC_LOCAL_PORT ('11110011'B), |
| 220 | RSL_IE_IPAC_SPEECH_MODE ('11110100'B), |
| 221 | RSL_IE_IPAC_LOCAL_IP ('11110101'B), |
| 222 | RSL_IE_IPAC_CONN_STAT ('11110110'B), |
| 223 | RSL_IE_IPAC_HO_C_PARMS ('11110111'B), |
| 224 | RSL_IE_IPAC_CONN_ID ('11111000'B), |
| 225 | RSL_IE_IPAC_RTP_CSD_FMT ('11111001'B), |
| 226 | RSL_IE_IPAC_RTP_JIT_BUF ('11111010'B), |
| 227 | RSL_IE_IPAC_RTP_COMPR ('11111011'B), |
| 228 | RSL_IE_IPAC_RTP_PAYLOAD2 ('11111100'B), |
| 229 | RSL_IE_IPAC_RTP_MPLEX ('11111101'B), |
| 230 | RSL_IE_IPAC_RTP_MPLEX_ID ('11111110'B) |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 231 | } with { variant "FIELDLENGTH(8)" }; |
| 232 | |
| 233 | type record RSL_LV { |
| 234 | uint8_t len, |
| 235 | octetstring payload |
| 236 | } with { variant (len) "LENGTHTO(payload)" } |
| 237 | |
| 238 | template RSL_LV ts_RSL_LV(template octetstring pl) := { |
| 239 | len := 0, |
| 240 | payload := pl |
| 241 | } |
| 242 | |
Harald Welte | 51d7410 | 2017-12-10 23:05:02 +0100 | [diff] [blame] | 243 | template RSL_LV tr_RSL_LV(template octetstring pl) := { |
| 244 | len := ?, |
| 245 | payload := pl |
| 246 | } |
| 247 | |
Harald Welte | 15bb5b5 | 2017-12-07 17:52:04 +0100 | [diff] [blame] | 248 | type record RSL_L16V { |
| 249 | uint16_t len, |
| 250 | octetstring payload |
| 251 | } with { variant (len) "LENGTHTO(payload)" } |
| 252 | |
| 253 | template RSL_L16V ts_RSL_L16V(template octetstring pl) := { |
| 254 | len := 0, |
| 255 | payload := pl |
| 256 | } |
| 257 | |
Harald Welte | 7794d5b | 2017-12-16 23:00:20 +0100 | [diff] [blame] | 258 | template RSL_L16V tr_RSL_L16V(template octetstring pl) := { |
| 259 | len := ?, |
| 260 | payload := pl |
| 261 | } |
| 262 | |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 263 | type record RSL_IE_V { |
| 264 | uint8_t val |
| 265 | } |
| 266 | |
| 267 | /* 9.3.3 */ |
| 268 | type record RSL_IE_ActivationType { |
| 269 | boolean reactivation, |
| 270 | uint4_t reserved, |
| 271 | uint3_t a_bits |
| 272 | } |
| 273 | |
| 274 | template RSL_IE_ActivationType t_RSL_IE_ActType := { |
| 275 | reactivation := false, |
| 276 | reserved := 0, |
| 277 | a_bits := 0 /* related to immediate assignment */ |
| 278 | } |
| 279 | |
| 280 | /* 9.3.6 */ |
| 281 | type enumerated RSL_SpeechDataInd { |
| 282 | RSL_SPDI_SPEECH ('00000001'B), |
| 283 | RSL_SPDI_DATA ('00000010'B), |
| 284 | RSL_SPDI_SIGN ('00000011'B) |
| 285 | } with { variant "FIELDLENGTH(8)" }; |
| 286 | type enumerated RSL_ChanRateType { |
| 287 | RSL_CHRT_SDCCH ('00000001'B), |
| 288 | RSL_CHRT_TCH_F ('00001000'B), |
| 289 | RSL_CHRT_TCH_H ('00001001'B), |
| 290 | RSL_CHRT_TCH_F_BD_MSLOT ('00001010'B), |
| 291 | RSL_CHRT_TCH_F_DL_MSLOT ('00011010'B), |
| 292 | RSL_CHRT_TCH_F_GROUP ('00011000'B), |
| 293 | RSL_CHRT_TCH_H_GROUP ('00011001'B), |
| 294 | RSL_CHRT_TCH_F_BCAST ('00101000'B), |
| 295 | RSL_CHRT_TCH_H_BCAST ('00101001'B) |
| 296 | } with { variant "FIELDLENGTH(8)" }; |
| 297 | type enumerated RSL_SpeechAlgo { |
| 298 | RSL_CMOD_NO_RESOURCE ('00000000'B), |
| 299 | RSL_CMOD_SP_GSM1 ('00000001'B), |
| 300 | RSL_CMOD_SP_GSM2 ('00010001'B), |
| 301 | RSL_CMOD_SP_GSM3 ('00100001'B), |
| 302 | RSL_CMOD_SP_GSM4 ('00110001'B), |
| 303 | RSL_CMOD_SP_GSM5 ('00001001'B), |
| 304 | RSL_CMOD_SP_GSM6 ('00001101'B) |
| 305 | } with { variant "FIELDLENGTH(8)" }; |
| 306 | type record RSL_IE_ChannelMode { |
Harald Welte | 8f2c21d | 2017-12-07 17:52:40 +0100 | [diff] [blame] | 307 | uint8_t len, |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 308 | BIT6 reserved, |
| 309 | boolean dtx_d, |
| 310 | boolean dtx_u, |
| 311 | RSL_SpeechDataInd spd_ind, |
| 312 | RSL_ChanRateType ch_rate_type, |
| 313 | RSL_SpeechAlgo coding_alg_rate |
Harald Welte | 8f2c21d | 2017-12-07 17:52:40 +0100 | [diff] [blame] | 314 | } 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] | 315 | |
| 316 | template RSL_IE_ChannelMode ts_RSL_ChanMode_SIGN := { |
Harald Welte | 8f2c21d | 2017-12-07 17:52:40 +0100 | [diff] [blame] | 317 | len := 0, /* overwritten */ |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 318 | reserved := '000000'B, |
| 319 | dtx_d := false, |
| 320 | dtx_u := false, |
| 321 | spd_ind := RSL_SPDI_SIGN, |
| 322 | ch_rate_type := RSL_CHRT_SDCCH, |
| 323 | coding_alg_rate := RSL_CMOD_NO_RESOURCE |
| 324 | } |
| 325 | |
| 326 | 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] | 327 | len := 0, /* overwritten */ |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 328 | reserved := '000000'B, |
| 329 | dtx_d := false, |
| 330 | dtx_u := false, |
| 331 | spd_ind := RSL_SPDI_SPEECH, |
| 332 | ch_rate_type := t, |
| 333 | coding_alg_rate := alg |
| 334 | } |
| 335 | |
| 336 | /* 9.3.4 */ |
| 337 | type record RSL_IE_BS_Power { |
| 338 | uint1_t reserved, |
| 339 | boolean epc, |
| 340 | boolean fpc, |
| 341 | uint5_t power_level |
| 342 | } |
| 343 | |
Harald Welte | 73cd271 | 2017-12-17 00:44:52 +0100 | [diff] [blame] | 344 | /* 9.3.7 */ |
| 345 | type record RSL_IE_EncryptionInfo { |
| 346 | uint8_t len, |
| 347 | OCT1 alg_id, |
| 348 | octetstring key |
| 349 | } with { variant (len) "LENGTHTO(alg_id,key)" }; |
| 350 | |
| 351 | template RSL_IE_EncryptionInfo tr_RSL_IE_EncrInfo(template OCT1 alg, template octetstring key) := { |
| 352 | len := ?, |
| 353 | alg_id := alg, |
| 354 | key := key |
| 355 | } |
| 356 | |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 357 | /* 9.3.8 */ |
| 358 | type record RSL_IE_FrameNumber { |
| 359 | uint5_t t1_p, |
| 360 | uint6_t t3, |
| 361 | uint5_t t2 |
| 362 | } |
| 363 | type RSL_IE_FrameNumber RSL_IE_StartingTime; |
| 364 | |
| 365 | /* 9.3.10 */ |
| 366 | type record RSL_IE_L1Info { |
| 367 | uint5_t ms_power_lvl, |
| 368 | boolean fpc, |
| 369 | uint2_t reserved, |
| 370 | uint8_t actual_ta |
| 371 | } |
| 372 | |
| 373 | /* 9.3.13 */ |
| 374 | type record RSL_IE_MS_Power { |
| 375 | uint2_t reserved, |
| 376 | boolean fpc_epc, |
| 377 | uint5_t power_level |
| 378 | } |
| 379 | |
Harald Welte | d5f521e | 2017-12-07 17:53:06 +0100 | [diff] [blame] | 380 | /* 9.3.18 */ |
| 381 | type record RSL_IE_RachLoad { |
| 382 | uint8_t len, |
| 383 | uint16_t slot_count, |
| 384 | uint16_t busy_count, |
| 385 | uint16_t access_count |
| 386 | } with { variant (len) "LENGTHTO(slot_count,busy_count,access_count)" } |
| 387 | |
| 388 | template RSL_IE_RachLoad ts_RSL_IE_RachLoad(uint16_t slot, uint16_t busy, uint16_t acc) := { |
| 389 | len := 0, /* overwritten */ |
| 390 | slot_count := slot, |
| 391 | busy_count := busy, |
| 392 | access_count := acc |
| 393 | } |
| 394 | |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 395 | /* 9.3.19 */ |
| 396 | type record RSL_IE_RequestRef { |
| 397 | OCT1 ra, |
| 398 | RSL_IE_FrameNumber frame_nr |
| 399 | } |
| 400 | |
| 401 | /* 3GPP TS 44.018 / 10.5.2.38 Starting Time */ |
| 402 | template RSL_IE_FrameNumber ts_RSL_IE_FrameNumber(GsmFrameNumber fn) := { |
| 403 | t1_p := (fn / 1326) mod 32, |
| 404 | t3 := fn mod 51, |
| 405 | t2 := fn mod 26 |
| 406 | } |
| 407 | |
| 408 | template RSL_IE_RequestRef ts_RSL_IE_ReqRef(OCT1 ra, GsmFrameNumber frame_nr) := { |
| 409 | ra := ra, |
| 410 | frame_nr := ts_RSL_IE_FrameNumber(frame_nr) |
| 411 | } |
| 412 | |
| 413 | /* 9.3.26 */ |
Harald Welte | a8ed906 | 2017-12-14 09:46:01 +0100 | [diff] [blame] | 414 | type enumerated RSL_Cause { |
| 415 | /* normal event */ |
| 416 | RSL_ERR_RADIO_IF_FAIL ('00'O), |
| 417 | RSL_ERR_RADIO_LINK_FAIL ('01'O), |
| 418 | RSL_ERR_HANDOVER_ACC_FAIL ('02'O), |
| 419 | RSL_ERR_TALKER_ACC_FAIL ('03'O), |
| 420 | RSL_ERR_OM_INTERVENTION ('07'O), |
| 421 | RSL_ERR_NORMAL_UNSPEC ('0f'O), |
| 422 | RSL_ERR_T_MSRFPCI_EXP ('18'O), |
| 423 | /* resource unavailable */ |
| 424 | RSL_ERR_EQUIPMENT_FAIL ('20'O), |
| 425 | RSL_ERR_RR_UNAVAIL ('21'O), |
| 426 | RSL_ERR_TERR_CH_FAIL ('22'O), |
| 427 | RSL_ERR_CCCH_OVERLOAD ('23'O), |
| 428 | RSL_ERR_ACCH_OVERLOAD ('24'O), |
| 429 | RSL_ERR_PROCESSOR_OVERLOAD ('25'O), |
| 430 | RSL_ERR_BTS_NOT_EQUIPPED ('27'O), |
| 431 | RSL_ERR_REMOTE_TRAU_FAILURE ('28'O), |
| 432 | RSL_ERR_NOTIF_OVERFLOW ('29'O), |
| 433 | RSL_ERR_RES_UNAVAIL ('2f'O), |
| 434 | /* service or option not available */ |
| 435 | RSL_ERR_TRANSC_UNAVAIL ('30'O), |
| 436 | RSL_ERR_SERV_OPT_UNAVAIL ('3f'O), |
| 437 | /* service or option not implemented */ |
| 438 | RSL_ERR_ENCR_UNIMPL ('40'O), |
| 439 | RSL_ERR_SERV_OPT_UNIMPL ('4f'O), |
| 440 | /* invalid message */ |
| 441 | RSL_ERR_RCH_ALR_ACTV_ALLOC ('50'O), |
| 442 | RSL_ERR_INVALID_MESSAGE ('5f'O), |
| 443 | /* protocol error */ |
| 444 | RSL_ERR_MSG_DISCR ('60'O), |
| 445 | RSL_ERR_MSG_TYPE ('61'O), |
| 446 | RSL_ERR_MSG_SEQ ('62'O), |
| 447 | RSL_ERR_IE_ERROR ('63'O), |
| 448 | RSL_ERR_MAND_IE_ERROR ('64'O), |
| 449 | RSL_ERR_OPT_IE_ERROR ('65'O), |
| 450 | RSL_ERR_IE_NONEXIST ('66'O), |
| 451 | RSL_ERR_IE_LENGTH ('67'O), |
| 452 | RSL_ERR_IE_CONTENT ('68'O), |
| 453 | RSL_ERR_PROTO ('6f'O), |
| 454 | /* interworking */ |
| 455 | RSL_ERR_INTERWORKING ('7f'O) |
| 456 | }; |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 457 | type record RSL_IE_Cause { |
Harald Welte | 6efa8e3 | 2017-12-09 22:34:06 +0100 | [diff] [blame] | 458 | uint8_t len, |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 459 | uint1_t e, |
| 460 | RSL_Cause cause, |
| 461 | octetstring cause_ext optional |
Harald Welte | 6efa8e3 | 2017-12-09 22:34:06 +0100 | [diff] [blame] | 462 | } with { variant (len) "LENGTHTO(e,cause,cause_ext)" } |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 463 | |
| 464 | template RSL_IE_Cause ts_RSL_IE_Cause(RSL_Cause cause) := { |
Harald Welte | 6efa8e3 | 2017-12-09 22:34:06 +0100 | [diff] [blame] | 465 | len := 0, /* overwritten */ |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 466 | e := 0, |
| 467 | cause := cause, |
| 468 | cause_ext := omit |
| 469 | } |
| 470 | |
| 471 | /* 9.3.40 */ |
| 472 | type enumerated RSL_ChanNeeded { |
| 473 | RSL_CHANNEED_ANY ('00'B), |
| 474 | RSL_CHANNEED_SDCCH ('01'B), |
| 475 | RSL_CHANNEED_TCH_F ('10'B), |
| 476 | RSL_CHANNEED_TCH_ForH ('11'B) |
Harald Welte | 51d7410 | 2017-12-10 23:05:02 +0100 | [diff] [blame] | 477 | } with { variant "FIELDLENGTH(2)" }; |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 478 | type record RSL_IE_ChanNeeded { |
| 479 | uint6_t reserved, |
| 480 | RSL_ChanNeeded chan_needed |
| 481 | } |
| 482 | |
| 483 | /* 9.3.53 */ |
| 484 | type record RSL_IE_MultirateCtrl { |
| 485 | uint3_t spare, |
| 486 | boolean od, |
| 487 | boolean pre, |
| 488 | uint2_t rae, |
| 489 | boolean tfo |
| 490 | } |
| 491 | |
| 492 | type enumerated RSL_IE_SysinfoType { |
| 493 | RSL_SYSTEM_INFO_8 ('00000000'B), |
| 494 | RSL_SYSTEM_INFO_1 ('00000001'B), |
| 495 | RSL_SYSTEM_INFO_2 ('00000010'B), |
| 496 | RSL_SYSTEM_INFO_3 ('00000011'B), |
| 497 | RSL_SYSTEM_INFO_4 ('00000100'B), |
| 498 | RSL_SYSTEM_INFO_5 ('00000101'B), |
| 499 | RSL_SYSTEM_INFO_6 ('00000110'B), |
| 500 | RSL_SYSTEM_INFO_7 ('00000111'B), |
| 501 | RSL_SYSTEM_INFO_16 ('00001000'B), |
| 502 | RSL_SYSTEM_INFO_17 ('00001001'B), |
| 503 | RSL_SYSTEM_INFO_2bis ('00001010'B), |
| 504 | RSL_SYSTEM_INFO_2ter ('00001011'B), |
| 505 | RSL_SYSTEM_INFO_5bis ('00001101'B), |
| 506 | RSL_SYSTEM_INFO_5ter ('00001110'B), |
| 507 | RSL_SYSTEM_INFO_10 ('00001111'B), |
| 508 | RSL_EXT_MEAS_ORDER ('01000111'B), |
| 509 | RSL_MEAS_INFO ('01001000'B), |
| 510 | RSL_SYSTEM_INFO_13 ('00101000'B), |
| 511 | RSL_ERIC_SYSTEM_INFO_13 ('00001100'B), |
| 512 | RSL_SYSTEM_INFO_2quater ('00101001'B), |
| 513 | RSL_SYSTEM_INFO_9 ('00101010'B), |
| 514 | RSL_SYSTEM_INFO_18 ('00101011'B), |
| 515 | RSL_SYSTEM_INFO_19 ('00101100'B), |
| 516 | RSL_SYSTEM_INFO_20 ('00101101'B) |
| 517 | } with { variant "FIELDLENGTH(8)" } |
| 518 | |
Harald Welte | 9958a4d | 2017-12-14 21:21:33 +0100 | [diff] [blame] | 519 | type record RSL_IE_IPA_ConnectionStats { |
| 520 | uint8_t len, |
| 521 | uint32_t tx_packets, |
| 522 | uint32_t tx_octets, |
| 523 | uint32_t rx_packets, |
| 524 | uint32_t rx_octets, |
| 525 | uint32_t lost_packets, |
| 526 | uint32_t jitter, |
| 527 | uint32_t avg_delay |
| 528 | } with { variant (len) "LENGTHTO(tx_packets,tx_octets,rx_packets,rx_octets,lost_packets,jitter,avg_delay)" } |
| 529 | |
| 530 | type enumerated RSL_IPA_SpeechMode { |
| 531 | RSL_IPA_SPM_SENDRECV ('00'B), |
| 532 | RSL_IPA_SPM_RECVONLY ('01'B), |
| 533 | RSL_IPA_SPM_SENDONLY ('10'B), |
| 534 | RSL_IPA_SPM_RESERVED ('11'B) |
| 535 | } with { variant "FIELDLENGTH(2)" } |
| 536 | |
| 537 | type enumerated RSL_IPA_Codec { |
| 538 | RSL_IPA_CODEC_FR ('0000'B), |
| 539 | RSL_IPA_CODEC_EFR ('0001'B), |
| 540 | RSL_IPA_CODEC_AMR_F ('0010'B), |
| 541 | RSL_IPA_CODEC_HR ('0011'B), |
| 542 | RSL_IPA_CODEC_AMR_H ('0101'B), |
| 543 | RSL_IPA_CODEC_RTP_PT ('1111'B) |
| 544 | } with { variant "FIELDLENGTH(4)" } |
| 545 | |
| 546 | type record RSL_IE_IPA_SpeechMode { |
| 547 | BIT2 reserved, |
| 548 | RSL_IPA_SpeechMode mode, |
| 549 | RSL_IPA_Codec codec |
| 550 | } |
| 551 | |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 552 | /* union of all IE bodies */ |
| 553 | type union RSL_IE_Body { |
| 554 | RslChannelNr chan_nr, |
| 555 | RslLinkId link_id, |
Harald Welte | 15bb5b5 | 2017-12-07 17:52:04 +0100 | [diff] [blame] | 556 | RSL_L16V l3_info, |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 557 | RSL_LV rlm_cause, |
| 558 | uint8_t release_mode, |
| 559 | RSL_IE_ActivationType act_type, |
| 560 | RSL_IE_ChannelMode chan_mode, |
| 561 | uint8_t handover_ref, |
| 562 | RSL_IE_BS_Power bs_power, |
| 563 | RSL_IE_MS_Power ms_power, |
| 564 | uint8_t timing_adv, |
| 565 | RSL_IE_MultirateCtrl multirate_ctrl, |
| 566 | RSL_IE_FrameNumber frame_nr, |
| 567 | RSL_IE_Cause cause, |
| 568 | uint8_t access_delay, |
Harald Welte | d5f521e | 2017-12-07 17:53:06 +0100 | [diff] [blame] | 569 | RSL_IE_RachLoad rach_load, |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 570 | uint8_t meas_res_nr, |
| 571 | RSL_IE_L1Info l1_info, |
| 572 | RSL_IE_SysinfoType sysinfo_type, |
| 573 | uint16_t paging_load, |
| 574 | uint8_t paging_group, |
| 575 | RSL_IE_ChanNeeded chan_needed, |
| 576 | RSL_IE_StartingTime starting_time, |
Harald Welte | 73cd271 | 2017-12-17 00:44:52 +0100 | [diff] [blame] | 577 | RSL_IE_EncryptionInfo encr_info, |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 578 | RSL_IE_RequestRef req_ref, |
| 579 | RSL_LV full_imm_ass_info, |
Harald Welte | fff6930 | 2017-12-07 17:53:42 +0100 | [diff] [blame] | 580 | RSL_LV ms_identity, |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 581 | |
Harald Welte | 9958a4d | 2017-12-14 21:21:33 +0100 | [diff] [blame] | 582 | uint16_t ipa_conn_id, |
| 583 | uint16_t ipa_local_port, |
| 584 | uint16_t ipa_remote_port, |
| 585 | uint32_t ipa_local_ip, |
| 586 | uint32_t ipa_remote_ip, |
| 587 | uint8_t ipa_rtp_pt, |
| 588 | uint8_t ipa_rtp_pt2, |
| 589 | RSL_IE_IPA_ConnectionStats ipa_stats, |
| 590 | RSL_IE_IPA_SpeechMode ipa_speech_mode, |
| 591 | |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 592 | RSL_LV other |
| 593 | } |
| 594 | |
| 595 | type record RSL_IE { |
| 596 | RSL_IE_Type iei, |
| 597 | RSL_IE_Body body |
| 598 | } with { variant (body) "CROSSTAG( |
| 599 | chan_nr, iei = RSL_IE_CHAN_NR; |
| 600 | link_id, iei = RSL_IE_LINK_IDENT; |
| 601 | l3_info, iei = RSL_IE_L3_INFO; |
| 602 | rlm_cause, iei = RSL_IE_RLM_CAUSE; |
| 603 | release_mode, iei = RSL_IE_RELEASE_MODE; |
| 604 | act_type, iei = RSL_IE_ACT_TYPE; |
| 605 | chan_mode, iei = RSL_IE_CHAN_MODE; |
| 606 | handover_ref, iei = RSL_IE_HANDO_REF; |
| 607 | bs_power, iei = RSL_IE_BS_POWER; |
| 608 | ms_power, iei = RSL_IE_MS_POWER; |
| 609 | timing_adv, iei = RSL_IE_TIMING_ADVANCE; |
| 610 | multirate_ctrl, iei = RSL_IE_MR_CONTROL; |
| 611 | |
| 612 | frame_nr, iei = RSL_IE_FRAME_NUMBER; |
| 613 | cause, iei = RSL_IE_CAUSE; |
| 614 | access_delay, iei = RSL_IE_ACCESS_DELAY; |
Harald Welte | d5f521e | 2017-12-07 17:53:06 +0100 | [diff] [blame] | 615 | rach_load, iei = RSL_IE_RACH_LOAD; |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 616 | meas_res_nr, iei = RSL_IE_MEAS_RES_NR; |
| 617 | l1_info, iei = RSL_IE_L1_INFO; |
| 618 | sysinfo_type, iei = RSL_IE_SYSINFO_TYPE; |
| 619 | paging_load, iei = RSL_IE_PAGING_LOAD; |
| 620 | paging_group, iei = RSL_IE_PAGING_GROUP; |
| 621 | chan_needed, iei = RSL_IE_CHAN_NEEDED; |
| 622 | starting_time, iei = RSL_IE_STARTNG_TIME; |
Harald Welte | 73cd271 | 2017-12-17 00:44:52 +0100 | [diff] [blame] | 623 | encr_info, iei = RSL_IE_ENCR_INFO; |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 624 | |
| 625 | req_ref, iei = RSL_IE_REQ_REFERENCE; |
Harald Welte | fff6930 | 2017-12-07 17:53:42 +0100 | [diff] [blame] | 626 | full_imm_ass_info, iei = RSL_IE_FULL_IMM_ASS_INFO; |
| 627 | ms_identity, iei = RSL_IE_MS_IDENTITY; |
| 628 | other, iei = RSL_IE_FULL_BCCH_INFO; |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 629 | |
Harald Welte | 9958a4d | 2017-12-14 21:21:33 +0100 | [diff] [blame] | 630 | ipa_conn_id, iei = RSL_IE_IPAC_CONN_ID; |
| 631 | ipa_remote_ip, iei = RSL_IE_IPAC_REMOTE_IP; |
| 632 | ipa_remote_port, iei = RSL_IE_IPAC_REMOTE_PORT; |
| 633 | ipa_local_ip, iei = RSL_IE_IPAC_LOCAL_IP; |
| 634 | ipa_local_port, iei = RSL_IE_IPAC_LOCAL_PORT; |
| 635 | ipa_rtp_pt, iei = RSL_IE_IPAC_RTP_PAYLOAD; |
| 636 | ipa_rtp_pt2, iei = RSL_IE_IPAC_RTP_PAYLOAD2; |
| 637 | ipa_stats, iei = RSL_IE_IPAC_CONN_STAT; |
| 638 | ipa_speech_mode, iei = RSL_IE_IPAC_SPEECH_MODE; |
| 639 | |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 640 | other, OTHERWISE; |
| 641 | )" }; |
| 642 | |
Harald Welte | 735dd07 | 2017-12-12 14:55:17 +0100 | [diff] [blame] | 643 | /* For some reason the TTCN-3 RAW codec cannot automatically figure out the IEI |
| 644 | * that it needs to set for a given union-choice (body). So we have to explicitly |
| 645 | * specify the IEI by the caller :( */ |
| 646 | template RSL_IE t_RSL_IE(RSL_IE_Type iei, template RSL_IE_Body body) := { |
| 647 | iei := iei, |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 648 | body := body |
| 649 | } |
| 650 | |
Harald Welte | c287775 | 2017-12-07 17:54:35 +0100 | [diff] [blame] | 651 | template RSL_IE tr_RSL_IE(template RSL_IE_Body body) := { |
| 652 | iei := ?, /* overwritten? */ |
| 653 | body := body |
| 654 | } |
| 655 | |
| 656 | |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 657 | type record of RSL_IE RSL_IE_List; |
| 658 | |
| 659 | type record RSL_Message { |
| 660 | RSL_MessageDiscriminator msg_disc, |
| 661 | RSL_MessageType msg_type, |
| 662 | RSL_IE_List ies optional |
| 663 | } |
| 664 | |
| 665 | external function enc_RSL_Message(in RSL_Message msg) return octetstring |
| 666 | with { extension "prototype(convert) encode(RAW)" }; |
| 667 | external function dec_RSL_Message(in octetstring stream) return RSL_Message |
| 668 | with { extension "prototype(convert) decode(RAW)" }; |
| 669 | |
Harald Welte | bc330be | 2017-12-09 00:56:36 +0100 | [diff] [blame] | 670 | template RSL_Message tr_RSL_MsgDiscType(template RSL_MessageDiscriminator m_disc, |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 671 | RSL_MessageType m_type) := { |
| 672 | msg_disc := m_disc, |
| 673 | msg_type := m_type, |
| 674 | ies := * |
| 675 | } |
| 676 | |
Harald Welte | 4a26736 | 2017-12-09 17:49:32 +0100 | [diff] [blame] | 677 | template RSL_Message ts_RSL_MsgDiscType(template RSL_MessageDiscriminator m_disc, |
| 678 | template RSL_MessageType msg_type, |
| 679 | template RSL_IE_List ies := omit) := { |
| 680 | msg_disc := m_disc, |
| 681 | msg_type := msg_type, |
| 682 | ies := ies |
| 683 | } |
| 684 | |
Harald Welte | bc330be | 2017-12-09 00:56:36 +0100 | [diff] [blame] | 685 | template RSL_Message tr_RSL_MsgType(template RSL_MessageType msg_type) := { |
| 686 | msg_disc := ?, |
| 687 | msg_type := msg_type, |
| 688 | ies := * |
| 689 | } |
| 690 | |
| 691 | /* Common Channel Management */ |
| 692 | template RSL_Message tr_RSL_MsgTypeC(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := { |
| 693 | msg_disc := { RSL_MDISC_CCHAN, ? } |
| 694 | } |
| 695 | |
| 696 | /* RLL */ |
| 697 | template RSL_Message tr_RSL_MsgTypeR(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := { |
| 698 | msg_disc := { RSL_MDISC_RLL, true } |
| 699 | } |
| 700 | |
| 701 | /* Dedicated Channel Management */ |
| 702 | template RSL_Message tr_RSL_MsgTypeD(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := { |
| 703 | msg_disc := { RSL_MDISC_DCHAN, ? } |
| 704 | } |
| 705 | |
| 706 | /* Dedicated Channel Management */ |
| 707 | template RSL_Message tr_RSL_MsgTypeT(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := { |
| 708 | msg_disc := { RSL_MDISC_TRX_MGMT, ? } |
| 709 | } |
| 710 | |
| 711 | |
| 712 | /* dedicated channel or RLL */ |
| 713 | template RSL_Message tr_RSL_MsgTypeDR(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := { |
Harald Welte | 7794d5b | 2017-12-16 23:00:20 +0100 | [diff] [blame] | 714 | msg_disc := ({RSL_MDISC_DCHAN,?}, {RSL_MDISC_RLL,true}, {RSL_MDISC_IPACCESS,false}) |
Harald Welte | bc330be | 2017-12-09 00:56:36 +0100 | [diff] [blame] | 715 | } |
| 716 | |
| 717 | |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 718 | /* 8.3.1 BSC -> BTS */ |
| 719 | template RSL_Message ts_RSL_DATA_REQ(RslChannelNr chan_nr, RslLinkId link_id, octetstring l3_info) := { |
| 720 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, true), |
| 721 | msg_type := RSL_MT_DATA_REQ, |
| 722 | ies :={ |
Harald Welte | 735dd07 | 2017-12-12 14:55:17 +0100 | [diff] [blame] | 723 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 724 | t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}), |
| 725 | 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] | 726 | } |
| 727 | } |
| 728 | |
Harald Welte | 7794d5b | 2017-12-16 23:00:20 +0100 | [diff] [blame] | 729 | template RSL_Message tr_RSL_DATA_REQ(template RslChannelNr chan_nr :=?, |
| 730 | template RslLinkId link_id := ?, |
| 731 | template octetstring l3_info := ?) := { |
| 732 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, true), |
| 733 | msg_type := RSL_MT_DATA_REQ, |
| 734 | ies :={ |
| 735 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
| 736 | tr_RSL_IE(RSL_IE_Body:{link_id := link_id}), |
| 737 | tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)}) |
| 738 | } |
| 739 | } |
| 740 | |
| 741 | |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 742 | /* 8.3.2 BTS -> BSC */ |
| 743 | template RSL_Message ts_RSL_DATA_IND(RslChannelNr chan_nr, RslLinkId link_id, octetstring l3_info) := { |
| 744 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, true), |
| 745 | msg_type := RSL_MT_DATA_IND, |
| 746 | ies :={ |
Harald Welte | 735dd07 | 2017-12-12 14:55:17 +0100 | [diff] [blame] | 747 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 748 | t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}), |
| 749 | 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] | 750 | } |
| 751 | } |
| 752 | |
| 753 | /* 8.3.3 BTS -> BSC */ |
| 754 | template RSL_Message ts_RSL_ERROR_IND(RslChannelNr chan_nr, RslLinkId link_id, RSL_Cause cause) := { |
| 755 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false), |
| 756 | msg_type := RSL_MT_ERROR_IND, |
| 757 | ies :={ |
Harald Welte | 735dd07 | 2017-12-12 14:55:17 +0100 | [diff] [blame] | 758 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 759 | t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}), |
| 760 | 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] | 761 | } |
| 762 | } |
| 763 | |
| 764 | /* 8.3.6 BTS -> BSC */ |
| 765 | template RSL_Message ts_RSL_EST_IND(RslChannelNr chan_nr, RslLinkId link_id, octetstring l3_info) := { |
| 766 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false), |
| 767 | msg_type := RSL_MT_EST_IND, |
| 768 | ies := { |
Harald Welte | 735dd07 | 2017-12-12 14:55:17 +0100 | [diff] [blame] | 769 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 770 | t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}), |
| 771 | 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] | 772 | } |
| 773 | } |
| 774 | |
| 775 | /* 8.3.7 BSC -> BTS */ |
| 776 | template RSL_Message ts_RSL_REL_REQ(RslChannelNr chan_nr, RslLinkId link_id) := { |
| 777 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false), |
| 778 | msg_type := RSL_MT_REL_REQ, |
| 779 | ies :={ |
Harald Welte | 735dd07 | 2017-12-12 14:55:17 +0100 | [diff] [blame] | 780 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 781 | 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] | 782 | } |
| 783 | } |
Harald Welte | e8a5ab1 | 2017-12-09 22:34:57 +0100 | [diff] [blame] | 784 | template RSL_Message tr_RSL_REL_REQ(template RslChannelNr chan_nr, |
| 785 | template RslLinkId link_id) := { |
| 786 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false), |
| 787 | msg_type := RSL_MT_REL_REQ, |
| 788 | ies :={ |
| 789 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
| 790 | tr_RSL_IE(RSL_IE_Body:{link_id := link_id}), |
| 791 | * |
| 792 | } |
| 793 | } |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 794 | |
| 795 | /* 8.3.8 BTS -> BSC */ |
| 796 | template RSL_Message ts_RSL_REL_CONF(RslChannelNr chan_nr, RslLinkId link_id) := { |
| 797 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false), |
| 798 | msg_type := RSL_MT_REL_CONF, |
| 799 | ies :={ |
Harald Welte | 735dd07 | 2017-12-12 14:55:17 +0100 | [diff] [blame] | 800 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 801 | 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] | 802 | } |
| 803 | } |
| 804 | |
| 805 | /* 8.3.9 BTS -> BSC */ |
| 806 | template RSL_Message ts_RSL_REL_IND(RslChannelNr chan_nr, RslLinkId link_id) := { |
| 807 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false), |
| 808 | msg_type := RSL_MT_REL_IND, |
| 809 | ies :={ |
Harald Welte | 735dd07 | 2017-12-12 14:55:17 +0100 | [diff] [blame] | 810 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 811 | 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] | 812 | } |
| 813 | } |
| 814 | |
| 815 | /* 8.3.10 BSC -> BTS */ |
| 816 | template RSL_Message ts_RSL_UNITDATA_REQ(RslChannelNr chan_nr, RslLinkId link_id, octetstring l3_info) |
| 817 | modifies ts_RSL_DATA_REQ := { |
| 818 | msg_type := RSL_MT_UNIT_DATA_REQ |
| 819 | } |
| 820 | |
| 821 | /* 8.3.11 BTS -> BSC */ |
| 822 | template RSL_Message ts_RSL_UNITDATA_IND(RslChannelNr chan_nr, RslLinkId link_id, octetstring l3_info) |
| 823 | modifies ts_RSL_DATA_IND := { |
| 824 | msg_type := RSL_MT_UNIT_DATA_IND |
| 825 | } |
| 826 | |
| 827 | |
| 828 | /* DEDICATED CANNEL MANAGEMENT MESSAGES */ |
| 829 | |
| 830 | /* 8.4.1 BSC -> BTS */ |
| 831 | template RSL_Message ts_RSL_CHAN_ACT(RslChannelNr chan_nr, RSL_IE_ChannelMode mode) := { |
| 832 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
| 833 | msg_type := RSL_MT_CHAN_ACTIV, |
| 834 | ies :={ |
Harald Welte | 735dd07 | 2017-12-12 14:55:17 +0100 | [diff] [blame] | 835 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 836 | t_RSL_IE(RSL_IE_ACT_TYPE, RSL_IE_Body:{act_type := t_RSL_IE_ActType}), |
| 837 | 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] | 838 | /* lots of optional IEs */ |
| 839 | } |
| 840 | } |
| 841 | |
| 842 | /* 8.4.2 BTS -> BSC */ |
| 843 | template RSL_Message ts_RSL_CHAN_ACT_ACK(RslChannelNr chan_nr, GsmFrameNumber fn) := { |
| 844 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
| 845 | msg_type := RSL_MT_CHAN_ACTIV_ACK, |
| 846 | ies :={ |
Harald Welte | 735dd07 | 2017-12-12 14:55:17 +0100 | [diff] [blame] | 847 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 848 | 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] | 849 | } |
| 850 | } |
| 851 | |
| 852 | /* 8.4.3 BTS -> BSC */ |
| 853 | template RSL_Message ts_RSL_CHAN_ACT_NACK(RslChannelNr chan_nr, RSL_Cause cause) := { |
| 854 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
| 855 | msg_type := RSL_MT_CHAN_ACTIV_NACK, |
| 856 | ies :={ |
Harald Welte | 735dd07 | 2017-12-12 14:55:17 +0100 | [diff] [blame] | 857 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 858 | 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] | 859 | } |
| 860 | } |
| 861 | |
| 862 | /* 8.4.4 BTS -> BSC */ |
| 863 | template RSL_Message ts_RSL_CONN_FAIL_IND(RslChannelNr chan_nr, RSL_Cause cause) := { |
| 864 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
| 865 | msg_type := RSL_MT_CONN_FAIL, |
| 866 | ies :={ |
Harald Welte | 735dd07 | 2017-12-12 14:55:17 +0100 | [diff] [blame] | 867 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 868 | 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] | 869 | } |
| 870 | } |
| 871 | |
Harald Welte | e8a5ab1 | 2017-12-09 22:34:57 +0100 | [diff] [blame] | 872 | /* 8.4.5 BSC -> BTS */ |
| 873 | template RSL_Message tr_RSL_DEACT_SACCH(template RslChannelNr chan_nr) := { |
| 874 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
| 875 | msg_type := RSL_MT_DEACTIVATE_SACCH, |
| 876 | ies := { |
| 877 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}) |
| 878 | } |
| 879 | } |
| 880 | |
Harald Welte | 73cd271 | 2017-12-17 00:44:52 +0100 | [diff] [blame] | 881 | /* 8.4.6 BSC ->BTS */ |
| 882 | template RSL_Message tr_RSL_ENCR_CMD(template RslChannelNr chan_nr, |
| 883 | template RslLinkId link_id := ?, |
| 884 | template OCT1 alg := ?, |
| 885 | template octetstring key := ?, |
| 886 | template octetstring l3_info := ?) := { |
| 887 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
| 888 | msg_type := RSL_MT_ENCR_CMD, |
| 889 | ies := { |
| 890 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
| 891 | tr_RSL_IE(RSL_IE_Body:{encr_info := tr_RSL_IE_EncrInfo(alg, key)}), |
| 892 | tr_RSL_IE(RSL_IE_Body:{link_id := link_id}), |
| 893 | tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)}) |
| 894 | } |
| 895 | } |
| 896 | |
Harald Welte | 7794d5b | 2017-12-16 23:00:20 +0100 | [diff] [blame] | 897 | /* 8.4.10 BTS -> BSC */ |
| 898 | template RSL_Message ts_RSL_MODE_MODIFY_ACK(RslChannelNr chan_nr) := { |
| 899 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
| 900 | msg_type := RSL_MT_MODE_MODIFY_ACK, |
| 901 | ies := { |
| 902 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}) |
| 903 | } |
| 904 | } |
| 905 | |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 906 | /* 8.4.11 BTS -> BSC */ |
| 907 | template RSL_Message ts_RSL_MODE_MODIFY_NACK(RslChannelNr chan_nr, RSL_Cause cause) |
| 908 | modifies ts_RSL_CHAN_ACT_NACK := { |
| 909 | msg_type := RSL_MT_MODE_MODIFY_NACK |
| 910 | } |
| 911 | |
Harald Welte | 4a26736 | 2017-12-09 17:49:32 +0100 | [diff] [blame] | 912 | /* 8.4.19 BTS -> BSC */ |
| 913 | template RSL_Message ts_RSL_RF_CHAN_REL_ACK(RslChannelNr chan_nr) := |
| 914 | ts_RSL_MsgDiscType(ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
| 915 | RSL_MT_RF_CHAN_REL_ACK, |
Harald Welte | 735dd07 | 2017-12-12 14:55:17 +0100 | [diff] [blame] | 916 | { 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] | 917 | |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 918 | /* COMMON CHANNEL MANAGEMENT MESSAGES */ |
| 919 | |
Harald Welte | 7ae9314 | 2017-12-07 17:56:15 +0100 | [diff] [blame] | 920 | /* 8.5.2 BTS -> BSC */ |
| 921 | template RSL_Message ts_RSL_RACH_LOAD_IND(uint16_t slot_ct, uint16_t busy_ct, uint16_t acc_ct) := { |
| 922 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false), |
| 923 | msg_type := RSL_MT_CCCH_LOAD_IND, |
| 924 | ies := { |
Harald Welte | 735dd07 | 2017-12-12 14:55:17 +0100 | [diff] [blame] | 925 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := t_RslChanNr_RACH(0)}), |
| 926 | 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] | 927 | } |
| 928 | } |
| 929 | template RSL_Message ts_RSL_PAGING_LOAD_IND(uint16_t buffer_space) := { |
| 930 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false), |
| 931 | msg_type := RSL_MT_CCCH_LOAD_IND, |
| 932 | ies := { |
Harald Welte | 735dd07 | 2017-12-12 14:55:17 +0100 | [diff] [blame] | 933 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(0)}), |
| 934 | 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] | 935 | } |
| 936 | } |
| 937 | |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 938 | /* 8.5.3 BTS -> BSC */ |
Harald Welte | 101fbed | 2017-12-07 17:56:38 +0100 | [diff] [blame] | 939 | 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] | 940 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false), |
| 941 | msg_type := RSL_MT_CHAN_RQD, |
| 942 | ies := { |
Harald Welte | 735dd07 | 2017-12-12 14:55:17 +0100 | [diff] [blame] | 943 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := t_RslChanNr_RACH(0)}), |
| 944 | t_RSL_IE(RSL_IE_REQ_REFERENCE, RSL_IE_Body:{req_ref := ts_RSL_IE_ReqRef(ra, fn)}), |
| 945 | 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] | 946 | } |
| 947 | } |
| 948 | |
| 949 | /* 8.5.4 BTS -> BSC */ |
| 950 | template RSL_Message ts_DELETE_IND(RslChannelNr chan_nr, octetstring imm_ass) := { |
| 951 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false), |
| 952 | msg_type := RSL_MT_DELETE_IND, |
| 953 | ies := { |
Harald Welte | 735dd07 | 2017-12-12 14:55:17 +0100 | [diff] [blame] | 954 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 955 | 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] | 956 | } |
| 957 | } |
| 958 | |
Harald Welte | c287775 | 2017-12-07 17:54:35 +0100 | [diff] [blame] | 959 | /* 8.5.5 BSC -> BTS */ |
| 960 | template RSL_Message tr_RSL_PAGING_CMD(template octetstring identity, template uint3_t tn := ?) := { |
| 961 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false), |
| 962 | msg_type := RSL_MT_PAGING_CMD, |
| 963 | ies := { |
| 964 | tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(tn)}), |
| 965 | tr_RSL_IE(RSL_IE_Body:{paging_group := ?}), |
Harald Welte | 51d7410 | 2017-12-10 23:05:02 +0100 | [diff] [blame] | 966 | tr_RSL_IE(RSL_IE_Body:{ms_identity := tr_RSL_LV(identity)}), |
Harald Welte | c287775 | 2017-12-07 17:54:35 +0100 | [diff] [blame] | 967 | * /* opt: channel needed, eMLPP prio */ |
| 968 | } |
| 969 | } |
| 970 | |
| 971 | /* 8.5.6 BSC -> BTS */ |
| 972 | template RSL_Message tr_RSL_IMM_ASSIGN(template uint3_t tn := ?) := { |
| 973 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false), |
| 974 | msg_type := RSL_MT_IMMEDIATE_ASSIGN_CMD, |
| 975 | ies := { |
| 976 | tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(tn)}), |
| 977 | tr_RSL_IE(RSL_IE_Body:{full_imm_ass_info := ?}) |
| 978 | } |
| 979 | } |
| 980 | |
| 981 | |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 982 | /* 8.6.4 BTS -> BSC */ |
| 983 | template RSL_Message ts_RSL_ERROR_REPORT(RSL_Cause cause) := { |
| 984 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false), |
| 985 | msg_type := RSL_MT_ERROR_IND, |
| 986 | ies := { |
Harald Welte | 735dd07 | 2017-12-12 14:55:17 +0100 | [diff] [blame] | 987 | 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] | 988 | } |
| 989 | } |
| 990 | |
Harald Welte | 9958a4d | 2017-12-14 21:21:33 +0100 | [diff] [blame] | 991 | |
| 992 | /* Abis/IP specific messages */ |
| 993 | |
| 994 | template RSL_Message tr_RSL_IPA_CRCX(template RslChannelNr chan_nr) := { |
| 995 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false), |
| 996 | msg_type := RSL_MT_IPAC_CRCX, |
| 997 | ies := { |
| 998 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
| 999 | * |
| 1000 | } |
| 1001 | } |
| 1002 | |
| 1003 | template RSL_Message ts_RSL_IPA_CRCX_ACK(RslChannelNr chan_nr, |
| 1004 | uint16_t ipa_conn_id, uint32_t local_ip, |
| 1005 | uint16_t local_port, uint7_t rtp_pt2) := { |
| 1006 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false), |
| 1007 | msg_type := RSL_MT_IPAC_CRCX_ACK, |
| 1008 | ies := { |
| 1009 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 1010 | t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}), |
| 1011 | t_RSL_IE(RSL_IE_IPAC_LOCAL_IP, RSL_IE_Body:{ipa_local_ip := local_ip}), |
| 1012 | t_RSL_IE(RSL_IE_IPAC_LOCAL_PORT, RSL_IE_Body:{ipa_local_port := local_port}), |
| 1013 | t_RSL_IE(RSL_IE_IPAC_RTP_PAYLOAD2, RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2}) |
| 1014 | } |
| 1015 | } |
| 1016 | |
| 1017 | template RSL_Message ts_RSL_IPA_CRCX_NACK(RslChannelNr chan_nr, RSL_Cause cause) := { |
| 1018 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false), |
| 1019 | msg_type := RSL_MT_IPAC_CRCX_NACK, |
| 1020 | ies := { |
| 1021 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 1022 | t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)}) |
| 1023 | } |
| 1024 | } |
| 1025 | |
| 1026 | template RSL_Message tr_RSL_IPA_MDCX(template RslChannelNr chan_nr, |
| 1027 | template uint16_t ipa_conn_id) := { |
| 1028 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false), |
| 1029 | msg_type := RSL_MT_IPAC_MDCX, |
| 1030 | ies := { |
| 1031 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
| 1032 | tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}), |
| 1033 | * |
| 1034 | } |
| 1035 | } |
| 1036 | |
| 1037 | template RSL_Message ts_RSL_IPA_MDCX_ACK(RslChannelNr chan_nr, template uint16_t ipa_conn_id, |
| 1038 | uint32_t remote_ip, uint16_t remote_port, |
| 1039 | uint7_t rtp_pt2) := { |
| 1040 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false), |
Harald Welte | 71b5ec8 | 2017-12-16 23:01:10 +0100 | [diff] [blame] | 1041 | msg_type := RSL_MT_IPAC_MDCX_ACK, |
Harald Welte | 9958a4d | 2017-12-14 21:21:33 +0100 | [diff] [blame] | 1042 | ies := { |
| 1043 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 1044 | /* optional */ |
| 1045 | t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}), |
| 1046 | t_RSL_IE(RSL_IE_IPAC_REMOTE_IP, RSL_IE_Body:{ipa_remote_ip := remote_ip}), |
| 1047 | t_RSL_IE(RSL_IE_IPAC_REMOTE_PORT, RSL_IE_Body:{ipa_remote_port := remote_port}), |
| 1048 | /* optional: RTP Payload Type */ |
| 1049 | t_RSL_IE(RSL_IE_IPAC_RTP_PAYLOAD2, RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2}) |
| 1050 | } |
| 1051 | } |
| 1052 | |
| 1053 | template RSL_Message ts_RSL_IPA_MDCX_NACK(RslChannelNr chan_nr, RSL_Cause cause, |
| 1054 | template uint16_t ipa_conn_id) := { |
| 1055 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false), |
| 1056 | msg_type := RSL_MT_IPAC_MDCX_NACK, |
| 1057 | ies := { |
| 1058 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 1059 | /* optional connection ID */ |
| 1060 | t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}), |
| 1061 | t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)}) |
| 1062 | } |
| 1063 | } |
| 1064 | |
| 1065 | template RSL_Message ts_RSL_IPA_DLCX_IND(RslChannelNr chan_nr, uint16_t ipa_conn_id, |
| 1066 | RSL_IE_IPA_ConnectionStats stats, RSL_Cause cause) := { |
| 1067 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false), |
| 1068 | msg_type := RSL_MT_IPAC_DLCX_IND, |
| 1069 | ies := { |
| 1070 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 1071 | t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}), |
| 1072 | t_RSL_IE(RSL_IE_IPAC_CONN_STAT, RSL_IE_Body:{ipa_stats := stats}), |
| 1073 | t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)}) |
| 1074 | } |
| 1075 | } |
| 1076 | |
| 1077 | template RSL_Message tr_RSL_IPA_DLCX(template RslChannelNr chan_nr, |
| 1078 | template uint16_t ipa_conn_id := omit) := { |
| 1079 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false), |
| 1080 | msg_type := RSL_MT_IPAC_DLCX, |
| 1081 | ies := { |
| 1082 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
| 1083 | /* FIXME: optional conn_id */ |
| 1084 | * |
| 1085 | } |
| 1086 | } |
| 1087 | |
| 1088 | template RSL_Message ts_RSL_IPA_DLCX_ACK(RslChannelNr chan_nr, template uint16_t ipa_conn_id, |
| 1089 | template RSL_IE_IPA_ConnectionStats stats) := { |
| 1090 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false), |
| 1091 | msg_type := RSL_MT_IPAC_DLCX_ACK, |
| 1092 | ies := { |
| 1093 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 1094 | t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}), |
| 1095 | t_RSL_IE(RSL_IE_IPAC_CONN_STAT, RSL_IE_Body:{ipa_stats := stats}) |
| 1096 | } |
| 1097 | } |
| 1098 | |
| 1099 | template RSL_Message ts_RSL_IPA_DLCX_NACK(RslChannelNr chan_nr, RSL_Cause cause, |
| 1100 | template uint16_t ipa_conn_id) := { |
| 1101 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false), |
| 1102 | msg_type := RSL_MT_IPAC_DLCX_NACK, |
| 1103 | ies := { |
| 1104 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 1105 | /* optional connection ID */ |
| 1106 | t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}), |
| 1107 | t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)}) |
| 1108 | } |
| 1109 | } |
| 1110 | |
| 1111 | template RSL_Message tr_RSL_IPA_PDCH_ACT(template RslChannelNr chan_nr) := { |
| 1112 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false), |
| 1113 | msg_type := RSL_MT_IPAC_PDCH_ACT, |
| 1114 | ies := { |
| 1115 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}) |
| 1116 | } |
| 1117 | } |
| 1118 | |
| 1119 | template RSL_Message ts_RSL_IPA_PDCH_ACT_ACK(RslChannelNr chan_nr, RSL_IE_FrameNumber fn) := { |
| 1120 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false), |
| 1121 | msg_type := RSL_MT_IPAC_PDCH_ACT_ACK, |
| 1122 | ies := { |
| 1123 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 1124 | t_RSL_IE(RSL_IE_FRAME_NUMBER, RSL_IE_Body:{frame_nr := fn}) |
| 1125 | } |
| 1126 | } |
| 1127 | |
| 1128 | template RSL_Message ts_RSL_IPA_PDCH_ACT_NACK(RslChannelNr chan_nr, RSL_Cause cause) := { |
| 1129 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false), |
| 1130 | msg_type := RSL_MT_IPAC_PDCH_ACT_NACK, |
| 1131 | ies := { |
| 1132 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 1133 | t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)}) |
| 1134 | } |
| 1135 | } |
| 1136 | |
| 1137 | template RSL_Message tr_RSL_IPA_PDCH_DEACT(template RslChannelNr chan_nr) := { |
| 1138 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false), |
| 1139 | msg_type := RSL_MT_IPAC_PDCH_DEACT, |
| 1140 | ies := { |
| 1141 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}) |
| 1142 | } |
| 1143 | } |
| 1144 | |
| 1145 | template RSL_Message ts_RSL_IPA_PDCH_DEACT_ACK(RslChannelNr chan_nr) := { |
| 1146 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false), |
| 1147 | msg_type := RSL_MT_IPAC_PDCH_DEACT_ACK, |
| 1148 | ies := { |
| 1149 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}) |
| 1150 | } |
| 1151 | } |
| 1152 | |
| 1153 | template RSL_Message ts_RSL_IPA_PDCH_DEACT_NACK(RslChannelNr chan_nr, RSL_Cause cause) := { |
| 1154 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false), |
| 1155 | msg_type := RSL_MT_IPAC_PDCH_DEACT_NACK, |
| 1156 | ies := { |
| 1157 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 1158 | t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)}) |
| 1159 | } |
| 1160 | } |
| 1161 | |
| 1162 | |
| 1163 | |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 1164 | } with { encode "RAW" ; variant "FIELDORDER(msb)" } |