blob: 6681024a48daa4c553907ec6fd3bd8e60053e473 [file] [log] [blame]
Harald Welte643e2a62017-11-27 15:03:18 +01001module RSL_Types {
2
Vadim Yanitskiyc06688e2020-05-06 15:22:45 +07003/* RSL types defining abstract TTCN-3 data types for the A-bis RSL protocol.
Harald Welte35bb7162018-01-03 21:07:52 +01004 *
5 * RSL is a 3GPP standard protocol used between BTS and BSC in a GSM network.
6 *
7 * (C) 2017 by Harald Welte <laforge@gnumonks.org>
8 * All rights reserved.
9 *
10 * Released under the terms of GNU General Public License, Version 2 or
11 * (at your option) any later version.
Harald Welte34b5a952019-05-27 11:54:11 +020012 *
13 * SPDX-License-Identifier: GPL-2.0-or-later
Harald Welte35bb7162018-01-03 21:07:52 +010014 */
15
Harald Welte643e2a62017-11-27 15:03:18 +010016 import from General_Types all;
17 import from Osmocom_Types all;
Vadim Yanitskiye02dbcc2020-08-25 04:20:51 +070018 import from GSM_RR_Types all;
Harald Welte643e2a62017-11-27 15:03:18 +010019 import from GSM_Types all;
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +070020 import from MobileL3_CommonIE_Types all;
21 import from L3_Templates all;
Harald Welte643e2a62017-11-27 15:03:18 +010022
23 /* Section 9.1 */
24 type enumerated RSL_MessageGroup {
25 RSL_MDISC_RESERVED ('0000000'B),
26 RSL_MDISC_RLL ('0000001'B),
27 RSL_MDISC_DCHAN ('0000100'B),
28 RSL_MDISC_CCHAN ('0000110'B),
29 RSL_MDISC_TRX_MGMT ('0001000'B),
30 RSL_MDISC_LCS ('0010000'B),
31 RSL_MDISC_IPACCESS ('0111111'B)
32 } with { variant "FIELDLENGTH(7)" };
33
34 /* Section 9.1 */
35 type record RSL_MessageDiscriminator {
36 RSL_MessageGroup msg_group,
37 boolean transparent
38 } with { variant "FIELDORDER(msb)" };
39
Harald Welteefa7d912018-04-18 23:22:15 +020040 template (value) RSL_MessageDiscriminator ts_RSL_MsgDisc(RSL_MessageGroup mg, boolean t := true) := {
Harald Welte643e2a62017-11-27 15:03:18 +010041 msg_group := mg,
42 transparent := t
43 }
Harald Welteefa7d912018-04-18 23:22:15 +020044 template RSL_MessageDiscriminator tr_RSL_MsgDisc(template RSL_MessageGroup mg, boolean t := true) := {
45 msg_group := mg,
46 transparent := t
47 }
48
Harald Welte643e2a62017-11-27 15:03:18 +010049
50 /* Section 9.2 */
51 type enumerated RSL_MessageType {
52 /* Radio Link Layer Management */
53 RSL_MT_DATA_REQ ('00000001'B),
54 RSL_MT_DATA_IND ('00000010'B),
55 RSL_MT_ERROR_IND ('00000011'B),
56 RSL_MT_EST_REQ ('00000100'B),
57 RSL_MT_EST_CONF ('00000101'B),
58 RSL_MT_EST_IND ('00000110'B),
59 RSL_MT_REL_REQ ('00000111'B),
60 RSL_MT_REL_CONF ('00001000'B),
61 RSL_MT_REL_IND ('00001001'B),
62 RSL_MT_UNIT_DATA_REQ ('00001010'B),
63 RSL_MT_UNIT_DATA_IND ('00001011'B),
64
65 /* non-standard below */
66 RSL_MT_SUSP_REQ ('00001100'B),
67 RSL_MT_SUSP_CONF ('00001101'B),
68 RSL_MT_RES_REQ ('00001110'B),
69 RSL_MT_RECON_REQ ('00001111'B),
70
71 /* Common Channel Management / TRX Management */
72 RSL_MT_BCCH_INFO ('00010001'B),
Harald Welte319be822017-12-07 17:50:26 +010073 RSL_MT_CCCH_LOAD_IND ('00010010'B),
74 RSL_MT_CHAN_RQD ('00010011'B),
75 RSL_MT_DELETE_IND ('00010100'B),
76 RSL_MT_PAGING_CMD ('00010101'B),
77 RSL_MT_IMMEDIATE_ASSIGN_CMD ('00010110'B),
78 RSL_MT_SMS_BC_REQ ('00010111'B),
79 RSL_MT_CHAN_CONF ('00011000'B), /* non-standard element */
Harald Welte643e2a62017-11-27 15:03:18 +010080 /* empty */
81 RSL_MT_RF_RES_IND ('00011001'B),
Harald Welte319be822017-12-07 17:50:26 +010082 RSL_MT_SACCH_FILL ('00011010'B),
83 RSL_MT_OVERLOAD ('00011011'B),
84 RSL_MT_ERROR_REPORT ('00011100'B),
85 RSL_MT_SMS_BC_CMD ('00011101'B),
86 RSL_MT_CBCH_LOAD_IND ('00011110'B),
87 RSL_MT_NOT_CMD ('00011111'B),
Harald Welte643e2a62017-11-27 15:03:18 +010088
89 /* Dedicate Channel Management */
90 RSL_MT_CHAN_ACTIV ('00100001'B),
Harald Welte319be822017-12-07 17:50:26 +010091 RSL_MT_CHAN_ACTIV_ACK ('00100010'B),
92 RSL_MT_CHAN_ACTIV_NACK ('00100011'B),
93 RSL_MT_CONN_FAIL ('00100100'B),
94 RSL_MT_DEACTIVATE_SACCH ('00100101'B),
95 RSL_MT_ENCR_CMD ('00100110'B),
96 RSL_MT_HANDO_DET ('00100111'B),
97 RSL_MT_MEAS_RES ('00101000'B),
98 RSL_MT_MODE_MODIFY_REQ ('00101001'B),
99 RSL_MT_MODE_MODIFY_ACK ('00101010'B),
100 RSL_MT_MODE_MODIFY_NACK ('00101011'B),
101 RSL_MT_PHY_CONTEXT_REQ ('00101100'B),
102 RSL_MT_PHY_CONTEXT_CONF ('00101101'B),
103 RSL_MT_RF_CHAN_REL ('00101110'B),
104 RSL_MT_MS_POWER_CONTROL ('00101111'B),
105 RSL_MT_BS_POWER_CONTROL ('00110000'B), /* 0x30 */
106 RSL_MT_PREPROC_CONFIG ('00110001'B),
107 RSL_MT_PREPROC_MEAS_RES ('00110010'B),
108 RSL_MT_RF_CHAN_REL_ACK ('00110011'B),
109 RSL_MT_SACCH_INFO_MODIFY('00110100'B),
110 RSL_MT_TALKER_DET ('00110101'B),
111 RSL_MT_LISTENER_DET ('00110110'B),
112 RSL_MT_REMOTE_CODEC_CONF_REP ('00110111'B),
113 RSL_MT_RTD_REP ('00111000'B),
114 RSL_MT_PRE_HANDO_NOTIF ('00111001'B),
115 RSL_MT_MR_CODEC_MOD_REQ ('00111010'B),
116 RSL_MT_MR_CODEC_MOD_ACK ('00111011'B),
117 RSL_MT_MR_CODEC_MOD_NACK ('00111100'B),
118 RSL_MT_MR_CODEC_MOD_PER ('00111101'B),
119 RSL_MT_TFO_REP ('00111110'B),
120 RSL_MT_TFO_MOD_REQ ('00111111'B), /* 0x3f */
Harald Welte643e2a62017-11-27 15:03:18 +0100121
122 RSL_MT_LOCATION_INFO ('01000001'B),
123
124 /* ip.access specific RSL message types */
125 RSL_MT_IPAC_DIR_RETR_ENQ ('01000000'B),
126
127 RSL_MT_IPAC_PDCH_ACT ('01001000'B),
Harald Welte319be822017-12-07 17:50:26 +0100128 RSL_MT_IPAC_PDCH_ACT_ACK ('01001001'B),
129 RSL_MT_IPAC_PDCH_ACT_NACK ('01001010'B),
Harald Welte643e2a62017-11-27 15:03:18 +0100130 RSL_MT_IPAC_PDCH_DEACT ('01001011'B),
Harald Welte319be822017-12-07 17:50:26 +0100131 RSL_MT_IPAC_PDCH_DEACT_ACK ('01001100'B),
132 RSL_MT_IPAC_PDCH_DEACT_NACK ('01001101'B),
Harald Welte643e2a62017-11-27 15:03:18 +0100133
134 RSL_MT_IPAC_CONNECT_MUX ('01010000'B),
Harald Weltef3075002017-12-16 22:31:41 +0100135 RSL_MT_IPAC_CONNECT_MUX_ACK ('01010001'B),
136 RSL_MT_IPAC_CONNECT_MUX_NACK ('01010010'B),
137 RSL_MT_IPAC_BIND_MUX ('01010011'B),
138 RSL_MT_IPAC_BIND_MUX_ACK ('01010100'B),
139 RSL_MT_IPAC_BIND_MUX_NACK ('01010101'B),
140 RSL_MT_IPAC_DISC_MUX ('01010110'B),
141 RSL_MT_IPAC_DISC_MUX_ACK ('01010111'B),
142 RSL_MT_IPAC_DISC_MUX_NACK ('01011000'B),
Harald Welte643e2a62017-11-27 15:03:18 +0100143 RSL_MT_IPAC_MEAS_PREPROC_DFT ('01100000'B),
Harald Weltef3075002017-12-16 22:31:41 +0100144 RSL_MT_IPAC_HO_CAN_ENQ ('01100001'B),
145 RSL_MT_IPAC_HO_CAN_RES ('01100010'B),
146 RSL_MT_IPAC_CRCX ('01110000'B),
147 RSL_MT_IPAC_CRCX_ACK ('01110001'B),
148 RSL_MT_IPAC_CRCX_NACK ('01110010'B),
149 RSL_MT_IPAC_MDCX ('01110011'B),
150 RSL_MT_IPAC_MDCX_ACK ('01110100'B),
151 RSL_MT_IPAC_MDCX_NACK ('01110101'B),
152 RSL_MT_IPAC_DLCX_IND ('01110110'B),
153 RSL_MT_IPAC_DLCX ('01110111'B),
154 RSL_MT_IPAC_DLCX_ACK ('01111000'B),
Harald Welte908ce542019-09-04 23:05:40 +0200155 RSL_MT_IPAC_DLCX_NACK ('01111001'B),
156
157 RSL_MT_OSMO_ETWS_CMD ('01111111'B)
Harald Welte643e2a62017-11-27 15:03:18 +0100158 } with { variant "FIELDLENGTH(8)" };
159
160 /*! RSL Information Element Identifiers (Chapter 9.3) */
161 type enumerated RSL_IE_Type {
162 RSL_IE_CHAN_NR ('00000001'B),
Harald Welte319be822017-12-07 17:50:26 +0100163 RSL_IE_LINK_IDENT ('00000010'B),
164 RSL_IE_ACT_TYPE ('00000011'B),
165 RSL_IE_BS_POWER ('00000100'B),
166 RSL_IE_CHAN_IDENT ('00000101'B),
167 RSL_IE_CHAN_MODE ('00000110'B),
168 RSL_IE_ENCR_INFO ('00000111'B),
169 RSL_IE_FRAME_NUMBER ('00001000'B),
170 RSL_IE_HANDO_REF ('00001001'B),
171 RSL_IE_L1_INFO ('00001010'B),
172 RSL_IE_L3_INFO ('00001011'B),
173 RSL_IE_MS_IDENTITY ('00001100'B),
174 RSL_IE_MS_POWER ('00001101'B),
175 RSL_IE_PAGING_GROUP ('00001110'B),
176 RSL_IE_PAGING_LOAD ('00001111'B),
177 RSL_IE_PYHS_CONTEXT ('00010000'B),
178 RSL_IE_ACCESS_DELAY ('00010001'B),
179 RSL_IE_RACH_LOAD ('00010010'B),
180 RSL_IE_REQ_REFERENCE ('00010011'B),
181 RSL_IE_RELEASE_MODE ('00010100'B),
182 RSL_IE_RESOURCE_INFO ('00010101'B),
183 RSL_IE_RLM_CAUSE ('00010110'B),
184 RSL_IE_STARTNG_TIME ('00010111'B),
185 RSL_IE_TIMING_ADVANCE ('00011000'B),
186 RSL_IE_UPLINK_MEAS ('00011001'B),
187 RSL_IE_CAUSE ('00011010'B),
188 RSL_IE_MEAS_RES_NR ('00011011'B),
189 RSL_IE_MSG_ID ('00011100'B),
Harald Welte643e2a62017-11-27 15:03:18 +0100190 /* reserved */
191 RSL_IE_SYSINFO_TYPE ('00011110'B),
Harald Welte319be822017-12-07 17:50:26 +0100192 RSL_IE_MS_POWER_PARAM ('00011111'B),
193 RSL_IE_BS_POWER_PARAM ('00100000'B),
194 RSL_IE_PREPROC_PARAM ('00100001'B),
195 RSL_IE_PREPROC_MEAS ('00100010'B),
196 RSL_IE_IMM_ASS_INFO ('00100011'B),/* Phase 1 (3.6.0), later Full below */
197 RSL_IE_SMSCB_INFO ('00100100'B),
198 RSL_IE_MS_TIMING_OFFSET ('00100101'B),
199 RSL_IE_ERR_MSG ('00100110'B),
200 RSL_IE_FULL_BCCH_INFO ('00100111'B),
201 RSL_IE_CHAN_NEEDED ('00101000'B),
202 RSL_IE_CB_CMD_TYPE ('00101001'B),
203 RSL_IE_SMSCB_MSG ('00101010'B),
204 RSL_IE_FULL_IMM_ASS_INFO ('00101011'B),
205 RSL_IE_SACCH_INFO ('00101100'B),
206 RSL_IE_CBCH_LOAD_INFO ('00101101'B),
207 RSL_IE_SMSCB_CHAN_INDICATOR ('00101110'B),
208 RSL_IE_GROUP_CALL_REF ('00101111'B),
209 RSL_IE_CHAN_DESC ('00110000'B),
210 RSL_IE_NCH_DRX_INFO ('00110001'B),
211 RSL_IE_CMD_INDICATOR ('00110010'B),
212 RSL_IE_EMLPP_PRIO ('00110011'B),
213 RSL_IE_UIC ('00110100'B),
214 RSL_IE_MAIN_CHAN_REF ('00110101'B),
215 RSL_IE_MR_CONFIG ('00110110'B),
216 RSL_IE_MR_CONTROL ('00110111'B),
217 RSL_IE_SUP_CODEC_TYPES ('00111000'B),
218 RSL_IE_CODEC_CONFIG ('00111001'B),
219 RSL_IE_RTD ('00111010'B),
220 RSL_IE_TFO_STATUS ('00111011'B),
221 RSL_IE_LLP_APDU ('00111100'B),
Harald Welte643e2a62017-11-27 15:03:18 +0100222
Pau Espin Pedrol29c6dfb2022-08-08 18:37:56 +0200223 /* Osmocom extensions */
Vadim Yanitskiy1f532152021-11-01 20:37:56 +0300224 RSL_IE_OSMO_REP_ACCH_CAP ('01100000'B),
Neels Hofmeyr2bef0dd2021-04-22 21:46:00 +0000225 RSL_IE_OSMO_TRAINING_SEQUENCE ('01100001'B),
Vadim Yanitskiya203d3b2021-11-01 21:32:31 +0300226 RSL_IE_OSMO_TOP_ACCH_CAP ('01100010'B),
Pau Espin Pedrol29c6dfb2022-08-08 18:37:56 +0200227 RSL_IE_OSMO_OSMUX_CID ('01100011'B),
Neels Hofmeyr2bef0dd2021-04-22 21:46:00 +0000228
Harald Welte643e2a62017-11-27 15:03:18 +0100229 /* ip.access */
230 RSL_IE_IPAC_SRTP_CONFIG ('11100000'B),
Harald Welte319be822017-12-07 17:50:26 +0100231 RSL_IE_IPAC_PROXY_UDP ('11100001'B),
232 RSL_IE_IPAC_BSCMPL_TOUT ('11100010'B),
Harald Welte643e2a62017-11-27 15:03:18 +0100233
234 RSL_IE_IPAC_REMOTE_IP ('11110000'B),
Harald Welte319be822017-12-07 17:50:26 +0100235 RSL_IE_IPAC_REMOTE_PORT ('11110001'B),
236 RSL_IE_IPAC_RTP_PAYLOAD ('11110010'B),
237 RSL_IE_IPAC_LOCAL_PORT ('11110011'B),
238 RSL_IE_IPAC_SPEECH_MODE ('11110100'B),
239 RSL_IE_IPAC_LOCAL_IP ('11110101'B),
240 RSL_IE_IPAC_CONN_STAT ('11110110'B),
241 RSL_IE_IPAC_HO_C_PARMS ('11110111'B),
242 RSL_IE_IPAC_CONN_ID ('11111000'B),
243 RSL_IE_IPAC_RTP_CSD_FMT ('11111001'B),
244 RSL_IE_IPAC_RTP_JIT_BUF ('11111010'B),
245 RSL_IE_IPAC_RTP_COMPR ('11111011'B),
246 RSL_IE_IPAC_RTP_PAYLOAD2 ('11111100'B),
247 RSL_IE_IPAC_RTP_MPLEX ('11111101'B),
248 RSL_IE_IPAC_RTP_MPLEX_ID ('11111110'B)
Harald Welte643e2a62017-11-27 15:03:18 +0100249 } with { variant "FIELDLENGTH(8)" };
250
251 type record RSL_LV {
252 uint8_t len,
253 octetstring payload
254 } with { variant (len) "LENGTHTO(payload)" }
255
Harald Welteefa7d912018-04-18 23:22:15 +0200256 template (value) RSL_LV ts_RSL_LV(template (value) octetstring pl) := {
Harald Welte643e2a62017-11-27 15:03:18 +0100257 len := 0,
258 payload := pl
259 }
260
Harald Welte51d74102017-12-10 23:05:02 +0100261 template RSL_LV tr_RSL_LV(template octetstring pl) := {
262 len := ?,
263 payload := pl
264 }
265
Harald Welte15bb5b52017-12-07 17:52:04 +0100266 type record RSL_L16V {
267 uint16_t len,
268 octetstring payload
269 } with { variant (len) "LENGTHTO(payload)" }
270
Harald Welteefa7d912018-04-18 23:22:15 +0200271 template (value) RSL_L16V ts_RSL_L16V(template (value) octetstring pl) := {
Harald Welte15bb5b52017-12-07 17:52:04 +0100272 len := 0,
273 payload := pl
274 }
275
Harald Welte7794d5b2017-12-16 23:00:20 +0100276 template RSL_L16V tr_RSL_L16V(template octetstring pl) := {
277 len := ?,
278 payload := pl
279 }
280
Harald Welte643e2a62017-11-27 15:03:18 +0100281 type record RSL_IE_V {
282 uint8_t val
283 }
284
285 /* 9.3.3 */
286 type record RSL_IE_ActivationType {
287 boolean reactivation,
288 uint4_t reserved,
Harald Welte921f9e02019-05-19 22:27:11 +0200289 RSL_ActivationAbits a_bits
290 };
291 type enumerated RSL_ActivationAbits {
292 ACT_REL_TO_IMM_ASSIGN ('000'B),
293 ACT_REL_TO_NORM_ASSIGN ('001'B),
294 ACT_REL_TO_ASYNC_HANDOVER ('010'B),
295 ACT_REL_TO_SYNC_HANDOVER ('011'B),
296 ACT_REL_TO_ADDL_ASSIGN ('100'B),
297 ACT_REL_TO_MSLOT_CONFIG ('101'B),
298 ACT_REL_TO_OSMO_PDCH ('111'B)
299 } with { variant "FIELDLENGTH(3)" };
Harald Welte643e2a62017-11-27 15:03:18 +0100300
Harald Welte921f9e02019-05-19 22:27:11 +0200301 const RSL_IE_ActivationType t_RSL_IE_ActType_IA := {
Harald Welte643e2a62017-11-27 15:03:18 +0100302 reactivation := false,
303 reserved := 0,
Harald Welte921f9e02019-05-19 22:27:11 +0200304 a_bits := ACT_REL_TO_IMM_ASSIGN
305 }
306 const RSL_IE_ActivationType t_RSL_IE_ActType_ASS := {
307 reactivation := false,
308 reserved := 0,
309 a_bits := ACT_REL_TO_NORM_ASSIGN
310 }
311 const RSL_IE_ActivationType t_RSL_IE_ActType_HO_ASYNC := {
312 reactivation := false,
313 reserved := 0,
314 a_bits := ACT_REL_TO_ASYNC_HANDOVER
315 }
316 const RSL_IE_ActivationType t_RSL_IE_ActType_HO_SYNC := {
317 reactivation := false,
318 reserved := 0,
319 a_bits := ACT_REL_TO_SYNC_HANDOVER
Harald Welte643e2a62017-11-27 15:03:18 +0100320 }
321
Harald Welte94e0c342018-04-07 11:33:23 +0200322 /* osmocom-style dynamic PDCH */
Vadim Yanitskiy58b16532021-10-09 20:27:39 +0600323 const RSL_IE_ActivationType c_RSL_IE_ActType_PDCH := {
Harald Welte94e0c342018-04-07 11:33:23 +0200324 reactivation := false,
325 reserved := 1,
Harald Welte921f9e02019-05-19 22:27:11 +0200326 a_bits := ACT_REL_TO_OSMO_PDCH
Harald Welte94e0c342018-04-07 11:33:23 +0200327 }
328
Vadim Yanitskiye02dbcc2020-08-25 04:20:51 +0700329 /* 9.3.5 */
330 type record RSL_IE_ChannelIdent {
331 uint8_t len,
332 /* 3GPP TS 44.018 Channel Description IE (TV) */
333 ChannelDescriptionTV ch_desc,
334 /* 3GPP TS 44.018 Mobile Allocation IE (shall be empty) */
335 MobileAllocationTLV ma
336 } with { variant (len) "LENGTHTO(ch_desc,ma)" };
337
338 template (value) RSL_IE_ChannelIdent
339 ts_RSL_ChannelIdent(template (value) ChannelDescription ch_desc) := {
340 len := 0, /* overwritten */
341 ch_desc := {
342 iei := '64'O,
343 v := ch_desc
344 },
345 /* Shall be included but empty */
346 ma := {
347 iei := '72'O,
348 v := {
349 len := 0,
350 ma := ''B
351 }
352 }
353 };
354
355 template RSL_IE_ChannelIdent
356 tr_RSL_ChannelIdent(template (present) ChannelDescription ch_desc := ?,
357 template (present) MobileAllocationLV ma := ?) := {
358 len := ?,
359 ch_desc := {
360 iei := '64'O,
361 v := ch_desc
362 },
363 /* Shall be included but empty */
364 ma := {
365 iei := '72'O,
366 v := ma
367 }
368 };
369
Harald Welte643e2a62017-11-27 15:03:18 +0100370 /* 9.3.6 */
371 type enumerated RSL_SpeechDataInd {
372 RSL_SPDI_SPEECH ('00000001'B),
373 RSL_SPDI_DATA ('00000010'B),
374 RSL_SPDI_SIGN ('00000011'B)
375 } with { variant "FIELDLENGTH(8)" };
376 type enumerated RSL_ChanRateType {
377 RSL_CHRT_SDCCH ('00000001'B),
378 RSL_CHRT_TCH_F ('00001000'B),
379 RSL_CHRT_TCH_H ('00001001'B),
380 RSL_CHRT_TCH_F_BD_MSLOT ('00001010'B),
381 RSL_CHRT_TCH_F_DL_MSLOT ('00011010'B),
382 RSL_CHRT_TCH_F_GROUP ('00011000'B),
383 RSL_CHRT_TCH_H_GROUP ('00011001'B),
384 RSL_CHRT_TCH_F_BCAST ('00101000'B),
Neels Hofmeyr2bef0dd2021-04-22 21:46:00 +0000385 RSL_CHRT_TCH_H_BCAST ('00101001'B),
386 RSL_CHRT_OSMO_TCH_F_VAMOS ('10001000'B),
387 RSL_CHRT_OSMO_TCH_H_VAMOS ('10001001'B)
Harald Welte643e2a62017-11-27 15:03:18 +0100388 } with { variant "FIELDLENGTH(8)" };
389 type enumerated RSL_SpeechAlgo {
390 RSL_CMOD_NO_RESOURCE ('00000000'B),
391 RSL_CMOD_SP_GSM1 ('00000001'B),
392 RSL_CMOD_SP_GSM2 ('00010001'B),
393 RSL_CMOD_SP_GSM3 ('00100001'B),
394 RSL_CMOD_SP_GSM4 ('00110001'B),
395 RSL_CMOD_SP_GSM5 ('00001001'B),
396 RSL_CMOD_SP_GSM6 ('00001101'B)
397 } with { variant "FIELDLENGTH(8)" };
398 type record RSL_IE_ChannelMode {
Harald Welte8f2c21d2017-12-07 17:52:40 +0100399 uint8_t len,
Harald Welte643e2a62017-11-27 15:03:18 +0100400 BIT6 reserved,
401 boolean dtx_d,
402 boolean dtx_u,
403 RSL_SpeechDataInd spd_ind,
404 RSL_ChanRateType ch_rate_type,
405 RSL_SpeechAlgo coding_alg_rate
Harald Welte8f2c21d2017-12-07 17:52:40 +0100406 } with { variant (len) "LENGTHTO(reserved,dtx_d,dtx_u,spd_ind,ch_rate_type,coding_alg_rate)" }
Harald Welte643e2a62017-11-27 15:03:18 +0100407
Vadim Yanitskiy8fc43df2020-10-20 02:11:05 +0700408 template (value) RSL_IE_ChannelMode ts_RSL_ChanMode_SIGN(RSL_ChanRateType t := RSL_CHRT_SDCCH,
409 boolean dtx_downlink := false) := {
Harald Welte8f2c21d2017-12-07 17:52:40 +0100410 len := 0, /* overwritten */
Harald Welte643e2a62017-11-27 15:03:18 +0100411 reserved := '000000'B,
Stefan Sperling4880be42018-08-07 18:12:59 +0200412 dtx_d := dtx_downlink,
Harald Welte643e2a62017-11-27 15:03:18 +0100413 dtx_u := false,
414 spd_ind := RSL_SPDI_SIGN,
Philipp Maierac693462020-10-14 20:21:44 +0200415 ch_rate_type := t,
Harald Welte643e2a62017-11-27 15:03:18 +0100416 coding_alg_rate := RSL_CMOD_NO_RESOURCE
417 }
418
Stefan Sperling4880be42018-08-07 18:12:59 +0200419 template (value) RSL_IE_ChannelMode ts_RSL_ChanMode(RSL_ChanRateType t, RSL_SpeechAlgo alg,
420 boolean dtx_downlink := false) := {
Harald Welte8f2c21d2017-12-07 17:52:40 +0100421 len := 0, /* overwritten */
Harald Welte643e2a62017-11-27 15:03:18 +0100422 reserved := '000000'B,
Stefan Sperling4880be42018-08-07 18:12:59 +0200423 dtx_d := dtx_downlink,
Harald Welte643e2a62017-11-27 15:03:18 +0100424 dtx_u := false,
425 spd_ind := RSL_SPDI_SPEECH,
426 ch_rate_type := t,
427 coding_alg_rate := alg
428 }
Harald Welte3618d9d2018-03-21 18:45:27 +0100429 template RSL_IE_ChannelMode tr_RSL_ChanMode(template RSL_ChanRateType t,
430 template RSL_SpeechAlgo alg) := {
431 len := ?,
432 reserved := '000000'B,
433 dtx_d := ?,
434 dtx_u := ?,
435 spd_ind := RSL_SPDI_SPEECH,
436 ch_rate_type := t,
437 coding_alg_rate := alg
438 }
Harald Welte643e2a62017-11-27 15:03:18 +0100439
Vadim Yanitskiy117c1762020-06-16 01:40:10 +0700440 /* 9.3.4 BS Power IE */
Harald Welte643e2a62017-11-27 15:03:18 +0100441 type record RSL_IE_BS_Power {
Vadim Yanitskiy117c1762020-06-16 01:40:10 +0700442 uint2_t reserved,
Harald Welte643e2a62017-11-27 15:03:18 +0100443 boolean epc,
444 boolean fpc,
Vadim Yanitskiy117c1762020-06-16 01:40:10 +0700445 uint4_t power_level
Harald Welte643e2a62017-11-27 15:03:18 +0100446 }
447
Vadim Yanitskiy117c1762020-06-16 01:40:10 +0700448 template (value) RSL_IE_BS_Power ts_RSL_IE_BS_Power(uint4_t power_level,
Eric Wildae8f2622019-06-18 17:05:11 +0200449 boolean epc := false, boolean fpc := false) := {
450 reserved := 0,
451 epc := epc,
452 fpc := fpc,
453 power_level := power_level
454 }
Vadim Yanitskiy2a5a1ef2021-06-30 00:51:48 +0200455 template RSL_IE_BS_Power
456 tr_RSL_IE_BS_Power(template (present) uint4_t power_level,
457 template (present) boolean epc := ?,
458 template (present) boolean fpc := ?) := {
459 reserved := ?,
460 epc := epc,
461 fpc := fpc,
462 power_level := power_level
463 }
Eric Wildae8f2622019-06-18 17:05:11 +0200464
Harald Welte73cd2712017-12-17 00:44:52 +0100465 /* 9.3.7 */
Harald Weltee613f962018-04-18 22:38:16 +0200466 type enumerated RSL_AlgId {
467 RSL_ALG_ID_A5_0 ('00000001'B),
468 RSL_ALG_ID_A5_1 ('00000010'B),
469 RSL_ALG_ID_A5_2 ('00000011'B),
470 RSL_ALG_ID_A5_3 ('00000100'B),
471 RSL_ALG_ID_A5_4 ('00000101'B),
472 RSL_ALG_ID_A5_5 ('00000110'B),
473 RSL_ALG_ID_A5_6 ('00000111'B),
474 RSL_ALG_ID_A5_7 ('00001000'B)
475 } with { variant "FIELDLENGTH(8)" };
Harald Welte73cd2712017-12-17 00:44:52 +0100476 type record RSL_IE_EncryptionInfo {
477 uint8_t len,
Harald Weltee613f962018-04-18 22:38:16 +0200478 RSL_AlgId alg_id,
Harald Welte73cd2712017-12-17 00:44:52 +0100479 octetstring key
480 } with { variant (len) "LENGTHTO(alg_id,key)" };
481
Harald Weltee613f962018-04-18 22:38:16 +0200482 template RSL_IE_EncryptionInfo tr_RSL_IE_EncrInfo(template RSL_AlgId alg,
483 template octetstring key) := {
Harald Welte73cd2712017-12-17 00:44:52 +0100484 len := ?,
485 alg_id := alg,
486 key := key
487 }
Harald Weltee613f962018-04-18 22:38:16 +0200488 template (value) RSL_IE_EncryptionInfo ts_RSL_IE_EncrInfo(template (value) RSL_AlgId alg,
489 octetstring key) := {
Harald Welteefa7d912018-04-18 23:22:15 +0200490 len := 0, /* overwritten */
491 alg_id := alg,
492 key := key
493 }
494
495
Harald Welte73cd2712017-12-17 00:44:52 +0100496
Harald Welte643e2a62017-11-27 15:03:18 +0100497 /* 9.3.8 */
498 type record RSL_IE_FrameNumber {
499 uint5_t t1_p,
500 uint6_t t3,
501 uint5_t t2
502 }
503 type RSL_IE_FrameNumber RSL_IE_StartingTime;
504
505 /* 9.3.10 */
506 type record RSL_IE_L1Info {
507 uint5_t ms_power_lvl,
508 boolean fpc,
509 uint2_t reserved,
510 uint8_t actual_ta
511 }
512
Neels Hofmeyrafe2ea52021-11-24 15:16:12 +0100513 template (value) RSL_IE_L1Info ts_RSL_IE_L1Info := {
514 ms_power_lvl := 0,
515 fpc := false,
516 reserved := 0,
517 actual_ta := 0
518 };
519
Harald Welte643e2a62017-11-27 15:03:18 +0100520 /* 9.3.13 */
521 type record RSL_IE_MS_Power {
522 uint2_t reserved,
523 boolean fpc_epc,
524 uint5_t power_level
525 }
Pau Espin Pedrolf7630a62019-10-28 15:07:08 +0100526 template RSL_IE_MS_Power tr_RSL_IE_MS_Power(template uint5_t power_level := ?,
527 template boolean fpc_epc := false) := {
528 reserved := 0,
529 fpc_epc := fpc_epc,
530 power_level := power_level
531 }
Harald Welte10280172019-05-19 22:28:04 +0200532 template (value) RSL_IE_MS_Power ts_RSL_IE_MS_Power(uint5_t power_level,
533 boolean fpc_epc := false) := {
534 reserved := 0,
535 fpc_epc := fpc_epc,
536 power_level := power_level
537 }
Harald Welte643e2a62017-11-27 15:03:18 +0100538
Harald Welted5f521e2017-12-07 17:53:06 +0100539 /* 9.3.18 */
540 type record RSL_IE_RachLoad {
541 uint8_t len,
542 uint16_t slot_count,
543 uint16_t busy_count,
544 uint16_t access_count
545 } with { variant (len) "LENGTHTO(slot_count,busy_count,access_count)" }
546
Harald Welteefa7d912018-04-18 23:22:15 +0200547 template (value) RSL_IE_RachLoad ts_RSL_IE_RachLoad(uint16_t slot, uint16_t busy, uint16_t acc) := {
Harald Welted5f521e2017-12-07 17:53:06 +0100548 len := 0, /* overwritten */
549 slot_count := slot,
550 busy_count := busy,
551 access_count := acc
552 }
553
Harald Welte68e495b2018-02-25 00:05:57 +0100554 template RSL_IE_RachLoad tr_RSL_IE_RachLoad(template uint16_t slot,
555 template uint16_t busy,
556 template uint16_t acc) := {
557 len := ?, /* overwritten */
558 slot_count := slot,
559 busy_count := busy,
560 access_count := acc
561 }
562
Harald Welte643e2a62017-11-27 15:03:18 +0100563 /* 9.3.19 */
564 type record RSL_IE_RequestRef {
565 OCT1 ra,
566 RSL_IE_FrameNumber frame_nr
567 }
568
569 /* 3GPP TS 44.018 / 10.5.2.38 Starting Time */
Harald Welte94e0c342018-04-07 11:33:23 +0200570 template (value) RSL_IE_FrameNumber ts_RSL_IE_FrameNumber(GsmFrameNumber fn) := {
Harald Welte643e2a62017-11-27 15:03:18 +0100571 t1_p := (fn / 1326) mod 32,
572 t3 := fn mod 51,
573 t2 := fn mod 26
574 }
575
Harald Welte9abd1282018-02-19 19:18:17 +0100576 function tr_RSL_IE_FrameNumber(template GsmFrameNumber fn) return template RSL_IE_FrameNumber {
577 if (istemplatekind(fn, "?")) {
578 return ?;
579 } else {
580 return ts_RSL_IE_FrameNumber(valueof(fn));
581 }
582 }
583
Harald Welteefa7d912018-04-18 23:22:15 +0200584 template (value) RSL_IE_RequestRef ts_RSL_IE_ReqRef(OCT1 ra, GsmFrameNumber frame_nr) := {
Harald Welte643e2a62017-11-27 15:03:18 +0100585 ra := ra,
586 frame_nr := ts_RSL_IE_FrameNumber(frame_nr)
587 }
588
Harald Welte9abd1282018-02-19 19:18:17 +0100589 template RSL_IE_RequestRef tr_RSL_IE_ReqRef(template OCT1 ra, template GsmFrameNumber frame_nr) := {
590 ra := ra,
591 frame_nr := tr_RSL_IE_FrameNumber(frame_nr)
592 }
593
Vadim Yanitskiy9f699532021-06-03 17:29:22 +0200594 /* 9.3.21 Resource Information */
595 type record RSL_IE_ResourceInfo {
596 uint8_t len,
597 RSL_ResourceInfo info
598 } with { variant (len) "LENGTHTO(info)" };
599
600 type record of RSL_ResourceInfoItem RSL_ResourceInfo;
601 type record RSL_ResourceInfoItem {
602 RslChannelNr chan_nr,
603 uint3_t interf_band,
604 BIT5 rfu ('00000'B)
605 };
606
607 template (value) RSL_ResourceInfoItem
608 ts_RSL_ResourceInfoItem(template (value) RslChannelNr chan_nr,
609 template (value) uint3_t interf_band := 0) := {
610 chan_nr := chan_nr,
611 interf_band := interf_band,
612 rfu := '00000'B
613 }
614 template RSL_ResourceInfoItem
615 tr_RSL_ResourceInfoItem(template (present) RslChannelNr chan_nr := ?,
616 template (present) uint3_t interf_band := ?) := {
617 chan_nr := chan_nr,
618 interf_band := interf_band,
619 rfu := ? /* Tolerate unknown values */
620 }
621
Harald Welte15de8ba2018-06-29 08:51:42 +0200622 /* Osmocom Extension */
623 type record RSL_IE_UplinkMeasSuppMeasInfo {
624 int16_t toa256_mean,
625 int16_t toa256_min,
626 int16_t toa256_max,
627 uint16_t toa256_std_dev
628 };
629
Harald Welte2691adf2018-02-22 17:32:39 +0100630 /* 9.3.25 */
631 type record RSL_IE_UplinkMeas {
632 uint8_t len,
633 BIT1 rfu,
634 boolean dtx_d,
635 uint6_t rxlev_f_u,
636 BIT2 reserved1,
637 uint6_t rxlev_s_u,
638 BIT2 reserved2,
639 uint3_t rxq_f_u,
640 uint3_t rxq_s_u,
Harald Welte15de8ba2018-06-29 08:51:42 +0200641 RSL_IE_UplinkMeasSuppMeasInfo supp_meas_info optional
Harald Welte2691adf2018-02-22 17:32:39 +0100642 } with { variant (len) "LENGTHTO(rfu,dtx_d,rxlev_f_u,reserved1,rxlev_s_u,reserved2,rxq_f_u,rxq_s_u,supp_meas_info)" };
Harald Welte9abd1282018-02-19 19:18:17 +0100643
Neels Hofmeyrafe2ea52021-11-24 15:16:12 +0100644 template (value) RSL_IE_UplinkMeas ts_RSL_IE_UplinkMeas(uint6_t rxlev := 12, uint3_t rxqual := 0) := {
645 len := 0, /* overwritten */
646 rfu := '0'B,
647 dtx_d := false,
648 rxlev_f_u := rxlev,
649 reserved1 := '00'B,
650 rxlev_s_u := rxlev,
651 reserved2 := '00'B,
652 rxq_f_u := rxqual,
653 rxq_s_u := rxqual,
654 supp_meas_info := omit
655 };
656
Harald Welte643e2a62017-11-27 15:03:18 +0100657 /* 9.3.26 */
Harald Weltea8ed9062017-12-14 09:46:01 +0100658 type enumerated RSL_Cause {
659 /* normal event */
660 RSL_ERR_RADIO_IF_FAIL ('00'O),
661 RSL_ERR_RADIO_LINK_FAIL ('01'O),
662 RSL_ERR_HANDOVER_ACC_FAIL ('02'O),
663 RSL_ERR_TALKER_ACC_FAIL ('03'O),
664 RSL_ERR_OM_INTERVENTION ('07'O),
665 RSL_ERR_NORMAL_UNSPEC ('0f'O),
666 RSL_ERR_T_MSRFPCI_EXP ('18'O),
667 /* resource unavailable */
668 RSL_ERR_EQUIPMENT_FAIL ('20'O),
669 RSL_ERR_RR_UNAVAIL ('21'O),
670 RSL_ERR_TERR_CH_FAIL ('22'O),
671 RSL_ERR_CCCH_OVERLOAD ('23'O),
672 RSL_ERR_ACCH_OVERLOAD ('24'O),
673 RSL_ERR_PROCESSOR_OVERLOAD ('25'O),
674 RSL_ERR_BTS_NOT_EQUIPPED ('27'O),
675 RSL_ERR_REMOTE_TRAU_FAILURE ('28'O),
676 RSL_ERR_NOTIF_OVERFLOW ('29'O),
677 RSL_ERR_RES_UNAVAIL ('2f'O),
678 /* service or option not available */
679 RSL_ERR_TRANSC_UNAVAIL ('30'O),
680 RSL_ERR_SERV_OPT_UNAVAIL ('3f'O),
681 /* service or option not implemented */
682 RSL_ERR_ENCR_UNIMPL ('40'O),
683 RSL_ERR_SERV_OPT_UNIMPL ('4f'O),
684 /* invalid message */
685 RSL_ERR_RCH_ALR_ACTV_ALLOC ('50'O),
Harald Welte9912eb52018-02-25 13:30:15 +0100686 RSL_ERR_IPA_RCH_NOT_ACTV_ALLOC ('51'O),
687 RSL_ERR_IPA_CONN_INVALID ('52'O),
688 RSL_ERR_IPA_CONN_IN_USE ('53'O),
689 RSL_ERR_IPA_CONN_ALREADY_EXISTS ('54'O),
Harald Weltea8ed9062017-12-14 09:46:01 +0100690 RSL_ERR_INVALID_MESSAGE ('5f'O),
691 /* protocol error */
692 RSL_ERR_MSG_DISCR ('60'O),
693 RSL_ERR_MSG_TYPE ('61'O),
694 RSL_ERR_MSG_SEQ ('62'O),
695 RSL_ERR_IE_ERROR ('63'O),
696 RSL_ERR_MAND_IE_ERROR ('64'O),
697 RSL_ERR_OPT_IE_ERROR ('65'O),
698 RSL_ERR_IE_NONEXIST ('66'O),
699 RSL_ERR_IE_LENGTH ('67'O),
700 RSL_ERR_IE_CONTENT ('68'O),
701 RSL_ERR_PROTO ('6f'O),
702 /* interworking */
703 RSL_ERR_INTERWORKING ('7f'O)
704 };
Harald Welte643e2a62017-11-27 15:03:18 +0100705 type record RSL_IE_Cause {
Harald Welte6efa8e32017-12-09 22:34:06 +0100706 uint8_t len,
Harald Welte643e2a62017-11-27 15:03:18 +0100707 uint1_t e,
708 RSL_Cause cause,
709 octetstring cause_ext optional
Harald Welte6efa8e32017-12-09 22:34:06 +0100710 } with { variant (len) "LENGTHTO(e,cause,cause_ext)" }
Harald Welte643e2a62017-11-27 15:03:18 +0100711
Harald Welteefa7d912018-04-18 23:22:15 +0200712 template (value) RSL_IE_Cause ts_RSL_IE_Cause(RSL_Cause cause) := {
Harald Welte6efa8e32017-12-09 22:34:06 +0100713 len := 0, /* overwritten */
Harald Welte643e2a62017-11-27 15:03:18 +0100714 e := 0,
715 cause := cause,
716 cause_ext := omit
717 }
718
Harald Welte9abd1282018-02-19 19:18:17 +0100719 template RSL_IE_Cause tr_RSL_IE_Cause(template RSL_Cause cause) := {
720 len := ?,
721 e := 0,
722 cause := cause,
723 cause_ext := omit
724 }
725
Harald Weltec8d363c2019-05-19 20:36:48 +0200726 /* 9.3.29 */
727 type record RSL_SacchInfo {
728 uint8_t len,
729 uint8_t num_msgs,
730 RSL_SacchInfoElements elems
731 } with {
732 variant (len) "LENGTHTO(num_msgs,elems)";
733 variant (num_msgs) "LENGTHTO(elems)";
734 variant (num_msgs) "UNIT(elements)"
735 };
736 type record RSL_SacchInfoElement {
737 RSL_IE_SysinfoType si_type,
738 uint8_t len,
739 octetstring msg
740 } with {
741 variant (len) "LENGTHTO(msg)";
742 };
743 type record of RSL_SacchInfoElement RSL_SacchInfoElements;
744 template (value) RSL_SacchInfo ts_RSL_SacchInfo(template (value) RSL_SacchInfoElements elems) := {
745 len := 0, /* overwritten */
746 num_msgs := 0, /* overwritten */
747 elems := elems
748 }
749 template (value) RSL_SacchInfoElement ts_RSL_SacchInfoElem(RSL_IE_SysinfoType tp, octetstring msg) := {
750 si_type := tp,
751 len := lengthof(msg),
752 msg := msg
753 }
754
Eric Wild61edb7e2019-06-03 12:38:31 +0200755 /* 9.3.31 */
756 type record RSL_IE_MS_Power_Parameters {
757 uint8_t len,
758 octetstring params
759 } with {
760 variant (len) "LENGTHTO(params)";
761 };
762 template (value) RSL_IE_MS_Power_Parameters ts_RSL_IE_MS_Power_Parameters(octetstring params) := {
763 len := 0, /* overwritten */
764 params := params
765 }
766
Harald Welte643e2a62017-11-27 15:03:18 +0100767 /* 9.3.40 */
768 type enumerated RSL_ChanNeeded {
769 RSL_CHANNEED_ANY ('00'B),
770 RSL_CHANNEED_SDCCH ('01'B),
771 RSL_CHANNEED_TCH_F ('10'B),
772 RSL_CHANNEED_TCH_ForH ('11'B)
Harald Welte51d74102017-12-10 23:05:02 +0100773 } with { variant "FIELDLENGTH(2)" };
Harald Welte643e2a62017-11-27 15:03:18 +0100774 type record RSL_IE_ChanNeeded {
775 uint6_t reserved,
776 RSL_ChanNeeded chan_needed
777 }
778
Harald Weltecc373202018-09-10 10:28:21 +0200779 /* 9.3.41 CB Command Type */
780 type enumerated RSL_CbCommand {
781 RSL_CB_CMD_NORMAL ('0000'B),
782 RSL_CB_CMD_SCHEDULE ('1000'B),
783 RSL_CB_CMD_DEFAULT ('1110'B),
784 RSL_CB_CMD_NULL ('1111'B)
785 } with { variant "FIELDLENGTH(4)" };
786 type record RSL_IE_CbCommandType {
787 RSL_CbCommand command,
788 boolean default_bcast_null,
789 BIT1 spare,
790 uint2_t last_block
791 };
792 template (value) RSL_IE_CbCommandType ts_RSL_IE_CbCmdType(RSL_CbCommand cmd := RSL_CB_CMD_NORMAL,
793 uint2_t last_block := 1,
794 boolean def_bcast_null := true) := {
795 command := cmd,
796 default_bcast_null := def_bcast_null,
797 spare := '0'B,
798 last_block := last_block
799 }
800
Harald Welte4a129f82019-05-21 16:35:22 +0200801 /* 9.4.43 CBCH Load Information */
802 type record RSL_IE_CbchLoadInfo {
803 boolean overflow,
804 BIT3 spare,
805 uint4_t slot_count
806 };
807 template RSL_IE_CbchLoadInfo tr_CbchLoadInfo(template boolean overflow,
808 template uint4_t slot_count) := {
809 overflow := overflow,
810 spare := ?,
811 slot_count := slot_count
812 }
813 template (value) RSL_IE_CbchLoadInfo ts_CbchLoadInfo(boolean overflow, uint4_t slot_count) := {
814 overflow := overflow,
815 spare := '000'B,
816 slot_count := slot_count
817 }
818
Pau Espin Pedrolf7634dc2022-09-02 17:56:00 +0200819 /* 9.3.52, 3GPP TS 44.018 10.5.2.21aa */
820 type record RSL_IE_MultirateCfg {
821 uint8_t len,
822 uint3_t mr_speech_ver,
823 boolean nscb,
824 boolean icmi,
825 BIT1 spare,
826 uint2_t start_mode,
Vadim Yanitskiyf14e6962022-09-14 15:18:06 +0700827 BIT8 codec_modes,
Pau Espin Pedrolf7634dc2022-09-02 17:56:00 +0200828 octetstring parameters
829 } with {
Vadim Yanitskiyf14e6962022-09-14 15:18:06 +0700830 variant (len) "LENGTHTO(mr_speech_ver,nscb,icmi,spare,start_mode,codec_modes,parameters)"
Pau Espin Pedrolf7634dc2022-09-02 17:56:00 +0200831 };
832 template (value) RSL_IE_MultirateCfg ts_RSL_MultirateCfg(boolean icmi := true, uint2_t start_mode := 0,
Vadim Yanitskiyf14e6962022-09-14 15:18:06 +0700833 BIT8 codec_modes := '00000100'B /* 5,90k */) := {
Pau Espin Pedrolf7634dc2022-09-02 17:56:00 +0200834 len := 2,
835 mr_speech_ver := 1,
836 nscb := false,
837 icmi := icmi,
838 spare := '0'B,
839 start_mode := start_mode,
Vadim Yanitskiyf14e6962022-09-14 15:18:06 +0700840 codec_modes := codec_modes,
Pau Espin Pedrolf7634dc2022-09-02 17:56:00 +0200841 parameters := ''O
842 }
843
Harald Welte643e2a62017-11-27 15:03:18 +0100844 /* 9.3.53 */
845 type record RSL_IE_MultirateCtrl {
846 uint3_t spare,
847 boolean od,
848 boolean pre,
849 uint2_t rae,
850 boolean tfo
851 }
852
853 type enumerated RSL_IE_SysinfoType {
854 RSL_SYSTEM_INFO_8 ('00000000'B),
855 RSL_SYSTEM_INFO_1 ('00000001'B),
856 RSL_SYSTEM_INFO_2 ('00000010'B),
857 RSL_SYSTEM_INFO_3 ('00000011'B),
858 RSL_SYSTEM_INFO_4 ('00000100'B),
859 RSL_SYSTEM_INFO_5 ('00000101'B),
860 RSL_SYSTEM_INFO_6 ('00000110'B),
861 RSL_SYSTEM_INFO_7 ('00000111'B),
862 RSL_SYSTEM_INFO_16 ('00001000'B),
863 RSL_SYSTEM_INFO_17 ('00001001'B),
864 RSL_SYSTEM_INFO_2bis ('00001010'B),
865 RSL_SYSTEM_INFO_2ter ('00001011'B),
866 RSL_SYSTEM_INFO_5bis ('00001101'B),
867 RSL_SYSTEM_INFO_5ter ('00001110'B),
868 RSL_SYSTEM_INFO_10 ('00001111'B),
869 RSL_EXT_MEAS_ORDER ('01000111'B),
870 RSL_MEAS_INFO ('01001000'B),
871 RSL_SYSTEM_INFO_13 ('00101000'B),
872 RSL_ERIC_SYSTEM_INFO_13 ('00001100'B),
873 RSL_SYSTEM_INFO_2quater ('00101001'B),
874 RSL_SYSTEM_INFO_9 ('00101010'B),
875 RSL_SYSTEM_INFO_18 ('00101011'B),
876 RSL_SYSTEM_INFO_19 ('00101100'B),
877 RSL_SYSTEM_INFO_20 ('00101101'B)
878 } with { variant "FIELDLENGTH(8)" }
879
Harald Welte9958a4d2017-12-14 21:21:33 +0100880 type record RSL_IE_IPA_ConnectionStats {
881 uint8_t len,
882 uint32_t tx_packets,
883 uint32_t tx_octets,
884 uint32_t rx_packets,
885 uint32_t rx_octets,
886 uint32_t lost_packets,
887 uint32_t jitter,
888 uint32_t avg_delay
889 } with { variant (len) "LENGTHTO(tx_packets,tx_octets,rx_packets,rx_octets,lost_packets,jitter,avg_delay)" }
890
891 type enumerated RSL_IPA_SpeechMode {
892 RSL_IPA_SPM_SENDRECV ('00'B),
893 RSL_IPA_SPM_RECVONLY ('01'B),
894 RSL_IPA_SPM_SENDONLY ('10'B),
895 RSL_IPA_SPM_RESERVED ('11'B)
896 } with { variant "FIELDLENGTH(2)" }
897
898 type enumerated RSL_IPA_Codec {
899 RSL_IPA_CODEC_FR ('0000'B),
900 RSL_IPA_CODEC_EFR ('0001'B),
901 RSL_IPA_CODEC_AMR_F ('0010'B),
902 RSL_IPA_CODEC_HR ('0011'B),
903 RSL_IPA_CODEC_AMR_H ('0101'B),
904 RSL_IPA_CODEC_RTP_PT ('1111'B)
905 } with { variant "FIELDLENGTH(4)" }
906
907 type record RSL_IE_IPA_SpeechMode {
908 BIT2 reserved,
909 RSL_IPA_SpeechMode mode,
910 RSL_IPA_Codec codec
911 }
912
Harald Welte0472ab42018-03-12 15:02:26 +0100913 /* 9.3.20 */
914 type enumerated RSL_IE_ReleaseMode {
915 RSL_REL_MODE_NORMAL ('00'B),
916 REL_REL_MODE_LOCAL ('01'B)
917 }
918
Neels Hofmeyr2bef0dd2021-04-22 21:46:00 +0000919 type record RSL_IE_OSMO_TrainingSequence {
920 uint8_t len,
921 uint8_t tsc_set,
922 uint8_t tsc
923 } with { variant (len) "LENGTHTO(tsc_set,tsc)" }
924
Vadim Yanitskiy1f532152021-11-01 20:37:56 +0300925 type record RSL_IE_OSMO_RepAcchCap {
926 uint8_t len,
927 BIT1 rfu ('0'B),
928 uint3_t rxqual,
929 boolean ul_sacch,
930 boolean dl_sacch,
931 boolean dl_facch_all,
932 boolean dl_facch_cmd
933 } with { variant (len) "LENGTHTO(rfu,rxqual,ul_sacch,dl_sacch,dl_facch_all,dl_facch_cmd)" }
934
Vadim Yanitskiya203d3b2021-11-01 21:32:31 +0300935 type record RSL_IE_OSMO_TopAcchCap {
936 uint8_t len,
937 boolean sacch_enable,
938 boolean facch_enable,
939 uint3_t rxqual,
940 uint3_t overpower_db
941 } with { variant (len) "LENGTHTO(sacch_enable,facch_enable,rxqual,overpower_db)" }
942
Vadim Yanitskiy66d3c332021-11-06 18:18:13 +0300943 template (value) RSL_IE_OSMO_TopAcchCap
944 ts_RSL_IE_OSMO_TopAcchCap(template (value) uint3_t overpower := 2,
945 template (value) uint3_t rxqual := 4,
946 boolean facch_enable := true,
947 boolean sacch_enable := true) := {
948 len := 0, /* overwritten */
949 sacch_enable := sacch_enable,
950 facch_enable := facch_enable,
951 rxqual := rxqual,
952 overpower_db := overpower
953 };
954 template RSL_IE_OSMO_TopAcchCap
955 tr_RSL_IE_OSMO_TopAcchCap(template (present) uint3_t overpower := ?,
956 template (present) uint3_t rxqual := ?,
957 template (present) boolean facch_enable := ?,
958 template (present) boolean sacch_enable := ?) := {
959 len := ?, /* overwritten */
960 sacch_enable := sacch_enable,
961 facch_enable := facch_enable,
962 rxqual := rxqual,
963 overpower_db := overpower
964 };
965
Pau Espin Pedrol29c6dfb2022-08-08 18:37:56 +0200966 type record RSL_IE_OSMO_Osmux_CID {
967 uint8_t len,
968 uint8_t cid
969 } with { variant (len) "LENGTHTO(cid)" }
970
971 template (present) RSL_IE_OSMO_Osmux_CID
972 tr_RSL_IE_OSMO_Osmux_CID(template (present) uint8_t osmux_cid := ?) := {
973 len := ?, /* overwritten */
974 cid := osmux_cid
975 };
Pau Espin Pedrol39bfa022022-08-12 14:56:12 +0200976 function f_tr_RSL_IE_OSMO_Osmux_CID(template uint8_t osmux_cid := *)
977 return template RSL_IE_OSMO_Osmux_CID {
978 var template RSL_IE_OSMO_Osmux_CID ie := omit;
979 if (not istemplatekind(osmux_cid, "omit")) {
980 ie := tr_RSL_IE_OSMO_Osmux_CID(osmux_cid);
981 }
982 return ie;
983 }
Pau Espin Pedrol29c6dfb2022-08-08 18:37:56 +0200984 template (value) RSL_IE_OSMO_Osmux_CID
985 ts_RSL_IE_OSMO_Osmux_CID(template (value) uint8_t osmux_cid) := {
986 len := 0, /* overwritten */
987 cid := osmux_cid
988 };
989
990
Harald Welte643e2a62017-11-27 15:03:18 +0100991 /* union of all IE bodies */
992 type union RSL_IE_Body {
993 RslChannelNr chan_nr,
994 RslLinkId link_id,
Harald Welte15bb5b52017-12-07 17:52:04 +0100995 RSL_L16V l3_info,
Harald Welte643e2a62017-11-27 15:03:18 +0100996 RSL_LV rlm_cause,
Harald Welte0472ab42018-03-12 15:02:26 +0100997 RSL_IE_ReleaseMode release_mode,
Harald Welte643e2a62017-11-27 15:03:18 +0100998 RSL_IE_ActivationType act_type,
Vadim Yanitskiye02dbcc2020-08-25 04:20:51 +0700999 RSL_IE_ChannelIdent chan_ident,
Harald Welte643e2a62017-11-27 15:03:18 +01001000 RSL_IE_ChannelMode chan_mode,
1001 uint8_t handover_ref,
1002 RSL_IE_BS_Power bs_power,
Vadim Yanitskiy802508e2020-11-11 07:25:47 +07001003 RSL_LV bs_power_params,
Harald Welte643e2a62017-11-27 15:03:18 +01001004 RSL_IE_MS_Power ms_power,
Eric Wild61edb7e2019-06-03 12:38:31 +02001005 RSL_IE_MS_Power_Parameters ms_power_params,
Harald Welte643e2a62017-11-27 15:03:18 +01001006 uint8_t timing_adv,
Pau Espin Pedrolf7634dc2022-09-02 17:56:00 +02001007 RSL_IE_MultirateCfg multirate_cfg,
Harald Welte643e2a62017-11-27 15:03:18 +01001008 RSL_IE_MultirateCtrl multirate_ctrl,
Harald Weltea6706152019-05-19 20:38:18 +02001009 uint8_t msg_id,
Harald Welte643e2a62017-11-27 15:03:18 +01001010 RSL_IE_FrameNumber frame_nr,
1011 RSL_IE_Cause cause,
1012 uint8_t access_delay,
Harald Welted5f521e2017-12-07 17:53:06 +01001013 RSL_IE_RachLoad rach_load,
Harald Welte643e2a62017-11-27 15:03:18 +01001014 uint8_t meas_res_nr,
Harald Welte2691adf2018-02-22 17:32:39 +01001015 uint8_t ms_timing_offset,
1016 RSL_IE_UplinkMeas uplink_meas,
Harald Welte643e2a62017-11-27 15:03:18 +01001017 RSL_IE_L1Info l1_info,
1018 RSL_IE_SysinfoType sysinfo_type,
1019 uint16_t paging_load,
1020 uint8_t paging_group,
1021 RSL_IE_ChanNeeded chan_needed,
Harald Weltecc373202018-09-10 10:28:21 +02001022 RSL_IE_CbCommandType cb_cmd_type,
1023 RSL_LV smscb_message,
Harald Welte4a129f82019-05-21 16:35:22 +02001024 RSL_IE_CbchLoadInfo cbch_load_info,
Vadim Yanitskiy9f699532021-06-03 17:29:22 +02001025 RSL_IE_ResourceInfo resource_info,
Harald Weltec8d363c2019-05-19 20:36:48 +02001026 RSL_SacchInfo sacch_info,
Harald Weltecc373202018-09-10 10:28:21 +02001027
Harald Welte643e2a62017-11-27 15:03:18 +01001028 RSL_IE_StartingTime starting_time,
Harald Welte73cd2712017-12-17 00:44:52 +01001029 RSL_IE_EncryptionInfo encr_info,
Harald Weltea3ff6702019-05-20 20:03:50 +02001030 uint8_t smscb_chan_ind,
Harald Welte643e2a62017-11-27 15:03:18 +01001031 RSL_IE_RequestRef req_ref,
1032 RSL_LV full_imm_ass_info,
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +07001033 MobileIdentityLV ms_identity,
Harald Welte643e2a62017-11-27 15:03:18 +01001034
Harald Welte9958a4d2017-12-14 21:21:33 +01001035 uint16_t ipa_conn_id,
1036 uint16_t ipa_local_port,
1037 uint16_t ipa_remote_port,
Vadim Yanitskiyfc631642021-07-03 02:42:45 +02001038 OCT4 ipa_local_ip,
1039 OCT4 ipa_remote_ip,
Harald Welte9958a4d2017-12-14 21:21:33 +01001040 uint8_t ipa_rtp_pt,
1041 uint8_t ipa_rtp_pt2,
1042 RSL_IE_IPA_ConnectionStats ipa_stats,
1043 RSL_IE_IPA_SpeechMode ipa_speech_mode,
1044
Neels Hofmeyr2bef0dd2021-04-22 21:46:00 +00001045 RSL_IE_OSMO_TrainingSequence osmo_training_sequence,
Vadim Yanitskiy1f532152021-11-01 20:37:56 +03001046 RSL_IE_OSMO_RepAcchCap rep_acch_cap,
Vadim Yanitskiya203d3b2021-11-01 21:32:31 +03001047 RSL_IE_OSMO_TopAcchCap top_acch_cap,
Pau Espin Pedrol29c6dfb2022-08-08 18:37:56 +02001048 RSL_IE_OSMO_Osmux_CID osmux_cid,
Neels Hofmeyr2bef0dd2021-04-22 21:46:00 +00001049
Harald Welte643e2a62017-11-27 15:03:18 +01001050 RSL_LV other
1051 }
1052
1053 type record RSL_IE {
1054 RSL_IE_Type iei,
1055 RSL_IE_Body body
1056 } with { variant (body) "CROSSTAG(
1057 chan_nr, iei = RSL_IE_CHAN_NR;
1058 link_id, iei = RSL_IE_LINK_IDENT;
1059 l3_info, iei = RSL_IE_L3_INFO;
1060 rlm_cause, iei = RSL_IE_RLM_CAUSE;
1061 release_mode, iei = RSL_IE_RELEASE_MODE;
1062 act_type, iei = RSL_IE_ACT_TYPE;
Vadim Yanitskiye02dbcc2020-08-25 04:20:51 +07001063 chan_ident, iei = RSL_IE_CHAN_IDENT;
Harald Welte643e2a62017-11-27 15:03:18 +01001064 chan_mode, iei = RSL_IE_CHAN_MODE;
1065 handover_ref, iei = RSL_IE_HANDO_REF;
1066 bs_power, iei = RSL_IE_BS_POWER;
Vadim Yanitskiy802508e2020-11-11 07:25:47 +07001067 bs_power_params, iei = RSL_IE_BS_POWER_PARAM;
Harald Welte643e2a62017-11-27 15:03:18 +01001068 ms_power, iei = RSL_IE_MS_POWER;
Eric Wild61edb7e2019-06-03 12:38:31 +02001069 ms_power_params, iei = RSL_IE_MS_POWER_PARAM;
Harald Welte643e2a62017-11-27 15:03:18 +01001070 timing_adv, iei = RSL_IE_TIMING_ADVANCE;
Pau Espin Pedrolf7634dc2022-09-02 17:56:00 +02001071 multirate_cfg, iei = RSL_IE_MR_CONFIG;
Harald Welte643e2a62017-11-27 15:03:18 +01001072 multirate_ctrl, iei = RSL_IE_MR_CONTROL;
Harald Weltea6706152019-05-19 20:38:18 +02001073 msg_id, iei = RSL_IE_MSG_ID;
Harald Welte643e2a62017-11-27 15:03:18 +01001074
1075 frame_nr, iei = RSL_IE_FRAME_NUMBER;
1076 cause, iei = RSL_IE_CAUSE;
1077 access_delay, iei = RSL_IE_ACCESS_DELAY;
Harald Welted5f521e2017-12-07 17:53:06 +01001078 rach_load, iei = RSL_IE_RACH_LOAD;
Harald Welte643e2a62017-11-27 15:03:18 +01001079 meas_res_nr, iei = RSL_IE_MEAS_RES_NR;
Harald Welte2691adf2018-02-22 17:32:39 +01001080 ms_timing_offset, iei = RSL_IE_MS_TIMING_OFFSET;
1081 uplink_meas, iei = RSL_IE_UPLINK_MEAS;
Harald Welte643e2a62017-11-27 15:03:18 +01001082 l1_info, iei = RSL_IE_L1_INFO;
1083 sysinfo_type, iei = RSL_IE_SYSINFO_TYPE;
1084 paging_load, iei = RSL_IE_PAGING_LOAD;
1085 paging_group, iei = RSL_IE_PAGING_GROUP;
1086 chan_needed, iei = RSL_IE_CHAN_NEEDED;
Harald Weltecc373202018-09-10 10:28:21 +02001087 cb_cmd_type, iei = RSL_IE_CB_CMD_TYPE;
1088 smscb_message, iei = RSL_IE_SMSCB_MSG;
Harald Welte4a129f82019-05-21 16:35:22 +02001089 cbch_load_info, iei = RSL_IE_CBCH_LOAD_INFO;
Vadim Yanitskiy9f699532021-06-03 17:29:22 +02001090 resource_info, iei = RSL_IE_RESOURCE_INFO;
Harald Weltec8d363c2019-05-19 20:36:48 +02001091 sacch_info, iei = RSL_IE_SACCH_INFO;
Harald Welte643e2a62017-11-27 15:03:18 +01001092 starting_time, iei = RSL_IE_STARTNG_TIME;
Harald Welte73cd2712017-12-17 00:44:52 +01001093 encr_info, iei = RSL_IE_ENCR_INFO;
Harald Weltea3ff6702019-05-20 20:03:50 +02001094 smscb_chan_ind, iei = RSL_IE_SMSCB_CHAN_INDICATOR;
Harald Welte643e2a62017-11-27 15:03:18 +01001095
1096 req_ref, iei = RSL_IE_REQ_REFERENCE;
Harald Weltefff69302017-12-07 17:53:42 +01001097 full_imm_ass_info, iei = RSL_IE_FULL_IMM_ASS_INFO;
1098 ms_identity, iei = RSL_IE_MS_IDENTITY;
1099 other, iei = RSL_IE_FULL_BCCH_INFO;
Harald Welte643e2a62017-11-27 15:03:18 +01001100
Harald Welte9958a4d2017-12-14 21:21:33 +01001101 ipa_conn_id, iei = RSL_IE_IPAC_CONN_ID;
1102 ipa_remote_ip, iei = RSL_IE_IPAC_REMOTE_IP;
1103 ipa_remote_port, iei = RSL_IE_IPAC_REMOTE_PORT;
1104 ipa_local_ip, iei = RSL_IE_IPAC_LOCAL_IP;
1105 ipa_local_port, iei = RSL_IE_IPAC_LOCAL_PORT;
1106 ipa_rtp_pt, iei = RSL_IE_IPAC_RTP_PAYLOAD;
1107 ipa_rtp_pt2, iei = RSL_IE_IPAC_RTP_PAYLOAD2;
1108 ipa_stats, iei = RSL_IE_IPAC_CONN_STAT;
1109 ipa_speech_mode, iei = RSL_IE_IPAC_SPEECH_MODE;
1110
Neels Hofmeyr2bef0dd2021-04-22 21:46:00 +00001111 osmo_training_sequence, iei = RSL_IE_OSMO_TRAINING_SEQUENCE;
Vadim Yanitskiy1f532152021-11-01 20:37:56 +03001112 rep_acch_cap, iei = RSL_IE_OSMO_REP_ACCH_CAP;
Vadim Yanitskiya203d3b2021-11-01 21:32:31 +03001113 top_acch_cap, iei = RSL_IE_OSMO_TOP_ACCH_CAP;
Pau Espin Pedrol29c6dfb2022-08-08 18:37:56 +02001114 osmux_cid, iei = RSL_IE_OSMO_OSMUX_CID;
Neels Hofmeyr2bef0dd2021-04-22 21:46:00 +00001115
Harald Welte643e2a62017-11-27 15:03:18 +01001116 other, OTHERWISE;
1117 )" };
1118
Harald Welte735dd072017-12-12 14:55:17 +01001119 /* For some reason the TTCN-3 RAW codec cannot automatically figure out the IEI
1120 * that it needs to set for a given union-choice (body). So we have to explicitly
1121 * specify the IEI by the caller :( */
Harald Welteefa7d912018-04-18 23:22:15 +02001122 template (value) RSL_IE t_RSL_IE(RSL_IE_Type iei, template (value) RSL_IE_Body body) := {
Harald Welte735dd072017-12-12 14:55:17 +01001123 iei := iei,
Harald Welte643e2a62017-11-27 15:03:18 +01001124 body := body
1125 }
1126
Harald Weltec2877752017-12-07 17:54:35 +01001127 template RSL_IE tr_RSL_IE(template RSL_IE_Body body) := {
1128 iei := ?, /* overwritten? */
1129 body := body
1130 }
1131
1132
Harald Welte643e2a62017-11-27 15:03:18 +01001133 type record of RSL_IE RSL_IE_List;
1134
1135 type record RSL_Message {
1136 RSL_MessageDiscriminator msg_disc,
1137 RSL_MessageType msg_type,
1138 RSL_IE_List ies optional
1139 }
1140
1141 external function enc_RSL_Message(in RSL_Message msg) return octetstring
1142 with { extension "prototype(convert) encode(RAW)" };
1143 external function dec_RSL_Message(in octetstring stream) return RSL_Message
1144 with { extension "prototype(convert) decode(RAW)" };
1145
Harald Weltebc330be2017-12-09 00:56:36 +01001146 template RSL_Message tr_RSL_MsgDiscType(template RSL_MessageDiscriminator m_disc,
Harald Welte643e2a62017-11-27 15:03:18 +01001147 RSL_MessageType m_type) := {
1148 msg_disc := m_disc,
1149 msg_type := m_type,
1150 ies := *
1151 }
1152
Harald Welteefa7d912018-04-18 23:22:15 +02001153 template (value) RSL_Message ts_RSL_MsgDiscType(template (value) RSL_MessageDiscriminator m_disc,
1154 template (value) RSL_MessageType msg_type,
1155 template (omit) RSL_IE_List ies := omit) := {
Harald Welte4a267362017-12-09 17:49:32 +01001156 msg_disc := m_disc,
1157 msg_type := msg_type,
1158 ies := ies
1159 }
1160
Harald Weltebc330be2017-12-09 00:56:36 +01001161template RSL_Message tr_RSL_MsgType(template RSL_MessageType msg_type) := {
1162 msg_disc := ?,
1163 msg_type := msg_type,
1164 ies := *
1165}
1166
1167/* Common Channel Management */
1168template RSL_Message tr_RSL_MsgTypeC(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
1169 msg_disc := { RSL_MDISC_CCHAN, ? }
1170}
1171
1172/* RLL */
1173template RSL_Message tr_RSL_MsgTypeR(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
1174 msg_disc := { RSL_MDISC_RLL, true }
1175}
1176
1177/* Dedicated Channel Management */
1178template RSL_Message tr_RSL_MsgTypeD(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
1179 msg_disc := { RSL_MDISC_DCHAN, ? }
1180}
1181
Vadim Yanitskiybf2aa492022-06-01 00:28:38 +06001182/* TRX Management */
Harald Weltebc330be2017-12-09 00:56:36 +01001183template RSL_Message tr_RSL_MsgTypeT(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
1184 msg_disc := { RSL_MDISC_TRX_MGMT, ? }
1185}
1186
1187
1188/* dedicated channel or RLL */
1189template RSL_Message tr_RSL_MsgTypeDR(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
Harald Weltee5408222018-01-29 21:57:58 +01001190 msg_disc := ({RSL_MDISC_DCHAN,?}, {RSL_MDISC_RLL,?}, {RSL_MDISC_IPACCESS,false})
Harald Weltebc330be2017-12-09 00:56:36 +01001191}
1192
1193
Harald Welte643e2a62017-11-27 15:03:18 +01001194 /* 8.3.1 BSC -> BTS */
Harald Welteefa7d912018-04-18 23:22:15 +02001195 template (value) RSL_Message ts_RSL_DATA_REQ(template (value) RslChannelNr chan_nr,
1196 template (value) RslLinkId link_id,
1197 octetstring l3_info) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001198 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, true),
1199 msg_type := RSL_MT_DATA_REQ,
1200 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001201 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1202 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
1203 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
Harald Welte643e2a62017-11-27 15:03:18 +01001204 }
1205 }
1206
Harald Welte7794d5b2017-12-16 23:00:20 +01001207 template RSL_Message tr_RSL_DATA_REQ(template RslChannelNr chan_nr :=?,
1208 template RslLinkId link_id := ?,
1209 template octetstring l3_info := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001210 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, true),
Harald Welte7794d5b2017-12-16 23:00:20 +01001211 msg_type := RSL_MT_DATA_REQ,
1212 ies :={
1213 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1214 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
1215 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
1216 }
1217 }
1218
1219
Harald Welte643e2a62017-11-27 15:03:18 +01001220 /* 8.3.2 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001221 template (value) RSL_Message ts_RSL_DATA_IND(template (value) RslChannelNr chan_nr,
1222 template (value) RslLinkId link_id,
1223 octetstring l3_info) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001224 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, true),
1225 msg_type := RSL_MT_DATA_IND,
1226 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001227 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1228 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
1229 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
Harald Welte643e2a62017-11-27 15:03:18 +01001230 }
1231 }
Harald Welte9abd1282018-02-19 19:18:17 +01001232 template RSL_Message tr_RSL_DATA_IND(template RslChannelNr chan_nr, template RslLinkId link_id,
1233 template octetstring l3_info := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001234 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, true),
Harald Welte9abd1282018-02-19 19:18:17 +01001235 msg_type := RSL_MT_DATA_IND,
1236 ies :={
1237 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1238 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
1239 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
1240 }
1241 }
Harald Welte643e2a62017-11-27 15:03:18 +01001242
1243 /* 8.3.3 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001244 template (value) RSL_Message ts_RSL_ERROR_IND(template (value) RslChannelNr chan_nr,
Harald Weltea7d81f12019-06-02 22:33:19 +02001245 template (value) RslLinkId link_id,
1246 template (value) octetstring rlm_cause) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001247 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1248 msg_type := RSL_MT_ERROR_IND,
1249 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001250 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1251 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
Harald Weltea7d81f12019-06-02 22:33:19 +02001252 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{rlm_cause := ts_RSL_LV(rlm_cause)})
Harald Welte643e2a62017-11-27 15:03:18 +01001253 }
1254 }
Harald Welte9abd1282018-02-19 19:18:17 +01001255 template RSL_Message tr_RSL_ERROR_IND(template RslChannelNr chan_nr, template RslLinkId link_id,
Harald Weltea7d81f12019-06-02 22:33:19 +02001256 template octetstring rlm_cause := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001257 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001258 msg_type := RSL_MT_ERROR_IND,
1259 ies :={
1260 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1261 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
Harald Weltea7d81f12019-06-02 22:33:19 +02001262 tr_RSL_IE(RSL_IE_Body:{rlm_cause := tr_RSL_LV(rlm_cause)})
Harald Welte9abd1282018-02-19 19:18:17 +01001263 }
1264 }
Harald Welte643e2a62017-11-27 15:03:18 +01001265
Harald Welteefa7d912018-04-18 23:22:15 +02001266 /* 8.3.4 BTS <- BSC */
1267 template (value) RSL_Message ts_RSL_EST_REQ(template (value) RslChannelNr chan_nr,
1268 template (value) RslLinkId link_id) := {
1269 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1270 msg_type := RSL_MT_EST_REQ,
1271 ies := {
1272 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1273 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
1274 }
1275 }
1276 template RSL_Message tr_RSL_EST_REQ(template RslChannelNr chan_nr, template RslLinkId link_id) := {
1277 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
1278 msg_type := RSL_MT_EST_REQ,
1279 ies := {
1280 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1281 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1282 }
1283 }
1284
1285 /* 8.3.5 BTS -> BSC */
1286 template (value) RSL_Message ts_RSL_EST_CONF(template (value) RslChannelNr chan_nr,
1287 template (value) RslLinkId link_id) := {
1288 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1289 msg_type := RSL_MT_EST_CONF,
1290 ies := {
1291 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1292 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
1293 }
1294 }
1295 template RSL_Message tr_RSL_EST_CONF(template RslChannelNr chan_nr, template RslLinkId link_id) := {
1296 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
1297 msg_type := RSL_MT_EST_CONF,
1298 ies := {
1299 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1300 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1301 }
1302 }
1303
Harald Welte643e2a62017-11-27 15:03:18 +01001304 /* 8.3.6 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001305 template (value) RSL_Message ts_RSL_EST_IND(template (value) RslChannelNr chan_nr,
1306 template (value) RslLinkId link_id,
1307 octetstring l3_info) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001308 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1309 msg_type := RSL_MT_EST_IND,
1310 ies := {
Harald Welte735dd072017-12-12 14:55:17 +01001311 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1312 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
1313 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
Harald Welte643e2a62017-11-27 15:03:18 +01001314 }
1315 }
Harald Welte9abd1282018-02-19 19:18:17 +01001316 template RSL_Message tr_RSL_EST_IND(template RslChannelNr chan_nr, template RslLinkId link_id,
1317 template octetstring l3_info := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001318 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001319 msg_type := RSL_MT_EST_IND,
1320 ies := {
1321 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1322 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
1323 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
1324 }
1325 }
Harald Welte0472ab42018-03-12 15:02:26 +01001326 template RSL_Message tr_RSL_EST_IND_NOL3(template RslChannelNr chan_nr, template RslLinkId link_id) :=
1327{
1328 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
1329 msg_type := RSL_MT_EST_IND,
1330 ies := {
1331 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1332 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1333 }
1334 }
1335
Harald Welte643e2a62017-11-27 15:03:18 +01001336
1337 /* 8.3.7 BSC -> BTS */
Harald Welteefa7d912018-04-18 23:22:15 +02001338 template (value) RSL_Message ts_RSL_REL_REQ(template (value) RslChannelNr chan_nr,
Harald Welte0472ab42018-03-12 15:02:26 +01001339 template (value) RslLinkId link_id,
1340 template (value) RSL_IE_ReleaseMode rel_mode := RSL_REL_MODE_NORMAL) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001341 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1342 msg_type := RSL_MT_REL_REQ,
1343 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001344 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
Harald Welte0472ab42018-03-12 15:02:26 +01001345 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
1346 t_RSL_IE(RSL_IE_RELEASE_MODE, RSL_IE_Body:{release_mode := rel_mode})
Harald Welte643e2a62017-11-27 15:03:18 +01001347 }
1348 }
Harald Weltee8a5ab12017-12-09 22:34:57 +01001349 template RSL_Message tr_RSL_REL_REQ(template RslChannelNr chan_nr,
Harald Welte0472ab42018-03-12 15:02:26 +01001350 template RslLinkId link_id,
1351 template RSL_IE_ReleaseMode rel_mode := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001352 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Weltee8a5ab12017-12-09 22:34:57 +01001353 msg_type := RSL_MT_REL_REQ,
1354 ies :={
1355 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1356 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
Harald Welte0472ab42018-03-12 15:02:26 +01001357 tr_RSL_IE(RSL_IE_Body:{release_mode := rel_mode})
Harald Weltee8a5ab12017-12-09 22:34:57 +01001358 }
1359 }
Harald Welte643e2a62017-11-27 15:03:18 +01001360
1361 /* 8.3.8 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001362 template (value) RSL_Message ts_RSL_REL_CONF(template (value) RslChannelNr chan_nr,
1363 template (value) RslLinkId link_id) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001364 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1365 msg_type := RSL_MT_REL_CONF,
1366 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001367 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1368 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
Harald Welte643e2a62017-11-27 15:03:18 +01001369 }
1370 }
Harald Welte9abd1282018-02-19 19:18:17 +01001371 template RSL_Message tr_RSL_REL_CONF(template RslChannelNr chan_nr, template RslLinkId link_id) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001372 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001373 msg_type := RSL_MT_REL_CONF,
1374 ies :={
1375 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1376 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1377 }
1378 }
Harald Welte643e2a62017-11-27 15:03:18 +01001379
1380 /* 8.3.9 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001381 template (value) RSL_Message ts_RSL_REL_IND(template (value) RslChannelNr chan_nr,
1382 template (value) RslLinkId link_id) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001383 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1384 msg_type := RSL_MT_REL_IND,
1385 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001386 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1387 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
Harald Welte643e2a62017-11-27 15:03:18 +01001388 }
1389 }
Harald Welte9abd1282018-02-19 19:18:17 +01001390 template RSL_Message tr_RSL_REL_IND(template RslChannelNr chan_nr, template RslLinkId link_id) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001391 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001392 msg_type := RSL_MT_REL_IND,
1393 ies :={
1394 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1395 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1396 }
1397 }
Harald Welte643e2a62017-11-27 15:03:18 +01001398
1399 /* 8.3.10 BSC -> BTS */
Harald Welteefa7d912018-04-18 23:22:15 +02001400 template (value) RSL_Message ts_RSL_UNITDATA_REQ(template (value) RslChannelNr chan_nr,
1401 template (value) RslLinkId link_id,
1402 octetstring l3_info)
Harald Welte643e2a62017-11-27 15:03:18 +01001403 modifies ts_RSL_DATA_REQ := {
1404 msg_type := RSL_MT_UNIT_DATA_REQ
1405 }
Harald Welte0472ab42018-03-12 15:02:26 +01001406 template RSL_Message tr_RSL_UNITDATA_REQ(template RslChannelNr chan_nr,
1407 template RslLinkId link_id,
Vadim Yanitskiy8f98d3f2018-10-03 17:58:10 +07001408 template octetstring l3_info := ?)
Harald Welte0472ab42018-03-12 15:02:26 +01001409 modifies tr_RSL_DATA_REQ := {
1410 msg_type := RSL_MT_UNIT_DATA_REQ
1411 }
1412
Harald Welte643e2a62017-11-27 15:03:18 +01001413
1414 /* 8.3.11 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001415 template (value) RSL_Message ts_RSL_UNITDATA_IND(template (value) RslChannelNr chan_nr,
1416 template (value) RslLinkId link_id,
1417 octetstring l3_info)
Harald Welte643e2a62017-11-27 15:03:18 +01001418 modifies ts_RSL_DATA_IND := {
1419 msg_type := RSL_MT_UNIT_DATA_IND
1420 }
Harald Welte0472ab42018-03-12 15:02:26 +01001421 template RSL_Message tr_RSL_UNITDATA_IND(template RslChannelNr chan_nr,
Vadim Yanitskiyfabe0f22018-10-03 17:51:47 +07001422 template RslLinkId link_id,
Vadim Yanitskiy8f98d3f2018-10-03 17:58:10 +07001423 template octetstring l3_info := ?)
Harald Welte0472ab42018-03-12 15:02:26 +01001424 modifies tr_RSL_DATA_IND := {
1425 msg_type := RSL_MT_UNIT_DATA_IND
1426 }
1427
1428
Harald Welte643e2a62017-11-27 15:03:18 +01001429
1430
1431 /* DEDICATED CANNEL MANAGEMENT MESSAGES */
1432
1433 /* 8.4.1 BSC -> BTS */
Harald Welteefa7d912018-04-18 23:22:15 +02001434 template (value) RSL_Message ts_RSL_CHAN_ACT(template (value) RslChannelNr chan_nr,
Harald Welte921f9e02019-05-19 22:27:11 +02001435 template (value) RSL_IE_ChannelMode mode,
1436 template (value) RSL_IE_ActivationType at := t_RSL_IE_ActType_IA) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001437 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1438 msg_type := RSL_MT_CHAN_ACTIV,
1439 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001440 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
Harald Welte921f9e02019-05-19 22:27:11 +02001441 t_RSL_IE(RSL_IE_ACT_TYPE, RSL_IE_Body:{act_type := at}),
Harald Welte735dd072017-12-12 14:55:17 +01001442 t_RSL_IE(RSL_IE_CHAN_MODE, RSL_IE_Body:{chan_mode := mode})
Harald Welte643e2a62017-11-27 15:03:18 +01001443 /* lots of optional IEs */
1444 }
1445 }
Harald Welte94e0c342018-04-07 11:33:23 +02001446 template RSL_Message tr_RSL_CHAN_ACT(template RslChannelNr chan_nr,
Harald Welte921f9e02019-05-19 22:27:11 +02001447 template RSL_IE_ChannelMode mode,
1448 template (value) RSL_IE_ActivationType at := t_RSL_IE_ActType_IA) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001449 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte94e0c342018-04-07 11:33:23 +02001450 msg_type := RSL_MT_CHAN_ACTIV,
1451 ies :={
1452 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
Harald Welte921f9e02019-05-19 22:27:11 +02001453 tr_RSL_IE(RSL_IE_Body:{act_type := at}),
Harald Welte94e0c342018-04-07 11:33:23 +02001454 tr_RSL_IE(RSL_IE_Body:{chan_mode := mode}),
1455 /* lots of optional IEs */
1456 *
1457 }
1458 }
Vadim Yanitskiy58b16532021-10-09 20:27:39 +06001459
1460 template (value) RSL_Message
1461 ts_RSL_CHAN_ACT_PDCH(template (value) RslChannelNr chan_nr) := {
1462 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1463 msg_type := RSL_MT_CHAN_ACTIV,
1464 ies :={
1465 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1466 t_RSL_IE(RSL_IE_ACT_TYPE, RSL_IE_Body:{act_type := c_RSL_IE_ActType_PDCH})
1467 }
1468 }
1469 template RSL_Message
1470 tr_RSL_CHAN_ACT_PDCH(template (present) RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001471 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte94e0c342018-04-07 11:33:23 +02001472 msg_type := RSL_MT_CHAN_ACTIV,
1473 ies :={
1474 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
Vadim Yanitskiy58b16532021-10-09 20:27:39 +06001475 tr_RSL_IE(RSL_IE_Body:{act_type := c_RSL_IE_ActType_PDCH}),
Harald Welte94e0c342018-04-07 11:33:23 +02001476 /* lots of optional IEs */
1477 *
1478 }
1479 }
1480
Harald Welte643e2a62017-11-27 15:03:18 +01001481
1482 /* 8.4.2 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001483 template (value) RSL_Message ts_RSL_CHAN_ACT_ACK(template (value) RslChannelNr chan_nr,
1484 GsmFrameNumber fn) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001485 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1486 msg_type := RSL_MT_CHAN_ACTIV_ACK,
1487 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001488 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1489 t_RSL_IE(RSL_IE_FRAME_NUMBER, RSL_IE_Body:{frame_nr := ts_RSL_IE_FrameNumber(fn)})
Harald Welte643e2a62017-11-27 15:03:18 +01001490 }
1491 }
Harald Welte9abd1282018-02-19 19:18:17 +01001492 template RSL_Message tr_RSL_CHAN_ACT_ACK(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001493 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001494 msg_type := RSL_MT_CHAN_ACTIV_ACK,
1495 ies := {
1496 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1497 tr_RSL_IE(RSL_IE_Body:{frame_nr := ?})
1498 }
1499 }
Harald Welte643e2a62017-11-27 15:03:18 +01001500
1501 /* 8.4.3 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001502 template (value) RSL_Message ts_RSL_CHAN_ACT_NACK(template (value) RslChannelNr chan_nr,
1503 RSL_Cause cause) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001504 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1505 msg_type := RSL_MT_CHAN_ACTIV_NACK,
1506 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001507 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1508 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
Harald Welte643e2a62017-11-27 15:03:18 +01001509 }
1510 }
Harald Welte9abd1282018-02-19 19:18:17 +01001511 template RSL_Message tr_RSL_CHAN_ACT_NACK(template RslChannelNr chan_nr,
1512 template RSL_Cause cause := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001513 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001514 msg_type := RSL_MT_CHAN_ACTIV_NACK,
1515 ies := {
1516 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1517 tr_RSL_IE(RSL_IE_Body:{cause := ?})
1518 }
1519 }
Harald Welte643e2a62017-11-27 15:03:18 +01001520
1521 /* 8.4.4 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001522 template (value) RSL_Message ts_RSL_CONN_FAIL_IND(RslChannelNr chan_nr, RSL_Cause cause) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001523 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1524 msg_type := RSL_MT_CONN_FAIL,
1525 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001526 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1527 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
Harald Welte643e2a62017-11-27 15:03:18 +01001528 }
1529 }
Harald Welte9abd1282018-02-19 19:18:17 +01001530 template RSL_Message tr_RSL_CONN_FAIL_IND(template RslChannelNr chan_nr,
1531 template RSL_Cause cause := ?) := {
1532 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1533 msg_type := RSL_MT_CONN_FAIL,
1534 ies :={
1535 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1536 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
1537 }
1538 }
Harald Welte643e2a62017-11-27 15:03:18 +01001539
Harald Weltee8a5ab12017-12-09 22:34:57 +01001540 /* 8.4.5 BSC -> BTS */
1541 template RSL_Message tr_RSL_DEACT_SACCH(template RslChannelNr chan_nr) := {
1542 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1543 msg_type := RSL_MT_DEACTIVATE_SACCH,
1544 ies := {
1545 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
1546 }
1547 }
Harald Welteefa7d912018-04-18 23:22:15 +02001548 template (value) RSL_Message ts_RSL_DEACT_SACCH(template (value) RslChannelNr chan_nr) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001549 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1550 msg_type := RSL_MT_DEACTIVATE_SACCH,
1551 ies := {
1552 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1553 }
1554 }
1555
Harald Weltee8a5ab12017-12-09 22:34:57 +01001556
Harald Welte73cd2712017-12-17 00:44:52 +01001557 /* 8.4.6 BSC ->BTS */
1558 template RSL_Message tr_RSL_ENCR_CMD(template RslChannelNr chan_nr,
1559 template RslLinkId link_id := ?,
Harald Weltee613f962018-04-18 22:38:16 +02001560 template RSL_AlgId alg := ?,
Harald Welte73cd2712017-12-17 00:44:52 +01001561 template octetstring key := ?,
1562 template octetstring l3_info := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001563 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte73cd2712017-12-17 00:44:52 +01001564 msg_type := RSL_MT_ENCR_CMD,
1565 ies := {
1566 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1567 tr_RSL_IE(RSL_IE_Body:{encr_info := tr_RSL_IE_EncrInfo(alg, key)}),
1568 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
1569 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
1570 }
1571 }
Harald Welteefa7d912018-04-18 23:22:15 +02001572 template (value) RSL_Message ts_RSL_ENCR_CMD(template (value) RslChannelNr chan_nr,
1573 template (value) RslLinkId link_id,
Harald Weltee613f962018-04-18 22:38:16 +02001574 template (value) RSL_AlgId alg, octetstring key,
Harald Welteefa7d912018-04-18 23:22:15 +02001575 octetstring l3_info) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001576 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1577 msg_type := RSL_MT_ENCR_CMD,
1578 ies := {
1579 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
Harald Welteefa7d912018-04-18 23:22:15 +02001580 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 +01001581 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
Harald Welteefa7d912018-04-18 23:22:15 +02001582 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
Harald Welte9abd1282018-02-19 19:18:17 +01001583 }
1584 }
Harald Welte73cd2712017-12-17 00:44:52 +01001585
Harald Welte2691adf2018-02-22 17:32:39 +01001586 template RSL_Message tr_RSL_MEAS_RES(template RslChannelNr chan_nr,
1587 template uint8_t meas_res_nr := ?,
1588 template RSL_IE_UplinkMeas ul_meas := ?,
1589 template RSL_IE_BS_Power bs_power := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001590 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte2691adf2018-02-22 17:32:39 +01001591 msg_type := RSL_MT_MEAS_RES,
1592 ies := {
1593 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1594 tr_RSL_IE(RSL_IE_Body:{meas_res_nr := meas_res_nr}),
1595 tr_RSL_IE(RSL_IE_Body:{uplink_meas := ul_meas}),
1596 tr_RSL_IE(RSL_IE_Body:{bs_power := bs_power}),
1597 *
1598 }
1599 }
1600
Vadim Yanitskiy7c29c4e2022-06-18 03:07:50 +07001601 /* Templates for a measurement report that lacks the measurement report
Philipp Maierdd841d32019-12-17 14:44:54 +01001602 * from the MS (l1_info, l3_info and ms timing offset */
Vadim Yanitskiy7c29c4e2022-06-18 03:07:50 +07001603 template (value) RSL_Message
1604 ts_RSL_MEAS_RES_EMPTY(template (value) RslChannelNr chan_nr,
1605 template (value) uint8_t meas_res_nr,
1606 template (value) RSL_IE_UplinkMeas ul_meas,
1607 template (value) RSL_IE_BS_Power bs_power) := {
1608 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1609 msg_type := RSL_MT_MEAS_RES,
1610 ies := {
1611 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1612 t_RSL_IE(RSL_IE_MEAS_RES_NR, RSL_IE_Body:{meas_res_nr := meas_res_nr}),
1613 t_RSL_IE(RSL_IE_UPLINK_MEAS, RSL_IE_Body:{uplink_meas := ul_meas}),
1614 t_RSL_IE(RSL_IE_BS_POWER, RSL_IE_Body:{bs_power := bs_power})
1615 }
1616 }
1617 template RSL_Message
1618 tr_RSL_MEAS_RES_EMPTY(template (present) RslChannelNr chan_nr,
1619 template uint8_t meas_res_nr := ?,
1620 template RSL_IE_UplinkMeas ul_meas := ?,
1621 template RSL_IE_BS_Power bs_power := ?) := {
Philipp Maierdd841d32019-12-17 14:44:54 +01001622 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1623 msg_type := RSL_MT_MEAS_RES,
1624 ies := {
1625 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1626 tr_RSL_IE(RSL_IE_Body:{meas_res_nr := meas_res_nr}),
1627 tr_RSL_IE(RSL_IE_Body:{uplink_meas := ul_meas}),
1628 tr_RSL_IE(RSL_IE_Body:{bs_power := bs_power})
1629 }
1630 }
1631
Harald Welte39b47be2018-02-23 18:58:48 +01001632 /* Osmocom specific template, require lots of optional fields to be present */
1633 template RSL_Message tr_RSL_MEAS_RES_OSMO(template RslChannelNr chan_nr,
1634 template uint8_t meas_res_nr := ?,
1635 template RSL_IE_UplinkMeas ul_meas := ?,
1636 template RSL_IE_BS_Power bs_power := ?,
1637 template RSL_IE_L1Info l1_info := ?,
1638 template octetstring l3_info := ?,
1639 template uint8_t ms_to := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001640 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte39b47be2018-02-23 18:58:48 +01001641 msg_type := RSL_MT_MEAS_RES,
1642 ies := {
1643 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1644 tr_RSL_IE(RSL_IE_Body:{meas_res_nr := meas_res_nr}),
1645 tr_RSL_IE(RSL_IE_Body:{uplink_meas := ul_meas}),
1646 tr_RSL_IE(RSL_IE_Body:{bs_power := bs_power}),
1647 tr_RSL_IE(RSL_IE_Body:{l1_info := l1_info}),
1648 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)}),
1649 tr_RSL_IE(RSL_IE_Body:{ms_timing_offset := ms_to})
1650 }
1651 }
1652
Neels Hofmeyrafe2ea52021-11-24 15:16:12 +01001653 template (value) RSL_Message ts_RSL_MEAS_RES(template (value) RslChannelNr chan_nr,
1654 uint8_t meas_res_nr,
1655 template (value) RSL_IE_UplinkMeas ul_meas,
1656 template (value) RSL_IE_BS_Power bs_power,
1657 template (value) RSL_IE_L1Info l1_info,
1658 octetstring l3_info,
1659 uint8_t ms_to) := {
1660 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1661 msg_type := RSL_MT_MEAS_RES,
1662 ies := {
1663 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1664 t_RSL_IE(RSL_IE_MEAS_RES_NR, RSL_IE_Body:{meas_res_nr := meas_res_nr}),
1665 t_RSL_IE(RSL_IE_UPLINK_MEAS, RSL_IE_Body:{uplink_meas := ul_meas}),
1666 t_RSL_IE(RSL_IE_BS_POWER, RSL_IE_Body:{bs_power := bs_power}),
1667 t_RSL_IE(RSL_IE_L1_INFO, RSL_IE_Body:{l1_info := l1_info}),
1668 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)}),
1669 t_RSL_IE(RSL_IE_MS_TIMING_OFFSET, RSL_IE_Body:{ms_timing_offset := ms_to})
1670 }
1671 }
1672
Eric Wildf1827a72019-05-28 17:37:35 +02001673 /* 8.4.9 BSC -> BTS */
1674 template (value) RSL_Message ts_RSL_MODE_MODIFY_REQ(template (value) RslChannelNr chan_nr,
1675 template (value) RSL_IE_ChannelMode mode) := {
1676 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1677 msg_type := RSL_MT_MODE_MODIFY_REQ,
1678 ies :={
1679 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1680 t_RSL_IE(RSL_IE_CHAN_MODE, RSL_IE_Body:{chan_mode := mode})
1681 /* lots of optional IEs */
1682 }
1683 }
1684 template RSL_Message tr_RSL_MODE_MODIFY_REQ(template RslChannelNr chan_nr,
1685 template RSL_IE_ChannelMode mode) := {
1686 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1687 msg_type := RSL_MT_MODE_MODIFY_REQ,
1688 ies :={
1689 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1690 tr_RSL_IE(RSL_IE_Body:{chan_mode := mode}),
1691 /* lots of optional IEs */
1692 *
1693 }
1694 }
Neels Hofmeyr9f3e6ac2021-04-08 23:09:24 +02001695
1696 template RSL_Message tr_RSL_MODE_MODIFY_REQ_with_OSMO_TSC(template RslChannelNr chan_nr,
1697 template RSL_IE_ChannelMode mode,
1698 template uint8_t tsc_set := ?,
1699 template uint8_t tsc := ?) := {
1700 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1701 msg_type := RSL_MT_MODE_MODIFY_REQ,
1702 ies := {
1703 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1704 tr_RSL_IE(RSL_IE_Body:{chan_mode := mode}),
1705 tr_RSL_IE(RSL_IE_Body:{osmo_training_sequence := {
1706 len := ?,
1707 tsc_set := tsc_set,
1708 tsc := tsc
1709 }
1710 })
1711 }
1712 };
Pau Espin Pedrol85393122022-09-02 17:56:25 +02001713
Harald Welte7794d5b2017-12-16 23:00:20 +01001714 /* 8.4.10 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001715 template (value) RSL_Message ts_RSL_MODE_MODIFY_ACK(template (value) RslChannelNr chan_nr) := {
Harald Welte7794d5b2017-12-16 23:00:20 +01001716 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1717 msg_type := RSL_MT_MODE_MODIFY_ACK,
1718 ies := {
1719 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1720 }
1721 }
Harald Welte9abd1282018-02-19 19:18:17 +01001722 template RSL_Message tr_RSL_MODE_MODIFY_ACK(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001723 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001724 msg_type := RSL_MT_MODE_MODIFY_ACK,
1725 ies := {
1726 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
1727 }
1728 }
Harald Welte7794d5b2017-12-16 23:00:20 +01001729
Harald Welte643e2a62017-11-27 15:03:18 +01001730 /* 8.4.11 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001731 template (value) RSL_Message ts_RSL_MODE_MODIFY_NACK(template (value) RslChannelNr chan_nr,
1732 RSL_Cause cause) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001733 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1734 msg_type := RSL_MT_MODE_MODIFY_NACK,
1735 ies := {
1736 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1737 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
1738 }
Harald Welte643e2a62017-11-27 15:03:18 +01001739 }
Harald Welte9abd1282018-02-19 19:18:17 +01001740 template RSL_Message tr_RSL_MODE_MODIFY_NACK(template RslChannelNr chan_nr,
1741 template RSL_Cause cause) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001742 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001743 msg_type := RSL_MT_MODE_MODIFY_NACK,
1744 ies := {
1745 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1746 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
1747 }
1748 }
1749
Harald Welte643e2a62017-11-27 15:03:18 +01001750
Harald Welte6a8199d2018-01-29 21:58:53 +01001751 /* 8.4.14: BTS <- BSC */
1752 template RSL_Message tr_RSL_RF_CHAN_REL(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001753 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte6a8199d2018-01-29 21:58:53 +01001754 msg_type := RSL_MT_RF_CHAN_REL,
1755 ies := {
1756 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
1757 }
1758 }
Harald Welteefa7d912018-04-18 23:22:15 +02001759 template (value) RSL_Message ts_RSL_RF_CHAN_REL(template (value) RslChannelNr chan_nr) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001760 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1761 msg_type := RSL_MT_RF_CHAN_REL,
1762 ies := {
1763 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1764 }
1765 }
Harald Welte6a8199d2018-01-29 21:58:53 +01001766
Philipp Maier4d1e9c92018-12-20 11:11:56 +01001767 /* 8.4.15: BTS <- BSC */
1768 template (value) RSL_Message ts_RSL_MS_PWR_CTRL(template (value) RslChannelNr chan_nr,
1769 template (value) RSL_IE_MS_Power ms_power) := {
1770 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1771 msg_type := RSL_MT_MS_POWER_CONTROL,
1772 ies := {
1773 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1774 t_RSL_IE(RSL_IE_MS_POWER, RSL_IE_Body:{ms_power := ms_power})
1775 /* One optional IE: MS POWER PARAMETERS */
1776 }
1777 }
1778
Eric Wild61edb7e2019-06-03 12:38:31 +02001779 template (value) RSL_Message ts_RSL_MS_PWR_CTRL_with_pp(template (value) RslChannelNr chan_nr,
1780 integer pwr_level) := {
1781 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1782 msg_type := RSL_MT_MS_POWER_CONTROL,
1783 ies := {
1784 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1785 t_RSL_IE(RSL_IE_MS_POWER, RSL_IE_Body:{ms_power := ts_RSL_IE_MS_Power(pwr_level)}),
1786 t_RSL_IE(RSL_IE_MS_POWER_PARAM, RSL_IE_Body:{ms_power_params :=
1787 ts_RSL_IE_MS_Power_Parameters(''O)})
1788 }
1789 }
1790
Eric Wildae8f2622019-06-18 17:05:11 +02001791 /* 8.4.16: BTS <- BSC */
1792 template (value) RSL_Message ts_RSL_BS_PWR_CTRL(template (value) RslChannelNr chan_nr,
1793 template (value) RSL_IE_BS_Power bs_power) := {
1794 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1795 msg_type := RSL_MT_BS_POWER_CONTROL,
1796 ies := {
1797 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1798 t_RSL_IE(RSL_IE_BS_POWER, RSL_IE_Body:{bs_power := bs_power})
1799 /* One optional IE: BS POWER PARAMETERS */
1800 }
1801 }
Vadim Yanitskiy2a5a1ef2021-06-30 00:51:48 +02001802 template RSL_Message tr_RSL_BS_PWR_CTRL(template (present) RslChannelNr chan_nr,
1803 template (present) RSL_IE_BS_Power bs_power) := {
1804 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1805 msg_type := RSL_MT_BS_POWER_CONTROL,
1806 ies := {
1807 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1808 tr_RSL_IE(RSL_IE_Body:{bs_power := bs_power})
1809 /* One optional IE: BS POWER PARAMETERS */
1810 }
1811 }
Eric Wildae8f2622019-06-18 17:05:11 +02001812
Harald Welte4a267362017-12-09 17:49:32 +01001813 /* 8.4.19 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001814 template (value) RSL_Message ts_RSL_RF_CHAN_REL_ACK(template (value) RslChannelNr chan_nr) :=
Harald Welte4a267362017-12-09 17:49:32 +01001815 ts_RSL_MsgDiscType(ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1816 RSL_MT_RF_CHAN_REL_ACK,
Harald Welte735dd072017-12-12 14:55:17 +01001817 { t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}) });
Harald Welte4a267362017-12-09 17:49:32 +01001818
Harald Welte9abd1282018-02-19 19:18:17 +01001819 template RSL_Message tr_RSL_RF_CHAN_REL_ACK(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001820 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001821 msg_type := RSL_MT_RF_CHAN_REL_ACK,
1822 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001823 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
Harald Welte9abd1282018-02-19 19:18:17 +01001824 }
1825 }
1826
Harald Welteea17b912018-03-11 22:29:31 +01001827 /* 8.6.20 BTS <- BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001828 template (value) RSL_Message ts_RSL_SACCH_INF_MOD(template (value) RslChannelNr chan_nr,
1829 RSL_IE_SysinfoType si_type,
1830 octetstring l3_info) := {
Harald Welteea17b912018-03-11 22:29:31 +01001831 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1832 msg_type := RSL_MT_SACCH_INFO_MODIFY,
1833 ies := {
1834 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1835 t_RSL_IE(RSL_IE_SYSINFO_TYPE, RSL_IE_Body:{sysinfo_type := si_type}),
1836 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
1837 }
1838 }
1839
Neels Hofmeyr378a49c2018-06-15 22:18:43 +02001840 /* 8.4.7 BTS -> BSC */
1841 template (value) RSL_Message ts_RSL_HANDO_DET(template (value) RslChannelNr chan_nr) := {
1842 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1843 msg_type := RSL_MT_HANDO_DET,
1844 ies := {
1845 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1846 }
1847 }
Vadim Yanitskiy7c2c10c2019-05-31 20:42:01 +07001848 template RSL_Message tr_RSL_HANDO_DET(template RslChannelNr chan_nr,
1849 template uint8_t acc_delay := ?) := {
1850 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1851 msg_type := RSL_MT_HANDO_DET,
1852 ies := {
1853 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1854 tr_RSL_IE(RSL_IE_Body:{access_delay := acc_delay})
1855 }
1856 }
Neels Hofmeyr378a49c2018-06-15 22:18:43 +02001857
Harald Welteea17b912018-03-11 22:29:31 +01001858
Harald Welte643e2a62017-11-27 15:03:18 +01001859 /* COMMON CHANNEL MANAGEMENT MESSAGES */
1860
Harald Welte874c2232018-02-24 04:52:43 +01001861 /* 8.5.1 BTS <- BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001862 template (value) RSL_Message ts_RSL_BCCH_INFO(RSL_IE_SysinfoType si_type,
1863 octetstring full_bcch_info) := {
Harald Welte874c2232018-02-24 04:52:43 +01001864 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1865 msg_type := RSL_MT_BCCH_INFO,
1866 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001867 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_BCCH(0)}),
Harald Welte874c2232018-02-24 04:52:43 +01001868 t_RSL_IE(RSL_IE_SYSINFO_TYPE, RSL_IE_Body:{sysinfo_type := si_type}),
1869 t_RSL_IE(RSL_IE_FULL_BCCH_INFO, RSL_IE_Body:{other := ts_RSL_LV(full_bcch_info)})
1870 }
1871 }
Harald Welte09538f82019-08-01 09:50:25 +02001872 template RSL_Message tr_RSL_NO_BCCH_INFO(template RSL_IE_SysinfoType si_type := ?) := {
1873 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1874 msg_type := RSL_MT_BCCH_INFO,
1875 ies := {
1876 tr_RSL_IE(RSL_IE_Body:{chan_nr := ts_RslChanNr_BCCH(0)}),
1877 tr_RSL_IE(RSL_IE_Body:{sysinfo_type := si_type})
1878 }
1879 }
1880 template RSL_Message tr_RSL_BCCH_INFO(template RSL_IE_SysinfoType si_type := ?,
1881 template octetstring full_bcch_info := ?) := {
1882 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1883 msg_type := RSL_MT_BCCH_INFO,
1884 ies := {
1885 tr_RSL_IE(RSL_IE_Body:{chan_nr := ts_RslChanNr_BCCH(0)}),
1886 tr_RSL_IE(RSL_IE_Body:{sysinfo_type := si_type}),
1887 tr_RSL_IE(RSL_IE_Body:{other := tr_RSL_LV(full_bcch_info)}),
1888 *
1889 }
1890 }
Harald Welte874c2232018-02-24 04:52:43 +01001891
Harald Welte7ae93142017-12-07 17:56:15 +01001892 /* 8.5.2 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001893 template (value) RSL_Message ts_RSL_RACH_LOAD_IND(uint16_t slot_ct, uint16_t busy_ct,
1894 uint16_t acc_ct) := {
Harald Welte7ae93142017-12-07 17:56:15 +01001895 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1896 msg_type := RSL_MT_CCCH_LOAD_IND,
1897 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001898 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_RACH(0)}),
Harald Welte735dd072017-12-12 14:55:17 +01001899 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 +01001900 }
1901 }
Harald Welte68e495b2018-02-25 00:05:57 +01001902 template RSL_Message tr_RSL_RACH_LOAD_IND(template uint16_t slot_ct := ?,
1903 template uint16_t busy_ct := ?,
Harald Welte09538f82019-08-01 09:50:25 +02001904 template uint16_t acc_ct := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001905 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Welte68e495b2018-02-25 00:05:57 +01001906 msg_type := RSL_MT_CCCH_LOAD_IND,
1907 ies := {
1908 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_RACH(0)}),
1909 tr_RSL_IE(RSL_IE_Body:{rach_load := tr_RSL_IE_RachLoad(slot_ct, busy_ct, acc_ct)})
1910 }
1911 }
1912
Harald Welteefa7d912018-04-18 23:22:15 +02001913 template (value) RSL_Message ts_RSL_PAGING_LOAD_IND(uint16_t buffer_space) := {
Harald Welte7ae93142017-12-07 17:56:15 +01001914 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1915 msg_type := RSL_MT_CCCH_LOAD_IND,
1916 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001917 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_PCH_AGCH(0)}),
Harald Welte735dd072017-12-12 14:55:17 +01001918 t_RSL_IE(RSL_IE_PAGING_LOAD, RSL_IE_Body:{paging_load := buffer_space})
Harald Welte7ae93142017-12-07 17:56:15 +01001919 }
1920 }
Harald Welte68e495b2018-02-25 00:05:57 +01001921 template RSL_Message tr_RSL_PAGING_LOAD_IND(template uint16_t buffer_space := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001922 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Welte68e495b2018-02-25 00:05:57 +01001923 msg_type := RSL_MT_CCCH_LOAD_IND,
1924 ies := {
1925 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(0)}),
1926 tr_RSL_IE(RSL_IE_Body:{paging_load := buffer_space})
1927 }
1928 }
1929
Harald Welte7ae93142017-12-07 17:56:15 +01001930
Harald Welte643e2a62017-11-27 15:03:18 +01001931 /* 8.5.3 BTS -> BSC */
Vadim Yanitskiyab448a52019-05-31 20:24:03 +07001932 template (value) RSL_Message ts_RSL_CHAN_RQD(OCT1 ra, GsmFrameNumber fn,
1933 template (value) RslChannelNr chan_nr := ts_RslChanNr_RACH(0),
1934 uint8_t acc_del := 0) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001935 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1936 msg_type := RSL_MT_CHAN_RQD,
1937 ies := {
Vadim Yanitskiyab448a52019-05-31 20:24:03 +07001938 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1939 /* TODO: we may need to have optional RSL_IE_LINK_IDENT IE here */
Harald Welte735dd072017-12-12 14:55:17 +01001940 t_RSL_IE(RSL_IE_REQ_REFERENCE, RSL_IE_Body:{req_ref := ts_RSL_IE_ReqRef(ra, fn)}),
1941 t_RSL_IE(RSL_IE_ACCESS_DELAY, RSL_IE_Body:{access_delay := acc_del})
Harald Welte643e2a62017-11-27 15:03:18 +01001942 }
1943 }
Harald Welte9abd1282018-02-19 19:18:17 +01001944 template RSL_Message tr_RSL_CHAN_RQD(template OCT1 ra, template GsmFrameNumber fn := ?,
Vadim Yanitskiyab448a52019-05-31 20:24:03 +07001945 template RslChannelNr chan_nr := ts_RslChanNr_RACH(0),
1946 template uint8_t acc_del := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001947 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001948 msg_type := RSL_MT_CHAN_RQD,
1949 ies := {
Vadim Yanitskiyab448a52019-05-31 20:24:03 +07001950 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1951 /* TODO: we may need to have optional RSL_IE_LINK_IDENT IE here */
Harald Welte9abd1282018-02-19 19:18:17 +01001952 tr_RSL_IE(RSL_IE_Body:{req_ref := tr_RSL_IE_ReqRef(ra, fn)}),
1953 tr_RSL_IE(RSL_IE_Body:{access_delay := acc_del})
1954 }
1955 }
Harald Welte643e2a62017-11-27 15:03:18 +01001956
1957 /* 8.5.4 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001958 template (value) RSL_Message ts_DELETE_IND(template (value) RslChannelNr chan_nr,
1959 octetstring imm_ass) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001960 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1961 msg_type := RSL_MT_DELETE_IND,
1962 ies := {
Harald Welte735dd072017-12-12 14:55:17 +01001963 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1964 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 +01001965 }
1966 }
Harald Weltee8d750e2018-06-10 21:41:35 +02001967 template RSL_Message tr_RSL_DELETE_IND(template octetstring imm_ass := ?, template uint3_t tn) := {
1968 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1969 msg_type := RSL_MT_DELETE_IND,
1970 ies := {
1971 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(tn)}),
1972 tr_RSL_IE(RSL_IE_Body:{full_imm_ass_info := tr_RSL_LV(imm_ass)}),
1973 *
1974 }
1975 }
Harald Welte643e2a62017-11-27 15:03:18 +01001976
Harald Weltec2877752017-12-07 17:54:35 +01001977 /* 8.5.5 BSC -> BTS */
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +07001978 template RSL_Message tr_RSL_PAGING_CMD(template MobileIdentityV mi, template uint3_t tn := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001979 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Weltec2877752017-12-07 17:54:35 +01001980 msg_type := RSL_MT_PAGING_CMD,
1981 ies := {
1982 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(tn)}),
1983 tr_RSL_IE(RSL_IE_Body:{paging_group := ?}),
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +07001984 tr_RSL_IE(RSL_IE_Body:{ms_identity := tr_MI_LV(mi)}),
Harald Weltec2877752017-12-07 17:54:35 +01001985 * /* opt: channel needed, eMLPP prio */
1986 }
1987 }
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +07001988 template (value) RSL_Message ts_RSL_PAGING_CMD(MobileIdentityV mi, uint8_t pg, uint3_t tn := 0) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001989 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1990 msg_type := RSL_MT_PAGING_CMD,
1991 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001992 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_PCH_AGCH(tn)}),
Harald Welte9abd1282018-02-19 19:18:17 +01001993 t_RSL_IE(RSL_IE_PAGING_GROUP, RSL_IE_Body:{paging_group := pg}),
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +07001994 t_RSL_IE(RSL_IE_MS_IDENTITY, RSL_IE_Body:{ms_identity := ts_MI_LV(mi)})
Harald Welte9abd1282018-02-19 19:18:17 +01001995 }
1996 }
Harald Weltec2877752017-12-07 17:54:35 +01001997
1998 /* 8.5.6 BSC -> BTS */
1999 template RSL_Message tr_RSL_IMM_ASSIGN(template uint3_t tn := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002000 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Weltec2877752017-12-07 17:54:35 +01002001 msg_type := RSL_MT_IMMEDIATE_ASSIGN_CMD,
2002 ies := {
2003 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(tn)}),
2004 tr_RSL_IE(RSL_IE_Body:{full_imm_ass_info := ?})
2005 }
2006 }
Harald Welteefa7d912018-04-18 23:22:15 +02002007 template (value) RSL_Message ts_RSL_IMM_ASSIGN(octetstring f_ass_inf, uint3_t tn := 0) := {
Harald Welte9abd1282018-02-19 19:18:17 +01002008 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2009 msg_type := RSL_MT_IMMEDIATE_ASSIGN_CMD,
2010 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02002011 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_PCH_AGCH(tn)}),
Harald Welte9abd1282018-02-19 19:18:17 +01002012 t_RSL_IE(RSL_IE_FULL_IMM_ASS_INFO, RSL_IE_Body:{full_imm_ass_info := ts_RSL_LV(f_ass_inf)})
2013 }
2014 }
Harald Weltec2877752017-12-07 17:54:35 +01002015
Harald Weltecc373202018-09-10 10:28:21 +02002016 /* 8.5.8 BTS <- BSC SMS BROADCAST COMMAND */
2017 template RSL_Message tr_RSL_SMSCB_CMD(template RSL_IE_CbCommandType cb_cmd := ?,
2018 template octetstring msg := ?,
2019 template RslChannelNr chan_nr := ?) := {
2020 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2021 msg_type := RSL_MT_SMS_BC_CMD,
2022 ies := {
2023 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2024 tr_RSL_IE(RSL_IE_Body:{cb_cmd_type := cb_cmd}),
2025 tr_RSL_IE(RSL_IE_Body:{smscb_message := tr_RSL_LV(msg)}),
2026 *
2027 }
2028 }
2029 template (value) RSL_Message ts_RSL_SMSCB_CMD(template (value) RSL_IE_CbCommandType cb_cmd,
2030 template (value) octetstring msg,
2031 template (value) RslChannelNr chan_nr :=
2032 ts_RslChanNr_SDCCH4(0, 2)) := {
2033 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2034 msg_type := RSL_MT_SMS_BC_CMD,
2035 ies := {
2036 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2037 t_RSL_IE(RSL_IE_CB_CMD_TYPE, RSL_IE_Body:{cb_cmd_type := cb_cmd}),
2038 t_RSL_IE(RSL_IE_SMSCB_MSG, RSL_IE_Body:{smscb_message := ts_RSL_LV(msg)})
2039 /* optional channel type for extended CBCH */
2040 }
2041 }
2042
Harald Welte4a129f82019-05-21 16:35:22 +02002043 /* 8.5.9 BTS -> BSC CBCH LOAD INDICATION */
2044 template RSL_Message tr_RSL_CBCH_LOAD_IND_BASIC(template boolean overflow := ?,
2045 template uint4_t slot_count := ?,
2046 template RslChannelNr chan_nr := ?) := {
2047 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2048 msg_type := RSL_MT_CBCH_LOAD_IND,
2049 ies := {
2050 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2051 tr_RSL_IE(RSL_IE_Body:{cbch_load_info := tr_CbchLoadInfo(overflow, slot_count)})
2052 }
2053 }
2054 template (value) RSL_Message ts_RSL_CBCH_LOAD_IND_BASIC(boolean overflow, uint4_t slot_count,
2055 template (value) RslChannelNr chan_nr :=
2056 ts_RslChanNr_SDCCH4(0, 2)) := {
2057 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2058 msg_type := RSL_MT_CBCH_LOAD_IND,
2059 ies := {
2060 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2061 t_RSL_IE(RSL_IE_CBCH_LOAD_INFO, RSL_IE_Body:{cbch_load_info := ts_CbchLoadInfo(overflow, slot_count)})
2062 }
2063 }
2064 template RSL_Message tr_RSL_CBCH_LOAD_IND_EXTD(template boolean overflow := ?,
2065 template uint4_t slot_count := ?,
2066 template RslChannelNr chan_nr := ?) := {
2067 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2068 msg_type := RSL_MT_CBCH_LOAD_IND,
2069 ies := {
2070 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2071 tr_RSL_IE(RSL_IE_Body:{cbch_load_info := tr_CbchLoadInfo(overflow, slot_count)}),
2072 tr_RSL_IE(RSL_IE_Body:{smscb_chan_ind := 1})
2073 }
2074 }
2075 template (value) RSL_Message ts_RSL_CBCH_LOAD_IND_EXTD(boolean overflow, uint4_t slot_count,
2076 template (value) RslChannelNr chan_nr :=
2077 ts_RslChanNr_SDCCH4(0, 2)) := {
2078 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2079 msg_type := RSL_MT_CBCH_LOAD_IND,
2080 ies := {
2081 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2082 t_RSL_IE(RSL_IE_CBCH_LOAD_INFO, RSL_IE_Body:{cbch_load_info := ts_CbchLoadInfo(overflow, slot_count)}),
2083 t_RSL_IE(RSL_IE_SMSCB_CHAN_INDICATOR, RSL_IE_Body:{smscb_chan_ind := 1})
2084 }
2085 }
2086
2087
Vadim Yanitskiy9f699532021-06-03 17:29:22 +02002088 /* 8.6.1 BTS -> BSC */
2089 template (value) RSL_Message
2090 ts_RSL_RF_RES_IND(template (value) RSL_ResourceInfo info) := {
2091 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
2092 msg_type := RSL_MT_RF_RES_IND,
2093 ies := {
2094 t_RSL_IE(RSL_IE_RESOURCE_INFO, RSL_IE_Body:{
2095 resource_info := {
2096 len := 0, /* overwritten */
2097 info := info
2098 }
2099 })
2100 }
2101 }
2102 template RSL_Message
2103 tr_RSL_RF_RES_IND(template (present) RSL_ResourceInfo info := ?) := {
2104 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
2105 msg_type := RSL_MT_RF_RES_IND,
2106 ies := {
2107 tr_RSL_IE(RSL_IE_Body:{
2108 resource_info := {
2109 len := ?,
2110 info := info
2111 }
2112 })
2113 }
2114 }
2115
2116
Harald Welte68e495b2018-02-25 00:05:57 +01002117 /* 8.6.2 BTS <- BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02002118 template (value) RSL_Message ts_RSL_SACCH_FILL(RSL_IE_SysinfoType si_type, octetstring l3_info) := {
Harald Welte68e495b2018-02-25 00:05:57 +01002119 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
2120 msg_type := RSL_MT_SACCH_FILL,
2121 ies := {
2122 t_RSL_IE(RSL_IE_SYSINFO_TYPE, RSL_IE_Body:{sysinfo_type := si_type}),
2123 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
2124 }
2125 }
Harald Welte09538f82019-08-01 09:50:25 +02002126 template RSL_Message tr_RSL_NO_SACCH_FILL(template RSL_IE_SysinfoType si_type := ?) := {
2127 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
2128 msg_type := RSL_MT_SACCH_FILL,
2129 ies := {
2130 tr_RSL_IE(RSL_IE_Body:{sysinfo_type := si_type})
2131 }
2132 }
2133 template RSL_Message tr_RSL_SACCH_FILL(template RSL_IE_SysinfoType si_type := ?,
2134 template octetstring l3_info := ?) := {
2135 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
2136 msg_type := RSL_MT_SACCH_FILL,
2137 ies := {
2138 tr_RSL_IE(RSL_IE_Body:{sysinfo_type := si_type}),
2139 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)}),
2140 *
2141 }
2142 }
2143
Harald Welte68e495b2018-02-25 00:05:57 +01002144
Harald Welte643e2a62017-11-27 15:03:18 +01002145 /* 8.6.4 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02002146 template (value) RSL_Message ts_RSL_ERROR_REPORT(RSL_Cause cause) := {
Harald Welte01d982c2018-02-25 01:31:40 +01002147 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
2148 msg_type := RSL_MT_ERROR_REPORT,
Harald Welte643e2a62017-11-27 15:03:18 +01002149 ies := {
Harald Welte735dd072017-12-12 14:55:17 +01002150 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
Harald Welte643e2a62017-11-27 15:03:18 +01002151 }
2152 }
Harald Welte01d982c2018-02-25 01:31:40 +01002153 template RSL_Message tr_RSL_ERROR_REPORT(template RSL_Cause cause := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002154 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
Harald Welte01d982c2018-02-25 01:31:40 +01002155 msg_type := RSL_MT_ERROR_REPORT,
2156 ies := {
2157 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)}),
2158 *
2159 }
2160 }
2161
Harald Welte643e2a62017-11-27 15:03:18 +01002162
Harald Welte9958a4d2017-12-14 21:21:33 +01002163
2164 /* Abis/IP specific messages */
2165
Vadim Yanitskiy1567bac2022-05-01 03:36:24 +03002166 private function f_ts_RSL_IPA_CRCX_IEs(template (value) RslChannelNr chan_nr,
2167 template (omit) OCT4 remote_ip,
Pau Espin Pedrol39bfa022022-08-12 14:56:12 +02002168 template (omit) uint16_t remote_port,
2169 template (omit) uint8_t osmux_cid)
Vadim Yanitskiy1567bac2022-05-01 03:36:24 +03002170 return RSL_IE_List {
2171 var RSL_IE_List ies;
2172
2173 /* Channel Number is a mandatory IE */
2174 ies := {
2175 valueof(RSL_IE:{
2176 iei := RSL_IE_CHAN_NR,
2177 body := { chan_nr := chan_nr }
2178 })
2179 };
2180 /* Remote IP / Port are optional IEs */
2181 if (not istemplatekind(remote_ip, "omit")) {
2182 ies := ies & {
2183 valueof(RSL_IE:{
2184 iei := RSL_IE_IPAC_REMOTE_IP,
2185 body := { ipa_remote_ip := remote_ip }
2186 })
2187 };
2188 }
2189 if (not istemplatekind(remote_port, "omit")) {
2190 ies := ies & {
2191 valueof(RSL_IE:{
2192 iei := RSL_IE_IPAC_REMOTE_PORT,
2193 body := { ipa_remote_port := remote_port }
2194 })
2195 };
2196 }
Pau Espin Pedrol39bfa022022-08-12 14:56:12 +02002197 /* Osmux CID extension IE is optional: */
2198 if (not istemplatekind(osmux_cid, "omit")) {
2199 ies := ies & {
2200 valueof(RSL_IE:{
2201 iei := RSL_IE_OSMO_OSMUX_CID,
2202 body := { osmux_cid := ts_RSL_IE_OSMO_Osmux_CID(osmux_cid) }
2203 })
2204 };
2205 }
Vadim Yanitskiy1567bac2022-05-01 03:36:24 +03002206
2207 return ies;
2208 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002209 template RSL_Message tr_RSL_IPA_CRCX(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002210 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002211 msg_type := RSL_MT_IPAC_CRCX,
2212 ies := {
2213 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2214 *
2215 }
2216 }
Vadim Yanitskiye9141c22021-07-03 01:45:40 +02002217 template (value) RSL_Message
2218 ts_RSL_IPA_CRCX(template (value) RslChannelNr chan_nr,
Vadim Yanitskiy1567bac2022-05-01 03:36:24 +03002219 template (omit) OCT4 remote_ip := omit,
Pau Espin Pedrol39bfa022022-08-12 14:56:12 +02002220 template (omit) uint16_t remote_port := omit,
2221 template (omit) uint8_t osmux_cid := omit) := {
Harald Welte9abd1282018-02-19 19:18:17 +01002222 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2223 msg_type := RSL_MT_IPAC_CRCX,
Pau Espin Pedrol39bfa022022-08-12 14:56:12 +02002224 ies := f_ts_RSL_IPA_CRCX_IEs(chan_nr, remote_ip, remote_port, osmux_cid)
Harald Welte9abd1282018-02-19 19:18:17 +01002225 }
2226
Pau Espin Pedrol29c6dfb2022-08-08 18:37:56 +02002227 function ts_RSL_IPA_CRCX_ACK(template (value) RslChannelNr chan_nr,
2228 uint16_t ipa_conn_id, OCT4 local_ip,
2229 uint16_t local_port, uint7_t rtp_pt2,
2230 template (omit) uint8_t osmux_cid := omit)
2231 return template (value) RSL_Message {
2232 var template (value) RSL_Message msg := {
2233 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2234 msg_type := RSL_MT_IPAC_CRCX_ACK,
2235 ies := {
2236 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2237 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2238 t_RSL_IE(RSL_IE_IPAC_LOCAL_IP, RSL_IE_Body:{ipa_local_ip := local_ip}),
2239 t_RSL_IE(RSL_IE_IPAC_LOCAL_PORT, RSL_IE_Body:{ipa_local_port := local_port}),
2240 t_RSL_IE(RSL_IE_IPAC_RTP_PAYLOAD2, RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
2241 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002242 }
Pau Espin Pedrol29c6dfb2022-08-08 18:37:56 +02002243 if (not istemplatekind(osmux_cid, "omit")) {
2244 msg.ies[lengthof(msg.ies)] := t_RSL_IE(RSL_IE_OSMO_OSMUX_CID, RSL_IE_Body:{osmux_cid := ts_RSL_IE_OSMO_Osmux_CID(osmux_cid)});
2245 }
2246 return msg;
Harald Welte9958a4d2017-12-14 21:21:33 +01002247 }
Pau Espin Pedrol29c6dfb2022-08-08 18:37:56 +02002248
Pau Espin Pedrol39bfa022022-08-12 14:56:12 +02002249 function tr_RSL_IPA_CRCX_ACK(template RslChannelNr chan_nr,
2250 template uint16_t ipa_conn_id,
2251 template OCT4 local_ip,
2252 template uint16_t local_port,
2253 template uint8_t osmux_cid := omit)
2254 return template RSL_Message {
2255 var template RSL_Message msg := {
2256 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2257 msg_type := RSL_MT_IPAC_CRCX_ACK,
2258 ies := {
2259 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2260 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2261 tr_RSL_IE(RSL_IE_Body:{ipa_local_ip := local_ip}),
2262 tr_RSL_IE(RSL_IE_Body:{ipa_local_port := local_port})
2263 /* Optional: RTP Payload Type 2 IE */
2264 }
Harald Welte9abd1282018-02-19 19:18:17 +01002265 }
Pau Espin Pedrol39bfa022022-08-12 14:56:12 +02002266 if (not istemplatekind(osmux_cid, "omit")) {
2267 msg.ies[lengthof(msg.ies)] := tr_RSL_IE(RSL_IE_Body:{osmux_cid := f_tr_RSL_IE_OSMO_Osmux_CID(osmux_cid)});
2268 }
2269 return msg;
Harald Welte9abd1282018-02-19 19:18:17 +01002270 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002271
Harald Welteefa7d912018-04-18 23:22:15 +02002272 template (value) RSL_Message ts_RSL_IPA_CRCX_NACK(template (value) RslChannelNr chan_nr,
2273 RSL_Cause cause) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002274 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2275 msg_type := RSL_MT_IPAC_CRCX_NACK,
2276 ies := {
2277 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2278 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2279 }
2280 }
Harald Welte9abd1282018-02-19 19:18:17 +01002281 template RSL_Message tr_RSL_IPA_CRCX_NACK(template RslChannelNr chan_nr,
2282 template RSL_Cause cause := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002283 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9abd1282018-02-19 19:18:17 +01002284 msg_type := RSL_MT_IPAC_CRCX_NACK,
2285 ies := {
2286 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2287 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
2288 }
2289 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002290
Pau Espin Pedrol39bfa022022-08-12 14:56:12 +02002291 function ts_RSL_IPA_MDCX(template (value) RslChannelNr chan_nr,
2292 uint16_t ipa_conn_id,
2293 OCT4 remote_ip, uint16_t remote_port,
2294 uint7_t rtp_pt2,
2295 template (omit) uint8_t osmux_cid := omit)
2296 return template (value) RSL_Message {
2297 var template (value) RSL_Message msg := {
2298 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2299 msg_type := RSL_MT_IPAC_MDCX,
2300 ies := {
2301 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2302 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2303 t_RSL_IE(RSL_IE_IPAC_REMOTE_IP, RSL_IE_Body:{ipa_remote_ip := remote_ip}),
2304 t_RSL_IE(RSL_IE_IPAC_REMOTE_PORT, RSL_IE_Body:{ipa_remote_port := remote_port}),
2305 /* optional: RTP Payload Type */
2306 t_RSL_IE(RSL_IE_IPAC_RTP_PAYLOAD2, RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
2307 }
Harald Welte30527452018-02-25 12:46:25 +01002308 }
Pau Espin Pedrol39bfa022022-08-12 14:56:12 +02002309 if (not istemplatekind(osmux_cid, "omit")) {
2310 msg.ies[lengthof(msg.ies)] := t_RSL_IE(RSL_IE_OSMO_OSMUX_CID, RSL_IE_Body:{osmux_cid := ts_RSL_IE_OSMO_Osmux_CID(osmux_cid)});
2311 }
2312 return msg;
Harald Welte30527452018-02-25 12:46:25 +01002313 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002314 template RSL_Message tr_RSL_IPA_MDCX(template RslChannelNr chan_nr,
2315 template uint16_t ipa_conn_id) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002316 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002317 msg_type := RSL_MT_IPAC_MDCX,
2318 ies := {
2319 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2320 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2321 *
2322 }
2323 }
2324
Pau Espin Pedrol29c6dfb2022-08-08 18:37:56 +02002325 function ts_RSL_IPA_MDCX_ACK(template (value) RslChannelNr chan_nr,
2326 uint16_t ipa_conn_id,
2327 OCT4 local_ip, uint16_t local_port,
2328 uint7_t rtp_pt2,
2329 template (omit) uint8_t osmux_cid := omit)
Pau Espin Pedrol39bfa022022-08-12 14:56:12 +02002330 return template (value) RSL_Message {
2331 var template (value) RSL_Message msg := {
2332 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2333 msg_type := RSL_MT_IPAC_MDCX_ACK,
2334 ies := {
2335 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2336 /* optional */
2337 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2338 t_RSL_IE(RSL_IE_IPAC_LOCAL_IP, RSL_IE_Body:{ipa_local_ip := local_ip}),
2339 t_RSL_IE(RSL_IE_IPAC_LOCAL_PORT, RSL_IE_Body:{ipa_local_port := local_port}),
2340 /* optional: RTP Payload Type */
2341 t_RSL_IE(RSL_IE_IPAC_RTP_PAYLOAD2, RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
Pau Espin Pedrol29c6dfb2022-08-08 18:37:56 +02002342 }
Pau Espin Pedrol39bfa022022-08-12 14:56:12 +02002343 }
2344 if (not istemplatekind(osmux_cid, "omit")) {
2345 msg.ies[lengthof(msg.ies)] := t_RSL_IE(RSL_IE_OSMO_OSMUX_CID, RSL_IE_Body:{osmux_cid := ts_RSL_IE_OSMO_Osmux_CID(osmux_cid)});
2346 }
2347 return msg;
2348 }
2349 function tr_RSL_IPA_MDCX_ACK(template RslChannelNr chan_nr,
2350 template uint16_t ipa_conn_id,
2351 template OCT4 local_ip,
2352 template uint16_t local_port,
2353 template uint7_t rtp_pt2,
2354 template uint8_t osmux_cid := omit)
2355 return template RSL_Message {
2356 var template RSL_Message msg := {
2357 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2358 msg_type := RSL_MT_IPAC_MDCX_ACK,
2359 ies := {
2360 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2361 /* optional */
2362 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2363 tr_RSL_IE(RSL_IE_Body:{ipa_local_ip := local_ip}),
2364 tr_RSL_IE(RSL_IE_Body:{ipa_local_port := local_port}),
2365 /* optional: RTP Payload Type */
2366 tr_RSL_IE(RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
Pau Espin Pedrol29c6dfb2022-08-08 18:37:56 +02002367 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002368 }
Pau Espin Pedrol39bfa022022-08-12 14:56:12 +02002369 if (not istemplatekind(osmux_cid, "omit")) {
2370 msg.ies[lengthof(msg.ies)] := tr_RSL_IE(RSL_IE_Body:{osmux_cid := f_tr_RSL_IE_OSMO_Osmux_CID(osmux_cid)});
Harald Welte30527452018-02-25 12:46:25 +01002371 }
Pau Espin Pedrol39bfa022022-08-12 14:56:12 +02002372 return msg;
Harald Welte30527452018-02-25 12:46:25 +01002373 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002374
Harald Welteefa7d912018-04-18 23:22:15 +02002375 template (value) RSL_Message ts_RSL_IPA_MDCX_NACK(template (value) RslChannelNr chan_nr,
2376 RSL_Cause cause,
2377 template (value) uint16_t ipa_conn_id) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002378 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2379 msg_type := RSL_MT_IPAC_MDCX_NACK,
2380 ies := {
2381 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2382 /* optional connection ID */
2383 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2384 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2385 }
2386 }
Harald Welte30527452018-02-25 12:46:25 +01002387 template RSL_Message tr_RSL_IPA_MDCX_NACK(template RslChannelNr chan_nr,
2388 template RSL_Cause cause,
2389 template uint16_t ipa_conn_id) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002390 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte30527452018-02-25 12:46:25 +01002391 msg_type := RSL_MT_IPAC_MDCX_NACK,
2392 ies := {
2393 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2394 /* optional connection ID */
2395 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2396 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
2397 }
2398 }
2399
Harald Welte9958a4d2017-12-14 21:21:33 +01002400
Harald Welteefa7d912018-04-18 23:22:15 +02002401 template (value) RSL_Message ts_RSL_IPA_DLCX_IND(template (value) RslChannelNr chan_nr,
2402 uint16_t ipa_conn_id,
2403 template (value) RSL_IE_IPA_ConnectionStats stats,
2404 RSL_Cause cause) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002405 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2406 msg_type := RSL_MT_IPAC_DLCX_IND,
2407 ies := {
2408 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2409 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2410 t_RSL_IE(RSL_IE_IPAC_CONN_STAT, RSL_IE_Body:{ipa_stats := stats}),
2411 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2412 }
2413 }
2414
Harald Welteefa7d912018-04-18 23:22:15 +02002415 template (value) RSL_Message ts_RSL_IPA_DLCX(template (value) RslChannelNr chan_nr,
2416 uint16_t ipa_conn_id) := {
Harald Weltea871a382018-02-25 02:03:14 +01002417 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2418 msg_type := RSL_MT_IPAC_DLCX,
2419 ies := {
Harald Welte2a7e7162018-02-25 12:46:48 +01002420 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2421 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id})
Harald Weltea871a382018-02-25 02:03:14 +01002422 }
2423 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002424 template RSL_Message tr_RSL_IPA_DLCX(template RslChannelNr chan_nr,
2425 template uint16_t ipa_conn_id := omit) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002426 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002427 msg_type := RSL_MT_IPAC_DLCX,
2428 ies := {
2429 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2430 /* FIXME: optional conn_id */
2431 *
2432 }
2433 }
2434
Harald Welteefa7d912018-04-18 23:22:15 +02002435 template (value) RSL_Message ts_RSL_IPA_DLCX_ACK(template (value) RslChannelNr chan_nr,
2436 uint16_t ipa_conn_id,
2437 RSL_IE_IPA_ConnectionStats stats) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002438 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2439 msg_type := RSL_MT_IPAC_DLCX_ACK,
2440 ies := {
2441 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2442 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2443 t_RSL_IE(RSL_IE_IPAC_CONN_STAT, RSL_IE_Body:{ipa_stats := stats})
2444 }
2445 }
Harald Weltea871a382018-02-25 02:03:14 +01002446 template RSL_Message tr_RSL_IPA_DLCX_ACK(template RslChannelNr chan_nr,
2447 template uint16_t ipa_conn_id,
2448 template RSL_IE_IPA_ConnectionStats stats) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002449 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Weltea871a382018-02-25 02:03:14 +01002450 msg_type := RSL_MT_IPAC_DLCX_ACK,
2451 ies := {
2452 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2453 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2454 tr_RSL_IE(RSL_IE_Body:{ipa_stats := stats})
2455 }
2456 }
2457
2458
Harald Welte9958a4d2017-12-14 21:21:33 +01002459
Harald Welteefa7d912018-04-18 23:22:15 +02002460 template (value) RSL_Message ts_RSL_IPA_DLCX_NACK(template (value) RslChannelNr chan_nr,
2461 RSL_Cause cause, uint16_t ipa_conn_id) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002462 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2463 msg_type := RSL_MT_IPAC_DLCX_NACK,
2464 ies := {
2465 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2466 /* optional connection ID */
2467 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2468 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2469 }
2470 }
Harald Weltea871a382018-02-25 02:03:14 +01002471 template RSL_Message tr_RSL_IPA_DLCX_NACK(template RslChannelNr chan_nr,
2472 template RSL_Cause cause) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002473 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Weltea871a382018-02-25 02:03:14 +01002474 msg_type := RSL_MT_IPAC_DLCX_NACK,
2475 ies := {
2476 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2477 /* optional connection ID */
2478 *,
2479 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
2480 }
2481 }
2482
Harald Welte9958a4d2017-12-14 21:21:33 +01002483
Vadim Yanitskiy58b16532021-10-09 20:27:39 +06002484 template (value) RSL_Message
2485 ts_RSL_IPA_PDCH_ACT(template (value) RslChannelNr chan_nr) := {
Harald Welteee19c732018-04-05 09:08:26 +02002486 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2487 msg_type := RSL_MT_IPAC_PDCH_ACT,
2488 ies := {
2489 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
2490 }
2491 }
Vadim Yanitskiy58b16532021-10-09 20:27:39 +06002492 template RSL_Message
2493 tr_RSL_IPA_PDCH_ACT(template (present) RslChannelNr chan_nr) := {
Harald Welteee19c732018-04-05 09:08:26 +02002494 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002495 msg_type := RSL_MT_IPAC_PDCH_ACT,
2496 ies := {
2497 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
2498 }
2499 }
2500
Harald Welteee19c732018-04-05 09:08:26 +02002501
Harald Welte94e0c342018-04-07 11:33:23 +02002502 template RSL_Message ts_RSL_IPA_PDCH_ACT_ACK(RslChannelNr chan_nr,
2503 template (value) RSL_IE_FrameNumber fn) := {
Harald Welteee19c732018-04-05 09:08:26 +02002504 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002505 msg_type := RSL_MT_IPAC_PDCH_ACT_ACK,
2506 ies := {
2507 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2508 t_RSL_IE(RSL_IE_FRAME_NUMBER, RSL_IE_Body:{frame_nr := fn})
2509 }
2510 }
Harald Welteee19c732018-04-05 09:08:26 +02002511 template RSL_Message tr_RSL_IPA_PDCH_ACT_ACK(template RslChannelNr chan_nr,
2512 template RSL_IE_FrameNumber fn) := {
2513 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2514 msg_type := RSL_MT_IPAC_PDCH_ACT_ACK,
2515 ies := {
2516 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2517 tr_RSL_IE(RSL_IE_Body:{frame_nr := fn})
2518 }
2519 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002520
2521 template RSL_Message ts_RSL_IPA_PDCH_ACT_NACK(RslChannelNr chan_nr, RSL_Cause cause) := {
Harald Welteee19c732018-04-05 09:08:26 +02002522 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002523 msg_type := RSL_MT_IPAC_PDCH_ACT_NACK,
2524 ies := {
2525 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2526 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2527 }
2528 }
Harald Welteee19c732018-04-05 09:08:26 +02002529 template RSL_Message tr_RSL_IPA_PDCH_ACT_NACK(template RslChannelNr chan_nr,
2530 template RSL_Cause cause) := {
2531 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2532 msg_type := RSL_MT_IPAC_PDCH_ACT_NACK,
2533 ies := {
2534 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2535 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
2536 }
2537 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002538
Harald Welteee19c732018-04-05 09:08:26 +02002539 template RSL_Message ts_RSL_IPA_PDCH_DEACT(RslChannelNr chan_nr) := {
2540 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2541 msg_type := RSL_MT_IPAC_PDCH_DEACT,
2542 ies := {
2543 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
2544 }
2545 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002546 template RSL_Message tr_RSL_IPA_PDCH_DEACT(template RslChannelNr chan_nr) := {
Harald Welteee19c732018-04-05 09:08:26 +02002547 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002548 msg_type := RSL_MT_IPAC_PDCH_DEACT,
2549 ies := {
2550 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
2551 }
2552 }
2553
2554 template RSL_Message ts_RSL_IPA_PDCH_DEACT_ACK(RslChannelNr chan_nr) := {
Harald Welteee19c732018-04-05 09:08:26 +02002555 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002556 msg_type := RSL_MT_IPAC_PDCH_DEACT_ACK,
2557 ies := {
2558 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
2559 }
2560 }
Harald Welteee19c732018-04-05 09:08:26 +02002561 template RSL_Message tr_RSL_IPA_PDCH_DEACT_ACK(template RslChannelNr chan_nr) := {
2562 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2563 msg_type := RSL_MT_IPAC_PDCH_DEACT_ACK,
2564 ies := {
2565 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
2566 }
2567 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002568
2569 template RSL_Message ts_RSL_IPA_PDCH_DEACT_NACK(RslChannelNr chan_nr, RSL_Cause cause) := {
Harald Welteee19c732018-04-05 09:08:26 +02002570 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002571 msg_type := RSL_MT_IPAC_PDCH_DEACT_NACK,
2572 ies := {
2573 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2574 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2575 }
2576 }
Harald Welteee19c732018-04-05 09:08:26 +02002577 template RSL_Message tr_RSL_IPA_PDCH_DEACT_NACK(template RslChannelNr chan_nr,
2578 template RSL_Cause cause) := {
2579 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2580 msg_type := RSL_MT_IPAC_PDCH_DEACT_NACK,
2581 ies := {
2582 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2583 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
2584 }
2585 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002586
Harald Welte908ce542019-09-04 23:05:40 +02002587 template (value) RSL_Message ts_RSL_OSMO_ETWS_CMD(template (value) octetstring msg,
2588 template (value) RslChannelNr chan_nr := ts_RslChanNr_PCH_AGCH(0)) := {
2589 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2590 msg_type := RSL_MT_OSMO_ETWS_CMD,
2591 ies := {
2592 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2593 t_RSL_IE(RSL_IE_SMSCB_MSG, RSL_IE_Body:{smscb_message := ts_RSL_LV(msg)})
2594 }
2595 }
2596 template RSL_Message tr_RSL_OSMO_ETWS_CMD(template RslChannelNr chan_nr := ?,
2597 template octetstring msg := ?) := {
2598 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2599 msg_type := RSL_MT_OSMO_ETWS_CMD,
2600 ies := {
2601 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2602 tr_RSL_IE(RSL_IE_Body:{smscb_message := tr_RSL_LV(msg)})
2603 }
2604 }
2605
2606
Harald Welte9958a4d2017-12-14 21:21:33 +01002607
Harald Welte6a8199d2018-01-29 21:58:53 +01002608 function f_rsl_find_ie(RSL_Message msg, RSL_IE_Type iei, out RSL_IE_Body ret) return boolean {
2609 for (var integer i := 0; i < sizeof(msg.ies); i := i+1) {
2610 if (msg.ies[i].iei == iei) {
2611 ret := msg.ies[i].body;
2612 return true;
2613 }
2614 }
2615 return false;
2616 }
2617
2618
Harald Welte9958a4d2017-12-14 21:21:33 +01002619
Harald Welte643e2a62017-11-27 15:03:18 +01002620} with { encode "RAW" ; variant "FIELDORDER(msb)" }