blob: cad8a34e273345d6375bf82582ddf6ed413361e3 [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 Yanitskiy0345d202022-09-14 16:13:40 +0700833 BIT8 codec_modes := '00000100'B /* 5,90k */,
834 octetstring params := ''O) := {
Vadim Yanitskiy9e0139b2022-09-14 17:41:29 +0700835 len := 2 + lengthof(params),
Pau Espin Pedrolf7634dc2022-09-02 17:56:00 +0200836 mr_speech_ver := 1,
837 nscb := false,
838 icmi := icmi,
839 spare := '0'B,
840 start_mode := start_mode,
Vadim Yanitskiyf14e6962022-09-14 15:18:06 +0700841 codec_modes := codec_modes,
Vadim Yanitskiy0345d202022-09-14 16:13:40 +0700842 parameters := params
Pau Espin Pedrolf7634dc2022-09-02 17:56:00 +0200843 }
844
Harald Welte643e2a62017-11-27 15:03:18 +0100845 /* 9.3.53 */
846 type record RSL_IE_MultirateCtrl {
847 uint3_t spare,
848 boolean od,
849 boolean pre,
850 uint2_t rae,
851 boolean tfo
852 }
853
854 type enumerated RSL_IE_SysinfoType {
855 RSL_SYSTEM_INFO_8 ('00000000'B),
856 RSL_SYSTEM_INFO_1 ('00000001'B),
857 RSL_SYSTEM_INFO_2 ('00000010'B),
858 RSL_SYSTEM_INFO_3 ('00000011'B),
859 RSL_SYSTEM_INFO_4 ('00000100'B),
860 RSL_SYSTEM_INFO_5 ('00000101'B),
861 RSL_SYSTEM_INFO_6 ('00000110'B),
862 RSL_SYSTEM_INFO_7 ('00000111'B),
863 RSL_SYSTEM_INFO_16 ('00001000'B),
864 RSL_SYSTEM_INFO_17 ('00001001'B),
865 RSL_SYSTEM_INFO_2bis ('00001010'B),
866 RSL_SYSTEM_INFO_2ter ('00001011'B),
867 RSL_SYSTEM_INFO_5bis ('00001101'B),
868 RSL_SYSTEM_INFO_5ter ('00001110'B),
869 RSL_SYSTEM_INFO_10 ('00001111'B),
870 RSL_EXT_MEAS_ORDER ('01000111'B),
871 RSL_MEAS_INFO ('01001000'B),
872 RSL_SYSTEM_INFO_13 ('00101000'B),
873 RSL_ERIC_SYSTEM_INFO_13 ('00001100'B),
874 RSL_SYSTEM_INFO_2quater ('00101001'B),
875 RSL_SYSTEM_INFO_9 ('00101010'B),
876 RSL_SYSTEM_INFO_18 ('00101011'B),
877 RSL_SYSTEM_INFO_19 ('00101100'B),
878 RSL_SYSTEM_INFO_20 ('00101101'B)
879 } with { variant "FIELDLENGTH(8)" }
880
Harald Welte9958a4d2017-12-14 21:21:33 +0100881 type record RSL_IE_IPA_ConnectionStats {
882 uint8_t len,
883 uint32_t tx_packets,
884 uint32_t tx_octets,
885 uint32_t rx_packets,
886 uint32_t rx_octets,
887 uint32_t lost_packets,
888 uint32_t jitter,
889 uint32_t avg_delay
890 } with { variant (len) "LENGTHTO(tx_packets,tx_octets,rx_packets,rx_octets,lost_packets,jitter,avg_delay)" }
891
892 type enumerated RSL_IPA_SpeechMode {
893 RSL_IPA_SPM_SENDRECV ('00'B),
894 RSL_IPA_SPM_RECVONLY ('01'B),
895 RSL_IPA_SPM_SENDONLY ('10'B),
896 RSL_IPA_SPM_RESERVED ('11'B)
897 } with { variant "FIELDLENGTH(2)" }
898
899 type enumerated RSL_IPA_Codec {
900 RSL_IPA_CODEC_FR ('0000'B),
901 RSL_IPA_CODEC_EFR ('0001'B),
902 RSL_IPA_CODEC_AMR_F ('0010'B),
903 RSL_IPA_CODEC_HR ('0011'B),
904 RSL_IPA_CODEC_AMR_H ('0101'B),
905 RSL_IPA_CODEC_RTP_PT ('1111'B)
906 } with { variant "FIELDLENGTH(4)" }
907
908 type record RSL_IE_IPA_SpeechMode {
909 BIT2 reserved,
910 RSL_IPA_SpeechMode mode,
911 RSL_IPA_Codec codec
912 }
913
Harald Welte0472ab42018-03-12 15:02:26 +0100914 /* 9.3.20 */
915 type enumerated RSL_IE_ReleaseMode {
916 RSL_REL_MODE_NORMAL ('00'B),
917 REL_REL_MODE_LOCAL ('01'B)
918 }
919
Neels Hofmeyr2bef0dd2021-04-22 21:46:00 +0000920 type record RSL_IE_OSMO_TrainingSequence {
921 uint8_t len,
922 uint8_t tsc_set,
923 uint8_t tsc
924 } with { variant (len) "LENGTHTO(tsc_set,tsc)" }
925
Vadim Yanitskiy1f532152021-11-01 20:37:56 +0300926 type record RSL_IE_OSMO_RepAcchCap {
927 uint8_t len,
928 BIT1 rfu ('0'B),
929 uint3_t rxqual,
930 boolean ul_sacch,
931 boolean dl_sacch,
932 boolean dl_facch_all,
933 boolean dl_facch_cmd
934 } with { variant (len) "LENGTHTO(rfu,rxqual,ul_sacch,dl_sacch,dl_facch_all,dl_facch_cmd)" }
935
Vadim Yanitskiya203d3b2021-11-01 21:32:31 +0300936 type record RSL_IE_OSMO_TopAcchCap {
937 uint8_t len,
938 boolean sacch_enable,
939 boolean facch_enable,
940 uint3_t rxqual,
941 uint3_t overpower_db
942 } with { variant (len) "LENGTHTO(sacch_enable,facch_enable,rxqual,overpower_db)" }
943
Vadim Yanitskiy66d3c332021-11-06 18:18:13 +0300944 template (value) RSL_IE_OSMO_TopAcchCap
945 ts_RSL_IE_OSMO_TopAcchCap(template (value) uint3_t overpower := 2,
946 template (value) uint3_t rxqual := 4,
947 boolean facch_enable := true,
948 boolean sacch_enable := true) := {
949 len := 0, /* overwritten */
950 sacch_enable := sacch_enable,
951 facch_enable := facch_enable,
952 rxqual := rxqual,
953 overpower_db := overpower
954 };
955 template RSL_IE_OSMO_TopAcchCap
956 tr_RSL_IE_OSMO_TopAcchCap(template (present) uint3_t overpower := ?,
957 template (present) uint3_t rxqual := ?,
958 template (present) boolean facch_enable := ?,
959 template (present) boolean sacch_enable := ?) := {
960 len := ?, /* overwritten */
961 sacch_enable := sacch_enable,
962 facch_enable := facch_enable,
963 rxqual := rxqual,
964 overpower_db := overpower
965 };
966
Pau Espin Pedrol29c6dfb2022-08-08 18:37:56 +0200967 type record RSL_IE_OSMO_Osmux_CID {
968 uint8_t len,
969 uint8_t cid
970 } with { variant (len) "LENGTHTO(cid)" }
971
972 template (present) RSL_IE_OSMO_Osmux_CID
973 tr_RSL_IE_OSMO_Osmux_CID(template (present) uint8_t osmux_cid := ?) := {
974 len := ?, /* overwritten */
975 cid := osmux_cid
976 };
Pau Espin Pedrol39bfa022022-08-12 14:56:12 +0200977 function f_tr_RSL_IE_OSMO_Osmux_CID(template uint8_t osmux_cid := *)
978 return template RSL_IE_OSMO_Osmux_CID {
979 var template RSL_IE_OSMO_Osmux_CID ie := omit;
980 if (not istemplatekind(osmux_cid, "omit")) {
981 ie := tr_RSL_IE_OSMO_Osmux_CID(osmux_cid);
982 }
983 return ie;
984 }
Pau Espin Pedrol29c6dfb2022-08-08 18:37:56 +0200985 template (value) RSL_IE_OSMO_Osmux_CID
986 ts_RSL_IE_OSMO_Osmux_CID(template (value) uint8_t osmux_cid) := {
987 len := 0, /* overwritten */
988 cid := osmux_cid
989 };
990
991
Harald Welte643e2a62017-11-27 15:03:18 +0100992 /* union of all IE bodies */
993 type union RSL_IE_Body {
994 RslChannelNr chan_nr,
995 RslLinkId link_id,
Harald Welte15bb5b52017-12-07 17:52:04 +0100996 RSL_L16V l3_info,
Harald Welte643e2a62017-11-27 15:03:18 +0100997 RSL_LV rlm_cause,
Harald Welte0472ab42018-03-12 15:02:26 +0100998 RSL_IE_ReleaseMode release_mode,
Harald Welte643e2a62017-11-27 15:03:18 +0100999 RSL_IE_ActivationType act_type,
Vadim Yanitskiye02dbcc2020-08-25 04:20:51 +07001000 RSL_IE_ChannelIdent chan_ident,
Harald Welte643e2a62017-11-27 15:03:18 +01001001 RSL_IE_ChannelMode chan_mode,
1002 uint8_t handover_ref,
1003 RSL_IE_BS_Power bs_power,
Vadim Yanitskiy802508e2020-11-11 07:25:47 +07001004 RSL_LV bs_power_params,
Harald Welte643e2a62017-11-27 15:03:18 +01001005 RSL_IE_MS_Power ms_power,
Eric Wild61edb7e2019-06-03 12:38:31 +02001006 RSL_IE_MS_Power_Parameters ms_power_params,
Harald Welte643e2a62017-11-27 15:03:18 +01001007 uint8_t timing_adv,
Pau Espin Pedrolf7634dc2022-09-02 17:56:00 +02001008 RSL_IE_MultirateCfg multirate_cfg,
Harald Welte643e2a62017-11-27 15:03:18 +01001009 RSL_IE_MultirateCtrl multirate_ctrl,
Harald Weltea6706152019-05-19 20:38:18 +02001010 uint8_t msg_id,
Harald Welte643e2a62017-11-27 15:03:18 +01001011 RSL_IE_FrameNumber frame_nr,
1012 RSL_IE_Cause cause,
1013 uint8_t access_delay,
Harald Welted5f521e2017-12-07 17:53:06 +01001014 RSL_IE_RachLoad rach_load,
Harald Welte643e2a62017-11-27 15:03:18 +01001015 uint8_t meas_res_nr,
Harald Welte2691adf2018-02-22 17:32:39 +01001016 uint8_t ms_timing_offset,
1017 RSL_IE_UplinkMeas uplink_meas,
Harald Welte643e2a62017-11-27 15:03:18 +01001018 RSL_IE_L1Info l1_info,
1019 RSL_IE_SysinfoType sysinfo_type,
1020 uint16_t paging_load,
1021 uint8_t paging_group,
1022 RSL_IE_ChanNeeded chan_needed,
Harald Weltecc373202018-09-10 10:28:21 +02001023 RSL_IE_CbCommandType cb_cmd_type,
1024 RSL_LV smscb_message,
Harald Welte4a129f82019-05-21 16:35:22 +02001025 RSL_IE_CbchLoadInfo cbch_load_info,
Vadim Yanitskiy9f699532021-06-03 17:29:22 +02001026 RSL_IE_ResourceInfo resource_info,
Harald Weltec8d363c2019-05-19 20:36:48 +02001027 RSL_SacchInfo sacch_info,
Harald Weltecc373202018-09-10 10:28:21 +02001028
Harald Welte643e2a62017-11-27 15:03:18 +01001029 RSL_IE_StartingTime starting_time,
Harald Welte73cd2712017-12-17 00:44:52 +01001030 RSL_IE_EncryptionInfo encr_info,
Harald Weltea3ff6702019-05-20 20:03:50 +02001031 uint8_t smscb_chan_ind,
Harald Welte643e2a62017-11-27 15:03:18 +01001032 RSL_IE_RequestRef req_ref,
1033 RSL_LV full_imm_ass_info,
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +07001034 MobileIdentityLV ms_identity,
Harald Welte643e2a62017-11-27 15:03:18 +01001035
Harald Welte9958a4d2017-12-14 21:21:33 +01001036 uint16_t ipa_conn_id,
1037 uint16_t ipa_local_port,
1038 uint16_t ipa_remote_port,
Vadim Yanitskiyfc631642021-07-03 02:42:45 +02001039 OCT4 ipa_local_ip,
1040 OCT4 ipa_remote_ip,
Harald Welte9958a4d2017-12-14 21:21:33 +01001041 uint8_t ipa_rtp_pt,
1042 uint8_t ipa_rtp_pt2,
1043 RSL_IE_IPA_ConnectionStats ipa_stats,
1044 RSL_IE_IPA_SpeechMode ipa_speech_mode,
1045
Neels Hofmeyr2bef0dd2021-04-22 21:46:00 +00001046 RSL_IE_OSMO_TrainingSequence osmo_training_sequence,
Vadim Yanitskiy1f532152021-11-01 20:37:56 +03001047 RSL_IE_OSMO_RepAcchCap rep_acch_cap,
Vadim Yanitskiya203d3b2021-11-01 21:32:31 +03001048 RSL_IE_OSMO_TopAcchCap top_acch_cap,
Pau Espin Pedrol29c6dfb2022-08-08 18:37:56 +02001049 RSL_IE_OSMO_Osmux_CID osmux_cid,
Neels Hofmeyr2bef0dd2021-04-22 21:46:00 +00001050
Harald Welte643e2a62017-11-27 15:03:18 +01001051 RSL_LV other
1052 }
1053
1054 type record RSL_IE {
1055 RSL_IE_Type iei,
1056 RSL_IE_Body body
1057 } with { variant (body) "CROSSTAG(
1058 chan_nr, iei = RSL_IE_CHAN_NR;
1059 link_id, iei = RSL_IE_LINK_IDENT;
1060 l3_info, iei = RSL_IE_L3_INFO;
1061 rlm_cause, iei = RSL_IE_RLM_CAUSE;
1062 release_mode, iei = RSL_IE_RELEASE_MODE;
1063 act_type, iei = RSL_IE_ACT_TYPE;
Vadim Yanitskiye02dbcc2020-08-25 04:20:51 +07001064 chan_ident, iei = RSL_IE_CHAN_IDENT;
Harald Welte643e2a62017-11-27 15:03:18 +01001065 chan_mode, iei = RSL_IE_CHAN_MODE;
1066 handover_ref, iei = RSL_IE_HANDO_REF;
1067 bs_power, iei = RSL_IE_BS_POWER;
Vadim Yanitskiy802508e2020-11-11 07:25:47 +07001068 bs_power_params, iei = RSL_IE_BS_POWER_PARAM;
Harald Welte643e2a62017-11-27 15:03:18 +01001069 ms_power, iei = RSL_IE_MS_POWER;
Eric Wild61edb7e2019-06-03 12:38:31 +02001070 ms_power_params, iei = RSL_IE_MS_POWER_PARAM;
Harald Welte643e2a62017-11-27 15:03:18 +01001071 timing_adv, iei = RSL_IE_TIMING_ADVANCE;
Pau Espin Pedrolf7634dc2022-09-02 17:56:00 +02001072 multirate_cfg, iei = RSL_IE_MR_CONFIG;
Harald Welte643e2a62017-11-27 15:03:18 +01001073 multirate_ctrl, iei = RSL_IE_MR_CONTROL;
Harald Weltea6706152019-05-19 20:38:18 +02001074 msg_id, iei = RSL_IE_MSG_ID;
Harald Welte643e2a62017-11-27 15:03:18 +01001075
1076 frame_nr, iei = RSL_IE_FRAME_NUMBER;
1077 cause, iei = RSL_IE_CAUSE;
1078 access_delay, iei = RSL_IE_ACCESS_DELAY;
Harald Welted5f521e2017-12-07 17:53:06 +01001079 rach_load, iei = RSL_IE_RACH_LOAD;
Harald Welte643e2a62017-11-27 15:03:18 +01001080 meas_res_nr, iei = RSL_IE_MEAS_RES_NR;
Harald Welte2691adf2018-02-22 17:32:39 +01001081 ms_timing_offset, iei = RSL_IE_MS_TIMING_OFFSET;
1082 uplink_meas, iei = RSL_IE_UPLINK_MEAS;
Harald Welte643e2a62017-11-27 15:03:18 +01001083 l1_info, iei = RSL_IE_L1_INFO;
1084 sysinfo_type, iei = RSL_IE_SYSINFO_TYPE;
1085 paging_load, iei = RSL_IE_PAGING_LOAD;
1086 paging_group, iei = RSL_IE_PAGING_GROUP;
1087 chan_needed, iei = RSL_IE_CHAN_NEEDED;
Harald Weltecc373202018-09-10 10:28:21 +02001088 cb_cmd_type, iei = RSL_IE_CB_CMD_TYPE;
1089 smscb_message, iei = RSL_IE_SMSCB_MSG;
Harald Welte4a129f82019-05-21 16:35:22 +02001090 cbch_load_info, iei = RSL_IE_CBCH_LOAD_INFO;
Vadim Yanitskiy9f699532021-06-03 17:29:22 +02001091 resource_info, iei = RSL_IE_RESOURCE_INFO;
Harald Weltec8d363c2019-05-19 20:36:48 +02001092 sacch_info, iei = RSL_IE_SACCH_INFO;
Harald Welte643e2a62017-11-27 15:03:18 +01001093 starting_time, iei = RSL_IE_STARTNG_TIME;
Harald Welte73cd2712017-12-17 00:44:52 +01001094 encr_info, iei = RSL_IE_ENCR_INFO;
Harald Weltea3ff6702019-05-20 20:03:50 +02001095 smscb_chan_ind, iei = RSL_IE_SMSCB_CHAN_INDICATOR;
Harald Welte643e2a62017-11-27 15:03:18 +01001096
1097 req_ref, iei = RSL_IE_REQ_REFERENCE;
Harald Weltefff69302017-12-07 17:53:42 +01001098 full_imm_ass_info, iei = RSL_IE_FULL_IMM_ASS_INFO;
1099 ms_identity, iei = RSL_IE_MS_IDENTITY;
1100 other, iei = RSL_IE_FULL_BCCH_INFO;
Harald Welte643e2a62017-11-27 15:03:18 +01001101
Harald Welte9958a4d2017-12-14 21:21:33 +01001102 ipa_conn_id, iei = RSL_IE_IPAC_CONN_ID;
1103 ipa_remote_ip, iei = RSL_IE_IPAC_REMOTE_IP;
1104 ipa_remote_port, iei = RSL_IE_IPAC_REMOTE_PORT;
1105 ipa_local_ip, iei = RSL_IE_IPAC_LOCAL_IP;
1106 ipa_local_port, iei = RSL_IE_IPAC_LOCAL_PORT;
1107 ipa_rtp_pt, iei = RSL_IE_IPAC_RTP_PAYLOAD;
1108 ipa_rtp_pt2, iei = RSL_IE_IPAC_RTP_PAYLOAD2;
1109 ipa_stats, iei = RSL_IE_IPAC_CONN_STAT;
1110 ipa_speech_mode, iei = RSL_IE_IPAC_SPEECH_MODE;
1111
Neels Hofmeyr2bef0dd2021-04-22 21:46:00 +00001112 osmo_training_sequence, iei = RSL_IE_OSMO_TRAINING_SEQUENCE;
Vadim Yanitskiy1f532152021-11-01 20:37:56 +03001113 rep_acch_cap, iei = RSL_IE_OSMO_REP_ACCH_CAP;
Vadim Yanitskiya203d3b2021-11-01 21:32:31 +03001114 top_acch_cap, iei = RSL_IE_OSMO_TOP_ACCH_CAP;
Pau Espin Pedrol29c6dfb2022-08-08 18:37:56 +02001115 osmux_cid, iei = RSL_IE_OSMO_OSMUX_CID;
Neels Hofmeyr2bef0dd2021-04-22 21:46:00 +00001116
Harald Welte643e2a62017-11-27 15:03:18 +01001117 other, OTHERWISE;
1118 )" };
1119
Harald Welte735dd072017-12-12 14:55:17 +01001120 /* For some reason the TTCN-3 RAW codec cannot automatically figure out the IEI
1121 * that it needs to set for a given union-choice (body). So we have to explicitly
1122 * specify the IEI by the caller :( */
Harald Welteefa7d912018-04-18 23:22:15 +02001123 template (value) RSL_IE t_RSL_IE(RSL_IE_Type iei, template (value) RSL_IE_Body body) := {
Harald Welte735dd072017-12-12 14:55:17 +01001124 iei := iei,
Harald Welte643e2a62017-11-27 15:03:18 +01001125 body := body
1126 }
1127
Harald Weltec2877752017-12-07 17:54:35 +01001128 template RSL_IE tr_RSL_IE(template RSL_IE_Body body) := {
1129 iei := ?, /* overwritten? */
1130 body := body
1131 }
1132
1133
Harald Welte643e2a62017-11-27 15:03:18 +01001134 type record of RSL_IE RSL_IE_List;
1135
1136 type record RSL_Message {
1137 RSL_MessageDiscriminator msg_disc,
1138 RSL_MessageType msg_type,
1139 RSL_IE_List ies optional
1140 }
1141
1142 external function enc_RSL_Message(in RSL_Message msg) return octetstring
1143 with { extension "prototype(convert) encode(RAW)" };
1144 external function dec_RSL_Message(in octetstring stream) return RSL_Message
1145 with { extension "prototype(convert) decode(RAW)" };
1146
Harald Weltebc330be2017-12-09 00:56:36 +01001147 template RSL_Message tr_RSL_MsgDiscType(template RSL_MessageDiscriminator m_disc,
Harald Welte643e2a62017-11-27 15:03:18 +01001148 RSL_MessageType m_type) := {
1149 msg_disc := m_disc,
1150 msg_type := m_type,
1151 ies := *
1152 }
1153
Harald Welteefa7d912018-04-18 23:22:15 +02001154 template (value) RSL_Message ts_RSL_MsgDiscType(template (value) RSL_MessageDiscriminator m_disc,
1155 template (value) RSL_MessageType msg_type,
1156 template (omit) RSL_IE_List ies := omit) := {
Harald Welte4a267362017-12-09 17:49:32 +01001157 msg_disc := m_disc,
1158 msg_type := msg_type,
1159 ies := ies
1160 }
1161
Harald Weltebc330be2017-12-09 00:56:36 +01001162template RSL_Message tr_RSL_MsgType(template RSL_MessageType msg_type) := {
1163 msg_disc := ?,
1164 msg_type := msg_type,
1165 ies := *
1166}
1167
1168/* Common Channel Management */
1169template RSL_Message tr_RSL_MsgTypeC(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
1170 msg_disc := { RSL_MDISC_CCHAN, ? }
1171}
1172
1173/* RLL */
1174template RSL_Message tr_RSL_MsgTypeR(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
1175 msg_disc := { RSL_MDISC_RLL, true }
1176}
1177
1178/* Dedicated Channel Management */
1179template RSL_Message tr_RSL_MsgTypeD(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
1180 msg_disc := { RSL_MDISC_DCHAN, ? }
1181}
1182
Vadim Yanitskiybf2aa492022-06-01 00:28:38 +06001183/* TRX Management */
Harald Weltebc330be2017-12-09 00:56:36 +01001184template RSL_Message tr_RSL_MsgTypeT(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
1185 msg_disc := { RSL_MDISC_TRX_MGMT, ? }
1186}
1187
1188
1189/* dedicated channel or RLL */
1190template RSL_Message tr_RSL_MsgTypeDR(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
Harald Weltee5408222018-01-29 21:57:58 +01001191 msg_disc := ({RSL_MDISC_DCHAN,?}, {RSL_MDISC_RLL,?}, {RSL_MDISC_IPACCESS,false})
Harald Weltebc330be2017-12-09 00:56:36 +01001192}
1193
1194
Harald Welte643e2a62017-11-27 15:03:18 +01001195 /* 8.3.1 BSC -> BTS */
Harald Welteefa7d912018-04-18 23:22:15 +02001196 template (value) RSL_Message ts_RSL_DATA_REQ(template (value) RslChannelNr chan_nr,
1197 template (value) RslLinkId link_id,
1198 octetstring l3_info) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001199 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, true),
1200 msg_type := RSL_MT_DATA_REQ,
1201 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001202 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1203 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
1204 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
Harald Welte643e2a62017-11-27 15:03:18 +01001205 }
1206 }
1207
Harald Welte7794d5b2017-12-16 23:00:20 +01001208 template RSL_Message tr_RSL_DATA_REQ(template RslChannelNr chan_nr :=?,
1209 template RslLinkId link_id := ?,
1210 template octetstring l3_info := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001211 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, true),
Harald Welte7794d5b2017-12-16 23:00:20 +01001212 msg_type := RSL_MT_DATA_REQ,
1213 ies :={
1214 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1215 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
1216 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
1217 }
1218 }
1219
1220
Harald Welte643e2a62017-11-27 15:03:18 +01001221 /* 8.3.2 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001222 template (value) RSL_Message ts_RSL_DATA_IND(template (value) RslChannelNr chan_nr,
1223 template (value) RslLinkId link_id,
1224 octetstring l3_info) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001225 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, true),
1226 msg_type := RSL_MT_DATA_IND,
1227 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001228 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1229 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
1230 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
Harald Welte643e2a62017-11-27 15:03:18 +01001231 }
1232 }
Harald Welte9abd1282018-02-19 19:18:17 +01001233 template RSL_Message tr_RSL_DATA_IND(template RslChannelNr chan_nr, template RslLinkId link_id,
1234 template octetstring l3_info := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001235 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, true),
Harald Welte9abd1282018-02-19 19:18:17 +01001236 msg_type := RSL_MT_DATA_IND,
1237 ies :={
1238 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1239 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
1240 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
1241 }
1242 }
Harald Welte643e2a62017-11-27 15:03:18 +01001243
1244 /* 8.3.3 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001245 template (value) RSL_Message ts_RSL_ERROR_IND(template (value) RslChannelNr chan_nr,
Harald Weltea7d81f12019-06-02 22:33:19 +02001246 template (value) RslLinkId link_id,
1247 template (value) octetstring rlm_cause) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001248 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1249 msg_type := RSL_MT_ERROR_IND,
1250 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001251 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1252 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
Harald Weltea7d81f12019-06-02 22:33:19 +02001253 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{rlm_cause := ts_RSL_LV(rlm_cause)})
Harald Welte643e2a62017-11-27 15:03:18 +01001254 }
1255 }
Harald Welte9abd1282018-02-19 19:18:17 +01001256 template RSL_Message tr_RSL_ERROR_IND(template RslChannelNr chan_nr, template RslLinkId link_id,
Harald Weltea7d81f12019-06-02 22:33:19 +02001257 template octetstring rlm_cause := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001258 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001259 msg_type := RSL_MT_ERROR_IND,
1260 ies :={
1261 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1262 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
Harald Weltea7d81f12019-06-02 22:33:19 +02001263 tr_RSL_IE(RSL_IE_Body:{rlm_cause := tr_RSL_LV(rlm_cause)})
Harald Welte9abd1282018-02-19 19:18:17 +01001264 }
1265 }
Harald Welte643e2a62017-11-27 15:03:18 +01001266
Harald Welteefa7d912018-04-18 23:22:15 +02001267 /* 8.3.4 BTS <- BSC */
1268 template (value) RSL_Message ts_RSL_EST_REQ(template (value) RslChannelNr chan_nr,
1269 template (value) RslLinkId link_id) := {
1270 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1271 msg_type := RSL_MT_EST_REQ,
1272 ies := {
1273 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1274 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
1275 }
1276 }
1277 template RSL_Message tr_RSL_EST_REQ(template RslChannelNr chan_nr, template RslLinkId link_id) := {
1278 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
1279 msg_type := RSL_MT_EST_REQ,
1280 ies := {
1281 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1282 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1283 }
1284 }
1285
1286 /* 8.3.5 BTS -> BSC */
1287 template (value) RSL_Message ts_RSL_EST_CONF(template (value) RslChannelNr chan_nr,
1288 template (value) RslLinkId link_id) := {
1289 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1290 msg_type := RSL_MT_EST_CONF,
1291 ies := {
1292 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1293 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
1294 }
1295 }
1296 template RSL_Message tr_RSL_EST_CONF(template RslChannelNr chan_nr, template RslLinkId link_id) := {
1297 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
1298 msg_type := RSL_MT_EST_CONF,
1299 ies := {
1300 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1301 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1302 }
1303 }
1304
Harald Welte643e2a62017-11-27 15:03:18 +01001305 /* 8.3.6 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001306 template (value) RSL_Message ts_RSL_EST_IND(template (value) RslChannelNr chan_nr,
1307 template (value) RslLinkId link_id,
1308 octetstring l3_info) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001309 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1310 msg_type := RSL_MT_EST_IND,
1311 ies := {
Harald Welte735dd072017-12-12 14:55:17 +01001312 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1313 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
1314 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
Harald Welte643e2a62017-11-27 15:03:18 +01001315 }
1316 }
Harald Welte9abd1282018-02-19 19:18:17 +01001317 template RSL_Message tr_RSL_EST_IND(template RslChannelNr chan_nr, template RslLinkId link_id,
1318 template octetstring l3_info := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001319 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001320 msg_type := RSL_MT_EST_IND,
1321 ies := {
1322 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1323 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
1324 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
1325 }
1326 }
Harald Welte0472ab42018-03-12 15:02:26 +01001327 template RSL_Message tr_RSL_EST_IND_NOL3(template RslChannelNr chan_nr, template RslLinkId link_id) :=
1328{
1329 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
1330 msg_type := RSL_MT_EST_IND,
1331 ies := {
1332 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1333 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1334 }
1335 }
1336
Harald Welte643e2a62017-11-27 15:03:18 +01001337
1338 /* 8.3.7 BSC -> BTS */
Harald Welteefa7d912018-04-18 23:22:15 +02001339 template (value) RSL_Message ts_RSL_REL_REQ(template (value) RslChannelNr chan_nr,
Harald Welte0472ab42018-03-12 15:02:26 +01001340 template (value) RslLinkId link_id,
1341 template (value) RSL_IE_ReleaseMode rel_mode := RSL_REL_MODE_NORMAL) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001342 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1343 msg_type := RSL_MT_REL_REQ,
1344 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001345 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
Harald Welte0472ab42018-03-12 15:02:26 +01001346 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
1347 t_RSL_IE(RSL_IE_RELEASE_MODE, RSL_IE_Body:{release_mode := rel_mode})
Harald Welte643e2a62017-11-27 15:03:18 +01001348 }
1349 }
Harald Weltee8a5ab12017-12-09 22:34:57 +01001350 template RSL_Message tr_RSL_REL_REQ(template RslChannelNr chan_nr,
Harald Welte0472ab42018-03-12 15:02:26 +01001351 template RslLinkId link_id,
1352 template RSL_IE_ReleaseMode rel_mode := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001353 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Weltee8a5ab12017-12-09 22:34:57 +01001354 msg_type := RSL_MT_REL_REQ,
1355 ies :={
1356 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1357 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
Harald Welte0472ab42018-03-12 15:02:26 +01001358 tr_RSL_IE(RSL_IE_Body:{release_mode := rel_mode})
Harald Weltee8a5ab12017-12-09 22:34:57 +01001359 }
1360 }
Harald Welte643e2a62017-11-27 15:03:18 +01001361
1362 /* 8.3.8 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001363 template (value) RSL_Message ts_RSL_REL_CONF(template (value) RslChannelNr chan_nr,
1364 template (value) RslLinkId link_id) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001365 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1366 msg_type := RSL_MT_REL_CONF,
1367 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001368 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1369 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
Harald Welte643e2a62017-11-27 15:03:18 +01001370 }
1371 }
Harald Welte9abd1282018-02-19 19:18:17 +01001372 template RSL_Message tr_RSL_REL_CONF(template RslChannelNr chan_nr, template RslLinkId link_id) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001373 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001374 msg_type := RSL_MT_REL_CONF,
1375 ies :={
1376 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1377 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1378 }
1379 }
Harald Welte643e2a62017-11-27 15:03:18 +01001380
1381 /* 8.3.9 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001382 template (value) RSL_Message ts_RSL_REL_IND(template (value) RslChannelNr chan_nr,
1383 template (value) RslLinkId link_id) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001384 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1385 msg_type := RSL_MT_REL_IND,
1386 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001387 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1388 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
Harald Welte643e2a62017-11-27 15:03:18 +01001389 }
1390 }
Harald Welte9abd1282018-02-19 19:18:17 +01001391 template RSL_Message tr_RSL_REL_IND(template RslChannelNr chan_nr, template RslLinkId link_id) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001392 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001393 msg_type := RSL_MT_REL_IND,
1394 ies :={
1395 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1396 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1397 }
1398 }
Harald Welte643e2a62017-11-27 15:03:18 +01001399
1400 /* 8.3.10 BSC -> BTS */
Harald Welteefa7d912018-04-18 23:22:15 +02001401 template (value) RSL_Message ts_RSL_UNITDATA_REQ(template (value) RslChannelNr chan_nr,
1402 template (value) RslLinkId link_id,
1403 octetstring l3_info)
Harald Welte643e2a62017-11-27 15:03:18 +01001404 modifies ts_RSL_DATA_REQ := {
1405 msg_type := RSL_MT_UNIT_DATA_REQ
1406 }
Harald Welte0472ab42018-03-12 15:02:26 +01001407 template RSL_Message tr_RSL_UNITDATA_REQ(template RslChannelNr chan_nr,
1408 template RslLinkId link_id,
Vadim Yanitskiy8f98d3f2018-10-03 17:58:10 +07001409 template octetstring l3_info := ?)
Harald Welte0472ab42018-03-12 15:02:26 +01001410 modifies tr_RSL_DATA_REQ := {
1411 msg_type := RSL_MT_UNIT_DATA_REQ
1412 }
1413
Harald Welte643e2a62017-11-27 15:03:18 +01001414
1415 /* 8.3.11 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001416 template (value) RSL_Message ts_RSL_UNITDATA_IND(template (value) RslChannelNr chan_nr,
1417 template (value) RslLinkId link_id,
1418 octetstring l3_info)
Harald Welte643e2a62017-11-27 15:03:18 +01001419 modifies ts_RSL_DATA_IND := {
1420 msg_type := RSL_MT_UNIT_DATA_IND
1421 }
Harald Welte0472ab42018-03-12 15:02:26 +01001422 template RSL_Message tr_RSL_UNITDATA_IND(template RslChannelNr chan_nr,
Vadim Yanitskiyfabe0f22018-10-03 17:51:47 +07001423 template RslLinkId link_id,
Vadim Yanitskiy8f98d3f2018-10-03 17:58:10 +07001424 template octetstring l3_info := ?)
Harald Welte0472ab42018-03-12 15:02:26 +01001425 modifies tr_RSL_DATA_IND := {
1426 msg_type := RSL_MT_UNIT_DATA_IND
1427 }
1428
1429
Harald Welte643e2a62017-11-27 15:03:18 +01001430
1431
1432 /* DEDICATED CANNEL MANAGEMENT MESSAGES */
1433
1434 /* 8.4.1 BSC -> BTS */
Harald Welteefa7d912018-04-18 23:22:15 +02001435 template (value) RSL_Message ts_RSL_CHAN_ACT(template (value) RslChannelNr chan_nr,
Harald Welte921f9e02019-05-19 22:27:11 +02001436 template (value) RSL_IE_ChannelMode mode,
1437 template (value) RSL_IE_ActivationType at := t_RSL_IE_ActType_IA) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001438 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1439 msg_type := RSL_MT_CHAN_ACTIV,
1440 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001441 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
Harald Welte921f9e02019-05-19 22:27:11 +02001442 t_RSL_IE(RSL_IE_ACT_TYPE, RSL_IE_Body:{act_type := at}),
Harald Welte735dd072017-12-12 14:55:17 +01001443 t_RSL_IE(RSL_IE_CHAN_MODE, RSL_IE_Body:{chan_mode := mode})
Harald Welte643e2a62017-11-27 15:03:18 +01001444 /* lots of optional IEs */
1445 }
1446 }
Harald Welte94e0c342018-04-07 11:33:23 +02001447 template RSL_Message tr_RSL_CHAN_ACT(template RslChannelNr chan_nr,
Harald Welte921f9e02019-05-19 22:27:11 +02001448 template RSL_IE_ChannelMode mode,
1449 template (value) RSL_IE_ActivationType at := t_RSL_IE_ActType_IA) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001450 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte94e0c342018-04-07 11:33:23 +02001451 msg_type := RSL_MT_CHAN_ACTIV,
1452 ies :={
1453 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
Harald Welte921f9e02019-05-19 22:27:11 +02001454 tr_RSL_IE(RSL_IE_Body:{act_type := at}),
Harald Welte94e0c342018-04-07 11:33:23 +02001455 tr_RSL_IE(RSL_IE_Body:{chan_mode := mode}),
1456 /* lots of optional IEs */
1457 *
1458 }
1459 }
Vadim Yanitskiy58b16532021-10-09 20:27:39 +06001460
1461 template (value) RSL_Message
1462 ts_RSL_CHAN_ACT_PDCH(template (value) RslChannelNr chan_nr) := {
1463 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1464 msg_type := RSL_MT_CHAN_ACTIV,
1465 ies :={
1466 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1467 t_RSL_IE(RSL_IE_ACT_TYPE, RSL_IE_Body:{act_type := c_RSL_IE_ActType_PDCH})
1468 }
1469 }
1470 template RSL_Message
1471 tr_RSL_CHAN_ACT_PDCH(template (present) RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001472 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte94e0c342018-04-07 11:33:23 +02001473 msg_type := RSL_MT_CHAN_ACTIV,
1474 ies :={
1475 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
Vadim Yanitskiy58b16532021-10-09 20:27:39 +06001476 tr_RSL_IE(RSL_IE_Body:{act_type := c_RSL_IE_ActType_PDCH}),
Harald Welte94e0c342018-04-07 11:33:23 +02001477 /* lots of optional IEs */
1478 *
1479 }
1480 }
1481
Harald Welte643e2a62017-11-27 15:03:18 +01001482
1483 /* 8.4.2 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001484 template (value) RSL_Message ts_RSL_CHAN_ACT_ACK(template (value) RslChannelNr chan_nr,
1485 GsmFrameNumber fn) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001486 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1487 msg_type := RSL_MT_CHAN_ACTIV_ACK,
1488 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001489 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1490 t_RSL_IE(RSL_IE_FRAME_NUMBER, RSL_IE_Body:{frame_nr := ts_RSL_IE_FrameNumber(fn)})
Harald Welte643e2a62017-11-27 15:03:18 +01001491 }
1492 }
Harald Welte9abd1282018-02-19 19:18:17 +01001493 template RSL_Message tr_RSL_CHAN_ACT_ACK(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001494 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001495 msg_type := RSL_MT_CHAN_ACTIV_ACK,
1496 ies := {
1497 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1498 tr_RSL_IE(RSL_IE_Body:{frame_nr := ?})
1499 }
1500 }
Harald Welte643e2a62017-11-27 15:03:18 +01001501
1502 /* 8.4.3 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001503 template (value) RSL_Message ts_RSL_CHAN_ACT_NACK(template (value) RslChannelNr chan_nr,
1504 RSL_Cause cause) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001505 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1506 msg_type := RSL_MT_CHAN_ACTIV_NACK,
1507 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001508 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1509 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
Harald Welte643e2a62017-11-27 15:03:18 +01001510 }
1511 }
Harald Welte9abd1282018-02-19 19:18:17 +01001512 template RSL_Message tr_RSL_CHAN_ACT_NACK(template RslChannelNr chan_nr,
1513 template RSL_Cause cause := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001514 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001515 msg_type := RSL_MT_CHAN_ACTIV_NACK,
1516 ies := {
1517 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1518 tr_RSL_IE(RSL_IE_Body:{cause := ?})
1519 }
1520 }
Harald Welte643e2a62017-11-27 15:03:18 +01001521
1522 /* 8.4.4 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001523 template (value) RSL_Message ts_RSL_CONN_FAIL_IND(RslChannelNr chan_nr, RSL_Cause cause) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001524 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1525 msg_type := RSL_MT_CONN_FAIL,
1526 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001527 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1528 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
Harald Welte643e2a62017-11-27 15:03:18 +01001529 }
1530 }
Harald Welte9abd1282018-02-19 19:18:17 +01001531 template RSL_Message tr_RSL_CONN_FAIL_IND(template RslChannelNr chan_nr,
1532 template RSL_Cause cause := ?) := {
1533 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1534 msg_type := RSL_MT_CONN_FAIL,
1535 ies :={
1536 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1537 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
1538 }
1539 }
Harald Welte643e2a62017-11-27 15:03:18 +01001540
Harald Weltee8a5ab12017-12-09 22:34:57 +01001541 /* 8.4.5 BSC -> BTS */
1542 template RSL_Message tr_RSL_DEACT_SACCH(template RslChannelNr chan_nr) := {
1543 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1544 msg_type := RSL_MT_DEACTIVATE_SACCH,
1545 ies := {
1546 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
1547 }
1548 }
Harald Welteefa7d912018-04-18 23:22:15 +02001549 template (value) RSL_Message ts_RSL_DEACT_SACCH(template (value) RslChannelNr chan_nr) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001550 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1551 msg_type := RSL_MT_DEACTIVATE_SACCH,
1552 ies := {
1553 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1554 }
1555 }
1556
Harald Weltee8a5ab12017-12-09 22:34:57 +01001557
Harald Welte73cd2712017-12-17 00:44:52 +01001558 /* 8.4.6 BSC ->BTS */
1559 template RSL_Message tr_RSL_ENCR_CMD(template RslChannelNr chan_nr,
1560 template RslLinkId link_id := ?,
Harald Weltee613f962018-04-18 22:38:16 +02001561 template RSL_AlgId alg := ?,
Harald Welte73cd2712017-12-17 00:44:52 +01001562 template octetstring key := ?,
1563 template octetstring l3_info := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001564 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte73cd2712017-12-17 00:44:52 +01001565 msg_type := RSL_MT_ENCR_CMD,
1566 ies := {
1567 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1568 tr_RSL_IE(RSL_IE_Body:{encr_info := tr_RSL_IE_EncrInfo(alg, key)}),
1569 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
1570 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
1571 }
1572 }
Harald Welteefa7d912018-04-18 23:22:15 +02001573 template (value) RSL_Message ts_RSL_ENCR_CMD(template (value) RslChannelNr chan_nr,
1574 template (value) RslLinkId link_id,
Harald Weltee613f962018-04-18 22:38:16 +02001575 template (value) RSL_AlgId alg, octetstring key,
Harald Welteefa7d912018-04-18 23:22:15 +02001576 octetstring l3_info) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001577 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1578 msg_type := RSL_MT_ENCR_CMD,
1579 ies := {
1580 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
Harald Welteefa7d912018-04-18 23:22:15 +02001581 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 +01001582 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
Harald Welteefa7d912018-04-18 23:22:15 +02001583 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
Harald Welte9abd1282018-02-19 19:18:17 +01001584 }
1585 }
Harald Welte73cd2712017-12-17 00:44:52 +01001586
Harald Welte2691adf2018-02-22 17:32:39 +01001587 template RSL_Message tr_RSL_MEAS_RES(template RslChannelNr chan_nr,
1588 template uint8_t meas_res_nr := ?,
1589 template RSL_IE_UplinkMeas ul_meas := ?,
1590 template RSL_IE_BS_Power bs_power := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001591 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte2691adf2018-02-22 17:32:39 +01001592 msg_type := RSL_MT_MEAS_RES,
1593 ies := {
1594 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1595 tr_RSL_IE(RSL_IE_Body:{meas_res_nr := meas_res_nr}),
1596 tr_RSL_IE(RSL_IE_Body:{uplink_meas := ul_meas}),
1597 tr_RSL_IE(RSL_IE_Body:{bs_power := bs_power}),
1598 *
1599 }
1600 }
1601
Vadim Yanitskiy7c29c4e2022-06-18 03:07:50 +07001602 /* Templates for a measurement report that lacks the measurement report
Philipp Maierdd841d32019-12-17 14:44:54 +01001603 * from the MS (l1_info, l3_info and ms timing offset */
Vadim Yanitskiy7c29c4e2022-06-18 03:07:50 +07001604 template (value) RSL_Message
1605 ts_RSL_MEAS_RES_EMPTY(template (value) RslChannelNr chan_nr,
1606 template (value) uint8_t meas_res_nr,
1607 template (value) RSL_IE_UplinkMeas ul_meas,
1608 template (value) RSL_IE_BS_Power bs_power) := {
1609 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1610 msg_type := RSL_MT_MEAS_RES,
1611 ies := {
1612 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1613 t_RSL_IE(RSL_IE_MEAS_RES_NR, RSL_IE_Body:{meas_res_nr := meas_res_nr}),
1614 t_RSL_IE(RSL_IE_UPLINK_MEAS, RSL_IE_Body:{uplink_meas := ul_meas}),
1615 t_RSL_IE(RSL_IE_BS_POWER, RSL_IE_Body:{bs_power := bs_power})
1616 }
1617 }
1618 template RSL_Message
1619 tr_RSL_MEAS_RES_EMPTY(template (present) RslChannelNr chan_nr,
1620 template uint8_t meas_res_nr := ?,
1621 template RSL_IE_UplinkMeas ul_meas := ?,
1622 template RSL_IE_BS_Power bs_power := ?) := {
Philipp Maierdd841d32019-12-17 14:44:54 +01001623 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1624 msg_type := RSL_MT_MEAS_RES,
1625 ies := {
1626 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1627 tr_RSL_IE(RSL_IE_Body:{meas_res_nr := meas_res_nr}),
1628 tr_RSL_IE(RSL_IE_Body:{uplink_meas := ul_meas}),
1629 tr_RSL_IE(RSL_IE_Body:{bs_power := bs_power})
1630 }
1631 }
1632
Harald Welte39b47be2018-02-23 18:58:48 +01001633 /* Osmocom specific template, require lots of optional fields to be present */
1634 template RSL_Message tr_RSL_MEAS_RES_OSMO(template RslChannelNr chan_nr,
1635 template uint8_t meas_res_nr := ?,
1636 template RSL_IE_UplinkMeas ul_meas := ?,
1637 template RSL_IE_BS_Power bs_power := ?,
1638 template RSL_IE_L1Info l1_info := ?,
1639 template octetstring l3_info := ?,
1640 template uint8_t ms_to := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001641 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte39b47be2018-02-23 18:58:48 +01001642 msg_type := RSL_MT_MEAS_RES,
1643 ies := {
1644 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1645 tr_RSL_IE(RSL_IE_Body:{meas_res_nr := meas_res_nr}),
1646 tr_RSL_IE(RSL_IE_Body:{uplink_meas := ul_meas}),
1647 tr_RSL_IE(RSL_IE_Body:{bs_power := bs_power}),
1648 tr_RSL_IE(RSL_IE_Body:{l1_info := l1_info}),
1649 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)}),
1650 tr_RSL_IE(RSL_IE_Body:{ms_timing_offset := ms_to})
1651 }
1652 }
1653
Neels Hofmeyrafe2ea52021-11-24 15:16:12 +01001654 template (value) RSL_Message ts_RSL_MEAS_RES(template (value) RslChannelNr chan_nr,
1655 uint8_t meas_res_nr,
1656 template (value) RSL_IE_UplinkMeas ul_meas,
1657 template (value) RSL_IE_BS_Power bs_power,
1658 template (value) RSL_IE_L1Info l1_info,
1659 octetstring l3_info,
1660 uint8_t ms_to) := {
1661 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1662 msg_type := RSL_MT_MEAS_RES,
1663 ies := {
1664 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1665 t_RSL_IE(RSL_IE_MEAS_RES_NR, RSL_IE_Body:{meas_res_nr := meas_res_nr}),
1666 t_RSL_IE(RSL_IE_UPLINK_MEAS, RSL_IE_Body:{uplink_meas := ul_meas}),
1667 t_RSL_IE(RSL_IE_BS_POWER, RSL_IE_Body:{bs_power := bs_power}),
1668 t_RSL_IE(RSL_IE_L1_INFO, RSL_IE_Body:{l1_info := l1_info}),
1669 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)}),
1670 t_RSL_IE(RSL_IE_MS_TIMING_OFFSET, RSL_IE_Body:{ms_timing_offset := ms_to})
1671 }
1672 }
1673
Eric Wildf1827a72019-05-28 17:37:35 +02001674 /* 8.4.9 BSC -> BTS */
1675 template (value) RSL_Message ts_RSL_MODE_MODIFY_REQ(template (value) RslChannelNr chan_nr,
1676 template (value) RSL_IE_ChannelMode mode) := {
1677 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1678 msg_type := RSL_MT_MODE_MODIFY_REQ,
1679 ies :={
1680 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1681 t_RSL_IE(RSL_IE_CHAN_MODE, RSL_IE_Body:{chan_mode := mode})
1682 /* lots of optional IEs */
1683 }
1684 }
1685 template RSL_Message tr_RSL_MODE_MODIFY_REQ(template RslChannelNr chan_nr,
1686 template RSL_IE_ChannelMode mode) := {
1687 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1688 msg_type := RSL_MT_MODE_MODIFY_REQ,
1689 ies :={
1690 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1691 tr_RSL_IE(RSL_IE_Body:{chan_mode := mode}),
1692 /* lots of optional IEs */
1693 *
1694 }
1695 }
Neels Hofmeyr9f3e6ac2021-04-08 23:09:24 +02001696
1697 template RSL_Message tr_RSL_MODE_MODIFY_REQ_with_OSMO_TSC(template RslChannelNr chan_nr,
1698 template RSL_IE_ChannelMode mode,
1699 template uint8_t tsc_set := ?,
1700 template uint8_t tsc := ?) := {
1701 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1702 msg_type := RSL_MT_MODE_MODIFY_REQ,
1703 ies := {
1704 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1705 tr_RSL_IE(RSL_IE_Body:{chan_mode := mode}),
1706 tr_RSL_IE(RSL_IE_Body:{osmo_training_sequence := {
1707 len := ?,
1708 tsc_set := tsc_set,
1709 tsc := tsc
1710 }
1711 })
1712 }
1713 };
Pau Espin Pedrol85393122022-09-02 17:56:25 +02001714
Harald Welte7794d5b2017-12-16 23:00:20 +01001715 /* 8.4.10 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001716 template (value) RSL_Message ts_RSL_MODE_MODIFY_ACK(template (value) RslChannelNr chan_nr) := {
Harald Welte7794d5b2017-12-16 23:00:20 +01001717 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1718 msg_type := RSL_MT_MODE_MODIFY_ACK,
1719 ies := {
1720 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1721 }
1722 }
Harald Welte9abd1282018-02-19 19:18:17 +01001723 template RSL_Message tr_RSL_MODE_MODIFY_ACK(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001724 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001725 msg_type := RSL_MT_MODE_MODIFY_ACK,
1726 ies := {
1727 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
1728 }
1729 }
Harald Welte7794d5b2017-12-16 23:00:20 +01001730
Harald Welte643e2a62017-11-27 15:03:18 +01001731 /* 8.4.11 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001732 template (value) RSL_Message ts_RSL_MODE_MODIFY_NACK(template (value) RslChannelNr chan_nr,
1733 RSL_Cause cause) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001734 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1735 msg_type := RSL_MT_MODE_MODIFY_NACK,
1736 ies := {
1737 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1738 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
1739 }
Harald Welte643e2a62017-11-27 15:03:18 +01001740 }
Harald Welte9abd1282018-02-19 19:18:17 +01001741 template RSL_Message tr_RSL_MODE_MODIFY_NACK(template RslChannelNr chan_nr,
1742 template RSL_Cause cause) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001743 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001744 msg_type := RSL_MT_MODE_MODIFY_NACK,
1745 ies := {
1746 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1747 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
1748 }
1749 }
1750
Harald Welte643e2a62017-11-27 15:03:18 +01001751
Harald Welte6a8199d2018-01-29 21:58:53 +01001752 /* 8.4.14: BTS <- BSC */
1753 template RSL_Message tr_RSL_RF_CHAN_REL(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001754 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte6a8199d2018-01-29 21:58:53 +01001755 msg_type := RSL_MT_RF_CHAN_REL,
1756 ies := {
1757 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
1758 }
1759 }
Harald Welteefa7d912018-04-18 23:22:15 +02001760 template (value) RSL_Message ts_RSL_RF_CHAN_REL(template (value) RslChannelNr chan_nr) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001761 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1762 msg_type := RSL_MT_RF_CHAN_REL,
1763 ies := {
1764 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1765 }
1766 }
Harald Welte6a8199d2018-01-29 21:58:53 +01001767
Philipp Maier4d1e9c92018-12-20 11:11:56 +01001768 /* 8.4.15: BTS <- BSC */
1769 template (value) RSL_Message ts_RSL_MS_PWR_CTRL(template (value) RslChannelNr chan_nr,
1770 template (value) RSL_IE_MS_Power ms_power) := {
1771 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1772 msg_type := RSL_MT_MS_POWER_CONTROL,
1773 ies := {
1774 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1775 t_RSL_IE(RSL_IE_MS_POWER, RSL_IE_Body:{ms_power := ms_power})
1776 /* One optional IE: MS POWER PARAMETERS */
1777 }
1778 }
1779
Eric Wild61edb7e2019-06-03 12:38:31 +02001780 template (value) RSL_Message ts_RSL_MS_PWR_CTRL_with_pp(template (value) RslChannelNr chan_nr,
1781 integer pwr_level) := {
1782 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1783 msg_type := RSL_MT_MS_POWER_CONTROL,
1784 ies := {
1785 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1786 t_RSL_IE(RSL_IE_MS_POWER, RSL_IE_Body:{ms_power := ts_RSL_IE_MS_Power(pwr_level)}),
1787 t_RSL_IE(RSL_IE_MS_POWER_PARAM, RSL_IE_Body:{ms_power_params :=
1788 ts_RSL_IE_MS_Power_Parameters(''O)})
1789 }
1790 }
1791
Eric Wildae8f2622019-06-18 17:05:11 +02001792 /* 8.4.16: BTS <- BSC */
1793 template (value) RSL_Message ts_RSL_BS_PWR_CTRL(template (value) RslChannelNr chan_nr,
1794 template (value) RSL_IE_BS_Power bs_power) := {
1795 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1796 msg_type := RSL_MT_BS_POWER_CONTROL,
1797 ies := {
1798 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1799 t_RSL_IE(RSL_IE_BS_POWER, RSL_IE_Body:{bs_power := bs_power})
1800 /* One optional IE: BS POWER PARAMETERS */
1801 }
1802 }
Vadim Yanitskiy2a5a1ef2021-06-30 00:51:48 +02001803 template RSL_Message tr_RSL_BS_PWR_CTRL(template (present) RslChannelNr chan_nr,
1804 template (present) RSL_IE_BS_Power bs_power) := {
1805 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1806 msg_type := RSL_MT_BS_POWER_CONTROL,
1807 ies := {
1808 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1809 tr_RSL_IE(RSL_IE_Body:{bs_power := bs_power})
1810 /* One optional IE: BS POWER PARAMETERS */
1811 }
1812 }
Eric Wildae8f2622019-06-18 17:05:11 +02001813
Harald Welte4a267362017-12-09 17:49:32 +01001814 /* 8.4.19 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001815 template (value) RSL_Message ts_RSL_RF_CHAN_REL_ACK(template (value) RslChannelNr chan_nr) :=
Harald Welte4a267362017-12-09 17:49:32 +01001816 ts_RSL_MsgDiscType(ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1817 RSL_MT_RF_CHAN_REL_ACK,
Harald Welte735dd072017-12-12 14:55:17 +01001818 { t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}) });
Harald Welte4a267362017-12-09 17:49:32 +01001819
Harald Welte9abd1282018-02-19 19:18:17 +01001820 template RSL_Message tr_RSL_RF_CHAN_REL_ACK(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001821 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001822 msg_type := RSL_MT_RF_CHAN_REL_ACK,
1823 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001824 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
Harald Welte9abd1282018-02-19 19:18:17 +01001825 }
1826 }
1827
Harald Welteea17b912018-03-11 22:29:31 +01001828 /* 8.6.20 BTS <- BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001829 template (value) RSL_Message ts_RSL_SACCH_INF_MOD(template (value) RslChannelNr chan_nr,
1830 RSL_IE_SysinfoType si_type,
1831 octetstring l3_info) := {
Harald Welteea17b912018-03-11 22:29:31 +01001832 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1833 msg_type := RSL_MT_SACCH_INFO_MODIFY,
1834 ies := {
1835 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1836 t_RSL_IE(RSL_IE_SYSINFO_TYPE, RSL_IE_Body:{sysinfo_type := si_type}),
1837 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
1838 }
1839 }
1840
Neels Hofmeyr378a49c2018-06-15 22:18:43 +02001841 /* 8.4.7 BTS -> BSC */
1842 template (value) RSL_Message ts_RSL_HANDO_DET(template (value) RslChannelNr chan_nr) := {
1843 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1844 msg_type := RSL_MT_HANDO_DET,
1845 ies := {
1846 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1847 }
1848 }
Vadim Yanitskiy7c2c10c2019-05-31 20:42:01 +07001849 template RSL_Message tr_RSL_HANDO_DET(template RslChannelNr chan_nr,
1850 template uint8_t acc_delay := ?) := {
1851 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1852 msg_type := RSL_MT_HANDO_DET,
1853 ies := {
1854 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1855 tr_RSL_IE(RSL_IE_Body:{access_delay := acc_delay})
1856 }
1857 }
Neels Hofmeyr378a49c2018-06-15 22:18:43 +02001858
Harald Welteea17b912018-03-11 22:29:31 +01001859
Harald Welte643e2a62017-11-27 15:03:18 +01001860 /* COMMON CHANNEL MANAGEMENT MESSAGES */
1861
Harald Welte874c2232018-02-24 04:52:43 +01001862 /* 8.5.1 BTS <- BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001863 template (value) RSL_Message ts_RSL_BCCH_INFO(RSL_IE_SysinfoType si_type,
1864 octetstring full_bcch_info) := {
Harald Welte874c2232018-02-24 04:52:43 +01001865 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1866 msg_type := RSL_MT_BCCH_INFO,
1867 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001868 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_BCCH(0)}),
Harald Welte874c2232018-02-24 04:52:43 +01001869 t_RSL_IE(RSL_IE_SYSINFO_TYPE, RSL_IE_Body:{sysinfo_type := si_type}),
1870 t_RSL_IE(RSL_IE_FULL_BCCH_INFO, RSL_IE_Body:{other := ts_RSL_LV(full_bcch_info)})
1871 }
1872 }
Harald Welte09538f82019-08-01 09:50:25 +02001873 template RSL_Message tr_RSL_NO_BCCH_INFO(template RSL_IE_SysinfoType si_type := ?) := {
1874 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1875 msg_type := RSL_MT_BCCH_INFO,
1876 ies := {
1877 tr_RSL_IE(RSL_IE_Body:{chan_nr := ts_RslChanNr_BCCH(0)}),
1878 tr_RSL_IE(RSL_IE_Body:{sysinfo_type := si_type})
1879 }
1880 }
1881 template RSL_Message tr_RSL_BCCH_INFO(template RSL_IE_SysinfoType si_type := ?,
1882 template octetstring full_bcch_info := ?) := {
1883 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1884 msg_type := RSL_MT_BCCH_INFO,
1885 ies := {
1886 tr_RSL_IE(RSL_IE_Body:{chan_nr := ts_RslChanNr_BCCH(0)}),
1887 tr_RSL_IE(RSL_IE_Body:{sysinfo_type := si_type}),
1888 tr_RSL_IE(RSL_IE_Body:{other := tr_RSL_LV(full_bcch_info)}),
1889 *
1890 }
1891 }
Harald Welte874c2232018-02-24 04:52:43 +01001892
Harald Welte7ae93142017-12-07 17:56:15 +01001893 /* 8.5.2 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001894 template (value) RSL_Message ts_RSL_RACH_LOAD_IND(uint16_t slot_ct, uint16_t busy_ct,
1895 uint16_t acc_ct) := {
Harald Welte7ae93142017-12-07 17:56:15 +01001896 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1897 msg_type := RSL_MT_CCCH_LOAD_IND,
1898 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001899 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_RACH(0)}),
Harald Welte735dd072017-12-12 14:55:17 +01001900 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 +01001901 }
1902 }
Harald Welte68e495b2018-02-25 00:05:57 +01001903 template RSL_Message tr_RSL_RACH_LOAD_IND(template uint16_t slot_ct := ?,
1904 template uint16_t busy_ct := ?,
Harald Welte09538f82019-08-01 09:50:25 +02001905 template uint16_t acc_ct := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001906 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Welte68e495b2018-02-25 00:05:57 +01001907 msg_type := RSL_MT_CCCH_LOAD_IND,
1908 ies := {
1909 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_RACH(0)}),
1910 tr_RSL_IE(RSL_IE_Body:{rach_load := tr_RSL_IE_RachLoad(slot_ct, busy_ct, acc_ct)})
1911 }
1912 }
1913
Harald Welteefa7d912018-04-18 23:22:15 +02001914 template (value) RSL_Message ts_RSL_PAGING_LOAD_IND(uint16_t buffer_space) := {
Harald Welte7ae93142017-12-07 17:56:15 +01001915 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1916 msg_type := RSL_MT_CCCH_LOAD_IND,
1917 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001918 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_PCH_AGCH(0)}),
Harald Welte735dd072017-12-12 14:55:17 +01001919 t_RSL_IE(RSL_IE_PAGING_LOAD, RSL_IE_Body:{paging_load := buffer_space})
Harald Welte7ae93142017-12-07 17:56:15 +01001920 }
1921 }
Harald Welte68e495b2018-02-25 00:05:57 +01001922 template RSL_Message tr_RSL_PAGING_LOAD_IND(template uint16_t buffer_space := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001923 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Welte68e495b2018-02-25 00:05:57 +01001924 msg_type := RSL_MT_CCCH_LOAD_IND,
1925 ies := {
1926 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(0)}),
1927 tr_RSL_IE(RSL_IE_Body:{paging_load := buffer_space})
1928 }
1929 }
1930
Harald Welte7ae93142017-12-07 17:56:15 +01001931
Harald Welte643e2a62017-11-27 15:03:18 +01001932 /* 8.5.3 BTS -> BSC */
Vadim Yanitskiyab448a52019-05-31 20:24:03 +07001933 template (value) RSL_Message ts_RSL_CHAN_RQD(OCT1 ra, GsmFrameNumber fn,
1934 template (value) RslChannelNr chan_nr := ts_RslChanNr_RACH(0),
1935 uint8_t acc_del := 0) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001936 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1937 msg_type := RSL_MT_CHAN_RQD,
1938 ies := {
Vadim Yanitskiyab448a52019-05-31 20:24:03 +07001939 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1940 /* TODO: we may need to have optional RSL_IE_LINK_IDENT IE here */
Harald Welte735dd072017-12-12 14:55:17 +01001941 t_RSL_IE(RSL_IE_REQ_REFERENCE, RSL_IE_Body:{req_ref := ts_RSL_IE_ReqRef(ra, fn)}),
1942 t_RSL_IE(RSL_IE_ACCESS_DELAY, RSL_IE_Body:{access_delay := acc_del})
Harald Welte643e2a62017-11-27 15:03:18 +01001943 }
1944 }
Harald Welte9abd1282018-02-19 19:18:17 +01001945 template RSL_Message tr_RSL_CHAN_RQD(template OCT1 ra, template GsmFrameNumber fn := ?,
Vadim Yanitskiyab448a52019-05-31 20:24:03 +07001946 template RslChannelNr chan_nr := ts_RslChanNr_RACH(0),
1947 template uint8_t acc_del := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001948 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001949 msg_type := RSL_MT_CHAN_RQD,
1950 ies := {
Vadim Yanitskiyab448a52019-05-31 20:24:03 +07001951 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1952 /* TODO: we may need to have optional RSL_IE_LINK_IDENT IE here */
Harald Welte9abd1282018-02-19 19:18:17 +01001953 tr_RSL_IE(RSL_IE_Body:{req_ref := tr_RSL_IE_ReqRef(ra, fn)}),
1954 tr_RSL_IE(RSL_IE_Body:{access_delay := acc_del})
1955 }
1956 }
Harald Welte643e2a62017-11-27 15:03:18 +01001957
1958 /* 8.5.4 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001959 template (value) RSL_Message ts_DELETE_IND(template (value) RslChannelNr chan_nr,
1960 octetstring imm_ass) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001961 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1962 msg_type := RSL_MT_DELETE_IND,
1963 ies := {
Harald Welte735dd072017-12-12 14:55:17 +01001964 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1965 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 +01001966 }
1967 }
Harald Weltee8d750e2018-06-10 21:41:35 +02001968 template RSL_Message tr_RSL_DELETE_IND(template octetstring imm_ass := ?, template uint3_t tn) := {
1969 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1970 msg_type := RSL_MT_DELETE_IND,
1971 ies := {
1972 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(tn)}),
1973 tr_RSL_IE(RSL_IE_Body:{full_imm_ass_info := tr_RSL_LV(imm_ass)}),
1974 *
1975 }
1976 }
Harald Welte643e2a62017-11-27 15:03:18 +01001977
Harald Weltec2877752017-12-07 17:54:35 +01001978 /* 8.5.5 BSC -> BTS */
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +07001979 template RSL_Message tr_RSL_PAGING_CMD(template MobileIdentityV mi, template uint3_t tn := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001980 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Weltec2877752017-12-07 17:54:35 +01001981 msg_type := RSL_MT_PAGING_CMD,
1982 ies := {
1983 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(tn)}),
1984 tr_RSL_IE(RSL_IE_Body:{paging_group := ?}),
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +07001985 tr_RSL_IE(RSL_IE_Body:{ms_identity := tr_MI_LV(mi)}),
Harald Weltec2877752017-12-07 17:54:35 +01001986 * /* opt: channel needed, eMLPP prio */
1987 }
1988 }
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +07001989 template (value) RSL_Message ts_RSL_PAGING_CMD(MobileIdentityV mi, uint8_t pg, uint3_t tn := 0) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001990 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1991 msg_type := RSL_MT_PAGING_CMD,
1992 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001993 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_PCH_AGCH(tn)}),
Harald Welte9abd1282018-02-19 19:18:17 +01001994 t_RSL_IE(RSL_IE_PAGING_GROUP, RSL_IE_Body:{paging_group := pg}),
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +07001995 t_RSL_IE(RSL_IE_MS_IDENTITY, RSL_IE_Body:{ms_identity := ts_MI_LV(mi)})
Harald Welte9abd1282018-02-19 19:18:17 +01001996 }
1997 }
Harald Weltec2877752017-12-07 17:54:35 +01001998
1999 /* 8.5.6 BSC -> BTS */
2000 template RSL_Message tr_RSL_IMM_ASSIGN(template uint3_t tn := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002001 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Weltec2877752017-12-07 17:54:35 +01002002 msg_type := RSL_MT_IMMEDIATE_ASSIGN_CMD,
2003 ies := {
2004 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(tn)}),
2005 tr_RSL_IE(RSL_IE_Body:{full_imm_ass_info := ?})
2006 }
2007 }
Harald Welteefa7d912018-04-18 23:22:15 +02002008 template (value) RSL_Message ts_RSL_IMM_ASSIGN(octetstring f_ass_inf, uint3_t tn := 0) := {
Harald Welte9abd1282018-02-19 19:18:17 +01002009 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2010 msg_type := RSL_MT_IMMEDIATE_ASSIGN_CMD,
2011 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02002012 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_PCH_AGCH(tn)}),
Harald Welte9abd1282018-02-19 19:18:17 +01002013 t_RSL_IE(RSL_IE_FULL_IMM_ASS_INFO, RSL_IE_Body:{full_imm_ass_info := ts_RSL_LV(f_ass_inf)})
2014 }
2015 }
Harald Weltec2877752017-12-07 17:54:35 +01002016
Harald Weltecc373202018-09-10 10:28:21 +02002017 /* 8.5.8 BTS <- BSC SMS BROADCAST COMMAND */
2018 template RSL_Message tr_RSL_SMSCB_CMD(template RSL_IE_CbCommandType cb_cmd := ?,
2019 template octetstring msg := ?,
2020 template RslChannelNr chan_nr := ?) := {
2021 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2022 msg_type := RSL_MT_SMS_BC_CMD,
2023 ies := {
2024 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2025 tr_RSL_IE(RSL_IE_Body:{cb_cmd_type := cb_cmd}),
2026 tr_RSL_IE(RSL_IE_Body:{smscb_message := tr_RSL_LV(msg)}),
2027 *
2028 }
2029 }
2030 template (value) RSL_Message ts_RSL_SMSCB_CMD(template (value) RSL_IE_CbCommandType cb_cmd,
2031 template (value) octetstring msg,
2032 template (value) RslChannelNr chan_nr :=
2033 ts_RslChanNr_SDCCH4(0, 2)) := {
2034 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2035 msg_type := RSL_MT_SMS_BC_CMD,
2036 ies := {
2037 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2038 t_RSL_IE(RSL_IE_CB_CMD_TYPE, RSL_IE_Body:{cb_cmd_type := cb_cmd}),
2039 t_RSL_IE(RSL_IE_SMSCB_MSG, RSL_IE_Body:{smscb_message := ts_RSL_LV(msg)})
2040 /* optional channel type for extended CBCH */
2041 }
2042 }
2043
Harald Welte4a129f82019-05-21 16:35:22 +02002044 /* 8.5.9 BTS -> BSC CBCH LOAD INDICATION */
2045 template RSL_Message tr_RSL_CBCH_LOAD_IND_BASIC(template boolean overflow := ?,
2046 template uint4_t slot_count := ?,
2047 template RslChannelNr chan_nr := ?) := {
2048 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2049 msg_type := RSL_MT_CBCH_LOAD_IND,
2050 ies := {
2051 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2052 tr_RSL_IE(RSL_IE_Body:{cbch_load_info := tr_CbchLoadInfo(overflow, slot_count)})
2053 }
2054 }
2055 template (value) RSL_Message ts_RSL_CBCH_LOAD_IND_BASIC(boolean overflow, uint4_t slot_count,
2056 template (value) RslChannelNr chan_nr :=
2057 ts_RslChanNr_SDCCH4(0, 2)) := {
2058 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2059 msg_type := RSL_MT_CBCH_LOAD_IND,
2060 ies := {
2061 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2062 t_RSL_IE(RSL_IE_CBCH_LOAD_INFO, RSL_IE_Body:{cbch_load_info := ts_CbchLoadInfo(overflow, slot_count)})
2063 }
2064 }
2065 template RSL_Message tr_RSL_CBCH_LOAD_IND_EXTD(template boolean overflow := ?,
2066 template uint4_t slot_count := ?,
2067 template RslChannelNr chan_nr := ?) := {
2068 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2069 msg_type := RSL_MT_CBCH_LOAD_IND,
2070 ies := {
2071 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2072 tr_RSL_IE(RSL_IE_Body:{cbch_load_info := tr_CbchLoadInfo(overflow, slot_count)}),
2073 tr_RSL_IE(RSL_IE_Body:{smscb_chan_ind := 1})
2074 }
2075 }
2076 template (value) RSL_Message ts_RSL_CBCH_LOAD_IND_EXTD(boolean overflow, uint4_t slot_count,
2077 template (value) RslChannelNr chan_nr :=
2078 ts_RslChanNr_SDCCH4(0, 2)) := {
2079 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2080 msg_type := RSL_MT_CBCH_LOAD_IND,
2081 ies := {
2082 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2083 t_RSL_IE(RSL_IE_CBCH_LOAD_INFO, RSL_IE_Body:{cbch_load_info := ts_CbchLoadInfo(overflow, slot_count)}),
2084 t_RSL_IE(RSL_IE_SMSCB_CHAN_INDICATOR, RSL_IE_Body:{smscb_chan_ind := 1})
2085 }
2086 }
2087
2088
Vadim Yanitskiy9f699532021-06-03 17:29:22 +02002089 /* 8.6.1 BTS -> BSC */
2090 template (value) RSL_Message
2091 ts_RSL_RF_RES_IND(template (value) RSL_ResourceInfo info) := {
2092 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
2093 msg_type := RSL_MT_RF_RES_IND,
2094 ies := {
2095 t_RSL_IE(RSL_IE_RESOURCE_INFO, RSL_IE_Body:{
2096 resource_info := {
2097 len := 0, /* overwritten */
2098 info := info
2099 }
2100 })
2101 }
2102 }
2103 template RSL_Message
2104 tr_RSL_RF_RES_IND(template (present) RSL_ResourceInfo info := ?) := {
2105 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
2106 msg_type := RSL_MT_RF_RES_IND,
2107 ies := {
2108 tr_RSL_IE(RSL_IE_Body:{
2109 resource_info := {
2110 len := ?,
2111 info := info
2112 }
2113 })
2114 }
2115 }
2116
2117
Harald Welte68e495b2018-02-25 00:05:57 +01002118 /* 8.6.2 BTS <- BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02002119 template (value) RSL_Message ts_RSL_SACCH_FILL(RSL_IE_SysinfoType si_type, octetstring l3_info) := {
Harald Welte68e495b2018-02-25 00:05:57 +01002120 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
2121 msg_type := RSL_MT_SACCH_FILL,
2122 ies := {
2123 t_RSL_IE(RSL_IE_SYSINFO_TYPE, RSL_IE_Body:{sysinfo_type := si_type}),
2124 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
2125 }
2126 }
Harald Welte09538f82019-08-01 09:50:25 +02002127 template RSL_Message tr_RSL_NO_SACCH_FILL(template RSL_IE_SysinfoType si_type := ?) := {
2128 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
2129 msg_type := RSL_MT_SACCH_FILL,
2130 ies := {
2131 tr_RSL_IE(RSL_IE_Body:{sysinfo_type := si_type})
2132 }
2133 }
2134 template RSL_Message tr_RSL_SACCH_FILL(template RSL_IE_SysinfoType si_type := ?,
2135 template octetstring l3_info := ?) := {
2136 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
2137 msg_type := RSL_MT_SACCH_FILL,
2138 ies := {
2139 tr_RSL_IE(RSL_IE_Body:{sysinfo_type := si_type}),
2140 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)}),
2141 *
2142 }
2143 }
2144
Harald Welte68e495b2018-02-25 00:05:57 +01002145
Harald Welte643e2a62017-11-27 15:03:18 +01002146 /* 8.6.4 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02002147 template (value) RSL_Message ts_RSL_ERROR_REPORT(RSL_Cause cause) := {
Harald Welte01d982c2018-02-25 01:31:40 +01002148 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
2149 msg_type := RSL_MT_ERROR_REPORT,
Harald Welte643e2a62017-11-27 15:03:18 +01002150 ies := {
Harald Welte735dd072017-12-12 14:55:17 +01002151 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
Harald Welte643e2a62017-11-27 15:03:18 +01002152 }
2153 }
Harald Welte01d982c2018-02-25 01:31:40 +01002154 template RSL_Message tr_RSL_ERROR_REPORT(template RSL_Cause cause := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002155 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
Harald Welte01d982c2018-02-25 01:31:40 +01002156 msg_type := RSL_MT_ERROR_REPORT,
2157 ies := {
2158 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)}),
2159 *
2160 }
2161 }
2162
Harald Welte643e2a62017-11-27 15:03:18 +01002163
Harald Welte9958a4d2017-12-14 21:21:33 +01002164
2165 /* Abis/IP specific messages */
2166
Vadim Yanitskiy1567bac2022-05-01 03:36:24 +03002167 private function f_ts_RSL_IPA_CRCX_IEs(template (value) RslChannelNr chan_nr,
2168 template (omit) OCT4 remote_ip,
Pau Espin Pedrol39bfa022022-08-12 14:56:12 +02002169 template (omit) uint16_t remote_port,
2170 template (omit) uint8_t osmux_cid)
Vadim Yanitskiy1567bac2022-05-01 03:36:24 +03002171 return RSL_IE_List {
2172 var RSL_IE_List ies;
2173
2174 /* Channel Number is a mandatory IE */
2175 ies := {
2176 valueof(RSL_IE:{
2177 iei := RSL_IE_CHAN_NR,
2178 body := { chan_nr := chan_nr }
2179 })
2180 };
2181 /* Remote IP / Port are optional IEs */
2182 if (not istemplatekind(remote_ip, "omit")) {
2183 ies := ies & {
2184 valueof(RSL_IE:{
2185 iei := RSL_IE_IPAC_REMOTE_IP,
2186 body := { ipa_remote_ip := remote_ip }
2187 })
2188 };
2189 }
2190 if (not istemplatekind(remote_port, "omit")) {
2191 ies := ies & {
2192 valueof(RSL_IE:{
2193 iei := RSL_IE_IPAC_REMOTE_PORT,
2194 body := { ipa_remote_port := remote_port }
2195 })
2196 };
2197 }
Pau Espin Pedrol39bfa022022-08-12 14:56:12 +02002198 /* Osmux CID extension IE is optional: */
2199 if (not istemplatekind(osmux_cid, "omit")) {
2200 ies := ies & {
2201 valueof(RSL_IE:{
2202 iei := RSL_IE_OSMO_OSMUX_CID,
2203 body := { osmux_cid := ts_RSL_IE_OSMO_Osmux_CID(osmux_cid) }
2204 })
2205 };
2206 }
Vadim Yanitskiy1567bac2022-05-01 03:36:24 +03002207
2208 return ies;
2209 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002210 template RSL_Message tr_RSL_IPA_CRCX(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002211 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002212 msg_type := RSL_MT_IPAC_CRCX,
2213 ies := {
2214 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2215 *
2216 }
2217 }
Vadim Yanitskiye9141c22021-07-03 01:45:40 +02002218 template (value) RSL_Message
2219 ts_RSL_IPA_CRCX(template (value) RslChannelNr chan_nr,
Vadim Yanitskiy1567bac2022-05-01 03:36:24 +03002220 template (omit) OCT4 remote_ip := omit,
Pau Espin Pedrol39bfa022022-08-12 14:56:12 +02002221 template (omit) uint16_t remote_port := omit,
2222 template (omit) uint8_t osmux_cid := omit) := {
Harald Welte9abd1282018-02-19 19:18:17 +01002223 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2224 msg_type := RSL_MT_IPAC_CRCX,
Pau Espin Pedrol39bfa022022-08-12 14:56:12 +02002225 ies := f_ts_RSL_IPA_CRCX_IEs(chan_nr, remote_ip, remote_port, osmux_cid)
Harald Welte9abd1282018-02-19 19:18:17 +01002226 }
2227
Pau Espin Pedrol29c6dfb2022-08-08 18:37:56 +02002228 function ts_RSL_IPA_CRCX_ACK(template (value) RslChannelNr chan_nr,
2229 uint16_t ipa_conn_id, OCT4 local_ip,
2230 uint16_t local_port, uint7_t rtp_pt2,
2231 template (omit) uint8_t osmux_cid := omit)
2232 return template (value) RSL_Message {
2233 var template (value) RSL_Message msg := {
2234 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2235 msg_type := RSL_MT_IPAC_CRCX_ACK,
2236 ies := {
2237 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2238 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2239 t_RSL_IE(RSL_IE_IPAC_LOCAL_IP, RSL_IE_Body:{ipa_local_ip := local_ip}),
2240 t_RSL_IE(RSL_IE_IPAC_LOCAL_PORT, RSL_IE_Body:{ipa_local_port := local_port}),
2241 t_RSL_IE(RSL_IE_IPAC_RTP_PAYLOAD2, RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
2242 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002243 }
Pau Espin Pedrol29c6dfb2022-08-08 18:37:56 +02002244 if (not istemplatekind(osmux_cid, "omit")) {
2245 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)});
2246 }
2247 return msg;
Harald Welte9958a4d2017-12-14 21:21:33 +01002248 }
Pau Espin Pedrol29c6dfb2022-08-08 18:37:56 +02002249
Pau Espin Pedrol39bfa022022-08-12 14:56:12 +02002250 function tr_RSL_IPA_CRCX_ACK(template RslChannelNr chan_nr,
2251 template uint16_t ipa_conn_id,
2252 template OCT4 local_ip,
2253 template uint16_t local_port,
2254 template uint8_t osmux_cid := omit)
2255 return template RSL_Message {
2256 var template RSL_Message msg := {
2257 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2258 msg_type := RSL_MT_IPAC_CRCX_ACK,
2259 ies := {
2260 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2261 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2262 tr_RSL_IE(RSL_IE_Body:{ipa_local_ip := local_ip}),
2263 tr_RSL_IE(RSL_IE_Body:{ipa_local_port := local_port})
2264 /* Optional: RTP Payload Type 2 IE */
2265 }
Harald Welte9abd1282018-02-19 19:18:17 +01002266 }
Pau Espin Pedrol39bfa022022-08-12 14:56:12 +02002267 if (not istemplatekind(osmux_cid, "omit")) {
2268 msg.ies[lengthof(msg.ies)] := tr_RSL_IE(RSL_IE_Body:{osmux_cid := f_tr_RSL_IE_OSMO_Osmux_CID(osmux_cid)});
2269 }
2270 return msg;
Harald Welte9abd1282018-02-19 19:18:17 +01002271 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002272
Harald Welteefa7d912018-04-18 23:22:15 +02002273 template (value) RSL_Message ts_RSL_IPA_CRCX_NACK(template (value) RslChannelNr chan_nr,
2274 RSL_Cause cause) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002275 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2276 msg_type := RSL_MT_IPAC_CRCX_NACK,
2277 ies := {
2278 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2279 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2280 }
2281 }
Harald Welte9abd1282018-02-19 19:18:17 +01002282 template RSL_Message tr_RSL_IPA_CRCX_NACK(template RslChannelNr chan_nr,
2283 template RSL_Cause cause := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002284 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9abd1282018-02-19 19:18:17 +01002285 msg_type := RSL_MT_IPAC_CRCX_NACK,
2286 ies := {
2287 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2288 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
2289 }
2290 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002291
Pau Espin Pedrol39bfa022022-08-12 14:56:12 +02002292 function ts_RSL_IPA_MDCX(template (value) RslChannelNr chan_nr,
2293 uint16_t ipa_conn_id,
2294 OCT4 remote_ip, uint16_t remote_port,
2295 uint7_t rtp_pt2,
2296 template (omit) uint8_t osmux_cid := omit)
2297 return template (value) RSL_Message {
2298 var template (value) RSL_Message msg := {
2299 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2300 msg_type := RSL_MT_IPAC_MDCX,
2301 ies := {
2302 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2303 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2304 t_RSL_IE(RSL_IE_IPAC_REMOTE_IP, RSL_IE_Body:{ipa_remote_ip := remote_ip}),
2305 t_RSL_IE(RSL_IE_IPAC_REMOTE_PORT, RSL_IE_Body:{ipa_remote_port := remote_port}),
2306 /* optional: RTP Payload Type */
2307 t_RSL_IE(RSL_IE_IPAC_RTP_PAYLOAD2, RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
2308 }
Harald Welte30527452018-02-25 12:46:25 +01002309 }
Pau Espin Pedrol39bfa022022-08-12 14:56:12 +02002310 if (not istemplatekind(osmux_cid, "omit")) {
2311 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)});
2312 }
2313 return msg;
Harald Welte30527452018-02-25 12:46:25 +01002314 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002315 template RSL_Message tr_RSL_IPA_MDCX(template RslChannelNr chan_nr,
2316 template uint16_t ipa_conn_id) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002317 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002318 msg_type := RSL_MT_IPAC_MDCX,
2319 ies := {
2320 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2321 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2322 *
2323 }
2324 }
2325
Pau Espin Pedrol29c6dfb2022-08-08 18:37:56 +02002326 function ts_RSL_IPA_MDCX_ACK(template (value) RslChannelNr chan_nr,
2327 uint16_t ipa_conn_id,
2328 OCT4 local_ip, uint16_t local_port,
2329 uint7_t rtp_pt2,
2330 template (omit) uint8_t osmux_cid := omit)
Pau Espin Pedrol39bfa022022-08-12 14:56:12 +02002331 return template (value) RSL_Message {
2332 var template (value) RSL_Message msg := {
2333 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2334 msg_type := RSL_MT_IPAC_MDCX_ACK,
2335 ies := {
2336 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2337 /* optional */
2338 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2339 t_RSL_IE(RSL_IE_IPAC_LOCAL_IP, RSL_IE_Body:{ipa_local_ip := local_ip}),
2340 t_RSL_IE(RSL_IE_IPAC_LOCAL_PORT, RSL_IE_Body:{ipa_local_port := local_port}),
2341 /* optional: RTP Payload Type */
2342 t_RSL_IE(RSL_IE_IPAC_RTP_PAYLOAD2, RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
Pau Espin Pedrol29c6dfb2022-08-08 18:37:56 +02002343 }
Pau Espin Pedrol39bfa022022-08-12 14:56:12 +02002344 }
2345 if (not istemplatekind(osmux_cid, "omit")) {
2346 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)});
2347 }
2348 return msg;
2349 }
2350 function tr_RSL_IPA_MDCX_ACK(template RslChannelNr chan_nr,
2351 template uint16_t ipa_conn_id,
2352 template OCT4 local_ip,
2353 template uint16_t local_port,
2354 template uint7_t rtp_pt2,
2355 template uint8_t osmux_cid := omit)
2356 return template RSL_Message {
2357 var template RSL_Message msg := {
2358 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2359 msg_type := RSL_MT_IPAC_MDCX_ACK,
2360 ies := {
2361 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2362 /* optional */
2363 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2364 tr_RSL_IE(RSL_IE_Body:{ipa_local_ip := local_ip}),
2365 tr_RSL_IE(RSL_IE_Body:{ipa_local_port := local_port}),
2366 /* optional: RTP Payload Type */
2367 tr_RSL_IE(RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
Pau Espin Pedrol29c6dfb2022-08-08 18:37:56 +02002368 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002369 }
Pau Espin Pedrol39bfa022022-08-12 14:56:12 +02002370 if (not istemplatekind(osmux_cid, "omit")) {
2371 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 +01002372 }
Pau Espin Pedrol39bfa022022-08-12 14:56:12 +02002373 return msg;
Harald Welte30527452018-02-25 12:46:25 +01002374 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002375
Harald Welteefa7d912018-04-18 23:22:15 +02002376 template (value) RSL_Message ts_RSL_IPA_MDCX_NACK(template (value) RslChannelNr chan_nr,
2377 RSL_Cause cause,
2378 template (value) uint16_t ipa_conn_id) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002379 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2380 msg_type := RSL_MT_IPAC_MDCX_NACK,
2381 ies := {
2382 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2383 /* optional connection ID */
2384 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2385 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2386 }
2387 }
Harald Welte30527452018-02-25 12:46:25 +01002388 template RSL_Message tr_RSL_IPA_MDCX_NACK(template RslChannelNr chan_nr,
2389 template RSL_Cause cause,
2390 template uint16_t ipa_conn_id) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002391 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte30527452018-02-25 12:46:25 +01002392 msg_type := RSL_MT_IPAC_MDCX_NACK,
2393 ies := {
2394 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2395 /* optional connection ID */
2396 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2397 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
2398 }
2399 }
2400
Harald Welte9958a4d2017-12-14 21:21:33 +01002401
Harald Welteefa7d912018-04-18 23:22:15 +02002402 template (value) RSL_Message ts_RSL_IPA_DLCX_IND(template (value) RslChannelNr chan_nr,
2403 uint16_t ipa_conn_id,
2404 template (value) RSL_IE_IPA_ConnectionStats stats,
2405 RSL_Cause cause) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002406 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2407 msg_type := RSL_MT_IPAC_DLCX_IND,
2408 ies := {
2409 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2410 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2411 t_RSL_IE(RSL_IE_IPAC_CONN_STAT, RSL_IE_Body:{ipa_stats := stats}),
2412 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2413 }
2414 }
2415
Harald Welteefa7d912018-04-18 23:22:15 +02002416 template (value) RSL_Message ts_RSL_IPA_DLCX(template (value) RslChannelNr chan_nr,
2417 uint16_t ipa_conn_id) := {
Harald Weltea871a382018-02-25 02:03:14 +01002418 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2419 msg_type := RSL_MT_IPAC_DLCX,
2420 ies := {
Harald Welte2a7e7162018-02-25 12:46:48 +01002421 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2422 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id})
Harald Weltea871a382018-02-25 02:03:14 +01002423 }
2424 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002425 template RSL_Message tr_RSL_IPA_DLCX(template RslChannelNr chan_nr,
2426 template uint16_t ipa_conn_id := omit) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002427 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002428 msg_type := RSL_MT_IPAC_DLCX,
2429 ies := {
2430 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2431 /* FIXME: optional conn_id */
2432 *
2433 }
2434 }
2435
Harald Welteefa7d912018-04-18 23:22:15 +02002436 template (value) RSL_Message ts_RSL_IPA_DLCX_ACK(template (value) RslChannelNr chan_nr,
2437 uint16_t ipa_conn_id,
2438 RSL_IE_IPA_ConnectionStats stats) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002439 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2440 msg_type := RSL_MT_IPAC_DLCX_ACK,
2441 ies := {
2442 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2443 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2444 t_RSL_IE(RSL_IE_IPAC_CONN_STAT, RSL_IE_Body:{ipa_stats := stats})
2445 }
2446 }
Harald Weltea871a382018-02-25 02:03:14 +01002447 template RSL_Message tr_RSL_IPA_DLCX_ACK(template RslChannelNr chan_nr,
2448 template uint16_t ipa_conn_id,
2449 template RSL_IE_IPA_ConnectionStats stats) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002450 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Weltea871a382018-02-25 02:03:14 +01002451 msg_type := RSL_MT_IPAC_DLCX_ACK,
2452 ies := {
2453 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2454 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2455 tr_RSL_IE(RSL_IE_Body:{ipa_stats := stats})
2456 }
2457 }
2458
2459
Harald Welte9958a4d2017-12-14 21:21:33 +01002460
Harald Welteefa7d912018-04-18 23:22:15 +02002461 template (value) RSL_Message ts_RSL_IPA_DLCX_NACK(template (value) RslChannelNr chan_nr,
2462 RSL_Cause cause, uint16_t ipa_conn_id) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002463 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2464 msg_type := RSL_MT_IPAC_DLCX_NACK,
2465 ies := {
2466 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2467 /* optional connection ID */
2468 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2469 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2470 }
2471 }
Harald Weltea871a382018-02-25 02:03:14 +01002472 template RSL_Message tr_RSL_IPA_DLCX_NACK(template RslChannelNr chan_nr,
2473 template RSL_Cause cause) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002474 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Weltea871a382018-02-25 02:03:14 +01002475 msg_type := RSL_MT_IPAC_DLCX_NACK,
2476 ies := {
2477 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2478 /* optional connection ID */
2479 *,
2480 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
2481 }
2482 }
2483
Harald Welte9958a4d2017-12-14 21:21:33 +01002484
Vadim Yanitskiy58b16532021-10-09 20:27:39 +06002485 template (value) RSL_Message
2486 ts_RSL_IPA_PDCH_ACT(template (value) RslChannelNr chan_nr) := {
Harald Welteee19c732018-04-05 09:08:26 +02002487 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2488 msg_type := RSL_MT_IPAC_PDCH_ACT,
2489 ies := {
2490 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
2491 }
2492 }
Vadim Yanitskiy58b16532021-10-09 20:27:39 +06002493 template RSL_Message
2494 tr_RSL_IPA_PDCH_ACT(template (present) RslChannelNr chan_nr) := {
Harald Welteee19c732018-04-05 09:08:26 +02002495 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002496 msg_type := RSL_MT_IPAC_PDCH_ACT,
2497 ies := {
2498 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
2499 }
2500 }
2501
Harald Welteee19c732018-04-05 09:08:26 +02002502
Harald Welte94e0c342018-04-07 11:33:23 +02002503 template RSL_Message ts_RSL_IPA_PDCH_ACT_ACK(RslChannelNr chan_nr,
2504 template (value) RSL_IE_FrameNumber fn) := {
Harald Welteee19c732018-04-05 09:08:26 +02002505 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002506 msg_type := RSL_MT_IPAC_PDCH_ACT_ACK,
2507 ies := {
2508 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2509 t_RSL_IE(RSL_IE_FRAME_NUMBER, RSL_IE_Body:{frame_nr := fn})
2510 }
2511 }
Harald Welteee19c732018-04-05 09:08:26 +02002512 template RSL_Message tr_RSL_IPA_PDCH_ACT_ACK(template RslChannelNr chan_nr,
2513 template RSL_IE_FrameNumber fn) := {
2514 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2515 msg_type := RSL_MT_IPAC_PDCH_ACT_ACK,
2516 ies := {
2517 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2518 tr_RSL_IE(RSL_IE_Body:{frame_nr := fn})
2519 }
2520 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002521
2522 template RSL_Message ts_RSL_IPA_PDCH_ACT_NACK(RslChannelNr chan_nr, RSL_Cause cause) := {
Harald Welteee19c732018-04-05 09:08:26 +02002523 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002524 msg_type := RSL_MT_IPAC_PDCH_ACT_NACK,
2525 ies := {
2526 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2527 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2528 }
2529 }
Harald Welteee19c732018-04-05 09:08:26 +02002530 template RSL_Message tr_RSL_IPA_PDCH_ACT_NACK(template RslChannelNr chan_nr,
2531 template RSL_Cause cause) := {
2532 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2533 msg_type := RSL_MT_IPAC_PDCH_ACT_NACK,
2534 ies := {
2535 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2536 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
2537 }
2538 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002539
Harald Welteee19c732018-04-05 09:08:26 +02002540 template RSL_Message ts_RSL_IPA_PDCH_DEACT(RslChannelNr chan_nr) := {
2541 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2542 msg_type := RSL_MT_IPAC_PDCH_DEACT,
2543 ies := {
2544 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
2545 }
2546 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002547 template RSL_Message tr_RSL_IPA_PDCH_DEACT(template RslChannelNr chan_nr) := {
Harald Welteee19c732018-04-05 09:08:26 +02002548 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002549 msg_type := RSL_MT_IPAC_PDCH_DEACT,
2550 ies := {
2551 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
2552 }
2553 }
2554
2555 template RSL_Message ts_RSL_IPA_PDCH_DEACT_ACK(RslChannelNr chan_nr) := {
Harald Welteee19c732018-04-05 09:08:26 +02002556 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002557 msg_type := RSL_MT_IPAC_PDCH_DEACT_ACK,
2558 ies := {
2559 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
2560 }
2561 }
Harald Welteee19c732018-04-05 09:08:26 +02002562 template RSL_Message tr_RSL_IPA_PDCH_DEACT_ACK(template RslChannelNr chan_nr) := {
2563 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2564 msg_type := RSL_MT_IPAC_PDCH_DEACT_ACK,
2565 ies := {
2566 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
2567 }
2568 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002569
2570 template RSL_Message ts_RSL_IPA_PDCH_DEACT_NACK(RslChannelNr chan_nr, RSL_Cause cause) := {
Harald Welteee19c732018-04-05 09:08:26 +02002571 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002572 msg_type := RSL_MT_IPAC_PDCH_DEACT_NACK,
2573 ies := {
2574 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2575 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2576 }
2577 }
Harald Welteee19c732018-04-05 09:08:26 +02002578 template RSL_Message tr_RSL_IPA_PDCH_DEACT_NACK(template RslChannelNr chan_nr,
2579 template RSL_Cause cause) := {
2580 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2581 msg_type := RSL_MT_IPAC_PDCH_DEACT_NACK,
2582 ies := {
2583 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2584 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
2585 }
2586 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002587
Harald Welte908ce542019-09-04 23:05:40 +02002588 template (value) RSL_Message ts_RSL_OSMO_ETWS_CMD(template (value) octetstring msg,
2589 template (value) RslChannelNr chan_nr := ts_RslChanNr_PCH_AGCH(0)) := {
2590 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2591 msg_type := RSL_MT_OSMO_ETWS_CMD,
2592 ies := {
2593 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2594 t_RSL_IE(RSL_IE_SMSCB_MSG, RSL_IE_Body:{smscb_message := ts_RSL_LV(msg)})
2595 }
2596 }
2597 template RSL_Message tr_RSL_OSMO_ETWS_CMD(template RslChannelNr chan_nr := ?,
2598 template octetstring msg := ?) := {
2599 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2600 msg_type := RSL_MT_OSMO_ETWS_CMD,
2601 ies := {
2602 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2603 tr_RSL_IE(RSL_IE_Body:{smscb_message := tr_RSL_LV(msg)})
2604 }
2605 }
2606
2607
Harald Welte9958a4d2017-12-14 21:21:33 +01002608
Harald Welte6a8199d2018-01-29 21:58:53 +01002609 function f_rsl_find_ie(RSL_Message msg, RSL_IE_Type iei, out RSL_IE_Body ret) return boolean {
2610 for (var integer i := 0; i < sizeof(msg.ies); i := i+1) {
2611 if (msg.ies[i].iei == iei) {
2612 ret := msg.ies[i].body;
2613 return true;
2614 }
2615 }
2616 return false;
2617 }
2618
2619
Harald Welte9958a4d2017-12-14 21:21:33 +01002620
Harald Welte643e2a62017-11-27 15:03:18 +01002621} with { encode "RAW" ; variant "FIELDORDER(msb)" }