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 | |
Harald Welte | 9abd128 | 2018-02-19 19:18:17 +0100 | [diff] [blame] | 408 | function tr_RSL_IE_FrameNumber(template GsmFrameNumber fn) return template RSL_IE_FrameNumber { |
| 409 | if (istemplatekind(fn, "?")) { |
| 410 | return ?; |
| 411 | } else { |
| 412 | return ts_RSL_IE_FrameNumber(valueof(fn)); |
| 413 | } |
| 414 | } |
| 415 | |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 416 | template RSL_IE_RequestRef ts_RSL_IE_ReqRef(OCT1 ra, GsmFrameNumber frame_nr) := { |
| 417 | ra := ra, |
| 418 | frame_nr := ts_RSL_IE_FrameNumber(frame_nr) |
| 419 | } |
| 420 | |
Harald Welte | 9abd128 | 2018-02-19 19:18:17 +0100 | [diff] [blame] | 421 | template RSL_IE_RequestRef tr_RSL_IE_ReqRef(template OCT1 ra, template GsmFrameNumber frame_nr) := { |
| 422 | ra := ra, |
| 423 | frame_nr := tr_RSL_IE_FrameNumber(frame_nr) |
| 424 | } |
| 425 | |
| 426 | |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 427 | /* 9.3.26 */ |
Harald Welte | a8ed906 | 2017-12-14 09:46:01 +0100 | [diff] [blame] | 428 | type enumerated RSL_Cause { |
| 429 | /* normal event */ |
| 430 | RSL_ERR_RADIO_IF_FAIL ('00'O), |
| 431 | RSL_ERR_RADIO_LINK_FAIL ('01'O), |
| 432 | RSL_ERR_HANDOVER_ACC_FAIL ('02'O), |
| 433 | RSL_ERR_TALKER_ACC_FAIL ('03'O), |
| 434 | RSL_ERR_OM_INTERVENTION ('07'O), |
| 435 | RSL_ERR_NORMAL_UNSPEC ('0f'O), |
| 436 | RSL_ERR_T_MSRFPCI_EXP ('18'O), |
| 437 | /* resource unavailable */ |
| 438 | RSL_ERR_EQUIPMENT_FAIL ('20'O), |
| 439 | RSL_ERR_RR_UNAVAIL ('21'O), |
| 440 | RSL_ERR_TERR_CH_FAIL ('22'O), |
| 441 | RSL_ERR_CCCH_OVERLOAD ('23'O), |
| 442 | RSL_ERR_ACCH_OVERLOAD ('24'O), |
| 443 | RSL_ERR_PROCESSOR_OVERLOAD ('25'O), |
| 444 | RSL_ERR_BTS_NOT_EQUIPPED ('27'O), |
| 445 | RSL_ERR_REMOTE_TRAU_FAILURE ('28'O), |
| 446 | RSL_ERR_NOTIF_OVERFLOW ('29'O), |
| 447 | RSL_ERR_RES_UNAVAIL ('2f'O), |
| 448 | /* service or option not available */ |
| 449 | RSL_ERR_TRANSC_UNAVAIL ('30'O), |
| 450 | RSL_ERR_SERV_OPT_UNAVAIL ('3f'O), |
| 451 | /* service or option not implemented */ |
| 452 | RSL_ERR_ENCR_UNIMPL ('40'O), |
| 453 | RSL_ERR_SERV_OPT_UNIMPL ('4f'O), |
| 454 | /* invalid message */ |
| 455 | RSL_ERR_RCH_ALR_ACTV_ALLOC ('50'O), |
| 456 | RSL_ERR_INVALID_MESSAGE ('5f'O), |
| 457 | /* protocol error */ |
| 458 | RSL_ERR_MSG_DISCR ('60'O), |
| 459 | RSL_ERR_MSG_TYPE ('61'O), |
| 460 | RSL_ERR_MSG_SEQ ('62'O), |
| 461 | RSL_ERR_IE_ERROR ('63'O), |
| 462 | RSL_ERR_MAND_IE_ERROR ('64'O), |
| 463 | RSL_ERR_OPT_IE_ERROR ('65'O), |
| 464 | RSL_ERR_IE_NONEXIST ('66'O), |
| 465 | RSL_ERR_IE_LENGTH ('67'O), |
| 466 | RSL_ERR_IE_CONTENT ('68'O), |
| 467 | RSL_ERR_PROTO ('6f'O), |
| 468 | /* interworking */ |
| 469 | RSL_ERR_INTERWORKING ('7f'O) |
| 470 | }; |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 471 | type record RSL_IE_Cause { |
Harald Welte | 6efa8e3 | 2017-12-09 22:34:06 +0100 | [diff] [blame] | 472 | uint8_t len, |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 473 | uint1_t e, |
| 474 | RSL_Cause cause, |
| 475 | octetstring cause_ext optional |
Harald Welte | 6efa8e3 | 2017-12-09 22:34:06 +0100 | [diff] [blame] | 476 | } with { variant (len) "LENGTHTO(e,cause,cause_ext)" } |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 477 | |
| 478 | template RSL_IE_Cause ts_RSL_IE_Cause(RSL_Cause cause) := { |
Harald Welte | 6efa8e3 | 2017-12-09 22:34:06 +0100 | [diff] [blame] | 479 | len := 0, /* overwritten */ |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 480 | e := 0, |
| 481 | cause := cause, |
| 482 | cause_ext := omit |
| 483 | } |
| 484 | |
Harald Welte | 9abd128 | 2018-02-19 19:18:17 +0100 | [diff] [blame] | 485 | template RSL_IE_Cause tr_RSL_IE_Cause(template RSL_Cause cause) := { |
| 486 | len := ?, |
| 487 | e := 0, |
| 488 | cause := cause, |
| 489 | cause_ext := omit |
| 490 | } |
| 491 | |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 492 | /* 9.3.40 */ |
| 493 | type enumerated RSL_ChanNeeded { |
| 494 | RSL_CHANNEED_ANY ('00'B), |
| 495 | RSL_CHANNEED_SDCCH ('01'B), |
| 496 | RSL_CHANNEED_TCH_F ('10'B), |
| 497 | RSL_CHANNEED_TCH_ForH ('11'B) |
Harald Welte | 51d7410 | 2017-12-10 23:05:02 +0100 | [diff] [blame] | 498 | } with { variant "FIELDLENGTH(2)" }; |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 499 | type record RSL_IE_ChanNeeded { |
| 500 | uint6_t reserved, |
| 501 | RSL_ChanNeeded chan_needed |
| 502 | } |
| 503 | |
| 504 | /* 9.3.53 */ |
| 505 | type record RSL_IE_MultirateCtrl { |
| 506 | uint3_t spare, |
| 507 | boolean od, |
| 508 | boolean pre, |
| 509 | uint2_t rae, |
| 510 | boolean tfo |
| 511 | } |
| 512 | |
| 513 | type enumerated RSL_IE_SysinfoType { |
| 514 | RSL_SYSTEM_INFO_8 ('00000000'B), |
| 515 | RSL_SYSTEM_INFO_1 ('00000001'B), |
| 516 | RSL_SYSTEM_INFO_2 ('00000010'B), |
| 517 | RSL_SYSTEM_INFO_3 ('00000011'B), |
| 518 | RSL_SYSTEM_INFO_4 ('00000100'B), |
| 519 | RSL_SYSTEM_INFO_5 ('00000101'B), |
| 520 | RSL_SYSTEM_INFO_6 ('00000110'B), |
| 521 | RSL_SYSTEM_INFO_7 ('00000111'B), |
| 522 | RSL_SYSTEM_INFO_16 ('00001000'B), |
| 523 | RSL_SYSTEM_INFO_17 ('00001001'B), |
| 524 | RSL_SYSTEM_INFO_2bis ('00001010'B), |
| 525 | RSL_SYSTEM_INFO_2ter ('00001011'B), |
| 526 | RSL_SYSTEM_INFO_5bis ('00001101'B), |
| 527 | RSL_SYSTEM_INFO_5ter ('00001110'B), |
| 528 | RSL_SYSTEM_INFO_10 ('00001111'B), |
| 529 | RSL_EXT_MEAS_ORDER ('01000111'B), |
| 530 | RSL_MEAS_INFO ('01001000'B), |
| 531 | RSL_SYSTEM_INFO_13 ('00101000'B), |
| 532 | RSL_ERIC_SYSTEM_INFO_13 ('00001100'B), |
| 533 | RSL_SYSTEM_INFO_2quater ('00101001'B), |
| 534 | RSL_SYSTEM_INFO_9 ('00101010'B), |
| 535 | RSL_SYSTEM_INFO_18 ('00101011'B), |
| 536 | RSL_SYSTEM_INFO_19 ('00101100'B), |
| 537 | RSL_SYSTEM_INFO_20 ('00101101'B) |
| 538 | } with { variant "FIELDLENGTH(8)" } |
| 539 | |
Harald Welte | 9958a4d | 2017-12-14 21:21:33 +0100 | [diff] [blame] | 540 | type record RSL_IE_IPA_ConnectionStats { |
| 541 | uint8_t len, |
| 542 | uint32_t tx_packets, |
| 543 | uint32_t tx_octets, |
| 544 | uint32_t rx_packets, |
| 545 | uint32_t rx_octets, |
| 546 | uint32_t lost_packets, |
| 547 | uint32_t jitter, |
| 548 | uint32_t avg_delay |
| 549 | } with { variant (len) "LENGTHTO(tx_packets,tx_octets,rx_packets,rx_octets,lost_packets,jitter,avg_delay)" } |
| 550 | |
| 551 | type enumerated RSL_IPA_SpeechMode { |
| 552 | RSL_IPA_SPM_SENDRECV ('00'B), |
| 553 | RSL_IPA_SPM_RECVONLY ('01'B), |
| 554 | RSL_IPA_SPM_SENDONLY ('10'B), |
| 555 | RSL_IPA_SPM_RESERVED ('11'B) |
| 556 | } with { variant "FIELDLENGTH(2)" } |
| 557 | |
| 558 | type enumerated RSL_IPA_Codec { |
| 559 | RSL_IPA_CODEC_FR ('0000'B), |
| 560 | RSL_IPA_CODEC_EFR ('0001'B), |
| 561 | RSL_IPA_CODEC_AMR_F ('0010'B), |
| 562 | RSL_IPA_CODEC_HR ('0011'B), |
| 563 | RSL_IPA_CODEC_AMR_H ('0101'B), |
| 564 | RSL_IPA_CODEC_RTP_PT ('1111'B) |
| 565 | } with { variant "FIELDLENGTH(4)" } |
| 566 | |
| 567 | type record RSL_IE_IPA_SpeechMode { |
| 568 | BIT2 reserved, |
| 569 | RSL_IPA_SpeechMode mode, |
| 570 | RSL_IPA_Codec codec |
| 571 | } |
| 572 | |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 573 | /* union of all IE bodies */ |
| 574 | type union RSL_IE_Body { |
| 575 | RslChannelNr chan_nr, |
| 576 | RslLinkId link_id, |
Harald Welte | 15bb5b5 | 2017-12-07 17:52:04 +0100 | [diff] [blame] | 577 | RSL_L16V l3_info, |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 578 | RSL_LV rlm_cause, |
| 579 | uint8_t release_mode, |
| 580 | RSL_IE_ActivationType act_type, |
| 581 | RSL_IE_ChannelMode chan_mode, |
| 582 | uint8_t handover_ref, |
| 583 | RSL_IE_BS_Power bs_power, |
| 584 | RSL_IE_MS_Power ms_power, |
| 585 | uint8_t timing_adv, |
| 586 | RSL_IE_MultirateCtrl multirate_ctrl, |
| 587 | RSL_IE_FrameNumber frame_nr, |
| 588 | RSL_IE_Cause cause, |
| 589 | uint8_t access_delay, |
Harald Welte | d5f521e | 2017-12-07 17:53:06 +0100 | [diff] [blame] | 590 | RSL_IE_RachLoad rach_load, |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 591 | uint8_t meas_res_nr, |
| 592 | RSL_IE_L1Info l1_info, |
| 593 | RSL_IE_SysinfoType sysinfo_type, |
| 594 | uint16_t paging_load, |
| 595 | uint8_t paging_group, |
| 596 | RSL_IE_ChanNeeded chan_needed, |
| 597 | RSL_IE_StartingTime starting_time, |
Harald Welte | 73cd271 | 2017-12-17 00:44:52 +0100 | [diff] [blame] | 598 | RSL_IE_EncryptionInfo encr_info, |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 599 | RSL_IE_RequestRef req_ref, |
| 600 | RSL_LV full_imm_ass_info, |
Harald Welte | fff6930 | 2017-12-07 17:53:42 +0100 | [diff] [blame] | 601 | RSL_LV ms_identity, |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 602 | |
Harald Welte | 9958a4d | 2017-12-14 21:21:33 +0100 | [diff] [blame] | 603 | uint16_t ipa_conn_id, |
| 604 | uint16_t ipa_local_port, |
| 605 | uint16_t ipa_remote_port, |
| 606 | uint32_t ipa_local_ip, |
| 607 | uint32_t ipa_remote_ip, |
| 608 | uint8_t ipa_rtp_pt, |
| 609 | uint8_t ipa_rtp_pt2, |
| 610 | RSL_IE_IPA_ConnectionStats ipa_stats, |
| 611 | RSL_IE_IPA_SpeechMode ipa_speech_mode, |
| 612 | |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 613 | RSL_LV other |
| 614 | } |
| 615 | |
| 616 | type record RSL_IE { |
| 617 | RSL_IE_Type iei, |
| 618 | RSL_IE_Body body |
| 619 | } with { variant (body) "CROSSTAG( |
| 620 | chan_nr, iei = RSL_IE_CHAN_NR; |
| 621 | link_id, iei = RSL_IE_LINK_IDENT; |
| 622 | l3_info, iei = RSL_IE_L3_INFO; |
| 623 | rlm_cause, iei = RSL_IE_RLM_CAUSE; |
| 624 | release_mode, iei = RSL_IE_RELEASE_MODE; |
| 625 | act_type, iei = RSL_IE_ACT_TYPE; |
| 626 | chan_mode, iei = RSL_IE_CHAN_MODE; |
| 627 | handover_ref, iei = RSL_IE_HANDO_REF; |
| 628 | bs_power, iei = RSL_IE_BS_POWER; |
| 629 | ms_power, iei = RSL_IE_MS_POWER; |
| 630 | timing_adv, iei = RSL_IE_TIMING_ADVANCE; |
| 631 | multirate_ctrl, iei = RSL_IE_MR_CONTROL; |
| 632 | |
| 633 | frame_nr, iei = RSL_IE_FRAME_NUMBER; |
| 634 | cause, iei = RSL_IE_CAUSE; |
| 635 | access_delay, iei = RSL_IE_ACCESS_DELAY; |
Harald Welte | d5f521e | 2017-12-07 17:53:06 +0100 | [diff] [blame] | 636 | rach_load, iei = RSL_IE_RACH_LOAD; |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 637 | meas_res_nr, iei = RSL_IE_MEAS_RES_NR; |
| 638 | l1_info, iei = RSL_IE_L1_INFO; |
| 639 | sysinfo_type, iei = RSL_IE_SYSINFO_TYPE; |
| 640 | paging_load, iei = RSL_IE_PAGING_LOAD; |
| 641 | paging_group, iei = RSL_IE_PAGING_GROUP; |
| 642 | chan_needed, iei = RSL_IE_CHAN_NEEDED; |
| 643 | starting_time, iei = RSL_IE_STARTNG_TIME; |
Harald Welte | 73cd271 | 2017-12-17 00:44:52 +0100 | [diff] [blame] | 644 | encr_info, iei = RSL_IE_ENCR_INFO; |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 645 | |
| 646 | req_ref, iei = RSL_IE_REQ_REFERENCE; |
Harald Welte | fff6930 | 2017-12-07 17:53:42 +0100 | [diff] [blame] | 647 | full_imm_ass_info, iei = RSL_IE_FULL_IMM_ASS_INFO; |
| 648 | ms_identity, iei = RSL_IE_MS_IDENTITY; |
| 649 | other, iei = RSL_IE_FULL_BCCH_INFO; |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 650 | |
Harald Welte | 9958a4d | 2017-12-14 21:21:33 +0100 | [diff] [blame] | 651 | ipa_conn_id, iei = RSL_IE_IPAC_CONN_ID; |
| 652 | ipa_remote_ip, iei = RSL_IE_IPAC_REMOTE_IP; |
| 653 | ipa_remote_port, iei = RSL_IE_IPAC_REMOTE_PORT; |
| 654 | ipa_local_ip, iei = RSL_IE_IPAC_LOCAL_IP; |
| 655 | ipa_local_port, iei = RSL_IE_IPAC_LOCAL_PORT; |
| 656 | ipa_rtp_pt, iei = RSL_IE_IPAC_RTP_PAYLOAD; |
| 657 | ipa_rtp_pt2, iei = RSL_IE_IPAC_RTP_PAYLOAD2; |
| 658 | ipa_stats, iei = RSL_IE_IPAC_CONN_STAT; |
| 659 | ipa_speech_mode, iei = RSL_IE_IPAC_SPEECH_MODE; |
| 660 | |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 661 | other, OTHERWISE; |
| 662 | )" }; |
| 663 | |
Harald Welte | 735dd07 | 2017-12-12 14:55:17 +0100 | [diff] [blame] | 664 | /* For some reason the TTCN-3 RAW codec cannot automatically figure out the IEI |
| 665 | * that it needs to set for a given union-choice (body). So we have to explicitly |
| 666 | * specify the IEI by the caller :( */ |
| 667 | template RSL_IE t_RSL_IE(RSL_IE_Type iei, template RSL_IE_Body body) := { |
| 668 | iei := iei, |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 669 | body := body |
| 670 | } |
| 671 | |
Harald Welte | c287775 | 2017-12-07 17:54:35 +0100 | [diff] [blame] | 672 | template RSL_IE tr_RSL_IE(template RSL_IE_Body body) := { |
| 673 | iei := ?, /* overwritten? */ |
| 674 | body := body |
| 675 | } |
| 676 | |
| 677 | |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 678 | type record of RSL_IE RSL_IE_List; |
| 679 | |
| 680 | type record RSL_Message { |
| 681 | RSL_MessageDiscriminator msg_disc, |
| 682 | RSL_MessageType msg_type, |
| 683 | RSL_IE_List ies optional |
| 684 | } |
| 685 | |
| 686 | external function enc_RSL_Message(in RSL_Message msg) return octetstring |
| 687 | with { extension "prototype(convert) encode(RAW)" }; |
| 688 | external function dec_RSL_Message(in octetstring stream) return RSL_Message |
| 689 | with { extension "prototype(convert) decode(RAW)" }; |
| 690 | |
Harald Welte | bc330be | 2017-12-09 00:56:36 +0100 | [diff] [blame] | 691 | template RSL_Message tr_RSL_MsgDiscType(template RSL_MessageDiscriminator m_disc, |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 692 | RSL_MessageType m_type) := { |
| 693 | msg_disc := m_disc, |
| 694 | msg_type := m_type, |
| 695 | ies := * |
| 696 | } |
| 697 | |
Harald Welte | 4a26736 | 2017-12-09 17:49:32 +0100 | [diff] [blame] | 698 | template RSL_Message ts_RSL_MsgDiscType(template RSL_MessageDiscriminator m_disc, |
| 699 | template RSL_MessageType msg_type, |
| 700 | template RSL_IE_List ies := omit) := { |
| 701 | msg_disc := m_disc, |
| 702 | msg_type := msg_type, |
| 703 | ies := ies |
| 704 | } |
| 705 | |
Harald Welte | bc330be | 2017-12-09 00:56:36 +0100 | [diff] [blame] | 706 | template RSL_Message tr_RSL_MsgType(template RSL_MessageType msg_type) := { |
| 707 | msg_disc := ?, |
| 708 | msg_type := msg_type, |
| 709 | ies := * |
| 710 | } |
| 711 | |
| 712 | /* Common Channel Management */ |
| 713 | template RSL_Message tr_RSL_MsgTypeC(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := { |
| 714 | msg_disc := { RSL_MDISC_CCHAN, ? } |
| 715 | } |
| 716 | |
| 717 | /* RLL */ |
| 718 | template RSL_Message tr_RSL_MsgTypeR(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := { |
| 719 | msg_disc := { RSL_MDISC_RLL, true } |
| 720 | } |
| 721 | |
| 722 | /* Dedicated Channel Management */ |
| 723 | template RSL_Message tr_RSL_MsgTypeD(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := { |
| 724 | msg_disc := { RSL_MDISC_DCHAN, ? } |
| 725 | } |
| 726 | |
| 727 | /* Dedicated Channel Management */ |
| 728 | template RSL_Message tr_RSL_MsgTypeT(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := { |
| 729 | msg_disc := { RSL_MDISC_TRX_MGMT, ? } |
| 730 | } |
| 731 | |
| 732 | |
| 733 | /* dedicated channel or RLL */ |
| 734 | template RSL_Message tr_RSL_MsgTypeDR(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := { |
Harald Welte | e540822 | 2018-01-29 21:57:58 +0100 | [diff] [blame] | 735 | msg_disc := ({RSL_MDISC_DCHAN,?}, {RSL_MDISC_RLL,?}, {RSL_MDISC_IPACCESS,false}) |
Harald Welte | bc330be | 2017-12-09 00:56:36 +0100 | [diff] [blame] | 736 | } |
| 737 | |
| 738 | |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 739 | /* 8.3.1 BSC -> BTS */ |
| 740 | template RSL_Message ts_RSL_DATA_REQ(RslChannelNr chan_nr, RslLinkId link_id, octetstring l3_info) := { |
| 741 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, true), |
| 742 | msg_type := RSL_MT_DATA_REQ, |
| 743 | ies :={ |
Harald Welte | 735dd07 | 2017-12-12 14:55:17 +0100 | [diff] [blame] | 744 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 745 | t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}), |
| 746 | 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] | 747 | } |
| 748 | } |
| 749 | |
Harald Welte | 7794d5b | 2017-12-16 23:00:20 +0100 | [diff] [blame] | 750 | template RSL_Message tr_RSL_DATA_REQ(template RslChannelNr chan_nr :=?, |
| 751 | template RslLinkId link_id := ?, |
| 752 | template octetstring l3_info := ?) := { |
| 753 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, true), |
| 754 | msg_type := RSL_MT_DATA_REQ, |
| 755 | ies :={ |
| 756 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
| 757 | tr_RSL_IE(RSL_IE_Body:{link_id := link_id}), |
| 758 | tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)}) |
| 759 | } |
| 760 | } |
| 761 | |
| 762 | |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 763 | /* 8.3.2 BTS -> BSC */ |
| 764 | template RSL_Message ts_RSL_DATA_IND(RslChannelNr chan_nr, RslLinkId link_id, octetstring l3_info) := { |
| 765 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, true), |
| 766 | msg_type := RSL_MT_DATA_IND, |
| 767 | ies :={ |
Harald Welte | 735dd07 | 2017-12-12 14:55:17 +0100 | [diff] [blame] | 768 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 769 | t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}), |
| 770 | 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] | 771 | } |
| 772 | } |
Harald Welte | 9abd128 | 2018-02-19 19:18:17 +0100 | [diff] [blame] | 773 | template RSL_Message tr_RSL_DATA_IND(template RslChannelNr chan_nr, template RslLinkId link_id, |
| 774 | template octetstring l3_info := ?) := { |
| 775 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, true), |
| 776 | msg_type := RSL_MT_DATA_IND, |
| 777 | ies :={ |
| 778 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
| 779 | tr_RSL_IE(RSL_IE_Body:{link_id := link_id}), |
| 780 | tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)}) |
| 781 | } |
| 782 | } |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 783 | |
| 784 | /* 8.3.3 BTS -> BSC */ |
| 785 | template RSL_Message ts_RSL_ERROR_IND(RslChannelNr chan_nr, RslLinkId link_id, RSL_Cause cause) := { |
| 786 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false), |
| 787 | msg_type := RSL_MT_ERROR_IND, |
| 788 | ies :={ |
Harald Welte | 735dd07 | 2017-12-12 14:55:17 +0100 | [diff] [blame] | 789 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 790 | t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}), |
| 791 | 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] | 792 | } |
| 793 | } |
Harald Welte | 9abd128 | 2018-02-19 19:18:17 +0100 | [diff] [blame] | 794 | template RSL_Message tr_RSL_ERROR_IND(template RslChannelNr chan_nr, template RslLinkId link_id, |
| 795 | template RSL_Cause cause := ?) := { |
| 796 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false), |
| 797 | msg_type := RSL_MT_ERROR_IND, |
| 798 | ies :={ |
| 799 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
| 800 | tr_RSL_IE(RSL_IE_Body:{link_id := link_id}), |
| 801 | tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)}) |
| 802 | } |
| 803 | } |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 804 | |
| 805 | /* 8.3.6 BTS -> BSC */ |
| 806 | template RSL_Message ts_RSL_EST_IND(RslChannelNr chan_nr, RslLinkId link_id, octetstring l3_info) := { |
| 807 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false), |
| 808 | msg_type := RSL_MT_EST_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}), |
| 812 | 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] | 813 | } |
| 814 | } |
Harald Welte | 9abd128 | 2018-02-19 19:18:17 +0100 | [diff] [blame] | 815 | template RSL_Message tr_RSL_EST_IND(template RslChannelNr chan_nr, template RslLinkId link_id, |
| 816 | template octetstring l3_info := ?) := { |
| 817 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false), |
| 818 | msg_type := RSL_MT_EST_IND, |
| 819 | ies := { |
| 820 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
| 821 | tr_RSL_IE(RSL_IE_Body:{link_id := link_id}), |
| 822 | tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)}) |
| 823 | } |
| 824 | } |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 825 | |
| 826 | /* 8.3.7 BSC -> BTS */ |
| 827 | template RSL_Message ts_RSL_REL_REQ(RslChannelNr chan_nr, RslLinkId link_id) := { |
| 828 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false), |
| 829 | msg_type := RSL_MT_REL_REQ, |
| 830 | ies :={ |
Harald Welte | 735dd07 | 2017-12-12 14:55:17 +0100 | [diff] [blame] | 831 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 832 | 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] | 833 | } |
| 834 | } |
Harald Welte | e8a5ab1 | 2017-12-09 22:34:57 +0100 | [diff] [blame] | 835 | template RSL_Message tr_RSL_REL_REQ(template RslChannelNr chan_nr, |
| 836 | template RslLinkId link_id) := { |
| 837 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false), |
| 838 | msg_type := RSL_MT_REL_REQ, |
| 839 | ies :={ |
| 840 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
| 841 | tr_RSL_IE(RSL_IE_Body:{link_id := link_id}), |
| 842 | * |
| 843 | } |
| 844 | } |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 845 | |
| 846 | /* 8.3.8 BTS -> BSC */ |
| 847 | template RSL_Message ts_RSL_REL_CONF(RslChannelNr chan_nr, RslLinkId link_id) := { |
| 848 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false), |
| 849 | msg_type := RSL_MT_REL_CONF, |
| 850 | ies :={ |
Harald Welte | 735dd07 | 2017-12-12 14:55:17 +0100 | [diff] [blame] | 851 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 852 | 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] | 853 | } |
| 854 | } |
Harald Welte | 9abd128 | 2018-02-19 19:18:17 +0100 | [diff] [blame] | 855 | template RSL_Message tr_RSL_REL_CONF(template RslChannelNr chan_nr, template RslLinkId link_id) := { |
| 856 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false), |
| 857 | msg_type := RSL_MT_REL_CONF, |
| 858 | ies :={ |
| 859 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
| 860 | tr_RSL_IE(RSL_IE_Body:{link_id := link_id}) |
| 861 | } |
| 862 | } |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 863 | |
| 864 | /* 8.3.9 BTS -> BSC */ |
| 865 | template RSL_Message ts_RSL_REL_IND(RslChannelNr chan_nr, RslLinkId link_id) := { |
| 866 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false), |
| 867 | msg_type := RSL_MT_REL_IND, |
| 868 | ies :={ |
Harald Welte | 735dd07 | 2017-12-12 14:55:17 +0100 | [diff] [blame] | 869 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 870 | 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] | 871 | } |
| 872 | } |
Harald Welte | 9abd128 | 2018-02-19 19:18:17 +0100 | [diff] [blame] | 873 | template RSL_Message tr_RSL_REL_IND(template RslChannelNr chan_nr, template RslLinkId link_id) := { |
| 874 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false), |
| 875 | msg_type := RSL_MT_REL_IND, |
| 876 | ies :={ |
| 877 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
| 878 | tr_RSL_IE(RSL_IE_Body:{link_id := link_id}) |
| 879 | } |
| 880 | } |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 881 | |
| 882 | /* 8.3.10 BSC -> BTS */ |
| 883 | template RSL_Message ts_RSL_UNITDATA_REQ(RslChannelNr chan_nr, RslLinkId link_id, octetstring l3_info) |
| 884 | modifies ts_RSL_DATA_REQ := { |
| 885 | msg_type := RSL_MT_UNIT_DATA_REQ |
| 886 | } |
| 887 | |
| 888 | /* 8.3.11 BTS -> BSC */ |
| 889 | template RSL_Message ts_RSL_UNITDATA_IND(RslChannelNr chan_nr, RslLinkId link_id, octetstring l3_info) |
| 890 | modifies ts_RSL_DATA_IND := { |
| 891 | msg_type := RSL_MT_UNIT_DATA_IND |
| 892 | } |
| 893 | |
| 894 | |
| 895 | /* DEDICATED CANNEL MANAGEMENT MESSAGES */ |
| 896 | |
| 897 | /* 8.4.1 BSC -> BTS */ |
| 898 | template RSL_Message ts_RSL_CHAN_ACT(RslChannelNr chan_nr, RSL_IE_ChannelMode mode) := { |
| 899 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
| 900 | msg_type := RSL_MT_CHAN_ACTIV, |
| 901 | ies :={ |
Harald Welte | 735dd07 | 2017-12-12 14:55:17 +0100 | [diff] [blame] | 902 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 903 | t_RSL_IE(RSL_IE_ACT_TYPE, RSL_IE_Body:{act_type := t_RSL_IE_ActType}), |
| 904 | 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] | 905 | /* lots of optional IEs */ |
| 906 | } |
| 907 | } |
| 908 | |
| 909 | /* 8.4.2 BTS -> BSC */ |
| 910 | template RSL_Message ts_RSL_CHAN_ACT_ACK(RslChannelNr chan_nr, GsmFrameNumber fn) := { |
| 911 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
| 912 | msg_type := RSL_MT_CHAN_ACTIV_ACK, |
| 913 | ies :={ |
Harald Welte | 735dd07 | 2017-12-12 14:55:17 +0100 | [diff] [blame] | 914 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 915 | 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] | 916 | } |
| 917 | } |
Harald Welte | 9abd128 | 2018-02-19 19:18:17 +0100 | [diff] [blame] | 918 | template RSL_Message tr_RSL_CHAN_ACT_ACK(template RslChannelNr chan_nr) := { |
| 919 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
| 920 | msg_type := RSL_MT_CHAN_ACTIV_ACK, |
| 921 | ies := { |
| 922 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
| 923 | tr_RSL_IE(RSL_IE_Body:{frame_nr := ?}) |
| 924 | } |
| 925 | } |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 926 | |
| 927 | /* 8.4.3 BTS -> BSC */ |
| 928 | template RSL_Message ts_RSL_CHAN_ACT_NACK(RslChannelNr chan_nr, RSL_Cause cause) := { |
| 929 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
| 930 | msg_type := RSL_MT_CHAN_ACTIV_NACK, |
| 931 | ies :={ |
Harald Welte | 735dd07 | 2017-12-12 14:55:17 +0100 | [diff] [blame] | 932 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 933 | 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] | 934 | } |
| 935 | } |
Harald Welte | 9abd128 | 2018-02-19 19:18:17 +0100 | [diff] [blame] | 936 | template RSL_Message tr_RSL_CHAN_ACT_NACK(template RslChannelNr chan_nr, |
| 937 | template RSL_Cause cause := ?) := { |
| 938 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
| 939 | msg_type := RSL_MT_CHAN_ACTIV_NACK, |
| 940 | ies := { |
| 941 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
| 942 | tr_RSL_IE(RSL_IE_Body:{cause := ?}) |
| 943 | } |
| 944 | } |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 945 | |
| 946 | /* 8.4.4 BTS -> BSC */ |
| 947 | template RSL_Message ts_RSL_CONN_FAIL_IND(RslChannelNr chan_nr, RSL_Cause cause) := { |
| 948 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
| 949 | msg_type := RSL_MT_CONN_FAIL, |
| 950 | ies :={ |
Harald Welte | 735dd07 | 2017-12-12 14:55:17 +0100 | [diff] [blame] | 951 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 952 | 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] | 953 | } |
| 954 | } |
Harald Welte | 9abd128 | 2018-02-19 19:18:17 +0100 | [diff] [blame] | 955 | template RSL_Message tr_RSL_CONN_FAIL_IND(template RslChannelNr chan_nr, |
| 956 | template RSL_Cause cause := ?) := { |
| 957 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
| 958 | msg_type := RSL_MT_CONN_FAIL, |
| 959 | ies :={ |
| 960 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
| 961 | tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)}) |
| 962 | } |
| 963 | } |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 964 | |
Harald Welte | e8a5ab1 | 2017-12-09 22:34:57 +0100 | [diff] [blame] | 965 | /* 8.4.5 BSC -> BTS */ |
| 966 | template RSL_Message tr_RSL_DEACT_SACCH(template RslChannelNr chan_nr) := { |
| 967 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
| 968 | msg_type := RSL_MT_DEACTIVATE_SACCH, |
| 969 | ies := { |
| 970 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}) |
| 971 | } |
| 972 | } |
Harald Welte | 9abd128 | 2018-02-19 19:18:17 +0100 | [diff] [blame] | 973 | template RSL_Message ts_RSL_DEACT_SACCH(RslChannelNr chan_nr) := { |
| 974 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
| 975 | msg_type := RSL_MT_DEACTIVATE_SACCH, |
| 976 | ies := { |
| 977 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}) |
| 978 | } |
| 979 | } |
| 980 | |
Harald Welte | e8a5ab1 | 2017-12-09 22:34:57 +0100 | [diff] [blame] | 981 | |
Harald Welte | 73cd271 | 2017-12-17 00:44:52 +0100 | [diff] [blame] | 982 | /* 8.4.6 BSC ->BTS */ |
| 983 | template RSL_Message tr_RSL_ENCR_CMD(template RslChannelNr chan_nr, |
| 984 | template RslLinkId link_id := ?, |
| 985 | template OCT1 alg := ?, |
| 986 | template octetstring key := ?, |
| 987 | template octetstring l3_info := ?) := { |
| 988 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
| 989 | msg_type := RSL_MT_ENCR_CMD, |
| 990 | ies := { |
| 991 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
| 992 | tr_RSL_IE(RSL_IE_Body:{encr_info := tr_RSL_IE_EncrInfo(alg, key)}), |
| 993 | tr_RSL_IE(RSL_IE_Body:{link_id := link_id}), |
| 994 | tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)}) |
| 995 | } |
| 996 | } |
Harald Welte | 9abd128 | 2018-02-19 19:18:17 +0100 | [diff] [blame] | 997 | template RSL_Message ts_RSL_ENCR_CMD(RslChannelNr chan_nr, RslLinkId link_id, |
| 998 | OCT1 alg, octetstring key, |
| 999 | octetstring l3_info) := { |
| 1000 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
| 1001 | msg_type := RSL_MT_ENCR_CMD, |
| 1002 | ies := { |
| 1003 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 1004 | t_RSL_IE(RSL_IE_ENCR_INFO, RSL_IE_Body:{encr_info := tr_RSL_IE_EncrInfo(alg, key)}), |
| 1005 | t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}), |
| 1006 | t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)}) |
| 1007 | } |
| 1008 | } |
Harald Welte | 73cd271 | 2017-12-17 00:44:52 +0100 | [diff] [blame] | 1009 | |
Harald Welte | 7794d5b | 2017-12-16 23:00:20 +0100 | [diff] [blame] | 1010 | /* 8.4.10 BTS -> BSC */ |
| 1011 | template RSL_Message ts_RSL_MODE_MODIFY_ACK(RslChannelNr chan_nr) := { |
| 1012 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
| 1013 | msg_type := RSL_MT_MODE_MODIFY_ACK, |
| 1014 | ies := { |
| 1015 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}) |
| 1016 | } |
| 1017 | } |
Harald Welte | 9abd128 | 2018-02-19 19:18:17 +0100 | [diff] [blame] | 1018 | template RSL_Message tr_RSL_MODE_MODIFY_ACK(template RslChannelNr chan_nr) := { |
| 1019 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
| 1020 | msg_type := RSL_MT_MODE_MODIFY_ACK, |
| 1021 | ies := { |
| 1022 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}) |
| 1023 | } |
| 1024 | } |
Harald Welte | 7794d5b | 2017-12-16 23:00:20 +0100 | [diff] [blame] | 1025 | |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 1026 | /* 8.4.11 BTS -> BSC */ |
Harald Welte | 9abd128 | 2018-02-19 19:18:17 +0100 | [diff] [blame] | 1027 | template RSL_Message ts_RSL_MODE_MODIFY_NACK(RslChannelNr chan_nr, RSL_Cause cause) := { |
| 1028 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
| 1029 | msg_type := RSL_MT_MODE_MODIFY_NACK, |
| 1030 | ies := { |
| 1031 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 1032 | t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)}) |
| 1033 | } |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 1034 | } |
Harald Welte | 9abd128 | 2018-02-19 19:18:17 +0100 | [diff] [blame] | 1035 | template RSL_Message tr_RSL_MODE_MODIFY_NACK(template RslChannelNr chan_nr, |
| 1036 | template RSL_Cause cause) := { |
| 1037 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
| 1038 | msg_type := RSL_MT_MODE_MODIFY_NACK, |
| 1039 | ies := { |
| 1040 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
| 1041 | tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)}) |
| 1042 | } |
| 1043 | } |
| 1044 | |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 1045 | |
Harald Welte | 6a8199d | 2018-01-29 21:58:53 +0100 | [diff] [blame] | 1046 | /* 8.4.14: BTS <- BSC */ |
| 1047 | template RSL_Message tr_RSL_RF_CHAN_REL(template RslChannelNr chan_nr) := { |
| 1048 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
| 1049 | msg_type := RSL_MT_RF_CHAN_REL, |
| 1050 | ies := { |
| 1051 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}) |
| 1052 | } |
| 1053 | } |
Harald Welte | 9abd128 | 2018-02-19 19:18:17 +0100 | [diff] [blame] | 1054 | template RSL_Message ts_RSL_RF_CHAN_REL(RslChannelNr chan_nr) := { |
| 1055 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
| 1056 | msg_type := RSL_MT_RF_CHAN_REL, |
| 1057 | ies := { |
| 1058 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}) |
| 1059 | } |
| 1060 | } |
Harald Welte | 6a8199d | 2018-01-29 21:58:53 +0100 | [diff] [blame] | 1061 | |
Harald Welte | 4a26736 | 2017-12-09 17:49:32 +0100 | [diff] [blame] | 1062 | /* 8.4.19 BTS -> BSC */ |
| 1063 | template RSL_Message ts_RSL_RF_CHAN_REL_ACK(RslChannelNr chan_nr) := |
| 1064 | ts_RSL_MsgDiscType(ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
| 1065 | RSL_MT_RF_CHAN_REL_ACK, |
Harald Welte | 735dd07 | 2017-12-12 14:55:17 +0100 | [diff] [blame] | 1066 | { 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] | 1067 | |
Harald Welte | 9abd128 | 2018-02-19 19:18:17 +0100 | [diff] [blame] | 1068 | template RSL_Message tr_RSL_RF_CHAN_REL_ACK(template RslChannelNr chan_nr) := { |
| 1069 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
| 1070 | msg_type := RSL_MT_RF_CHAN_REL_ACK, |
| 1071 | ies := { |
| 1072 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}) |
| 1073 | } |
| 1074 | } |
| 1075 | |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 1076 | /* COMMON CHANNEL MANAGEMENT MESSAGES */ |
| 1077 | |
Harald Welte | 7ae9314 | 2017-12-07 17:56:15 +0100 | [diff] [blame] | 1078 | /* 8.5.2 BTS -> BSC */ |
| 1079 | template RSL_Message ts_RSL_RACH_LOAD_IND(uint16_t slot_ct, uint16_t busy_ct, uint16_t acc_ct) := { |
| 1080 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false), |
| 1081 | msg_type := RSL_MT_CCCH_LOAD_IND, |
| 1082 | ies := { |
Harald Welte | 735dd07 | 2017-12-12 14:55:17 +0100 | [diff] [blame] | 1083 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := t_RslChanNr_RACH(0)}), |
| 1084 | 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] | 1085 | } |
| 1086 | } |
| 1087 | template RSL_Message ts_RSL_PAGING_LOAD_IND(uint16_t buffer_space) := { |
| 1088 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false), |
| 1089 | msg_type := RSL_MT_CCCH_LOAD_IND, |
| 1090 | ies := { |
Harald Welte | 735dd07 | 2017-12-12 14:55:17 +0100 | [diff] [blame] | 1091 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(0)}), |
| 1092 | 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] | 1093 | } |
| 1094 | } |
| 1095 | |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 1096 | /* 8.5.3 BTS -> BSC */ |
Harald Welte | 101fbed | 2017-12-07 17:56:38 +0100 | [diff] [blame] | 1097 | 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] | 1098 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false), |
| 1099 | msg_type := RSL_MT_CHAN_RQD, |
| 1100 | ies := { |
Harald Welte | 735dd07 | 2017-12-12 14:55:17 +0100 | [diff] [blame] | 1101 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := t_RslChanNr_RACH(0)}), |
| 1102 | t_RSL_IE(RSL_IE_REQ_REFERENCE, RSL_IE_Body:{req_ref := ts_RSL_IE_ReqRef(ra, fn)}), |
| 1103 | 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] | 1104 | } |
| 1105 | } |
Harald Welte | 9abd128 | 2018-02-19 19:18:17 +0100 | [diff] [blame] | 1106 | template RSL_Message tr_RSL_CHAN_RQD(template OCT1 ra, template GsmFrameNumber fn := ?, |
| 1107 | template uint8_t acc_del := ?) := { |
| 1108 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false), |
| 1109 | msg_type := RSL_MT_CHAN_RQD, |
| 1110 | ies := { |
| 1111 | tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_RACH(0)}), |
| 1112 | tr_RSL_IE(RSL_IE_Body:{req_ref := tr_RSL_IE_ReqRef(ra, fn)}), |
| 1113 | tr_RSL_IE(RSL_IE_Body:{access_delay := acc_del}) |
| 1114 | } |
| 1115 | } |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 1116 | |
| 1117 | /* 8.5.4 BTS -> BSC */ |
| 1118 | template RSL_Message ts_DELETE_IND(RslChannelNr chan_nr, octetstring imm_ass) := { |
| 1119 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false), |
| 1120 | msg_type := RSL_MT_DELETE_IND, |
| 1121 | ies := { |
Harald Welte | 735dd07 | 2017-12-12 14:55:17 +0100 | [diff] [blame] | 1122 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 1123 | 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] | 1124 | } |
| 1125 | } |
| 1126 | |
Harald Welte | c287775 | 2017-12-07 17:54:35 +0100 | [diff] [blame] | 1127 | /* 8.5.5 BSC -> BTS */ |
| 1128 | template RSL_Message tr_RSL_PAGING_CMD(template octetstring identity, template uint3_t tn := ?) := { |
| 1129 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false), |
| 1130 | msg_type := RSL_MT_PAGING_CMD, |
| 1131 | ies := { |
| 1132 | tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(tn)}), |
| 1133 | tr_RSL_IE(RSL_IE_Body:{paging_group := ?}), |
Harald Welte | 51d7410 | 2017-12-10 23:05:02 +0100 | [diff] [blame] | 1134 | tr_RSL_IE(RSL_IE_Body:{ms_identity := tr_RSL_LV(identity)}), |
Harald Welte | c287775 | 2017-12-07 17:54:35 +0100 | [diff] [blame] | 1135 | * /* opt: channel needed, eMLPP prio */ |
| 1136 | } |
| 1137 | } |
Harald Welte | 9abd128 | 2018-02-19 19:18:17 +0100 | [diff] [blame] | 1138 | template RSL_Message ts_RSL_PAGING_CMD(octetstring identity, uint8_t pg, uint3_t tn := 0) := { |
| 1139 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false), |
| 1140 | msg_type := RSL_MT_PAGING_CMD, |
| 1141 | ies := { |
| 1142 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(tn)}), |
| 1143 | t_RSL_IE(RSL_IE_PAGING_GROUP, RSL_IE_Body:{paging_group := pg}), |
| 1144 | t_RSL_IE(RSL_IE_MS_IDENTITY, RSL_IE_Body:{ms_identity := ts_RSL_LV(identity)}) |
| 1145 | } |
| 1146 | } |
Harald Welte | c287775 | 2017-12-07 17:54:35 +0100 | [diff] [blame] | 1147 | |
| 1148 | /* 8.5.6 BSC -> BTS */ |
| 1149 | template RSL_Message tr_RSL_IMM_ASSIGN(template uint3_t tn := ?) := { |
| 1150 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false), |
| 1151 | msg_type := RSL_MT_IMMEDIATE_ASSIGN_CMD, |
| 1152 | ies := { |
| 1153 | tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(tn)}), |
| 1154 | tr_RSL_IE(RSL_IE_Body:{full_imm_ass_info := ?}) |
| 1155 | } |
| 1156 | } |
Harald Welte | 9abd128 | 2018-02-19 19:18:17 +0100 | [diff] [blame] | 1157 | template RSL_Message ts_RSL_IMM_ASSIGN(octetstring f_ass_inf, uint3_t tn := 0) := { |
| 1158 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false), |
| 1159 | msg_type := RSL_MT_IMMEDIATE_ASSIGN_CMD, |
| 1160 | ies := { |
| 1161 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(tn)}), |
| 1162 | t_RSL_IE(RSL_IE_FULL_IMM_ASS_INFO, RSL_IE_Body:{full_imm_ass_info := ts_RSL_LV(f_ass_inf)}) |
| 1163 | } |
| 1164 | } |
Harald Welte | c287775 | 2017-12-07 17:54:35 +0100 | [diff] [blame] | 1165 | |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 1166 | /* 8.6.4 BTS -> BSC */ |
| 1167 | template RSL_Message ts_RSL_ERROR_REPORT(RSL_Cause cause) := { |
| 1168 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false), |
| 1169 | msg_type := RSL_MT_ERROR_IND, |
| 1170 | ies := { |
Harald Welte | 735dd07 | 2017-12-12 14:55:17 +0100 | [diff] [blame] | 1171 | 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] | 1172 | } |
| 1173 | } |
| 1174 | |
Harald Welte | 9958a4d | 2017-12-14 21:21:33 +0100 | [diff] [blame] | 1175 | |
| 1176 | /* Abis/IP specific messages */ |
| 1177 | |
| 1178 | template RSL_Message tr_RSL_IPA_CRCX(template RslChannelNr chan_nr) := { |
| 1179 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false), |
| 1180 | msg_type := RSL_MT_IPAC_CRCX, |
| 1181 | ies := { |
| 1182 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
| 1183 | * |
| 1184 | } |
| 1185 | } |
Harald Welte | 9abd128 | 2018-02-19 19:18:17 +0100 | [diff] [blame] | 1186 | template RSL_Message ts_RSL_IPA_CRCX(RslChannelNr chan_nr) := { |
| 1187 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false), |
| 1188 | msg_type := RSL_MT_IPAC_CRCX, |
| 1189 | ies := { |
| 1190 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}) |
| 1191 | } |
| 1192 | } |
| 1193 | |
Harald Welte | 9958a4d | 2017-12-14 21:21:33 +0100 | [diff] [blame] | 1194 | |
| 1195 | template RSL_Message ts_RSL_IPA_CRCX_ACK(RslChannelNr chan_nr, |
| 1196 | uint16_t ipa_conn_id, uint32_t local_ip, |
| 1197 | uint16_t local_port, uint7_t rtp_pt2) := { |
| 1198 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false), |
| 1199 | msg_type := RSL_MT_IPAC_CRCX_ACK, |
| 1200 | ies := { |
| 1201 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 1202 | t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}), |
| 1203 | t_RSL_IE(RSL_IE_IPAC_LOCAL_IP, RSL_IE_Body:{ipa_local_ip := local_ip}), |
| 1204 | t_RSL_IE(RSL_IE_IPAC_LOCAL_PORT, RSL_IE_Body:{ipa_local_port := local_port}), |
| 1205 | t_RSL_IE(RSL_IE_IPAC_RTP_PAYLOAD2, RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2}) |
| 1206 | } |
| 1207 | } |
Harald Welte | 9abd128 | 2018-02-19 19:18:17 +0100 | [diff] [blame] | 1208 | template RSL_Message tr_RSL_IPA_CRCX_ACK(template RslChannelNr chan_nr, |
| 1209 | template uint16_t ipa_conn_id, |
| 1210 | template uint32_t local_ip, |
| 1211 | template uint16_t local_port, |
| 1212 | template uint7_t rtp_pt2) := { |
| 1213 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false), |
| 1214 | msg_type := RSL_MT_IPAC_CRCX_ACK, |
| 1215 | ies := { |
| 1216 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
| 1217 | tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}), |
| 1218 | tr_RSL_IE(RSL_IE_Body:{ipa_local_ip := local_ip}), |
| 1219 | tr_RSL_IE(RSL_IE_Body:{ipa_local_port := local_port}), |
| 1220 | tr_RSL_IE(RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2}) |
| 1221 | } |
| 1222 | } |
Harald Welte | 9958a4d | 2017-12-14 21:21:33 +0100 | [diff] [blame] | 1223 | |
| 1224 | template RSL_Message ts_RSL_IPA_CRCX_NACK(RslChannelNr chan_nr, RSL_Cause cause) := { |
| 1225 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false), |
| 1226 | msg_type := RSL_MT_IPAC_CRCX_NACK, |
| 1227 | ies := { |
| 1228 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 1229 | t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)}) |
| 1230 | } |
| 1231 | } |
Harald Welte | 9abd128 | 2018-02-19 19:18:17 +0100 | [diff] [blame] | 1232 | template RSL_Message tr_RSL_IPA_CRCX_NACK(template RslChannelNr chan_nr, |
| 1233 | template RSL_Cause cause := ?) := { |
| 1234 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false), |
| 1235 | msg_type := RSL_MT_IPAC_CRCX_NACK, |
| 1236 | ies := { |
| 1237 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
| 1238 | tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)}) |
| 1239 | } |
| 1240 | } |
Harald Welte | 9958a4d | 2017-12-14 21:21:33 +0100 | [diff] [blame] | 1241 | |
| 1242 | template RSL_Message tr_RSL_IPA_MDCX(template RslChannelNr chan_nr, |
| 1243 | template uint16_t ipa_conn_id) := { |
| 1244 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false), |
| 1245 | msg_type := RSL_MT_IPAC_MDCX, |
| 1246 | ies := { |
| 1247 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
| 1248 | tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}), |
| 1249 | * |
| 1250 | } |
| 1251 | } |
| 1252 | |
| 1253 | template RSL_Message ts_RSL_IPA_MDCX_ACK(RslChannelNr chan_nr, template uint16_t ipa_conn_id, |
| 1254 | uint32_t remote_ip, uint16_t remote_port, |
| 1255 | uint7_t rtp_pt2) := { |
| 1256 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false), |
Harald Welte | 71b5ec8 | 2017-12-16 23:01:10 +0100 | [diff] [blame] | 1257 | msg_type := RSL_MT_IPAC_MDCX_ACK, |
Harald Welte | 9958a4d | 2017-12-14 21:21:33 +0100 | [diff] [blame] | 1258 | ies := { |
| 1259 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 1260 | /* optional */ |
| 1261 | t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}), |
| 1262 | t_RSL_IE(RSL_IE_IPAC_REMOTE_IP, RSL_IE_Body:{ipa_remote_ip := remote_ip}), |
| 1263 | t_RSL_IE(RSL_IE_IPAC_REMOTE_PORT, RSL_IE_Body:{ipa_remote_port := remote_port}), |
| 1264 | /* optional: RTP Payload Type */ |
| 1265 | t_RSL_IE(RSL_IE_IPAC_RTP_PAYLOAD2, RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2}) |
| 1266 | } |
| 1267 | } |
| 1268 | |
| 1269 | template RSL_Message ts_RSL_IPA_MDCX_NACK(RslChannelNr chan_nr, RSL_Cause cause, |
| 1270 | template uint16_t ipa_conn_id) := { |
| 1271 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false), |
| 1272 | msg_type := RSL_MT_IPAC_MDCX_NACK, |
| 1273 | ies := { |
| 1274 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 1275 | /* optional connection ID */ |
| 1276 | t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}), |
| 1277 | t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)}) |
| 1278 | } |
| 1279 | } |
| 1280 | |
| 1281 | template RSL_Message ts_RSL_IPA_DLCX_IND(RslChannelNr chan_nr, uint16_t ipa_conn_id, |
| 1282 | RSL_IE_IPA_ConnectionStats stats, RSL_Cause cause) := { |
| 1283 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false), |
| 1284 | msg_type := RSL_MT_IPAC_DLCX_IND, |
| 1285 | ies := { |
| 1286 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 1287 | t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}), |
| 1288 | t_RSL_IE(RSL_IE_IPAC_CONN_STAT, RSL_IE_Body:{ipa_stats := stats}), |
| 1289 | t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)}) |
| 1290 | } |
| 1291 | } |
| 1292 | |
| 1293 | template RSL_Message tr_RSL_IPA_DLCX(template RslChannelNr chan_nr, |
| 1294 | template uint16_t ipa_conn_id := omit) := { |
| 1295 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false), |
| 1296 | msg_type := RSL_MT_IPAC_DLCX, |
| 1297 | ies := { |
| 1298 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
| 1299 | /* FIXME: optional conn_id */ |
| 1300 | * |
| 1301 | } |
| 1302 | } |
| 1303 | |
| 1304 | template RSL_Message ts_RSL_IPA_DLCX_ACK(RslChannelNr chan_nr, template uint16_t ipa_conn_id, |
| 1305 | template RSL_IE_IPA_ConnectionStats stats) := { |
| 1306 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false), |
| 1307 | msg_type := RSL_MT_IPAC_DLCX_ACK, |
| 1308 | ies := { |
| 1309 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 1310 | t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}), |
| 1311 | t_RSL_IE(RSL_IE_IPAC_CONN_STAT, RSL_IE_Body:{ipa_stats := stats}) |
| 1312 | } |
| 1313 | } |
| 1314 | |
| 1315 | template RSL_Message ts_RSL_IPA_DLCX_NACK(RslChannelNr chan_nr, RSL_Cause cause, |
| 1316 | template uint16_t ipa_conn_id) := { |
| 1317 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false), |
| 1318 | msg_type := RSL_MT_IPAC_DLCX_NACK, |
| 1319 | ies := { |
| 1320 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 1321 | /* optional connection ID */ |
| 1322 | t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}), |
| 1323 | t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)}) |
| 1324 | } |
| 1325 | } |
| 1326 | |
| 1327 | template RSL_Message tr_RSL_IPA_PDCH_ACT(template RslChannelNr chan_nr) := { |
| 1328 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false), |
| 1329 | msg_type := RSL_MT_IPAC_PDCH_ACT, |
| 1330 | ies := { |
| 1331 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}) |
| 1332 | } |
| 1333 | } |
| 1334 | |
| 1335 | template RSL_Message ts_RSL_IPA_PDCH_ACT_ACK(RslChannelNr chan_nr, RSL_IE_FrameNumber fn) := { |
| 1336 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false), |
| 1337 | msg_type := RSL_MT_IPAC_PDCH_ACT_ACK, |
| 1338 | ies := { |
| 1339 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 1340 | t_RSL_IE(RSL_IE_FRAME_NUMBER, RSL_IE_Body:{frame_nr := fn}) |
| 1341 | } |
| 1342 | } |
| 1343 | |
| 1344 | template RSL_Message ts_RSL_IPA_PDCH_ACT_NACK(RslChannelNr chan_nr, RSL_Cause cause) := { |
| 1345 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false), |
| 1346 | msg_type := RSL_MT_IPAC_PDCH_ACT_NACK, |
| 1347 | ies := { |
| 1348 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 1349 | t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)}) |
| 1350 | } |
| 1351 | } |
| 1352 | |
| 1353 | template RSL_Message tr_RSL_IPA_PDCH_DEACT(template RslChannelNr chan_nr) := { |
| 1354 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false), |
| 1355 | msg_type := RSL_MT_IPAC_PDCH_DEACT, |
| 1356 | ies := { |
| 1357 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}) |
| 1358 | } |
| 1359 | } |
| 1360 | |
| 1361 | template RSL_Message ts_RSL_IPA_PDCH_DEACT_ACK(RslChannelNr chan_nr) := { |
| 1362 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false), |
| 1363 | msg_type := RSL_MT_IPAC_PDCH_DEACT_ACK, |
| 1364 | ies := { |
| 1365 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}) |
| 1366 | } |
| 1367 | } |
| 1368 | |
| 1369 | template RSL_Message ts_RSL_IPA_PDCH_DEACT_NACK(RslChannelNr chan_nr, RSL_Cause cause) := { |
| 1370 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false), |
| 1371 | msg_type := RSL_MT_IPAC_PDCH_DEACT_NACK, |
| 1372 | ies := { |
| 1373 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 1374 | t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)}) |
| 1375 | } |
| 1376 | } |
| 1377 | |
| 1378 | |
Harald Welte | 6a8199d | 2018-01-29 21:58:53 +0100 | [diff] [blame] | 1379 | function f_rsl_find_ie(RSL_Message msg, RSL_IE_Type iei, out RSL_IE_Body ret) return boolean { |
| 1380 | for (var integer i := 0; i < sizeof(msg.ies); i := i+1) { |
| 1381 | if (msg.ies[i].iei == iei) { |
| 1382 | ret := msg.ies[i].body; |
| 1383 | return true; |
| 1384 | } |
| 1385 | } |
| 1386 | return false; |
| 1387 | } |
| 1388 | |
| 1389 | |
Harald Welte | 9958a4d | 2017-12-14 21:21:33 +0100 | [diff] [blame] | 1390 | |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 1391 | } with { encode "RAW" ; variant "FIELDORDER(msb)" } |