blob: 6c45ca93aec21a574e9d4e522da8fce23fb99cbf [file] [log] [blame]
Harald Welte643e2a62017-11-27 15:03:18 +01001module RSL_Types {
2
Vadim Yanitskiyc06688e2020-05-06 15:22:45 +07003/* RSL types defining abstract TTCN-3 data types for the A-bis RSL protocol.
Harald Welte35bb7162018-01-03 21:07:52 +01004 *
5 * RSL is a 3GPP standard protocol used between BTS and BSC in a GSM network.
6 *
7 * (C) 2017 by Harald Welte <laforge@gnumonks.org>
8 * All rights reserved.
9 *
10 * Released under the terms of GNU General Public License, Version 2 or
11 * (at your option) any later version.
Harald Welte34b5a952019-05-27 11:54:11 +020012 *
13 * SPDX-License-Identifier: GPL-2.0-or-later
Harald Welte35bb7162018-01-03 21:07:52 +010014 */
15
Harald Welte643e2a62017-11-27 15:03:18 +010016 import from General_Types all;
17 import from Osmocom_Types all;
Vadim Yanitskiye02dbcc2020-08-25 04:20:51 +070018 import from GSM_RR_Types all;
Harald Welte643e2a62017-11-27 15:03:18 +010019 import from GSM_Types all;
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +070020 import from MobileL3_CommonIE_Types all;
21 import from L3_Templates all;
Harald Welte643e2a62017-11-27 15:03:18 +010022
23 /* Section 9.1 */
24 type enumerated RSL_MessageGroup {
25 RSL_MDISC_RESERVED ('0000000'B),
26 RSL_MDISC_RLL ('0000001'B),
27 RSL_MDISC_DCHAN ('0000100'B),
28 RSL_MDISC_CCHAN ('0000110'B),
29 RSL_MDISC_TRX_MGMT ('0001000'B),
30 RSL_MDISC_LCS ('0010000'B),
31 RSL_MDISC_IPACCESS ('0111111'B)
32 } with { variant "FIELDLENGTH(7)" };
33
34 /* Section 9.1 */
35 type record RSL_MessageDiscriminator {
36 RSL_MessageGroup msg_group,
37 boolean transparent
38 } with { variant "FIELDORDER(msb)" };
39
Harald Welteefa7d912018-04-18 23:22:15 +020040 template (value) RSL_MessageDiscriminator ts_RSL_MsgDisc(RSL_MessageGroup mg, boolean t := true) := {
Harald Welte643e2a62017-11-27 15:03:18 +010041 msg_group := mg,
42 transparent := t
43 }
Harald Welteefa7d912018-04-18 23:22:15 +020044 template RSL_MessageDiscriminator tr_RSL_MsgDisc(template RSL_MessageGroup mg, boolean t := true) := {
45 msg_group := mg,
46 transparent := t
47 }
48
Harald Welte643e2a62017-11-27 15:03:18 +010049
50 /* Section 9.2 */
51 type enumerated RSL_MessageType {
52 /* Radio Link Layer Management */
53 RSL_MT_DATA_REQ ('00000001'B),
54 RSL_MT_DATA_IND ('00000010'B),
55 RSL_MT_ERROR_IND ('00000011'B),
56 RSL_MT_EST_REQ ('00000100'B),
57 RSL_MT_EST_CONF ('00000101'B),
58 RSL_MT_EST_IND ('00000110'B),
59 RSL_MT_REL_REQ ('00000111'B),
60 RSL_MT_REL_CONF ('00001000'B),
61 RSL_MT_REL_IND ('00001001'B),
62 RSL_MT_UNIT_DATA_REQ ('00001010'B),
63 RSL_MT_UNIT_DATA_IND ('00001011'B),
64
65 /* non-standard below */
66 RSL_MT_SUSP_REQ ('00001100'B),
67 RSL_MT_SUSP_CONF ('00001101'B),
68 RSL_MT_RES_REQ ('00001110'B),
69 RSL_MT_RECON_REQ ('00001111'B),
70
71 /* Common Channel Management / TRX Management */
72 RSL_MT_BCCH_INFO ('00010001'B),
Harald Welte319be822017-12-07 17:50:26 +010073 RSL_MT_CCCH_LOAD_IND ('00010010'B),
74 RSL_MT_CHAN_RQD ('00010011'B),
75 RSL_MT_DELETE_IND ('00010100'B),
76 RSL_MT_PAGING_CMD ('00010101'B),
77 RSL_MT_IMMEDIATE_ASSIGN_CMD ('00010110'B),
78 RSL_MT_SMS_BC_REQ ('00010111'B),
79 RSL_MT_CHAN_CONF ('00011000'B), /* non-standard element */
Harald Welte643e2a62017-11-27 15:03:18 +010080 /* empty */
81 RSL_MT_RF_RES_IND ('00011001'B),
Harald Welte319be822017-12-07 17:50:26 +010082 RSL_MT_SACCH_FILL ('00011010'B),
83 RSL_MT_OVERLOAD ('00011011'B),
84 RSL_MT_ERROR_REPORT ('00011100'B),
85 RSL_MT_SMS_BC_CMD ('00011101'B),
86 RSL_MT_CBCH_LOAD_IND ('00011110'B),
87 RSL_MT_NOT_CMD ('00011111'B),
Harald Welte643e2a62017-11-27 15:03:18 +010088
89 /* Dedicate Channel Management */
90 RSL_MT_CHAN_ACTIV ('00100001'B),
Harald Welte319be822017-12-07 17:50:26 +010091 RSL_MT_CHAN_ACTIV_ACK ('00100010'B),
92 RSL_MT_CHAN_ACTIV_NACK ('00100011'B),
93 RSL_MT_CONN_FAIL ('00100100'B),
94 RSL_MT_DEACTIVATE_SACCH ('00100101'B),
95 RSL_MT_ENCR_CMD ('00100110'B),
96 RSL_MT_HANDO_DET ('00100111'B),
97 RSL_MT_MEAS_RES ('00101000'B),
98 RSL_MT_MODE_MODIFY_REQ ('00101001'B),
99 RSL_MT_MODE_MODIFY_ACK ('00101010'B),
100 RSL_MT_MODE_MODIFY_NACK ('00101011'B),
101 RSL_MT_PHY_CONTEXT_REQ ('00101100'B),
102 RSL_MT_PHY_CONTEXT_CONF ('00101101'B),
103 RSL_MT_RF_CHAN_REL ('00101110'B),
104 RSL_MT_MS_POWER_CONTROL ('00101111'B),
105 RSL_MT_BS_POWER_CONTROL ('00110000'B), /* 0x30 */
106 RSL_MT_PREPROC_CONFIG ('00110001'B),
107 RSL_MT_PREPROC_MEAS_RES ('00110010'B),
108 RSL_MT_RF_CHAN_REL_ACK ('00110011'B),
109 RSL_MT_SACCH_INFO_MODIFY('00110100'B),
110 RSL_MT_TALKER_DET ('00110101'B),
111 RSL_MT_LISTENER_DET ('00110110'B),
112 RSL_MT_REMOTE_CODEC_CONF_REP ('00110111'B),
113 RSL_MT_RTD_REP ('00111000'B),
114 RSL_MT_PRE_HANDO_NOTIF ('00111001'B),
115 RSL_MT_MR_CODEC_MOD_REQ ('00111010'B),
116 RSL_MT_MR_CODEC_MOD_ACK ('00111011'B),
117 RSL_MT_MR_CODEC_MOD_NACK ('00111100'B),
118 RSL_MT_MR_CODEC_MOD_PER ('00111101'B),
119 RSL_MT_TFO_REP ('00111110'B),
120 RSL_MT_TFO_MOD_REQ ('00111111'B), /* 0x3f */
Harald Welte643e2a62017-11-27 15:03:18 +0100121
122 RSL_MT_LOCATION_INFO ('01000001'B),
123
124 /* ip.access specific RSL message types */
125 RSL_MT_IPAC_DIR_RETR_ENQ ('01000000'B),
126
127 RSL_MT_IPAC_PDCH_ACT ('01001000'B),
Harald Welte319be822017-12-07 17:50:26 +0100128 RSL_MT_IPAC_PDCH_ACT_ACK ('01001001'B),
129 RSL_MT_IPAC_PDCH_ACT_NACK ('01001010'B),
Harald Welte643e2a62017-11-27 15:03:18 +0100130 RSL_MT_IPAC_PDCH_DEACT ('01001011'B),
Harald Welte319be822017-12-07 17:50:26 +0100131 RSL_MT_IPAC_PDCH_DEACT_ACK ('01001100'B),
132 RSL_MT_IPAC_PDCH_DEACT_NACK ('01001101'B),
Harald Welte643e2a62017-11-27 15:03:18 +0100133
134 RSL_MT_IPAC_CONNECT_MUX ('01010000'B),
Harald Weltef3075002017-12-16 22:31:41 +0100135 RSL_MT_IPAC_CONNECT_MUX_ACK ('01010001'B),
136 RSL_MT_IPAC_CONNECT_MUX_NACK ('01010010'B),
137 RSL_MT_IPAC_BIND_MUX ('01010011'B),
138 RSL_MT_IPAC_BIND_MUX_ACK ('01010100'B),
139 RSL_MT_IPAC_BIND_MUX_NACK ('01010101'B),
140 RSL_MT_IPAC_DISC_MUX ('01010110'B),
141 RSL_MT_IPAC_DISC_MUX_ACK ('01010111'B),
142 RSL_MT_IPAC_DISC_MUX_NACK ('01011000'B),
Harald Welte643e2a62017-11-27 15:03:18 +0100143 RSL_MT_IPAC_MEAS_PREPROC_DFT ('01100000'B),
Harald Weltef3075002017-12-16 22:31:41 +0100144 RSL_MT_IPAC_HO_CAN_ENQ ('01100001'B),
145 RSL_MT_IPAC_HO_CAN_RES ('01100010'B),
146 RSL_MT_IPAC_CRCX ('01110000'B),
147 RSL_MT_IPAC_CRCX_ACK ('01110001'B),
148 RSL_MT_IPAC_CRCX_NACK ('01110010'B),
149 RSL_MT_IPAC_MDCX ('01110011'B),
150 RSL_MT_IPAC_MDCX_ACK ('01110100'B),
151 RSL_MT_IPAC_MDCX_NACK ('01110101'B),
152 RSL_MT_IPAC_DLCX_IND ('01110110'B),
153 RSL_MT_IPAC_DLCX ('01110111'B),
154 RSL_MT_IPAC_DLCX_ACK ('01111000'B),
Harald Welte908ce542019-09-04 23:05:40 +0200155 RSL_MT_IPAC_DLCX_NACK ('01111001'B),
156
157 RSL_MT_OSMO_ETWS_CMD ('01111111'B)
Harald Welte643e2a62017-11-27 15:03:18 +0100158 } with { variant "FIELDLENGTH(8)" };
159
160 /*! RSL Information Element Identifiers (Chapter 9.3) */
161 type enumerated RSL_IE_Type {
162 RSL_IE_CHAN_NR ('00000001'B),
Harald Welte319be822017-12-07 17:50:26 +0100163 RSL_IE_LINK_IDENT ('00000010'B),
164 RSL_IE_ACT_TYPE ('00000011'B),
165 RSL_IE_BS_POWER ('00000100'B),
166 RSL_IE_CHAN_IDENT ('00000101'B),
167 RSL_IE_CHAN_MODE ('00000110'B),
168 RSL_IE_ENCR_INFO ('00000111'B),
169 RSL_IE_FRAME_NUMBER ('00001000'B),
170 RSL_IE_HANDO_REF ('00001001'B),
171 RSL_IE_L1_INFO ('00001010'B),
172 RSL_IE_L3_INFO ('00001011'B),
173 RSL_IE_MS_IDENTITY ('00001100'B),
174 RSL_IE_MS_POWER ('00001101'B),
175 RSL_IE_PAGING_GROUP ('00001110'B),
176 RSL_IE_PAGING_LOAD ('00001111'B),
177 RSL_IE_PYHS_CONTEXT ('00010000'B),
178 RSL_IE_ACCESS_DELAY ('00010001'B),
179 RSL_IE_RACH_LOAD ('00010010'B),
180 RSL_IE_REQ_REFERENCE ('00010011'B),
181 RSL_IE_RELEASE_MODE ('00010100'B),
182 RSL_IE_RESOURCE_INFO ('00010101'B),
183 RSL_IE_RLM_CAUSE ('00010110'B),
184 RSL_IE_STARTNG_TIME ('00010111'B),
185 RSL_IE_TIMING_ADVANCE ('00011000'B),
186 RSL_IE_UPLINK_MEAS ('00011001'B),
187 RSL_IE_CAUSE ('00011010'B),
188 RSL_IE_MEAS_RES_NR ('00011011'B),
189 RSL_IE_MSG_ID ('00011100'B),
Harald Welte643e2a62017-11-27 15:03:18 +0100190 /* reserved */
191 RSL_IE_SYSINFO_TYPE ('00011110'B),
Harald Welte319be822017-12-07 17:50:26 +0100192 RSL_IE_MS_POWER_PARAM ('00011111'B),
193 RSL_IE_BS_POWER_PARAM ('00100000'B),
194 RSL_IE_PREPROC_PARAM ('00100001'B),
195 RSL_IE_PREPROC_MEAS ('00100010'B),
196 RSL_IE_IMM_ASS_INFO ('00100011'B),/* Phase 1 (3.6.0), later Full below */
197 RSL_IE_SMSCB_INFO ('00100100'B),
198 RSL_IE_MS_TIMING_OFFSET ('00100101'B),
199 RSL_IE_ERR_MSG ('00100110'B),
200 RSL_IE_FULL_BCCH_INFO ('00100111'B),
201 RSL_IE_CHAN_NEEDED ('00101000'B),
202 RSL_IE_CB_CMD_TYPE ('00101001'B),
203 RSL_IE_SMSCB_MSG ('00101010'B),
204 RSL_IE_FULL_IMM_ASS_INFO ('00101011'B),
205 RSL_IE_SACCH_INFO ('00101100'B),
206 RSL_IE_CBCH_LOAD_INFO ('00101101'B),
207 RSL_IE_SMSCB_CHAN_INDICATOR ('00101110'B),
208 RSL_IE_GROUP_CALL_REF ('00101111'B),
209 RSL_IE_CHAN_DESC ('00110000'B),
210 RSL_IE_NCH_DRX_INFO ('00110001'B),
211 RSL_IE_CMD_INDICATOR ('00110010'B),
212 RSL_IE_EMLPP_PRIO ('00110011'B),
213 RSL_IE_UIC ('00110100'B),
214 RSL_IE_MAIN_CHAN_REF ('00110101'B),
215 RSL_IE_MR_CONFIG ('00110110'B),
216 RSL_IE_MR_CONTROL ('00110111'B),
217 RSL_IE_SUP_CODEC_TYPES ('00111000'B),
218 RSL_IE_CODEC_CONFIG ('00111001'B),
219 RSL_IE_RTD ('00111010'B),
220 RSL_IE_TFO_STATUS ('00111011'B),
221 RSL_IE_LLP_APDU ('00111100'B),
Harald Welte643e2a62017-11-27 15:03:18 +0100222
Vadim Yanitskiy1f532152021-11-01 20:37:56 +0300223 RSL_IE_OSMO_REP_ACCH_CAP ('01100000'B),
Neels Hofmeyr2bef0dd2021-04-22 21:46:00 +0000224 RSL_IE_OSMO_TRAINING_SEQUENCE ('01100001'B),
Vadim Yanitskiya203d3b2021-11-01 21:32:31 +0300225 RSL_IE_OSMO_TOP_ACCH_CAP ('01100010'B),
Neels Hofmeyr2bef0dd2021-04-22 21:46:00 +0000226
Harald Welte643e2a62017-11-27 15:03:18 +0100227 /* ip.access */
228 RSL_IE_IPAC_SRTP_CONFIG ('11100000'B),
Harald Welte319be822017-12-07 17:50:26 +0100229 RSL_IE_IPAC_PROXY_UDP ('11100001'B),
230 RSL_IE_IPAC_BSCMPL_TOUT ('11100010'B),
Harald Welte643e2a62017-11-27 15:03:18 +0100231
232 RSL_IE_IPAC_REMOTE_IP ('11110000'B),
Harald Welte319be822017-12-07 17:50:26 +0100233 RSL_IE_IPAC_REMOTE_PORT ('11110001'B),
234 RSL_IE_IPAC_RTP_PAYLOAD ('11110010'B),
235 RSL_IE_IPAC_LOCAL_PORT ('11110011'B),
236 RSL_IE_IPAC_SPEECH_MODE ('11110100'B),
237 RSL_IE_IPAC_LOCAL_IP ('11110101'B),
238 RSL_IE_IPAC_CONN_STAT ('11110110'B),
239 RSL_IE_IPAC_HO_C_PARMS ('11110111'B),
240 RSL_IE_IPAC_CONN_ID ('11111000'B),
241 RSL_IE_IPAC_RTP_CSD_FMT ('11111001'B),
242 RSL_IE_IPAC_RTP_JIT_BUF ('11111010'B),
243 RSL_IE_IPAC_RTP_COMPR ('11111011'B),
244 RSL_IE_IPAC_RTP_PAYLOAD2 ('11111100'B),
245 RSL_IE_IPAC_RTP_MPLEX ('11111101'B),
246 RSL_IE_IPAC_RTP_MPLEX_ID ('11111110'B)
Harald Welte643e2a62017-11-27 15:03:18 +0100247 } with { variant "FIELDLENGTH(8)" };
248
249 type record RSL_LV {
250 uint8_t len,
251 octetstring payload
252 } with { variant (len) "LENGTHTO(payload)" }
253
Harald Welteefa7d912018-04-18 23:22:15 +0200254 template (value) RSL_LV ts_RSL_LV(template (value) octetstring pl) := {
Harald Welte643e2a62017-11-27 15:03:18 +0100255 len := 0,
256 payload := pl
257 }
258
Harald Welte51d74102017-12-10 23:05:02 +0100259 template RSL_LV tr_RSL_LV(template octetstring pl) := {
260 len := ?,
261 payload := pl
262 }
263
Harald Welte15bb5b52017-12-07 17:52:04 +0100264 type record RSL_L16V {
265 uint16_t len,
266 octetstring payload
267 } with { variant (len) "LENGTHTO(payload)" }
268
Harald Welteefa7d912018-04-18 23:22:15 +0200269 template (value) RSL_L16V ts_RSL_L16V(template (value) octetstring pl) := {
Harald Welte15bb5b52017-12-07 17:52:04 +0100270 len := 0,
271 payload := pl
272 }
273
Harald Welte7794d5b2017-12-16 23:00:20 +0100274 template RSL_L16V tr_RSL_L16V(template octetstring pl) := {
275 len := ?,
276 payload := pl
277 }
278
Harald Welte643e2a62017-11-27 15:03:18 +0100279 type record RSL_IE_V {
280 uint8_t val
281 }
282
283 /* 9.3.3 */
284 type record RSL_IE_ActivationType {
285 boolean reactivation,
286 uint4_t reserved,
Harald Welte921f9e02019-05-19 22:27:11 +0200287 RSL_ActivationAbits a_bits
288 };
289 type enumerated RSL_ActivationAbits {
290 ACT_REL_TO_IMM_ASSIGN ('000'B),
291 ACT_REL_TO_NORM_ASSIGN ('001'B),
292 ACT_REL_TO_ASYNC_HANDOVER ('010'B),
293 ACT_REL_TO_SYNC_HANDOVER ('011'B),
294 ACT_REL_TO_ADDL_ASSIGN ('100'B),
295 ACT_REL_TO_MSLOT_CONFIG ('101'B),
296 ACT_REL_TO_OSMO_PDCH ('111'B)
297 } with { variant "FIELDLENGTH(3)" };
Harald Welte643e2a62017-11-27 15:03:18 +0100298
Harald Welte921f9e02019-05-19 22:27:11 +0200299 const RSL_IE_ActivationType t_RSL_IE_ActType_IA := {
Harald Welte643e2a62017-11-27 15:03:18 +0100300 reactivation := false,
301 reserved := 0,
Harald Welte921f9e02019-05-19 22:27:11 +0200302 a_bits := ACT_REL_TO_IMM_ASSIGN
303 }
304 const RSL_IE_ActivationType t_RSL_IE_ActType_ASS := {
305 reactivation := false,
306 reserved := 0,
307 a_bits := ACT_REL_TO_NORM_ASSIGN
308 }
309 const RSL_IE_ActivationType t_RSL_IE_ActType_HO_ASYNC := {
310 reactivation := false,
311 reserved := 0,
312 a_bits := ACT_REL_TO_ASYNC_HANDOVER
313 }
314 const RSL_IE_ActivationType t_RSL_IE_ActType_HO_SYNC := {
315 reactivation := false,
316 reserved := 0,
317 a_bits := ACT_REL_TO_SYNC_HANDOVER
Harald Welte643e2a62017-11-27 15:03:18 +0100318 }
319
Harald Welte94e0c342018-04-07 11:33:23 +0200320 /* osmocom-style dynamic PDCH */
Vadim Yanitskiy58b16532021-10-09 20:27:39 +0600321 const RSL_IE_ActivationType c_RSL_IE_ActType_PDCH := {
Harald Welte94e0c342018-04-07 11:33:23 +0200322 reactivation := false,
323 reserved := 1,
Harald Welte921f9e02019-05-19 22:27:11 +0200324 a_bits := ACT_REL_TO_OSMO_PDCH
Harald Welte94e0c342018-04-07 11:33:23 +0200325 }
326
Vadim Yanitskiye02dbcc2020-08-25 04:20:51 +0700327 /* 9.3.5 */
328 type record RSL_IE_ChannelIdent {
329 uint8_t len,
330 /* 3GPP TS 44.018 Channel Description IE (TV) */
331 ChannelDescriptionTV ch_desc,
332 /* 3GPP TS 44.018 Mobile Allocation IE (shall be empty) */
333 MobileAllocationTLV ma
334 } with { variant (len) "LENGTHTO(ch_desc,ma)" };
335
336 template (value) RSL_IE_ChannelIdent
337 ts_RSL_ChannelIdent(template (value) ChannelDescription ch_desc) := {
338 len := 0, /* overwritten */
339 ch_desc := {
340 iei := '64'O,
341 v := ch_desc
342 },
343 /* Shall be included but empty */
344 ma := {
345 iei := '72'O,
346 v := {
347 len := 0,
348 ma := ''B
349 }
350 }
351 };
352
353 template RSL_IE_ChannelIdent
354 tr_RSL_ChannelIdent(template (present) ChannelDescription ch_desc := ?,
355 template (present) MobileAllocationLV ma := ?) := {
356 len := ?,
357 ch_desc := {
358 iei := '64'O,
359 v := ch_desc
360 },
361 /* Shall be included but empty */
362 ma := {
363 iei := '72'O,
364 v := ma
365 }
366 };
367
Harald Welte643e2a62017-11-27 15:03:18 +0100368 /* 9.3.6 */
369 type enumerated RSL_SpeechDataInd {
370 RSL_SPDI_SPEECH ('00000001'B),
371 RSL_SPDI_DATA ('00000010'B),
372 RSL_SPDI_SIGN ('00000011'B)
373 } with { variant "FIELDLENGTH(8)" };
374 type enumerated RSL_ChanRateType {
375 RSL_CHRT_SDCCH ('00000001'B),
376 RSL_CHRT_TCH_F ('00001000'B),
377 RSL_CHRT_TCH_H ('00001001'B),
378 RSL_CHRT_TCH_F_BD_MSLOT ('00001010'B),
379 RSL_CHRT_TCH_F_DL_MSLOT ('00011010'B),
380 RSL_CHRT_TCH_F_GROUP ('00011000'B),
381 RSL_CHRT_TCH_H_GROUP ('00011001'B),
382 RSL_CHRT_TCH_F_BCAST ('00101000'B),
Neels Hofmeyr2bef0dd2021-04-22 21:46:00 +0000383 RSL_CHRT_TCH_H_BCAST ('00101001'B),
384 RSL_CHRT_OSMO_TCH_F_VAMOS ('10001000'B),
385 RSL_CHRT_OSMO_TCH_H_VAMOS ('10001001'B)
Harald Welte643e2a62017-11-27 15:03:18 +0100386 } with { variant "FIELDLENGTH(8)" };
387 type enumerated RSL_SpeechAlgo {
388 RSL_CMOD_NO_RESOURCE ('00000000'B),
389 RSL_CMOD_SP_GSM1 ('00000001'B),
390 RSL_CMOD_SP_GSM2 ('00010001'B),
391 RSL_CMOD_SP_GSM3 ('00100001'B),
392 RSL_CMOD_SP_GSM4 ('00110001'B),
393 RSL_CMOD_SP_GSM5 ('00001001'B),
394 RSL_CMOD_SP_GSM6 ('00001101'B)
395 } with { variant "FIELDLENGTH(8)" };
396 type record RSL_IE_ChannelMode {
Harald Welte8f2c21d2017-12-07 17:52:40 +0100397 uint8_t len,
Harald Welte643e2a62017-11-27 15:03:18 +0100398 BIT6 reserved,
399 boolean dtx_d,
400 boolean dtx_u,
401 RSL_SpeechDataInd spd_ind,
402 RSL_ChanRateType ch_rate_type,
403 RSL_SpeechAlgo coding_alg_rate
Harald Welte8f2c21d2017-12-07 17:52:40 +0100404 } with { variant (len) "LENGTHTO(reserved,dtx_d,dtx_u,spd_ind,ch_rate_type,coding_alg_rate)" }
Harald Welte643e2a62017-11-27 15:03:18 +0100405
Vadim Yanitskiy8fc43df2020-10-20 02:11:05 +0700406 template (value) RSL_IE_ChannelMode ts_RSL_ChanMode_SIGN(RSL_ChanRateType t := RSL_CHRT_SDCCH,
407 boolean dtx_downlink := false) := {
Harald Welte8f2c21d2017-12-07 17:52:40 +0100408 len := 0, /* overwritten */
Harald Welte643e2a62017-11-27 15:03:18 +0100409 reserved := '000000'B,
Stefan Sperling4880be42018-08-07 18:12:59 +0200410 dtx_d := dtx_downlink,
Harald Welte643e2a62017-11-27 15:03:18 +0100411 dtx_u := false,
412 spd_ind := RSL_SPDI_SIGN,
Philipp Maierac693462020-10-14 20:21:44 +0200413 ch_rate_type := t,
Harald Welte643e2a62017-11-27 15:03:18 +0100414 coding_alg_rate := RSL_CMOD_NO_RESOURCE
415 }
416
Stefan Sperling4880be42018-08-07 18:12:59 +0200417 template (value) RSL_IE_ChannelMode ts_RSL_ChanMode(RSL_ChanRateType t, RSL_SpeechAlgo alg,
418 boolean dtx_downlink := false) := {
Harald Welte8f2c21d2017-12-07 17:52:40 +0100419 len := 0, /* overwritten */
Harald Welte643e2a62017-11-27 15:03:18 +0100420 reserved := '000000'B,
Stefan Sperling4880be42018-08-07 18:12:59 +0200421 dtx_d := dtx_downlink,
Harald Welte643e2a62017-11-27 15:03:18 +0100422 dtx_u := false,
423 spd_ind := RSL_SPDI_SPEECH,
424 ch_rate_type := t,
425 coding_alg_rate := alg
426 }
Harald Welte3618d9d2018-03-21 18:45:27 +0100427 template RSL_IE_ChannelMode tr_RSL_ChanMode(template RSL_ChanRateType t,
428 template RSL_SpeechAlgo alg) := {
429 len := ?,
430 reserved := '000000'B,
431 dtx_d := ?,
432 dtx_u := ?,
433 spd_ind := RSL_SPDI_SPEECH,
434 ch_rate_type := t,
435 coding_alg_rate := alg
436 }
Harald Welte643e2a62017-11-27 15:03:18 +0100437
Vadim Yanitskiy117c1762020-06-16 01:40:10 +0700438 /* 9.3.4 BS Power IE */
Harald Welte643e2a62017-11-27 15:03:18 +0100439 type record RSL_IE_BS_Power {
Vadim Yanitskiy117c1762020-06-16 01:40:10 +0700440 uint2_t reserved,
Harald Welte643e2a62017-11-27 15:03:18 +0100441 boolean epc,
442 boolean fpc,
Vadim Yanitskiy117c1762020-06-16 01:40:10 +0700443 uint4_t power_level
Harald Welte643e2a62017-11-27 15:03:18 +0100444 }
445
Vadim Yanitskiy117c1762020-06-16 01:40:10 +0700446 template (value) RSL_IE_BS_Power ts_RSL_IE_BS_Power(uint4_t power_level,
Eric Wildae8f2622019-06-18 17:05:11 +0200447 boolean epc := false, boolean fpc := false) := {
448 reserved := 0,
449 epc := epc,
450 fpc := fpc,
451 power_level := power_level
452 }
Vadim Yanitskiy2a5a1ef2021-06-30 00:51:48 +0200453 template RSL_IE_BS_Power
454 tr_RSL_IE_BS_Power(template (present) uint4_t power_level,
455 template (present) boolean epc := ?,
456 template (present) boolean fpc := ?) := {
457 reserved := ?,
458 epc := epc,
459 fpc := fpc,
460 power_level := power_level
461 }
Eric Wildae8f2622019-06-18 17:05:11 +0200462
Harald Welte73cd2712017-12-17 00:44:52 +0100463 /* 9.3.7 */
Harald Weltee613f962018-04-18 22:38:16 +0200464 type enumerated RSL_AlgId {
465 RSL_ALG_ID_A5_0 ('00000001'B),
466 RSL_ALG_ID_A5_1 ('00000010'B),
467 RSL_ALG_ID_A5_2 ('00000011'B),
468 RSL_ALG_ID_A5_3 ('00000100'B),
469 RSL_ALG_ID_A5_4 ('00000101'B),
470 RSL_ALG_ID_A5_5 ('00000110'B),
471 RSL_ALG_ID_A5_6 ('00000111'B),
472 RSL_ALG_ID_A5_7 ('00001000'B)
473 } with { variant "FIELDLENGTH(8)" };
Harald Welte73cd2712017-12-17 00:44:52 +0100474 type record RSL_IE_EncryptionInfo {
475 uint8_t len,
Harald Weltee613f962018-04-18 22:38:16 +0200476 RSL_AlgId alg_id,
Harald Welte73cd2712017-12-17 00:44:52 +0100477 octetstring key
478 } with { variant (len) "LENGTHTO(alg_id,key)" };
479
Harald Weltee613f962018-04-18 22:38:16 +0200480 template RSL_IE_EncryptionInfo tr_RSL_IE_EncrInfo(template RSL_AlgId alg,
481 template octetstring key) := {
Harald Welte73cd2712017-12-17 00:44:52 +0100482 len := ?,
483 alg_id := alg,
484 key := key
485 }
Harald Weltee613f962018-04-18 22:38:16 +0200486 template (value) RSL_IE_EncryptionInfo ts_RSL_IE_EncrInfo(template (value) RSL_AlgId alg,
487 octetstring key) := {
Harald Welteefa7d912018-04-18 23:22:15 +0200488 len := 0, /* overwritten */
489 alg_id := alg,
490 key := key
491 }
492
493
Harald Welte73cd2712017-12-17 00:44:52 +0100494
Harald Welte643e2a62017-11-27 15:03:18 +0100495 /* 9.3.8 */
496 type record RSL_IE_FrameNumber {
497 uint5_t t1_p,
498 uint6_t t3,
499 uint5_t t2
500 }
501 type RSL_IE_FrameNumber RSL_IE_StartingTime;
502
503 /* 9.3.10 */
504 type record RSL_IE_L1Info {
505 uint5_t ms_power_lvl,
506 boolean fpc,
507 uint2_t reserved,
508 uint8_t actual_ta
509 }
510
Neels Hofmeyrafe2ea52021-11-24 15:16:12 +0100511 template (value) RSL_IE_L1Info ts_RSL_IE_L1Info := {
512 ms_power_lvl := 0,
513 fpc := false,
514 reserved := 0,
515 actual_ta := 0
516 };
517
Harald Welte643e2a62017-11-27 15:03:18 +0100518 /* 9.3.13 */
519 type record RSL_IE_MS_Power {
520 uint2_t reserved,
521 boolean fpc_epc,
522 uint5_t power_level
523 }
Pau Espin Pedrolf7630a62019-10-28 15:07:08 +0100524 template RSL_IE_MS_Power tr_RSL_IE_MS_Power(template uint5_t power_level := ?,
525 template boolean fpc_epc := false) := {
526 reserved := 0,
527 fpc_epc := fpc_epc,
528 power_level := power_level
529 }
Harald Welte10280172019-05-19 22:28:04 +0200530 template (value) RSL_IE_MS_Power ts_RSL_IE_MS_Power(uint5_t power_level,
531 boolean fpc_epc := false) := {
532 reserved := 0,
533 fpc_epc := fpc_epc,
534 power_level := power_level
535 }
Harald Welte643e2a62017-11-27 15:03:18 +0100536
Harald Welted5f521e2017-12-07 17:53:06 +0100537 /* 9.3.18 */
538 type record RSL_IE_RachLoad {
539 uint8_t len,
540 uint16_t slot_count,
541 uint16_t busy_count,
542 uint16_t access_count
543 } with { variant (len) "LENGTHTO(slot_count,busy_count,access_count)" }
544
Harald Welteefa7d912018-04-18 23:22:15 +0200545 template (value) RSL_IE_RachLoad ts_RSL_IE_RachLoad(uint16_t slot, uint16_t busy, uint16_t acc) := {
Harald Welted5f521e2017-12-07 17:53:06 +0100546 len := 0, /* overwritten */
547 slot_count := slot,
548 busy_count := busy,
549 access_count := acc
550 }
551
Harald Welte68e495b2018-02-25 00:05:57 +0100552 template RSL_IE_RachLoad tr_RSL_IE_RachLoad(template uint16_t slot,
553 template uint16_t busy,
554 template uint16_t acc) := {
555 len := ?, /* overwritten */
556 slot_count := slot,
557 busy_count := busy,
558 access_count := acc
559 }
560
Harald Welte643e2a62017-11-27 15:03:18 +0100561 /* 9.3.19 */
562 type record RSL_IE_RequestRef {
563 OCT1 ra,
564 RSL_IE_FrameNumber frame_nr
565 }
566
567 /* 3GPP TS 44.018 / 10.5.2.38 Starting Time */
Harald Welte94e0c342018-04-07 11:33:23 +0200568 template (value) RSL_IE_FrameNumber ts_RSL_IE_FrameNumber(GsmFrameNumber fn) := {
Harald Welte643e2a62017-11-27 15:03:18 +0100569 t1_p := (fn / 1326) mod 32,
570 t3 := fn mod 51,
571 t2 := fn mod 26
572 }
573
Harald Welte9abd1282018-02-19 19:18:17 +0100574 function tr_RSL_IE_FrameNumber(template GsmFrameNumber fn) return template RSL_IE_FrameNumber {
575 if (istemplatekind(fn, "?")) {
576 return ?;
577 } else {
578 return ts_RSL_IE_FrameNumber(valueof(fn));
579 }
580 }
581
Harald Welteefa7d912018-04-18 23:22:15 +0200582 template (value) RSL_IE_RequestRef ts_RSL_IE_ReqRef(OCT1 ra, GsmFrameNumber frame_nr) := {
Harald Welte643e2a62017-11-27 15:03:18 +0100583 ra := ra,
584 frame_nr := ts_RSL_IE_FrameNumber(frame_nr)
585 }
586
Harald Welte9abd1282018-02-19 19:18:17 +0100587 template RSL_IE_RequestRef tr_RSL_IE_ReqRef(template OCT1 ra, template GsmFrameNumber frame_nr) := {
588 ra := ra,
589 frame_nr := tr_RSL_IE_FrameNumber(frame_nr)
590 }
591
Vadim Yanitskiy9f699532021-06-03 17:29:22 +0200592 /* 9.3.21 Resource Information */
593 type record RSL_IE_ResourceInfo {
594 uint8_t len,
595 RSL_ResourceInfo info
596 } with { variant (len) "LENGTHTO(info)" };
597
598 type record of RSL_ResourceInfoItem RSL_ResourceInfo;
599 type record RSL_ResourceInfoItem {
600 RslChannelNr chan_nr,
601 uint3_t interf_band,
602 BIT5 rfu ('00000'B)
603 };
604
605 template (value) RSL_ResourceInfoItem
606 ts_RSL_ResourceInfoItem(template (value) RslChannelNr chan_nr,
607 template (value) uint3_t interf_band := 0) := {
608 chan_nr := chan_nr,
609 interf_band := interf_band,
610 rfu := '00000'B
611 }
612 template RSL_ResourceInfoItem
613 tr_RSL_ResourceInfoItem(template (present) RslChannelNr chan_nr := ?,
614 template (present) uint3_t interf_band := ?) := {
615 chan_nr := chan_nr,
616 interf_band := interf_band,
617 rfu := ? /* Tolerate unknown values */
618 }
619
Harald Welte15de8ba2018-06-29 08:51:42 +0200620 /* Osmocom Extension */
621 type record RSL_IE_UplinkMeasSuppMeasInfo {
622 int16_t toa256_mean,
623 int16_t toa256_min,
624 int16_t toa256_max,
625 uint16_t toa256_std_dev
626 };
627
Harald Welte2691adf2018-02-22 17:32:39 +0100628 /* 9.3.25 */
629 type record RSL_IE_UplinkMeas {
630 uint8_t len,
631 BIT1 rfu,
632 boolean dtx_d,
633 uint6_t rxlev_f_u,
634 BIT2 reserved1,
635 uint6_t rxlev_s_u,
636 BIT2 reserved2,
637 uint3_t rxq_f_u,
638 uint3_t rxq_s_u,
Harald Welte15de8ba2018-06-29 08:51:42 +0200639 RSL_IE_UplinkMeasSuppMeasInfo supp_meas_info optional
Harald Welte2691adf2018-02-22 17:32:39 +0100640 } with { variant (len) "LENGTHTO(rfu,dtx_d,rxlev_f_u,reserved1,rxlev_s_u,reserved2,rxq_f_u,rxq_s_u,supp_meas_info)" };
Harald Welte9abd1282018-02-19 19:18:17 +0100641
Neels Hofmeyrafe2ea52021-11-24 15:16:12 +0100642 template (value) RSL_IE_UplinkMeas ts_RSL_IE_UplinkMeas(uint6_t rxlev := 12, uint3_t rxqual := 0) := {
643 len := 0, /* overwritten */
644 rfu := '0'B,
645 dtx_d := false,
646 rxlev_f_u := rxlev,
647 reserved1 := '00'B,
648 rxlev_s_u := rxlev,
649 reserved2 := '00'B,
650 rxq_f_u := rxqual,
651 rxq_s_u := rxqual,
652 supp_meas_info := omit
653 };
654
Harald Welte643e2a62017-11-27 15:03:18 +0100655 /* 9.3.26 */
Harald Weltea8ed9062017-12-14 09:46:01 +0100656 type enumerated RSL_Cause {
657 /* normal event */
658 RSL_ERR_RADIO_IF_FAIL ('00'O),
659 RSL_ERR_RADIO_LINK_FAIL ('01'O),
660 RSL_ERR_HANDOVER_ACC_FAIL ('02'O),
661 RSL_ERR_TALKER_ACC_FAIL ('03'O),
662 RSL_ERR_OM_INTERVENTION ('07'O),
663 RSL_ERR_NORMAL_UNSPEC ('0f'O),
664 RSL_ERR_T_MSRFPCI_EXP ('18'O),
665 /* resource unavailable */
666 RSL_ERR_EQUIPMENT_FAIL ('20'O),
667 RSL_ERR_RR_UNAVAIL ('21'O),
668 RSL_ERR_TERR_CH_FAIL ('22'O),
669 RSL_ERR_CCCH_OVERLOAD ('23'O),
670 RSL_ERR_ACCH_OVERLOAD ('24'O),
671 RSL_ERR_PROCESSOR_OVERLOAD ('25'O),
672 RSL_ERR_BTS_NOT_EQUIPPED ('27'O),
673 RSL_ERR_REMOTE_TRAU_FAILURE ('28'O),
674 RSL_ERR_NOTIF_OVERFLOW ('29'O),
675 RSL_ERR_RES_UNAVAIL ('2f'O),
676 /* service or option not available */
677 RSL_ERR_TRANSC_UNAVAIL ('30'O),
678 RSL_ERR_SERV_OPT_UNAVAIL ('3f'O),
679 /* service or option not implemented */
680 RSL_ERR_ENCR_UNIMPL ('40'O),
681 RSL_ERR_SERV_OPT_UNIMPL ('4f'O),
682 /* invalid message */
683 RSL_ERR_RCH_ALR_ACTV_ALLOC ('50'O),
Harald Welte9912eb52018-02-25 13:30:15 +0100684 RSL_ERR_IPA_RCH_NOT_ACTV_ALLOC ('51'O),
685 RSL_ERR_IPA_CONN_INVALID ('52'O),
686 RSL_ERR_IPA_CONN_IN_USE ('53'O),
687 RSL_ERR_IPA_CONN_ALREADY_EXISTS ('54'O),
Harald Weltea8ed9062017-12-14 09:46:01 +0100688 RSL_ERR_INVALID_MESSAGE ('5f'O),
689 /* protocol error */
690 RSL_ERR_MSG_DISCR ('60'O),
691 RSL_ERR_MSG_TYPE ('61'O),
692 RSL_ERR_MSG_SEQ ('62'O),
693 RSL_ERR_IE_ERROR ('63'O),
694 RSL_ERR_MAND_IE_ERROR ('64'O),
695 RSL_ERR_OPT_IE_ERROR ('65'O),
696 RSL_ERR_IE_NONEXIST ('66'O),
697 RSL_ERR_IE_LENGTH ('67'O),
698 RSL_ERR_IE_CONTENT ('68'O),
699 RSL_ERR_PROTO ('6f'O),
700 /* interworking */
701 RSL_ERR_INTERWORKING ('7f'O)
702 };
Harald Welte643e2a62017-11-27 15:03:18 +0100703 type record RSL_IE_Cause {
Harald Welte6efa8e32017-12-09 22:34:06 +0100704 uint8_t len,
Harald Welte643e2a62017-11-27 15:03:18 +0100705 uint1_t e,
706 RSL_Cause cause,
707 octetstring cause_ext optional
Harald Welte6efa8e32017-12-09 22:34:06 +0100708 } with { variant (len) "LENGTHTO(e,cause,cause_ext)" }
Harald Welte643e2a62017-11-27 15:03:18 +0100709
Harald Welteefa7d912018-04-18 23:22:15 +0200710 template (value) RSL_IE_Cause ts_RSL_IE_Cause(RSL_Cause cause) := {
Harald Welte6efa8e32017-12-09 22:34:06 +0100711 len := 0, /* overwritten */
Harald Welte643e2a62017-11-27 15:03:18 +0100712 e := 0,
713 cause := cause,
714 cause_ext := omit
715 }
716
Harald Welte9abd1282018-02-19 19:18:17 +0100717 template RSL_IE_Cause tr_RSL_IE_Cause(template RSL_Cause cause) := {
718 len := ?,
719 e := 0,
720 cause := cause,
721 cause_ext := omit
722 }
723
Harald Weltec8d363c2019-05-19 20:36:48 +0200724 /* 9.3.29 */
725 type record RSL_SacchInfo {
726 uint8_t len,
727 uint8_t num_msgs,
728 RSL_SacchInfoElements elems
729 } with {
730 variant (len) "LENGTHTO(num_msgs,elems)";
731 variant (num_msgs) "LENGTHTO(elems)";
732 variant (num_msgs) "UNIT(elements)"
733 };
734 type record RSL_SacchInfoElement {
735 RSL_IE_SysinfoType si_type,
736 uint8_t len,
737 octetstring msg
738 } with {
739 variant (len) "LENGTHTO(msg)";
740 };
741 type record of RSL_SacchInfoElement RSL_SacchInfoElements;
742 template (value) RSL_SacchInfo ts_RSL_SacchInfo(template (value) RSL_SacchInfoElements elems) := {
743 len := 0, /* overwritten */
744 num_msgs := 0, /* overwritten */
745 elems := elems
746 }
747 template (value) RSL_SacchInfoElement ts_RSL_SacchInfoElem(RSL_IE_SysinfoType tp, octetstring msg) := {
748 si_type := tp,
749 len := lengthof(msg),
750 msg := msg
751 }
752
Eric Wild61edb7e2019-06-03 12:38:31 +0200753 /* 9.3.31 */
754 type record RSL_IE_MS_Power_Parameters {
755 uint8_t len,
756 octetstring params
757 } with {
758 variant (len) "LENGTHTO(params)";
759 };
760 template (value) RSL_IE_MS_Power_Parameters ts_RSL_IE_MS_Power_Parameters(octetstring params) := {
761 len := 0, /* overwritten */
762 params := params
763 }
764
Harald Welte643e2a62017-11-27 15:03:18 +0100765 /* 9.3.40 */
766 type enumerated RSL_ChanNeeded {
767 RSL_CHANNEED_ANY ('00'B),
768 RSL_CHANNEED_SDCCH ('01'B),
769 RSL_CHANNEED_TCH_F ('10'B),
770 RSL_CHANNEED_TCH_ForH ('11'B)
Harald Welte51d74102017-12-10 23:05:02 +0100771 } with { variant "FIELDLENGTH(2)" };
Harald Welte643e2a62017-11-27 15:03:18 +0100772 type record RSL_IE_ChanNeeded {
773 uint6_t reserved,
774 RSL_ChanNeeded chan_needed
775 }
776
Harald Weltecc373202018-09-10 10:28:21 +0200777 /* 9.3.41 CB Command Type */
778 type enumerated RSL_CbCommand {
779 RSL_CB_CMD_NORMAL ('0000'B),
780 RSL_CB_CMD_SCHEDULE ('1000'B),
781 RSL_CB_CMD_DEFAULT ('1110'B),
782 RSL_CB_CMD_NULL ('1111'B)
783 } with { variant "FIELDLENGTH(4)" };
784 type record RSL_IE_CbCommandType {
785 RSL_CbCommand command,
786 boolean default_bcast_null,
787 BIT1 spare,
788 uint2_t last_block
789 };
790 template (value) RSL_IE_CbCommandType ts_RSL_IE_CbCmdType(RSL_CbCommand cmd := RSL_CB_CMD_NORMAL,
791 uint2_t last_block := 1,
792 boolean def_bcast_null := true) := {
793 command := cmd,
794 default_bcast_null := def_bcast_null,
795 spare := '0'B,
796 last_block := last_block
797 }
798
Harald Welte4a129f82019-05-21 16:35:22 +0200799 /* 9.4.43 CBCH Load Information */
800 type record RSL_IE_CbchLoadInfo {
801 boolean overflow,
802 BIT3 spare,
803 uint4_t slot_count
804 };
805 template RSL_IE_CbchLoadInfo tr_CbchLoadInfo(template boolean overflow,
806 template uint4_t slot_count) := {
807 overflow := overflow,
808 spare := ?,
809 slot_count := slot_count
810 }
811 template (value) RSL_IE_CbchLoadInfo ts_CbchLoadInfo(boolean overflow, uint4_t slot_count) := {
812 overflow := overflow,
813 spare := '000'B,
814 slot_count := slot_count
815 }
816
Pau Espin Pedrolf7634dc2022-09-02 17:56:00 +0200817 /* 9.3.52, 3GPP TS 44.018 10.5.2.21aa */
818 type record RSL_IE_MultirateCfg {
819 uint8_t len,
820 uint3_t mr_speech_ver,
821 boolean nscb,
822 boolean icmi,
823 BIT1 spare,
824 uint2_t start_mode,
825 BIT8 amr_codec_modes,
826 octetstring parameters
827 } with {
828 variant (len) "LENGTHTO(mr_speech_ver,nscb,icmi,spare,start_mode,amr_codec_modes,parameters)"
829 };
830 template (value) RSL_IE_MultirateCfg ts_RSL_MultirateCfg(boolean icmi := true, uint2_t start_mode := 0,
831 BIT8 amr_codec_modes := '00000100'B /* 5,90k */) := {
832 len := 2,
833 mr_speech_ver := 1,
834 nscb := false,
835 icmi := icmi,
836 spare := '0'B,
837 start_mode := start_mode,
838 amr_codec_modes := amr_codec_modes,
839 parameters := ''O
840 }
841
Harald Welte643e2a62017-11-27 15:03:18 +0100842 /* 9.3.53 */
843 type record RSL_IE_MultirateCtrl {
844 uint3_t spare,
845 boolean od,
846 boolean pre,
847 uint2_t rae,
848 boolean tfo
849 }
850
851 type enumerated RSL_IE_SysinfoType {
852 RSL_SYSTEM_INFO_8 ('00000000'B),
853 RSL_SYSTEM_INFO_1 ('00000001'B),
854 RSL_SYSTEM_INFO_2 ('00000010'B),
855 RSL_SYSTEM_INFO_3 ('00000011'B),
856 RSL_SYSTEM_INFO_4 ('00000100'B),
857 RSL_SYSTEM_INFO_5 ('00000101'B),
858 RSL_SYSTEM_INFO_6 ('00000110'B),
859 RSL_SYSTEM_INFO_7 ('00000111'B),
860 RSL_SYSTEM_INFO_16 ('00001000'B),
861 RSL_SYSTEM_INFO_17 ('00001001'B),
862 RSL_SYSTEM_INFO_2bis ('00001010'B),
863 RSL_SYSTEM_INFO_2ter ('00001011'B),
864 RSL_SYSTEM_INFO_5bis ('00001101'B),
865 RSL_SYSTEM_INFO_5ter ('00001110'B),
866 RSL_SYSTEM_INFO_10 ('00001111'B),
867 RSL_EXT_MEAS_ORDER ('01000111'B),
868 RSL_MEAS_INFO ('01001000'B),
869 RSL_SYSTEM_INFO_13 ('00101000'B),
870 RSL_ERIC_SYSTEM_INFO_13 ('00001100'B),
871 RSL_SYSTEM_INFO_2quater ('00101001'B),
872 RSL_SYSTEM_INFO_9 ('00101010'B),
873 RSL_SYSTEM_INFO_18 ('00101011'B),
874 RSL_SYSTEM_INFO_19 ('00101100'B),
875 RSL_SYSTEM_INFO_20 ('00101101'B)
876 } with { variant "FIELDLENGTH(8)" }
877
Harald Welte9958a4d2017-12-14 21:21:33 +0100878 type record RSL_IE_IPA_ConnectionStats {
879 uint8_t len,
880 uint32_t tx_packets,
881 uint32_t tx_octets,
882 uint32_t rx_packets,
883 uint32_t rx_octets,
884 uint32_t lost_packets,
885 uint32_t jitter,
886 uint32_t avg_delay
887 } with { variant (len) "LENGTHTO(tx_packets,tx_octets,rx_packets,rx_octets,lost_packets,jitter,avg_delay)" }
888
889 type enumerated RSL_IPA_SpeechMode {
890 RSL_IPA_SPM_SENDRECV ('00'B),
891 RSL_IPA_SPM_RECVONLY ('01'B),
892 RSL_IPA_SPM_SENDONLY ('10'B),
893 RSL_IPA_SPM_RESERVED ('11'B)
894 } with { variant "FIELDLENGTH(2)" }
895
896 type enumerated RSL_IPA_Codec {
897 RSL_IPA_CODEC_FR ('0000'B),
898 RSL_IPA_CODEC_EFR ('0001'B),
899 RSL_IPA_CODEC_AMR_F ('0010'B),
900 RSL_IPA_CODEC_HR ('0011'B),
901 RSL_IPA_CODEC_AMR_H ('0101'B),
902 RSL_IPA_CODEC_RTP_PT ('1111'B)
903 } with { variant "FIELDLENGTH(4)" }
904
905 type record RSL_IE_IPA_SpeechMode {
906 BIT2 reserved,
907 RSL_IPA_SpeechMode mode,
908 RSL_IPA_Codec codec
909 }
910
Harald Welte0472ab42018-03-12 15:02:26 +0100911 /* 9.3.20 */
912 type enumerated RSL_IE_ReleaseMode {
913 RSL_REL_MODE_NORMAL ('00'B),
914 REL_REL_MODE_LOCAL ('01'B)
915 }
916
Neels Hofmeyr2bef0dd2021-04-22 21:46:00 +0000917 type record RSL_IE_OSMO_TrainingSequence {
918 uint8_t len,
919 uint8_t tsc_set,
920 uint8_t tsc
921 } with { variant (len) "LENGTHTO(tsc_set,tsc)" }
922
Vadim Yanitskiy1f532152021-11-01 20:37:56 +0300923 type record RSL_IE_OSMO_RepAcchCap {
924 uint8_t len,
925 BIT1 rfu ('0'B),
926 uint3_t rxqual,
927 boolean ul_sacch,
928 boolean dl_sacch,
929 boolean dl_facch_all,
930 boolean dl_facch_cmd
931 } with { variant (len) "LENGTHTO(rfu,rxqual,ul_sacch,dl_sacch,dl_facch_all,dl_facch_cmd)" }
932
Vadim Yanitskiya203d3b2021-11-01 21:32:31 +0300933 type record RSL_IE_OSMO_TopAcchCap {
934 uint8_t len,
935 boolean sacch_enable,
936 boolean facch_enable,
937 uint3_t rxqual,
938 uint3_t overpower_db
939 } with { variant (len) "LENGTHTO(sacch_enable,facch_enable,rxqual,overpower_db)" }
940
Vadim Yanitskiy66d3c332021-11-06 18:18:13 +0300941 template (value) RSL_IE_OSMO_TopAcchCap
942 ts_RSL_IE_OSMO_TopAcchCap(template (value) uint3_t overpower := 2,
943 template (value) uint3_t rxqual := 4,
944 boolean facch_enable := true,
945 boolean sacch_enable := true) := {
946 len := 0, /* overwritten */
947 sacch_enable := sacch_enable,
948 facch_enable := facch_enable,
949 rxqual := rxqual,
950 overpower_db := overpower
951 };
952 template RSL_IE_OSMO_TopAcchCap
953 tr_RSL_IE_OSMO_TopAcchCap(template (present) uint3_t overpower := ?,
954 template (present) uint3_t rxqual := ?,
955 template (present) boolean facch_enable := ?,
956 template (present) boolean sacch_enable := ?) := {
957 len := ?, /* overwritten */
958 sacch_enable := sacch_enable,
959 facch_enable := facch_enable,
960 rxqual := rxqual,
961 overpower_db := overpower
962 };
963
Harald Welte643e2a62017-11-27 15:03:18 +0100964 /* union of all IE bodies */
965 type union RSL_IE_Body {
966 RslChannelNr chan_nr,
967 RslLinkId link_id,
Harald Welte15bb5b52017-12-07 17:52:04 +0100968 RSL_L16V l3_info,
Harald Welte643e2a62017-11-27 15:03:18 +0100969 RSL_LV rlm_cause,
Harald Welte0472ab42018-03-12 15:02:26 +0100970 RSL_IE_ReleaseMode release_mode,
Harald Welte643e2a62017-11-27 15:03:18 +0100971 RSL_IE_ActivationType act_type,
Vadim Yanitskiye02dbcc2020-08-25 04:20:51 +0700972 RSL_IE_ChannelIdent chan_ident,
Harald Welte643e2a62017-11-27 15:03:18 +0100973 RSL_IE_ChannelMode chan_mode,
974 uint8_t handover_ref,
975 RSL_IE_BS_Power bs_power,
Vadim Yanitskiy802508e2020-11-11 07:25:47 +0700976 RSL_LV bs_power_params,
Harald Welte643e2a62017-11-27 15:03:18 +0100977 RSL_IE_MS_Power ms_power,
Eric Wild61edb7e2019-06-03 12:38:31 +0200978 RSL_IE_MS_Power_Parameters ms_power_params,
Harald Welte643e2a62017-11-27 15:03:18 +0100979 uint8_t timing_adv,
Pau Espin Pedrolf7634dc2022-09-02 17:56:00 +0200980 RSL_IE_MultirateCfg multirate_cfg,
Harald Welte643e2a62017-11-27 15:03:18 +0100981 RSL_IE_MultirateCtrl multirate_ctrl,
Harald Weltea6706152019-05-19 20:38:18 +0200982 uint8_t msg_id,
Harald Welte643e2a62017-11-27 15:03:18 +0100983 RSL_IE_FrameNumber frame_nr,
984 RSL_IE_Cause cause,
985 uint8_t access_delay,
Harald Welted5f521e2017-12-07 17:53:06 +0100986 RSL_IE_RachLoad rach_load,
Harald Welte643e2a62017-11-27 15:03:18 +0100987 uint8_t meas_res_nr,
Harald Welte2691adf2018-02-22 17:32:39 +0100988 uint8_t ms_timing_offset,
989 RSL_IE_UplinkMeas uplink_meas,
Harald Welte643e2a62017-11-27 15:03:18 +0100990 RSL_IE_L1Info l1_info,
991 RSL_IE_SysinfoType sysinfo_type,
992 uint16_t paging_load,
993 uint8_t paging_group,
994 RSL_IE_ChanNeeded chan_needed,
Harald Weltecc373202018-09-10 10:28:21 +0200995 RSL_IE_CbCommandType cb_cmd_type,
996 RSL_LV smscb_message,
Harald Welte4a129f82019-05-21 16:35:22 +0200997 RSL_IE_CbchLoadInfo cbch_load_info,
Vadim Yanitskiy9f699532021-06-03 17:29:22 +0200998 RSL_IE_ResourceInfo resource_info,
Harald Weltec8d363c2019-05-19 20:36:48 +0200999 RSL_SacchInfo sacch_info,
Harald Weltecc373202018-09-10 10:28:21 +02001000
Harald Welte643e2a62017-11-27 15:03:18 +01001001 RSL_IE_StartingTime starting_time,
Harald Welte73cd2712017-12-17 00:44:52 +01001002 RSL_IE_EncryptionInfo encr_info,
Harald Weltea3ff6702019-05-20 20:03:50 +02001003 uint8_t smscb_chan_ind,
Harald Welte643e2a62017-11-27 15:03:18 +01001004 RSL_IE_RequestRef req_ref,
1005 RSL_LV full_imm_ass_info,
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +07001006 MobileIdentityLV ms_identity,
Harald Welte643e2a62017-11-27 15:03:18 +01001007
Harald Welte9958a4d2017-12-14 21:21:33 +01001008 uint16_t ipa_conn_id,
1009 uint16_t ipa_local_port,
1010 uint16_t ipa_remote_port,
Vadim Yanitskiyfc631642021-07-03 02:42:45 +02001011 OCT4 ipa_local_ip,
1012 OCT4 ipa_remote_ip,
Harald Welte9958a4d2017-12-14 21:21:33 +01001013 uint8_t ipa_rtp_pt,
1014 uint8_t ipa_rtp_pt2,
1015 RSL_IE_IPA_ConnectionStats ipa_stats,
1016 RSL_IE_IPA_SpeechMode ipa_speech_mode,
1017
Neels Hofmeyr2bef0dd2021-04-22 21:46:00 +00001018 RSL_IE_OSMO_TrainingSequence osmo_training_sequence,
Vadim Yanitskiy1f532152021-11-01 20:37:56 +03001019 RSL_IE_OSMO_RepAcchCap rep_acch_cap,
Vadim Yanitskiya203d3b2021-11-01 21:32:31 +03001020 RSL_IE_OSMO_TopAcchCap top_acch_cap,
Neels Hofmeyr2bef0dd2021-04-22 21:46:00 +00001021
Harald Welte643e2a62017-11-27 15:03:18 +01001022 RSL_LV other
1023 }
1024
1025 type record RSL_IE {
1026 RSL_IE_Type iei,
1027 RSL_IE_Body body
1028 } with { variant (body) "CROSSTAG(
1029 chan_nr, iei = RSL_IE_CHAN_NR;
1030 link_id, iei = RSL_IE_LINK_IDENT;
1031 l3_info, iei = RSL_IE_L3_INFO;
1032 rlm_cause, iei = RSL_IE_RLM_CAUSE;
1033 release_mode, iei = RSL_IE_RELEASE_MODE;
1034 act_type, iei = RSL_IE_ACT_TYPE;
Vadim Yanitskiye02dbcc2020-08-25 04:20:51 +07001035 chan_ident, iei = RSL_IE_CHAN_IDENT;
Harald Welte643e2a62017-11-27 15:03:18 +01001036 chan_mode, iei = RSL_IE_CHAN_MODE;
1037 handover_ref, iei = RSL_IE_HANDO_REF;
1038 bs_power, iei = RSL_IE_BS_POWER;
Vadim Yanitskiy802508e2020-11-11 07:25:47 +07001039 bs_power_params, iei = RSL_IE_BS_POWER_PARAM;
Harald Welte643e2a62017-11-27 15:03:18 +01001040 ms_power, iei = RSL_IE_MS_POWER;
Eric Wild61edb7e2019-06-03 12:38:31 +02001041 ms_power_params, iei = RSL_IE_MS_POWER_PARAM;
Harald Welte643e2a62017-11-27 15:03:18 +01001042 timing_adv, iei = RSL_IE_TIMING_ADVANCE;
Pau Espin Pedrolf7634dc2022-09-02 17:56:00 +02001043 multirate_cfg, iei = RSL_IE_MR_CONFIG;
Harald Welte643e2a62017-11-27 15:03:18 +01001044 multirate_ctrl, iei = RSL_IE_MR_CONTROL;
Harald Weltea6706152019-05-19 20:38:18 +02001045 msg_id, iei = RSL_IE_MSG_ID;
Harald Welte643e2a62017-11-27 15:03:18 +01001046
1047 frame_nr, iei = RSL_IE_FRAME_NUMBER;
1048 cause, iei = RSL_IE_CAUSE;
1049 access_delay, iei = RSL_IE_ACCESS_DELAY;
Harald Welted5f521e2017-12-07 17:53:06 +01001050 rach_load, iei = RSL_IE_RACH_LOAD;
Harald Welte643e2a62017-11-27 15:03:18 +01001051 meas_res_nr, iei = RSL_IE_MEAS_RES_NR;
Harald Welte2691adf2018-02-22 17:32:39 +01001052 ms_timing_offset, iei = RSL_IE_MS_TIMING_OFFSET;
1053 uplink_meas, iei = RSL_IE_UPLINK_MEAS;
Harald Welte643e2a62017-11-27 15:03:18 +01001054 l1_info, iei = RSL_IE_L1_INFO;
1055 sysinfo_type, iei = RSL_IE_SYSINFO_TYPE;
1056 paging_load, iei = RSL_IE_PAGING_LOAD;
1057 paging_group, iei = RSL_IE_PAGING_GROUP;
1058 chan_needed, iei = RSL_IE_CHAN_NEEDED;
Harald Weltecc373202018-09-10 10:28:21 +02001059 cb_cmd_type, iei = RSL_IE_CB_CMD_TYPE;
1060 smscb_message, iei = RSL_IE_SMSCB_MSG;
Harald Welte4a129f82019-05-21 16:35:22 +02001061 cbch_load_info, iei = RSL_IE_CBCH_LOAD_INFO;
Vadim Yanitskiy9f699532021-06-03 17:29:22 +02001062 resource_info, iei = RSL_IE_RESOURCE_INFO;
Harald Weltec8d363c2019-05-19 20:36:48 +02001063 sacch_info, iei = RSL_IE_SACCH_INFO;
Harald Welte643e2a62017-11-27 15:03:18 +01001064 starting_time, iei = RSL_IE_STARTNG_TIME;
Harald Welte73cd2712017-12-17 00:44:52 +01001065 encr_info, iei = RSL_IE_ENCR_INFO;
Harald Weltea3ff6702019-05-20 20:03:50 +02001066 smscb_chan_ind, iei = RSL_IE_SMSCB_CHAN_INDICATOR;
Harald Welte643e2a62017-11-27 15:03:18 +01001067
1068 req_ref, iei = RSL_IE_REQ_REFERENCE;
Harald Weltefff69302017-12-07 17:53:42 +01001069 full_imm_ass_info, iei = RSL_IE_FULL_IMM_ASS_INFO;
1070 ms_identity, iei = RSL_IE_MS_IDENTITY;
1071 other, iei = RSL_IE_FULL_BCCH_INFO;
Harald Welte643e2a62017-11-27 15:03:18 +01001072
Harald Welte9958a4d2017-12-14 21:21:33 +01001073 ipa_conn_id, iei = RSL_IE_IPAC_CONN_ID;
1074 ipa_remote_ip, iei = RSL_IE_IPAC_REMOTE_IP;
1075 ipa_remote_port, iei = RSL_IE_IPAC_REMOTE_PORT;
1076 ipa_local_ip, iei = RSL_IE_IPAC_LOCAL_IP;
1077 ipa_local_port, iei = RSL_IE_IPAC_LOCAL_PORT;
1078 ipa_rtp_pt, iei = RSL_IE_IPAC_RTP_PAYLOAD;
1079 ipa_rtp_pt2, iei = RSL_IE_IPAC_RTP_PAYLOAD2;
1080 ipa_stats, iei = RSL_IE_IPAC_CONN_STAT;
1081 ipa_speech_mode, iei = RSL_IE_IPAC_SPEECH_MODE;
1082
Neels Hofmeyr2bef0dd2021-04-22 21:46:00 +00001083 osmo_training_sequence, iei = RSL_IE_OSMO_TRAINING_SEQUENCE;
Vadim Yanitskiy1f532152021-11-01 20:37:56 +03001084 rep_acch_cap, iei = RSL_IE_OSMO_REP_ACCH_CAP;
Vadim Yanitskiya203d3b2021-11-01 21:32:31 +03001085 top_acch_cap, iei = RSL_IE_OSMO_TOP_ACCH_CAP;
Neels Hofmeyr2bef0dd2021-04-22 21:46:00 +00001086
Harald Welte643e2a62017-11-27 15:03:18 +01001087 other, OTHERWISE;
1088 )" };
1089
Harald Welte735dd072017-12-12 14:55:17 +01001090 /* For some reason the TTCN-3 RAW codec cannot automatically figure out the IEI
1091 * that it needs to set for a given union-choice (body). So we have to explicitly
1092 * specify the IEI by the caller :( */
Harald Welteefa7d912018-04-18 23:22:15 +02001093 template (value) RSL_IE t_RSL_IE(RSL_IE_Type iei, template (value) RSL_IE_Body body) := {
Harald Welte735dd072017-12-12 14:55:17 +01001094 iei := iei,
Harald Welte643e2a62017-11-27 15:03:18 +01001095 body := body
1096 }
1097
Harald Weltec2877752017-12-07 17:54:35 +01001098 template RSL_IE tr_RSL_IE(template RSL_IE_Body body) := {
1099 iei := ?, /* overwritten? */
1100 body := body
1101 }
1102
1103
Harald Welte643e2a62017-11-27 15:03:18 +01001104 type record of RSL_IE RSL_IE_List;
1105
1106 type record RSL_Message {
1107 RSL_MessageDiscriminator msg_disc,
1108 RSL_MessageType msg_type,
1109 RSL_IE_List ies optional
1110 }
1111
1112 external function enc_RSL_Message(in RSL_Message msg) return octetstring
1113 with { extension "prototype(convert) encode(RAW)" };
1114 external function dec_RSL_Message(in octetstring stream) return RSL_Message
1115 with { extension "prototype(convert) decode(RAW)" };
1116
Harald Weltebc330be2017-12-09 00:56:36 +01001117 template RSL_Message tr_RSL_MsgDiscType(template RSL_MessageDiscriminator m_disc,
Harald Welte643e2a62017-11-27 15:03:18 +01001118 RSL_MessageType m_type) := {
1119 msg_disc := m_disc,
1120 msg_type := m_type,
1121 ies := *
1122 }
1123
Harald Welteefa7d912018-04-18 23:22:15 +02001124 template (value) RSL_Message ts_RSL_MsgDiscType(template (value) RSL_MessageDiscriminator m_disc,
1125 template (value) RSL_MessageType msg_type,
1126 template (omit) RSL_IE_List ies := omit) := {
Harald Welte4a267362017-12-09 17:49:32 +01001127 msg_disc := m_disc,
1128 msg_type := msg_type,
1129 ies := ies
1130 }
1131
Harald Weltebc330be2017-12-09 00:56:36 +01001132template RSL_Message tr_RSL_MsgType(template RSL_MessageType msg_type) := {
1133 msg_disc := ?,
1134 msg_type := msg_type,
1135 ies := *
1136}
1137
1138/* Common Channel Management */
1139template RSL_Message tr_RSL_MsgTypeC(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
1140 msg_disc := { RSL_MDISC_CCHAN, ? }
1141}
1142
1143/* RLL */
1144template RSL_Message tr_RSL_MsgTypeR(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
1145 msg_disc := { RSL_MDISC_RLL, true }
1146}
1147
1148/* Dedicated Channel Management */
1149template RSL_Message tr_RSL_MsgTypeD(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
1150 msg_disc := { RSL_MDISC_DCHAN, ? }
1151}
1152
Vadim Yanitskiybf2aa492022-06-01 00:28:38 +06001153/* TRX Management */
Harald Weltebc330be2017-12-09 00:56:36 +01001154template RSL_Message tr_RSL_MsgTypeT(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
1155 msg_disc := { RSL_MDISC_TRX_MGMT, ? }
1156}
1157
1158
1159/* dedicated channel or RLL */
1160template RSL_Message tr_RSL_MsgTypeDR(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
Harald Weltee5408222018-01-29 21:57:58 +01001161 msg_disc := ({RSL_MDISC_DCHAN,?}, {RSL_MDISC_RLL,?}, {RSL_MDISC_IPACCESS,false})
Harald Weltebc330be2017-12-09 00:56:36 +01001162}
1163
1164
Harald Welte643e2a62017-11-27 15:03:18 +01001165 /* 8.3.1 BSC -> BTS */
Harald Welteefa7d912018-04-18 23:22:15 +02001166 template (value) RSL_Message ts_RSL_DATA_REQ(template (value) RslChannelNr chan_nr,
1167 template (value) RslLinkId link_id,
1168 octetstring l3_info) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001169 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, true),
1170 msg_type := RSL_MT_DATA_REQ,
1171 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001172 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1173 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
1174 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
Harald Welte643e2a62017-11-27 15:03:18 +01001175 }
1176 }
1177
Harald Welte7794d5b2017-12-16 23:00:20 +01001178 template RSL_Message tr_RSL_DATA_REQ(template RslChannelNr chan_nr :=?,
1179 template RslLinkId link_id := ?,
1180 template octetstring l3_info := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001181 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, true),
Harald Welte7794d5b2017-12-16 23:00:20 +01001182 msg_type := RSL_MT_DATA_REQ,
1183 ies :={
1184 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1185 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
1186 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
1187 }
1188 }
1189
1190
Harald Welte643e2a62017-11-27 15:03:18 +01001191 /* 8.3.2 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001192 template (value) RSL_Message ts_RSL_DATA_IND(template (value) RslChannelNr chan_nr,
1193 template (value) RslLinkId link_id,
1194 octetstring l3_info) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001195 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, true),
1196 msg_type := RSL_MT_DATA_IND,
1197 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001198 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1199 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
1200 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
Harald Welte643e2a62017-11-27 15:03:18 +01001201 }
1202 }
Harald Welte9abd1282018-02-19 19:18:17 +01001203 template RSL_Message tr_RSL_DATA_IND(template RslChannelNr chan_nr, template RslLinkId link_id,
1204 template octetstring l3_info := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001205 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, true),
Harald Welte9abd1282018-02-19 19:18:17 +01001206 msg_type := RSL_MT_DATA_IND,
1207 ies :={
1208 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1209 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
1210 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
1211 }
1212 }
Harald Welte643e2a62017-11-27 15:03:18 +01001213
1214 /* 8.3.3 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001215 template (value) RSL_Message ts_RSL_ERROR_IND(template (value) RslChannelNr chan_nr,
Harald Weltea7d81f12019-06-02 22:33:19 +02001216 template (value) RslLinkId link_id,
1217 template (value) octetstring rlm_cause) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001218 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1219 msg_type := RSL_MT_ERROR_IND,
1220 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001221 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1222 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
Harald Weltea7d81f12019-06-02 22:33:19 +02001223 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{rlm_cause := ts_RSL_LV(rlm_cause)})
Harald Welte643e2a62017-11-27 15:03:18 +01001224 }
1225 }
Harald Welte9abd1282018-02-19 19:18:17 +01001226 template RSL_Message tr_RSL_ERROR_IND(template RslChannelNr chan_nr, template RslLinkId link_id,
Harald Weltea7d81f12019-06-02 22:33:19 +02001227 template octetstring rlm_cause := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001228 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001229 msg_type := RSL_MT_ERROR_IND,
1230 ies :={
1231 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1232 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
Harald Weltea7d81f12019-06-02 22:33:19 +02001233 tr_RSL_IE(RSL_IE_Body:{rlm_cause := tr_RSL_LV(rlm_cause)})
Harald Welte9abd1282018-02-19 19:18:17 +01001234 }
1235 }
Harald Welte643e2a62017-11-27 15:03:18 +01001236
Harald Welteefa7d912018-04-18 23:22:15 +02001237 /* 8.3.4 BTS <- BSC */
1238 template (value) RSL_Message ts_RSL_EST_REQ(template (value) RslChannelNr chan_nr,
1239 template (value) RslLinkId link_id) := {
1240 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1241 msg_type := RSL_MT_EST_REQ,
1242 ies := {
1243 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1244 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
1245 }
1246 }
1247 template RSL_Message tr_RSL_EST_REQ(template RslChannelNr chan_nr, template RslLinkId link_id) := {
1248 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
1249 msg_type := RSL_MT_EST_REQ,
1250 ies := {
1251 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1252 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1253 }
1254 }
1255
1256 /* 8.3.5 BTS -> BSC */
1257 template (value) RSL_Message ts_RSL_EST_CONF(template (value) RslChannelNr chan_nr,
1258 template (value) RslLinkId link_id) := {
1259 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1260 msg_type := RSL_MT_EST_CONF,
1261 ies := {
1262 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1263 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
1264 }
1265 }
1266 template RSL_Message tr_RSL_EST_CONF(template RslChannelNr chan_nr, template RslLinkId link_id) := {
1267 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
1268 msg_type := RSL_MT_EST_CONF,
1269 ies := {
1270 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1271 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1272 }
1273 }
1274
Harald Welte643e2a62017-11-27 15:03:18 +01001275 /* 8.3.6 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001276 template (value) RSL_Message ts_RSL_EST_IND(template (value) RslChannelNr chan_nr,
1277 template (value) RslLinkId link_id,
1278 octetstring l3_info) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001279 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1280 msg_type := RSL_MT_EST_IND,
1281 ies := {
Harald Welte735dd072017-12-12 14:55:17 +01001282 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1283 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
1284 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
Harald Welte643e2a62017-11-27 15:03:18 +01001285 }
1286 }
Harald Welte9abd1282018-02-19 19:18:17 +01001287 template RSL_Message tr_RSL_EST_IND(template RslChannelNr chan_nr, template RslLinkId link_id,
1288 template octetstring l3_info := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001289 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001290 msg_type := RSL_MT_EST_IND,
1291 ies := {
1292 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1293 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
1294 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
1295 }
1296 }
Harald Welte0472ab42018-03-12 15:02:26 +01001297 template RSL_Message tr_RSL_EST_IND_NOL3(template RslChannelNr chan_nr, template RslLinkId link_id) :=
1298{
1299 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
1300 msg_type := RSL_MT_EST_IND,
1301 ies := {
1302 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1303 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1304 }
1305 }
1306
Harald Welte643e2a62017-11-27 15:03:18 +01001307
1308 /* 8.3.7 BSC -> BTS */
Harald Welteefa7d912018-04-18 23:22:15 +02001309 template (value) RSL_Message ts_RSL_REL_REQ(template (value) RslChannelNr chan_nr,
Harald Welte0472ab42018-03-12 15:02:26 +01001310 template (value) RslLinkId link_id,
1311 template (value) RSL_IE_ReleaseMode rel_mode := RSL_REL_MODE_NORMAL) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001312 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1313 msg_type := RSL_MT_REL_REQ,
1314 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001315 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
Harald Welte0472ab42018-03-12 15:02:26 +01001316 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
1317 t_RSL_IE(RSL_IE_RELEASE_MODE, RSL_IE_Body:{release_mode := rel_mode})
Harald Welte643e2a62017-11-27 15:03:18 +01001318 }
1319 }
Harald Weltee8a5ab12017-12-09 22:34:57 +01001320 template RSL_Message tr_RSL_REL_REQ(template RslChannelNr chan_nr,
Harald Welte0472ab42018-03-12 15:02:26 +01001321 template RslLinkId link_id,
1322 template RSL_IE_ReleaseMode rel_mode := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001323 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Weltee8a5ab12017-12-09 22:34:57 +01001324 msg_type := RSL_MT_REL_REQ,
1325 ies :={
1326 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1327 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
Harald Welte0472ab42018-03-12 15:02:26 +01001328 tr_RSL_IE(RSL_IE_Body:{release_mode := rel_mode})
Harald Weltee8a5ab12017-12-09 22:34:57 +01001329 }
1330 }
Harald Welte643e2a62017-11-27 15:03:18 +01001331
1332 /* 8.3.8 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001333 template (value) RSL_Message ts_RSL_REL_CONF(template (value) RslChannelNr chan_nr,
1334 template (value) RslLinkId link_id) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001335 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1336 msg_type := RSL_MT_REL_CONF,
1337 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001338 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1339 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
Harald Welte643e2a62017-11-27 15:03:18 +01001340 }
1341 }
Harald Welte9abd1282018-02-19 19:18:17 +01001342 template RSL_Message tr_RSL_REL_CONF(template RslChannelNr chan_nr, template RslLinkId link_id) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001343 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001344 msg_type := RSL_MT_REL_CONF,
1345 ies :={
1346 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1347 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1348 }
1349 }
Harald Welte643e2a62017-11-27 15:03:18 +01001350
1351 /* 8.3.9 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001352 template (value) RSL_Message ts_RSL_REL_IND(template (value) RslChannelNr chan_nr,
1353 template (value) RslLinkId link_id) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001354 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1355 msg_type := RSL_MT_REL_IND,
1356 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001357 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1358 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
Harald Welte643e2a62017-11-27 15:03:18 +01001359 }
1360 }
Harald Welte9abd1282018-02-19 19:18:17 +01001361 template RSL_Message tr_RSL_REL_IND(template RslChannelNr chan_nr, template RslLinkId link_id) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001362 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001363 msg_type := RSL_MT_REL_IND,
1364 ies :={
1365 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1366 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1367 }
1368 }
Harald Welte643e2a62017-11-27 15:03:18 +01001369
1370 /* 8.3.10 BSC -> BTS */
Harald Welteefa7d912018-04-18 23:22:15 +02001371 template (value) RSL_Message ts_RSL_UNITDATA_REQ(template (value) RslChannelNr chan_nr,
1372 template (value) RslLinkId link_id,
1373 octetstring l3_info)
Harald Welte643e2a62017-11-27 15:03:18 +01001374 modifies ts_RSL_DATA_REQ := {
1375 msg_type := RSL_MT_UNIT_DATA_REQ
1376 }
Harald Welte0472ab42018-03-12 15:02:26 +01001377 template RSL_Message tr_RSL_UNITDATA_REQ(template RslChannelNr chan_nr,
1378 template RslLinkId link_id,
Vadim Yanitskiy8f98d3f2018-10-03 17:58:10 +07001379 template octetstring l3_info := ?)
Harald Welte0472ab42018-03-12 15:02:26 +01001380 modifies tr_RSL_DATA_REQ := {
1381 msg_type := RSL_MT_UNIT_DATA_REQ
1382 }
1383
Harald Welte643e2a62017-11-27 15:03:18 +01001384
1385 /* 8.3.11 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001386 template (value) RSL_Message ts_RSL_UNITDATA_IND(template (value) RslChannelNr chan_nr,
1387 template (value) RslLinkId link_id,
1388 octetstring l3_info)
Harald Welte643e2a62017-11-27 15:03:18 +01001389 modifies ts_RSL_DATA_IND := {
1390 msg_type := RSL_MT_UNIT_DATA_IND
1391 }
Harald Welte0472ab42018-03-12 15:02:26 +01001392 template RSL_Message tr_RSL_UNITDATA_IND(template RslChannelNr chan_nr,
Vadim Yanitskiyfabe0f22018-10-03 17:51:47 +07001393 template RslLinkId link_id,
Vadim Yanitskiy8f98d3f2018-10-03 17:58:10 +07001394 template octetstring l3_info := ?)
Harald Welte0472ab42018-03-12 15:02:26 +01001395 modifies tr_RSL_DATA_IND := {
1396 msg_type := RSL_MT_UNIT_DATA_IND
1397 }
1398
1399
Harald Welte643e2a62017-11-27 15:03:18 +01001400
1401
1402 /* DEDICATED CANNEL MANAGEMENT MESSAGES */
1403
1404 /* 8.4.1 BSC -> BTS */
Harald Welteefa7d912018-04-18 23:22:15 +02001405 template (value) RSL_Message ts_RSL_CHAN_ACT(template (value) RslChannelNr chan_nr,
Harald Welte921f9e02019-05-19 22:27:11 +02001406 template (value) RSL_IE_ChannelMode mode,
1407 template (value) RSL_IE_ActivationType at := t_RSL_IE_ActType_IA) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001408 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1409 msg_type := RSL_MT_CHAN_ACTIV,
1410 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001411 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
Harald Welte921f9e02019-05-19 22:27:11 +02001412 t_RSL_IE(RSL_IE_ACT_TYPE, RSL_IE_Body:{act_type := at}),
Harald Welte735dd072017-12-12 14:55:17 +01001413 t_RSL_IE(RSL_IE_CHAN_MODE, RSL_IE_Body:{chan_mode := mode})
Harald Welte643e2a62017-11-27 15:03:18 +01001414 /* lots of optional IEs */
1415 }
1416 }
Harald Welte94e0c342018-04-07 11:33:23 +02001417 template RSL_Message tr_RSL_CHAN_ACT(template RslChannelNr chan_nr,
Harald Welte921f9e02019-05-19 22:27:11 +02001418 template RSL_IE_ChannelMode mode,
1419 template (value) RSL_IE_ActivationType at := t_RSL_IE_ActType_IA) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001420 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte94e0c342018-04-07 11:33:23 +02001421 msg_type := RSL_MT_CHAN_ACTIV,
1422 ies :={
1423 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
Harald Welte921f9e02019-05-19 22:27:11 +02001424 tr_RSL_IE(RSL_IE_Body:{act_type := at}),
Harald Welte94e0c342018-04-07 11:33:23 +02001425 tr_RSL_IE(RSL_IE_Body:{chan_mode := mode}),
1426 /* lots of optional IEs */
1427 *
1428 }
1429 }
Vadim Yanitskiy58b16532021-10-09 20:27:39 +06001430
1431 template (value) RSL_Message
1432 ts_RSL_CHAN_ACT_PDCH(template (value) RslChannelNr chan_nr) := {
1433 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1434 msg_type := RSL_MT_CHAN_ACTIV,
1435 ies :={
1436 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1437 t_RSL_IE(RSL_IE_ACT_TYPE, RSL_IE_Body:{act_type := c_RSL_IE_ActType_PDCH})
1438 }
1439 }
1440 template RSL_Message
1441 tr_RSL_CHAN_ACT_PDCH(template (present) RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001442 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte94e0c342018-04-07 11:33:23 +02001443 msg_type := RSL_MT_CHAN_ACTIV,
1444 ies :={
1445 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
Vadim Yanitskiy58b16532021-10-09 20:27:39 +06001446 tr_RSL_IE(RSL_IE_Body:{act_type := c_RSL_IE_ActType_PDCH}),
Harald Welte94e0c342018-04-07 11:33:23 +02001447 /* lots of optional IEs */
1448 *
1449 }
1450 }
1451
Harald Welte643e2a62017-11-27 15:03:18 +01001452
1453 /* 8.4.2 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001454 template (value) RSL_Message ts_RSL_CHAN_ACT_ACK(template (value) RslChannelNr chan_nr,
1455 GsmFrameNumber fn) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001456 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1457 msg_type := RSL_MT_CHAN_ACTIV_ACK,
1458 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001459 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1460 t_RSL_IE(RSL_IE_FRAME_NUMBER, RSL_IE_Body:{frame_nr := ts_RSL_IE_FrameNumber(fn)})
Harald Welte643e2a62017-11-27 15:03:18 +01001461 }
1462 }
Harald Welte9abd1282018-02-19 19:18:17 +01001463 template RSL_Message tr_RSL_CHAN_ACT_ACK(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001464 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001465 msg_type := RSL_MT_CHAN_ACTIV_ACK,
1466 ies := {
1467 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1468 tr_RSL_IE(RSL_IE_Body:{frame_nr := ?})
1469 }
1470 }
Harald Welte643e2a62017-11-27 15:03:18 +01001471
1472 /* 8.4.3 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001473 template (value) RSL_Message ts_RSL_CHAN_ACT_NACK(template (value) RslChannelNr chan_nr,
1474 RSL_Cause cause) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001475 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1476 msg_type := RSL_MT_CHAN_ACTIV_NACK,
1477 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001478 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1479 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
Harald Welte643e2a62017-11-27 15:03:18 +01001480 }
1481 }
Harald Welte9abd1282018-02-19 19:18:17 +01001482 template RSL_Message tr_RSL_CHAN_ACT_NACK(template RslChannelNr chan_nr,
1483 template RSL_Cause cause := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001484 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001485 msg_type := RSL_MT_CHAN_ACTIV_NACK,
1486 ies := {
1487 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1488 tr_RSL_IE(RSL_IE_Body:{cause := ?})
1489 }
1490 }
Harald Welte643e2a62017-11-27 15:03:18 +01001491
1492 /* 8.4.4 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001493 template (value) RSL_Message ts_RSL_CONN_FAIL_IND(RslChannelNr chan_nr, RSL_Cause cause) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001494 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1495 msg_type := RSL_MT_CONN_FAIL,
1496 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001497 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1498 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
Harald Welte643e2a62017-11-27 15:03:18 +01001499 }
1500 }
Harald Welte9abd1282018-02-19 19:18:17 +01001501 template RSL_Message tr_RSL_CONN_FAIL_IND(template RslChannelNr chan_nr,
1502 template RSL_Cause cause := ?) := {
1503 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1504 msg_type := RSL_MT_CONN_FAIL,
1505 ies :={
1506 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1507 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
1508 }
1509 }
Harald Welte643e2a62017-11-27 15:03:18 +01001510
Harald Weltee8a5ab12017-12-09 22:34:57 +01001511 /* 8.4.5 BSC -> BTS */
1512 template RSL_Message tr_RSL_DEACT_SACCH(template RslChannelNr chan_nr) := {
1513 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1514 msg_type := RSL_MT_DEACTIVATE_SACCH,
1515 ies := {
1516 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
1517 }
1518 }
Harald Welteefa7d912018-04-18 23:22:15 +02001519 template (value) RSL_Message ts_RSL_DEACT_SACCH(template (value) RslChannelNr chan_nr) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001520 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1521 msg_type := RSL_MT_DEACTIVATE_SACCH,
1522 ies := {
1523 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1524 }
1525 }
1526
Harald Weltee8a5ab12017-12-09 22:34:57 +01001527
Harald Welte73cd2712017-12-17 00:44:52 +01001528 /* 8.4.6 BSC ->BTS */
1529 template RSL_Message tr_RSL_ENCR_CMD(template RslChannelNr chan_nr,
1530 template RslLinkId link_id := ?,
Harald Weltee613f962018-04-18 22:38:16 +02001531 template RSL_AlgId alg := ?,
Harald Welte73cd2712017-12-17 00:44:52 +01001532 template octetstring key := ?,
1533 template octetstring l3_info := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001534 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte73cd2712017-12-17 00:44:52 +01001535 msg_type := RSL_MT_ENCR_CMD,
1536 ies := {
1537 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1538 tr_RSL_IE(RSL_IE_Body:{encr_info := tr_RSL_IE_EncrInfo(alg, key)}),
1539 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
1540 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
1541 }
1542 }
Harald Welteefa7d912018-04-18 23:22:15 +02001543 template (value) RSL_Message ts_RSL_ENCR_CMD(template (value) RslChannelNr chan_nr,
1544 template (value) RslLinkId link_id,
Harald Weltee613f962018-04-18 22:38:16 +02001545 template (value) RSL_AlgId alg, octetstring key,
Harald Welteefa7d912018-04-18 23:22:15 +02001546 octetstring l3_info) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001547 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1548 msg_type := RSL_MT_ENCR_CMD,
1549 ies := {
1550 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
Harald Welteefa7d912018-04-18 23:22:15 +02001551 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 +01001552 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
Harald Welteefa7d912018-04-18 23:22:15 +02001553 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
Harald Welte9abd1282018-02-19 19:18:17 +01001554 }
1555 }
Harald Welte73cd2712017-12-17 00:44:52 +01001556
Harald Welte2691adf2018-02-22 17:32:39 +01001557 template RSL_Message tr_RSL_MEAS_RES(template RslChannelNr chan_nr,
1558 template uint8_t meas_res_nr := ?,
1559 template RSL_IE_UplinkMeas ul_meas := ?,
1560 template RSL_IE_BS_Power bs_power := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001561 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte2691adf2018-02-22 17:32:39 +01001562 msg_type := RSL_MT_MEAS_RES,
1563 ies := {
1564 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1565 tr_RSL_IE(RSL_IE_Body:{meas_res_nr := meas_res_nr}),
1566 tr_RSL_IE(RSL_IE_Body:{uplink_meas := ul_meas}),
1567 tr_RSL_IE(RSL_IE_Body:{bs_power := bs_power}),
1568 *
1569 }
1570 }
1571
Vadim Yanitskiy7c29c4e2022-06-18 03:07:50 +07001572 /* Templates for a measurement report that lacks the measurement report
Philipp Maierdd841d32019-12-17 14:44:54 +01001573 * from the MS (l1_info, l3_info and ms timing offset */
Vadim Yanitskiy7c29c4e2022-06-18 03:07:50 +07001574 template (value) RSL_Message
1575 ts_RSL_MEAS_RES_EMPTY(template (value) RslChannelNr chan_nr,
1576 template (value) uint8_t meas_res_nr,
1577 template (value) RSL_IE_UplinkMeas ul_meas,
1578 template (value) RSL_IE_BS_Power bs_power) := {
1579 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1580 msg_type := RSL_MT_MEAS_RES,
1581 ies := {
1582 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1583 t_RSL_IE(RSL_IE_MEAS_RES_NR, RSL_IE_Body:{meas_res_nr := meas_res_nr}),
1584 t_RSL_IE(RSL_IE_UPLINK_MEAS, RSL_IE_Body:{uplink_meas := ul_meas}),
1585 t_RSL_IE(RSL_IE_BS_POWER, RSL_IE_Body:{bs_power := bs_power})
1586 }
1587 }
1588 template RSL_Message
1589 tr_RSL_MEAS_RES_EMPTY(template (present) RslChannelNr chan_nr,
1590 template uint8_t meas_res_nr := ?,
1591 template RSL_IE_UplinkMeas ul_meas := ?,
1592 template RSL_IE_BS_Power bs_power := ?) := {
Philipp Maierdd841d32019-12-17 14:44:54 +01001593 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1594 msg_type := RSL_MT_MEAS_RES,
1595 ies := {
1596 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1597 tr_RSL_IE(RSL_IE_Body:{meas_res_nr := meas_res_nr}),
1598 tr_RSL_IE(RSL_IE_Body:{uplink_meas := ul_meas}),
1599 tr_RSL_IE(RSL_IE_Body:{bs_power := bs_power})
1600 }
1601 }
1602
Harald Welte39b47be2018-02-23 18:58:48 +01001603 /* Osmocom specific template, require lots of optional fields to be present */
1604 template RSL_Message tr_RSL_MEAS_RES_OSMO(template RslChannelNr chan_nr,
1605 template uint8_t meas_res_nr := ?,
1606 template RSL_IE_UplinkMeas ul_meas := ?,
1607 template RSL_IE_BS_Power bs_power := ?,
1608 template RSL_IE_L1Info l1_info := ?,
1609 template octetstring l3_info := ?,
1610 template uint8_t ms_to := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001611 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte39b47be2018-02-23 18:58:48 +01001612 msg_type := RSL_MT_MEAS_RES,
1613 ies := {
1614 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1615 tr_RSL_IE(RSL_IE_Body:{meas_res_nr := meas_res_nr}),
1616 tr_RSL_IE(RSL_IE_Body:{uplink_meas := ul_meas}),
1617 tr_RSL_IE(RSL_IE_Body:{bs_power := bs_power}),
1618 tr_RSL_IE(RSL_IE_Body:{l1_info := l1_info}),
1619 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)}),
1620 tr_RSL_IE(RSL_IE_Body:{ms_timing_offset := ms_to})
1621 }
1622 }
1623
Neels Hofmeyrafe2ea52021-11-24 15:16:12 +01001624 template (value) RSL_Message ts_RSL_MEAS_RES(template (value) RslChannelNr chan_nr,
1625 uint8_t meas_res_nr,
1626 template (value) RSL_IE_UplinkMeas ul_meas,
1627 template (value) RSL_IE_BS_Power bs_power,
1628 template (value) RSL_IE_L1Info l1_info,
1629 octetstring l3_info,
1630 uint8_t ms_to) := {
1631 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1632 msg_type := RSL_MT_MEAS_RES,
1633 ies := {
1634 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1635 t_RSL_IE(RSL_IE_MEAS_RES_NR, RSL_IE_Body:{meas_res_nr := meas_res_nr}),
1636 t_RSL_IE(RSL_IE_UPLINK_MEAS, RSL_IE_Body:{uplink_meas := ul_meas}),
1637 t_RSL_IE(RSL_IE_BS_POWER, RSL_IE_Body:{bs_power := bs_power}),
1638 t_RSL_IE(RSL_IE_L1_INFO, RSL_IE_Body:{l1_info := l1_info}),
1639 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)}),
1640 t_RSL_IE(RSL_IE_MS_TIMING_OFFSET, RSL_IE_Body:{ms_timing_offset := ms_to})
1641 }
1642 }
1643
Eric Wildf1827a72019-05-28 17:37:35 +02001644 /* 8.4.9 BSC -> BTS */
1645 template (value) RSL_Message ts_RSL_MODE_MODIFY_REQ(template (value) RslChannelNr chan_nr,
1646 template (value) RSL_IE_ChannelMode mode) := {
1647 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1648 msg_type := RSL_MT_MODE_MODIFY_REQ,
1649 ies :={
1650 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1651 t_RSL_IE(RSL_IE_CHAN_MODE, RSL_IE_Body:{chan_mode := mode})
1652 /* lots of optional IEs */
1653 }
1654 }
1655 template RSL_Message tr_RSL_MODE_MODIFY_REQ(template RslChannelNr chan_nr,
1656 template RSL_IE_ChannelMode mode) := {
1657 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1658 msg_type := RSL_MT_MODE_MODIFY_REQ,
1659 ies :={
1660 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1661 tr_RSL_IE(RSL_IE_Body:{chan_mode := mode}),
1662 /* lots of optional IEs */
1663 *
1664 }
1665 }
Neels Hofmeyr9f3e6ac2021-04-08 23:09:24 +02001666
1667 template RSL_Message tr_RSL_MODE_MODIFY_REQ_with_OSMO_TSC(template RslChannelNr chan_nr,
1668 template RSL_IE_ChannelMode mode,
1669 template uint8_t tsc_set := ?,
1670 template uint8_t tsc := ?) := {
1671 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1672 msg_type := RSL_MT_MODE_MODIFY_REQ,
1673 ies := {
1674 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1675 tr_RSL_IE(RSL_IE_Body:{chan_mode := mode}),
1676 tr_RSL_IE(RSL_IE_Body:{osmo_training_sequence := {
1677 len := ?,
1678 tsc_set := tsc_set,
1679 tsc := tsc
1680 }
1681 })
1682 }
1683 };
Pau Espin Pedrol85393122022-09-02 17:56:25 +02001684
Harald Welte7794d5b2017-12-16 23:00:20 +01001685 /* 8.4.10 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001686 template (value) RSL_Message ts_RSL_MODE_MODIFY_ACK(template (value) RslChannelNr chan_nr) := {
Harald Welte7794d5b2017-12-16 23:00:20 +01001687 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1688 msg_type := RSL_MT_MODE_MODIFY_ACK,
1689 ies := {
1690 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1691 }
1692 }
Harald Welte9abd1282018-02-19 19:18:17 +01001693 template RSL_Message tr_RSL_MODE_MODIFY_ACK(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001694 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001695 msg_type := RSL_MT_MODE_MODIFY_ACK,
1696 ies := {
1697 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
1698 }
1699 }
Harald Welte7794d5b2017-12-16 23:00:20 +01001700
Harald Welte643e2a62017-11-27 15:03:18 +01001701 /* 8.4.11 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001702 template (value) RSL_Message ts_RSL_MODE_MODIFY_NACK(template (value) RslChannelNr chan_nr,
1703 RSL_Cause cause) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001704 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1705 msg_type := RSL_MT_MODE_MODIFY_NACK,
1706 ies := {
1707 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1708 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
1709 }
Harald Welte643e2a62017-11-27 15:03:18 +01001710 }
Harald Welte9abd1282018-02-19 19:18:17 +01001711 template RSL_Message tr_RSL_MODE_MODIFY_NACK(template RslChannelNr chan_nr,
1712 template RSL_Cause cause) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001713 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001714 msg_type := RSL_MT_MODE_MODIFY_NACK,
1715 ies := {
1716 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1717 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
1718 }
1719 }
1720
Harald Welte643e2a62017-11-27 15:03:18 +01001721
Harald Welte6a8199d2018-01-29 21:58:53 +01001722 /* 8.4.14: BTS <- BSC */
1723 template RSL_Message tr_RSL_RF_CHAN_REL(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001724 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte6a8199d2018-01-29 21:58:53 +01001725 msg_type := RSL_MT_RF_CHAN_REL,
1726 ies := {
1727 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
1728 }
1729 }
Harald Welteefa7d912018-04-18 23:22:15 +02001730 template (value) RSL_Message ts_RSL_RF_CHAN_REL(template (value) RslChannelNr chan_nr) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001731 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1732 msg_type := RSL_MT_RF_CHAN_REL,
1733 ies := {
1734 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1735 }
1736 }
Harald Welte6a8199d2018-01-29 21:58:53 +01001737
Philipp Maier4d1e9c92018-12-20 11:11:56 +01001738 /* 8.4.15: BTS <- BSC */
1739 template (value) RSL_Message ts_RSL_MS_PWR_CTRL(template (value) RslChannelNr chan_nr,
1740 template (value) RSL_IE_MS_Power ms_power) := {
1741 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1742 msg_type := RSL_MT_MS_POWER_CONTROL,
1743 ies := {
1744 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1745 t_RSL_IE(RSL_IE_MS_POWER, RSL_IE_Body:{ms_power := ms_power})
1746 /* One optional IE: MS POWER PARAMETERS */
1747 }
1748 }
1749
Eric Wild61edb7e2019-06-03 12:38:31 +02001750 template (value) RSL_Message ts_RSL_MS_PWR_CTRL_with_pp(template (value) RslChannelNr chan_nr,
1751 integer pwr_level) := {
1752 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1753 msg_type := RSL_MT_MS_POWER_CONTROL,
1754 ies := {
1755 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1756 t_RSL_IE(RSL_IE_MS_POWER, RSL_IE_Body:{ms_power := ts_RSL_IE_MS_Power(pwr_level)}),
1757 t_RSL_IE(RSL_IE_MS_POWER_PARAM, RSL_IE_Body:{ms_power_params :=
1758 ts_RSL_IE_MS_Power_Parameters(''O)})
1759 }
1760 }
1761
Eric Wildae8f2622019-06-18 17:05:11 +02001762 /* 8.4.16: BTS <- BSC */
1763 template (value) RSL_Message ts_RSL_BS_PWR_CTRL(template (value) RslChannelNr chan_nr,
1764 template (value) RSL_IE_BS_Power bs_power) := {
1765 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1766 msg_type := RSL_MT_BS_POWER_CONTROL,
1767 ies := {
1768 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1769 t_RSL_IE(RSL_IE_BS_POWER, RSL_IE_Body:{bs_power := bs_power})
1770 /* One optional IE: BS POWER PARAMETERS */
1771 }
1772 }
Vadim Yanitskiy2a5a1ef2021-06-30 00:51:48 +02001773 template RSL_Message tr_RSL_BS_PWR_CTRL(template (present) RslChannelNr chan_nr,
1774 template (present) RSL_IE_BS_Power bs_power) := {
1775 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1776 msg_type := RSL_MT_BS_POWER_CONTROL,
1777 ies := {
1778 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1779 tr_RSL_IE(RSL_IE_Body:{bs_power := bs_power})
1780 /* One optional IE: BS POWER PARAMETERS */
1781 }
1782 }
Eric Wildae8f2622019-06-18 17:05:11 +02001783
Harald Welte4a267362017-12-09 17:49:32 +01001784 /* 8.4.19 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001785 template (value) RSL_Message ts_RSL_RF_CHAN_REL_ACK(template (value) RslChannelNr chan_nr) :=
Harald Welte4a267362017-12-09 17:49:32 +01001786 ts_RSL_MsgDiscType(ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1787 RSL_MT_RF_CHAN_REL_ACK,
Harald Welte735dd072017-12-12 14:55:17 +01001788 { t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}) });
Harald Welte4a267362017-12-09 17:49:32 +01001789
Harald Welte9abd1282018-02-19 19:18:17 +01001790 template RSL_Message tr_RSL_RF_CHAN_REL_ACK(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001791 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001792 msg_type := RSL_MT_RF_CHAN_REL_ACK,
1793 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001794 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
Harald Welte9abd1282018-02-19 19:18:17 +01001795 }
1796 }
1797
Harald Welteea17b912018-03-11 22:29:31 +01001798 /* 8.6.20 BTS <- BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001799 template (value) RSL_Message ts_RSL_SACCH_INF_MOD(template (value) RslChannelNr chan_nr,
1800 RSL_IE_SysinfoType si_type,
1801 octetstring l3_info) := {
Harald Welteea17b912018-03-11 22:29:31 +01001802 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1803 msg_type := RSL_MT_SACCH_INFO_MODIFY,
1804 ies := {
1805 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1806 t_RSL_IE(RSL_IE_SYSINFO_TYPE, RSL_IE_Body:{sysinfo_type := si_type}),
1807 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
1808 }
1809 }
1810
Neels Hofmeyr378a49c2018-06-15 22:18:43 +02001811 /* 8.4.7 BTS -> BSC */
1812 template (value) RSL_Message ts_RSL_HANDO_DET(template (value) RslChannelNr chan_nr) := {
1813 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1814 msg_type := RSL_MT_HANDO_DET,
1815 ies := {
1816 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1817 }
1818 }
Vadim Yanitskiy7c2c10c2019-05-31 20:42:01 +07001819 template RSL_Message tr_RSL_HANDO_DET(template RslChannelNr chan_nr,
1820 template uint8_t acc_delay := ?) := {
1821 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1822 msg_type := RSL_MT_HANDO_DET,
1823 ies := {
1824 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1825 tr_RSL_IE(RSL_IE_Body:{access_delay := acc_delay})
1826 }
1827 }
Neels Hofmeyr378a49c2018-06-15 22:18:43 +02001828
Harald Welteea17b912018-03-11 22:29:31 +01001829
Harald Welte643e2a62017-11-27 15:03:18 +01001830 /* COMMON CHANNEL MANAGEMENT MESSAGES */
1831
Harald Welte874c2232018-02-24 04:52:43 +01001832 /* 8.5.1 BTS <- BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001833 template (value) RSL_Message ts_RSL_BCCH_INFO(RSL_IE_SysinfoType si_type,
1834 octetstring full_bcch_info) := {
Harald Welte874c2232018-02-24 04:52:43 +01001835 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1836 msg_type := RSL_MT_BCCH_INFO,
1837 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001838 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_BCCH(0)}),
Harald Welte874c2232018-02-24 04:52:43 +01001839 t_RSL_IE(RSL_IE_SYSINFO_TYPE, RSL_IE_Body:{sysinfo_type := si_type}),
1840 t_RSL_IE(RSL_IE_FULL_BCCH_INFO, RSL_IE_Body:{other := ts_RSL_LV(full_bcch_info)})
1841 }
1842 }
Harald Welte09538f82019-08-01 09:50:25 +02001843 template RSL_Message tr_RSL_NO_BCCH_INFO(template RSL_IE_SysinfoType si_type := ?) := {
1844 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1845 msg_type := RSL_MT_BCCH_INFO,
1846 ies := {
1847 tr_RSL_IE(RSL_IE_Body:{chan_nr := ts_RslChanNr_BCCH(0)}),
1848 tr_RSL_IE(RSL_IE_Body:{sysinfo_type := si_type})
1849 }
1850 }
1851 template RSL_Message tr_RSL_BCCH_INFO(template RSL_IE_SysinfoType si_type := ?,
1852 template octetstring full_bcch_info := ?) := {
1853 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1854 msg_type := RSL_MT_BCCH_INFO,
1855 ies := {
1856 tr_RSL_IE(RSL_IE_Body:{chan_nr := ts_RslChanNr_BCCH(0)}),
1857 tr_RSL_IE(RSL_IE_Body:{sysinfo_type := si_type}),
1858 tr_RSL_IE(RSL_IE_Body:{other := tr_RSL_LV(full_bcch_info)}),
1859 *
1860 }
1861 }
Harald Welte874c2232018-02-24 04:52:43 +01001862
Harald Welte7ae93142017-12-07 17:56:15 +01001863 /* 8.5.2 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001864 template (value) RSL_Message ts_RSL_RACH_LOAD_IND(uint16_t slot_ct, uint16_t busy_ct,
1865 uint16_t acc_ct) := {
Harald Welte7ae93142017-12-07 17:56:15 +01001866 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1867 msg_type := RSL_MT_CCCH_LOAD_IND,
1868 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001869 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_RACH(0)}),
Harald Welte735dd072017-12-12 14:55:17 +01001870 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 +01001871 }
1872 }
Harald Welte68e495b2018-02-25 00:05:57 +01001873 template RSL_Message tr_RSL_RACH_LOAD_IND(template uint16_t slot_ct := ?,
1874 template uint16_t busy_ct := ?,
Harald Welte09538f82019-08-01 09:50:25 +02001875 template uint16_t acc_ct := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001876 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Welte68e495b2018-02-25 00:05:57 +01001877 msg_type := RSL_MT_CCCH_LOAD_IND,
1878 ies := {
1879 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_RACH(0)}),
1880 tr_RSL_IE(RSL_IE_Body:{rach_load := tr_RSL_IE_RachLoad(slot_ct, busy_ct, acc_ct)})
1881 }
1882 }
1883
Harald Welteefa7d912018-04-18 23:22:15 +02001884 template (value) RSL_Message ts_RSL_PAGING_LOAD_IND(uint16_t buffer_space) := {
Harald Welte7ae93142017-12-07 17:56:15 +01001885 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1886 msg_type := RSL_MT_CCCH_LOAD_IND,
1887 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001888 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_PCH_AGCH(0)}),
Harald Welte735dd072017-12-12 14:55:17 +01001889 t_RSL_IE(RSL_IE_PAGING_LOAD, RSL_IE_Body:{paging_load := buffer_space})
Harald Welte7ae93142017-12-07 17:56:15 +01001890 }
1891 }
Harald Welte68e495b2018-02-25 00:05:57 +01001892 template RSL_Message tr_RSL_PAGING_LOAD_IND(template uint16_t buffer_space := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001893 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Welte68e495b2018-02-25 00:05:57 +01001894 msg_type := RSL_MT_CCCH_LOAD_IND,
1895 ies := {
1896 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(0)}),
1897 tr_RSL_IE(RSL_IE_Body:{paging_load := buffer_space})
1898 }
1899 }
1900
Harald Welte7ae93142017-12-07 17:56:15 +01001901
Harald Welte643e2a62017-11-27 15:03:18 +01001902 /* 8.5.3 BTS -> BSC */
Vadim Yanitskiyab448a52019-05-31 20:24:03 +07001903 template (value) RSL_Message ts_RSL_CHAN_RQD(OCT1 ra, GsmFrameNumber fn,
1904 template (value) RslChannelNr chan_nr := ts_RslChanNr_RACH(0),
1905 uint8_t acc_del := 0) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001906 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1907 msg_type := RSL_MT_CHAN_RQD,
1908 ies := {
Vadim Yanitskiyab448a52019-05-31 20:24:03 +07001909 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1910 /* TODO: we may need to have optional RSL_IE_LINK_IDENT IE here */
Harald Welte735dd072017-12-12 14:55:17 +01001911 t_RSL_IE(RSL_IE_REQ_REFERENCE, RSL_IE_Body:{req_ref := ts_RSL_IE_ReqRef(ra, fn)}),
1912 t_RSL_IE(RSL_IE_ACCESS_DELAY, RSL_IE_Body:{access_delay := acc_del})
Harald Welte643e2a62017-11-27 15:03:18 +01001913 }
1914 }
Harald Welte9abd1282018-02-19 19:18:17 +01001915 template RSL_Message tr_RSL_CHAN_RQD(template OCT1 ra, template GsmFrameNumber fn := ?,
Vadim Yanitskiyab448a52019-05-31 20:24:03 +07001916 template RslChannelNr chan_nr := ts_RslChanNr_RACH(0),
1917 template uint8_t acc_del := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001918 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001919 msg_type := RSL_MT_CHAN_RQD,
1920 ies := {
Vadim Yanitskiyab448a52019-05-31 20:24:03 +07001921 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1922 /* TODO: we may need to have optional RSL_IE_LINK_IDENT IE here */
Harald Welte9abd1282018-02-19 19:18:17 +01001923 tr_RSL_IE(RSL_IE_Body:{req_ref := tr_RSL_IE_ReqRef(ra, fn)}),
1924 tr_RSL_IE(RSL_IE_Body:{access_delay := acc_del})
1925 }
1926 }
Harald Welte643e2a62017-11-27 15:03:18 +01001927
1928 /* 8.5.4 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001929 template (value) RSL_Message ts_DELETE_IND(template (value) RslChannelNr chan_nr,
1930 octetstring imm_ass) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001931 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1932 msg_type := RSL_MT_DELETE_IND,
1933 ies := {
Harald Welte735dd072017-12-12 14:55:17 +01001934 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1935 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 +01001936 }
1937 }
Harald Weltee8d750e2018-06-10 21:41:35 +02001938 template RSL_Message tr_RSL_DELETE_IND(template octetstring imm_ass := ?, template uint3_t tn) := {
1939 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1940 msg_type := RSL_MT_DELETE_IND,
1941 ies := {
1942 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(tn)}),
1943 tr_RSL_IE(RSL_IE_Body:{full_imm_ass_info := tr_RSL_LV(imm_ass)}),
1944 *
1945 }
1946 }
Harald Welte643e2a62017-11-27 15:03:18 +01001947
Harald Weltec2877752017-12-07 17:54:35 +01001948 /* 8.5.5 BSC -> BTS */
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +07001949 template RSL_Message tr_RSL_PAGING_CMD(template MobileIdentityV mi, template uint3_t tn := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001950 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Weltec2877752017-12-07 17:54:35 +01001951 msg_type := RSL_MT_PAGING_CMD,
1952 ies := {
1953 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(tn)}),
1954 tr_RSL_IE(RSL_IE_Body:{paging_group := ?}),
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +07001955 tr_RSL_IE(RSL_IE_Body:{ms_identity := tr_MI_LV(mi)}),
Harald Weltec2877752017-12-07 17:54:35 +01001956 * /* opt: channel needed, eMLPP prio */
1957 }
1958 }
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +07001959 template (value) RSL_Message ts_RSL_PAGING_CMD(MobileIdentityV mi, uint8_t pg, uint3_t tn := 0) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001960 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1961 msg_type := RSL_MT_PAGING_CMD,
1962 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001963 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_PCH_AGCH(tn)}),
Harald Welte9abd1282018-02-19 19:18:17 +01001964 t_RSL_IE(RSL_IE_PAGING_GROUP, RSL_IE_Body:{paging_group := pg}),
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +07001965 t_RSL_IE(RSL_IE_MS_IDENTITY, RSL_IE_Body:{ms_identity := ts_MI_LV(mi)})
Harald Welte9abd1282018-02-19 19:18:17 +01001966 }
1967 }
Harald Weltec2877752017-12-07 17:54:35 +01001968
1969 /* 8.5.6 BSC -> BTS */
1970 template RSL_Message tr_RSL_IMM_ASSIGN(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_IMMEDIATE_ASSIGN_CMD,
1973 ies := {
1974 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(tn)}),
1975 tr_RSL_IE(RSL_IE_Body:{full_imm_ass_info := ?})
1976 }
1977 }
Harald Welteefa7d912018-04-18 23:22:15 +02001978 template (value) RSL_Message ts_RSL_IMM_ASSIGN(octetstring f_ass_inf, uint3_t tn := 0) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001979 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1980 msg_type := RSL_MT_IMMEDIATE_ASSIGN_CMD,
1981 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001982 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_PCH_AGCH(tn)}),
Harald Welte9abd1282018-02-19 19:18:17 +01001983 t_RSL_IE(RSL_IE_FULL_IMM_ASS_INFO, RSL_IE_Body:{full_imm_ass_info := ts_RSL_LV(f_ass_inf)})
1984 }
1985 }
Harald Weltec2877752017-12-07 17:54:35 +01001986
Harald Weltecc373202018-09-10 10:28:21 +02001987 /* 8.5.8 BTS <- BSC SMS BROADCAST COMMAND */
1988 template RSL_Message tr_RSL_SMSCB_CMD(template RSL_IE_CbCommandType cb_cmd := ?,
1989 template octetstring msg := ?,
1990 template RslChannelNr chan_nr := ?) := {
1991 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1992 msg_type := RSL_MT_SMS_BC_CMD,
1993 ies := {
1994 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1995 tr_RSL_IE(RSL_IE_Body:{cb_cmd_type := cb_cmd}),
1996 tr_RSL_IE(RSL_IE_Body:{smscb_message := tr_RSL_LV(msg)}),
1997 *
1998 }
1999 }
2000 template (value) RSL_Message ts_RSL_SMSCB_CMD(template (value) RSL_IE_CbCommandType cb_cmd,
2001 template (value) octetstring msg,
2002 template (value) RslChannelNr chan_nr :=
2003 ts_RslChanNr_SDCCH4(0, 2)) := {
2004 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2005 msg_type := RSL_MT_SMS_BC_CMD,
2006 ies := {
2007 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2008 t_RSL_IE(RSL_IE_CB_CMD_TYPE, RSL_IE_Body:{cb_cmd_type := cb_cmd}),
2009 t_RSL_IE(RSL_IE_SMSCB_MSG, RSL_IE_Body:{smscb_message := ts_RSL_LV(msg)})
2010 /* optional channel type for extended CBCH */
2011 }
2012 }
2013
Harald Welte4a129f82019-05-21 16:35:22 +02002014 /* 8.5.9 BTS -> BSC CBCH LOAD INDICATION */
2015 template RSL_Message tr_RSL_CBCH_LOAD_IND_BASIC(template boolean overflow := ?,
2016 template uint4_t slot_count := ?,
2017 template RslChannelNr chan_nr := ?) := {
2018 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2019 msg_type := RSL_MT_CBCH_LOAD_IND,
2020 ies := {
2021 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2022 tr_RSL_IE(RSL_IE_Body:{cbch_load_info := tr_CbchLoadInfo(overflow, slot_count)})
2023 }
2024 }
2025 template (value) RSL_Message ts_RSL_CBCH_LOAD_IND_BASIC(boolean overflow, uint4_t slot_count,
2026 template (value) RslChannelNr chan_nr :=
2027 ts_RslChanNr_SDCCH4(0, 2)) := {
2028 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2029 msg_type := RSL_MT_CBCH_LOAD_IND,
2030 ies := {
2031 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2032 t_RSL_IE(RSL_IE_CBCH_LOAD_INFO, RSL_IE_Body:{cbch_load_info := ts_CbchLoadInfo(overflow, slot_count)})
2033 }
2034 }
2035 template RSL_Message tr_RSL_CBCH_LOAD_IND_EXTD(template boolean overflow := ?,
2036 template uint4_t slot_count := ?,
2037 template RslChannelNr chan_nr := ?) := {
2038 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2039 msg_type := RSL_MT_CBCH_LOAD_IND,
2040 ies := {
2041 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2042 tr_RSL_IE(RSL_IE_Body:{cbch_load_info := tr_CbchLoadInfo(overflow, slot_count)}),
2043 tr_RSL_IE(RSL_IE_Body:{smscb_chan_ind := 1})
2044 }
2045 }
2046 template (value) RSL_Message ts_RSL_CBCH_LOAD_IND_EXTD(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 t_RSL_IE(RSL_IE_SMSCB_CHAN_INDICATOR, RSL_IE_Body:{smscb_chan_ind := 1})
2055 }
2056 }
2057
2058
Vadim Yanitskiy9f699532021-06-03 17:29:22 +02002059 /* 8.6.1 BTS -> BSC */
2060 template (value) RSL_Message
2061 ts_RSL_RF_RES_IND(template (value) RSL_ResourceInfo info) := {
2062 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
2063 msg_type := RSL_MT_RF_RES_IND,
2064 ies := {
2065 t_RSL_IE(RSL_IE_RESOURCE_INFO, RSL_IE_Body:{
2066 resource_info := {
2067 len := 0, /* overwritten */
2068 info := info
2069 }
2070 })
2071 }
2072 }
2073 template RSL_Message
2074 tr_RSL_RF_RES_IND(template (present) RSL_ResourceInfo info := ?) := {
2075 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
2076 msg_type := RSL_MT_RF_RES_IND,
2077 ies := {
2078 tr_RSL_IE(RSL_IE_Body:{
2079 resource_info := {
2080 len := ?,
2081 info := info
2082 }
2083 })
2084 }
2085 }
2086
2087
Harald Welte68e495b2018-02-25 00:05:57 +01002088 /* 8.6.2 BTS <- BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02002089 template (value) RSL_Message ts_RSL_SACCH_FILL(RSL_IE_SysinfoType si_type, octetstring l3_info) := {
Harald Welte68e495b2018-02-25 00:05:57 +01002090 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
2091 msg_type := RSL_MT_SACCH_FILL,
2092 ies := {
2093 t_RSL_IE(RSL_IE_SYSINFO_TYPE, RSL_IE_Body:{sysinfo_type := si_type}),
2094 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
2095 }
2096 }
Harald Welte09538f82019-08-01 09:50:25 +02002097 template RSL_Message tr_RSL_NO_SACCH_FILL(template RSL_IE_SysinfoType si_type := ?) := {
2098 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
2099 msg_type := RSL_MT_SACCH_FILL,
2100 ies := {
2101 tr_RSL_IE(RSL_IE_Body:{sysinfo_type := si_type})
2102 }
2103 }
2104 template RSL_Message tr_RSL_SACCH_FILL(template RSL_IE_SysinfoType si_type := ?,
2105 template octetstring l3_info := ?) := {
2106 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
2107 msg_type := RSL_MT_SACCH_FILL,
2108 ies := {
2109 tr_RSL_IE(RSL_IE_Body:{sysinfo_type := si_type}),
2110 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)}),
2111 *
2112 }
2113 }
2114
Harald Welte68e495b2018-02-25 00:05:57 +01002115
Harald Welte643e2a62017-11-27 15:03:18 +01002116 /* 8.6.4 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02002117 template (value) RSL_Message ts_RSL_ERROR_REPORT(RSL_Cause cause) := {
Harald Welte01d982c2018-02-25 01:31:40 +01002118 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
2119 msg_type := RSL_MT_ERROR_REPORT,
Harald Welte643e2a62017-11-27 15:03:18 +01002120 ies := {
Harald Welte735dd072017-12-12 14:55:17 +01002121 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
Harald Welte643e2a62017-11-27 15:03:18 +01002122 }
2123 }
Harald Welte01d982c2018-02-25 01:31:40 +01002124 template RSL_Message tr_RSL_ERROR_REPORT(template RSL_Cause cause := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002125 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
Harald Welte01d982c2018-02-25 01:31:40 +01002126 msg_type := RSL_MT_ERROR_REPORT,
2127 ies := {
2128 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)}),
2129 *
2130 }
2131 }
2132
Harald Welte643e2a62017-11-27 15:03:18 +01002133
Harald Welte9958a4d2017-12-14 21:21:33 +01002134
2135 /* Abis/IP specific messages */
2136
Vadim Yanitskiy1567bac2022-05-01 03:36:24 +03002137 private function f_ts_RSL_IPA_CRCX_IEs(template (value) RslChannelNr chan_nr,
2138 template (omit) OCT4 remote_ip,
2139 template (omit) uint16_t remote_port)
2140 return RSL_IE_List {
2141 var RSL_IE_List ies;
2142
2143 /* Channel Number is a mandatory IE */
2144 ies := {
2145 valueof(RSL_IE:{
2146 iei := RSL_IE_CHAN_NR,
2147 body := { chan_nr := chan_nr }
2148 })
2149 };
2150 /* Remote IP / Port are optional IEs */
2151 if (not istemplatekind(remote_ip, "omit")) {
2152 ies := ies & {
2153 valueof(RSL_IE:{
2154 iei := RSL_IE_IPAC_REMOTE_IP,
2155 body := { ipa_remote_ip := remote_ip }
2156 })
2157 };
2158 }
2159 if (not istemplatekind(remote_port, "omit")) {
2160 ies := ies & {
2161 valueof(RSL_IE:{
2162 iei := RSL_IE_IPAC_REMOTE_PORT,
2163 body := { ipa_remote_port := remote_port }
2164 })
2165 };
2166 }
2167
2168 return ies;
2169 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002170 template RSL_Message tr_RSL_IPA_CRCX(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002171 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002172 msg_type := RSL_MT_IPAC_CRCX,
2173 ies := {
2174 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2175 *
2176 }
2177 }
Vadim Yanitskiye9141c22021-07-03 01:45:40 +02002178 template (value) RSL_Message
2179 ts_RSL_IPA_CRCX(template (value) RslChannelNr chan_nr,
Vadim Yanitskiy1567bac2022-05-01 03:36:24 +03002180 template (omit) OCT4 remote_ip := omit,
2181 template (omit) uint16_t remote_port := omit) := {
Harald Welte9abd1282018-02-19 19:18:17 +01002182 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2183 msg_type := RSL_MT_IPAC_CRCX,
Vadim Yanitskiy1567bac2022-05-01 03:36:24 +03002184 ies := f_ts_RSL_IPA_CRCX_IEs(chan_nr, remote_ip, remote_port)
Harald Welte9abd1282018-02-19 19:18:17 +01002185 }
2186
Harald Welte9958a4d2017-12-14 21:21:33 +01002187
Harald Welteefa7d912018-04-18 23:22:15 +02002188 template (value) RSL_Message ts_RSL_IPA_CRCX_ACK(template (value) RslChannelNr chan_nr,
Vadim Yanitskiyfc631642021-07-03 02:42:45 +02002189 uint16_t ipa_conn_id, OCT4 local_ip,
Harald Welteefa7d912018-04-18 23:22:15 +02002190 uint16_t local_port, uint7_t rtp_pt2) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002191 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2192 msg_type := RSL_MT_IPAC_CRCX_ACK,
2193 ies := {
2194 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2195 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2196 t_RSL_IE(RSL_IE_IPAC_LOCAL_IP, RSL_IE_Body:{ipa_local_ip := local_ip}),
2197 t_RSL_IE(RSL_IE_IPAC_LOCAL_PORT, RSL_IE_Body:{ipa_local_port := local_port}),
2198 t_RSL_IE(RSL_IE_IPAC_RTP_PAYLOAD2, RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
2199 }
2200 }
Harald Welte9abd1282018-02-19 19:18:17 +01002201 template RSL_Message tr_RSL_IPA_CRCX_ACK(template RslChannelNr chan_nr,
2202 template uint16_t ipa_conn_id,
Vadim Yanitskiyfc631642021-07-03 02:42:45 +02002203 template OCT4 local_ip,
Harald Welte8bd0f822018-02-25 12:43:28 +01002204 template uint16_t local_port) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002205 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9abd1282018-02-19 19:18:17 +01002206 msg_type := RSL_MT_IPAC_CRCX_ACK,
2207 ies := {
2208 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2209 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2210 tr_RSL_IE(RSL_IE_Body:{ipa_local_ip := local_ip}),
Harald Welte8bd0f822018-02-25 12:43:28 +01002211 tr_RSL_IE(RSL_IE_Body:{ipa_local_port := local_port})
2212 /* Optional: RTP Payload Type 2 IE */
Harald Welte9abd1282018-02-19 19:18:17 +01002213 }
2214 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002215
Harald Welteefa7d912018-04-18 23:22:15 +02002216 template (value) RSL_Message ts_RSL_IPA_CRCX_NACK(template (value) RslChannelNr chan_nr,
2217 RSL_Cause cause) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002218 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2219 msg_type := RSL_MT_IPAC_CRCX_NACK,
2220 ies := {
2221 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2222 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2223 }
2224 }
Harald Welte9abd1282018-02-19 19:18:17 +01002225 template RSL_Message tr_RSL_IPA_CRCX_NACK(template RslChannelNr chan_nr,
2226 template RSL_Cause cause := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002227 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9abd1282018-02-19 19:18:17 +01002228 msg_type := RSL_MT_IPAC_CRCX_NACK,
2229 ies := {
2230 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2231 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
2232 }
2233 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002234
Harald Welteefa7d912018-04-18 23:22:15 +02002235 template (value) RSL_Message ts_RSL_IPA_MDCX(template (value) RslChannelNr chan_nr,
2236 uint16_t ipa_conn_id,
Vadim Yanitskiyfc631642021-07-03 02:42:45 +02002237 OCT4 remote_ip, uint16_t remote_port,
Harald Welteefa7d912018-04-18 23:22:15 +02002238 uint7_t rtp_pt2) := {
Harald Welte30527452018-02-25 12:46:25 +01002239 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2240 msg_type := RSL_MT_IPAC_MDCX,
2241 ies := {
2242 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2243 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2244 t_RSL_IE(RSL_IE_IPAC_REMOTE_IP, RSL_IE_Body:{ipa_remote_ip := remote_ip}),
2245 t_RSL_IE(RSL_IE_IPAC_REMOTE_PORT, RSL_IE_Body:{ipa_remote_port := remote_port}),
2246 /* optional: RTP Payload Type */
2247 t_RSL_IE(RSL_IE_IPAC_RTP_PAYLOAD2, RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
2248 }
2249 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002250 template RSL_Message tr_RSL_IPA_MDCX(template RslChannelNr chan_nr,
2251 template uint16_t ipa_conn_id) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002252 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002253 msg_type := RSL_MT_IPAC_MDCX,
2254 ies := {
2255 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2256 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2257 *
2258 }
2259 }
2260
Harald Welteefa7d912018-04-18 23:22:15 +02002261 template (value) RSL_Message ts_RSL_IPA_MDCX_ACK(template (value) RslChannelNr chan_nr,
2262 uint16_t ipa_conn_id,
Vadim Yanitskiyfc631642021-07-03 02:42:45 +02002263 OCT4 local_ip, uint16_t local_port,
Harald Welteefa7d912018-04-18 23:22:15 +02002264 uint7_t rtp_pt2) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002265 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte71b5ec82017-12-16 23:01:10 +01002266 msg_type := RSL_MT_IPAC_MDCX_ACK,
Harald Welte9958a4d2017-12-14 21:21:33 +01002267 ies := {
2268 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2269 /* optional */
2270 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
Harald Welte6cb400a2018-02-25 12:45:25 +01002271 t_RSL_IE(RSL_IE_IPAC_LOCAL_IP, RSL_IE_Body:{ipa_local_ip := local_ip}),
2272 t_RSL_IE(RSL_IE_IPAC_LOCAL_PORT, RSL_IE_Body:{ipa_local_port := local_port}),
Harald Welte9958a4d2017-12-14 21:21:33 +01002273 /* optional: RTP Payload Type */
2274 t_RSL_IE(RSL_IE_IPAC_RTP_PAYLOAD2, RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
2275 }
2276 }
Harald Welte30527452018-02-25 12:46:25 +01002277 template RSL_Message tr_RSL_IPA_MDCX_ACK(template RslChannelNr chan_nr,
2278 template uint16_t ipa_conn_id,
Vadim Yanitskiyfc631642021-07-03 02:42:45 +02002279 template OCT4 local_ip,
Harald Welte30527452018-02-25 12:46:25 +01002280 template uint16_t local_port,
2281 template uint7_t rtp_pt2) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002282 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte30527452018-02-25 12:46:25 +01002283 msg_type := RSL_MT_IPAC_MDCX_ACK,
2284 ies := {
2285 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2286 /* optional */
2287 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2288 tr_RSL_IE(RSL_IE_Body:{ipa_local_ip := local_ip}),
2289 tr_RSL_IE(RSL_IE_Body:{ipa_local_port := local_port}),
2290 /* optional: RTP Payload Type */
2291 tr_RSL_IE(RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
2292 }
2293 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002294
Harald Welteefa7d912018-04-18 23:22:15 +02002295 template (value) RSL_Message ts_RSL_IPA_MDCX_NACK(template (value) RslChannelNr chan_nr,
2296 RSL_Cause cause,
2297 template (value) uint16_t ipa_conn_id) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002298 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2299 msg_type := RSL_MT_IPAC_MDCX_NACK,
2300 ies := {
2301 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2302 /* optional connection ID */
2303 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2304 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2305 }
2306 }
Harald Welte30527452018-02-25 12:46:25 +01002307 template RSL_Message tr_RSL_IPA_MDCX_NACK(template RslChannelNr chan_nr,
2308 template RSL_Cause cause,
2309 template uint16_t ipa_conn_id) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002310 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte30527452018-02-25 12:46:25 +01002311 msg_type := RSL_MT_IPAC_MDCX_NACK,
2312 ies := {
2313 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2314 /* optional connection ID */
2315 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2316 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
2317 }
2318 }
2319
Harald Welte9958a4d2017-12-14 21:21:33 +01002320
Harald Welteefa7d912018-04-18 23:22:15 +02002321 template (value) RSL_Message ts_RSL_IPA_DLCX_IND(template (value) RslChannelNr chan_nr,
2322 uint16_t ipa_conn_id,
2323 template (value) RSL_IE_IPA_ConnectionStats stats,
2324 RSL_Cause cause) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002325 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2326 msg_type := RSL_MT_IPAC_DLCX_IND,
2327 ies := {
2328 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2329 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2330 t_RSL_IE(RSL_IE_IPAC_CONN_STAT, RSL_IE_Body:{ipa_stats := stats}),
2331 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2332 }
2333 }
2334
Harald Welteefa7d912018-04-18 23:22:15 +02002335 template (value) RSL_Message ts_RSL_IPA_DLCX(template (value) RslChannelNr chan_nr,
2336 uint16_t ipa_conn_id) := {
Harald Weltea871a382018-02-25 02:03:14 +01002337 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2338 msg_type := RSL_MT_IPAC_DLCX,
2339 ies := {
Harald Welte2a7e7162018-02-25 12:46:48 +01002340 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2341 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id})
Harald Weltea871a382018-02-25 02:03:14 +01002342 }
2343 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002344 template RSL_Message tr_RSL_IPA_DLCX(template RslChannelNr chan_nr,
2345 template uint16_t ipa_conn_id := omit) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002346 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002347 msg_type := RSL_MT_IPAC_DLCX,
2348 ies := {
2349 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2350 /* FIXME: optional conn_id */
2351 *
2352 }
2353 }
2354
Harald Welteefa7d912018-04-18 23:22:15 +02002355 template (value) RSL_Message ts_RSL_IPA_DLCX_ACK(template (value) RslChannelNr chan_nr,
2356 uint16_t ipa_conn_id,
2357 RSL_IE_IPA_ConnectionStats stats) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002358 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2359 msg_type := RSL_MT_IPAC_DLCX_ACK,
2360 ies := {
2361 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2362 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2363 t_RSL_IE(RSL_IE_IPAC_CONN_STAT, RSL_IE_Body:{ipa_stats := stats})
2364 }
2365 }
Harald Weltea871a382018-02-25 02:03:14 +01002366 template RSL_Message tr_RSL_IPA_DLCX_ACK(template RslChannelNr chan_nr,
2367 template uint16_t ipa_conn_id,
2368 template RSL_IE_IPA_ConnectionStats stats) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002369 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Weltea871a382018-02-25 02:03:14 +01002370 msg_type := RSL_MT_IPAC_DLCX_ACK,
2371 ies := {
2372 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2373 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2374 tr_RSL_IE(RSL_IE_Body:{ipa_stats := stats})
2375 }
2376 }
2377
2378
Harald Welte9958a4d2017-12-14 21:21:33 +01002379
Harald Welteefa7d912018-04-18 23:22:15 +02002380 template (value) RSL_Message ts_RSL_IPA_DLCX_NACK(template (value) RslChannelNr chan_nr,
2381 RSL_Cause cause, uint16_t ipa_conn_id) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002382 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2383 msg_type := RSL_MT_IPAC_DLCX_NACK,
2384 ies := {
2385 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2386 /* optional connection ID */
2387 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2388 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2389 }
2390 }
Harald Weltea871a382018-02-25 02:03:14 +01002391 template RSL_Message tr_RSL_IPA_DLCX_NACK(template RslChannelNr chan_nr,
2392 template RSL_Cause cause) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002393 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Weltea871a382018-02-25 02:03:14 +01002394 msg_type := RSL_MT_IPAC_DLCX_NACK,
2395 ies := {
2396 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2397 /* optional connection ID */
2398 *,
2399 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
2400 }
2401 }
2402
Harald Welte9958a4d2017-12-14 21:21:33 +01002403
Vadim Yanitskiy58b16532021-10-09 20:27:39 +06002404 template (value) RSL_Message
2405 ts_RSL_IPA_PDCH_ACT(template (value) RslChannelNr chan_nr) := {
Harald Welteee19c732018-04-05 09:08:26 +02002406 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2407 msg_type := RSL_MT_IPAC_PDCH_ACT,
2408 ies := {
2409 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
2410 }
2411 }
Vadim Yanitskiy58b16532021-10-09 20:27:39 +06002412 template RSL_Message
2413 tr_RSL_IPA_PDCH_ACT(template (present) RslChannelNr chan_nr) := {
Harald Welteee19c732018-04-05 09:08:26 +02002414 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002415 msg_type := RSL_MT_IPAC_PDCH_ACT,
2416 ies := {
2417 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
2418 }
2419 }
2420
Harald Welteee19c732018-04-05 09:08:26 +02002421
Harald Welte94e0c342018-04-07 11:33:23 +02002422 template RSL_Message ts_RSL_IPA_PDCH_ACT_ACK(RslChannelNr chan_nr,
2423 template (value) RSL_IE_FrameNumber fn) := {
Harald Welteee19c732018-04-05 09:08:26 +02002424 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002425 msg_type := RSL_MT_IPAC_PDCH_ACT_ACK,
2426 ies := {
2427 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2428 t_RSL_IE(RSL_IE_FRAME_NUMBER, RSL_IE_Body:{frame_nr := fn})
2429 }
2430 }
Harald Welteee19c732018-04-05 09:08:26 +02002431 template RSL_Message tr_RSL_IPA_PDCH_ACT_ACK(template RslChannelNr chan_nr,
2432 template RSL_IE_FrameNumber fn) := {
2433 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2434 msg_type := RSL_MT_IPAC_PDCH_ACT_ACK,
2435 ies := {
2436 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2437 tr_RSL_IE(RSL_IE_Body:{frame_nr := fn})
2438 }
2439 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002440
2441 template RSL_Message ts_RSL_IPA_PDCH_ACT_NACK(RslChannelNr chan_nr, RSL_Cause cause) := {
Harald Welteee19c732018-04-05 09:08:26 +02002442 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002443 msg_type := RSL_MT_IPAC_PDCH_ACT_NACK,
2444 ies := {
2445 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2446 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2447 }
2448 }
Harald Welteee19c732018-04-05 09:08:26 +02002449 template RSL_Message tr_RSL_IPA_PDCH_ACT_NACK(template RslChannelNr chan_nr,
2450 template RSL_Cause cause) := {
2451 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2452 msg_type := RSL_MT_IPAC_PDCH_ACT_NACK,
2453 ies := {
2454 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2455 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
2456 }
2457 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002458
Harald Welteee19c732018-04-05 09:08:26 +02002459 template RSL_Message ts_RSL_IPA_PDCH_DEACT(RslChannelNr chan_nr) := {
2460 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2461 msg_type := RSL_MT_IPAC_PDCH_DEACT,
2462 ies := {
2463 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
2464 }
2465 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002466 template RSL_Message tr_RSL_IPA_PDCH_DEACT(template RslChannelNr chan_nr) := {
Harald Welteee19c732018-04-05 09:08:26 +02002467 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002468 msg_type := RSL_MT_IPAC_PDCH_DEACT,
2469 ies := {
2470 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
2471 }
2472 }
2473
2474 template RSL_Message ts_RSL_IPA_PDCH_DEACT_ACK(RslChannelNr chan_nr) := {
Harald Welteee19c732018-04-05 09:08:26 +02002475 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002476 msg_type := RSL_MT_IPAC_PDCH_DEACT_ACK,
2477 ies := {
2478 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
2479 }
2480 }
Harald Welteee19c732018-04-05 09:08:26 +02002481 template RSL_Message tr_RSL_IPA_PDCH_DEACT_ACK(template RslChannelNr chan_nr) := {
2482 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2483 msg_type := RSL_MT_IPAC_PDCH_DEACT_ACK,
2484 ies := {
2485 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
2486 }
2487 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002488
2489 template RSL_Message ts_RSL_IPA_PDCH_DEACT_NACK(RslChannelNr chan_nr, RSL_Cause cause) := {
Harald Welteee19c732018-04-05 09:08:26 +02002490 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002491 msg_type := RSL_MT_IPAC_PDCH_DEACT_NACK,
2492 ies := {
2493 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2494 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2495 }
2496 }
Harald Welteee19c732018-04-05 09:08:26 +02002497 template RSL_Message tr_RSL_IPA_PDCH_DEACT_NACK(template RslChannelNr chan_nr,
2498 template RSL_Cause cause) := {
2499 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2500 msg_type := RSL_MT_IPAC_PDCH_DEACT_NACK,
2501 ies := {
2502 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2503 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
2504 }
2505 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002506
Harald Welte908ce542019-09-04 23:05:40 +02002507 template (value) RSL_Message ts_RSL_OSMO_ETWS_CMD(template (value) octetstring msg,
2508 template (value) RslChannelNr chan_nr := ts_RslChanNr_PCH_AGCH(0)) := {
2509 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2510 msg_type := RSL_MT_OSMO_ETWS_CMD,
2511 ies := {
2512 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2513 t_RSL_IE(RSL_IE_SMSCB_MSG, RSL_IE_Body:{smscb_message := ts_RSL_LV(msg)})
2514 }
2515 }
2516 template RSL_Message tr_RSL_OSMO_ETWS_CMD(template RslChannelNr chan_nr := ?,
2517 template octetstring msg := ?) := {
2518 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2519 msg_type := RSL_MT_OSMO_ETWS_CMD,
2520 ies := {
2521 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2522 tr_RSL_IE(RSL_IE_Body:{smscb_message := tr_RSL_LV(msg)})
2523 }
2524 }
2525
2526
Harald Welte9958a4d2017-12-14 21:21:33 +01002527
Harald Welte6a8199d2018-01-29 21:58:53 +01002528 function f_rsl_find_ie(RSL_Message msg, RSL_IE_Type iei, out RSL_IE_Body ret) return boolean {
2529 for (var integer i := 0; i < sizeof(msg.ies); i := i+1) {
2530 if (msg.ies[i].iei == iei) {
2531 ret := msg.ies[i].body;
2532 return true;
2533 }
2534 }
2535 return false;
2536 }
2537
2538
Harald Welte9958a4d2017-12-14 21:21:33 +01002539
Harald Welte643e2a62017-11-27 15:03:18 +01002540} with { encode "RAW" ; variant "FIELDORDER(msb)" }