blob: ceb6adbba5308f20c90f332174654fbcb0d75b4c [file] [log] [blame]
Harald Welte643e2a62017-11-27 15:03:18 +01001module RSL_Types {
2
Vadim Yanitskiyc06688e2020-05-06 15:22:45 +07003/* RSL types defining abstract TTCN-3 data types for the A-bis RSL protocol.
Harald Welte35bb7162018-01-03 21:07:52 +01004 *
5 * RSL is a 3GPP standard protocol used between BTS and BSC in a GSM network.
6 *
Harald Weltee33e5152023-04-09 23:29:48 +02007 * (C) 2017-2023 by Harald Welte <laforge@gnumonks.org>
Harald Welte35bb7162018-01-03 21:07:52 +01008 * 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 Welte34b5a952019-05-27 11:54:11 +020012 *
13 * SPDX-License-Identifier: GPL-2.0-or-later
Harald Welte35bb7162018-01-03 21:07:52 +010014 */
15
Harald Welte643e2a62017-11-27 15:03:18 +010016 import from General_Types all;
17 import from Osmocom_Types all;
Vadim Yanitskiye02dbcc2020-08-25 04:20:51 +070018 import from GSM_RR_Types all;
Harald Welte643e2a62017-11-27 15:03:18 +010019 import from GSM_Types all;
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +070020 import from MobileL3_CommonIE_Types all;
21 import from L3_Templates all;
Harald Welte643e2a62017-11-27 15:03:18 +010022
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 Welteefa7d912018-04-18 23:22:15 +020040 template (value) RSL_MessageDiscriminator ts_RSL_MsgDisc(RSL_MessageGroup mg, boolean t := true) := {
Harald Welte643e2a62017-11-27 15:03:18 +010041 msg_group := mg,
42 transparent := t
43 }
Harald Welteefa7d912018-04-18 23:22:15 +020044 template RSL_MessageDiscriminator tr_RSL_MsgDisc(template RSL_MessageGroup mg, boolean t := true) := {
45 msg_group := mg,
46 transparent := t
47 }
48
Harald Welte643e2a62017-11-27 15:03:18 +010049
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 Welte319be822017-12-07 17:50:26 +010073 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 Welte643e2a62017-11-27 15:03:18 +010080 /* empty */
81 RSL_MT_RF_RES_IND ('00011001'B),
Harald Welte319be822017-12-07 17:50:26 +010082 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 Welte643e2a62017-11-27 15:03:18 +010088
89 /* Dedicate Channel Management */
90 RSL_MT_CHAN_ACTIV ('00100001'B),
Harald Welte319be822017-12-07 17:50:26 +010091 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 Welte643e2a62017-11-27 15:03:18 +0100121
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 Welte319be822017-12-07 17:50:26 +0100128 RSL_MT_IPAC_PDCH_ACT_ACK ('01001001'B),
129 RSL_MT_IPAC_PDCH_ACT_NACK ('01001010'B),
Harald Welte643e2a62017-11-27 15:03:18 +0100130 RSL_MT_IPAC_PDCH_DEACT ('01001011'B),
Harald Welte319be822017-12-07 17:50:26 +0100131 RSL_MT_IPAC_PDCH_DEACT_ACK ('01001100'B),
132 RSL_MT_IPAC_PDCH_DEACT_NACK ('01001101'B),
Harald Welte643e2a62017-11-27 15:03:18 +0100133
134 RSL_MT_IPAC_CONNECT_MUX ('01010000'B),
Harald Weltef3075002017-12-16 22:31:41 +0100135 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 Welte643e2a62017-11-27 15:03:18 +0100143 RSL_MT_IPAC_MEAS_PREPROC_DFT ('01100000'B),
Harald Weltef3075002017-12-16 22:31:41 +0100144 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 Welte908ce542019-09-04 23:05:40 +0200155 RSL_MT_IPAC_DLCX_NACK ('01111001'B),
156
157 RSL_MT_OSMO_ETWS_CMD ('01111111'B)
Harald Welte643e2a62017-11-27 15:03:18 +0100158 } 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 Welte319be822017-12-07 17:50:26 +0100163 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 Welte643e2a62017-11-27 15:03:18 +0100190 /* reserved */
191 RSL_IE_SYSINFO_TYPE ('00011110'B),
Harald Welte319be822017-12-07 17:50:26 +0100192 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),
Harald Weltee33e5152023-04-09 23:29:48 +0200209 RSL_IE_GROUP_CHAN_DESC ('00110000'B),
Harald Welte319be822017-12-07 17:50:26 +0100210 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 Welte643e2a62017-11-27 15:03:18 +0100222
Pau Espin Pedrol29c6dfb2022-08-08 18:37:56 +0200223 /* Osmocom extensions */
Vadim Yanitskiy1f532152021-11-01 20:37:56 +0300224 RSL_IE_OSMO_REP_ACCH_CAP ('01100000'B),
Neels Hofmeyr2bef0dd2021-04-22 21:46:00 +0000225 RSL_IE_OSMO_TRAINING_SEQUENCE ('01100001'B),
Vadim Yanitskiya203d3b2021-11-01 21:32:31 +0300226 RSL_IE_OSMO_TOP_ACCH_CAP ('01100010'B),
Pau Espin Pedrol29c6dfb2022-08-08 18:37:56 +0200227 RSL_IE_OSMO_OSMUX_CID ('01100011'B),
Neels Hofmeyr2bef0dd2021-04-22 21:46:00 +0000228
Harald Welte643e2a62017-11-27 15:03:18 +0100229 /* ip.access */
230 RSL_IE_IPAC_SRTP_CONFIG ('11100000'B),
Harald Welte319be822017-12-07 17:50:26 +0100231 RSL_IE_IPAC_PROXY_UDP ('11100001'B),
232 RSL_IE_IPAC_BSCMPL_TOUT ('11100010'B),
Harald Welte643e2a62017-11-27 15:03:18 +0100233
234 RSL_IE_IPAC_REMOTE_IP ('11110000'B),
Harald Welte319be822017-12-07 17:50:26 +0100235 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 Welte643e2a62017-11-27 15:03:18 +0100249 } 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 Welteefa7d912018-04-18 23:22:15 +0200256 template (value) RSL_LV ts_RSL_LV(template (value) octetstring pl) := {
Harald Welte643e2a62017-11-27 15:03:18 +0100257 len := 0,
258 payload := pl
259 }
260
Harald Welte51d74102017-12-10 23:05:02 +0100261 template RSL_LV tr_RSL_LV(template octetstring pl) := {
262 len := ?,
263 payload := pl
264 }
265
Harald Welte15bb5b52017-12-07 17:52:04 +0100266 type record RSL_L16V {
267 uint16_t len,
268 octetstring payload
269 } with { variant (len) "LENGTHTO(payload)" }
270
Harald Welteefa7d912018-04-18 23:22:15 +0200271 template (value) RSL_L16V ts_RSL_L16V(template (value) octetstring pl) := {
Harald Welte15bb5b52017-12-07 17:52:04 +0100272 len := 0,
273 payload := pl
274 }
275
Harald Welte7794d5b2017-12-16 23:00:20 +0100276 template RSL_L16V tr_RSL_L16V(template octetstring pl) := {
277 len := ?,
278 payload := pl
279 }
280
Harald Welte643e2a62017-11-27 15:03:18 +0100281 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 Welte921f9e02019-05-19 22:27:11 +0200289 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 Welte643e2a62017-11-27 15:03:18 +0100300
Harald Welte921f9e02019-05-19 22:27:11 +0200301 const RSL_IE_ActivationType t_RSL_IE_ActType_IA := {
Harald Welte643e2a62017-11-27 15:03:18 +0100302 reactivation := false,
303 reserved := 0,
Harald Welte921f9e02019-05-19 22:27:11 +0200304 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 Welte643e2a62017-11-27 15:03:18 +0100320 }
321
Harald Welte94e0c342018-04-07 11:33:23 +0200322 /* osmocom-style dynamic PDCH */
Vadim Yanitskiy58b16532021-10-09 20:27:39 +0600323 const RSL_IE_ActivationType c_RSL_IE_ActType_PDCH := {
Harald Welte94e0c342018-04-07 11:33:23 +0200324 reactivation := false,
325 reserved := 1,
Harald Welte921f9e02019-05-19 22:27:11 +0200326 a_bits := ACT_REL_TO_OSMO_PDCH
Harald Welte94e0c342018-04-07 11:33:23 +0200327 }
328
Vadim Yanitskiye02dbcc2020-08-25 04:20:51 +0700329 /* 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 Welte643e2a62017-11-27 15:03:18 +0100370 /* 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 Hofmeyr2bef0dd2021-04-22 21:46:00 +0000385 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 Welte643e2a62017-11-27 15:03:18 +0100388 } with { variant "FIELDLENGTH(8)" };
Oliver Smith0033b122023-02-28 13:30:53 +0100389 type enumerated RSL_ChanModeOct6Signalling {
390 RSL_CMOD_NO_RESOURCE ('00000000'B)
391 } with { variant "FIELDLENGTH(8)" };
392 type enumerated RSL_ChanModeOct6SpeechAlgo {
Harald Welte643e2a62017-11-27 15:03:18 +0100393 RSL_CMOD_SP_GSM1 ('00000001'B),
394 RSL_CMOD_SP_GSM2 ('00010001'B),
395 RSL_CMOD_SP_GSM3 ('00100001'B),
396 RSL_CMOD_SP_GSM4 ('00110001'B),
397 RSL_CMOD_SP_GSM5 ('00001001'B),
398 RSL_CMOD_SP_GSM6 ('00001101'B)
399 } with { variant "FIELDLENGTH(8)" };
Oliver Smith0033b122023-02-28 13:30:53 +0100400 type enumerated RSL_ChanModeOct6DataRate {
401 RSL_CMOD_CSD_NTA_43k5_14k5 ('01100001'B),
402 RSL_CMOD_CSD_NTA_29k0_14k5 ('01100010'B),
403 RSL_CMOD_CSD_NTA_43k5_29k0 ('01100011'B),
404 RSL_CMOD_CSD_NTA_14k5_43k5 ('01101001'B),
405 RSL_CMOD_CSD_NTA_14k5_29k0 ('01101010'B),
406 RSL_CMOD_CSD_NTA_29k0_43k5 ('01101011'B),
407 RSL_CMOD_CSD_NT_43k5 ('01110100'B),
408 RSL_CMOD_CSD_NT_28k8 ('01110001'B),
409 RSL_CMOD_CSD_NT_14k5 ('01011000'B),
410 RSL_CMOD_CSD_NT_12k0 ('01010000'B),
411 RSL_CMOD_CSD_NT_6k0 ('01010001'B),
412 RSL_CMOD_CSD_T_32k0 ('00111000'B),
413 RSL_CMOD_CSD_T_29k0 ('00111001'B),
414 RSL_CMOD_CSD_T_14k4 ('00011000'B),
415 RSL_CMOD_CSD_T_9k6 ('00010000'B),
416 RSL_CMOD_CSD_T_4k8 ('00010001'B),
417 RSL_CMOD_CSD_T_2k4 ('00010010'B),
418 RSL_CMOD_CSD_T_1k2 ('00010011'B),
419 RSL_CMOD_CSD_T_600 ('00010100'B),
420 RSL_CMOD_CSD_T_1200_75 ('00010101'B)
421 } with { variant "FIELDLENGTH(8)" };
422 type union RSL_ChanModeOct6 {
423 RSL_ChanModeOct6Signalling sign,
424 RSL_ChanModeOct6SpeechAlgo speech,
425 RSL_ChanModeOct6DataRate data
426 };
Harald Welte643e2a62017-11-27 15:03:18 +0100427 type record RSL_IE_ChannelMode {
Harald Welte8f2c21d2017-12-07 17:52:40 +0100428 uint8_t len,
Harald Welte643e2a62017-11-27 15:03:18 +0100429 BIT6 reserved,
430 boolean dtx_d,
431 boolean dtx_u,
432 RSL_SpeechDataInd spd_ind,
433 RSL_ChanRateType ch_rate_type,
Oliver Smith0033b122023-02-28 13:30:53 +0100434 RSL_ChanModeOct6 u
435 } with { variant (len) "LENGTHTO(reserved,dtx_d,dtx_u,spd_ind,ch_rate_type,u)"
436 variant (u) "CROSSTAG(
437 sign, spd_ind = RSL_SPDI_SIGN;
438 speech, spd_ind = RSL_SPDI_SPEECH;
439 data, spd_ind = RSL_SPDI_DATA;
440 )"}
Harald Welte643e2a62017-11-27 15:03:18 +0100441
Vadim Yanitskiy8fc43df2020-10-20 02:11:05 +0700442 template (value) RSL_IE_ChannelMode ts_RSL_ChanMode_SIGN(RSL_ChanRateType t := RSL_CHRT_SDCCH,
443 boolean dtx_downlink := false) := {
Harald Welte8f2c21d2017-12-07 17:52:40 +0100444 len := 0, /* overwritten */
Harald Welte643e2a62017-11-27 15:03:18 +0100445 reserved := '000000'B,
Stefan Sperling4880be42018-08-07 18:12:59 +0200446 dtx_d := dtx_downlink,
Harald Welte643e2a62017-11-27 15:03:18 +0100447 dtx_u := false,
448 spd_ind := RSL_SPDI_SIGN,
Philipp Maierac693462020-10-14 20:21:44 +0200449 ch_rate_type := t,
Oliver Smith0033b122023-02-28 13:30:53 +0100450 u := { sign := RSL_CMOD_NO_RESOURCE }
Harald Welte643e2a62017-11-27 15:03:18 +0100451 }
452
Oliver Smith0033b122023-02-28 13:30:53 +0100453 template (value) RSL_IE_ChannelMode ts_RSL_ChanMode(RSL_ChanRateType t, RSL_ChanModeOct6SpeechAlgo alg,
Stefan Sperling4880be42018-08-07 18:12:59 +0200454 boolean dtx_downlink := false) := {
Harald Welte8f2c21d2017-12-07 17:52:40 +0100455 len := 0, /* overwritten */
Harald Welte643e2a62017-11-27 15:03:18 +0100456 reserved := '000000'B,
Stefan Sperling4880be42018-08-07 18:12:59 +0200457 dtx_d := dtx_downlink,
Harald Welte643e2a62017-11-27 15:03:18 +0100458 dtx_u := false,
459 spd_ind := RSL_SPDI_SPEECH,
460 ch_rate_type := t,
Oliver Smith0033b122023-02-28 13:30:53 +0100461 u := { speech := alg }
Harald Welte643e2a62017-11-27 15:03:18 +0100462 }
Harald Welte3618d9d2018-03-21 18:45:27 +0100463 template RSL_IE_ChannelMode tr_RSL_ChanMode(template RSL_ChanRateType t,
Oliver Smith0033b122023-02-28 13:30:53 +0100464 template RSL_ChanModeOct6SpeechAlgo alg) := {
Harald Welte3618d9d2018-03-21 18:45:27 +0100465 len := ?,
466 reserved := '000000'B,
467 dtx_d := ?,
468 dtx_u := ?,
469 spd_ind := RSL_SPDI_SPEECH,
470 ch_rate_type := t,
Oliver Smith0033b122023-02-28 13:30:53 +0100471 u := { speech := alg }
Harald Welte3618d9d2018-03-21 18:45:27 +0100472 }
Harald Welte643e2a62017-11-27 15:03:18 +0100473
Vadim Yanitskiy117c1762020-06-16 01:40:10 +0700474 /* 9.3.4 BS Power IE */
Harald Welte643e2a62017-11-27 15:03:18 +0100475 type record RSL_IE_BS_Power {
Vadim Yanitskiy117c1762020-06-16 01:40:10 +0700476 uint2_t reserved,
Harald Welte643e2a62017-11-27 15:03:18 +0100477 boolean epc,
478 boolean fpc,
Vadim Yanitskiy117c1762020-06-16 01:40:10 +0700479 uint4_t power_level
Harald Welte643e2a62017-11-27 15:03:18 +0100480 }
481
Vadim Yanitskiy117c1762020-06-16 01:40:10 +0700482 template (value) RSL_IE_BS_Power ts_RSL_IE_BS_Power(uint4_t power_level,
Eric Wildae8f2622019-06-18 17:05:11 +0200483 boolean epc := false, boolean fpc := false) := {
484 reserved := 0,
485 epc := epc,
486 fpc := fpc,
487 power_level := power_level
488 }
Vadim Yanitskiy2a5a1ef2021-06-30 00:51:48 +0200489 template RSL_IE_BS_Power
490 tr_RSL_IE_BS_Power(template (present) uint4_t power_level,
491 template (present) boolean epc := ?,
492 template (present) boolean fpc := ?) := {
493 reserved := ?,
494 epc := epc,
495 fpc := fpc,
496 power_level := power_level
497 }
Eric Wildae8f2622019-06-18 17:05:11 +0200498
Harald Welte73cd2712017-12-17 00:44:52 +0100499 /* 9.3.7 */
Harald Weltee613f962018-04-18 22:38:16 +0200500 type enumerated RSL_AlgId {
501 RSL_ALG_ID_A5_0 ('00000001'B),
502 RSL_ALG_ID_A5_1 ('00000010'B),
503 RSL_ALG_ID_A5_2 ('00000011'B),
504 RSL_ALG_ID_A5_3 ('00000100'B),
505 RSL_ALG_ID_A5_4 ('00000101'B),
506 RSL_ALG_ID_A5_5 ('00000110'B),
507 RSL_ALG_ID_A5_6 ('00000111'B),
508 RSL_ALG_ID_A5_7 ('00001000'B)
509 } with { variant "FIELDLENGTH(8)" };
Harald Welte73cd2712017-12-17 00:44:52 +0100510 type record RSL_IE_EncryptionInfo {
511 uint8_t len,
Harald Weltee613f962018-04-18 22:38:16 +0200512 RSL_AlgId alg_id,
Harald Welte73cd2712017-12-17 00:44:52 +0100513 octetstring key
514 } with { variant (len) "LENGTHTO(alg_id,key)" };
515
Harald Weltee613f962018-04-18 22:38:16 +0200516 template RSL_IE_EncryptionInfo tr_RSL_IE_EncrInfo(template RSL_AlgId alg,
517 template octetstring key) := {
Harald Welte73cd2712017-12-17 00:44:52 +0100518 len := ?,
519 alg_id := alg,
520 key := key
521 }
Harald Weltee613f962018-04-18 22:38:16 +0200522 template (value) RSL_IE_EncryptionInfo ts_RSL_IE_EncrInfo(template (value) RSL_AlgId alg,
523 octetstring key) := {
Harald Welteefa7d912018-04-18 23:22:15 +0200524 len := 0, /* overwritten */
525 alg_id := alg,
526 key := key
527 }
528
529
Harald Welte73cd2712017-12-17 00:44:52 +0100530
Harald Welte643e2a62017-11-27 15:03:18 +0100531 /* 9.3.8 */
532 type record RSL_IE_FrameNumber {
533 uint5_t t1_p,
534 uint6_t t3,
535 uint5_t t2
536 }
537 type RSL_IE_FrameNumber RSL_IE_StartingTime;
538
539 /* 9.3.10 */
540 type record RSL_IE_L1Info {
541 uint5_t ms_power_lvl,
542 boolean fpc,
543 uint2_t reserved,
544 uint8_t actual_ta
545 }
546
Neels Hofmeyrafe2ea52021-11-24 15:16:12 +0100547 template (value) RSL_IE_L1Info ts_RSL_IE_L1Info := {
548 ms_power_lvl := 0,
549 fpc := false,
550 reserved := 0,
551 actual_ta := 0
552 };
553
Harald Welte643e2a62017-11-27 15:03:18 +0100554 /* 9.3.13 */
555 type record RSL_IE_MS_Power {
556 uint2_t reserved,
557 boolean fpc_epc,
558 uint5_t power_level
559 }
Pau Espin Pedrolf7630a62019-10-28 15:07:08 +0100560 template RSL_IE_MS_Power tr_RSL_IE_MS_Power(template uint5_t power_level := ?,
561 template boolean fpc_epc := false) := {
562 reserved := 0,
563 fpc_epc := fpc_epc,
564 power_level := power_level
565 }
Harald Welte10280172019-05-19 22:28:04 +0200566 template (value) RSL_IE_MS_Power ts_RSL_IE_MS_Power(uint5_t power_level,
567 boolean fpc_epc := false) := {
568 reserved := 0,
569 fpc_epc := fpc_epc,
570 power_level := power_level
571 }
Harald Welte643e2a62017-11-27 15:03:18 +0100572
Harald Welted5f521e2017-12-07 17:53:06 +0100573 /* 9.3.18 */
574 type record RSL_IE_RachLoad {
575 uint8_t len,
576 uint16_t slot_count,
577 uint16_t busy_count,
578 uint16_t access_count
579 } with { variant (len) "LENGTHTO(slot_count,busy_count,access_count)" }
580
Harald Welteefa7d912018-04-18 23:22:15 +0200581 template (value) RSL_IE_RachLoad ts_RSL_IE_RachLoad(uint16_t slot, uint16_t busy, uint16_t acc) := {
Harald Welted5f521e2017-12-07 17:53:06 +0100582 len := 0, /* overwritten */
583 slot_count := slot,
584 busy_count := busy,
585 access_count := acc
586 }
587
Harald Welte68e495b2018-02-25 00:05:57 +0100588 template RSL_IE_RachLoad tr_RSL_IE_RachLoad(template uint16_t slot,
589 template uint16_t busy,
590 template uint16_t acc) := {
591 len := ?, /* overwritten */
592 slot_count := slot,
593 busy_count := busy,
594 access_count := acc
595 }
596
Harald Welte643e2a62017-11-27 15:03:18 +0100597 /* 9.3.19 */
598 type record RSL_IE_RequestRef {
599 OCT1 ra,
600 RSL_IE_FrameNumber frame_nr
601 }
602
603 /* 3GPP TS 44.018 / 10.5.2.38 Starting Time */
Harald Welte94e0c342018-04-07 11:33:23 +0200604 template (value) RSL_IE_FrameNumber ts_RSL_IE_FrameNumber(GsmFrameNumber fn) := {
Harald Welte643e2a62017-11-27 15:03:18 +0100605 t1_p := (fn / 1326) mod 32,
606 t3 := fn mod 51,
607 t2 := fn mod 26
608 }
609
Harald Welte9abd1282018-02-19 19:18:17 +0100610 function tr_RSL_IE_FrameNumber(template GsmFrameNumber fn) return template RSL_IE_FrameNumber {
611 if (istemplatekind(fn, "?")) {
612 return ?;
613 } else {
614 return ts_RSL_IE_FrameNumber(valueof(fn));
615 }
616 }
617
Harald Welteefa7d912018-04-18 23:22:15 +0200618 template (value) RSL_IE_RequestRef ts_RSL_IE_ReqRef(OCT1 ra, GsmFrameNumber frame_nr) := {
Harald Welte643e2a62017-11-27 15:03:18 +0100619 ra := ra,
620 frame_nr := ts_RSL_IE_FrameNumber(frame_nr)
621 }
622
Harald Welte9abd1282018-02-19 19:18:17 +0100623 template RSL_IE_RequestRef tr_RSL_IE_ReqRef(template OCT1 ra, template GsmFrameNumber frame_nr) := {
624 ra := ra,
625 frame_nr := tr_RSL_IE_FrameNumber(frame_nr)
626 }
627
Vadim Yanitskiy9f699532021-06-03 17:29:22 +0200628 /* 9.3.21 Resource Information */
629 type record RSL_IE_ResourceInfo {
630 uint8_t len,
631 RSL_ResourceInfo info
632 } with { variant (len) "LENGTHTO(info)" };
633
634 type record of RSL_ResourceInfoItem RSL_ResourceInfo;
635 type record RSL_ResourceInfoItem {
636 RslChannelNr chan_nr,
637 uint3_t interf_band,
638 BIT5 rfu ('00000'B)
639 };
640
641 template (value) RSL_ResourceInfoItem
642 ts_RSL_ResourceInfoItem(template (value) RslChannelNr chan_nr,
643 template (value) uint3_t interf_band := 0) := {
644 chan_nr := chan_nr,
645 interf_band := interf_band,
646 rfu := '00000'B
647 }
648 template RSL_ResourceInfoItem
649 tr_RSL_ResourceInfoItem(template (present) RslChannelNr chan_nr := ?,
650 template (present) uint3_t interf_band := ?) := {
651 chan_nr := chan_nr,
652 interf_band := interf_band,
653 rfu := ? /* Tolerate unknown values */
654 }
655
Harald Welte15de8ba2018-06-29 08:51:42 +0200656 /* Osmocom Extension */
657 type record RSL_IE_UplinkMeasSuppMeasInfo {
658 int16_t toa256_mean,
659 int16_t toa256_min,
660 int16_t toa256_max,
661 uint16_t toa256_std_dev
662 };
663
Harald Welte2691adf2018-02-22 17:32:39 +0100664 /* 9.3.25 */
665 type record RSL_IE_UplinkMeas {
666 uint8_t len,
667 BIT1 rfu,
668 boolean dtx_d,
669 uint6_t rxlev_f_u,
670 BIT2 reserved1,
671 uint6_t rxlev_s_u,
672 BIT2 reserved2,
673 uint3_t rxq_f_u,
674 uint3_t rxq_s_u,
Harald Welte15de8ba2018-06-29 08:51:42 +0200675 RSL_IE_UplinkMeasSuppMeasInfo supp_meas_info optional
Harald Welte2691adf2018-02-22 17:32:39 +0100676 } 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 Welte9abd1282018-02-19 19:18:17 +0100677
Neels Hofmeyrafe2ea52021-11-24 15:16:12 +0100678 template (value) RSL_IE_UplinkMeas ts_RSL_IE_UplinkMeas(uint6_t rxlev := 12, uint3_t rxqual := 0) := {
679 len := 0, /* overwritten */
680 rfu := '0'B,
681 dtx_d := false,
682 rxlev_f_u := rxlev,
683 reserved1 := '00'B,
684 rxlev_s_u := rxlev,
685 reserved2 := '00'B,
686 rxq_f_u := rxqual,
687 rxq_s_u := rxqual,
688 supp_meas_info := omit
689 };
690
Harald Welte643e2a62017-11-27 15:03:18 +0100691 /* 9.3.26 */
Harald Weltea8ed9062017-12-14 09:46:01 +0100692 type enumerated RSL_Cause {
693 /* normal event */
694 RSL_ERR_RADIO_IF_FAIL ('00'O),
695 RSL_ERR_RADIO_LINK_FAIL ('01'O),
696 RSL_ERR_HANDOVER_ACC_FAIL ('02'O),
697 RSL_ERR_TALKER_ACC_FAIL ('03'O),
698 RSL_ERR_OM_INTERVENTION ('07'O),
699 RSL_ERR_NORMAL_UNSPEC ('0f'O),
700 RSL_ERR_T_MSRFPCI_EXP ('18'O),
701 /* resource unavailable */
702 RSL_ERR_EQUIPMENT_FAIL ('20'O),
703 RSL_ERR_RR_UNAVAIL ('21'O),
704 RSL_ERR_TERR_CH_FAIL ('22'O),
705 RSL_ERR_CCCH_OVERLOAD ('23'O),
706 RSL_ERR_ACCH_OVERLOAD ('24'O),
707 RSL_ERR_PROCESSOR_OVERLOAD ('25'O),
708 RSL_ERR_BTS_NOT_EQUIPPED ('27'O),
709 RSL_ERR_REMOTE_TRAU_FAILURE ('28'O),
710 RSL_ERR_NOTIF_OVERFLOW ('29'O),
711 RSL_ERR_RES_UNAVAIL ('2f'O),
712 /* service or option not available */
713 RSL_ERR_TRANSC_UNAVAIL ('30'O),
714 RSL_ERR_SERV_OPT_UNAVAIL ('3f'O),
715 /* service or option not implemented */
716 RSL_ERR_ENCR_UNIMPL ('40'O),
717 RSL_ERR_SERV_OPT_UNIMPL ('4f'O),
718 /* invalid message */
719 RSL_ERR_RCH_ALR_ACTV_ALLOC ('50'O),
Harald Welte9912eb52018-02-25 13:30:15 +0100720 RSL_ERR_IPA_RCH_NOT_ACTV_ALLOC ('51'O),
721 RSL_ERR_IPA_CONN_INVALID ('52'O),
722 RSL_ERR_IPA_CONN_IN_USE ('53'O),
723 RSL_ERR_IPA_CONN_ALREADY_EXISTS ('54'O),
Harald Weltea8ed9062017-12-14 09:46:01 +0100724 RSL_ERR_INVALID_MESSAGE ('5f'O),
725 /* protocol error */
726 RSL_ERR_MSG_DISCR ('60'O),
727 RSL_ERR_MSG_TYPE ('61'O),
728 RSL_ERR_MSG_SEQ ('62'O),
729 RSL_ERR_IE_ERROR ('63'O),
730 RSL_ERR_MAND_IE_ERROR ('64'O),
731 RSL_ERR_OPT_IE_ERROR ('65'O),
732 RSL_ERR_IE_NONEXIST ('66'O),
733 RSL_ERR_IE_LENGTH ('67'O),
734 RSL_ERR_IE_CONTENT ('68'O),
735 RSL_ERR_PROTO ('6f'O),
736 /* interworking */
737 RSL_ERR_INTERWORKING ('7f'O)
738 };
Harald Welte643e2a62017-11-27 15:03:18 +0100739 type record RSL_IE_Cause {
Harald Welte6efa8e32017-12-09 22:34:06 +0100740 uint8_t len,
Harald Welte643e2a62017-11-27 15:03:18 +0100741 uint1_t e,
742 RSL_Cause cause,
743 octetstring cause_ext optional
Harald Welte6efa8e32017-12-09 22:34:06 +0100744 } with { variant (len) "LENGTHTO(e,cause,cause_ext)" }
Harald Welte643e2a62017-11-27 15:03:18 +0100745
Harald Welteefa7d912018-04-18 23:22:15 +0200746 template (value) RSL_IE_Cause ts_RSL_IE_Cause(RSL_Cause cause) := {
Harald Welte6efa8e32017-12-09 22:34:06 +0100747 len := 0, /* overwritten */
Harald Welte643e2a62017-11-27 15:03:18 +0100748 e := 0,
749 cause := cause,
750 cause_ext := omit
751 }
752
Harald Welte9abd1282018-02-19 19:18:17 +0100753 template RSL_IE_Cause tr_RSL_IE_Cause(template RSL_Cause cause) := {
754 len := ?,
755 e := 0,
756 cause := cause,
757 cause_ext := omit
758 }
759
Harald Weltec8d363c2019-05-19 20:36:48 +0200760 /* 9.3.29 */
761 type record RSL_SacchInfo {
762 uint8_t len,
763 uint8_t num_msgs,
764 RSL_SacchInfoElements elems
765 } with {
766 variant (len) "LENGTHTO(num_msgs,elems)";
767 variant (num_msgs) "LENGTHTO(elems)";
768 variant (num_msgs) "UNIT(elements)"
769 };
770 type record RSL_SacchInfoElement {
771 RSL_IE_SysinfoType si_type,
772 uint8_t len,
773 octetstring msg
774 } with {
775 variant (len) "LENGTHTO(msg)";
776 };
777 type record of RSL_SacchInfoElement RSL_SacchInfoElements;
778 template (value) RSL_SacchInfo ts_RSL_SacchInfo(template (value) RSL_SacchInfoElements elems) := {
779 len := 0, /* overwritten */
780 num_msgs := 0, /* overwritten */
781 elems := elems
782 }
783 template (value) RSL_SacchInfoElement ts_RSL_SacchInfoElem(RSL_IE_SysinfoType tp, octetstring msg) := {
784 si_type := tp,
785 len := lengthof(msg),
786 msg := msg
787 }
788
Eric Wild61edb7e2019-06-03 12:38:31 +0200789 /* 9.3.31 */
790 type record RSL_IE_MS_Power_Parameters {
791 uint8_t len,
792 octetstring params
793 } with {
794 variant (len) "LENGTHTO(params)";
795 };
796 template (value) RSL_IE_MS_Power_Parameters ts_RSL_IE_MS_Power_Parameters(octetstring params) := {
797 len := 0, /* overwritten */
798 params := params
799 }
800
Harald Welte643e2a62017-11-27 15:03:18 +0100801 /* 9.3.40 */
802 type enumerated RSL_ChanNeeded {
803 RSL_CHANNEED_ANY ('00'B),
804 RSL_CHANNEED_SDCCH ('01'B),
805 RSL_CHANNEED_TCH_F ('10'B),
806 RSL_CHANNEED_TCH_ForH ('11'B)
Harald Welte51d74102017-12-10 23:05:02 +0100807 } with { variant "FIELDLENGTH(2)" };
Harald Welte643e2a62017-11-27 15:03:18 +0100808 type record RSL_IE_ChanNeeded {
809 uint6_t reserved,
810 RSL_ChanNeeded chan_needed
811 }
812
Harald Weltecc373202018-09-10 10:28:21 +0200813 /* 9.3.41 CB Command Type */
814 type enumerated RSL_CbCommand {
815 RSL_CB_CMD_NORMAL ('0000'B),
816 RSL_CB_CMD_SCHEDULE ('1000'B),
817 RSL_CB_CMD_DEFAULT ('1110'B),
818 RSL_CB_CMD_NULL ('1111'B)
819 } with { variant "FIELDLENGTH(4)" };
820 type record RSL_IE_CbCommandType {
821 RSL_CbCommand command,
822 boolean default_bcast_null,
823 BIT1 spare,
824 uint2_t last_block
825 };
826 template (value) RSL_IE_CbCommandType ts_RSL_IE_CbCmdType(RSL_CbCommand cmd := RSL_CB_CMD_NORMAL,
827 uint2_t last_block := 1,
828 boolean def_bcast_null := true) := {
829 command := cmd,
830 default_bcast_null := def_bcast_null,
831 spare := '0'B,
832 last_block := last_block
833 }
834
Harald Welte4a129f82019-05-21 16:35:22 +0200835 /* 9.4.43 CBCH Load Information */
836 type record RSL_IE_CbchLoadInfo {
837 boolean overflow,
838 BIT3 spare,
839 uint4_t slot_count
840 };
841 template RSL_IE_CbchLoadInfo tr_CbchLoadInfo(template boolean overflow,
842 template uint4_t slot_count) := {
843 overflow := overflow,
844 spare := ?,
845 slot_count := slot_count
846 }
847 template (value) RSL_IE_CbchLoadInfo ts_CbchLoadInfo(boolean overflow, uint4_t slot_count) := {
848 overflow := overflow,
849 spare := '000'B,
850 slot_count := slot_count
851 }
852
Harald Weltee33e5152023-04-09 23:29:48 +0200853 /* 9.3.45 Group Call Reference */
854 type record RSL_IE_GroupCallReference {
855 uint8_t len,
856 GroupCallRef group_or_bcast_call_ref
857 } with {
858 variant (len) "LENGTHTO(group_or_bcast_call_ref)"
859 };
860 template (value) RSL_IE_GroupCallReference ts_GroupCallRef(template (value) GroupCallRef gcr) := {
861 len := 0, // overwritten
862 group_or_bcast_call_ref := gcr
863 }
864 template (present) RSL_IE_GroupCallReference tr_GroupCallRef(template (present) GroupCallRef gcr := ?) := {
865 len := ?,
866 group_or_bcast_call_ref := gcr
867 }
868
869 /* 9.3.46 Channel description */
870 type record RSL_IE_GroupChannelDescription {
871 uint8_t len,
872 octetstring chan_desc
873 } with {
874 variant (len) "LENGTHTO(chan_desc)"
875 };
876 template (value) RSL_IE_GroupChannelDescription ts_GroupChanDesc(template (value) octetstring cd) := {
877 len := 0, // overwritten
878 chan_desc := cd
879 }
880 template (present) RSL_IE_GroupChannelDescription tr_GroupChanDesc(template (present) octetstring cd) := {
881 len := ?,
882 chan_desc := cd
883 }
884
885 /* 9.3.47 NCH DRX Information */
886 type record RSL_IE_NchDrxInformation {
887 uint8_t len,
888 BIT2 spare,
889 BIT1 nln_status,
890 BIT3 emlpp_priority,
891 BIT2 nln
892 } with {
893 variant (len) "LENGTHTO(spare,nln_status,emlpp_priority,nln)"
894 };
895
896 /* 9.3.48 Command Indicator */
897 type enumerated RSL_CommandIndicator {
898 CMD_IND_START (0),
899 CMD_IND_STOP (1)
900 } with { variant "FIELDLENGTH(8)" };
901 type record RSL_IE_CommandIndicator {
902 uint8_t len,
903 RSL_CommandIndicator command_value
904 } with {
905 variant (len) "LENGTHTO(command_value)"
906 };
907 template (value) RSL_IE_CommandIndicator ts_CommandInd(template (value) RSL_CommandIndicator ci) := {
908 len := 0, // overwritten
909 command_value := ci
910 }
911 template (present) RSL_IE_CommandIndicator tr_CommandInd(template (present) RSL_CommandIndicator ci) := {
912 len := ?,
913 command_value := ci
914 }
915
916 /* 9.3.50 UIC */
917 type record RSL_IE_Uic {
918 uint8_t len,
919 BIT2 spare,
920 uint6_t uic
921 } with {
922 variant (len) "LENGTHTO(spare,uic)"
923 };
924
Pau Espin Pedrolf7634dc2022-09-02 17:56:00 +0200925 /* 9.3.52, 3GPP TS 44.018 10.5.2.21aa */
926 type record RSL_IE_MultirateCfg {
927 uint8_t len,
928 uint3_t mr_speech_ver,
929 boolean nscb,
930 boolean icmi,
931 BIT1 spare,
932 uint2_t start_mode,
Vadim Yanitskiyf14e6962022-09-14 15:18:06 +0700933 BIT8 codec_modes,
Pau Espin Pedrolf7634dc2022-09-02 17:56:00 +0200934 octetstring parameters
935 } with {
Vadim Yanitskiyf14e6962022-09-14 15:18:06 +0700936 variant (len) "LENGTHTO(mr_speech_ver,nscb,icmi,spare,start_mode,codec_modes,parameters)"
Pau Espin Pedrolf7634dc2022-09-02 17:56:00 +0200937 };
938 template (value) RSL_IE_MultirateCfg ts_RSL_MultirateCfg(boolean icmi := true, uint2_t start_mode := 0,
Vadim Yanitskiy0345d202022-09-14 16:13:40 +0700939 BIT8 codec_modes := '00000100'B /* 5,90k */,
940 octetstring params := ''O) := {
Vadim Yanitskiy9e0139b2022-09-14 17:41:29 +0700941 len := 2 + lengthof(params),
Pau Espin Pedrolf7634dc2022-09-02 17:56:00 +0200942 mr_speech_ver := 1,
943 nscb := false,
944 icmi := icmi,
945 spare := '0'B,
946 start_mode := start_mode,
Vadim Yanitskiyf14e6962022-09-14 15:18:06 +0700947 codec_modes := codec_modes,
Vadim Yanitskiy0345d202022-09-14 16:13:40 +0700948 parameters := params
Pau Espin Pedrolf7634dc2022-09-02 17:56:00 +0200949 }
950
Harald Welte643e2a62017-11-27 15:03:18 +0100951 /* 9.3.53 */
952 type record RSL_IE_MultirateCtrl {
953 uint3_t spare,
954 boolean od,
955 boolean pre,
956 uint2_t rae,
957 boolean tfo
958 }
959
960 type enumerated RSL_IE_SysinfoType {
961 RSL_SYSTEM_INFO_8 ('00000000'B),
962 RSL_SYSTEM_INFO_1 ('00000001'B),
963 RSL_SYSTEM_INFO_2 ('00000010'B),
964 RSL_SYSTEM_INFO_3 ('00000011'B),
965 RSL_SYSTEM_INFO_4 ('00000100'B),
966 RSL_SYSTEM_INFO_5 ('00000101'B),
967 RSL_SYSTEM_INFO_6 ('00000110'B),
968 RSL_SYSTEM_INFO_7 ('00000111'B),
969 RSL_SYSTEM_INFO_16 ('00001000'B),
970 RSL_SYSTEM_INFO_17 ('00001001'B),
971 RSL_SYSTEM_INFO_2bis ('00001010'B),
972 RSL_SYSTEM_INFO_2ter ('00001011'B),
973 RSL_SYSTEM_INFO_5bis ('00001101'B),
974 RSL_SYSTEM_INFO_5ter ('00001110'B),
975 RSL_SYSTEM_INFO_10 ('00001111'B),
976 RSL_EXT_MEAS_ORDER ('01000111'B),
977 RSL_MEAS_INFO ('01001000'B),
978 RSL_SYSTEM_INFO_13 ('00101000'B),
979 RSL_ERIC_SYSTEM_INFO_13 ('00001100'B),
980 RSL_SYSTEM_INFO_2quater ('00101001'B),
981 RSL_SYSTEM_INFO_9 ('00101010'B),
982 RSL_SYSTEM_INFO_18 ('00101011'B),
983 RSL_SYSTEM_INFO_19 ('00101100'B),
984 RSL_SYSTEM_INFO_20 ('00101101'B)
985 } with { variant "FIELDLENGTH(8)" }
986
Harald Welte9958a4d2017-12-14 21:21:33 +0100987 type record RSL_IE_IPA_ConnectionStats {
988 uint8_t len,
989 uint32_t tx_packets,
990 uint32_t tx_octets,
991 uint32_t rx_packets,
992 uint32_t rx_octets,
993 uint32_t lost_packets,
994 uint32_t jitter,
995 uint32_t avg_delay
996 } with { variant (len) "LENGTHTO(tx_packets,tx_octets,rx_packets,rx_octets,lost_packets,jitter,avg_delay)" }
997
998 type enumerated RSL_IPA_SpeechMode {
999 RSL_IPA_SPM_SENDRECV ('00'B),
1000 RSL_IPA_SPM_RECVONLY ('01'B),
1001 RSL_IPA_SPM_SENDONLY ('10'B),
1002 RSL_IPA_SPM_RESERVED ('11'B)
1003 } with { variant "FIELDLENGTH(2)" }
1004
1005 type enumerated RSL_IPA_Codec {
1006 RSL_IPA_CODEC_FR ('0000'B),
1007 RSL_IPA_CODEC_EFR ('0001'B),
1008 RSL_IPA_CODEC_AMR_F ('0010'B),
1009 RSL_IPA_CODEC_HR ('0011'B),
1010 RSL_IPA_CODEC_AMR_H ('0101'B),
1011 RSL_IPA_CODEC_RTP_PT ('1111'B)
1012 } with { variant "FIELDLENGTH(4)" }
1013
1014 type record RSL_IE_IPA_SpeechMode {
1015 BIT2 reserved,
1016 RSL_IPA_SpeechMode mode,
1017 RSL_IPA_Codec codec
1018 }
1019
Oliver Smithbc392a82023-04-17 14:06:42 +02001020 type enumerated RSL_IPA_RTP_CSD_FMT_D {
1021 RSL_IPA_RTP_CSD_EXT_TRAU ('0000'B),
1022 RSL_IPA_RTP_CSD_NON_TRAU ('0001'B),
1023 RSL_IPA_RTP_CSD_TRAU_BTS ('0010'B),
1024 RSL_IPA_RTP_CSD_IWF_FREE ('0011'B)
1025 } with { variant "FIELDLENGTH(4)" }
1026
1027 type enumerated RSL_IPA_RTP_CSD_FMT_IR {
1028 RSL_IPA_RTP_CSD_8k ('0000'B),
1029 RSL_IPA_RTP_CSD_16k ('0001'B),
1030 RSL_IPA_RTP_CSD_32k ('0010'B),
1031 RSL_IPA_RTP_CSD_64 ('0011'B)
1032 } with { variant "FIELDLENGTH(4)" }
1033
1034 type record RSL_IE_IPA_RTP_CSD_FMT {
1035 RSL_IPA_RTP_CSD_FMT_IR ir,
1036 RSL_IPA_RTP_CSD_FMT_D d
1037 }
1038
Harald Welte0472ab42018-03-12 15:02:26 +01001039 /* 9.3.20 */
1040 type enumerated RSL_IE_ReleaseMode {
1041 RSL_REL_MODE_NORMAL ('00'B),
1042 REL_REL_MODE_LOCAL ('01'B)
1043 }
1044
Neels Hofmeyr2bef0dd2021-04-22 21:46:00 +00001045 type record RSL_IE_OSMO_TrainingSequence {
1046 uint8_t len,
1047 uint8_t tsc_set,
1048 uint8_t tsc
1049 } with { variant (len) "LENGTHTO(tsc_set,tsc)" }
1050
Vadim Yanitskiy1f532152021-11-01 20:37:56 +03001051 type record RSL_IE_OSMO_RepAcchCap {
1052 uint8_t len,
1053 BIT1 rfu ('0'B),
1054 uint3_t rxqual,
1055 boolean ul_sacch,
1056 boolean dl_sacch,
1057 boolean dl_facch_all,
1058 boolean dl_facch_cmd
1059 } with { variant (len) "LENGTHTO(rfu,rxqual,ul_sacch,dl_sacch,dl_facch_all,dl_facch_cmd)" }
1060
Vadim Yanitskiya203d3b2021-11-01 21:32:31 +03001061 type record RSL_IE_OSMO_TopAcchCap {
1062 uint8_t len,
1063 boolean sacch_enable,
1064 boolean facch_enable,
1065 uint3_t rxqual,
1066 uint3_t overpower_db
1067 } with { variant (len) "LENGTHTO(sacch_enable,facch_enable,rxqual,overpower_db)" }
1068
Vadim Yanitskiy66d3c332021-11-06 18:18:13 +03001069 template (value) RSL_IE_OSMO_TopAcchCap
1070 ts_RSL_IE_OSMO_TopAcchCap(template (value) uint3_t overpower := 2,
1071 template (value) uint3_t rxqual := 4,
1072 boolean facch_enable := true,
1073 boolean sacch_enable := true) := {
1074 len := 0, /* overwritten */
1075 sacch_enable := sacch_enable,
1076 facch_enable := facch_enable,
1077 rxqual := rxqual,
1078 overpower_db := overpower
1079 };
1080 template RSL_IE_OSMO_TopAcchCap
1081 tr_RSL_IE_OSMO_TopAcchCap(template (present) uint3_t overpower := ?,
1082 template (present) uint3_t rxqual := ?,
1083 template (present) boolean facch_enable := ?,
1084 template (present) boolean sacch_enable := ?) := {
1085 len := ?, /* overwritten */
1086 sacch_enable := sacch_enable,
1087 facch_enable := facch_enable,
1088 rxqual := rxqual,
1089 overpower_db := overpower
1090 };
1091
Pau Espin Pedrol29c6dfb2022-08-08 18:37:56 +02001092 type record RSL_IE_OSMO_Osmux_CID {
1093 uint8_t len,
1094 uint8_t cid
1095 } with { variant (len) "LENGTHTO(cid)" }
1096
1097 template (present) RSL_IE_OSMO_Osmux_CID
1098 tr_RSL_IE_OSMO_Osmux_CID(template (present) uint8_t osmux_cid := ?) := {
1099 len := ?, /* overwritten */
1100 cid := osmux_cid
1101 };
Pau Espin Pedrol39bfa022022-08-12 14:56:12 +02001102 function f_tr_RSL_IE_OSMO_Osmux_CID(template uint8_t osmux_cid := *)
1103 return template RSL_IE_OSMO_Osmux_CID {
1104 var template RSL_IE_OSMO_Osmux_CID ie := omit;
1105 if (not istemplatekind(osmux_cid, "omit")) {
1106 ie := tr_RSL_IE_OSMO_Osmux_CID(osmux_cid);
1107 }
1108 return ie;
1109 }
Pau Espin Pedrol29c6dfb2022-08-08 18:37:56 +02001110 template (value) RSL_IE_OSMO_Osmux_CID
1111 ts_RSL_IE_OSMO_Osmux_CID(template (value) uint8_t osmux_cid) := {
1112 len := 0, /* overwritten */
1113 cid := osmux_cid
1114 };
1115
1116
Harald Welte643e2a62017-11-27 15:03:18 +01001117 /* union of all IE bodies */
1118 type union RSL_IE_Body {
1119 RslChannelNr chan_nr,
1120 RslLinkId link_id,
Harald Welte15bb5b52017-12-07 17:52:04 +01001121 RSL_L16V l3_info,
Harald Welte643e2a62017-11-27 15:03:18 +01001122 RSL_LV rlm_cause,
Harald Welte0472ab42018-03-12 15:02:26 +01001123 RSL_IE_ReleaseMode release_mode,
Harald Welte643e2a62017-11-27 15:03:18 +01001124 RSL_IE_ActivationType act_type,
Vadim Yanitskiye02dbcc2020-08-25 04:20:51 +07001125 RSL_IE_ChannelIdent chan_ident,
Harald Welte643e2a62017-11-27 15:03:18 +01001126 RSL_IE_ChannelMode chan_mode,
1127 uint8_t handover_ref,
1128 RSL_IE_BS_Power bs_power,
Vadim Yanitskiy802508e2020-11-11 07:25:47 +07001129 RSL_LV bs_power_params,
Harald Welte643e2a62017-11-27 15:03:18 +01001130 RSL_IE_MS_Power ms_power,
Eric Wild61edb7e2019-06-03 12:38:31 +02001131 RSL_IE_MS_Power_Parameters ms_power_params,
Harald Welte643e2a62017-11-27 15:03:18 +01001132 uint8_t timing_adv,
Pau Espin Pedrolf7634dc2022-09-02 17:56:00 +02001133 RSL_IE_MultirateCfg multirate_cfg,
Harald Welte643e2a62017-11-27 15:03:18 +01001134 RSL_IE_MultirateCtrl multirate_ctrl,
Harald Weltea6706152019-05-19 20:38:18 +02001135 uint8_t msg_id,
Harald Welte643e2a62017-11-27 15:03:18 +01001136 RSL_IE_FrameNumber frame_nr,
1137 RSL_IE_Cause cause,
1138 uint8_t access_delay,
Harald Welted5f521e2017-12-07 17:53:06 +01001139 RSL_IE_RachLoad rach_load,
Harald Welte643e2a62017-11-27 15:03:18 +01001140 uint8_t meas_res_nr,
Harald Welte2691adf2018-02-22 17:32:39 +01001141 uint8_t ms_timing_offset,
1142 RSL_IE_UplinkMeas uplink_meas,
Harald Welte643e2a62017-11-27 15:03:18 +01001143 RSL_IE_L1Info l1_info,
1144 RSL_IE_SysinfoType sysinfo_type,
1145 uint16_t paging_load,
1146 uint8_t paging_group,
1147 RSL_IE_ChanNeeded chan_needed,
Harald Weltecc373202018-09-10 10:28:21 +02001148 RSL_IE_CbCommandType cb_cmd_type,
1149 RSL_LV smscb_message,
Harald Welte4a129f82019-05-21 16:35:22 +02001150 RSL_IE_CbchLoadInfo cbch_load_info,
Vadim Yanitskiy9f699532021-06-03 17:29:22 +02001151 RSL_IE_ResourceInfo resource_info,
Harald Weltec8d363c2019-05-19 20:36:48 +02001152 RSL_SacchInfo sacch_info,
Harald Weltecc373202018-09-10 10:28:21 +02001153
Harald Welte643e2a62017-11-27 15:03:18 +01001154 RSL_IE_StartingTime starting_time,
Harald Welte73cd2712017-12-17 00:44:52 +01001155 RSL_IE_EncryptionInfo encr_info,
Harald Weltea3ff6702019-05-20 20:03:50 +02001156 uint8_t smscb_chan_ind,
Harald Welte643e2a62017-11-27 15:03:18 +01001157 RSL_IE_RequestRef req_ref,
1158 RSL_LV full_imm_ass_info,
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +07001159 MobileIdentityLV ms_identity,
Harald Welte643e2a62017-11-27 15:03:18 +01001160
Harald Weltee33e5152023-04-09 23:29:48 +02001161 RSL_IE_GroupCallReference group_call_ref,
1162 RSL_IE_GroupChannelDescription group_chan_desc,
1163 RSL_IE_NchDrxInformation nch_drx_info,
1164 RSL_IE_CommandIndicator cmd_indicator,
1165 RSL_IE_Uic uic,
1166
Harald Welte9958a4d2017-12-14 21:21:33 +01001167 uint16_t ipa_conn_id,
1168 uint16_t ipa_local_port,
1169 uint16_t ipa_remote_port,
Vadim Yanitskiyfc631642021-07-03 02:42:45 +02001170 OCT4 ipa_local_ip,
1171 OCT4 ipa_remote_ip,
Harald Welte9958a4d2017-12-14 21:21:33 +01001172 uint8_t ipa_rtp_pt,
1173 uint8_t ipa_rtp_pt2,
1174 RSL_IE_IPA_ConnectionStats ipa_stats,
1175 RSL_IE_IPA_SpeechMode ipa_speech_mode,
Oliver Smithbc392a82023-04-17 14:06:42 +02001176 RSL_IE_IPA_RTP_CSD_FMT ipa_rtp_csd_fmt,
Harald Welte9958a4d2017-12-14 21:21:33 +01001177
Neels Hofmeyr2bef0dd2021-04-22 21:46:00 +00001178 RSL_IE_OSMO_TrainingSequence osmo_training_sequence,
Vadim Yanitskiy1f532152021-11-01 20:37:56 +03001179 RSL_IE_OSMO_RepAcchCap rep_acch_cap,
Vadim Yanitskiya203d3b2021-11-01 21:32:31 +03001180 RSL_IE_OSMO_TopAcchCap top_acch_cap,
Pau Espin Pedrol29c6dfb2022-08-08 18:37:56 +02001181 RSL_IE_OSMO_Osmux_CID osmux_cid,
Neels Hofmeyr2bef0dd2021-04-22 21:46:00 +00001182
Harald Welte643e2a62017-11-27 15:03:18 +01001183 RSL_LV other
1184 }
1185
1186 type record RSL_IE {
1187 RSL_IE_Type iei,
1188 RSL_IE_Body body
1189 } with { variant (body) "CROSSTAG(
1190 chan_nr, iei = RSL_IE_CHAN_NR;
1191 link_id, iei = RSL_IE_LINK_IDENT;
1192 l3_info, iei = RSL_IE_L3_INFO;
1193 rlm_cause, iei = RSL_IE_RLM_CAUSE;
1194 release_mode, iei = RSL_IE_RELEASE_MODE;
1195 act_type, iei = RSL_IE_ACT_TYPE;
Vadim Yanitskiye02dbcc2020-08-25 04:20:51 +07001196 chan_ident, iei = RSL_IE_CHAN_IDENT;
Harald Welte643e2a62017-11-27 15:03:18 +01001197 chan_mode, iei = RSL_IE_CHAN_MODE;
1198 handover_ref, iei = RSL_IE_HANDO_REF;
1199 bs_power, iei = RSL_IE_BS_POWER;
Vadim Yanitskiy802508e2020-11-11 07:25:47 +07001200 bs_power_params, iei = RSL_IE_BS_POWER_PARAM;
Harald Welte643e2a62017-11-27 15:03:18 +01001201 ms_power, iei = RSL_IE_MS_POWER;
Eric Wild61edb7e2019-06-03 12:38:31 +02001202 ms_power_params, iei = RSL_IE_MS_POWER_PARAM;
Harald Welte643e2a62017-11-27 15:03:18 +01001203 timing_adv, iei = RSL_IE_TIMING_ADVANCE;
Pau Espin Pedrolf7634dc2022-09-02 17:56:00 +02001204 multirate_cfg, iei = RSL_IE_MR_CONFIG;
Harald Welte643e2a62017-11-27 15:03:18 +01001205 multirate_ctrl, iei = RSL_IE_MR_CONTROL;
Harald Weltea6706152019-05-19 20:38:18 +02001206 msg_id, iei = RSL_IE_MSG_ID;
Harald Welte643e2a62017-11-27 15:03:18 +01001207
1208 frame_nr, iei = RSL_IE_FRAME_NUMBER;
1209 cause, iei = RSL_IE_CAUSE;
1210 access_delay, iei = RSL_IE_ACCESS_DELAY;
Harald Welted5f521e2017-12-07 17:53:06 +01001211 rach_load, iei = RSL_IE_RACH_LOAD;
Harald Welte643e2a62017-11-27 15:03:18 +01001212 meas_res_nr, iei = RSL_IE_MEAS_RES_NR;
Harald Welte2691adf2018-02-22 17:32:39 +01001213 ms_timing_offset, iei = RSL_IE_MS_TIMING_OFFSET;
1214 uplink_meas, iei = RSL_IE_UPLINK_MEAS;
Harald Welte643e2a62017-11-27 15:03:18 +01001215 l1_info, iei = RSL_IE_L1_INFO;
1216 sysinfo_type, iei = RSL_IE_SYSINFO_TYPE;
1217 paging_load, iei = RSL_IE_PAGING_LOAD;
1218 paging_group, iei = RSL_IE_PAGING_GROUP;
1219 chan_needed, iei = RSL_IE_CHAN_NEEDED;
Harald Weltecc373202018-09-10 10:28:21 +02001220 cb_cmd_type, iei = RSL_IE_CB_CMD_TYPE;
1221 smscb_message, iei = RSL_IE_SMSCB_MSG;
Harald Welte4a129f82019-05-21 16:35:22 +02001222 cbch_load_info, iei = RSL_IE_CBCH_LOAD_INFO;
Vadim Yanitskiy9f699532021-06-03 17:29:22 +02001223 resource_info, iei = RSL_IE_RESOURCE_INFO;
Harald Weltec8d363c2019-05-19 20:36:48 +02001224 sacch_info, iei = RSL_IE_SACCH_INFO;
Harald Welte643e2a62017-11-27 15:03:18 +01001225 starting_time, iei = RSL_IE_STARTNG_TIME;
Harald Welte73cd2712017-12-17 00:44:52 +01001226 encr_info, iei = RSL_IE_ENCR_INFO;
Harald Weltea3ff6702019-05-20 20:03:50 +02001227 smscb_chan_ind, iei = RSL_IE_SMSCB_CHAN_INDICATOR;
Harald Welte643e2a62017-11-27 15:03:18 +01001228
1229 req_ref, iei = RSL_IE_REQ_REFERENCE;
Harald Weltefff69302017-12-07 17:53:42 +01001230 full_imm_ass_info, iei = RSL_IE_FULL_IMM_ASS_INFO;
1231 ms_identity, iei = RSL_IE_MS_IDENTITY;
1232 other, iei = RSL_IE_FULL_BCCH_INFO;
Harald Welte643e2a62017-11-27 15:03:18 +01001233
Harald Weltee33e5152023-04-09 23:29:48 +02001234 group_call_ref, iei = RSL_IE_GROUP_CALL_REF;
1235 group_chan_desc, iei = RSL_IE_GROUP_CHAN_DESC;
1236 nch_drx_info, iei = RSL_IE_NCH_DRX_INFO;
1237 cmd_indicator, iei = RSL_IE_CMD_INDICATOR;
1238 uic, iei = RSL_IE_UIC;
1239
Harald Welte9958a4d2017-12-14 21:21:33 +01001240 ipa_conn_id, iei = RSL_IE_IPAC_CONN_ID;
1241 ipa_remote_ip, iei = RSL_IE_IPAC_REMOTE_IP;
1242 ipa_remote_port, iei = RSL_IE_IPAC_REMOTE_PORT;
1243 ipa_local_ip, iei = RSL_IE_IPAC_LOCAL_IP;
1244 ipa_local_port, iei = RSL_IE_IPAC_LOCAL_PORT;
1245 ipa_rtp_pt, iei = RSL_IE_IPAC_RTP_PAYLOAD;
1246 ipa_rtp_pt2, iei = RSL_IE_IPAC_RTP_PAYLOAD2;
1247 ipa_stats, iei = RSL_IE_IPAC_CONN_STAT;
1248 ipa_speech_mode, iei = RSL_IE_IPAC_SPEECH_MODE;
Oliver Smithbc392a82023-04-17 14:06:42 +02001249 ipa_rtp_csd_fmt, iei = RSL_IE_IPAC_RTP_CSD_FMT;
Harald Welte9958a4d2017-12-14 21:21:33 +01001250
Neels Hofmeyr2bef0dd2021-04-22 21:46:00 +00001251 osmo_training_sequence, iei = RSL_IE_OSMO_TRAINING_SEQUENCE;
Vadim Yanitskiy1f532152021-11-01 20:37:56 +03001252 rep_acch_cap, iei = RSL_IE_OSMO_REP_ACCH_CAP;
Vadim Yanitskiya203d3b2021-11-01 21:32:31 +03001253 top_acch_cap, iei = RSL_IE_OSMO_TOP_ACCH_CAP;
Pau Espin Pedrol29c6dfb2022-08-08 18:37:56 +02001254 osmux_cid, iei = RSL_IE_OSMO_OSMUX_CID;
Neels Hofmeyr2bef0dd2021-04-22 21:46:00 +00001255
Harald Welte643e2a62017-11-27 15:03:18 +01001256 other, OTHERWISE;
1257 )" };
1258
Harald Welte735dd072017-12-12 14:55:17 +01001259 /* For some reason the TTCN-3 RAW codec cannot automatically figure out the IEI
1260 * that it needs to set for a given union-choice (body). So we have to explicitly
1261 * specify the IEI by the caller :( */
Harald Welteefa7d912018-04-18 23:22:15 +02001262 template (value) RSL_IE t_RSL_IE(RSL_IE_Type iei, template (value) RSL_IE_Body body) := {
Harald Welte735dd072017-12-12 14:55:17 +01001263 iei := iei,
Harald Welte643e2a62017-11-27 15:03:18 +01001264 body := body
1265 }
1266
Harald Weltec2877752017-12-07 17:54:35 +01001267 template RSL_IE tr_RSL_IE(template RSL_IE_Body body) := {
1268 iei := ?, /* overwritten? */
1269 body := body
1270 }
1271
1272
Harald Welte643e2a62017-11-27 15:03:18 +01001273 type record of RSL_IE RSL_IE_List;
1274
1275 type record RSL_Message {
1276 RSL_MessageDiscriminator msg_disc,
1277 RSL_MessageType msg_type,
1278 RSL_IE_List ies optional
1279 }
1280
1281 external function enc_RSL_Message(in RSL_Message msg) return octetstring
1282 with { extension "prototype(convert) encode(RAW)" };
1283 external function dec_RSL_Message(in octetstring stream) return RSL_Message
1284 with { extension "prototype(convert) decode(RAW)" };
1285
Harald Weltebc330be2017-12-09 00:56:36 +01001286 template RSL_Message tr_RSL_MsgDiscType(template RSL_MessageDiscriminator m_disc,
Harald Welte643e2a62017-11-27 15:03:18 +01001287 RSL_MessageType m_type) := {
1288 msg_disc := m_disc,
1289 msg_type := m_type,
1290 ies := *
1291 }
1292
Harald Welteefa7d912018-04-18 23:22:15 +02001293 template (value) RSL_Message ts_RSL_MsgDiscType(template (value) RSL_MessageDiscriminator m_disc,
1294 template (value) RSL_MessageType msg_type,
1295 template (omit) RSL_IE_List ies := omit) := {
Harald Welte4a267362017-12-09 17:49:32 +01001296 msg_disc := m_disc,
1297 msg_type := msg_type,
1298 ies := ies
1299 }
1300
Harald Weltebc330be2017-12-09 00:56:36 +01001301template RSL_Message tr_RSL_MsgType(template RSL_MessageType msg_type) := {
1302 msg_disc := ?,
1303 msg_type := msg_type,
1304 ies := *
1305}
1306
1307/* Common Channel Management */
1308template RSL_Message tr_RSL_MsgTypeC(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
1309 msg_disc := { RSL_MDISC_CCHAN, ? }
1310}
1311
1312/* RLL */
1313template RSL_Message tr_RSL_MsgTypeR(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
1314 msg_disc := { RSL_MDISC_RLL, true }
1315}
1316
1317/* Dedicated Channel Management */
1318template RSL_Message tr_RSL_MsgTypeD(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
1319 msg_disc := { RSL_MDISC_DCHAN, ? }
1320}
1321
Vadim Yanitskiybf2aa492022-06-01 00:28:38 +06001322/* TRX Management */
Harald Weltebc330be2017-12-09 00:56:36 +01001323template RSL_Message tr_RSL_MsgTypeT(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
1324 msg_disc := { RSL_MDISC_TRX_MGMT, ? }
1325}
1326
1327
1328/* dedicated channel or RLL */
1329template RSL_Message tr_RSL_MsgTypeDR(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
Harald Weltee5408222018-01-29 21:57:58 +01001330 msg_disc := ({RSL_MDISC_DCHAN,?}, {RSL_MDISC_RLL,?}, {RSL_MDISC_IPACCESS,false})
Harald Weltebc330be2017-12-09 00:56:36 +01001331}
1332
1333
Harald Welte643e2a62017-11-27 15:03:18 +01001334 /* 8.3.1 BSC -> BTS */
Harald Welteefa7d912018-04-18 23:22:15 +02001335 template (value) RSL_Message ts_RSL_DATA_REQ(template (value) RslChannelNr chan_nr,
1336 template (value) RslLinkId link_id,
1337 octetstring l3_info) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001338 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, true),
1339 msg_type := RSL_MT_DATA_REQ,
1340 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001341 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1342 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
1343 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
Harald Welte643e2a62017-11-27 15:03:18 +01001344 }
1345 }
1346
Harald Welte7794d5b2017-12-16 23:00:20 +01001347 template RSL_Message tr_RSL_DATA_REQ(template RslChannelNr chan_nr :=?,
1348 template RslLinkId link_id := ?,
1349 template octetstring l3_info := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001350 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, true),
Harald Welte7794d5b2017-12-16 23:00:20 +01001351 msg_type := RSL_MT_DATA_REQ,
1352 ies :={
1353 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1354 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
1355 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
1356 }
1357 }
1358
1359
Harald Welte643e2a62017-11-27 15:03:18 +01001360 /* 8.3.2 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001361 template (value) RSL_Message ts_RSL_DATA_IND(template (value) RslChannelNr chan_nr,
1362 template (value) RslLinkId link_id,
1363 octetstring l3_info) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001364 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, true),
1365 msg_type := RSL_MT_DATA_IND,
1366 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001367 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1368 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
1369 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
Harald Welte643e2a62017-11-27 15:03:18 +01001370 }
1371 }
Harald Welte9abd1282018-02-19 19:18:17 +01001372 template RSL_Message tr_RSL_DATA_IND(template RslChannelNr chan_nr, template RslLinkId link_id,
1373 template octetstring l3_info := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001374 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, true),
Harald Welte9abd1282018-02-19 19:18:17 +01001375 msg_type := RSL_MT_DATA_IND,
1376 ies :={
1377 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1378 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
1379 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
1380 }
1381 }
Harald Welte643e2a62017-11-27 15:03:18 +01001382
1383 /* 8.3.3 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001384 template (value) RSL_Message ts_RSL_ERROR_IND(template (value) RslChannelNr chan_nr,
Harald Weltea7d81f12019-06-02 22:33:19 +02001385 template (value) RslLinkId link_id,
1386 template (value) octetstring rlm_cause) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001387 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1388 msg_type := RSL_MT_ERROR_IND,
1389 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001390 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1391 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
Harald Weltea7d81f12019-06-02 22:33:19 +02001392 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{rlm_cause := ts_RSL_LV(rlm_cause)})
Harald Welte643e2a62017-11-27 15:03:18 +01001393 }
1394 }
Harald Welte9abd1282018-02-19 19:18:17 +01001395 template RSL_Message tr_RSL_ERROR_IND(template RslChannelNr chan_nr, template RslLinkId link_id,
Harald Weltea7d81f12019-06-02 22:33:19 +02001396 template octetstring rlm_cause := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001397 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001398 msg_type := RSL_MT_ERROR_IND,
1399 ies :={
1400 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1401 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
Harald Weltea7d81f12019-06-02 22:33:19 +02001402 tr_RSL_IE(RSL_IE_Body:{rlm_cause := tr_RSL_LV(rlm_cause)})
Harald Welte9abd1282018-02-19 19:18:17 +01001403 }
1404 }
Harald Welte643e2a62017-11-27 15:03:18 +01001405
Harald Welteefa7d912018-04-18 23:22:15 +02001406 /* 8.3.4 BTS <- BSC */
1407 template (value) RSL_Message ts_RSL_EST_REQ(template (value) RslChannelNr chan_nr,
1408 template (value) RslLinkId link_id) := {
1409 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1410 msg_type := RSL_MT_EST_REQ,
1411 ies := {
1412 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1413 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
1414 }
1415 }
1416 template RSL_Message tr_RSL_EST_REQ(template RslChannelNr chan_nr, template RslLinkId link_id) := {
1417 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
1418 msg_type := RSL_MT_EST_REQ,
1419 ies := {
1420 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1421 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1422 }
1423 }
1424
1425 /* 8.3.5 BTS -> BSC */
1426 template (value) RSL_Message ts_RSL_EST_CONF(template (value) RslChannelNr chan_nr,
1427 template (value) RslLinkId link_id) := {
1428 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1429 msg_type := RSL_MT_EST_CONF,
1430 ies := {
1431 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1432 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
1433 }
1434 }
1435 template RSL_Message tr_RSL_EST_CONF(template RslChannelNr chan_nr, template RslLinkId link_id) := {
1436 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
1437 msg_type := RSL_MT_EST_CONF,
1438 ies := {
1439 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1440 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1441 }
1442 }
1443
Harald Welte643e2a62017-11-27 15:03:18 +01001444 /* 8.3.6 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001445 template (value) RSL_Message ts_RSL_EST_IND(template (value) RslChannelNr chan_nr,
1446 template (value) RslLinkId link_id,
1447 octetstring l3_info) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001448 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1449 msg_type := RSL_MT_EST_IND,
1450 ies := {
Harald Welte735dd072017-12-12 14:55:17 +01001451 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1452 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
1453 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
Harald Welte643e2a62017-11-27 15:03:18 +01001454 }
1455 }
Harald Welte9abd1282018-02-19 19:18:17 +01001456 template RSL_Message tr_RSL_EST_IND(template RslChannelNr chan_nr, template RslLinkId link_id,
1457 template octetstring l3_info := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001458 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001459 msg_type := RSL_MT_EST_IND,
1460 ies := {
1461 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1462 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
1463 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
1464 }
1465 }
Harald Welte0472ab42018-03-12 15:02:26 +01001466 template RSL_Message tr_RSL_EST_IND_NOL3(template RslChannelNr chan_nr, template RslLinkId link_id) :=
1467{
1468 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
1469 msg_type := RSL_MT_EST_IND,
1470 ies := {
1471 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1472 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1473 }
1474 }
1475
Harald Welte643e2a62017-11-27 15:03:18 +01001476
1477 /* 8.3.7 BSC -> BTS */
Harald Welteefa7d912018-04-18 23:22:15 +02001478 template (value) RSL_Message ts_RSL_REL_REQ(template (value) RslChannelNr chan_nr,
Harald Welte0472ab42018-03-12 15:02:26 +01001479 template (value) RslLinkId link_id,
1480 template (value) RSL_IE_ReleaseMode rel_mode := RSL_REL_MODE_NORMAL) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001481 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1482 msg_type := RSL_MT_REL_REQ,
1483 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001484 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
Harald Welte0472ab42018-03-12 15:02:26 +01001485 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
1486 t_RSL_IE(RSL_IE_RELEASE_MODE, RSL_IE_Body:{release_mode := rel_mode})
Harald Welte643e2a62017-11-27 15:03:18 +01001487 }
1488 }
Harald Weltee8a5ab12017-12-09 22:34:57 +01001489 template RSL_Message tr_RSL_REL_REQ(template RslChannelNr chan_nr,
Harald Welte0472ab42018-03-12 15:02:26 +01001490 template RslLinkId link_id,
1491 template RSL_IE_ReleaseMode rel_mode := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001492 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Weltee8a5ab12017-12-09 22:34:57 +01001493 msg_type := RSL_MT_REL_REQ,
1494 ies :={
1495 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1496 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
Harald Welte0472ab42018-03-12 15:02:26 +01001497 tr_RSL_IE(RSL_IE_Body:{release_mode := rel_mode})
Harald Weltee8a5ab12017-12-09 22:34:57 +01001498 }
1499 }
Harald Welte643e2a62017-11-27 15:03:18 +01001500
1501 /* 8.3.8 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001502 template (value) RSL_Message ts_RSL_REL_CONF(template (value) RslChannelNr chan_nr,
1503 template (value) RslLinkId link_id) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001504 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1505 msg_type := RSL_MT_REL_CONF,
1506 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001507 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1508 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
Harald Welte643e2a62017-11-27 15:03:18 +01001509 }
1510 }
Harald Welte9abd1282018-02-19 19:18:17 +01001511 template RSL_Message tr_RSL_REL_CONF(template RslChannelNr chan_nr, template RslLinkId link_id) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001512 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001513 msg_type := RSL_MT_REL_CONF,
1514 ies :={
1515 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1516 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1517 }
1518 }
Harald Welte643e2a62017-11-27 15:03:18 +01001519
1520 /* 8.3.9 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001521 template (value) RSL_Message ts_RSL_REL_IND(template (value) RslChannelNr chan_nr,
1522 template (value) RslLinkId link_id) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001523 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1524 msg_type := RSL_MT_REL_IND,
1525 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001526 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1527 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
Harald Welte643e2a62017-11-27 15:03:18 +01001528 }
1529 }
Harald Welte9abd1282018-02-19 19:18:17 +01001530 template RSL_Message tr_RSL_REL_IND(template RslChannelNr chan_nr, template RslLinkId link_id) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001531 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001532 msg_type := RSL_MT_REL_IND,
1533 ies :={
1534 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1535 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1536 }
1537 }
Harald Welte643e2a62017-11-27 15:03:18 +01001538
1539 /* 8.3.10 BSC -> BTS */
Harald Welteefa7d912018-04-18 23:22:15 +02001540 template (value) RSL_Message ts_RSL_UNITDATA_REQ(template (value) RslChannelNr chan_nr,
1541 template (value) RslLinkId link_id,
1542 octetstring l3_info)
Harald Welte643e2a62017-11-27 15:03:18 +01001543 modifies ts_RSL_DATA_REQ := {
1544 msg_type := RSL_MT_UNIT_DATA_REQ
1545 }
Harald Welte0472ab42018-03-12 15:02:26 +01001546 template RSL_Message tr_RSL_UNITDATA_REQ(template RslChannelNr chan_nr,
1547 template RslLinkId link_id,
Vadim Yanitskiy8f98d3f2018-10-03 17:58:10 +07001548 template octetstring l3_info := ?)
Harald Welte0472ab42018-03-12 15:02:26 +01001549 modifies tr_RSL_DATA_REQ := {
1550 msg_type := RSL_MT_UNIT_DATA_REQ
1551 }
1552
Harald Welte643e2a62017-11-27 15:03:18 +01001553
1554 /* 8.3.11 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001555 template (value) RSL_Message ts_RSL_UNITDATA_IND(template (value) RslChannelNr chan_nr,
1556 template (value) RslLinkId link_id,
1557 octetstring l3_info)
Harald Welte643e2a62017-11-27 15:03:18 +01001558 modifies ts_RSL_DATA_IND := {
1559 msg_type := RSL_MT_UNIT_DATA_IND
1560 }
Harald Welte0472ab42018-03-12 15:02:26 +01001561 template RSL_Message tr_RSL_UNITDATA_IND(template RslChannelNr chan_nr,
Vadim Yanitskiyfabe0f22018-10-03 17:51:47 +07001562 template RslLinkId link_id,
Vadim Yanitskiy8f98d3f2018-10-03 17:58:10 +07001563 template octetstring l3_info := ?)
Harald Welte0472ab42018-03-12 15:02:26 +01001564 modifies tr_RSL_DATA_IND := {
1565 msg_type := RSL_MT_UNIT_DATA_IND
1566 }
1567
1568
Harald Welte643e2a62017-11-27 15:03:18 +01001569
1570
1571 /* DEDICATED CANNEL MANAGEMENT MESSAGES */
1572
1573 /* 8.4.1 BSC -> BTS */
Harald Welteefa7d912018-04-18 23:22:15 +02001574 template (value) RSL_Message ts_RSL_CHAN_ACT(template (value) RslChannelNr chan_nr,
Harald Welte921f9e02019-05-19 22:27:11 +02001575 template (value) RSL_IE_ChannelMode mode,
1576 template (value) RSL_IE_ActivationType at := t_RSL_IE_ActType_IA) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001577 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1578 msg_type := RSL_MT_CHAN_ACTIV,
1579 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001580 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
Harald Welte921f9e02019-05-19 22:27:11 +02001581 t_RSL_IE(RSL_IE_ACT_TYPE, RSL_IE_Body:{act_type := at}),
Harald Welte735dd072017-12-12 14:55:17 +01001582 t_RSL_IE(RSL_IE_CHAN_MODE, RSL_IE_Body:{chan_mode := mode})
Harald Welte643e2a62017-11-27 15:03:18 +01001583 /* lots of optional IEs */
1584 }
1585 }
Harald Welte94e0c342018-04-07 11:33:23 +02001586 template RSL_Message tr_RSL_CHAN_ACT(template RslChannelNr chan_nr,
Harald Welte921f9e02019-05-19 22:27:11 +02001587 template RSL_IE_ChannelMode mode,
1588 template (value) RSL_IE_ActivationType at := t_RSL_IE_ActType_IA) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001589 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte94e0c342018-04-07 11:33:23 +02001590 msg_type := RSL_MT_CHAN_ACTIV,
1591 ies :={
1592 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
Harald Welte921f9e02019-05-19 22:27:11 +02001593 tr_RSL_IE(RSL_IE_Body:{act_type := at}),
Harald Welte94e0c342018-04-07 11:33:23 +02001594 tr_RSL_IE(RSL_IE_Body:{chan_mode := mode}),
1595 /* lots of optional IEs */
1596 *
1597 }
1598 }
Vadim Yanitskiy58b16532021-10-09 20:27:39 +06001599
1600 template (value) RSL_Message
1601 ts_RSL_CHAN_ACT_PDCH(template (value) RslChannelNr chan_nr) := {
1602 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1603 msg_type := RSL_MT_CHAN_ACTIV,
1604 ies :={
1605 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1606 t_RSL_IE(RSL_IE_ACT_TYPE, RSL_IE_Body:{act_type := c_RSL_IE_ActType_PDCH})
1607 }
1608 }
1609 template RSL_Message
1610 tr_RSL_CHAN_ACT_PDCH(template (present) RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001611 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte94e0c342018-04-07 11:33:23 +02001612 msg_type := RSL_MT_CHAN_ACTIV,
1613 ies :={
1614 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
Vadim Yanitskiy58b16532021-10-09 20:27:39 +06001615 tr_RSL_IE(RSL_IE_Body:{act_type := c_RSL_IE_ActType_PDCH}),
Harald Welte94e0c342018-04-07 11:33:23 +02001616 /* lots of optional IEs */
1617 *
1618 }
1619 }
1620
Harald Welte643e2a62017-11-27 15:03:18 +01001621
1622 /* 8.4.2 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001623 template (value) RSL_Message ts_RSL_CHAN_ACT_ACK(template (value) RslChannelNr chan_nr,
1624 GsmFrameNumber fn) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001625 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1626 msg_type := RSL_MT_CHAN_ACTIV_ACK,
1627 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001628 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1629 t_RSL_IE(RSL_IE_FRAME_NUMBER, RSL_IE_Body:{frame_nr := ts_RSL_IE_FrameNumber(fn)})
Harald Welte643e2a62017-11-27 15:03:18 +01001630 }
1631 }
Harald Welte9abd1282018-02-19 19:18:17 +01001632 template RSL_Message tr_RSL_CHAN_ACT_ACK(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001633 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001634 msg_type := RSL_MT_CHAN_ACTIV_ACK,
1635 ies := {
1636 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1637 tr_RSL_IE(RSL_IE_Body:{frame_nr := ?})
1638 }
1639 }
Harald Welte643e2a62017-11-27 15:03:18 +01001640
1641 /* 8.4.3 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001642 template (value) RSL_Message ts_RSL_CHAN_ACT_NACK(template (value) RslChannelNr chan_nr,
1643 RSL_Cause cause) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001644 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1645 msg_type := RSL_MT_CHAN_ACTIV_NACK,
1646 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001647 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1648 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
Harald Welte643e2a62017-11-27 15:03:18 +01001649 }
1650 }
Harald Welte9abd1282018-02-19 19:18:17 +01001651 template RSL_Message tr_RSL_CHAN_ACT_NACK(template RslChannelNr chan_nr,
1652 template RSL_Cause cause := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001653 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001654 msg_type := RSL_MT_CHAN_ACTIV_NACK,
1655 ies := {
1656 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1657 tr_RSL_IE(RSL_IE_Body:{cause := ?})
1658 }
1659 }
Harald Welte643e2a62017-11-27 15:03:18 +01001660
1661 /* 8.4.4 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001662 template (value) RSL_Message ts_RSL_CONN_FAIL_IND(RslChannelNr chan_nr, RSL_Cause cause) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001663 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1664 msg_type := RSL_MT_CONN_FAIL,
1665 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001666 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1667 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
Harald Welte643e2a62017-11-27 15:03:18 +01001668 }
1669 }
Harald Welte9abd1282018-02-19 19:18:17 +01001670 template RSL_Message tr_RSL_CONN_FAIL_IND(template RslChannelNr chan_nr,
1671 template RSL_Cause cause := ?) := {
1672 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1673 msg_type := RSL_MT_CONN_FAIL,
1674 ies :={
1675 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1676 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
1677 }
1678 }
Harald Welte643e2a62017-11-27 15:03:18 +01001679
Harald Weltee8a5ab12017-12-09 22:34:57 +01001680 /* 8.4.5 BSC -> BTS */
1681 template RSL_Message tr_RSL_DEACT_SACCH(template RslChannelNr chan_nr) := {
1682 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1683 msg_type := RSL_MT_DEACTIVATE_SACCH,
1684 ies := {
1685 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
1686 }
1687 }
Harald Welteefa7d912018-04-18 23:22:15 +02001688 template (value) RSL_Message ts_RSL_DEACT_SACCH(template (value) RslChannelNr chan_nr) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001689 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1690 msg_type := RSL_MT_DEACTIVATE_SACCH,
1691 ies := {
1692 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1693 }
1694 }
1695
Harald Weltee8a5ab12017-12-09 22:34:57 +01001696
Harald Welte73cd2712017-12-17 00:44:52 +01001697 /* 8.4.6 BSC ->BTS */
1698 template RSL_Message tr_RSL_ENCR_CMD(template RslChannelNr chan_nr,
1699 template RslLinkId link_id := ?,
Harald Weltee613f962018-04-18 22:38:16 +02001700 template RSL_AlgId alg := ?,
Harald Welte73cd2712017-12-17 00:44:52 +01001701 template octetstring key := ?,
1702 template octetstring l3_info := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001703 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte73cd2712017-12-17 00:44:52 +01001704 msg_type := RSL_MT_ENCR_CMD,
1705 ies := {
1706 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1707 tr_RSL_IE(RSL_IE_Body:{encr_info := tr_RSL_IE_EncrInfo(alg, key)}),
1708 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
1709 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
1710 }
1711 }
Harald Welteefa7d912018-04-18 23:22:15 +02001712 template (value) RSL_Message ts_RSL_ENCR_CMD(template (value) RslChannelNr chan_nr,
1713 template (value) RslLinkId link_id,
Harald Weltee613f962018-04-18 22:38:16 +02001714 template (value) RSL_AlgId alg, octetstring key,
Harald Welteefa7d912018-04-18 23:22:15 +02001715 octetstring l3_info) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001716 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1717 msg_type := RSL_MT_ENCR_CMD,
1718 ies := {
1719 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
Harald Welteefa7d912018-04-18 23:22:15 +02001720 t_RSL_IE(RSL_IE_ENCR_INFO, RSL_IE_Body:{encr_info := ts_RSL_IE_EncrInfo(alg, key)}),
Harald Welte9abd1282018-02-19 19:18:17 +01001721 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
Harald Welteefa7d912018-04-18 23:22:15 +02001722 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
Harald Welte9abd1282018-02-19 19:18:17 +01001723 }
1724 }
Harald Welte73cd2712017-12-17 00:44:52 +01001725
Harald Welte2691adf2018-02-22 17:32:39 +01001726 template RSL_Message tr_RSL_MEAS_RES(template RslChannelNr chan_nr,
1727 template uint8_t meas_res_nr := ?,
1728 template RSL_IE_UplinkMeas ul_meas := ?,
1729 template RSL_IE_BS_Power bs_power := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001730 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte2691adf2018-02-22 17:32:39 +01001731 msg_type := RSL_MT_MEAS_RES,
1732 ies := {
1733 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1734 tr_RSL_IE(RSL_IE_Body:{meas_res_nr := meas_res_nr}),
1735 tr_RSL_IE(RSL_IE_Body:{uplink_meas := ul_meas}),
1736 tr_RSL_IE(RSL_IE_Body:{bs_power := bs_power}),
1737 *
1738 }
1739 }
1740
Vadim Yanitskiy7c29c4e2022-06-18 03:07:50 +07001741 /* Templates for a measurement report that lacks the measurement report
Philipp Maierdd841d32019-12-17 14:44:54 +01001742 * from the MS (l1_info, l3_info and ms timing offset */
Vadim Yanitskiy7c29c4e2022-06-18 03:07:50 +07001743 template (value) RSL_Message
1744 ts_RSL_MEAS_RES_EMPTY(template (value) RslChannelNr chan_nr,
1745 template (value) uint8_t meas_res_nr,
1746 template (value) RSL_IE_UplinkMeas ul_meas,
1747 template (value) RSL_IE_BS_Power bs_power) := {
1748 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1749 msg_type := RSL_MT_MEAS_RES,
1750 ies := {
1751 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1752 t_RSL_IE(RSL_IE_MEAS_RES_NR, RSL_IE_Body:{meas_res_nr := meas_res_nr}),
1753 t_RSL_IE(RSL_IE_UPLINK_MEAS, RSL_IE_Body:{uplink_meas := ul_meas}),
1754 t_RSL_IE(RSL_IE_BS_POWER, RSL_IE_Body:{bs_power := bs_power})
1755 }
1756 }
1757 template RSL_Message
1758 tr_RSL_MEAS_RES_EMPTY(template (present) RslChannelNr chan_nr,
1759 template uint8_t meas_res_nr := ?,
1760 template RSL_IE_UplinkMeas ul_meas := ?,
1761 template RSL_IE_BS_Power bs_power := ?) := {
Philipp Maierdd841d32019-12-17 14:44:54 +01001762 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1763 msg_type := RSL_MT_MEAS_RES,
1764 ies := {
1765 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1766 tr_RSL_IE(RSL_IE_Body:{meas_res_nr := meas_res_nr}),
1767 tr_RSL_IE(RSL_IE_Body:{uplink_meas := ul_meas}),
1768 tr_RSL_IE(RSL_IE_Body:{bs_power := bs_power})
1769 }
1770 }
1771
Harald Welte39b47be2018-02-23 18:58:48 +01001772 /* Osmocom specific template, require lots of optional fields to be present */
1773 template RSL_Message tr_RSL_MEAS_RES_OSMO(template RslChannelNr chan_nr,
1774 template uint8_t meas_res_nr := ?,
1775 template RSL_IE_UplinkMeas ul_meas := ?,
1776 template RSL_IE_BS_Power bs_power := ?,
1777 template RSL_IE_L1Info l1_info := ?,
1778 template octetstring l3_info := ?,
1779 template uint8_t ms_to := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001780 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte39b47be2018-02-23 18:58:48 +01001781 msg_type := RSL_MT_MEAS_RES,
1782 ies := {
1783 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1784 tr_RSL_IE(RSL_IE_Body:{meas_res_nr := meas_res_nr}),
1785 tr_RSL_IE(RSL_IE_Body:{uplink_meas := ul_meas}),
1786 tr_RSL_IE(RSL_IE_Body:{bs_power := bs_power}),
1787 tr_RSL_IE(RSL_IE_Body:{l1_info := l1_info}),
1788 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)}),
1789 tr_RSL_IE(RSL_IE_Body:{ms_timing_offset := ms_to})
1790 }
1791 }
1792
Neels Hofmeyrafe2ea52021-11-24 15:16:12 +01001793 template (value) RSL_Message ts_RSL_MEAS_RES(template (value) RslChannelNr chan_nr,
1794 uint8_t meas_res_nr,
1795 template (value) RSL_IE_UplinkMeas ul_meas,
1796 template (value) RSL_IE_BS_Power bs_power,
1797 template (value) RSL_IE_L1Info l1_info,
1798 octetstring l3_info,
1799 uint8_t ms_to) := {
1800 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1801 msg_type := RSL_MT_MEAS_RES,
1802 ies := {
1803 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1804 t_RSL_IE(RSL_IE_MEAS_RES_NR, RSL_IE_Body:{meas_res_nr := meas_res_nr}),
1805 t_RSL_IE(RSL_IE_UPLINK_MEAS, RSL_IE_Body:{uplink_meas := ul_meas}),
1806 t_RSL_IE(RSL_IE_BS_POWER, RSL_IE_Body:{bs_power := bs_power}),
1807 t_RSL_IE(RSL_IE_L1_INFO, RSL_IE_Body:{l1_info := l1_info}),
1808 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)}),
1809 t_RSL_IE(RSL_IE_MS_TIMING_OFFSET, RSL_IE_Body:{ms_timing_offset := ms_to})
1810 }
1811 }
1812
Eric Wildf1827a72019-05-28 17:37:35 +02001813 /* 8.4.9 BSC -> BTS */
1814 template (value) RSL_Message ts_RSL_MODE_MODIFY_REQ(template (value) RslChannelNr chan_nr,
1815 template (value) RSL_IE_ChannelMode mode) := {
1816 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1817 msg_type := RSL_MT_MODE_MODIFY_REQ,
1818 ies :={
1819 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1820 t_RSL_IE(RSL_IE_CHAN_MODE, RSL_IE_Body:{chan_mode := mode})
1821 /* lots of optional IEs */
1822 }
1823 }
1824 template RSL_Message tr_RSL_MODE_MODIFY_REQ(template RslChannelNr chan_nr,
1825 template RSL_IE_ChannelMode mode) := {
1826 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1827 msg_type := RSL_MT_MODE_MODIFY_REQ,
1828 ies :={
1829 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1830 tr_RSL_IE(RSL_IE_Body:{chan_mode := mode}),
1831 /* lots of optional IEs */
1832 *
1833 }
1834 }
Neels Hofmeyr9f3e6ac2021-04-08 23:09:24 +02001835
1836 template RSL_Message tr_RSL_MODE_MODIFY_REQ_with_OSMO_TSC(template RslChannelNr chan_nr,
1837 template RSL_IE_ChannelMode mode,
1838 template uint8_t tsc_set := ?,
1839 template uint8_t tsc := ?) := {
1840 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1841 msg_type := RSL_MT_MODE_MODIFY_REQ,
1842 ies := {
1843 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1844 tr_RSL_IE(RSL_IE_Body:{chan_mode := mode}),
1845 tr_RSL_IE(RSL_IE_Body:{osmo_training_sequence := {
1846 len := ?,
1847 tsc_set := tsc_set,
1848 tsc := tsc
1849 }
1850 })
1851 }
1852 };
Pau Espin Pedrol85393122022-09-02 17:56:25 +02001853
Harald Welte7794d5b2017-12-16 23:00:20 +01001854 /* 8.4.10 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001855 template (value) RSL_Message ts_RSL_MODE_MODIFY_ACK(template (value) RslChannelNr chan_nr) := {
Harald Welte7794d5b2017-12-16 23:00:20 +01001856 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1857 msg_type := RSL_MT_MODE_MODIFY_ACK,
1858 ies := {
1859 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1860 }
1861 }
Harald Welte9abd1282018-02-19 19:18:17 +01001862 template RSL_Message tr_RSL_MODE_MODIFY_ACK(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001863 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001864 msg_type := RSL_MT_MODE_MODIFY_ACK,
1865 ies := {
1866 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
1867 }
1868 }
Harald Welte7794d5b2017-12-16 23:00:20 +01001869
Harald Welte643e2a62017-11-27 15:03:18 +01001870 /* 8.4.11 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001871 template (value) RSL_Message ts_RSL_MODE_MODIFY_NACK(template (value) RslChannelNr chan_nr,
1872 RSL_Cause cause) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001873 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1874 msg_type := RSL_MT_MODE_MODIFY_NACK,
1875 ies := {
1876 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1877 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
1878 }
Harald Welte643e2a62017-11-27 15:03:18 +01001879 }
Harald Welte9abd1282018-02-19 19:18:17 +01001880 template RSL_Message tr_RSL_MODE_MODIFY_NACK(template RslChannelNr chan_nr,
1881 template RSL_Cause cause) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001882 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001883 msg_type := RSL_MT_MODE_MODIFY_NACK,
1884 ies := {
1885 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1886 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
1887 }
1888 }
1889
Harald Welte643e2a62017-11-27 15:03:18 +01001890
Harald Welte6a8199d2018-01-29 21:58:53 +01001891 /* 8.4.14: BTS <- BSC */
1892 template RSL_Message tr_RSL_RF_CHAN_REL(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001893 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte6a8199d2018-01-29 21:58:53 +01001894 msg_type := RSL_MT_RF_CHAN_REL,
1895 ies := {
1896 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
1897 }
1898 }
Harald Welteefa7d912018-04-18 23:22:15 +02001899 template (value) RSL_Message ts_RSL_RF_CHAN_REL(template (value) RslChannelNr chan_nr) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001900 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1901 msg_type := RSL_MT_RF_CHAN_REL,
1902 ies := {
1903 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1904 }
1905 }
Harald Welte6a8199d2018-01-29 21:58:53 +01001906
Philipp Maier4d1e9c92018-12-20 11:11:56 +01001907 /* 8.4.15: BTS <- BSC */
1908 template (value) RSL_Message ts_RSL_MS_PWR_CTRL(template (value) RslChannelNr chan_nr,
1909 template (value) RSL_IE_MS_Power ms_power) := {
1910 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1911 msg_type := RSL_MT_MS_POWER_CONTROL,
1912 ies := {
1913 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1914 t_RSL_IE(RSL_IE_MS_POWER, RSL_IE_Body:{ms_power := ms_power})
1915 /* One optional IE: MS POWER PARAMETERS */
1916 }
1917 }
1918
Eric Wild61edb7e2019-06-03 12:38:31 +02001919 template (value) RSL_Message ts_RSL_MS_PWR_CTRL_with_pp(template (value) RslChannelNr chan_nr,
1920 integer pwr_level) := {
1921 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1922 msg_type := RSL_MT_MS_POWER_CONTROL,
1923 ies := {
1924 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1925 t_RSL_IE(RSL_IE_MS_POWER, RSL_IE_Body:{ms_power := ts_RSL_IE_MS_Power(pwr_level)}),
1926 t_RSL_IE(RSL_IE_MS_POWER_PARAM, RSL_IE_Body:{ms_power_params :=
1927 ts_RSL_IE_MS_Power_Parameters(''O)})
1928 }
1929 }
1930
Eric Wildae8f2622019-06-18 17:05:11 +02001931 /* 8.4.16: BTS <- BSC */
1932 template (value) RSL_Message ts_RSL_BS_PWR_CTRL(template (value) RslChannelNr chan_nr,
1933 template (value) RSL_IE_BS_Power bs_power) := {
1934 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1935 msg_type := RSL_MT_BS_POWER_CONTROL,
1936 ies := {
1937 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1938 t_RSL_IE(RSL_IE_BS_POWER, RSL_IE_Body:{bs_power := bs_power})
1939 /* One optional IE: BS POWER PARAMETERS */
1940 }
1941 }
Vadim Yanitskiy2a5a1ef2021-06-30 00:51:48 +02001942 template RSL_Message tr_RSL_BS_PWR_CTRL(template (present) RslChannelNr chan_nr,
1943 template (present) RSL_IE_BS_Power bs_power) := {
1944 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1945 msg_type := RSL_MT_BS_POWER_CONTROL,
1946 ies := {
1947 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1948 tr_RSL_IE(RSL_IE_Body:{bs_power := bs_power})
1949 /* One optional IE: BS POWER PARAMETERS */
1950 }
1951 }
Eric Wildae8f2622019-06-18 17:05:11 +02001952
Harald Welte4a267362017-12-09 17:49:32 +01001953 /* 8.4.19 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001954 template (value) RSL_Message ts_RSL_RF_CHAN_REL_ACK(template (value) RslChannelNr chan_nr) :=
Harald Welte4a267362017-12-09 17:49:32 +01001955 ts_RSL_MsgDiscType(ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1956 RSL_MT_RF_CHAN_REL_ACK,
Harald Welte735dd072017-12-12 14:55:17 +01001957 { t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}) });
Harald Welte4a267362017-12-09 17:49:32 +01001958
Harald Welte9abd1282018-02-19 19:18:17 +01001959 template RSL_Message tr_RSL_RF_CHAN_REL_ACK(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001960 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001961 msg_type := RSL_MT_RF_CHAN_REL_ACK,
1962 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001963 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
Harald Welte9abd1282018-02-19 19:18:17 +01001964 }
1965 }
1966
Harald Welteea17b912018-03-11 22:29:31 +01001967 /* 8.6.20 BTS <- BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001968 template (value) RSL_Message ts_RSL_SACCH_INF_MOD(template (value) RslChannelNr chan_nr,
1969 RSL_IE_SysinfoType si_type,
1970 octetstring l3_info) := {
Harald Welteea17b912018-03-11 22:29:31 +01001971 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1972 msg_type := RSL_MT_SACCH_INFO_MODIFY,
1973 ies := {
1974 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1975 t_RSL_IE(RSL_IE_SYSINFO_TYPE, RSL_IE_Body:{sysinfo_type := si_type}),
1976 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
1977 }
1978 }
1979
Neels Hofmeyr378a49c2018-06-15 22:18:43 +02001980 /* 8.4.7 BTS -> BSC */
1981 template (value) RSL_Message ts_RSL_HANDO_DET(template (value) RslChannelNr chan_nr) := {
1982 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1983 msg_type := RSL_MT_HANDO_DET,
1984 ies := {
1985 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1986 }
1987 }
Vadim Yanitskiy7c2c10c2019-05-31 20:42:01 +07001988 template RSL_Message tr_RSL_HANDO_DET(template RslChannelNr chan_nr,
1989 template uint8_t acc_delay := ?) := {
1990 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1991 msg_type := RSL_MT_HANDO_DET,
1992 ies := {
1993 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1994 tr_RSL_IE(RSL_IE_Body:{access_delay := acc_delay})
1995 }
1996 }
Neels Hofmeyr378a49c2018-06-15 22:18:43 +02001997
Harald Welteea17b912018-03-11 22:29:31 +01001998
Harald Welte643e2a62017-11-27 15:03:18 +01001999 /* COMMON CHANNEL MANAGEMENT MESSAGES */
2000
Harald Welte874c2232018-02-24 04:52:43 +01002001 /* 8.5.1 BTS <- BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02002002 template (value) RSL_Message ts_RSL_BCCH_INFO(RSL_IE_SysinfoType si_type,
2003 octetstring full_bcch_info) := {
Harald Welte874c2232018-02-24 04:52:43 +01002004 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2005 msg_type := RSL_MT_BCCH_INFO,
2006 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02002007 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_BCCH(0)}),
Harald Welte874c2232018-02-24 04:52:43 +01002008 t_RSL_IE(RSL_IE_SYSINFO_TYPE, RSL_IE_Body:{sysinfo_type := si_type}),
2009 t_RSL_IE(RSL_IE_FULL_BCCH_INFO, RSL_IE_Body:{other := ts_RSL_LV(full_bcch_info)})
2010 }
2011 }
Harald Welte09538f82019-08-01 09:50:25 +02002012 template RSL_Message tr_RSL_NO_BCCH_INFO(template RSL_IE_SysinfoType si_type := ?) := {
2013 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2014 msg_type := RSL_MT_BCCH_INFO,
2015 ies := {
2016 tr_RSL_IE(RSL_IE_Body:{chan_nr := ts_RslChanNr_BCCH(0)}),
2017 tr_RSL_IE(RSL_IE_Body:{sysinfo_type := si_type})
2018 }
2019 }
2020 template RSL_Message tr_RSL_BCCH_INFO(template RSL_IE_SysinfoType si_type := ?,
2021 template octetstring full_bcch_info := ?) := {
2022 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2023 msg_type := RSL_MT_BCCH_INFO,
2024 ies := {
2025 tr_RSL_IE(RSL_IE_Body:{chan_nr := ts_RslChanNr_BCCH(0)}),
2026 tr_RSL_IE(RSL_IE_Body:{sysinfo_type := si_type}),
2027 tr_RSL_IE(RSL_IE_Body:{other := tr_RSL_LV(full_bcch_info)}),
2028 *
2029 }
2030 }
Harald Welte874c2232018-02-24 04:52:43 +01002031
Harald Welte7ae93142017-12-07 17:56:15 +01002032 /* 8.5.2 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02002033 template (value) RSL_Message ts_RSL_RACH_LOAD_IND(uint16_t slot_ct, uint16_t busy_ct,
2034 uint16_t acc_ct) := {
Harald Welte7ae93142017-12-07 17:56:15 +01002035 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2036 msg_type := RSL_MT_CCCH_LOAD_IND,
2037 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02002038 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_RACH(0)}),
Harald Welte735dd072017-12-12 14:55:17 +01002039 t_RSL_IE(RSL_IE_RACH_LOAD, RSL_IE_Body:{rach_load := ts_RSL_IE_RachLoad(slot_ct, busy_ct, acc_ct)})
Harald Welte7ae93142017-12-07 17:56:15 +01002040 }
2041 }
Harald Welte68e495b2018-02-25 00:05:57 +01002042 template RSL_Message tr_RSL_RACH_LOAD_IND(template uint16_t slot_ct := ?,
2043 template uint16_t busy_ct := ?,
Harald Welte09538f82019-08-01 09:50:25 +02002044 template uint16_t acc_ct := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002045 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Welte68e495b2018-02-25 00:05:57 +01002046 msg_type := RSL_MT_CCCH_LOAD_IND,
2047 ies := {
2048 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_RACH(0)}),
2049 tr_RSL_IE(RSL_IE_Body:{rach_load := tr_RSL_IE_RachLoad(slot_ct, busy_ct, acc_ct)})
2050 }
2051 }
2052
Harald Welteefa7d912018-04-18 23:22:15 +02002053 template (value) RSL_Message ts_RSL_PAGING_LOAD_IND(uint16_t buffer_space) := {
Harald Welte7ae93142017-12-07 17:56:15 +01002054 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2055 msg_type := RSL_MT_CCCH_LOAD_IND,
2056 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02002057 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_PCH_AGCH(0)}),
Harald Welte735dd072017-12-12 14:55:17 +01002058 t_RSL_IE(RSL_IE_PAGING_LOAD, RSL_IE_Body:{paging_load := buffer_space})
Harald Welte7ae93142017-12-07 17:56:15 +01002059 }
2060 }
Harald Welte68e495b2018-02-25 00:05:57 +01002061 template RSL_Message tr_RSL_PAGING_LOAD_IND(template uint16_t buffer_space := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002062 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Welte68e495b2018-02-25 00:05:57 +01002063 msg_type := RSL_MT_CCCH_LOAD_IND,
2064 ies := {
2065 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(0)}),
2066 tr_RSL_IE(RSL_IE_Body:{paging_load := buffer_space})
2067 }
2068 }
2069
Harald Welte7ae93142017-12-07 17:56:15 +01002070
Harald Welte643e2a62017-11-27 15:03:18 +01002071 /* 8.5.3 BTS -> BSC */
Vadim Yanitskiyab448a52019-05-31 20:24:03 +07002072 template (value) RSL_Message ts_RSL_CHAN_RQD(OCT1 ra, GsmFrameNumber fn,
2073 template (value) RslChannelNr chan_nr := ts_RslChanNr_RACH(0),
2074 uint8_t acc_del := 0) := {
Harald Welte643e2a62017-11-27 15:03:18 +01002075 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2076 msg_type := RSL_MT_CHAN_RQD,
2077 ies := {
Vadim Yanitskiyab448a52019-05-31 20:24:03 +07002078 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2079 /* TODO: we may need to have optional RSL_IE_LINK_IDENT IE here */
Harald Welte735dd072017-12-12 14:55:17 +01002080 t_RSL_IE(RSL_IE_REQ_REFERENCE, RSL_IE_Body:{req_ref := ts_RSL_IE_ReqRef(ra, fn)}),
2081 t_RSL_IE(RSL_IE_ACCESS_DELAY, RSL_IE_Body:{access_delay := acc_del})
Harald Welte643e2a62017-11-27 15:03:18 +01002082 }
2083 }
Harald Welte9abd1282018-02-19 19:18:17 +01002084 template RSL_Message tr_RSL_CHAN_RQD(template OCT1 ra, template GsmFrameNumber fn := ?,
Vadim Yanitskiyab448a52019-05-31 20:24:03 +07002085 template RslChannelNr chan_nr := ts_RslChanNr_RACH(0),
2086 template uint8_t acc_del := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002087 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01002088 msg_type := RSL_MT_CHAN_RQD,
2089 ies := {
Vadim Yanitskiyab448a52019-05-31 20:24:03 +07002090 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2091 /* TODO: we may need to have optional RSL_IE_LINK_IDENT IE here */
Harald Welte9abd1282018-02-19 19:18:17 +01002092 tr_RSL_IE(RSL_IE_Body:{req_ref := tr_RSL_IE_ReqRef(ra, fn)}),
2093 tr_RSL_IE(RSL_IE_Body:{access_delay := acc_del})
2094 }
2095 }
Harald Welte643e2a62017-11-27 15:03:18 +01002096
2097 /* 8.5.4 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02002098 template (value) RSL_Message ts_DELETE_IND(template (value) RslChannelNr chan_nr,
2099 octetstring imm_ass) := {
Harald Welte643e2a62017-11-27 15:03:18 +01002100 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2101 msg_type := RSL_MT_DELETE_IND,
2102 ies := {
Harald Welte735dd072017-12-12 14:55:17 +01002103 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2104 t_RSL_IE(RSL_IE_FULL_IMM_ASS_INFO, RSL_IE_Body:{full_imm_ass_info := ts_RSL_LV(imm_ass)})
Harald Welte643e2a62017-11-27 15:03:18 +01002105 }
2106 }
Harald Weltee8d750e2018-06-10 21:41:35 +02002107 template RSL_Message tr_RSL_DELETE_IND(template octetstring imm_ass := ?, template uint3_t tn) := {
2108 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2109 msg_type := RSL_MT_DELETE_IND,
2110 ies := {
2111 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(tn)}),
2112 tr_RSL_IE(RSL_IE_Body:{full_imm_ass_info := tr_RSL_LV(imm_ass)}),
2113 *
2114 }
2115 }
Harald Welte643e2a62017-11-27 15:03:18 +01002116
Harald Weltec2877752017-12-07 17:54:35 +01002117 /* 8.5.5 BSC -> BTS */
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +07002118 template RSL_Message tr_RSL_PAGING_CMD(template MobileIdentityV mi, template uint3_t tn := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002119 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Weltec2877752017-12-07 17:54:35 +01002120 msg_type := RSL_MT_PAGING_CMD,
2121 ies := {
2122 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(tn)}),
2123 tr_RSL_IE(RSL_IE_Body:{paging_group := ?}),
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +07002124 tr_RSL_IE(RSL_IE_Body:{ms_identity := tr_MI_LV(mi)}),
Harald Weltec2877752017-12-07 17:54:35 +01002125 * /* opt: channel needed, eMLPP prio */
2126 }
2127 }
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +07002128 template (value) RSL_Message ts_RSL_PAGING_CMD(MobileIdentityV mi, uint8_t pg, uint3_t tn := 0) := {
Harald Welte9abd1282018-02-19 19:18:17 +01002129 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2130 msg_type := RSL_MT_PAGING_CMD,
2131 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02002132 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_PCH_AGCH(tn)}),
Harald Welte9abd1282018-02-19 19:18:17 +01002133 t_RSL_IE(RSL_IE_PAGING_GROUP, RSL_IE_Body:{paging_group := pg}),
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +07002134 t_RSL_IE(RSL_IE_MS_IDENTITY, RSL_IE_Body:{ms_identity := ts_MI_LV(mi)})
Harald Welte9abd1282018-02-19 19:18:17 +01002135 }
2136 }
Harald Weltec2877752017-12-07 17:54:35 +01002137
2138 /* 8.5.6 BSC -> BTS */
2139 template RSL_Message tr_RSL_IMM_ASSIGN(template uint3_t tn := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002140 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Weltec2877752017-12-07 17:54:35 +01002141 msg_type := RSL_MT_IMMEDIATE_ASSIGN_CMD,
2142 ies := {
2143 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(tn)}),
2144 tr_RSL_IE(RSL_IE_Body:{full_imm_ass_info := ?})
2145 }
2146 }
Harald Welteefa7d912018-04-18 23:22:15 +02002147 template (value) RSL_Message ts_RSL_IMM_ASSIGN(octetstring f_ass_inf, uint3_t tn := 0) := {
Harald Welte9abd1282018-02-19 19:18:17 +01002148 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2149 msg_type := RSL_MT_IMMEDIATE_ASSIGN_CMD,
2150 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02002151 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_PCH_AGCH(tn)}),
Harald Welte9abd1282018-02-19 19:18:17 +01002152 t_RSL_IE(RSL_IE_FULL_IMM_ASS_INFO, RSL_IE_Body:{full_imm_ass_info := ts_RSL_LV(f_ass_inf)})
2153 }
2154 }
Harald Weltec2877752017-12-07 17:54:35 +01002155
Harald Weltecc373202018-09-10 10:28:21 +02002156 /* 8.5.8 BTS <- BSC SMS BROADCAST COMMAND */
2157 template RSL_Message tr_RSL_SMSCB_CMD(template RSL_IE_CbCommandType cb_cmd := ?,
2158 template octetstring msg := ?,
2159 template RslChannelNr chan_nr := ?) := {
2160 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2161 msg_type := RSL_MT_SMS_BC_CMD,
2162 ies := {
2163 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2164 tr_RSL_IE(RSL_IE_Body:{cb_cmd_type := cb_cmd}),
2165 tr_RSL_IE(RSL_IE_Body:{smscb_message := tr_RSL_LV(msg)}),
2166 *
2167 }
2168 }
2169 template (value) RSL_Message ts_RSL_SMSCB_CMD(template (value) RSL_IE_CbCommandType cb_cmd,
2170 template (value) octetstring msg,
2171 template (value) RslChannelNr chan_nr :=
2172 ts_RslChanNr_SDCCH4(0, 2)) := {
2173 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2174 msg_type := RSL_MT_SMS_BC_CMD,
2175 ies := {
2176 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2177 t_RSL_IE(RSL_IE_CB_CMD_TYPE, RSL_IE_Body:{cb_cmd_type := cb_cmd}),
2178 t_RSL_IE(RSL_IE_SMSCB_MSG, RSL_IE_Body:{smscb_message := ts_RSL_LV(msg)})
2179 /* optional channel type for extended CBCH */
2180 }
2181 }
2182
Harald Welte4a129f82019-05-21 16:35:22 +02002183 /* 8.5.9 BTS -> BSC CBCH LOAD INDICATION */
2184 template RSL_Message tr_RSL_CBCH_LOAD_IND_BASIC(template boolean overflow := ?,
2185 template uint4_t slot_count := ?,
2186 template RslChannelNr chan_nr := ?) := {
2187 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2188 msg_type := RSL_MT_CBCH_LOAD_IND,
2189 ies := {
2190 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2191 tr_RSL_IE(RSL_IE_Body:{cbch_load_info := tr_CbchLoadInfo(overflow, slot_count)})
2192 }
2193 }
2194 template (value) RSL_Message ts_RSL_CBCH_LOAD_IND_BASIC(boolean overflow, uint4_t slot_count,
2195 template (value) RslChannelNr chan_nr :=
2196 ts_RslChanNr_SDCCH4(0, 2)) := {
2197 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2198 msg_type := RSL_MT_CBCH_LOAD_IND,
2199 ies := {
2200 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2201 t_RSL_IE(RSL_IE_CBCH_LOAD_INFO, RSL_IE_Body:{cbch_load_info := ts_CbchLoadInfo(overflow, slot_count)})
2202 }
2203 }
2204 template RSL_Message tr_RSL_CBCH_LOAD_IND_EXTD(template boolean overflow := ?,
2205 template uint4_t slot_count := ?,
2206 template RslChannelNr chan_nr := ?) := {
2207 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2208 msg_type := RSL_MT_CBCH_LOAD_IND,
2209 ies := {
2210 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2211 tr_RSL_IE(RSL_IE_Body:{cbch_load_info := tr_CbchLoadInfo(overflow, slot_count)}),
2212 tr_RSL_IE(RSL_IE_Body:{smscb_chan_ind := 1})
2213 }
2214 }
2215 template (value) RSL_Message ts_RSL_CBCH_LOAD_IND_EXTD(boolean overflow, uint4_t slot_count,
2216 template (value) RslChannelNr chan_nr :=
2217 ts_RslChanNr_SDCCH4(0, 2)) := {
2218 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2219 msg_type := RSL_MT_CBCH_LOAD_IND,
2220 ies := {
2221 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2222 t_RSL_IE(RSL_IE_CBCH_LOAD_INFO, RSL_IE_Body:{cbch_load_info := ts_CbchLoadInfo(overflow, slot_count)}),
2223 t_RSL_IE(RSL_IE_SMSCB_CHAN_INDICATOR, RSL_IE_Body:{smscb_chan_ind := 1})
2224 }
2225 }
2226
2227
Vadim Yanitskiy9f699532021-06-03 17:29:22 +02002228 /* 8.6.1 BTS -> BSC */
2229 template (value) RSL_Message
2230 ts_RSL_RF_RES_IND(template (value) RSL_ResourceInfo info) := {
2231 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
2232 msg_type := RSL_MT_RF_RES_IND,
2233 ies := {
2234 t_RSL_IE(RSL_IE_RESOURCE_INFO, RSL_IE_Body:{
2235 resource_info := {
2236 len := 0, /* overwritten */
2237 info := info
2238 }
2239 })
2240 }
2241 }
2242 template RSL_Message
2243 tr_RSL_RF_RES_IND(template (present) RSL_ResourceInfo info := ?) := {
2244 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
2245 msg_type := RSL_MT_RF_RES_IND,
2246 ies := {
2247 tr_RSL_IE(RSL_IE_Body:{
2248 resource_info := {
2249 len := ?,
2250 info := info
2251 }
2252 })
2253 }
2254 }
2255
2256
Harald Welte68e495b2018-02-25 00:05:57 +01002257 /* 8.6.2 BTS <- BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02002258 template (value) RSL_Message ts_RSL_SACCH_FILL(RSL_IE_SysinfoType si_type, octetstring l3_info) := {
Harald Welte68e495b2018-02-25 00:05:57 +01002259 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
2260 msg_type := RSL_MT_SACCH_FILL,
2261 ies := {
2262 t_RSL_IE(RSL_IE_SYSINFO_TYPE, RSL_IE_Body:{sysinfo_type := si_type}),
2263 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
2264 }
2265 }
Harald Welte09538f82019-08-01 09:50:25 +02002266 template RSL_Message tr_RSL_NO_SACCH_FILL(template RSL_IE_SysinfoType si_type := ?) := {
2267 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
2268 msg_type := RSL_MT_SACCH_FILL,
2269 ies := {
2270 tr_RSL_IE(RSL_IE_Body:{sysinfo_type := si_type})
2271 }
2272 }
2273 template RSL_Message tr_RSL_SACCH_FILL(template RSL_IE_SysinfoType si_type := ?,
2274 template octetstring l3_info := ?) := {
2275 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
2276 msg_type := RSL_MT_SACCH_FILL,
2277 ies := {
2278 tr_RSL_IE(RSL_IE_Body:{sysinfo_type := si_type}),
2279 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)}),
2280 *
2281 }
2282 }
2283
Harald Welte68e495b2018-02-25 00:05:57 +01002284
Harald Welte643e2a62017-11-27 15:03:18 +01002285 /* 8.6.4 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02002286 template (value) RSL_Message ts_RSL_ERROR_REPORT(RSL_Cause cause) := {
Harald Welte01d982c2018-02-25 01:31:40 +01002287 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
2288 msg_type := RSL_MT_ERROR_REPORT,
Harald Welte643e2a62017-11-27 15:03:18 +01002289 ies := {
Harald Welte735dd072017-12-12 14:55:17 +01002290 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
Harald Welte643e2a62017-11-27 15:03:18 +01002291 }
2292 }
Harald Welte01d982c2018-02-25 01:31:40 +01002293 template RSL_Message tr_RSL_ERROR_REPORT(template RSL_Cause cause := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002294 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
Harald Welte01d982c2018-02-25 01:31:40 +01002295 msg_type := RSL_MT_ERROR_REPORT,
2296 ies := {
2297 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)}),
2298 *
2299 }
2300 }
2301
Harald Welte643e2a62017-11-27 15:03:18 +01002302
Harald Welte9958a4d2017-12-14 21:21:33 +01002303
2304 /* Abis/IP specific messages */
2305
Vadim Yanitskiy1567bac2022-05-01 03:36:24 +03002306 private function f_ts_RSL_IPA_CRCX_IEs(template (value) RslChannelNr chan_nr,
2307 template (omit) OCT4 remote_ip,
Pau Espin Pedrol39bfa022022-08-12 14:56:12 +02002308 template (omit) uint16_t remote_port,
2309 template (omit) uint8_t osmux_cid)
Vadim Yanitskiy1567bac2022-05-01 03:36:24 +03002310 return RSL_IE_List {
2311 var RSL_IE_List ies;
2312
2313 /* Channel Number is a mandatory IE */
2314 ies := {
2315 valueof(RSL_IE:{
2316 iei := RSL_IE_CHAN_NR,
2317 body := { chan_nr := chan_nr }
2318 })
2319 };
2320 /* Remote IP / Port are optional IEs */
2321 if (not istemplatekind(remote_ip, "omit")) {
2322 ies := ies & {
2323 valueof(RSL_IE:{
2324 iei := RSL_IE_IPAC_REMOTE_IP,
2325 body := { ipa_remote_ip := remote_ip }
2326 })
2327 };
2328 }
2329 if (not istemplatekind(remote_port, "omit")) {
2330 ies := ies & {
2331 valueof(RSL_IE:{
2332 iei := RSL_IE_IPAC_REMOTE_PORT,
2333 body := { ipa_remote_port := remote_port }
2334 })
2335 };
2336 }
Pau Espin Pedrol39bfa022022-08-12 14:56:12 +02002337 /* Osmux CID extension IE is optional: */
2338 if (not istemplatekind(osmux_cid, "omit")) {
2339 ies := ies & {
2340 valueof(RSL_IE:{
2341 iei := RSL_IE_OSMO_OSMUX_CID,
2342 body := { osmux_cid := ts_RSL_IE_OSMO_Osmux_CID(osmux_cid) }
2343 })
2344 };
2345 }
Vadim Yanitskiy1567bac2022-05-01 03:36:24 +03002346
2347 return ies;
2348 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002349 template RSL_Message tr_RSL_IPA_CRCX(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002350 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002351 msg_type := RSL_MT_IPAC_CRCX,
2352 ies := {
2353 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2354 *
2355 }
2356 }
Vadim Yanitskiye9141c22021-07-03 01:45:40 +02002357 template (value) RSL_Message
2358 ts_RSL_IPA_CRCX(template (value) RslChannelNr chan_nr,
Vadim Yanitskiy1567bac2022-05-01 03:36:24 +03002359 template (omit) OCT4 remote_ip := omit,
Pau Espin Pedrol39bfa022022-08-12 14:56:12 +02002360 template (omit) uint16_t remote_port := omit,
2361 template (omit) uint8_t osmux_cid := omit) := {
Harald Welte9abd1282018-02-19 19:18:17 +01002362 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2363 msg_type := RSL_MT_IPAC_CRCX,
Pau Espin Pedrol39bfa022022-08-12 14:56:12 +02002364 ies := f_ts_RSL_IPA_CRCX_IEs(chan_nr, remote_ip, remote_port, osmux_cid)
Harald Welte9abd1282018-02-19 19:18:17 +01002365 }
2366
Pau Espin Pedrol29c6dfb2022-08-08 18:37:56 +02002367 function ts_RSL_IPA_CRCX_ACK(template (value) RslChannelNr chan_nr,
2368 uint16_t ipa_conn_id, OCT4 local_ip,
2369 uint16_t local_port, uint7_t rtp_pt2,
2370 template (omit) uint8_t osmux_cid := omit)
2371 return template (value) RSL_Message {
2372 var template (value) RSL_Message msg := {
2373 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2374 msg_type := RSL_MT_IPAC_CRCX_ACK,
2375 ies := {
2376 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2377 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2378 t_RSL_IE(RSL_IE_IPAC_LOCAL_IP, RSL_IE_Body:{ipa_local_ip := local_ip}),
2379 t_RSL_IE(RSL_IE_IPAC_LOCAL_PORT, RSL_IE_Body:{ipa_local_port := local_port}),
2380 t_RSL_IE(RSL_IE_IPAC_RTP_PAYLOAD2, RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
2381 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002382 }
Pau Espin Pedrol29c6dfb2022-08-08 18:37:56 +02002383 if (not istemplatekind(osmux_cid, "omit")) {
2384 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)});
2385 }
2386 return msg;
Harald Welte9958a4d2017-12-14 21:21:33 +01002387 }
Pau Espin Pedrol29c6dfb2022-08-08 18:37:56 +02002388
Pau Espin Pedrol39bfa022022-08-12 14:56:12 +02002389 function tr_RSL_IPA_CRCX_ACK(template RslChannelNr chan_nr,
2390 template uint16_t ipa_conn_id,
2391 template OCT4 local_ip,
2392 template uint16_t local_port,
2393 template uint8_t osmux_cid := omit)
2394 return template RSL_Message {
2395 var template RSL_Message msg := {
2396 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2397 msg_type := RSL_MT_IPAC_CRCX_ACK,
2398 ies := {
2399 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2400 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2401 tr_RSL_IE(RSL_IE_Body:{ipa_local_ip := local_ip}),
2402 tr_RSL_IE(RSL_IE_Body:{ipa_local_port := local_port})
2403 /* Optional: RTP Payload Type 2 IE */
2404 }
Harald Welte9abd1282018-02-19 19:18:17 +01002405 }
Pau Espin Pedrol39bfa022022-08-12 14:56:12 +02002406 if (not istemplatekind(osmux_cid, "omit")) {
2407 msg.ies[lengthof(msg.ies)] := tr_RSL_IE(RSL_IE_Body:{osmux_cid := f_tr_RSL_IE_OSMO_Osmux_CID(osmux_cid)});
2408 }
2409 return msg;
Harald Welte9abd1282018-02-19 19:18:17 +01002410 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002411
Harald Welteefa7d912018-04-18 23:22:15 +02002412 template (value) RSL_Message ts_RSL_IPA_CRCX_NACK(template (value) RslChannelNr chan_nr,
2413 RSL_Cause cause) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002414 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2415 msg_type := RSL_MT_IPAC_CRCX_NACK,
2416 ies := {
2417 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2418 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2419 }
2420 }
Harald Welte9abd1282018-02-19 19:18:17 +01002421 template RSL_Message tr_RSL_IPA_CRCX_NACK(template RslChannelNr chan_nr,
2422 template RSL_Cause cause := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002423 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9abd1282018-02-19 19:18:17 +01002424 msg_type := RSL_MT_IPAC_CRCX_NACK,
2425 ies := {
2426 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2427 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
2428 }
2429 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002430
Pau Espin Pedrol39bfa022022-08-12 14:56:12 +02002431 function ts_RSL_IPA_MDCX(template (value) RslChannelNr chan_nr,
2432 uint16_t ipa_conn_id,
2433 OCT4 remote_ip, uint16_t remote_port,
2434 uint7_t rtp_pt2,
2435 template (omit) uint8_t osmux_cid := omit)
2436 return template (value) RSL_Message {
2437 var template (value) RSL_Message msg := {
2438 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2439 msg_type := RSL_MT_IPAC_MDCX,
2440 ies := {
2441 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2442 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2443 t_RSL_IE(RSL_IE_IPAC_REMOTE_IP, RSL_IE_Body:{ipa_remote_ip := remote_ip}),
2444 t_RSL_IE(RSL_IE_IPAC_REMOTE_PORT, RSL_IE_Body:{ipa_remote_port := remote_port}),
2445 /* optional: RTP Payload Type */
2446 t_RSL_IE(RSL_IE_IPAC_RTP_PAYLOAD2, RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
2447 }
Harald Welte30527452018-02-25 12:46:25 +01002448 }
Pau Espin Pedrol39bfa022022-08-12 14:56:12 +02002449 if (not istemplatekind(osmux_cid, "omit")) {
2450 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)});
2451 }
2452 return msg;
Harald Welte30527452018-02-25 12:46:25 +01002453 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002454 template RSL_Message tr_RSL_IPA_MDCX(template RslChannelNr chan_nr,
2455 template uint16_t ipa_conn_id) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002456 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002457 msg_type := RSL_MT_IPAC_MDCX,
2458 ies := {
2459 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2460 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2461 *
2462 }
2463 }
2464
Pau Espin Pedrol29c6dfb2022-08-08 18:37:56 +02002465 function ts_RSL_IPA_MDCX_ACK(template (value) RslChannelNr chan_nr,
2466 uint16_t ipa_conn_id,
2467 OCT4 local_ip, uint16_t local_port,
2468 uint7_t rtp_pt2,
2469 template (omit) uint8_t osmux_cid := omit)
Pau Espin Pedrol39bfa022022-08-12 14:56:12 +02002470 return template (value) RSL_Message {
2471 var template (value) RSL_Message msg := {
2472 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2473 msg_type := RSL_MT_IPAC_MDCX_ACK,
2474 ies := {
2475 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2476 /* optional */
2477 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2478 t_RSL_IE(RSL_IE_IPAC_LOCAL_IP, RSL_IE_Body:{ipa_local_ip := local_ip}),
2479 t_RSL_IE(RSL_IE_IPAC_LOCAL_PORT, RSL_IE_Body:{ipa_local_port := local_port}),
2480 /* optional: RTP Payload Type */
2481 t_RSL_IE(RSL_IE_IPAC_RTP_PAYLOAD2, RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
Pau Espin Pedrol29c6dfb2022-08-08 18:37:56 +02002482 }
Pau Espin Pedrol39bfa022022-08-12 14:56:12 +02002483 }
2484 if (not istemplatekind(osmux_cid, "omit")) {
2485 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)});
2486 }
2487 return msg;
2488 }
2489 function tr_RSL_IPA_MDCX_ACK(template RslChannelNr chan_nr,
2490 template uint16_t ipa_conn_id,
2491 template OCT4 local_ip,
2492 template uint16_t local_port,
2493 template uint7_t rtp_pt2,
2494 template uint8_t osmux_cid := omit)
2495 return template RSL_Message {
2496 var template RSL_Message msg := {
2497 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2498 msg_type := RSL_MT_IPAC_MDCX_ACK,
2499 ies := {
2500 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2501 /* optional */
2502 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2503 tr_RSL_IE(RSL_IE_Body:{ipa_local_ip := local_ip}),
2504 tr_RSL_IE(RSL_IE_Body:{ipa_local_port := local_port}),
2505 /* optional: RTP Payload Type */
2506 tr_RSL_IE(RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
Pau Espin Pedrol29c6dfb2022-08-08 18:37:56 +02002507 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002508 }
Pau Espin Pedrol39bfa022022-08-12 14:56:12 +02002509 if (not istemplatekind(osmux_cid, "omit")) {
2510 msg.ies[lengthof(msg.ies)] := tr_RSL_IE(RSL_IE_Body:{osmux_cid := f_tr_RSL_IE_OSMO_Osmux_CID(osmux_cid)});
Harald Welte30527452018-02-25 12:46:25 +01002511 }
Pau Espin Pedrol39bfa022022-08-12 14:56:12 +02002512 return msg;
Harald Welte30527452018-02-25 12:46:25 +01002513 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002514
Harald Welteefa7d912018-04-18 23:22:15 +02002515 template (value) RSL_Message ts_RSL_IPA_MDCX_NACK(template (value) RslChannelNr chan_nr,
2516 RSL_Cause cause,
2517 template (value) uint16_t ipa_conn_id) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002518 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2519 msg_type := RSL_MT_IPAC_MDCX_NACK,
2520 ies := {
2521 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2522 /* optional connection ID */
2523 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2524 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2525 }
2526 }
Harald Welte30527452018-02-25 12:46:25 +01002527 template RSL_Message tr_RSL_IPA_MDCX_NACK(template RslChannelNr chan_nr,
2528 template RSL_Cause cause,
2529 template uint16_t ipa_conn_id) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002530 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte30527452018-02-25 12:46:25 +01002531 msg_type := RSL_MT_IPAC_MDCX_NACK,
2532 ies := {
2533 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2534 /* optional connection ID */
2535 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2536 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
2537 }
2538 }
2539
Harald Welte9958a4d2017-12-14 21:21:33 +01002540
Harald Welteefa7d912018-04-18 23:22:15 +02002541 template (value) RSL_Message ts_RSL_IPA_DLCX_IND(template (value) RslChannelNr chan_nr,
2542 uint16_t ipa_conn_id,
2543 template (value) RSL_IE_IPA_ConnectionStats stats,
2544 RSL_Cause cause) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002545 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2546 msg_type := RSL_MT_IPAC_DLCX_IND,
2547 ies := {
2548 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2549 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2550 t_RSL_IE(RSL_IE_IPAC_CONN_STAT, RSL_IE_Body:{ipa_stats := stats}),
2551 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2552 }
2553 }
2554
Harald Welteefa7d912018-04-18 23:22:15 +02002555 template (value) RSL_Message ts_RSL_IPA_DLCX(template (value) RslChannelNr chan_nr,
2556 uint16_t ipa_conn_id) := {
Harald Weltea871a382018-02-25 02:03:14 +01002557 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2558 msg_type := RSL_MT_IPAC_DLCX,
2559 ies := {
Harald Welte2a7e7162018-02-25 12:46:48 +01002560 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2561 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id})
Harald Weltea871a382018-02-25 02:03:14 +01002562 }
2563 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002564 template RSL_Message tr_RSL_IPA_DLCX(template RslChannelNr chan_nr,
2565 template uint16_t ipa_conn_id := omit) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002566 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002567 msg_type := RSL_MT_IPAC_DLCX,
2568 ies := {
2569 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2570 /* FIXME: optional conn_id */
2571 *
2572 }
2573 }
2574
Harald Welteefa7d912018-04-18 23:22:15 +02002575 template (value) RSL_Message ts_RSL_IPA_DLCX_ACK(template (value) RslChannelNr chan_nr,
2576 uint16_t ipa_conn_id,
2577 RSL_IE_IPA_ConnectionStats stats) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002578 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2579 msg_type := RSL_MT_IPAC_DLCX_ACK,
2580 ies := {
2581 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2582 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2583 t_RSL_IE(RSL_IE_IPAC_CONN_STAT, RSL_IE_Body:{ipa_stats := stats})
2584 }
2585 }
Harald Weltea871a382018-02-25 02:03:14 +01002586 template RSL_Message tr_RSL_IPA_DLCX_ACK(template RslChannelNr chan_nr,
2587 template uint16_t ipa_conn_id,
2588 template RSL_IE_IPA_ConnectionStats stats) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002589 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Weltea871a382018-02-25 02:03:14 +01002590 msg_type := RSL_MT_IPAC_DLCX_ACK,
2591 ies := {
2592 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2593 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2594 tr_RSL_IE(RSL_IE_Body:{ipa_stats := stats})
2595 }
2596 }
2597
2598
Harald Welte9958a4d2017-12-14 21:21:33 +01002599
Harald Welteefa7d912018-04-18 23:22:15 +02002600 template (value) RSL_Message ts_RSL_IPA_DLCX_NACK(template (value) RslChannelNr chan_nr,
2601 RSL_Cause cause, uint16_t ipa_conn_id) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002602 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2603 msg_type := RSL_MT_IPAC_DLCX_NACK,
2604 ies := {
2605 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2606 /* optional connection ID */
2607 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2608 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2609 }
2610 }
Harald Weltea871a382018-02-25 02:03:14 +01002611 template RSL_Message tr_RSL_IPA_DLCX_NACK(template RslChannelNr chan_nr,
2612 template RSL_Cause cause) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002613 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Weltea871a382018-02-25 02:03:14 +01002614 msg_type := RSL_MT_IPAC_DLCX_NACK,
2615 ies := {
2616 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2617 /* optional connection ID */
2618 *,
2619 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
2620 }
2621 }
2622
Harald Welte9958a4d2017-12-14 21:21:33 +01002623
Vadim Yanitskiy58b16532021-10-09 20:27:39 +06002624 template (value) RSL_Message
2625 ts_RSL_IPA_PDCH_ACT(template (value) RslChannelNr chan_nr) := {
Harald Welteee19c732018-04-05 09:08:26 +02002626 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2627 msg_type := RSL_MT_IPAC_PDCH_ACT,
2628 ies := {
2629 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
2630 }
2631 }
Vadim Yanitskiy58b16532021-10-09 20:27:39 +06002632 template RSL_Message
2633 tr_RSL_IPA_PDCH_ACT(template (present) RslChannelNr chan_nr) := {
Harald Welteee19c732018-04-05 09:08:26 +02002634 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002635 msg_type := RSL_MT_IPAC_PDCH_ACT,
2636 ies := {
2637 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
2638 }
2639 }
2640
Harald Welteee19c732018-04-05 09:08:26 +02002641
Harald Welte94e0c342018-04-07 11:33:23 +02002642 template RSL_Message ts_RSL_IPA_PDCH_ACT_ACK(RslChannelNr chan_nr,
2643 template (value) RSL_IE_FrameNumber fn) := {
Harald Welteee19c732018-04-05 09:08:26 +02002644 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002645 msg_type := RSL_MT_IPAC_PDCH_ACT_ACK,
2646 ies := {
2647 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2648 t_RSL_IE(RSL_IE_FRAME_NUMBER, RSL_IE_Body:{frame_nr := fn})
2649 }
2650 }
Harald Welteee19c732018-04-05 09:08:26 +02002651 template RSL_Message tr_RSL_IPA_PDCH_ACT_ACK(template RslChannelNr chan_nr,
2652 template RSL_IE_FrameNumber fn) := {
2653 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2654 msg_type := RSL_MT_IPAC_PDCH_ACT_ACK,
2655 ies := {
2656 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2657 tr_RSL_IE(RSL_IE_Body:{frame_nr := fn})
2658 }
2659 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002660
2661 template RSL_Message ts_RSL_IPA_PDCH_ACT_NACK(RslChannelNr chan_nr, RSL_Cause cause) := {
Harald Welteee19c732018-04-05 09:08:26 +02002662 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002663 msg_type := RSL_MT_IPAC_PDCH_ACT_NACK,
2664 ies := {
2665 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2666 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2667 }
2668 }
Harald Welteee19c732018-04-05 09:08:26 +02002669 template RSL_Message tr_RSL_IPA_PDCH_ACT_NACK(template RslChannelNr chan_nr,
2670 template RSL_Cause cause) := {
2671 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2672 msg_type := RSL_MT_IPAC_PDCH_ACT_NACK,
2673 ies := {
2674 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2675 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
2676 }
2677 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002678
Harald Welteee19c732018-04-05 09:08:26 +02002679 template RSL_Message ts_RSL_IPA_PDCH_DEACT(RslChannelNr chan_nr) := {
2680 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2681 msg_type := RSL_MT_IPAC_PDCH_DEACT,
2682 ies := {
2683 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
2684 }
2685 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002686 template RSL_Message tr_RSL_IPA_PDCH_DEACT(template RslChannelNr chan_nr) := {
Harald Welteee19c732018-04-05 09:08:26 +02002687 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002688 msg_type := RSL_MT_IPAC_PDCH_DEACT,
2689 ies := {
2690 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
2691 }
2692 }
2693
2694 template RSL_Message ts_RSL_IPA_PDCH_DEACT_ACK(RslChannelNr chan_nr) := {
Harald Welteee19c732018-04-05 09:08:26 +02002695 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002696 msg_type := RSL_MT_IPAC_PDCH_DEACT_ACK,
2697 ies := {
2698 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
2699 }
2700 }
Harald Welteee19c732018-04-05 09:08:26 +02002701 template RSL_Message tr_RSL_IPA_PDCH_DEACT_ACK(template RslChannelNr chan_nr) := {
2702 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2703 msg_type := RSL_MT_IPAC_PDCH_DEACT_ACK,
2704 ies := {
2705 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
2706 }
2707 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002708
2709 template RSL_Message ts_RSL_IPA_PDCH_DEACT_NACK(RslChannelNr chan_nr, RSL_Cause cause) := {
Harald Welteee19c732018-04-05 09:08:26 +02002710 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002711 msg_type := RSL_MT_IPAC_PDCH_DEACT_NACK,
2712 ies := {
2713 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2714 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2715 }
2716 }
Harald Welteee19c732018-04-05 09:08:26 +02002717 template RSL_Message tr_RSL_IPA_PDCH_DEACT_NACK(template RslChannelNr chan_nr,
2718 template RSL_Cause cause) := {
2719 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2720 msg_type := RSL_MT_IPAC_PDCH_DEACT_NACK,
2721 ies := {
2722 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2723 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
2724 }
2725 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002726
Harald Welte908ce542019-09-04 23:05:40 +02002727 template (value) RSL_Message ts_RSL_OSMO_ETWS_CMD(template (value) octetstring msg,
2728 template (value) RslChannelNr chan_nr := ts_RslChanNr_PCH_AGCH(0)) := {
2729 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2730 msg_type := RSL_MT_OSMO_ETWS_CMD,
2731 ies := {
2732 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2733 t_RSL_IE(RSL_IE_SMSCB_MSG, RSL_IE_Body:{smscb_message := ts_RSL_LV(msg)})
2734 }
2735 }
2736 template RSL_Message tr_RSL_OSMO_ETWS_CMD(template RslChannelNr chan_nr := ?,
2737 template octetstring msg := ?) := {
2738 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2739 msg_type := RSL_MT_OSMO_ETWS_CMD,
2740 ies := {
2741 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2742 tr_RSL_IE(RSL_IE_Body:{smscb_message := tr_RSL_LV(msg)})
2743 }
2744 }
2745
Harald Weltee33e5152023-04-09 23:29:48 +02002746 template (value) RSL_Message ts_RSL_NOTIF_CMD_START(template (value) GroupCallRef group_call_ref,
2747 template (value) octetstring chan_desc) := {
2748 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2749 msg_type := RSL_MT_NOT_CMD,
2750 ies := {
2751 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_PCH_AGCH(0)}),
2752 t_RSL_IE(RSL_IE_CMD_INDICATOR, RSL_IE_Body:{cmd_indicator := ts_CommandInd(CMD_IND_START)}),
2753 t_RSL_IE(RSL_IE_GROUP_CALL_REF, RSL_IE_Body:{group_call_ref := ts_GroupCallRef(group_call_ref)}),
2754 t_RSL_IE(RSL_IE_GROUP_CHAN_DESC, RSL_IE_Body:{group_chan_desc := ts_GroupChanDesc(chan_desc)})
2755 }
2756 }
2757 template RSL_Message tr_RSL_NOTIF_CMD_START(template (present) GroupCallRef group_call_ref,
2758 template (present) octetstring chan_desc := ?) := {
2759 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2760 msg_type := RSL_MT_NOT_CMD,
2761 ies := {
2762 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(0)}),
2763 tr_RSL_IE(RSL_IE_Body:{cmd_indicator := tr_CommandInd(CMD_IND_START)}),
2764 tr_RSL_IE(RSL_IE_Body:{group_call_ref := tr_GroupCallRef(group_call_ref)}),
2765 tr_RSL_IE(RSL_IE_Body:{group_chan_desc := tr_GroupChanDesc(chan_desc)}),
2766 *
2767 }
2768 }
2769
2770 template (value) RSL_Message ts_RSL_NOTIF_CMD_STOP(template (value) GroupCallRef group_call_ref) := {
2771 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2772 msg_type := RSL_MT_NOT_CMD,
2773 ies := {
2774 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_PCH_AGCH(0)}),
2775 t_RSL_IE(RSL_IE_CMD_INDICATOR, RSL_IE_Body:{cmd_indicator := ts_CommandInd(CMD_IND_STOP)}),
2776 t_RSL_IE(RSL_IE_GROUP_CALL_REF, RSL_IE_Body:{group_call_ref := ts_GroupCallRef(group_call_ref)})
2777 }
2778 }
2779 template RSL_Message tr_RSL_NOTIF_CMD_STOP(template (present) GroupCallRef group_call_ref) := {
2780 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2781 msg_type := RSL_MT_NOT_CMD,
2782 ies := {
2783 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(0)}),
2784 tr_RSL_IE(RSL_IE_Body:{cmd_indicator := tr_CommandInd(CMD_IND_STOP)}),
2785 tr_RSL_IE(RSL_IE_Body:{group_call_ref := tr_GroupCallRef(group_call_ref)}),
2786 *
2787 }
2788 }
2789
Harald Welte908ce542019-09-04 23:05:40 +02002790
Harald Welte9958a4d2017-12-14 21:21:33 +01002791
Harald Welte6a8199d2018-01-29 21:58:53 +01002792 function f_rsl_find_ie(RSL_Message msg, RSL_IE_Type iei, out RSL_IE_Body ret) return boolean {
2793 for (var integer i := 0; i < sizeof(msg.ies); i := i+1) {
2794 if (msg.ies[i].iei == iei) {
2795 ret := msg.ies[i].body;
2796 return true;
2797 }
2798 }
2799 return false;
2800 }
2801
2802
Harald Welte9958a4d2017-12-14 21:21:33 +01002803
Harald Welte643e2a62017-11-27 15:03:18 +01002804} with { encode "RAW" ; variant "FIELDORDER(msb)" }