blob: c1b7a801afcb96aa7ee34467f2114f499691bbc7 [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
Vadim Yanitskiy8e2b8e32023-05-26 18:44:01 +0700453 template (value) RSL_IE_ChannelMode
454 ts_RSL_ChanMode_DATA(template (value) RSL_ChanRateType t,
455 template (value) RSL_ChanModeOct6DataRate r,
456 template (value) boolean dtxd := false,
457 template (value) boolean dtxu := false) := {
458 len := 0, /* overwritten */
459 reserved := '000000'B,
460 dtx_d := dtxd,
461 dtx_u := dtxu,
462 spd_ind := RSL_SPDI_DATA,
463 ch_rate_type := t,
464 u := { data := r }
465 }
466 template RSL_IE_ChannelMode
467 tr_RSL_ChanMode_DATA(template (present) RSL_ChanRateType t := ?,
468 template (present) RSL_ChanModeOct6DataRate r := ?,
469 template (present) boolean dtxd := ?,
470 template (present) boolean dtxu := ?) := {
471 len := ?,
472 reserved := ?,
473 dtx_d := dtxd,
474 dtx_u := dtxu,
475 spd_ind := RSL_SPDI_DATA,
476 ch_rate_type := t,
477 u := { data := r }
478 }
479
Oliver Smith0033b122023-02-28 13:30:53 +0100480 template (value) RSL_IE_ChannelMode ts_RSL_ChanMode(RSL_ChanRateType t, RSL_ChanModeOct6SpeechAlgo alg,
Stefan Sperling4880be42018-08-07 18:12:59 +0200481 boolean dtx_downlink := false) := {
Harald Welte8f2c21d2017-12-07 17:52:40 +0100482 len := 0, /* overwritten */
Harald Welte643e2a62017-11-27 15:03:18 +0100483 reserved := '000000'B,
Stefan Sperling4880be42018-08-07 18:12:59 +0200484 dtx_d := dtx_downlink,
Harald Welte643e2a62017-11-27 15:03:18 +0100485 dtx_u := false,
486 spd_ind := RSL_SPDI_SPEECH,
487 ch_rate_type := t,
Oliver Smith0033b122023-02-28 13:30:53 +0100488 u := { speech := alg }
Harald Welte643e2a62017-11-27 15:03:18 +0100489 }
Harald Welte3618d9d2018-03-21 18:45:27 +0100490 template RSL_IE_ChannelMode tr_RSL_ChanMode(template RSL_ChanRateType t,
Oliver Smith0033b122023-02-28 13:30:53 +0100491 template RSL_ChanModeOct6SpeechAlgo alg) := {
Harald Welte3618d9d2018-03-21 18:45:27 +0100492 len := ?,
493 reserved := '000000'B,
494 dtx_d := ?,
495 dtx_u := ?,
496 spd_ind := RSL_SPDI_SPEECH,
497 ch_rate_type := t,
Oliver Smith0033b122023-02-28 13:30:53 +0100498 u := { speech := alg }
Harald Welte3618d9d2018-03-21 18:45:27 +0100499 }
Harald Welte643e2a62017-11-27 15:03:18 +0100500
Vadim Yanitskiy117c1762020-06-16 01:40:10 +0700501 /* 9.3.4 BS Power IE */
Harald Welte643e2a62017-11-27 15:03:18 +0100502 type record RSL_IE_BS_Power {
Vadim Yanitskiy117c1762020-06-16 01:40:10 +0700503 uint2_t reserved,
Harald Welte643e2a62017-11-27 15:03:18 +0100504 boolean epc,
505 boolean fpc,
Vadim Yanitskiy117c1762020-06-16 01:40:10 +0700506 uint4_t power_level
Harald Welte643e2a62017-11-27 15:03:18 +0100507 }
508
Vadim Yanitskiy117c1762020-06-16 01:40:10 +0700509 template (value) RSL_IE_BS_Power ts_RSL_IE_BS_Power(uint4_t power_level,
Eric Wildae8f2622019-06-18 17:05:11 +0200510 boolean epc := false, boolean fpc := false) := {
511 reserved := 0,
512 epc := epc,
513 fpc := fpc,
514 power_level := power_level
515 }
Vadim Yanitskiy2a5a1ef2021-06-30 00:51:48 +0200516 template RSL_IE_BS_Power
517 tr_RSL_IE_BS_Power(template (present) uint4_t power_level,
518 template (present) boolean epc := ?,
519 template (present) boolean fpc := ?) := {
520 reserved := ?,
521 epc := epc,
522 fpc := fpc,
523 power_level := power_level
524 }
Eric Wildae8f2622019-06-18 17:05:11 +0200525
Harald Welte73cd2712017-12-17 00:44:52 +0100526 /* 9.3.7 */
Harald Weltee613f962018-04-18 22:38:16 +0200527 type enumerated RSL_AlgId {
528 RSL_ALG_ID_A5_0 ('00000001'B),
529 RSL_ALG_ID_A5_1 ('00000010'B),
530 RSL_ALG_ID_A5_2 ('00000011'B),
531 RSL_ALG_ID_A5_3 ('00000100'B),
532 RSL_ALG_ID_A5_4 ('00000101'B),
533 RSL_ALG_ID_A5_5 ('00000110'B),
534 RSL_ALG_ID_A5_6 ('00000111'B),
535 RSL_ALG_ID_A5_7 ('00001000'B)
536 } with { variant "FIELDLENGTH(8)" };
Harald Welte73cd2712017-12-17 00:44:52 +0100537 type record RSL_IE_EncryptionInfo {
538 uint8_t len,
Harald Weltee613f962018-04-18 22:38:16 +0200539 RSL_AlgId alg_id,
Harald Welte73cd2712017-12-17 00:44:52 +0100540 octetstring key
541 } with { variant (len) "LENGTHTO(alg_id,key)" };
542
Harald Weltee613f962018-04-18 22:38:16 +0200543 template RSL_IE_EncryptionInfo tr_RSL_IE_EncrInfo(template RSL_AlgId alg,
544 template octetstring key) := {
Harald Welte73cd2712017-12-17 00:44:52 +0100545 len := ?,
546 alg_id := alg,
547 key := key
548 }
Harald Weltee613f962018-04-18 22:38:16 +0200549 template (value) RSL_IE_EncryptionInfo ts_RSL_IE_EncrInfo(template (value) RSL_AlgId alg,
550 octetstring key) := {
Harald Welteefa7d912018-04-18 23:22:15 +0200551 len := 0, /* overwritten */
552 alg_id := alg,
553 key := key
554 }
555
556
Harald Welte73cd2712017-12-17 00:44:52 +0100557
Harald Welte643e2a62017-11-27 15:03:18 +0100558 /* 9.3.8 */
559 type record RSL_IE_FrameNumber {
560 uint5_t t1_p,
561 uint6_t t3,
562 uint5_t t2
563 }
564 type RSL_IE_FrameNumber RSL_IE_StartingTime;
565
566 /* 9.3.10 */
567 type record RSL_IE_L1Info {
568 uint5_t ms_power_lvl,
569 boolean fpc,
570 uint2_t reserved,
571 uint8_t actual_ta
572 }
573
Neels Hofmeyrafe2ea52021-11-24 15:16:12 +0100574 template (value) RSL_IE_L1Info ts_RSL_IE_L1Info := {
575 ms_power_lvl := 0,
576 fpc := false,
577 reserved := 0,
578 actual_ta := 0
579 };
580
Harald Welte643e2a62017-11-27 15:03:18 +0100581 /* 9.3.13 */
582 type record RSL_IE_MS_Power {
583 uint2_t reserved,
584 boolean fpc_epc,
585 uint5_t power_level
586 }
Pau Espin Pedrolf7630a62019-10-28 15:07:08 +0100587 template RSL_IE_MS_Power tr_RSL_IE_MS_Power(template uint5_t power_level := ?,
588 template boolean fpc_epc := false) := {
589 reserved := 0,
590 fpc_epc := fpc_epc,
591 power_level := power_level
592 }
Harald Welte10280172019-05-19 22:28:04 +0200593 template (value) RSL_IE_MS_Power ts_RSL_IE_MS_Power(uint5_t power_level,
594 boolean fpc_epc := false) := {
595 reserved := 0,
596 fpc_epc := fpc_epc,
597 power_level := power_level
598 }
Harald Welte643e2a62017-11-27 15:03:18 +0100599
Harald Welted5f521e2017-12-07 17:53:06 +0100600 /* 9.3.18 */
601 type record RSL_IE_RachLoad {
602 uint8_t len,
603 uint16_t slot_count,
604 uint16_t busy_count,
605 uint16_t access_count
606 } with { variant (len) "LENGTHTO(slot_count,busy_count,access_count)" }
607
Harald Welteefa7d912018-04-18 23:22:15 +0200608 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 +0100609 len := 0, /* overwritten */
610 slot_count := slot,
611 busy_count := busy,
612 access_count := acc
613 }
614
Harald Welte68e495b2018-02-25 00:05:57 +0100615 template RSL_IE_RachLoad tr_RSL_IE_RachLoad(template uint16_t slot,
616 template uint16_t busy,
617 template uint16_t acc) := {
618 len := ?, /* overwritten */
619 slot_count := slot,
620 busy_count := busy,
621 access_count := acc
622 }
623
Harald Welte643e2a62017-11-27 15:03:18 +0100624 /* 9.3.19 */
625 type record RSL_IE_RequestRef {
626 OCT1 ra,
627 RSL_IE_FrameNumber frame_nr
628 }
629
630 /* 3GPP TS 44.018 / 10.5.2.38 Starting Time */
Harald Welte94e0c342018-04-07 11:33:23 +0200631 template (value) RSL_IE_FrameNumber ts_RSL_IE_FrameNumber(GsmFrameNumber fn) := {
Harald Welte643e2a62017-11-27 15:03:18 +0100632 t1_p := (fn / 1326) mod 32,
633 t3 := fn mod 51,
634 t2 := fn mod 26
635 }
636
Harald Welte9abd1282018-02-19 19:18:17 +0100637 function tr_RSL_IE_FrameNumber(template GsmFrameNumber fn) return template RSL_IE_FrameNumber {
638 if (istemplatekind(fn, "?")) {
639 return ?;
640 } else {
641 return ts_RSL_IE_FrameNumber(valueof(fn));
642 }
643 }
644
Harald Welteefa7d912018-04-18 23:22:15 +0200645 template (value) RSL_IE_RequestRef ts_RSL_IE_ReqRef(OCT1 ra, GsmFrameNumber frame_nr) := {
Harald Welte643e2a62017-11-27 15:03:18 +0100646 ra := ra,
647 frame_nr := ts_RSL_IE_FrameNumber(frame_nr)
648 }
649
Harald Welte9abd1282018-02-19 19:18:17 +0100650 template RSL_IE_RequestRef tr_RSL_IE_ReqRef(template OCT1 ra, template GsmFrameNumber frame_nr) := {
651 ra := ra,
652 frame_nr := tr_RSL_IE_FrameNumber(frame_nr)
653 }
654
Vadim Yanitskiy9f699532021-06-03 17:29:22 +0200655 /* 9.3.21 Resource Information */
656 type record RSL_IE_ResourceInfo {
657 uint8_t len,
658 RSL_ResourceInfo info
659 } with { variant (len) "LENGTHTO(info)" };
660
661 type record of RSL_ResourceInfoItem RSL_ResourceInfo;
662 type record RSL_ResourceInfoItem {
663 RslChannelNr chan_nr,
664 uint3_t interf_band,
665 BIT5 rfu ('00000'B)
666 };
667
668 template (value) RSL_ResourceInfoItem
669 ts_RSL_ResourceInfoItem(template (value) RslChannelNr chan_nr,
670 template (value) uint3_t interf_band := 0) := {
671 chan_nr := chan_nr,
672 interf_band := interf_band,
673 rfu := '00000'B
674 }
675 template RSL_ResourceInfoItem
676 tr_RSL_ResourceInfoItem(template (present) RslChannelNr chan_nr := ?,
677 template (present) uint3_t interf_band := ?) := {
678 chan_nr := chan_nr,
679 interf_band := interf_band,
680 rfu := ? /* Tolerate unknown values */
681 }
682
Harald Welte15de8ba2018-06-29 08:51:42 +0200683 /* Osmocom Extension */
684 type record RSL_IE_UplinkMeasSuppMeasInfo {
685 int16_t toa256_mean,
686 int16_t toa256_min,
687 int16_t toa256_max,
688 uint16_t toa256_std_dev
689 };
690
Harald Welte2691adf2018-02-22 17:32:39 +0100691 /* 9.3.25 */
692 type record RSL_IE_UplinkMeas {
693 uint8_t len,
694 BIT1 rfu,
695 boolean dtx_d,
696 uint6_t rxlev_f_u,
697 BIT2 reserved1,
698 uint6_t rxlev_s_u,
699 BIT2 reserved2,
700 uint3_t rxq_f_u,
701 uint3_t rxq_s_u,
Harald Welte15de8ba2018-06-29 08:51:42 +0200702 RSL_IE_UplinkMeasSuppMeasInfo supp_meas_info optional
Harald Welte2691adf2018-02-22 17:32:39 +0100703 } 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 +0100704
Neels Hofmeyrafe2ea52021-11-24 15:16:12 +0100705 template (value) RSL_IE_UplinkMeas ts_RSL_IE_UplinkMeas(uint6_t rxlev := 12, uint3_t rxqual := 0) := {
706 len := 0, /* overwritten */
707 rfu := '0'B,
708 dtx_d := false,
709 rxlev_f_u := rxlev,
710 reserved1 := '00'B,
711 rxlev_s_u := rxlev,
712 reserved2 := '00'B,
713 rxq_f_u := rxqual,
714 rxq_s_u := rxqual,
715 supp_meas_info := omit
716 };
717
Harald Welte643e2a62017-11-27 15:03:18 +0100718 /* 9.3.26 */
Harald Weltea8ed9062017-12-14 09:46:01 +0100719 type enumerated RSL_Cause {
720 /* normal event */
721 RSL_ERR_RADIO_IF_FAIL ('00'O),
722 RSL_ERR_RADIO_LINK_FAIL ('01'O),
723 RSL_ERR_HANDOVER_ACC_FAIL ('02'O),
724 RSL_ERR_TALKER_ACC_FAIL ('03'O),
725 RSL_ERR_OM_INTERVENTION ('07'O),
726 RSL_ERR_NORMAL_UNSPEC ('0f'O),
727 RSL_ERR_T_MSRFPCI_EXP ('18'O),
728 /* resource unavailable */
729 RSL_ERR_EQUIPMENT_FAIL ('20'O),
730 RSL_ERR_RR_UNAVAIL ('21'O),
731 RSL_ERR_TERR_CH_FAIL ('22'O),
732 RSL_ERR_CCCH_OVERLOAD ('23'O),
733 RSL_ERR_ACCH_OVERLOAD ('24'O),
734 RSL_ERR_PROCESSOR_OVERLOAD ('25'O),
735 RSL_ERR_BTS_NOT_EQUIPPED ('27'O),
736 RSL_ERR_REMOTE_TRAU_FAILURE ('28'O),
737 RSL_ERR_NOTIF_OVERFLOW ('29'O),
738 RSL_ERR_RES_UNAVAIL ('2f'O),
739 /* service or option not available */
740 RSL_ERR_TRANSC_UNAVAIL ('30'O),
741 RSL_ERR_SERV_OPT_UNAVAIL ('3f'O),
742 /* service or option not implemented */
743 RSL_ERR_ENCR_UNIMPL ('40'O),
744 RSL_ERR_SERV_OPT_UNIMPL ('4f'O),
745 /* invalid message */
746 RSL_ERR_RCH_ALR_ACTV_ALLOC ('50'O),
Harald Welte9912eb52018-02-25 13:30:15 +0100747 RSL_ERR_IPA_RCH_NOT_ACTV_ALLOC ('51'O),
748 RSL_ERR_IPA_CONN_INVALID ('52'O),
749 RSL_ERR_IPA_CONN_IN_USE ('53'O),
750 RSL_ERR_IPA_CONN_ALREADY_EXISTS ('54'O),
Harald Weltea8ed9062017-12-14 09:46:01 +0100751 RSL_ERR_INVALID_MESSAGE ('5f'O),
752 /* protocol error */
753 RSL_ERR_MSG_DISCR ('60'O),
754 RSL_ERR_MSG_TYPE ('61'O),
755 RSL_ERR_MSG_SEQ ('62'O),
756 RSL_ERR_IE_ERROR ('63'O),
757 RSL_ERR_MAND_IE_ERROR ('64'O),
758 RSL_ERR_OPT_IE_ERROR ('65'O),
759 RSL_ERR_IE_NONEXIST ('66'O),
760 RSL_ERR_IE_LENGTH ('67'O),
761 RSL_ERR_IE_CONTENT ('68'O),
762 RSL_ERR_PROTO ('6f'O),
763 /* interworking */
764 RSL_ERR_INTERWORKING ('7f'O)
765 };
Harald Welte643e2a62017-11-27 15:03:18 +0100766 type record RSL_IE_Cause {
Harald Welte6efa8e32017-12-09 22:34:06 +0100767 uint8_t len,
Harald Welte643e2a62017-11-27 15:03:18 +0100768 uint1_t e,
769 RSL_Cause cause,
770 octetstring cause_ext optional
Harald Welte6efa8e32017-12-09 22:34:06 +0100771 } with { variant (len) "LENGTHTO(e,cause,cause_ext)" }
Harald Welte643e2a62017-11-27 15:03:18 +0100772
Harald Welteefa7d912018-04-18 23:22:15 +0200773 template (value) RSL_IE_Cause ts_RSL_IE_Cause(RSL_Cause cause) := {
Harald Welte6efa8e32017-12-09 22:34:06 +0100774 len := 0, /* overwritten */
Harald Welte643e2a62017-11-27 15:03:18 +0100775 e := 0,
776 cause := cause,
777 cause_ext := omit
778 }
779
Harald Welte9abd1282018-02-19 19:18:17 +0100780 template RSL_IE_Cause tr_RSL_IE_Cause(template RSL_Cause cause) := {
781 len := ?,
782 e := 0,
783 cause := cause,
784 cause_ext := omit
785 }
786
Harald Weltec8d363c2019-05-19 20:36:48 +0200787 /* 9.3.29 */
788 type record RSL_SacchInfo {
789 uint8_t len,
790 uint8_t num_msgs,
791 RSL_SacchInfoElements elems
792 } with {
793 variant (len) "LENGTHTO(num_msgs,elems)";
794 variant (num_msgs) "LENGTHTO(elems)";
795 variant (num_msgs) "UNIT(elements)"
796 };
797 type record RSL_SacchInfoElement {
798 RSL_IE_SysinfoType si_type,
799 uint8_t len,
800 octetstring msg
801 } with {
802 variant (len) "LENGTHTO(msg)";
803 };
804 type record of RSL_SacchInfoElement RSL_SacchInfoElements;
805 template (value) RSL_SacchInfo ts_RSL_SacchInfo(template (value) RSL_SacchInfoElements elems) := {
806 len := 0, /* overwritten */
807 num_msgs := 0, /* overwritten */
808 elems := elems
809 }
810 template (value) RSL_SacchInfoElement ts_RSL_SacchInfoElem(RSL_IE_SysinfoType tp, octetstring msg) := {
811 si_type := tp,
812 len := lengthof(msg),
813 msg := msg
814 }
815
Eric Wild61edb7e2019-06-03 12:38:31 +0200816 /* 9.3.31 */
817 type record RSL_IE_MS_Power_Parameters {
818 uint8_t len,
819 octetstring params
820 } with {
821 variant (len) "LENGTHTO(params)";
822 };
823 template (value) RSL_IE_MS_Power_Parameters ts_RSL_IE_MS_Power_Parameters(octetstring params) := {
824 len := 0, /* overwritten */
825 params := params
826 }
827
Harald Welte643e2a62017-11-27 15:03:18 +0100828 /* 9.3.40 */
829 type enumerated RSL_ChanNeeded {
830 RSL_CHANNEED_ANY ('00'B),
831 RSL_CHANNEED_SDCCH ('01'B),
832 RSL_CHANNEED_TCH_F ('10'B),
833 RSL_CHANNEED_TCH_ForH ('11'B)
Harald Welte51d74102017-12-10 23:05:02 +0100834 } with { variant "FIELDLENGTH(2)" };
Harald Welte643e2a62017-11-27 15:03:18 +0100835 type record RSL_IE_ChanNeeded {
836 uint6_t reserved,
837 RSL_ChanNeeded chan_needed
838 }
839
Harald Weltecc373202018-09-10 10:28:21 +0200840 /* 9.3.41 CB Command Type */
841 type enumerated RSL_CbCommand {
842 RSL_CB_CMD_NORMAL ('0000'B),
843 RSL_CB_CMD_SCHEDULE ('1000'B),
844 RSL_CB_CMD_DEFAULT ('1110'B),
845 RSL_CB_CMD_NULL ('1111'B)
846 } with { variant "FIELDLENGTH(4)" };
847 type record RSL_IE_CbCommandType {
848 RSL_CbCommand command,
849 boolean default_bcast_null,
850 BIT1 spare,
851 uint2_t last_block
852 };
853 template (value) RSL_IE_CbCommandType ts_RSL_IE_CbCmdType(RSL_CbCommand cmd := RSL_CB_CMD_NORMAL,
854 uint2_t last_block := 1,
855 boolean def_bcast_null := true) := {
856 command := cmd,
857 default_bcast_null := def_bcast_null,
858 spare := '0'B,
859 last_block := last_block
860 }
861
Harald Welte4a129f82019-05-21 16:35:22 +0200862 /* 9.4.43 CBCH Load Information */
863 type record RSL_IE_CbchLoadInfo {
864 boolean overflow,
865 BIT3 spare,
866 uint4_t slot_count
867 };
868 template RSL_IE_CbchLoadInfo tr_CbchLoadInfo(template boolean overflow,
869 template uint4_t slot_count) := {
870 overflow := overflow,
871 spare := ?,
872 slot_count := slot_count
873 }
874 template (value) RSL_IE_CbchLoadInfo ts_CbchLoadInfo(boolean overflow, uint4_t slot_count) := {
875 overflow := overflow,
876 spare := '000'B,
877 slot_count := slot_count
878 }
879
Harald Weltee33e5152023-04-09 23:29:48 +0200880 /* 9.3.45 Group Call Reference */
881 type record RSL_IE_GroupCallReference {
882 uint8_t len,
883 GroupCallRef group_or_bcast_call_ref
884 } with {
885 variant (len) "LENGTHTO(group_or_bcast_call_ref)"
886 };
887 template (value) RSL_IE_GroupCallReference ts_GroupCallRef(template (value) GroupCallRef gcr) := {
888 len := 0, // overwritten
889 group_or_bcast_call_ref := gcr
890 }
891 template (present) RSL_IE_GroupCallReference tr_GroupCallRef(template (present) GroupCallRef gcr := ?) := {
892 len := ?,
893 group_or_bcast_call_ref := gcr
894 }
895
896 /* 9.3.46 Channel description */
897 type record RSL_IE_GroupChannelDescription {
898 uint8_t len,
899 octetstring chan_desc
900 } with {
901 variant (len) "LENGTHTO(chan_desc)"
902 };
903 template (value) RSL_IE_GroupChannelDescription ts_GroupChanDesc(template (value) octetstring cd) := {
904 len := 0, // overwritten
905 chan_desc := cd
906 }
907 template (present) RSL_IE_GroupChannelDescription tr_GroupChanDesc(template (present) octetstring cd) := {
908 len := ?,
909 chan_desc := cd
910 }
911
912 /* 9.3.47 NCH DRX Information */
913 type record RSL_IE_NchDrxInformation {
914 uint8_t len,
915 BIT2 spare,
916 BIT1 nln_status,
917 BIT3 emlpp_priority,
918 BIT2 nln
919 } with {
920 variant (len) "LENGTHTO(spare,nln_status,emlpp_priority,nln)"
921 };
922
923 /* 9.3.48 Command Indicator */
924 type enumerated RSL_CommandIndicator {
925 CMD_IND_START (0),
926 CMD_IND_STOP (1)
927 } with { variant "FIELDLENGTH(8)" };
928 type record RSL_IE_CommandIndicator {
929 uint8_t len,
930 RSL_CommandIndicator command_value
931 } with {
932 variant (len) "LENGTHTO(command_value)"
933 };
934 template (value) RSL_IE_CommandIndicator ts_CommandInd(template (value) RSL_CommandIndicator ci) := {
935 len := 0, // overwritten
936 command_value := ci
937 }
938 template (present) RSL_IE_CommandIndicator tr_CommandInd(template (present) RSL_CommandIndicator ci) := {
939 len := ?,
940 command_value := ci
941 }
942
943 /* 9.3.50 UIC */
944 type record RSL_IE_Uic {
945 uint8_t len,
946 BIT2 spare,
947 uint6_t uic
948 } with {
949 variant (len) "LENGTHTO(spare,uic)"
950 };
951
Pau Espin Pedrolf7634dc2022-09-02 17:56:00 +0200952 /* 9.3.52, 3GPP TS 44.018 10.5.2.21aa */
953 type record RSL_IE_MultirateCfg {
954 uint8_t len,
955 uint3_t mr_speech_ver,
956 boolean nscb,
957 boolean icmi,
958 BIT1 spare,
959 uint2_t start_mode,
Vadim Yanitskiyf14e6962022-09-14 15:18:06 +0700960 BIT8 codec_modes,
Pau Espin Pedrolf7634dc2022-09-02 17:56:00 +0200961 octetstring parameters
962 } with {
Vadim Yanitskiyf14e6962022-09-14 15:18:06 +0700963 variant (len) "LENGTHTO(mr_speech_ver,nscb,icmi,spare,start_mode,codec_modes,parameters)"
Pau Espin Pedrolf7634dc2022-09-02 17:56:00 +0200964 };
965 template (value) RSL_IE_MultirateCfg ts_RSL_MultirateCfg(boolean icmi := true, uint2_t start_mode := 0,
Vadim Yanitskiy0345d202022-09-14 16:13:40 +0700966 BIT8 codec_modes := '00000100'B /* 5,90k */,
967 octetstring params := ''O) := {
Vadim Yanitskiy9e0139b2022-09-14 17:41:29 +0700968 len := 2 + lengthof(params),
Pau Espin Pedrolf7634dc2022-09-02 17:56:00 +0200969 mr_speech_ver := 1,
970 nscb := false,
971 icmi := icmi,
972 spare := '0'B,
973 start_mode := start_mode,
Vadim Yanitskiyf14e6962022-09-14 15:18:06 +0700974 codec_modes := codec_modes,
Vadim Yanitskiy0345d202022-09-14 16:13:40 +0700975 parameters := params
Pau Espin Pedrolf7634dc2022-09-02 17:56:00 +0200976 }
977
Harald Welte643e2a62017-11-27 15:03:18 +0100978 /* 9.3.53 */
979 type record RSL_IE_MultirateCtrl {
980 uint3_t spare,
981 boolean od,
982 boolean pre,
983 uint2_t rae,
984 boolean tfo
985 }
986
987 type enumerated RSL_IE_SysinfoType {
988 RSL_SYSTEM_INFO_8 ('00000000'B),
989 RSL_SYSTEM_INFO_1 ('00000001'B),
990 RSL_SYSTEM_INFO_2 ('00000010'B),
991 RSL_SYSTEM_INFO_3 ('00000011'B),
992 RSL_SYSTEM_INFO_4 ('00000100'B),
993 RSL_SYSTEM_INFO_5 ('00000101'B),
994 RSL_SYSTEM_INFO_6 ('00000110'B),
995 RSL_SYSTEM_INFO_7 ('00000111'B),
996 RSL_SYSTEM_INFO_16 ('00001000'B),
997 RSL_SYSTEM_INFO_17 ('00001001'B),
998 RSL_SYSTEM_INFO_2bis ('00001010'B),
999 RSL_SYSTEM_INFO_2ter ('00001011'B),
1000 RSL_SYSTEM_INFO_5bis ('00001101'B),
1001 RSL_SYSTEM_INFO_5ter ('00001110'B),
1002 RSL_SYSTEM_INFO_10 ('00001111'B),
1003 RSL_EXT_MEAS_ORDER ('01000111'B),
1004 RSL_MEAS_INFO ('01001000'B),
1005 RSL_SYSTEM_INFO_13 ('00101000'B),
1006 RSL_ERIC_SYSTEM_INFO_13 ('00001100'B),
1007 RSL_SYSTEM_INFO_2quater ('00101001'B),
1008 RSL_SYSTEM_INFO_9 ('00101010'B),
1009 RSL_SYSTEM_INFO_18 ('00101011'B),
1010 RSL_SYSTEM_INFO_19 ('00101100'B),
1011 RSL_SYSTEM_INFO_20 ('00101101'B)
1012 } with { variant "FIELDLENGTH(8)" }
1013
Harald Welte9958a4d2017-12-14 21:21:33 +01001014 type record RSL_IE_IPA_ConnectionStats {
1015 uint8_t len,
1016 uint32_t tx_packets,
1017 uint32_t tx_octets,
1018 uint32_t rx_packets,
1019 uint32_t rx_octets,
1020 uint32_t lost_packets,
1021 uint32_t jitter,
1022 uint32_t avg_delay
1023 } with { variant (len) "LENGTHTO(tx_packets,tx_octets,rx_packets,rx_octets,lost_packets,jitter,avg_delay)" }
1024
1025 type enumerated RSL_IPA_SpeechMode {
1026 RSL_IPA_SPM_SENDRECV ('00'B),
1027 RSL_IPA_SPM_RECVONLY ('01'B),
1028 RSL_IPA_SPM_SENDONLY ('10'B),
1029 RSL_IPA_SPM_RESERVED ('11'B)
1030 } with { variant "FIELDLENGTH(2)" }
1031
1032 type enumerated RSL_IPA_Codec {
1033 RSL_IPA_CODEC_FR ('0000'B),
1034 RSL_IPA_CODEC_EFR ('0001'B),
1035 RSL_IPA_CODEC_AMR_F ('0010'B),
1036 RSL_IPA_CODEC_HR ('0011'B),
1037 RSL_IPA_CODEC_AMR_H ('0101'B),
1038 RSL_IPA_CODEC_RTP_PT ('1111'B)
1039 } with { variant "FIELDLENGTH(4)" }
1040
1041 type record RSL_IE_IPA_SpeechMode {
1042 BIT2 reserved,
1043 RSL_IPA_SpeechMode mode,
1044 RSL_IPA_Codec codec
1045 }
1046
Oliver Smithbc392a82023-04-17 14:06:42 +02001047 type enumerated RSL_IPA_RTP_CSD_FMT_D {
1048 RSL_IPA_RTP_CSD_EXT_TRAU ('0000'B),
1049 RSL_IPA_RTP_CSD_NON_TRAU ('0001'B),
1050 RSL_IPA_RTP_CSD_TRAU_BTS ('0010'B),
1051 RSL_IPA_RTP_CSD_IWF_FREE ('0011'B)
1052 } with { variant "FIELDLENGTH(4)" }
1053
1054 type enumerated RSL_IPA_RTP_CSD_FMT_IR {
1055 RSL_IPA_RTP_CSD_8k ('0000'B),
1056 RSL_IPA_RTP_CSD_16k ('0001'B),
1057 RSL_IPA_RTP_CSD_32k ('0010'B),
1058 RSL_IPA_RTP_CSD_64 ('0011'B)
1059 } with { variant "FIELDLENGTH(4)" }
1060
1061 type record RSL_IE_IPA_RTP_CSD_FMT {
1062 RSL_IPA_RTP_CSD_FMT_IR ir,
1063 RSL_IPA_RTP_CSD_FMT_D d
1064 }
1065
Harald Welte0472ab42018-03-12 15:02:26 +01001066 /* 9.3.20 */
1067 type enumerated RSL_IE_ReleaseMode {
1068 RSL_REL_MODE_NORMAL ('00'B),
1069 REL_REL_MODE_LOCAL ('01'B)
1070 }
1071
Neels Hofmeyr2bef0dd2021-04-22 21:46:00 +00001072 type record RSL_IE_OSMO_TrainingSequence {
1073 uint8_t len,
1074 uint8_t tsc_set,
1075 uint8_t tsc
1076 } with { variant (len) "LENGTHTO(tsc_set,tsc)" }
1077
Vadim Yanitskiy1f532152021-11-01 20:37:56 +03001078 type record RSL_IE_OSMO_RepAcchCap {
1079 uint8_t len,
1080 BIT1 rfu ('0'B),
1081 uint3_t rxqual,
1082 boolean ul_sacch,
1083 boolean dl_sacch,
1084 boolean dl_facch_all,
1085 boolean dl_facch_cmd
1086 } with { variant (len) "LENGTHTO(rfu,rxqual,ul_sacch,dl_sacch,dl_facch_all,dl_facch_cmd)" }
1087
Vadim Yanitskiya203d3b2021-11-01 21:32:31 +03001088 type record RSL_IE_OSMO_TopAcchCap {
1089 uint8_t len,
1090 boolean sacch_enable,
1091 boolean facch_enable,
1092 uint3_t rxqual,
1093 uint3_t overpower_db
1094 } with { variant (len) "LENGTHTO(sacch_enable,facch_enable,rxqual,overpower_db)" }
1095
Vadim Yanitskiy66d3c332021-11-06 18:18:13 +03001096 template (value) RSL_IE_OSMO_TopAcchCap
1097 ts_RSL_IE_OSMO_TopAcchCap(template (value) uint3_t overpower := 2,
1098 template (value) uint3_t rxqual := 4,
1099 boolean facch_enable := true,
1100 boolean sacch_enable := true) := {
1101 len := 0, /* overwritten */
1102 sacch_enable := sacch_enable,
1103 facch_enable := facch_enable,
1104 rxqual := rxqual,
1105 overpower_db := overpower
1106 };
1107 template RSL_IE_OSMO_TopAcchCap
1108 tr_RSL_IE_OSMO_TopAcchCap(template (present) uint3_t overpower := ?,
1109 template (present) uint3_t rxqual := ?,
1110 template (present) boolean facch_enable := ?,
1111 template (present) boolean sacch_enable := ?) := {
1112 len := ?, /* overwritten */
1113 sacch_enable := sacch_enable,
1114 facch_enable := facch_enable,
1115 rxqual := rxqual,
1116 overpower_db := overpower
1117 };
1118
Pau Espin Pedrol29c6dfb2022-08-08 18:37:56 +02001119 type record RSL_IE_OSMO_Osmux_CID {
1120 uint8_t len,
1121 uint8_t cid
1122 } with { variant (len) "LENGTHTO(cid)" }
1123
1124 template (present) RSL_IE_OSMO_Osmux_CID
1125 tr_RSL_IE_OSMO_Osmux_CID(template (present) uint8_t osmux_cid := ?) := {
1126 len := ?, /* overwritten */
1127 cid := osmux_cid
1128 };
Pau Espin Pedrol39bfa022022-08-12 14:56:12 +02001129 function f_tr_RSL_IE_OSMO_Osmux_CID(template uint8_t osmux_cid := *)
1130 return template RSL_IE_OSMO_Osmux_CID {
1131 var template RSL_IE_OSMO_Osmux_CID ie := omit;
1132 if (not istemplatekind(osmux_cid, "omit")) {
1133 ie := tr_RSL_IE_OSMO_Osmux_CID(osmux_cid);
1134 }
1135 return ie;
1136 }
Pau Espin Pedrol29c6dfb2022-08-08 18:37:56 +02001137 template (value) RSL_IE_OSMO_Osmux_CID
1138 ts_RSL_IE_OSMO_Osmux_CID(template (value) uint8_t osmux_cid) := {
1139 len := 0, /* overwritten */
1140 cid := osmux_cid
1141 };
1142
1143
Harald Welte643e2a62017-11-27 15:03:18 +01001144 /* union of all IE bodies */
1145 type union RSL_IE_Body {
1146 RslChannelNr chan_nr,
1147 RslLinkId link_id,
Harald Welte15bb5b52017-12-07 17:52:04 +01001148 RSL_L16V l3_info,
Harald Welte643e2a62017-11-27 15:03:18 +01001149 RSL_LV rlm_cause,
Harald Welte0472ab42018-03-12 15:02:26 +01001150 RSL_IE_ReleaseMode release_mode,
Harald Welte643e2a62017-11-27 15:03:18 +01001151 RSL_IE_ActivationType act_type,
Vadim Yanitskiye02dbcc2020-08-25 04:20:51 +07001152 RSL_IE_ChannelIdent chan_ident,
Harald Welte643e2a62017-11-27 15:03:18 +01001153 RSL_IE_ChannelMode chan_mode,
1154 uint8_t handover_ref,
1155 RSL_IE_BS_Power bs_power,
Vadim Yanitskiy802508e2020-11-11 07:25:47 +07001156 RSL_LV bs_power_params,
Harald Welte643e2a62017-11-27 15:03:18 +01001157 RSL_IE_MS_Power ms_power,
Eric Wild61edb7e2019-06-03 12:38:31 +02001158 RSL_IE_MS_Power_Parameters ms_power_params,
Harald Welte643e2a62017-11-27 15:03:18 +01001159 uint8_t timing_adv,
Pau Espin Pedrolf7634dc2022-09-02 17:56:00 +02001160 RSL_IE_MultirateCfg multirate_cfg,
Harald Welte643e2a62017-11-27 15:03:18 +01001161 RSL_IE_MultirateCtrl multirate_ctrl,
Harald Weltea6706152019-05-19 20:38:18 +02001162 uint8_t msg_id,
Harald Welte643e2a62017-11-27 15:03:18 +01001163 RSL_IE_FrameNumber frame_nr,
1164 RSL_IE_Cause cause,
1165 uint8_t access_delay,
Harald Welted5f521e2017-12-07 17:53:06 +01001166 RSL_IE_RachLoad rach_load,
Harald Welte643e2a62017-11-27 15:03:18 +01001167 uint8_t meas_res_nr,
Harald Welte2691adf2018-02-22 17:32:39 +01001168 uint8_t ms_timing_offset,
1169 RSL_IE_UplinkMeas uplink_meas,
Harald Welte643e2a62017-11-27 15:03:18 +01001170 RSL_IE_L1Info l1_info,
1171 RSL_IE_SysinfoType sysinfo_type,
1172 uint16_t paging_load,
1173 uint8_t paging_group,
1174 RSL_IE_ChanNeeded chan_needed,
Harald Weltecc373202018-09-10 10:28:21 +02001175 RSL_IE_CbCommandType cb_cmd_type,
1176 RSL_LV smscb_message,
Harald Welte4a129f82019-05-21 16:35:22 +02001177 RSL_IE_CbchLoadInfo cbch_load_info,
Vadim Yanitskiy9f699532021-06-03 17:29:22 +02001178 RSL_IE_ResourceInfo resource_info,
Harald Weltec8d363c2019-05-19 20:36:48 +02001179 RSL_SacchInfo sacch_info,
Harald Weltecc373202018-09-10 10:28:21 +02001180
Harald Welte643e2a62017-11-27 15:03:18 +01001181 RSL_IE_StartingTime starting_time,
Harald Welte73cd2712017-12-17 00:44:52 +01001182 RSL_IE_EncryptionInfo encr_info,
Harald Weltea3ff6702019-05-20 20:03:50 +02001183 uint8_t smscb_chan_ind,
Harald Welte643e2a62017-11-27 15:03:18 +01001184 RSL_IE_RequestRef req_ref,
1185 RSL_LV full_imm_ass_info,
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +07001186 MobileIdentityLV ms_identity,
Harald Welte643e2a62017-11-27 15:03:18 +01001187
Harald Weltee33e5152023-04-09 23:29:48 +02001188 RSL_IE_GroupCallReference group_call_ref,
1189 RSL_IE_GroupChannelDescription group_chan_desc,
1190 RSL_IE_NchDrxInformation nch_drx_info,
1191 RSL_IE_CommandIndicator cmd_indicator,
1192 RSL_IE_Uic uic,
1193
Harald Welte9958a4d2017-12-14 21:21:33 +01001194 uint16_t ipa_conn_id,
1195 uint16_t ipa_local_port,
1196 uint16_t ipa_remote_port,
Vadim Yanitskiyfc631642021-07-03 02:42:45 +02001197 OCT4 ipa_local_ip,
1198 OCT4 ipa_remote_ip,
Harald Welte9958a4d2017-12-14 21:21:33 +01001199 uint8_t ipa_rtp_pt,
1200 uint8_t ipa_rtp_pt2,
1201 RSL_IE_IPA_ConnectionStats ipa_stats,
1202 RSL_IE_IPA_SpeechMode ipa_speech_mode,
Oliver Smithbc392a82023-04-17 14:06:42 +02001203 RSL_IE_IPA_RTP_CSD_FMT ipa_rtp_csd_fmt,
Harald Welte9958a4d2017-12-14 21:21:33 +01001204
Neels Hofmeyr2bef0dd2021-04-22 21:46:00 +00001205 RSL_IE_OSMO_TrainingSequence osmo_training_sequence,
Vadim Yanitskiy1f532152021-11-01 20:37:56 +03001206 RSL_IE_OSMO_RepAcchCap rep_acch_cap,
Vadim Yanitskiya203d3b2021-11-01 21:32:31 +03001207 RSL_IE_OSMO_TopAcchCap top_acch_cap,
Pau Espin Pedrol29c6dfb2022-08-08 18:37:56 +02001208 RSL_IE_OSMO_Osmux_CID osmux_cid,
Neels Hofmeyr2bef0dd2021-04-22 21:46:00 +00001209
Harald Welte643e2a62017-11-27 15:03:18 +01001210 RSL_LV other
1211 }
1212
1213 type record RSL_IE {
1214 RSL_IE_Type iei,
1215 RSL_IE_Body body
1216 } with { variant (body) "CROSSTAG(
1217 chan_nr, iei = RSL_IE_CHAN_NR;
1218 link_id, iei = RSL_IE_LINK_IDENT;
1219 l3_info, iei = RSL_IE_L3_INFO;
1220 rlm_cause, iei = RSL_IE_RLM_CAUSE;
1221 release_mode, iei = RSL_IE_RELEASE_MODE;
1222 act_type, iei = RSL_IE_ACT_TYPE;
Vadim Yanitskiye02dbcc2020-08-25 04:20:51 +07001223 chan_ident, iei = RSL_IE_CHAN_IDENT;
Harald Welte643e2a62017-11-27 15:03:18 +01001224 chan_mode, iei = RSL_IE_CHAN_MODE;
1225 handover_ref, iei = RSL_IE_HANDO_REF;
1226 bs_power, iei = RSL_IE_BS_POWER;
Vadim Yanitskiy802508e2020-11-11 07:25:47 +07001227 bs_power_params, iei = RSL_IE_BS_POWER_PARAM;
Harald Welte643e2a62017-11-27 15:03:18 +01001228 ms_power, iei = RSL_IE_MS_POWER;
Eric Wild61edb7e2019-06-03 12:38:31 +02001229 ms_power_params, iei = RSL_IE_MS_POWER_PARAM;
Harald Welte643e2a62017-11-27 15:03:18 +01001230 timing_adv, iei = RSL_IE_TIMING_ADVANCE;
Pau Espin Pedrolf7634dc2022-09-02 17:56:00 +02001231 multirate_cfg, iei = RSL_IE_MR_CONFIG;
Harald Welte643e2a62017-11-27 15:03:18 +01001232 multirate_ctrl, iei = RSL_IE_MR_CONTROL;
Harald Weltea6706152019-05-19 20:38:18 +02001233 msg_id, iei = RSL_IE_MSG_ID;
Harald Welte643e2a62017-11-27 15:03:18 +01001234
1235 frame_nr, iei = RSL_IE_FRAME_NUMBER;
1236 cause, iei = RSL_IE_CAUSE;
1237 access_delay, iei = RSL_IE_ACCESS_DELAY;
Harald Welted5f521e2017-12-07 17:53:06 +01001238 rach_load, iei = RSL_IE_RACH_LOAD;
Harald Welte643e2a62017-11-27 15:03:18 +01001239 meas_res_nr, iei = RSL_IE_MEAS_RES_NR;
Harald Welte2691adf2018-02-22 17:32:39 +01001240 ms_timing_offset, iei = RSL_IE_MS_TIMING_OFFSET;
1241 uplink_meas, iei = RSL_IE_UPLINK_MEAS;
Harald Welte643e2a62017-11-27 15:03:18 +01001242 l1_info, iei = RSL_IE_L1_INFO;
1243 sysinfo_type, iei = RSL_IE_SYSINFO_TYPE;
1244 paging_load, iei = RSL_IE_PAGING_LOAD;
1245 paging_group, iei = RSL_IE_PAGING_GROUP;
1246 chan_needed, iei = RSL_IE_CHAN_NEEDED;
Harald Weltecc373202018-09-10 10:28:21 +02001247 cb_cmd_type, iei = RSL_IE_CB_CMD_TYPE;
1248 smscb_message, iei = RSL_IE_SMSCB_MSG;
Harald Welte4a129f82019-05-21 16:35:22 +02001249 cbch_load_info, iei = RSL_IE_CBCH_LOAD_INFO;
Vadim Yanitskiy9f699532021-06-03 17:29:22 +02001250 resource_info, iei = RSL_IE_RESOURCE_INFO;
Harald Weltec8d363c2019-05-19 20:36:48 +02001251 sacch_info, iei = RSL_IE_SACCH_INFO;
Harald Welte643e2a62017-11-27 15:03:18 +01001252 starting_time, iei = RSL_IE_STARTNG_TIME;
Harald Welte73cd2712017-12-17 00:44:52 +01001253 encr_info, iei = RSL_IE_ENCR_INFO;
Harald Weltea3ff6702019-05-20 20:03:50 +02001254 smscb_chan_ind, iei = RSL_IE_SMSCB_CHAN_INDICATOR;
Harald Welte643e2a62017-11-27 15:03:18 +01001255
1256 req_ref, iei = RSL_IE_REQ_REFERENCE;
Harald Weltefff69302017-12-07 17:53:42 +01001257 full_imm_ass_info, iei = RSL_IE_FULL_IMM_ASS_INFO;
1258 ms_identity, iei = RSL_IE_MS_IDENTITY;
1259 other, iei = RSL_IE_FULL_BCCH_INFO;
Harald Welte643e2a62017-11-27 15:03:18 +01001260
Harald Weltee33e5152023-04-09 23:29:48 +02001261 group_call_ref, iei = RSL_IE_GROUP_CALL_REF;
1262 group_chan_desc, iei = RSL_IE_GROUP_CHAN_DESC;
1263 nch_drx_info, iei = RSL_IE_NCH_DRX_INFO;
1264 cmd_indicator, iei = RSL_IE_CMD_INDICATOR;
1265 uic, iei = RSL_IE_UIC;
1266
Harald Welte9958a4d2017-12-14 21:21:33 +01001267 ipa_conn_id, iei = RSL_IE_IPAC_CONN_ID;
1268 ipa_remote_ip, iei = RSL_IE_IPAC_REMOTE_IP;
1269 ipa_remote_port, iei = RSL_IE_IPAC_REMOTE_PORT;
1270 ipa_local_ip, iei = RSL_IE_IPAC_LOCAL_IP;
1271 ipa_local_port, iei = RSL_IE_IPAC_LOCAL_PORT;
1272 ipa_rtp_pt, iei = RSL_IE_IPAC_RTP_PAYLOAD;
1273 ipa_rtp_pt2, iei = RSL_IE_IPAC_RTP_PAYLOAD2;
1274 ipa_stats, iei = RSL_IE_IPAC_CONN_STAT;
1275 ipa_speech_mode, iei = RSL_IE_IPAC_SPEECH_MODE;
Oliver Smithbc392a82023-04-17 14:06:42 +02001276 ipa_rtp_csd_fmt, iei = RSL_IE_IPAC_RTP_CSD_FMT;
Harald Welte9958a4d2017-12-14 21:21:33 +01001277
Neels Hofmeyr2bef0dd2021-04-22 21:46:00 +00001278 osmo_training_sequence, iei = RSL_IE_OSMO_TRAINING_SEQUENCE;
Vadim Yanitskiy1f532152021-11-01 20:37:56 +03001279 rep_acch_cap, iei = RSL_IE_OSMO_REP_ACCH_CAP;
Vadim Yanitskiya203d3b2021-11-01 21:32:31 +03001280 top_acch_cap, iei = RSL_IE_OSMO_TOP_ACCH_CAP;
Pau Espin Pedrol29c6dfb2022-08-08 18:37:56 +02001281 osmux_cid, iei = RSL_IE_OSMO_OSMUX_CID;
Neels Hofmeyr2bef0dd2021-04-22 21:46:00 +00001282
Harald Welte643e2a62017-11-27 15:03:18 +01001283 other, OTHERWISE;
1284 )" };
1285
Harald Welte735dd072017-12-12 14:55:17 +01001286 /* For some reason the TTCN-3 RAW codec cannot automatically figure out the IEI
1287 * that it needs to set for a given union-choice (body). So we have to explicitly
1288 * specify the IEI by the caller :( */
Harald Welteefa7d912018-04-18 23:22:15 +02001289 template (value) RSL_IE t_RSL_IE(RSL_IE_Type iei, template (value) RSL_IE_Body body) := {
Harald Welte735dd072017-12-12 14:55:17 +01001290 iei := iei,
Harald Welte643e2a62017-11-27 15:03:18 +01001291 body := body
1292 }
1293
Harald Weltec2877752017-12-07 17:54:35 +01001294 template RSL_IE tr_RSL_IE(template RSL_IE_Body body) := {
1295 iei := ?, /* overwritten? */
1296 body := body
1297 }
1298
1299
Harald Welte643e2a62017-11-27 15:03:18 +01001300 type record of RSL_IE RSL_IE_List;
1301
1302 type record RSL_Message {
1303 RSL_MessageDiscriminator msg_disc,
1304 RSL_MessageType msg_type,
1305 RSL_IE_List ies optional
1306 }
1307
1308 external function enc_RSL_Message(in RSL_Message msg) return octetstring
1309 with { extension "prototype(convert) encode(RAW)" };
1310 external function dec_RSL_Message(in octetstring stream) return RSL_Message
1311 with { extension "prototype(convert) decode(RAW)" };
1312
Harald Weltebc330be2017-12-09 00:56:36 +01001313 template RSL_Message tr_RSL_MsgDiscType(template RSL_MessageDiscriminator m_disc,
Harald Welte643e2a62017-11-27 15:03:18 +01001314 RSL_MessageType m_type) := {
1315 msg_disc := m_disc,
1316 msg_type := m_type,
1317 ies := *
1318 }
1319
Harald Welteefa7d912018-04-18 23:22:15 +02001320 template (value) RSL_Message ts_RSL_MsgDiscType(template (value) RSL_MessageDiscriminator m_disc,
1321 template (value) RSL_MessageType msg_type,
1322 template (omit) RSL_IE_List ies := omit) := {
Harald Welte4a267362017-12-09 17:49:32 +01001323 msg_disc := m_disc,
1324 msg_type := msg_type,
1325 ies := ies
1326 }
1327
Harald Weltebc330be2017-12-09 00:56:36 +01001328template RSL_Message tr_RSL_MsgType(template RSL_MessageType msg_type) := {
1329 msg_disc := ?,
1330 msg_type := msg_type,
1331 ies := *
1332}
1333
1334/* Common Channel Management */
1335template RSL_Message tr_RSL_MsgTypeC(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
1336 msg_disc := { RSL_MDISC_CCHAN, ? }
1337}
1338
1339/* RLL */
1340template RSL_Message tr_RSL_MsgTypeR(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
1341 msg_disc := { RSL_MDISC_RLL, true }
1342}
1343
1344/* Dedicated Channel Management */
1345template RSL_Message tr_RSL_MsgTypeD(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
1346 msg_disc := { RSL_MDISC_DCHAN, ? }
1347}
1348
Vadim Yanitskiybf2aa492022-06-01 00:28:38 +06001349/* TRX Management */
Harald Weltebc330be2017-12-09 00:56:36 +01001350template RSL_Message tr_RSL_MsgTypeT(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
1351 msg_disc := { RSL_MDISC_TRX_MGMT, ? }
1352}
1353
1354
1355/* dedicated channel or RLL */
1356template RSL_Message tr_RSL_MsgTypeDR(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
Harald Weltee5408222018-01-29 21:57:58 +01001357 msg_disc := ({RSL_MDISC_DCHAN,?}, {RSL_MDISC_RLL,?}, {RSL_MDISC_IPACCESS,false})
Harald Weltebc330be2017-12-09 00:56:36 +01001358}
1359
1360
Harald Welte643e2a62017-11-27 15:03:18 +01001361 /* 8.3.1 BSC -> BTS */
Harald Welteefa7d912018-04-18 23:22:15 +02001362 template (value) RSL_Message ts_RSL_DATA_REQ(template (value) RslChannelNr chan_nr,
1363 template (value) RslLinkId link_id,
1364 octetstring l3_info) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001365 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, true),
1366 msg_type := RSL_MT_DATA_REQ,
1367 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001368 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1369 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
1370 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
Harald Welte643e2a62017-11-27 15:03:18 +01001371 }
1372 }
1373
Harald Welte7794d5b2017-12-16 23:00:20 +01001374 template RSL_Message tr_RSL_DATA_REQ(template RslChannelNr chan_nr :=?,
1375 template RslLinkId link_id := ?,
1376 template octetstring l3_info := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001377 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, true),
Harald Welte7794d5b2017-12-16 23:00:20 +01001378 msg_type := RSL_MT_DATA_REQ,
1379 ies :={
1380 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1381 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
1382 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
1383 }
1384 }
1385
1386
Harald Welte643e2a62017-11-27 15:03:18 +01001387 /* 8.3.2 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001388 template (value) RSL_Message ts_RSL_DATA_IND(template (value) RslChannelNr chan_nr,
1389 template (value) RslLinkId link_id,
1390 octetstring l3_info) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001391 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, true),
1392 msg_type := RSL_MT_DATA_IND,
1393 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001394 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1395 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
1396 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
Harald Welte643e2a62017-11-27 15:03:18 +01001397 }
1398 }
Harald Welte9abd1282018-02-19 19:18:17 +01001399 template RSL_Message tr_RSL_DATA_IND(template RslChannelNr chan_nr, template RslLinkId link_id,
1400 template octetstring l3_info := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001401 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, true),
Harald Welte9abd1282018-02-19 19:18:17 +01001402 msg_type := RSL_MT_DATA_IND,
1403 ies :={
1404 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1405 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
1406 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
1407 }
1408 }
Harald Welte643e2a62017-11-27 15:03:18 +01001409
1410 /* 8.3.3 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001411 template (value) RSL_Message ts_RSL_ERROR_IND(template (value) RslChannelNr chan_nr,
Harald Weltea7d81f12019-06-02 22:33:19 +02001412 template (value) RslLinkId link_id,
1413 template (value) octetstring rlm_cause) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001414 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1415 msg_type := RSL_MT_ERROR_IND,
1416 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001417 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1418 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
Harald Weltea7d81f12019-06-02 22:33:19 +02001419 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{rlm_cause := ts_RSL_LV(rlm_cause)})
Harald Welte643e2a62017-11-27 15:03:18 +01001420 }
1421 }
Harald Welte9abd1282018-02-19 19:18:17 +01001422 template RSL_Message tr_RSL_ERROR_IND(template RslChannelNr chan_nr, template RslLinkId link_id,
Harald Weltea7d81f12019-06-02 22:33:19 +02001423 template octetstring rlm_cause := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001424 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001425 msg_type := RSL_MT_ERROR_IND,
1426 ies :={
1427 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1428 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
Harald Weltea7d81f12019-06-02 22:33:19 +02001429 tr_RSL_IE(RSL_IE_Body:{rlm_cause := tr_RSL_LV(rlm_cause)})
Harald Welte9abd1282018-02-19 19:18:17 +01001430 }
1431 }
Harald Welte643e2a62017-11-27 15:03:18 +01001432
Harald Welteefa7d912018-04-18 23:22:15 +02001433 /* 8.3.4 BTS <- BSC */
1434 template (value) RSL_Message ts_RSL_EST_REQ(template (value) RslChannelNr chan_nr,
1435 template (value) RslLinkId link_id) := {
1436 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1437 msg_type := RSL_MT_EST_REQ,
1438 ies := {
1439 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1440 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
1441 }
1442 }
1443 template RSL_Message tr_RSL_EST_REQ(template RslChannelNr chan_nr, template RslLinkId link_id) := {
1444 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
1445 msg_type := RSL_MT_EST_REQ,
1446 ies := {
1447 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1448 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1449 }
1450 }
1451
1452 /* 8.3.5 BTS -> BSC */
1453 template (value) RSL_Message ts_RSL_EST_CONF(template (value) RslChannelNr chan_nr,
1454 template (value) RslLinkId link_id) := {
1455 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1456 msg_type := RSL_MT_EST_CONF,
1457 ies := {
1458 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1459 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
1460 }
1461 }
1462 template RSL_Message tr_RSL_EST_CONF(template RslChannelNr chan_nr, template RslLinkId link_id) := {
1463 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
1464 msg_type := RSL_MT_EST_CONF,
1465 ies := {
1466 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1467 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1468 }
1469 }
1470
Harald Welte643e2a62017-11-27 15:03:18 +01001471 /* 8.3.6 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001472 template (value) RSL_Message ts_RSL_EST_IND(template (value) RslChannelNr chan_nr,
1473 template (value) RslLinkId link_id,
1474 octetstring l3_info) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001475 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1476 msg_type := RSL_MT_EST_IND,
1477 ies := {
Harald Welte735dd072017-12-12 14:55:17 +01001478 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1479 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
1480 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
Harald Welte643e2a62017-11-27 15:03:18 +01001481 }
1482 }
Harald Welte9abd1282018-02-19 19:18:17 +01001483 template RSL_Message tr_RSL_EST_IND(template RslChannelNr chan_nr, template RslLinkId link_id,
1484 template octetstring l3_info := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001485 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001486 msg_type := RSL_MT_EST_IND,
1487 ies := {
1488 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1489 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
1490 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
1491 }
1492 }
Harald Welte0472ab42018-03-12 15:02:26 +01001493 template RSL_Message tr_RSL_EST_IND_NOL3(template RslChannelNr chan_nr, template RslLinkId link_id) :=
1494{
1495 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
1496 msg_type := RSL_MT_EST_IND,
1497 ies := {
1498 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1499 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1500 }
1501 }
1502
Harald Welte643e2a62017-11-27 15:03:18 +01001503
1504 /* 8.3.7 BSC -> BTS */
Harald Welteefa7d912018-04-18 23:22:15 +02001505 template (value) RSL_Message ts_RSL_REL_REQ(template (value) RslChannelNr chan_nr,
Harald Welte0472ab42018-03-12 15:02:26 +01001506 template (value) RslLinkId link_id,
1507 template (value) RSL_IE_ReleaseMode rel_mode := RSL_REL_MODE_NORMAL) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001508 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1509 msg_type := RSL_MT_REL_REQ,
1510 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001511 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
Harald Welte0472ab42018-03-12 15:02:26 +01001512 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
1513 t_RSL_IE(RSL_IE_RELEASE_MODE, RSL_IE_Body:{release_mode := rel_mode})
Harald Welte643e2a62017-11-27 15:03:18 +01001514 }
1515 }
Harald Weltee8a5ab12017-12-09 22:34:57 +01001516 template RSL_Message tr_RSL_REL_REQ(template RslChannelNr chan_nr,
Harald Welte0472ab42018-03-12 15:02:26 +01001517 template RslLinkId link_id,
1518 template RSL_IE_ReleaseMode rel_mode := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001519 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Weltee8a5ab12017-12-09 22:34:57 +01001520 msg_type := RSL_MT_REL_REQ,
1521 ies :={
1522 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1523 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
Harald Welte0472ab42018-03-12 15:02:26 +01001524 tr_RSL_IE(RSL_IE_Body:{release_mode := rel_mode})
Harald Weltee8a5ab12017-12-09 22:34:57 +01001525 }
1526 }
Harald Welte643e2a62017-11-27 15:03:18 +01001527
1528 /* 8.3.8 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001529 template (value) RSL_Message ts_RSL_REL_CONF(template (value) RslChannelNr chan_nr,
1530 template (value) RslLinkId link_id) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001531 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1532 msg_type := RSL_MT_REL_CONF,
1533 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001534 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1535 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
Harald Welte643e2a62017-11-27 15:03:18 +01001536 }
1537 }
Harald Welte9abd1282018-02-19 19:18:17 +01001538 template RSL_Message tr_RSL_REL_CONF(template RslChannelNr chan_nr, template RslLinkId link_id) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001539 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001540 msg_type := RSL_MT_REL_CONF,
1541 ies :={
1542 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1543 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1544 }
1545 }
Harald Welte643e2a62017-11-27 15:03:18 +01001546
1547 /* 8.3.9 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001548 template (value) RSL_Message ts_RSL_REL_IND(template (value) RslChannelNr chan_nr,
1549 template (value) RslLinkId link_id) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001550 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1551 msg_type := RSL_MT_REL_IND,
1552 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001553 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1554 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
Harald Welte643e2a62017-11-27 15:03:18 +01001555 }
1556 }
Harald Welte9abd1282018-02-19 19:18:17 +01001557 template RSL_Message tr_RSL_REL_IND(template RslChannelNr chan_nr, template RslLinkId link_id) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001558 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001559 msg_type := RSL_MT_REL_IND,
1560 ies :={
1561 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1562 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1563 }
1564 }
Harald Welte643e2a62017-11-27 15:03:18 +01001565
1566 /* 8.3.10 BSC -> BTS */
Harald Welteefa7d912018-04-18 23:22:15 +02001567 template (value) RSL_Message ts_RSL_UNITDATA_REQ(template (value) RslChannelNr chan_nr,
1568 template (value) RslLinkId link_id,
1569 octetstring l3_info)
Harald Welte643e2a62017-11-27 15:03:18 +01001570 modifies ts_RSL_DATA_REQ := {
1571 msg_type := RSL_MT_UNIT_DATA_REQ
1572 }
Harald Welte0472ab42018-03-12 15:02:26 +01001573 template RSL_Message tr_RSL_UNITDATA_REQ(template RslChannelNr chan_nr,
1574 template RslLinkId link_id,
Vadim Yanitskiy8f98d3f2018-10-03 17:58:10 +07001575 template octetstring l3_info := ?)
Harald Welte0472ab42018-03-12 15:02:26 +01001576 modifies tr_RSL_DATA_REQ := {
1577 msg_type := RSL_MT_UNIT_DATA_REQ
1578 }
1579
Harald Welte643e2a62017-11-27 15:03:18 +01001580
1581 /* 8.3.11 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001582 template (value) RSL_Message ts_RSL_UNITDATA_IND(template (value) RslChannelNr chan_nr,
1583 template (value) RslLinkId link_id,
1584 octetstring l3_info)
Harald Welte643e2a62017-11-27 15:03:18 +01001585 modifies ts_RSL_DATA_IND := {
1586 msg_type := RSL_MT_UNIT_DATA_IND
1587 }
Harald Welte0472ab42018-03-12 15:02:26 +01001588 template RSL_Message tr_RSL_UNITDATA_IND(template RslChannelNr chan_nr,
Vadim Yanitskiyfabe0f22018-10-03 17:51:47 +07001589 template RslLinkId link_id,
Vadim Yanitskiy8f98d3f2018-10-03 17:58:10 +07001590 template octetstring l3_info := ?)
Harald Welte0472ab42018-03-12 15:02:26 +01001591 modifies tr_RSL_DATA_IND := {
1592 msg_type := RSL_MT_UNIT_DATA_IND
1593 }
1594
1595
Harald Welte643e2a62017-11-27 15:03:18 +01001596
1597
1598 /* DEDICATED CANNEL MANAGEMENT MESSAGES */
1599
1600 /* 8.4.1 BSC -> BTS */
Harald Welteefa7d912018-04-18 23:22:15 +02001601 template (value) RSL_Message ts_RSL_CHAN_ACT(template (value) RslChannelNr chan_nr,
Harald Welte921f9e02019-05-19 22:27:11 +02001602 template (value) RSL_IE_ChannelMode mode,
1603 template (value) RSL_IE_ActivationType at := t_RSL_IE_ActType_IA) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001604 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1605 msg_type := RSL_MT_CHAN_ACTIV,
1606 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001607 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
Harald Welte921f9e02019-05-19 22:27:11 +02001608 t_RSL_IE(RSL_IE_ACT_TYPE, RSL_IE_Body:{act_type := at}),
Harald Welte735dd072017-12-12 14:55:17 +01001609 t_RSL_IE(RSL_IE_CHAN_MODE, RSL_IE_Body:{chan_mode := mode})
Harald Welte643e2a62017-11-27 15:03:18 +01001610 /* lots of optional IEs */
1611 }
1612 }
Harald Welte94e0c342018-04-07 11:33:23 +02001613 template RSL_Message tr_RSL_CHAN_ACT(template RslChannelNr chan_nr,
Harald Welte921f9e02019-05-19 22:27:11 +02001614 template RSL_IE_ChannelMode mode,
1615 template (value) RSL_IE_ActivationType at := t_RSL_IE_ActType_IA) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001616 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte94e0c342018-04-07 11:33:23 +02001617 msg_type := RSL_MT_CHAN_ACTIV,
1618 ies :={
1619 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
Harald Welte921f9e02019-05-19 22:27:11 +02001620 tr_RSL_IE(RSL_IE_Body:{act_type := at}),
Harald Welte94e0c342018-04-07 11:33:23 +02001621 tr_RSL_IE(RSL_IE_Body:{chan_mode := mode}),
1622 /* lots of optional IEs */
1623 *
1624 }
1625 }
Vadim Yanitskiy58b16532021-10-09 20:27:39 +06001626
1627 template (value) RSL_Message
1628 ts_RSL_CHAN_ACT_PDCH(template (value) RslChannelNr chan_nr) := {
1629 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1630 msg_type := RSL_MT_CHAN_ACTIV,
1631 ies :={
1632 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1633 t_RSL_IE(RSL_IE_ACT_TYPE, RSL_IE_Body:{act_type := c_RSL_IE_ActType_PDCH})
1634 }
1635 }
1636 template RSL_Message
1637 tr_RSL_CHAN_ACT_PDCH(template (present) RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001638 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte94e0c342018-04-07 11:33:23 +02001639 msg_type := RSL_MT_CHAN_ACTIV,
1640 ies :={
1641 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
Vadim Yanitskiy58b16532021-10-09 20:27:39 +06001642 tr_RSL_IE(RSL_IE_Body:{act_type := c_RSL_IE_ActType_PDCH}),
Harald Welte94e0c342018-04-07 11:33:23 +02001643 /* lots of optional IEs */
1644 *
1645 }
1646 }
1647
Harald Welte643e2a62017-11-27 15:03:18 +01001648
1649 /* 8.4.2 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001650 template (value) RSL_Message ts_RSL_CHAN_ACT_ACK(template (value) RslChannelNr chan_nr,
1651 GsmFrameNumber fn) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001652 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1653 msg_type := RSL_MT_CHAN_ACTIV_ACK,
1654 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001655 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1656 t_RSL_IE(RSL_IE_FRAME_NUMBER, RSL_IE_Body:{frame_nr := ts_RSL_IE_FrameNumber(fn)})
Harald Welte643e2a62017-11-27 15:03:18 +01001657 }
1658 }
Harald Welte9abd1282018-02-19 19:18:17 +01001659 template RSL_Message tr_RSL_CHAN_ACT_ACK(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001660 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001661 msg_type := RSL_MT_CHAN_ACTIV_ACK,
1662 ies := {
1663 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1664 tr_RSL_IE(RSL_IE_Body:{frame_nr := ?})
1665 }
1666 }
Harald Welte643e2a62017-11-27 15:03:18 +01001667
1668 /* 8.4.3 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001669 template (value) RSL_Message ts_RSL_CHAN_ACT_NACK(template (value) RslChannelNr chan_nr,
1670 RSL_Cause cause) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001671 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1672 msg_type := RSL_MT_CHAN_ACTIV_NACK,
1673 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001674 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1675 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
Harald Welte643e2a62017-11-27 15:03:18 +01001676 }
1677 }
Harald Welte9abd1282018-02-19 19:18:17 +01001678 template RSL_Message tr_RSL_CHAN_ACT_NACK(template RslChannelNr chan_nr,
1679 template RSL_Cause cause := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001680 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001681 msg_type := RSL_MT_CHAN_ACTIV_NACK,
1682 ies := {
1683 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1684 tr_RSL_IE(RSL_IE_Body:{cause := ?})
1685 }
1686 }
Harald Welte643e2a62017-11-27 15:03:18 +01001687
1688 /* 8.4.4 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001689 template (value) RSL_Message ts_RSL_CONN_FAIL_IND(RslChannelNr chan_nr, RSL_Cause cause) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001690 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1691 msg_type := RSL_MT_CONN_FAIL,
1692 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001693 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1694 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
Harald Welte643e2a62017-11-27 15:03:18 +01001695 }
1696 }
Harald Welte9abd1282018-02-19 19:18:17 +01001697 template RSL_Message tr_RSL_CONN_FAIL_IND(template RslChannelNr chan_nr,
1698 template RSL_Cause cause := ?) := {
1699 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1700 msg_type := RSL_MT_CONN_FAIL,
1701 ies :={
1702 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1703 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
1704 }
1705 }
Harald Welte643e2a62017-11-27 15:03:18 +01001706
Harald Weltee8a5ab12017-12-09 22:34:57 +01001707 /* 8.4.5 BSC -> BTS */
1708 template RSL_Message tr_RSL_DEACT_SACCH(template RslChannelNr chan_nr) := {
1709 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1710 msg_type := RSL_MT_DEACTIVATE_SACCH,
1711 ies := {
1712 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
1713 }
1714 }
Harald Welteefa7d912018-04-18 23:22:15 +02001715 template (value) RSL_Message ts_RSL_DEACT_SACCH(template (value) RslChannelNr chan_nr) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001716 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1717 msg_type := RSL_MT_DEACTIVATE_SACCH,
1718 ies := {
1719 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1720 }
1721 }
1722
Harald Weltee8a5ab12017-12-09 22:34:57 +01001723
Harald Welte73cd2712017-12-17 00:44:52 +01001724 /* 8.4.6 BSC ->BTS */
1725 template RSL_Message tr_RSL_ENCR_CMD(template RslChannelNr chan_nr,
1726 template RslLinkId link_id := ?,
Harald Weltee613f962018-04-18 22:38:16 +02001727 template RSL_AlgId alg := ?,
Harald Welte73cd2712017-12-17 00:44:52 +01001728 template octetstring key := ?,
1729 template octetstring l3_info := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001730 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte73cd2712017-12-17 00:44:52 +01001731 msg_type := RSL_MT_ENCR_CMD,
1732 ies := {
1733 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1734 tr_RSL_IE(RSL_IE_Body:{encr_info := tr_RSL_IE_EncrInfo(alg, key)}),
1735 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
1736 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
1737 }
1738 }
Harald Welteefa7d912018-04-18 23:22:15 +02001739 template (value) RSL_Message ts_RSL_ENCR_CMD(template (value) RslChannelNr chan_nr,
1740 template (value) RslLinkId link_id,
Harald Weltee613f962018-04-18 22:38:16 +02001741 template (value) RSL_AlgId alg, octetstring key,
Harald Welteefa7d912018-04-18 23:22:15 +02001742 octetstring l3_info) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001743 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1744 msg_type := RSL_MT_ENCR_CMD,
1745 ies := {
1746 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
Harald Welteefa7d912018-04-18 23:22:15 +02001747 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 +01001748 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
Harald Welteefa7d912018-04-18 23:22:15 +02001749 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
Harald Welte9abd1282018-02-19 19:18:17 +01001750 }
1751 }
Harald Welte73cd2712017-12-17 00:44:52 +01001752
Harald Welte2691adf2018-02-22 17:32:39 +01001753 template RSL_Message tr_RSL_MEAS_RES(template RslChannelNr chan_nr,
1754 template uint8_t meas_res_nr := ?,
1755 template RSL_IE_UplinkMeas ul_meas := ?,
1756 template RSL_IE_BS_Power bs_power := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001757 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte2691adf2018-02-22 17:32:39 +01001758 msg_type := RSL_MT_MEAS_RES,
1759 ies := {
1760 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1761 tr_RSL_IE(RSL_IE_Body:{meas_res_nr := meas_res_nr}),
1762 tr_RSL_IE(RSL_IE_Body:{uplink_meas := ul_meas}),
1763 tr_RSL_IE(RSL_IE_Body:{bs_power := bs_power}),
1764 *
1765 }
1766 }
1767
Vadim Yanitskiy7c29c4e2022-06-18 03:07:50 +07001768 /* Templates for a measurement report that lacks the measurement report
Philipp Maierdd841d32019-12-17 14:44:54 +01001769 * from the MS (l1_info, l3_info and ms timing offset */
Vadim Yanitskiy7c29c4e2022-06-18 03:07:50 +07001770 template (value) RSL_Message
1771 ts_RSL_MEAS_RES_EMPTY(template (value) RslChannelNr chan_nr,
1772 template (value) uint8_t meas_res_nr,
1773 template (value) RSL_IE_UplinkMeas ul_meas,
1774 template (value) RSL_IE_BS_Power bs_power) := {
1775 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1776 msg_type := RSL_MT_MEAS_RES,
1777 ies := {
1778 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1779 t_RSL_IE(RSL_IE_MEAS_RES_NR, RSL_IE_Body:{meas_res_nr := meas_res_nr}),
1780 t_RSL_IE(RSL_IE_UPLINK_MEAS, RSL_IE_Body:{uplink_meas := ul_meas}),
1781 t_RSL_IE(RSL_IE_BS_POWER, RSL_IE_Body:{bs_power := bs_power})
1782 }
1783 }
1784 template RSL_Message
1785 tr_RSL_MEAS_RES_EMPTY(template (present) RslChannelNr chan_nr,
1786 template uint8_t meas_res_nr := ?,
1787 template RSL_IE_UplinkMeas ul_meas := ?,
1788 template RSL_IE_BS_Power bs_power := ?) := {
Philipp Maierdd841d32019-12-17 14:44:54 +01001789 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1790 msg_type := RSL_MT_MEAS_RES,
1791 ies := {
1792 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1793 tr_RSL_IE(RSL_IE_Body:{meas_res_nr := meas_res_nr}),
1794 tr_RSL_IE(RSL_IE_Body:{uplink_meas := ul_meas}),
1795 tr_RSL_IE(RSL_IE_Body:{bs_power := bs_power})
1796 }
1797 }
1798
Harald Welte39b47be2018-02-23 18:58:48 +01001799 /* Osmocom specific template, require lots of optional fields to be present */
1800 template RSL_Message tr_RSL_MEAS_RES_OSMO(template RslChannelNr chan_nr,
1801 template uint8_t meas_res_nr := ?,
1802 template RSL_IE_UplinkMeas ul_meas := ?,
1803 template RSL_IE_BS_Power bs_power := ?,
1804 template RSL_IE_L1Info l1_info := ?,
1805 template octetstring l3_info := ?,
1806 template uint8_t ms_to := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001807 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte39b47be2018-02-23 18:58:48 +01001808 msg_type := RSL_MT_MEAS_RES,
1809 ies := {
1810 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1811 tr_RSL_IE(RSL_IE_Body:{meas_res_nr := meas_res_nr}),
1812 tr_RSL_IE(RSL_IE_Body:{uplink_meas := ul_meas}),
1813 tr_RSL_IE(RSL_IE_Body:{bs_power := bs_power}),
1814 tr_RSL_IE(RSL_IE_Body:{l1_info := l1_info}),
1815 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)}),
1816 tr_RSL_IE(RSL_IE_Body:{ms_timing_offset := ms_to})
1817 }
1818 }
1819
Neels Hofmeyrafe2ea52021-11-24 15:16:12 +01001820 template (value) RSL_Message ts_RSL_MEAS_RES(template (value) RslChannelNr chan_nr,
1821 uint8_t meas_res_nr,
1822 template (value) RSL_IE_UplinkMeas ul_meas,
1823 template (value) RSL_IE_BS_Power bs_power,
1824 template (value) RSL_IE_L1Info l1_info,
1825 octetstring l3_info,
1826 uint8_t ms_to) := {
1827 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1828 msg_type := RSL_MT_MEAS_RES,
1829 ies := {
1830 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1831 t_RSL_IE(RSL_IE_MEAS_RES_NR, RSL_IE_Body:{meas_res_nr := meas_res_nr}),
1832 t_RSL_IE(RSL_IE_UPLINK_MEAS, RSL_IE_Body:{uplink_meas := ul_meas}),
1833 t_RSL_IE(RSL_IE_BS_POWER, RSL_IE_Body:{bs_power := bs_power}),
1834 t_RSL_IE(RSL_IE_L1_INFO, RSL_IE_Body:{l1_info := l1_info}),
1835 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)}),
1836 t_RSL_IE(RSL_IE_MS_TIMING_OFFSET, RSL_IE_Body:{ms_timing_offset := ms_to})
1837 }
1838 }
1839
Eric Wildf1827a72019-05-28 17:37:35 +02001840 /* 8.4.9 BSC -> BTS */
1841 template (value) RSL_Message ts_RSL_MODE_MODIFY_REQ(template (value) RslChannelNr chan_nr,
1842 template (value) RSL_IE_ChannelMode mode) := {
1843 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1844 msg_type := RSL_MT_MODE_MODIFY_REQ,
1845 ies :={
1846 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1847 t_RSL_IE(RSL_IE_CHAN_MODE, RSL_IE_Body:{chan_mode := mode})
1848 /* lots of optional IEs */
1849 }
1850 }
1851 template RSL_Message tr_RSL_MODE_MODIFY_REQ(template RslChannelNr chan_nr,
1852 template RSL_IE_ChannelMode mode) := {
1853 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1854 msg_type := RSL_MT_MODE_MODIFY_REQ,
1855 ies :={
1856 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1857 tr_RSL_IE(RSL_IE_Body:{chan_mode := mode}),
1858 /* lots of optional IEs */
1859 *
1860 }
1861 }
Neels Hofmeyr9f3e6ac2021-04-08 23:09:24 +02001862
1863 template RSL_Message tr_RSL_MODE_MODIFY_REQ_with_OSMO_TSC(template RslChannelNr chan_nr,
1864 template RSL_IE_ChannelMode mode,
1865 template uint8_t tsc_set := ?,
1866 template uint8_t tsc := ?) := {
1867 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1868 msg_type := RSL_MT_MODE_MODIFY_REQ,
1869 ies := {
1870 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1871 tr_RSL_IE(RSL_IE_Body:{chan_mode := mode}),
1872 tr_RSL_IE(RSL_IE_Body:{osmo_training_sequence := {
1873 len := ?,
1874 tsc_set := tsc_set,
1875 tsc := tsc
1876 }
1877 })
1878 }
1879 };
Pau Espin Pedrol85393122022-09-02 17:56:25 +02001880
Harald Welte7794d5b2017-12-16 23:00:20 +01001881 /* 8.4.10 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001882 template (value) RSL_Message ts_RSL_MODE_MODIFY_ACK(template (value) RslChannelNr chan_nr) := {
Harald Welte7794d5b2017-12-16 23:00:20 +01001883 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1884 msg_type := RSL_MT_MODE_MODIFY_ACK,
1885 ies := {
1886 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1887 }
1888 }
Harald Welte9abd1282018-02-19 19:18:17 +01001889 template RSL_Message tr_RSL_MODE_MODIFY_ACK(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001890 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001891 msg_type := RSL_MT_MODE_MODIFY_ACK,
1892 ies := {
1893 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
1894 }
1895 }
Harald Welte7794d5b2017-12-16 23:00:20 +01001896
Harald Welte643e2a62017-11-27 15:03:18 +01001897 /* 8.4.11 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001898 template (value) RSL_Message ts_RSL_MODE_MODIFY_NACK(template (value) RslChannelNr chan_nr,
1899 RSL_Cause cause) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001900 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1901 msg_type := RSL_MT_MODE_MODIFY_NACK,
1902 ies := {
1903 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1904 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
1905 }
Harald Welte643e2a62017-11-27 15:03:18 +01001906 }
Harald Welte9abd1282018-02-19 19:18:17 +01001907 template RSL_Message tr_RSL_MODE_MODIFY_NACK(template RslChannelNr chan_nr,
1908 template RSL_Cause cause) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001909 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001910 msg_type := RSL_MT_MODE_MODIFY_NACK,
1911 ies := {
1912 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1913 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
1914 }
1915 }
1916
Harald Welte643e2a62017-11-27 15:03:18 +01001917
Harald Welte6a8199d2018-01-29 21:58:53 +01001918 /* 8.4.14: BTS <- BSC */
1919 template RSL_Message tr_RSL_RF_CHAN_REL(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001920 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte6a8199d2018-01-29 21:58:53 +01001921 msg_type := RSL_MT_RF_CHAN_REL,
1922 ies := {
1923 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
1924 }
1925 }
Harald Welteefa7d912018-04-18 23:22:15 +02001926 template (value) RSL_Message ts_RSL_RF_CHAN_REL(template (value) RslChannelNr chan_nr) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001927 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1928 msg_type := RSL_MT_RF_CHAN_REL,
1929 ies := {
1930 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1931 }
1932 }
Harald Welte6a8199d2018-01-29 21:58:53 +01001933
Philipp Maier4d1e9c92018-12-20 11:11:56 +01001934 /* 8.4.15: BTS <- BSC */
1935 template (value) RSL_Message ts_RSL_MS_PWR_CTRL(template (value) RslChannelNr chan_nr,
1936 template (value) RSL_IE_MS_Power ms_power) := {
1937 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1938 msg_type := RSL_MT_MS_POWER_CONTROL,
1939 ies := {
1940 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1941 t_RSL_IE(RSL_IE_MS_POWER, RSL_IE_Body:{ms_power := ms_power})
1942 /* One optional IE: MS POWER PARAMETERS */
1943 }
1944 }
1945
Eric Wild61edb7e2019-06-03 12:38:31 +02001946 template (value) RSL_Message ts_RSL_MS_PWR_CTRL_with_pp(template (value) RslChannelNr chan_nr,
1947 integer pwr_level) := {
1948 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1949 msg_type := RSL_MT_MS_POWER_CONTROL,
1950 ies := {
1951 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1952 t_RSL_IE(RSL_IE_MS_POWER, RSL_IE_Body:{ms_power := ts_RSL_IE_MS_Power(pwr_level)}),
1953 t_RSL_IE(RSL_IE_MS_POWER_PARAM, RSL_IE_Body:{ms_power_params :=
1954 ts_RSL_IE_MS_Power_Parameters(''O)})
1955 }
1956 }
1957
Eric Wildae8f2622019-06-18 17:05:11 +02001958 /* 8.4.16: BTS <- BSC */
1959 template (value) RSL_Message ts_RSL_BS_PWR_CTRL(template (value) RslChannelNr chan_nr,
1960 template (value) RSL_IE_BS_Power bs_power) := {
1961 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1962 msg_type := RSL_MT_BS_POWER_CONTROL,
1963 ies := {
1964 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1965 t_RSL_IE(RSL_IE_BS_POWER, RSL_IE_Body:{bs_power := bs_power})
1966 /* One optional IE: BS POWER PARAMETERS */
1967 }
1968 }
Vadim Yanitskiy2a5a1ef2021-06-30 00:51:48 +02001969 template RSL_Message tr_RSL_BS_PWR_CTRL(template (present) RslChannelNr chan_nr,
1970 template (present) RSL_IE_BS_Power bs_power) := {
1971 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1972 msg_type := RSL_MT_BS_POWER_CONTROL,
1973 ies := {
1974 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1975 tr_RSL_IE(RSL_IE_Body:{bs_power := bs_power})
1976 /* One optional IE: BS POWER PARAMETERS */
1977 }
1978 }
Eric Wildae8f2622019-06-18 17:05:11 +02001979
Harald Welte4a267362017-12-09 17:49:32 +01001980 /* 8.4.19 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001981 template (value) RSL_Message ts_RSL_RF_CHAN_REL_ACK(template (value) RslChannelNr chan_nr) :=
Harald Welte4a267362017-12-09 17:49:32 +01001982 ts_RSL_MsgDiscType(ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1983 RSL_MT_RF_CHAN_REL_ACK,
Harald Welte735dd072017-12-12 14:55:17 +01001984 { t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}) });
Harald Welte4a267362017-12-09 17:49:32 +01001985
Harald Welte9abd1282018-02-19 19:18:17 +01001986 template RSL_Message tr_RSL_RF_CHAN_REL_ACK(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001987 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001988 msg_type := RSL_MT_RF_CHAN_REL_ACK,
1989 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001990 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
Harald Welte9abd1282018-02-19 19:18:17 +01001991 }
1992 }
1993
Harald Welteea17b912018-03-11 22:29:31 +01001994 /* 8.6.20 BTS <- BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001995 template (value) RSL_Message ts_RSL_SACCH_INF_MOD(template (value) RslChannelNr chan_nr,
1996 RSL_IE_SysinfoType si_type,
1997 octetstring l3_info) := {
Harald Welteea17b912018-03-11 22:29:31 +01001998 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1999 msg_type := RSL_MT_SACCH_INFO_MODIFY,
2000 ies := {
2001 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2002 t_RSL_IE(RSL_IE_SYSINFO_TYPE, RSL_IE_Body:{sysinfo_type := si_type}),
2003 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
2004 }
2005 }
2006
Neels Hofmeyr378a49c2018-06-15 22:18:43 +02002007 /* 8.4.7 BTS -> BSC */
2008 template (value) RSL_Message ts_RSL_HANDO_DET(template (value) RslChannelNr chan_nr) := {
2009 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2010 msg_type := RSL_MT_HANDO_DET,
2011 ies := {
2012 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
2013 }
2014 }
Vadim Yanitskiy7c2c10c2019-05-31 20:42:01 +07002015 template RSL_Message tr_RSL_HANDO_DET(template RslChannelNr chan_nr,
2016 template uint8_t acc_delay := ?) := {
2017 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2018 msg_type := RSL_MT_HANDO_DET,
2019 ies := {
2020 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2021 tr_RSL_IE(RSL_IE_Body:{access_delay := acc_delay})
2022 }
2023 }
Neels Hofmeyr378a49c2018-06-15 22:18:43 +02002024
Harald Welteea17b912018-03-11 22:29:31 +01002025
Harald Welte643e2a62017-11-27 15:03:18 +01002026 /* COMMON CHANNEL MANAGEMENT MESSAGES */
2027
Harald Welte874c2232018-02-24 04:52:43 +01002028 /* 8.5.1 BTS <- BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02002029 template (value) RSL_Message ts_RSL_BCCH_INFO(RSL_IE_SysinfoType si_type,
2030 octetstring full_bcch_info) := {
Harald Welte874c2232018-02-24 04:52:43 +01002031 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2032 msg_type := RSL_MT_BCCH_INFO,
2033 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02002034 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_BCCH(0)}),
Harald Welte874c2232018-02-24 04:52:43 +01002035 t_RSL_IE(RSL_IE_SYSINFO_TYPE, RSL_IE_Body:{sysinfo_type := si_type}),
2036 t_RSL_IE(RSL_IE_FULL_BCCH_INFO, RSL_IE_Body:{other := ts_RSL_LV(full_bcch_info)})
2037 }
2038 }
Harald Welte09538f82019-08-01 09:50:25 +02002039 template RSL_Message tr_RSL_NO_BCCH_INFO(template RSL_IE_SysinfoType si_type := ?) := {
2040 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2041 msg_type := RSL_MT_BCCH_INFO,
2042 ies := {
2043 tr_RSL_IE(RSL_IE_Body:{chan_nr := ts_RslChanNr_BCCH(0)}),
2044 tr_RSL_IE(RSL_IE_Body:{sysinfo_type := si_type})
2045 }
2046 }
2047 template RSL_Message tr_RSL_BCCH_INFO(template RSL_IE_SysinfoType si_type := ?,
2048 template octetstring full_bcch_info := ?) := {
2049 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2050 msg_type := RSL_MT_BCCH_INFO,
2051 ies := {
2052 tr_RSL_IE(RSL_IE_Body:{chan_nr := ts_RslChanNr_BCCH(0)}),
2053 tr_RSL_IE(RSL_IE_Body:{sysinfo_type := si_type}),
2054 tr_RSL_IE(RSL_IE_Body:{other := tr_RSL_LV(full_bcch_info)}),
2055 *
2056 }
2057 }
Harald Welte874c2232018-02-24 04:52:43 +01002058
Harald Welte7ae93142017-12-07 17:56:15 +01002059 /* 8.5.2 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02002060 template (value) RSL_Message ts_RSL_RACH_LOAD_IND(uint16_t slot_ct, uint16_t busy_ct,
2061 uint16_t acc_ct) := {
Harald Welte7ae93142017-12-07 17:56:15 +01002062 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2063 msg_type := RSL_MT_CCCH_LOAD_IND,
2064 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02002065 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_RACH(0)}),
Harald Welte735dd072017-12-12 14:55:17 +01002066 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 +01002067 }
2068 }
Harald Welte68e495b2018-02-25 00:05:57 +01002069 template RSL_Message tr_RSL_RACH_LOAD_IND(template uint16_t slot_ct := ?,
2070 template uint16_t busy_ct := ?,
Harald Welte09538f82019-08-01 09:50:25 +02002071 template uint16_t acc_ct := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002072 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Welte68e495b2018-02-25 00:05:57 +01002073 msg_type := RSL_MT_CCCH_LOAD_IND,
2074 ies := {
2075 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_RACH(0)}),
2076 tr_RSL_IE(RSL_IE_Body:{rach_load := tr_RSL_IE_RachLoad(slot_ct, busy_ct, acc_ct)})
2077 }
2078 }
2079
Harald Welteefa7d912018-04-18 23:22:15 +02002080 template (value) RSL_Message ts_RSL_PAGING_LOAD_IND(uint16_t buffer_space) := {
Harald Welte7ae93142017-12-07 17:56:15 +01002081 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2082 msg_type := RSL_MT_CCCH_LOAD_IND,
2083 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02002084 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_PCH_AGCH(0)}),
Harald Welte735dd072017-12-12 14:55:17 +01002085 t_RSL_IE(RSL_IE_PAGING_LOAD, RSL_IE_Body:{paging_load := buffer_space})
Harald Welte7ae93142017-12-07 17:56:15 +01002086 }
2087 }
Harald Welte68e495b2018-02-25 00:05:57 +01002088 template RSL_Message tr_RSL_PAGING_LOAD_IND(template uint16_t buffer_space := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002089 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Welte68e495b2018-02-25 00:05:57 +01002090 msg_type := RSL_MT_CCCH_LOAD_IND,
2091 ies := {
2092 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(0)}),
2093 tr_RSL_IE(RSL_IE_Body:{paging_load := buffer_space})
2094 }
2095 }
2096
Harald Welte7ae93142017-12-07 17:56:15 +01002097
Harald Welte643e2a62017-11-27 15:03:18 +01002098 /* 8.5.3 BTS -> BSC */
Vadim Yanitskiyab448a52019-05-31 20:24:03 +07002099 template (value) RSL_Message ts_RSL_CHAN_RQD(OCT1 ra, GsmFrameNumber fn,
2100 template (value) RslChannelNr chan_nr := ts_RslChanNr_RACH(0),
2101 uint8_t acc_del := 0) := {
Harald Welte643e2a62017-11-27 15:03:18 +01002102 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2103 msg_type := RSL_MT_CHAN_RQD,
2104 ies := {
Vadim Yanitskiyab448a52019-05-31 20:24:03 +07002105 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2106 /* TODO: we may need to have optional RSL_IE_LINK_IDENT IE here */
Harald Welte735dd072017-12-12 14:55:17 +01002107 t_RSL_IE(RSL_IE_REQ_REFERENCE, RSL_IE_Body:{req_ref := ts_RSL_IE_ReqRef(ra, fn)}),
2108 t_RSL_IE(RSL_IE_ACCESS_DELAY, RSL_IE_Body:{access_delay := acc_del})
Harald Welte643e2a62017-11-27 15:03:18 +01002109 }
2110 }
Harald Welte9abd1282018-02-19 19:18:17 +01002111 template RSL_Message tr_RSL_CHAN_RQD(template OCT1 ra, template GsmFrameNumber fn := ?,
Vadim Yanitskiyab448a52019-05-31 20:24:03 +07002112 template RslChannelNr chan_nr := ts_RslChanNr_RACH(0),
2113 template uint8_t acc_del := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002114 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01002115 msg_type := RSL_MT_CHAN_RQD,
2116 ies := {
Vadim Yanitskiyab448a52019-05-31 20:24:03 +07002117 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2118 /* TODO: we may need to have optional RSL_IE_LINK_IDENT IE here */
Harald Welte9abd1282018-02-19 19:18:17 +01002119 tr_RSL_IE(RSL_IE_Body:{req_ref := tr_RSL_IE_ReqRef(ra, fn)}),
2120 tr_RSL_IE(RSL_IE_Body:{access_delay := acc_del})
2121 }
2122 }
Harald Welte643e2a62017-11-27 15:03:18 +01002123
2124 /* 8.5.4 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02002125 template (value) RSL_Message ts_DELETE_IND(template (value) RslChannelNr chan_nr,
2126 octetstring imm_ass) := {
Harald Welte643e2a62017-11-27 15:03:18 +01002127 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2128 msg_type := RSL_MT_DELETE_IND,
2129 ies := {
Harald Welte735dd072017-12-12 14:55:17 +01002130 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2131 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 +01002132 }
2133 }
Harald Weltee8d750e2018-06-10 21:41:35 +02002134 template RSL_Message tr_RSL_DELETE_IND(template octetstring imm_ass := ?, template uint3_t tn) := {
2135 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2136 msg_type := RSL_MT_DELETE_IND,
2137 ies := {
2138 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(tn)}),
2139 tr_RSL_IE(RSL_IE_Body:{full_imm_ass_info := tr_RSL_LV(imm_ass)}),
2140 *
2141 }
2142 }
Harald Welte643e2a62017-11-27 15:03:18 +01002143
Harald Weltec2877752017-12-07 17:54:35 +01002144 /* 8.5.5 BSC -> BTS */
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +07002145 template RSL_Message tr_RSL_PAGING_CMD(template MobileIdentityV mi, template uint3_t tn := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002146 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Weltec2877752017-12-07 17:54:35 +01002147 msg_type := RSL_MT_PAGING_CMD,
2148 ies := {
2149 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(tn)}),
2150 tr_RSL_IE(RSL_IE_Body:{paging_group := ?}),
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +07002151 tr_RSL_IE(RSL_IE_Body:{ms_identity := tr_MI_LV(mi)}),
Harald Weltec2877752017-12-07 17:54:35 +01002152 * /* opt: channel needed, eMLPP prio */
2153 }
2154 }
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +07002155 template (value) RSL_Message ts_RSL_PAGING_CMD(MobileIdentityV mi, uint8_t pg, uint3_t tn := 0) := {
Harald Welte9abd1282018-02-19 19:18:17 +01002156 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2157 msg_type := RSL_MT_PAGING_CMD,
2158 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02002159 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_PCH_AGCH(tn)}),
Harald Welte9abd1282018-02-19 19:18:17 +01002160 t_RSL_IE(RSL_IE_PAGING_GROUP, RSL_IE_Body:{paging_group := pg}),
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +07002161 t_RSL_IE(RSL_IE_MS_IDENTITY, RSL_IE_Body:{ms_identity := ts_MI_LV(mi)})
Harald Welte9abd1282018-02-19 19:18:17 +01002162 }
2163 }
Harald Weltec2877752017-12-07 17:54:35 +01002164
2165 /* 8.5.6 BSC -> BTS */
2166 template RSL_Message tr_RSL_IMM_ASSIGN(template uint3_t tn := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002167 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Weltec2877752017-12-07 17:54:35 +01002168 msg_type := RSL_MT_IMMEDIATE_ASSIGN_CMD,
2169 ies := {
2170 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(tn)}),
2171 tr_RSL_IE(RSL_IE_Body:{full_imm_ass_info := ?})
2172 }
2173 }
Harald Welteefa7d912018-04-18 23:22:15 +02002174 template (value) RSL_Message ts_RSL_IMM_ASSIGN(octetstring f_ass_inf, uint3_t tn := 0) := {
Harald Welte9abd1282018-02-19 19:18:17 +01002175 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2176 msg_type := RSL_MT_IMMEDIATE_ASSIGN_CMD,
2177 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02002178 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_PCH_AGCH(tn)}),
Harald Welte9abd1282018-02-19 19:18:17 +01002179 t_RSL_IE(RSL_IE_FULL_IMM_ASS_INFO, RSL_IE_Body:{full_imm_ass_info := ts_RSL_LV(f_ass_inf)})
2180 }
2181 }
Harald Weltec2877752017-12-07 17:54:35 +01002182
Harald Weltecc373202018-09-10 10:28:21 +02002183 /* 8.5.8 BTS <- BSC SMS BROADCAST COMMAND */
2184 template RSL_Message tr_RSL_SMSCB_CMD(template RSL_IE_CbCommandType cb_cmd := ?,
2185 template octetstring msg := ?,
2186 template RslChannelNr chan_nr := ?) := {
2187 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2188 msg_type := RSL_MT_SMS_BC_CMD,
2189 ies := {
2190 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2191 tr_RSL_IE(RSL_IE_Body:{cb_cmd_type := cb_cmd}),
2192 tr_RSL_IE(RSL_IE_Body:{smscb_message := tr_RSL_LV(msg)}),
2193 *
2194 }
2195 }
2196 template (value) RSL_Message ts_RSL_SMSCB_CMD(template (value) RSL_IE_CbCommandType cb_cmd,
2197 template (value) octetstring msg,
2198 template (value) RslChannelNr chan_nr :=
2199 ts_RslChanNr_SDCCH4(0, 2)) := {
2200 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2201 msg_type := RSL_MT_SMS_BC_CMD,
2202 ies := {
2203 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2204 t_RSL_IE(RSL_IE_CB_CMD_TYPE, RSL_IE_Body:{cb_cmd_type := cb_cmd}),
2205 t_RSL_IE(RSL_IE_SMSCB_MSG, RSL_IE_Body:{smscb_message := ts_RSL_LV(msg)})
2206 /* optional channel type for extended CBCH */
2207 }
2208 }
2209
Harald Welte4a129f82019-05-21 16:35:22 +02002210 /* 8.5.9 BTS -> BSC CBCH LOAD INDICATION */
2211 template RSL_Message tr_RSL_CBCH_LOAD_IND_BASIC(template boolean overflow := ?,
2212 template uint4_t slot_count := ?,
2213 template RslChannelNr chan_nr := ?) := {
2214 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2215 msg_type := RSL_MT_CBCH_LOAD_IND,
2216 ies := {
2217 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2218 tr_RSL_IE(RSL_IE_Body:{cbch_load_info := tr_CbchLoadInfo(overflow, slot_count)})
2219 }
2220 }
2221 template (value) RSL_Message ts_RSL_CBCH_LOAD_IND_BASIC(boolean overflow, uint4_t slot_count,
2222 template (value) RslChannelNr chan_nr :=
2223 ts_RslChanNr_SDCCH4(0, 2)) := {
2224 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2225 msg_type := RSL_MT_CBCH_LOAD_IND,
2226 ies := {
2227 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2228 t_RSL_IE(RSL_IE_CBCH_LOAD_INFO, RSL_IE_Body:{cbch_load_info := ts_CbchLoadInfo(overflow, slot_count)})
2229 }
2230 }
2231 template RSL_Message tr_RSL_CBCH_LOAD_IND_EXTD(template boolean overflow := ?,
2232 template uint4_t slot_count := ?,
2233 template RslChannelNr chan_nr := ?) := {
2234 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2235 msg_type := RSL_MT_CBCH_LOAD_IND,
2236 ies := {
2237 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2238 tr_RSL_IE(RSL_IE_Body:{cbch_load_info := tr_CbchLoadInfo(overflow, slot_count)}),
2239 tr_RSL_IE(RSL_IE_Body:{smscb_chan_ind := 1})
2240 }
2241 }
2242 template (value) RSL_Message ts_RSL_CBCH_LOAD_IND_EXTD(boolean overflow, uint4_t slot_count,
2243 template (value) RslChannelNr chan_nr :=
2244 ts_RslChanNr_SDCCH4(0, 2)) := {
2245 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2246 msg_type := RSL_MT_CBCH_LOAD_IND,
2247 ies := {
2248 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2249 t_RSL_IE(RSL_IE_CBCH_LOAD_INFO, RSL_IE_Body:{cbch_load_info := ts_CbchLoadInfo(overflow, slot_count)}),
2250 t_RSL_IE(RSL_IE_SMSCB_CHAN_INDICATOR, RSL_IE_Body:{smscb_chan_ind := 1})
2251 }
2252 }
2253
2254
Vadim Yanitskiy9f699532021-06-03 17:29:22 +02002255 /* 8.6.1 BTS -> BSC */
2256 template (value) RSL_Message
2257 ts_RSL_RF_RES_IND(template (value) RSL_ResourceInfo info) := {
2258 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
2259 msg_type := RSL_MT_RF_RES_IND,
2260 ies := {
2261 t_RSL_IE(RSL_IE_RESOURCE_INFO, RSL_IE_Body:{
2262 resource_info := {
2263 len := 0, /* overwritten */
2264 info := info
2265 }
2266 })
2267 }
2268 }
2269 template RSL_Message
2270 tr_RSL_RF_RES_IND(template (present) RSL_ResourceInfo info := ?) := {
2271 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
2272 msg_type := RSL_MT_RF_RES_IND,
2273 ies := {
2274 tr_RSL_IE(RSL_IE_Body:{
2275 resource_info := {
2276 len := ?,
2277 info := info
2278 }
2279 })
2280 }
2281 }
2282
2283
Harald Welte68e495b2018-02-25 00:05:57 +01002284 /* 8.6.2 BTS <- BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02002285 template (value) RSL_Message ts_RSL_SACCH_FILL(RSL_IE_SysinfoType si_type, octetstring l3_info) := {
Harald Welte68e495b2018-02-25 00:05:57 +01002286 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
2287 msg_type := RSL_MT_SACCH_FILL,
2288 ies := {
2289 t_RSL_IE(RSL_IE_SYSINFO_TYPE, RSL_IE_Body:{sysinfo_type := si_type}),
2290 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
2291 }
2292 }
Harald Welte09538f82019-08-01 09:50:25 +02002293 template RSL_Message tr_RSL_NO_SACCH_FILL(template RSL_IE_SysinfoType si_type := ?) := {
2294 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
2295 msg_type := RSL_MT_SACCH_FILL,
2296 ies := {
2297 tr_RSL_IE(RSL_IE_Body:{sysinfo_type := si_type})
2298 }
2299 }
2300 template RSL_Message tr_RSL_SACCH_FILL(template RSL_IE_SysinfoType si_type := ?,
2301 template octetstring l3_info := ?) := {
2302 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
2303 msg_type := RSL_MT_SACCH_FILL,
2304 ies := {
2305 tr_RSL_IE(RSL_IE_Body:{sysinfo_type := si_type}),
2306 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)}),
2307 *
2308 }
2309 }
2310
Harald Welte68e495b2018-02-25 00:05:57 +01002311
Harald Welte643e2a62017-11-27 15:03:18 +01002312 /* 8.6.4 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02002313 template (value) RSL_Message ts_RSL_ERROR_REPORT(RSL_Cause cause) := {
Harald Welte01d982c2018-02-25 01:31:40 +01002314 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
2315 msg_type := RSL_MT_ERROR_REPORT,
Harald Welte643e2a62017-11-27 15:03:18 +01002316 ies := {
Harald Welte735dd072017-12-12 14:55:17 +01002317 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
Harald Welte643e2a62017-11-27 15:03:18 +01002318 }
2319 }
Harald Welte01d982c2018-02-25 01:31:40 +01002320 template RSL_Message tr_RSL_ERROR_REPORT(template RSL_Cause cause := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002321 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
Harald Welte01d982c2018-02-25 01:31:40 +01002322 msg_type := RSL_MT_ERROR_REPORT,
2323 ies := {
2324 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)}),
2325 *
2326 }
2327 }
2328
Harald Welte643e2a62017-11-27 15:03:18 +01002329
Harald Welte9958a4d2017-12-14 21:21:33 +01002330
2331 /* Abis/IP specific messages */
2332
Vadim Yanitskiy1567bac2022-05-01 03:36:24 +03002333 private function f_ts_RSL_IPA_CRCX_IEs(template (value) RslChannelNr chan_nr,
2334 template (omit) OCT4 remote_ip,
Pau Espin Pedrol39bfa022022-08-12 14:56:12 +02002335 template (omit) uint16_t remote_port,
2336 template (omit) uint8_t osmux_cid)
Vadim Yanitskiy1567bac2022-05-01 03:36:24 +03002337 return RSL_IE_List {
2338 var RSL_IE_List ies;
2339
2340 /* Channel Number is a mandatory IE */
2341 ies := {
2342 valueof(RSL_IE:{
2343 iei := RSL_IE_CHAN_NR,
2344 body := { chan_nr := chan_nr }
2345 })
2346 };
2347 /* Remote IP / Port are optional IEs */
2348 if (not istemplatekind(remote_ip, "omit")) {
2349 ies := ies & {
2350 valueof(RSL_IE:{
2351 iei := RSL_IE_IPAC_REMOTE_IP,
2352 body := { ipa_remote_ip := remote_ip }
2353 })
2354 };
2355 }
2356 if (not istemplatekind(remote_port, "omit")) {
2357 ies := ies & {
2358 valueof(RSL_IE:{
2359 iei := RSL_IE_IPAC_REMOTE_PORT,
2360 body := { ipa_remote_port := remote_port }
2361 })
2362 };
2363 }
Pau Espin Pedrol39bfa022022-08-12 14:56:12 +02002364 /* Osmux CID extension IE is optional: */
2365 if (not istemplatekind(osmux_cid, "omit")) {
2366 ies := ies & {
2367 valueof(RSL_IE:{
2368 iei := RSL_IE_OSMO_OSMUX_CID,
2369 body := { osmux_cid := ts_RSL_IE_OSMO_Osmux_CID(osmux_cid) }
2370 })
2371 };
2372 }
Vadim Yanitskiy1567bac2022-05-01 03:36:24 +03002373
2374 return ies;
2375 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002376 template RSL_Message tr_RSL_IPA_CRCX(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002377 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002378 msg_type := RSL_MT_IPAC_CRCX,
2379 ies := {
2380 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2381 *
2382 }
2383 }
Vadim Yanitskiye9141c22021-07-03 01:45:40 +02002384 template (value) RSL_Message
2385 ts_RSL_IPA_CRCX(template (value) RslChannelNr chan_nr,
Vadim Yanitskiy1567bac2022-05-01 03:36:24 +03002386 template (omit) OCT4 remote_ip := omit,
Pau Espin Pedrol39bfa022022-08-12 14:56:12 +02002387 template (omit) uint16_t remote_port := omit,
2388 template (omit) uint8_t osmux_cid := omit) := {
Harald Welte9abd1282018-02-19 19:18:17 +01002389 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2390 msg_type := RSL_MT_IPAC_CRCX,
Pau Espin Pedrol39bfa022022-08-12 14:56:12 +02002391 ies := f_ts_RSL_IPA_CRCX_IEs(chan_nr, remote_ip, remote_port, osmux_cid)
Harald Welte9abd1282018-02-19 19:18:17 +01002392 }
2393
Pau Espin Pedrol29c6dfb2022-08-08 18:37:56 +02002394 function ts_RSL_IPA_CRCX_ACK(template (value) RslChannelNr chan_nr,
2395 uint16_t ipa_conn_id, OCT4 local_ip,
2396 uint16_t local_port, uint7_t rtp_pt2,
2397 template (omit) uint8_t osmux_cid := omit)
2398 return template (value) RSL_Message {
2399 var template (value) RSL_Message msg := {
2400 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2401 msg_type := RSL_MT_IPAC_CRCX_ACK,
2402 ies := {
2403 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2404 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2405 t_RSL_IE(RSL_IE_IPAC_LOCAL_IP, RSL_IE_Body:{ipa_local_ip := local_ip}),
2406 t_RSL_IE(RSL_IE_IPAC_LOCAL_PORT, RSL_IE_Body:{ipa_local_port := local_port}),
2407 t_RSL_IE(RSL_IE_IPAC_RTP_PAYLOAD2, RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
2408 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002409 }
Pau Espin Pedrol29c6dfb2022-08-08 18:37:56 +02002410 if (not istemplatekind(osmux_cid, "omit")) {
2411 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)});
2412 }
2413 return msg;
Harald Welte9958a4d2017-12-14 21:21:33 +01002414 }
Pau Espin Pedrol29c6dfb2022-08-08 18:37:56 +02002415
Pau Espin Pedrol39bfa022022-08-12 14:56:12 +02002416 function tr_RSL_IPA_CRCX_ACK(template RslChannelNr chan_nr,
2417 template uint16_t ipa_conn_id,
2418 template OCT4 local_ip,
2419 template uint16_t local_port,
2420 template uint8_t osmux_cid := omit)
2421 return template RSL_Message {
2422 var template RSL_Message msg := {
2423 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2424 msg_type := RSL_MT_IPAC_CRCX_ACK,
2425 ies := {
2426 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2427 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2428 tr_RSL_IE(RSL_IE_Body:{ipa_local_ip := local_ip}),
2429 tr_RSL_IE(RSL_IE_Body:{ipa_local_port := local_port})
2430 /* Optional: RTP Payload Type 2 IE */
2431 }
Harald Welte9abd1282018-02-19 19:18:17 +01002432 }
Pau Espin Pedrol39bfa022022-08-12 14:56:12 +02002433 if (not istemplatekind(osmux_cid, "omit")) {
2434 msg.ies[lengthof(msg.ies)] := tr_RSL_IE(RSL_IE_Body:{osmux_cid := f_tr_RSL_IE_OSMO_Osmux_CID(osmux_cid)});
2435 }
2436 return msg;
Harald Welte9abd1282018-02-19 19:18:17 +01002437 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002438
Harald Welteefa7d912018-04-18 23:22:15 +02002439 template (value) RSL_Message ts_RSL_IPA_CRCX_NACK(template (value) RslChannelNr chan_nr,
2440 RSL_Cause cause) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002441 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2442 msg_type := RSL_MT_IPAC_CRCX_NACK,
2443 ies := {
2444 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2445 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2446 }
2447 }
Harald Welte9abd1282018-02-19 19:18:17 +01002448 template RSL_Message tr_RSL_IPA_CRCX_NACK(template RslChannelNr chan_nr,
2449 template RSL_Cause cause := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002450 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9abd1282018-02-19 19:18:17 +01002451 msg_type := RSL_MT_IPAC_CRCX_NACK,
2452 ies := {
2453 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2454 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
2455 }
2456 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002457
Pau Espin Pedrol39bfa022022-08-12 14:56:12 +02002458 function ts_RSL_IPA_MDCX(template (value) RslChannelNr chan_nr,
2459 uint16_t ipa_conn_id,
2460 OCT4 remote_ip, uint16_t remote_port,
2461 uint7_t rtp_pt2,
2462 template (omit) uint8_t osmux_cid := omit)
2463 return template (value) RSL_Message {
2464 var template (value) RSL_Message msg := {
2465 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2466 msg_type := RSL_MT_IPAC_MDCX,
2467 ies := {
2468 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2469 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2470 t_RSL_IE(RSL_IE_IPAC_REMOTE_IP, RSL_IE_Body:{ipa_remote_ip := remote_ip}),
2471 t_RSL_IE(RSL_IE_IPAC_REMOTE_PORT, RSL_IE_Body:{ipa_remote_port := remote_port}),
2472 /* optional: RTP Payload Type */
2473 t_RSL_IE(RSL_IE_IPAC_RTP_PAYLOAD2, RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
2474 }
Harald Welte30527452018-02-25 12:46:25 +01002475 }
Pau Espin Pedrol39bfa022022-08-12 14:56:12 +02002476 if (not istemplatekind(osmux_cid, "omit")) {
2477 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)});
2478 }
2479 return msg;
Harald Welte30527452018-02-25 12:46:25 +01002480 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002481 template RSL_Message tr_RSL_IPA_MDCX(template RslChannelNr chan_nr,
2482 template uint16_t ipa_conn_id) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002483 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002484 msg_type := RSL_MT_IPAC_MDCX,
2485 ies := {
2486 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2487 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2488 *
2489 }
2490 }
2491
Pau Espin Pedrol29c6dfb2022-08-08 18:37:56 +02002492 function ts_RSL_IPA_MDCX_ACK(template (value) RslChannelNr chan_nr,
2493 uint16_t ipa_conn_id,
2494 OCT4 local_ip, uint16_t local_port,
2495 uint7_t rtp_pt2,
2496 template (omit) uint8_t osmux_cid := omit)
Pau Espin Pedrol39bfa022022-08-12 14:56:12 +02002497 return template (value) RSL_Message {
2498 var template (value) RSL_Message msg := {
2499 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2500 msg_type := RSL_MT_IPAC_MDCX_ACK,
2501 ies := {
2502 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2503 /* optional */
2504 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2505 t_RSL_IE(RSL_IE_IPAC_LOCAL_IP, RSL_IE_Body:{ipa_local_ip := local_ip}),
2506 t_RSL_IE(RSL_IE_IPAC_LOCAL_PORT, RSL_IE_Body:{ipa_local_port := local_port}),
2507 /* optional: RTP Payload Type */
2508 t_RSL_IE(RSL_IE_IPAC_RTP_PAYLOAD2, RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
Pau Espin Pedrol29c6dfb2022-08-08 18:37:56 +02002509 }
Pau Espin Pedrol39bfa022022-08-12 14:56:12 +02002510 }
2511 if (not istemplatekind(osmux_cid, "omit")) {
2512 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)});
2513 }
2514 return msg;
2515 }
2516 function tr_RSL_IPA_MDCX_ACK(template RslChannelNr chan_nr,
2517 template uint16_t ipa_conn_id,
2518 template OCT4 local_ip,
2519 template uint16_t local_port,
2520 template uint7_t rtp_pt2,
2521 template uint8_t osmux_cid := omit)
2522 return template RSL_Message {
2523 var template RSL_Message msg := {
2524 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2525 msg_type := RSL_MT_IPAC_MDCX_ACK,
2526 ies := {
2527 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2528 /* optional */
2529 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2530 tr_RSL_IE(RSL_IE_Body:{ipa_local_ip := local_ip}),
2531 tr_RSL_IE(RSL_IE_Body:{ipa_local_port := local_port}),
2532 /* optional: RTP Payload Type */
2533 tr_RSL_IE(RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
Pau Espin Pedrol29c6dfb2022-08-08 18:37:56 +02002534 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002535 }
Pau Espin Pedrol39bfa022022-08-12 14:56:12 +02002536 if (not istemplatekind(osmux_cid, "omit")) {
2537 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 +01002538 }
Pau Espin Pedrol39bfa022022-08-12 14:56:12 +02002539 return msg;
Harald Welte30527452018-02-25 12:46:25 +01002540 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002541
Harald Welteefa7d912018-04-18 23:22:15 +02002542 template (value) RSL_Message ts_RSL_IPA_MDCX_NACK(template (value) RslChannelNr chan_nr,
2543 RSL_Cause cause,
2544 template (value) uint16_t ipa_conn_id) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002545 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2546 msg_type := RSL_MT_IPAC_MDCX_NACK,
2547 ies := {
2548 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2549 /* optional connection ID */
2550 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2551 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2552 }
2553 }
Harald Welte30527452018-02-25 12:46:25 +01002554 template RSL_Message tr_RSL_IPA_MDCX_NACK(template RslChannelNr chan_nr,
2555 template RSL_Cause cause,
2556 template uint16_t ipa_conn_id) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002557 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte30527452018-02-25 12:46:25 +01002558 msg_type := RSL_MT_IPAC_MDCX_NACK,
2559 ies := {
2560 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2561 /* optional connection ID */
2562 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2563 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
2564 }
2565 }
2566
Harald Welte9958a4d2017-12-14 21:21:33 +01002567
Harald Welteefa7d912018-04-18 23:22:15 +02002568 template (value) RSL_Message ts_RSL_IPA_DLCX_IND(template (value) RslChannelNr chan_nr,
2569 uint16_t ipa_conn_id,
2570 template (value) RSL_IE_IPA_ConnectionStats stats,
2571 RSL_Cause cause) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002572 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2573 msg_type := RSL_MT_IPAC_DLCX_IND,
2574 ies := {
2575 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2576 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2577 t_RSL_IE(RSL_IE_IPAC_CONN_STAT, RSL_IE_Body:{ipa_stats := stats}),
2578 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2579 }
2580 }
2581
Harald Welteefa7d912018-04-18 23:22:15 +02002582 template (value) RSL_Message ts_RSL_IPA_DLCX(template (value) RslChannelNr chan_nr,
2583 uint16_t ipa_conn_id) := {
Harald Weltea871a382018-02-25 02:03:14 +01002584 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2585 msg_type := RSL_MT_IPAC_DLCX,
2586 ies := {
Harald Welte2a7e7162018-02-25 12:46:48 +01002587 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2588 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id})
Harald Weltea871a382018-02-25 02:03:14 +01002589 }
2590 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002591 template RSL_Message tr_RSL_IPA_DLCX(template RslChannelNr chan_nr,
2592 template uint16_t ipa_conn_id := omit) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002593 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002594 msg_type := RSL_MT_IPAC_DLCX,
2595 ies := {
2596 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2597 /* FIXME: optional conn_id */
2598 *
2599 }
2600 }
2601
Harald Welteefa7d912018-04-18 23:22:15 +02002602 template (value) RSL_Message ts_RSL_IPA_DLCX_ACK(template (value) RslChannelNr chan_nr,
2603 uint16_t ipa_conn_id,
2604 RSL_IE_IPA_ConnectionStats stats) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002605 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2606 msg_type := RSL_MT_IPAC_DLCX_ACK,
2607 ies := {
2608 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2609 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2610 t_RSL_IE(RSL_IE_IPAC_CONN_STAT, RSL_IE_Body:{ipa_stats := stats})
2611 }
2612 }
Harald Weltea871a382018-02-25 02:03:14 +01002613 template RSL_Message tr_RSL_IPA_DLCX_ACK(template RslChannelNr chan_nr,
2614 template uint16_t ipa_conn_id,
2615 template RSL_IE_IPA_ConnectionStats stats) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002616 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Weltea871a382018-02-25 02:03:14 +01002617 msg_type := RSL_MT_IPAC_DLCX_ACK,
2618 ies := {
2619 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2620 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2621 tr_RSL_IE(RSL_IE_Body:{ipa_stats := stats})
2622 }
2623 }
2624
2625
Harald Welte9958a4d2017-12-14 21:21:33 +01002626
Harald Welteefa7d912018-04-18 23:22:15 +02002627 template (value) RSL_Message ts_RSL_IPA_DLCX_NACK(template (value) RslChannelNr chan_nr,
2628 RSL_Cause cause, uint16_t ipa_conn_id) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002629 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2630 msg_type := RSL_MT_IPAC_DLCX_NACK,
2631 ies := {
2632 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2633 /* optional connection ID */
2634 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2635 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2636 }
2637 }
Harald Weltea871a382018-02-25 02:03:14 +01002638 template RSL_Message tr_RSL_IPA_DLCX_NACK(template RslChannelNr chan_nr,
2639 template RSL_Cause cause) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002640 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Weltea871a382018-02-25 02:03:14 +01002641 msg_type := RSL_MT_IPAC_DLCX_NACK,
2642 ies := {
2643 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2644 /* optional connection ID */
2645 *,
2646 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
2647 }
2648 }
2649
Harald Welte9958a4d2017-12-14 21:21:33 +01002650
Vadim Yanitskiy58b16532021-10-09 20:27:39 +06002651 template (value) RSL_Message
2652 ts_RSL_IPA_PDCH_ACT(template (value) RslChannelNr chan_nr) := {
Harald Welteee19c732018-04-05 09:08:26 +02002653 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2654 msg_type := RSL_MT_IPAC_PDCH_ACT,
2655 ies := {
2656 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
2657 }
2658 }
Vadim Yanitskiy58b16532021-10-09 20:27:39 +06002659 template RSL_Message
2660 tr_RSL_IPA_PDCH_ACT(template (present) RslChannelNr chan_nr) := {
Harald Welteee19c732018-04-05 09:08:26 +02002661 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002662 msg_type := RSL_MT_IPAC_PDCH_ACT,
2663 ies := {
2664 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
2665 }
2666 }
2667
Harald Welteee19c732018-04-05 09:08:26 +02002668
Harald Welte94e0c342018-04-07 11:33:23 +02002669 template RSL_Message ts_RSL_IPA_PDCH_ACT_ACK(RslChannelNr chan_nr,
2670 template (value) RSL_IE_FrameNumber fn) := {
Harald Welteee19c732018-04-05 09:08:26 +02002671 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002672 msg_type := RSL_MT_IPAC_PDCH_ACT_ACK,
2673 ies := {
2674 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2675 t_RSL_IE(RSL_IE_FRAME_NUMBER, RSL_IE_Body:{frame_nr := fn})
2676 }
2677 }
Harald Welteee19c732018-04-05 09:08:26 +02002678 template RSL_Message tr_RSL_IPA_PDCH_ACT_ACK(template RslChannelNr chan_nr,
2679 template RSL_IE_FrameNumber fn) := {
2680 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2681 msg_type := RSL_MT_IPAC_PDCH_ACT_ACK,
2682 ies := {
2683 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2684 tr_RSL_IE(RSL_IE_Body:{frame_nr := fn})
2685 }
2686 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002687
2688 template RSL_Message ts_RSL_IPA_PDCH_ACT_NACK(RslChannelNr chan_nr, RSL_Cause cause) := {
Harald Welteee19c732018-04-05 09:08:26 +02002689 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002690 msg_type := RSL_MT_IPAC_PDCH_ACT_NACK,
2691 ies := {
2692 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2693 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2694 }
2695 }
Harald Welteee19c732018-04-05 09:08:26 +02002696 template RSL_Message tr_RSL_IPA_PDCH_ACT_NACK(template RslChannelNr chan_nr,
2697 template RSL_Cause cause) := {
2698 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2699 msg_type := RSL_MT_IPAC_PDCH_ACT_NACK,
2700 ies := {
2701 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2702 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
2703 }
2704 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002705
Harald Welteee19c732018-04-05 09:08:26 +02002706 template RSL_Message ts_RSL_IPA_PDCH_DEACT(RslChannelNr chan_nr) := {
2707 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2708 msg_type := RSL_MT_IPAC_PDCH_DEACT,
2709 ies := {
2710 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
2711 }
2712 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002713 template RSL_Message tr_RSL_IPA_PDCH_DEACT(template RslChannelNr chan_nr) := {
Harald Welteee19c732018-04-05 09:08:26 +02002714 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002715 msg_type := RSL_MT_IPAC_PDCH_DEACT,
2716 ies := {
2717 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
2718 }
2719 }
2720
2721 template RSL_Message ts_RSL_IPA_PDCH_DEACT_ACK(RslChannelNr chan_nr) := {
Harald Welteee19c732018-04-05 09:08:26 +02002722 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002723 msg_type := RSL_MT_IPAC_PDCH_DEACT_ACK,
2724 ies := {
2725 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
2726 }
2727 }
Harald Welteee19c732018-04-05 09:08:26 +02002728 template RSL_Message tr_RSL_IPA_PDCH_DEACT_ACK(template RslChannelNr chan_nr) := {
2729 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2730 msg_type := RSL_MT_IPAC_PDCH_DEACT_ACK,
2731 ies := {
2732 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
2733 }
2734 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002735
2736 template RSL_Message ts_RSL_IPA_PDCH_DEACT_NACK(RslChannelNr chan_nr, RSL_Cause cause) := {
Harald Welteee19c732018-04-05 09:08:26 +02002737 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002738 msg_type := RSL_MT_IPAC_PDCH_DEACT_NACK,
2739 ies := {
2740 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2741 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2742 }
2743 }
Harald Welteee19c732018-04-05 09:08:26 +02002744 template RSL_Message tr_RSL_IPA_PDCH_DEACT_NACK(template RslChannelNr chan_nr,
2745 template RSL_Cause cause) := {
2746 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2747 msg_type := RSL_MT_IPAC_PDCH_DEACT_NACK,
2748 ies := {
2749 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2750 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
2751 }
2752 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002753
Harald Welte908ce542019-09-04 23:05:40 +02002754 template (value) RSL_Message ts_RSL_OSMO_ETWS_CMD(template (value) octetstring msg,
2755 template (value) RslChannelNr chan_nr := ts_RslChanNr_PCH_AGCH(0)) := {
2756 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2757 msg_type := RSL_MT_OSMO_ETWS_CMD,
2758 ies := {
2759 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2760 t_RSL_IE(RSL_IE_SMSCB_MSG, RSL_IE_Body:{smscb_message := ts_RSL_LV(msg)})
2761 }
2762 }
2763 template RSL_Message tr_RSL_OSMO_ETWS_CMD(template RslChannelNr chan_nr := ?,
2764 template octetstring msg := ?) := {
2765 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2766 msg_type := RSL_MT_OSMO_ETWS_CMD,
2767 ies := {
2768 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2769 tr_RSL_IE(RSL_IE_Body:{smscb_message := tr_RSL_LV(msg)})
2770 }
2771 }
2772
Harald Weltee33e5152023-04-09 23:29:48 +02002773 template (value) RSL_Message ts_RSL_NOTIF_CMD_START(template (value) GroupCallRef group_call_ref,
2774 template (value) octetstring chan_desc) := {
2775 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2776 msg_type := RSL_MT_NOT_CMD,
2777 ies := {
2778 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_PCH_AGCH(0)}),
2779 t_RSL_IE(RSL_IE_CMD_INDICATOR, RSL_IE_Body:{cmd_indicator := ts_CommandInd(CMD_IND_START)}),
2780 t_RSL_IE(RSL_IE_GROUP_CALL_REF, RSL_IE_Body:{group_call_ref := ts_GroupCallRef(group_call_ref)}),
2781 t_RSL_IE(RSL_IE_GROUP_CHAN_DESC, RSL_IE_Body:{group_chan_desc := ts_GroupChanDesc(chan_desc)})
2782 }
2783 }
2784 template RSL_Message tr_RSL_NOTIF_CMD_START(template (present) GroupCallRef group_call_ref,
2785 template (present) octetstring chan_desc := ?) := {
2786 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2787 msg_type := RSL_MT_NOT_CMD,
2788 ies := {
2789 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(0)}),
2790 tr_RSL_IE(RSL_IE_Body:{cmd_indicator := tr_CommandInd(CMD_IND_START)}),
2791 tr_RSL_IE(RSL_IE_Body:{group_call_ref := tr_GroupCallRef(group_call_ref)}),
2792 tr_RSL_IE(RSL_IE_Body:{group_chan_desc := tr_GroupChanDesc(chan_desc)}),
2793 *
2794 }
2795 }
2796
2797 template (value) RSL_Message ts_RSL_NOTIF_CMD_STOP(template (value) GroupCallRef group_call_ref) := {
2798 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2799 msg_type := RSL_MT_NOT_CMD,
2800 ies := {
2801 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_PCH_AGCH(0)}),
2802 t_RSL_IE(RSL_IE_CMD_INDICATOR, RSL_IE_Body:{cmd_indicator := ts_CommandInd(CMD_IND_STOP)}),
2803 t_RSL_IE(RSL_IE_GROUP_CALL_REF, RSL_IE_Body:{group_call_ref := ts_GroupCallRef(group_call_ref)})
2804 }
2805 }
2806 template RSL_Message tr_RSL_NOTIF_CMD_STOP(template (present) GroupCallRef group_call_ref) := {
2807 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2808 msg_type := RSL_MT_NOT_CMD,
2809 ies := {
2810 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(0)}),
2811 tr_RSL_IE(RSL_IE_Body:{cmd_indicator := tr_CommandInd(CMD_IND_STOP)}),
2812 tr_RSL_IE(RSL_IE_Body:{group_call_ref := tr_GroupCallRef(group_call_ref)}),
2813 *
2814 }
2815 }
2816
Harald Welte908ce542019-09-04 23:05:40 +02002817
Harald Welte9958a4d2017-12-14 21:21:33 +01002818
Harald Welte6a8199d2018-01-29 21:58:53 +01002819 function f_rsl_find_ie(RSL_Message msg, RSL_IE_Type iei, out RSL_IE_Body ret) return boolean {
2820 for (var integer i := 0; i < sizeof(msg.ies); i := i+1) {
2821 if (msg.ies[i].iei == iei) {
2822 ret := msg.ies[i].body;
2823 return true;
2824 }
2825 }
2826 return false;
2827 }
2828
2829
Harald Welte9958a4d2017-12-14 21:21:33 +01002830
Harald Welte643e2a62017-11-27 15:03:18 +01002831} with { encode "RAW" ; variant "FIELDORDER(msb)" }