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