blob: 3acd6196101f86ce57c0b2aff2a7b24ecd9933ed [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
Pau Espin Pedrol29c6dfb2022-08-08 18:37:56 +0200223 /* Osmocom extensions */
Vadim Yanitskiy1f532152021-11-01 20:37:56 +0300224 RSL_IE_OSMO_REP_ACCH_CAP ('01100000'B),
Neels Hofmeyr2bef0dd2021-04-22 21:46:00 +0000225 RSL_IE_OSMO_TRAINING_SEQUENCE ('01100001'B),
Vadim Yanitskiya203d3b2021-11-01 21:32:31 +0300226 RSL_IE_OSMO_TOP_ACCH_CAP ('01100010'B),
Pau Espin Pedrol29c6dfb2022-08-08 18:37:56 +0200227 RSL_IE_OSMO_OSMUX_CID ('01100011'B),
Neels Hofmeyr2bef0dd2021-04-22 21:46:00 +0000228
Harald Welte643e2a62017-11-27 15:03:18 +0100229 /* ip.access */
230 RSL_IE_IPAC_SRTP_CONFIG ('11100000'B),
Harald Welte319be822017-12-07 17:50:26 +0100231 RSL_IE_IPAC_PROXY_UDP ('11100001'B),
232 RSL_IE_IPAC_BSCMPL_TOUT ('11100010'B),
Harald Welte643e2a62017-11-27 15:03:18 +0100233
234 RSL_IE_IPAC_REMOTE_IP ('11110000'B),
Harald Welte319be822017-12-07 17:50:26 +0100235 RSL_IE_IPAC_REMOTE_PORT ('11110001'B),
236 RSL_IE_IPAC_RTP_PAYLOAD ('11110010'B),
237 RSL_IE_IPAC_LOCAL_PORT ('11110011'B),
238 RSL_IE_IPAC_SPEECH_MODE ('11110100'B),
239 RSL_IE_IPAC_LOCAL_IP ('11110101'B),
240 RSL_IE_IPAC_CONN_STAT ('11110110'B),
241 RSL_IE_IPAC_HO_C_PARMS ('11110111'B),
242 RSL_IE_IPAC_CONN_ID ('11111000'B),
243 RSL_IE_IPAC_RTP_CSD_FMT ('11111001'B),
244 RSL_IE_IPAC_RTP_JIT_BUF ('11111010'B),
245 RSL_IE_IPAC_RTP_COMPR ('11111011'B),
246 RSL_IE_IPAC_RTP_PAYLOAD2 ('11111100'B),
247 RSL_IE_IPAC_RTP_MPLEX ('11111101'B),
248 RSL_IE_IPAC_RTP_MPLEX_ID ('11111110'B)
Harald Welte643e2a62017-11-27 15:03:18 +0100249 } with { variant "FIELDLENGTH(8)" };
250
251 type record RSL_LV {
252 uint8_t len,
253 octetstring payload
254 } with { variant (len) "LENGTHTO(payload)" }
255
Harald Welteefa7d912018-04-18 23:22:15 +0200256 template (value) RSL_LV ts_RSL_LV(template (value) octetstring pl) := {
Harald Welte643e2a62017-11-27 15:03:18 +0100257 len := 0,
258 payload := pl
259 }
260
Harald Welte51d74102017-12-10 23:05:02 +0100261 template RSL_LV tr_RSL_LV(template octetstring pl) := {
262 len := ?,
263 payload := pl
264 }
265
Harald Welte15bb5b52017-12-07 17:52:04 +0100266 type record RSL_L16V {
267 uint16_t len,
268 octetstring payload
269 } with { variant (len) "LENGTHTO(payload)" }
270
Harald Welteefa7d912018-04-18 23:22:15 +0200271 template (value) RSL_L16V ts_RSL_L16V(template (value) octetstring pl) := {
Harald Welte15bb5b52017-12-07 17:52:04 +0100272 len := 0,
273 payload := pl
274 }
275
Harald Welte7794d5b2017-12-16 23:00:20 +0100276 template RSL_L16V tr_RSL_L16V(template octetstring pl) := {
277 len := ?,
278 payload := pl
279 }
280
Harald Welte643e2a62017-11-27 15:03:18 +0100281 type record RSL_IE_V {
282 uint8_t val
283 }
284
285 /* 9.3.3 */
286 type record RSL_IE_ActivationType {
287 boolean reactivation,
288 uint4_t reserved,
Harald Welte921f9e02019-05-19 22:27:11 +0200289 RSL_ActivationAbits a_bits
290 };
291 type enumerated RSL_ActivationAbits {
292 ACT_REL_TO_IMM_ASSIGN ('000'B),
293 ACT_REL_TO_NORM_ASSIGN ('001'B),
294 ACT_REL_TO_ASYNC_HANDOVER ('010'B),
295 ACT_REL_TO_SYNC_HANDOVER ('011'B),
296 ACT_REL_TO_ADDL_ASSIGN ('100'B),
297 ACT_REL_TO_MSLOT_CONFIG ('101'B),
298 ACT_REL_TO_OSMO_PDCH ('111'B)
299 } with { variant "FIELDLENGTH(3)" };
Harald Welte643e2a62017-11-27 15:03:18 +0100300
Harald Welte921f9e02019-05-19 22:27:11 +0200301 const RSL_IE_ActivationType t_RSL_IE_ActType_IA := {
Harald Welte643e2a62017-11-27 15:03:18 +0100302 reactivation := false,
303 reserved := 0,
Harald Welte921f9e02019-05-19 22:27:11 +0200304 a_bits := ACT_REL_TO_IMM_ASSIGN
305 }
306 const RSL_IE_ActivationType t_RSL_IE_ActType_ASS := {
307 reactivation := false,
308 reserved := 0,
309 a_bits := ACT_REL_TO_NORM_ASSIGN
310 }
311 const RSL_IE_ActivationType t_RSL_IE_ActType_HO_ASYNC := {
312 reactivation := false,
313 reserved := 0,
314 a_bits := ACT_REL_TO_ASYNC_HANDOVER
315 }
316 const RSL_IE_ActivationType t_RSL_IE_ActType_HO_SYNC := {
317 reactivation := false,
318 reserved := 0,
319 a_bits := ACT_REL_TO_SYNC_HANDOVER
Harald Welte643e2a62017-11-27 15:03:18 +0100320 }
321
Harald Welte94e0c342018-04-07 11:33:23 +0200322 /* osmocom-style dynamic PDCH */
Vadim Yanitskiy58b16532021-10-09 20:27:39 +0600323 const RSL_IE_ActivationType c_RSL_IE_ActType_PDCH := {
Harald Welte94e0c342018-04-07 11:33:23 +0200324 reactivation := false,
325 reserved := 1,
Harald Welte921f9e02019-05-19 22:27:11 +0200326 a_bits := ACT_REL_TO_OSMO_PDCH
Harald Welte94e0c342018-04-07 11:33:23 +0200327 }
328
Vadim Yanitskiye02dbcc2020-08-25 04:20:51 +0700329 /* 9.3.5 */
330 type record RSL_IE_ChannelIdent {
331 uint8_t len,
332 /* 3GPP TS 44.018 Channel Description IE (TV) */
333 ChannelDescriptionTV ch_desc,
334 /* 3GPP TS 44.018 Mobile Allocation IE (shall be empty) */
335 MobileAllocationTLV ma
336 } with { variant (len) "LENGTHTO(ch_desc,ma)" };
337
338 template (value) RSL_IE_ChannelIdent
339 ts_RSL_ChannelIdent(template (value) ChannelDescription ch_desc) := {
340 len := 0, /* overwritten */
341 ch_desc := {
342 iei := '64'O,
343 v := ch_desc
344 },
345 /* Shall be included but empty */
346 ma := {
347 iei := '72'O,
348 v := {
349 len := 0,
350 ma := ''B
351 }
352 }
353 };
354
355 template RSL_IE_ChannelIdent
356 tr_RSL_ChannelIdent(template (present) ChannelDescription ch_desc := ?,
357 template (present) MobileAllocationLV ma := ?) := {
358 len := ?,
359 ch_desc := {
360 iei := '64'O,
361 v := ch_desc
362 },
363 /* Shall be included but empty */
364 ma := {
365 iei := '72'O,
366 v := ma
367 }
368 };
369
Harald Welte643e2a62017-11-27 15:03:18 +0100370 /* 9.3.6 */
371 type enumerated RSL_SpeechDataInd {
372 RSL_SPDI_SPEECH ('00000001'B),
373 RSL_SPDI_DATA ('00000010'B),
374 RSL_SPDI_SIGN ('00000011'B)
375 } with { variant "FIELDLENGTH(8)" };
376 type enumerated RSL_ChanRateType {
377 RSL_CHRT_SDCCH ('00000001'B),
378 RSL_CHRT_TCH_F ('00001000'B),
379 RSL_CHRT_TCH_H ('00001001'B),
380 RSL_CHRT_TCH_F_BD_MSLOT ('00001010'B),
381 RSL_CHRT_TCH_F_DL_MSLOT ('00011010'B),
382 RSL_CHRT_TCH_F_GROUP ('00011000'B),
383 RSL_CHRT_TCH_H_GROUP ('00011001'B),
384 RSL_CHRT_TCH_F_BCAST ('00101000'B),
Neels Hofmeyr2bef0dd2021-04-22 21:46:00 +0000385 RSL_CHRT_TCH_H_BCAST ('00101001'B),
386 RSL_CHRT_OSMO_TCH_F_VAMOS ('10001000'B),
387 RSL_CHRT_OSMO_TCH_H_VAMOS ('10001001'B)
Harald Welte643e2a62017-11-27 15:03:18 +0100388 } with { variant "FIELDLENGTH(8)" };
389 type enumerated RSL_SpeechAlgo {
390 RSL_CMOD_NO_RESOURCE ('00000000'B),
391 RSL_CMOD_SP_GSM1 ('00000001'B),
392 RSL_CMOD_SP_GSM2 ('00010001'B),
393 RSL_CMOD_SP_GSM3 ('00100001'B),
394 RSL_CMOD_SP_GSM4 ('00110001'B),
395 RSL_CMOD_SP_GSM5 ('00001001'B),
396 RSL_CMOD_SP_GSM6 ('00001101'B)
397 } with { variant "FIELDLENGTH(8)" };
398 type record RSL_IE_ChannelMode {
Harald Welte8f2c21d2017-12-07 17:52:40 +0100399 uint8_t len,
Harald Welte643e2a62017-11-27 15:03:18 +0100400 BIT6 reserved,
401 boolean dtx_d,
402 boolean dtx_u,
403 RSL_SpeechDataInd spd_ind,
404 RSL_ChanRateType ch_rate_type,
405 RSL_SpeechAlgo coding_alg_rate
Harald Welte8f2c21d2017-12-07 17:52:40 +0100406 } with { variant (len) "LENGTHTO(reserved,dtx_d,dtx_u,spd_ind,ch_rate_type,coding_alg_rate)" }
Harald Welte643e2a62017-11-27 15:03:18 +0100407
Vadim Yanitskiy8fc43df2020-10-20 02:11:05 +0700408 template (value) RSL_IE_ChannelMode ts_RSL_ChanMode_SIGN(RSL_ChanRateType t := RSL_CHRT_SDCCH,
409 boolean dtx_downlink := false) := {
Harald Welte8f2c21d2017-12-07 17:52:40 +0100410 len := 0, /* overwritten */
Harald Welte643e2a62017-11-27 15:03:18 +0100411 reserved := '000000'B,
Stefan Sperling4880be42018-08-07 18:12:59 +0200412 dtx_d := dtx_downlink,
Harald Welte643e2a62017-11-27 15:03:18 +0100413 dtx_u := false,
414 spd_ind := RSL_SPDI_SIGN,
Philipp Maierac693462020-10-14 20:21:44 +0200415 ch_rate_type := t,
Harald Welte643e2a62017-11-27 15:03:18 +0100416 coding_alg_rate := RSL_CMOD_NO_RESOURCE
417 }
418
Stefan Sperling4880be42018-08-07 18:12:59 +0200419 template (value) RSL_IE_ChannelMode ts_RSL_ChanMode(RSL_ChanRateType t, RSL_SpeechAlgo alg,
420 boolean dtx_downlink := false) := {
Harald Welte8f2c21d2017-12-07 17:52:40 +0100421 len := 0, /* overwritten */
Harald Welte643e2a62017-11-27 15:03:18 +0100422 reserved := '000000'B,
Stefan Sperling4880be42018-08-07 18:12:59 +0200423 dtx_d := dtx_downlink,
Harald Welte643e2a62017-11-27 15:03:18 +0100424 dtx_u := false,
425 spd_ind := RSL_SPDI_SPEECH,
426 ch_rate_type := t,
427 coding_alg_rate := alg
428 }
Harald Welte3618d9d2018-03-21 18:45:27 +0100429 template RSL_IE_ChannelMode tr_RSL_ChanMode(template RSL_ChanRateType t,
430 template RSL_SpeechAlgo alg) := {
431 len := ?,
432 reserved := '000000'B,
433 dtx_d := ?,
434 dtx_u := ?,
435 spd_ind := RSL_SPDI_SPEECH,
436 ch_rate_type := t,
437 coding_alg_rate := alg
438 }
Harald Welte643e2a62017-11-27 15:03:18 +0100439
Vadim Yanitskiy117c1762020-06-16 01:40:10 +0700440 /* 9.3.4 BS Power IE */
Harald Welte643e2a62017-11-27 15:03:18 +0100441 type record RSL_IE_BS_Power {
Vadim Yanitskiy117c1762020-06-16 01:40:10 +0700442 uint2_t reserved,
Harald Welte643e2a62017-11-27 15:03:18 +0100443 boolean epc,
444 boolean fpc,
Vadim Yanitskiy117c1762020-06-16 01:40:10 +0700445 uint4_t power_level
Harald Welte643e2a62017-11-27 15:03:18 +0100446 }
447
Vadim Yanitskiy117c1762020-06-16 01:40:10 +0700448 template (value) RSL_IE_BS_Power ts_RSL_IE_BS_Power(uint4_t power_level,
Eric Wildae8f2622019-06-18 17:05:11 +0200449 boolean epc := false, boolean fpc := false) := {
450 reserved := 0,
451 epc := epc,
452 fpc := fpc,
453 power_level := power_level
454 }
Vadim Yanitskiy2a5a1ef2021-06-30 00:51:48 +0200455 template RSL_IE_BS_Power
456 tr_RSL_IE_BS_Power(template (present) uint4_t power_level,
457 template (present) boolean epc := ?,
458 template (present) boolean fpc := ?) := {
459 reserved := ?,
460 epc := epc,
461 fpc := fpc,
462 power_level := power_level
463 }
Eric Wildae8f2622019-06-18 17:05:11 +0200464
Harald Welte73cd2712017-12-17 00:44:52 +0100465 /* 9.3.7 */
Harald Weltee613f962018-04-18 22:38:16 +0200466 type enumerated RSL_AlgId {
467 RSL_ALG_ID_A5_0 ('00000001'B),
468 RSL_ALG_ID_A5_1 ('00000010'B),
469 RSL_ALG_ID_A5_2 ('00000011'B),
470 RSL_ALG_ID_A5_3 ('00000100'B),
471 RSL_ALG_ID_A5_4 ('00000101'B),
472 RSL_ALG_ID_A5_5 ('00000110'B),
473 RSL_ALG_ID_A5_6 ('00000111'B),
474 RSL_ALG_ID_A5_7 ('00001000'B)
475 } with { variant "FIELDLENGTH(8)" };
Harald Welte73cd2712017-12-17 00:44:52 +0100476 type record RSL_IE_EncryptionInfo {
477 uint8_t len,
Harald Weltee613f962018-04-18 22:38:16 +0200478 RSL_AlgId alg_id,
Harald Welte73cd2712017-12-17 00:44:52 +0100479 octetstring key
480 } with { variant (len) "LENGTHTO(alg_id,key)" };
481
Harald Weltee613f962018-04-18 22:38:16 +0200482 template RSL_IE_EncryptionInfo tr_RSL_IE_EncrInfo(template RSL_AlgId alg,
483 template octetstring key) := {
Harald Welte73cd2712017-12-17 00:44:52 +0100484 len := ?,
485 alg_id := alg,
486 key := key
487 }
Harald Weltee613f962018-04-18 22:38:16 +0200488 template (value) RSL_IE_EncryptionInfo ts_RSL_IE_EncrInfo(template (value) RSL_AlgId alg,
489 octetstring key) := {
Harald Welteefa7d912018-04-18 23:22:15 +0200490 len := 0, /* overwritten */
491 alg_id := alg,
492 key := key
493 }
494
495
Harald Welte73cd2712017-12-17 00:44:52 +0100496
Harald Welte643e2a62017-11-27 15:03:18 +0100497 /* 9.3.8 */
498 type record RSL_IE_FrameNumber {
499 uint5_t t1_p,
500 uint6_t t3,
501 uint5_t t2
502 }
503 type RSL_IE_FrameNumber RSL_IE_StartingTime;
504
505 /* 9.3.10 */
506 type record RSL_IE_L1Info {
507 uint5_t ms_power_lvl,
508 boolean fpc,
509 uint2_t reserved,
510 uint8_t actual_ta
511 }
512
Neels Hofmeyrafe2ea52021-11-24 15:16:12 +0100513 template (value) RSL_IE_L1Info ts_RSL_IE_L1Info := {
514 ms_power_lvl := 0,
515 fpc := false,
516 reserved := 0,
517 actual_ta := 0
518 };
519
Harald Welte643e2a62017-11-27 15:03:18 +0100520 /* 9.3.13 */
521 type record RSL_IE_MS_Power {
522 uint2_t reserved,
523 boolean fpc_epc,
524 uint5_t power_level
525 }
Pau Espin Pedrolf7630a62019-10-28 15:07:08 +0100526 template RSL_IE_MS_Power tr_RSL_IE_MS_Power(template uint5_t power_level := ?,
527 template boolean fpc_epc := false) := {
528 reserved := 0,
529 fpc_epc := fpc_epc,
530 power_level := power_level
531 }
Harald Welte10280172019-05-19 22:28:04 +0200532 template (value) RSL_IE_MS_Power ts_RSL_IE_MS_Power(uint5_t power_level,
533 boolean fpc_epc := false) := {
534 reserved := 0,
535 fpc_epc := fpc_epc,
536 power_level := power_level
537 }
Harald Welte643e2a62017-11-27 15:03:18 +0100538
Harald Welted5f521e2017-12-07 17:53:06 +0100539 /* 9.3.18 */
540 type record RSL_IE_RachLoad {
541 uint8_t len,
542 uint16_t slot_count,
543 uint16_t busy_count,
544 uint16_t access_count
545 } with { variant (len) "LENGTHTO(slot_count,busy_count,access_count)" }
546
Harald Welteefa7d912018-04-18 23:22:15 +0200547 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 +0100548 len := 0, /* overwritten */
549 slot_count := slot,
550 busy_count := busy,
551 access_count := acc
552 }
553
Harald Welte68e495b2018-02-25 00:05:57 +0100554 template RSL_IE_RachLoad tr_RSL_IE_RachLoad(template uint16_t slot,
555 template uint16_t busy,
556 template uint16_t acc) := {
557 len := ?, /* overwritten */
558 slot_count := slot,
559 busy_count := busy,
560 access_count := acc
561 }
562
Harald Welte643e2a62017-11-27 15:03:18 +0100563 /* 9.3.19 */
564 type record RSL_IE_RequestRef {
565 OCT1 ra,
566 RSL_IE_FrameNumber frame_nr
567 }
568
569 /* 3GPP TS 44.018 / 10.5.2.38 Starting Time */
Harald Welte94e0c342018-04-07 11:33:23 +0200570 template (value) RSL_IE_FrameNumber ts_RSL_IE_FrameNumber(GsmFrameNumber fn) := {
Harald Welte643e2a62017-11-27 15:03:18 +0100571 t1_p := (fn / 1326) mod 32,
572 t3 := fn mod 51,
573 t2 := fn mod 26
574 }
575
Harald Welte9abd1282018-02-19 19:18:17 +0100576 function tr_RSL_IE_FrameNumber(template GsmFrameNumber fn) return template RSL_IE_FrameNumber {
577 if (istemplatekind(fn, "?")) {
578 return ?;
579 } else {
580 return ts_RSL_IE_FrameNumber(valueof(fn));
581 }
582 }
583
Harald Welteefa7d912018-04-18 23:22:15 +0200584 template (value) RSL_IE_RequestRef ts_RSL_IE_ReqRef(OCT1 ra, GsmFrameNumber frame_nr) := {
Harald Welte643e2a62017-11-27 15:03:18 +0100585 ra := ra,
586 frame_nr := ts_RSL_IE_FrameNumber(frame_nr)
587 }
588
Harald Welte9abd1282018-02-19 19:18:17 +0100589 template RSL_IE_RequestRef tr_RSL_IE_ReqRef(template OCT1 ra, template GsmFrameNumber frame_nr) := {
590 ra := ra,
591 frame_nr := tr_RSL_IE_FrameNumber(frame_nr)
592 }
593
Vadim Yanitskiy9f699532021-06-03 17:29:22 +0200594 /* 9.3.21 Resource Information */
595 type record RSL_IE_ResourceInfo {
596 uint8_t len,
597 RSL_ResourceInfo info
598 } with { variant (len) "LENGTHTO(info)" };
599
600 type record of RSL_ResourceInfoItem RSL_ResourceInfo;
601 type record RSL_ResourceInfoItem {
602 RslChannelNr chan_nr,
603 uint3_t interf_band,
604 BIT5 rfu ('00000'B)
605 };
606
607 template (value) RSL_ResourceInfoItem
608 ts_RSL_ResourceInfoItem(template (value) RslChannelNr chan_nr,
609 template (value) uint3_t interf_band := 0) := {
610 chan_nr := chan_nr,
611 interf_band := interf_band,
612 rfu := '00000'B
613 }
614 template RSL_ResourceInfoItem
615 tr_RSL_ResourceInfoItem(template (present) RslChannelNr chan_nr := ?,
616 template (present) uint3_t interf_band := ?) := {
617 chan_nr := chan_nr,
618 interf_band := interf_band,
619 rfu := ? /* Tolerate unknown values */
620 }
621
Harald Welte15de8ba2018-06-29 08:51:42 +0200622 /* Osmocom Extension */
623 type record RSL_IE_UplinkMeasSuppMeasInfo {
624 int16_t toa256_mean,
625 int16_t toa256_min,
626 int16_t toa256_max,
627 uint16_t toa256_std_dev
628 };
629
Harald Welte2691adf2018-02-22 17:32:39 +0100630 /* 9.3.25 */
631 type record RSL_IE_UplinkMeas {
632 uint8_t len,
633 BIT1 rfu,
634 boolean dtx_d,
635 uint6_t rxlev_f_u,
636 BIT2 reserved1,
637 uint6_t rxlev_s_u,
638 BIT2 reserved2,
639 uint3_t rxq_f_u,
640 uint3_t rxq_s_u,
Harald Welte15de8ba2018-06-29 08:51:42 +0200641 RSL_IE_UplinkMeasSuppMeasInfo supp_meas_info optional
Harald Welte2691adf2018-02-22 17:32:39 +0100642 } 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 +0100643
Neels Hofmeyrafe2ea52021-11-24 15:16:12 +0100644 template (value) RSL_IE_UplinkMeas ts_RSL_IE_UplinkMeas(uint6_t rxlev := 12, uint3_t rxqual := 0) := {
645 len := 0, /* overwritten */
646 rfu := '0'B,
647 dtx_d := false,
648 rxlev_f_u := rxlev,
649 reserved1 := '00'B,
650 rxlev_s_u := rxlev,
651 reserved2 := '00'B,
652 rxq_f_u := rxqual,
653 rxq_s_u := rxqual,
654 supp_meas_info := omit
655 };
656
Harald Welte643e2a62017-11-27 15:03:18 +0100657 /* 9.3.26 */
Harald Weltea8ed9062017-12-14 09:46:01 +0100658 type enumerated RSL_Cause {
659 /* normal event */
660 RSL_ERR_RADIO_IF_FAIL ('00'O),
661 RSL_ERR_RADIO_LINK_FAIL ('01'O),
662 RSL_ERR_HANDOVER_ACC_FAIL ('02'O),
663 RSL_ERR_TALKER_ACC_FAIL ('03'O),
664 RSL_ERR_OM_INTERVENTION ('07'O),
665 RSL_ERR_NORMAL_UNSPEC ('0f'O),
666 RSL_ERR_T_MSRFPCI_EXP ('18'O),
667 /* resource unavailable */
668 RSL_ERR_EQUIPMENT_FAIL ('20'O),
669 RSL_ERR_RR_UNAVAIL ('21'O),
670 RSL_ERR_TERR_CH_FAIL ('22'O),
671 RSL_ERR_CCCH_OVERLOAD ('23'O),
672 RSL_ERR_ACCH_OVERLOAD ('24'O),
673 RSL_ERR_PROCESSOR_OVERLOAD ('25'O),
674 RSL_ERR_BTS_NOT_EQUIPPED ('27'O),
675 RSL_ERR_REMOTE_TRAU_FAILURE ('28'O),
676 RSL_ERR_NOTIF_OVERFLOW ('29'O),
677 RSL_ERR_RES_UNAVAIL ('2f'O),
678 /* service or option not available */
679 RSL_ERR_TRANSC_UNAVAIL ('30'O),
680 RSL_ERR_SERV_OPT_UNAVAIL ('3f'O),
681 /* service or option not implemented */
682 RSL_ERR_ENCR_UNIMPL ('40'O),
683 RSL_ERR_SERV_OPT_UNIMPL ('4f'O),
684 /* invalid message */
685 RSL_ERR_RCH_ALR_ACTV_ALLOC ('50'O),
Harald Welte9912eb52018-02-25 13:30:15 +0100686 RSL_ERR_IPA_RCH_NOT_ACTV_ALLOC ('51'O),
687 RSL_ERR_IPA_CONN_INVALID ('52'O),
688 RSL_ERR_IPA_CONN_IN_USE ('53'O),
689 RSL_ERR_IPA_CONN_ALREADY_EXISTS ('54'O),
Harald Weltea8ed9062017-12-14 09:46:01 +0100690 RSL_ERR_INVALID_MESSAGE ('5f'O),
691 /* protocol error */
692 RSL_ERR_MSG_DISCR ('60'O),
693 RSL_ERR_MSG_TYPE ('61'O),
694 RSL_ERR_MSG_SEQ ('62'O),
695 RSL_ERR_IE_ERROR ('63'O),
696 RSL_ERR_MAND_IE_ERROR ('64'O),
697 RSL_ERR_OPT_IE_ERROR ('65'O),
698 RSL_ERR_IE_NONEXIST ('66'O),
699 RSL_ERR_IE_LENGTH ('67'O),
700 RSL_ERR_IE_CONTENT ('68'O),
701 RSL_ERR_PROTO ('6f'O),
702 /* interworking */
703 RSL_ERR_INTERWORKING ('7f'O)
704 };
Harald Welte643e2a62017-11-27 15:03:18 +0100705 type record RSL_IE_Cause {
Harald Welte6efa8e32017-12-09 22:34:06 +0100706 uint8_t len,
Harald Welte643e2a62017-11-27 15:03:18 +0100707 uint1_t e,
708 RSL_Cause cause,
709 octetstring cause_ext optional
Harald Welte6efa8e32017-12-09 22:34:06 +0100710 } with { variant (len) "LENGTHTO(e,cause,cause_ext)" }
Harald Welte643e2a62017-11-27 15:03:18 +0100711
Harald Welteefa7d912018-04-18 23:22:15 +0200712 template (value) RSL_IE_Cause ts_RSL_IE_Cause(RSL_Cause cause) := {
Harald Welte6efa8e32017-12-09 22:34:06 +0100713 len := 0, /* overwritten */
Harald Welte643e2a62017-11-27 15:03:18 +0100714 e := 0,
715 cause := cause,
716 cause_ext := omit
717 }
718
Harald Welte9abd1282018-02-19 19:18:17 +0100719 template RSL_IE_Cause tr_RSL_IE_Cause(template RSL_Cause cause) := {
720 len := ?,
721 e := 0,
722 cause := cause,
723 cause_ext := omit
724 }
725
Harald Weltec8d363c2019-05-19 20:36:48 +0200726 /* 9.3.29 */
727 type record RSL_SacchInfo {
728 uint8_t len,
729 uint8_t num_msgs,
730 RSL_SacchInfoElements elems
731 } with {
732 variant (len) "LENGTHTO(num_msgs,elems)";
733 variant (num_msgs) "LENGTHTO(elems)";
734 variant (num_msgs) "UNIT(elements)"
735 };
736 type record RSL_SacchInfoElement {
737 RSL_IE_SysinfoType si_type,
738 uint8_t len,
739 octetstring msg
740 } with {
741 variant (len) "LENGTHTO(msg)";
742 };
743 type record of RSL_SacchInfoElement RSL_SacchInfoElements;
744 template (value) RSL_SacchInfo ts_RSL_SacchInfo(template (value) RSL_SacchInfoElements elems) := {
745 len := 0, /* overwritten */
746 num_msgs := 0, /* overwritten */
747 elems := elems
748 }
749 template (value) RSL_SacchInfoElement ts_RSL_SacchInfoElem(RSL_IE_SysinfoType tp, octetstring msg) := {
750 si_type := tp,
751 len := lengthof(msg),
752 msg := msg
753 }
754
Eric Wild61edb7e2019-06-03 12:38:31 +0200755 /* 9.3.31 */
756 type record RSL_IE_MS_Power_Parameters {
757 uint8_t len,
758 octetstring params
759 } with {
760 variant (len) "LENGTHTO(params)";
761 };
762 template (value) RSL_IE_MS_Power_Parameters ts_RSL_IE_MS_Power_Parameters(octetstring params) := {
763 len := 0, /* overwritten */
764 params := params
765 }
766
Harald Welte643e2a62017-11-27 15:03:18 +0100767 /* 9.3.40 */
768 type enumerated RSL_ChanNeeded {
769 RSL_CHANNEED_ANY ('00'B),
770 RSL_CHANNEED_SDCCH ('01'B),
771 RSL_CHANNEED_TCH_F ('10'B),
772 RSL_CHANNEED_TCH_ForH ('11'B)
Harald Welte51d74102017-12-10 23:05:02 +0100773 } with { variant "FIELDLENGTH(2)" };
Harald Welte643e2a62017-11-27 15:03:18 +0100774 type record RSL_IE_ChanNeeded {
775 uint6_t reserved,
776 RSL_ChanNeeded chan_needed
777 }
778
Harald Weltecc373202018-09-10 10:28:21 +0200779 /* 9.3.41 CB Command Type */
780 type enumerated RSL_CbCommand {
781 RSL_CB_CMD_NORMAL ('0000'B),
782 RSL_CB_CMD_SCHEDULE ('1000'B),
783 RSL_CB_CMD_DEFAULT ('1110'B),
784 RSL_CB_CMD_NULL ('1111'B)
785 } with { variant "FIELDLENGTH(4)" };
786 type record RSL_IE_CbCommandType {
787 RSL_CbCommand command,
788 boolean default_bcast_null,
789 BIT1 spare,
790 uint2_t last_block
791 };
792 template (value) RSL_IE_CbCommandType ts_RSL_IE_CbCmdType(RSL_CbCommand cmd := RSL_CB_CMD_NORMAL,
793 uint2_t last_block := 1,
794 boolean def_bcast_null := true) := {
795 command := cmd,
796 default_bcast_null := def_bcast_null,
797 spare := '0'B,
798 last_block := last_block
799 }
800
Harald Welte4a129f82019-05-21 16:35:22 +0200801 /* 9.4.43 CBCH Load Information */
802 type record RSL_IE_CbchLoadInfo {
803 boolean overflow,
804 BIT3 spare,
805 uint4_t slot_count
806 };
807 template RSL_IE_CbchLoadInfo tr_CbchLoadInfo(template boolean overflow,
808 template uint4_t slot_count) := {
809 overflow := overflow,
810 spare := ?,
811 slot_count := slot_count
812 }
813 template (value) RSL_IE_CbchLoadInfo ts_CbchLoadInfo(boolean overflow, uint4_t slot_count) := {
814 overflow := overflow,
815 spare := '000'B,
816 slot_count := slot_count
817 }
818
Pau Espin Pedrolf7634dc2022-09-02 17:56:00 +0200819 /* 9.3.52, 3GPP TS 44.018 10.5.2.21aa */
820 type record RSL_IE_MultirateCfg {
821 uint8_t len,
822 uint3_t mr_speech_ver,
823 boolean nscb,
824 boolean icmi,
825 BIT1 spare,
826 uint2_t start_mode,
827 BIT8 amr_codec_modes,
828 octetstring parameters
829 } with {
830 variant (len) "LENGTHTO(mr_speech_ver,nscb,icmi,spare,start_mode,amr_codec_modes,parameters)"
831 };
832 template (value) RSL_IE_MultirateCfg ts_RSL_MultirateCfg(boolean icmi := true, uint2_t start_mode := 0,
833 BIT8 amr_codec_modes := '00000100'B /* 5,90k */) := {
834 len := 2,
835 mr_speech_ver := 1,
836 nscb := false,
837 icmi := icmi,
838 spare := '0'B,
839 start_mode := start_mode,
840 amr_codec_modes := amr_codec_modes,
841 parameters := ''O
842 }
843
Harald Welte643e2a62017-11-27 15:03:18 +0100844 /* 9.3.53 */
845 type record RSL_IE_MultirateCtrl {
846 uint3_t spare,
847 boolean od,
848 boolean pre,
849 uint2_t rae,
850 boolean tfo
851 }
852
853 type enumerated RSL_IE_SysinfoType {
854 RSL_SYSTEM_INFO_8 ('00000000'B),
855 RSL_SYSTEM_INFO_1 ('00000001'B),
856 RSL_SYSTEM_INFO_2 ('00000010'B),
857 RSL_SYSTEM_INFO_3 ('00000011'B),
858 RSL_SYSTEM_INFO_4 ('00000100'B),
859 RSL_SYSTEM_INFO_5 ('00000101'B),
860 RSL_SYSTEM_INFO_6 ('00000110'B),
861 RSL_SYSTEM_INFO_7 ('00000111'B),
862 RSL_SYSTEM_INFO_16 ('00001000'B),
863 RSL_SYSTEM_INFO_17 ('00001001'B),
864 RSL_SYSTEM_INFO_2bis ('00001010'B),
865 RSL_SYSTEM_INFO_2ter ('00001011'B),
866 RSL_SYSTEM_INFO_5bis ('00001101'B),
867 RSL_SYSTEM_INFO_5ter ('00001110'B),
868 RSL_SYSTEM_INFO_10 ('00001111'B),
869 RSL_EXT_MEAS_ORDER ('01000111'B),
870 RSL_MEAS_INFO ('01001000'B),
871 RSL_SYSTEM_INFO_13 ('00101000'B),
872 RSL_ERIC_SYSTEM_INFO_13 ('00001100'B),
873 RSL_SYSTEM_INFO_2quater ('00101001'B),
874 RSL_SYSTEM_INFO_9 ('00101010'B),
875 RSL_SYSTEM_INFO_18 ('00101011'B),
876 RSL_SYSTEM_INFO_19 ('00101100'B),
877 RSL_SYSTEM_INFO_20 ('00101101'B)
878 } with { variant "FIELDLENGTH(8)" }
879
Harald Welte9958a4d2017-12-14 21:21:33 +0100880 type record RSL_IE_IPA_ConnectionStats {
881 uint8_t len,
882 uint32_t tx_packets,
883 uint32_t tx_octets,
884 uint32_t rx_packets,
885 uint32_t rx_octets,
886 uint32_t lost_packets,
887 uint32_t jitter,
888 uint32_t avg_delay
889 } with { variant (len) "LENGTHTO(tx_packets,tx_octets,rx_packets,rx_octets,lost_packets,jitter,avg_delay)" }
890
891 type enumerated RSL_IPA_SpeechMode {
892 RSL_IPA_SPM_SENDRECV ('00'B),
893 RSL_IPA_SPM_RECVONLY ('01'B),
894 RSL_IPA_SPM_SENDONLY ('10'B),
895 RSL_IPA_SPM_RESERVED ('11'B)
896 } with { variant "FIELDLENGTH(2)" }
897
898 type enumerated RSL_IPA_Codec {
899 RSL_IPA_CODEC_FR ('0000'B),
900 RSL_IPA_CODEC_EFR ('0001'B),
901 RSL_IPA_CODEC_AMR_F ('0010'B),
902 RSL_IPA_CODEC_HR ('0011'B),
903 RSL_IPA_CODEC_AMR_H ('0101'B),
904 RSL_IPA_CODEC_RTP_PT ('1111'B)
905 } with { variant "FIELDLENGTH(4)" }
906
907 type record RSL_IE_IPA_SpeechMode {
908 BIT2 reserved,
909 RSL_IPA_SpeechMode mode,
910 RSL_IPA_Codec codec
911 }
912
Harald Welte0472ab42018-03-12 15:02:26 +0100913 /* 9.3.20 */
914 type enumerated RSL_IE_ReleaseMode {
915 RSL_REL_MODE_NORMAL ('00'B),
916 REL_REL_MODE_LOCAL ('01'B)
917 }
918
Neels Hofmeyr2bef0dd2021-04-22 21:46:00 +0000919 type record RSL_IE_OSMO_TrainingSequence {
920 uint8_t len,
921 uint8_t tsc_set,
922 uint8_t tsc
923 } with { variant (len) "LENGTHTO(tsc_set,tsc)" }
924
Vadim Yanitskiy1f532152021-11-01 20:37:56 +0300925 type record RSL_IE_OSMO_RepAcchCap {
926 uint8_t len,
927 BIT1 rfu ('0'B),
928 uint3_t rxqual,
929 boolean ul_sacch,
930 boolean dl_sacch,
931 boolean dl_facch_all,
932 boolean dl_facch_cmd
933 } with { variant (len) "LENGTHTO(rfu,rxqual,ul_sacch,dl_sacch,dl_facch_all,dl_facch_cmd)" }
934
Vadim Yanitskiya203d3b2021-11-01 21:32:31 +0300935 type record RSL_IE_OSMO_TopAcchCap {
936 uint8_t len,
937 boolean sacch_enable,
938 boolean facch_enable,
939 uint3_t rxqual,
940 uint3_t overpower_db
941 } with { variant (len) "LENGTHTO(sacch_enable,facch_enable,rxqual,overpower_db)" }
942
Vadim Yanitskiy66d3c332021-11-06 18:18:13 +0300943 template (value) RSL_IE_OSMO_TopAcchCap
944 ts_RSL_IE_OSMO_TopAcchCap(template (value) uint3_t overpower := 2,
945 template (value) uint3_t rxqual := 4,
946 boolean facch_enable := true,
947 boolean sacch_enable := true) := {
948 len := 0, /* overwritten */
949 sacch_enable := sacch_enable,
950 facch_enable := facch_enable,
951 rxqual := rxqual,
952 overpower_db := overpower
953 };
954 template RSL_IE_OSMO_TopAcchCap
955 tr_RSL_IE_OSMO_TopAcchCap(template (present) uint3_t overpower := ?,
956 template (present) uint3_t rxqual := ?,
957 template (present) boolean facch_enable := ?,
958 template (present) boolean sacch_enable := ?) := {
959 len := ?, /* overwritten */
960 sacch_enable := sacch_enable,
961 facch_enable := facch_enable,
962 rxqual := rxqual,
963 overpower_db := overpower
964 };
965
Pau Espin Pedrol29c6dfb2022-08-08 18:37:56 +0200966 type record RSL_IE_OSMO_Osmux_CID {
967 uint8_t len,
968 uint8_t cid
969 } with { variant (len) "LENGTHTO(cid)" }
970
971 template (present) RSL_IE_OSMO_Osmux_CID
972 tr_RSL_IE_OSMO_Osmux_CID(template (present) uint8_t osmux_cid := ?) := {
973 len := ?, /* overwritten */
974 cid := osmux_cid
975 };
976 template (value) RSL_IE_OSMO_Osmux_CID
977 ts_RSL_IE_OSMO_Osmux_CID(template (value) uint8_t osmux_cid) := {
978 len := 0, /* overwritten */
979 cid := osmux_cid
980 };
981
982
Harald Welte643e2a62017-11-27 15:03:18 +0100983 /* union of all IE bodies */
984 type union RSL_IE_Body {
985 RslChannelNr chan_nr,
986 RslLinkId link_id,
Harald Welte15bb5b52017-12-07 17:52:04 +0100987 RSL_L16V l3_info,
Harald Welte643e2a62017-11-27 15:03:18 +0100988 RSL_LV rlm_cause,
Harald Welte0472ab42018-03-12 15:02:26 +0100989 RSL_IE_ReleaseMode release_mode,
Harald Welte643e2a62017-11-27 15:03:18 +0100990 RSL_IE_ActivationType act_type,
Vadim Yanitskiye02dbcc2020-08-25 04:20:51 +0700991 RSL_IE_ChannelIdent chan_ident,
Harald Welte643e2a62017-11-27 15:03:18 +0100992 RSL_IE_ChannelMode chan_mode,
993 uint8_t handover_ref,
994 RSL_IE_BS_Power bs_power,
Vadim Yanitskiy802508e2020-11-11 07:25:47 +0700995 RSL_LV bs_power_params,
Harald Welte643e2a62017-11-27 15:03:18 +0100996 RSL_IE_MS_Power ms_power,
Eric Wild61edb7e2019-06-03 12:38:31 +0200997 RSL_IE_MS_Power_Parameters ms_power_params,
Harald Welte643e2a62017-11-27 15:03:18 +0100998 uint8_t timing_adv,
Pau Espin Pedrolf7634dc2022-09-02 17:56:00 +0200999 RSL_IE_MultirateCfg multirate_cfg,
Harald Welte643e2a62017-11-27 15:03:18 +01001000 RSL_IE_MultirateCtrl multirate_ctrl,
Harald Weltea6706152019-05-19 20:38:18 +02001001 uint8_t msg_id,
Harald Welte643e2a62017-11-27 15:03:18 +01001002 RSL_IE_FrameNumber frame_nr,
1003 RSL_IE_Cause cause,
1004 uint8_t access_delay,
Harald Welted5f521e2017-12-07 17:53:06 +01001005 RSL_IE_RachLoad rach_load,
Harald Welte643e2a62017-11-27 15:03:18 +01001006 uint8_t meas_res_nr,
Harald Welte2691adf2018-02-22 17:32:39 +01001007 uint8_t ms_timing_offset,
1008 RSL_IE_UplinkMeas uplink_meas,
Harald Welte643e2a62017-11-27 15:03:18 +01001009 RSL_IE_L1Info l1_info,
1010 RSL_IE_SysinfoType sysinfo_type,
1011 uint16_t paging_load,
1012 uint8_t paging_group,
1013 RSL_IE_ChanNeeded chan_needed,
Harald Weltecc373202018-09-10 10:28:21 +02001014 RSL_IE_CbCommandType cb_cmd_type,
1015 RSL_LV smscb_message,
Harald Welte4a129f82019-05-21 16:35:22 +02001016 RSL_IE_CbchLoadInfo cbch_load_info,
Vadim Yanitskiy9f699532021-06-03 17:29:22 +02001017 RSL_IE_ResourceInfo resource_info,
Harald Weltec8d363c2019-05-19 20:36:48 +02001018 RSL_SacchInfo sacch_info,
Harald Weltecc373202018-09-10 10:28:21 +02001019
Harald Welte643e2a62017-11-27 15:03:18 +01001020 RSL_IE_StartingTime starting_time,
Harald Welte73cd2712017-12-17 00:44:52 +01001021 RSL_IE_EncryptionInfo encr_info,
Harald Weltea3ff6702019-05-20 20:03:50 +02001022 uint8_t smscb_chan_ind,
Harald Welte643e2a62017-11-27 15:03:18 +01001023 RSL_IE_RequestRef req_ref,
1024 RSL_LV full_imm_ass_info,
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +07001025 MobileIdentityLV ms_identity,
Harald Welte643e2a62017-11-27 15:03:18 +01001026
Harald Welte9958a4d2017-12-14 21:21:33 +01001027 uint16_t ipa_conn_id,
1028 uint16_t ipa_local_port,
1029 uint16_t ipa_remote_port,
Vadim Yanitskiyfc631642021-07-03 02:42:45 +02001030 OCT4 ipa_local_ip,
1031 OCT4 ipa_remote_ip,
Harald Welte9958a4d2017-12-14 21:21:33 +01001032 uint8_t ipa_rtp_pt,
1033 uint8_t ipa_rtp_pt2,
1034 RSL_IE_IPA_ConnectionStats ipa_stats,
1035 RSL_IE_IPA_SpeechMode ipa_speech_mode,
1036
Neels Hofmeyr2bef0dd2021-04-22 21:46:00 +00001037 RSL_IE_OSMO_TrainingSequence osmo_training_sequence,
Vadim Yanitskiy1f532152021-11-01 20:37:56 +03001038 RSL_IE_OSMO_RepAcchCap rep_acch_cap,
Vadim Yanitskiya203d3b2021-11-01 21:32:31 +03001039 RSL_IE_OSMO_TopAcchCap top_acch_cap,
Pau Espin Pedrol29c6dfb2022-08-08 18:37:56 +02001040 RSL_IE_OSMO_Osmux_CID osmux_cid,
Neels Hofmeyr2bef0dd2021-04-22 21:46:00 +00001041
Harald Welte643e2a62017-11-27 15:03:18 +01001042 RSL_LV other
1043 }
1044
1045 type record RSL_IE {
1046 RSL_IE_Type iei,
1047 RSL_IE_Body body
1048 } with { variant (body) "CROSSTAG(
1049 chan_nr, iei = RSL_IE_CHAN_NR;
1050 link_id, iei = RSL_IE_LINK_IDENT;
1051 l3_info, iei = RSL_IE_L3_INFO;
1052 rlm_cause, iei = RSL_IE_RLM_CAUSE;
1053 release_mode, iei = RSL_IE_RELEASE_MODE;
1054 act_type, iei = RSL_IE_ACT_TYPE;
Vadim Yanitskiye02dbcc2020-08-25 04:20:51 +07001055 chan_ident, iei = RSL_IE_CHAN_IDENT;
Harald Welte643e2a62017-11-27 15:03:18 +01001056 chan_mode, iei = RSL_IE_CHAN_MODE;
1057 handover_ref, iei = RSL_IE_HANDO_REF;
1058 bs_power, iei = RSL_IE_BS_POWER;
Vadim Yanitskiy802508e2020-11-11 07:25:47 +07001059 bs_power_params, iei = RSL_IE_BS_POWER_PARAM;
Harald Welte643e2a62017-11-27 15:03:18 +01001060 ms_power, iei = RSL_IE_MS_POWER;
Eric Wild61edb7e2019-06-03 12:38:31 +02001061 ms_power_params, iei = RSL_IE_MS_POWER_PARAM;
Harald Welte643e2a62017-11-27 15:03:18 +01001062 timing_adv, iei = RSL_IE_TIMING_ADVANCE;
Pau Espin Pedrolf7634dc2022-09-02 17:56:00 +02001063 multirate_cfg, iei = RSL_IE_MR_CONFIG;
Harald Welte643e2a62017-11-27 15:03:18 +01001064 multirate_ctrl, iei = RSL_IE_MR_CONTROL;
Harald Weltea6706152019-05-19 20:38:18 +02001065 msg_id, iei = RSL_IE_MSG_ID;
Harald Welte643e2a62017-11-27 15:03:18 +01001066
1067 frame_nr, iei = RSL_IE_FRAME_NUMBER;
1068 cause, iei = RSL_IE_CAUSE;
1069 access_delay, iei = RSL_IE_ACCESS_DELAY;
Harald Welted5f521e2017-12-07 17:53:06 +01001070 rach_load, iei = RSL_IE_RACH_LOAD;
Harald Welte643e2a62017-11-27 15:03:18 +01001071 meas_res_nr, iei = RSL_IE_MEAS_RES_NR;
Harald Welte2691adf2018-02-22 17:32:39 +01001072 ms_timing_offset, iei = RSL_IE_MS_TIMING_OFFSET;
1073 uplink_meas, iei = RSL_IE_UPLINK_MEAS;
Harald Welte643e2a62017-11-27 15:03:18 +01001074 l1_info, iei = RSL_IE_L1_INFO;
1075 sysinfo_type, iei = RSL_IE_SYSINFO_TYPE;
1076 paging_load, iei = RSL_IE_PAGING_LOAD;
1077 paging_group, iei = RSL_IE_PAGING_GROUP;
1078 chan_needed, iei = RSL_IE_CHAN_NEEDED;
Harald Weltecc373202018-09-10 10:28:21 +02001079 cb_cmd_type, iei = RSL_IE_CB_CMD_TYPE;
1080 smscb_message, iei = RSL_IE_SMSCB_MSG;
Harald Welte4a129f82019-05-21 16:35:22 +02001081 cbch_load_info, iei = RSL_IE_CBCH_LOAD_INFO;
Vadim Yanitskiy9f699532021-06-03 17:29:22 +02001082 resource_info, iei = RSL_IE_RESOURCE_INFO;
Harald Weltec8d363c2019-05-19 20:36:48 +02001083 sacch_info, iei = RSL_IE_SACCH_INFO;
Harald Welte643e2a62017-11-27 15:03:18 +01001084 starting_time, iei = RSL_IE_STARTNG_TIME;
Harald Welte73cd2712017-12-17 00:44:52 +01001085 encr_info, iei = RSL_IE_ENCR_INFO;
Harald Weltea3ff6702019-05-20 20:03:50 +02001086 smscb_chan_ind, iei = RSL_IE_SMSCB_CHAN_INDICATOR;
Harald Welte643e2a62017-11-27 15:03:18 +01001087
1088 req_ref, iei = RSL_IE_REQ_REFERENCE;
Harald Weltefff69302017-12-07 17:53:42 +01001089 full_imm_ass_info, iei = RSL_IE_FULL_IMM_ASS_INFO;
1090 ms_identity, iei = RSL_IE_MS_IDENTITY;
1091 other, iei = RSL_IE_FULL_BCCH_INFO;
Harald Welte643e2a62017-11-27 15:03:18 +01001092
Harald Welte9958a4d2017-12-14 21:21:33 +01001093 ipa_conn_id, iei = RSL_IE_IPAC_CONN_ID;
1094 ipa_remote_ip, iei = RSL_IE_IPAC_REMOTE_IP;
1095 ipa_remote_port, iei = RSL_IE_IPAC_REMOTE_PORT;
1096 ipa_local_ip, iei = RSL_IE_IPAC_LOCAL_IP;
1097 ipa_local_port, iei = RSL_IE_IPAC_LOCAL_PORT;
1098 ipa_rtp_pt, iei = RSL_IE_IPAC_RTP_PAYLOAD;
1099 ipa_rtp_pt2, iei = RSL_IE_IPAC_RTP_PAYLOAD2;
1100 ipa_stats, iei = RSL_IE_IPAC_CONN_STAT;
1101 ipa_speech_mode, iei = RSL_IE_IPAC_SPEECH_MODE;
1102
Neels Hofmeyr2bef0dd2021-04-22 21:46:00 +00001103 osmo_training_sequence, iei = RSL_IE_OSMO_TRAINING_SEQUENCE;
Vadim Yanitskiy1f532152021-11-01 20:37:56 +03001104 rep_acch_cap, iei = RSL_IE_OSMO_REP_ACCH_CAP;
Vadim Yanitskiya203d3b2021-11-01 21:32:31 +03001105 top_acch_cap, iei = RSL_IE_OSMO_TOP_ACCH_CAP;
Pau Espin Pedrol29c6dfb2022-08-08 18:37:56 +02001106 osmux_cid, iei = RSL_IE_OSMO_OSMUX_CID;
Neels Hofmeyr2bef0dd2021-04-22 21:46:00 +00001107
Harald Welte643e2a62017-11-27 15:03:18 +01001108 other, OTHERWISE;
1109 )" };
1110
Harald Welte735dd072017-12-12 14:55:17 +01001111 /* For some reason the TTCN-3 RAW codec cannot automatically figure out the IEI
1112 * that it needs to set for a given union-choice (body). So we have to explicitly
1113 * specify the IEI by the caller :( */
Harald Welteefa7d912018-04-18 23:22:15 +02001114 template (value) RSL_IE t_RSL_IE(RSL_IE_Type iei, template (value) RSL_IE_Body body) := {
Harald Welte735dd072017-12-12 14:55:17 +01001115 iei := iei,
Harald Welte643e2a62017-11-27 15:03:18 +01001116 body := body
1117 }
1118
Harald Weltec2877752017-12-07 17:54:35 +01001119 template RSL_IE tr_RSL_IE(template RSL_IE_Body body) := {
1120 iei := ?, /* overwritten? */
1121 body := body
1122 }
1123
1124
Harald Welte643e2a62017-11-27 15:03:18 +01001125 type record of RSL_IE RSL_IE_List;
1126
1127 type record RSL_Message {
1128 RSL_MessageDiscriminator msg_disc,
1129 RSL_MessageType msg_type,
1130 RSL_IE_List ies optional
1131 }
1132
1133 external function enc_RSL_Message(in RSL_Message msg) return octetstring
1134 with { extension "prototype(convert) encode(RAW)" };
1135 external function dec_RSL_Message(in octetstring stream) return RSL_Message
1136 with { extension "prototype(convert) decode(RAW)" };
1137
Harald Weltebc330be2017-12-09 00:56:36 +01001138 template RSL_Message tr_RSL_MsgDiscType(template RSL_MessageDiscriminator m_disc,
Harald Welte643e2a62017-11-27 15:03:18 +01001139 RSL_MessageType m_type) := {
1140 msg_disc := m_disc,
1141 msg_type := m_type,
1142 ies := *
1143 }
1144
Harald Welteefa7d912018-04-18 23:22:15 +02001145 template (value) RSL_Message ts_RSL_MsgDiscType(template (value) RSL_MessageDiscriminator m_disc,
1146 template (value) RSL_MessageType msg_type,
1147 template (omit) RSL_IE_List ies := omit) := {
Harald Welte4a267362017-12-09 17:49:32 +01001148 msg_disc := m_disc,
1149 msg_type := msg_type,
1150 ies := ies
1151 }
1152
Harald Weltebc330be2017-12-09 00:56:36 +01001153template RSL_Message tr_RSL_MsgType(template RSL_MessageType msg_type) := {
1154 msg_disc := ?,
1155 msg_type := msg_type,
1156 ies := *
1157}
1158
1159/* Common Channel Management */
1160template RSL_Message tr_RSL_MsgTypeC(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
1161 msg_disc := { RSL_MDISC_CCHAN, ? }
1162}
1163
1164/* RLL */
1165template RSL_Message tr_RSL_MsgTypeR(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
1166 msg_disc := { RSL_MDISC_RLL, true }
1167}
1168
1169/* Dedicated Channel Management */
1170template RSL_Message tr_RSL_MsgTypeD(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
1171 msg_disc := { RSL_MDISC_DCHAN, ? }
1172}
1173
Vadim Yanitskiybf2aa492022-06-01 00:28:38 +06001174/* TRX Management */
Harald Weltebc330be2017-12-09 00:56:36 +01001175template RSL_Message tr_RSL_MsgTypeT(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
1176 msg_disc := { RSL_MDISC_TRX_MGMT, ? }
1177}
1178
1179
1180/* dedicated channel or RLL */
1181template RSL_Message tr_RSL_MsgTypeDR(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
Harald Weltee5408222018-01-29 21:57:58 +01001182 msg_disc := ({RSL_MDISC_DCHAN,?}, {RSL_MDISC_RLL,?}, {RSL_MDISC_IPACCESS,false})
Harald Weltebc330be2017-12-09 00:56:36 +01001183}
1184
1185
Harald Welte643e2a62017-11-27 15:03:18 +01001186 /* 8.3.1 BSC -> BTS */
Harald Welteefa7d912018-04-18 23:22:15 +02001187 template (value) RSL_Message ts_RSL_DATA_REQ(template (value) RslChannelNr chan_nr,
1188 template (value) RslLinkId link_id,
1189 octetstring l3_info) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001190 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, true),
1191 msg_type := RSL_MT_DATA_REQ,
1192 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001193 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1194 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
1195 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
Harald Welte643e2a62017-11-27 15:03:18 +01001196 }
1197 }
1198
Harald Welte7794d5b2017-12-16 23:00:20 +01001199 template RSL_Message tr_RSL_DATA_REQ(template RslChannelNr chan_nr :=?,
1200 template RslLinkId link_id := ?,
1201 template octetstring l3_info := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001202 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, true),
Harald Welte7794d5b2017-12-16 23:00:20 +01001203 msg_type := RSL_MT_DATA_REQ,
1204 ies :={
1205 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1206 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
1207 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
1208 }
1209 }
1210
1211
Harald Welte643e2a62017-11-27 15:03:18 +01001212 /* 8.3.2 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001213 template (value) RSL_Message ts_RSL_DATA_IND(template (value) RslChannelNr chan_nr,
1214 template (value) RslLinkId link_id,
1215 octetstring l3_info) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001216 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, true),
1217 msg_type := RSL_MT_DATA_IND,
1218 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001219 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1220 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
1221 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
Harald Welte643e2a62017-11-27 15:03:18 +01001222 }
1223 }
Harald Welte9abd1282018-02-19 19:18:17 +01001224 template RSL_Message tr_RSL_DATA_IND(template RslChannelNr chan_nr, template RslLinkId link_id,
1225 template octetstring l3_info := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001226 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, true),
Harald Welte9abd1282018-02-19 19:18:17 +01001227 msg_type := RSL_MT_DATA_IND,
1228 ies :={
1229 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1230 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
1231 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
1232 }
1233 }
Harald Welte643e2a62017-11-27 15:03:18 +01001234
1235 /* 8.3.3 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001236 template (value) RSL_Message ts_RSL_ERROR_IND(template (value) RslChannelNr chan_nr,
Harald Weltea7d81f12019-06-02 22:33:19 +02001237 template (value) RslLinkId link_id,
1238 template (value) octetstring rlm_cause) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001239 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1240 msg_type := RSL_MT_ERROR_IND,
1241 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001242 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1243 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
Harald Weltea7d81f12019-06-02 22:33:19 +02001244 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{rlm_cause := ts_RSL_LV(rlm_cause)})
Harald Welte643e2a62017-11-27 15:03:18 +01001245 }
1246 }
Harald Welte9abd1282018-02-19 19:18:17 +01001247 template RSL_Message tr_RSL_ERROR_IND(template RslChannelNr chan_nr, template RslLinkId link_id,
Harald Weltea7d81f12019-06-02 22:33:19 +02001248 template octetstring rlm_cause := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001249 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001250 msg_type := RSL_MT_ERROR_IND,
1251 ies :={
1252 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1253 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
Harald Weltea7d81f12019-06-02 22:33:19 +02001254 tr_RSL_IE(RSL_IE_Body:{rlm_cause := tr_RSL_LV(rlm_cause)})
Harald Welte9abd1282018-02-19 19:18:17 +01001255 }
1256 }
Harald Welte643e2a62017-11-27 15:03:18 +01001257
Harald Welteefa7d912018-04-18 23:22:15 +02001258 /* 8.3.4 BTS <- BSC */
1259 template (value) RSL_Message ts_RSL_EST_REQ(template (value) RslChannelNr chan_nr,
1260 template (value) RslLinkId link_id) := {
1261 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1262 msg_type := RSL_MT_EST_REQ,
1263 ies := {
1264 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1265 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
1266 }
1267 }
1268 template RSL_Message tr_RSL_EST_REQ(template RslChannelNr chan_nr, template RslLinkId link_id) := {
1269 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
1270 msg_type := RSL_MT_EST_REQ,
1271 ies := {
1272 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1273 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1274 }
1275 }
1276
1277 /* 8.3.5 BTS -> BSC */
1278 template (value) RSL_Message ts_RSL_EST_CONF(template (value) RslChannelNr chan_nr,
1279 template (value) RslLinkId link_id) := {
1280 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1281 msg_type := RSL_MT_EST_CONF,
1282 ies := {
1283 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1284 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
1285 }
1286 }
1287 template RSL_Message tr_RSL_EST_CONF(template RslChannelNr chan_nr, template RslLinkId link_id) := {
1288 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
1289 msg_type := RSL_MT_EST_CONF,
1290 ies := {
1291 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1292 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1293 }
1294 }
1295
Harald Welte643e2a62017-11-27 15:03:18 +01001296 /* 8.3.6 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001297 template (value) RSL_Message ts_RSL_EST_IND(template (value) RslChannelNr chan_nr,
1298 template (value) RslLinkId link_id,
1299 octetstring l3_info) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001300 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1301 msg_type := RSL_MT_EST_IND,
1302 ies := {
Harald Welte735dd072017-12-12 14:55:17 +01001303 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1304 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
1305 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
Harald Welte643e2a62017-11-27 15:03:18 +01001306 }
1307 }
Harald Welte9abd1282018-02-19 19:18:17 +01001308 template RSL_Message tr_RSL_EST_IND(template RslChannelNr chan_nr, template RslLinkId link_id,
1309 template octetstring l3_info := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001310 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001311 msg_type := RSL_MT_EST_IND,
1312 ies := {
1313 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1314 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
1315 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
1316 }
1317 }
Harald Welte0472ab42018-03-12 15:02:26 +01001318 template RSL_Message tr_RSL_EST_IND_NOL3(template RslChannelNr chan_nr, template RslLinkId link_id) :=
1319{
1320 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
1321 msg_type := RSL_MT_EST_IND,
1322 ies := {
1323 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1324 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1325 }
1326 }
1327
Harald Welte643e2a62017-11-27 15:03:18 +01001328
1329 /* 8.3.7 BSC -> BTS */
Harald Welteefa7d912018-04-18 23:22:15 +02001330 template (value) RSL_Message ts_RSL_REL_REQ(template (value) RslChannelNr chan_nr,
Harald Welte0472ab42018-03-12 15:02:26 +01001331 template (value) RslLinkId link_id,
1332 template (value) RSL_IE_ReleaseMode rel_mode := RSL_REL_MODE_NORMAL) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001333 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1334 msg_type := RSL_MT_REL_REQ,
1335 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001336 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
Harald Welte0472ab42018-03-12 15:02:26 +01001337 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
1338 t_RSL_IE(RSL_IE_RELEASE_MODE, RSL_IE_Body:{release_mode := rel_mode})
Harald Welte643e2a62017-11-27 15:03:18 +01001339 }
1340 }
Harald Weltee8a5ab12017-12-09 22:34:57 +01001341 template RSL_Message tr_RSL_REL_REQ(template RslChannelNr chan_nr,
Harald Welte0472ab42018-03-12 15:02:26 +01001342 template RslLinkId link_id,
1343 template RSL_IE_ReleaseMode rel_mode := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001344 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Weltee8a5ab12017-12-09 22:34:57 +01001345 msg_type := RSL_MT_REL_REQ,
1346 ies :={
1347 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1348 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
Harald Welte0472ab42018-03-12 15:02:26 +01001349 tr_RSL_IE(RSL_IE_Body:{release_mode := rel_mode})
Harald Weltee8a5ab12017-12-09 22:34:57 +01001350 }
1351 }
Harald Welte643e2a62017-11-27 15:03:18 +01001352
1353 /* 8.3.8 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001354 template (value) RSL_Message ts_RSL_REL_CONF(template (value) RslChannelNr chan_nr,
1355 template (value) RslLinkId link_id) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001356 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1357 msg_type := RSL_MT_REL_CONF,
1358 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001359 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1360 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
Harald Welte643e2a62017-11-27 15:03:18 +01001361 }
1362 }
Harald Welte9abd1282018-02-19 19:18:17 +01001363 template RSL_Message tr_RSL_REL_CONF(template RslChannelNr chan_nr, template RslLinkId link_id) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001364 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001365 msg_type := RSL_MT_REL_CONF,
1366 ies :={
1367 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1368 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1369 }
1370 }
Harald Welte643e2a62017-11-27 15:03:18 +01001371
1372 /* 8.3.9 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001373 template (value) RSL_Message ts_RSL_REL_IND(template (value) RslChannelNr chan_nr,
1374 template (value) RslLinkId link_id) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001375 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1376 msg_type := RSL_MT_REL_IND,
1377 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001378 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1379 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
Harald Welte643e2a62017-11-27 15:03:18 +01001380 }
1381 }
Harald Welte9abd1282018-02-19 19:18:17 +01001382 template RSL_Message tr_RSL_REL_IND(template RslChannelNr chan_nr, template RslLinkId link_id) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001383 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001384 msg_type := RSL_MT_REL_IND,
1385 ies :={
1386 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1387 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1388 }
1389 }
Harald Welte643e2a62017-11-27 15:03:18 +01001390
1391 /* 8.3.10 BSC -> BTS */
Harald Welteefa7d912018-04-18 23:22:15 +02001392 template (value) RSL_Message ts_RSL_UNITDATA_REQ(template (value) RslChannelNr chan_nr,
1393 template (value) RslLinkId link_id,
1394 octetstring l3_info)
Harald Welte643e2a62017-11-27 15:03:18 +01001395 modifies ts_RSL_DATA_REQ := {
1396 msg_type := RSL_MT_UNIT_DATA_REQ
1397 }
Harald Welte0472ab42018-03-12 15:02:26 +01001398 template RSL_Message tr_RSL_UNITDATA_REQ(template RslChannelNr chan_nr,
1399 template RslLinkId link_id,
Vadim Yanitskiy8f98d3f2018-10-03 17:58:10 +07001400 template octetstring l3_info := ?)
Harald Welte0472ab42018-03-12 15:02:26 +01001401 modifies tr_RSL_DATA_REQ := {
1402 msg_type := RSL_MT_UNIT_DATA_REQ
1403 }
1404
Harald Welte643e2a62017-11-27 15:03:18 +01001405
1406 /* 8.3.11 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001407 template (value) RSL_Message ts_RSL_UNITDATA_IND(template (value) RslChannelNr chan_nr,
1408 template (value) RslLinkId link_id,
1409 octetstring l3_info)
Harald Welte643e2a62017-11-27 15:03:18 +01001410 modifies ts_RSL_DATA_IND := {
1411 msg_type := RSL_MT_UNIT_DATA_IND
1412 }
Harald Welte0472ab42018-03-12 15:02:26 +01001413 template RSL_Message tr_RSL_UNITDATA_IND(template RslChannelNr chan_nr,
Vadim Yanitskiyfabe0f22018-10-03 17:51:47 +07001414 template RslLinkId link_id,
Vadim Yanitskiy8f98d3f2018-10-03 17:58:10 +07001415 template octetstring l3_info := ?)
Harald Welte0472ab42018-03-12 15:02:26 +01001416 modifies tr_RSL_DATA_IND := {
1417 msg_type := RSL_MT_UNIT_DATA_IND
1418 }
1419
1420
Harald Welte643e2a62017-11-27 15:03:18 +01001421
1422
1423 /* DEDICATED CANNEL MANAGEMENT MESSAGES */
1424
1425 /* 8.4.1 BSC -> BTS */
Harald Welteefa7d912018-04-18 23:22:15 +02001426 template (value) RSL_Message ts_RSL_CHAN_ACT(template (value) RslChannelNr chan_nr,
Harald Welte921f9e02019-05-19 22:27:11 +02001427 template (value) RSL_IE_ChannelMode mode,
1428 template (value) RSL_IE_ActivationType at := t_RSL_IE_ActType_IA) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001429 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1430 msg_type := RSL_MT_CHAN_ACTIV,
1431 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001432 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
Harald Welte921f9e02019-05-19 22:27:11 +02001433 t_RSL_IE(RSL_IE_ACT_TYPE, RSL_IE_Body:{act_type := at}),
Harald Welte735dd072017-12-12 14:55:17 +01001434 t_RSL_IE(RSL_IE_CHAN_MODE, RSL_IE_Body:{chan_mode := mode})
Harald Welte643e2a62017-11-27 15:03:18 +01001435 /* lots of optional IEs */
1436 }
1437 }
Harald Welte94e0c342018-04-07 11:33:23 +02001438 template RSL_Message tr_RSL_CHAN_ACT(template RslChannelNr chan_nr,
Harald Welte921f9e02019-05-19 22:27:11 +02001439 template RSL_IE_ChannelMode mode,
1440 template (value) RSL_IE_ActivationType at := t_RSL_IE_ActType_IA) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001441 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte94e0c342018-04-07 11:33:23 +02001442 msg_type := RSL_MT_CHAN_ACTIV,
1443 ies :={
1444 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
Harald Welte921f9e02019-05-19 22:27:11 +02001445 tr_RSL_IE(RSL_IE_Body:{act_type := at}),
Harald Welte94e0c342018-04-07 11:33:23 +02001446 tr_RSL_IE(RSL_IE_Body:{chan_mode := mode}),
1447 /* lots of optional IEs */
1448 *
1449 }
1450 }
Vadim Yanitskiy58b16532021-10-09 20:27:39 +06001451
1452 template (value) RSL_Message
1453 ts_RSL_CHAN_ACT_PDCH(template (value) RslChannelNr chan_nr) := {
1454 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1455 msg_type := RSL_MT_CHAN_ACTIV,
1456 ies :={
1457 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1458 t_RSL_IE(RSL_IE_ACT_TYPE, RSL_IE_Body:{act_type := c_RSL_IE_ActType_PDCH})
1459 }
1460 }
1461 template RSL_Message
1462 tr_RSL_CHAN_ACT_PDCH(template (present) RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001463 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte94e0c342018-04-07 11:33:23 +02001464 msg_type := RSL_MT_CHAN_ACTIV,
1465 ies :={
1466 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
Vadim Yanitskiy58b16532021-10-09 20:27:39 +06001467 tr_RSL_IE(RSL_IE_Body:{act_type := c_RSL_IE_ActType_PDCH}),
Harald Welte94e0c342018-04-07 11:33:23 +02001468 /* lots of optional IEs */
1469 *
1470 }
1471 }
1472
Harald Welte643e2a62017-11-27 15:03:18 +01001473
1474 /* 8.4.2 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001475 template (value) RSL_Message ts_RSL_CHAN_ACT_ACK(template (value) RslChannelNr chan_nr,
1476 GsmFrameNumber fn) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001477 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1478 msg_type := RSL_MT_CHAN_ACTIV_ACK,
1479 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001480 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1481 t_RSL_IE(RSL_IE_FRAME_NUMBER, RSL_IE_Body:{frame_nr := ts_RSL_IE_FrameNumber(fn)})
Harald Welte643e2a62017-11-27 15:03:18 +01001482 }
1483 }
Harald Welte9abd1282018-02-19 19:18:17 +01001484 template RSL_Message tr_RSL_CHAN_ACT_ACK(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001485 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001486 msg_type := RSL_MT_CHAN_ACTIV_ACK,
1487 ies := {
1488 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1489 tr_RSL_IE(RSL_IE_Body:{frame_nr := ?})
1490 }
1491 }
Harald Welte643e2a62017-11-27 15:03:18 +01001492
1493 /* 8.4.3 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001494 template (value) RSL_Message ts_RSL_CHAN_ACT_NACK(template (value) RslChannelNr chan_nr,
1495 RSL_Cause cause) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001496 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1497 msg_type := RSL_MT_CHAN_ACTIV_NACK,
1498 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001499 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1500 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
Harald Welte643e2a62017-11-27 15:03:18 +01001501 }
1502 }
Harald Welte9abd1282018-02-19 19:18:17 +01001503 template RSL_Message tr_RSL_CHAN_ACT_NACK(template RslChannelNr chan_nr,
1504 template RSL_Cause cause := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001505 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001506 msg_type := RSL_MT_CHAN_ACTIV_NACK,
1507 ies := {
1508 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1509 tr_RSL_IE(RSL_IE_Body:{cause := ?})
1510 }
1511 }
Harald Welte643e2a62017-11-27 15:03:18 +01001512
1513 /* 8.4.4 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001514 template (value) RSL_Message ts_RSL_CONN_FAIL_IND(RslChannelNr chan_nr, RSL_Cause cause) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001515 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1516 msg_type := RSL_MT_CONN_FAIL,
1517 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001518 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1519 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
Harald Welte643e2a62017-11-27 15:03:18 +01001520 }
1521 }
Harald Welte9abd1282018-02-19 19:18:17 +01001522 template RSL_Message tr_RSL_CONN_FAIL_IND(template RslChannelNr chan_nr,
1523 template RSL_Cause cause := ?) := {
1524 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1525 msg_type := RSL_MT_CONN_FAIL,
1526 ies :={
1527 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1528 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
1529 }
1530 }
Harald Welte643e2a62017-11-27 15:03:18 +01001531
Harald Weltee8a5ab12017-12-09 22:34:57 +01001532 /* 8.4.5 BSC -> BTS */
1533 template RSL_Message tr_RSL_DEACT_SACCH(template RslChannelNr chan_nr) := {
1534 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1535 msg_type := RSL_MT_DEACTIVATE_SACCH,
1536 ies := {
1537 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
1538 }
1539 }
Harald Welteefa7d912018-04-18 23:22:15 +02001540 template (value) RSL_Message ts_RSL_DEACT_SACCH(template (value) RslChannelNr chan_nr) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001541 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1542 msg_type := RSL_MT_DEACTIVATE_SACCH,
1543 ies := {
1544 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1545 }
1546 }
1547
Harald Weltee8a5ab12017-12-09 22:34:57 +01001548
Harald Welte73cd2712017-12-17 00:44:52 +01001549 /* 8.4.6 BSC ->BTS */
1550 template RSL_Message tr_RSL_ENCR_CMD(template RslChannelNr chan_nr,
1551 template RslLinkId link_id := ?,
Harald Weltee613f962018-04-18 22:38:16 +02001552 template RSL_AlgId alg := ?,
Harald Welte73cd2712017-12-17 00:44:52 +01001553 template octetstring key := ?,
1554 template octetstring l3_info := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001555 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte73cd2712017-12-17 00:44:52 +01001556 msg_type := RSL_MT_ENCR_CMD,
1557 ies := {
1558 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1559 tr_RSL_IE(RSL_IE_Body:{encr_info := tr_RSL_IE_EncrInfo(alg, key)}),
1560 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
1561 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
1562 }
1563 }
Harald Welteefa7d912018-04-18 23:22:15 +02001564 template (value) RSL_Message ts_RSL_ENCR_CMD(template (value) RslChannelNr chan_nr,
1565 template (value) RslLinkId link_id,
Harald Weltee613f962018-04-18 22:38:16 +02001566 template (value) RSL_AlgId alg, octetstring key,
Harald Welteefa7d912018-04-18 23:22:15 +02001567 octetstring l3_info) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001568 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1569 msg_type := RSL_MT_ENCR_CMD,
1570 ies := {
1571 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
Harald Welteefa7d912018-04-18 23:22:15 +02001572 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 +01001573 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
Harald Welteefa7d912018-04-18 23:22:15 +02001574 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
Harald Welte9abd1282018-02-19 19:18:17 +01001575 }
1576 }
Harald Welte73cd2712017-12-17 00:44:52 +01001577
Harald Welte2691adf2018-02-22 17:32:39 +01001578 template RSL_Message tr_RSL_MEAS_RES(template RslChannelNr chan_nr,
1579 template uint8_t meas_res_nr := ?,
1580 template RSL_IE_UplinkMeas ul_meas := ?,
1581 template RSL_IE_BS_Power bs_power := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001582 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte2691adf2018-02-22 17:32:39 +01001583 msg_type := RSL_MT_MEAS_RES,
1584 ies := {
1585 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1586 tr_RSL_IE(RSL_IE_Body:{meas_res_nr := meas_res_nr}),
1587 tr_RSL_IE(RSL_IE_Body:{uplink_meas := ul_meas}),
1588 tr_RSL_IE(RSL_IE_Body:{bs_power := bs_power}),
1589 *
1590 }
1591 }
1592
Vadim Yanitskiy7c29c4e2022-06-18 03:07:50 +07001593 /* Templates for a measurement report that lacks the measurement report
Philipp Maierdd841d32019-12-17 14:44:54 +01001594 * from the MS (l1_info, l3_info and ms timing offset */
Vadim Yanitskiy7c29c4e2022-06-18 03:07:50 +07001595 template (value) RSL_Message
1596 ts_RSL_MEAS_RES_EMPTY(template (value) RslChannelNr chan_nr,
1597 template (value) uint8_t meas_res_nr,
1598 template (value) RSL_IE_UplinkMeas ul_meas,
1599 template (value) RSL_IE_BS_Power bs_power) := {
1600 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1601 msg_type := RSL_MT_MEAS_RES,
1602 ies := {
1603 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1604 t_RSL_IE(RSL_IE_MEAS_RES_NR, RSL_IE_Body:{meas_res_nr := meas_res_nr}),
1605 t_RSL_IE(RSL_IE_UPLINK_MEAS, RSL_IE_Body:{uplink_meas := ul_meas}),
1606 t_RSL_IE(RSL_IE_BS_POWER, RSL_IE_Body:{bs_power := bs_power})
1607 }
1608 }
1609 template RSL_Message
1610 tr_RSL_MEAS_RES_EMPTY(template (present) RslChannelNr chan_nr,
1611 template uint8_t meas_res_nr := ?,
1612 template RSL_IE_UplinkMeas ul_meas := ?,
1613 template RSL_IE_BS_Power bs_power := ?) := {
Philipp Maierdd841d32019-12-17 14:44:54 +01001614 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1615 msg_type := RSL_MT_MEAS_RES,
1616 ies := {
1617 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1618 tr_RSL_IE(RSL_IE_Body:{meas_res_nr := meas_res_nr}),
1619 tr_RSL_IE(RSL_IE_Body:{uplink_meas := ul_meas}),
1620 tr_RSL_IE(RSL_IE_Body:{bs_power := bs_power})
1621 }
1622 }
1623
Harald Welte39b47be2018-02-23 18:58:48 +01001624 /* Osmocom specific template, require lots of optional fields to be present */
1625 template RSL_Message tr_RSL_MEAS_RES_OSMO(template RslChannelNr chan_nr,
1626 template uint8_t meas_res_nr := ?,
1627 template RSL_IE_UplinkMeas ul_meas := ?,
1628 template RSL_IE_BS_Power bs_power := ?,
1629 template RSL_IE_L1Info l1_info := ?,
1630 template octetstring l3_info := ?,
1631 template uint8_t ms_to := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001632 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte39b47be2018-02-23 18:58:48 +01001633 msg_type := RSL_MT_MEAS_RES,
1634 ies := {
1635 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1636 tr_RSL_IE(RSL_IE_Body:{meas_res_nr := meas_res_nr}),
1637 tr_RSL_IE(RSL_IE_Body:{uplink_meas := ul_meas}),
1638 tr_RSL_IE(RSL_IE_Body:{bs_power := bs_power}),
1639 tr_RSL_IE(RSL_IE_Body:{l1_info := l1_info}),
1640 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)}),
1641 tr_RSL_IE(RSL_IE_Body:{ms_timing_offset := ms_to})
1642 }
1643 }
1644
Neels Hofmeyrafe2ea52021-11-24 15:16:12 +01001645 template (value) RSL_Message ts_RSL_MEAS_RES(template (value) RslChannelNr chan_nr,
1646 uint8_t meas_res_nr,
1647 template (value) RSL_IE_UplinkMeas ul_meas,
1648 template (value) RSL_IE_BS_Power bs_power,
1649 template (value) RSL_IE_L1Info l1_info,
1650 octetstring l3_info,
1651 uint8_t ms_to) := {
1652 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1653 msg_type := RSL_MT_MEAS_RES,
1654 ies := {
1655 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1656 t_RSL_IE(RSL_IE_MEAS_RES_NR, RSL_IE_Body:{meas_res_nr := meas_res_nr}),
1657 t_RSL_IE(RSL_IE_UPLINK_MEAS, RSL_IE_Body:{uplink_meas := ul_meas}),
1658 t_RSL_IE(RSL_IE_BS_POWER, RSL_IE_Body:{bs_power := bs_power}),
1659 t_RSL_IE(RSL_IE_L1_INFO, RSL_IE_Body:{l1_info := l1_info}),
1660 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)}),
1661 t_RSL_IE(RSL_IE_MS_TIMING_OFFSET, RSL_IE_Body:{ms_timing_offset := ms_to})
1662 }
1663 }
1664
Eric Wildf1827a72019-05-28 17:37:35 +02001665 /* 8.4.9 BSC -> BTS */
1666 template (value) RSL_Message ts_RSL_MODE_MODIFY_REQ(template (value) RslChannelNr chan_nr,
1667 template (value) RSL_IE_ChannelMode mode) := {
1668 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1669 msg_type := RSL_MT_MODE_MODIFY_REQ,
1670 ies :={
1671 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1672 t_RSL_IE(RSL_IE_CHAN_MODE, RSL_IE_Body:{chan_mode := mode})
1673 /* lots of optional IEs */
1674 }
1675 }
1676 template RSL_Message tr_RSL_MODE_MODIFY_REQ(template RslChannelNr chan_nr,
1677 template RSL_IE_ChannelMode mode) := {
1678 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1679 msg_type := RSL_MT_MODE_MODIFY_REQ,
1680 ies :={
1681 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1682 tr_RSL_IE(RSL_IE_Body:{chan_mode := mode}),
1683 /* lots of optional IEs */
1684 *
1685 }
1686 }
Neels Hofmeyr9f3e6ac2021-04-08 23:09:24 +02001687
1688 template RSL_Message tr_RSL_MODE_MODIFY_REQ_with_OSMO_TSC(template RslChannelNr chan_nr,
1689 template RSL_IE_ChannelMode mode,
1690 template uint8_t tsc_set := ?,
1691 template uint8_t tsc := ?) := {
1692 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1693 msg_type := RSL_MT_MODE_MODIFY_REQ,
1694 ies := {
1695 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1696 tr_RSL_IE(RSL_IE_Body:{chan_mode := mode}),
1697 tr_RSL_IE(RSL_IE_Body:{osmo_training_sequence := {
1698 len := ?,
1699 tsc_set := tsc_set,
1700 tsc := tsc
1701 }
1702 })
1703 }
1704 };
Pau Espin Pedrol85393122022-09-02 17:56:25 +02001705
Harald Welte7794d5b2017-12-16 23:00:20 +01001706 /* 8.4.10 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001707 template (value) RSL_Message ts_RSL_MODE_MODIFY_ACK(template (value) RslChannelNr chan_nr) := {
Harald Welte7794d5b2017-12-16 23:00:20 +01001708 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1709 msg_type := RSL_MT_MODE_MODIFY_ACK,
1710 ies := {
1711 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1712 }
1713 }
Harald Welte9abd1282018-02-19 19:18:17 +01001714 template RSL_Message tr_RSL_MODE_MODIFY_ACK(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001715 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001716 msg_type := RSL_MT_MODE_MODIFY_ACK,
1717 ies := {
1718 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
1719 }
1720 }
Harald Welte7794d5b2017-12-16 23:00:20 +01001721
Harald Welte643e2a62017-11-27 15:03:18 +01001722 /* 8.4.11 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001723 template (value) RSL_Message ts_RSL_MODE_MODIFY_NACK(template (value) RslChannelNr chan_nr,
1724 RSL_Cause cause) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001725 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1726 msg_type := RSL_MT_MODE_MODIFY_NACK,
1727 ies := {
1728 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1729 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
1730 }
Harald Welte643e2a62017-11-27 15:03:18 +01001731 }
Harald Welte9abd1282018-02-19 19:18:17 +01001732 template RSL_Message tr_RSL_MODE_MODIFY_NACK(template RslChannelNr chan_nr,
1733 template RSL_Cause cause) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001734 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001735 msg_type := RSL_MT_MODE_MODIFY_NACK,
1736 ies := {
1737 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1738 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
1739 }
1740 }
1741
Harald Welte643e2a62017-11-27 15:03:18 +01001742
Harald Welte6a8199d2018-01-29 21:58:53 +01001743 /* 8.4.14: BTS <- BSC */
1744 template RSL_Message tr_RSL_RF_CHAN_REL(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001745 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte6a8199d2018-01-29 21:58:53 +01001746 msg_type := RSL_MT_RF_CHAN_REL,
1747 ies := {
1748 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
1749 }
1750 }
Harald Welteefa7d912018-04-18 23:22:15 +02001751 template (value) RSL_Message ts_RSL_RF_CHAN_REL(template (value) RslChannelNr chan_nr) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001752 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1753 msg_type := RSL_MT_RF_CHAN_REL,
1754 ies := {
1755 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1756 }
1757 }
Harald Welte6a8199d2018-01-29 21:58:53 +01001758
Philipp Maier4d1e9c92018-12-20 11:11:56 +01001759 /* 8.4.15: BTS <- BSC */
1760 template (value) RSL_Message ts_RSL_MS_PWR_CTRL(template (value) RslChannelNr chan_nr,
1761 template (value) RSL_IE_MS_Power ms_power) := {
1762 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1763 msg_type := RSL_MT_MS_POWER_CONTROL,
1764 ies := {
1765 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1766 t_RSL_IE(RSL_IE_MS_POWER, RSL_IE_Body:{ms_power := ms_power})
1767 /* One optional IE: MS POWER PARAMETERS */
1768 }
1769 }
1770
Eric Wild61edb7e2019-06-03 12:38:31 +02001771 template (value) RSL_Message ts_RSL_MS_PWR_CTRL_with_pp(template (value) RslChannelNr chan_nr,
1772 integer pwr_level) := {
1773 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1774 msg_type := RSL_MT_MS_POWER_CONTROL,
1775 ies := {
1776 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1777 t_RSL_IE(RSL_IE_MS_POWER, RSL_IE_Body:{ms_power := ts_RSL_IE_MS_Power(pwr_level)}),
1778 t_RSL_IE(RSL_IE_MS_POWER_PARAM, RSL_IE_Body:{ms_power_params :=
1779 ts_RSL_IE_MS_Power_Parameters(''O)})
1780 }
1781 }
1782
Eric Wildae8f2622019-06-18 17:05:11 +02001783 /* 8.4.16: BTS <- BSC */
1784 template (value) RSL_Message ts_RSL_BS_PWR_CTRL(template (value) RslChannelNr chan_nr,
1785 template (value) RSL_IE_BS_Power bs_power) := {
1786 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1787 msg_type := RSL_MT_BS_POWER_CONTROL,
1788 ies := {
1789 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1790 t_RSL_IE(RSL_IE_BS_POWER, RSL_IE_Body:{bs_power := bs_power})
1791 /* One optional IE: BS POWER PARAMETERS */
1792 }
1793 }
Vadim Yanitskiy2a5a1ef2021-06-30 00:51:48 +02001794 template RSL_Message tr_RSL_BS_PWR_CTRL(template (present) RslChannelNr chan_nr,
1795 template (present) RSL_IE_BS_Power bs_power) := {
1796 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1797 msg_type := RSL_MT_BS_POWER_CONTROL,
1798 ies := {
1799 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1800 tr_RSL_IE(RSL_IE_Body:{bs_power := bs_power})
1801 /* One optional IE: BS POWER PARAMETERS */
1802 }
1803 }
Eric Wildae8f2622019-06-18 17:05:11 +02001804
Harald Welte4a267362017-12-09 17:49:32 +01001805 /* 8.4.19 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001806 template (value) RSL_Message ts_RSL_RF_CHAN_REL_ACK(template (value) RslChannelNr chan_nr) :=
Harald Welte4a267362017-12-09 17:49:32 +01001807 ts_RSL_MsgDiscType(ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1808 RSL_MT_RF_CHAN_REL_ACK,
Harald Welte735dd072017-12-12 14:55:17 +01001809 { t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}) });
Harald Welte4a267362017-12-09 17:49:32 +01001810
Harald Welte9abd1282018-02-19 19:18:17 +01001811 template RSL_Message tr_RSL_RF_CHAN_REL_ACK(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001812 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001813 msg_type := RSL_MT_RF_CHAN_REL_ACK,
1814 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001815 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
Harald Welte9abd1282018-02-19 19:18:17 +01001816 }
1817 }
1818
Harald Welteea17b912018-03-11 22:29:31 +01001819 /* 8.6.20 BTS <- BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001820 template (value) RSL_Message ts_RSL_SACCH_INF_MOD(template (value) RslChannelNr chan_nr,
1821 RSL_IE_SysinfoType si_type,
1822 octetstring l3_info) := {
Harald Welteea17b912018-03-11 22:29:31 +01001823 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1824 msg_type := RSL_MT_SACCH_INFO_MODIFY,
1825 ies := {
1826 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1827 t_RSL_IE(RSL_IE_SYSINFO_TYPE, RSL_IE_Body:{sysinfo_type := si_type}),
1828 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
1829 }
1830 }
1831
Neels Hofmeyr378a49c2018-06-15 22:18:43 +02001832 /* 8.4.7 BTS -> BSC */
1833 template (value) RSL_Message ts_RSL_HANDO_DET(template (value) RslChannelNr chan_nr) := {
1834 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1835 msg_type := RSL_MT_HANDO_DET,
1836 ies := {
1837 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1838 }
1839 }
Vadim Yanitskiy7c2c10c2019-05-31 20:42:01 +07001840 template RSL_Message tr_RSL_HANDO_DET(template RslChannelNr chan_nr,
1841 template uint8_t acc_delay := ?) := {
1842 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1843 msg_type := RSL_MT_HANDO_DET,
1844 ies := {
1845 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1846 tr_RSL_IE(RSL_IE_Body:{access_delay := acc_delay})
1847 }
1848 }
Neels Hofmeyr378a49c2018-06-15 22:18:43 +02001849
Harald Welteea17b912018-03-11 22:29:31 +01001850
Harald Welte643e2a62017-11-27 15:03:18 +01001851 /* COMMON CHANNEL MANAGEMENT MESSAGES */
1852
Harald Welte874c2232018-02-24 04:52:43 +01001853 /* 8.5.1 BTS <- BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001854 template (value) RSL_Message ts_RSL_BCCH_INFO(RSL_IE_SysinfoType si_type,
1855 octetstring full_bcch_info) := {
Harald Welte874c2232018-02-24 04:52:43 +01001856 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1857 msg_type := RSL_MT_BCCH_INFO,
1858 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001859 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_BCCH(0)}),
Harald Welte874c2232018-02-24 04:52:43 +01001860 t_RSL_IE(RSL_IE_SYSINFO_TYPE, RSL_IE_Body:{sysinfo_type := si_type}),
1861 t_RSL_IE(RSL_IE_FULL_BCCH_INFO, RSL_IE_Body:{other := ts_RSL_LV(full_bcch_info)})
1862 }
1863 }
Harald Welte09538f82019-08-01 09:50:25 +02001864 template RSL_Message tr_RSL_NO_BCCH_INFO(template RSL_IE_SysinfoType si_type := ?) := {
1865 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1866 msg_type := RSL_MT_BCCH_INFO,
1867 ies := {
1868 tr_RSL_IE(RSL_IE_Body:{chan_nr := ts_RslChanNr_BCCH(0)}),
1869 tr_RSL_IE(RSL_IE_Body:{sysinfo_type := si_type})
1870 }
1871 }
1872 template RSL_Message tr_RSL_BCCH_INFO(template RSL_IE_SysinfoType si_type := ?,
1873 template octetstring full_bcch_info := ?) := {
1874 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1875 msg_type := RSL_MT_BCCH_INFO,
1876 ies := {
1877 tr_RSL_IE(RSL_IE_Body:{chan_nr := ts_RslChanNr_BCCH(0)}),
1878 tr_RSL_IE(RSL_IE_Body:{sysinfo_type := si_type}),
1879 tr_RSL_IE(RSL_IE_Body:{other := tr_RSL_LV(full_bcch_info)}),
1880 *
1881 }
1882 }
Harald Welte874c2232018-02-24 04:52:43 +01001883
Harald Welte7ae93142017-12-07 17:56:15 +01001884 /* 8.5.2 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001885 template (value) RSL_Message ts_RSL_RACH_LOAD_IND(uint16_t slot_ct, uint16_t busy_ct,
1886 uint16_t acc_ct) := {
Harald Welte7ae93142017-12-07 17:56:15 +01001887 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1888 msg_type := RSL_MT_CCCH_LOAD_IND,
1889 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001890 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_RACH(0)}),
Harald Welte735dd072017-12-12 14:55:17 +01001891 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 +01001892 }
1893 }
Harald Welte68e495b2018-02-25 00:05:57 +01001894 template RSL_Message tr_RSL_RACH_LOAD_IND(template uint16_t slot_ct := ?,
1895 template uint16_t busy_ct := ?,
Harald Welte09538f82019-08-01 09:50:25 +02001896 template uint16_t acc_ct := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001897 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Welte68e495b2018-02-25 00:05:57 +01001898 msg_type := RSL_MT_CCCH_LOAD_IND,
1899 ies := {
1900 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_RACH(0)}),
1901 tr_RSL_IE(RSL_IE_Body:{rach_load := tr_RSL_IE_RachLoad(slot_ct, busy_ct, acc_ct)})
1902 }
1903 }
1904
Harald Welteefa7d912018-04-18 23:22:15 +02001905 template (value) RSL_Message ts_RSL_PAGING_LOAD_IND(uint16_t buffer_space) := {
Harald Welte7ae93142017-12-07 17:56:15 +01001906 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1907 msg_type := RSL_MT_CCCH_LOAD_IND,
1908 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001909 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_PCH_AGCH(0)}),
Harald Welte735dd072017-12-12 14:55:17 +01001910 t_RSL_IE(RSL_IE_PAGING_LOAD, RSL_IE_Body:{paging_load := buffer_space})
Harald Welte7ae93142017-12-07 17:56:15 +01001911 }
1912 }
Harald Welte68e495b2018-02-25 00:05:57 +01001913 template RSL_Message tr_RSL_PAGING_LOAD_IND(template uint16_t buffer_space := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001914 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Welte68e495b2018-02-25 00:05:57 +01001915 msg_type := RSL_MT_CCCH_LOAD_IND,
1916 ies := {
1917 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(0)}),
1918 tr_RSL_IE(RSL_IE_Body:{paging_load := buffer_space})
1919 }
1920 }
1921
Harald Welte7ae93142017-12-07 17:56:15 +01001922
Harald Welte643e2a62017-11-27 15:03:18 +01001923 /* 8.5.3 BTS -> BSC */
Vadim Yanitskiyab448a52019-05-31 20:24:03 +07001924 template (value) RSL_Message ts_RSL_CHAN_RQD(OCT1 ra, GsmFrameNumber fn,
1925 template (value) RslChannelNr chan_nr := ts_RslChanNr_RACH(0),
1926 uint8_t acc_del := 0) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001927 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1928 msg_type := RSL_MT_CHAN_RQD,
1929 ies := {
Vadim Yanitskiyab448a52019-05-31 20:24:03 +07001930 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1931 /* TODO: we may need to have optional RSL_IE_LINK_IDENT IE here */
Harald Welte735dd072017-12-12 14:55:17 +01001932 t_RSL_IE(RSL_IE_REQ_REFERENCE, RSL_IE_Body:{req_ref := ts_RSL_IE_ReqRef(ra, fn)}),
1933 t_RSL_IE(RSL_IE_ACCESS_DELAY, RSL_IE_Body:{access_delay := acc_del})
Harald Welte643e2a62017-11-27 15:03:18 +01001934 }
1935 }
Harald Welte9abd1282018-02-19 19:18:17 +01001936 template RSL_Message tr_RSL_CHAN_RQD(template OCT1 ra, template GsmFrameNumber fn := ?,
Vadim Yanitskiyab448a52019-05-31 20:24:03 +07001937 template RslChannelNr chan_nr := ts_RslChanNr_RACH(0),
1938 template uint8_t acc_del := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001939 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001940 msg_type := RSL_MT_CHAN_RQD,
1941 ies := {
Vadim Yanitskiyab448a52019-05-31 20:24:03 +07001942 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1943 /* TODO: we may need to have optional RSL_IE_LINK_IDENT IE here */
Harald Welte9abd1282018-02-19 19:18:17 +01001944 tr_RSL_IE(RSL_IE_Body:{req_ref := tr_RSL_IE_ReqRef(ra, fn)}),
1945 tr_RSL_IE(RSL_IE_Body:{access_delay := acc_del})
1946 }
1947 }
Harald Welte643e2a62017-11-27 15:03:18 +01001948
1949 /* 8.5.4 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001950 template (value) RSL_Message ts_DELETE_IND(template (value) RslChannelNr chan_nr,
1951 octetstring imm_ass) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001952 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1953 msg_type := RSL_MT_DELETE_IND,
1954 ies := {
Harald Welte735dd072017-12-12 14:55:17 +01001955 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1956 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 +01001957 }
1958 }
Harald Weltee8d750e2018-06-10 21:41:35 +02001959 template RSL_Message tr_RSL_DELETE_IND(template octetstring imm_ass := ?, template uint3_t tn) := {
1960 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1961 msg_type := RSL_MT_DELETE_IND,
1962 ies := {
1963 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(tn)}),
1964 tr_RSL_IE(RSL_IE_Body:{full_imm_ass_info := tr_RSL_LV(imm_ass)}),
1965 *
1966 }
1967 }
Harald Welte643e2a62017-11-27 15:03:18 +01001968
Harald Weltec2877752017-12-07 17:54:35 +01001969 /* 8.5.5 BSC -> BTS */
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +07001970 template RSL_Message tr_RSL_PAGING_CMD(template MobileIdentityV mi, template uint3_t tn := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001971 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Weltec2877752017-12-07 17:54:35 +01001972 msg_type := RSL_MT_PAGING_CMD,
1973 ies := {
1974 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(tn)}),
1975 tr_RSL_IE(RSL_IE_Body:{paging_group := ?}),
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +07001976 tr_RSL_IE(RSL_IE_Body:{ms_identity := tr_MI_LV(mi)}),
Harald Weltec2877752017-12-07 17:54:35 +01001977 * /* opt: channel needed, eMLPP prio */
1978 }
1979 }
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +07001980 template (value) RSL_Message ts_RSL_PAGING_CMD(MobileIdentityV mi, uint8_t pg, uint3_t tn := 0) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001981 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1982 msg_type := RSL_MT_PAGING_CMD,
1983 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001984 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_PCH_AGCH(tn)}),
Harald Welte9abd1282018-02-19 19:18:17 +01001985 t_RSL_IE(RSL_IE_PAGING_GROUP, RSL_IE_Body:{paging_group := pg}),
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +07001986 t_RSL_IE(RSL_IE_MS_IDENTITY, RSL_IE_Body:{ms_identity := ts_MI_LV(mi)})
Harald Welte9abd1282018-02-19 19:18:17 +01001987 }
1988 }
Harald Weltec2877752017-12-07 17:54:35 +01001989
1990 /* 8.5.6 BSC -> BTS */
1991 template RSL_Message tr_RSL_IMM_ASSIGN(template uint3_t tn := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001992 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Weltec2877752017-12-07 17:54:35 +01001993 msg_type := RSL_MT_IMMEDIATE_ASSIGN_CMD,
1994 ies := {
1995 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(tn)}),
1996 tr_RSL_IE(RSL_IE_Body:{full_imm_ass_info := ?})
1997 }
1998 }
Harald Welteefa7d912018-04-18 23:22:15 +02001999 template (value) RSL_Message ts_RSL_IMM_ASSIGN(octetstring f_ass_inf, uint3_t tn := 0) := {
Harald Welte9abd1282018-02-19 19:18:17 +01002000 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2001 msg_type := RSL_MT_IMMEDIATE_ASSIGN_CMD,
2002 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02002003 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_PCH_AGCH(tn)}),
Harald Welte9abd1282018-02-19 19:18:17 +01002004 t_RSL_IE(RSL_IE_FULL_IMM_ASS_INFO, RSL_IE_Body:{full_imm_ass_info := ts_RSL_LV(f_ass_inf)})
2005 }
2006 }
Harald Weltec2877752017-12-07 17:54:35 +01002007
Harald Weltecc373202018-09-10 10:28:21 +02002008 /* 8.5.8 BTS <- BSC SMS BROADCAST COMMAND */
2009 template RSL_Message tr_RSL_SMSCB_CMD(template RSL_IE_CbCommandType cb_cmd := ?,
2010 template octetstring msg := ?,
2011 template RslChannelNr chan_nr := ?) := {
2012 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2013 msg_type := RSL_MT_SMS_BC_CMD,
2014 ies := {
2015 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2016 tr_RSL_IE(RSL_IE_Body:{cb_cmd_type := cb_cmd}),
2017 tr_RSL_IE(RSL_IE_Body:{smscb_message := tr_RSL_LV(msg)}),
2018 *
2019 }
2020 }
2021 template (value) RSL_Message ts_RSL_SMSCB_CMD(template (value) RSL_IE_CbCommandType cb_cmd,
2022 template (value) octetstring msg,
2023 template (value) RslChannelNr chan_nr :=
2024 ts_RslChanNr_SDCCH4(0, 2)) := {
2025 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2026 msg_type := RSL_MT_SMS_BC_CMD,
2027 ies := {
2028 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2029 t_RSL_IE(RSL_IE_CB_CMD_TYPE, RSL_IE_Body:{cb_cmd_type := cb_cmd}),
2030 t_RSL_IE(RSL_IE_SMSCB_MSG, RSL_IE_Body:{smscb_message := ts_RSL_LV(msg)})
2031 /* optional channel type for extended CBCH */
2032 }
2033 }
2034
Harald Welte4a129f82019-05-21 16:35:22 +02002035 /* 8.5.9 BTS -> BSC CBCH LOAD INDICATION */
2036 template RSL_Message tr_RSL_CBCH_LOAD_IND_BASIC(template boolean overflow := ?,
2037 template uint4_t slot_count := ?,
2038 template RslChannelNr chan_nr := ?) := {
2039 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2040 msg_type := RSL_MT_CBCH_LOAD_IND,
2041 ies := {
2042 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2043 tr_RSL_IE(RSL_IE_Body:{cbch_load_info := tr_CbchLoadInfo(overflow, slot_count)})
2044 }
2045 }
2046 template (value) RSL_Message ts_RSL_CBCH_LOAD_IND_BASIC(boolean overflow, uint4_t slot_count,
2047 template (value) RslChannelNr chan_nr :=
2048 ts_RslChanNr_SDCCH4(0, 2)) := {
2049 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2050 msg_type := RSL_MT_CBCH_LOAD_IND,
2051 ies := {
2052 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2053 t_RSL_IE(RSL_IE_CBCH_LOAD_INFO, RSL_IE_Body:{cbch_load_info := ts_CbchLoadInfo(overflow, slot_count)})
2054 }
2055 }
2056 template RSL_Message tr_RSL_CBCH_LOAD_IND_EXTD(template boolean overflow := ?,
2057 template uint4_t slot_count := ?,
2058 template RslChannelNr chan_nr := ?) := {
2059 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2060 msg_type := RSL_MT_CBCH_LOAD_IND,
2061 ies := {
2062 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2063 tr_RSL_IE(RSL_IE_Body:{cbch_load_info := tr_CbchLoadInfo(overflow, slot_count)}),
2064 tr_RSL_IE(RSL_IE_Body:{smscb_chan_ind := 1})
2065 }
2066 }
2067 template (value) RSL_Message ts_RSL_CBCH_LOAD_IND_EXTD(boolean overflow, uint4_t slot_count,
2068 template (value) RslChannelNr chan_nr :=
2069 ts_RslChanNr_SDCCH4(0, 2)) := {
2070 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2071 msg_type := RSL_MT_CBCH_LOAD_IND,
2072 ies := {
2073 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2074 t_RSL_IE(RSL_IE_CBCH_LOAD_INFO, RSL_IE_Body:{cbch_load_info := ts_CbchLoadInfo(overflow, slot_count)}),
2075 t_RSL_IE(RSL_IE_SMSCB_CHAN_INDICATOR, RSL_IE_Body:{smscb_chan_ind := 1})
2076 }
2077 }
2078
2079
Vadim Yanitskiy9f699532021-06-03 17:29:22 +02002080 /* 8.6.1 BTS -> BSC */
2081 template (value) RSL_Message
2082 ts_RSL_RF_RES_IND(template (value) RSL_ResourceInfo info) := {
2083 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
2084 msg_type := RSL_MT_RF_RES_IND,
2085 ies := {
2086 t_RSL_IE(RSL_IE_RESOURCE_INFO, RSL_IE_Body:{
2087 resource_info := {
2088 len := 0, /* overwritten */
2089 info := info
2090 }
2091 })
2092 }
2093 }
2094 template RSL_Message
2095 tr_RSL_RF_RES_IND(template (present) RSL_ResourceInfo info := ?) := {
2096 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
2097 msg_type := RSL_MT_RF_RES_IND,
2098 ies := {
2099 tr_RSL_IE(RSL_IE_Body:{
2100 resource_info := {
2101 len := ?,
2102 info := info
2103 }
2104 })
2105 }
2106 }
2107
2108
Harald Welte68e495b2018-02-25 00:05:57 +01002109 /* 8.6.2 BTS <- BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02002110 template (value) RSL_Message ts_RSL_SACCH_FILL(RSL_IE_SysinfoType si_type, octetstring l3_info) := {
Harald Welte68e495b2018-02-25 00:05:57 +01002111 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
2112 msg_type := RSL_MT_SACCH_FILL,
2113 ies := {
2114 t_RSL_IE(RSL_IE_SYSINFO_TYPE, RSL_IE_Body:{sysinfo_type := si_type}),
2115 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
2116 }
2117 }
Harald Welte09538f82019-08-01 09:50:25 +02002118 template RSL_Message tr_RSL_NO_SACCH_FILL(template RSL_IE_SysinfoType si_type := ?) := {
2119 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
2120 msg_type := RSL_MT_SACCH_FILL,
2121 ies := {
2122 tr_RSL_IE(RSL_IE_Body:{sysinfo_type := si_type})
2123 }
2124 }
2125 template RSL_Message tr_RSL_SACCH_FILL(template RSL_IE_SysinfoType si_type := ?,
2126 template octetstring l3_info := ?) := {
2127 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
2128 msg_type := RSL_MT_SACCH_FILL,
2129 ies := {
2130 tr_RSL_IE(RSL_IE_Body:{sysinfo_type := si_type}),
2131 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)}),
2132 *
2133 }
2134 }
2135
Harald Welte68e495b2018-02-25 00:05:57 +01002136
Harald Welte643e2a62017-11-27 15:03:18 +01002137 /* 8.6.4 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02002138 template (value) RSL_Message ts_RSL_ERROR_REPORT(RSL_Cause cause) := {
Harald Welte01d982c2018-02-25 01:31:40 +01002139 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
2140 msg_type := RSL_MT_ERROR_REPORT,
Harald Welte643e2a62017-11-27 15:03:18 +01002141 ies := {
Harald Welte735dd072017-12-12 14:55:17 +01002142 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
Harald Welte643e2a62017-11-27 15:03:18 +01002143 }
2144 }
Harald Welte01d982c2018-02-25 01:31:40 +01002145 template RSL_Message tr_RSL_ERROR_REPORT(template RSL_Cause cause := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002146 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
Harald Welte01d982c2018-02-25 01:31:40 +01002147 msg_type := RSL_MT_ERROR_REPORT,
2148 ies := {
2149 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)}),
2150 *
2151 }
2152 }
2153
Harald Welte643e2a62017-11-27 15:03:18 +01002154
Harald Welte9958a4d2017-12-14 21:21:33 +01002155
2156 /* Abis/IP specific messages */
2157
Vadim Yanitskiy1567bac2022-05-01 03:36:24 +03002158 private function f_ts_RSL_IPA_CRCX_IEs(template (value) RslChannelNr chan_nr,
2159 template (omit) OCT4 remote_ip,
2160 template (omit) uint16_t remote_port)
2161 return RSL_IE_List {
2162 var RSL_IE_List ies;
2163
2164 /* Channel Number is a mandatory IE */
2165 ies := {
2166 valueof(RSL_IE:{
2167 iei := RSL_IE_CHAN_NR,
2168 body := { chan_nr := chan_nr }
2169 })
2170 };
2171 /* Remote IP / Port are optional IEs */
2172 if (not istemplatekind(remote_ip, "omit")) {
2173 ies := ies & {
2174 valueof(RSL_IE:{
2175 iei := RSL_IE_IPAC_REMOTE_IP,
2176 body := { ipa_remote_ip := remote_ip }
2177 })
2178 };
2179 }
2180 if (not istemplatekind(remote_port, "omit")) {
2181 ies := ies & {
2182 valueof(RSL_IE:{
2183 iei := RSL_IE_IPAC_REMOTE_PORT,
2184 body := { ipa_remote_port := remote_port }
2185 })
2186 };
2187 }
2188
2189 return ies;
2190 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002191 template RSL_Message tr_RSL_IPA_CRCX(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002192 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002193 msg_type := RSL_MT_IPAC_CRCX,
2194 ies := {
2195 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2196 *
2197 }
2198 }
Vadim Yanitskiye9141c22021-07-03 01:45:40 +02002199 template (value) RSL_Message
2200 ts_RSL_IPA_CRCX(template (value) RslChannelNr chan_nr,
Vadim Yanitskiy1567bac2022-05-01 03:36:24 +03002201 template (omit) OCT4 remote_ip := omit,
2202 template (omit) uint16_t remote_port := omit) := {
Harald Welte9abd1282018-02-19 19:18:17 +01002203 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2204 msg_type := RSL_MT_IPAC_CRCX,
Vadim Yanitskiy1567bac2022-05-01 03:36:24 +03002205 ies := f_ts_RSL_IPA_CRCX_IEs(chan_nr, remote_ip, remote_port)
Harald Welte9abd1282018-02-19 19:18:17 +01002206 }
2207
Pau Espin Pedrol29c6dfb2022-08-08 18:37:56 +02002208 function ts_RSL_IPA_CRCX_ACK(template (value) RslChannelNr chan_nr,
2209 uint16_t ipa_conn_id, OCT4 local_ip,
2210 uint16_t local_port, uint7_t rtp_pt2,
2211 template (omit) uint8_t osmux_cid := omit)
2212 return template (value) RSL_Message {
2213 var template (value) RSL_Message msg := {
2214 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2215 msg_type := RSL_MT_IPAC_CRCX_ACK,
2216 ies := {
2217 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2218 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2219 t_RSL_IE(RSL_IE_IPAC_LOCAL_IP, RSL_IE_Body:{ipa_local_ip := local_ip}),
2220 t_RSL_IE(RSL_IE_IPAC_LOCAL_PORT, RSL_IE_Body:{ipa_local_port := local_port}),
2221 t_RSL_IE(RSL_IE_IPAC_RTP_PAYLOAD2, RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
2222 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002223 }
Pau Espin Pedrol29c6dfb2022-08-08 18:37:56 +02002224 if (not istemplatekind(osmux_cid, "omit")) {
2225 msg.ies[lengthof(msg.ies)] := t_RSL_IE(RSL_IE_OSMO_OSMUX_CID, RSL_IE_Body:{osmux_cid := ts_RSL_IE_OSMO_Osmux_CID(osmux_cid)});
2226 }
2227 return msg;
Harald Welte9958a4d2017-12-14 21:21:33 +01002228 }
Pau Espin Pedrol29c6dfb2022-08-08 18:37:56 +02002229
Harald Welte9abd1282018-02-19 19:18:17 +01002230 template RSL_Message tr_RSL_IPA_CRCX_ACK(template RslChannelNr chan_nr,
2231 template uint16_t ipa_conn_id,
Vadim Yanitskiyfc631642021-07-03 02:42:45 +02002232 template OCT4 local_ip,
Harald Welte8bd0f822018-02-25 12:43:28 +01002233 template uint16_t local_port) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002234 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9abd1282018-02-19 19:18:17 +01002235 msg_type := RSL_MT_IPAC_CRCX_ACK,
2236 ies := {
2237 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2238 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2239 tr_RSL_IE(RSL_IE_Body:{ipa_local_ip := local_ip}),
Harald Welte8bd0f822018-02-25 12:43:28 +01002240 tr_RSL_IE(RSL_IE_Body:{ipa_local_port := local_port})
2241 /* Optional: RTP Payload Type 2 IE */
Harald Welte9abd1282018-02-19 19:18:17 +01002242 }
2243 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002244
Harald Welteefa7d912018-04-18 23:22:15 +02002245 template (value) RSL_Message ts_RSL_IPA_CRCX_NACK(template (value) RslChannelNr chan_nr,
2246 RSL_Cause cause) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002247 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2248 msg_type := RSL_MT_IPAC_CRCX_NACK,
2249 ies := {
2250 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2251 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2252 }
2253 }
Harald Welte9abd1282018-02-19 19:18:17 +01002254 template RSL_Message tr_RSL_IPA_CRCX_NACK(template RslChannelNr chan_nr,
2255 template RSL_Cause cause := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002256 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9abd1282018-02-19 19:18:17 +01002257 msg_type := RSL_MT_IPAC_CRCX_NACK,
2258 ies := {
2259 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2260 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
2261 }
2262 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002263
Harald Welteefa7d912018-04-18 23:22:15 +02002264 template (value) RSL_Message ts_RSL_IPA_MDCX(template (value) RslChannelNr chan_nr,
2265 uint16_t ipa_conn_id,
Vadim Yanitskiyfc631642021-07-03 02:42:45 +02002266 OCT4 remote_ip, uint16_t remote_port,
Harald Welteefa7d912018-04-18 23:22:15 +02002267 uint7_t rtp_pt2) := {
Harald Welte30527452018-02-25 12:46:25 +01002268 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2269 msg_type := RSL_MT_IPAC_MDCX,
2270 ies := {
2271 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2272 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2273 t_RSL_IE(RSL_IE_IPAC_REMOTE_IP, RSL_IE_Body:{ipa_remote_ip := remote_ip}),
2274 t_RSL_IE(RSL_IE_IPAC_REMOTE_PORT, RSL_IE_Body:{ipa_remote_port := remote_port}),
2275 /* optional: RTP Payload Type */
2276 t_RSL_IE(RSL_IE_IPAC_RTP_PAYLOAD2, RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
2277 }
2278 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002279 template RSL_Message tr_RSL_IPA_MDCX(template RslChannelNr chan_nr,
2280 template uint16_t ipa_conn_id) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002281 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002282 msg_type := RSL_MT_IPAC_MDCX,
2283 ies := {
2284 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2285 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2286 *
2287 }
2288 }
2289
Pau Espin Pedrol29c6dfb2022-08-08 18:37:56 +02002290 function ts_RSL_IPA_MDCX_ACK(template (value) RslChannelNr chan_nr,
2291 uint16_t ipa_conn_id,
2292 OCT4 local_ip, uint16_t local_port,
2293 uint7_t rtp_pt2,
2294 template (omit) uint8_t osmux_cid := omit)
2295 return template (value) RSL_Message {
2296 var template (value) RSL_Message msg := {
2297 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2298 msg_type := RSL_MT_IPAC_MDCX_ACK,
2299 ies := {
2300 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2301 /* optional */
2302 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2303 t_RSL_IE(RSL_IE_IPAC_LOCAL_IP, RSL_IE_Body:{ipa_local_ip := local_ip}),
2304 t_RSL_IE(RSL_IE_IPAC_LOCAL_PORT, RSL_IE_Body:{ipa_local_port := local_port}),
2305 /* optional: RTP Payload Type */
2306 t_RSL_IE(RSL_IE_IPAC_RTP_PAYLOAD2, RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
2307 }
2308 }
2309 if (not istemplatekind(osmux_cid, "omit")) {
2310 msg.ies[lengthof(msg.ies)] := t_RSL_IE(RSL_IE_OSMO_OSMUX_CID, RSL_IE_Body:{osmux_cid := ts_RSL_IE_OSMO_Osmux_CID(osmux_cid)});
2311 }
2312 return msg;
Harald Welte9958a4d2017-12-14 21:21:33 +01002313 }
Harald Welte30527452018-02-25 12:46:25 +01002314 template RSL_Message tr_RSL_IPA_MDCX_ACK(template RslChannelNr chan_nr,
2315 template uint16_t ipa_conn_id,
Vadim Yanitskiyfc631642021-07-03 02:42:45 +02002316 template OCT4 local_ip,
Harald Welte30527452018-02-25 12:46:25 +01002317 template uint16_t local_port,
2318 template uint7_t rtp_pt2) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002319 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte30527452018-02-25 12:46:25 +01002320 msg_type := RSL_MT_IPAC_MDCX_ACK,
2321 ies := {
2322 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2323 /* optional */
2324 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2325 tr_RSL_IE(RSL_IE_Body:{ipa_local_ip := local_ip}),
2326 tr_RSL_IE(RSL_IE_Body:{ipa_local_port := local_port}),
2327 /* optional: RTP Payload Type */
2328 tr_RSL_IE(RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
2329 }
2330 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002331
Harald Welteefa7d912018-04-18 23:22:15 +02002332 template (value) RSL_Message ts_RSL_IPA_MDCX_NACK(template (value) RslChannelNr chan_nr,
2333 RSL_Cause cause,
2334 template (value) uint16_t ipa_conn_id) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002335 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2336 msg_type := RSL_MT_IPAC_MDCX_NACK,
2337 ies := {
2338 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2339 /* optional connection ID */
2340 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2341 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2342 }
2343 }
Harald Welte30527452018-02-25 12:46:25 +01002344 template RSL_Message tr_RSL_IPA_MDCX_NACK(template RslChannelNr chan_nr,
2345 template RSL_Cause cause,
2346 template uint16_t ipa_conn_id) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002347 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte30527452018-02-25 12:46:25 +01002348 msg_type := RSL_MT_IPAC_MDCX_NACK,
2349 ies := {
2350 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2351 /* optional connection ID */
2352 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2353 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
2354 }
2355 }
2356
Harald Welte9958a4d2017-12-14 21:21:33 +01002357
Harald Welteefa7d912018-04-18 23:22:15 +02002358 template (value) RSL_Message ts_RSL_IPA_DLCX_IND(template (value) RslChannelNr chan_nr,
2359 uint16_t ipa_conn_id,
2360 template (value) RSL_IE_IPA_ConnectionStats stats,
2361 RSL_Cause cause) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002362 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2363 msg_type := RSL_MT_IPAC_DLCX_IND,
2364 ies := {
2365 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2366 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2367 t_RSL_IE(RSL_IE_IPAC_CONN_STAT, RSL_IE_Body:{ipa_stats := stats}),
2368 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2369 }
2370 }
2371
Harald Welteefa7d912018-04-18 23:22:15 +02002372 template (value) RSL_Message ts_RSL_IPA_DLCX(template (value) RslChannelNr chan_nr,
2373 uint16_t ipa_conn_id) := {
Harald Weltea871a382018-02-25 02:03:14 +01002374 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2375 msg_type := RSL_MT_IPAC_DLCX,
2376 ies := {
Harald Welte2a7e7162018-02-25 12:46:48 +01002377 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2378 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id})
Harald Weltea871a382018-02-25 02:03:14 +01002379 }
2380 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002381 template RSL_Message tr_RSL_IPA_DLCX(template RslChannelNr chan_nr,
2382 template uint16_t ipa_conn_id := omit) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002383 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002384 msg_type := RSL_MT_IPAC_DLCX,
2385 ies := {
2386 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2387 /* FIXME: optional conn_id */
2388 *
2389 }
2390 }
2391
Harald Welteefa7d912018-04-18 23:22:15 +02002392 template (value) RSL_Message ts_RSL_IPA_DLCX_ACK(template (value) RslChannelNr chan_nr,
2393 uint16_t ipa_conn_id,
2394 RSL_IE_IPA_ConnectionStats stats) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002395 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2396 msg_type := RSL_MT_IPAC_DLCX_ACK,
2397 ies := {
2398 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2399 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2400 t_RSL_IE(RSL_IE_IPAC_CONN_STAT, RSL_IE_Body:{ipa_stats := stats})
2401 }
2402 }
Harald Weltea871a382018-02-25 02:03:14 +01002403 template RSL_Message tr_RSL_IPA_DLCX_ACK(template RslChannelNr chan_nr,
2404 template uint16_t ipa_conn_id,
2405 template RSL_IE_IPA_ConnectionStats stats) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002406 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Weltea871a382018-02-25 02:03:14 +01002407 msg_type := RSL_MT_IPAC_DLCX_ACK,
2408 ies := {
2409 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2410 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2411 tr_RSL_IE(RSL_IE_Body:{ipa_stats := stats})
2412 }
2413 }
2414
2415
Harald Welte9958a4d2017-12-14 21:21:33 +01002416
Harald Welteefa7d912018-04-18 23:22:15 +02002417 template (value) RSL_Message ts_RSL_IPA_DLCX_NACK(template (value) RslChannelNr chan_nr,
2418 RSL_Cause cause, uint16_t ipa_conn_id) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002419 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2420 msg_type := RSL_MT_IPAC_DLCX_NACK,
2421 ies := {
2422 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2423 /* optional connection ID */
2424 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2425 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2426 }
2427 }
Harald Weltea871a382018-02-25 02:03:14 +01002428 template RSL_Message tr_RSL_IPA_DLCX_NACK(template RslChannelNr chan_nr,
2429 template RSL_Cause cause) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002430 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Weltea871a382018-02-25 02:03:14 +01002431 msg_type := RSL_MT_IPAC_DLCX_NACK,
2432 ies := {
2433 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2434 /* optional connection ID */
2435 *,
2436 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
2437 }
2438 }
2439
Harald Welte9958a4d2017-12-14 21:21:33 +01002440
Vadim Yanitskiy58b16532021-10-09 20:27:39 +06002441 template (value) RSL_Message
2442 ts_RSL_IPA_PDCH_ACT(template (value) RslChannelNr chan_nr) := {
Harald Welteee19c732018-04-05 09:08:26 +02002443 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2444 msg_type := RSL_MT_IPAC_PDCH_ACT,
2445 ies := {
2446 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
2447 }
2448 }
Vadim Yanitskiy58b16532021-10-09 20:27:39 +06002449 template RSL_Message
2450 tr_RSL_IPA_PDCH_ACT(template (present) RslChannelNr chan_nr) := {
Harald Welteee19c732018-04-05 09:08:26 +02002451 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002452 msg_type := RSL_MT_IPAC_PDCH_ACT,
2453 ies := {
2454 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
2455 }
2456 }
2457
Harald Welteee19c732018-04-05 09:08:26 +02002458
Harald Welte94e0c342018-04-07 11:33:23 +02002459 template RSL_Message ts_RSL_IPA_PDCH_ACT_ACK(RslChannelNr chan_nr,
2460 template (value) RSL_IE_FrameNumber fn) := {
Harald Welteee19c732018-04-05 09:08:26 +02002461 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002462 msg_type := RSL_MT_IPAC_PDCH_ACT_ACK,
2463 ies := {
2464 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2465 t_RSL_IE(RSL_IE_FRAME_NUMBER, RSL_IE_Body:{frame_nr := fn})
2466 }
2467 }
Harald Welteee19c732018-04-05 09:08:26 +02002468 template RSL_Message tr_RSL_IPA_PDCH_ACT_ACK(template RslChannelNr chan_nr,
2469 template RSL_IE_FrameNumber fn) := {
2470 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2471 msg_type := RSL_MT_IPAC_PDCH_ACT_ACK,
2472 ies := {
2473 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2474 tr_RSL_IE(RSL_IE_Body:{frame_nr := fn})
2475 }
2476 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002477
2478 template RSL_Message ts_RSL_IPA_PDCH_ACT_NACK(RslChannelNr chan_nr, RSL_Cause cause) := {
Harald Welteee19c732018-04-05 09:08:26 +02002479 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002480 msg_type := RSL_MT_IPAC_PDCH_ACT_NACK,
2481 ies := {
2482 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2483 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2484 }
2485 }
Harald Welteee19c732018-04-05 09:08:26 +02002486 template RSL_Message tr_RSL_IPA_PDCH_ACT_NACK(template RslChannelNr chan_nr,
2487 template RSL_Cause cause) := {
2488 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2489 msg_type := RSL_MT_IPAC_PDCH_ACT_NACK,
2490 ies := {
2491 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2492 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
2493 }
2494 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002495
Harald Welteee19c732018-04-05 09:08:26 +02002496 template RSL_Message ts_RSL_IPA_PDCH_DEACT(RslChannelNr chan_nr) := {
2497 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2498 msg_type := RSL_MT_IPAC_PDCH_DEACT,
2499 ies := {
2500 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
2501 }
2502 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002503 template RSL_Message tr_RSL_IPA_PDCH_DEACT(template RslChannelNr chan_nr) := {
Harald Welteee19c732018-04-05 09:08:26 +02002504 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002505 msg_type := RSL_MT_IPAC_PDCH_DEACT,
2506 ies := {
2507 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
2508 }
2509 }
2510
2511 template RSL_Message ts_RSL_IPA_PDCH_DEACT_ACK(RslChannelNr chan_nr) := {
Harald Welteee19c732018-04-05 09:08:26 +02002512 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002513 msg_type := RSL_MT_IPAC_PDCH_DEACT_ACK,
2514 ies := {
2515 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
2516 }
2517 }
Harald Welteee19c732018-04-05 09:08:26 +02002518 template RSL_Message tr_RSL_IPA_PDCH_DEACT_ACK(template RslChannelNr chan_nr) := {
2519 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2520 msg_type := RSL_MT_IPAC_PDCH_DEACT_ACK,
2521 ies := {
2522 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
2523 }
2524 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002525
2526 template RSL_Message ts_RSL_IPA_PDCH_DEACT_NACK(RslChannelNr chan_nr, RSL_Cause cause) := {
Harald Welteee19c732018-04-05 09:08:26 +02002527 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002528 msg_type := RSL_MT_IPAC_PDCH_DEACT_NACK,
2529 ies := {
2530 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2531 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2532 }
2533 }
Harald Welteee19c732018-04-05 09:08:26 +02002534 template RSL_Message tr_RSL_IPA_PDCH_DEACT_NACK(template RslChannelNr chan_nr,
2535 template RSL_Cause cause) := {
2536 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2537 msg_type := RSL_MT_IPAC_PDCH_DEACT_NACK,
2538 ies := {
2539 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2540 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
2541 }
2542 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002543
Harald Welte908ce542019-09-04 23:05:40 +02002544 template (value) RSL_Message ts_RSL_OSMO_ETWS_CMD(template (value) octetstring msg,
2545 template (value) RslChannelNr chan_nr := ts_RslChanNr_PCH_AGCH(0)) := {
2546 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2547 msg_type := RSL_MT_OSMO_ETWS_CMD,
2548 ies := {
2549 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2550 t_RSL_IE(RSL_IE_SMSCB_MSG, RSL_IE_Body:{smscb_message := ts_RSL_LV(msg)})
2551 }
2552 }
2553 template RSL_Message tr_RSL_OSMO_ETWS_CMD(template RslChannelNr chan_nr := ?,
2554 template octetstring msg := ?) := {
2555 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2556 msg_type := RSL_MT_OSMO_ETWS_CMD,
2557 ies := {
2558 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2559 tr_RSL_IE(RSL_IE_Body:{smscb_message := tr_RSL_LV(msg)})
2560 }
2561 }
2562
2563
Harald Welte9958a4d2017-12-14 21:21:33 +01002564
Harald Welte6a8199d2018-01-29 21:58:53 +01002565 function f_rsl_find_ie(RSL_Message msg, RSL_IE_Type iei, out RSL_IE_Body ret) return boolean {
2566 for (var integer i := 0; i < sizeof(msg.ies); i := i+1) {
2567 if (msg.ies[i].iei == iei) {
2568 ret := msg.ies[i].body;
2569 return true;
2570 }
2571 }
2572 return false;
2573 }
2574
2575
Harald Welte9958a4d2017-12-14 21:21:33 +01002576
Harald Welte643e2a62017-11-27 15:03:18 +01002577} with { encode "RAW" ; variant "FIELDORDER(msb)" }