blob: fa1d928595791f08e97051883403d3ddf8eb506d [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 Yanitskiyeaaa1d62023-05-26 18:46:25 +0700442 template (value) RSL_IE_ChannelMode
443 ts_RSL_ChanMode_SIGN(template (value) RSL_ChanRateType t := RSL_CHRT_SDCCH,
444 template (value) boolean dtxd := false,
445 template (value) boolean dtxu := false) := {
Harald Welte8f2c21d2017-12-07 17:52:40 +0100446 len := 0, /* overwritten */
Harald Welte643e2a62017-11-27 15:03:18 +0100447 reserved := '000000'B,
Vadim Yanitskiyeaaa1d62023-05-26 18:46:25 +0700448 dtx_d := dtxd,
449 dtx_u := dtxu,
450 spd_ind := RSL_SPDI_SIGN,
451 ch_rate_type := t,
452 u := { sign := RSL_CMOD_NO_RESOURCE }
453 }
454 template RSL_IE_ChannelMode
455 tr_RSL_ChanMode_SIGN(template (present) RSL_ChanRateType t := ?,
456 template (present) boolean dtxd := ?,
457 template (present) boolean dtxu := ?) := {
458 len := ?,
459 reserved := ?,
460 dtx_d := dtxd,
461 dtx_u := dtxu,
Harald Welte643e2a62017-11-27 15:03:18 +0100462 spd_ind := RSL_SPDI_SIGN,
Philipp Maierac693462020-10-14 20:21:44 +0200463 ch_rate_type := t,
Oliver Smith0033b122023-02-28 13:30:53 +0100464 u := { sign := RSL_CMOD_NO_RESOURCE }
Harald Welte643e2a62017-11-27 15:03:18 +0100465 }
466
Vadim Yanitskiy8e2b8e32023-05-26 18:44:01 +0700467 template (value) RSL_IE_ChannelMode
468 ts_RSL_ChanMode_DATA(template (value) RSL_ChanRateType t,
469 template (value) RSL_ChanModeOct6DataRate r,
470 template (value) boolean dtxd := false,
471 template (value) boolean dtxu := false) := {
472 len := 0, /* overwritten */
473 reserved := '000000'B,
474 dtx_d := dtxd,
475 dtx_u := dtxu,
476 spd_ind := RSL_SPDI_DATA,
477 ch_rate_type := t,
478 u := { data := r }
479 }
480 template RSL_IE_ChannelMode
481 tr_RSL_ChanMode_DATA(template (present) RSL_ChanRateType t := ?,
482 template (present) RSL_ChanModeOct6DataRate r := ?,
483 template (present) boolean dtxd := ?,
484 template (present) boolean dtxu := ?) := {
485 len := ?,
486 reserved := ?,
487 dtx_d := dtxd,
488 dtx_u := dtxu,
489 spd_ind := RSL_SPDI_DATA,
490 ch_rate_type := t,
491 u := { data := r }
492 }
493
Oliver Smith0033b122023-02-28 13:30:53 +0100494 template (value) RSL_IE_ChannelMode ts_RSL_ChanMode(RSL_ChanRateType t, RSL_ChanModeOct6SpeechAlgo alg,
Stefan Sperling4880be42018-08-07 18:12:59 +0200495 boolean dtx_downlink := false) := {
Harald Welte8f2c21d2017-12-07 17:52:40 +0100496 len := 0, /* overwritten */
Harald Welte643e2a62017-11-27 15:03:18 +0100497 reserved := '000000'B,
Stefan Sperling4880be42018-08-07 18:12:59 +0200498 dtx_d := dtx_downlink,
Harald Welte643e2a62017-11-27 15:03:18 +0100499 dtx_u := false,
500 spd_ind := RSL_SPDI_SPEECH,
501 ch_rate_type := t,
Oliver Smith0033b122023-02-28 13:30:53 +0100502 u := { speech := alg }
Harald Welte643e2a62017-11-27 15:03:18 +0100503 }
Harald Welte3618d9d2018-03-21 18:45:27 +0100504 template RSL_IE_ChannelMode tr_RSL_ChanMode(template RSL_ChanRateType t,
Oliver Smith0033b122023-02-28 13:30:53 +0100505 template RSL_ChanModeOct6SpeechAlgo alg) := {
Harald Welte3618d9d2018-03-21 18:45:27 +0100506 len := ?,
507 reserved := '000000'B,
508 dtx_d := ?,
509 dtx_u := ?,
510 spd_ind := RSL_SPDI_SPEECH,
511 ch_rate_type := t,
Oliver Smith0033b122023-02-28 13:30:53 +0100512 u := { speech := alg }
Harald Welte3618d9d2018-03-21 18:45:27 +0100513 }
Harald Welte643e2a62017-11-27 15:03:18 +0100514
Vadim Yanitskiy117c1762020-06-16 01:40:10 +0700515 /* 9.3.4 BS Power IE */
Harald Welte643e2a62017-11-27 15:03:18 +0100516 type record RSL_IE_BS_Power {
Vadim Yanitskiy117c1762020-06-16 01:40:10 +0700517 uint2_t reserved,
Harald Welte643e2a62017-11-27 15:03:18 +0100518 boolean epc,
519 boolean fpc,
Vadim Yanitskiy117c1762020-06-16 01:40:10 +0700520 uint4_t power_level
Harald Welte643e2a62017-11-27 15:03:18 +0100521 }
522
Vadim Yanitskiy117c1762020-06-16 01:40:10 +0700523 template (value) RSL_IE_BS_Power ts_RSL_IE_BS_Power(uint4_t power_level,
Eric Wildae8f2622019-06-18 17:05:11 +0200524 boolean epc := false, boolean fpc := false) := {
525 reserved := 0,
526 epc := epc,
527 fpc := fpc,
528 power_level := power_level
529 }
Vadim Yanitskiy2a5a1ef2021-06-30 00:51:48 +0200530 template RSL_IE_BS_Power
531 tr_RSL_IE_BS_Power(template (present) uint4_t power_level,
532 template (present) boolean epc := ?,
533 template (present) boolean fpc := ?) := {
534 reserved := ?,
535 epc := epc,
536 fpc := fpc,
537 power_level := power_level
538 }
Eric Wildae8f2622019-06-18 17:05:11 +0200539
Harald Welte73cd2712017-12-17 00:44:52 +0100540 /* 9.3.7 */
Harald Weltee613f962018-04-18 22:38:16 +0200541 type enumerated RSL_AlgId {
542 RSL_ALG_ID_A5_0 ('00000001'B),
543 RSL_ALG_ID_A5_1 ('00000010'B),
544 RSL_ALG_ID_A5_2 ('00000011'B),
545 RSL_ALG_ID_A5_3 ('00000100'B),
546 RSL_ALG_ID_A5_4 ('00000101'B),
547 RSL_ALG_ID_A5_5 ('00000110'B),
548 RSL_ALG_ID_A5_6 ('00000111'B),
549 RSL_ALG_ID_A5_7 ('00001000'B)
550 } with { variant "FIELDLENGTH(8)" };
Harald Welte73cd2712017-12-17 00:44:52 +0100551 type record RSL_IE_EncryptionInfo {
552 uint8_t len,
Harald Weltee613f962018-04-18 22:38:16 +0200553 RSL_AlgId alg_id,
Harald Welte73cd2712017-12-17 00:44:52 +0100554 octetstring key
555 } with { variant (len) "LENGTHTO(alg_id,key)" };
556
Harald Weltee613f962018-04-18 22:38:16 +0200557 template RSL_IE_EncryptionInfo tr_RSL_IE_EncrInfo(template RSL_AlgId alg,
558 template octetstring key) := {
Harald Welte73cd2712017-12-17 00:44:52 +0100559 len := ?,
560 alg_id := alg,
561 key := key
562 }
Harald Weltee613f962018-04-18 22:38:16 +0200563 template (value) RSL_IE_EncryptionInfo ts_RSL_IE_EncrInfo(template (value) RSL_AlgId alg,
564 octetstring key) := {
Harald Welteefa7d912018-04-18 23:22:15 +0200565 len := 0, /* overwritten */
566 alg_id := alg,
567 key := key
568 }
569
570
Harald Welte73cd2712017-12-17 00:44:52 +0100571
Harald Welte643e2a62017-11-27 15:03:18 +0100572 /* 9.3.8 */
573 type record RSL_IE_FrameNumber {
574 uint5_t t1_p,
575 uint6_t t3,
576 uint5_t t2
577 }
578 type RSL_IE_FrameNumber RSL_IE_StartingTime;
579
580 /* 9.3.10 */
581 type record RSL_IE_L1Info {
582 uint5_t ms_power_lvl,
583 boolean fpc,
584 uint2_t reserved,
585 uint8_t actual_ta
586 }
587
Neels Hofmeyrafe2ea52021-11-24 15:16:12 +0100588 template (value) RSL_IE_L1Info ts_RSL_IE_L1Info := {
589 ms_power_lvl := 0,
590 fpc := false,
591 reserved := 0,
592 actual_ta := 0
593 };
594
Harald Welte643e2a62017-11-27 15:03:18 +0100595 /* 9.3.13 */
596 type record RSL_IE_MS_Power {
597 uint2_t reserved,
598 boolean fpc_epc,
599 uint5_t power_level
600 }
Pau Espin Pedrolf7630a62019-10-28 15:07:08 +0100601 template RSL_IE_MS_Power tr_RSL_IE_MS_Power(template uint5_t power_level := ?,
602 template boolean fpc_epc := false) := {
603 reserved := 0,
604 fpc_epc := fpc_epc,
605 power_level := power_level
606 }
Harald Welte10280172019-05-19 22:28:04 +0200607 template (value) RSL_IE_MS_Power ts_RSL_IE_MS_Power(uint5_t power_level,
608 boolean fpc_epc := false) := {
609 reserved := 0,
610 fpc_epc := fpc_epc,
611 power_level := power_level
612 }
Harald Welte643e2a62017-11-27 15:03:18 +0100613
Harald Welted5f521e2017-12-07 17:53:06 +0100614 /* 9.3.18 */
615 type record RSL_IE_RachLoad {
616 uint8_t len,
617 uint16_t slot_count,
618 uint16_t busy_count,
619 uint16_t access_count
620 } with { variant (len) "LENGTHTO(slot_count,busy_count,access_count)" }
621
Harald Welteefa7d912018-04-18 23:22:15 +0200622 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 +0100623 len := 0, /* overwritten */
624 slot_count := slot,
625 busy_count := busy,
626 access_count := acc
627 }
628
Harald Welte68e495b2018-02-25 00:05:57 +0100629 template RSL_IE_RachLoad tr_RSL_IE_RachLoad(template uint16_t slot,
630 template uint16_t busy,
631 template uint16_t acc) := {
632 len := ?, /* overwritten */
633 slot_count := slot,
634 busy_count := busy,
635 access_count := acc
636 }
637
Harald Welte643e2a62017-11-27 15:03:18 +0100638 /* 9.3.19 */
639 type record RSL_IE_RequestRef {
640 OCT1 ra,
641 RSL_IE_FrameNumber frame_nr
642 }
643
644 /* 3GPP TS 44.018 / 10.5.2.38 Starting Time */
Harald Welte94e0c342018-04-07 11:33:23 +0200645 template (value) RSL_IE_FrameNumber ts_RSL_IE_FrameNumber(GsmFrameNumber fn) := {
Harald Welte643e2a62017-11-27 15:03:18 +0100646 t1_p := (fn / 1326) mod 32,
647 t3 := fn mod 51,
648 t2 := fn mod 26
649 }
650
Harald Welte9abd1282018-02-19 19:18:17 +0100651 function tr_RSL_IE_FrameNumber(template GsmFrameNumber fn) return template RSL_IE_FrameNumber {
652 if (istemplatekind(fn, "?")) {
653 return ?;
654 } else {
655 return ts_RSL_IE_FrameNumber(valueof(fn));
656 }
657 }
658
Harald Welteefa7d912018-04-18 23:22:15 +0200659 template (value) RSL_IE_RequestRef ts_RSL_IE_ReqRef(OCT1 ra, GsmFrameNumber frame_nr) := {
Harald Welte643e2a62017-11-27 15:03:18 +0100660 ra := ra,
661 frame_nr := ts_RSL_IE_FrameNumber(frame_nr)
662 }
663
Harald Welte9abd1282018-02-19 19:18:17 +0100664 template RSL_IE_RequestRef tr_RSL_IE_ReqRef(template OCT1 ra, template GsmFrameNumber frame_nr) := {
665 ra := ra,
666 frame_nr := tr_RSL_IE_FrameNumber(frame_nr)
667 }
668
Vadim Yanitskiy9f699532021-06-03 17:29:22 +0200669 /* 9.3.21 Resource Information */
670 type record RSL_IE_ResourceInfo {
671 uint8_t len,
672 RSL_ResourceInfo info
673 } with { variant (len) "LENGTHTO(info)" };
674
675 type record of RSL_ResourceInfoItem RSL_ResourceInfo;
676 type record RSL_ResourceInfoItem {
677 RslChannelNr chan_nr,
678 uint3_t interf_band,
679 BIT5 rfu ('00000'B)
680 };
681
682 template (value) RSL_ResourceInfoItem
683 ts_RSL_ResourceInfoItem(template (value) RslChannelNr chan_nr,
684 template (value) uint3_t interf_band := 0) := {
685 chan_nr := chan_nr,
686 interf_band := interf_band,
687 rfu := '00000'B
688 }
689 template RSL_ResourceInfoItem
690 tr_RSL_ResourceInfoItem(template (present) RslChannelNr chan_nr := ?,
691 template (present) uint3_t interf_band := ?) := {
692 chan_nr := chan_nr,
693 interf_band := interf_band,
694 rfu := ? /* Tolerate unknown values */
695 }
696
Harald Welte15de8ba2018-06-29 08:51:42 +0200697 /* Osmocom Extension */
698 type record RSL_IE_UplinkMeasSuppMeasInfo {
699 int16_t toa256_mean,
700 int16_t toa256_min,
701 int16_t toa256_max,
702 uint16_t toa256_std_dev
703 };
704
Harald Welte2691adf2018-02-22 17:32:39 +0100705 /* 9.3.25 */
706 type record RSL_IE_UplinkMeas {
707 uint8_t len,
708 BIT1 rfu,
709 boolean dtx_d,
710 uint6_t rxlev_f_u,
711 BIT2 reserved1,
712 uint6_t rxlev_s_u,
713 BIT2 reserved2,
714 uint3_t rxq_f_u,
715 uint3_t rxq_s_u,
Harald Welte15de8ba2018-06-29 08:51:42 +0200716 RSL_IE_UplinkMeasSuppMeasInfo supp_meas_info optional
Harald Welte2691adf2018-02-22 17:32:39 +0100717 } 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 +0100718
Neels Hofmeyrafe2ea52021-11-24 15:16:12 +0100719 template (value) RSL_IE_UplinkMeas ts_RSL_IE_UplinkMeas(uint6_t rxlev := 12, uint3_t rxqual := 0) := {
720 len := 0, /* overwritten */
721 rfu := '0'B,
722 dtx_d := false,
723 rxlev_f_u := rxlev,
724 reserved1 := '00'B,
725 rxlev_s_u := rxlev,
726 reserved2 := '00'B,
727 rxq_f_u := rxqual,
728 rxq_s_u := rxqual,
729 supp_meas_info := omit
730 };
731
Harald Welte643e2a62017-11-27 15:03:18 +0100732 /* 9.3.26 */
Harald Weltea8ed9062017-12-14 09:46:01 +0100733 type enumerated RSL_Cause {
734 /* normal event */
735 RSL_ERR_RADIO_IF_FAIL ('00'O),
736 RSL_ERR_RADIO_LINK_FAIL ('01'O),
737 RSL_ERR_HANDOVER_ACC_FAIL ('02'O),
738 RSL_ERR_TALKER_ACC_FAIL ('03'O),
739 RSL_ERR_OM_INTERVENTION ('07'O),
740 RSL_ERR_NORMAL_UNSPEC ('0f'O),
741 RSL_ERR_T_MSRFPCI_EXP ('18'O),
742 /* resource unavailable */
743 RSL_ERR_EQUIPMENT_FAIL ('20'O),
744 RSL_ERR_RR_UNAVAIL ('21'O),
745 RSL_ERR_TERR_CH_FAIL ('22'O),
746 RSL_ERR_CCCH_OVERLOAD ('23'O),
747 RSL_ERR_ACCH_OVERLOAD ('24'O),
748 RSL_ERR_PROCESSOR_OVERLOAD ('25'O),
749 RSL_ERR_BTS_NOT_EQUIPPED ('27'O),
750 RSL_ERR_REMOTE_TRAU_FAILURE ('28'O),
751 RSL_ERR_NOTIF_OVERFLOW ('29'O),
752 RSL_ERR_RES_UNAVAIL ('2f'O),
753 /* service or option not available */
754 RSL_ERR_TRANSC_UNAVAIL ('30'O),
755 RSL_ERR_SERV_OPT_UNAVAIL ('3f'O),
756 /* service or option not implemented */
757 RSL_ERR_ENCR_UNIMPL ('40'O),
758 RSL_ERR_SERV_OPT_UNIMPL ('4f'O),
759 /* invalid message */
760 RSL_ERR_RCH_ALR_ACTV_ALLOC ('50'O),
Harald Welte9912eb52018-02-25 13:30:15 +0100761 RSL_ERR_IPA_RCH_NOT_ACTV_ALLOC ('51'O),
762 RSL_ERR_IPA_CONN_INVALID ('52'O),
763 RSL_ERR_IPA_CONN_IN_USE ('53'O),
764 RSL_ERR_IPA_CONN_ALREADY_EXISTS ('54'O),
Harald Weltea8ed9062017-12-14 09:46:01 +0100765 RSL_ERR_INVALID_MESSAGE ('5f'O),
766 /* protocol error */
767 RSL_ERR_MSG_DISCR ('60'O),
768 RSL_ERR_MSG_TYPE ('61'O),
769 RSL_ERR_MSG_SEQ ('62'O),
770 RSL_ERR_IE_ERROR ('63'O),
771 RSL_ERR_MAND_IE_ERROR ('64'O),
772 RSL_ERR_OPT_IE_ERROR ('65'O),
773 RSL_ERR_IE_NONEXIST ('66'O),
774 RSL_ERR_IE_LENGTH ('67'O),
775 RSL_ERR_IE_CONTENT ('68'O),
776 RSL_ERR_PROTO ('6f'O),
777 /* interworking */
778 RSL_ERR_INTERWORKING ('7f'O)
779 };
Harald Welte643e2a62017-11-27 15:03:18 +0100780 type record RSL_IE_Cause {
Harald Welte6efa8e32017-12-09 22:34:06 +0100781 uint8_t len,
Harald Welte643e2a62017-11-27 15:03:18 +0100782 uint1_t e,
783 RSL_Cause cause,
784 octetstring cause_ext optional
Harald Welte6efa8e32017-12-09 22:34:06 +0100785 } with { variant (len) "LENGTHTO(e,cause,cause_ext)" }
Harald Welte643e2a62017-11-27 15:03:18 +0100786
Harald Welteefa7d912018-04-18 23:22:15 +0200787 template (value) RSL_IE_Cause ts_RSL_IE_Cause(RSL_Cause cause) := {
Harald Welte6efa8e32017-12-09 22:34:06 +0100788 len := 0, /* overwritten */
Harald Welte643e2a62017-11-27 15:03:18 +0100789 e := 0,
790 cause := cause,
791 cause_ext := omit
792 }
793
Harald Welte9abd1282018-02-19 19:18:17 +0100794 template RSL_IE_Cause tr_RSL_IE_Cause(template RSL_Cause cause) := {
795 len := ?,
796 e := 0,
797 cause := cause,
798 cause_ext := omit
799 }
800
Harald Weltec8d363c2019-05-19 20:36:48 +0200801 /* 9.3.29 */
802 type record RSL_SacchInfo {
803 uint8_t len,
804 uint8_t num_msgs,
805 RSL_SacchInfoElements elems
806 } with {
807 variant (len) "LENGTHTO(num_msgs,elems)";
808 variant (num_msgs) "LENGTHTO(elems)";
809 variant (num_msgs) "UNIT(elements)"
810 };
811 type record RSL_SacchInfoElement {
812 RSL_IE_SysinfoType si_type,
813 uint8_t len,
814 octetstring msg
815 } with {
816 variant (len) "LENGTHTO(msg)";
817 };
818 type record of RSL_SacchInfoElement RSL_SacchInfoElements;
819 template (value) RSL_SacchInfo ts_RSL_SacchInfo(template (value) RSL_SacchInfoElements elems) := {
820 len := 0, /* overwritten */
821 num_msgs := 0, /* overwritten */
822 elems := elems
823 }
824 template (value) RSL_SacchInfoElement ts_RSL_SacchInfoElem(RSL_IE_SysinfoType tp, octetstring msg) := {
825 si_type := tp,
826 len := lengthof(msg),
827 msg := msg
828 }
829
Eric Wild61edb7e2019-06-03 12:38:31 +0200830 /* 9.3.31 */
831 type record RSL_IE_MS_Power_Parameters {
832 uint8_t len,
833 octetstring params
834 } with {
835 variant (len) "LENGTHTO(params)";
836 };
837 template (value) RSL_IE_MS_Power_Parameters ts_RSL_IE_MS_Power_Parameters(octetstring params) := {
838 len := 0, /* overwritten */
839 params := params
840 }
841
Harald Welte643e2a62017-11-27 15:03:18 +0100842 /* 9.3.40 */
843 type enumerated RSL_ChanNeeded {
844 RSL_CHANNEED_ANY ('00'B),
845 RSL_CHANNEED_SDCCH ('01'B),
846 RSL_CHANNEED_TCH_F ('10'B),
847 RSL_CHANNEED_TCH_ForH ('11'B)
Harald Welte51d74102017-12-10 23:05:02 +0100848 } with { variant "FIELDLENGTH(2)" };
Harald Welte643e2a62017-11-27 15:03:18 +0100849 type record RSL_IE_ChanNeeded {
850 uint6_t reserved,
851 RSL_ChanNeeded chan_needed
852 }
853
Harald Weltecc373202018-09-10 10:28:21 +0200854 /* 9.3.41 CB Command Type */
855 type enumerated RSL_CbCommand {
856 RSL_CB_CMD_NORMAL ('0000'B),
857 RSL_CB_CMD_SCHEDULE ('1000'B),
858 RSL_CB_CMD_DEFAULT ('1110'B),
859 RSL_CB_CMD_NULL ('1111'B)
860 } with { variant "FIELDLENGTH(4)" };
861 type record RSL_IE_CbCommandType {
862 RSL_CbCommand command,
863 boolean default_bcast_null,
864 BIT1 spare,
865 uint2_t last_block
866 };
867 template (value) RSL_IE_CbCommandType ts_RSL_IE_CbCmdType(RSL_CbCommand cmd := RSL_CB_CMD_NORMAL,
868 uint2_t last_block := 1,
869 boolean def_bcast_null := true) := {
870 command := cmd,
871 default_bcast_null := def_bcast_null,
872 spare := '0'B,
873 last_block := last_block
874 }
875
Harald Welte4a129f82019-05-21 16:35:22 +0200876 /* 9.4.43 CBCH Load Information */
877 type record RSL_IE_CbchLoadInfo {
878 boolean overflow,
879 BIT3 spare,
880 uint4_t slot_count
881 };
882 template RSL_IE_CbchLoadInfo tr_CbchLoadInfo(template boolean overflow,
883 template uint4_t slot_count) := {
884 overflow := overflow,
885 spare := ?,
886 slot_count := slot_count
887 }
888 template (value) RSL_IE_CbchLoadInfo ts_CbchLoadInfo(boolean overflow, uint4_t slot_count) := {
889 overflow := overflow,
890 spare := '000'B,
891 slot_count := slot_count
892 }
893
Harald Weltee33e5152023-04-09 23:29:48 +0200894 /* 9.3.45 Group Call Reference */
895 type record RSL_IE_GroupCallReference {
896 uint8_t len,
897 GroupCallRef group_or_bcast_call_ref
898 } with {
899 variant (len) "LENGTHTO(group_or_bcast_call_ref)"
900 };
901 template (value) RSL_IE_GroupCallReference ts_GroupCallRef(template (value) GroupCallRef gcr) := {
902 len := 0, // overwritten
903 group_or_bcast_call_ref := gcr
904 }
905 template (present) RSL_IE_GroupCallReference tr_GroupCallRef(template (present) GroupCallRef gcr := ?) := {
906 len := ?,
907 group_or_bcast_call_ref := gcr
908 }
909
910 /* 9.3.46 Channel description */
911 type record RSL_IE_GroupChannelDescription {
912 uint8_t len,
913 octetstring chan_desc
914 } with {
915 variant (len) "LENGTHTO(chan_desc)"
916 };
917 template (value) RSL_IE_GroupChannelDescription ts_GroupChanDesc(template (value) octetstring cd) := {
918 len := 0, // overwritten
919 chan_desc := cd
920 }
921 template (present) RSL_IE_GroupChannelDescription tr_GroupChanDesc(template (present) octetstring cd) := {
922 len := ?,
923 chan_desc := cd
924 }
925
926 /* 9.3.47 NCH DRX Information */
927 type record RSL_IE_NchDrxInformation {
928 uint8_t len,
929 BIT2 spare,
930 BIT1 nln_status,
931 BIT3 emlpp_priority,
932 BIT2 nln
933 } with {
934 variant (len) "LENGTHTO(spare,nln_status,emlpp_priority,nln)"
935 };
936
937 /* 9.3.48 Command Indicator */
938 type enumerated RSL_CommandIndicator {
939 CMD_IND_START (0),
940 CMD_IND_STOP (1)
941 } with { variant "FIELDLENGTH(8)" };
942 type record RSL_IE_CommandIndicator {
943 uint8_t len,
944 RSL_CommandIndicator command_value
945 } with {
946 variant (len) "LENGTHTO(command_value)"
947 };
948 template (value) RSL_IE_CommandIndicator ts_CommandInd(template (value) RSL_CommandIndicator ci) := {
949 len := 0, // overwritten
950 command_value := ci
951 }
952 template (present) RSL_IE_CommandIndicator tr_CommandInd(template (present) RSL_CommandIndicator ci) := {
953 len := ?,
954 command_value := ci
955 }
956
957 /* 9.3.50 UIC */
958 type record RSL_IE_Uic {
959 uint8_t len,
960 BIT2 spare,
961 uint6_t uic
962 } with {
963 variant (len) "LENGTHTO(spare,uic)"
964 };
965
Pau Espin Pedrolf7634dc2022-09-02 17:56:00 +0200966 /* 9.3.52, 3GPP TS 44.018 10.5.2.21aa */
967 type record RSL_IE_MultirateCfg {
968 uint8_t len,
969 uint3_t mr_speech_ver,
970 boolean nscb,
971 boolean icmi,
972 BIT1 spare,
973 uint2_t start_mode,
Vadim Yanitskiyf14e6962022-09-14 15:18:06 +0700974 BIT8 codec_modes,
Pau Espin Pedrolf7634dc2022-09-02 17:56:00 +0200975 octetstring parameters
976 } with {
Vadim Yanitskiyf14e6962022-09-14 15:18:06 +0700977 variant (len) "LENGTHTO(mr_speech_ver,nscb,icmi,spare,start_mode,codec_modes,parameters)"
Pau Espin Pedrolf7634dc2022-09-02 17:56:00 +0200978 };
979 template (value) RSL_IE_MultirateCfg ts_RSL_MultirateCfg(boolean icmi := true, uint2_t start_mode := 0,
Vadim Yanitskiy0345d202022-09-14 16:13:40 +0700980 BIT8 codec_modes := '00000100'B /* 5,90k */,
981 octetstring params := ''O) := {
Vadim Yanitskiy9e0139b2022-09-14 17:41:29 +0700982 len := 2 + lengthof(params),
Pau Espin Pedrolf7634dc2022-09-02 17:56:00 +0200983 mr_speech_ver := 1,
984 nscb := false,
985 icmi := icmi,
986 spare := '0'B,
987 start_mode := start_mode,
Vadim Yanitskiyf14e6962022-09-14 15:18:06 +0700988 codec_modes := codec_modes,
Vadim Yanitskiy0345d202022-09-14 16:13:40 +0700989 parameters := params
Pau Espin Pedrolf7634dc2022-09-02 17:56:00 +0200990 }
991
Harald Welte643e2a62017-11-27 15:03:18 +0100992 /* 9.3.53 */
993 type record RSL_IE_MultirateCtrl {
994 uint3_t spare,
995 boolean od,
996 boolean pre,
997 uint2_t rae,
998 boolean tfo
999 }
1000
1001 type enumerated RSL_IE_SysinfoType {
1002 RSL_SYSTEM_INFO_8 ('00000000'B),
1003 RSL_SYSTEM_INFO_1 ('00000001'B),
1004 RSL_SYSTEM_INFO_2 ('00000010'B),
1005 RSL_SYSTEM_INFO_3 ('00000011'B),
1006 RSL_SYSTEM_INFO_4 ('00000100'B),
1007 RSL_SYSTEM_INFO_5 ('00000101'B),
1008 RSL_SYSTEM_INFO_6 ('00000110'B),
1009 RSL_SYSTEM_INFO_7 ('00000111'B),
1010 RSL_SYSTEM_INFO_16 ('00001000'B),
1011 RSL_SYSTEM_INFO_17 ('00001001'B),
1012 RSL_SYSTEM_INFO_2bis ('00001010'B),
1013 RSL_SYSTEM_INFO_2ter ('00001011'B),
1014 RSL_SYSTEM_INFO_5bis ('00001101'B),
1015 RSL_SYSTEM_INFO_5ter ('00001110'B),
1016 RSL_SYSTEM_INFO_10 ('00001111'B),
1017 RSL_EXT_MEAS_ORDER ('01000111'B),
1018 RSL_MEAS_INFO ('01001000'B),
1019 RSL_SYSTEM_INFO_13 ('00101000'B),
1020 RSL_ERIC_SYSTEM_INFO_13 ('00001100'B),
1021 RSL_SYSTEM_INFO_2quater ('00101001'B),
1022 RSL_SYSTEM_INFO_9 ('00101010'B),
1023 RSL_SYSTEM_INFO_18 ('00101011'B),
1024 RSL_SYSTEM_INFO_19 ('00101100'B),
1025 RSL_SYSTEM_INFO_20 ('00101101'B)
1026 } with { variant "FIELDLENGTH(8)" }
1027
Harald Welte9958a4d2017-12-14 21:21:33 +01001028 type record RSL_IE_IPA_ConnectionStats {
1029 uint8_t len,
1030 uint32_t tx_packets,
1031 uint32_t tx_octets,
1032 uint32_t rx_packets,
1033 uint32_t rx_octets,
1034 uint32_t lost_packets,
1035 uint32_t jitter,
1036 uint32_t avg_delay
1037 } with { variant (len) "LENGTHTO(tx_packets,tx_octets,rx_packets,rx_octets,lost_packets,jitter,avg_delay)" }
1038
1039 type enumerated RSL_IPA_SpeechMode {
1040 RSL_IPA_SPM_SENDRECV ('00'B),
1041 RSL_IPA_SPM_RECVONLY ('01'B),
1042 RSL_IPA_SPM_SENDONLY ('10'B),
1043 RSL_IPA_SPM_RESERVED ('11'B)
1044 } with { variant "FIELDLENGTH(2)" }
1045
1046 type enumerated RSL_IPA_Codec {
1047 RSL_IPA_CODEC_FR ('0000'B),
1048 RSL_IPA_CODEC_EFR ('0001'B),
1049 RSL_IPA_CODEC_AMR_F ('0010'B),
1050 RSL_IPA_CODEC_HR ('0011'B),
1051 RSL_IPA_CODEC_AMR_H ('0101'B),
1052 RSL_IPA_CODEC_RTP_PT ('1111'B)
1053 } with { variant "FIELDLENGTH(4)" }
1054
1055 type record RSL_IE_IPA_SpeechMode {
1056 BIT2 reserved,
1057 RSL_IPA_SpeechMode mode,
1058 RSL_IPA_Codec codec
1059 }
1060
Oliver Smithbc392a82023-04-17 14:06:42 +02001061 type enumerated RSL_IPA_RTP_CSD_FMT_D {
1062 RSL_IPA_RTP_CSD_EXT_TRAU ('0000'B),
1063 RSL_IPA_RTP_CSD_NON_TRAU ('0001'B),
1064 RSL_IPA_RTP_CSD_TRAU_BTS ('0010'B),
1065 RSL_IPA_RTP_CSD_IWF_FREE ('0011'B)
1066 } with { variant "FIELDLENGTH(4)" }
1067
1068 type enumerated RSL_IPA_RTP_CSD_FMT_IR {
1069 RSL_IPA_RTP_CSD_8k ('0000'B),
1070 RSL_IPA_RTP_CSD_16k ('0001'B),
1071 RSL_IPA_RTP_CSD_32k ('0010'B),
1072 RSL_IPA_RTP_CSD_64 ('0011'B)
1073 } with { variant "FIELDLENGTH(4)" }
1074
1075 type record RSL_IE_IPA_RTP_CSD_FMT {
1076 RSL_IPA_RTP_CSD_FMT_IR ir,
1077 RSL_IPA_RTP_CSD_FMT_D d
1078 }
1079
Harald Welte0472ab42018-03-12 15:02:26 +01001080 /* 9.3.20 */
1081 type enumerated RSL_IE_ReleaseMode {
1082 RSL_REL_MODE_NORMAL ('00'B),
Andreas Eversbergd8237a32023-07-18 14:43:03 +02001083 RSL_REL_MODE_LOCAL ('01'B)
Harald Welte0472ab42018-03-12 15:02:26 +01001084 }
1085
Neels Hofmeyr2bef0dd2021-04-22 21:46:00 +00001086 type record RSL_IE_OSMO_TrainingSequence {
1087 uint8_t len,
1088 uint8_t tsc_set,
1089 uint8_t tsc
1090 } with { variant (len) "LENGTHTO(tsc_set,tsc)" }
1091
Vadim Yanitskiy1f532152021-11-01 20:37:56 +03001092 type record RSL_IE_OSMO_RepAcchCap {
1093 uint8_t len,
1094 BIT1 rfu ('0'B),
1095 uint3_t rxqual,
1096 boolean ul_sacch,
1097 boolean dl_sacch,
1098 boolean dl_facch_all,
1099 boolean dl_facch_cmd
1100 } with { variant (len) "LENGTHTO(rfu,rxqual,ul_sacch,dl_sacch,dl_facch_all,dl_facch_cmd)" }
1101
Vadim Yanitskiya203d3b2021-11-01 21:32:31 +03001102 type record RSL_IE_OSMO_TopAcchCap {
1103 uint8_t len,
1104 boolean sacch_enable,
1105 boolean facch_enable,
1106 uint3_t rxqual,
1107 uint3_t overpower_db
1108 } with { variant (len) "LENGTHTO(sacch_enable,facch_enable,rxqual,overpower_db)" }
1109
Vadim Yanitskiy66d3c332021-11-06 18:18:13 +03001110 template (value) RSL_IE_OSMO_TopAcchCap
1111 ts_RSL_IE_OSMO_TopAcchCap(template (value) uint3_t overpower := 2,
1112 template (value) uint3_t rxqual := 4,
1113 boolean facch_enable := true,
1114 boolean sacch_enable := true) := {
1115 len := 0, /* overwritten */
1116 sacch_enable := sacch_enable,
1117 facch_enable := facch_enable,
1118 rxqual := rxqual,
1119 overpower_db := overpower
1120 };
1121 template RSL_IE_OSMO_TopAcchCap
1122 tr_RSL_IE_OSMO_TopAcchCap(template (present) uint3_t overpower := ?,
1123 template (present) uint3_t rxqual := ?,
1124 template (present) boolean facch_enable := ?,
1125 template (present) boolean sacch_enable := ?) := {
1126 len := ?, /* overwritten */
1127 sacch_enable := sacch_enable,
1128 facch_enable := facch_enable,
1129 rxqual := rxqual,
1130 overpower_db := overpower
1131 };
1132
Pau Espin Pedrol29c6dfb2022-08-08 18:37:56 +02001133 type record RSL_IE_OSMO_Osmux_CID {
1134 uint8_t len,
1135 uint8_t cid
1136 } with { variant (len) "LENGTHTO(cid)" }
1137
1138 template (present) RSL_IE_OSMO_Osmux_CID
1139 tr_RSL_IE_OSMO_Osmux_CID(template (present) uint8_t osmux_cid := ?) := {
1140 len := ?, /* overwritten */
1141 cid := osmux_cid
1142 };
Pau Espin Pedrol39bfa022022-08-12 14:56:12 +02001143 function f_tr_RSL_IE_OSMO_Osmux_CID(template uint8_t osmux_cid := *)
1144 return template RSL_IE_OSMO_Osmux_CID {
1145 var template RSL_IE_OSMO_Osmux_CID ie := omit;
1146 if (not istemplatekind(osmux_cid, "omit")) {
1147 ie := tr_RSL_IE_OSMO_Osmux_CID(osmux_cid);
1148 }
1149 return ie;
1150 }
Pau Espin Pedrol29c6dfb2022-08-08 18:37:56 +02001151 template (value) RSL_IE_OSMO_Osmux_CID
1152 ts_RSL_IE_OSMO_Osmux_CID(template (value) uint8_t osmux_cid) := {
1153 len := 0, /* overwritten */
1154 cid := osmux_cid
1155 };
1156
1157
Harald Welte643e2a62017-11-27 15:03:18 +01001158 /* union of all IE bodies */
1159 type union RSL_IE_Body {
1160 RslChannelNr chan_nr,
1161 RslLinkId link_id,
Harald Welte15bb5b52017-12-07 17:52:04 +01001162 RSL_L16V l3_info,
Harald Welte643e2a62017-11-27 15:03:18 +01001163 RSL_LV rlm_cause,
Harald Welte0472ab42018-03-12 15:02:26 +01001164 RSL_IE_ReleaseMode release_mode,
Harald Welte643e2a62017-11-27 15:03:18 +01001165 RSL_IE_ActivationType act_type,
Vadim Yanitskiye02dbcc2020-08-25 04:20:51 +07001166 RSL_IE_ChannelIdent chan_ident,
Harald Welte643e2a62017-11-27 15:03:18 +01001167 RSL_IE_ChannelMode chan_mode,
1168 uint8_t handover_ref,
1169 RSL_IE_BS_Power bs_power,
Vadim Yanitskiy802508e2020-11-11 07:25:47 +07001170 RSL_LV bs_power_params,
Harald Welte643e2a62017-11-27 15:03:18 +01001171 RSL_IE_MS_Power ms_power,
Eric Wild61edb7e2019-06-03 12:38:31 +02001172 RSL_IE_MS_Power_Parameters ms_power_params,
Harald Welte643e2a62017-11-27 15:03:18 +01001173 uint8_t timing_adv,
Pau Espin Pedrolf7634dc2022-09-02 17:56:00 +02001174 RSL_IE_MultirateCfg multirate_cfg,
Harald Welte643e2a62017-11-27 15:03:18 +01001175 RSL_IE_MultirateCtrl multirate_ctrl,
Harald Weltea6706152019-05-19 20:38:18 +02001176 uint8_t msg_id,
Harald Welte643e2a62017-11-27 15:03:18 +01001177 RSL_IE_FrameNumber frame_nr,
1178 RSL_IE_Cause cause,
1179 uint8_t access_delay,
Harald Welted5f521e2017-12-07 17:53:06 +01001180 RSL_IE_RachLoad rach_load,
Harald Welte643e2a62017-11-27 15:03:18 +01001181 uint8_t meas_res_nr,
Harald Welte2691adf2018-02-22 17:32:39 +01001182 uint8_t ms_timing_offset,
1183 RSL_IE_UplinkMeas uplink_meas,
Harald Welte643e2a62017-11-27 15:03:18 +01001184 RSL_IE_L1Info l1_info,
1185 RSL_IE_SysinfoType sysinfo_type,
1186 uint16_t paging_load,
1187 uint8_t paging_group,
1188 RSL_IE_ChanNeeded chan_needed,
Harald Weltecc373202018-09-10 10:28:21 +02001189 RSL_IE_CbCommandType cb_cmd_type,
1190 RSL_LV smscb_message,
Harald Welte4a129f82019-05-21 16:35:22 +02001191 RSL_IE_CbchLoadInfo cbch_load_info,
Vadim Yanitskiy9f699532021-06-03 17:29:22 +02001192 RSL_IE_ResourceInfo resource_info,
Harald Weltec8d363c2019-05-19 20:36:48 +02001193 RSL_SacchInfo sacch_info,
Harald Weltecc373202018-09-10 10:28:21 +02001194
Harald Welte643e2a62017-11-27 15:03:18 +01001195 RSL_IE_StartingTime starting_time,
Harald Welte73cd2712017-12-17 00:44:52 +01001196 RSL_IE_EncryptionInfo encr_info,
Harald Weltea3ff6702019-05-20 20:03:50 +02001197 uint8_t smscb_chan_ind,
Harald Welte643e2a62017-11-27 15:03:18 +01001198 RSL_IE_RequestRef req_ref,
1199 RSL_LV full_imm_ass_info,
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +07001200 MobileIdentityLV ms_identity,
Harald Welte643e2a62017-11-27 15:03:18 +01001201
Harald Weltee33e5152023-04-09 23:29:48 +02001202 RSL_IE_GroupCallReference group_call_ref,
1203 RSL_IE_GroupChannelDescription group_chan_desc,
1204 RSL_IE_NchDrxInformation nch_drx_info,
1205 RSL_IE_CommandIndicator cmd_indicator,
1206 RSL_IE_Uic uic,
1207
Harald Welte9958a4d2017-12-14 21:21:33 +01001208 uint16_t ipa_conn_id,
1209 uint16_t ipa_local_port,
1210 uint16_t ipa_remote_port,
Vadim Yanitskiyfc631642021-07-03 02:42:45 +02001211 OCT4 ipa_local_ip,
1212 OCT4 ipa_remote_ip,
Harald Welte9958a4d2017-12-14 21:21:33 +01001213 uint8_t ipa_rtp_pt,
1214 uint8_t ipa_rtp_pt2,
1215 RSL_IE_IPA_ConnectionStats ipa_stats,
1216 RSL_IE_IPA_SpeechMode ipa_speech_mode,
Oliver Smithbc392a82023-04-17 14:06:42 +02001217 RSL_IE_IPA_RTP_CSD_FMT ipa_rtp_csd_fmt,
Harald Welte9958a4d2017-12-14 21:21:33 +01001218
Neels Hofmeyr2bef0dd2021-04-22 21:46:00 +00001219 RSL_IE_OSMO_TrainingSequence osmo_training_sequence,
Vadim Yanitskiy1f532152021-11-01 20:37:56 +03001220 RSL_IE_OSMO_RepAcchCap rep_acch_cap,
Vadim Yanitskiya203d3b2021-11-01 21:32:31 +03001221 RSL_IE_OSMO_TopAcchCap top_acch_cap,
Pau Espin Pedrol29c6dfb2022-08-08 18:37:56 +02001222 RSL_IE_OSMO_Osmux_CID osmux_cid,
Neels Hofmeyr2bef0dd2021-04-22 21:46:00 +00001223
Harald Welte643e2a62017-11-27 15:03:18 +01001224 RSL_LV other
1225 }
1226
1227 type record RSL_IE {
1228 RSL_IE_Type iei,
1229 RSL_IE_Body body
1230 } with { variant (body) "CROSSTAG(
1231 chan_nr, iei = RSL_IE_CHAN_NR;
1232 link_id, iei = RSL_IE_LINK_IDENT;
1233 l3_info, iei = RSL_IE_L3_INFO;
1234 rlm_cause, iei = RSL_IE_RLM_CAUSE;
1235 release_mode, iei = RSL_IE_RELEASE_MODE;
1236 act_type, iei = RSL_IE_ACT_TYPE;
Vadim Yanitskiye02dbcc2020-08-25 04:20:51 +07001237 chan_ident, iei = RSL_IE_CHAN_IDENT;
Harald Welte643e2a62017-11-27 15:03:18 +01001238 chan_mode, iei = RSL_IE_CHAN_MODE;
1239 handover_ref, iei = RSL_IE_HANDO_REF;
1240 bs_power, iei = RSL_IE_BS_POWER;
Vadim Yanitskiy802508e2020-11-11 07:25:47 +07001241 bs_power_params, iei = RSL_IE_BS_POWER_PARAM;
Harald Welte643e2a62017-11-27 15:03:18 +01001242 ms_power, iei = RSL_IE_MS_POWER;
Eric Wild61edb7e2019-06-03 12:38:31 +02001243 ms_power_params, iei = RSL_IE_MS_POWER_PARAM;
Harald Welte643e2a62017-11-27 15:03:18 +01001244 timing_adv, iei = RSL_IE_TIMING_ADVANCE;
Pau Espin Pedrolf7634dc2022-09-02 17:56:00 +02001245 multirate_cfg, iei = RSL_IE_MR_CONFIG;
Harald Welte643e2a62017-11-27 15:03:18 +01001246 multirate_ctrl, iei = RSL_IE_MR_CONTROL;
Harald Weltea6706152019-05-19 20:38:18 +02001247 msg_id, iei = RSL_IE_MSG_ID;
Harald Welte643e2a62017-11-27 15:03:18 +01001248
1249 frame_nr, iei = RSL_IE_FRAME_NUMBER;
1250 cause, iei = RSL_IE_CAUSE;
1251 access_delay, iei = RSL_IE_ACCESS_DELAY;
Harald Welted5f521e2017-12-07 17:53:06 +01001252 rach_load, iei = RSL_IE_RACH_LOAD;
Harald Welte643e2a62017-11-27 15:03:18 +01001253 meas_res_nr, iei = RSL_IE_MEAS_RES_NR;
Harald Welte2691adf2018-02-22 17:32:39 +01001254 ms_timing_offset, iei = RSL_IE_MS_TIMING_OFFSET;
1255 uplink_meas, iei = RSL_IE_UPLINK_MEAS;
Harald Welte643e2a62017-11-27 15:03:18 +01001256 l1_info, iei = RSL_IE_L1_INFO;
1257 sysinfo_type, iei = RSL_IE_SYSINFO_TYPE;
1258 paging_load, iei = RSL_IE_PAGING_LOAD;
1259 paging_group, iei = RSL_IE_PAGING_GROUP;
1260 chan_needed, iei = RSL_IE_CHAN_NEEDED;
Harald Weltecc373202018-09-10 10:28:21 +02001261 cb_cmd_type, iei = RSL_IE_CB_CMD_TYPE;
1262 smscb_message, iei = RSL_IE_SMSCB_MSG;
Harald Welte4a129f82019-05-21 16:35:22 +02001263 cbch_load_info, iei = RSL_IE_CBCH_LOAD_INFO;
Vadim Yanitskiy9f699532021-06-03 17:29:22 +02001264 resource_info, iei = RSL_IE_RESOURCE_INFO;
Harald Weltec8d363c2019-05-19 20:36:48 +02001265 sacch_info, iei = RSL_IE_SACCH_INFO;
Harald Welte643e2a62017-11-27 15:03:18 +01001266 starting_time, iei = RSL_IE_STARTNG_TIME;
Harald Welte73cd2712017-12-17 00:44:52 +01001267 encr_info, iei = RSL_IE_ENCR_INFO;
Harald Weltea3ff6702019-05-20 20:03:50 +02001268 smscb_chan_ind, iei = RSL_IE_SMSCB_CHAN_INDICATOR;
Harald Welte643e2a62017-11-27 15:03:18 +01001269
1270 req_ref, iei = RSL_IE_REQ_REFERENCE;
Harald Weltefff69302017-12-07 17:53:42 +01001271 full_imm_ass_info, iei = RSL_IE_FULL_IMM_ASS_INFO;
1272 ms_identity, iei = RSL_IE_MS_IDENTITY;
1273 other, iei = RSL_IE_FULL_BCCH_INFO;
Harald Welte643e2a62017-11-27 15:03:18 +01001274
Harald Weltee33e5152023-04-09 23:29:48 +02001275 group_call_ref, iei = RSL_IE_GROUP_CALL_REF;
1276 group_chan_desc, iei = RSL_IE_GROUP_CHAN_DESC;
1277 nch_drx_info, iei = RSL_IE_NCH_DRX_INFO;
1278 cmd_indicator, iei = RSL_IE_CMD_INDICATOR;
1279 uic, iei = RSL_IE_UIC;
1280
Harald Welte9958a4d2017-12-14 21:21:33 +01001281 ipa_conn_id, iei = RSL_IE_IPAC_CONN_ID;
1282 ipa_remote_ip, iei = RSL_IE_IPAC_REMOTE_IP;
1283 ipa_remote_port, iei = RSL_IE_IPAC_REMOTE_PORT;
1284 ipa_local_ip, iei = RSL_IE_IPAC_LOCAL_IP;
1285 ipa_local_port, iei = RSL_IE_IPAC_LOCAL_PORT;
1286 ipa_rtp_pt, iei = RSL_IE_IPAC_RTP_PAYLOAD;
1287 ipa_rtp_pt2, iei = RSL_IE_IPAC_RTP_PAYLOAD2;
1288 ipa_stats, iei = RSL_IE_IPAC_CONN_STAT;
1289 ipa_speech_mode, iei = RSL_IE_IPAC_SPEECH_MODE;
Oliver Smithbc392a82023-04-17 14:06:42 +02001290 ipa_rtp_csd_fmt, iei = RSL_IE_IPAC_RTP_CSD_FMT;
Harald Welte9958a4d2017-12-14 21:21:33 +01001291
Neels Hofmeyr2bef0dd2021-04-22 21:46:00 +00001292 osmo_training_sequence, iei = RSL_IE_OSMO_TRAINING_SEQUENCE;
Vadim Yanitskiy1f532152021-11-01 20:37:56 +03001293 rep_acch_cap, iei = RSL_IE_OSMO_REP_ACCH_CAP;
Vadim Yanitskiya203d3b2021-11-01 21:32:31 +03001294 top_acch_cap, iei = RSL_IE_OSMO_TOP_ACCH_CAP;
Pau Espin Pedrol29c6dfb2022-08-08 18:37:56 +02001295 osmux_cid, iei = RSL_IE_OSMO_OSMUX_CID;
Neels Hofmeyr2bef0dd2021-04-22 21:46:00 +00001296
Harald Welte643e2a62017-11-27 15:03:18 +01001297 other, OTHERWISE;
1298 )" };
1299
Harald Welte735dd072017-12-12 14:55:17 +01001300 /* For some reason the TTCN-3 RAW codec cannot automatically figure out the IEI
1301 * that it needs to set for a given union-choice (body). So we have to explicitly
1302 * specify the IEI by the caller :( */
Harald Welteefa7d912018-04-18 23:22:15 +02001303 template (value) RSL_IE t_RSL_IE(RSL_IE_Type iei, template (value) RSL_IE_Body body) := {
Harald Welte735dd072017-12-12 14:55:17 +01001304 iei := iei,
Harald Welte643e2a62017-11-27 15:03:18 +01001305 body := body
1306 }
1307
Harald Weltec2877752017-12-07 17:54:35 +01001308 template RSL_IE tr_RSL_IE(template RSL_IE_Body body) := {
1309 iei := ?, /* overwritten? */
1310 body := body
1311 }
1312
1313
Harald Welte643e2a62017-11-27 15:03:18 +01001314 type record of RSL_IE RSL_IE_List;
1315
1316 type record RSL_Message {
1317 RSL_MessageDiscriminator msg_disc,
1318 RSL_MessageType msg_type,
1319 RSL_IE_List ies optional
1320 }
1321
1322 external function enc_RSL_Message(in RSL_Message msg) return octetstring
1323 with { extension "prototype(convert) encode(RAW)" };
1324 external function dec_RSL_Message(in octetstring stream) return RSL_Message
1325 with { extension "prototype(convert) decode(RAW)" };
1326
Harald Weltebc330be2017-12-09 00:56:36 +01001327 template RSL_Message tr_RSL_MsgDiscType(template RSL_MessageDiscriminator m_disc,
Harald Welte643e2a62017-11-27 15:03:18 +01001328 RSL_MessageType m_type) := {
1329 msg_disc := m_disc,
1330 msg_type := m_type,
1331 ies := *
1332 }
1333
Harald Welteefa7d912018-04-18 23:22:15 +02001334 template (value) RSL_Message ts_RSL_MsgDiscType(template (value) RSL_MessageDiscriminator m_disc,
1335 template (value) RSL_MessageType msg_type,
1336 template (omit) RSL_IE_List ies := omit) := {
Harald Welte4a267362017-12-09 17:49:32 +01001337 msg_disc := m_disc,
1338 msg_type := msg_type,
1339 ies := ies
1340 }
1341
Harald Weltebc330be2017-12-09 00:56:36 +01001342template RSL_Message tr_RSL_MsgType(template RSL_MessageType msg_type) := {
1343 msg_disc := ?,
1344 msg_type := msg_type,
1345 ies := *
1346}
1347
1348/* Common Channel Management */
1349template RSL_Message tr_RSL_MsgTypeC(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
1350 msg_disc := { RSL_MDISC_CCHAN, ? }
1351}
1352
1353/* RLL */
1354template RSL_Message tr_RSL_MsgTypeR(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
1355 msg_disc := { RSL_MDISC_RLL, true }
1356}
1357
1358/* Dedicated Channel Management */
1359template RSL_Message tr_RSL_MsgTypeD(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
1360 msg_disc := { RSL_MDISC_DCHAN, ? }
1361}
1362
Vadim Yanitskiybf2aa492022-06-01 00:28:38 +06001363/* TRX Management */
Harald Weltebc330be2017-12-09 00:56:36 +01001364template RSL_Message tr_RSL_MsgTypeT(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
1365 msg_disc := { RSL_MDISC_TRX_MGMT, ? }
1366}
1367
1368
1369/* dedicated channel or RLL */
1370template RSL_Message tr_RSL_MsgTypeDR(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
Harald Weltee5408222018-01-29 21:57:58 +01001371 msg_disc := ({RSL_MDISC_DCHAN,?}, {RSL_MDISC_RLL,?}, {RSL_MDISC_IPACCESS,false})
Harald Weltebc330be2017-12-09 00:56:36 +01001372}
1373
1374
Harald Welte643e2a62017-11-27 15:03:18 +01001375 /* 8.3.1 BSC -> BTS */
Harald Welteefa7d912018-04-18 23:22:15 +02001376 template (value) RSL_Message ts_RSL_DATA_REQ(template (value) RslChannelNr chan_nr,
1377 template (value) RslLinkId link_id,
1378 octetstring l3_info) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001379 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, true),
1380 msg_type := RSL_MT_DATA_REQ,
1381 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001382 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1383 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
1384 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
Harald Welte643e2a62017-11-27 15:03:18 +01001385 }
1386 }
1387
Harald Welte7794d5b2017-12-16 23:00:20 +01001388 template RSL_Message tr_RSL_DATA_REQ(template RslChannelNr chan_nr :=?,
1389 template RslLinkId link_id := ?,
1390 template octetstring l3_info := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001391 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, true),
Harald Welte7794d5b2017-12-16 23:00:20 +01001392 msg_type := RSL_MT_DATA_REQ,
1393 ies :={
1394 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1395 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
1396 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
1397 }
1398 }
1399
1400
Harald Welte643e2a62017-11-27 15:03:18 +01001401 /* 8.3.2 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001402 template (value) RSL_Message ts_RSL_DATA_IND(template (value) RslChannelNr chan_nr,
1403 template (value) RslLinkId link_id,
1404 octetstring l3_info) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001405 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, true),
1406 msg_type := RSL_MT_DATA_IND,
1407 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001408 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1409 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
1410 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
Harald Welte643e2a62017-11-27 15:03:18 +01001411 }
1412 }
Harald Welte9abd1282018-02-19 19:18:17 +01001413 template RSL_Message tr_RSL_DATA_IND(template RslChannelNr chan_nr, template RslLinkId link_id,
1414 template octetstring l3_info := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001415 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, true),
Harald Welte9abd1282018-02-19 19:18:17 +01001416 msg_type := RSL_MT_DATA_IND,
1417 ies :={
1418 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1419 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
1420 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
1421 }
1422 }
Harald Welte643e2a62017-11-27 15:03:18 +01001423
1424 /* 8.3.3 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001425 template (value) RSL_Message ts_RSL_ERROR_IND(template (value) RslChannelNr chan_nr,
Harald Weltea7d81f12019-06-02 22:33:19 +02001426 template (value) RslLinkId link_id,
1427 template (value) octetstring rlm_cause) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001428 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1429 msg_type := RSL_MT_ERROR_IND,
1430 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001431 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1432 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
Harald Weltea7d81f12019-06-02 22:33:19 +02001433 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{rlm_cause := ts_RSL_LV(rlm_cause)})
Harald Welte643e2a62017-11-27 15:03:18 +01001434 }
1435 }
Harald Welte9abd1282018-02-19 19:18:17 +01001436 template RSL_Message tr_RSL_ERROR_IND(template RslChannelNr chan_nr, template RslLinkId link_id,
Harald Weltea7d81f12019-06-02 22:33:19 +02001437 template octetstring rlm_cause := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001438 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001439 msg_type := RSL_MT_ERROR_IND,
1440 ies :={
1441 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1442 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
Harald Weltea7d81f12019-06-02 22:33:19 +02001443 tr_RSL_IE(RSL_IE_Body:{rlm_cause := tr_RSL_LV(rlm_cause)})
Harald Welte9abd1282018-02-19 19:18:17 +01001444 }
1445 }
Harald Welte643e2a62017-11-27 15:03:18 +01001446
Harald Welteefa7d912018-04-18 23:22:15 +02001447 /* 8.3.4 BTS <- BSC */
1448 template (value) RSL_Message ts_RSL_EST_REQ(template (value) RslChannelNr chan_nr,
1449 template (value) RslLinkId link_id) := {
1450 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1451 msg_type := RSL_MT_EST_REQ,
1452 ies := {
1453 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1454 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
1455 }
1456 }
1457 template RSL_Message tr_RSL_EST_REQ(template RslChannelNr chan_nr, template RslLinkId link_id) := {
1458 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
1459 msg_type := RSL_MT_EST_REQ,
1460 ies := {
1461 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1462 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1463 }
1464 }
1465
1466 /* 8.3.5 BTS -> BSC */
1467 template (value) RSL_Message ts_RSL_EST_CONF(template (value) RslChannelNr chan_nr,
1468 template (value) RslLinkId link_id) := {
1469 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1470 msg_type := RSL_MT_EST_CONF,
1471 ies := {
1472 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1473 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
1474 }
1475 }
1476 template RSL_Message tr_RSL_EST_CONF(template RslChannelNr chan_nr, template RslLinkId link_id) := {
1477 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
1478 msg_type := RSL_MT_EST_CONF,
1479 ies := {
1480 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1481 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1482 }
1483 }
1484
Harald Welte643e2a62017-11-27 15:03:18 +01001485 /* 8.3.6 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001486 template (value) RSL_Message ts_RSL_EST_IND(template (value) RslChannelNr chan_nr,
1487 template (value) RslLinkId link_id,
1488 octetstring l3_info) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001489 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1490 msg_type := RSL_MT_EST_IND,
1491 ies := {
Harald Welte735dd072017-12-12 14:55:17 +01001492 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1493 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
1494 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
Harald Welte643e2a62017-11-27 15:03:18 +01001495 }
1496 }
Harald Welte9abd1282018-02-19 19:18:17 +01001497 template RSL_Message tr_RSL_EST_IND(template RslChannelNr chan_nr, template RslLinkId link_id,
1498 template octetstring l3_info := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001499 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001500 msg_type := RSL_MT_EST_IND,
1501 ies := {
1502 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1503 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
1504 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
1505 }
1506 }
Harald Welte0472ab42018-03-12 15:02:26 +01001507 template RSL_Message tr_RSL_EST_IND_NOL3(template RslChannelNr chan_nr, template RslLinkId link_id) :=
1508{
1509 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
1510 msg_type := RSL_MT_EST_IND,
1511 ies := {
1512 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1513 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1514 }
1515 }
1516
Harald Welte643e2a62017-11-27 15:03:18 +01001517
1518 /* 8.3.7 BSC -> BTS */
Harald Welteefa7d912018-04-18 23:22:15 +02001519 template (value) RSL_Message ts_RSL_REL_REQ(template (value) RslChannelNr chan_nr,
Harald Welte0472ab42018-03-12 15:02:26 +01001520 template (value) RslLinkId link_id,
1521 template (value) RSL_IE_ReleaseMode rel_mode := RSL_REL_MODE_NORMAL) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001522 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1523 msg_type := RSL_MT_REL_REQ,
1524 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001525 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
Harald Welte0472ab42018-03-12 15:02:26 +01001526 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
1527 t_RSL_IE(RSL_IE_RELEASE_MODE, RSL_IE_Body:{release_mode := rel_mode})
Harald Welte643e2a62017-11-27 15:03:18 +01001528 }
1529 }
Harald Weltee8a5ab12017-12-09 22:34:57 +01001530 template RSL_Message tr_RSL_REL_REQ(template RslChannelNr chan_nr,
Harald Welte0472ab42018-03-12 15:02:26 +01001531 template RslLinkId link_id,
1532 template RSL_IE_ReleaseMode rel_mode := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001533 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Weltee8a5ab12017-12-09 22:34:57 +01001534 msg_type := RSL_MT_REL_REQ,
1535 ies :={
1536 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1537 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
Harald Welte0472ab42018-03-12 15:02:26 +01001538 tr_RSL_IE(RSL_IE_Body:{release_mode := rel_mode})
Harald Weltee8a5ab12017-12-09 22:34:57 +01001539 }
1540 }
Harald Welte643e2a62017-11-27 15:03:18 +01001541
1542 /* 8.3.8 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001543 template (value) RSL_Message ts_RSL_REL_CONF(template (value) RslChannelNr chan_nr,
1544 template (value) RslLinkId link_id) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001545 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1546 msg_type := RSL_MT_REL_CONF,
1547 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001548 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1549 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
Harald Welte643e2a62017-11-27 15:03:18 +01001550 }
1551 }
Harald Welte9abd1282018-02-19 19:18:17 +01001552 template RSL_Message tr_RSL_REL_CONF(template RslChannelNr chan_nr, template RslLinkId link_id) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001553 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001554 msg_type := RSL_MT_REL_CONF,
1555 ies :={
1556 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1557 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1558 }
1559 }
Harald Welte643e2a62017-11-27 15:03:18 +01001560
1561 /* 8.3.9 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001562 template (value) RSL_Message ts_RSL_REL_IND(template (value) RslChannelNr chan_nr,
1563 template (value) RslLinkId link_id) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001564 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1565 msg_type := RSL_MT_REL_IND,
1566 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001567 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1568 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
Harald Welte643e2a62017-11-27 15:03:18 +01001569 }
1570 }
Harald Welte9abd1282018-02-19 19:18:17 +01001571 template RSL_Message tr_RSL_REL_IND(template RslChannelNr chan_nr, template RslLinkId link_id) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001572 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001573 msg_type := RSL_MT_REL_IND,
1574 ies :={
1575 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1576 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1577 }
1578 }
Harald Welte643e2a62017-11-27 15:03:18 +01001579
1580 /* 8.3.10 BSC -> BTS */
Harald Welteefa7d912018-04-18 23:22:15 +02001581 template (value) RSL_Message ts_RSL_UNITDATA_REQ(template (value) RslChannelNr chan_nr,
1582 template (value) RslLinkId link_id,
1583 octetstring l3_info)
Harald Welte643e2a62017-11-27 15:03:18 +01001584 modifies ts_RSL_DATA_REQ := {
1585 msg_type := RSL_MT_UNIT_DATA_REQ
1586 }
Harald Welte0472ab42018-03-12 15:02:26 +01001587 template RSL_Message tr_RSL_UNITDATA_REQ(template RslChannelNr chan_nr,
1588 template RslLinkId link_id,
Vadim Yanitskiy8f98d3f2018-10-03 17:58:10 +07001589 template octetstring l3_info := ?)
Harald Welte0472ab42018-03-12 15:02:26 +01001590 modifies tr_RSL_DATA_REQ := {
1591 msg_type := RSL_MT_UNIT_DATA_REQ
1592 }
1593
Harald Welte643e2a62017-11-27 15:03:18 +01001594
1595 /* 8.3.11 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001596 template (value) RSL_Message ts_RSL_UNITDATA_IND(template (value) RslChannelNr chan_nr,
1597 template (value) RslLinkId link_id,
1598 octetstring l3_info)
Harald Welte643e2a62017-11-27 15:03:18 +01001599 modifies ts_RSL_DATA_IND := {
1600 msg_type := RSL_MT_UNIT_DATA_IND
1601 }
Harald Welte0472ab42018-03-12 15:02:26 +01001602 template RSL_Message tr_RSL_UNITDATA_IND(template RslChannelNr chan_nr,
Vadim Yanitskiyfabe0f22018-10-03 17:51:47 +07001603 template RslLinkId link_id,
Vadim Yanitskiy8f98d3f2018-10-03 17:58:10 +07001604 template octetstring l3_info := ?)
Harald Welte0472ab42018-03-12 15:02:26 +01001605 modifies tr_RSL_DATA_IND := {
1606 msg_type := RSL_MT_UNIT_DATA_IND
1607 }
1608
1609
Harald Welte643e2a62017-11-27 15:03:18 +01001610
1611
1612 /* DEDICATED CANNEL MANAGEMENT MESSAGES */
1613
1614 /* 8.4.1 BSC -> BTS */
Harald Welteefa7d912018-04-18 23:22:15 +02001615 template (value) RSL_Message ts_RSL_CHAN_ACT(template (value) RslChannelNr chan_nr,
Harald Welte921f9e02019-05-19 22:27:11 +02001616 template (value) RSL_IE_ChannelMode mode,
1617 template (value) RSL_IE_ActivationType at := t_RSL_IE_ActType_IA) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001618 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1619 msg_type := RSL_MT_CHAN_ACTIV,
1620 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001621 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
Harald Welte921f9e02019-05-19 22:27:11 +02001622 t_RSL_IE(RSL_IE_ACT_TYPE, RSL_IE_Body:{act_type := at}),
Harald Welte735dd072017-12-12 14:55:17 +01001623 t_RSL_IE(RSL_IE_CHAN_MODE, RSL_IE_Body:{chan_mode := mode})
Harald Welte643e2a62017-11-27 15:03:18 +01001624 /* lots of optional IEs */
1625 }
1626 }
Harald Welte94e0c342018-04-07 11:33:23 +02001627 template RSL_Message tr_RSL_CHAN_ACT(template RslChannelNr chan_nr,
Harald Welte921f9e02019-05-19 22:27:11 +02001628 template RSL_IE_ChannelMode mode,
1629 template (value) RSL_IE_ActivationType at := t_RSL_IE_ActType_IA) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001630 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte94e0c342018-04-07 11:33:23 +02001631 msg_type := RSL_MT_CHAN_ACTIV,
1632 ies :={
1633 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
Harald Welte921f9e02019-05-19 22:27:11 +02001634 tr_RSL_IE(RSL_IE_Body:{act_type := at}),
Harald Welte94e0c342018-04-07 11:33:23 +02001635 tr_RSL_IE(RSL_IE_Body:{chan_mode := mode}),
1636 /* lots of optional IEs */
1637 *
1638 }
1639 }
Vadim Yanitskiy58b16532021-10-09 20:27:39 +06001640
1641 template (value) RSL_Message
1642 ts_RSL_CHAN_ACT_PDCH(template (value) RslChannelNr chan_nr) := {
1643 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1644 msg_type := RSL_MT_CHAN_ACTIV,
1645 ies :={
1646 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1647 t_RSL_IE(RSL_IE_ACT_TYPE, RSL_IE_Body:{act_type := c_RSL_IE_ActType_PDCH})
1648 }
1649 }
1650 template RSL_Message
1651 tr_RSL_CHAN_ACT_PDCH(template (present) RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001652 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte94e0c342018-04-07 11:33:23 +02001653 msg_type := RSL_MT_CHAN_ACTIV,
1654 ies :={
1655 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
Vadim Yanitskiy58b16532021-10-09 20:27:39 +06001656 tr_RSL_IE(RSL_IE_Body:{act_type := c_RSL_IE_ActType_PDCH}),
Harald Welte94e0c342018-04-07 11:33:23 +02001657 /* lots of optional IEs */
1658 *
1659 }
1660 }
1661
Harald Welte643e2a62017-11-27 15:03:18 +01001662
1663 /* 8.4.2 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001664 template (value) RSL_Message ts_RSL_CHAN_ACT_ACK(template (value) RslChannelNr chan_nr,
1665 GsmFrameNumber fn) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001666 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1667 msg_type := RSL_MT_CHAN_ACTIV_ACK,
1668 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001669 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1670 t_RSL_IE(RSL_IE_FRAME_NUMBER, RSL_IE_Body:{frame_nr := ts_RSL_IE_FrameNumber(fn)})
Harald Welte643e2a62017-11-27 15:03:18 +01001671 }
1672 }
Harald Welte9abd1282018-02-19 19:18:17 +01001673 template RSL_Message tr_RSL_CHAN_ACT_ACK(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001674 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001675 msg_type := RSL_MT_CHAN_ACTIV_ACK,
1676 ies := {
1677 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1678 tr_RSL_IE(RSL_IE_Body:{frame_nr := ?})
1679 }
1680 }
Harald Welte643e2a62017-11-27 15:03:18 +01001681
1682 /* 8.4.3 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001683 template (value) RSL_Message ts_RSL_CHAN_ACT_NACK(template (value) RslChannelNr chan_nr,
1684 RSL_Cause cause) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001685 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1686 msg_type := RSL_MT_CHAN_ACTIV_NACK,
1687 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001688 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1689 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
Harald Welte643e2a62017-11-27 15:03:18 +01001690 }
1691 }
Harald Welte9abd1282018-02-19 19:18:17 +01001692 template RSL_Message tr_RSL_CHAN_ACT_NACK(template RslChannelNr chan_nr,
1693 template RSL_Cause cause := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001694 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001695 msg_type := RSL_MT_CHAN_ACTIV_NACK,
1696 ies := {
1697 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1698 tr_RSL_IE(RSL_IE_Body:{cause := ?})
1699 }
1700 }
Harald Welte643e2a62017-11-27 15:03:18 +01001701
1702 /* 8.4.4 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001703 template (value) RSL_Message ts_RSL_CONN_FAIL_IND(RslChannelNr chan_nr, RSL_Cause cause) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001704 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1705 msg_type := RSL_MT_CONN_FAIL,
1706 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001707 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1708 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
Harald Welte643e2a62017-11-27 15:03:18 +01001709 }
1710 }
Harald Welte9abd1282018-02-19 19:18:17 +01001711 template RSL_Message tr_RSL_CONN_FAIL_IND(template RslChannelNr chan_nr,
1712 template RSL_Cause cause := ?) := {
1713 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1714 msg_type := RSL_MT_CONN_FAIL,
1715 ies :={
1716 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1717 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
1718 }
1719 }
Harald Welte643e2a62017-11-27 15:03:18 +01001720
Harald Weltee8a5ab12017-12-09 22:34:57 +01001721 /* 8.4.5 BSC -> BTS */
1722 template RSL_Message tr_RSL_DEACT_SACCH(template RslChannelNr chan_nr) := {
1723 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1724 msg_type := RSL_MT_DEACTIVATE_SACCH,
1725 ies := {
1726 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
1727 }
1728 }
Harald Welteefa7d912018-04-18 23:22:15 +02001729 template (value) RSL_Message ts_RSL_DEACT_SACCH(template (value) RslChannelNr chan_nr) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001730 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1731 msg_type := RSL_MT_DEACTIVATE_SACCH,
1732 ies := {
1733 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1734 }
1735 }
1736
Harald Weltee8a5ab12017-12-09 22:34:57 +01001737
Harald Welte73cd2712017-12-17 00:44:52 +01001738 /* 8.4.6 BSC ->BTS */
1739 template RSL_Message tr_RSL_ENCR_CMD(template RslChannelNr chan_nr,
1740 template RslLinkId link_id := ?,
Harald Weltee613f962018-04-18 22:38:16 +02001741 template RSL_AlgId alg := ?,
Harald Welte73cd2712017-12-17 00:44:52 +01001742 template octetstring key := ?,
1743 template octetstring l3_info := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001744 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte73cd2712017-12-17 00:44:52 +01001745 msg_type := RSL_MT_ENCR_CMD,
1746 ies := {
1747 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1748 tr_RSL_IE(RSL_IE_Body:{encr_info := tr_RSL_IE_EncrInfo(alg, key)}),
1749 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
1750 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
1751 }
1752 }
Harald Welteefa7d912018-04-18 23:22:15 +02001753 template (value) RSL_Message ts_RSL_ENCR_CMD(template (value) RslChannelNr chan_nr,
1754 template (value) RslLinkId link_id,
Harald Weltee613f962018-04-18 22:38:16 +02001755 template (value) RSL_AlgId alg, octetstring key,
Harald Welteefa7d912018-04-18 23:22:15 +02001756 octetstring l3_info) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001757 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1758 msg_type := RSL_MT_ENCR_CMD,
1759 ies := {
1760 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
Harald Welteefa7d912018-04-18 23:22:15 +02001761 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 +01001762 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
Harald Welteefa7d912018-04-18 23:22:15 +02001763 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
Harald Welte9abd1282018-02-19 19:18:17 +01001764 }
1765 }
Harald Welte73cd2712017-12-17 00:44:52 +01001766
Harald Welte2691adf2018-02-22 17:32:39 +01001767 template RSL_Message tr_RSL_MEAS_RES(template RslChannelNr chan_nr,
1768 template uint8_t meas_res_nr := ?,
1769 template RSL_IE_UplinkMeas ul_meas := ?,
1770 template RSL_IE_BS_Power bs_power := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001771 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte2691adf2018-02-22 17:32:39 +01001772 msg_type := RSL_MT_MEAS_RES,
1773 ies := {
1774 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1775 tr_RSL_IE(RSL_IE_Body:{meas_res_nr := meas_res_nr}),
1776 tr_RSL_IE(RSL_IE_Body:{uplink_meas := ul_meas}),
1777 tr_RSL_IE(RSL_IE_Body:{bs_power := bs_power}),
1778 *
1779 }
1780 }
1781
Vadim Yanitskiy7c29c4e2022-06-18 03:07:50 +07001782 /* Templates for a measurement report that lacks the measurement report
Philipp Maierdd841d32019-12-17 14:44:54 +01001783 * from the MS (l1_info, l3_info and ms timing offset */
Vadim Yanitskiy7c29c4e2022-06-18 03:07:50 +07001784 template (value) RSL_Message
1785 ts_RSL_MEAS_RES_EMPTY(template (value) RslChannelNr chan_nr,
1786 template (value) uint8_t meas_res_nr,
1787 template (value) RSL_IE_UplinkMeas ul_meas,
1788 template (value) RSL_IE_BS_Power bs_power) := {
1789 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1790 msg_type := RSL_MT_MEAS_RES,
1791 ies := {
1792 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1793 t_RSL_IE(RSL_IE_MEAS_RES_NR, RSL_IE_Body:{meas_res_nr := meas_res_nr}),
1794 t_RSL_IE(RSL_IE_UPLINK_MEAS, RSL_IE_Body:{uplink_meas := ul_meas}),
1795 t_RSL_IE(RSL_IE_BS_POWER, RSL_IE_Body:{bs_power := bs_power})
1796 }
1797 }
1798 template RSL_Message
1799 tr_RSL_MEAS_RES_EMPTY(template (present) RslChannelNr chan_nr,
1800 template uint8_t meas_res_nr := ?,
1801 template RSL_IE_UplinkMeas ul_meas := ?,
1802 template RSL_IE_BS_Power bs_power := ?) := {
Philipp Maierdd841d32019-12-17 14:44:54 +01001803 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1804 msg_type := RSL_MT_MEAS_RES,
1805 ies := {
1806 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1807 tr_RSL_IE(RSL_IE_Body:{meas_res_nr := meas_res_nr}),
1808 tr_RSL_IE(RSL_IE_Body:{uplink_meas := ul_meas}),
1809 tr_RSL_IE(RSL_IE_Body:{bs_power := bs_power})
1810 }
1811 }
1812
Harald Welte39b47be2018-02-23 18:58:48 +01001813 /* Osmocom specific template, require lots of optional fields to be present */
1814 template RSL_Message tr_RSL_MEAS_RES_OSMO(template RslChannelNr chan_nr,
1815 template uint8_t meas_res_nr := ?,
1816 template RSL_IE_UplinkMeas ul_meas := ?,
1817 template RSL_IE_BS_Power bs_power := ?,
1818 template RSL_IE_L1Info l1_info := ?,
1819 template octetstring l3_info := ?,
1820 template uint8_t ms_to := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001821 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte39b47be2018-02-23 18:58:48 +01001822 msg_type := RSL_MT_MEAS_RES,
1823 ies := {
1824 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1825 tr_RSL_IE(RSL_IE_Body:{meas_res_nr := meas_res_nr}),
1826 tr_RSL_IE(RSL_IE_Body:{uplink_meas := ul_meas}),
1827 tr_RSL_IE(RSL_IE_Body:{bs_power := bs_power}),
1828 tr_RSL_IE(RSL_IE_Body:{l1_info := l1_info}),
1829 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)}),
1830 tr_RSL_IE(RSL_IE_Body:{ms_timing_offset := ms_to})
1831 }
1832 }
1833
Neels Hofmeyrafe2ea52021-11-24 15:16:12 +01001834 template (value) RSL_Message ts_RSL_MEAS_RES(template (value) RslChannelNr chan_nr,
1835 uint8_t meas_res_nr,
1836 template (value) RSL_IE_UplinkMeas ul_meas,
1837 template (value) RSL_IE_BS_Power bs_power,
1838 template (value) RSL_IE_L1Info l1_info,
1839 octetstring l3_info,
1840 uint8_t ms_to) := {
1841 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1842 msg_type := RSL_MT_MEAS_RES,
1843 ies := {
1844 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1845 t_RSL_IE(RSL_IE_MEAS_RES_NR, RSL_IE_Body:{meas_res_nr := meas_res_nr}),
1846 t_RSL_IE(RSL_IE_UPLINK_MEAS, RSL_IE_Body:{uplink_meas := ul_meas}),
1847 t_RSL_IE(RSL_IE_BS_POWER, RSL_IE_Body:{bs_power := bs_power}),
1848 t_RSL_IE(RSL_IE_L1_INFO, RSL_IE_Body:{l1_info := l1_info}),
1849 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)}),
1850 t_RSL_IE(RSL_IE_MS_TIMING_OFFSET, RSL_IE_Body:{ms_timing_offset := ms_to})
1851 }
1852 }
1853
Eric Wildf1827a72019-05-28 17:37:35 +02001854 /* 8.4.9 BSC -> BTS */
1855 template (value) RSL_Message ts_RSL_MODE_MODIFY_REQ(template (value) RslChannelNr chan_nr,
1856 template (value) RSL_IE_ChannelMode mode) := {
1857 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1858 msg_type := RSL_MT_MODE_MODIFY_REQ,
1859 ies :={
1860 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1861 t_RSL_IE(RSL_IE_CHAN_MODE, RSL_IE_Body:{chan_mode := mode})
1862 /* lots of optional IEs */
1863 }
1864 }
1865 template RSL_Message tr_RSL_MODE_MODIFY_REQ(template RslChannelNr chan_nr,
1866 template RSL_IE_ChannelMode mode) := {
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 /* lots of optional IEs */
1873 *
1874 }
1875 }
Neels Hofmeyr9f3e6ac2021-04-08 23:09:24 +02001876
1877 template RSL_Message tr_RSL_MODE_MODIFY_REQ_with_OSMO_TSC(template RslChannelNr chan_nr,
1878 template RSL_IE_ChannelMode mode,
1879 template uint8_t tsc_set := ?,
1880 template uint8_t tsc := ?) := {
1881 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1882 msg_type := RSL_MT_MODE_MODIFY_REQ,
1883 ies := {
1884 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1885 tr_RSL_IE(RSL_IE_Body:{chan_mode := mode}),
1886 tr_RSL_IE(RSL_IE_Body:{osmo_training_sequence := {
1887 len := ?,
1888 tsc_set := tsc_set,
1889 tsc := tsc
1890 }
1891 })
1892 }
1893 };
Pau Espin Pedrol85393122022-09-02 17:56:25 +02001894
Harald Welte7794d5b2017-12-16 23:00:20 +01001895 /* 8.4.10 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001896 template (value) RSL_Message ts_RSL_MODE_MODIFY_ACK(template (value) RslChannelNr chan_nr) := {
Harald Welte7794d5b2017-12-16 23:00:20 +01001897 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1898 msg_type := RSL_MT_MODE_MODIFY_ACK,
1899 ies := {
1900 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1901 }
1902 }
Harald Welte9abd1282018-02-19 19:18:17 +01001903 template RSL_Message tr_RSL_MODE_MODIFY_ACK(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001904 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001905 msg_type := RSL_MT_MODE_MODIFY_ACK,
1906 ies := {
1907 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
1908 }
1909 }
Harald Welte7794d5b2017-12-16 23:00:20 +01001910
Harald Welte643e2a62017-11-27 15:03:18 +01001911 /* 8.4.11 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001912 template (value) RSL_Message ts_RSL_MODE_MODIFY_NACK(template (value) RslChannelNr chan_nr,
1913 RSL_Cause cause) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001914 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1915 msg_type := RSL_MT_MODE_MODIFY_NACK,
1916 ies := {
1917 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1918 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
1919 }
Harald Welte643e2a62017-11-27 15:03:18 +01001920 }
Harald Welte9abd1282018-02-19 19:18:17 +01001921 template RSL_Message tr_RSL_MODE_MODIFY_NACK(template RslChannelNr chan_nr,
1922 template RSL_Cause cause) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001923 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001924 msg_type := RSL_MT_MODE_MODIFY_NACK,
1925 ies := {
1926 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1927 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
1928 }
1929 }
1930
Harald Welte643e2a62017-11-27 15:03:18 +01001931
Harald Welte6a8199d2018-01-29 21:58:53 +01001932 /* 8.4.14: BTS <- BSC */
1933 template RSL_Message tr_RSL_RF_CHAN_REL(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001934 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte6a8199d2018-01-29 21:58:53 +01001935 msg_type := RSL_MT_RF_CHAN_REL,
1936 ies := {
1937 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
1938 }
1939 }
Harald Welteefa7d912018-04-18 23:22:15 +02001940 template (value) RSL_Message ts_RSL_RF_CHAN_REL(template (value) RslChannelNr chan_nr) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001941 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1942 msg_type := RSL_MT_RF_CHAN_REL,
1943 ies := {
1944 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1945 }
1946 }
Harald Welte6a8199d2018-01-29 21:58:53 +01001947
Philipp Maier4d1e9c92018-12-20 11:11:56 +01001948 /* 8.4.15: BTS <- BSC */
1949 template (value) RSL_Message ts_RSL_MS_PWR_CTRL(template (value) RslChannelNr chan_nr,
1950 template (value) RSL_IE_MS_Power ms_power) := {
1951 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1952 msg_type := RSL_MT_MS_POWER_CONTROL,
1953 ies := {
1954 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1955 t_RSL_IE(RSL_IE_MS_POWER, RSL_IE_Body:{ms_power := ms_power})
1956 /* One optional IE: MS POWER PARAMETERS */
1957 }
1958 }
1959
Eric Wild61edb7e2019-06-03 12:38:31 +02001960 template (value) RSL_Message ts_RSL_MS_PWR_CTRL_with_pp(template (value) RslChannelNr chan_nr,
1961 integer pwr_level) := {
1962 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1963 msg_type := RSL_MT_MS_POWER_CONTROL,
1964 ies := {
1965 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1966 t_RSL_IE(RSL_IE_MS_POWER, RSL_IE_Body:{ms_power := ts_RSL_IE_MS_Power(pwr_level)}),
1967 t_RSL_IE(RSL_IE_MS_POWER_PARAM, RSL_IE_Body:{ms_power_params :=
1968 ts_RSL_IE_MS_Power_Parameters(''O)})
1969 }
1970 }
1971
Eric Wildae8f2622019-06-18 17:05:11 +02001972 /* 8.4.16: BTS <- BSC */
1973 template (value) RSL_Message ts_RSL_BS_PWR_CTRL(template (value) RslChannelNr chan_nr,
1974 template (value) RSL_IE_BS_Power bs_power) := {
1975 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1976 msg_type := RSL_MT_BS_POWER_CONTROL,
1977 ies := {
1978 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1979 t_RSL_IE(RSL_IE_BS_POWER, RSL_IE_Body:{bs_power := bs_power})
1980 /* One optional IE: BS POWER PARAMETERS */
1981 }
1982 }
Vadim Yanitskiy2a5a1ef2021-06-30 00:51:48 +02001983 template RSL_Message tr_RSL_BS_PWR_CTRL(template (present) RslChannelNr chan_nr,
1984 template (present) RSL_IE_BS_Power bs_power) := {
1985 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1986 msg_type := RSL_MT_BS_POWER_CONTROL,
1987 ies := {
1988 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1989 tr_RSL_IE(RSL_IE_Body:{bs_power := bs_power})
1990 /* One optional IE: BS POWER PARAMETERS */
1991 }
1992 }
Eric Wildae8f2622019-06-18 17:05:11 +02001993
Harald Welte4a267362017-12-09 17:49:32 +01001994 /* 8.4.19 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001995 template (value) RSL_Message ts_RSL_RF_CHAN_REL_ACK(template (value) RslChannelNr chan_nr) :=
Harald Welte4a267362017-12-09 17:49:32 +01001996 ts_RSL_MsgDiscType(ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1997 RSL_MT_RF_CHAN_REL_ACK,
Harald Welte735dd072017-12-12 14:55:17 +01001998 { t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}) });
Harald Welte4a267362017-12-09 17:49:32 +01001999
Harald Welte9abd1282018-02-19 19:18:17 +01002000 template RSL_Message tr_RSL_RF_CHAN_REL_ACK(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002001 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01002002 msg_type := RSL_MT_RF_CHAN_REL_ACK,
2003 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02002004 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
Harald Welte9abd1282018-02-19 19:18:17 +01002005 }
2006 }
2007
Harald Welteea17b912018-03-11 22:29:31 +01002008 /* 8.6.20 BTS <- BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02002009 template (value) RSL_Message ts_RSL_SACCH_INF_MOD(template (value) RslChannelNr chan_nr,
2010 RSL_IE_SysinfoType si_type,
2011 octetstring l3_info) := {
Harald Welteea17b912018-03-11 22:29:31 +01002012 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2013 msg_type := RSL_MT_SACCH_INFO_MODIFY,
2014 ies := {
2015 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2016 t_RSL_IE(RSL_IE_SYSINFO_TYPE, RSL_IE_Body:{sysinfo_type := si_type}),
2017 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
2018 }
2019 }
2020
Neels Hofmeyr378a49c2018-06-15 22:18:43 +02002021 /* 8.4.7 BTS -> BSC */
2022 template (value) RSL_Message ts_RSL_HANDO_DET(template (value) RslChannelNr chan_nr) := {
2023 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2024 msg_type := RSL_MT_HANDO_DET,
2025 ies := {
2026 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
2027 }
2028 }
Vadim Yanitskiy7c2c10c2019-05-31 20:42:01 +07002029 template RSL_Message tr_RSL_HANDO_DET(template RslChannelNr chan_nr,
2030 template uint8_t acc_delay := ?) := {
2031 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2032 msg_type := RSL_MT_HANDO_DET,
2033 ies := {
2034 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2035 tr_RSL_IE(RSL_IE_Body:{access_delay := acc_delay})
2036 }
2037 }
Neels Hofmeyr378a49c2018-06-15 22:18:43 +02002038
Andreas Eversberg06c44632023-05-09 12:41:32 +02002039 /* 8.4.21 BTS -> BSC */
2040 template (value) RSL_Message ts_RSL_TALKER_DET(template (value) RslChannelNr chan_nr) := {
2041 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2042 msg_type := RSL_MT_TALKER_DET,
2043 ies := {
2044 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
2045 }
2046 }
2047 template RSL_Message tr_RSL_TALKER_DET(template RslChannelNr chan_nr,
2048 template uint8_t acc_delay := ?) := {
2049 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2050 msg_type := RSL_MT_TALKER_DET,
2051 ies := {
2052 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2053 tr_RSL_IE(RSL_IE_Body:{access_delay := acc_delay})
2054 }
2055 }
2056
2057 /* 8.4.22 BTS -> BSC */
2058 template (value) RSL_Message ts_RSL_LISTENER_DET(template (value) RslChannelNr chan_nr) := {
2059 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2060 msg_type := RSL_MT_LISTENER_DET,
2061 ies := {
2062 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
2063 }
2064 }
2065 template RSL_Message tr_RSL_LISTENER_DET(template RslChannelNr chan_nr,
2066 template uint8_t acc_delay := ?) := {
2067 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2068 msg_type := RSL_MT_LISTENER_DET,
2069 ies := {
2070 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2071 tr_RSL_IE(RSL_IE_Body:{access_delay := acc_delay})
2072 }
2073 }
2074
Harald Welteea17b912018-03-11 22:29:31 +01002075
Harald Welte643e2a62017-11-27 15:03:18 +01002076 /* COMMON CHANNEL MANAGEMENT MESSAGES */
2077
Harald Welte874c2232018-02-24 04:52:43 +01002078 /* 8.5.1 BTS <- BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02002079 template (value) RSL_Message ts_RSL_BCCH_INFO(RSL_IE_SysinfoType si_type,
2080 octetstring full_bcch_info) := {
Harald Welte874c2232018-02-24 04:52:43 +01002081 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2082 msg_type := RSL_MT_BCCH_INFO,
2083 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02002084 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_BCCH(0)}),
Harald Welte874c2232018-02-24 04:52:43 +01002085 t_RSL_IE(RSL_IE_SYSINFO_TYPE, RSL_IE_Body:{sysinfo_type := si_type}),
2086 t_RSL_IE(RSL_IE_FULL_BCCH_INFO, RSL_IE_Body:{other := ts_RSL_LV(full_bcch_info)})
2087 }
2088 }
Harald Welte09538f82019-08-01 09:50:25 +02002089 template RSL_Message tr_RSL_NO_BCCH_INFO(template RSL_IE_SysinfoType si_type := ?) := {
2090 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2091 msg_type := RSL_MT_BCCH_INFO,
2092 ies := {
2093 tr_RSL_IE(RSL_IE_Body:{chan_nr := ts_RslChanNr_BCCH(0)}),
2094 tr_RSL_IE(RSL_IE_Body:{sysinfo_type := si_type})
2095 }
2096 }
2097 template RSL_Message tr_RSL_BCCH_INFO(template RSL_IE_SysinfoType si_type := ?,
2098 template octetstring full_bcch_info := ?) := {
2099 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2100 msg_type := RSL_MT_BCCH_INFO,
2101 ies := {
2102 tr_RSL_IE(RSL_IE_Body:{chan_nr := ts_RslChanNr_BCCH(0)}),
2103 tr_RSL_IE(RSL_IE_Body:{sysinfo_type := si_type}),
2104 tr_RSL_IE(RSL_IE_Body:{other := tr_RSL_LV(full_bcch_info)}),
2105 *
2106 }
2107 }
Harald Welte874c2232018-02-24 04:52:43 +01002108
Harald Welte7ae93142017-12-07 17:56:15 +01002109 /* 8.5.2 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02002110 template (value) RSL_Message ts_RSL_RACH_LOAD_IND(uint16_t slot_ct, uint16_t busy_ct,
2111 uint16_t acc_ct) := {
Harald Welte7ae93142017-12-07 17:56:15 +01002112 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2113 msg_type := RSL_MT_CCCH_LOAD_IND,
2114 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02002115 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_RACH(0)}),
Harald Welte735dd072017-12-12 14:55:17 +01002116 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 +01002117 }
2118 }
Harald Welte68e495b2018-02-25 00:05:57 +01002119 template RSL_Message tr_RSL_RACH_LOAD_IND(template uint16_t slot_ct := ?,
2120 template uint16_t busy_ct := ?,
Harald Welte09538f82019-08-01 09:50:25 +02002121 template uint16_t acc_ct := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002122 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Welte68e495b2018-02-25 00:05:57 +01002123 msg_type := RSL_MT_CCCH_LOAD_IND,
2124 ies := {
2125 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_RACH(0)}),
2126 tr_RSL_IE(RSL_IE_Body:{rach_load := tr_RSL_IE_RachLoad(slot_ct, busy_ct, acc_ct)})
2127 }
2128 }
2129
Harald Welteefa7d912018-04-18 23:22:15 +02002130 template (value) RSL_Message ts_RSL_PAGING_LOAD_IND(uint16_t buffer_space) := {
Harald Welte7ae93142017-12-07 17:56:15 +01002131 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2132 msg_type := RSL_MT_CCCH_LOAD_IND,
2133 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02002134 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_PCH_AGCH(0)}),
Harald Welte735dd072017-12-12 14:55:17 +01002135 t_RSL_IE(RSL_IE_PAGING_LOAD, RSL_IE_Body:{paging_load := buffer_space})
Harald Welte7ae93142017-12-07 17:56:15 +01002136 }
2137 }
Harald Welte68e495b2018-02-25 00:05:57 +01002138 template RSL_Message tr_RSL_PAGING_LOAD_IND(template uint16_t buffer_space := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002139 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Welte68e495b2018-02-25 00:05:57 +01002140 msg_type := RSL_MT_CCCH_LOAD_IND,
2141 ies := {
2142 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(0)}),
2143 tr_RSL_IE(RSL_IE_Body:{paging_load := buffer_space})
2144 }
2145 }
2146
Harald Welte7ae93142017-12-07 17:56:15 +01002147
Harald Welte643e2a62017-11-27 15:03:18 +01002148 /* 8.5.3 BTS -> BSC */
Vadim Yanitskiyab448a52019-05-31 20:24:03 +07002149 template (value) RSL_Message ts_RSL_CHAN_RQD(OCT1 ra, GsmFrameNumber fn,
2150 template (value) RslChannelNr chan_nr := ts_RslChanNr_RACH(0),
2151 uint8_t acc_del := 0) := {
Harald Welte643e2a62017-11-27 15:03:18 +01002152 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2153 msg_type := RSL_MT_CHAN_RQD,
2154 ies := {
Vadim Yanitskiyab448a52019-05-31 20:24:03 +07002155 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2156 /* TODO: we may need to have optional RSL_IE_LINK_IDENT IE here */
Harald Welte735dd072017-12-12 14:55:17 +01002157 t_RSL_IE(RSL_IE_REQ_REFERENCE, RSL_IE_Body:{req_ref := ts_RSL_IE_ReqRef(ra, fn)}),
2158 t_RSL_IE(RSL_IE_ACCESS_DELAY, RSL_IE_Body:{access_delay := acc_del})
Harald Welte643e2a62017-11-27 15:03:18 +01002159 }
2160 }
Harald Welte9abd1282018-02-19 19:18:17 +01002161 template RSL_Message tr_RSL_CHAN_RQD(template OCT1 ra, template GsmFrameNumber fn := ?,
Vadim Yanitskiyab448a52019-05-31 20:24:03 +07002162 template RslChannelNr chan_nr := ts_RslChanNr_RACH(0),
2163 template uint8_t acc_del := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002164 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01002165 msg_type := RSL_MT_CHAN_RQD,
2166 ies := {
Vadim Yanitskiyab448a52019-05-31 20:24:03 +07002167 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2168 /* TODO: we may need to have optional RSL_IE_LINK_IDENT IE here */
Harald Welte9abd1282018-02-19 19:18:17 +01002169 tr_RSL_IE(RSL_IE_Body:{req_ref := tr_RSL_IE_ReqRef(ra, fn)}),
2170 tr_RSL_IE(RSL_IE_Body:{access_delay := acc_del})
2171 }
2172 }
Harald Welte643e2a62017-11-27 15:03:18 +01002173
2174 /* 8.5.4 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02002175 template (value) RSL_Message ts_DELETE_IND(template (value) RslChannelNr chan_nr,
2176 octetstring imm_ass) := {
Harald Welte643e2a62017-11-27 15:03:18 +01002177 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2178 msg_type := RSL_MT_DELETE_IND,
2179 ies := {
Harald Welte735dd072017-12-12 14:55:17 +01002180 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2181 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 +01002182 }
2183 }
Harald Weltee8d750e2018-06-10 21:41:35 +02002184 template RSL_Message tr_RSL_DELETE_IND(template octetstring imm_ass := ?, template uint3_t tn) := {
2185 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2186 msg_type := RSL_MT_DELETE_IND,
2187 ies := {
2188 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(tn)}),
2189 tr_RSL_IE(RSL_IE_Body:{full_imm_ass_info := tr_RSL_LV(imm_ass)}),
2190 *
2191 }
2192 }
Harald Welte643e2a62017-11-27 15:03:18 +01002193
Harald Weltec2877752017-12-07 17:54:35 +01002194 /* 8.5.5 BSC -> BTS */
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +07002195 template RSL_Message tr_RSL_PAGING_CMD(template MobileIdentityV mi, template uint3_t tn := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002196 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Weltec2877752017-12-07 17:54:35 +01002197 msg_type := RSL_MT_PAGING_CMD,
2198 ies := {
2199 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(tn)}),
2200 tr_RSL_IE(RSL_IE_Body:{paging_group := ?}),
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +07002201 tr_RSL_IE(RSL_IE_Body:{ms_identity := tr_MI_LV(mi)}),
Harald Weltec2877752017-12-07 17:54:35 +01002202 * /* opt: channel needed, eMLPP prio */
2203 }
2204 }
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +07002205 template (value) RSL_Message ts_RSL_PAGING_CMD(MobileIdentityV mi, uint8_t pg, uint3_t tn := 0) := {
Harald Welte9abd1282018-02-19 19:18:17 +01002206 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2207 msg_type := RSL_MT_PAGING_CMD,
2208 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02002209 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_PCH_AGCH(tn)}),
Harald Welte9abd1282018-02-19 19:18:17 +01002210 t_RSL_IE(RSL_IE_PAGING_GROUP, RSL_IE_Body:{paging_group := pg}),
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +07002211 t_RSL_IE(RSL_IE_MS_IDENTITY, RSL_IE_Body:{ms_identity := ts_MI_LV(mi)})
Harald Welte9abd1282018-02-19 19:18:17 +01002212 }
2213 }
Harald Weltec2877752017-12-07 17:54:35 +01002214
2215 /* 8.5.6 BSC -> BTS */
2216 template RSL_Message tr_RSL_IMM_ASSIGN(template uint3_t tn := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002217 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Weltec2877752017-12-07 17:54:35 +01002218 msg_type := RSL_MT_IMMEDIATE_ASSIGN_CMD,
2219 ies := {
2220 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(tn)}),
2221 tr_RSL_IE(RSL_IE_Body:{full_imm_ass_info := ?})
2222 }
2223 }
Harald Welteefa7d912018-04-18 23:22:15 +02002224 template (value) RSL_Message ts_RSL_IMM_ASSIGN(octetstring f_ass_inf, uint3_t tn := 0) := {
Harald Welte9abd1282018-02-19 19:18:17 +01002225 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2226 msg_type := RSL_MT_IMMEDIATE_ASSIGN_CMD,
2227 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02002228 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_PCH_AGCH(tn)}),
Harald Welte9abd1282018-02-19 19:18:17 +01002229 t_RSL_IE(RSL_IE_FULL_IMM_ASS_INFO, RSL_IE_Body:{full_imm_ass_info := ts_RSL_LV(f_ass_inf)})
2230 }
2231 }
Harald Weltec2877752017-12-07 17:54:35 +01002232
Harald Weltecc373202018-09-10 10:28:21 +02002233 /* 8.5.8 BTS <- BSC SMS BROADCAST COMMAND */
2234 template RSL_Message tr_RSL_SMSCB_CMD(template RSL_IE_CbCommandType cb_cmd := ?,
2235 template octetstring msg := ?,
2236 template RslChannelNr chan_nr := ?) := {
2237 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2238 msg_type := RSL_MT_SMS_BC_CMD,
2239 ies := {
2240 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2241 tr_RSL_IE(RSL_IE_Body:{cb_cmd_type := cb_cmd}),
2242 tr_RSL_IE(RSL_IE_Body:{smscb_message := tr_RSL_LV(msg)}),
2243 *
2244 }
2245 }
2246 template (value) RSL_Message ts_RSL_SMSCB_CMD(template (value) RSL_IE_CbCommandType cb_cmd,
2247 template (value) octetstring msg,
2248 template (value) RslChannelNr chan_nr :=
2249 ts_RslChanNr_SDCCH4(0, 2)) := {
2250 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2251 msg_type := RSL_MT_SMS_BC_CMD,
2252 ies := {
2253 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2254 t_RSL_IE(RSL_IE_CB_CMD_TYPE, RSL_IE_Body:{cb_cmd_type := cb_cmd}),
2255 t_RSL_IE(RSL_IE_SMSCB_MSG, RSL_IE_Body:{smscb_message := ts_RSL_LV(msg)})
2256 /* optional channel type for extended CBCH */
2257 }
2258 }
2259
Harald Welte4a129f82019-05-21 16:35:22 +02002260 /* 8.5.9 BTS -> BSC CBCH LOAD INDICATION */
2261 template RSL_Message tr_RSL_CBCH_LOAD_IND_BASIC(template boolean overflow := ?,
2262 template uint4_t slot_count := ?,
2263 template RslChannelNr chan_nr := ?) := {
2264 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2265 msg_type := RSL_MT_CBCH_LOAD_IND,
2266 ies := {
2267 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2268 tr_RSL_IE(RSL_IE_Body:{cbch_load_info := tr_CbchLoadInfo(overflow, slot_count)})
2269 }
2270 }
2271 template (value) RSL_Message ts_RSL_CBCH_LOAD_IND_BASIC(boolean overflow, uint4_t slot_count,
2272 template (value) RslChannelNr chan_nr :=
2273 ts_RslChanNr_SDCCH4(0, 2)) := {
2274 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2275 msg_type := RSL_MT_CBCH_LOAD_IND,
2276 ies := {
2277 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2278 t_RSL_IE(RSL_IE_CBCH_LOAD_INFO, RSL_IE_Body:{cbch_load_info := ts_CbchLoadInfo(overflow, slot_count)})
2279 }
2280 }
2281 template RSL_Message tr_RSL_CBCH_LOAD_IND_EXTD(template boolean overflow := ?,
2282 template uint4_t slot_count := ?,
2283 template RslChannelNr chan_nr := ?) := {
2284 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2285 msg_type := RSL_MT_CBCH_LOAD_IND,
2286 ies := {
2287 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2288 tr_RSL_IE(RSL_IE_Body:{cbch_load_info := tr_CbchLoadInfo(overflow, slot_count)}),
2289 tr_RSL_IE(RSL_IE_Body:{smscb_chan_ind := 1})
2290 }
2291 }
2292 template (value) RSL_Message ts_RSL_CBCH_LOAD_IND_EXTD(boolean overflow, uint4_t slot_count,
2293 template (value) RslChannelNr chan_nr :=
2294 ts_RslChanNr_SDCCH4(0, 2)) := {
2295 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2296 msg_type := RSL_MT_CBCH_LOAD_IND,
2297 ies := {
2298 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2299 t_RSL_IE(RSL_IE_CBCH_LOAD_INFO, RSL_IE_Body:{cbch_load_info := ts_CbchLoadInfo(overflow, slot_count)}),
2300 t_RSL_IE(RSL_IE_SMSCB_CHAN_INDICATOR, RSL_IE_Body:{smscb_chan_ind := 1})
2301 }
2302 }
2303
2304
Vadim Yanitskiy9f699532021-06-03 17:29:22 +02002305 /* 8.6.1 BTS -> BSC */
2306 template (value) RSL_Message
2307 ts_RSL_RF_RES_IND(template (value) RSL_ResourceInfo info) := {
2308 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
2309 msg_type := RSL_MT_RF_RES_IND,
2310 ies := {
2311 t_RSL_IE(RSL_IE_RESOURCE_INFO, RSL_IE_Body:{
2312 resource_info := {
2313 len := 0, /* overwritten */
2314 info := info
2315 }
2316 })
2317 }
2318 }
2319 template RSL_Message
2320 tr_RSL_RF_RES_IND(template (present) RSL_ResourceInfo info := ?) := {
2321 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
2322 msg_type := RSL_MT_RF_RES_IND,
2323 ies := {
2324 tr_RSL_IE(RSL_IE_Body:{
2325 resource_info := {
2326 len := ?,
2327 info := info
2328 }
2329 })
2330 }
2331 }
2332
2333
Harald Welte68e495b2018-02-25 00:05:57 +01002334 /* 8.6.2 BTS <- BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02002335 template (value) RSL_Message ts_RSL_SACCH_FILL(RSL_IE_SysinfoType si_type, octetstring l3_info) := {
Harald Welte68e495b2018-02-25 00:05:57 +01002336 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
2337 msg_type := RSL_MT_SACCH_FILL,
2338 ies := {
2339 t_RSL_IE(RSL_IE_SYSINFO_TYPE, RSL_IE_Body:{sysinfo_type := si_type}),
2340 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
2341 }
2342 }
Harald Welte09538f82019-08-01 09:50:25 +02002343 template RSL_Message tr_RSL_NO_SACCH_FILL(template RSL_IE_SysinfoType si_type := ?) := {
2344 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
2345 msg_type := RSL_MT_SACCH_FILL,
2346 ies := {
2347 tr_RSL_IE(RSL_IE_Body:{sysinfo_type := si_type})
2348 }
2349 }
2350 template RSL_Message tr_RSL_SACCH_FILL(template RSL_IE_SysinfoType si_type := ?,
2351 template octetstring l3_info := ?) := {
2352 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
2353 msg_type := RSL_MT_SACCH_FILL,
2354 ies := {
2355 tr_RSL_IE(RSL_IE_Body:{sysinfo_type := si_type}),
2356 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)}),
2357 *
2358 }
2359 }
2360
Harald Welte68e495b2018-02-25 00:05:57 +01002361
Harald Welte643e2a62017-11-27 15:03:18 +01002362 /* 8.6.4 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02002363 template (value) RSL_Message ts_RSL_ERROR_REPORT(RSL_Cause cause) := {
Harald Welte01d982c2018-02-25 01:31:40 +01002364 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
2365 msg_type := RSL_MT_ERROR_REPORT,
Harald Welte643e2a62017-11-27 15:03:18 +01002366 ies := {
Harald Welte735dd072017-12-12 14:55:17 +01002367 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
Harald Welte643e2a62017-11-27 15:03:18 +01002368 }
2369 }
Harald Welte01d982c2018-02-25 01:31:40 +01002370 template RSL_Message tr_RSL_ERROR_REPORT(template RSL_Cause cause := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002371 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
Harald Welte01d982c2018-02-25 01:31:40 +01002372 msg_type := RSL_MT_ERROR_REPORT,
2373 ies := {
2374 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)}),
2375 *
2376 }
2377 }
2378
Harald Welte643e2a62017-11-27 15:03:18 +01002379
Harald Welte9958a4d2017-12-14 21:21:33 +01002380
2381 /* Abis/IP specific messages */
2382
Vadim Yanitskiy1567bac2022-05-01 03:36:24 +03002383 private function f_ts_RSL_IPA_CRCX_IEs(template (value) RslChannelNr chan_nr,
2384 template (omit) OCT4 remote_ip,
Pau Espin Pedrol39bfa022022-08-12 14:56:12 +02002385 template (omit) uint16_t remote_port,
2386 template (omit) uint8_t osmux_cid)
Vadim Yanitskiy1567bac2022-05-01 03:36:24 +03002387 return RSL_IE_List {
2388 var RSL_IE_List ies;
2389
2390 /* Channel Number is a mandatory IE */
2391 ies := {
2392 valueof(RSL_IE:{
2393 iei := RSL_IE_CHAN_NR,
2394 body := { chan_nr := chan_nr }
2395 })
2396 };
2397 /* Remote IP / Port are optional IEs */
2398 if (not istemplatekind(remote_ip, "omit")) {
2399 ies := ies & {
2400 valueof(RSL_IE:{
2401 iei := RSL_IE_IPAC_REMOTE_IP,
2402 body := { ipa_remote_ip := remote_ip }
2403 })
2404 };
2405 }
2406 if (not istemplatekind(remote_port, "omit")) {
2407 ies := ies & {
2408 valueof(RSL_IE:{
2409 iei := RSL_IE_IPAC_REMOTE_PORT,
2410 body := { ipa_remote_port := remote_port }
2411 })
2412 };
2413 }
Pau Espin Pedrol39bfa022022-08-12 14:56:12 +02002414 /* Osmux CID extension IE is optional: */
2415 if (not istemplatekind(osmux_cid, "omit")) {
2416 ies := ies & {
2417 valueof(RSL_IE:{
2418 iei := RSL_IE_OSMO_OSMUX_CID,
2419 body := { osmux_cid := ts_RSL_IE_OSMO_Osmux_CID(osmux_cid) }
2420 })
2421 };
2422 }
Vadim Yanitskiy1567bac2022-05-01 03:36:24 +03002423
2424 return ies;
2425 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002426 template RSL_Message tr_RSL_IPA_CRCX(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002427 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002428 msg_type := RSL_MT_IPAC_CRCX,
2429 ies := {
2430 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2431 *
2432 }
2433 }
Vadim Yanitskiye9141c22021-07-03 01:45:40 +02002434 template (value) RSL_Message
2435 ts_RSL_IPA_CRCX(template (value) RslChannelNr chan_nr,
Vadim Yanitskiy1567bac2022-05-01 03:36:24 +03002436 template (omit) OCT4 remote_ip := omit,
Pau Espin Pedrol39bfa022022-08-12 14:56:12 +02002437 template (omit) uint16_t remote_port := omit,
2438 template (omit) uint8_t osmux_cid := omit) := {
Harald Welte9abd1282018-02-19 19:18:17 +01002439 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2440 msg_type := RSL_MT_IPAC_CRCX,
Pau Espin Pedrol39bfa022022-08-12 14:56:12 +02002441 ies := f_ts_RSL_IPA_CRCX_IEs(chan_nr, remote_ip, remote_port, osmux_cid)
Harald Welte9abd1282018-02-19 19:18:17 +01002442 }
2443
Pau Espin Pedrol29c6dfb2022-08-08 18:37:56 +02002444 function ts_RSL_IPA_CRCX_ACK(template (value) RslChannelNr chan_nr,
2445 uint16_t ipa_conn_id, OCT4 local_ip,
2446 uint16_t local_port, uint7_t rtp_pt2,
2447 template (omit) uint8_t osmux_cid := omit)
2448 return template (value) RSL_Message {
2449 var template (value) RSL_Message msg := {
2450 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2451 msg_type := RSL_MT_IPAC_CRCX_ACK,
2452 ies := {
2453 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2454 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2455 t_RSL_IE(RSL_IE_IPAC_LOCAL_IP, RSL_IE_Body:{ipa_local_ip := local_ip}),
2456 t_RSL_IE(RSL_IE_IPAC_LOCAL_PORT, RSL_IE_Body:{ipa_local_port := local_port}),
2457 t_RSL_IE(RSL_IE_IPAC_RTP_PAYLOAD2, RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
2458 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002459 }
Pau Espin Pedrol29c6dfb2022-08-08 18:37:56 +02002460 if (not istemplatekind(osmux_cid, "omit")) {
2461 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)});
2462 }
2463 return msg;
Harald Welte9958a4d2017-12-14 21:21:33 +01002464 }
Pau Espin Pedrol29c6dfb2022-08-08 18:37:56 +02002465
Pau Espin Pedrol39bfa022022-08-12 14:56:12 +02002466 function tr_RSL_IPA_CRCX_ACK(template RslChannelNr chan_nr,
2467 template uint16_t ipa_conn_id,
2468 template OCT4 local_ip,
2469 template uint16_t local_port,
2470 template uint8_t osmux_cid := omit)
2471 return template RSL_Message {
2472 var template RSL_Message msg := {
2473 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2474 msg_type := RSL_MT_IPAC_CRCX_ACK,
2475 ies := {
2476 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2477 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2478 tr_RSL_IE(RSL_IE_Body:{ipa_local_ip := local_ip}),
2479 tr_RSL_IE(RSL_IE_Body:{ipa_local_port := local_port})
2480 /* Optional: RTP Payload Type 2 IE */
2481 }
Harald Welte9abd1282018-02-19 19:18:17 +01002482 }
Pau Espin Pedrol39bfa022022-08-12 14:56:12 +02002483 if (not istemplatekind(osmux_cid, "omit")) {
2484 msg.ies[lengthof(msg.ies)] := tr_RSL_IE(RSL_IE_Body:{osmux_cid := f_tr_RSL_IE_OSMO_Osmux_CID(osmux_cid)});
2485 }
2486 return msg;
Harald Welte9abd1282018-02-19 19:18:17 +01002487 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002488
Harald Welteefa7d912018-04-18 23:22:15 +02002489 template (value) RSL_Message ts_RSL_IPA_CRCX_NACK(template (value) RslChannelNr chan_nr,
2490 RSL_Cause cause) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002491 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2492 msg_type := RSL_MT_IPAC_CRCX_NACK,
2493 ies := {
2494 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2495 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2496 }
2497 }
Harald Welte9abd1282018-02-19 19:18:17 +01002498 template RSL_Message tr_RSL_IPA_CRCX_NACK(template RslChannelNr chan_nr,
2499 template RSL_Cause cause := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002500 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9abd1282018-02-19 19:18:17 +01002501 msg_type := RSL_MT_IPAC_CRCX_NACK,
2502 ies := {
2503 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2504 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
2505 }
2506 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002507
Pau Espin Pedrol39bfa022022-08-12 14:56:12 +02002508 function ts_RSL_IPA_MDCX(template (value) RslChannelNr chan_nr,
2509 uint16_t ipa_conn_id,
2510 OCT4 remote_ip, uint16_t remote_port,
2511 uint7_t rtp_pt2,
2512 template (omit) uint8_t osmux_cid := omit)
2513 return template (value) RSL_Message {
2514 var template (value) RSL_Message msg := {
2515 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2516 msg_type := RSL_MT_IPAC_MDCX,
2517 ies := {
2518 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2519 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2520 t_RSL_IE(RSL_IE_IPAC_REMOTE_IP, RSL_IE_Body:{ipa_remote_ip := remote_ip}),
2521 t_RSL_IE(RSL_IE_IPAC_REMOTE_PORT, RSL_IE_Body:{ipa_remote_port := remote_port}),
2522 /* optional: RTP Payload Type */
2523 t_RSL_IE(RSL_IE_IPAC_RTP_PAYLOAD2, RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
2524 }
Harald Welte30527452018-02-25 12:46:25 +01002525 }
Pau Espin Pedrol39bfa022022-08-12 14:56:12 +02002526 if (not istemplatekind(osmux_cid, "omit")) {
2527 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)});
2528 }
2529 return msg;
Harald Welte30527452018-02-25 12:46:25 +01002530 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002531 template RSL_Message tr_RSL_IPA_MDCX(template RslChannelNr chan_nr,
2532 template uint16_t ipa_conn_id) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002533 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002534 msg_type := RSL_MT_IPAC_MDCX,
2535 ies := {
2536 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2537 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2538 *
2539 }
2540 }
2541
Pau Espin Pedrol29c6dfb2022-08-08 18:37:56 +02002542 function ts_RSL_IPA_MDCX_ACK(template (value) RslChannelNr chan_nr,
2543 uint16_t ipa_conn_id,
2544 OCT4 local_ip, uint16_t local_port,
2545 uint7_t rtp_pt2,
2546 template (omit) uint8_t osmux_cid := omit)
Pau Espin Pedrol39bfa022022-08-12 14:56:12 +02002547 return template (value) RSL_Message {
2548 var template (value) RSL_Message msg := {
2549 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2550 msg_type := RSL_MT_IPAC_MDCX_ACK,
2551 ies := {
2552 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2553 /* optional */
2554 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2555 t_RSL_IE(RSL_IE_IPAC_LOCAL_IP, RSL_IE_Body:{ipa_local_ip := local_ip}),
2556 t_RSL_IE(RSL_IE_IPAC_LOCAL_PORT, RSL_IE_Body:{ipa_local_port := local_port}),
2557 /* optional: RTP Payload Type */
2558 t_RSL_IE(RSL_IE_IPAC_RTP_PAYLOAD2, RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
Pau Espin Pedrol29c6dfb2022-08-08 18:37:56 +02002559 }
Pau Espin Pedrol39bfa022022-08-12 14:56:12 +02002560 }
2561 if (not istemplatekind(osmux_cid, "omit")) {
2562 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)});
2563 }
2564 return msg;
2565 }
2566 function tr_RSL_IPA_MDCX_ACK(template RslChannelNr chan_nr,
2567 template uint16_t ipa_conn_id,
2568 template OCT4 local_ip,
2569 template uint16_t local_port,
2570 template uint7_t rtp_pt2,
2571 template uint8_t osmux_cid := omit)
2572 return template RSL_Message {
2573 var template RSL_Message msg := {
2574 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2575 msg_type := RSL_MT_IPAC_MDCX_ACK,
2576 ies := {
2577 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2578 /* optional */
2579 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2580 tr_RSL_IE(RSL_IE_Body:{ipa_local_ip := local_ip}),
2581 tr_RSL_IE(RSL_IE_Body:{ipa_local_port := local_port}),
2582 /* optional: RTP Payload Type */
2583 tr_RSL_IE(RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
Pau Espin Pedrol29c6dfb2022-08-08 18:37:56 +02002584 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002585 }
Pau Espin Pedrol39bfa022022-08-12 14:56:12 +02002586 if (not istemplatekind(osmux_cid, "omit")) {
2587 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 +01002588 }
Pau Espin Pedrol39bfa022022-08-12 14:56:12 +02002589 return msg;
Harald Welte30527452018-02-25 12:46:25 +01002590 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002591
Harald Welteefa7d912018-04-18 23:22:15 +02002592 template (value) RSL_Message ts_RSL_IPA_MDCX_NACK(template (value) RslChannelNr chan_nr,
2593 RSL_Cause cause,
2594 template (value) uint16_t ipa_conn_id) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002595 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2596 msg_type := RSL_MT_IPAC_MDCX_NACK,
2597 ies := {
2598 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2599 /* optional connection ID */
2600 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2601 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2602 }
2603 }
Harald Welte30527452018-02-25 12:46:25 +01002604 template RSL_Message tr_RSL_IPA_MDCX_NACK(template RslChannelNr chan_nr,
2605 template RSL_Cause cause,
2606 template uint16_t ipa_conn_id) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002607 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte30527452018-02-25 12:46:25 +01002608 msg_type := RSL_MT_IPAC_MDCX_NACK,
2609 ies := {
2610 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2611 /* optional connection ID */
2612 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2613 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
2614 }
2615 }
2616
Harald Welte9958a4d2017-12-14 21:21:33 +01002617
Harald Welteefa7d912018-04-18 23:22:15 +02002618 template (value) RSL_Message ts_RSL_IPA_DLCX_IND(template (value) RslChannelNr chan_nr,
2619 uint16_t ipa_conn_id,
2620 template (value) RSL_IE_IPA_ConnectionStats stats,
2621 RSL_Cause cause) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002622 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2623 msg_type := RSL_MT_IPAC_DLCX_IND,
2624 ies := {
2625 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2626 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2627 t_RSL_IE(RSL_IE_IPAC_CONN_STAT, RSL_IE_Body:{ipa_stats := stats}),
2628 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2629 }
2630 }
2631
Harald Welteefa7d912018-04-18 23:22:15 +02002632 template (value) RSL_Message ts_RSL_IPA_DLCX(template (value) RslChannelNr chan_nr,
2633 uint16_t ipa_conn_id) := {
Harald Weltea871a382018-02-25 02:03:14 +01002634 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2635 msg_type := RSL_MT_IPAC_DLCX,
2636 ies := {
Harald Welte2a7e7162018-02-25 12:46:48 +01002637 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2638 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id})
Harald Weltea871a382018-02-25 02:03:14 +01002639 }
2640 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002641 template RSL_Message tr_RSL_IPA_DLCX(template RslChannelNr chan_nr,
2642 template uint16_t ipa_conn_id := omit) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002643 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002644 msg_type := RSL_MT_IPAC_DLCX,
2645 ies := {
2646 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2647 /* FIXME: optional conn_id */
2648 *
2649 }
2650 }
2651
Harald Welteefa7d912018-04-18 23:22:15 +02002652 template (value) RSL_Message ts_RSL_IPA_DLCX_ACK(template (value) RslChannelNr chan_nr,
2653 uint16_t ipa_conn_id,
2654 RSL_IE_IPA_ConnectionStats stats) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002655 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2656 msg_type := RSL_MT_IPAC_DLCX_ACK,
2657 ies := {
2658 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2659 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2660 t_RSL_IE(RSL_IE_IPAC_CONN_STAT, RSL_IE_Body:{ipa_stats := stats})
2661 }
2662 }
Harald Weltea871a382018-02-25 02:03:14 +01002663 template RSL_Message tr_RSL_IPA_DLCX_ACK(template RslChannelNr chan_nr,
2664 template uint16_t ipa_conn_id,
2665 template RSL_IE_IPA_ConnectionStats stats) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002666 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Weltea871a382018-02-25 02:03:14 +01002667 msg_type := RSL_MT_IPAC_DLCX_ACK,
2668 ies := {
2669 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2670 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2671 tr_RSL_IE(RSL_IE_Body:{ipa_stats := stats})
2672 }
2673 }
2674
2675
Harald Welte9958a4d2017-12-14 21:21:33 +01002676
Harald Welteefa7d912018-04-18 23:22:15 +02002677 template (value) RSL_Message ts_RSL_IPA_DLCX_NACK(template (value) RslChannelNr chan_nr,
2678 RSL_Cause cause, uint16_t ipa_conn_id) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002679 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2680 msg_type := RSL_MT_IPAC_DLCX_NACK,
2681 ies := {
2682 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2683 /* optional connection ID */
2684 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2685 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2686 }
2687 }
Harald Weltea871a382018-02-25 02:03:14 +01002688 template RSL_Message tr_RSL_IPA_DLCX_NACK(template RslChannelNr chan_nr,
2689 template RSL_Cause cause) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002690 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Weltea871a382018-02-25 02:03:14 +01002691 msg_type := RSL_MT_IPAC_DLCX_NACK,
2692 ies := {
2693 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2694 /* optional connection ID */
2695 *,
2696 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
2697 }
2698 }
2699
Harald Welte9958a4d2017-12-14 21:21:33 +01002700
Vadim Yanitskiy58b16532021-10-09 20:27:39 +06002701 template (value) RSL_Message
2702 ts_RSL_IPA_PDCH_ACT(template (value) RslChannelNr chan_nr) := {
Harald Welteee19c732018-04-05 09:08:26 +02002703 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2704 msg_type := RSL_MT_IPAC_PDCH_ACT,
2705 ies := {
2706 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
2707 }
2708 }
Vadim Yanitskiy58b16532021-10-09 20:27:39 +06002709 template RSL_Message
2710 tr_RSL_IPA_PDCH_ACT(template (present) RslChannelNr chan_nr) := {
Harald Welteee19c732018-04-05 09:08:26 +02002711 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002712 msg_type := RSL_MT_IPAC_PDCH_ACT,
2713 ies := {
2714 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
2715 }
2716 }
2717
Harald Welteee19c732018-04-05 09:08:26 +02002718
Harald Welte94e0c342018-04-07 11:33:23 +02002719 template RSL_Message ts_RSL_IPA_PDCH_ACT_ACK(RslChannelNr chan_nr,
2720 template (value) RSL_IE_FrameNumber fn) := {
Harald Welteee19c732018-04-05 09:08:26 +02002721 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002722 msg_type := RSL_MT_IPAC_PDCH_ACT_ACK,
2723 ies := {
2724 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2725 t_RSL_IE(RSL_IE_FRAME_NUMBER, RSL_IE_Body:{frame_nr := fn})
2726 }
2727 }
Harald Welteee19c732018-04-05 09:08:26 +02002728 template RSL_Message tr_RSL_IPA_PDCH_ACT_ACK(template RslChannelNr chan_nr,
2729 template RSL_IE_FrameNumber fn) := {
2730 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2731 msg_type := RSL_MT_IPAC_PDCH_ACT_ACK,
2732 ies := {
2733 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2734 tr_RSL_IE(RSL_IE_Body:{frame_nr := fn})
2735 }
2736 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002737
2738 template RSL_Message ts_RSL_IPA_PDCH_ACT_NACK(RslChannelNr chan_nr, RSL_Cause cause) := {
Harald Welteee19c732018-04-05 09:08:26 +02002739 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002740 msg_type := RSL_MT_IPAC_PDCH_ACT_NACK,
2741 ies := {
2742 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2743 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2744 }
2745 }
Harald Welteee19c732018-04-05 09:08:26 +02002746 template RSL_Message tr_RSL_IPA_PDCH_ACT_NACK(template RslChannelNr chan_nr,
2747 template RSL_Cause cause) := {
2748 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2749 msg_type := RSL_MT_IPAC_PDCH_ACT_NACK,
2750 ies := {
2751 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2752 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
2753 }
2754 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002755
Harald Welteee19c732018-04-05 09:08:26 +02002756 template RSL_Message ts_RSL_IPA_PDCH_DEACT(RslChannelNr chan_nr) := {
2757 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2758 msg_type := RSL_MT_IPAC_PDCH_DEACT,
2759 ies := {
2760 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
2761 }
2762 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002763 template RSL_Message tr_RSL_IPA_PDCH_DEACT(template RslChannelNr chan_nr) := {
Harald Welteee19c732018-04-05 09:08:26 +02002764 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002765 msg_type := RSL_MT_IPAC_PDCH_DEACT,
2766 ies := {
2767 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
2768 }
2769 }
2770
2771 template RSL_Message ts_RSL_IPA_PDCH_DEACT_ACK(RslChannelNr chan_nr) := {
Harald Welteee19c732018-04-05 09:08:26 +02002772 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002773 msg_type := RSL_MT_IPAC_PDCH_DEACT_ACK,
2774 ies := {
2775 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
2776 }
2777 }
Harald Welteee19c732018-04-05 09:08:26 +02002778 template RSL_Message tr_RSL_IPA_PDCH_DEACT_ACK(template RslChannelNr chan_nr) := {
2779 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2780 msg_type := RSL_MT_IPAC_PDCH_DEACT_ACK,
2781 ies := {
2782 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
2783 }
2784 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002785
2786 template RSL_Message ts_RSL_IPA_PDCH_DEACT_NACK(RslChannelNr chan_nr, RSL_Cause cause) := {
Harald Welteee19c732018-04-05 09:08:26 +02002787 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002788 msg_type := RSL_MT_IPAC_PDCH_DEACT_NACK,
2789 ies := {
2790 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2791 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2792 }
2793 }
Harald Welteee19c732018-04-05 09:08:26 +02002794 template RSL_Message tr_RSL_IPA_PDCH_DEACT_NACK(template RslChannelNr chan_nr,
2795 template RSL_Cause cause) := {
2796 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2797 msg_type := RSL_MT_IPAC_PDCH_DEACT_NACK,
2798 ies := {
2799 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2800 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
2801 }
2802 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002803
Harald Welte908ce542019-09-04 23:05:40 +02002804 template (value) RSL_Message ts_RSL_OSMO_ETWS_CMD(template (value) octetstring msg,
2805 template (value) RslChannelNr chan_nr := ts_RslChanNr_PCH_AGCH(0)) := {
2806 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2807 msg_type := RSL_MT_OSMO_ETWS_CMD,
2808 ies := {
2809 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2810 t_RSL_IE(RSL_IE_SMSCB_MSG, RSL_IE_Body:{smscb_message := ts_RSL_LV(msg)})
2811 }
2812 }
2813 template RSL_Message tr_RSL_OSMO_ETWS_CMD(template RslChannelNr chan_nr := ?,
2814 template octetstring msg := ?) := {
2815 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2816 msg_type := RSL_MT_OSMO_ETWS_CMD,
2817 ies := {
2818 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2819 tr_RSL_IE(RSL_IE_Body:{smscb_message := tr_RSL_LV(msg)})
2820 }
2821 }
2822
Harald Weltee33e5152023-04-09 23:29:48 +02002823 template (value) RSL_Message ts_RSL_NOTIF_CMD_START(template (value) GroupCallRef group_call_ref,
2824 template (value) octetstring chan_desc) := {
2825 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2826 msg_type := RSL_MT_NOT_CMD,
2827 ies := {
2828 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_PCH_AGCH(0)}),
2829 t_RSL_IE(RSL_IE_CMD_INDICATOR, RSL_IE_Body:{cmd_indicator := ts_CommandInd(CMD_IND_START)}),
2830 t_RSL_IE(RSL_IE_GROUP_CALL_REF, RSL_IE_Body:{group_call_ref := ts_GroupCallRef(group_call_ref)}),
2831 t_RSL_IE(RSL_IE_GROUP_CHAN_DESC, RSL_IE_Body:{group_chan_desc := ts_GroupChanDesc(chan_desc)})
2832 }
2833 }
2834 template RSL_Message tr_RSL_NOTIF_CMD_START(template (present) GroupCallRef group_call_ref,
2835 template (present) octetstring chan_desc := ?) := {
2836 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2837 msg_type := RSL_MT_NOT_CMD,
2838 ies := {
2839 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(0)}),
2840 tr_RSL_IE(RSL_IE_Body:{cmd_indicator := tr_CommandInd(CMD_IND_START)}),
2841 tr_RSL_IE(RSL_IE_Body:{group_call_ref := tr_GroupCallRef(group_call_ref)}),
2842 tr_RSL_IE(RSL_IE_Body:{group_chan_desc := tr_GroupChanDesc(chan_desc)}),
2843 *
2844 }
2845 }
2846
2847 template (value) RSL_Message ts_RSL_NOTIF_CMD_STOP(template (value) GroupCallRef group_call_ref) := {
2848 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2849 msg_type := RSL_MT_NOT_CMD,
2850 ies := {
2851 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_PCH_AGCH(0)}),
2852 t_RSL_IE(RSL_IE_CMD_INDICATOR, RSL_IE_Body:{cmd_indicator := ts_CommandInd(CMD_IND_STOP)}),
2853 t_RSL_IE(RSL_IE_GROUP_CALL_REF, RSL_IE_Body:{group_call_ref := ts_GroupCallRef(group_call_ref)})
2854 }
2855 }
2856 template RSL_Message tr_RSL_NOTIF_CMD_STOP(template (present) GroupCallRef group_call_ref) := {
2857 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2858 msg_type := RSL_MT_NOT_CMD,
2859 ies := {
2860 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(0)}),
2861 tr_RSL_IE(RSL_IE_Body:{cmd_indicator := tr_CommandInd(CMD_IND_STOP)}),
2862 tr_RSL_IE(RSL_IE_Body:{group_call_ref := tr_GroupCallRef(group_call_ref)}),
2863 *
2864 }
2865 }
2866
Harald Welte908ce542019-09-04 23:05:40 +02002867
Harald Welte9958a4d2017-12-14 21:21:33 +01002868
Harald Welte6a8199d2018-01-29 21:58:53 +01002869 function f_rsl_find_ie(RSL_Message msg, RSL_IE_Type iei, out RSL_IE_Body ret) return boolean {
2870 for (var integer i := 0; i < sizeof(msg.ies); i := i+1) {
2871 if (msg.ies[i].iei == iei) {
2872 ret := msg.ies[i].body;
2873 return true;
2874 }
2875 }
2876 return false;
2877 }
2878
2879
Harald Welte9958a4d2017-12-14 21:21:33 +01002880
Harald Welte643e2a62017-11-27 15:03:18 +01002881} with { encode "RAW" ; variant "FIELDORDER(msb)" }