blob: 70fb3986820855a6d1701d129c2734c7ee14490b [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 *
7 * (C) 2017 by Harald Welte <laforge@gnumonks.org>
8 * All rights reserved.
9 *
10 * Released under the terms of GNU General Public License, Version 2 or
11 * (at your option) any later version.
Harald 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),
209 RSL_IE_CHAN_DESC ('00110000'B),
210 RSL_IE_NCH_DRX_INFO ('00110001'B),
211 RSL_IE_CMD_INDICATOR ('00110010'B),
212 RSL_IE_EMLPP_PRIO ('00110011'B),
213 RSL_IE_UIC ('00110100'B),
214 RSL_IE_MAIN_CHAN_REF ('00110101'B),
215 RSL_IE_MR_CONFIG ('00110110'B),
216 RSL_IE_MR_CONTROL ('00110111'B),
217 RSL_IE_SUP_CODEC_TYPES ('00111000'B),
218 RSL_IE_CODEC_CONFIG ('00111001'B),
219 RSL_IE_RTD ('00111010'B),
220 RSL_IE_TFO_STATUS ('00111011'B),
221 RSL_IE_LLP_APDU ('00111100'B),
Harald Welte643e2a62017-11-27 15:03:18 +0100222
Vadim Yanitskiy1f532152021-11-01 20:37:56 +0300223 RSL_IE_OSMO_REP_ACCH_CAP ('01100000'B),
Neels Hofmeyr2bef0dd2021-04-22 21:46:00 +0000224 RSL_IE_OSMO_TRAINING_SEQUENCE ('01100001'B),
Vadim Yanitskiya203d3b2021-11-01 21:32:31 +0300225 RSL_IE_OSMO_TOP_ACCH_CAP ('01100010'B),
Neels Hofmeyr2bef0dd2021-04-22 21:46:00 +0000226
Harald Welte643e2a62017-11-27 15:03:18 +0100227 /* ip.access */
228 RSL_IE_IPAC_SRTP_CONFIG ('11100000'B),
Harald Welte319be822017-12-07 17:50:26 +0100229 RSL_IE_IPAC_PROXY_UDP ('11100001'B),
230 RSL_IE_IPAC_BSCMPL_TOUT ('11100010'B),
Harald Welte643e2a62017-11-27 15:03:18 +0100231
232 RSL_IE_IPAC_REMOTE_IP ('11110000'B),
Harald Welte319be822017-12-07 17:50:26 +0100233 RSL_IE_IPAC_REMOTE_PORT ('11110001'B),
234 RSL_IE_IPAC_RTP_PAYLOAD ('11110010'B),
235 RSL_IE_IPAC_LOCAL_PORT ('11110011'B),
236 RSL_IE_IPAC_SPEECH_MODE ('11110100'B),
237 RSL_IE_IPAC_LOCAL_IP ('11110101'B),
238 RSL_IE_IPAC_CONN_STAT ('11110110'B),
239 RSL_IE_IPAC_HO_C_PARMS ('11110111'B),
240 RSL_IE_IPAC_CONN_ID ('11111000'B),
241 RSL_IE_IPAC_RTP_CSD_FMT ('11111001'B),
242 RSL_IE_IPAC_RTP_JIT_BUF ('11111010'B),
243 RSL_IE_IPAC_RTP_COMPR ('11111011'B),
244 RSL_IE_IPAC_RTP_PAYLOAD2 ('11111100'B),
245 RSL_IE_IPAC_RTP_MPLEX ('11111101'B),
246 RSL_IE_IPAC_RTP_MPLEX_ID ('11111110'B)
Harald Welte643e2a62017-11-27 15:03:18 +0100247 } with { variant "FIELDLENGTH(8)" };
248
249 type record RSL_LV {
250 uint8_t len,
251 octetstring payload
252 } with { variant (len) "LENGTHTO(payload)" }
253
Harald Welteefa7d912018-04-18 23:22:15 +0200254 template (value) RSL_LV ts_RSL_LV(template (value) octetstring pl) := {
Harald Welte643e2a62017-11-27 15:03:18 +0100255 len := 0,
256 payload := pl
257 }
258
Harald Welte51d74102017-12-10 23:05:02 +0100259 template RSL_LV tr_RSL_LV(template octetstring pl) := {
260 len := ?,
261 payload := pl
262 }
263
Harald Welte15bb5b52017-12-07 17:52:04 +0100264 type record RSL_L16V {
265 uint16_t len,
266 octetstring payload
267 } with { variant (len) "LENGTHTO(payload)" }
268
Harald Welteefa7d912018-04-18 23:22:15 +0200269 template (value) RSL_L16V ts_RSL_L16V(template (value) octetstring pl) := {
Harald Welte15bb5b52017-12-07 17:52:04 +0100270 len := 0,
271 payload := pl
272 }
273
Harald Welte7794d5b2017-12-16 23:00:20 +0100274 template RSL_L16V tr_RSL_L16V(template octetstring pl) := {
275 len := ?,
276 payload := pl
277 }
278
Harald Welte643e2a62017-11-27 15:03:18 +0100279 type record RSL_IE_V {
280 uint8_t val
281 }
282
283 /* 9.3.3 */
284 type record RSL_IE_ActivationType {
285 boolean reactivation,
286 uint4_t reserved,
Harald Welte921f9e02019-05-19 22:27:11 +0200287 RSL_ActivationAbits a_bits
288 };
289 type enumerated RSL_ActivationAbits {
290 ACT_REL_TO_IMM_ASSIGN ('000'B),
291 ACT_REL_TO_NORM_ASSIGN ('001'B),
292 ACT_REL_TO_ASYNC_HANDOVER ('010'B),
293 ACT_REL_TO_SYNC_HANDOVER ('011'B),
294 ACT_REL_TO_ADDL_ASSIGN ('100'B),
295 ACT_REL_TO_MSLOT_CONFIG ('101'B),
296 ACT_REL_TO_OSMO_PDCH ('111'B)
297 } with { variant "FIELDLENGTH(3)" };
Harald Welte643e2a62017-11-27 15:03:18 +0100298
Harald Welte921f9e02019-05-19 22:27:11 +0200299 const RSL_IE_ActivationType t_RSL_IE_ActType_IA := {
Harald Welte643e2a62017-11-27 15:03:18 +0100300 reactivation := false,
301 reserved := 0,
Harald Welte921f9e02019-05-19 22:27:11 +0200302 a_bits := ACT_REL_TO_IMM_ASSIGN
303 }
304 const RSL_IE_ActivationType t_RSL_IE_ActType_ASS := {
305 reactivation := false,
306 reserved := 0,
307 a_bits := ACT_REL_TO_NORM_ASSIGN
308 }
309 const RSL_IE_ActivationType t_RSL_IE_ActType_HO_ASYNC := {
310 reactivation := false,
311 reserved := 0,
312 a_bits := ACT_REL_TO_ASYNC_HANDOVER
313 }
314 const RSL_IE_ActivationType t_RSL_IE_ActType_HO_SYNC := {
315 reactivation := false,
316 reserved := 0,
317 a_bits := ACT_REL_TO_SYNC_HANDOVER
Harald Welte643e2a62017-11-27 15:03:18 +0100318 }
319
Harald Welte94e0c342018-04-07 11:33:23 +0200320 /* osmocom-style dynamic PDCH */
Harald Welte921f9e02019-05-19 22:27:11 +0200321 const RSL_IE_ActivationType t_RSL_IE_ActType_PDCH := {
Harald Welte94e0c342018-04-07 11:33:23 +0200322 reactivation := false,
323 reserved := 1,
Harald Welte921f9e02019-05-19 22:27:11 +0200324 a_bits := ACT_REL_TO_OSMO_PDCH
Harald Welte94e0c342018-04-07 11:33:23 +0200325 }
326
Vadim Yanitskiye02dbcc2020-08-25 04:20:51 +0700327 /* 9.3.5 */
328 type record RSL_IE_ChannelIdent {
329 uint8_t len,
330 /* 3GPP TS 44.018 Channel Description IE (TV) */
331 ChannelDescriptionTV ch_desc,
332 /* 3GPP TS 44.018 Mobile Allocation IE (shall be empty) */
333 MobileAllocationTLV ma
334 } with { variant (len) "LENGTHTO(ch_desc,ma)" };
335
336 template (value) RSL_IE_ChannelIdent
337 ts_RSL_ChannelIdent(template (value) ChannelDescription ch_desc) := {
338 len := 0, /* overwritten */
339 ch_desc := {
340 iei := '64'O,
341 v := ch_desc
342 },
343 /* Shall be included but empty */
344 ma := {
345 iei := '72'O,
346 v := {
347 len := 0,
348 ma := ''B
349 }
350 }
351 };
352
353 template RSL_IE_ChannelIdent
354 tr_RSL_ChannelIdent(template (present) ChannelDescription ch_desc := ?,
355 template (present) MobileAllocationLV ma := ?) := {
356 len := ?,
357 ch_desc := {
358 iei := '64'O,
359 v := ch_desc
360 },
361 /* Shall be included but empty */
362 ma := {
363 iei := '72'O,
364 v := ma
365 }
366 };
367
Harald Welte643e2a62017-11-27 15:03:18 +0100368 /* 9.3.6 */
369 type enumerated RSL_SpeechDataInd {
370 RSL_SPDI_SPEECH ('00000001'B),
371 RSL_SPDI_DATA ('00000010'B),
372 RSL_SPDI_SIGN ('00000011'B)
373 } with { variant "FIELDLENGTH(8)" };
374 type enumerated RSL_ChanRateType {
375 RSL_CHRT_SDCCH ('00000001'B),
376 RSL_CHRT_TCH_F ('00001000'B),
377 RSL_CHRT_TCH_H ('00001001'B),
378 RSL_CHRT_TCH_F_BD_MSLOT ('00001010'B),
379 RSL_CHRT_TCH_F_DL_MSLOT ('00011010'B),
380 RSL_CHRT_TCH_F_GROUP ('00011000'B),
381 RSL_CHRT_TCH_H_GROUP ('00011001'B),
382 RSL_CHRT_TCH_F_BCAST ('00101000'B),
Neels Hofmeyr2bef0dd2021-04-22 21:46:00 +0000383 RSL_CHRT_TCH_H_BCAST ('00101001'B),
384 RSL_CHRT_OSMO_TCH_F_VAMOS ('10001000'B),
385 RSL_CHRT_OSMO_TCH_H_VAMOS ('10001001'B)
Harald Welte643e2a62017-11-27 15:03:18 +0100386 } with { variant "FIELDLENGTH(8)" };
387 type enumerated RSL_SpeechAlgo {
388 RSL_CMOD_NO_RESOURCE ('00000000'B),
389 RSL_CMOD_SP_GSM1 ('00000001'B),
390 RSL_CMOD_SP_GSM2 ('00010001'B),
391 RSL_CMOD_SP_GSM3 ('00100001'B),
392 RSL_CMOD_SP_GSM4 ('00110001'B),
393 RSL_CMOD_SP_GSM5 ('00001001'B),
394 RSL_CMOD_SP_GSM6 ('00001101'B)
395 } with { variant "FIELDLENGTH(8)" };
396 type record RSL_IE_ChannelMode {
Harald Welte8f2c21d2017-12-07 17:52:40 +0100397 uint8_t len,
Harald Welte643e2a62017-11-27 15:03:18 +0100398 BIT6 reserved,
399 boolean dtx_d,
400 boolean dtx_u,
401 RSL_SpeechDataInd spd_ind,
402 RSL_ChanRateType ch_rate_type,
403 RSL_SpeechAlgo coding_alg_rate
Harald Welte8f2c21d2017-12-07 17:52:40 +0100404 } with { variant (len) "LENGTHTO(reserved,dtx_d,dtx_u,spd_ind,ch_rate_type,coding_alg_rate)" }
Harald Welte643e2a62017-11-27 15:03:18 +0100405
Vadim Yanitskiy8fc43df2020-10-20 02:11:05 +0700406 template (value) RSL_IE_ChannelMode ts_RSL_ChanMode_SIGN(RSL_ChanRateType t := RSL_CHRT_SDCCH,
407 boolean dtx_downlink := false) := {
Harald Welte8f2c21d2017-12-07 17:52:40 +0100408 len := 0, /* overwritten */
Harald Welte643e2a62017-11-27 15:03:18 +0100409 reserved := '000000'B,
Stefan Sperling4880be42018-08-07 18:12:59 +0200410 dtx_d := dtx_downlink,
Harald Welte643e2a62017-11-27 15:03:18 +0100411 dtx_u := false,
412 spd_ind := RSL_SPDI_SIGN,
Philipp Maierac693462020-10-14 20:21:44 +0200413 ch_rate_type := t,
Harald Welte643e2a62017-11-27 15:03:18 +0100414 coding_alg_rate := RSL_CMOD_NO_RESOURCE
415 }
416
Stefan Sperling4880be42018-08-07 18:12:59 +0200417 template (value) RSL_IE_ChannelMode ts_RSL_ChanMode(RSL_ChanRateType t, RSL_SpeechAlgo alg,
418 boolean dtx_downlink := false) := {
Harald Welte8f2c21d2017-12-07 17:52:40 +0100419 len := 0, /* overwritten */
Harald Welte643e2a62017-11-27 15:03:18 +0100420 reserved := '000000'B,
Stefan Sperling4880be42018-08-07 18:12:59 +0200421 dtx_d := dtx_downlink,
Harald Welte643e2a62017-11-27 15:03:18 +0100422 dtx_u := false,
423 spd_ind := RSL_SPDI_SPEECH,
424 ch_rate_type := t,
425 coding_alg_rate := alg
426 }
Harald Welte3618d9d2018-03-21 18:45:27 +0100427 template RSL_IE_ChannelMode tr_RSL_ChanMode(template RSL_ChanRateType t,
428 template RSL_SpeechAlgo alg) := {
429 len := ?,
430 reserved := '000000'B,
431 dtx_d := ?,
432 dtx_u := ?,
433 spd_ind := RSL_SPDI_SPEECH,
434 ch_rate_type := t,
435 coding_alg_rate := alg
436 }
Harald Welte643e2a62017-11-27 15:03:18 +0100437
Vadim Yanitskiy117c1762020-06-16 01:40:10 +0700438 /* 9.3.4 BS Power IE */
Harald Welte643e2a62017-11-27 15:03:18 +0100439 type record RSL_IE_BS_Power {
Vadim Yanitskiy117c1762020-06-16 01:40:10 +0700440 uint2_t reserved,
Harald Welte643e2a62017-11-27 15:03:18 +0100441 boolean epc,
442 boolean fpc,
Vadim Yanitskiy117c1762020-06-16 01:40:10 +0700443 uint4_t power_level
Harald Welte643e2a62017-11-27 15:03:18 +0100444 }
445
Vadim Yanitskiy117c1762020-06-16 01:40:10 +0700446 template (value) RSL_IE_BS_Power ts_RSL_IE_BS_Power(uint4_t power_level,
Eric Wildae8f2622019-06-18 17:05:11 +0200447 boolean epc := false, boolean fpc := false) := {
448 reserved := 0,
449 epc := epc,
450 fpc := fpc,
451 power_level := power_level
452 }
Vadim Yanitskiy2a5a1ef2021-06-30 00:51:48 +0200453 template RSL_IE_BS_Power
454 tr_RSL_IE_BS_Power(template (present) uint4_t power_level,
455 template (present) boolean epc := ?,
456 template (present) boolean fpc := ?) := {
457 reserved := ?,
458 epc := epc,
459 fpc := fpc,
460 power_level := power_level
461 }
Eric Wildae8f2622019-06-18 17:05:11 +0200462
Harald Welte73cd2712017-12-17 00:44:52 +0100463 /* 9.3.7 */
Harald Weltee613f962018-04-18 22:38:16 +0200464 type enumerated RSL_AlgId {
465 RSL_ALG_ID_A5_0 ('00000001'B),
466 RSL_ALG_ID_A5_1 ('00000010'B),
467 RSL_ALG_ID_A5_2 ('00000011'B),
468 RSL_ALG_ID_A5_3 ('00000100'B),
469 RSL_ALG_ID_A5_4 ('00000101'B),
470 RSL_ALG_ID_A5_5 ('00000110'B),
471 RSL_ALG_ID_A5_6 ('00000111'B),
472 RSL_ALG_ID_A5_7 ('00001000'B)
473 } with { variant "FIELDLENGTH(8)" };
Harald Welte73cd2712017-12-17 00:44:52 +0100474 type record RSL_IE_EncryptionInfo {
475 uint8_t len,
Harald Weltee613f962018-04-18 22:38:16 +0200476 RSL_AlgId alg_id,
Harald Welte73cd2712017-12-17 00:44:52 +0100477 octetstring key
478 } with { variant (len) "LENGTHTO(alg_id,key)" };
479
Harald Weltee613f962018-04-18 22:38:16 +0200480 template RSL_IE_EncryptionInfo tr_RSL_IE_EncrInfo(template RSL_AlgId alg,
481 template octetstring key) := {
Harald Welte73cd2712017-12-17 00:44:52 +0100482 len := ?,
483 alg_id := alg,
484 key := key
485 }
Harald Weltee613f962018-04-18 22:38:16 +0200486 template (value) RSL_IE_EncryptionInfo ts_RSL_IE_EncrInfo(template (value) RSL_AlgId alg,
487 octetstring key) := {
Harald Welteefa7d912018-04-18 23:22:15 +0200488 len := 0, /* overwritten */
489 alg_id := alg,
490 key := key
491 }
492
493
Harald Welte73cd2712017-12-17 00:44:52 +0100494
Harald Welte643e2a62017-11-27 15:03:18 +0100495 /* 9.3.8 */
496 type record RSL_IE_FrameNumber {
497 uint5_t t1_p,
498 uint6_t t3,
499 uint5_t t2
500 }
501 type RSL_IE_FrameNumber RSL_IE_StartingTime;
502
503 /* 9.3.10 */
504 type record RSL_IE_L1Info {
505 uint5_t ms_power_lvl,
506 boolean fpc,
507 uint2_t reserved,
508 uint8_t actual_ta
509 }
510
Neels Hofmeyrafe2ea52021-11-24 15:16:12 +0100511 template (value) RSL_IE_L1Info ts_RSL_IE_L1Info := {
512 ms_power_lvl := 0,
513 fpc := false,
514 reserved := 0,
515 actual_ta := 0
516 };
517
Harald Welte643e2a62017-11-27 15:03:18 +0100518 /* 9.3.13 */
519 type record RSL_IE_MS_Power {
520 uint2_t reserved,
521 boolean fpc_epc,
522 uint5_t power_level
523 }
Pau Espin Pedrolf7630a62019-10-28 15:07:08 +0100524 template RSL_IE_MS_Power tr_RSL_IE_MS_Power(template uint5_t power_level := ?,
525 template boolean fpc_epc := false) := {
526 reserved := 0,
527 fpc_epc := fpc_epc,
528 power_level := power_level
529 }
Harald Welte10280172019-05-19 22:28:04 +0200530 template (value) RSL_IE_MS_Power ts_RSL_IE_MS_Power(uint5_t power_level,
531 boolean fpc_epc := false) := {
532 reserved := 0,
533 fpc_epc := fpc_epc,
534 power_level := power_level
535 }
Harald Welte643e2a62017-11-27 15:03:18 +0100536
Harald Welted5f521e2017-12-07 17:53:06 +0100537 /* 9.3.18 */
538 type record RSL_IE_RachLoad {
539 uint8_t len,
540 uint16_t slot_count,
541 uint16_t busy_count,
542 uint16_t access_count
543 } with { variant (len) "LENGTHTO(slot_count,busy_count,access_count)" }
544
Harald Welteefa7d912018-04-18 23:22:15 +0200545 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 +0100546 len := 0, /* overwritten */
547 slot_count := slot,
548 busy_count := busy,
549 access_count := acc
550 }
551
Harald Welte68e495b2018-02-25 00:05:57 +0100552 template RSL_IE_RachLoad tr_RSL_IE_RachLoad(template uint16_t slot,
553 template uint16_t busy,
554 template uint16_t acc) := {
555 len := ?, /* overwritten */
556 slot_count := slot,
557 busy_count := busy,
558 access_count := acc
559 }
560
Harald Welte643e2a62017-11-27 15:03:18 +0100561 /* 9.3.19 */
562 type record RSL_IE_RequestRef {
563 OCT1 ra,
564 RSL_IE_FrameNumber frame_nr
565 }
566
567 /* 3GPP TS 44.018 / 10.5.2.38 Starting Time */
Harald Welte94e0c342018-04-07 11:33:23 +0200568 template (value) RSL_IE_FrameNumber ts_RSL_IE_FrameNumber(GsmFrameNumber fn) := {
Harald Welte643e2a62017-11-27 15:03:18 +0100569 t1_p := (fn / 1326) mod 32,
570 t3 := fn mod 51,
571 t2 := fn mod 26
572 }
573
Harald Welte9abd1282018-02-19 19:18:17 +0100574 function tr_RSL_IE_FrameNumber(template GsmFrameNumber fn) return template RSL_IE_FrameNumber {
575 if (istemplatekind(fn, "?")) {
576 return ?;
577 } else {
578 return ts_RSL_IE_FrameNumber(valueof(fn));
579 }
580 }
581
Harald Welteefa7d912018-04-18 23:22:15 +0200582 template (value) RSL_IE_RequestRef ts_RSL_IE_ReqRef(OCT1 ra, GsmFrameNumber frame_nr) := {
Harald Welte643e2a62017-11-27 15:03:18 +0100583 ra := ra,
584 frame_nr := ts_RSL_IE_FrameNumber(frame_nr)
585 }
586
Harald Welte9abd1282018-02-19 19:18:17 +0100587 template RSL_IE_RequestRef tr_RSL_IE_ReqRef(template OCT1 ra, template GsmFrameNumber frame_nr) := {
588 ra := ra,
589 frame_nr := tr_RSL_IE_FrameNumber(frame_nr)
590 }
591
Vadim Yanitskiy9f699532021-06-03 17:29:22 +0200592 /* 9.3.21 Resource Information */
593 type record RSL_IE_ResourceInfo {
594 uint8_t len,
595 RSL_ResourceInfo info
596 } with { variant (len) "LENGTHTO(info)" };
597
598 type record of RSL_ResourceInfoItem RSL_ResourceInfo;
599 type record RSL_ResourceInfoItem {
600 RslChannelNr chan_nr,
601 uint3_t interf_band,
602 BIT5 rfu ('00000'B)
603 };
604
605 template (value) RSL_ResourceInfoItem
606 ts_RSL_ResourceInfoItem(template (value) RslChannelNr chan_nr,
607 template (value) uint3_t interf_band := 0) := {
608 chan_nr := chan_nr,
609 interf_band := interf_band,
610 rfu := '00000'B
611 }
612 template RSL_ResourceInfoItem
613 tr_RSL_ResourceInfoItem(template (present) RslChannelNr chan_nr := ?,
614 template (present) uint3_t interf_band := ?) := {
615 chan_nr := chan_nr,
616 interf_band := interf_band,
617 rfu := ? /* Tolerate unknown values */
618 }
619
Harald Welte15de8ba2018-06-29 08:51:42 +0200620 /* Osmocom Extension */
621 type record RSL_IE_UplinkMeasSuppMeasInfo {
622 int16_t toa256_mean,
623 int16_t toa256_min,
624 int16_t toa256_max,
625 uint16_t toa256_std_dev
626 };
627
Harald Welte2691adf2018-02-22 17:32:39 +0100628 /* 9.3.25 */
629 type record RSL_IE_UplinkMeas {
630 uint8_t len,
631 BIT1 rfu,
632 boolean dtx_d,
633 uint6_t rxlev_f_u,
634 BIT2 reserved1,
635 uint6_t rxlev_s_u,
636 BIT2 reserved2,
637 uint3_t rxq_f_u,
638 uint3_t rxq_s_u,
Harald Welte15de8ba2018-06-29 08:51:42 +0200639 RSL_IE_UplinkMeasSuppMeasInfo supp_meas_info optional
Harald Welte2691adf2018-02-22 17:32:39 +0100640 } 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 +0100641
Neels Hofmeyrafe2ea52021-11-24 15:16:12 +0100642 template (value) RSL_IE_UplinkMeas ts_RSL_IE_UplinkMeas(uint6_t rxlev := 12, uint3_t rxqual := 0) := {
643 len := 0, /* overwritten */
644 rfu := '0'B,
645 dtx_d := false,
646 rxlev_f_u := rxlev,
647 reserved1 := '00'B,
648 rxlev_s_u := rxlev,
649 reserved2 := '00'B,
650 rxq_f_u := rxqual,
651 rxq_s_u := rxqual,
652 supp_meas_info := omit
653 };
654
Harald Welte643e2a62017-11-27 15:03:18 +0100655 /* 9.3.26 */
Harald Weltea8ed9062017-12-14 09:46:01 +0100656 type enumerated RSL_Cause {
657 /* normal event */
658 RSL_ERR_RADIO_IF_FAIL ('00'O),
659 RSL_ERR_RADIO_LINK_FAIL ('01'O),
660 RSL_ERR_HANDOVER_ACC_FAIL ('02'O),
661 RSL_ERR_TALKER_ACC_FAIL ('03'O),
662 RSL_ERR_OM_INTERVENTION ('07'O),
663 RSL_ERR_NORMAL_UNSPEC ('0f'O),
664 RSL_ERR_T_MSRFPCI_EXP ('18'O),
665 /* resource unavailable */
666 RSL_ERR_EQUIPMENT_FAIL ('20'O),
667 RSL_ERR_RR_UNAVAIL ('21'O),
668 RSL_ERR_TERR_CH_FAIL ('22'O),
669 RSL_ERR_CCCH_OVERLOAD ('23'O),
670 RSL_ERR_ACCH_OVERLOAD ('24'O),
671 RSL_ERR_PROCESSOR_OVERLOAD ('25'O),
672 RSL_ERR_BTS_NOT_EQUIPPED ('27'O),
673 RSL_ERR_REMOTE_TRAU_FAILURE ('28'O),
674 RSL_ERR_NOTIF_OVERFLOW ('29'O),
675 RSL_ERR_RES_UNAVAIL ('2f'O),
676 /* service or option not available */
677 RSL_ERR_TRANSC_UNAVAIL ('30'O),
678 RSL_ERR_SERV_OPT_UNAVAIL ('3f'O),
679 /* service or option not implemented */
680 RSL_ERR_ENCR_UNIMPL ('40'O),
681 RSL_ERR_SERV_OPT_UNIMPL ('4f'O),
682 /* invalid message */
683 RSL_ERR_RCH_ALR_ACTV_ALLOC ('50'O),
Harald Welte9912eb52018-02-25 13:30:15 +0100684 RSL_ERR_IPA_RCH_NOT_ACTV_ALLOC ('51'O),
685 RSL_ERR_IPA_CONN_INVALID ('52'O),
686 RSL_ERR_IPA_CONN_IN_USE ('53'O),
687 RSL_ERR_IPA_CONN_ALREADY_EXISTS ('54'O),
Harald Weltea8ed9062017-12-14 09:46:01 +0100688 RSL_ERR_INVALID_MESSAGE ('5f'O),
689 /* protocol error */
690 RSL_ERR_MSG_DISCR ('60'O),
691 RSL_ERR_MSG_TYPE ('61'O),
692 RSL_ERR_MSG_SEQ ('62'O),
693 RSL_ERR_IE_ERROR ('63'O),
694 RSL_ERR_MAND_IE_ERROR ('64'O),
695 RSL_ERR_OPT_IE_ERROR ('65'O),
696 RSL_ERR_IE_NONEXIST ('66'O),
697 RSL_ERR_IE_LENGTH ('67'O),
698 RSL_ERR_IE_CONTENT ('68'O),
699 RSL_ERR_PROTO ('6f'O),
700 /* interworking */
701 RSL_ERR_INTERWORKING ('7f'O)
702 };
Harald Welte643e2a62017-11-27 15:03:18 +0100703 type record RSL_IE_Cause {
Harald Welte6efa8e32017-12-09 22:34:06 +0100704 uint8_t len,
Harald Welte643e2a62017-11-27 15:03:18 +0100705 uint1_t e,
706 RSL_Cause cause,
707 octetstring cause_ext optional
Harald Welte6efa8e32017-12-09 22:34:06 +0100708 } with { variant (len) "LENGTHTO(e,cause,cause_ext)" }
Harald Welte643e2a62017-11-27 15:03:18 +0100709
Harald Welteefa7d912018-04-18 23:22:15 +0200710 template (value) RSL_IE_Cause ts_RSL_IE_Cause(RSL_Cause cause) := {
Harald Welte6efa8e32017-12-09 22:34:06 +0100711 len := 0, /* overwritten */
Harald Welte643e2a62017-11-27 15:03:18 +0100712 e := 0,
713 cause := cause,
714 cause_ext := omit
715 }
716
Harald Welte9abd1282018-02-19 19:18:17 +0100717 template RSL_IE_Cause tr_RSL_IE_Cause(template RSL_Cause cause) := {
718 len := ?,
719 e := 0,
720 cause := cause,
721 cause_ext := omit
722 }
723
Harald Weltec8d363c2019-05-19 20:36:48 +0200724 /* 9.3.29 */
725 type record RSL_SacchInfo {
726 uint8_t len,
727 uint8_t num_msgs,
728 RSL_SacchInfoElements elems
729 } with {
730 variant (len) "LENGTHTO(num_msgs,elems)";
731 variant (num_msgs) "LENGTHTO(elems)";
732 variant (num_msgs) "UNIT(elements)"
733 };
734 type record RSL_SacchInfoElement {
735 RSL_IE_SysinfoType si_type,
736 uint8_t len,
737 octetstring msg
738 } with {
739 variant (len) "LENGTHTO(msg)";
740 };
741 type record of RSL_SacchInfoElement RSL_SacchInfoElements;
742 template (value) RSL_SacchInfo ts_RSL_SacchInfo(template (value) RSL_SacchInfoElements elems) := {
743 len := 0, /* overwritten */
744 num_msgs := 0, /* overwritten */
745 elems := elems
746 }
747 template (value) RSL_SacchInfoElement ts_RSL_SacchInfoElem(RSL_IE_SysinfoType tp, octetstring msg) := {
748 si_type := tp,
749 len := lengthof(msg),
750 msg := msg
751 }
752
Eric Wild61edb7e2019-06-03 12:38:31 +0200753 /* 9.3.31 */
754 type record RSL_IE_MS_Power_Parameters {
755 uint8_t len,
756 octetstring params
757 } with {
758 variant (len) "LENGTHTO(params)";
759 };
760 template (value) RSL_IE_MS_Power_Parameters ts_RSL_IE_MS_Power_Parameters(octetstring params) := {
761 len := 0, /* overwritten */
762 params := params
763 }
764
Harald Welte643e2a62017-11-27 15:03:18 +0100765 /* 9.3.40 */
766 type enumerated RSL_ChanNeeded {
767 RSL_CHANNEED_ANY ('00'B),
768 RSL_CHANNEED_SDCCH ('01'B),
769 RSL_CHANNEED_TCH_F ('10'B),
770 RSL_CHANNEED_TCH_ForH ('11'B)
Harald Welte51d74102017-12-10 23:05:02 +0100771 } with { variant "FIELDLENGTH(2)" };
Harald Welte643e2a62017-11-27 15:03:18 +0100772 type record RSL_IE_ChanNeeded {
773 uint6_t reserved,
774 RSL_ChanNeeded chan_needed
775 }
776
Harald Weltecc373202018-09-10 10:28:21 +0200777 /* 9.3.41 CB Command Type */
778 type enumerated RSL_CbCommand {
779 RSL_CB_CMD_NORMAL ('0000'B),
780 RSL_CB_CMD_SCHEDULE ('1000'B),
781 RSL_CB_CMD_DEFAULT ('1110'B),
782 RSL_CB_CMD_NULL ('1111'B)
783 } with { variant "FIELDLENGTH(4)" };
784 type record RSL_IE_CbCommandType {
785 RSL_CbCommand command,
786 boolean default_bcast_null,
787 BIT1 spare,
788 uint2_t last_block
789 };
790 template (value) RSL_IE_CbCommandType ts_RSL_IE_CbCmdType(RSL_CbCommand cmd := RSL_CB_CMD_NORMAL,
791 uint2_t last_block := 1,
792 boolean def_bcast_null := true) := {
793 command := cmd,
794 default_bcast_null := def_bcast_null,
795 spare := '0'B,
796 last_block := last_block
797 }
798
Harald Welte4a129f82019-05-21 16:35:22 +0200799 /* 9.4.43 CBCH Load Information */
800 type record RSL_IE_CbchLoadInfo {
801 boolean overflow,
802 BIT3 spare,
803 uint4_t slot_count
804 };
805 template RSL_IE_CbchLoadInfo tr_CbchLoadInfo(template boolean overflow,
806 template uint4_t slot_count) := {
807 overflow := overflow,
808 spare := ?,
809 slot_count := slot_count
810 }
811 template (value) RSL_IE_CbchLoadInfo ts_CbchLoadInfo(boolean overflow, uint4_t slot_count) := {
812 overflow := overflow,
813 spare := '000'B,
814 slot_count := slot_count
815 }
816
Harald Welte643e2a62017-11-27 15:03:18 +0100817 /* 9.3.53 */
818 type record RSL_IE_MultirateCtrl {
819 uint3_t spare,
820 boolean od,
821 boolean pre,
822 uint2_t rae,
823 boolean tfo
824 }
825
826 type enumerated RSL_IE_SysinfoType {
827 RSL_SYSTEM_INFO_8 ('00000000'B),
828 RSL_SYSTEM_INFO_1 ('00000001'B),
829 RSL_SYSTEM_INFO_2 ('00000010'B),
830 RSL_SYSTEM_INFO_3 ('00000011'B),
831 RSL_SYSTEM_INFO_4 ('00000100'B),
832 RSL_SYSTEM_INFO_5 ('00000101'B),
833 RSL_SYSTEM_INFO_6 ('00000110'B),
834 RSL_SYSTEM_INFO_7 ('00000111'B),
835 RSL_SYSTEM_INFO_16 ('00001000'B),
836 RSL_SYSTEM_INFO_17 ('00001001'B),
837 RSL_SYSTEM_INFO_2bis ('00001010'B),
838 RSL_SYSTEM_INFO_2ter ('00001011'B),
839 RSL_SYSTEM_INFO_5bis ('00001101'B),
840 RSL_SYSTEM_INFO_5ter ('00001110'B),
841 RSL_SYSTEM_INFO_10 ('00001111'B),
842 RSL_EXT_MEAS_ORDER ('01000111'B),
843 RSL_MEAS_INFO ('01001000'B),
844 RSL_SYSTEM_INFO_13 ('00101000'B),
845 RSL_ERIC_SYSTEM_INFO_13 ('00001100'B),
846 RSL_SYSTEM_INFO_2quater ('00101001'B),
847 RSL_SYSTEM_INFO_9 ('00101010'B),
848 RSL_SYSTEM_INFO_18 ('00101011'B),
849 RSL_SYSTEM_INFO_19 ('00101100'B),
850 RSL_SYSTEM_INFO_20 ('00101101'B)
851 } with { variant "FIELDLENGTH(8)" }
852
Harald Welte9958a4d2017-12-14 21:21:33 +0100853 type record RSL_IE_IPA_ConnectionStats {
854 uint8_t len,
855 uint32_t tx_packets,
856 uint32_t tx_octets,
857 uint32_t rx_packets,
858 uint32_t rx_octets,
859 uint32_t lost_packets,
860 uint32_t jitter,
861 uint32_t avg_delay
862 } with { variant (len) "LENGTHTO(tx_packets,tx_octets,rx_packets,rx_octets,lost_packets,jitter,avg_delay)" }
863
864 type enumerated RSL_IPA_SpeechMode {
865 RSL_IPA_SPM_SENDRECV ('00'B),
866 RSL_IPA_SPM_RECVONLY ('01'B),
867 RSL_IPA_SPM_SENDONLY ('10'B),
868 RSL_IPA_SPM_RESERVED ('11'B)
869 } with { variant "FIELDLENGTH(2)" }
870
871 type enumerated RSL_IPA_Codec {
872 RSL_IPA_CODEC_FR ('0000'B),
873 RSL_IPA_CODEC_EFR ('0001'B),
874 RSL_IPA_CODEC_AMR_F ('0010'B),
875 RSL_IPA_CODEC_HR ('0011'B),
876 RSL_IPA_CODEC_AMR_H ('0101'B),
877 RSL_IPA_CODEC_RTP_PT ('1111'B)
878 } with { variant "FIELDLENGTH(4)" }
879
880 type record RSL_IE_IPA_SpeechMode {
881 BIT2 reserved,
882 RSL_IPA_SpeechMode mode,
883 RSL_IPA_Codec codec
884 }
885
Harald Welte0472ab42018-03-12 15:02:26 +0100886 /* 9.3.20 */
887 type enumerated RSL_IE_ReleaseMode {
888 RSL_REL_MODE_NORMAL ('00'B),
889 REL_REL_MODE_LOCAL ('01'B)
890 }
891
Neels Hofmeyr2bef0dd2021-04-22 21:46:00 +0000892 type record RSL_IE_OSMO_TrainingSequence {
893 uint8_t len,
894 uint8_t tsc_set,
895 uint8_t tsc
896 } with { variant (len) "LENGTHTO(tsc_set,tsc)" }
897
Vadim Yanitskiy1f532152021-11-01 20:37:56 +0300898 type record RSL_IE_OSMO_RepAcchCap {
899 uint8_t len,
900 BIT1 rfu ('0'B),
901 uint3_t rxqual,
902 boolean ul_sacch,
903 boolean dl_sacch,
904 boolean dl_facch_all,
905 boolean dl_facch_cmd
906 } with { variant (len) "LENGTHTO(rfu,rxqual,ul_sacch,dl_sacch,dl_facch_all,dl_facch_cmd)" }
907
Vadim Yanitskiya203d3b2021-11-01 21:32:31 +0300908 type record RSL_IE_OSMO_TopAcchCap {
909 uint8_t len,
910 boolean sacch_enable,
911 boolean facch_enable,
912 uint3_t rxqual,
913 uint3_t overpower_db
914 } with { variant (len) "LENGTHTO(sacch_enable,facch_enable,rxqual,overpower_db)" }
915
Vadim Yanitskiy66d3c332021-11-06 18:18:13 +0300916 template (value) RSL_IE_OSMO_TopAcchCap
917 ts_RSL_IE_OSMO_TopAcchCap(template (value) uint3_t overpower := 2,
918 template (value) uint3_t rxqual := 4,
919 boolean facch_enable := true,
920 boolean sacch_enable := true) := {
921 len := 0, /* overwritten */
922 sacch_enable := sacch_enable,
923 facch_enable := facch_enable,
924 rxqual := rxqual,
925 overpower_db := overpower
926 };
927 template RSL_IE_OSMO_TopAcchCap
928 tr_RSL_IE_OSMO_TopAcchCap(template (present) uint3_t overpower := ?,
929 template (present) uint3_t rxqual := ?,
930 template (present) boolean facch_enable := ?,
931 template (present) boolean sacch_enable := ?) := {
932 len := ?, /* overwritten */
933 sacch_enable := sacch_enable,
934 facch_enable := facch_enable,
935 rxqual := rxqual,
936 overpower_db := overpower
937 };
938
Harald Welte643e2a62017-11-27 15:03:18 +0100939 /* union of all IE bodies */
940 type union RSL_IE_Body {
941 RslChannelNr chan_nr,
942 RslLinkId link_id,
Harald Welte15bb5b52017-12-07 17:52:04 +0100943 RSL_L16V l3_info,
Harald Welte643e2a62017-11-27 15:03:18 +0100944 RSL_LV rlm_cause,
Harald Welte0472ab42018-03-12 15:02:26 +0100945 RSL_IE_ReleaseMode release_mode,
Harald Welte643e2a62017-11-27 15:03:18 +0100946 RSL_IE_ActivationType act_type,
Vadim Yanitskiye02dbcc2020-08-25 04:20:51 +0700947 RSL_IE_ChannelIdent chan_ident,
Harald Welte643e2a62017-11-27 15:03:18 +0100948 RSL_IE_ChannelMode chan_mode,
949 uint8_t handover_ref,
950 RSL_IE_BS_Power bs_power,
Vadim Yanitskiy802508e2020-11-11 07:25:47 +0700951 RSL_LV bs_power_params,
Harald Welte643e2a62017-11-27 15:03:18 +0100952 RSL_IE_MS_Power ms_power,
Eric Wild61edb7e2019-06-03 12:38:31 +0200953 RSL_IE_MS_Power_Parameters ms_power_params,
Harald Welte643e2a62017-11-27 15:03:18 +0100954 uint8_t timing_adv,
955 RSL_IE_MultirateCtrl multirate_ctrl,
Harald Weltea6706152019-05-19 20:38:18 +0200956 uint8_t msg_id,
Harald Welte643e2a62017-11-27 15:03:18 +0100957 RSL_IE_FrameNumber frame_nr,
958 RSL_IE_Cause cause,
959 uint8_t access_delay,
Harald Welted5f521e2017-12-07 17:53:06 +0100960 RSL_IE_RachLoad rach_load,
Harald Welte643e2a62017-11-27 15:03:18 +0100961 uint8_t meas_res_nr,
Harald Welte2691adf2018-02-22 17:32:39 +0100962 uint8_t ms_timing_offset,
963 RSL_IE_UplinkMeas uplink_meas,
Harald Welte643e2a62017-11-27 15:03:18 +0100964 RSL_IE_L1Info l1_info,
965 RSL_IE_SysinfoType sysinfo_type,
966 uint16_t paging_load,
967 uint8_t paging_group,
968 RSL_IE_ChanNeeded chan_needed,
Harald Weltecc373202018-09-10 10:28:21 +0200969 RSL_IE_CbCommandType cb_cmd_type,
970 RSL_LV smscb_message,
Harald Welte4a129f82019-05-21 16:35:22 +0200971 RSL_IE_CbchLoadInfo cbch_load_info,
Vadim Yanitskiy9f699532021-06-03 17:29:22 +0200972 RSL_IE_ResourceInfo resource_info,
Harald Weltec8d363c2019-05-19 20:36:48 +0200973 RSL_SacchInfo sacch_info,
Harald Weltecc373202018-09-10 10:28:21 +0200974
Harald Welte643e2a62017-11-27 15:03:18 +0100975 RSL_IE_StartingTime starting_time,
Harald Welte73cd2712017-12-17 00:44:52 +0100976 RSL_IE_EncryptionInfo encr_info,
Harald Weltea3ff6702019-05-20 20:03:50 +0200977 uint8_t smscb_chan_ind,
Harald Welte643e2a62017-11-27 15:03:18 +0100978 RSL_IE_RequestRef req_ref,
979 RSL_LV full_imm_ass_info,
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +0700980 MobileIdentityLV ms_identity,
Harald Welte643e2a62017-11-27 15:03:18 +0100981
Harald Welte9958a4d2017-12-14 21:21:33 +0100982 uint16_t ipa_conn_id,
983 uint16_t ipa_local_port,
984 uint16_t ipa_remote_port,
Vadim Yanitskiyfc631642021-07-03 02:42:45 +0200985 OCT4 ipa_local_ip,
986 OCT4 ipa_remote_ip,
Harald Welte9958a4d2017-12-14 21:21:33 +0100987 uint8_t ipa_rtp_pt,
988 uint8_t ipa_rtp_pt2,
989 RSL_IE_IPA_ConnectionStats ipa_stats,
990 RSL_IE_IPA_SpeechMode ipa_speech_mode,
991
Neels Hofmeyr2bef0dd2021-04-22 21:46:00 +0000992 RSL_IE_OSMO_TrainingSequence osmo_training_sequence,
Vadim Yanitskiy1f532152021-11-01 20:37:56 +0300993 RSL_IE_OSMO_RepAcchCap rep_acch_cap,
Vadim Yanitskiya203d3b2021-11-01 21:32:31 +0300994 RSL_IE_OSMO_TopAcchCap top_acch_cap,
Neels Hofmeyr2bef0dd2021-04-22 21:46:00 +0000995
Harald Welte643e2a62017-11-27 15:03:18 +0100996 RSL_LV other
997 }
998
999 type record RSL_IE {
1000 RSL_IE_Type iei,
1001 RSL_IE_Body body
1002 } with { variant (body) "CROSSTAG(
1003 chan_nr, iei = RSL_IE_CHAN_NR;
1004 link_id, iei = RSL_IE_LINK_IDENT;
1005 l3_info, iei = RSL_IE_L3_INFO;
1006 rlm_cause, iei = RSL_IE_RLM_CAUSE;
1007 release_mode, iei = RSL_IE_RELEASE_MODE;
1008 act_type, iei = RSL_IE_ACT_TYPE;
Vadim Yanitskiye02dbcc2020-08-25 04:20:51 +07001009 chan_ident, iei = RSL_IE_CHAN_IDENT;
Harald Welte643e2a62017-11-27 15:03:18 +01001010 chan_mode, iei = RSL_IE_CHAN_MODE;
1011 handover_ref, iei = RSL_IE_HANDO_REF;
1012 bs_power, iei = RSL_IE_BS_POWER;
Vadim Yanitskiy802508e2020-11-11 07:25:47 +07001013 bs_power_params, iei = RSL_IE_BS_POWER_PARAM;
Harald Welte643e2a62017-11-27 15:03:18 +01001014 ms_power, iei = RSL_IE_MS_POWER;
Eric Wild61edb7e2019-06-03 12:38:31 +02001015 ms_power_params, iei = RSL_IE_MS_POWER_PARAM;
Harald Welte643e2a62017-11-27 15:03:18 +01001016 timing_adv, iei = RSL_IE_TIMING_ADVANCE;
1017 multirate_ctrl, iei = RSL_IE_MR_CONTROL;
Harald Weltea6706152019-05-19 20:38:18 +02001018 msg_id, iei = RSL_IE_MSG_ID;
Harald Welte643e2a62017-11-27 15:03:18 +01001019
1020 frame_nr, iei = RSL_IE_FRAME_NUMBER;
1021 cause, iei = RSL_IE_CAUSE;
1022 access_delay, iei = RSL_IE_ACCESS_DELAY;
Harald Welted5f521e2017-12-07 17:53:06 +01001023 rach_load, iei = RSL_IE_RACH_LOAD;
Harald Welte643e2a62017-11-27 15:03:18 +01001024 meas_res_nr, iei = RSL_IE_MEAS_RES_NR;
Harald Welte2691adf2018-02-22 17:32:39 +01001025 ms_timing_offset, iei = RSL_IE_MS_TIMING_OFFSET;
1026 uplink_meas, iei = RSL_IE_UPLINK_MEAS;
Harald Welte643e2a62017-11-27 15:03:18 +01001027 l1_info, iei = RSL_IE_L1_INFO;
1028 sysinfo_type, iei = RSL_IE_SYSINFO_TYPE;
1029 paging_load, iei = RSL_IE_PAGING_LOAD;
1030 paging_group, iei = RSL_IE_PAGING_GROUP;
1031 chan_needed, iei = RSL_IE_CHAN_NEEDED;
Harald Weltecc373202018-09-10 10:28:21 +02001032 cb_cmd_type, iei = RSL_IE_CB_CMD_TYPE;
1033 smscb_message, iei = RSL_IE_SMSCB_MSG;
Harald Welte4a129f82019-05-21 16:35:22 +02001034 cbch_load_info, iei = RSL_IE_CBCH_LOAD_INFO;
Vadim Yanitskiy9f699532021-06-03 17:29:22 +02001035 resource_info, iei = RSL_IE_RESOURCE_INFO;
Harald Weltec8d363c2019-05-19 20:36:48 +02001036 sacch_info, iei = RSL_IE_SACCH_INFO;
Harald Welte643e2a62017-11-27 15:03:18 +01001037 starting_time, iei = RSL_IE_STARTNG_TIME;
Harald Welte73cd2712017-12-17 00:44:52 +01001038 encr_info, iei = RSL_IE_ENCR_INFO;
Harald Weltea3ff6702019-05-20 20:03:50 +02001039 smscb_chan_ind, iei = RSL_IE_SMSCB_CHAN_INDICATOR;
Harald Welte643e2a62017-11-27 15:03:18 +01001040
1041 req_ref, iei = RSL_IE_REQ_REFERENCE;
Harald Weltefff69302017-12-07 17:53:42 +01001042 full_imm_ass_info, iei = RSL_IE_FULL_IMM_ASS_INFO;
1043 ms_identity, iei = RSL_IE_MS_IDENTITY;
1044 other, iei = RSL_IE_FULL_BCCH_INFO;
Harald Welte643e2a62017-11-27 15:03:18 +01001045
Harald Welte9958a4d2017-12-14 21:21:33 +01001046 ipa_conn_id, iei = RSL_IE_IPAC_CONN_ID;
1047 ipa_remote_ip, iei = RSL_IE_IPAC_REMOTE_IP;
1048 ipa_remote_port, iei = RSL_IE_IPAC_REMOTE_PORT;
1049 ipa_local_ip, iei = RSL_IE_IPAC_LOCAL_IP;
1050 ipa_local_port, iei = RSL_IE_IPAC_LOCAL_PORT;
1051 ipa_rtp_pt, iei = RSL_IE_IPAC_RTP_PAYLOAD;
1052 ipa_rtp_pt2, iei = RSL_IE_IPAC_RTP_PAYLOAD2;
1053 ipa_stats, iei = RSL_IE_IPAC_CONN_STAT;
1054 ipa_speech_mode, iei = RSL_IE_IPAC_SPEECH_MODE;
1055
Neels Hofmeyr2bef0dd2021-04-22 21:46:00 +00001056 osmo_training_sequence, iei = RSL_IE_OSMO_TRAINING_SEQUENCE;
Vadim Yanitskiy1f532152021-11-01 20:37:56 +03001057 rep_acch_cap, iei = RSL_IE_OSMO_REP_ACCH_CAP;
Vadim Yanitskiya203d3b2021-11-01 21:32:31 +03001058 top_acch_cap, iei = RSL_IE_OSMO_TOP_ACCH_CAP;
Neels Hofmeyr2bef0dd2021-04-22 21:46:00 +00001059
Harald Welte643e2a62017-11-27 15:03:18 +01001060 other, OTHERWISE;
1061 )" };
1062
Harald Welte735dd072017-12-12 14:55:17 +01001063 /* For some reason the TTCN-3 RAW codec cannot automatically figure out the IEI
1064 * that it needs to set for a given union-choice (body). So we have to explicitly
1065 * specify the IEI by the caller :( */
Harald Welteefa7d912018-04-18 23:22:15 +02001066 template (value) RSL_IE t_RSL_IE(RSL_IE_Type iei, template (value) RSL_IE_Body body) := {
Harald Welte735dd072017-12-12 14:55:17 +01001067 iei := iei,
Harald Welte643e2a62017-11-27 15:03:18 +01001068 body := body
1069 }
1070
Harald Weltec2877752017-12-07 17:54:35 +01001071 template RSL_IE tr_RSL_IE(template RSL_IE_Body body) := {
1072 iei := ?, /* overwritten? */
1073 body := body
1074 }
1075
1076
Harald Welte643e2a62017-11-27 15:03:18 +01001077 type record of RSL_IE RSL_IE_List;
1078
1079 type record RSL_Message {
1080 RSL_MessageDiscriminator msg_disc,
1081 RSL_MessageType msg_type,
1082 RSL_IE_List ies optional
1083 }
1084
1085 external function enc_RSL_Message(in RSL_Message msg) return octetstring
1086 with { extension "prototype(convert) encode(RAW)" };
1087 external function dec_RSL_Message(in octetstring stream) return RSL_Message
1088 with { extension "prototype(convert) decode(RAW)" };
1089
Harald Weltebc330be2017-12-09 00:56:36 +01001090 template RSL_Message tr_RSL_MsgDiscType(template RSL_MessageDiscriminator m_disc,
Harald Welte643e2a62017-11-27 15:03:18 +01001091 RSL_MessageType m_type) := {
1092 msg_disc := m_disc,
1093 msg_type := m_type,
1094 ies := *
1095 }
1096
Harald Welteefa7d912018-04-18 23:22:15 +02001097 template (value) RSL_Message ts_RSL_MsgDiscType(template (value) RSL_MessageDiscriminator m_disc,
1098 template (value) RSL_MessageType msg_type,
1099 template (omit) RSL_IE_List ies := omit) := {
Harald Welte4a267362017-12-09 17:49:32 +01001100 msg_disc := m_disc,
1101 msg_type := msg_type,
1102 ies := ies
1103 }
1104
Harald Weltebc330be2017-12-09 00:56:36 +01001105template RSL_Message tr_RSL_MsgType(template RSL_MessageType msg_type) := {
1106 msg_disc := ?,
1107 msg_type := msg_type,
1108 ies := *
1109}
1110
1111/* Common Channel Management */
1112template RSL_Message tr_RSL_MsgTypeC(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
1113 msg_disc := { RSL_MDISC_CCHAN, ? }
1114}
1115
1116/* RLL */
1117template RSL_Message tr_RSL_MsgTypeR(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
1118 msg_disc := { RSL_MDISC_RLL, true }
1119}
1120
1121/* Dedicated Channel Management */
1122template RSL_Message tr_RSL_MsgTypeD(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
1123 msg_disc := { RSL_MDISC_DCHAN, ? }
1124}
1125
1126/* Dedicated Channel Management */
1127template RSL_Message tr_RSL_MsgTypeT(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
1128 msg_disc := { RSL_MDISC_TRX_MGMT, ? }
1129}
1130
1131
1132/* dedicated channel or RLL */
1133template RSL_Message tr_RSL_MsgTypeDR(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
Harald Weltee5408222018-01-29 21:57:58 +01001134 msg_disc := ({RSL_MDISC_DCHAN,?}, {RSL_MDISC_RLL,?}, {RSL_MDISC_IPACCESS,false})
Harald Weltebc330be2017-12-09 00:56:36 +01001135}
1136
1137
Harald Welte643e2a62017-11-27 15:03:18 +01001138 /* 8.3.1 BSC -> BTS */
Harald Welteefa7d912018-04-18 23:22:15 +02001139 template (value) RSL_Message ts_RSL_DATA_REQ(template (value) RslChannelNr chan_nr,
1140 template (value) RslLinkId link_id,
1141 octetstring l3_info) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001142 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, true),
1143 msg_type := RSL_MT_DATA_REQ,
1144 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001145 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1146 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
1147 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
Harald Welte643e2a62017-11-27 15:03:18 +01001148 }
1149 }
1150
Harald Welte7794d5b2017-12-16 23:00:20 +01001151 template RSL_Message tr_RSL_DATA_REQ(template RslChannelNr chan_nr :=?,
1152 template RslLinkId link_id := ?,
1153 template octetstring l3_info := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001154 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, true),
Harald Welte7794d5b2017-12-16 23:00:20 +01001155 msg_type := RSL_MT_DATA_REQ,
1156 ies :={
1157 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1158 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
1159 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
1160 }
1161 }
1162
1163
Harald Welte643e2a62017-11-27 15:03:18 +01001164 /* 8.3.2 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001165 template (value) RSL_Message ts_RSL_DATA_IND(template (value) RslChannelNr chan_nr,
1166 template (value) RslLinkId link_id,
1167 octetstring l3_info) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001168 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, true),
1169 msg_type := RSL_MT_DATA_IND,
1170 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001171 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1172 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
1173 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
Harald Welte643e2a62017-11-27 15:03:18 +01001174 }
1175 }
Harald Welte9abd1282018-02-19 19:18:17 +01001176 template RSL_Message tr_RSL_DATA_IND(template RslChannelNr chan_nr, template RslLinkId link_id,
1177 template octetstring l3_info := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001178 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, true),
Harald Welte9abd1282018-02-19 19:18:17 +01001179 msg_type := RSL_MT_DATA_IND,
1180 ies :={
1181 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1182 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
1183 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
1184 }
1185 }
Harald Welte643e2a62017-11-27 15:03:18 +01001186
1187 /* 8.3.3 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001188 template (value) RSL_Message ts_RSL_ERROR_IND(template (value) RslChannelNr chan_nr,
Harald Weltea7d81f12019-06-02 22:33:19 +02001189 template (value) RslLinkId link_id,
1190 template (value) octetstring rlm_cause) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001191 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1192 msg_type := RSL_MT_ERROR_IND,
1193 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001194 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1195 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
Harald Weltea7d81f12019-06-02 22:33:19 +02001196 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{rlm_cause := ts_RSL_LV(rlm_cause)})
Harald Welte643e2a62017-11-27 15:03:18 +01001197 }
1198 }
Harald Welte9abd1282018-02-19 19:18:17 +01001199 template RSL_Message tr_RSL_ERROR_IND(template RslChannelNr chan_nr, template RslLinkId link_id,
Harald Weltea7d81f12019-06-02 22:33:19 +02001200 template octetstring rlm_cause := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001201 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001202 msg_type := RSL_MT_ERROR_IND,
1203 ies :={
1204 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1205 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
Harald Weltea7d81f12019-06-02 22:33:19 +02001206 tr_RSL_IE(RSL_IE_Body:{rlm_cause := tr_RSL_LV(rlm_cause)})
Harald Welte9abd1282018-02-19 19:18:17 +01001207 }
1208 }
Harald Welte643e2a62017-11-27 15:03:18 +01001209
Harald Welteefa7d912018-04-18 23:22:15 +02001210 /* 8.3.4 BTS <- BSC */
1211 template (value) RSL_Message ts_RSL_EST_REQ(template (value) RslChannelNr chan_nr,
1212 template (value) RslLinkId link_id) := {
1213 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1214 msg_type := RSL_MT_EST_REQ,
1215 ies := {
1216 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1217 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
1218 }
1219 }
1220 template RSL_Message tr_RSL_EST_REQ(template RslChannelNr chan_nr, template RslLinkId link_id) := {
1221 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
1222 msg_type := RSL_MT_EST_REQ,
1223 ies := {
1224 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1225 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1226 }
1227 }
1228
1229 /* 8.3.5 BTS -> BSC */
1230 template (value) RSL_Message ts_RSL_EST_CONF(template (value) RslChannelNr chan_nr,
1231 template (value) RslLinkId link_id) := {
1232 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1233 msg_type := RSL_MT_EST_CONF,
1234 ies := {
1235 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1236 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
1237 }
1238 }
1239 template RSL_Message tr_RSL_EST_CONF(template RslChannelNr chan_nr, template RslLinkId link_id) := {
1240 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
1241 msg_type := RSL_MT_EST_CONF,
1242 ies := {
1243 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1244 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1245 }
1246 }
1247
Harald Welte643e2a62017-11-27 15:03:18 +01001248 /* 8.3.6 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001249 template (value) RSL_Message ts_RSL_EST_IND(template (value) RslChannelNr chan_nr,
1250 template (value) RslLinkId link_id,
1251 octetstring l3_info) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001252 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1253 msg_type := RSL_MT_EST_IND,
1254 ies := {
Harald Welte735dd072017-12-12 14:55:17 +01001255 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1256 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
1257 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
Harald Welte643e2a62017-11-27 15:03:18 +01001258 }
1259 }
Harald Welte9abd1282018-02-19 19:18:17 +01001260 template RSL_Message tr_RSL_EST_IND(template RslChannelNr chan_nr, template RslLinkId link_id,
1261 template octetstring l3_info := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001262 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001263 msg_type := RSL_MT_EST_IND,
1264 ies := {
1265 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1266 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
1267 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
1268 }
1269 }
Harald Welte0472ab42018-03-12 15:02:26 +01001270 template RSL_Message tr_RSL_EST_IND_NOL3(template RslChannelNr chan_nr, template RslLinkId link_id) :=
1271{
1272 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
1273 msg_type := RSL_MT_EST_IND,
1274 ies := {
1275 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1276 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1277 }
1278 }
1279
Harald Welte643e2a62017-11-27 15:03:18 +01001280
1281 /* 8.3.7 BSC -> BTS */
Harald Welteefa7d912018-04-18 23:22:15 +02001282 template (value) RSL_Message ts_RSL_REL_REQ(template (value) RslChannelNr chan_nr,
Harald Welte0472ab42018-03-12 15:02:26 +01001283 template (value) RslLinkId link_id,
1284 template (value) RSL_IE_ReleaseMode rel_mode := RSL_REL_MODE_NORMAL) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001285 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1286 msg_type := RSL_MT_REL_REQ,
1287 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001288 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
Harald Welte0472ab42018-03-12 15:02:26 +01001289 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
1290 t_RSL_IE(RSL_IE_RELEASE_MODE, RSL_IE_Body:{release_mode := rel_mode})
Harald Welte643e2a62017-11-27 15:03:18 +01001291 }
1292 }
Harald Weltee8a5ab12017-12-09 22:34:57 +01001293 template RSL_Message tr_RSL_REL_REQ(template RslChannelNr chan_nr,
Harald Welte0472ab42018-03-12 15:02:26 +01001294 template RslLinkId link_id,
1295 template RSL_IE_ReleaseMode rel_mode := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001296 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Weltee8a5ab12017-12-09 22:34:57 +01001297 msg_type := RSL_MT_REL_REQ,
1298 ies :={
1299 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1300 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
Harald Welte0472ab42018-03-12 15:02:26 +01001301 tr_RSL_IE(RSL_IE_Body:{release_mode := rel_mode})
Harald Weltee8a5ab12017-12-09 22:34:57 +01001302 }
1303 }
Harald Welte643e2a62017-11-27 15:03:18 +01001304
1305 /* 8.3.8 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001306 template (value) RSL_Message ts_RSL_REL_CONF(template (value) RslChannelNr chan_nr,
1307 template (value) RslLinkId link_id) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001308 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1309 msg_type := RSL_MT_REL_CONF,
1310 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001311 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1312 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
Harald Welte643e2a62017-11-27 15:03:18 +01001313 }
1314 }
Harald Welte9abd1282018-02-19 19:18:17 +01001315 template RSL_Message tr_RSL_REL_CONF(template RslChannelNr chan_nr, template RslLinkId link_id) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001316 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001317 msg_type := RSL_MT_REL_CONF,
1318 ies :={
1319 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1320 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1321 }
1322 }
Harald Welte643e2a62017-11-27 15:03:18 +01001323
1324 /* 8.3.9 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001325 template (value) RSL_Message ts_RSL_REL_IND(template (value) RslChannelNr chan_nr,
1326 template (value) RslLinkId link_id) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001327 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1328 msg_type := RSL_MT_REL_IND,
1329 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001330 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1331 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
Harald Welte643e2a62017-11-27 15:03:18 +01001332 }
1333 }
Harald Welte9abd1282018-02-19 19:18:17 +01001334 template RSL_Message tr_RSL_REL_IND(template RslChannelNr chan_nr, template RslLinkId link_id) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001335 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001336 msg_type := RSL_MT_REL_IND,
1337 ies :={
1338 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1339 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1340 }
1341 }
Harald Welte643e2a62017-11-27 15:03:18 +01001342
1343 /* 8.3.10 BSC -> BTS */
Harald Welteefa7d912018-04-18 23:22:15 +02001344 template (value) RSL_Message ts_RSL_UNITDATA_REQ(template (value) RslChannelNr chan_nr,
1345 template (value) RslLinkId link_id,
1346 octetstring l3_info)
Harald Welte643e2a62017-11-27 15:03:18 +01001347 modifies ts_RSL_DATA_REQ := {
1348 msg_type := RSL_MT_UNIT_DATA_REQ
1349 }
Harald Welte0472ab42018-03-12 15:02:26 +01001350 template RSL_Message tr_RSL_UNITDATA_REQ(template RslChannelNr chan_nr,
1351 template RslLinkId link_id,
Vadim Yanitskiy8f98d3f2018-10-03 17:58:10 +07001352 template octetstring l3_info := ?)
Harald Welte0472ab42018-03-12 15:02:26 +01001353 modifies tr_RSL_DATA_REQ := {
1354 msg_type := RSL_MT_UNIT_DATA_REQ
1355 }
1356
Harald Welte643e2a62017-11-27 15:03:18 +01001357
1358 /* 8.3.11 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001359 template (value) RSL_Message ts_RSL_UNITDATA_IND(template (value) RslChannelNr chan_nr,
1360 template (value) RslLinkId link_id,
1361 octetstring l3_info)
Harald Welte643e2a62017-11-27 15:03:18 +01001362 modifies ts_RSL_DATA_IND := {
1363 msg_type := RSL_MT_UNIT_DATA_IND
1364 }
Harald Welte0472ab42018-03-12 15:02:26 +01001365 template RSL_Message tr_RSL_UNITDATA_IND(template RslChannelNr chan_nr,
Vadim Yanitskiyfabe0f22018-10-03 17:51:47 +07001366 template RslLinkId link_id,
Vadim Yanitskiy8f98d3f2018-10-03 17:58:10 +07001367 template octetstring l3_info := ?)
Harald Welte0472ab42018-03-12 15:02:26 +01001368 modifies tr_RSL_DATA_IND := {
1369 msg_type := RSL_MT_UNIT_DATA_IND
1370 }
1371
1372
Harald Welte643e2a62017-11-27 15:03:18 +01001373
1374
1375 /* DEDICATED CANNEL MANAGEMENT MESSAGES */
1376
1377 /* 8.4.1 BSC -> BTS */
Harald Welteefa7d912018-04-18 23:22:15 +02001378 template (value) RSL_Message ts_RSL_CHAN_ACT(template (value) RslChannelNr chan_nr,
Harald Welte921f9e02019-05-19 22:27:11 +02001379 template (value) RSL_IE_ChannelMode mode,
1380 template (value) RSL_IE_ActivationType at := t_RSL_IE_ActType_IA) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001381 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1382 msg_type := RSL_MT_CHAN_ACTIV,
1383 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001384 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
Harald Welte921f9e02019-05-19 22:27:11 +02001385 t_RSL_IE(RSL_IE_ACT_TYPE, RSL_IE_Body:{act_type := at}),
Harald Welte735dd072017-12-12 14:55:17 +01001386 t_RSL_IE(RSL_IE_CHAN_MODE, RSL_IE_Body:{chan_mode := mode})
Harald Welte643e2a62017-11-27 15:03:18 +01001387 /* lots of optional IEs */
1388 }
1389 }
Harald Welte94e0c342018-04-07 11:33:23 +02001390 template RSL_Message tr_RSL_CHAN_ACT(template RslChannelNr chan_nr,
Harald Welte921f9e02019-05-19 22:27:11 +02001391 template RSL_IE_ChannelMode mode,
1392 template (value) RSL_IE_ActivationType at := t_RSL_IE_ActType_IA) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001393 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte94e0c342018-04-07 11:33:23 +02001394 msg_type := RSL_MT_CHAN_ACTIV,
1395 ies :={
1396 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
Harald Welte921f9e02019-05-19 22:27:11 +02001397 tr_RSL_IE(RSL_IE_Body:{act_type := at}),
Harald Welte94e0c342018-04-07 11:33:23 +02001398 tr_RSL_IE(RSL_IE_Body:{chan_mode := mode}),
1399 /* lots of optional IEs */
1400 *
1401 }
1402 }
1403 template RSL_Message tr_RSL_CHAN_ACT_PDCH(template RslChannelNr chan_nr,
1404 template RSL_IE_ChannelMode mode) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001405 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte94e0c342018-04-07 11:33:23 +02001406 msg_type := RSL_MT_CHAN_ACTIV,
1407 ies :={
1408 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1409 tr_RSL_IE(RSL_IE_Body:{act_type := t_RSL_IE_ActType_PDCH}),
1410 /* lots of optional IEs */
1411 *
1412 }
1413 }
1414
Harald Welte643e2a62017-11-27 15:03:18 +01001415
1416 /* 8.4.2 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001417 template (value) RSL_Message ts_RSL_CHAN_ACT_ACK(template (value) RslChannelNr chan_nr,
1418 GsmFrameNumber fn) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001419 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1420 msg_type := RSL_MT_CHAN_ACTIV_ACK,
1421 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001422 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1423 t_RSL_IE(RSL_IE_FRAME_NUMBER, RSL_IE_Body:{frame_nr := ts_RSL_IE_FrameNumber(fn)})
Harald Welte643e2a62017-11-27 15:03:18 +01001424 }
1425 }
Harald Welte9abd1282018-02-19 19:18:17 +01001426 template RSL_Message tr_RSL_CHAN_ACT_ACK(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001427 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001428 msg_type := RSL_MT_CHAN_ACTIV_ACK,
1429 ies := {
1430 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1431 tr_RSL_IE(RSL_IE_Body:{frame_nr := ?})
1432 }
1433 }
Harald Welte643e2a62017-11-27 15:03:18 +01001434
1435 /* 8.4.3 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001436 template (value) RSL_Message ts_RSL_CHAN_ACT_NACK(template (value) RslChannelNr chan_nr,
1437 RSL_Cause cause) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001438 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1439 msg_type := RSL_MT_CHAN_ACTIV_NACK,
1440 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001441 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1442 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
Harald Welte643e2a62017-11-27 15:03:18 +01001443 }
1444 }
Harald Welte9abd1282018-02-19 19:18:17 +01001445 template RSL_Message tr_RSL_CHAN_ACT_NACK(template RslChannelNr chan_nr,
1446 template RSL_Cause cause := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001447 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001448 msg_type := RSL_MT_CHAN_ACTIV_NACK,
1449 ies := {
1450 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1451 tr_RSL_IE(RSL_IE_Body:{cause := ?})
1452 }
1453 }
Harald Welte643e2a62017-11-27 15:03:18 +01001454
1455 /* 8.4.4 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001456 template (value) RSL_Message ts_RSL_CONN_FAIL_IND(RslChannelNr chan_nr, RSL_Cause cause) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001457 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1458 msg_type := RSL_MT_CONN_FAIL,
1459 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001460 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1461 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
Harald Welte643e2a62017-11-27 15:03:18 +01001462 }
1463 }
Harald Welte9abd1282018-02-19 19:18:17 +01001464 template RSL_Message tr_RSL_CONN_FAIL_IND(template RslChannelNr chan_nr,
1465 template RSL_Cause cause := ?) := {
1466 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1467 msg_type := RSL_MT_CONN_FAIL,
1468 ies :={
1469 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1470 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
1471 }
1472 }
Harald Welte643e2a62017-11-27 15:03:18 +01001473
Harald Weltee8a5ab12017-12-09 22:34:57 +01001474 /* 8.4.5 BSC -> BTS */
1475 template RSL_Message tr_RSL_DEACT_SACCH(template RslChannelNr chan_nr) := {
1476 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1477 msg_type := RSL_MT_DEACTIVATE_SACCH,
1478 ies := {
1479 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
1480 }
1481 }
Harald Welteefa7d912018-04-18 23:22:15 +02001482 template (value) RSL_Message ts_RSL_DEACT_SACCH(template (value) RslChannelNr chan_nr) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001483 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1484 msg_type := RSL_MT_DEACTIVATE_SACCH,
1485 ies := {
1486 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1487 }
1488 }
1489
Harald Weltee8a5ab12017-12-09 22:34:57 +01001490
Harald Welte73cd2712017-12-17 00:44:52 +01001491 /* 8.4.6 BSC ->BTS */
1492 template RSL_Message tr_RSL_ENCR_CMD(template RslChannelNr chan_nr,
1493 template RslLinkId link_id := ?,
Harald Weltee613f962018-04-18 22:38:16 +02001494 template RSL_AlgId alg := ?,
Harald Welte73cd2712017-12-17 00:44:52 +01001495 template octetstring key := ?,
1496 template octetstring l3_info := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001497 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte73cd2712017-12-17 00:44:52 +01001498 msg_type := RSL_MT_ENCR_CMD,
1499 ies := {
1500 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1501 tr_RSL_IE(RSL_IE_Body:{encr_info := tr_RSL_IE_EncrInfo(alg, key)}),
1502 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
1503 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
1504 }
1505 }
Harald Welteefa7d912018-04-18 23:22:15 +02001506 template (value) RSL_Message ts_RSL_ENCR_CMD(template (value) RslChannelNr chan_nr,
1507 template (value) RslLinkId link_id,
Harald Weltee613f962018-04-18 22:38:16 +02001508 template (value) RSL_AlgId alg, octetstring key,
Harald Welteefa7d912018-04-18 23:22:15 +02001509 octetstring l3_info) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001510 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1511 msg_type := RSL_MT_ENCR_CMD,
1512 ies := {
1513 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
Harald Welteefa7d912018-04-18 23:22:15 +02001514 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 +01001515 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
Harald Welteefa7d912018-04-18 23:22:15 +02001516 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
Harald Welte9abd1282018-02-19 19:18:17 +01001517 }
1518 }
Harald Welte73cd2712017-12-17 00:44:52 +01001519
Harald Welte2691adf2018-02-22 17:32:39 +01001520 template RSL_Message tr_RSL_MEAS_RES(template RslChannelNr chan_nr,
1521 template uint8_t meas_res_nr := ?,
1522 template RSL_IE_UplinkMeas ul_meas := ?,
1523 template RSL_IE_BS_Power bs_power := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001524 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte2691adf2018-02-22 17:32:39 +01001525 msg_type := RSL_MT_MEAS_RES,
1526 ies := {
1527 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1528 tr_RSL_IE(RSL_IE_Body:{meas_res_nr := meas_res_nr}),
1529 tr_RSL_IE(RSL_IE_Body:{uplink_meas := ul_meas}),
1530 tr_RSL_IE(RSL_IE_Body:{bs_power := bs_power}),
1531 *
1532 }
1533 }
1534
Philipp Maierdd841d32019-12-17 14:44:54 +01001535 /* Receive template for a measurement report that lacks the measurement report
1536 * from the MS (l1_info, l3_info and ms timing offset */
1537 template RSL_Message tr_RSL_MEAS_RES_EMPTY(template RslChannelNr chan_nr,
1538 template uint8_t meas_res_nr := ?,
1539 template RSL_IE_UplinkMeas ul_meas := ?,
1540 template RSL_IE_BS_Power bs_power := ?) := {
1541 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1542 msg_type := RSL_MT_MEAS_RES,
1543 ies := {
1544 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1545 tr_RSL_IE(RSL_IE_Body:{meas_res_nr := meas_res_nr}),
1546 tr_RSL_IE(RSL_IE_Body:{uplink_meas := ul_meas}),
1547 tr_RSL_IE(RSL_IE_Body:{bs_power := bs_power})
1548 }
1549 }
1550
Harald Welte39b47be2018-02-23 18:58:48 +01001551 /* Osmocom specific template, require lots of optional fields to be present */
1552 template RSL_Message tr_RSL_MEAS_RES_OSMO(template RslChannelNr chan_nr,
1553 template uint8_t meas_res_nr := ?,
1554 template RSL_IE_UplinkMeas ul_meas := ?,
1555 template RSL_IE_BS_Power bs_power := ?,
1556 template RSL_IE_L1Info l1_info := ?,
1557 template octetstring l3_info := ?,
1558 template uint8_t ms_to := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001559 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte39b47be2018-02-23 18:58:48 +01001560 msg_type := RSL_MT_MEAS_RES,
1561 ies := {
1562 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1563 tr_RSL_IE(RSL_IE_Body:{meas_res_nr := meas_res_nr}),
1564 tr_RSL_IE(RSL_IE_Body:{uplink_meas := ul_meas}),
1565 tr_RSL_IE(RSL_IE_Body:{bs_power := bs_power}),
1566 tr_RSL_IE(RSL_IE_Body:{l1_info := l1_info}),
1567 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)}),
1568 tr_RSL_IE(RSL_IE_Body:{ms_timing_offset := ms_to})
1569 }
1570 }
1571
Neels Hofmeyrafe2ea52021-11-24 15:16:12 +01001572 template (value) RSL_Message ts_RSL_MEAS_RES(template (value) RslChannelNr chan_nr,
1573 uint8_t meas_res_nr,
1574 template (value) RSL_IE_UplinkMeas ul_meas,
1575 template (value) RSL_IE_BS_Power bs_power,
1576 template (value) RSL_IE_L1Info l1_info,
1577 octetstring l3_info,
1578 uint8_t ms_to) := {
1579 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1580 msg_type := RSL_MT_MEAS_RES,
1581 ies := {
1582 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1583 t_RSL_IE(RSL_IE_MEAS_RES_NR, RSL_IE_Body:{meas_res_nr := meas_res_nr}),
1584 t_RSL_IE(RSL_IE_UPLINK_MEAS, RSL_IE_Body:{uplink_meas := ul_meas}),
1585 t_RSL_IE(RSL_IE_BS_POWER, RSL_IE_Body:{bs_power := bs_power}),
1586 t_RSL_IE(RSL_IE_L1_INFO, RSL_IE_Body:{l1_info := l1_info}),
1587 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)}),
1588 t_RSL_IE(RSL_IE_MS_TIMING_OFFSET, RSL_IE_Body:{ms_timing_offset := ms_to})
1589 }
1590 }
1591
Eric Wildf1827a72019-05-28 17:37:35 +02001592 /* 8.4.9 BSC -> BTS */
1593 template (value) RSL_Message ts_RSL_MODE_MODIFY_REQ(template (value) RslChannelNr chan_nr,
1594 template (value) RSL_IE_ChannelMode mode) := {
1595 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1596 msg_type := RSL_MT_MODE_MODIFY_REQ,
1597 ies :={
1598 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1599 t_RSL_IE(RSL_IE_CHAN_MODE, RSL_IE_Body:{chan_mode := mode})
1600 /* lots of optional IEs */
1601 }
1602 }
1603 template RSL_Message tr_RSL_MODE_MODIFY_REQ(template RslChannelNr chan_nr,
1604 template RSL_IE_ChannelMode mode) := {
1605 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1606 msg_type := RSL_MT_MODE_MODIFY_REQ,
1607 ies :={
1608 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1609 tr_RSL_IE(RSL_IE_Body:{chan_mode := mode}),
1610 /* lots of optional IEs */
1611 *
1612 }
1613 }
Neels Hofmeyr9f3e6ac2021-04-08 23:09:24 +02001614
1615 template RSL_Message tr_RSL_MODE_MODIFY_REQ_with_OSMO_TSC(template RslChannelNr chan_nr,
1616 template RSL_IE_ChannelMode mode,
1617 template uint8_t tsc_set := ?,
1618 template uint8_t tsc := ?) := {
1619 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1620 msg_type := RSL_MT_MODE_MODIFY_REQ,
1621 ies := {
1622 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1623 tr_RSL_IE(RSL_IE_Body:{chan_mode := mode}),
1624 tr_RSL_IE(RSL_IE_Body:{osmo_training_sequence := {
1625 len := ?,
1626 tsc_set := tsc_set,
1627 tsc := tsc
1628 }
1629 })
1630 }
1631 };
Eric Wildf1827a72019-05-28 17:37:35 +02001632
Harald Welte7794d5b2017-12-16 23:00:20 +01001633 /* 8.4.10 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001634 template (value) RSL_Message ts_RSL_MODE_MODIFY_ACK(template (value) RslChannelNr chan_nr) := {
Harald Welte7794d5b2017-12-16 23:00:20 +01001635 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1636 msg_type := RSL_MT_MODE_MODIFY_ACK,
1637 ies := {
1638 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1639 }
1640 }
Harald Welte9abd1282018-02-19 19:18:17 +01001641 template RSL_Message tr_RSL_MODE_MODIFY_ACK(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001642 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001643 msg_type := RSL_MT_MODE_MODIFY_ACK,
1644 ies := {
1645 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
1646 }
1647 }
Harald Welte7794d5b2017-12-16 23:00:20 +01001648
Harald Welte643e2a62017-11-27 15:03:18 +01001649 /* 8.4.11 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001650 template (value) RSL_Message ts_RSL_MODE_MODIFY_NACK(template (value) RslChannelNr chan_nr,
1651 RSL_Cause cause) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001652 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1653 msg_type := RSL_MT_MODE_MODIFY_NACK,
1654 ies := {
1655 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1656 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
1657 }
Harald Welte643e2a62017-11-27 15:03:18 +01001658 }
Harald Welte9abd1282018-02-19 19:18:17 +01001659 template RSL_Message tr_RSL_MODE_MODIFY_NACK(template RslChannelNr chan_nr,
1660 template RSL_Cause cause) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001661 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001662 msg_type := RSL_MT_MODE_MODIFY_NACK,
1663 ies := {
1664 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1665 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
1666 }
1667 }
1668
Harald Welte643e2a62017-11-27 15:03:18 +01001669
Harald Welte6a8199d2018-01-29 21:58:53 +01001670 /* 8.4.14: BTS <- BSC */
1671 template RSL_Message tr_RSL_RF_CHAN_REL(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001672 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte6a8199d2018-01-29 21:58:53 +01001673 msg_type := RSL_MT_RF_CHAN_REL,
1674 ies := {
1675 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
1676 }
1677 }
Harald Welteefa7d912018-04-18 23:22:15 +02001678 template (value) RSL_Message ts_RSL_RF_CHAN_REL(template (value) RslChannelNr chan_nr) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001679 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1680 msg_type := RSL_MT_RF_CHAN_REL,
1681 ies := {
1682 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1683 }
1684 }
Harald Welte6a8199d2018-01-29 21:58:53 +01001685
Philipp Maier4d1e9c92018-12-20 11:11:56 +01001686 /* 8.4.15: BTS <- BSC */
1687 template (value) RSL_Message ts_RSL_MS_PWR_CTRL(template (value) RslChannelNr chan_nr,
1688 template (value) RSL_IE_MS_Power ms_power) := {
1689 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1690 msg_type := RSL_MT_MS_POWER_CONTROL,
1691 ies := {
1692 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1693 t_RSL_IE(RSL_IE_MS_POWER, RSL_IE_Body:{ms_power := ms_power})
1694 /* One optional IE: MS POWER PARAMETERS */
1695 }
1696 }
1697
Eric Wild61edb7e2019-06-03 12:38:31 +02001698 template (value) RSL_Message ts_RSL_MS_PWR_CTRL_with_pp(template (value) RslChannelNr chan_nr,
1699 integer pwr_level) := {
1700 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1701 msg_type := RSL_MT_MS_POWER_CONTROL,
1702 ies := {
1703 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1704 t_RSL_IE(RSL_IE_MS_POWER, RSL_IE_Body:{ms_power := ts_RSL_IE_MS_Power(pwr_level)}),
1705 t_RSL_IE(RSL_IE_MS_POWER_PARAM, RSL_IE_Body:{ms_power_params :=
1706 ts_RSL_IE_MS_Power_Parameters(''O)})
1707 }
1708 }
1709
Eric Wildae8f2622019-06-18 17:05:11 +02001710 /* 8.4.16: BTS <- BSC */
1711 template (value) RSL_Message ts_RSL_BS_PWR_CTRL(template (value) RslChannelNr chan_nr,
1712 template (value) RSL_IE_BS_Power bs_power) := {
1713 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1714 msg_type := RSL_MT_BS_POWER_CONTROL,
1715 ies := {
1716 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1717 t_RSL_IE(RSL_IE_BS_POWER, RSL_IE_Body:{bs_power := bs_power})
1718 /* One optional IE: BS POWER PARAMETERS */
1719 }
1720 }
Vadim Yanitskiy2a5a1ef2021-06-30 00:51:48 +02001721 template RSL_Message tr_RSL_BS_PWR_CTRL(template (present) RslChannelNr chan_nr,
1722 template (present) RSL_IE_BS_Power bs_power) := {
1723 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1724 msg_type := RSL_MT_BS_POWER_CONTROL,
1725 ies := {
1726 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1727 tr_RSL_IE(RSL_IE_Body:{bs_power := bs_power})
1728 /* One optional IE: BS POWER PARAMETERS */
1729 }
1730 }
Eric Wildae8f2622019-06-18 17:05:11 +02001731
Harald Welte4a267362017-12-09 17:49:32 +01001732 /* 8.4.19 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001733 template (value) RSL_Message ts_RSL_RF_CHAN_REL_ACK(template (value) RslChannelNr chan_nr) :=
Harald Welte4a267362017-12-09 17:49:32 +01001734 ts_RSL_MsgDiscType(ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1735 RSL_MT_RF_CHAN_REL_ACK,
Harald Welte735dd072017-12-12 14:55:17 +01001736 { t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}) });
Harald Welte4a267362017-12-09 17:49:32 +01001737
Harald Welte9abd1282018-02-19 19:18:17 +01001738 template RSL_Message tr_RSL_RF_CHAN_REL_ACK(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001739 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001740 msg_type := RSL_MT_RF_CHAN_REL_ACK,
1741 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001742 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
Harald Welte9abd1282018-02-19 19:18:17 +01001743 }
1744 }
1745
Harald Welteea17b912018-03-11 22:29:31 +01001746 /* 8.6.20 BTS <- BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001747 template (value) RSL_Message ts_RSL_SACCH_INF_MOD(template (value) RslChannelNr chan_nr,
1748 RSL_IE_SysinfoType si_type,
1749 octetstring l3_info) := {
Harald Welteea17b912018-03-11 22:29:31 +01001750 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1751 msg_type := RSL_MT_SACCH_INFO_MODIFY,
1752 ies := {
1753 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1754 t_RSL_IE(RSL_IE_SYSINFO_TYPE, RSL_IE_Body:{sysinfo_type := si_type}),
1755 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
1756 }
1757 }
1758
Neels Hofmeyr378a49c2018-06-15 22:18:43 +02001759 /* 8.4.7 BTS -> BSC */
1760 template (value) RSL_Message ts_RSL_HANDO_DET(template (value) RslChannelNr chan_nr) := {
1761 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1762 msg_type := RSL_MT_HANDO_DET,
1763 ies := {
1764 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1765 }
1766 }
Vadim Yanitskiy7c2c10c2019-05-31 20:42:01 +07001767 template RSL_Message tr_RSL_HANDO_DET(template RslChannelNr chan_nr,
1768 template uint8_t acc_delay := ?) := {
1769 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1770 msg_type := RSL_MT_HANDO_DET,
1771 ies := {
1772 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1773 tr_RSL_IE(RSL_IE_Body:{access_delay := acc_delay})
1774 }
1775 }
Neels Hofmeyr378a49c2018-06-15 22:18:43 +02001776
Harald Welteea17b912018-03-11 22:29:31 +01001777
Harald Welte643e2a62017-11-27 15:03:18 +01001778 /* COMMON CHANNEL MANAGEMENT MESSAGES */
1779
Harald Welte874c2232018-02-24 04:52:43 +01001780 /* 8.5.1 BTS <- BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001781 template (value) RSL_Message ts_RSL_BCCH_INFO(RSL_IE_SysinfoType si_type,
1782 octetstring full_bcch_info) := {
Harald Welte874c2232018-02-24 04:52:43 +01001783 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1784 msg_type := RSL_MT_BCCH_INFO,
1785 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001786 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_BCCH(0)}),
Harald Welte874c2232018-02-24 04:52:43 +01001787 t_RSL_IE(RSL_IE_SYSINFO_TYPE, RSL_IE_Body:{sysinfo_type := si_type}),
1788 t_RSL_IE(RSL_IE_FULL_BCCH_INFO, RSL_IE_Body:{other := ts_RSL_LV(full_bcch_info)})
1789 }
1790 }
Harald Welte09538f82019-08-01 09:50:25 +02001791 template RSL_Message tr_RSL_NO_BCCH_INFO(template RSL_IE_SysinfoType si_type := ?) := {
1792 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1793 msg_type := RSL_MT_BCCH_INFO,
1794 ies := {
1795 tr_RSL_IE(RSL_IE_Body:{chan_nr := ts_RslChanNr_BCCH(0)}),
1796 tr_RSL_IE(RSL_IE_Body:{sysinfo_type := si_type})
1797 }
1798 }
1799 template RSL_Message tr_RSL_BCCH_INFO(template RSL_IE_SysinfoType si_type := ?,
1800 template octetstring full_bcch_info := ?) := {
1801 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1802 msg_type := RSL_MT_BCCH_INFO,
1803 ies := {
1804 tr_RSL_IE(RSL_IE_Body:{chan_nr := ts_RslChanNr_BCCH(0)}),
1805 tr_RSL_IE(RSL_IE_Body:{sysinfo_type := si_type}),
1806 tr_RSL_IE(RSL_IE_Body:{other := tr_RSL_LV(full_bcch_info)}),
1807 *
1808 }
1809 }
Harald Welte874c2232018-02-24 04:52:43 +01001810
Harald Welte7ae93142017-12-07 17:56:15 +01001811 /* 8.5.2 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001812 template (value) RSL_Message ts_RSL_RACH_LOAD_IND(uint16_t slot_ct, uint16_t busy_ct,
1813 uint16_t acc_ct) := {
Harald Welte7ae93142017-12-07 17:56:15 +01001814 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1815 msg_type := RSL_MT_CCCH_LOAD_IND,
1816 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001817 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_RACH(0)}),
Harald Welte735dd072017-12-12 14:55:17 +01001818 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 +01001819 }
1820 }
Harald Welte68e495b2018-02-25 00:05:57 +01001821 template RSL_Message tr_RSL_RACH_LOAD_IND(template uint16_t slot_ct := ?,
1822 template uint16_t busy_ct := ?,
Harald Welte09538f82019-08-01 09:50:25 +02001823 template uint16_t acc_ct := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001824 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Welte68e495b2018-02-25 00:05:57 +01001825 msg_type := RSL_MT_CCCH_LOAD_IND,
1826 ies := {
1827 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_RACH(0)}),
1828 tr_RSL_IE(RSL_IE_Body:{rach_load := tr_RSL_IE_RachLoad(slot_ct, busy_ct, acc_ct)})
1829 }
1830 }
1831
Harald Welteefa7d912018-04-18 23:22:15 +02001832 template (value) RSL_Message ts_RSL_PAGING_LOAD_IND(uint16_t buffer_space) := {
Harald Welte7ae93142017-12-07 17:56:15 +01001833 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1834 msg_type := RSL_MT_CCCH_LOAD_IND,
1835 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001836 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_PCH_AGCH(0)}),
Harald Welte735dd072017-12-12 14:55:17 +01001837 t_RSL_IE(RSL_IE_PAGING_LOAD, RSL_IE_Body:{paging_load := buffer_space})
Harald Welte7ae93142017-12-07 17:56:15 +01001838 }
1839 }
Harald Welte68e495b2018-02-25 00:05:57 +01001840 template RSL_Message tr_RSL_PAGING_LOAD_IND(template uint16_t buffer_space := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001841 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Welte68e495b2018-02-25 00:05:57 +01001842 msg_type := RSL_MT_CCCH_LOAD_IND,
1843 ies := {
1844 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(0)}),
1845 tr_RSL_IE(RSL_IE_Body:{paging_load := buffer_space})
1846 }
1847 }
1848
Harald Welte7ae93142017-12-07 17:56:15 +01001849
Harald Welte643e2a62017-11-27 15:03:18 +01001850 /* 8.5.3 BTS -> BSC */
Vadim Yanitskiyab448a52019-05-31 20:24:03 +07001851 template (value) RSL_Message ts_RSL_CHAN_RQD(OCT1 ra, GsmFrameNumber fn,
1852 template (value) RslChannelNr chan_nr := ts_RslChanNr_RACH(0),
1853 uint8_t acc_del := 0) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001854 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1855 msg_type := RSL_MT_CHAN_RQD,
1856 ies := {
Vadim Yanitskiyab448a52019-05-31 20:24:03 +07001857 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1858 /* TODO: we may need to have optional RSL_IE_LINK_IDENT IE here */
Harald Welte735dd072017-12-12 14:55:17 +01001859 t_RSL_IE(RSL_IE_REQ_REFERENCE, RSL_IE_Body:{req_ref := ts_RSL_IE_ReqRef(ra, fn)}),
1860 t_RSL_IE(RSL_IE_ACCESS_DELAY, RSL_IE_Body:{access_delay := acc_del})
Harald Welte643e2a62017-11-27 15:03:18 +01001861 }
1862 }
Harald Welte9abd1282018-02-19 19:18:17 +01001863 template RSL_Message tr_RSL_CHAN_RQD(template OCT1 ra, template GsmFrameNumber fn := ?,
Vadim Yanitskiyab448a52019-05-31 20:24:03 +07001864 template RslChannelNr chan_nr := ts_RslChanNr_RACH(0),
1865 template uint8_t acc_del := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001866 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001867 msg_type := RSL_MT_CHAN_RQD,
1868 ies := {
Vadim Yanitskiyab448a52019-05-31 20:24:03 +07001869 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1870 /* TODO: we may need to have optional RSL_IE_LINK_IDENT IE here */
Harald Welte9abd1282018-02-19 19:18:17 +01001871 tr_RSL_IE(RSL_IE_Body:{req_ref := tr_RSL_IE_ReqRef(ra, fn)}),
1872 tr_RSL_IE(RSL_IE_Body:{access_delay := acc_del})
1873 }
1874 }
Harald Welte643e2a62017-11-27 15:03:18 +01001875
1876 /* 8.5.4 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001877 template (value) RSL_Message ts_DELETE_IND(template (value) RslChannelNr chan_nr,
1878 octetstring imm_ass) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001879 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1880 msg_type := RSL_MT_DELETE_IND,
1881 ies := {
Harald Welte735dd072017-12-12 14:55:17 +01001882 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1883 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 +01001884 }
1885 }
Harald Weltee8d750e2018-06-10 21:41:35 +02001886 template RSL_Message tr_RSL_DELETE_IND(template octetstring imm_ass := ?, template uint3_t tn) := {
1887 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1888 msg_type := RSL_MT_DELETE_IND,
1889 ies := {
1890 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(tn)}),
1891 tr_RSL_IE(RSL_IE_Body:{full_imm_ass_info := tr_RSL_LV(imm_ass)}),
1892 *
1893 }
1894 }
Harald Welte643e2a62017-11-27 15:03:18 +01001895
Harald Weltec2877752017-12-07 17:54:35 +01001896 /* 8.5.5 BSC -> BTS */
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +07001897 template RSL_Message tr_RSL_PAGING_CMD(template MobileIdentityV mi, template uint3_t tn := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001898 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Weltec2877752017-12-07 17:54:35 +01001899 msg_type := RSL_MT_PAGING_CMD,
1900 ies := {
1901 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(tn)}),
1902 tr_RSL_IE(RSL_IE_Body:{paging_group := ?}),
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +07001903 tr_RSL_IE(RSL_IE_Body:{ms_identity := tr_MI_LV(mi)}),
Harald Weltec2877752017-12-07 17:54:35 +01001904 * /* opt: channel needed, eMLPP prio */
1905 }
1906 }
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +07001907 template (value) RSL_Message ts_RSL_PAGING_CMD(MobileIdentityV mi, uint8_t pg, uint3_t tn := 0) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001908 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1909 msg_type := RSL_MT_PAGING_CMD,
1910 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001911 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_PCH_AGCH(tn)}),
Harald Welte9abd1282018-02-19 19:18:17 +01001912 t_RSL_IE(RSL_IE_PAGING_GROUP, RSL_IE_Body:{paging_group := pg}),
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +07001913 t_RSL_IE(RSL_IE_MS_IDENTITY, RSL_IE_Body:{ms_identity := ts_MI_LV(mi)})
Harald Welte9abd1282018-02-19 19:18:17 +01001914 }
1915 }
Harald Weltec2877752017-12-07 17:54:35 +01001916
1917 /* 8.5.6 BSC -> BTS */
1918 template RSL_Message tr_RSL_IMM_ASSIGN(template uint3_t tn := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001919 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Weltec2877752017-12-07 17:54:35 +01001920 msg_type := RSL_MT_IMMEDIATE_ASSIGN_CMD,
1921 ies := {
1922 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(tn)}),
1923 tr_RSL_IE(RSL_IE_Body:{full_imm_ass_info := ?})
1924 }
1925 }
Harald Welteefa7d912018-04-18 23:22:15 +02001926 template (value) RSL_Message ts_RSL_IMM_ASSIGN(octetstring f_ass_inf, uint3_t tn := 0) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001927 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1928 msg_type := RSL_MT_IMMEDIATE_ASSIGN_CMD,
1929 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001930 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_PCH_AGCH(tn)}),
Harald Welte9abd1282018-02-19 19:18:17 +01001931 t_RSL_IE(RSL_IE_FULL_IMM_ASS_INFO, RSL_IE_Body:{full_imm_ass_info := ts_RSL_LV(f_ass_inf)})
1932 }
1933 }
Harald Weltec2877752017-12-07 17:54:35 +01001934
Harald Weltecc373202018-09-10 10:28:21 +02001935 /* 8.5.8 BTS <- BSC SMS BROADCAST COMMAND */
1936 template RSL_Message tr_RSL_SMSCB_CMD(template RSL_IE_CbCommandType cb_cmd := ?,
1937 template octetstring msg := ?,
1938 template RslChannelNr chan_nr := ?) := {
1939 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1940 msg_type := RSL_MT_SMS_BC_CMD,
1941 ies := {
1942 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1943 tr_RSL_IE(RSL_IE_Body:{cb_cmd_type := cb_cmd}),
1944 tr_RSL_IE(RSL_IE_Body:{smscb_message := tr_RSL_LV(msg)}),
1945 *
1946 }
1947 }
1948 template (value) RSL_Message ts_RSL_SMSCB_CMD(template (value) RSL_IE_CbCommandType cb_cmd,
1949 template (value) octetstring msg,
1950 template (value) RslChannelNr chan_nr :=
1951 ts_RslChanNr_SDCCH4(0, 2)) := {
1952 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1953 msg_type := RSL_MT_SMS_BC_CMD,
1954 ies := {
1955 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1956 t_RSL_IE(RSL_IE_CB_CMD_TYPE, RSL_IE_Body:{cb_cmd_type := cb_cmd}),
1957 t_RSL_IE(RSL_IE_SMSCB_MSG, RSL_IE_Body:{smscb_message := ts_RSL_LV(msg)})
1958 /* optional channel type for extended CBCH */
1959 }
1960 }
1961
Harald Welte4a129f82019-05-21 16:35:22 +02001962 /* 8.5.9 BTS -> BSC CBCH LOAD INDICATION */
1963 template RSL_Message tr_RSL_CBCH_LOAD_IND_BASIC(template boolean overflow := ?,
1964 template uint4_t slot_count := ?,
1965 template RslChannelNr chan_nr := ?) := {
1966 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1967 msg_type := RSL_MT_CBCH_LOAD_IND,
1968 ies := {
1969 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1970 tr_RSL_IE(RSL_IE_Body:{cbch_load_info := tr_CbchLoadInfo(overflow, slot_count)})
1971 }
1972 }
1973 template (value) RSL_Message ts_RSL_CBCH_LOAD_IND_BASIC(boolean overflow, uint4_t slot_count,
1974 template (value) RslChannelNr chan_nr :=
1975 ts_RslChanNr_SDCCH4(0, 2)) := {
1976 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1977 msg_type := RSL_MT_CBCH_LOAD_IND,
1978 ies := {
1979 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1980 t_RSL_IE(RSL_IE_CBCH_LOAD_INFO, RSL_IE_Body:{cbch_load_info := ts_CbchLoadInfo(overflow, slot_count)})
1981 }
1982 }
1983 template RSL_Message tr_RSL_CBCH_LOAD_IND_EXTD(template boolean overflow := ?,
1984 template uint4_t slot_count := ?,
1985 template RslChannelNr chan_nr := ?) := {
1986 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1987 msg_type := RSL_MT_CBCH_LOAD_IND,
1988 ies := {
1989 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1990 tr_RSL_IE(RSL_IE_Body:{cbch_load_info := tr_CbchLoadInfo(overflow, slot_count)}),
1991 tr_RSL_IE(RSL_IE_Body:{smscb_chan_ind := 1})
1992 }
1993 }
1994 template (value) RSL_Message ts_RSL_CBCH_LOAD_IND_EXTD(boolean overflow, uint4_t slot_count,
1995 template (value) RslChannelNr chan_nr :=
1996 ts_RslChanNr_SDCCH4(0, 2)) := {
1997 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1998 msg_type := RSL_MT_CBCH_LOAD_IND,
1999 ies := {
2000 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2001 t_RSL_IE(RSL_IE_CBCH_LOAD_INFO, RSL_IE_Body:{cbch_load_info := ts_CbchLoadInfo(overflow, slot_count)}),
2002 t_RSL_IE(RSL_IE_SMSCB_CHAN_INDICATOR, RSL_IE_Body:{smscb_chan_ind := 1})
2003 }
2004 }
2005
2006
Vadim Yanitskiy9f699532021-06-03 17:29:22 +02002007 /* 8.6.1 BTS -> BSC */
2008 template (value) RSL_Message
2009 ts_RSL_RF_RES_IND(template (value) RSL_ResourceInfo info) := {
2010 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
2011 msg_type := RSL_MT_RF_RES_IND,
2012 ies := {
2013 t_RSL_IE(RSL_IE_RESOURCE_INFO, RSL_IE_Body:{
2014 resource_info := {
2015 len := 0, /* overwritten */
2016 info := info
2017 }
2018 })
2019 }
2020 }
2021 template RSL_Message
2022 tr_RSL_RF_RES_IND(template (present) RSL_ResourceInfo info := ?) := {
2023 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
2024 msg_type := RSL_MT_RF_RES_IND,
2025 ies := {
2026 tr_RSL_IE(RSL_IE_Body:{
2027 resource_info := {
2028 len := ?,
2029 info := info
2030 }
2031 })
2032 }
2033 }
2034
2035
Harald Welte68e495b2018-02-25 00:05:57 +01002036 /* 8.6.2 BTS <- BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02002037 template (value) RSL_Message ts_RSL_SACCH_FILL(RSL_IE_SysinfoType si_type, octetstring l3_info) := {
Harald Welte68e495b2018-02-25 00:05:57 +01002038 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
2039 msg_type := RSL_MT_SACCH_FILL,
2040 ies := {
2041 t_RSL_IE(RSL_IE_SYSINFO_TYPE, RSL_IE_Body:{sysinfo_type := si_type}),
2042 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
2043 }
2044 }
Harald Welte09538f82019-08-01 09:50:25 +02002045 template RSL_Message tr_RSL_NO_SACCH_FILL(template RSL_IE_SysinfoType si_type := ?) := {
2046 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
2047 msg_type := RSL_MT_SACCH_FILL,
2048 ies := {
2049 tr_RSL_IE(RSL_IE_Body:{sysinfo_type := si_type})
2050 }
2051 }
2052 template RSL_Message tr_RSL_SACCH_FILL(template RSL_IE_SysinfoType si_type := ?,
2053 template octetstring l3_info := ?) := {
2054 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
2055 msg_type := RSL_MT_SACCH_FILL,
2056 ies := {
2057 tr_RSL_IE(RSL_IE_Body:{sysinfo_type := si_type}),
2058 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)}),
2059 *
2060 }
2061 }
2062
Harald Welte68e495b2018-02-25 00:05:57 +01002063
Harald Welte643e2a62017-11-27 15:03:18 +01002064 /* 8.6.4 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02002065 template (value) RSL_Message ts_RSL_ERROR_REPORT(RSL_Cause cause) := {
Harald Welte01d982c2018-02-25 01:31:40 +01002066 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
2067 msg_type := RSL_MT_ERROR_REPORT,
Harald Welte643e2a62017-11-27 15:03:18 +01002068 ies := {
Harald Welte735dd072017-12-12 14:55:17 +01002069 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
Harald Welte643e2a62017-11-27 15:03:18 +01002070 }
2071 }
Harald Welte01d982c2018-02-25 01:31:40 +01002072 template RSL_Message tr_RSL_ERROR_REPORT(template RSL_Cause cause := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002073 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
Harald Welte01d982c2018-02-25 01:31:40 +01002074 msg_type := RSL_MT_ERROR_REPORT,
2075 ies := {
2076 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)}),
2077 *
2078 }
2079 }
2080
Harald Welte643e2a62017-11-27 15:03:18 +01002081
Harald Welte9958a4d2017-12-14 21:21:33 +01002082
2083 /* Abis/IP specific messages */
2084
2085 template RSL_Message tr_RSL_IPA_CRCX(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002086 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002087 msg_type := RSL_MT_IPAC_CRCX,
2088 ies := {
2089 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2090 *
2091 }
2092 }
Vadim Yanitskiye9141c22021-07-03 01:45:40 +02002093 template (value) RSL_Message
2094 ts_RSL_IPA_CRCX(template (value) RslChannelNr chan_nr,
Vadim Yanitskiyfc631642021-07-03 02:42:45 +02002095 template (value) OCT4 remote_ip := '7F000001'O,
Vadim Yanitskiye9141c22021-07-03 01:45:40 +02002096 template (value) uint16_t remote_port := 6766) := {
Harald Welte9abd1282018-02-19 19:18:17 +01002097 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2098 msg_type := RSL_MT_IPAC_CRCX,
2099 ies := {
Vadim Yanitskiye9141c22021-07-03 01:45:40 +02002100 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2101 t_RSL_IE(RSL_IE_IPAC_REMOTE_IP, RSL_IE_Body:{ipa_remote_ip := remote_ip}),
2102 t_RSL_IE(RSL_IE_IPAC_REMOTE_PORT, RSL_IE_Body:{ipa_remote_port := remote_port})
Harald Welte9abd1282018-02-19 19:18:17 +01002103 }
2104 }
2105
Harald Welte9958a4d2017-12-14 21:21:33 +01002106
Harald Welteefa7d912018-04-18 23:22:15 +02002107 template (value) RSL_Message ts_RSL_IPA_CRCX_ACK(template (value) RslChannelNr chan_nr,
Vadim Yanitskiyfc631642021-07-03 02:42:45 +02002108 uint16_t ipa_conn_id, OCT4 local_ip,
Harald Welteefa7d912018-04-18 23:22:15 +02002109 uint16_t local_port, uint7_t rtp_pt2) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002110 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2111 msg_type := RSL_MT_IPAC_CRCX_ACK,
2112 ies := {
2113 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2114 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2115 t_RSL_IE(RSL_IE_IPAC_LOCAL_IP, RSL_IE_Body:{ipa_local_ip := local_ip}),
2116 t_RSL_IE(RSL_IE_IPAC_LOCAL_PORT, RSL_IE_Body:{ipa_local_port := local_port}),
2117 t_RSL_IE(RSL_IE_IPAC_RTP_PAYLOAD2, RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
2118 }
2119 }
Harald Welte9abd1282018-02-19 19:18:17 +01002120 template RSL_Message tr_RSL_IPA_CRCX_ACK(template RslChannelNr chan_nr,
2121 template uint16_t ipa_conn_id,
Vadim Yanitskiyfc631642021-07-03 02:42:45 +02002122 template OCT4 local_ip,
Harald Welte8bd0f822018-02-25 12:43:28 +01002123 template uint16_t local_port) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002124 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9abd1282018-02-19 19:18:17 +01002125 msg_type := RSL_MT_IPAC_CRCX_ACK,
2126 ies := {
2127 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2128 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2129 tr_RSL_IE(RSL_IE_Body:{ipa_local_ip := local_ip}),
Harald Welte8bd0f822018-02-25 12:43:28 +01002130 tr_RSL_IE(RSL_IE_Body:{ipa_local_port := local_port})
2131 /* Optional: RTP Payload Type 2 IE */
Harald Welte9abd1282018-02-19 19:18:17 +01002132 }
2133 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002134
Harald Welteefa7d912018-04-18 23:22:15 +02002135 template (value) RSL_Message ts_RSL_IPA_CRCX_NACK(template (value) RslChannelNr chan_nr,
2136 RSL_Cause cause) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002137 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2138 msg_type := RSL_MT_IPAC_CRCX_NACK,
2139 ies := {
2140 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2141 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2142 }
2143 }
Harald Welte9abd1282018-02-19 19:18:17 +01002144 template RSL_Message tr_RSL_IPA_CRCX_NACK(template RslChannelNr chan_nr,
2145 template RSL_Cause cause := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002146 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9abd1282018-02-19 19:18:17 +01002147 msg_type := RSL_MT_IPAC_CRCX_NACK,
2148 ies := {
2149 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2150 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
2151 }
2152 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002153
Harald Welteefa7d912018-04-18 23:22:15 +02002154 template (value) RSL_Message ts_RSL_IPA_MDCX(template (value) RslChannelNr chan_nr,
2155 uint16_t ipa_conn_id,
Vadim Yanitskiyfc631642021-07-03 02:42:45 +02002156 OCT4 remote_ip, uint16_t remote_port,
Harald Welteefa7d912018-04-18 23:22:15 +02002157 uint7_t rtp_pt2) := {
Harald Welte30527452018-02-25 12:46:25 +01002158 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2159 msg_type := RSL_MT_IPAC_MDCX,
2160 ies := {
2161 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2162 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2163 t_RSL_IE(RSL_IE_IPAC_REMOTE_IP, RSL_IE_Body:{ipa_remote_ip := remote_ip}),
2164 t_RSL_IE(RSL_IE_IPAC_REMOTE_PORT, RSL_IE_Body:{ipa_remote_port := remote_port}),
2165 /* optional: RTP Payload Type */
2166 t_RSL_IE(RSL_IE_IPAC_RTP_PAYLOAD2, RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
2167 }
2168 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002169 template RSL_Message tr_RSL_IPA_MDCX(template RslChannelNr chan_nr,
2170 template uint16_t ipa_conn_id) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002171 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002172 msg_type := RSL_MT_IPAC_MDCX,
2173 ies := {
2174 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2175 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2176 *
2177 }
2178 }
2179
Harald Welteefa7d912018-04-18 23:22:15 +02002180 template (value) RSL_Message ts_RSL_IPA_MDCX_ACK(template (value) RslChannelNr chan_nr,
2181 uint16_t ipa_conn_id,
Vadim Yanitskiyfc631642021-07-03 02:42:45 +02002182 OCT4 local_ip, uint16_t local_port,
Harald Welteefa7d912018-04-18 23:22:15 +02002183 uint7_t rtp_pt2) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002184 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte71b5ec82017-12-16 23:01:10 +01002185 msg_type := RSL_MT_IPAC_MDCX_ACK,
Harald Welte9958a4d2017-12-14 21:21:33 +01002186 ies := {
2187 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2188 /* optional */
2189 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
Harald Welte6cb400a2018-02-25 12:45:25 +01002190 t_RSL_IE(RSL_IE_IPAC_LOCAL_IP, RSL_IE_Body:{ipa_local_ip := local_ip}),
2191 t_RSL_IE(RSL_IE_IPAC_LOCAL_PORT, RSL_IE_Body:{ipa_local_port := local_port}),
Harald Welte9958a4d2017-12-14 21:21:33 +01002192 /* optional: RTP Payload Type */
2193 t_RSL_IE(RSL_IE_IPAC_RTP_PAYLOAD2, RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
2194 }
2195 }
Harald Welte30527452018-02-25 12:46:25 +01002196 template RSL_Message tr_RSL_IPA_MDCX_ACK(template RslChannelNr chan_nr,
2197 template uint16_t ipa_conn_id,
Vadim Yanitskiyfc631642021-07-03 02:42:45 +02002198 template OCT4 local_ip,
Harald Welte30527452018-02-25 12:46:25 +01002199 template uint16_t local_port,
2200 template uint7_t rtp_pt2) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002201 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte30527452018-02-25 12:46:25 +01002202 msg_type := RSL_MT_IPAC_MDCX_ACK,
2203 ies := {
2204 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2205 /* optional */
2206 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2207 tr_RSL_IE(RSL_IE_Body:{ipa_local_ip := local_ip}),
2208 tr_RSL_IE(RSL_IE_Body:{ipa_local_port := local_port}),
2209 /* optional: RTP Payload Type */
2210 tr_RSL_IE(RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
2211 }
2212 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002213
Harald Welteefa7d912018-04-18 23:22:15 +02002214 template (value) RSL_Message ts_RSL_IPA_MDCX_NACK(template (value) RslChannelNr chan_nr,
2215 RSL_Cause cause,
2216 template (value) uint16_t ipa_conn_id) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002217 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2218 msg_type := RSL_MT_IPAC_MDCX_NACK,
2219 ies := {
2220 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2221 /* optional connection ID */
2222 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2223 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2224 }
2225 }
Harald Welte30527452018-02-25 12:46:25 +01002226 template RSL_Message tr_RSL_IPA_MDCX_NACK(template RslChannelNr chan_nr,
2227 template RSL_Cause cause,
2228 template uint16_t ipa_conn_id) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002229 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte30527452018-02-25 12:46:25 +01002230 msg_type := RSL_MT_IPAC_MDCX_NACK,
2231 ies := {
2232 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2233 /* optional connection ID */
2234 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2235 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
2236 }
2237 }
2238
Harald Welte9958a4d2017-12-14 21:21:33 +01002239
Harald Welteefa7d912018-04-18 23:22:15 +02002240 template (value) RSL_Message ts_RSL_IPA_DLCX_IND(template (value) RslChannelNr chan_nr,
2241 uint16_t ipa_conn_id,
2242 template (value) RSL_IE_IPA_ConnectionStats stats,
2243 RSL_Cause cause) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002244 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2245 msg_type := RSL_MT_IPAC_DLCX_IND,
2246 ies := {
2247 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2248 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2249 t_RSL_IE(RSL_IE_IPAC_CONN_STAT, RSL_IE_Body:{ipa_stats := stats}),
2250 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2251 }
2252 }
2253
Harald Welteefa7d912018-04-18 23:22:15 +02002254 template (value) RSL_Message ts_RSL_IPA_DLCX(template (value) RslChannelNr chan_nr,
2255 uint16_t ipa_conn_id) := {
Harald Weltea871a382018-02-25 02:03:14 +01002256 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2257 msg_type := RSL_MT_IPAC_DLCX,
2258 ies := {
Harald Welte2a7e7162018-02-25 12:46:48 +01002259 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2260 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id})
Harald Weltea871a382018-02-25 02:03:14 +01002261 }
2262 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002263 template RSL_Message tr_RSL_IPA_DLCX(template RslChannelNr chan_nr,
2264 template uint16_t ipa_conn_id := omit) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002265 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002266 msg_type := RSL_MT_IPAC_DLCX,
2267 ies := {
2268 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2269 /* FIXME: optional conn_id */
2270 *
2271 }
2272 }
2273
Harald Welteefa7d912018-04-18 23:22:15 +02002274 template (value) RSL_Message ts_RSL_IPA_DLCX_ACK(template (value) RslChannelNr chan_nr,
2275 uint16_t ipa_conn_id,
2276 RSL_IE_IPA_ConnectionStats stats) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002277 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2278 msg_type := RSL_MT_IPAC_DLCX_ACK,
2279 ies := {
2280 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2281 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2282 t_RSL_IE(RSL_IE_IPAC_CONN_STAT, RSL_IE_Body:{ipa_stats := stats})
2283 }
2284 }
Harald Weltea871a382018-02-25 02:03:14 +01002285 template RSL_Message tr_RSL_IPA_DLCX_ACK(template RslChannelNr chan_nr,
2286 template uint16_t ipa_conn_id,
2287 template RSL_IE_IPA_ConnectionStats stats) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002288 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Weltea871a382018-02-25 02:03:14 +01002289 msg_type := RSL_MT_IPAC_DLCX_ACK,
2290 ies := {
2291 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2292 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2293 tr_RSL_IE(RSL_IE_Body:{ipa_stats := stats})
2294 }
2295 }
2296
2297
Harald Welte9958a4d2017-12-14 21:21:33 +01002298
Harald Welteefa7d912018-04-18 23:22:15 +02002299 template (value) RSL_Message ts_RSL_IPA_DLCX_NACK(template (value) RslChannelNr chan_nr,
2300 RSL_Cause cause, uint16_t ipa_conn_id) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002301 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2302 msg_type := RSL_MT_IPAC_DLCX_NACK,
2303 ies := {
2304 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2305 /* optional connection ID */
2306 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2307 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2308 }
2309 }
Harald Weltea871a382018-02-25 02:03:14 +01002310 template RSL_Message tr_RSL_IPA_DLCX_NACK(template RslChannelNr chan_nr,
2311 template RSL_Cause cause) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002312 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Weltea871a382018-02-25 02:03:14 +01002313 msg_type := RSL_MT_IPAC_DLCX_NACK,
2314 ies := {
2315 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2316 /* optional connection ID */
2317 *,
2318 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
2319 }
2320 }
2321
Harald Welte9958a4d2017-12-14 21:21:33 +01002322
Harald Welteefa7d912018-04-18 23:22:15 +02002323 template (value) RSL_Message ts_RSL_IPA_PDCH_ACT(RslChannelNr chan_nr) := {
Harald Welteee19c732018-04-05 09:08:26 +02002324 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2325 msg_type := RSL_MT_IPAC_PDCH_ACT,
2326 ies := {
2327 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
2328 }
2329 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002330 template RSL_Message tr_RSL_IPA_PDCH_ACT(template RslChannelNr chan_nr) := {
Harald Welteee19c732018-04-05 09:08:26 +02002331 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002332 msg_type := RSL_MT_IPAC_PDCH_ACT,
2333 ies := {
2334 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
2335 }
2336 }
2337
Harald Welteee19c732018-04-05 09:08:26 +02002338
Harald Welte94e0c342018-04-07 11:33:23 +02002339 template RSL_Message ts_RSL_IPA_PDCH_ACT_ACK(RslChannelNr chan_nr,
2340 template (value) RSL_IE_FrameNumber fn) := {
Harald Welteee19c732018-04-05 09:08:26 +02002341 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002342 msg_type := RSL_MT_IPAC_PDCH_ACT_ACK,
2343 ies := {
2344 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2345 t_RSL_IE(RSL_IE_FRAME_NUMBER, RSL_IE_Body:{frame_nr := fn})
2346 }
2347 }
Harald Welteee19c732018-04-05 09:08:26 +02002348 template RSL_Message tr_RSL_IPA_PDCH_ACT_ACK(template RslChannelNr chan_nr,
2349 template RSL_IE_FrameNumber fn) := {
2350 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2351 msg_type := RSL_MT_IPAC_PDCH_ACT_ACK,
2352 ies := {
2353 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2354 tr_RSL_IE(RSL_IE_Body:{frame_nr := fn})
2355 }
2356 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002357
2358 template RSL_Message ts_RSL_IPA_PDCH_ACT_NACK(RslChannelNr chan_nr, RSL_Cause cause) := {
Harald Welteee19c732018-04-05 09:08:26 +02002359 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002360 msg_type := RSL_MT_IPAC_PDCH_ACT_NACK,
2361 ies := {
2362 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2363 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2364 }
2365 }
Harald Welteee19c732018-04-05 09:08:26 +02002366 template RSL_Message tr_RSL_IPA_PDCH_ACT_NACK(template RslChannelNr chan_nr,
2367 template RSL_Cause cause) := {
2368 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2369 msg_type := RSL_MT_IPAC_PDCH_ACT_NACK,
2370 ies := {
2371 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2372 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
2373 }
2374 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002375
Harald Welteee19c732018-04-05 09:08:26 +02002376 template RSL_Message ts_RSL_IPA_PDCH_DEACT(RslChannelNr chan_nr) := {
2377 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2378 msg_type := RSL_MT_IPAC_PDCH_DEACT,
2379 ies := {
2380 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
2381 }
2382 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002383 template RSL_Message tr_RSL_IPA_PDCH_DEACT(template RslChannelNr chan_nr) := {
Harald Welteee19c732018-04-05 09:08:26 +02002384 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002385 msg_type := RSL_MT_IPAC_PDCH_DEACT,
2386 ies := {
2387 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
2388 }
2389 }
2390
2391 template RSL_Message ts_RSL_IPA_PDCH_DEACT_ACK(RslChannelNr chan_nr) := {
Harald Welteee19c732018-04-05 09:08:26 +02002392 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002393 msg_type := RSL_MT_IPAC_PDCH_DEACT_ACK,
2394 ies := {
2395 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
2396 }
2397 }
Harald Welteee19c732018-04-05 09:08:26 +02002398 template RSL_Message tr_RSL_IPA_PDCH_DEACT_ACK(template RslChannelNr chan_nr) := {
2399 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2400 msg_type := RSL_MT_IPAC_PDCH_DEACT_ACK,
2401 ies := {
2402 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
2403 }
2404 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002405
2406 template RSL_Message ts_RSL_IPA_PDCH_DEACT_NACK(RslChannelNr chan_nr, RSL_Cause cause) := {
Harald Welteee19c732018-04-05 09:08:26 +02002407 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002408 msg_type := RSL_MT_IPAC_PDCH_DEACT_NACK,
2409 ies := {
2410 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2411 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2412 }
2413 }
Harald Welteee19c732018-04-05 09:08:26 +02002414 template RSL_Message tr_RSL_IPA_PDCH_DEACT_NACK(template RslChannelNr chan_nr,
2415 template RSL_Cause cause) := {
2416 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2417 msg_type := RSL_MT_IPAC_PDCH_DEACT_NACK,
2418 ies := {
2419 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2420 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
2421 }
2422 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002423
Harald Welte908ce542019-09-04 23:05:40 +02002424 template (value) RSL_Message ts_RSL_OSMO_ETWS_CMD(template (value) octetstring msg,
2425 template (value) RslChannelNr chan_nr := ts_RslChanNr_PCH_AGCH(0)) := {
2426 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2427 msg_type := RSL_MT_OSMO_ETWS_CMD,
2428 ies := {
2429 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2430 t_RSL_IE(RSL_IE_SMSCB_MSG, RSL_IE_Body:{smscb_message := ts_RSL_LV(msg)})
2431 }
2432 }
2433 template RSL_Message tr_RSL_OSMO_ETWS_CMD(template RslChannelNr chan_nr := ?,
2434 template octetstring msg := ?) := {
2435 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2436 msg_type := RSL_MT_OSMO_ETWS_CMD,
2437 ies := {
2438 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2439 tr_RSL_IE(RSL_IE_Body:{smscb_message := tr_RSL_LV(msg)})
2440 }
2441 }
2442
2443
Harald Welte9958a4d2017-12-14 21:21:33 +01002444
Harald Welte6a8199d2018-01-29 21:58:53 +01002445 function f_rsl_find_ie(RSL_Message msg, RSL_IE_Type iei, out RSL_IE_Body ret) return boolean {
2446 for (var integer i := 0; i < sizeof(msg.ies); i := i+1) {
2447 if (msg.ies[i].iei == iei) {
2448 ret := msg.ies[i].body;
2449 return true;
2450 }
2451 }
2452 return false;
2453 }
2454
2455
Harald Welte9958a4d2017-12-14 21:21:33 +01002456
Harald Welte643e2a62017-11-27 15:03:18 +01002457} with { encode "RAW" ; variant "FIELDORDER(msb)" }