Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 1 | module RSL_Types { |
| 2 | |
Vadim Yanitskiy | c06688e | 2020-05-06 15:22:45 +0700 | [diff] [blame] | 3 | /* RSL types defining abstract TTCN-3 data types for the A-bis RSL protocol. |
Harald Welte | 35bb716 | 2018-01-03 21:07:52 +0100 | [diff] [blame] | 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. |
Harald Welte | 34b5a95 | 2019-05-27 11:54:11 +0200 | [diff] [blame] | 12 | * |
| 13 | * SPDX-License-Identifier: GPL-2.0-or-later |
Harald Welte | 35bb716 | 2018-01-03 21:07:52 +0100 | [diff] [blame] | 14 | */ |
| 15 | |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 16 | import from General_Types all; |
| 17 | import from Osmocom_Types all; |
Vadim Yanitskiy | e02dbcc | 2020-08-25 04:20:51 +0700 | [diff] [blame] | 18 | import from GSM_RR_Types all; |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 19 | import from GSM_Types all; |
Vadim Yanitskiy | cc4623d | 2020-03-28 06:14:06 +0700 | [diff] [blame] | 20 | import from MobileL3_CommonIE_Types all; |
| 21 | import from L3_Templates all; |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 22 | |
| 23 | /* Section 9.1 */ |
| 24 | type enumerated RSL_MessageGroup { |
| 25 | RSL_MDISC_RESERVED ('0000000'B), |
| 26 | RSL_MDISC_RLL ('0000001'B), |
| 27 | RSL_MDISC_DCHAN ('0000100'B), |
| 28 | RSL_MDISC_CCHAN ('0000110'B), |
| 29 | RSL_MDISC_TRX_MGMT ('0001000'B), |
| 30 | RSL_MDISC_LCS ('0010000'B), |
| 31 | RSL_MDISC_IPACCESS ('0111111'B) |
| 32 | } with { variant "FIELDLENGTH(7)" }; |
| 33 | |
| 34 | /* Section 9.1 */ |
| 35 | type record RSL_MessageDiscriminator { |
| 36 | RSL_MessageGroup msg_group, |
| 37 | boolean transparent |
| 38 | } with { variant "FIELDORDER(msb)" }; |
| 39 | |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 40 | template (value) RSL_MessageDiscriminator ts_RSL_MsgDisc(RSL_MessageGroup mg, boolean t := true) := { |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 41 | msg_group := mg, |
| 42 | transparent := t |
| 43 | } |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 44 | template RSL_MessageDiscriminator tr_RSL_MsgDisc(template RSL_MessageGroup mg, boolean t := true) := { |
| 45 | msg_group := mg, |
| 46 | transparent := t |
| 47 | } |
| 48 | |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 49 | |
| 50 | /* Section 9.2 */ |
| 51 | type enumerated RSL_MessageType { |
| 52 | /* Radio Link Layer Management */ |
| 53 | RSL_MT_DATA_REQ ('00000001'B), |
| 54 | RSL_MT_DATA_IND ('00000010'B), |
| 55 | RSL_MT_ERROR_IND ('00000011'B), |
| 56 | RSL_MT_EST_REQ ('00000100'B), |
| 57 | RSL_MT_EST_CONF ('00000101'B), |
| 58 | RSL_MT_EST_IND ('00000110'B), |
| 59 | RSL_MT_REL_REQ ('00000111'B), |
| 60 | RSL_MT_REL_CONF ('00001000'B), |
| 61 | RSL_MT_REL_IND ('00001001'B), |
| 62 | RSL_MT_UNIT_DATA_REQ ('00001010'B), |
| 63 | RSL_MT_UNIT_DATA_IND ('00001011'B), |
| 64 | |
| 65 | /* non-standard below */ |
| 66 | RSL_MT_SUSP_REQ ('00001100'B), |
| 67 | RSL_MT_SUSP_CONF ('00001101'B), |
| 68 | RSL_MT_RES_REQ ('00001110'B), |
| 69 | RSL_MT_RECON_REQ ('00001111'B), |
| 70 | |
| 71 | /* Common Channel Management / TRX Management */ |
| 72 | RSL_MT_BCCH_INFO ('00010001'B), |
Harald Welte | 319be82 | 2017-12-07 17:50:26 +0100 | [diff] [blame] | 73 | RSL_MT_CCCH_LOAD_IND ('00010010'B), |
| 74 | RSL_MT_CHAN_RQD ('00010011'B), |
| 75 | RSL_MT_DELETE_IND ('00010100'B), |
| 76 | RSL_MT_PAGING_CMD ('00010101'B), |
| 77 | RSL_MT_IMMEDIATE_ASSIGN_CMD ('00010110'B), |
| 78 | RSL_MT_SMS_BC_REQ ('00010111'B), |
| 79 | RSL_MT_CHAN_CONF ('00011000'B), /* non-standard element */ |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 80 | /* empty */ |
| 81 | RSL_MT_RF_RES_IND ('00011001'B), |
Harald Welte | 319be82 | 2017-12-07 17:50:26 +0100 | [diff] [blame] | 82 | RSL_MT_SACCH_FILL ('00011010'B), |
| 83 | RSL_MT_OVERLOAD ('00011011'B), |
| 84 | RSL_MT_ERROR_REPORT ('00011100'B), |
| 85 | RSL_MT_SMS_BC_CMD ('00011101'B), |
| 86 | RSL_MT_CBCH_LOAD_IND ('00011110'B), |
| 87 | RSL_MT_NOT_CMD ('00011111'B), |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 88 | |
| 89 | /* Dedicate Channel Management */ |
| 90 | RSL_MT_CHAN_ACTIV ('00100001'B), |
Harald Welte | 319be82 | 2017-12-07 17:50:26 +0100 | [diff] [blame] | 91 | RSL_MT_CHAN_ACTIV_ACK ('00100010'B), |
| 92 | RSL_MT_CHAN_ACTIV_NACK ('00100011'B), |
| 93 | RSL_MT_CONN_FAIL ('00100100'B), |
| 94 | RSL_MT_DEACTIVATE_SACCH ('00100101'B), |
| 95 | RSL_MT_ENCR_CMD ('00100110'B), |
| 96 | RSL_MT_HANDO_DET ('00100111'B), |
| 97 | RSL_MT_MEAS_RES ('00101000'B), |
| 98 | RSL_MT_MODE_MODIFY_REQ ('00101001'B), |
| 99 | RSL_MT_MODE_MODIFY_ACK ('00101010'B), |
| 100 | RSL_MT_MODE_MODIFY_NACK ('00101011'B), |
| 101 | RSL_MT_PHY_CONTEXT_REQ ('00101100'B), |
| 102 | RSL_MT_PHY_CONTEXT_CONF ('00101101'B), |
| 103 | RSL_MT_RF_CHAN_REL ('00101110'B), |
| 104 | RSL_MT_MS_POWER_CONTROL ('00101111'B), |
| 105 | RSL_MT_BS_POWER_CONTROL ('00110000'B), /* 0x30 */ |
| 106 | RSL_MT_PREPROC_CONFIG ('00110001'B), |
| 107 | RSL_MT_PREPROC_MEAS_RES ('00110010'B), |
| 108 | RSL_MT_RF_CHAN_REL_ACK ('00110011'B), |
| 109 | RSL_MT_SACCH_INFO_MODIFY('00110100'B), |
| 110 | RSL_MT_TALKER_DET ('00110101'B), |
| 111 | RSL_MT_LISTENER_DET ('00110110'B), |
| 112 | RSL_MT_REMOTE_CODEC_CONF_REP ('00110111'B), |
| 113 | RSL_MT_RTD_REP ('00111000'B), |
| 114 | RSL_MT_PRE_HANDO_NOTIF ('00111001'B), |
| 115 | RSL_MT_MR_CODEC_MOD_REQ ('00111010'B), |
| 116 | RSL_MT_MR_CODEC_MOD_ACK ('00111011'B), |
| 117 | RSL_MT_MR_CODEC_MOD_NACK ('00111100'B), |
| 118 | RSL_MT_MR_CODEC_MOD_PER ('00111101'B), |
| 119 | RSL_MT_TFO_REP ('00111110'B), |
| 120 | RSL_MT_TFO_MOD_REQ ('00111111'B), /* 0x3f */ |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 121 | |
| 122 | RSL_MT_LOCATION_INFO ('01000001'B), |
| 123 | |
| 124 | /* ip.access specific RSL message types */ |
| 125 | RSL_MT_IPAC_DIR_RETR_ENQ ('01000000'B), |
| 126 | |
| 127 | RSL_MT_IPAC_PDCH_ACT ('01001000'B), |
Harald Welte | 319be82 | 2017-12-07 17:50:26 +0100 | [diff] [blame] | 128 | RSL_MT_IPAC_PDCH_ACT_ACK ('01001001'B), |
| 129 | RSL_MT_IPAC_PDCH_ACT_NACK ('01001010'B), |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 130 | RSL_MT_IPAC_PDCH_DEACT ('01001011'B), |
Harald Welte | 319be82 | 2017-12-07 17:50:26 +0100 | [diff] [blame] | 131 | RSL_MT_IPAC_PDCH_DEACT_ACK ('01001100'B), |
| 132 | RSL_MT_IPAC_PDCH_DEACT_NACK ('01001101'B), |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 133 | |
| 134 | RSL_MT_IPAC_CONNECT_MUX ('01010000'B), |
Harald Welte | f307500 | 2017-12-16 22:31:41 +0100 | [diff] [blame] | 135 | RSL_MT_IPAC_CONNECT_MUX_ACK ('01010001'B), |
| 136 | RSL_MT_IPAC_CONNECT_MUX_NACK ('01010010'B), |
| 137 | RSL_MT_IPAC_BIND_MUX ('01010011'B), |
| 138 | RSL_MT_IPAC_BIND_MUX_ACK ('01010100'B), |
| 139 | RSL_MT_IPAC_BIND_MUX_NACK ('01010101'B), |
| 140 | RSL_MT_IPAC_DISC_MUX ('01010110'B), |
| 141 | RSL_MT_IPAC_DISC_MUX_ACK ('01010111'B), |
| 142 | RSL_MT_IPAC_DISC_MUX_NACK ('01011000'B), |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 143 | RSL_MT_IPAC_MEAS_PREPROC_DFT ('01100000'B), |
Harald Welte | f307500 | 2017-12-16 22:31:41 +0100 | [diff] [blame] | 144 | RSL_MT_IPAC_HO_CAN_ENQ ('01100001'B), |
| 145 | RSL_MT_IPAC_HO_CAN_RES ('01100010'B), |
| 146 | RSL_MT_IPAC_CRCX ('01110000'B), |
| 147 | RSL_MT_IPAC_CRCX_ACK ('01110001'B), |
| 148 | RSL_MT_IPAC_CRCX_NACK ('01110010'B), |
| 149 | RSL_MT_IPAC_MDCX ('01110011'B), |
| 150 | RSL_MT_IPAC_MDCX_ACK ('01110100'B), |
| 151 | RSL_MT_IPAC_MDCX_NACK ('01110101'B), |
| 152 | RSL_MT_IPAC_DLCX_IND ('01110110'B), |
| 153 | RSL_MT_IPAC_DLCX ('01110111'B), |
| 154 | RSL_MT_IPAC_DLCX_ACK ('01111000'B), |
Harald Welte | 908ce54 | 2019-09-04 23:05:40 +0200 | [diff] [blame] | 155 | RSL_MT_IPAC_DLCX_NACK ('01111001'B), |
| 156 | |
| 157 | RSL_MT_OSMO_ETWS_CMD ('01111111'B) |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 158 | } with { variant "FIELDLENGTH(8)" }; |
| 159 | |
| 160 | /*! RSL Information Element Identifiers (Chapter 9.3) */ |
| 161 | type enumerated RSL_IE_Type { |
| 162 | RSL_IE_CHAN_NR ('00000001'B), |
Harald Welte | 319be82 | 2017-12-07 17:50:26 +0100 | [diff] [blame] | 163 | RSL_IE_LINK_IDENT ('00000010'B), |
| 164 | RSL_IE_ACT_TYPE ('00000011'B), |
| 165 | RSL_IE_BS_POWER ('00000100'B), |
| 166 | RSL_IE_CHAN_IDENT ('00000101'B), |
| 167 | RSL_IE_CHAN_MODE ('00000110'B), |
| 168 | RSL_IE_ENCR_INFO ('00000111'B), |
| 169 | RSL_IE_FRAME_NUMBER ('00001000'B), |
| 170 | RSL_IE_HANDO_REF ('00001001'B), |
| 171 | RSL_IE_L1_INFO ('00001010'B), |
| 172 | RSL_IE_L3_INFO ('00001011'B), |
| 173 | RSL_IE_MS_IDENTITY ('00001100'B), |
| 174 | RSL_IE_MS_POWER ('00001101'B), |
| 175 | RSL_IE_PAGING_GROUP ('00001110'B), |
| 176 | RSL_IE_PAGING_LOAD ('00001111'B), |
| 177 | RSL_IE_PYHS_CONTEXT ('00010000'B), |
| 178 | RSL_IE_ACCESS_DELAY ('00010001'B), |
| 179 | RSL_IE_RACH_LOAD ('00010010'B), |
| 180 | RSL_IE_REQ_REFERENCE ('00010011'B), |
| 181 | RSL_IE_RELEASE_MODE ('00010100'B), |
| 182 | RSL_IE_RESOURCE_INFO ('00010101'B), |
| 183 | RSL_IE_RLM_CAUSE ('00010110'B), |
| 184 | RSL_IE_STARTNG_TIME ('00010111'B), |
| 185 | RSL_IE_TIMING_ADVANCE ('00011000'B), |
| 186 | RSL_IE_UPLINK_MEAS ('00011001'B), |
| 187 | RSL_IE_CAUSE ('00011010'B), |
| 188 | RSL_IE_MEAS_RES_NR ('00011011'B), |
| 189 | RSL_IE_MSG_ID ('00011100'B), |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 190 | /* reserved */ |
| 191 | RSL_IE_SYSINFO_TYPE ('00011110'B), |
Harald Welte | 319be82 | 2017-12-07 17:50:26 +0100 | [diff] [blame] | 192 | RSL_IE_MS_POWER_PARAM ('00011111'B), |
| 193 | RSL_IE_BS_POWER_PARAM ('00100000'B), |
| 194 | RSL_IE_PREPROC_PARAM ('00100001'B), |
| 195 | RSL_IE_PREPROC_MEAS ('00100010'B), |
| 196 | RSL_IE_IMM_ASS_INFO ('00100011'B),/* Phase 1 (3.6.0), later Full below */ |
| 197 | RSL_IE_SMSCB_INFO ('00100100'B), |
| 198 | RSL_IE_MS_TIMING_OFFSET ('00100101'B), |
| 199 | RSL_IE_ERR_MSG ('00100110'B), |
| 200 | RSL_IE_FULL_BCCH_INFO ('00100111'B), |
| 201 | RSL_IE_CHAN_NEEDED ('00101000'B), |
| 202 | RSL_IE_CB_CMD_TYPE ('00101001'B), |
| 203 | RSL_IE_SMSCB_MSG ('00101010'B), |
| 204 | RSL_IE_FULL_IMM_ASS_INFO ('00101011'B), |
| 205 | RSL_IE_SACCH_INFO ('00101100'B), |
| 206 | RSL_IE_CBCH_LOAD_INFO ('00101101'B), |
| 207 | RSL_IE_SMSCB_CHAN_INDICATOR ('00101110'B), |
| 208 | RSL_IE_GROUP_CALL_REF ('00101111'B), |
| 209 | RSL_IE_CHAN_DESC ('00110000'B), |
| 210 | RSL_IE_NCH_DRX_INFO ('00110001'B), |
| 211 | RSL_IE_CMD_INDICATOR ('00110010'B), |
| 212 | RSL_IE_EMLPP_PRIO ('00110011'B), |
| 213 | RSL_IE_UIC ('00110100'B), |
| 214 | RSL_IE_MAIN_CHAN_REF ('00110101'B), |
| 215 | RSL_IE_MR_CONFIG ('00110110'B), |
| 216 | RSL_IE_MR_CONTROL ('00110111'B), |
| 217 | RSL_IE_SUP_CODEC_TYPES ('00111000'B), |
| 218 | RSL_IE_CODEC_CONFIG ('00111001'B), |
| 219 | RSL_IE_RTD ('00111010'B), |
| 220 | RSL_IE_TFO_STATUS ('00111011'B), |
| 221 | RSL_IE_LLP_APDU ('00111100'B), |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 222 | |
Pau Espin Pedrol | 29c6dfb | 2022-08-08 18:37:56 +0200 | [diff] [blame] | 223 | /* Osmocom extensions */ |
Vadim Yanitskiy | 1f53215 | 2021-11-01 20:37:56 +0300 | [diff] [blame] | 224 | RSL_IE_OSMO_REP_ACCH_CAP ('01100000'B), |
Neels Hofmeyr | 2bef0dd | 2021-04-22 21:46:00 +0000 | [diff] [blame] | 225 | RSL_IE_OSMO_TRAINING_SEQUENCE ('01100001'B), |
Vadim Yanitskiy | a203d3b | 2021-11-01 21:32:31 +0300 | [diff] [blame] | 226 | RSL_IE_OSMO_TOP_ACCH_CAP ('01100010'B), |
Pau Espin Pedrol | 29c6dfb | 2022-08-08 18:37:56 +0200 | [diff] [blame] | 227 | RSL_IE_OSMO_OSMUX_CID ('01100011'B), |
Neels Hofmeyr | 2bef0dd | 2021-04-22 21:46:00 +0000 | [diff] [blame] | 228 | |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 229 | /* ip.access */ |
| 230 | RSL_IE_IPAC_SRTP_CONFIG ('11100000'B), |
Harald Welte | 319be82 | 2017-12-07 17:50:26 +0100 | [diff] [blame] | 231 | RSL_IE_IPAC_PROXY_UDP ('11100001'B), |
| 232 | RSL_IE_IPAC_BSCMPL_TOUT ('11100010'B), |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 233 | |
| 234 | RSL_IE_IPAC_REMOTE_IP ('11110000'B), |
Harald Welte | 319be82 | 2017-12-07 17:50:26 +0100 | [diff] [blame] | 235 | RSL_IE_IPAC_REMOTE_PORT ('11110001'B), |
| 236 | RSL_IE_IPAC_RTP_PAYLOAD ('11110010'B), |
| 237 | RSL_IE_IPAC_LOCAL_PORT ('11110011'B), |
| 238 | RSL_IE_IPAC_SPEECH_MODE ('11110100'B), |
| 239 | RSL_IE_IPAC_LOCAL_IP ('11110101'B), |
| 240 | RSL_IE_IPAC_CONN_STAT ('11110110'B), |
| 241 | RSL_IE_IPAC_HO_C_PARMS ('11110111'B), |
| 242 | RSL_IE_IPAC_CONN_ID ('11111000'B), |
| 243 | RSL_IE_IPAC_RTP_CSD_FMT ('11111001'B), |
| 244 | RSL_IE_IPAC_RTP_JIT_BUF ('11111010'B), |
| 245 | RSL_IE_IPAC_RTP_COMPR ('11111011'B), |
| 246 | RSL_IE_IPAC_RTP_PAYLOAD2 ('11111100'B), |
| 247 | RSL_IE_IPAC_RTP_MPLEX ('11111101'B), |
| 248 | RSL_IE_IPAC_RTP_MPLEX_ID ('11111110'B) |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 249 | } with { variant "FIELDLENGTH(8)" }; |
| 250 | |
| 251 | type record RSL_LV { |
| 252 | uint8_t len, |
| 253 | octetstring payload |
| 254 | } with { variant (len) "LENGTHTO(payload)" } |
| 255 | |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 256 | template (value) RSL_LV ts_RSL_LV(template (value) octetstring pl) := { |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 257 | len := 0, |
| 258 | payload := pl |
| 259 | } |
| 260 | |
Harald Welte | 51d7410 | 2017-12-10 23:05:02 +0100 | [diff] [blame] | 261 | template RSL_LV tr_RSL_LV(template octetstring pl) := { |
| 262 | len := ?, |
| 263 | payload := pl |
| 264 | } |
| 265 | |
Harald Welte | 15bb5b5 | 2017-12-07 17:52:04 +0100 | [diff] [blame] | 266 | type record RSL_L16V { |
| 267 | uint16_t len, |
| 268 | octetstring payload |
| 269 | } with { variant (len) "LENGTHTO(payload)" } |
| 270 | |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 271 | template (value) RSL_L16V ts_RSL_L16V(template (value) octetstring pl) := { |
Harald Welte | 15bb5b5 | 2017-12-07 17:52:04 +0100 | [diff] [blame] | 272 | len := 0, |
| 273 | payload := pl |
| 274 | } |
| 275 | |
Harald Welte | 7794d5b | 2017-12-16 23:00:20 +0100 | [diff] [blame] | 276 | template RSL_L16V tr_RSL_L16V(template octetstring pl) := { |
| 277 | len := ?, |
| 278 | payload := pl |
| 279 | } |
| 280 | |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 281 | type record RSL_IE_V { |
| 282 | uint8_t val |
| 283 | } |
| 284 | |
| 285 | /* 9.3.3 */ |
| 286 | type record RSL_IE_ActivationType { |
| 287 | boolean reactivation, |
| 288 | uint4_t reserved, |
Harald Welte | 921f9e0 | 2019-05-19 22:27:11 +0200 | [diff] [blame] | 289 | RSL_ActivationAbits a_bits |
| 290 | }; |
| 291 | type enumerated RSL_ActivationAbits { |
| 292 | ACT_REL_TO_IMM_ASSIGN ('000'B), |
| 293 | ACT_REL_TO_NORM_ASSIGN ('001'B), |
| 294 | ACT_REL_TO_ASYNC_HANDOVER ('010'B), |
| 295 | ACT_REL_TO_SYNC_HANDOVER ('011'B), |
| 296 | ACT_REL_TO_ADDL_ASSIGN ('100'B), |
| 297 | ACT_REL_TO_MSLOT_CONFIG ('101'B), |
| 298 | ACT_REL_TO_OSMO_PDCH ('111'B) |
| 299 | } with { variant "FIELDLENGTH(3)" }; |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 300 | |
Harald Welte | 921f9e0 | 2019-05-19 22:27:11 +0200 | [diff] [blame] | 301 | const RSL_IE_ActivationType t_RSL_IE_ActType_IA := { |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 302 | reactivation := false, |
| 303 | reserved := 0, |
Harald Welte | 921f9e0 | 2019-05-19 22:27:11 +0200 | [diff] [blame] | 304 | a_bits := ACT_REL_TO_IMM_ASSIGN |
| 305 | } |
| 306 | const RSL_IE_ActivationType t_RSL_IE_ActType_ASS := { |
| 307 | reactivation := false, |
| 308 | reserved := 0, |
| 309 | a_bits := ACT_REL_TO_NORM_ASSIGN |
| 310 | } |
| 311 | const RSL_IE_ActivationType t_RSL_IE_ActType_HO_ASYNC := { |
| 312 | reactivation := false, |
| 313 | reserved := 0, |
| 314 | a_bits := ACT_REL_TO_ASYNC_HANDOVER |
| 315 | } |
| 316 | const RSL_IE_ActivationType t_RSL_IE_ActType_HO_SYNC := { |
| 317 | reactivation := false, |
| 318 | reserved := 0, |
| 319 | a_bits := ACT_REL_TO_SYNC_HANDOVER |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 320 | } |
| 321 | |
Harald Welte | 94e0c34 | 2018-04-07 11:33:23 +0200 | [diff] [blame] | 322 | /* osmocom-style dynamic PDCH */ |
Vadim Yanitskiy | 58b1653 | 2021-10-09 20:27:39 +0600 | [diff] [blame] | 323 | const RSL_IE_ActivationType c_RSL_IE_ActType_PDCH := { |
Harald Welte | 94e0c34 | 2018-04-07 11:33:23 +0200 | [diff] [blame] | 324 | reactivation := false, |
| 325 | reserved := 1, |
Harald Welte | 921f9e0 | 2019-05-19 22:27:11 +0200 | [diff] [blame] | 326 | a_bits := ACT_REL_TO_OSMO_PDCH |
Harald Welte | 94e0c34 | 2018-04-07 11:33:23 +0200 | [diff] [blame] | 327 | } |
| 328 | |
Vadim Yanitskiy | e02dbcc | 2020-08-25 04:20:51 +0700 | [diff] [blame] | 329 | /* 9.3.5 */ |
| 330 | type record RSL_IE_ChannelIdent { |
| 331 | uint8_t len, |
| 332 | /* 3GPP TS 44.018 Channel Description IE (TV) */ |
| 333 | ChannelDescriptionTV ch_desc, |
| 334 | /* 3GPP TS 44.018 Mobile Allocation IE (shall be empty) */ |
| 335 | MobileAllocationTLV ma |
| 336 | } with { variant (len) "LENGTHTO(ch_desc,ma)" }; |
| 337 | |
| 338 | template (value) RSL_IE_ChannelIdent |
| 339 | ts_RSL_ChannelIdent(template (value) ChannelDescription ch_desc) := { |
| 340 | len := 0, /* overwritten */ |
| 341 | ch_desc := { |
| 342 | iei := '64'O, |
| 343 | v := ch_desc |
| 344 | }, |
| 345 | /* Shall be included but empty */ |
| 346 | ma := { |
| 347 | iei := '72'O, |
| 348 | v := { |
| 349 | len := 0, |
| 350 | ma := ''B |
| 351 | } |
| 352 | } |
| 353 | }; |
| 354 | |
| 355 | template RSL_IE_ChannelIdent |
| 356 | tr_RSL_ChannelIdent(template (present) ChannelDescription ch_desc := ?, |
| 357 | template (present) MobileAllocationLV ma := ?) := { |
| 358 | len := ?, |
| 359 | ch_desc := { |
| 360 | iei := '64'O, |
| 361 | v := ch_desc |
| 362 | }, |
| 363 | /* Shall be included but empty */ |
| 364 | ma := { |
| 365 | iei := '72'O, |
| 366 | v := ma |
| 367 | } |
| 368 | }; |
| 369 | |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 370 | /* 9.3.6 */ |
| 371 | type enumerated RSL_SpeechDataInd { |
| 372 | RSL_SPDI_SPEECH ('00000001'B), |
| 373 | RSL_SPDI_DATA ('00000010'B), |
| 374 | RSL_SPDI_SIGN ('00000011'B) |
| 375 | } with { variant "FIELDLENGTH(8)" }; |
| 376 | type enumerated RSL_ChanRateType { |
| 377 | RSL_CHRT_SDCCH ('00000001'B), |
| 378 | RSL_CHRT_TCH_F ('00001000'B), |
| 379 | RSL_CHRT_TCH_H ('00001001'B), |
| 380 | RSL_CHRT_TCH_F_BD_MSLOT ('00001010'B), |
| 381 | RSL_CHRT_TCH_F_DL_MSLOT ('00011010'B), |
| 382 | RSL_CHRT_TCH_F_GROUP ('00011000'B), |
| 383 | RSL_CHRT_TCH_H_GROUP ('00011001'B), |
| 384 | RSL_CHRT_TCH_F_BCAST ('00101000'B), |
Neels Hofmeyr | 2bef0dd | 2021-04-22 21:46:00 +0000 | [diff] [blame] | 385 | RSL_CHRT_TCH_H_BCAST ('00101001'B), |
| 386 | RSL_CHRT_OSMO_TCH_F_VAMOS ('10001000'B), |
| 387 | RSL_CHRT_OSMO_TCH_H_VAMOS ('10001001'B) |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 388 | } with { variant "FIELDLENGTH(8)" }; |
| 389 | type enumerated RSL_SpeechAlgo { |
| 390 | RSL_CMOD_NO_RESOURCE ('00000000'B), |
| 391 | RSL_CMOD_SP_GSM1 ('00000001'B), |
| 392 | RSL_CMOD_SP_GSM2 ('00010001'B), |
| 393 | RSL_CMOD_SP_GSM3 ('00100001'B), |
| 394 | RSL_CMOD_SP_GSM4 ('00110001'B), |
| 395 | RSL_CMOD_SP_GSM5 ('00001001'B), |
| 396 | RSL_CMOD_SP_GSM6 ('00001101'B) |
| 397 | } with { variant "FIELDLENGTH(8)" }; |
| 398 | type record RSL_IE_ChannelMode { |
Harald Welte | 8f2c21d | 2017-12-07 17:52:40 +0100 | [diff] [blame] | 399 | uint8_t len, |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 400 | BIT6 reserved, |
| 401 | boolean dtx_d, |
| 402 | boolean dtx_u, |
| 403 | RSL_SpeechDataInd spd_ind, |
| 404 | RSL_ChanRateType ch_rate_type, |
| 405 | RSL_SpeechAlgo coding_alg_rate |
Harald Welte | 8f2c21d | 2017-12-07 17:52:40 +0100 | [diff] [blame] | 406 | } 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] | 407 | |
Vadim Yanitskiy | 8fc43df | 2020-10-20 02:11:05 +0700 | [diff] [blame] | 408 | template (value) RSL_IE_ChannelMode ts_RSL_ChanMode_SIGN(RSL_ChanRateType t := RSL_CHRT_SDCCH, |
| 409 | boolean dtx_downlink := false) := { |
Harald Welte | 8f2c21d | 2017-12-07 17:52:40 +0100 | [diff] [blame] | 410 | len := 0, /* overwritten */ |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 411 | reserved := '000000'B, |
Stefan Sperling | 4880be4 | 2018-08-07 18:12:59 +0200 | [diff] [blame] | 412 | dtx_d := dtx_downlink, |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 413 | dtx_u := false, |
| 414 | spd_ind := RSL_SPDI_SIGN, |
Philipp Maier | ac69346 | 2020-10-14 20:21:44 +0200 | [diff] [blame] | 415 | ch_rate_type := t, |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 416 | coding_alg_rate := RSL_CMOD_NO_RESOURCE |
| 417 | } |
| 418 | |
Stefan Sperling | 4880be4 | 2018-08-07 18:12:59 +0200 | [diff] [blame] | 419 | template (value) RSL_IE_ChannelMode ts_RSL_ChanMode(RSL_ChanRateType t, RSL_SpeechAlgo alg, |
| 420 | boolean dtx_downlink := false) := { |
Harald Welte | 8f2c21d | 2017-12-07 17:52:40 +0100 | [diff] [blame] | 421 | len := 0, /* overwritten */ |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 422 | reserved := '000000'B, |
Stefan Sperling | 4880be4 | 2018-08-07 18:12:59 +0200 | [diff] [blame] | 423 | dtx_d := dtx_downlink, |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 424 | dtx_u := false, |
| 425 | spd_ind := RSL_SPDI_SPEECH, |
| 426 | ch_rate_type := t, |
| 427 | coding_alg_rate := alg |
| 428 | } |
Harald Welte | 3618d9d | 2018-03-21 18:45:27 +0100 | [diff] [blame] | 429 | template RSL_IE_ChannelMode tr_RSL_ChanMode(template RSL_ChanRateType t, |
| 430 | template RSL_SpeechAlgo alg) := { |
| 431 | len := ?, |
| 432 | reserved := '000000'B, |
| 433 | dtx_d := ?, |
| 434 | dtx_u := ?, |
| 435 | spd_ind := RSL_SPDI_SPEECH, |
| 436 | ch_rate_type := t, |
| 437 | coding_alg_rate := alg |
| 438 | } |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 439 | |
Vadim Yanitskiy | 117c176 | 2020-06-16 01:40:10 +0700 | [diff] [blame] | 440 | /* 9.3.4 BS Power IE */ |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 441 | type record RSL_IE_BS_Power { |
Vadim Yanitskiy | 117c176 | 2020-06-16 01:40:10 +0700 | [diff] [blame] | 442 | uint2_t reserved, |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 443 | boolean epc, |
| 444 | boolean fpc, |
Vadim Yanitskiy | 117c176 | 2020-06-16 01:40:10 +0700 | [diff] [blame] | 445 | uint4_t power_level |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 446 | } |
| 447 | |
Vadim Yanitskiy | 117c176 | 2020-06-16 01:40:10 +0700 | [diff] [blame] | 448 | template (value) RSL_IE_BS_Power ts_RSL_IE_BS_Power(uint4_t power_level, |
Eric Wild | ae8f262 | 2019-06-18 17:05:11 +0200 | [diff] [blame] | 449 | boolean epc := false, boolean fpc := false) := { |
| 450 | reserved := 0, |
| 451 | epc := epc, |
| 452 | fpc := fpc, |
| 453 | power_level := power_level |
| 454 | } |
Vadim Yanitskiy | 2a5a1ef | 2021-06-30 00:51:48 +0200 | [diff] [blame] | 455 | template RSL_IE_BS_Power |
| 456 | tr_RSL_IE_BS_Power(template (present) uint4_t power_level, |
| 457 | template (present) boolean epc := ?, |
| 458 | template (present) boolean fpc := ?) := { |
| 459 | reserved := ?, |
| 460 | epc := epc, |
| 461 | fpc := fpc, |
| 462 | power_level := power_level |
| 463 | } |
Eric Wild | ae8f262 | 2019-06-18 17:05:11 +0200 | [diff] [blame] | 464 | |
Harald Welte | 73cd271 | 2017-12-17 00:44:52 +0100 | [diff] [blame] | 465 | /* 9.3.7 */ |
Harald Welte | e613f96 | 2018-04-18 22:38:16 +0200 | [diff] [blame] | 466 | type enumerated RSL_AlgId { |
| 467 | RSL_ALG_ID_A5_0 ('00000001'B), |
| 468 | RSL_ALG_ID_A5_1 ('00000010'B), |
| 469 | RSL_ALG_ID_A5_2 ('00000011'B), |
| 470 | RSL_ALG_ID_A5_3 ('00000100'B), |
| 471 | RSL_ALG_ID_A5_4 ('00000101'B), |
| 472 | RSL_ALG_ID_A5_5 ('00000110'B), |
| 473 | RSL_ALG_ID_A5_6 ('00000111'B), |
| 474 | RSL_ALG_ID_A5_7 ('00001000'B) |
| 475 | } with { variant "FIELDLENGTH(8)" }; |
Harald Welte | 73cd271 | 2017-12-17 00:44:52 +0100 | [diff] [blame] | 476 | type record RSL_IE_EncryptionInfo { |
| 477 | uint8_t len, |
Harald Welte | e613f96 | 2018-04-18 22:38:16 +0200 | [diff] [blame] | 478 | RSL_AlgId alg_id, |
Harald Welte | 73cd271 | 2017-12-17 00:44:52 +0100 | [diff] [blame] | 479 | octetstring key |
| 480 | } with { variant (len) "LENGTHTO(alg_id,key)" }; |
| 481 | |
Harald Welte | e613f96 | 2018-04-18 22:38:16 +0200 | [diff] [blame] | 482 | template RSL_IE_EncryptionInfo tr_RSL_IE_EncrInfo(template RSL_AlgId alg, |
| 483 | template octetstring key) := { |
Harald Welte | 73cd271 | 2017-12-17 00:44:52 +0100 | [diff] [blame] | 484 | len := ?, |
| 485 | alg_id := alg, |
| 486 | key := key |
| 487 | } |
Harald Welte | e613f96 | 2018-04-18 22:38:16 +0200 | [diff] [blame] | 488 | template (value) RSL_IE_EncryptionInfo ts_RSL_IE_EncrInfo(template (value) RSL_AlgId alg, |
| 489 | octetstring key) := { |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 490 | len := 0, /* overwritten */ |
| 491 | alg_id := alg, |
| 492 | key := key |
| 493 | } |
| 494 | |
| 495 | |
Harald Welte | 73cd271 | 2017-12-17 00:44:52 +0100 | [diff] [blame] | 496 | |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 497 | /* 9.3.8 */ |
| 498 | type record RSL_IE_FrameNumber { |
| 499 | uint5_t t1_p, |
| 500 | uint6_t t3, |
| 501 | uint5_t t2 |
| 502 | } |
| 503 | type RSL_IE_FrameNumber RSL_IE_StartingTime; |
| 504 | |
| 505 | /* 9.3.10 */ |
| 506 | type record RSL_IE_L1Info { |
| 507 | uint5_t ms_power_lvl, |
| 508 | boolean fpc, |
| 509 | uint2_t reserved, |
| 510 | uint8_t actual_ta |
| 511 | } |
| 512 | |
Neels Hofmeyr | afe2ea5 | 2021-11-24 15:16:12 +0100 | [diff] [blame] | 513 | template (value) RSL_IE_L1Info ts_RSL_IE_L1Info := { |
| 514 | ms_power_lvl := 0, |
| 515 | fpc := false, |
| 516 | reserved := 0, |
| 517 | actual_ta := 0 |
| 518 | }; |
| 519 | |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 520 | /* 9.3.13 */ |
| 521 | type record RSL_IE_MS_Power { |
| 522 | uint2_t reserved, |
| 523 | boolean fpc_epc, |
| 524 | uint5_t power_level |
| 525 | } |
Pau Espin Pedrol | f7630a6 | 2019-10-28 15:07:08 +0100 | [diff] [blame] | 526 | template RSL_IE_MS_Power tr_RSL_IE_MS_Power(template uint5_t power_level := ?, |
| 527 | template boolean fpc_epc := false) := { |
| 528 | reserved := 0, |
| 529 | fpc_epc := fpc_epc, |
| 530 | power_level := power_level |
| 531 | } |
Harald Welte | 1028017 | 2019-05-19 22:28:04 +0200 | [diff] [blame] | 532 | template (value) RSL_IE_MS_Power ts_RSL_IE_MS_Power(uint5_t power_level, |
| 533 | boolean fpc_epc := false) := { |
| 534 | reserved := 0, |
| 535 | fpc_epc := fpc_epc, |
| 536 | power_level := power_level |
| 537 | } |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 538 | |
Harald Welte | d5f521e | 2017-12-07 17:53:06 +0100 | [diff] [blame] | 539 | /* 9.3.18 */ |
| 540 | type record RSL_IE_RachLoad { |
| 541 | uint8_t len, |
| 542 | uint16_t slot_count, |
| 543 | uint16_t busy_count, |
| 544 | uint16_t access_count |
| 545 | } with { variant (len) "LENGTHTO(slot_count,busy_count,access_count)" } |
| 546 | |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 547 | template (value) RSL_IE_RachLoad ts_RSL_IE_RachLoad(uint16_t slot, uint16_t busy, uint16_t acc) := { |
Harald Welte | d5f521e | 2017-12-07 17:53:06 +0100 | [diff] [blame] | 548 | len := 0, /* overwritten */ |
| 549 | slot_count := slot, |
| 550 | busy_count := busy, |
| 551 | access_count := acc |
| 552 | } |
| 553 | |
Harald Welte | 68e495b | 2018-02-25 00:05:57 +0100 | [diff] [blame] | 554 | template RSL_IE_RachLoad tr_RSL_IE_RachLoad(template uint16_t slot, |
| 555 | template uint16_t busy, |
| 556 | template uint16_t acc) := { |
| 557 | len := ?, /* overwritten */ |
| 558 | slot_count := slot, |
| 559 | busy_count := busy, |
| 560 | access_count := acc |
| 561 | } |
| 562 | |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 563 | /* 9.3.19 */ |
| 564 | type record RSL_IE_RequestRef { |
| 565 | OCT1 ra, |
| 566 | RSL_IE_FrameNumber frame_nr |
| 567 | } |
| 568 | |
| 569 | /* 3GPP TS 44.018 / 10.5.2.38 Starting Time */ |
Harald Welte | 94e0c34 | 2018-04-07 11:33:23 +0200 | [diff] [blame] | 570 | template (value) RSL_IE_FrameNumber ts_RSL_IE_FrameNumber(GsmFrameNumber fn) := { |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 571 | t1_p := (fn / 1326) mod 32, |
| 572 | t3 := fn mod 51, |
| 573 | t2 := fn mod 26 |
| 574 | } |
| 575 | |
Harald Welte | 9abd128 | 2018-02-19 19:18:17 +0100 | [diff] [blame] | 576 | function tr_RSL_IE_FrameNumber(template GsmFrameNumber fn) return template RSL_IE_FrameNumber { |
| 577 | if (istemplatekind(fn, "?")) { |
| 578 | return ?; |
| 579 | } else { |
| 580 | return ts_RSL_IE_FrameNumber(valueof(fn)); |
| 581 | } |
| 582 | } |
| 583 | |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 584 | template (value) RSL_IE_RequestRef ts_RSL_IE_ReqRef(OCT1 ra, GsmFrameNumber frame_nr) := { |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 585 | ra := ra, |
| 586 | frame_nr := ts_RSL_IE_FrameNumber(frame_nr) |
| 587 | } |
| 588 | |
Harald Welte | 9abd128 | 2018-02-19 19:18:17 +0100 | [diff] [blame] | 589 | template RSL_IE_RequestRef tr_RSL_IE_ReqRef(template OCT1 ra, template GsmFrameNumber frame_nr) := { |
| 590 | ra := ra, |
| 591 | frame_nr := tr_RSL_IE_FrameNumber(frame_nr) |
| 592 | } |
| 593 | |
Vadim Yanitskiy | 9f69953 | 2021-06-03 17:29:22 +0200 | [diff] [blame] | 594 | /* 9.3.21 Resource Information */ |
| 595 | type record RSL_IE_ResourceInfo { |
| 596 | uint8_t len, |
| 597 | RSL_ResourceInfo info |
| 598 | } with { variant (len) "LENGTHTO(info)" }; |
| 599 | |
| 600 | type record of RSL_ResourceInfoItem RSL_ResourceInfo; |
| 601 | type record RSL_ResourceInfoItem { |
| 602 | RslChannelNr chan_nr, |
| 603 | uint3_t interf_band, |
| 604 | BIT5 rfu ('00000'B) |
| 605 | }; |
| 606 | |
| 607 | template (value) RSL_ResourceInfoItem |
| 608 | ts_RSL_ResourceInfoItem(template (value) RslChannelNr chan_nr, |
| 609 | template (value) uint3_t interf_band := 0) := { |
| 610 | chan_nr := chan_nr, |
| 611 | interf_band := interf_band, |
| 612 | rfu := '00000'B |
| 613 | } |
| 614 | template RSL_ResourceInfoItem |
| 615 | tr_RSL_ResourceInfoItem(template (present) RslChannelNr chan_nr := ?, |
| 616 | template (present) uint3_t interf_band := ?) := { |
| 617 | chan_nr := chan_nr, |
| 618 | interf_band := interf_band, |
| 619 | rfu := ? /* Tolerate unknown values */ |
| 620 | } |
| 621 | |
Harald Welte | 15de8ba | 2018-06-29 08:51:42 +0200 | [diff] [blame] | 622 | /* Osmocom Extension */ |
| 623 | type record RSL_IE_UplinkMeasSuppMeasInfo { |
| 624 | int16_t toa256_mean, |
| 625 | int16_t toa256_min, |
| 626 | int16_t toa256_max, |
| 627 | uint16_t toa256_std_dev |
| 628 | }; |
| 629 | |
Harald Welte | 2691adf | 2018-02-22 17:32:39 +0100 | [diff] [blame] | 630 | /* 9.3.25 */ |
| 631 | type record RSL_IE_UplinkMeas { |
| 632 | uint8_t len, |
| 633 | BIT1 rfu, |
| 634 | boolean dtx_d, |
| 635 | uint6_t rxlev_f_u, |
| 636 | BIT2 reserved1, |
| 637 | uint6_t rxlev_s_u, |
| 638 | BIT2 reserved2, |
| 639 | uint3_t rxq_f_u, |
| 640 | uint3_t rxq_s_u, |
Harald Welte | 15de8ba | 2018-06-29 08:51:42 +0200 | [diff] [blame] | 641 | RSL_IE_UplinkMeasSuppMeasInfo supp_meas_info optional |
Harald Welte | 2691adf | 2018-02-22 17:32:39 +0100 | [diff] [blame] | 642 | } with { variant (len) "LENGTHTO(rfu,dtx_d,rxlev_f_u,reserved1,rxlev_s_u,reserved2,rxq_f_u,rxq_s_u,supp_meas_info)" }; |
Harald Welte | 9abd128 | 2018-02-19 19:18:17 +0100 | [diff] [blame] | 643 | |
Neels Hofmeyr | afe2ea5 | 2021-11-24 15:16:12 +0100 | [diff] [blame] | 644 | template (value) RSL_IE_UplinkMeas ts_RSL_IE_UplinkMeas(uint6_t rxlev := 12, uint3_t rxqual := 0) := { |
| 645 | len := 0, /* overwritten */ |
| 646 | rfu := '0'B, |
| 647 | dtx_d := false, |
| 648 | rxlev_f_u := rxlev, |
| 649 | reserved1 := '00'B, |
| 650 | rxlev_s_u := rxlev, |
| 651 | reserved2 := '00'B, |
| 652 | rxq_f_u := rxqual, |
| 653 | rxq_s_u := rxqual, |
| 654 | supp_meas_info := omit |
| 655 | }; |
| 656 | |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 657 | /* 9.3.26 */ |
Harald Welte | a8ed906 | 2017-12-14 09:46:01 +0100 | [diff] [blame] | 658 | type enumerated RSL_Cause { |
| 659 | /* normal event */ |
| 660 | RSL_ERR_RADIO_IF_FAIL ('00'O), |
| 661 | RSL_ERR_RADIO_LINK_FAIL ('01'O), |
| 662 | RSL_ERR_HANDOVER_ACC_FAIL ('02'O), |
| 663 | RSL_ERR_TALKER_ACC_FAIL ('03'O), |
| 664 | RSL_ERR_OM_INTERVENTION ('07'O), |
| 665 | RSL_ERR_NORMAL_UNSPEC ('0f'O), |
| 666 | RSL_ERR_T_MSRFPCI_EXP ('18'O), |
| 667 | /* resource unavailable */ |
| 668 | RSL_ERR_EQUIPMENT_FAIL ('20'O), |
| 669 | RSL_ERR_RR_UNAVAIL ('21'O), |
| 670 | RSL_ERR_TERR_CH_FAIL ('22'O), |
| 671 | RSL_ERR_CCCH_OVERLOAD ('23'O), |
| 672 | RSL_ERR_ACCH_OVERLOAD ('24'O), |
| 673 | RSL_ERR_PROCESSOR_OVERLOAD ('25'O), |
| 674 | RSL_ERR_BTS_NOT_EQUIPPED ('27'O), |
| 675 | RSL_ERR_REMOTE_TRAU_FAILURE ('28'O), |
| 676 | RSL_ERR_NOTIF_OVERFLOW ('29'O), |
| 677 | RSL_ERR_RES_UNAVAIL ('2f'O), |
| 678 | /* service or option not available */ |
| 679 | RSL_ERR_TRANSC_UNAVAIL ('30'O), |
| 680 | RSL_ERR_SERV_OPT_UNAVAIL ('3f'O), |
| 681 | /* service or option not implemented */ |
| 682 | RSL_ERR_ENCR_UNIMPL ('40'O), |
| 683 | RSL_ERR_SERV_OPT_UNIMPL ('4f'O), |
| 684 | /* invalid message */ |
| 685 | RSL_ERR_RCH_ALR_ACTV_ALLOC ('50'O), |
Harald Welte | 9912eb5 | 2018-02-25 13:30:15 +0100 | [diff] [blame] | 686 | RSL_ERR_IPA_RCH_NOT_ACTV_ALLOC ('51'O), |
| 687 | RSL_ERR_IPA_CONN_INVALID ('52'O), |
| 688 | RSL_ERR_IPA_CONN_IN_USE ('53'O), |
| 689 | RSL_ERR_IPA_CONN_ALREADY_EXISTS ('54'O), |
Harald Welte | a8ed906 | 2017-12-14 09:46:01 +0100 | [diff] [blame] | 690 | RSL_ERR_INVALID_MESSAGE ('5f'O), |
| 691 | /* protocol error */ |
| 692 | RSL_ERR_MSG_DISCR ('60'O), |
| 693 | RSL_ERR_MSG_TYPE ('61'O), |
| 694 | RSL_ERR_MSG_SEQ ('62'O), |
| 695 | RSL_ERR_IE_ERROR ('63'O), |
| 696 | RSL_ERR_MAND_IE_ERROR ('64'O), |
| 697 | RSL_ERR_OPT_IE_ERROR ('65'O), |
| 698 | RSL_ERR_IE_NONEXIST ('66'O), |
| 699 | RSL_ERR_IE_LENGTH ('67'O), |
| 700 | RSL_ERR_IE_CONTENT ('68'O), |
| 701 | RSL_ERR_PROTO ('6f'O), |
| 702 | /* interworking */ |
| 703 | RSL_ERR_INTERWORKING ('7f'O) |
| 704 | }; |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 705 | type record RSL_IE_Cause { |
Harald Welte | 6efa8e3 | 2017-12-09 22:34:06 +0100 | [diff] [blame] | 706 | uint8_t len, |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 707 | uint1_t e, |
| 708 | RSL_Cause cause, |
| 709 | octetstring cause_ext optional |
Harald Welte | 6efa8e3 | 2017-12-09 22:34:06 +0100 | [diff] [blame] | 710 | } with { variant (len) "LENGTHTO(e,cause,cause_ext)" } |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 711 | |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 712 | template (value) RSL_IE_Cause ts_RSL_IE_Cause(RSL_Cause cause) := { |
Harald Welte | 6efa8e3 | 2017-12-09 22:34:06 +0100 | [diff] [blame] | 713 | len := 0, /* overwritten */ |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 714 | e := 0, |
| 715 | cause := cause, |
| 716 | cause_ext := omit |
| 717 | } |
| 718 | |
Harald Welte | 9abd128 | 2018-02-19 19:18:17 +0100 | [diff] [blame] | 719 | template RSL_IE_Cause tr_RSL_IE_Cause(template RSL_Cause cause) := { |
| 720 | len := ?, |
| 721 | e := 0, |
| 722 | cause := cause, |
| 723 | cause_ext := omit |
| 724 | } |
| 725 | |
Harald Welte | c8d363c | 2019-05-19 20:36:48 +0200 | [diff] [blame] | 726 | /* 9.3.29 */ |
| 727 | type record RSL_SacchInfo { |
| 728 | uint8_t len, |
| 729 | uint8_t num_msgs, |
| 730 | RSL_SacchInfoElements elems |
| 731 | } with { |
| 732 | variant (len) "LENGTHTO(num_msgs,elems)"; |
| 733 | variant (num_msgs) "LENGTHTO(elems)"; |
| 734 | variant (num_msgs) "UNIT(elements)" |
| 735 | }; |
| 736 | type record RSL_SacchInfoElement { |
| 737 | RSL_IE_SysinfoType si_type, |
| 738 | uint8_t len, |
| 739 | octetstring msg |
| 740 | } with { |
| 741 | variant (len) "LENGTHTO(msg)"; |
| 742 | }; |
| 743 | type record of RSL_SacchInfoElement RSL_SacchInfoElements; |
| 744 | template (value) RSL_SacchInfo ts_RSL_SacchInfo(template (value) RSL_SacchInfoElements elems) := { |
| 745 | len := 0, /* overwritten */ |
| 746 | num_msgs := 0, /* overwritten */ |
| 747 | elems := elems |
| 748 | } |
| 749 | template (value) RSL_SacchInfoElement ts_RSL_SacchInfoElem(RSL_IE_SysinfoType tp, octetstring msg) := { |
| 750 | si_type := tp, |
| 751 | len := lengthof(msg), |
| 752 | msg := msg |
| 753 | } |
| 754 | |
Eric Wild | 61edb7e | 2019-06-03 12:38:31 +0200 | [diff] [blame] | 755 | /* 9.3.31 */ |
| 756 | type record RSL_IE_MS_Power_Parameters { |
| 757 | uint8_t len, |
| 758 | octetstring params |
| 759 | } with { |
| 760 | variant (len) "LENGTHTO(params)"; |
| 761 | }; |
| 762 | template (value) RSL_IE_MS_Power_Parameters ts_RSL_IE_MS_Power_Parameters(octetstring params) := { |
| 763 | len := 0, /* overwritten */ |
| 764 | params := params |
| 765 | } |
| 766 | |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 767 | /* 9.3.40 */ |
| 768 | type enumerated RSL_ChanNeeded { |
| 769 | RSL_CHANNEED_ANY ('00'B), |
| 770 | RSL_CHANNEED_SDCCH ('01'B), |
| 771 | RSL_CHANNEED_TCH_F ('10'B), |
| 772 | RSL_CHANNEED_TCH_ForH ('11'B) |
Harald Welte | 51d7410 | 2017-12-10 23:05:02 +0100 | [diff] [blame] | 773 | } with { variant "FIELDLENGTH(2)" }; |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 774 | type record RSL_IE_ChanNeeded { |
| 775 | uint6_t reserved, |
| 776 | RSL_ChanNeeded chan_needed |
| 777 | } |
| 778 | |
Harald Welte | cc37320 | 2018-09-10 10:28:21 +0200 | [diff] [blame] | 779 | /* 9.3.41 CB Command Type */ |
| 780 | type enumerated RSL_CbCommand { |
| 781 | RSL_CB_CMD_NORMAL ('0000'B), |
| 782 | RSL_CB_CMD_SCHEDULE ('1000'B), |
| 783 | RSL_CB_CMD_DEFAULT ('1110'B), |
| 784 | RSL_CB_CMD_NULL ('1111'B) |
| 785 | } with { variant "FIELDLENGTH(4)" }; |
| 786 | type record RSL_IE_CbCommandType { |
| 787 | RSL_CbCommand command, |
| 788 | boolean default_bcast_null, |
| 789 | BIT1 spare, |
| 790 | uint2_t last_block |
| 791 | }; |
| 792 | template (value) RSL_IE_CbCommandType ts_RSL_IE_CbCmdType(RSL_CbCommand cmd := RSL_CB_CMD_NORMAL, |
| 793 | uint2_t last_block := 1, |
| 794 | boolean def_bcast_null := true) := { |
| 795 | command := cmd, |
| 796 | default_bcast_null := def_bcast_null, |
| 797 | spare := '0'B, |
| 798 | last_block := last_block |
| 799 | } |
| 800 | |
Harald Welte | 4a129f8 | 2019-05-21 16:35:22 +0200 | [diff] [blame] | 801 | /* 9.4.43 CBCH Load Information */ |
| 802 | type record RSL_IE_CbchLoadInfo { |
| 803 | boolean overflow, |
| 804 | BIT3 spare, |
| 805 | uint4_t slot_count |
| 806 | }; |
| 807 | template RSL_IE_CbchLoadInfo tr_CbchLoadInfo(template boolean overflow, |
| 808 | template uint4_t slot_count) := { |
| 809 | overflow := overflow, |
| 810 | spare := ?, |
| 811 | slot_count := slot_count |
| 812 | } |
| 813 | template (value) RSL_IE_CbchLoadInfo ts_CbchLoadInfo(boolean overflow, uint4_t slot_count) := { |
| 814 | overflow := overflow, |
| 815 | spare := '000'B, |
| 816 | slot_count := slot_count |
| 817 | } |
| 818 | |
Pau Espin Pedrol | f7634dc | 2022-09-02 17:56:00 +0200 | [diff] [blame] | 819 | /* 9.3.52, 3GPP TS 44.018 10.5.2.21aa */ |
| 820 | type record RSL_IE_MultirateCfg { |
| 821 | uint8_t len, |
| 822 | uint3_t mr_speech_ver, |
| 823 | boolean nscb, |
| 824 | boolean icmi, |
| 825 | BIT1 spare, |
| 826 | uint2_t start_mode, |
Vadim Yanitskiy | f14e696 | 2022-09-14 15:18:06 +0700 | [diff] [blame] | 827 | BIT8 codec_modes, |
Pau Espin Pedrol | f7634dc | 2022-09-02 17:56:00 +0200 | [diff] [blame] | 828 | octetstring parameters |
| 829 | } with { |
Vadim Yanitskiy | f14e696 | 2022-09-14 15:18:06 +0700 | [diff] [blame] | 830 | variant (len) "LENGTHTO(mr_speech_ver,nscb,icmi,spare,start_mode,codec_modes,parameters)" |
Pau Espin Pedrol | f7634dc | 2022-09-02 17:56:00 +0200 | [diff] [blame] | 831 | }; |
| 832 | template (value) RSL_IE_MultirateCfg ts_RSL_MultirateCfg(boolean icmi := true, uint2_t start_mode := 0, |
Vadim Yanitskiy | 0345d20 | 2022-09-14 16:13:40 +0700 | [diff] [blame] | 833 | BIT8 codec_modes := '00000100'B /* 5,90k */, |
| 834 | octetstring params := ''O) := { |
Vadim Yanitskiy | 9e0139b | 2022-09-14 17:41:29 +0700 | [diff] [blame] | 835 | len := 2 + lengthof(params), |
Pau Espin Pedrol | f7634dc | 2022-09-02 17:56:00 +0200 | [diff] [blame] | 836 | mr_speech_ver := 1, |
| 837 | nscb := false, |
| 838 | icmi := icmi, |
| 839 | spare := '0'B, |
| 840 | start_mode := start_mode, |
Vadim Yanitskiy | f14e696 | 2022-09-14 15:18:06 +0700 | [diff] [blame] | 841 | codec_modes := codec_modes, |
Vadim Yanitskiy | 0345d20 | 2022-09-14 16:13:40 +0700 | [diff] [blame] | 842 | parameters := params |
Pau Espin Pedrol | f7634dc | 2022-09-02 17:56:00 +0200 | [diff] [blame] | 843 | } |
| 844 | |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 845 | /* 9.3.53 */ |
| 846 | type record RSL_IE_MultirateCtrl { |
| 847 | uint3_t spare, |
| 848 | boolean od, |
| 849 | boolean pre, |
| 850 | uint2_t rae, |
| 851 | boolean tfo |
| 852 | } |
| 853 | |
| 854 | type enumerated RSL_IE_SysinfoType { |
| 855 | RSL_SYSTEM_INFO_8 ('00000000'B), |
| 856 | RSL_SYSTEM_INFO_1 ('00000001'B), |
| 857 | RSL_SYSTEM_INFO_2 ('00000010'B), |
| 858 | RSL_SYSTEM_INFO_3 ('00000011'B), |
| 859 | RSL_SYSTEM_INFO_4 ('00000100'B), |
| 860 | RSL_SYSTEM_INFO_5 ('00000101'B), |
| 861 | RSL_SYSTEM_INFO_6 ('00000110'B), |
| 862 | RSL_SYSTEM_INFO_7 ('00000111'B), |
| 863 | RSL_SYSTEM_INFO_16 ('00001000'B), |
| 864 | RSL_SYSTEM_INFO_17 ('00001001'B), |
| 865 | RSL_SYSTEM_INFO_2bis ('00001010'B), |
| 866 | RSL_SYSTEM_INFO_2ter ('00001011'B), |
| 867 | RSL_SYSTEM_INFO_5bis ('00001101'B), |
| 868 | RSL_SYSTEM_INFO_5ter ('00001110'B), |
| 869 | RSL_SYSTEM_INFO_10 ('00001111'B), |
| 870 | RSL_EXT_MEAS_ORDER ('01000111'B), |
| 871 | RSL_MEAS_INFO ('01001000'B), |
| 872 | RSL_SYSTEM_INFO_13 ('00101000'B), |
| 873 | RSL_ERIC_SYSTEM_INFO_13 ('00001100'B), |
| 874 | RSL_SYSTEM_INFO_2quater ('00101001'B), |
| 875 | RSL_SYSTEM_INFO_9 ('00101010'B), |
| 876 | RSL_SYSTEM_INFO_18 ('00101011'B), |
| 877 | RSL_SYSTEM_INFO_19 ('00101100'B), |
| 878 | RSL_SYSTEM_INFO_20 ('00101101'B) |
| 879 | } with { variant "FIELDLENGTH(8)" } |
| 880 | |
Harald Welte | 9958a4d | 2017-12-14 21:21:33 +0100 | [diff] [blame] | 881 | type record RSL_IE_IPA_ConnectionStats { |
| 882 | uint8_t len, |
| 883 | uint32_t tx_packets, |
| 884 | uint32_t tx_octets, |
| 885 | uint32_t rx_packets, |
| 886 | uint32_t rx_octets, |
| 887 | uint32_t lost_packets, |
| 888 | uint32_t jitter, |
| 889 | uint32_t avg_delay |
| 890 | } with { variant (len) "LENGTHTO(tx_packets,tx_octets,rx_packets,rx_octets,lost_packets,jitter,avg_delay)" } |
| 891 | |
| 892 | type enumerated RSL_IPA_SpeechMode { |
| 893 | RSL_IPA_SPM_SENDRECV ('00'B), |
| 894 | RSL_IPA_SPM_RECVONLY ('01'B), |
| 895 | RSL_IPA_SPM_SENDONLY ('10'B), |
| 896 | RSL_IPA_SPM_RESERVED ('11'B) |
| 897 | } with { variant "FIELDLENGTH(2)" } |
| 898 | |
| 899 | type enumerated RSL_IPA_Codec { |
| 900 | RSL_IPA_CODEC_FR ('0000'B), |
| 901 | RSL_IPA_CODEC_EFR ('0001'B), |
| 902 | RSL_IPA_CODEC_AMR_F ('0010'B), |
| 903 | RSL_IPA_CODEC_HR ('0011'B), |
| 904 | RSL_IPA_CODEC_AMR_H ('0101'B), |
| 905 | RSL_IPA_CODEC_RTP_PT ('1111'B) |
| 906 | } with { variant "FIELDLENGTH(4)" } |
| 907 | |
| 908 | type record RSL_IE_IPA_SpeechMode { |
| 909 | BIT2 reserved, |
| 910 | RSL_IPA_SpeechMode mode, |
| 911 | RSL_IPA_Codec codec |
| 912 | } |
| 913 | |
Harald Welte | 0472ab4 | 2018-03-12 15:02:26 +0100 | [diff] [blame] | 914 | /* 9.3.20 */ |
| 915 | type enumerated RSL_IE_ReleaseMode { |
| 916 | RSL_REL_MODE_NORMAL ('00'B), |
| 917 | REL_REL_MODE_LOCAL ('01'B) |
| 918 | } |
| 919 | |
Neels Hofmeyr | 2bef0dd | 2021-04-22 21:46:00 +0000 | [diff] [blame] | 920 | type record RSL_IE_OSMO_TrainingSequence { |
| 921 | uint8_t len, |
| 922 | uint8_t tsc_set, |
| 923 | uint8_t tsc |
| 924 | } with { variant (len) "LENGTHTO(tsc_set,tsc)" } |
| 925 | |
Vadim Yanitskiy | 1f53215 | 2021-11-01 20:37:56 +0300 | [diff] [blame] | 926 | type record RSL_IE_OSMO_RepAcchCap { |
| 927 | uint8_t len, |
| 928 | BIT1 rfu ('0'B), |
| 929 | uint3_t rxqual, |
| 930 | boolean ul_sacch, |
| 931 | boolean dl_sacch, |
| 932 | boolean dl_facch_all, |
| 933 | boolean dl_facch_cmd |
| 934 | } with { variant (len) "LENGTHTO(rfu,rxqual,ul_sacch,dl_sacch,dl_facch_all,dl_facch_cmd)" } |
| 935 | |
Vadim Yanitskiy | a203d3b | 2021-11-01 21:32:31 +0300 | [diff] [blame] | 936 | type record RSL_IE_OSMO_TopAcchCap { |
| 937 | uint8_t len, |
| 938 | boolean sacch_enable, |
| 939 | boolean facch_enable, |
| 940 | uint3_t rxqual, |
| 941 | uint3_t overpower_db |
| 942 | } with { variant (len) "LENGTHTO(sacch_enable,facch_enable,rxqual,overpower_db)" } |
| 943 | |
Vadim Yanitskiy | 66d3c33 | 2021-11-06 18:18:13 +0300 | [diff] [blame] | 944 | template (value) RSL_IE_OSMO_TopAcchCap |
| 945 | ts_RSL_IE_OSMO_TopAcchCap(template (value) uint3_t overpower := 2, |
| 946 | template (value) uint3_t rxqual := 4, |
| 947 | boolean facch_enable := true, |
| 948 | boolean sacch_enable := true) := { |
| 949 | len := 0, /* overwritten */ |
| 950 | sacch_enable := sacch_enable, |
| 951 | facch_enable := facch_enable, |
| 952 | rxqual := rxqual, |
| 953 | overpower_db := overpower |
| 954 | }; |
| 955 | template RSL_IE_OSMO_TopAcchCap |
| 956 | tr_RSL_IE_OSMO_TopAcchCap(template (present) uint3_t overpower := ?, |
| 957 | template (present) uint3_t rxqual := ?, |
| 958 | template (present) boolean facch_enable := ?, |
| 959 | template (present) boolean sacch_enable := ?) := { |
| 960 | len := ?, /* overwritten */ |
| 961 | sacch_enable := sacch_enable, |
| 962 | facch_enable := facch_enable, |
| 963 | rxqual := rxqual, |
| 964 | overpower_db := overpower |
| 965 | }; |
| 966 | |
Pau Espin Pedrol | 29c6dfb | 2022-08-08 18:37:56 +0200 | [diff] [blame] | 967 | type record RSL_IE_OSMO_Osmux_CID { |
| 968 | uint8_t len, |
| 969 | uint8_t cid |
| 970 | } with { variant (len) "LENGTHTO(cid)" } |
| 971 | |
| 972 | template (present) RSL_IE_OSMO_Osmux_CID |
| 973 | tr_RSL_IE_OSMO_Osmux_CID(template (present) uint8_t osmux_cid := ?) := { |
| 974 | len := ?, /* overwritten */ |
| 975 | cid := osmux_cid |
| 976 | }; |
Pau Espin Pedrol | 39bfa02 | 2022-08-12 14:56:12 +0200 | [diff] [blame] | 977 | function f_tr_RSL_IE_OSMO_Osmux_CID(template uint8_t osmux_cid := *) |
| 978 | return template RSL_IE_OSMO_Osmux_CID { |
| 979 | var template RSL_IE_OSMO_Osmux_CID ie := omit; |
| 980 | if (not istemplatekind(osmux_cid, "omit")) { |
| 981 | ie := tr_RSL_IE_OSMO_Osmux_CID(osmux_cid); |
| 982 | } |
| 983 | return ie; |
| 984 | } |
Pau Espin Pedrol | 29c6dfb | 2022-08-08 18:37:56 +0200 | [diff] [blame] | 985 | template (value) RSL_IE_OSMO_Osmux_CID |
| 986 | ts_RSL_IE_OSMO_Osmux_CID(template (value) uint8_t osmux_cid) := { |
| 987 | len := 0, /* overwritten */ |
| 988 | cid := osmux_cid |
| 989 | }; |
| 990 | |
| 991 | |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 992 | /* union of all IE bodies */ |
| 993 | type union RSL_IE_Body { |
| 994 | RslChannelNr chan_nr, |
| 995 | RslLinkId link_id, |
Harald Welte | 15bb5b5 | 2017-12-07 17:52:04 +0100 | [diff] [blame] | 996 | RSL_L16V l3_info, |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 997 | RSL_LV rlm_cause, |
Harald Welte | 0472ab4 | 2018-03-12 15:02:26 +0100 | [diff] [blame] | 998 | RSL_IE_ReleaseMode release_mode, |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 999 | RSL_IE_ActivationType act_type, |
Vadim Yanitskiy | e02dbcc | 2020-08-25 04:20:51 +0700 | [diff] [blame] | 1000 | RSL_IE_ChannelIdent chan_ident, |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 1001 | RSL_IE_ChannelMode chan_mode, |
| 1002 | uint8_t handover_ref, |
| 1003 | RSL_IE_BS_Power bs_power, |
Vadim Yanitskiy | 802508e | 2020-11-11 07:25:47 +0700 | [diff] [blame] | 1004 | RSL_LV bs_power_params, |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 1005 | RSL_IE_MS_Power ms_power, |
Eric Wild | 61edb7e | 2019-06-03 12:38:31 +0200 | [diff] [blame] | 1006 | RSL_IE_MS_Power_Parameters ms_power_params, |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 1007 | uint8_t timing_adv, |
Pau Espin Pedrol | f7634dc | 2022-09-02 17:56:00 +0200 | [diff] [blame] | 1008 | RSL_IE_MultirateCfg multirate_cfg, |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 1009 | RSL_IE_MultirateCtrl multirate_ctrl, |
Harald Welte | a670615 | 2019-05-19 20:38:18 +0200 | [diff] [blame] | 1010 | uint8_t msg_id, |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 1011 | RSL_IE_FrameNumber frame_nr, |
| 1012 | RSL_IE_Cause cause, |
| 1013 | uint8_t access_delay, |
Harald Welte | d5f521e | 2017-12-07 17:53:06 +0100 | [diff] [blame] | 1014 | RSL_IE_RachLoad rach_load, |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 1015 | uint8_t meas_res_nr, |
Harald Welte | 2691adf | 2018-02-22 17:32:39 +0100 | [diff] [blame] | 1016 | uint8_t ms_timing_offset, |
| 1017 | RSL_IE_UplinkMeas uplink_meas, |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 1018 | RSL_IE_L1Info l1_info, |
| 1019 | RSL_IE_SysinfoType sysinfo_type, |
| 1020 | uint16_t paging_load, |
| 1021 | uint8_t paging_group, |
| 1022 | RSL_IE_ChanNeeded chan_needed, |
Harald Welte | cc37320 | 2018-09-10 10:28:21 +0200 | [diff] [blame] | 1023 | RSL_IE_CbCommandType cb_cmd_type, |
| 1024 | RSL_LV smscb_message, |
Harald Welte | 4a129f8 | 2019-05-21 16:35:22 +0200 | [diff] [blame] | 1025 | RSL_IE_CbchLoadInfo cbch_load_info, |
Vadim Yanitskiy | 9f69953 | 2021-06-03 17:29:22 +0200 | [diff] [blame] | 1026 | RSL_IE_ResourceInfo resource_info, |
Harald Welte | c8d363c | 2019-05-19 20:36:48 +0200 | [diff] [blame] | 1027 | RSL_SacchInfo sacch_info, |
Harald Welte | cc37320 | 2018-09-10 10:28:21 +0200 | [diff] [blame] | 1028 | |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 1029 | RSL_IE_StartingTime starting_time, |
Harald Welte | 73cd271 | 2017-12-17 00:44:52 +0100 | [diff] [blame] | 1030 | RSL_IE_EncryptionInfo encr_info, |
Harald Welte | a3ff670 | 2019-05-20 20:03:50 +0200 | [diff] [blame] | 1031 | uint8_t smscb_chan_ind, |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 1032 | RSL_IE_RequestRef req_ref, |
| 1033 | RSL_LV full_imm_ass_info, |
Vadim Yanitskiy | cc4623d | 2020-03-28 06:14:06 +0700 | [diff] [blame] | 1034 | MobileIdentityLV ms_identity, |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 1035 | |
Harald Welte | 9958a4d | 2017-12-14 21:21:33 +0100 | [diff] [blame] | 1036 | uint16_t ipa_conn_id, |
| 1037 | uint16_t ipa_local_port, |
| 1038 | uint16_t ipa_remote_port, |
Vadim Yanitskiy | fc63164 | 2021-07-03 02:42:45 +0200 | [diff] [blame] | 1039 | OCT4 ipa_local_ip, |
| 1040 | OCT4 ipa_remote_ip, |
Harald Welte | 9958a4d | 2017-12-14 21:21:33 +0100 | [diff] [blame] | 1041 | uint8_t ipa_rtp_pt, |
| 1042 | uint8_t ipa_rtp_pt2, |
| 1043 | RSL_IE_IPA_ConnectionStats ipa_stats, |
| 1044 | RSL_IE_IPA_SpeechMode ipa_speech_mode, |
| 1045 | |
Neels Hofmeyr | 2bef0dd | 2021-04-22 21:46:00 +0000 | [diff] [blame] | 1046 | RSL_IE_OSMO_TrainingSequence osmo_training_sequence, |
Vadim Yanitskiy | 1f53215 | 2021-11-01 20:37:56 +0300 | [diff] [blame] | 1047 | RSL_IE_OSMO_RepAcchCap rep_acch_cap, |
Vadim Yanitskiy | a203d3b | 2021-11-01 21:32:31 +0300 | [diff] [blame] | 1048 | RSL_IE_OSMO_TopAcchCap top_acch_cap, |
Pau Espin Pedrol | 29c6dfb | 2022-08-08 18:37:56 +0200 | [diff] [blame] | 1049 | RSL_IE_OSMO_Osmux_CID osmux_cid, |
Neels Hofmeyr | 2bef0dd | 2021-04-22 21:46:00 +0000 | [diff] [blame] | 1050 | |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 1051 | RSL_LV other |
| 1052 | } |
| 1053 | |
| 1054 | type record RSL_IE { |
| 1055 | RSL_IE_Type iei, |
| 1056 | RSL_IE_Body body |
| 1057 | } with { variant (body) "CROSSTAG( |
| 1058 | chan_nr, iei = RSL_IE_CHAN_NR; |
| 1059 | link_id, iei = RSL_IE_LINK_IDENT; |
| 1060 | l3_info, iei = RSL_IE_L3_INFO; |
| 1061 | rlm_cause, iei = RSL_IE_RLM_CAUSE; |
| 1062 | release_mode, iei = RSL_IE_RELEASE_MODE; |
| 1063 | act_type, iei = RSL_IE_ACT_TYPE; |
Vadim Yanitskiy | e02dbcc | 2020-08-25 04:20:51 +0700 | [diff] [blame] | 1064 | chan_ident, iei = RSL_IE_CHAN_IDENT; |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 1065 | chan_mode, iei = RSL_IE_CHAN_MODE; |
| 1066 | handover_ref, iei = RSL_IE_HANDO_REF; |
| 1067 | bs_power, iei = RSL_IE_BS_POWER; |
Vadim Yanitskiy | 802508e | 2020-11-11 07:25:47 +0700 | [diff] [blame] | 1068 | bs_power_params, iei = RSL_IE_BS_POWER_PARAM; |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 1069 | ms_power, iei = RSL_IE_MS_POWER; |
Eric Wild | 61edb7e | 2019-06-03 12:38:31 +0200 | [diff] [blame] | 1070 | ms_power_params, iei = RSL_IE_MS_POWER_PARAM; |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 1071 | timing_adv, iei = RSL_IE_TIMING_ADVANCE; |
Pau Espin Pedrol | f7634dc | 2022-09-02 17:56:00 +0200 | [diff] [blame] | 1072 | multirate_cfg, iei = RSL_IE_MR_CONFIG; |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 1073 | multirate_ctrl, iei = RSL_IE_MR_CONTROL; |
Harald Welte | a670615 | 2019-05-19 20:38:18 +0200 | [diff] [blame] | 1074 | msg_id, iei = RSL_IE_MSG_ID; |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 1075 | |
| 1076 | frame_nr, iei = RSL_IE_FRAME_NUMBER; |
| 1077 | cause, iei = RSL_IE_CAUSE; |
| 1078 | access_delay, iei = RSL_IE_ACCESS_DELAY; |
Harald Welte | d5f521e | 2017-12-07 17:53:06 +0100 | [diff] [blame] | 1079 | rach_load, iei = RSL_IE_RACH_LOAD; |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 1080 | meas_res_nr, iei = RSL_IE_MEAS_RES_NR; |
Harald Welte | 2691adf | 2018-02-22 17:32:39 +0100 | [diff] [blame] | 1081 | ms_timing_offset, iei = RSL_IE_MS_TIMING_OFFSET; |
| 1082 | uplink_meas, iei = RSL_IE_UPLINK_MEAS; |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 1083 | l1_info, iei = RSL_IE_L1_INFO; |
| 1084 | sysinfo_type, iei = RSL_IE_SYSINFO_TYPE; |
| 1085 | paging_load, iei = RSL_IE_PAGING_LOAD; |
| 1086 | paging_group, iei = RSL_IE_PAGING_GROUP; |
| 1087 | chan_needed, iei = RSL_IE_CHAN_NEEDED; |
Harald Welte | cc37320 | 2018-09-10 10:28:21 +0200 | [diff] [blame] | 1088 | cb_cmd_type, iei = RSL_IE_CB_CMD_TYPE; |
| 1089 | smscb_message, iei = RSL_IE_SMSCB_MSG; |
Harald Welte | 4a129f8 | 2019-05-21 16:35:22 +0200 | [diff] [blame] | 1090 | cbch_load_info, iei = RSL_IE_CBCH_LOAD_INFO; |
Vadim Yanitskiy | 9f69953 | 2021-06-03 17:29:22 +0200 | [diff] [blame] | 1091 | resource_info, iei = RSL_IE_RESOURCE_INFO; |
Harald Welte | c8d363c | 2019-05-19 20:36:48 +0200 | [diff] [blame] | 1092 | sacch_info, iei = RSL_IE_SACCH_INFO; |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 1093 | starting_time, iei = RSL_IE_STARTNG_TIME; |
Harald Welte | 73cd271 | 2017-12-17 00:44:52 +0100 | [diff] [blame] | 1094 | encr_info, iei = RSL_IE_ENCR_INFO; |
Harald Welte | a3ff670 | 2019-05-20 20:03:50 +0200 | [diff] [blame] | 1095 | smscb_chan_ind, iei = RSL_IE_SMSCB_CHAN_INDICATOR; |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 1096 | |
| 1097 | req_ref, iei = RSL_IE_REQ_REFERENCE; |
Harald Welte | fff6930 | 2017-12-07 17:53:42 +0100 | [diff] [blame] | 1098 | full_imm_ass_info, iei = RSL_IE_FULL_IMM_ASS_INFO; |
| 1099 | ms_identity, iei = RSL_IE_MS_IDENTITY; |
| 1100 | other, iei = RSL_IE_FULL_BCCH_INFO; |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 1101 | |
Harald Welte | 9958a4d | 2017-12-14 21:21:33 +0100 | [diff] [blame] | 1102 | ipa_conn_id, iei = RSL_IE_IPAC_CONN_ID; |
| 1103 | ipa_remote_ip, iei = RSL_IE_IPAC_REMOTE_IP; |
| 1104 | ipa_remote_port, iei = RSL_IE_IPAC_REMOTE_PORT; |
| 1105 | ipa_local_ip, iei = RSL_IE_IPAC_LOCAL_IP; |
| 1106 | ipa_local_port, iei = RSL_IE_IPAC_LOCAL_PORT; |
| 1107 | ipa_rtp_pt, iei = RSL_IE_IPAC_RTP_PAYLOAD; |
| 1108 | ipa_rtp_pt2, iei = RSL_IE_IPAC_RTP_PAYLOAD2; |
| 1109 | ipa_stats, iei = RSL_IE_IPAC_CONN_STAT; |
| 1110 | ipa_speech_mode, iei = RSL_IE_IPAC_SPEECH_MODE; |
| 1111 | |
Neels Hofmeyr | 2bef0dd | 2021-04-22 21:46:00 +0000 | [diff] [blame] | 1112 | osmo_training_sequence, iei = RSL_IE_OSMO_TRAINING_SEQUENCE; |
Vadim Yanitskiy | 1f53215 | 2021-11-01 20:37:56 +0300 | [diff] [blame] | 1113 | rep_acch_cap, iei = RSL_IE_OSMO_REP_ACCH_CAP; |
Vadim Yanitskiy | a203d3b | 2021-11-01 21:32:31 +0300 | [diff] [blame] | 1114 | top_acch_cap, iei = RSL_IE_OSMO_TOP_ACCH_CAP; |
Pau Espin Pedrol | 29c6dfb | 2022-08-08 18:37:56 +0200 | [diff] [blame] | 1115 | osmux_cid, iei = RSL_IE_OSMO_OSMUX_CID; |
Neels Hofmeyr | 2bef0dd | 2021-04-22 21:46:00 +0000 | [diff] [blame] | 1116 | |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 1117 | other, OTHERWISE; |
| 1118 | )" }; |
| 1119 | |
Harald Welte | 735dd07 | 2017-12-12 14:55:17 +0100 | [diff] [blame] | 1120 | /* For some reason the TTCN-3 RAW codec cannot automatically figure out the IEI |
| 1121 | * that it needs to set for a given union-choice (body). So we have to explicitly |
| 1122 | * specify the IEI by the caller :( */ |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 1123 | template (value) RSL_IE t_RSL_IE(RSL_IE_Type iei, template (value) RSL_IE_Body body) := { |
Harald Welte | 735dd07 | 2017-12-12 14:55:17 +0100 | [diff] [blame] | 1124 | iei := iei, |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 1125 | body := body |
| 1126 | } |
| 1127 | |
Harald Welte | c287775 | 2017-12-07 17:54:35 +0100 | [diff] [blame] | 1128 | template RSL_IE tr_RSL_IE(template RSL_IE_Body body) := { |
| 1129 | iei := ?, /* overwritten? */ |
| 1130 | body := body |
| 1131 | } |
| 1132 | |
| 1133 | |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 1134 | type record of RSL_IE RSL_IE_List; |
| 1135 | |
| 1136 | type record RSL_Message { |
| 1137 | RSL_MessageDiscriminator msg_disc, |
| 1138 | RSL_MessageType msg_type, |
| 1139 | RSL_IE_List ies optional |
| 1140 | } |
| 1141 | |
| 1142 | external function enc_RSL_Message(in RSL_Message msg) return octetstring |
| 1143 | with { extension "prototype(convert) encode(RAW)" }; |
| 1144 | external function dec_RSL_Message(in octetstring stream) return RSL_Message |
| 1145 | with { extension "prototype(convert) decode(RAW)" }; |
| 1146 | |
Harald Welte | bc330be | 2017-12-09 00:56:36 +0100 | [diff] [blame] | 1147 | template RSL_Message tr_RSL_MsgDiscType(template RSL_MessageDiscriminator m_disc, |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 1148 | RSL_MessageType m_type) := { |
| 1149 | msg_disc := m_disc, |
| 1150 | msg_type := m_type, |
| 1151 | ies := * |
| 1152 | } |
| 1153 | |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 1154 | template (value) RSL_Message ts_RSL_MsgDiscType(template (value) RSL_MessageDiscriminator m_disc, |
| 1155 | template (value) RSL_MessageType msg_type, |
| 1156 | template (omit) RSL_IE_List ies := omit) := { |
Harald Welte | 4a26736 | 2017-12-09 17:49:32 +0100 | [diff] [blame] | 1157 | msg_disc := m_disc, |
| 1158 | msg_type := msg_type, |
| 1159 | ies := ies |
| 1160 | } |
| 1161 | |
Harald Welte | bc330be | 2017-12-09 00:56:36 +0100 | [diff] [blame] | 1162 | template RSL_Message tr_RSL_MsgType(template RSL_MessageType msg_type) := { |
| 1163 | msg_disc := ?, |
| 1164 | msg_type := msg_type, |
| 1165 | ies := * |
| 1166 | } |
| 1167 | |
| 1168 | /* Common Channel Management */ |
| 1169 | template RSL_Message tr_RSL_MsgTypeC(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := { |
| 1170 | msg_disc := { RSL_MDISC_CCHAN, ? } |
| 1171 | } |
| 1172 | |
| 1173 | /* RLL */ |
| 1174 | template RSL_Message tr_RSL_MsgTypeR(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := { |
| 1175 | msg_disc := { RSL_MDISC_RLL, true } |
| 1176 | } |
| 1177 | |
| 1178 | /* Dedicated Channel Management */ |
| 1179 | template RSL_Message tr_RSL_MsgTypeD(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := { |
| 1180 | msg_disc := { RSL_MDISC_DCHAN, ? } |
| 1181 | } |
| 1182 | |
Vadim Yanitskiy | bf2aa49 | 2022-06-01 00:28:38 +0600 | [diff] [blame] | 1183 | /* TRX Management */ |
Harald Welte | bc330be | 2017-12-09 00:56:36 +0100 | [diff] [blame] | 1184 | template RSL_Message tr_RSL_MsgTypeT(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := { |
| 1185 | msg_disc := { RSL_MDISC_TRX_MGMT, ? } |
| 1186 | } |
| 1187 | |
| 1188 | |
| 1189 | /* dedicated channel or RLL */ |
| 1190 | 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] | 1191 | msg_disc := ({RSL_MDISC_DCHAN,?}, {RSL_MDISC_RLL,?}, {RSL_MDISC_IPACCESS,false}) |
Harald Welte | bc330be | 2017-12-09 00:56:36 +0100 | [diff] [blame] | 1192 | } |
| 1193 | |
| 1194 | |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 1195 | /* 8.3.1 BSC -> BTS */ |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 1196 | template (value) RSL_Message ts_RSL_DATA_REQ(template (value) RslChannelNr chan_nr, |
| 1197 | template (value) RslLinkId link_id, |
| 1198 | octetstring l3_info) := { |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 1199 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, true), |
| 1200 | msg_type := RSL_MT_DATA_REQ, |
| 1201 | ies :={ |
Harald Welte | 735dd07 | 2017-12-12 14:55:17 +0100 | [diff] [blame] | 1202 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 1203 | t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}), |
| 1204 | 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] | 1205 | } |
| 1206 | } |
| 1207 | |
Harald Welte | 7794d5b | 2017-12-16 23:00:20 +0100 | [diff] [blame] | 1208 | template RSL_Message tr_RSL_DATA_REQ(template RslChannelNr chan_nr :=?, |
| 1209 | template RslLinkId link_id := ?, |
| 1210 | template octetstring l3_info := ?) := { |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 1211 | msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, true), |
Harald Welte | 7794d5b | 2017-12-16 23:00:20 +0100 | [diff] [blame] | 1212 | msg_type := RSL_MT_DATA_REQ, |
| 1213 | ies :={ |
| 1214 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
| 1215 | tr_RSL_IE(RSL_IE_Body:{link_id := link_id}), |
| 1216 | tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)}) |
| 1217 | } |
| 1218 | } |
| 1219 | |
| 1220 | |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 1221 | /* 8.3.2 BTS -> BSC */ |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 1222 | template (value) RSL_Message ts_RSL_DATA_IND(template (value) RslChannelNr chan_nr, |
| 1223 | template (value) RslLinkId link_id, |
| 1224 | octetstring l3_info) := { |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 1225 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, true), |
| 1226 | msg_type := RSL_MT_DATA_IND, |
| 1227 | ies :={ |
Harald Welte | 735dd07 | 2017-12-12 14:55:17 +0100 | [diff] [blame] | 1228 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 1229 | t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}), |
| 1230 | 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] | 1231 | } |
| 1232 | } |
Harald Welte | 9abd128 | 2018-02-19 19:18:17 +0100 | [diff] [blame] | 1233 | template RSL_Message tr_RSL_DATA_IND(template RslChannelNr chan_nr, template RslLinkId link_id, |
| 1234 | template octetstring l3_info := ?) := { |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 1235 | msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, true), |
Harald Welte | 9abd128 | 2018-02-19 19:18:17 +0100 | [diff] [blame] | 1236 | msg_type := RSL_MT_DATA_IND, |
| 1237 | ies :={ |
| 1238 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
| 1239 | tr_RSL_IE(RSL_IE_Body:{link_id := link_id}), |
| 1240 | tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)}) |
| 1241 | } |
| 1242 | } |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 1243 | |
| 1244 | /* 8.3.3 BTS -> BSC */ |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 1245 | template (value) RSL_Message ts_RSL_ERROR_IND(template (value) RslChannelNr chan_nr, |
Harald Welte | a7d81f1 | 2019-06-02 22:33:19 +0200 | [diff] [blame] | 1246 | template (value) RslLinkId link_id, |
| 1247 | template (value) octetstring rlm_cause) := { |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 1248 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false), |
| 1249 | msg_type := RSL_MT_ERROR_IND, |
| 1250 | ies :={ |
Harald Welte | 735dd07 | 2017-12-12 14:55:17 +0100 | [diff] [blame] | 1251 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 1252 | t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}), |
Harald Welte | a7d81f1 | 2019-06-02 22:33:19 +0200 | [diff] [blame] | 1253 | t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{rlm_cause := ts_RSL_LV(rlm_cause)}) |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 1254 | } |
| 1255 | } |
Harald Welte | 9abd128 | 2018-02-19 19:18:17 +0100 | [diff] [blame] | 1256 | template RSL_Message tr_RSL_ERROR_IND(template RslChannelNr chan_nr, template RslLinkId link_id, |
Harald Welte | a7d81f1 | 2019-06-02 22:33:19 +0200 | [diff] [blame] | 1257 | template octetstring rlm_cause := ?) := { |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 1258 | msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false), |
Harald Welte | 9abd128 | 2018-02-19 19:18:17 +0100 | [diff] [blame] | 1259 | msg_type := RSL_MT_ERROR_IND, |
| 1260 | ies :={ |
| 1261 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
| 1262 | tr_RSL_IE(RSL_IE_Body:{link_id := link_id}), |
Harald Welte | a7d81f1 | 2019-06-02 22:33:19 +0200 | [diff] [blame] | 1263 | tr_RSL_IE(RSL_IE_Body:{rlm_cause := tr_RSL_LV(rlm_cause)}) |
Harald Welte | 9abd128 | 2018-02-19 19:18:17 +0100 | [diff] [blame] | 1264 | } |
| 1265 | } |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 1266 | |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 1267 | /* 8.3.4 BTS <- BSC */ |
| 1268 | template (value) RSL_Message ts_RSL_EST_REQ(template (value) RslChannelNr chan_nr, |
| 1269 | template (value) RslLinkId link_id) := { |
| 1270 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false), |
| 1271 | msg_type := RSL_MT_EST_REQ, |
| 1272 | ies := { |
| 1273 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 1274 | t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}) |
| 1275 | } |
| 1276 | } |
| 1277 | template RSL_Message tr_RSL_EST_REQ(template RslChannelNr chan_nr, template RslLinkId link_id) := { |
| 1278 | msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false), |
| 1279 | msg_type := RSL_MT_EST_REQ, |
| 1280 | ies := { |
| 1281 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
| 1282 | tr_RSL_IE(RSL_IE_Body:{link_id := link_id}) |
| 1283 | } |
| 1284 | } |
| 1285 | |
| 1286 | /* 8.3.5 BTS -> BSC */ |
| 1287 | template (value) RSL_Message ts_RSL_EST_CONF(template (value) RslChannelNr chan_nr, |
| 1288 | template (value) RslLinkId link_id) := { |
| 1289 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false), |
| 1290 | msg_type := RSL_MT_EST_CONF, |
| 1291 | ies := { |
| 1292 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 1293 | t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}) |
| 1294 | } |
| 1295 | } |
| 1296 | template RSL_Message tr_RSL_EST_CONF(template RslChannelNr chan_nr, template RslLinkId link_id) := { |
| 1297 | msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false), |
| 1298 | msg_type := RSL_MT_EST_CONF, |
| 1299 | ies := { |
| 1300 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
| 1301 | tr_RSL_IE(RSL_IE_Body:{link_id := link_id}) |
| 1302 | } |
| 1303 | } |
| 1304 | |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 1305 | /* 8.3.6 BTS -> BSC */ |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 1306 | template (value) RSL_Message ts_RSL_EST_IND(template (value) RslChannelNr chan_nr, |
| 1307 | template (value) RslLinkId link_id, |
| 1308 | octetstring l3_info) := { |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 1309 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false), |
| 1310 | msg_type := RSL_MT_EST_IND, |
| 1311 | ies := { |
Harald Welte | 735dd07 | 2017-12-12 14:55:17 +0100 | [diff] [blame] | 1312 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 1313 | t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}), |
| 1314 | 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] | 1315 | } |
| 1316 | } |
Harald Welte | 9abd128 | 2018-02-19 19:18:17 +0100 | [diff] [blame] | 1317 | template RSL_Message tr_RSL_EST_IND(template RslChannelNr chan_nr, template RslLinkId link_id, |
| 1318 | template octetstring l3_info := ?) := { |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 1319 | msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false), |
Harald Welte | 9abd128 | 2018-02-19 19:18:17 +0100 | [diff] [blame] | 1320 | msg_type := RSL_MT_EST_IND, |
| 1321 | ies := { |
| 1322 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
| 1323 | tr_RSL_IE(RSL_IE_Body:{link_id := link_id}), |
| 1324 | tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)}) |
| 1325 | } |
| 1326 | } |
Harald Welte | 0472ab4 | 2018-03-12 15:02:26 +0100 | [diff] [blame] | 1327 | template RSL_Message tr_RSL_EST_IND_NOL3(template RslChannelNr chan_nr, template RslLinkId link_id) := |
| 1328 | { |
| 1329 | msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false), |
| 1330 | msg_type := RSL_MT_EST_IND, |
| 1331 | ies := { |
| 1332 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
| 1333 | tr_RSL_IE(RSL_IE_Body:{link_id := link_id}) |
| 1334 | } |
| 1335 | } |
| 1336 | |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 1337 | |
| 1338 | /* 8.3.7 BSC -> BTS */ |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 1339 | template (value) RSL_Message ts_RSL_REL_REQ(template (value) RslChannelNr chan_nr, |
Harald Welte | 0472ab4 | 2018-03-12 15:02:26 +0100 | [diff] [blame] | 1340 | template (value) RslLinkId link_id, |
| 1341 | template (value) RSL_IE_ReleaseMode rel_mode := RSL_REL_MODE_NORMAL) := { |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 1342 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false), |
| 1343 | msg_type := RSL_MT_REL_REQ, |
| 1344 | ies :={ |
Harald Welte | 735dd07 | 2017-12-12 14:55:17 +0100 | [diff] [blame] | 1345 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
Harald Welte | 0472ab4 | 2018-03-12 15:02:26 +0100 | [diff] [blame] | 1346 | t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}), |
| 1347 | t_RSL_IE(RSL_IE_RELEASE_MODE, RSL_IE_Body:{release_mode := rel_mode}) |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 1348 | } |
| 1349 | } |
Harald Welte | e8a5ab1 | 2017-12-09 22:34:57 +0100 | [diff] [blame] | 1350 | template RSL_Message tr_RSL_REL_REQ(template RslChannelNr chan_nr, |
Harald Welte | 0472ab4 | 2018-03-12 15:02:26 +0100 | [diff] [blame] | 1351 | template RslLinkId link_id, |
| 1352 | template RSL_IE_ReleaseMode rel_mode := ?) := { |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 1353 | msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false), |
Harald Welte | e8a5ab1 | 2017-12-09 22:34:57 +0100 | [diff] [blame] | 1354 | msg_type := RSL_MT_REL_REQ, |
| 1355 | ies :={ |
| 1356 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
| 1357 | tr_RSL_IE(RSL_IE_Body:{link_id := link_id}), |
Harald Welte | 0472ab4 | 2018-03-12 15:02:26 +0100 | [diff] [blame] | 1358 | tr_RSL_IE(RSL_IE_Body:{release_mode := rel_mode}) |
Harald Welte | e8a5ab1 | 2017-12-09 22:34:57 +0100 | [diff] [blame] | 1359 | } |
| 1360 | } |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 1361 | |
| 1362 | /* 8.3.8 BTS -> BSC */ |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 1363 | template (value) RSL_Message ts_RSL_REL_CONF(template (value) RslChannelNr chan_nr, |
| 1364 | template (value) RslLinkId link_id) := { |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 1365 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false), |
| 1366 | msg_type := RSL_MT_REL_CONF, |
| 1367 | ies :={ |
Harald Welte | 735dd07 | 2017-12-12 14:55:17 +0100 | [diff] [blame] | 1368 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 1369 | 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] | 1370 | } |
| 1371 | } |
Harald Welte | 9abd128 | 2018-02-19 19:18:17 +0100 | [diff] [blame] | 1372 | template RSL_Message tr_RSL_REL_CONF(template RslChannelNr chan_nr, template RslLinkId link_id) := { |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 1373 | msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false), |
Harald Welte | 9abd128 | 2018-02-19 19:18:17 +0100 | [diff] [blame] | 1374 | msg_type := RSL_MT_REL_CONF, |
| 1375 | ies :={ |
| 1376 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
| 1377 | tr_RSL_IE(RSL_IE_Body:{link_id := link_id}) |
| 1378 | } |
| 1379 | } |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 1380 | |
| 1381 | /* 8.3.9 BTS -> BSC */ |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 1382 | template (value) RSL_Message ts_RSL_REL_IND(template (value) RslChannelNr chan_nr, |
| 1383 | template (value) RslLinkId link_id) := { |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 1384 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false), |
| 1385 | msg_type := RSL_MT_REL_IND, |
| 1386 | ies :={ |
Harald Welte | 735dd07 | 2017-12-12 14:55:17 +0100 | [diff] [blame] | 1387 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 1388 | 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] | 1389 | } |
| 1390 | } |
Harald Welte | 9abd128 | 2018-02-19 19:18:17 +0100 | [diff] [blame] | 1391 | template RSL_Message tr_RSL_REL_IND(template RslChannelNr chan_nr, template RslLinkId link_id) := { |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 1392 | msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false), |
Harald Welte | 9abd128 | 2018-02-19 19:18:17 +0100 | [diff] [blame] | 1393 | msg_type := RSL_MT_REL_IND, |
| 1394 | ies :={ |
| 1395 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
| 1396 | tr_RSL_IE(RSL_IE_Body:{link_id := link_id}) |
| 1397 | } |
| 1398 | } |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 1399 | |
| 1400 | /* 8.3.10 BSC -> BTS */ |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 1401 | template (value) RSL_Message ts_RSL_UNITDATA_REQ(template (value) RslChannelNr chan_nr, |
| 1402 | template (value) RslLinkId link_id, |
| 1403 | octetstring l3_info) |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 1404 | modifies ts_RSL_DATA_REQ := { |
| 1405 | msg_type := RSL_MT_UNIT_DATA_REQ |
| 1406 | } |
Harald Welte | 0472ab4 | 2018-03-12 15:02:26 +0100 | [diff] [blame] | 1407 | template RSL_Message tr_RSL_UNITDATA_REQ(template RslChannelNr chan_nr, |
| 1408 | template RslLinkId link_id, |
Vadim Yanitskiy | 8f98d3f | 2018-10-03 17:58:10 +0700 | [diff] [blame] | 1409 | template octetstring l3_info := ?) |
Harald Welte | 0472ab4 | 2018-03-12 15:02:26 +0100 | [diff] [blame] | 1410 | modifies tr_RSL_DATA_REQ := { |
| 1411 | msg_type := RSL_MT_UNIT_DATA_REQ |
| 1412 | } |
| 1413 | |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 1414 | |
| 1415 | /* 8.3.11 BTS -> BSC */ |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 1416 | template (value) RSL_Message ts_RSL_UNITDATA_IND(template (value) RslChannelNr chan_nr, |
| 1417 | template (value) RslLinkId link_id, |
| 1418 | octetstring l3_info) |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 1419 | modifies ts_RSL_DATA_IND := { |
| 1420 | msg_type := RSL_MT_UNIT_DATA_IND |
| 1421 | } |
Harald Welte | 0472ab4 | 2018-03-12 15:02:26 +0100 | [diff] [blame] | 1422 | template RSL_Message tr_RSL_UNITDATA_IND(template RslChannelNr chan_nr, |
Vadim Yanitskiy | fabe0f2 | 2018-10-03 17:51:47 +0700 | [diff] [blame] | 1423 | template RslLinkId link_id, |
Vadim Yanitskiy | 8f98d3f | 2018-10-03 17:58:10 +0700 | [diff] [blame] | 1424 | template octetstring l3_info := ?) |
Harald Welte | 0472ab4 | 2018-03-12 15:02:26 +0100 | [diff] [blame] | 1425 | modifies tr_RSL_DATA_IND := { |
| 1426 | msg_type := RSL_MT_UNIT_DATA_IND |
| 1427 | } |
| 1428 | |
| 1429 | |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 1430 | |
| 1431 | |
| 1432 | /* DEDICATED CANNEL MANAGEMENT MESSAGES */ |
| 1433 | |
| 1434 | /* 8.4.1 BSC -> BTS */ |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 1435 | template (value) RSL_Message ts_RSL_CHAN_ACT(template (value) RslChannelNr chan_nr, |
Harald Welte | 921f9e0 | 2019-05-19 22:27:11 +0200 | [diff] [blame] | 1436 | template (value) RSL_IE_ChannelMode mode, |
| 1437 | template (value) RSL_IE_ActivationType at := t_RSL_IE_ActType_IA) := { |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 1438 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
| 1439 | msg_type := RSL_MT_CHAN_ACTIV, |
| 1440 | ies :={ |
Harald Welte | 735dd07 | 2017-12-12 14:55:17 +0100 | [diff] [blame] | 1441 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
Harald Welte | 921f9e0 | 2019-05-19 22:27:11 +0200 | [diff] [blame] | 1442 | t_RSL_IE(RSL_IE_ACT_TYPE, RSL_IE_Body:{act_type := at}), |
Harald Welte | 735dd07 | 2017-12-12 14:55:17 +0100 | [diff] [blame] | 1443 | 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] | 1444 | /* lots of optional IEs */ |
| 1445 | } |
| 1446 | } |
Harald Welte | 94e0c34 | 2018-04-07 11:33:23 +0200 | [diff] [blame] | 1447 | template RSL_Message tr_RSL_CHAN_ACT(template RslChannelNr chan_nr, |
Harald Welte | 921f9e0 | 2019-05-19 22:27:11 +0200 | [diff] [blame] | 1448 | template RSL_IE_ChannelMode mode, |
| 1449 | template (value) RSL_IE_ActivationType at := t_RSL_IE_ActType_IA) := { |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 1450 | msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
Harald Welte | 94e0c34 | 2018-04-07 11:33:23 +0200 | [diff] [blame] | 1451 | msg_type := RSL_MT_CHAN_ACTIV, |
| 1452 | ies :={ |
| 1453 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
Harald Welte | 921f9e0 | 2019-05-19 22:27:11 +0200 | [diff] [blame] | 1454 | tr_RSL_IE(RSL_IE_Body:{act_type := at}), |
Harald Welte | 94e0c34 | 2018-04-07 11:33:23 +0200 | [diff] [blame] | 1455 | tr_RSL_IE(RSL_IE_Body:{chan_mode := mode}), |
| 1456 | /* lots of optional IEs */ |
| 1457 | * |
| 1458 | } |
| 1459 | } |
Vadim Yanitskiy | 58b1653 | 2021-10-09 20:27:39 +0600 | [diff] [blame] | 1460 | |
| 1461 | template (value) RSL_Message |
| 1462 | ts_RSL_CHAN_ACT_PDCH(template (value) RslChannelNr chan_nr) := { |
| 1463 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
| 1464 | msg_type := RSL_MT_CHAN_ACTIV, |
| 1465 | ies :={ |
| 1466 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 1467 | t_RSL_IE(RSL_IE_ACT_TYPE, RSL_IE_Body:{act_type := c_RSL_IE_ActType_PDCH}) |
| 1468 | } |
| 1469 | } |
| 1470 | template RSL_Message |
| 1471 | tr_RSL_CHAN_ACT_PDCH(template (present) RslChannelNr chan_nr) := { |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 1472 | msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
Harald Welte | 94e0c34 | 2018-04-07 11:33:23 +0200 | [diff] [blame] | 1473 | msg_type := RSL_MT_CHAN_ACTIV, |
| 1474 | ies :={ |
| 1475 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
Vadim Yanitskiy | 58b1653 | 2021-10-09 20:27:39 +0600 | [diff] [blame] | 1476 | tr_RSL_IE(RSL_IE_Body:{act_type := c_RSL_IE_ActType_PDCH}), |
Harald Welte | 94e0c34 | 2018-04-07 11:33:23 +0200 | [diff] [blame] | 1477 | /* lots of optional IEs */ |
| 1478 | * |
| 1479 | } |
| 1480 | } |
| 1481 | |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 1482 | |
| 1483 | /* 8.4.2 BTS -> BSC */ |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 1484 | template (value) RSL_Message ts_RSL_CHAN_ACT_ACK(template (value) RslChannelNr chan_nr, |
| 1485 | GsmFrameNumber fn) := { |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 1486 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
| 1487 | msg_type := RSL_MT_CHAN_ACTIV_ACK, |
| 1488 | ies :={ |
Harald Welte | 735dd07 | 2017-12-12 14:55:17 +0100 | [diff] [blame] | 1489 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 1490 | 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] | 1491 | } |
| 1492 | } |
Harald Welte | 9abd128 | 2018-02-19 19:18:17 +0100 | [diff] [blame] | 1493 | template RSL_Message tr_RSL_CHAN_ACT_ACK(template RslChannelNr chan_nr) := { |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 1494 | msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
Harald Welte | 9abd128 | 2018-02-19 19:18:17 +0100 | [diff] [blame] | 1495 | msg_type := RSL_MT_CHAN_ACTIV_ACK, |
| 1496 | ies := { |
| 1497 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
| 1498 | tr_RSL_IE(RSL_IE_Body:{frame_nr := ?}) |
| 1499 | } |
| 1500 | } |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 1501 | |
| 1502 | /* 8.4.3 BTS -> BSC */ |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 1503 | template (value) RSL_Message ts_RSL_CHAN_ACT_NACK(template (value) RslChannelNr chan_nr, |
| 1504 | RSL_Cause cause) := { |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 1505 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
| 1506 | msg_type := RSL_MT_CHAN_ACTIV_NACK, |
| 1507 | ies :={ |
Harald Welte | 735dd07 | 2017-12-12 14:55:17 +0100 | [diff] [blame] | 1508 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 1509 | 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] | 1510 | } |
| 1511 | } |
Harald Welte | 9abd128 | 2018-02-19 19:18:17 +0100 | [diff] [blame] | 1512 | template RSL_Message tr_RSL_CHAN_ACT_NACK(template RslChannelNr chan_nr, |
| 1513 | template RSL_Cause cause := ?) := { |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 1514 | msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
Harald Welte | 9abd128 | 2018-02-19 19:18:17 +0100 | [diff] [blame] | 1515 | msg_type := RSL_MT_CHAN_ACTIV_NACK, |
| 1516 | ies := { |
| 1517 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
| 1518 | tr_RSL_IE(RSL_IE_Body:{cause := ?}) |
| 1519 | } |
| 1520 | } |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 1521 | |
| 1522 | /* 8.4.4 BTS -> BSC */ |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 1523 | template (value) RSL_Message ts_RSL_CONN_FAIL_IND(RslChannelNr chan_nr, RSL_Cause cause) := { |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 1524 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
| 1525 | msg_type := RSL_MT_CONN_FAIL, |
| 1526 | ies :={ |
Harald Welte | 735dd07 | 2017-12-12 14:55:17 +0100 | [diff] [blame] | 1527 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 1528 | 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] | 1529 | } |
| 1530 | } |
Harald Welte | 9abd128 | 2018-02-19 19:18:17 +0100 | [diff] [blame] | 1531 | template RSL_Message tr_RSL_CONN_FAIL_IND(template RslChannelNr chan_nr, |
| 1532 | template RSL_Cause cause := ?) := { |
| 1533 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
| 1534 | msg_type := RSL_MT_CONN_FAIL, |
| 1535 | ies :={ |
| 1536 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
| 1537 | tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)}) |
| 1538 | } |
| 1539 | } |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 1540 | |
Harald Welte | e8a5ab1 | 2017-12-09 22:34:57 +0100 | [diff] [blame] | 1541 | /* 8.4.5 BSC -> BTS */ |
| 1542 | template RSL_Message tr_RSL_DEACT_SACCH(template RslChannelNr chan_nr) := { |
| 1543 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
| 1544 | msg_type := RSL_MT_DEACTIVATE_SACCH, |
| 1545 | ies := { |
| 1546 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}) |
| 1547 | } |
| 1548 | } |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 1549 | template (value) RSL_Message ts_RSL_DEACT_SACCH(template (value) RslChannelNr chan_nr) := { |
Harald Welte | 9abd128 | 2018-02-19 19:18:17 +0100 | [diff] [blame] | 1550 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
| 1551 | msg_type := RSL_MT_DEACTIVATE_SACCH, |
| 1552 | ies := { |
| 1553 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}) |
| 1554 | } |
| 1555 | } |
| 1556 | |
Harald Welte | e8a5ab1 | 2017-12-09 22:34:57 +0100 | [diff] [blame] | 1557 | |
Harald Welte | 73cd271 | 2017-12-17 00:44:52 +0100 | [diff] [blame] | 1558 | /* 8.4.6 BSC ->BTS */ |
| 1559 | template RSL_Message tr_RSL_ENCR_CMD(template RslChannelNr chan_nr, |
| 1560 | template RslLinkId link_id := ?, |
Harald Welte | e613f96 | 2018-04-18 22:38:16 +0200 | [diff] [blame] | 1561 | template RSL_AlgId alg := ?, |
Harald Welte | 73cd271 | 2017-12-17 00:44:52 +0100 | [diff] [blame] | 1562 | template octetstring key := ?, |
| 1563 | template octetstring l3_info := ?) := { |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 1564 | msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
Harald Welte | 73cd271 | 2017-12-17 00:44:52 +0100 | [diff] [blame] | 1565 | msg_type := RSL_MT_ENCR_CMD, |
| 1566 | ies := { |
| 1567 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
| 1568 | tr_RSL_IE(RSL_IE_Body:{encr_info := tr_RSL_IE_EncrInfo(alg, key)}), |
| 1569 | tr_RSL_IE(RSL_IE_Body:{link_id := link_id}), |
| 1570 | tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)}) |
| 1571 | } |
| 1572 | } |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 1573 | template (value) RSL_Message ts_RSL_ENCR_CMD(template (value) RslChannelNr chan_nr, |
| 1574 | template (value) RslLinkId link_id, |
Harald Welte | e613f96 | 2018-04-18 22:38:16 +0200 | [diff] [blame] | 1575 | template (value) RSL_AlgId alg, octetstring key, |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 1576 | octetstring l3_info) := { |
Harald Welte | 9abd128 | 2018-02-19 19:18:17 +0100 | [diff] [blame] | 1577 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
| 1578 | msg_type := RSL_MT_ENCR_CMD, |
| 1579 | ies := { |
| 1580 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 1581 | t_RSL_IE(RSL_IE_ENCR_INFO, RSL_IE_Body:{encr_info := ts_RSL_IE_EncrInfo(alg, key)}), |
Harald Welte | 9abd128 | 2018-02-19 19:18:17 +0100 | [diff] [blame] | 1582 | t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}), |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 1583 | t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)}) |
Harald Welte | 9abd128 | 2018-02-19 19:18:17 +0100 | [diff] [blame] | 1584 | } |
| 1585 | } |
Harald Welte | 73cd271 | 2017-12-17 00:44:52 +0100 | [diff] [blame] | 1586 | |
Harald Welte | 2691adf | 2018-02-22 17:32:39 +0100 | [diff] [blame] | 1587 | template RSL_Message tr_RSL_MEAS_RES(template RslChannelNr chan_nr, |
| 1588 | template uint8_t meas_res_nr := ?, |
| 1589 | template RSL_IE_UplinkMeas ul_meas := ?, |
| 1590 | template RSL_IE_BS_Power bs_power := ?) := { |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 1591 | msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
Harald Welte | 2691adf | 2018-02-22 17:32:39 +0100 | [diff] [blame] | 1592 | msg_type := RSL_MT_MEAS_RES, |
| 1593 | ies := { |
| 1594 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
| 1595 | tr_RSL_IE(RSL_IE_Body:{meas_res_nr := meas_res_nr}), |
| 1596 | tr_RSL_IE(RSL_IE_Body:{uplink_meas := ul_meas}), |
| 1597 | tr_RSL_IE(RSL_IE_Body:{bs_power := bs_power}), |
| 1598 | * |
| 1599 | } |
| 1600 | } |
| 1601 | |
Vadim Yanitskiy | 7c29c4e | 2022-06-18 03:07:50 +0700 | [diff] [blame] | 1602 | /* Templates for a measurement report that lacks the measurement report |
Philipp Maier | dd841d3 | 2019-12-17 14:44:54 +0100 | [diff] [blame] | 1603 | * from the MS (l1_info, l3_info and ms timing offset */ |
Vadim Yanitskiy | 7c29c4e | 2022-06-18 03:07:50 +0700 | [diff] [blame] | 1604 | template (value) RSL_Message |
| 1605 | ts_RSL_MEAS_RES_EMPTY(template (value) RslChannelNr chan_nr, |
| 1606 | template (value) uint8_t meas_res_nr, |
| 1607 | template (value) RSL_IE_UplinkMeas ul_meas, |
| 1608 | template (value) RSL_IE_BS_Power bs_power) := { |
| 1609 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
| 1610 | msg_type := RSL_MT_MEAS_RES, |
| 1611 | ies := { |
| 1612 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 1613 | t_RSL_IE(RSL_IE_MEAS_RES_NR, RSL_IE_Body:{meas_res_nr := meas_res_nr}), |
| 1614 | t_RSL_IE(RSL_IE_UPLINK_MEAS, RSL_IE_Body:{uplink_meas := ul_meas}), |
| 1615 | t_RSL_IE(RSL_IE_BS_POWER, RSL_IE_Body:{bs_power := bs_power}) |
| 1616 | } |
| 1617 | } |
| 1618 | template RSL_Message |
| 1619 | tr_RSL_MEAS_RES_EMPTY(template (present) RslChannelNr chan_nr, |
| 1620 | template uint8_t meas_res_nr := ?, |
| 1621 | template RSL_IE_UplinkMeas ul_meas := ?, |
| 1622 | template RSL_IE_BS_Power bs_power := ?) := { |
Philipp Maier | dd841d3 | 2019-12-17 14:44:54 +0100 | [diff] [blame] | 1623 | msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
| 1624 | msg_type := RSL_MT_MEAS_RES, |
| 1625 | ies := { |
| 1626 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
| 1627 | tr_RSL_IE(RSL_IE_Body:{meas_res_nr := meas_res_nr}), |
| 1628 | tr_RSL_IE(RSL_IE_Body:{uplink_meas := ul_meas}), |
| 1629 | tr_RSL_IE(RSL_IE_Body:{bs_power := bs_power}) |
| 1630 | } |
| 1631 | } |
| 1632 | |
Harald Welte | 39b47be | 2018-02-23 18:58:48 +0100 | [diff] [blame] | 1633 | /* Osmocom specific template, require lots of optional fields to be present */ |
| 1634 | template RSL_Message tr_RSL_MEAS_RES_OSMO(template RslChannelNr chan_nr, |
| 1635 | template uint8_t meas_res_nr := ?, |
| 1636 | template RSL_IE_UplinkMeas ul_meas := ?, |
| 1637 | template RSL_IE_BS_Power bs_power := ?, |
| 1638 | template RSL_IE_L1Info l1_info := ?, |
| 1639 | template octetstring l3_info := ?, |
| 1640 | template uint8_t ms_to := ?) := { |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 1641 | msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
Harald Welte | 39b47be | 2018-02-23 18:58:48 +0100 | [diff] [blame] | 1642 | msg_type := RSL_MT_MEAS_RES, |
| 1643 | ies := { |
| 1644 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
| 1645 | tr_RSL_IE(RSL_IE_Body:{meas_res_nr := meas_res_nr}), |
| 1646 | tr_RSL_IE(RSL_IE_Body:{uplink_meas := ul_meas}), |
| 1647 | tr_RSL_IE(RSL_IE_Body:{bs_power := bs_power}), |
| 1648 | tr_RSL_IE(RSL_IE_Body:{l1_info := l1_info}), |
| 1649 | tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)}), |
| 1650 | tr_RSL_IE(RSL_IE_Body:{ms_timing_offset := ms_to}) |
| 1651 | } |
| 1652 | } |
| 1653 | |
Neels Hofmeyr | afe2ea5 | 2021-11-24 15:16:12 +0100 | [diff] [blame] | 1654 | template (value) RSL_Message ts_RSL_MEAS_RES(template (value) RslChannelNr chan_nr, |
| 1655 | uint8_t meas_res_nr, |
| 1656 | template (value) RSL_IE_UplinkMeas ul_meas, |
| 1657 | template (value) RSL_IE_BS_Power bs_power, |
| 1658 | template (value) RSL_IE_L1Info l1_info, |
| 1659 | octetstring l3_info, |
| 1660 | uint8_t ms_to) := { |
| 1661 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
| 1662 | msg_type := RSL_MT_MEAS_RES, |
| 1663 | ies := { |
| 1664 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 1665 | t_RSL_IE(RSL_IE_MEAS_RES_NR, RSL_IE_Body:{meas_res_nr := meas_res_nr}), |
| 1666 | t_RSL_IE(RSL_IE_UPLINK_MEAS, RSL_IE_Body:{uplink_meas := ul_meas}), |
| 1667 | t_RSL_IE(RSL_IE_BS_POWER, RSL_IE_Body:{bs_power := bs_power}), |
| 1668 | t_RSL_IE(RSL_IE_L1_INFO, RSL_IE_Body:{l1_info := l1_info}), |
| 1669 | t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)}), |
| 1670 | t_RSL_IE(RSL_IE_MS_TIMING_OFFSET, RSL_IE_Body:{ms_timing_offset := ms_to}) |
| 1671 | } |
| 1672 | } |
| 1673 | |
Eric Wild | f1827a7 | 2019-05-28 17:37:35 +0200 | [diff] [blame] | 1674 | /* 8.4.9 BSC -> BTS */ |
| 1675 | template (value) RSL_Message ts_RSL_MODE_MODIFY_REQ(template (value) RslChannelNr chan_nr, |
| 1676 | template (value) RSL_IE_ChannelMode mode) := { |
| 1677 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
| 1678 | msg_type := RSL_MT_MODE_MODIFY_REQ, |
| 1679 | ies :={ |
| 1680 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 1681 | t_RSL_IE(RSL_IE_CHAN_MODE, RSL_IE_Body:{chan_mode := mode}) |
| 1682 | /* lots of optional IEs */ |
| 1683 | } |
| 1684 | } |
| 1685 | template RSL_Message tr_RSL_MODE_MODIFY_REQ(template RslChannelNr chan_nr, |
| 1686 | template RSL_IE_ChannelMode mode) := { |
| 1687 | msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
| 1688 | msg_type := RSL_MT_MODE_MODIFY_REQ, |
| 1689 | ies :={ |
| 1690 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
| 1691 | tr_RSL_IE(RSL_IE_Body:{chan_mode := mode}), |
| 1692 | /* lots of optional IEs */ |
| 1693 | * |
| 1694 | } |
| 1695 | } |
Neels Hofmeyr | 9f3e6ac | 2021-04-08 23:09:24 +0200 | [diff] [blame] | 1696 | |
| 1697 | template RSL_Message tr_RSL_MODE_MODIFY_REQ_with_OSMO_TSC(template RslChannelNr chan_nr, |
| 1698 | template RSL_IE_ChannelMode mode, |
| 1699 | template uint8_t tsc_set := ?, |
| 1700 | template uint8_t tsc := ?) := { |
| 1701 | msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
| 1702 | msg_type := RSL_MT_MODE_MODIFY_REQ, |
| 1703 | ies := { |
| 1704 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
| 1705 | tr_RSL_IE(RSL_IE_Body:{chan_mode := mode}), |
| 1706 | tr_RSL_IE(RSL_IE_Body:{osmo_training_sequence := { |
| 1707 | len := ?, |
| 1708 | tsc_set := tsc_set, |
| 1709 | tsc := tsc |
| 1710 | } |
| 1711 | }) |
| 1712 | } |
| 1713 | }; |
Pau Espin Pedrol | 8539312 | 2022-09-02 17:56:25 +0200 | [diff] [blame] | 1714 | |
Harald Welte | 7794d5b | 2017-12-16 23:00:20 +0100 | [diff] [blame] | 1715 | /* 8.4.10 BTS -> BSC */ |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 1716 | template (value) RSL_Message ts_RSL_MODE_MODIFY_ACK(template (value) RslChannelNr chan_nr) := { |
Harald Welte | 7794d5b | 2017-12-16 23:00:20 +0100 | [diff] [blame] | 1717 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
| 1718 | msg_type := RSL_MT_MODE_MODIFY_ACK, |
| 1719 | ies := { |
| 1720 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}) |
| 1721 | } |
| 1722 | } |
Harald Welte | 9abd128 | 2018-02-19 19:18:17 +0100 | [diff] [blame] | 1723 | template RSL_Message tr_RSL_MODE_MODIFY_ACK(template RslChannelNr chan_nr) := { |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 1724 | msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
Harald Welte | 9abd128 | 2018-02-19 19:18:17 +0100 | [diff] [blame] | 1725 | msg_type := RSL_MT_MODE_MODIFY_ACK, |
| 1726 | ies := { |
| 1727 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}) |
| 1728 | } |
| 1729 | } |
Harald Welte | 7794d5b | 2017-12-16 23:00:20 +0100 | [diff] [blame] | 1730 | |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 1731 | /* 8.4.11 BTS -> BSC */ |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 1732 | template (value) RSL_Message ts_RSL_MODE_MODIFY_NACK(template (value) RslChannelNr chan_nr, |
| 1733 | RSL_Cause cause) := { |
Harald Welte | 9abd128 | 2018-02-19 19:18:17 +0100 | [diff] [blame] | 1734 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
| 1735 | msg_type := RSL_MT_MODE_MODIFY_NACK, |
| 1736 | ies := { |
| 1737 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 1738 | t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)}) |
| 1739 | } |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 1740 | } |
Harald Welte | 9abd128 | 2018-02-19 19:18:17 +0100 | [diff] [blame] | 1741 | template RSL_Message tr_RSL_MODE_MODIFY_NACK(template RslChannelNr chan_nr, |
| 1742 | template RSL_Cause cause) := { |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 1743 | msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
Harald Welte | 9abd128 | 2018-02-19 19:18:17 +0100 | [diff] [blame] | 1744 | msg_type := RSL_MT_MODE_MODIFY_NACK, |
| 1745 | ies := { |
| 1746 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
| 1747 | tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)}) |
| 1748 | } |
| 1749 | } |
| 1750 | |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 1751 | |
Harald Welte | 6a8199d | 2018-01-29 21:58:53 +0100 | [diff] [blame] | 1752 | /* 8.4.14: BTS <- BSC */ |
| 1753 | template RSL_Message tr_RSL_RF_CHAN_REL(template RslChannelNr chan_nr) := { |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 1754 | msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
Harald Welte | 6a8199d | 2018-01-29 21:58:53 +0100 | [diff] [blame] | 1755 | msg_type := RSL_MT_RF_CHAN_REL, |
| 1756 | ies := { |
| 1757 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}) |
| 1758 | } |
| 1759 | } |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 1760 | template (value) RSL_Message ts_RSL_RF_CHAN_REL(template (value) RslChannelNr chan_nr) := { |
Harald Welte | 9abd128 | 2018-02-19 19:18:17 +0100 | [diff] [blame] | 1761 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
| 1762 | msg_type := RSL_MT_RF_CHAN_REL, |
| 1763 | ies := { |
| 1764 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}) |
| 1765 | } |
| 1766 | } |
Harald Welte | 6a8199d | 2018-01-29 21:58:53 +0100 | [diff] [blame] | 1767 | |
Philipp Maier | 4d1e9c9 | 2018-12-20 11:11:56 +0100 | [diff] [blame] | 1768 | /* 8.4.15: BTS <- BSC */ |
| 1769 | template (value) RSL_Message ts_RSL_MS_PWR_CTRL(template (value) RslChannelNr chan_nr, |
| 1770 | template (value) RSL_IE_MS_Power ms_power) := { |
| 1771 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
| 1772 | msg_type := RSL_MT_MS_POWER_CONTROL, |
| 1773 | ies := { |
| 1774 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 1775 | t_RSL_IE(RSL_IE_MS_POWER, RSL_IE_Body:{ms_power := ms_power}) |
| 1776 | /* One optional IE: MS POWER PARAMETERS */ |
| 1777 | } |
| 1778 | } |
| 1779 | |
Eric Wild | 61edb7e | 2019-06-03 12:38:31 +0200 | [diff] [blame] | 1780 | template (value) RSL_Message ts_RSL_MS_PWR_CTRL_with_pp(template (value) RslChannelNr chan_nr, |
| 1781 | integer pwr_level) := { |
| 1782 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
| 1783 | msg_type := RSL_MT_MS_POWER_CONTROL, |
| 1784 | ies := { |
| 1785 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 1786 | t_RSL_IE(RSL_IE_MS_POWER, RSL_IE_Body:{ms_power := ts_RSL_IE_MS_Power(pwr_level)}), |
| 1787 | t_RSL_IE(RSL_IE_MS_POWER_PARAM, RSL_IE_Body:{ms_power_params := |
| 1788 | ts_RSL_IE_MS_Power_Parameters(''O)}) |
| 1789 | } |
| 1790 | } |
| 1791 | |
Eric Wild | ae8f262 | 2019-06-18 17:05:11 +0200 | [diff] [blame] | 1792 | /* 8.4.16: BTS <- BSC */ |
| 1793 | template (value) RSL_Message ts_RSL_BS_PWR_CTRL(template (value) RslChannelNr chan_nr, |
| 1794 | template (value) RSL_IE_BS_Power bs_power) := { |
| 1795 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
| 1796 | msg_type := RSL_MT_BS_POWER_CONTROL, |
| 1797 | ies := { |
| 1798 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 1799 | t_RSL_IE(RSL_IE_BS_POWER, RSL_IE_Body:{bs_power := bs_power}) |
| 1800 | /* One optional IE: BS POWER PARAMETERS */ |
| 1801 | } |
| 1802 | } |
Vadim Yanitskiy | 2a5a1ef | 2021-06-30 00:51:48 +0200 | [diff] [blame] | 1803 | template RSL_Message tr_RSL_BS_PWR_CTRL(template (present) RslChannelNr chan_nr, |
| 1804 | template (present) RSL_IE_BS_Power bs_power) := { |
| 1805 | msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
| 1806 | msg_type := RSL_MT_BS_POWER_CONTROL, |
| 1807 | ies := { |
| 1808 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
| 1809 | tr_RSL_IE(RSL_IE_Body:{bs_power := bs_power}) |
| 1810 | /* One optional IE: BS POWER PARAMETERS */ |
| 1811 | } |
| 1812 | } |
Eric Wild | ae8f262 | 2019-06-18 17:05:11 +0200 | [diff] [blame] | 1813 | |
Harald Welte | 4a26736 | 2017-12-09 17:49:32 +0100 | [diff] [blame] | 1814 | /* 8.4.19 BTS -> BSC */ |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 1815 | template (value) RSL_Message ts_RSL_RF_CHAN_REL_ACK(template (value) RslChannelNr chan_nr) := |
Harald Welte | 4a26736 | 2017-12-09 17:49:32 +0100 | [diff] [blame] | 1816 | ts_RSL_MsgDiscType(ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
| 1817 | RSL_MT_RF_CHAN_REL_ACK, |
Harald Welte | 735dd07 | 2017-12-12 14:55:17 +0100 | [diff] [blame] | 1818 | { 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] | 1819 | |
Harald Welte | 9abd128 | 2018-02-19 19:18:17 +0100 | [diff] [blame] | 1820 | template RSL_Message tr_RSL_RF_CHAN_REL_ACK(template RslChannelNr chan_nr) := { |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 1821 | msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
Harald Welte | 9abd128 | 2018-02-19 19:18:17 +0100 | [diff] [blame] | 1822 | msg_type := RSL_MT_RF_CHAN_REL_ACK, |
| 1823 | ies := { |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 1824 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}) |
Harald Welte | 9abd128 | 2018-02-19 19:18:17 +0100 | [diff] [blame] | 1825 | } |
| 1826 | } |
| 1827 | |
Harald Welte | ea17b91 | 2018-03-11 22:29:31 +0100 | [diff] [blame] | 1828 | /* 8.6.20 BTS <- BSC */ |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 1829 | template (value) RSL_Message ts_RSL_SACCH_INF_MOD(template (value) RslChannelNr chan_nr, |
| 1830 | RSL_IE_SysinfoType si_type, |
| 1831 | octetstring l3_info) := { |
Harald Welte | ea17b91 | 2018-03-11 22:29:31 +0100 | [diff] [blame] | 1832 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
| 1833 | msg_type := RSL_MT_SACCH_INFO_MODIFY, |
| 1834 | ies := { |
| 1835 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 1836 | t_RSL_IE(RSL_IE_SYSINFO_TYPE, RSL_IE_Body:{sysinfo_type := si_type}), |
| 1837 | t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)}) |
| 1838 | } |
| 1839 | } |
| 1840 | |
Neels Hofmeyr | 378a49c | 2018-06-15 22:18:43 +0200 | [diff] [blame] | 1841 | /* 8.4.7 BTS -> BSC */ |
| 1842 | template (value) RSL_Message ts_RSL_HANDO_DET(template (value) RslChannelNr chan_nr) := { |
| 1843 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
| 1844 | msg_type := RSL_MT_HANDO_DET, |
| 1845 | ies := { |
| 1846 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}) |
| 1847 | } |
| 1848 | } |
Vadim Yanitskiy | 7c2c10c | 2019-05-31 20:42:01 +0700 | [diff] [blame] | 1849 | template RSL_Message tr_RSL_HANDO_DET(template RslChannelNr chan_nr, |
| 1850 | template uint8_t acc_delay := ?) := { |
| 1851 | msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
| 1852 | msg_type := RSL_MT_HANDO_DET, |
| 1853 | ies := { |
| 1854 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
| 1855 | tr_RSL_IE(RSL_IE_Body:{access_delay := acc_delay}) |
| 1856 | } |
| 1857 | } |
Neels Hofmeyr | 378a49c | 2018-06-15 22:18:43 +0200 | [diff] [blame] | 1858 | |
Harald Welte | ea17b91 | 2018-03-11 22:29:31 +0100 | [diff] [blame] | 1859 | |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 1860 | /* COMMON CHANNEL MANAGEMENT MESSAGES */ |
| 1861 | |
Harald Welte | 874c223 | 2018-02-24 04:52:43 +0100 | [diff] [blame] | 1862 | /* 8.5.1 BTS <- BSC */ |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 1863 | template (value) RSL_Message ts_RSL_BCCH_INFO(RSL_IE_SysinfoType si_type, |
| 1864 | octetstring full_bcch_info) := { |
Harald Welte | 874c223 | 2018-02-24 04:52:43 +0100 | [diff] [blame] | 1865 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false), |
| 1866 | msg_type := RSL_MT_BCCH_INFO, |
| 1867 | ies := { |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 1868 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_BCCH(0)}), |
Harald Welte | 874c223 | 2018-02-24 04:52:43 +0100 | [diff] [blame] | 1869 | t_RSL_IE(RSL_IE_SYSINFO_TYPE, RSL_IE_Body:{sysinfo_type := si_type}), |
| 1870 | t_RSL_IE(RSL_IE_FULL_BCCH_INFO, RSL_IE_Body:{other := ts_RSL_LV(full_bcch_info)}) |
| 1871 | } |
| 1872 | } |
Harald Welte | 09538f8 | 2019-08-01 09:50:25 +0200 | [diff] [blame] | 1873 | template RSL_Message tr_RSL_NO_BCCH_INFO(template RSL_IE_SysinfoType si_type := ?) := { |
| 1874 | msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false), |
| 1875 | msg_type := RSL_MT_BCCH_INFO, |
| 1876 | ies := { |
| 1877 | tr_RSL_IE(RSL_IE_Body:{chan_nr := ts_RslChanNr_BCCH(0)}), |
| 1878 | tr_RSL_IE(RSL_IE_Body:{sysinfo_type := si_type}) |
| 1879 | } |
| 1880 | } |
| 1881 | template RSL_Message tr_RSL_BCCH_INFO(template RSL_IE_SysinfoType si_type := ?, |
| 1882 | template octetstring full_bcch_info := ?) := { |
| 1883 | msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false), |
| 1884 | msg_type := RSL_MT_BCCH_INFO, |
| 1885 | ies := { |
| 1886 | tr_RSL_IE(RSL_IE_Body:{chan_nr := ts_RslChanNr_BCCH(0)}), |
| 1887 | tr_RSL_IE(RSL_IE_Body:{sysinfo_type := si_type}), |
| 1888 | tr_RSL_IE(RSL_IE_Body:{other := tr_RSL_LV(full_bcch_info)}), |
| 1889 | * |
| 1890 | } |
| 1891 | } |
Harald Welte | 874c223 | 2018-02-24 04:52:43 +0100 | [diff] [blame] | 1892 | |
Harald Welte | 7ae9314 | 2017-12-07 17:56:15 +0100 | [diff] [blame] | 1893 | /* 8.5.2 BTS -> BSC */ |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 1894 | template (value) RSL_Message ts_RSL_RACH_LOAD_IND(uint16_t slot_ct, uint16_t busy_ct, |
| 1895 | uint16_t acc_ct) := { |
Harald Welte | 7ae9314 | 2017-12-07 17:56:15 +0100 | [diff] [blame] | 1896 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false), |
| 1897 | msg_type := RSL_MT_CCCH_LOAD_IND, |
| 1898 | ies := { |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 1899 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_RACH(0)}), |
Harald Welte | 735dd07 | 2017-12-12 14:55:17 +0100 | [diff] [blame] | 1900 | 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] | 1901 | } |
| 1902 | } |
Harald Welte | 68e495b | 2018-02-25 00:05:57 +0100 | [diff] [blame] | 1903 | template RSL_Message tr_RSL_RACH_LOAD_IND(template uint16_t slot_ct := ?, |
| 1904 | template uint16_t busy_ct := ?, |
Harald Welte | 09538f8 | 2019-08-01 09:50:25 +0200 | [diff] [blame] | 1905 | template uint16_t acc_ct := ?) := { |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 1906 | msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false), |
Harald Welte | 68e495b | 2018-02-25 00:05:57 +0100 | [diff] [blame] | 1907 | msg_type := RSL_MT_CCCH_LOAD_IND, |
| 1908 | ies := { |
| 1909 | tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_RACH(0)}), |
| 1910 | tr_RSL_IE(RSL_IE_Body:{rach_load := tr_RSL_IE_RachLoad(slot_ct, busy_ct, acc_ct)}) |
| 1911 | } |
| 1912 | } |
| 1913 | |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 1914 | template (value) RSL_Message ts_RSL_PAGING_LOAD_IND(uint16_t buffer_space) := { |
Harald Welte | 7ae9314 | 2017-12-07 17:56:15 +0100 | [diff] [blame] | 1915 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false), |
| 1916 | msg_type := RSL_MT_CCCH_LOAD_IND, |
| 1917 | ies := { |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 1918 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_PCH_AGCH(0)}), |
Harald Welte | 735dd07 | 2017-12-12 14:55:17 +0100 | [diff] [blame] | 1919 | 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] | 1920 | } |
| 1921 | } |
Harald Welte | 68e495b | 2018-02-25 00:05:57 +0100 | [diff] [blame] | 1922 | template RSL_Message tr_RSL_PAGING_LOAD_IND(template uint16_t buffer_space := ?) := { |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 1923 | msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false), |
Harald Welte | 68e495b | 2018-02-25 00:05:57 +0100 | [diff] [blame] | 1924 | msg_type := RSL_MT_CCCH_LOAD_IND, |
| 1925 | ies := { |
| 1926 | tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(0)}), |
| 1927 | tr_RSL_IE(RSL_IE_Body:{paging_load := buffer_space}) |
| 1928 | } |
| 1929 | } |
| 1930 | |
Harald Welte | 7ae9314 | 2017-12-07 17:56:15 +0100 | [diff] [blame] | 1931 | |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 1932 | /* 8.5.3 BTS -> BSC */ |
Vadim Yanitskiy | ab448a5 | 2019-05-31 20:24:03 +0700 | [diff] [blame] | 1933 | template (value) RSL_Message ts_RSL_CHAN_RQD(OCT1 ra, GsmFrameNumber fn, |
| 1934 | template (value) RslChannelNr chan_nr := ts_RslChanNr_RACH(0), |
| 1935 | uint8_t acc_del := 0) := { |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 1936 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false), |
| 1937 | msg_type := RSL_MT_CHAN_RQD, |
| 1938 | ies := { |
Vadim Yanitskiy | ab448a5 | 2019-05-31 20:24:03 +0700 | [diff] [blame] | 1939 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 1940 | /* TODO: we may need to have optional RSL_IE_LINK_IDENT IE here */ |
Harald Welte | 735dd07 | 2017-12-12 14:55:17 +0100 | [diff] [blame] | 1941 | t_RSL_IE(RSL_IE_REQ_REFERENCE, RSL_IE_Body:{req_ref := ts_RSL_IE_ReqRef(ra, fn)}), |
| 1942 | 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] | 1943 | } |
| 1944 | } |
Harald Welte | 9abd128 | 2018-02-19 19:18:17 +0100 | [diff] [blame] | 1945 | template RSL_Message tr_RSL_CHAN_RQD(template OCT1 ra, template GsmFrameNumber fn := ?, |
Vadim Yanitskiy | ab448a5 | 2019-05-31 20:24:03 +0700 | [diff] [blame] | 1946 | template RslChannelNr chan_nr := ts_RslChanNr_RACH(0), |
| 1947 | template uint8_t acc_del := ?) := { |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 1948 | msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false), |
Harald Welte | 9abd128 | 2018-02-19 19:18:17 +0100 | [diff] [blame] | 1949 | msg_type := RSL_MT_CHAN_RQD, |
| 1950 | ies := { |
Vadim Yanitskiy | ab448a5 | 2019-05-31 20:24:03 +0700 | [diff] [blame] | 1951 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
| 1952 | /* TODO: we may need to have optional RSL_IE_LINK_IDENT IE here */ |
Harald Welte | 9abd128 | 2018-02-19 19:18:17 +0100 | [diff] [blame] | 1953 | tr_RSL_IE(RSL_IE_Body:{req_ref := tr_RSL_IE_ReqRef(ra, fn)}), |
| 1954 | tr_RSL_IE(RSL_IE_Body:{access_delay := acc_del}) |
| 1955 | } |
| 1956 | } |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 1957 | |
| 1958 | /* 8.5.4 BTS -> BSC */ |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 1959 | template (value) RSL_Message ts_DELETE_IND(template (value) RslChannelNr chan_nr, |
| 1960 | octetstring imm_ass) := { |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 1961 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false), |
| 1962 | msg_type := RSL_MT_DELETE_IND, |
| 1963 | ies := { |
Harald Welte | 735dd07 | 2017-12-12 14:55:17 +0100 | [diff] [blame] | 1964 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 1965 | 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] | 1966 | } |
| 1967 | } |
Harald Welte | e8d750e | 2018-06-10 21:41:35 +0200 | [diff] [blame] | 1968 | template RSL_Message tr_RSL_DELETE_IND(template octetstring imm_ass := ?, template uint3_t tn) := { |
| 1969 | msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false), |
| 1970 | msg_type := RSL_MT_DELETE_IND, |
| 1971 | ies := { |
| 1972 | tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(tn)}), |
| 1973 | tr_RSL_IE(RSL_IE_Body:{full_imm_ass_info := tr_RSL_LV(imm_ass)}), |
| 1974 | * |
| 1975 | } |
| 1976 | } |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 1977 | |
Harald Welte | c287775 | 2017-12-07 17:54:35 +0100 | [diff] [blame] | 1978 | /* 8.5.5 BSC -> BTS */ |
Vadim Yanitskiy | cc4623d | 2020-03-28 06:14:06 +0700 | [diff] [blame] | 1979 | template RSL_Message tr_RSL_PAGING_CMD(template MobileIdentityV mi, template uint3_t tn := ?) := { |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 1980 | msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false), |
Harald Welte | c287775 | 2017-12-07 17:54:35 +0100 | [diff] [blame] | 1981 | msg_type := RSL_MT_PAGING_CMD, |
| 1982 | ies := { |
| 1983 | tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(tn)}), |
| 1984 | tr_RSL_IE(RSL_IE_Body:{paging_group := ?}), |
Vadim Yanitskiy | cc4623d | 2020-03-28 06:14:06 +0700 | [diff] [blame] | 1985 | tr_RSL_IE(RSL_IE_Body:{ms_identity := tr_MI_LV(mi)}), |
Harald Welte | c287775 | 2017-12-07 17:54:35 +0100 | [diff] [blame] | 1986 | * /* opt: channel needed, eMLPP prio */ |
| 1987 | } |
| 1988 | } |
Vadim Yanitskiy | cc4623d | 2020-03-28 06:14:06 +0700 | [diff] [blame] | 1989 | template (value) RSL_Message ts_RSL_PAGING_CMD(MobileIdentityV mi, uint8_t pg, uint3_t tn := 0) := { |
Harald Welte | 9abd128 | 2018-02-19 19:18:17 +0100 | [diff] [blame] | 1990 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false), |
| 1991 | msg_type := RSL_MT_PAGING_CMD, |
| 1992 | ies := { |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 1993 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_PCH_AGCH(tn)}), |
Harald Welte | 9abd128 | 2018-02-19 19:18:17 +0100 | [diff] [blame] | 1994 | t_RSL_IE(RSL_IE_PAGING_GROUP, RSL_IE_Body:{paging_group := pg}), |
Vadim Yanitskiy | cc4623d | 2020-03-28 06:14:06 +0700 | [diff] [blame] | 1995 | t_RSL_IE(RSL_IE_MS_IDENTITY, RSL_IE_Body:{ms_identity := ts_MI_LV(mi)}) |
Harald Welte | 9abd128 | 2018-02-19 19:18:17 +0100 | [diff] [blame] | 1996 | } |
| 1997 | } |
Harald Welte | c287775 | 2017-12-07 17:54:35 +0100 | [diff] [blame] | 1998 | |
| 1999 | /* 8.5.6 BSC -> BTS */ |
| 2000 | template RSL_Message tr_RSL_IMM_ASSIGN(template uint3_t tn := ?) := { |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 2001 | msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false), |
Harald Welte | c287775 | 2017-12-07 17:54:35 +0100 | [diff] [blame] | 2002 | msg_type := RSL_MT_IMMEDIATE_ASSIGN_CMD, |
| 2003 | ies := { |
| 2004 | tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(tn)}), |
| 2005 | tr_RSL_IE(RSL_IE_Body:{full_imm_ass_info := ?}) |
| 2006 | } |
| 2007 | } |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 2008 | template (value) RSL_Message ts_RSL_IMM_ASSIGN(octetstring f_ass_inf, uint3_t tn := 0) := { |
Harald Welte | 9abd128 | 2018-02-19 19:18:17 +0100 | [diff] [blame] | 2009 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false), |
| 2010 | msg_type := RSL_MT_IMMEDIATE_ASSIGN_CMD, |
| 2011 | ies := { |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 2012 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_PCH_AGCH(tn)}), |
Harald Welte | 9abd128 | 2018-02-19 19:18:17 +0100 | [diff] [blame] | 2013 | t_RSL_IE(RSL_IE_FULL_IMM_ASS_INFO, RSL_IE_Body:{full_imm_ass_info := ts_RSL_LV(f_ass_inf)}) |
| 2014 | } |
| 2015 | } |
Harald Welte | c287775 | 2017-12-07 17:54:35 +0100 | [diff] [blame] | 2016 | |
Harald Welte | cc37320 | 2018-09-10 10:28:21 +0200 | [diff] [blame] | 2017 | /* 8.5.8 BTS <- BSC SMS BROADCAST COMMAND */ |
| 2018 | template RSL_Message tr_RSL_SMSCB_CMD(template RSL_IE_CbCommandType cb_cmd := ?, |
| 2019 | template octetstring msg := ?, |
| 2020 | template RslChannelNr chan_nr := ?) := { |
| 2021 | msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false), |
| 2022 | msg_type := RSL_MT_SMS_BC_CMD, |
| 2023 | ies := { |
| 2024 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
| 2025 | tr_RSL_IE(RSL_IE_Body:{cb_cmd_type := cb_cmd}), |
| 2026 | tr_RSL_IE(RSL_IE_Body:{smscb_message := tr_RSL_LV(msg)}), |
| 2027 | * |
| 2028 | } |
| 2029 | } |
| 2030 | template (value) RSL_Message ts_RSL_SMSCB_CMD(template (value) RSL_IE_CbCommandType cb_cmd, |
| 2031 | template (value) octetstring msg, |
| 2032 | template (value) RslChannelNr chan_nr := |
| 2033 | ts_RslChanNr_SDCCH4(0, 2)) := { |
| 2034 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false), |
| 2035 | msg_type := RSL_MT_SMS_BC_CMD, |
| 2036 | ies := { |
| 2037 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 2038 | t_RSL_IE(RSL_IE_CB_CMD_TYPE, RSL_IE_Body:{cb_cmd_type := cb_cmd}), |
| 2039 | t_RSL_IE(RSL_IE_SMSCB_MSG, RSL_IE_Body:{smscb_message := ts_RSL_LV(msg)}) |
| 2040 | /* optional channel type for extended CBCH */ |
| 2041 | } |
| 2042 | } |
| 2043 | |
Harald Welte | 4a129f8 | 2019-05-21 16:35:22 +0200 | [diff] [blame] | 2044 | /* 8.5.9 BTS -> BSC CBCH LOAD INDICATION */ |
| 2045 | template RSL_Message tr_RSL_CBCH_LOAD_IND_BASIC(template boolean overflow := ?, |
| 2046 | template uint4_t slot_count := ?, |
| 2047 | template RslChannelNr chan_nr := ?) := { |
| 2048 | msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false), |
| 2049 | msg_type := RSL_MT_CBCH_LOAD_IND, |
| 2050 | ies := { |
| 2051 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
| 2052 | tr_RSL_IE(RSL_IE_Body:{cbch_load_info := tr_CbchLoadInfo(overflow, slot_count)}) |
| 2053 | } |
| 2054 | } |
| 2055 | template (value) RSL_Message ts_RSL_CBCH_LOAD_IND_BASIC(boolean overflow, uint4_t slot_count, |
| 2056 | template (value) RslChannelNr chan_nr := |
| 2057 | ts_RslChanNr_SDCCH4(0, 2)) := { |
| 2058 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false), |
| 2059 | msg_type := RSL_MT_CBCH_LOAD_IND, |
| 2060 | ies := { |
| 2061 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 2062 | t_RSL_IE(RSL_IE_CBCH_LOAD_INFO, RSL_IE_Body:{cbch_load_info := ts_CbchLoadInfo(overflow, slot_count)}) |
| 2063 | } |
| 2064 | } |
| 2065 | template RSL_Message tr_RSL_CBCH_LOAD_IND_EXTD(template boolean overflow := ?, |
| 2066 | template uint4_t slot_count := ?, |
| 2067 | template RslChannelNr chan_nr := ?) := { |
| 2068 | msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false), |
| 2069 | msg_type := RSL_MT_CBCH_LOAD_IND, |
| 2070 | ies := { |
| 2071 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
| 2072 | tr_RSL_IE(RSL_IE_Body:{cbch_load_info := tr_CbchLoadInfo(overflow, slot_count)}), |
| 2073 | tr_RSL_IE(RSL_IE_Body:{smscb_chan_ind := 1}) |
| 2074 | } |
| 2075 | } |
| 2076 | template (value) RSL_Message ts_RSL_CBCH_LOAD_IND_EXTD(boolean overflow, uint4_t slot_count, |
| 2077 | template (value) RslChannelNr chan_nr := |
| 2078 | ts_RslChanNr_SDCCH4(0, 2)) := { |
| 2079 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false), |
| 2080 | msg_type := RSL_MT_CBCH_LOAD_IND, |
| 2081 | ies := { |
| 2082 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 2083 | t_RSL_IE(RSL_IE_CBCH_LOAD_INFO, RSL_IE_Body:{cbch_load_info := ts_CbchLoadInfo(overflow, slot_count)}), |
| 2084 | t_RSL_IE(RSL_IE_SMSCB_CHAN_INDICATOR, RSL_IE_Body:{smscb_chan_ind := 1}) |
| 2085 | } |
| 2086 | } |
| 2087 | |
| 2088 | |
Vadim Yanitskiy | 9f69953 | 2021-06-03 17:29:22 +0200 | [diff] [blame] | 2089 | /* 8.6.1 BTS -> BSC */ |
| 2090 | template (value) RSL_Message |
| 2091 | ts_RSL_RF_RES_IND(template (value) RSL_ResourceInfo info) := { |
| 2092 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false), |
| 2093 | msg_type := RSL_MT_RF_RES_IND, |
| 2094 | ies := { |
| 2095 | t_RSL_IE(RSL_IE_RESOURCE_INFO, RSL_IE_Body:{ |
| 2096 | resource_info := { |
| 2097 | len := 0, /* overwritten */ |
| 2098 | info := info |
| 2099 | } |
| 2100 | }) |
| 2101 | } |
| 2102 | } |
| 2103 | template RSL_Message |
| 2104 | tr_RSL_RF_RES_IND(template (present) RSL_ResourceInfo info := ?) := { |
| 2105 | msg_disc := tr_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false), |
| 2106 | msg_type := RSL_MT_RF_RES_IND, |
| 2107 | ies := { |
| 2108 | tr_RSL_IE(RSL_IE_Body:{ |
| 2109 | resource_info := { |
| 2110 | len := ?, |
| 2111 | info := info |
| 2112 | } |
| 2113 | }) |
| 2114 | } |
| 2115 | } |
| 2116 | |
| 2117 | |
Harald Welte | 68e495b | 2018-02-25 00:05:57 +0100 | [diff] [blame] | 2118 | /* 8.6.2 BTS <- BSC */ |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 2119 | template (value) RSL_Message ts_RSL_SACCH_FILL(RSL_IE_SysinfoType si_type, octetstring l3_info) := { |
Harald Welte | 68e495b | 2018-02-25 00:05:57 +0100 | [diff] [blame] | 2120 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false), |
| 2121 | msg_type := RSL_MT_SACCH_FILL, |
| 2122 | ies := { |
| 2123 | t_RSL_IE(RSL_IE_SYSINFO_TYPE, RSL_IE_Body:{sysinfo_type := si_type}), |
| 2124 | t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)}) |
| 2125 | } |
| 2126 | } |
Harald Welte | 09538f8 | 2019-08-01 09:50:25 +0200 | [diff] [blame] | 2127 | template RSL_Message tr_RSL_NO_SACCH_FILL(template RSL_IE_SysinfoType si_type := ?) := { |
| 2128 | msg_disc := tr_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false), |
| 2129 | msg_type := RSL_MT_SACCH_FILL, |
| 2130 | ies := { |
| 2131 | tr_RSL_IE(RSL_IE_Body:{sysinfo_type := si_type}) |
| 2132 | } |
| 2133 | } |
| 2134 | template RSL_Message tr_RSL_SACCH_FILL(template RSL_IE_SysinfoType si_type := ?, |
| 2135 | template octetstring l3_info := ?) := { |
| 2136 | msg_disc := tr_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false), |
| 2137 | msg_type := RSL_MT_SACCH_FILL, |
| 2138 | ies := { |
| 2139 | tr_RSL_IE(RSL_IE_Body:{sysinfo_type := si_type}), |
| 2140 | tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)}), |
| 2141 | * |
| 2142 | } |
| 2143 | } |
| 2144 | |
Harald Welte | 68e495b | 2018-02-25 00:05:57 +0100 | [diff] [blame] | 2145 | |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 2146 | /* 8.6.4 BTS -> BSC */ |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 2147 | template (value) RSL_Message ts_RSL_ERROR_REPORT(RSL_Cause cause) := { |
Harald Welte | 01d982c | 2018-02-25 01:31:40 +0100 | [diff] [blame] | 2148 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false), |
| 2149 | msg_type := RSL_MT_ERROR_REPORT, |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 2150 | ies := { |
Harald Welte | 735dd07 | 2017-12-12 14:55:17 +0100 | [diff] [blame] | 2151 | 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] | 2152 | } |
| 2153 | } |
Harald Welte | 01d982c | 2018-02-25 01:31:40 +0100 | [diff] [blame] | 2154 | template RSL_Message tr_RSL_ERROR_REPORT(template RSL_Cause cause := ?) := { |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 2155 | msg_disc := tr_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false), |
Harald Welte | 01d982c | 2018-02-25 01:31:40 +0100 | [diff] [blame] | 2156 | msg_type := RSL_MT_ERROR_REPORT, |
| 2157 | ies := { |
| 2158 | tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)}), |
| 2159 | * |
| 2160 | } |
| 2161 | } |
| 2162 | |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 2163 | |
Harald Welte | 9958a4d | 2017-12-14 21:21:33 +0100 | [diff] [blame] | 2164 | |
| 2165 | /* Abis/IP specific messages */ |
| 2166 | |
Vadim Yanitskiy | 1567bac | 2022-05-01 03:36:24 +0300 | [diff] [blame] | 2167 | private function f_ts_RSL_IPA_CRCX_IEs(template (value) RslChannelNr chan_nr, |
| 2168 | template (omit) OCT4 remote_ip, |
Pau Espin Pedrol | 39bfa02 | 2022-08-12 14:56:12 +0200 | [diff] [blame] | 2169 | template (omit) uint16_t remote_port, |
| 2170 | template (omit) uint8_t osmux_cid) |
Vadim Yanitskiy | 1567bac | 2022-05-01 03:36:24 +0300 | [diff] [blame] | 2171 | return RSL_IE_List { |
| 2172 | var RSL_IE_List ies; |
| 2173 | |
| 2174 | /* Channel Number is a mandatory IE */ |
| 2175 | ies := { |
| 2176 | valueof(RSL_IE:{ |
| 2177 | iei := RSL_IE_CHAN_NR, |
| 2178 | body := { chan_nr := chan_nr } |
| 2179 | }) |
| 2180 | }; |
| 2181 | /* Remote IP / Port are optional IEs */ |
| 2182 | if (not istemplatekind(remote_ip, "omit")) { |
| 2183 | ies := ies & { |
| 2184 | valueof(RSL_IE:{ |
| 2185 | iei := RSL_IE_IPAC_REMOTE_IP, |
| 2186 | body := { ipa_remote_ip := remote_ip } |
| 2187 | }) |
| 2188 | }; |
| 2189 | } |
| 2190 | if (not istemplatekind(remote_port, "omit")) { |
| 2191 | ies := ies & { |
| 2192 | valueof(RSL_IE:{ |
| 2193 | iei := RSL_IE_IPAC_REMOTE_PORT, |
| 2194 | body := { ipa_remote_port := remote_port } |
| 2195 | }) |
| 2196 | }; |
| 2197 | } |
Pau Espin Pedrol | 39bfa02 | 2022-08-12 14:56:12 +0200 | [diff] [blame] | 2198 | /* Osmux CID extension IE is optional: */ |
| 2199 | if (not istemplatekind(osmux_cid, "omit")) { |
| 2200 | ies := ies & { |
| 2201 | valueof(RSL_IE:{ |
| 2202 | iei := RSL_IE_OSMO_OSMUX_CID, |
| 2203 | body := { osmux_cid := ts_RSL_IE_OSMO_Osmux_CID(osmux_cid) } |
| 2204 | }) |
| 2205 | }; |
| 2206 | } |
Vadim Yanitskiy | 1567bac | 2022-05-01 03:36:24 +0300 | [diff] [blame] | 2207 | |
| 2208 | return ies; |
| 2209 | } |
Harald Welte | 9958a4d | 2017-12-14 21:21:33 +0100 | [diff] [blame] | 2210 | template RSL_Message tr_RSL_IPA_CRCX(template RslChannelNr chan_nr) := { |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 2211 | msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false), |
Harald Welte | 9958a4d | 2017-12-14 21:21:33 +0100 | [diff] [blame] | 2212 | msg_type := RSL_MT_IPAC_CRCX, |
| 2213 | ies := { |
| 2214 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
| 2215 | * |
| 2216 | } |
| 2217 | } |
Vadim Yanitskiy | e9141c2 | 2021-07-03 01:45:40 +0200 | [diff] [blame] | 2218 | template (value) RSL_Message |
| 2219 | ts_RSL_IPA_CRCX(template (value) RslChannelNr chan_nr, |
Vadim Yanitskiy | 1567bac | 2022-05-01 03:36:24 +0300 | [diff] [blame] | 2220 | template (omit) OCT4 remote_ip := omit, |
Pau Espin Pedrol | 39bfa02 | 2022-08-12 14:56:12 +0200 | [diff] [blame] | 2221 | template (omit) uint16_t remote_port := omit, |
| 2222 | template (omit) uint8_t osmux_cid := omit) := { |
Harald Welte | 9abd128 | 2018-02-19 19:18:17 +0100 | [diff] [blame] | 2223 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false), |
| 2224 | msg_type := RSL_MT_IPAC_CRCX, |
Pau Espin Pedrol | 39bfa02 | 2022-08-12 14:56:12 +0200 | [diff] [blame] | 2225 | ies := f_ts_RSL_IPA_CRCX_IEs(chan_nr, remote_ip, remote_port, osmux_cid) |
Harald Welte | 9abd128 | 2018-02-19 19:18:17 +0100 | [diff] [blame] | 2226 | } |
| 2227 | |
Pau Espin Pedrol | 29c6dfb | 2022-08-08 18:37:56 +0200 | [diff] [blame] | 2228 | function ts_RSL_IPA_CRCX_ACK(template (value) RslChannelNr chan_nr, |
| 2229 | uint16_t ipa_conn_id, OCT4 local_ip, |
| 2230 | uint16_t local_port, uint7_t rtp_pt2, |
| 2231 | template (omit) uint8_t osmux_cid := omit) |
| 2232 | return template (value) RSL_Message { |
| 2233 | var template (value) RSL_Message msg := { |
| 2234 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false), |
| 2235 | msg_type := RSL_MT_IPAC_CRCX_ACK, |
| 2236 | ies := { |
| 2237 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 2238 | t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}), |
| 2239 | t_RSL_IE(RSL_IE_IPAC_LOCAL_IP, RSL_IE_Body:{ipa_local_ip := local_ip}), |
| 2240 | t_RSL_IE(RSL_IE_IPAC_LOCAL_PORT, RSL_IE_Body:{ipa_local_port := local_port}), |
| 2241 | t_RSL_IE(RSL_IE_IPAC_RTP_PAYLOAD2, RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2}) |
| 2242 | } |
Harald Welte | 9958a4d | 2017-12-14 21:21:33 +0100 | [diff] [blame] | 2243 | } |
Pau Espin Pedrol | 29c6dfb | 2022-08-08 18:37:56 +0200 | [diff] [blame] | 2244 | if (not istemplatekind(osmux_cid, "omit")) { |
| 2245 | msg.ies[lengthof(msg.ies)] := t_RSL_IE(RSL_IE_OSMO_OSMUX_CID, RSL_IE_Body:{osmux_cid := ts_RSL_IE_OSMO_Osmux_CID(osmux_cid)}); |
| 2246 | } |
| 2247 | return msg; |
Harald Welte | 9958a4d | 2017-12-14 21:21:33 +0100 | [diff] [blame] | 2248 | } |
Pau Espin Pedrol | 29c6dfb | 2022-08-08 18:37:56 +0200 | [diff] [blame] | 2249 | |
Pau Espin Pedrol | 39bfa02 | 2022-08-12 14:56:12 +0200 | [diff] [blame] | 2250 | function tr_RSL_IPA_CRCX_ACK(template RslChannelNr chan_nr, |
| 2251 | template uint16_t ipa_conn_id, |
| 2252 | template OCT4 local_ip, |
| 2253 | template uint16_t local_port, |
| 2254 | template uint8_t osmux_cid := omit) |
| 2255 | return template RSL_Message { |
| 2256 | var template RSL_Message msg := { |
| 2257 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false), |
| 2258 | msg_type := RSL_MT_IPAC_CRCX_ACK, |
| 2259 | ies := { |
| 2260 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
| 2261 | tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}), |
| 2262 | tr_RSL_IE(RSL_IE_Body:{ipa_local_ip := local_ip}), |
| 2263 | tr_RSL_IE(RSL_IE_Body:{ipa_local_port := local_port}) |
| 2264 | /* Optional: RTP Payload Type 2 IE */ |
| 2265 | } |
Harald Welte | 9abd128 | 2018-02-19 19:18:17 +0100 | [diff] [blame] | 2266 | } |
Pau Espin Pedrol | 39bfa02 | 2022-08-12 14:56:12 +0200 | [diff] [blame] | 2267 | if (not istemplatekind(osmux_cid, "omit")) { |
| 2268 | msg.ies[lengthof(msg.ies)] := tr_RSL_IE(RSL_IE_Body:{osmux_cid := f_tr_RSL_IE_OSMO_Osmux_CID(osmux_cid)}); |
| 2269 | } |
| 2270 | return msg; |
Harald Welte | 9abd128 | 2018-02-19 19:18:17 +0100 | [diff] [blame] | 2271 | } |
Harald Welte | 9958a4d | 2017-12-14 21:21:33 +0100 | [diff] [blame] | 2272 | |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 2273 | template (value) RSL_Message ts_RSL_IPA_CRCX_NACK(template (value) RslChannelNr chan_nr, |
| 2274 | RSL_Cause cause) := { |
Harald Welte | 9958a4d | 2017-12-14 21:21:33 +0100 | [diff] [blame] | 2275 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false), |
| 2276 | msg_type := RSL_MT_IPAC_CRCX_NACK, |
| 2277 | ies := { |
| 2278 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 2279 | t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)}) |
| 2280 | } |
| 2281 | } |
Harald Welte | 9abd128 | 2018-02-19 19:18:17 +0100 | [diff] [blame] | 2282 | template RSL_Message tr_RSL_IPA_CRCX_NACK(template RslChannelNr chan_nr, |
| 2283 | template RSL_Cause cause := ?) := { |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 2284 | msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false), |
Harald Welte | 9abd128 | 2018-02-19 19:18:17 +0100 | [diff] [blame] | 2285 | msg_type := RSL_MT_IPAC_CRCX_NACK, |
| 2286 | ies := { |
| 2287 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
| 2288 | tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)}) |
| 2289 | } |
| 2290 | } |
Harald Welte | 9958a4d | 2017-12-14 21:21:33 +0100 | [diff] [blame] | 2291 | |
Pau Espin Pedrol | 39bfa02 | 2022-08-12 14:56:12 +0200 | [diff] [blame] | 2292 | function ts_RSL_IPA_MDCX(template (value) RslChannelNr chan_nr, |
| 2293 | uint16_t ipa_conn_id, |
| 2294 | OCT4 remote_ip, uint16_t remote_port, |
| 2295 | uint7_t rtp_pt2, |
| 2296 | template (omit) uint8_t osmux_cid := omit) |
| 2297 | return template (value) RSL_Message { |
| 2298 | var template (value) RSL_Message msg := { |
| 2299 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false), |
| 2300 | msg_type := RSL_MT_IPAC_MDCX, |
| 2301 | ies := { |
| 2302 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 2303 | t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}), |
| 2304 | t_RSL_IE(RSL_IE_IPAC_REMOTE_IP, RSL_IE_Body:{ipa_remote_ip := remote_ip}), |
| 2305 | t_RSL_IE(RSL_IE_IPAC_REMOTE_PORT, RSL_IE_Body:{ipa_remote_port := remote_port}), |
| 2306 | /* optional: RTP Payload Type */ |
| 2307 | t_RSL_IE(RSL_IE_IPAC_RTP_PAYLOAD2, RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2}) |
| 2308 | } |
Harald Welte | 3052745 | 2018-02-25 12:46:25 +0100 | [diff] [blame] | 2309 | } |
Pau Espin Pedrol | 39bfa02 | 2022-08-12 14:56:12 +0200 | [diff] [blame] | 2310 | if (not istemplatekind(osmux_cid, "omit")) { |
| 2311 | msg.ies[lengthof(msg.ies)] := t_RSL_IE(RSL_IE_OSMO_OSMUX_CID, RSL_IE_Body:{osmux_cid := ts_RSL_IE_OSMO_Osmux_CID(osmux_cid)}); |
| 2312 | } |
| 2313 | return msg; |
Harald Welte | 3052745 | 2018-02-25 12:46:25 +0100 | [diff] [blame] | 2314 | } |
Harald Welte | 9958a4d | 2017-12-14 21:21:33 +0100 | [diff] [blame] | 2315 | template RSL_Message tr_RSL_IPA_MDCX(template RslChannelNr chan_nr, |
| 2316 | template uint16_t ipa_conn_id) := { |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 2317 | msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false), |
Harald Welte | 9958a4d | 2017-12-14 21:21:33 +0100 | [diff] [blame] | 2318 | msg_type := RSL_MT_IPAC_MDCX, |
| 2319 | ies := { |
| 2320 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
| 2321 | tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}), |
| 2322 | * |
| 2323 | } |
| 2324 | } |
| 2325 | |
Pau Espin Pedrol | 29c6dfb | 2022-08-08 18:37:56 +0200 | [diff] [blame] | 2326 | function ts_RSL_IPA_MDCX_ACK(template (value) RslChannelNr chan_nr, |
| 2327 | uint16_t ipa_conn_id, |
| 2328 | OCT4 local_ip, uint16_t local_port, |
| 2329 | uint7_t rtp_pt2, |
| 2330 | template (omit) uint8_t osmux_cid := omit) |
Pau Espin Pedrol | 39bfa02 | 2022-08-12 14:56:12 +0200 | [diff] [blame] | 2331 | return template (value) RSL_Message { |
| 2332 | var template (value) RSL_Message msg := { |
| 2333 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false), |
| 2334 | msg_type := RSL_MT_IPAC_MDCX_ACK, |
| 2335 | ies := { |
| 2336 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 2337 | /* optional */ |
| 2338 | t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}), |
| 2339 | t_RSL_IE(RSL_IE_IPAC_LOCAL_IP, RSL_IE_Body:{ipa_local_ip := local_ip}), |
| 2340 | t_RSL_IE(RSL_IE_IPAC_LOCAL_PORT, RSL_IE_Body:{ipa_local_port := local_port}), |
| 2341 | /* optional: RTP Payload Type */ |
| 2342 | t_RSL_IE(RSL_IE_IPAC_RTP_PAYLOAD2, RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2}) |
Pau Espin Pedrol | 29c6dfb | 2022-08-08 18:37:56 +0200 | [diff] [blame] | 2343 | } |
Pau Espin Pedrol | 39bfa02 | 2022-08-12 14:56:12 +0200 | [diff] [blame] | 2344 | } |
| 2345 | if (not istemplatekind(osmux_cid, "omit")) { |
| 2346 | msg.ies[lengthof(msg.ies)] := t_RSL_IE(RSL_IE_OSMO_OSMUX_CID, RSL_IE_Body:{osmux_cid := ts_RSL_IE_OSMO_Osmux_CID(osmux_cid)}); |
| 2347 | } |
| 2348 | return msg; |
| 2349 | } |
| 2350 | function tr_RSL_IPA_MDCX_ACK(template RslChannelNr chan_nr, |
| 2351 | template uint16_t ipa_conn_id, |
| 2352 | template OCT4 local_ip, |
| 2353 | template uint16_t local_port, |
| 2354 | template uint7_t rtp_pt2, |
| 2355 | template uint8_t osmux_cid := omit) |
| 2356 | return template RSL_Message { |
| 2357 | var template RSL_Message msg := { |
| 2358 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false), |
| 2359 | msg_type := RSL_MT_IPAC_MDCX_ACK, |
| 2360 | ies := { |
| 2361 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
| 2362 | /* optional */ |
| 2363 | tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}), |
| 2364 | tr_RSL_IE(RSL_IE_Body:{ipa_local_ip := local_ip}), |
| 2365 | tr_RSL_IE(RSL_IE_Body:{ipa_local_port := local_port}), |
| 2366 | /* optional: RTP Payload Type */ |
| 2367 | tr_RSL_IE(RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2}) |
Pau Espin Pedrol | 29c6dfb | 2022-08-08 18:37:56 +0200 | [diff] [blame] | 2368 | } |
Harald Welte | 9958a4d | 2017-12-14 21:21:33 +0100 | [diff] [blame] | 2369 | } |
Pau Espin Pedrol | 39bfa02 | 2022-08-12 14:56:12 +0200 | [diff] [blame] | 2370 | if (not istemplatekind(osmux_cid, "omit")) { |
| 2371 | msg.ies[lengthof(msg.ies)] := tr_RSL_IE(RSL_IE_Body:{osmux_cid := f_tr_RSL_IE_OSMO_Osmux_CID(osmux_cid)}); |
Harald Welte | 3052745 | 2018-02-25 12:46:25 +0100 | [diff] [blame] | 2372 | } |
Pau Espin Pedrol | 39bfa02 | 2022-08-12 14:56:12 +0200 | [diff] [blame] | 2373 | return msg; |
Harald Welte | 3052745 | 2018-02-25 12:46:25 +0100 | [diff] [blame] | 2374 | } |
Harald Welte | 9958a4d | 2017-12-14 21:21:33 +0100 | [diff] [blame] | 2375 | |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 2376 | template (value) RSL_Message ts_RSL_IPA_MDCX_NACK(template (value) RslChannelNr chan_nr, |
| 2377 | RSL_Cause cause, |
| 2378 | template (value) uint16_t ipa_conn_id) := { |
Harald Welte | 9958a4d | 2017-12-14 21:21:33 +0100 | [diff] [blame] | 2379 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false), |
| 2380 | msg_type := RSL_MT_IPAC_MDCX_NACK, |
| 2381 | ies := { |
| 2382 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 2383 | /* optional connection ID */ |
| 2384 | t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}), |
| 2385 | t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)}) |
| 2386 | } |
| 2387 | } |
Harald Welte | 3052745 | 2018-02-25 12:46:25 +0100 | [diff] [blame] | 2388 | template RSL_Message tr_RSL_IPA_MDCX_NACK(template RslChannelNr chan_nr, |
| 2389 | template RSL_Cause cause, |
| 2390 | template uint16_t ipa_conn_id) := { |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 2391 | msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false), |
Harald Welte | 3052745 | 2018-02-25 12:46:25 +0100 | [diff] [blame] | 2392 | msg_type := RSL_MT_IPAC_MDCX_NACK, |
| 2393 | ies := { |
| 2394 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
| 2395 | /* optional connection ID */ |
| 2396 | tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}), |
| 2397 | tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)}) |
| 2398 | } |
| 2399 | } |
| 2400 | |
Harald Welte | 9958a4d | 2017-12-14 21:21:33 +0100 | [diff] [blame] | 2401 | |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 2402 | template (value) RSL_Message ts_RSL_IPA_DLCX_IND(template (value) RslChannelNr chan_nr, |
| 2403 | uint16_t ipa_conn_id, |
| 2404 | template (value) RSL_IE_IPA_ConnectionStats stats, |
| 2405 | RSL_Cause cause) := { |
Harald Welte | 9958a4d | 2017-12-14 21:21:33 +0100 | [diff] [blame] | 2406 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false), |
| 2407 | msg_type := RSL_MT_IPAC_DLCX_IND, |
| 2408 | ies := { |
| 2409 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 2410 | t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}), |
| 2411 | t_RSL_IE(RSL_IE_IPAC_CONN_STAT, RSL_IE_Body:{ipa_stats := stats}), |
| 2412 | t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)}) |
| 2413 | } |
| 2414 | } |
| 2415 | |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 2416 | template (value) RSL_Message ts_RSL_IPA_DLCX(template (value) RslChannelNr chan_nr, |
| 2417 | uint16_t ipa_conn_id) := { |
Harald Welte | a871a38 | 2018-02-25 02:03:14 +0100 | [diff] [blame] | 2418 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false), |
| 2419 | msg_type := RSL_MT_IPAC_DLCX, |
| 2420 | ies := { |
Harald Welte | 2a7e716 | 2018-02-25 12:46:48 +0100 | [diff] [blame] | 2421 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 2422 | t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}) |
Harald Welte | a871a38 | 2018-02-25 02:03:14 +0100 | [diff] [blame] | 2423 | } |
| 2424 | } |
Harald Welte | 9958a4d | 2017-12-14 21:21:33 +0100 | [diff] [blame] | 2425 | template RSL_Message tr_RSL_IPA_DLCX(template RslChannelNr chan_nr, |
| 2426 | template uint16_t ipa_conn_id := omit) := { |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 2427 | msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false), |
Harald Welte | 9958a4d | 2017-12-14 21:21:33 +0100 | [diff] [blame] | 2428 | msg_type := RSL_MT_IPAC_DLCX, |
| 2429 | ies := { |
| 2430 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
| 2431 | /* FIXME: optional conn_id */ |
| 2432 | * |
| 2433 | } |
| 2434 | } |
| 2435 | |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 2436 | template (value) RSL_Message ts_RSL_IPA_DLCX_ACK(template (value) RslChannelNr chan_nr, |
| 2437 | uint16_t ipa_conn_id, |
| 2438 | RSL_IE_IPA_ConnectionStats stats) := { |
Harald Welte | 9958a4d | 2017-12-14 21:21:33 +0100 | [diff] [blame] | 2439 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false), |
| 2440 | msg_type := RSL_MT_IPAC_DLCX_ACK, |
| 2441 | ies := { |
| 2442 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 2443 | t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}), |
| 2444 | t_RSL_IE(RSL_IE_IPAC_CONN_STAT, RSL_IE_Body:{ipa_stats := stats}) |
| 2445 | } |
| 2446 | } |
Harald Welte | a871a38 | 2018-02-25 02:03:14 +0100 | [diff] [blame] | 2447 | template RSL_Message tr_RSL_IPA_DLCX_ACK(template RslChannelNr chan_nr, |
| 2448 | template uint16_t ipa_conn_id, |
| 2449 | template RSL_IE_IPA_ConnectionStats stats) := { |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 2450 | msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false), |
Harald Welte | a871a38 | 2018-02-25 02:03:14 +0100 | [diff] [blame] | 2451 | msg_type := RSL_MT_IPAC_DLCX_ACK, |
| 2452 | ies := { |
| 2453 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
| 2454 | tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}), |
| 2455 | tr_RSL_IE(RSL_IE_Body:{ipa_stats := stats}) |
| 2456 | } |
| 2457 | } |
| 2458 | |
| 2459 | |
Harald Welte | 9958a4d | 2017-12-14 21:21:33 +0100 | [diff] [blame] | 2460 | |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 2461 | template (value) RSL_Message ts_RSL_IPA_DLCX_NACK(template (value) RslChannelNr chan_nr, |
| 2462 | RSL_Cause cause, uint16_t ipa_conn_id) := { |
Harald Welte | 9958a4d | 2017-12-14 21:21:33 +0100 | [diff] [blame] | 2463 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false), |
| 2464 | msg_type := RSL_MT_IPAC_DLCX_NACK, |
| 2465 | ies := { |
| 2466 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 2467 | /* optional connection ID */ |
| 2468 | t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}), |
| 2469 | t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)}) |
| 2470 | } |
| 2471 | } |
Harald Welte | a871a38 | 2018-02-25 02:03:14 +0100 | [diff] [blame] | 2472 | template RSL_Message tr_RSL_IPA_DLCX_NACK(template RslChannelNr chan_nr, |
| 2473 | template RSL_Cause cause) := { |
Harald Welte | efa7d91 | 2018-04-18 23:22:15 +0200 | [diff] [blame] | 2474 | msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false), |
Harald Welte | a871a38 | 2018-02-25 02:03:14 +0100 | [diff] [blame] | 2475 | msg_type := RSL_MT_IPAC_DLCX_NACK, |
| 2476 | ies := { |
| 2477 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
| 2478 | /* optional connection ID */ |
| 2479 | *, |
| 2480 | tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)}) |
| 2481 | } |
| 2482 | } |
| 2483 | |
Harald Welte | 9958a4d | 2017-12-14 21:21:33 +0100 | [diff] [blame] | 2484 | |
Vadim Yanitskiy | 58b1653 | 2021-10-09 20:27:39 +0600 | [diff] [blame] | 2485 | template (value) RSL_Message |
| 2486 | ts_RSL_IPA_PDCH_ACT(template (value) RslChannelNr chan_nr) := { |
Harald Welte | ee19c73 | 2018-04-05 09:08:26 +0200 | [diff] [blame] | 2487 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
| 2488 | msg_type := RSL_MT_IPAC_PDCH_ACT, |
| 2489 | ies := { |
| 2490 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}) |
| 2491 | } |
| 2492 | } |
Vadim Yanitskiy | 58b1653 | 2021-10-09 20:27:39 +0600 | [diff] [blame] | 2493 | template RSL_Message |
| 2494 | tr_RSL_IPA_PDCH_ACT(template (present) RslChannelNr chan_nr) := { |
Harald Welte | ee19c73 | 2018-04-05 09:08:26 +0200 | [diff] [blame] | 2495 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
Harald Welte | 9958a4d | 2017-12-14 21:21:33 +0100 | [diff] [blame] | 2496 | msg_type := RSL_MT_IPAC_PDCH_ACT, |
| 2497 | ies := { |
| 2498 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}) |
| 2499 | } |
| 2500 | } |
| 2501 | |
Harald Welte | ee19c73 | 2018-04-05 09:08:26 +0200 | [diff] [blame] | 2502 | |
Harald Welte | 94e0c34 | 2018-04-07 11:33:23 +0200 | [diff] [blame] | 2503 | template RSL_Message ts_RSL_IPA_PDCH_ACT_ACK(RslChannelNr chan_nr, |
| 2504 | template (value) RSL_IE_FrameNumber fn) := { |
Harald Welte | ee19c73 | 2018-04-05 09:08:26 +0200 | [diff] [blame] | 2505 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
Harald Welte | 9958a4d | 2017-12-14 21:21:33 +0100 | [diff] [blame] | 2506 | msg_type := RSL_MT_IPAC_PDCH_ACT_ACK, |
| 2507 | ies := { |
| 2508 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 2509 | t_RSL_IE(RSL_IE_FRAME_NUMBER, RSL_IE_Body:{frame_nr := fn}) |
| 2510 | } |
| 2511 | } |
Harald Welte | ee19c73 | 2018-04-05 09:08:26 +0200 | [diff] [blame] | 2512 | template RSL_Message tr_RSL_IPA_PDCH_ACT_ACK(template RslChannelNr chan_nr, |
| 2513 | template RSL_IE_FrameNumber fn) := { |
| 2514 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
| 2515 | msg_type := RSL_MT_IPAC_PDCH_ACT_ACK, |
| 2516 | ies := { |
| 2517 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
| 2518 | tr_RSL_IE(RSL_IE_Body:{frame_nr := fn}) |
| 2519 | } |
| 2520 | } |
Harald Welte | 9958a4d | 2017-12-14 21:21:33 +0100 | [diff] [blame] | 2521 | |
| 2522 | template RSL_Message ts_RSL_IPA_PDCH_ACT_NACK(RslChannelNr chan_nr, RSL_Cause cause) := { |
Harald Welte | ee19c73 | 2018-04-05 09:08:26 +0200 | [diff] [blame] | 2523 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
Harald Welte | 9958a4d | 2017-12-14 21:21:33 +0100 | [diff] [blame] | 2524 | msg_type := RSL_MT_IPAC_PDCH_ACT_NACK, |
| 2525 | ies := { |
| 2526 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 2527 | t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)}) |
| 2528 | } |
| 2529 | } |
Harald Welte | ee19c73 | 2018-04-05 09:08:26 +0200 | [diff] [blame] | 2530 | template RSL_Message tr_RSL_IPA_PDCH_ACT_NACK(template RslChannelNr chan_nr, |
| 2531 | template RSL_Cause cause) := { |
| 2532 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
| 2533 | msg_type := RSL_MT_IPAC_PDCH_ACT_NACK, |
| 2534 | ies := { |
| 2535 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
| 2536 | tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)}) |
| 2537 | } |
| 2538 | } |
Harald Welte | 9958a4d | 2017-12-14 21:21:33 +0100 | [diff] [blame] | 2539 | |
Harald Welte | ee19c73 | 2018-04-05 09:08:26 +0200 | [diff] [blame] | 2540 | template RSL_Message ts_RSL_IPA_PDCH_DEACT(RslChannelNr chan_nr) := { |
| 2541 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
| 2542 | msg_type := RSL_MT_IPAC_PDCH_DEACT, |
| 2543 | ies := { |
| 2544 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}) |
| 2545 | } |
| 2546 | } |
Harald Welte | 9958a4d | 2017-12-14 21:21:33 +0100 | [diff] [blame] | 2547 | template RSL_Message tr_RSL_IPA_PDCH_DEACT(template RslChannelNr chan_nr) := { |
Harald Welte | ee19c73 | 2018-04-05 09:08:26 +0200 | [diff] [blame] | 2548 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
Harald Welte | 9958a4d | 2017-12-14 21:21:33 +0100 | [diff] [blame] | 2549 | msg_type := RSL_MT_IPAC_PDCH_DEACT, |
| 2550 | ies := { |
| 2551 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}) |
| 2552 | } |
| 2553 | } |
| 2554 | |
| 2555 | template RSL_Message ts_RSL_IPA_PDCH_DEACT_ACK(RslChannelNr chan_nr) := { |
Harald Welte | ee19c73 | 2018-04-05 09:08:26 +0200 | [diff] [blame] | 2556 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
Harald Welte | 9958a4d | 2017-12-14 21:21:33 +0100 | [diff] [blame] | 2557 | msg_type := RSL_MT_IPAC_PDCH_DEACT_ACK, |
| 2558 | ies := { |
| 2559 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}) |
| 2560 | } |
| 2561 | } |
Harald Welte | ee19c73 | 2018-04-05 09:08:26 +0200 | [diff] [blame] | 2562 | template RSL_Message tr_RSL_IPA_PDCH_DEACT_ACK(template RslChannelNr chan_nr) := { |
| 2563 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
| 2564 | msg_type := RSL_MT_IPAC_PDCH_DEACT_ACK, |
| 2565 | ies := { |
| 2566 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}) |
| 2567 | } |
| 2568 | } |
Harald Welte | 9958a4d | 2017-12-14 21:21:33 +0100 | [diff] [blame] | 2569 | |
| 2570 | template RSL_Message ts_RSL_IPA_PDCH_DEACT_NACK(RslChannelNr chan_nr, RSL_Cause cause) := { |
Harald Welte | ee19c73 | 2018-04-05 09:08:26 +0200 | [diff] [blame] | 2571 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
Harald Welte | 9958a4d | 2017-12-14 21:21:33 +0100 | [diff] [blame] | 2572 | msg_type := RSL_MT_IPAC_PDCH_DEACT_NACK, |
| 2573 | ies := { |
| 2574 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 2575 | t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)}) |
| 2576 | } |
| 2577 | } |
Harald Welte | ee19c73 | 2018-04-05 09:08:26 +0200 | [diff] [blame] | 2578 | template RSL_Message tr_RSL_IPA_PDCH_DEACT_NACK(template RslChannelNr chan_nr, |
| 2579 | template RSL_Cause cause) := { |
| 2580 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false), |
| 2581 | msg_type := RSL_MT_IPAC_PDCH_DEACT_NACK, |
| 2582 | ies := { |
| 2583 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
| 2584 | tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)}) |
| 2585 | } |
| 2586 | } |
Harald Welte | 9958a4d | 2017-12-14 21:21:33 +0100 | [diff] [blame] | 2587 | |
Harald Welte | 908ce54 | 2019-09-04 23:05:40 +0200 | [diff] [blame] | 2588 | template (value) RSL_Message ts_RSL_OSMO_ETWS_CMD(template (value) octetstring msg, |
| 2589 | template (value) RslChannelNr chan_nr := ts_RslChanNr_PCH_AGCH(0)) := { |
| 2590 | msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false), |
| 2591 | msg_type := RSL_MT_OSMO_ETWS_CMD, |
| 2592 | ies := { |
| 2593 | t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}), |
| 2594 | t_RSL_IE(RSL_IE_SMSCB_MSG, RSL_IE_Body:{smscb_message := ts_RSL_LV(msg)}) |
| 2595 | } |
| 2596 | } |
| 2597 | template RSL_Message tr_RSL_OSMO_ETWS_CMD(template RslChannelNr chan_nr := ?, |
| 2598 | template octetstring msg := ?) := { |
| 2599 | msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false), |
| 2600 | msg_type := RSL_MT_OSMO_ETWS_CMD, |
| 2601 | ies := { |
| 2602 | tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}), |
| 2603 | tr_RSL_IE(RSL_IE_Body:{smscb_message := tr_RSL_LV(msg)}) |
| 2604 | } |
| 2605 | } |
| 2606 | |
| 2607 | |
Harald Welte | 9958a4d | 2017-12-14 21:21:33 +0100 | [diff] [blame] | 2608 | |
Harald Welte | 6a8199d | 2018-01-29 21:58:53 +0100 | [diff] [blame] | 2609 | function f_rsl_find_ie(RSL_Message msg, RSL_IE_Type iei, out RSL_IE_Body ret) return boolean { |
| 2610 | for (var integer i := 0; i < sizeof(msg.ies); i := i+1) { |
| 2611 | if (msg.ies[i].iei == iei) { |
| 2612 | ret := msg.ies[i].body; |
| 2613 | return true; |
| 2614 | } |
| 2615 | } |
| 2616 | return false; |
| 2617 | } |
| 2618 | |
| 2619 | |
Harald Welte | 9958a4d | 2017-12-14 21:21:33 +0100 | [diff] [blame] | 2620 | |
Harald Welte | 643e2a6 | 2017-11-27 15:03:18 +0100 | [diff] [blame] | 2621 | } with { encode "RAW" ; variant "FIELDORDER(msb)" } |