blob: 10284b895685c32fdd82baab8a8c98f9598487f1 [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
Neels Hofmeyr2bef0dd2021-04-22 21:46:00 +0000223 RSL_IE_OSMO_TRAINING_SEQUENCE ('01100001'B),
224
Harald Welte643e2a62017-11-27 15:03:18 +0100225 /* ip.access */
226 RSL_IE_IPAC_SRTP_CONFIG ('11100000'B),
Harald Welte319be822017-12-07 17:50:26 +0100227 RSL_IE_IPAC_PROXY_UDP ('11100001'B),
228 RSL_IE_IPAC_BSCMPL_TOUT ('11100010'B),
Harald Welte643e2a62017-11-27 15:03:18 +0100229
230 RSL_IE_IPAC_REMOTE_IP ('11110000'B),
Harald Welte319be822017-12-07 17:50:26 +0100231 RSL_IE_IPAC_REMOTE_PORT ('11110001'B),
232 RSL_IE_IPAC_RTP_PAYLOAD ('11110010'B),
233 RSL_IE_IPAC_LOCAL_PORT ('11110011'B),
234 RSL_IE_IPAC_SPEECH_MODE ('11110100'B),
235 RSL_IE_IPAC_LOCAL_IP ('11110101'B),
236 RSL_IE_IPAC_CONN_STAT ('11110110'B),
237 RSL_IE_IPAC_HO_C_PARMS ('11110111'B),
238 RSL_IE_IPAC_CONN_ID ('11111000'B),
239 RSL_IE_IPAC_RTP_CSD_FMT ('11111001'B),
240 RSL_IE_IPAC_RTP_JIT_BUF ('11111010'B),
241 RSL_IE_IPAC_RTP_COMPR ('11111011'B),
242 RSL_IE_IPAC_RTP_PAYLOAD2 ('11111100'B),
243 RSL_IE_IPAC_RTP_MPLEX ('11111101'B),
244 RSL_IE_IPAC_RTP_MPLEX_ID ('11111110'B)
Harald Welte643e2a62017-11-27 15:03:18 +0100245 } with { variant "FIELDLENGTH(8)" };
246
247 type record RSL_LV {
248 uint8_t len,
249 octetstring payload
250 } with { variant (len) "LENGTHTO(payload)" }
251
Harald Welteefa7d912018-04-18 23:22:15 +0200252 template (value) RSL_LV ts_RSL_LV(template (value) octetstring pl) := {
Harald Welte643e2a62017-11-27 15:03:18 +0100253 len := 0,
254 payload := pl
255 }
256
Harald Welte51d74102017-12-10 23:05:02 +0100257 template RSL_LV tr_RSL_LV(template octetstring pl) := {
258 len := ?,
259 payload := pl
260 }
261
Harald Welte15bb5b52017-12-07 17:52:04 +0100262 type record RSL_L16V {
263 uint16_t len,
264 octetstring payload
265 } with { variant (len) "LENGTHTO(payload)" }
266
Harald Welteefa7d912018-04-18 23:22:15 +0200267 template (value) RSL_L16V ts_RSL_L16V(template (value) octetstring pl) := {
Harald Welte15bb5b52017-12-07 17:52:04 +0100268 len := 0,
269 payload := pl
270 }
271
Harald Welte7794d5b2017-12-16 23:00:20 +0100272 template RSL_L16V tr_RSL_L16V(template octetstring pl) := {
273 len := ?,
274 payload := pl
275 }
276
Harald Welte643e2a62017-11-27 15:03:18 +0100277 type record RSL_IE_V {
278 uint8_t val
279 }
280
281 /* 9.3.3 */
282 type record RSL_IE_ActivationType {
283 boolean reactivation,
284 uint4_t reserved,
Harald Welte921f9e02019-05-19 22:27:11 +0200285 RSL_ActivationAbits a_bits
286 };
287 type enumerated RSL_ActivationAbits {
288 ACT_REL_TO_IMM_ASSIGN ('000'B),
289 ACT_REL_TO_NORM_ASSIGN ('001'B),
290 ACT_REL_TO_ASYNC_HANDOVER ('010'B),
291 ACT_REL_TO_SYNC_HANDOVER ('011'B),
292 ACT_REL_TO_ADDL_ASSIGN ('100'B),
293 ACT_REL_TO_MSLOT_CONFIG ('101'B),
294 ACT_REL_TO_OSMO_PDCH ('111'B)
295 } with { variant "FIELDLENGTH(3)" };
Harald Welte643e2a62017-11-27 15:03:18 +0100296
Harald Welte921f9e02019-05-19 22:27:11 +0200297 const RSL_IE_ActivationType t_RSL_IE_ActType_IA := {
Harald Welte643e2a62017-11-27 15:03:18 +0100298 reactivation := false,
299 reserved := 0,
Harald Welte921f9e02019-05-19 22:27:11 +0200300 a_bits := ACT_REL_TO_IMM_ASSIGN
301 }
302 const RSL_IE_ActivationType t_RSL_IE_ActType_ASS := {
303 reactivation := false,
304 reserved := 0,
305 a_bits := ACT_REL_TO_NORM_ASSIGN
306 }
307 const RSL_IE_ActivationType t_RSL_IE_ActType_HO_ASYNC := {
308 reactivation := false,
309 reserved := 0,
310 a_bits := ACT_REL_TO_ASYNC_HANDOVER
311 }
312 const RSL_IE_ActivationType t_RSL_IE_ActType_HO_SYNC := {
313 reactivation := false,
314 reserved := 0,
315 a_bits := ACT_REL_TO_SYNC_HANDOVER
Harald Welte643e2a62017-11-27 15:03:18 +0100316 }
317
Harald Welte94e0c342018-04-07 11:33:23 +0200318 /* osmocom-style dynamic PDCH */
Harald Welte921f9e02019-05-19 22:27:11 +0200319 const RSL_IE_ActivationType t_RSL_IE_ActType_PDCH := {
Harald Welte94e0c342018-04-07 11:33:23 +0200320 reactivation := false,
321 reserved := 1,
Harald Welte921f9e02019-05-19 22:27:11 +0200322 a_bits := ACT_REL_TO_OSMO_PDCH
Harald Welte94e0c342018-04-07 11:33:23 +0200323 }
324
Vadim Yanitskiye02dbcc2020-08-25 04:20:51 +0700325 /* 9.3.5 */
326 type record RSL_IE_ChannelIdent {
327 uint8_t len,
328 /* 3GPP TS 44.018 Channel Description IE (TV) */
329 ChannelDescriptionTV ch_desc,
330 /* 3GPP TS 44.018 Mobile Allocation IE (shall be empty) */
331 MobileAllocationTLV ma
332 } with { variant (len) "LENGTHTO(ch_desc,ma)" };
333
334 template (value) RSL_IE_ChannelIdent
335 ts_RSL_ChannelIdent(template (value) ChannelDescription ch_desc) := {
336 len := 0, /* overwritten */
337 ch_desc := {
338 iei := '64'O,
339 v := ch_desc
340 },
341 /* Shall be included but empty */
342 ma := {
343 iei := '72'O,
344 v := {
345 len := 0,
346 ma := ''B
347 }
348 }
349 };
350
351 template RSL_IE_ChannelIdent
352 tr_RSL_ChannelIdent(template (present) ChannelDescription ch_desc := ?,
353 template (present) MobileAllocationLV ma := ?) := {
354 len := ?,
355 ch_desc := {
356 iei := '64'O,
357 v := ch_desc
358 },
359 /* Shall be included but empty */
360 ma := {
361 iei := '72'O,
362 v := ma
363 }
364 };
365
Harald Welte643e2a62017-11-27 15:03:18 +0100366 /* 9.3.6 */
367 type enumerated RSL_SpeechDataInd {
368 RSL_SPDI_SPEECH ('00000001'B),
369 RSL_SPDI_DATA ('00000010'B),
370 RSL_SPDI_SIGN ('00000011'B)
371 } with { variant "FIELDLENGTH(8)" };
372 type enumerated RSL_ChanRateType {
373 RSL_CHRT_SDCCH ('00000001'B),
374 RSL_CHRT_TCH_F ('00001000'B),
375 RSL_CHRT_TCH_H ('00001001'B),
376 RSL_CHRT_TCH_F_BD_MSLOT ('00001010'B),
377 RSL_CHRT_TCH_F_DL_MSLOT ('00011010'B),
378 RSL_CHRT_TCH_F_GROUP ('00011000'B),
379 RSL_CHRT_TCH_H_GROUP ('00011001'B),
380 RSL_CHRT_TCH_F_BCAST ('00101000'B),
Neels Hofmeyr2bef0dd2021-04-22 21:46:00 +0000381 RSL_CHRT_TCH_H_BCAST ('00101001'B),
382 RSL_CHRT_OSMO_TCH_F_VAMOS ('10001000'B),
383 RSL_CHRT_OSMO_TCH_H_VAMOS ('10001001'B)
Harald Welte643e2a62017-11-27 15:03:18 +0100384 } with { variant "FIELDLENGTH(8)" };
385 type enumerated RSL_SpeechAlgo {
386 RSL_CMOD_NO_RESOURCE ('00000000'B),
387 RSL_CMOD_SP_GSM1 ('00000001'B),
388 RSL_CMOD_SP_GSM2 ('00010001'B),
389 RSL_CMOD_SP_GSM3 ('00100001'B),
390 RSL_CMOD_SP_GSM4 ('00110001'B),
391 RSL_CMOD_SP_GSM5 ('00001001'B),
392 RSL_CMOD_SP_GSM6 ('00001101'B)
393 } with { variant "FIELDLENGTH(8)" };
394 type record RSL_IE_ChannelMode {
Harald Welte8f2c21d2017-12-07 17:52:40 +0100395 uint8_t len,
Harald Welte643e2a62017-11-27 15:03:18 +0100396 BIT6 reserved,
397 boolean dtx_d,
398 boolean dtx_u,
399 RSL_SpeechDataInd spd_ind,
400 RSL_ChanRateType ch_rate_type,
401 RSL_SpeechAlgo coding_alg_rate
Harald Welte8f2c21d2017-12-07 17:52:40 +0100402 } with { variant (len) "LENGTHTO(reserved,dtx_d,dtx_u,spd_ind,ch_rate_type,coding_alg_rate)" }
Harald Welte643e2a62017-11-27 15:03:18 +0100403
Vadim Yanitskiy8fc43df2020-10-20 02:11:05 +0700404 template (value) RSL_IE_ChannelMode ts_RSL_ChanMode_SIGN(RSL_ChanRateType t := RSL_CHRT_SDCCH,
405 boolean dtx_downlink := false) := {
Harald Welte8f2c21d2017-12-07 17:52:40 +0100406 len := 0, /* overwritten */
Harald Welte643e2a62017-11-27 15:03:18 +0100407 reserved := '000000'B,
Stefan Sperling4880be42018-08-07 18:12:59 +0200408 dtx_d := dtx_downlink,
Harald Welte643e2a62017-11-27 15:03:18 +0100409 dtx_u := false,
410 spd_ind := RSL_SPDI_SIGN,
Philipp Maierac693462020-10-14 20:21:44 +0200411 ch_rate_type := t,
Harald Welte643e2a62017-11-27 15:03:18 +0100412 coding_alg_rate := RSL_CMOD_NO_RESOURCE
413 }
414
Stefan Sperling4880be42018-08-07 18:12:59 +0200415 template (value) RSL_IE_ChannelMode ts_RSL_ChanMode(RSL_ChanRateType t, RSL_SpeechAlgo alg,
416 boolean dtx_downlink := false) := {
Harald Welte8f2c21d2017-12-07 17:52:40 +0100417 len := 0, /* overwritten */
Harald Welte643e2a62017-11-27 15:03:18 +0100418 reserved := '000000'B,
Stefan Sperling4880be42018-08-07 18:12:59 +0200419 dtx_d := dtx_downlink,
Harald Welte643e2a62017-11-27 15:03:18 +0100420 dtx_u := false,
421 spd_ind := RSL_SPDI_SPEECH,
422 ch_rate_type := t,
423 coding_alg_rate := alg
424 }
Harald Welte3618d9d2018-03-21 18:45:27 +0100425 template RSL_IE_ChannelMode tr_RSL_ChanMode(template RSL_ChanRateType t,
426 template RSL_SpeechAlgo alg) := {
427 len := ?,
428 reserved := '000000'B,
429 dtx_d := ?,
430 dtx_u := ?,
431 spd_ind := RSL_SPDI_SPEECH,
432 ch_rate_type := t,
433 coding_alg_rate := alg
434 }
Harald Welte643e2a62017-11-27 15:03:18 +0100435
Vadim Yanitskiy117c1762020-06-16 01:40:10 +0700436 /* 9.3.4 BS Power IE */
Harald Welte643e2a62017-11-27 15:03:18 +0100437 type record RSL_IE_BS_Power {
Vadim Yanitskiy117c1762020-06-16 01:40:10 +0700438 uint2_t reserved,
Harald Welte643e2a62017-11-27 15:03:18 +0100439 boolean epc,
440 boolean fpc,
Vadim Yanitskiy117c1762020-06-16 01:40:10 +0700441 uint4_t power_level
Harald Welte643e2a62017-11-27 15:03:18 +0100442 }
443
Vadim Yanitskiy117c1762020-06-16 01:40:10 +0700444 template (value) RSL_IE_BS_Power ts_RSL_IE_BS_Power(uint4_t power_level,
Eric Wildae8f2622019-06-18 17:05:11 +0200445 boolean epc := false, boolean fpc := false) := {
446 reserved := 0,
447 epc := epc,
448 fpc := fpc,
449 power_level := power_level
450 }
451
Harald Welte73cd2712017-12-17 00:44:52 +0100452 /* 9.3.7 */
Harald Weltee613f962018-04-18 22:38:16 +0200453 type enumerated RSL_AlgId {
454 RSL_ALG_ID_A5_0 ('00000001'B),
455 RSL_ALG_ID_A5_1 ('00000010'B),
456 RSL_ALG_ID_A5_2 ('00000011'B),
457 RSL_ALG_ID_A5_3 ('00000100'B),
458 RSL_ALG_ID_A5_4 ('00000101'B),
459 RSL_ALG_ID_A5_5 ('00000110'B),
460 RSL_ALG_ID_A5_6 ('00000111'B),
461 RSL_ALG_ID_A5_7 ('00001000'B)
462 } with { variant "FIELDLENGTH(8)" };
Harald Welte73cd2712017-12-17 00:44:52 +0100463 type record RSL_IE_EncryptionInfo {
464 uint8_t len,
Harald Weltee613f962018-04-18 22:38:16 +0200465 RSL_AlgId alg_id,
Harald Welte73cd2712017-12-17 00:44:52 +0100466 octetstring key
467 } with { variant (len) "LENGTHTO(alg_id,key)" };
468
Harald Weltee613f962018-04-18 22:38:16 +0200469 template RSL_IE_EncryptionInfo tr_RSL_IE_EncrInfo(template RSL_AlgId alg,
470 template octetstring key) := {
Harald Welte73cd2712017-12-17 00:44:52 +0100471 len := ?,
472 alg_id := alg,
473 key := key
474 }
Harald Weltee613f962018-04-18 22:38:16 +0200475 template (value) RSL_IE_EncryptionInfo ts_RSL_IE_EncrInfo(template (value) RSL_AlgId alg,
476 octetstring key) := {
Harald Welteefa7d912018-04-18 23:22:15 +0200477 len := 0, /* overwritten */
478 alg_id := alg,
479 key := key
480 }
481
482
Harald Welte73cd2712017-12-17 00:44:52 +0100483
Harald Welte643e2a62017-11-27 15:03:18 +0100484 /* 9.3.8 */
485 type record RSL_IE_FrameNumber {
486 uint5_t t1_p,
487 uint6_t t3,
488 uint5_t t2
489 }
490 type RSL_IE_FrameNumber RSL_IE_StartingTime;
491
492 /* 9.3.10 */
493 type record RSL_IE_L1Info {
494 uint5_t ms_power_lvl,
495 boolean fpc,
496 uint2_t reserved,
497 uint8_t actual_ta
498 }
499
500 /* 9.3.13 */
501 type record RSL_IE_MS_Power {
502 uint2_t reserved,
503 boolean fpc_epc,
504 uint5_t power_level
505 }
Pau Espin Pedrolf7630a62019-10-28 15:07:08 +0100506 template RSL_IE_MS_Power tr_RSL_IE_MS_Power(template uint5_t power_level := ?,
507 template boolean fpc_epc := false) := {
508 reserved := 0,
509 fpc_epc := fpc_epc,
510 power_level := power_level
511 }
Harald Welte10280172019-05-19 22:28:04 +0200512 template (value) RSL_IE_MS_Power ts_RSL_IE_MS_Power(uint5_t power_level,
513 boolean fpc_epc := false) := {
514 reserved := 0,
515 fpc_epc := fpc_epc,
516 power_level := power_level
517 }
Harald Welte643e2a62017-11-27 15:03:18 +0100518
Harald Welted5f521e2017-12-07 17:53:06 +0100519 /* 9.3.18 */
520 type record RSL_IE_RachLoad {
521 uint8_t len,
522 uint16_t slot_count,
523 uint16_t busy_count,
524 uint16_t access_count
525 } with { variant (len) "LENGTHTO(slot_count,busy_count,access_count)" }
526
Harald Welteefa7d912018-04-18 23:22:15 +0200527 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 +0100528 len := 0, /* overwritten */
529 slot_count := slot,
530 busy_count := busy,
531 access_count := acc
532 }
533
Harald Welte68e495b2018-02-25 00:05:57 +0100534 template RSL_IE_RachLoad tr_RSL_IE_RachLoad(template uint16_t slot,
535 template uint16_t busy,
536 template uint16_t acc) := {
537 len := ?, /* overwritten */
538 slot_count := slot,
539 busy_count := busy,
540 access_count := acc
541 }
542
Harald Welte643e2a62017-11-27 15:03:18 +0100543 /* 9.3.19 */
544 type record RSL_IE_RequestRef {
545 OCT1 ra,
546 RSL_IE_FrameNumber frame_nr
547 }
548
549 /* 3GPP TS 44.018 / 10.5.2.38 Starting Time */
Harald Welte94e0c342018-04-07 11:33:23 +0200550 template (value) RSL_IE_FrameNumber ts_RSL_IE_FrameNumber(GsmFrameNumber fn) := {
Harald Welte643e2a62017-11-27 15:03:18 +0100551 t1_p := (fn / 1326) mod 32,
552 t3 := fn mod 51,
553 t2 := fn mod 26
554 }
555
Harald Welte9abd1282018-02-19 19:18:17 +0100556 function tr_RSL_IE_FrameNumber(template GsmFrameNumber fn) return template RSL_IE_FrameNumber {
557 if (istemplatekind(fn, "?")) {
558 return ?;
559 } else {
560 return ts_RSL_IE_FrameNumber(valueof(fn));
561 }
562 }
563
Harald Welteefa7d912018-04-18 23:22:15 +0200564 template (value) RSL_IE_RequestRef ts_RSL_IE_ReqRef(OCT1 ra, GsmFrameNumber frame_nr) := {
Harald Welte643e2a62017-11-27 15:03:18 +0100565 ra := ra,
566 frame_nr := ts_RSL_IE_FrameNumber(frame_nr)
567 }
568
Harald Welte9abd1282018-02-19 19:18:17 +0100569 template RSL_IE_RequestRef tr_RSL_IE_ReqRef(template OCT1 ra, template GsmFrameNumber frame_nr) := {
570 ra := ra,
571 frame_nr := tr_RSL_IE_FrameNumber(frame_nr)
572 }
573
Vadim Yanitskiy9f699532021-06-03 17:29:22 +0200574 /* 9.3.21 Resource Information */
575 type record RSL_IE_ResourceInfo {
576 uint8_t len,
577 RSL_ResourceInfo info
578 } with { variant (len) "LENGTHTO(info)" };
579
580 type record of RSL_ResourceInfoItem RSL_ResourceInfo;
581 type record RSL_ResourceInfoItem {
582 RslChannelNr chan_nr,
583 uint3_t interf_band,
584 BIT5 rfu ('00000'B)
585 };
586
587 template (value) RSL_ResourceInfoItem
588 ts_RSL_ResourceInfoItem(template (value) RslChannelNr chan_nr,
589 template (value) uint3_t interf_band := 0) := {
590 chan_nr := chan_nr,
591 interf_band := interf_band,
592 rfu := '00000'B
593 }
594 template RSL_ResourceInfoItem
595 tr_RSL_ResourceInfoItem(template (present) RslChannelNr chan_nr := ?,
596 template (present) uint3_t interf_band := ?) := {
597 chan_nr := chan_nr,
598 interf_band := interf_band,
599 rfu := ? /* Tolerate unknown values */
600 }
601
Harald Welte15de8ba2018-06-29 08:51:42 +0200602 /* Osmocom Extension */
603 type record RSL_IE_UplinkMeasSuppMeasInfo {
604 int16_t toa256_mean,
605 int16_t toa256_min,
606 int16_t toa256_max,
607 uint16_t toa256_std_dev
608 };
609
Harald Welte2691adf2018-02-22 17:32:39 +0100610 /* 9.3.25 */
611 type record RSL_IE_UplinkMeas {
612 uint8_t len,
613 BIT1 rfu,
614 boolean dtx_d,
615 uint6_t rxlev_f_u,
616 BIT2 reserved1,
617 uint6_t rxlev_s_u,
618 BIT2 reserved2,
619 uint3_t rxq_f_u,
620 uint3_t rxq_s_u,
Harald Welte15de8ba2018-06-29 08:51:42 +0200621 RSL_IE_UplinkMeasSuppMeasInfo supp_meas_info optional
Harald Welte2691adf2018-02-22 17:32:39 +0100622 } 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 +0100623
Harald Welte643e2a62017-11-27 15:03:18 +0100624 /* 9.3.26 */
Harald Weltea8ed9062017-12-14 09:46:01 +0100625 type enumerated RSL_Cause {
626 /* normal event */
627 RSL_ERR_RADIO_IF_FAIL ('00'O),
628 RSL_ERR_RADIO_LINK_FAIL ('01'O),
629 RSL_ERR_HANDOVER_ACC_FAIL ('02'O),
630 RSL_ERR_TALKER_ACC_FAIL ('03'O),
631 RSL_ERR_OM_INTERVENTION ('07'O),
632 RSL_ERR_NORMAL_UNSPEC ('0f'O),
633 RSL_ERR_T_MSRFPCI_EXP ('18'O),
634 /* resource unavailable */
635 RSL_ERR_EQUIPMENT_FAIL ('20'O),
636 RSL_ERR_RR_UNAVAIL ('21'O),
637 RSL_ERR_TERR_CH_FAIL ('22'O),
638 RSL_ERR_CCCH_OVERLOAD ('23'O),
639 RSL_ERR_ACCH_OVERLOAD ('24'O),
640 RSL_ERR_PROCESSOR_OVERLOAD ('25'O),
641 RSL_ERR_BTS_NOT_EQUIPPED ('27'O),
642 RSL_ERR_REMOTE_TRAU_FAILURE ('28'O),
643 RSL_ERR_NOTIF_OVERFLOW ('29'O),
644 RSL_ERR_RES_UNAVAIL ('2f'O),
645 /* service or option not available */
646 RSL_ERR_TRANSC_UNAVAIL ('30'O),
647 RSL_ERR_SERV_OPT_UNAVAIL ('3f'O),
648 /* service or option not implemented */
649 RSL_ERR_ENCR_UNIMPL ('40'O),
650 RSL_ERR_SERV_OPT_UNIMPL ('4f'O),
651 /* invalid message */
652 RSL_ERR_RCH_ALR_ACTV_ALLOC ('50'O),
Harald Welte9912eb52018-02-25 13:30:15 +0100653 RSL_ERR_IPA_RCH_NOT_ACTV_ALLOC ('51'O),
654 RSL_ERR_IPA_CONN_INVALID ('52'O),
655 RSL_ERR_IPA_CONN_IN_USE ('53'O),
656 RSL_ERR_IPA_CONN_ALREADY_EXISTS ('54'O),
Harald Weltea8ed9062017-12-14 09:46:01 +0100657 RSL_ERR_INVALID_MESSAGE ('5f'O),
658 /* protocol error */
659 RSL_ERR_MSG_DISCR ('60'O),
660 RSL_ERR_MSG_TYPE ('61'O),
661 RSL_ERR_MSG_SEQ ('62'O),
662 RSL_ERR_IE_ERROR ('63'O),
663 RSL_ERR_MAND_IE_ERROR ('64'O),
664 RSL_ERR_OPT_IE_ERROR ('65'O),
665 RSL_ERR_IE_NONEXIST ('66'O),
666 RSL_ERR_IE_LENGTH ('67'O),
667 RSL_ERR_IE_CONTENT ('68'O),
668 RSL_ERR_PROTO ('6f'O),
669 /* interworking */
670 RSL_ERR_INTERWORKING ('7f'O)
671 };
Harald Welte643e2a62017-11-27 15:03:18 +0100672 type record RSL_IE_Cause {
Harald Welte6efa8e32017-12-09 22:34:06 +0100673 uint8_t len,
Harald Welte643e2a62017-11-27 15:03:18 +0100674 uint1_t e,
675 RSL_Cause cause,
676 octetstring cause_ext optional
Harald Welte6efa8e32017-12-09 22:34:06 +0100677 } with { variant (len) "LENGTHTO(e,cause,cause_ext)" }
Harald Welte643e2a62017-11-27 15:03:18 +0100678
Harald Welteefa7d912018-04-18 23:22:15 +0200679 template (value) RSL_IE_Cause ts_RSL_IE_Cause(RSL_Cause cause) := {
Harald Welte6efa8e32017-12-09 22:34:06 +0100680 len := 0, /* overwritten */
Harald Welte643e2a62017-11-27 15:03:18 +0100681 e := 0,
682 cause := cause,
683 cause_ext := omit
684 }
685
Harald Welte9abd1282018-02-19 19:18:17 +0100686 template RSL_IE_Cause tr_RSL_IE_Cause(template RSL_Cause cause) := {
687 len := ?,
688 e := 0,
689 cause := cause,
690 cause_ext := omit
691 }
692
Harald Weltec8d363c2019-05-19 20:36:48 +0200693 /* 9.3.29 */
694 type record RSL_SacchInfo {
695 uint8_t len,
696 uint8_t num_msgs,
697 RSL_SacchInfoElements elems
698 } with {
699 variant (len) "LENGTHTO(num_msgs,elems)";
700 variant (num_msgs) "LENGTHTO(elems)";
701 variant (num_msgs) "UNIT(elements)"
702 };
703 type record RSL_SacchInfoElement {
704 RSL_IE_SysinfoType si_type,
705 uint8_t len,
706 octetstring msg
707 } with {
708 variant (len) "LENGTHTO(msg)";
709 };
710 type record of RSL_SacchInfoElement RSL_SacchInfoElements;
711 template (value) RSL_SacchInfo ts_RSL_SacchInfo(template (value) RSL_SacchInfoElements elems) := {
712 len := 0, /* overwritten */
713 num_msgs := 0, /* overwritten */
714 elems := elems
715 }
716 template (value) RSL_SacchInfoElement ts_RSL_SacchInfoElem(RSL_IE_SysinfoType tp, octetstring msg) := {
717 si_type := tp,
718 len := lengthof(msg),
719 msg := msg
720 }
721
Eric Wild61edb7e2019-06-03 12:38:31 +0200722 /* 9.3.31 */
723 type record RSL_IE_MS_Power_Parameters {
724 uint8_t len,
725 octetstring params
726 } with {
727 variant (len) "LENGTHTO(params)";
728 };
729 template (value) RSL_IE_MS_Power_Parameters ts_RSL_IE_MS_Power_Parameters(octetstring params) := {
730 len := 0, /* overwritten */
731 params := params
732 }
733
Harald Welte643e2a62017-11-27 15:03:18 +0100734 /* 9.3.40 */
735 type enumerated RSL_ChanNeeded {
736 RSL_CHANNEED_ANY ('00'B),
737 RSL_CHANNEED_SDCCH ('01'B),
738 RSL_CHANNEED_TCH_F ('10'B),
739 RSL_CHANNEED_TCH_ForH ('11'B)
Harald Welte51d74102017-12-10 23:05:02 +0100740 } with { variant "FIELDLENGTH(2)" };
Harald Welte643e2a62017-11-27 15:03:18 +0100741 type record RSL_IE_ChanNeeded {
742 uint6_t reserved,
743 RSL_ChanNeeded chan_needed
744 }
745
Harald Weltecc373202018-09-10 10:28:21 +0200746 /* 9.3.41 CB Command Type */
747 type enumerated RSL_CbCommand {
748 RSL_CB_CMD_NORMAL ('0000'B),
749 RSL_CB_CMD_SCHEDULE ('1000'B),
750 RSL_CB_CMD_DEFAULT ('1110'B),
751 RSL_CB_CMD_NULL ('1111'B)
752 } with { variant "FIELDLENGTH(4)" };
753 type record RSL_IE_CbCommandType {
754 RSL_CbCommand command,
755 boolean default_bcast_null,
756 BIT1 spare,
757 uint2_t last_block
758 };
759 template (value) RSL_IE_CbCommandType ts_RSL_IE_CbCmdType(RSL_CbCommand cmd := RSL_CB_CMD_NORMAL,
760 uint2_t last_block := 1,
761 boolean def_bcast_null := true) := {
762 command := cmd,
763 default_bcast_null := def_bcast_null,
764 spare := '0'B,
765 last_block := last_block
766 }
767
Harald Welte4a129f82019-05-21 16:35:22 +0200768 /* 9.4.43 CBCH Load Information */
769 type record RSL_IE_CbchLoadInfo {
770 boolean overflow,
771 BIT3 spare,
772 uint4_t slot_count
773 };
774 template RSL_IE_CbchLoadInfo tr_CbchLoadInfo(template boolean overflow,
775 template uint4_t slot_count) := {
776 overflow := overflow,
777 spare := ?,
778 slot_count := slot_count
779 }
780 template (value) RSL_IE_CbchLoadInfo ts_CbchLoadInfo(boolean overflow, uint4_t slot_count) := {
781 overflow := overflow,
782 spare := '000'B,
783 slot_count := slot_count
784 }
785
Harald Welte643e2a62017-11-27 15:03:18 +0100786 /* 9.3.53 */
787 type record RSL_IE_MultirateCtrl {
788 uint3_t spare,
789 boolean od,
790 boolean pre,
791 uint2_t rae,
792 boolean tfo
793 }
794
795 type enumerated RSL_IE_SysinfoType {
796 RSL_SYSTEM_INFO_8 ('00000000'B),
797 RSL_SYSTEM_INFO_1 ('00000001'B),
798 RSL_SYSTEM_INFO_2 ('00000010'B),
799 RSL_SYSTEM_INFO_3 ('00000011'B),
800 RSL_SYSTEM_INFO_4 ('00000100'B),
801 RSL_SYSTEM_INFO_5 ('00000101'B),
802 RSL_SYSTEM_INFO_6 ('00000110'B),
803 RSL_SYSTEM_INFO_7 ('00000111'B),
804 RSL_SYSTEM_INFO_16 ('00001000'B),
805 RSL_SYSTEM_INFO_17 ('00001001'B),
806 RSL_SYSTEM_INFO_2bis ('00001010'B),
807 RSL_SYSTEM_INFO_2ter ('00001011'B),
808 RSL_SYSTEM_INFO_5bis ('00001101'B),
809 RSL_SYSTEM_INFO_5ter ('00001110'B),
810 RSL_SYSTEM_INFO_10 ('00001111'B),
811 RSL_EXT_MEAS_ORDER ('01000111'B),
812 RSL_MEAS_INFO ('01001000'B),
813 RSL_SYSTEM_INFO_13 ('00101000'B),
814 RSL_ERIC_SYSTEM_INFO_13 ('00001100'B),
815 RSL_SYSTEM_INFO_2quater ('00101001'B),
816 RSL_SYSTEM_INFO_9 ('00101010'B),
817 RSL_SYSTEM_INFO_18 ('00101011'B),
818 RSL_SYSTEM_INFO_19 ('00101100'B),
819 RSL_SYSTEM_INFO_20 ('00101101'B)
820 } with { variant "FIELDLENGTH(8)" }
821
Harald Welte9958a4d2017-12-14 21:21:33 +0100822 type record RSL_IE_IPA_ConnectionStats {
823 uint8_t len,
824 uint32_t tx_packets,
825 uint32_t tx_octets,
826 uint32_t rx_packets,
827 uint32_t rx_octets,
828 uint32_t lost_packets,
829 uint32_t jitter,
830 uint32_t avg_delay
831 } with { variant (len) "LENGTHTO(tx_packets,tx_octets,rx_packets,rx_octets,lost_packets,jitter,avg_delay)" }
832
833 type enumerated RSL_IPA_SpeechMode {
834 RSL_IPA_SPM_SENDRECV ('00'B),
835 RSL_IPA_SPM_RECVONLY ('01'B),
836 RSL_IPA_SPM_SENDONLY ('10'B),
837 RSL_IPA_SPM_RESERVED ('11'B)
838 } with { variant "FIELDLENGTH(2)" }
839
840 type enumerated RSL_IPA_Codec {
841 RSL_IPA_CODEC_FR ('0000'B),
842 RSL_IPA_CODEC_EFR ('0001'B),
843 RSL_IPA_CODEC_AMR_F ('0010'B),
844 RSL_IPA_CODEC_HR ('0011'B),
845 RSL_IPA_CODEC_AMR_H ('0101'B),
846 RSL_IPA_CODEC_RTP_PT ('1111'B)
847 } with { variant "FIELDLENGTH(4)" }
848
849 type record RSL_IE_IPA_SpeechMode {
850 BIT2 reserved,
851 RSL_IPA_SpeechMode mode,
852 RSL_IPA_Codec codec
853 }
854
Harald Welte0472ab42018-03-12 15:02:26 +0100855 /* 9.3.20 */
856 type enumerated RSL_IE_ReleaseMode {
857 RSL_REL_MODE_NORMAL ('00'B),
858 REL_REL_MODE_LOCAL ('01'B)
859 }
860
Neels Hofmeyr2bef0dd2021-04-22 21:46:00 +0000861 type record RSL_IE_OSMO_TrainingSequence {
862 uint8_t len,
863 uint8_t tsc_set,
864 uint8_t tsc
865 } with { variant (len) "LENGTHTO(tsc_set,tsc)" }
866
Harald Welte643e2a62017-11-27 15:03:18 +0100867 /* union of all IE bodies */
868 type union RSL_IE_Body {
869 RslChannelNr chan_nr,
870 RslLinkId link_id,
Harald Welte15bb5b52017-12-07 17:52:04 +0100871 RSL_L16V l3_info,
Harald Welte643e2a62017-11-27 15:03:18 +0100872 RSL_LV rlm_cause,
Harald Welte0472ab42018-03-12 15:02:26 +0100873 RSL_IE_ReleaseMode release_mode,
Harald Welte643e2a62017-11-27 15:03:18 +0100874 RSL_IE_ActivationType act_type,
Vadim Yanitskiye02dbcc2020-08-25 04:20:51 +0700875 RSL_IE_ChannelIdent chan_ident,
Harald Welte643e2a62017-11-27 15:03:18 +0100876 RSL_IE_ChannelMode chan_mode,
877 uint8_t handover_ref,
878 RSL_IE_BS_Power bs_power,
Vadim Yanitskiy802508e2020-11-11 07:25:47 +0700879 RSL_LV bs_power_params,
Harald Welte643e2a62017-11-27 15:03:18 +0100880 RSL_IE_MS_Power ms_power,
Eric Wild61edb7e2019-06-03 12:38:31 +0200881 RSL_IE_MS_Power_Parameters ms_power_params,
Harald Welte643e2a62017-11-27 15:03:18 +0100882 uint8_t timing_adv,
883 RSL_IE_MultirateCtrl multirate_ctrl,
Harald Weltea6706152019-05-19 20:38:18 +0200884 uint8_t msg_id,
Harald Welte643e2a62017-11-27 15:03:18 +0100885 RSL_IE_FrameNumber frame_nr,
886 RSL_IE_Cause cause,
887 uint8_t access_delay,
Harald Welted5f521e2017-12-07 17:53:06 +0100888 RSL_IE_RachLoad rach_load,
Harald Welte643e2a62017-11-27 15:03:18 +0100889 uint8_t meas_res_nr,
Harald Welte2691adf2018-02-22 17:32:39 +0100890 uint8_t ms_timing_offset,
891 RSL_IE_UplinkMeas uplink_meas,
Harald Welte643e2a62017-11-27 15:03:18 +0100892 RSL_IE_L1Info l1_info,
893 RSL_IE_SysinfoType sysinfo_type,
894 uint16_t paging_load,
895 uint8_t paging_group,
896 RSL_IE_ChanNeeded chan_needed,
Harald Weltecc373202018-09-10 10:28:21 +0200897 RSL_IE_CbCommandType cb_cmd_type,
898 RSL_LV smscb_message,
Harald Welte4a129f82019-05-21 16:35:22 +0200899 RSL_IE_CbchLoadInfo cbch_load_info,
Vadim Yanitskiy9f699532021-06-03 17:29:22 +0200900 RSL_IE_ResourceInfo resource_info,
Harald Weltec8d363c2019-05-19 20:36:48 +0200901 RSL_SacchInfo sacch_info,
Harald Weltecc373202018-09-10 10:28:21 +0200902
Harald Welte643e2a62017-11-27 15:03:18 +0100903 RSL_IE_StartingTime starting_time,
Harald Welte73cd2712017-12-17 00:44:52 +0100904 RSL_IE_EncryptionInfo encr_info,
Harald Weltea3ff6702019-05-20 20:03:50 +0200905 uint8_t smscb_chan_ind,
Harald Welte643e2a62017-11-27 15:03:18 +0100906 RSL_IE_RequestRef req_ref,
907 RSL_LV full_imm_ass_info,
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +0700908 MobileIdentityLV ms_identity,
Harald Welte643e2a62017-11-27 15:03:18 +0100909
Harald Welte9958a4d2017-12-14 21:21:33 +0100910 uint16_t ipa_conn_id,
911 uint16_t ipa_local_port,
912 uint16_t ipa_remote_port,
913 uint32_t ipa_local_ip,
914 uint32_t ipa_remote_ip,
915 uint8_t ipa_rtp_pt,
916 uint8_t ipa_rtp_pt2,
917 RSL_IE_IPA_ConnectionStats ipa_stats,
918 RSL_IE_IPA_SpeechMode ipa_speech_mode,
919
Neels Hofmeyr2bef0dd2021-04-22 21:46:00 +0000920 RSL_IE_OSMO_TrainingSequence osmo_training_sequence,
921
Harald Welte643e2a62017-11-27 15:03:18 +0100922 RSL_LV other
923 }
924
925 type record RSL_IE {
926 RSL_IE_Type iei,
927 RSL_IE_Body body
928 } with { variant (body) "CROSSTAG(
929 chan_nr, iei = RSL_IE_CHAN_NR;
930 link_id, iei = RSL_IE_LINK_IDENT;
931 l3_info, iei = RSL_IE_L3_INFO;
932 rlm_cause, iei = RSL_IE_RLM_CAUSE;
933 release_mode, iei = RSL_IE_RELEASE_MODE;
934 act_type, iei = RSL_IE_ACT_TYPE;
Vadim Yanitskiye02dbcc2020-08-25 04:20:51 +0700935 chan_ident, iei = RSL_IE_CHAN_IDENT;
Harald Welte643e2a62017-11-27 15:03:18 +0100936 chan_mode, iei = RSL_IE_CHAN_MODE;
937 handover_ref, iei = RSL_IE_HANDO_REF;
938 bs_power, iei = RSL_IE_BS_POWER;
Vadim Yanitskiy802508e2020-11-11 07:25:47 +0700939 bs_power_params, iei = RSL_IE_BS_POWER_PARAM;
Harald Welte643e2a62017-11-27 15:03:18 +0100940 ms_power, iei = RSL_IE_MS_POWER;
Eric Wild61edb7e2019-06-03 12:38:31 +0200941 ms_power_params, iei = RSL_IE_MS_POWER_PARAM;
Harald Welte643e2a62017-11-27 15:03:18 +0100942 timing_adv, iei = RSL_IE_TIMING_ADVANCE;
943 multirate_ctrl, iei = RSL_IE_MR_CONTROL;
Harald Weltea6706152019-05-19 20:38:18 +0200944 msg_id, iei = RSL_IE_MSG_ID;
Harald Welte643e2a62017-11-27 15:03:18 +0100945
946 frame_nr, iei = RSL_IE_FRAME_NUMBER;
947 cause, iei = RSL_IE_CAUSE;
948 access_delay, iei = RSL_IE_ACCESS_DELAY;
Harald Welted5f521e2017-12-07 17:53:06 +0100949 rach_load, iei = RSL_IE_RACH_LOAD;
Harald Welte643e2a62017-11-27 15:03:18 +0100950 meas_res_nr, iei = RSL_IE_MEAS_RES_NR;
Harald Welte2691adf2018-02-22 17:32:39 +0100951 ms_timing_offset, iei = RSL_IE_MS_TIMING_OFFSET;
952 uplink_meas, iei = RSL_IE_UPLINK_MEAS;
Harald Welte643e2a62017-11-27 15:03:18 +0100953 l1_info, iei = RSL_IE_L1_INFO;
954 sysinfo_type, iei = RSL_IE_SYSINFO_TYPE;
955 paging_load, iei = RSL_IE_PAGING_LOAD;
956 paging_group, iei = RSL_IE_PAGING_GROUP;
957 chan_needed, iei = RSL_IE_CHAN_NEEDED;
Harald Weltecc373202018-09-10 10:28:21 +0200958 cb_cmd_type, iei = RSL_IE_CB_CMD_TYPE;
959 smscb_message, iei = RSL_IE_SMSCB_MSG;
Harald Welte4a129f82019-05-21 16:35:22 +0200960 cbch_load_info, iei = RSL_IE_CBCH_LOAD_INFO;
Vadim Yanitskiy9f699532021-06-03 17:29:22 +0200961 resource_info, iei = RSL_IE_RESOURCE_INFO;
Harald Weltec8d363c2019-05-19 20:36:48 +0200962 sacch_info, iei = RSL_IE_SACCH_INFO;
Harald Welte643e2a62017-11-27 15:03:18 +0100963 starting_time, iei = RSL_IE_STARTNG_TIME;
Harald Welte73cd2712017-12-17 00:44:52 +0100964 encr_info, iei = RSL_IE_ENCR_INFO;
Harald Weltea3ff6702019-05-20 20:03:50 +0200965 smscb_chan_ind, iei = RSL_IE_SMSCB_CHAN_INDICATOR;
Harald Welte643e2a62017-11-27 15:03:18 +0100966
967 req_ref, iei = RSL_IE_REQ_REFERENCE;
Harald Weltefff69302017-12-07 17:53:42 +0100968 full_imm_ass_info, iei = RSL_IE_FULL_IMM_ASS_INFO;
969 ms_identity, iei = RSL_IE_MS_IDENTITY;
970 other, iei = RSL_IE_FULL_BCCH_INFO;
Harald Welte643e2a62017-11-27 15:03:18 +0100971
Harald Welte9958a4d2017-12-14 21:21:33 +0100972 ipa_conn_id, iei = RSL_IE_IPAC_CONN_ID;
973 ipa_remote_ip, iei = RSL_IE_IPAC_REMOTE_IP;
974 ipa_remote_port, iei = RSL_IE_IPAC_REMOTE_PORT;
975 ipa_local_ip, iei = RSL_IE_IPAC_LOCAL_IP;
976 ipa_local_port, iei = RSL_IE_IPAC_LOCAL_PORT;
977 ipa_rtp_pt, iei = RSL_IE_IPAC_RTP_PAYLOAD;
978 ipa_rtp_pt2, iei = RSL_IE_IPAC_RTP_PAYLOAD2;
979 ipa_stats, iei = RSL_IE_IPAC_CONN_STAT;
980 ipa_speech_mode, iei = RSL_IE_IPAC_SPEECH_MODE;
981
Neels Hofmeyr2bef0dd2021-04-22 21:46:00 +0000982 osmo_training_sequence, iei = RSL_IE_OSMO_TRAINING_SEQUENCE;
983
Harald Welte643e2a62017-11-27 15:03:18 +0100984 other, OTHERWISE;
985 )" };
986
Harald Welte735dd072017-12-12 14:55:17 +0100987 /* For some reason the TTCN-3 RAW codec cannot automatically figure out the IEI
988 * that it needs to set for a given union-choice (body). So we have to explicitly
989 * specify the IEI by the caller :( */
Harald Welteefa7d912018-04-18 23:22:15 +0200990 template (value) RSL_IE t_RSL_IE(RSL_IE_Type iei, template (value) RSL_IE_Body body) := {
Harald Welte735dd072017-12-12 14:55:17 +0100991 iei := iei,
Harald Welte643e2a62017-11-27 15:03:18 +0100992 body := body
993 }
994
Harald Weltec2877752017-12-07 17:54:35 +0100995 template RSL_IE tr_RSL_IE(template RSL_IE_Body body) := {
996 iei := ?, /* overwritten? */
997 body := body
998 }
999
1000
Harald Welte643e2a62017-11-27 15:03:18 +01001001 type record of RSL_IE RSL_IE_List;
1002
1003 type record RSL_Message {
1004 RSL_MessageDiscriminator msg_disc,
1005 RSL_MessageType msg_type,
1006 RSL_IE_List ies optional
1007 }
1008
1009 external function enc_RSL_Message(in RSL_Message msg) return octetstring
1010 with { extension "prototype(convert) encode(RAW)" };
1011 external function dec_RSL_Message(in octetstring stream) return RSL_Message
1012 with { extension "prototype(convert) decode(RAW)" };
1013
Harald Weltebc330be2017-12-09 00:56:36 +01001014 template RSL_Message tr_RSL_MsgDiscType(template RSL_MessageDiscriminator m_disc,
Harald Welte643e2a62017-11-27 15:03:18 +01001015 RSL_MessageType m_type) := {
1016 msg_disc := m_disc,
1017 msg_type := m_type,
1018 ies := *
1019 }
1020
Harald Welteefa7d912018-04-18 23:22:15 +02001021 template (value) RSL_Message ts_RSL_MsgDiscType(template (value) RSL_MessageDiscriminator m_disc,
1022 template (value) RSL_MessageType msg_type,
1023 template (omit) RSL_IE_List ies := omit) := {
Harald Welte4a267362017-12-09 17:49:32 +01001024 msg_disc := m_disc,
1025 msg_type := msg_type,
1026 ies := ies
1027 }
1028
Harald Weltebc330be2017-12-09 00:56:36 +01001029template RSL_Message tr_RSL_MsgType(template RSL_MessageType msg_type) := {
1030 msg_disc := ?,
1031 msg_type := msg_type,
1032 ies := *
1033}
1034
1035/* Common Channel Management */
1036template RSL_Message tr_RSL_MsgTypeC(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
1037 msg_disc := { RSL_MDISC_CCHAN, ? }
1038}
1039
1040/* RLL */
1041template RSL_Message tr_RSL_MsgTypeR(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
1042 msg_disc := { RSL_MDISC_RLL, true }
1043}
1044
1045/* Dedicated Channel Management */
1046template RSL_Message tr_RSL_MsgTypeD(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
1047 msg_disc := { RSL_MDISC_DCHAN, ? }
1048}
1049
1050/* Dedicated Channel Management */
1051template RSL_Message tr_RSL_MsgTypeT(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
1052 msg_disc := { RSL_MDISC_TRX_MGMT, ? }
1053}
1054
1055
1056/* dedicated channel or RLL */
1057template RSL_Message tr_RSL_MsgTypeDR(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
Harald Weltee5408222018-01-29 21:57:58 +01001058 msg_disc := ({RSL_MDISC_DCHAN,?}, {RSL_MDISC_RLL,?}, {RSL_MDISC_IPACCESS,false})
Harald Weltebc330be2017-12-09 00:56:36 +01001059}
1060
1061
Harald Welte643e2a62017-11-27 15:03:18 +01001062 /* 8.3.1 BSC -> BTS */
Harald Welteefa7d912018-04-18 23:22:15 +02001063 template (value) RSL_Message ts_RSL_DATA_REQ(template (value) RslChannelNr chan_nr,
1064 template (value) RslLinkId link_id,
1065 octetstring l3_info) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001066 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, true),
1067 msg_type := RSL_MT_DATA_REQ,
1068 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001069 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1070 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
1071 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
Harald Welte643e2a62017-11-27 15:03:18 +01001072 }
1073 }
1074
Harald Welte7794d5b2017-12-16 23:00:20 +01001075 template RSL_Message tr_RSL_DATA_REQ(template RslChannelNr chan_nr :=?,
1076 template RslLinkId link_id := ?,
1077 template octetstring l3_info := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001078 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, true),
Harald Welte7794d5b2017-12-16 23:00:20 +01001079 msg_type := RSL_MT_DATA_REQ,
1080 ies :={
1081 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1082 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
1083 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
1084 }
1085 }
1086
1087
Harald Welte643e2a62017-11-27 15:03:18 +01001088 /* 8.3.2 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001089 template (value) RSL_Message ts_RSL_DATA_IND(template (value) RslChannelNr chan_nr,
1090 template (value) RslLinkId link_id,
1091 octetstring l3_info) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001092 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, true),
1093 msg_type := RSL_MT_DATA_IND,
1094 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001095 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1096 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
1097 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
Harald Welte643e2a62017-11-27 15:03:18 +01001098 }
1099 }
Harald Welte9abd1282018-02-19 19:18:17 +01001100 template RSL_Message tr_RSL_DATA_IND(template RslChannelNr chan_nr, template RslLinkId link_id,
1101 template octetstring l3_info := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001102 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, true),
Harald Welte9abd1282018-02-19 19:18:17 +01001103 msg_type := RSL_MT_DATA_IND,
1104 ies :={
1105 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1106 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
1107 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
1108 }
1109 }
Harald Welte643e2a62017-11-27 15:03:18 +01001110
1111 /* 8.3.3 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001112 template (value) RSL_Message ts_RSL_ERROR_IND(template (value) RslChannelNr chan_nr,
Harald Weltea7d81f12019-06-02 22:33:19 +02001113 template (value) RslLinkId link_id,
1114 template (value) octetstring rlm_cause) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001115 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1116 msg_type := RSL_MT_ERROR_IND,
1117 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001118 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1119 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
Harald Weltea7d81f12019-06-02 22:33:19 +02001120 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{rlm_cause := ts_RSL_LV(rlm_cause)})
Harald Welte643e2a62017-11-27 15:03:18 +01001121 }
1122 }
Harald Welte9abd1282018-02-19 19:18:17 +01001123 template RSL_Message tr_RSL_ERROR_IND(template RslChannelNr chan_nr, template RslLinkId link_id,
Harald Weltea7d81f12019-06-02 22:33:19 +02001124 template octetstring rlm_cause := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001125 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001126 msg_type := RSL_MT_ERROR_IND,
1127 ies :={
1128 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1129 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
Harald Weltea7d81f12019-06-02 22:33:19 +02001130 tr_RSL_IE(RSL_IE_Body:{rlm_cause := tr_RSL_LV(rlm_cause)})
Harald Welte9abd1282018-02-19 19:18:17 +01001131 }
1132 }
Harald Welte643e2a62017-11-27 15:03:18 +01001133
Harald Welteefa7d912018-04-18 23:22:15 +02001134 /* 8.3.4 BTS <- BSC */
1135 template (value) RSL_Message ts_RSL_EST_REQ(template (value) RslChannelNr chan_nr,
1136 template (value) RslLinkId link_id) := {
1137 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1138 msg_type := RSL_MT_EST_REQ,
1139 ies := {
1140 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1141 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
1142 }
1143 }
1144 template RSL_Message tr_RSL_EST_REQ(template RslChannelNr chan_nr, template RslLinkId link_id) := {
1145 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
1146 msg_type := RSL_MT_EST_REQ,
1147 ies := {
1148 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1149 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1150 }
1151 }
1152
1153 /* 8.3.5 BTS -> BSC */
1154 template (value) RSL_Message ts_RSL_EST_CONF(template (value) RslChannelNr chan_nr,
1155 template (value) RslLinkId link_id) := {
1156 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1157 msg_type := RSL_MT_EST_CONF,
1158 ies := {
1159 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1160 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
1161 }
1162 }
1163 template RSL_Message tr_RSL_EST_CONF(template RslChannelNr chan_nr, template RslLinkId link_id) := {
1164 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
1165 msg_type := RSL_MT_EST_CONF,
1166 ies := {
1167 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1168 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1169 }
1170 }
1171
Harald Welte643e2a62017-11-27 15:03:18 +01001172 /* 8.3.6 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001173 template (value) RSL_Message ts_RSL_EST_IND(template (value) RslChannelNr chan_nr,
1174 template (value) RslLinkId link_id,
1175 octetstring l3_info) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001176 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1177 msg_type := RSL_MT_EST_IND,
1178 ies := {
Harald Welte735dd072017-12-12 14:55:17 +01001179 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1180 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
1181 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
Harald Welte643e2a62017-11-27 15:03:18 +01001182 }
1183 }
Harald Welte9abd1282018-02-19 19:18:17 +01001184 template RSL_Message tr_RSL_EST_IND(template RslChannelNr chan_nr, template RslLinkId link_id,
1185 template octetstring l3_info := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001186 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001187 msg_type := RSL_MT_EST_IND,
1188 ies := {
1189 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1190 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
1191 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
1192 }
1193 }
Harald Welte0472ab42018-03-12 15:02:26 +01001194 template RSL_Message tr_RSL_EST_IND_NOL3(template RslChannelNr chan_nr, template RslLinkId link_id) :=
1195{
1196 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
1197 msg_type := RSL_MT_EST_IND,
1198 ies := {
1199 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1200 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1201 }
1202 }
1203
Harald Welte643e2a62017-11-27 15:03:18 +01001204
1205 /* 8.3.7 BSC -> BTS */
Harald Welteefa7d912018-04-18 23:22:15 +02001206 template (value) RSL_Message ts_RSL_REL_REQ(template (value) RslChannelNr chan_nr,
Harald Welte0472ab42018-03-12 15:02:26 +01001207 template (value) RslLinkId link_id,
1208 template (value) RSL_IE_ReleaseMode rel_mode := RSL_REL_MODE_NORMAL) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001209 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1210 msg_type := RSL_MT_REL_REQ,
1211 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001212 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
Harald Welte0472ab42018-03-12 15:02:26 +01001213 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
1214 t_RSL_IE(RSL_IE_RELEASE_MODE, RSL_IE_Body:{release_mode := rel_mode})
Harald Welte643e2a62017-11-27 15:03:18 +01001215 }
1216 }
Harald Weltee8a5ab12017-12-09 22:34:57 +01001217 template RSL_Message tr_RSL_REL_REQ(template RslChannelNr chan_nr,
Harald Welte0472ab42018-03-12 15:02:26 +01001218 template RslLinkId link_id,
1219 template RSL_IE_ReleaseMode rel_mode := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001220 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Weltee8a5ab12017-12-09 22:34:57 +01001221 msg_type := RSL_MT_REL_REQ,
1222 ies :={
1223 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1224 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
Harald Welte0472ab42018-03-12 15:02:26 +01001225 tr_RSL_IE(RSL_IE_Body:{release_mode := rel_mode})
Harald Weltee8a5ab12017-12-09 22:34:57 +01001226 }
1227 }
Harald Welte643e2a62017-11-27 15:03:18 +01001228
1229 /* 8.3.8 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001230 template (value) RSL_Message ts_RSL_REL_CONF(template (value) RslChannelNr chan_nr,
1231 template (value) RslLinkId link_id) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001232 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1233 msg_type := RSL_MT_REL_CONF,
1234 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001235 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1236 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
Harald Welte643e2a62017-11-27 15:03:18 +01001237 }
1238 }
Harald Welte9abd1282018-02-19 19:18:17 +01001239 template RSL_Message tr_RSL_REL_CONF(template RslChannelNr chan_nr, template RslLinkId link_id) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001240 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001241 msg_type := RSL_MT_REL_CONF,
1242 ies :={
1243 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1244 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1245 }
1246 }
Harald Welte643e2a62017-11-27 15:03:18 +01001247
1248 /* 8.3.9 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001249 template (value) RSL_Message ts_RSL_REL_IND(template (value) RslChannelNr chan_nr,
1250 template (value) RslLinkId link_id) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001251 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1252 msg_type := RSL_MT_REL_IND,
1253 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001254 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1255 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
Harald Welte643e2a62017-11-27 15:03:18 +01001256 }
1257 }
Harald Welte9abd1282018-02-19 19:18:17 +01001258 template RSL_Message tr_RSL_REL_IND(template RslChannelNr chan_nr, template RslLinkId link_id) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001259 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001260 msg_type := RSL_MT_REL_IND,
1261 ies :={
1262 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1263 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1264 }
1265 }
Harald Welte643e2a62017-11-27 15:03:18 +01001266
1267 /* 8.3.10 BSC -> BTS */
Harald Welteefa7d912018-04-18 23:22:15 +02001268 template (value) RSL_Message ts_RSL_UNITDATA_REQ(template (value) RslChannelNr chan_nr,
1269 template (value) RslLinkId link_id,
1270 octetstring l3_info)
Harald Welte643e2a62017-11-27 15:03:18 +01001271 modifies ts_RSL_DATA_REQ := {
1272 msg_type := RSL_MT_UNIT_DATA_REQ
1273 }
Harald Welte0472ab42018-03-12 15:02:26 +01001274 template RSL_Message tr_RSL_UNITDATA_REQ(template RslChannelNr chan_nr,
1275 template RslLinkId link_id,
Vadim Yanitskiy8f98d3f2018-10-03 17:58:10 +07001276 template octetstring l3_info := ?)
Harald Welte0472ab42018-03-12 15:02:26 +01001277 modifies tr_RSL_DATA_REQ := {
1278 msg_type := RSL_MT_UNIT_DATA_REQ
1279 }
1280
Harald Welte643e2a62017-11-27 15:03:18 +01001281
1282 /* 8.3.11 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001283 template (value) RSL_Message ts_RSL_UNITDATA_IND(template (value) RslChannelNr chan_nr,
1284 template (value) RslLinkId link_id,
1285 octetstring l3_info)
Harald Welte643e2a62017-11-27 15:03:18 +01001286 modifies ts_RSL_DATA_IND := {
1287 msg_type := RSL_MT_UNIT_DATA_IND
1288 }
Harald Welte0472ab42018-03-12 15:02:26 +01001289 template RSL_Message tr_RSL_UNITDATA_IND(template RslChannelNr chan_nr,
Vadim Yanitskiyfabe0f22018-10-03 17:51:47 +07001290 template RslLinkId link_id,
Vadim Yanitskiy8f98d3f2018-10-03 17:58:10 +07001291 template octetstring l3_info := ?)
Harald Welte0472ab42018-03-12 15:02:26 +01001292 modifies tr_RSL_DATA_IND := {
1293 msg_type := RSL_MT_UNIT_DATA_IND
1294 }
1295
1296
Harald Welte643e2a62017-11-27 15:03:18 +01001297
1298
1299 /* DEDICATED CANNEL MANAGEMENT MESSAGES */
1300
1301 /* 8.4.1 BSC -> BTS */
Harald Welteefa7d912018-04-18 23:22:15 +02001302 template (value) RSL_Message ts_RSL_CHAN_ACT(template (value) RslChannelNr chan_nr,
Harald Welte921f9e02019-05-19 22:27:11 +02001303 template (value) RSL_IE_ChannelMode mode,
1304 template (value) RSL_IE_ActivationType at := t_RSL_IE_ActType_IA) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001305 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1306 msg_type := RSL_MT_CHAN_ACTIV,
1307 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001308 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
Harald Welte921f9e02019-05-19 22:27:11 +02001309 t_RSL_IE(RSL_IE_ACT_TYPE, RSL_IE_Body:{act_type := at}),
Harald Welte735dd072017-12-12 14:55:17 +01001310 t_RSL_IE(RSL_IE_CHAN_MODE, RSL_IE_Body:{chan_mode := mode})
Harald Welte643e2a62017-11-27 15:03:18 +01001311 /* lots of optional IEs */
1312 }
1313 }
Harald Welte94e0c342018-04-07 11:33:23 +02001314 template RSL_Message tr_RSL_CHAN_ACT(template RslChannelNr chan_nr,
Harald Welte921f9e02019-05-19 22:27:11 +02001315 template RSL_IE_ChannelMode mode,
1316 template (value) RSL_IE_ActivationType at := t_RSL_IE_ActType_IA) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001317 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte94e0c342018-04-07 11:33:23 +02001318 msg_type := RSL_MT_CHAN_ACTIV,
1319 ies :={
1320 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
Harald Welte921f9e02019-05-19 22:27:11 +02001321 tr_RSL_IE(RSL_IE_Body:{act_type := at}),
Harald Welte94e0c342018-04-07 11:33:23 +02001322 tr_RSL_IE(RSL_IE_Body:{chan_mode := mode}),
1323 /* lots of optional IEs */
1324 *
1325 }
1326 }
1327 template RSL_Message tr_RSL_CHAN_ACT_PDCH(template RslChannelNr chan_nr,
1328 template RSL_IE_ChannelMode mode) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001329 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte94e0c342018-04-07 11:33:23 +02001330 msg_type := RSL_MT_CHAN_ACTIV,
1331 ies :={
1332 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1333 tr_RSL_IE(RSL_IE_Body:{act_type := t_RSL_IE_ActType_PDCH}),
1334 /* lots of optional IEs */
1335 *
1336 }
1337 }
1338
Harald Welte643e2a62017-11-27 15:03:18 +01001339
1340 /* 8.4.2 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001341 template (value) RSL_Message ts_RSL_CHAN_ACT_ACK(template (value) RslChannelNr chan_nr,
1342 GsmFrameNumber fn) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001343 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1344 msg_type := RSL_MT_CHAN_ACTIV_ACK,
1345 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001346 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1347 t_RSL_IE(RSL_IE_FRAME_NUMBER, RSL_IE_Body:{frame_nr := ts_RSL_IE_FrameNumber(fn)})
Harald Welte643e2a62017-11-27 15:03:18 +01001348 }
1349 }
Harald Welte9abd1282018-02-19 19:18:17 +01001350 template RSL_Message tr_RSL_CHAN_ACT_ACK(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001351 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001352 msg_type := RSL_MT_CHAN_ACTIV_ACK,
1353 ies := {
1354 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1355 tr_RSL_IE(RSL_IE_Body:{frame_nr := ?})
1356 }
1357 }
Harald Welte643e2a62017-11-27 15:03:18 +01001358
1359 /* 8.4.3 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001360 template (value) RSL_Message ts_RSL_CHAN_ACT_NACK(template (value) RslChannelNr chan_nr,
1361 RSL_Cause cause) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001362 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1363 msg_type := RSL_MT_CHAN_ACTIV_NACK,
1364 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001365 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1366 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
Harald Welte643e2a62017-11-27 15:03:18 +01001367 }
1368 }
Harald Welte9abd1282018-02-19 19:18:17 +01001369 template RSL_Message tr_RSL_CHAN_ACT_NACK(template RslChannelNr chan_nr,
1370 template RSL_Cause cause := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001371 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001372 msg_type := RSL_MT_CHAN_ACTIV_NACK,
1373 ies := {
1374 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1375 tr_RSL_IE(RSL_IE_Body:{cause := ?})
1376 }
1377 }
Harald Welte643e2a62017-11-27 15:03:18 +01001378
1379 /* 8.4.4 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001380 template (value) RSL_Message ts_RSL_CONN_FAIL_IND(RslChannelNr chan_nr, RSL_Cause cause) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001381 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1382 msg_type := RSL_MT_CONN_FAIL,
1383 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001384 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1385 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
Harald Welte643e2a62017-11-27 15:03:18 +01001386 }
1387 }
Harald Welte9abd1282018-02-19 19:18:17 +01001388 template RSL_Message tr_RSL_CONN_FAIL_IND(template RslChannelNr chan_nr,
1389 template RSL_Cause cause := ?) := {
1390 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1391 msg_type := RSL_MT_CONN_FAIL,
1392 ies :={
1393 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1394 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
1395 }
1396 }
Harald Welte643e2a62017-11-27 15:03:18 +01001397
Harald Weltee8a5ab12017-12-09 22:34:57 +01001398 /* 8.4.5 BSC -> BTS */
1399 template RSL_Message tr_RSL_DEACT_SACCH(template RslChannelNr chan_nr) := {
1400 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1401 msg_type := RSL_MT_DEACTIVATE_SACCH,
1402 ies := {
1403 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
1404 }
1405 }
Harald Welteefa7d912018-04-18 23:22:15 +02001406 template (value) RSL_Message ts_RSL_DEACT_SACCH(template (value) RslChannelNr chan_nr) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001407 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1408 msg_type := RSL_MT_DEACTIVATE_SACCH,
1409 ies := {
1410 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1411 }
1412 }
1413
Harald Weltee8a5ab12017-12-09 22:34:57 +01001414
Harald Welte73cd2712017-12-17 00:44:52 +01001415 /* 8.4.6 BSC ->BTS */
1416 template RSL_Message tr_RSL_ENCR_CMD(template RslChannelNr chan_nr,
1417 template RslLinkId link_id := ?,
Harald Weltee613f962018-04-18 22:38:16 +02001418 template RSL_AlgId alg := ?,
Harald Welte73cd2712017-12-17 00:44:52 +01001419 template octetstring key := ?,
1420 template octetstring l3_info := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001421 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte73cd2712017-12-17 00:44:52 +01001422 msg_type := RSL_MT_ENCR_CMD,
1423 ies := {
1424 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1425 tr_RSL_IE(RSL_IE_Body:{encr_info := tr_RSL_IE_EncrInfo(alg, key)}),
1426 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
1427 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
1428 }
1429 }
Harald Welteefa7d912018-04-18 23:22:15 +02001430 template (value) RSL_Message ts_RSL_ENCR_CMD(template (value) RslChannelNr chan_nr,
1431 template (value) RslLinkId link_id,
Harald Weltee613f962018-04-18 22:38:16 +02001432 template (value) RSL_AlgId alg, octetstring key,
Harald Welteefa7d912018-04-18 23:22:15 +02001433 octetstring l3_info) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001434 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1435 msg_type := RSL_MT_ENCR_CMD,
1436 ies := {
1437 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
Harald Welteefa7d912018-04-18 23:22:15 +02001438 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 +01001439 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
Harald Welteefa7d912018-04-18 23:22:15 +02001440 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
Harald Welte9abd1282018-02-19 19:18:17 +01001441 }
1442 }
Harald Welte73cd2712017-12-17 00:44:52 +01001443
Harald Welte2691adf2018-02-22 17:32:39 +01001444 template RSL_Message tr_RSL_MEAS_RES(template RslChannelNr chan_nr,
1445 template uint8_t meas_res_nr := ?,
1446 template RSL_IE_UplinkMeas ul_meas := ?,
1447 template RSL_IE_BS_Power bs_power := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001448 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte2691adf2018-02-22 17:32:39 +01001449 msg_type := RSL_MT_MEAS_RES,
1450 ies := {
1451 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1452 tr_RSL_IE(RSL_IE_Body:{meas_res_nr := meas_res_nr}),
1453 tr_RSL_IE(RSL_IE_Body:{uplink_meas := ul_meas}),
1454 tr_RSL_IE(RSL_IE_Body:{bs_power := bs_power}),
1455 *
1456 }
1457 }
1458
Philipp Maierdd841d32019-12-17 14:44:54 +01001459 /* Receive template for a measurement report that lacks the measurement report
1460 * from the MS (l1_info, l3_info and ms timing offset */
1461 template RSL_Message tr_RSL_MEAS_RES_EMPTY(template RslChannelNr chan_nr,
1462 template uint8_t meas_res_nr := ?,
1463 template RSL_IE_UplinkMeas ul_meas := ?,
1464 template RSL_IE_BS_Power bs_power := ?) := {
1465 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1466 msg_type := RSL_MT_MEAS_RES,
1467 ies := {
1468 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1469 tr_RSL_IE(RSL_IE_Body:{meas_res_nr := meas_res_nr}),
1470 tr_RSL_IE(RSL_IE_Body:{uplink_meas := ul_meas}),
1471 tr_RSL_IE(RSL_IE_Body:{bs_power := bs_power})
1472 }
1473 }
1474
Harald Welte39b47be2018-02-23 18:58:48 +01001475 /* Osmocom specific template, require lots of optional fields to be present */
1476 template RSL_Message tr_RSL_MEAS_RES_OSMO(template RslChannelNr chan_nr,
1477 template uint8_t meas_res_nr := ?,
1478 template RSL_IE_UplinkMeas ul_meas := ?,
1479 template RSL_IE_BS_Power bs_power := ?,
1480 template RSL_IE_L1Info l1_info := ?,
1481 template octetstring l3_info := ?,
1482 template uint8_t ms_to := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001483 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte39b47be2018-02-23 18:58:48 +01001484 msg_type := RSL_MT_MEAS_RES,
1485 ies := {
1486 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1487 tr_RSL_IE(RSL_IE_Body:{meas_res_nr := meas_res_nr}),
1488 tr_RSL_IE(RSL_IE_Body:{uplink_meas := ul_meas}),
1489 tr_RSL_IE(RSL_IE_Body:{bs_power := bs_power}),
1490 tr_RSL_IE(RSL_IE_Body:{l1_info := l1_info}),
1491 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)}),
1492 tr_RSL_IE(RSL_IE_Body:{ms_timing_offset := ms_to})
1493 }
1494 }
1495
Eric Wildf1827a72019-05-28 17:37:35 +02001496 /* 8.4.9 BSC -> BTS */
1497 template (value) RSL_Message ts_RSL_MODE_MODIFY_REQ(template (value) RslChannelNr chan_nr,
1498 template (value) RSL_IE_ChannelMode mode) := {
1499 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1500 msg_type := RSL_MT_MODE_MODIFY_REQ,
1501 ies :={
1502 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1503 t_RSL_IE(RSL_IE_CHAN_MODE, RSL_IE_Body:{chan_mode := mode})
1504 /* lots of optional IEs */
1505 }
1506 }
1507 template RSL_Message tr_RSL_MODE_MODIFY_REQ(template RslChannelNr chan_nr,
1508 template RSL_IE_ChannelMode mode) := {
1509 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1510 msg_type := RSL_MT_MODE_MODIFY_REQ,
1511 ies :={
1512 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1513 tr_RSL_IE(RSL_IE_Body:{chan_mode := mode}),
1514 /* lots of optional IEs */
1515 *
1516 }
1517 }
Neels Hofmeyr9f3e6ac2021-04-08 23:09:24 +02001518
1519 template RSL_Message tr_RSL_MODE_MODIFY_REQ_with_OSMO_TSC(template RslChannelNr chan_nr,
1520 template RSL_IE_ChannelMode mode,
1521 template uint8_t tsc_set := ?,
1522 template uint8_t tsc := ?) := {
1523 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1524 msg_type := RSL_MT_MODE_MODIFY_REQ,
1525 ies := {
1526 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1527 tr_RSL_IE(RSL_IE_Body:{chan_mode := mode}),
1528 tr_RSL_IE(RSL_IE_Body:{osmo_training_sequence := {
1529 len := ?,
1530 tsc_set := tsc_set,
1531 tsc := tsc
1532 }
1533 })
1534 }
1535 };
Eric Wildf1827a72019-05-28 17:37:35 +02001536
Harald Welte7794d5b2017-12-16 23:00:20 +01001537 /* 8.4.10 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001538 template (value) RSL_Message ts_RSL_MODE_MODIFY_ACK(template (value) RslChannelNr chan_nr) := {
Harald Welte7794d5b2017-12-16 23:00:20 +01001539 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1540 msg_type := RSL_MT_MODE_MODIFY_ACK,
1541 ies := {
1542 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1543 }
1544 }
Harald Welte9abd1282018-02-19 19:18:17 +01001545 template RSL_Message tr_RSL_MODE_MODIFY_ACK(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001546 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001547 msg_type := RSL_MT_MODE_MODIFY_ACK,
1548 ies := {
1549 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
1550 }
1551 }
Harald Welte7794d5b2017-12-16 23:00:20 +01001552
Harald Welte643e2a62017-11-27 15:03:18 +01001553 /* 8.4.11 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001554 template (value) RSL_Message ts_RSL_MODE_MODIFY_NACK(template (value) RslChannelNr chan_nr,
1555 RSL_Cause cause) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001556 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1557 msg_type := RSL_MT_MODE_MODIFY_NACK,
1558 ies := {
1559 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1560 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
1561 }
Harald Welte643e2a62017-11-27 15:03:18 +01001562 }
Harald Welte9abd1282018-02-19 19:18:17 +01001563 template RSL_Message tr_RSL_MODE_MODIFY_NACK(template RslChannelNr chan_nr,
1564 template RSL_Cause cause) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001565 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001566 msg_type := RSL_MT_MODE_MODIFY_NACK,
1567 ies := {
1568 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1569 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
1570 }
1571 }
1572
Harald Welte643e2a62017-11-27 15:03:18 +01001573
Harald Welte6a8199d2018-01-29 21:58:53 +01001574 /* 8.4.14: BTS <- BSC */
1575 template RSL_Message tr_RSL_RF_CHAN_REL(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001576 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte6a8199d2018-01-29 21:58:53 +01001577 msg_type := RSL_MT_RF_CHAN_REL,
1578 ies := {
1579 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
1580 }
1581 }
Harald Welteefa7d912018-04-18 23:22:15 +02001582 template (value) RSL_Message ts_RSL_RF_CHAN_REL(template (value) RslChannelNr chan_nr) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001583 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1584 msg_type := RSL_MT_RF_CHAN_REL,
1585 ies := {
1586 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1587 }
1588 }
Harald Welte6a8199d2018-01-29 21:58:53 +01001589
Philipp Maier4d1e9c92018-12-20 11:11:56 +01001590 /* 8.4.15: BTS <- BSC */
1591 template (value) RSL_Message ts_RSL_MS_PWR_CTRL(template (value) RslChannelNr chan_nr,
1592 template (value) RSL_IE_MS_Power ms_power) := {
1593 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1594 msg_type := RSL_MT_MS_POWER_CONTROL,
1595 ies := {
1596 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1597 t_RSL_IE(RSL_IE_MS_POWER, RSL_IE_Body:{ms_power := ms_power})
1598 /* One optional IE: MS POWER PARAMETERS */
1599 }
1600 }
1601
Eric Wild61edb7e2019-06-03 12:38:31 +02001602 template (value) RSL_Message ts_RSL_MS_PWR_CTRL_with_pp(template (value) RslChannelNr chan_nr,
1603 integer pwr_level) := {
1604 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1605 msg_type := RSL_MT_MS_POWER_CONTROL,
1606 ies := {
1607 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1608 t_RSL_IE(RSL_IE_MS_POWER, RSL_IE_Body:{ms_power := ts_RSL_IE_MS_Power(pwr_level)}),
1609 t_RSL_IE(RSL_IE_MS_POWER_PARAM, RSL_IE_Body:{ms_power_params :=
1610 ts_RSL_IE_MS_Power_Parameters(''O)})
1611 }
1612 }
1613
Eric Wildae8f2622019-06-18 17:05:11 +02001614 /* 8.4.16: BTS <- BSC */
1615 template (value) RSL_Message ts_RSL_BS_PWR_CTRL(template (value) RslChannelNr chan_nr,
1616 template (value) RSL_IE_BS_Power bs_power) := {
1617 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1618 msg_type := RSL_MT_BS_POWER_CONTROL,
1619 ies := {
1620 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1621 t_RSL_IE(RSL_IE_BS_POWER, RSL_IE_Body:{bs_power := bs_power})
1622 /* One optional IE: BS POWER PARAMETERS */
1623 }
1624 }
1625
Harald Welte4a267362017-12-09 17:49:32 +01001626 /* 8.4.19 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001627 template (value) RSL_Message ts_RSL_RF_CHAN_REL_ACK(template (value) RslChannelNr chan_nr) :=
Harald Welte4a267362017-12-09 17:49:32 +01001628 ts_RSL_MsgDiscType(ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1629 RSL_MT_RF_CHAN_REL_ACK,
Harald Welte735dd072017-12-12 14:55:17 +01001630 { t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}) });
Harald Welte4a267362017-12-09 17:49:32 +01001631
Harald Welte9abd1282018-02-19 19:18:17 +01001632 template RSL_Message tr_RSL_RF_CHAN_REL_ACK(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001633 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001634 msg_type := RSL_MT_RF_CHAN_REL_ACK,
1635 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001636 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
Harald Welte9abd1282018-02-19 19:18:17 +01001637 }
1638 }
1639
Harald Welteea17b912018-03-11 22:29:31 +01001640 /* 8.6.20 BTS <- BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001641 template (value) RSL_Message ts_RSL_SACCH_INF_MOD(template (value) RslChannelNr chan_nr,
1642 RSL_IE_SysinfoType si_type,
1643 octetstring l3_info) := {
Harald Welteea17b912018-03-11 22:29:31 +01001644 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1645 msg_type := RSL_MT_SACCH_INFO_MODIFY,
1646 ies := {
1647 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1648 t_RSL_IE(RSL_IE_SYSINFO_TYPE, RSL_IE_Body:{sysinfo_type := si_type}),
1649 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
1650 }
1651 }
1652
Neels Hofmeyr378a49c2018-06-15 22:18:43 +02001653 /* 8.4.7 BTS -> BSC */
1654 template (value) RSL_Message ts_RSL_HANDO_DET(template (value) RslChannelNr chan_nr) := {
1655 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1656 msg_type := RSL_MT_HANDO_DET,
1657 ies := {
1658 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1659 }
1660 }
Vadim Yanitskiy7c2c10c2019-05-31 20:42:01 +07001661 template RSL_Message tr_RSL_HANDO_DET(template RslChannelNr chan_nr,
1662 template uint8_t acc_delay := ?) := {
1663 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1664 msg_type := RSL_MT_HANDO_DET,
1665 ies := {
1666 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1667 tr_RSL_IE(RSL_IE_Body:{access_delay := acc_delay})
1668 }
1669 }
Neels Hofmeyr378a49c2018-06-15 22:18:43 +02001670
Harald Welteea17b912018-03-11 22:29:31 +01001671
Harald Welte643e2a62017-11-27 15:03:18 +01001672 /* COMMON CHANNEL MANAGEMENT MESSAGES */
1673
Harald Welte874c2232018-02-24 04:52:43 +01001674 /* 8.5.1 BTS <- BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001675 template (value) RSL_Message ts_RSL_BCCH_INFO(RSL_IE_SysinfoType si_type,
1676 octetstring full_bcch_info) := {
Harald Welte874c2232018-02-24 04:52:43 +01001677 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1678 msg_type := RSL_MT_BCCH_INFO,
1679 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001680 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_BCCH(0)}),
Harald Welte874c2232018-02-24 04:52:43 +01001681 t_RSL_IE(RSL_IE_SYSINFO_TYPE, RSL_IE_Body:{sysinfo_type := si_type}),
1682 t_RSL_IE(RSL_IE_FULL_BCCH_INFO, RSL_IE_Body:{other := ts_RSL_LV(full_bcch_info)})
1683 }
1684 }
Harald Welte09538f82019-08-01 09:50:25 +02001685 template RSL_Message tr_RSL_NO_BCCH_INFO(template RSL_IE_SysinfoType si_type := ?) := {
1686 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1687 msg_type := RSL_MT_BCCH_INFO,
1688 ies := {
1689 tr_RSL_IE(RSL_IE_Body:{chan_nr := ts_RslChanNr_BCCH(0)}),
1690 tr_RSL_IE(RSL_IE_Body:{sysinfo_type := si_type})
1691 }
1692 }
1693 template RSL_Message tr_RSL_BCCH_INFO(template RSL_IE_SysinfoType si_type := ?,
1694 template octetstring full_bcch_info := ?) := {
1695 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1696 msg_type := RSL_MT_BCCH_INFO,
1697 ies := {
1698 tr_RSL_IE(RSL_IE_Body:{chan_nr := ts_RslChanNr_BCCH(0)}),
1699 tr_RSL_IE(RSL_IE_Body:{sysinfo_type := si_type}),
1700 tr_RSL_IE(RSL_IE_Body:{other := tr_RSL_LV(full_bcch_info)}),
1701 *
1702 }
1703 }
Harald Welte874c2232018-02-24 04:52:43 +01001704
Harald Welte7ae93142017-12-07 17:56:15 +01001705 /* 8.5.2 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001706 template (value) RSL_Message ts_RSL_RACH_LOAD_IND(uint16_t slot_ct, uint16_t busy_ct,
1707 uint16_t acc_ct) := {
Harald Welte7ae93142017-12-07 17:56:15 +01001708 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1709 msg_type := RSL_MT_CCCH_LOAD_IND,
1710 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001711 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_RACH(0)}),
Harald Welte735dd072017-12-12 14:55:17 +01001712 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 +01001713 }
1714 }
Harald Welte68e495b2018-02-25 00:05:57 +01001715 template RSL_Message tr_RSL_RACH_LOAD_IND(template uint16_t slot_ct := ?,
1716 template uint16_t busy_ct := ?,
Harald Welte09538f82019-08-01 09:50:25 +02001717 template uint16_t acc_ct := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001718 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Welte68e495b2018-02-25 00:05:57 +01001719 msg_type := RSL_MT_CCCH_LOAD_IND,
1720 ies := {
1721 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_RACH(0)}),
1722 tr_RSL_IE(RSL_IE_Body:{rach_load := tr_RSL_IE_RachLoad(slot_ct, busy_ct, acc_ct)})
1723 }
1724 }
1725
Harald Welteefa7d912018-04-18 23:22:15 +02001726 template (value) RSL_Message ts_RSL_PAGING_LOAD_IND(uint16_t buffer_space) := {
Harald Welte7ae93142017-12-07 17:56:15 +01001727 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1728 msg_type := RSL_MT_CCCH_LOAD_IND,
1729 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001730 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_PCH_AGCH(0)}),
Harald Welte735dd072017-12-12 14:55:17 +01001731 t_RSL_IE(RSL_IE_PAGING_LOAD, RSL_IE_Body:{paging_load := buffer_space})
Harald Welte7ae93142017-12-07 17:56:15 +01001732 }
1733 }
Harald Welte68e495b2018-02-25 00:05:57 +01001734 template RSL_Message tr_RSL_PAGING_LOAD_IND(template uint16_t buffer_space := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001735 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Welte68e495b2018-02-25 00:05:57 +01001736 msg_type := RSL_MT_CCCH_LOAD_IND,
1737 ies := {
1738 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(0)}),
1739 tr_RSL_IE(RSL_IE_Body:{paging_load := buffer_space})
1740 }
1741 }
1742
Harald Welte7ae93142017-12-07 17:56:15 +01001743
Harald Welte643e2a62017-11-27 15:03:18 +01001744 /* 8.5.3 BTS -> BSC */
Vadim Yanitskiyab448a52019-05-31 20:24:03 +07001745 template (value) RSL_Message ts_RSL_CHAN_RQD(OCT1 ra, GsmFrameNumber fn,
1746 template (value) RslChannelNr chan_nr := ts_RslChanNr_RACH(0),
1747 uint8_t acc_del := 0) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001748 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1749 msg_type := RSL_MT_CHAN_RQD,
1750 ies := {
Vadim Yanitskiyab448a52019-05-31 20:24:03 +07001751 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1752 /* TODO: we may need to have optional RSL_IE_LINK_IDENT IE here */
Harald Welte735dd072017-12-12 14:55:17 +01001753 t_RSL_IE(RSL_IE_REQ_REFERENCE, RSL_IE_Body:{req_ref := ts_RSL_IE_ReqRef(ra, fn)}),
1754 t_RSL_IE(RSL_IE_ACCESS_DELAY, RSL_IE_Body:{access_delay := acc_del})
Harald Welte643e2a62017-11-27 15:03:18 +01001755 }
1756 }
Harald Welte9abd1282018-02-19 19:18:17 +01001757 template RSL_Message tr_RSL_CHAN_RQD(template OCT1 ra, template GsmFrameNumber fn := ?,
Vadim Yanitskiyab448a52019-05-31 20:24:03 +07001758 template RslChannelNr chan_nr := ts_RslChanNr_RACH(0),
1759 template uint8_t acc_del := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001760 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001761 msg_type := RSL_MT_CHAN_RQD,
1762 ies := {
Vadim Yanitskiyab448a52019-05-31 20:24:03 +07001763 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1764 /* TODO: we may need to have optional RSL_IE_LINK_IDENT IE here */
Harald Welte9abd1282018-02-19 19:18:17 +01001765 tr_RSL_IE(RSL_IE_Body:{req_ref := tr_RSL_IE_ReqRef(ra, fn)}),
1766 tr_RSL_IE(RSL_IE_Body:{access_delay := acc_del})
1767 }
1768 }
Harald Welte643e2a62017-11-27 15:03:18 +01001769
1770 /* 8.5.4 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001771 template (value) RSL_Message ts_DELETE_IND(template (value) RslChannelNr chan_nr,
1772 octetstring imm_ass) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001773 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1774 msg_type := RSL_MT_DELETE_IND,
1775 ies := {
Harald Welte735dd072017-12-12 14:55:17 +01001776 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1777 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 +01001778 }
1779 }
Harald Weltee8d750e2018-06-10 21:41:35 +02001780 template RSL_Message tr_RSL_DELETE_IND(template octetstring imm_ass := ?, template uint3_t tn) := {
1781 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1782 msg_type := RSL_MT_DELETE_IND,
1783 ies := {
1784 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(tn)}),
1785 tr_RSL_IE(RSL_IE_Body:{full_imm_ass_info := tr_RSL_LV(imm_ass)}),
1786 *
1787 }
1788 }
Harald Welte643e2a62017-11-27 15:03:18 +01001789
Harald Weltec2877752017-12-07 17:54:35 +01001790 /* 8.5.5 BSC -> BTS */
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +07001791 template RSL_Message tr_RSL_PAGING_CMD(template MobileIdentityV mi, template uint3_t tn := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001792 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Weltec2877752017-12-07 17:54:35 +01001793 msg_type := RSL_MT_PAGING_CMD,
1794 ies := {
1795 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(tn)}),
1796 tr_RSL_IE(RSL_IE_Body:{paging_group := ?}),
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +07001797 tr_RSL_IE(RSL_IE_Body:{ms_identity := tr_MI_LV(mi)}),
Harald Weltec2877752017-12-07 17:54:35 +01001798 * /* opt: channel needed, eMLPP prio */
1799 }
1800 }
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +07001801 template (value) RSL_Message ts_RSL_PAGING_CMD(MobileIdentityV mi, uint8_t pg, uint3_t tn := 0) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001802 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1803 msg_type := RSL_MT_PAGING_CMD,
1804 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001805 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_PCH_AGCH(tn)}),
Harald Welte9abd1282018-02-19 19:18:17 +01001806 t_RSL_IE(RSL_IE_PAGING_GROUP, RSL_IE_Body:{paging_group := pg}),
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +07001807 t_RSL_IE(RSL_IE_MS_IDENTITY, RSL_IE_Body:{ms_identity := ts_MI_LV(mi)})
Harald Welte9abd1282018-02-19 19:18:17 +01001808 }
1809 }
Harald Weltec2877752017-12-07 17:54:35 +01001810
1811 /* 8.5.6 BSC -> BTS */
1812 template RSL_Message tr_RSL_IMM_ASSIGN(template uint3_t tn := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001813 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Weltec2877752017-12-07 17:54:35 +01001814 msg_type := RSL_MT_IMMEDIATE_ASSIGN_CMD,
1815 ies := {
1816 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(tn)}),
1817 tr_RSL_IE(RSL_IE_Body:{full_imm_ass_info := ?})
1818 }
1819 }
Harald Welteefa7d912018-04-18 23:22:15 +02001820 template (value) RSL_Message ts_RSL_IMM_ASSIGN(octetstring f_ass_inf, uint3_t tn := 0) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001821 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1822 msg_type := RSL_MT_IMMEDIATE_ASSIGN_CMD,
1823 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001824 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_PCH_AGCH(tn)}),
Harald Welte9abd1282018-02-19 19:18:17 +01001825 t_RSL_IE(RSL_IE_FULL_IMM_ASS_INFO, RSL_IE_Body:{full_imm_ass_info := ts_RSL_LV(f_ass_inf)})
1826 }
1827 }
Harald Weltec2877752017-12-07 17:54:35 +01001828
Harald Weltecc373202018-09-10 10:28:21 +02001829 /* 8.5.8 BTS <- BSC SMS BROADCAST COMMAND */
1830 template RSL_Message tr_RSL_SMSCB_CMD(template RSL_IE_CbCommandType cb_cmd := ?,
1831 template octetstring msg := ?,
1832 template RslChannelNr chan_nr := ?) := {
1833 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1834 msg_type := RSL_MT_SMS_BC_CMD,
1835 ies := {
1836 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1837 tr_RSL_IE(RSL_IE_Body:{cb_cmd_type := cb_cmd}),
1838 tr_RSL_IE(RSL_IE_Body:{smscb_message := tr_RSL_LV(msg)}),
1839 *
1840 }
1841 }
1842 template (value) RSL_Message ts_RSL_SMSCB_CMD(template (value) RSL_IE_CbCommandType cb_cmd,
1843 template (value) octetstring msg,
1844 template (value) RslChannelNr chan_nr :=
1845 ts_RslChanNr_SDCCH4(0, 2)) := {
1846 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1847 msg_type := RSL_MT_SMS_BC_CMD,
1848 ies := {
1849 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1850 t_RSL_IE(RSL_IE_CB_CMD_TYPE, RSL_IE_Body:{cb_cmd_type := cb_cmd}),
1851 t_RSL_IE(RSL_IE_SMSCB_MSG, RSL_IE_Body:{smscb_message := ts_RSL_LV(msg)})
1852 /* optional channel type for extended CBCH */
1853 }
1854 }
1855
Harald Welte4a129f82019-05-21 16:35:22 +02001856 /* 8.5.9 BTS -> BSC CBCH LOAD INDICATION */
1857 template RSL_Message tr_RSL_CBCH_LOAD_IND_BASIC(template boolean overflow := ?,
1858 template uint4_t slot_count := ?,
1859 template RslChannelNr chan_nr := ?) := {
1860 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1861 msg_type := RSL_MT_CBCH_LOAD_IND,
1862 ies := {
1863 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1864 tr_RSL_IE(RSL_IE_Body:{cbch_load_info := tr_CbchLoadInfo(overflow, slot_count)})
1865 }
1866 }
1867 template (value) RSL_Message ts_RSL_CBCH_LOAD_IND_BASIC(boolean overflow, uint4_t slot_count,
1868 template (value) RslChannelNr chan_nr :=
1869 ts_RslChanNr_SDCCH4(0, 2)) := {
1870 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1871 msg_type := RSL_MT_CBCH_LOAD_IND,
1872 ies := {
1873 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1874 t_RSL_IE(RSL_IE_CBCH_LOAD_INFO, RSL_IE_Body:{cbch_load_info := ts_CbchLoadInfo(overflow, slot_count)})
1875 }
1876 }
1877 template RSL_Message tr_RSL_CBCH_LOAD_IND_EXTD(template boolean overflow := ?,
1878 template uint4_t slot_count := ?,
1879 template RslChannelNr chan_nr := ?) := {
1880 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1881 msg_type := RSL_MT_CBCH_LOAD_IND,
1882 ies := {
1883 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1884 tr_RSL_IE(RSL_IE_Body:{cbch_load_info := tr_CbchLoadInfo(overflow, slot_count)}),
1885 tr_RSL_IE(RSL_IE_Body:{smscb_chan_ind := 1})
1886 }
1887 }
1888 template (value) RSL_Message ts_RSL_CBCH_LOAD_IND_EXTD(boolean overflow, uint4_t slot_count,
1889 template (value) RslChannelNr chan_nr :=
1890 ts_RslChanNr_SDCCH4(0, 2)) := {
1891 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1892 msg_type := RSL_MT_CBCH_LOAD_IND,
1893 ies := {
1894 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1895 t_RSL_IE(RSL_IE_CBCH_LOAD_INFO, RSL_IE_Body:{cbch_load_info := ts_CbchLoadInfo(overflow, slot_count)}),
1896 t_RSL_IE(RSL_IE_SMSCB_CHAN_INDICATOR, RSL_IE_Body:{smscb_chan_ind := 1})
1897 }
1898 }
1899
1900
Vadim Yanitskiy9f699532021-06-03 17:29:22 +02001901 /* 8.6.1 BTS -> BSC */
1902 template (value) RSL_Message
1903 ts_RSL_RF_RES_IND(template (value) RSL_ResourceInfo info) := {
1904 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
1905 msg_type := RSL_MT_RF_RES_IND,
1906 ies := {
1907 t_RSL_IE(RSL_IE_RESOURCE_INFO, RSL_IE_Body:{
1908 resource_info := {
1909 len := 0, /* overwritten */
1910 info := info
1911 }
1912 })
1913 }
1914 }
1915 template RSL_Message
1916 tr_RSL_RF_RES_IND(template (present) RSL_ResourceInfo info := ?) := {
1917 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
1918 msg_type := RSL_MT_RF_RES_IND,
1919 ies := {
1920 tr_RSL_IE(RSL_IE_Body:{
1921 resource_info := {
1922 len := ?,
1923 info := info
1924 }
1925 })
1926 }
1927 }
1928
1929
Harald Welte68e495b2018-02-25 00:05:57 +01001930 /* 8.6.2 BTS <- BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001931 template (value) RSL_Message ts_RSL_SACCH_FILL(RSL_IE_SysinfoType si_type, octetstring l3_info) := {
Harald Welte68e495b2018-02-25 00:05:57 +01001932 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
1933 msg_type := RSL_MT_SACCH_FILL,
1934 ies := {
1935 t_RSL_IE(RSL_IE_SYSINFO_TYPE, RSL_IE_Body:{sysinfo_type := si_type}),
1936 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
1937 }
1938 }
Harald Welte09538f82019-08-01 09:50:25 +02001939 template RSL_Message tr_RSL_NO_SACCH_FILL(template RSL_IE_SysinfoType si_type := ?) := {
1940 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
1941 msg_type := RSL_MT_SACCH_FILL,
1942 ies := {
1943 tr_RSL_IE(RSL_IE_Body:{sysinfo_type := si_type})
1944 }
1945 }
1946 template RSL_Message tr_RSL_SACCH_FILL(template RSL_IE_SysinfoType si_type := ?,
1947 template octetstring l3_info := ?) := {
1948 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
1949 msg_type := RSL_MT_SACCH_FILL,
1950 ies := {
1951 tr_RSL_IE(RSL_IE_Body:{sysinfo_type := si_type}),
1952 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)}),
1953 *
1954 }
1955 }
1956
Harald Welte68e495b2018-02-25 00:05:57 +01001957
Harald Welte643e2a62017-11-27 15:03:18 +01001958 /* 8.6.4 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001959 template (value) RSL_Message ts_RSL_ERROR_REPORT(RSL_Cause cause) := {
Harald Welte01d982c2018-02-25 01:31:40 +01001960 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
1961 msg_type := RSL_MT_ERROR_REPORT,
Harald Welte643e2a62017-11-27 15:03:18 +01001962 ies := {
Harald Welte735dd072017-12-12 14:55:17 +01001963 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
Harald Welte643e2a62017-11-27 15:03:18 +01001964 }
1965 }
Harald Welte01d982c2018-02-25 01:31:40 +01001966 template RSL_Message tr_RSL_ERROR_REPORT(template RSL_Cause cause := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001967 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
Harald Welte01d982c2018-02-25 01:31:40 +01001968 msg_type := RSL_MT_ERROR_REPORT,
1969 ies := {
1970 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)}),
1971 *
1972 }
1973 }
1974
Harald Welte643e2a62017-11-27 15:03:18 +01001975
Harald Welte9958a4d2017-12-14 21:21:33 +01001976
1977 /* Abis/IP specific messages */
1978
1979 template RSL_Message tr_RSL_IPA_CRCX(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001980 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01001981 msg_type := RSL_MT_IPAC_CRCX,
1982 ies := {
1983 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1984 *
1985 }
1986 }
Harald Welteefa7d912018-04-18 23:22:15 +02001987 template (value) RSL_Message ts_RSL_IPA_CRCX(template (value) RslChannelNr chan_nr) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001988 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
1989 msg_type := RSL_MT_IPAC_CRCX,
1990 ies := {
1991 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1992 }
1993 }
1994
Harald Welte9958a4d2017-12-14 21:21:33 +01001995
Harald Welteefa7d912018-04-18 23:22:15 +02001996 template (value) RSL_Message ts_RSL_IPA_CRCX_ACK(template (value) RslChannelNr chan_nr,
1997 uint16_t ipa_conn_id, uint32_t local_ip,
1998 uint16_t local_port, uint7_t rtp_pt2) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01001999 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2000 msg_type := RSL_MT_IPAC_CRCX_ACK,
2001 ies := {
2002 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2003 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2004 t_RSL_IE(RSL_IE_IPAC_LOCAL_IP, RSL_IE_Body:{ipa_local_ip := local_ip}),
2005 t_RSL_IE(RSL_IE_IPAC_LOCAL_PORT, RSL_IE_Body:{ipa_local_port := local_port}),
2006 t_RSL_IE(RSL_IE_IPAC_RTP_PAYLOAD2, RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
2007 }
2008 }
Harald Welte9abd1282018-02-19 19:18:17 +01002009 template RSL_Message tr_RSL_IPA_CRCX_ACK(template RslChannelNr chan_nr,
2010 template uint16_t ipa_conn_id,
2011 template uint32_t local_ip,
Harald Welte8bd0f822018-02-25 12:43:28 +01002012 template uint16_t local_port) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002013 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9abd1282018-02-19 19:18:17 +01002014 msg_type := RSL_MT_IPAC_CRCX_ACK,
2015 ies := {
2016 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2017 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2018 tr_RSL_IE(RSL_IE_Body:{ipa_local_ip := local_ip}),
Harald Welte8bd0f822018-02-25 12:43:28 +01002019 tr_RSL_IE(RSL_IE_Body:{ipa_local_port := local_port})
2020 /* Optional: RTP Payload Type 2 IE */
Harald Welte9abd1282018-02-19 19:18:17 +01002021 }
2022 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002023
Harald Welteefa7d912018-04-18 23:22:15 +02002024 template (value) RSL_Message ts_RSL_IPA_CRCX_NACK(template (value) RslChannelNr chan_nr,
2025 RSL_Cause cause) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002026 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2027 msg_type := RSL_MT_IPAC_CRCX_NACK,
2028 ies := {
2029 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2030 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2031 }
2032 }
Harald Welte9abd1282018-02-19 19:18:17 +01002033 template RSL_Message tr_RSL_IPA_CRCX_NACK(template RslChannelNr chan_nr,
2034 template RSL_Cause cause := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002035 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9abd1282018-02-19 19:18:17 +01002036 msg_type := RSL_MT_IPAC_CRCX_NACK,
2037 ies := {
2038 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2039 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
2040 }
2041 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002042
Harald Welteefa7d912018-04-18 23:22:15 +02002043 template (value) RSL_Message ts_RSL_IPA_MDCX(template (value) RslChannelNr chan_nr,
2044 uint16_t ipa_conn_id,
2045 uint32_t remote_ip, uint16_t remote_port,
2046 uint7_t rtp_pt2) := {
Harald Welte30527452018-02-25 12:46:25 +01002047 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2048 msg_type := RSL_MT_IPAC_MDCX,
2049 ies := {
2050 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2051 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2052 t_RSL_IE(RSL_IE_IPAC_REMOTE_IP, RSL_IE_Body:{ipa_remote_ip := remote_ip}),
2053 t_RSL_IE(RSL_IE_IPAC_REMOTE_PORT, RSL_IE_Body:{ipa_remote_port := remote_port}),
2054 /* optional: RTP Payload Type */
2055 t_RSL_IE(RSL_IE_IPAC_RTP_PAYLOAD2, RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
2056 }
2057 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002058 template RSL_Message tr_RSL_IPA_MDCX(template RslChannelNr chan_nr,
2059 template uint16_t ipa_conn_id) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002060 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002061 msg_type := RSL_MT_IPAC_MDCX,
2062 ies := {
2063 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2064 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2065 *
2066 }
2067 }
2068
Harald Welteefa7d912018-04-18 23:22:15 +02002069 template (value) RSL_Message ts_RSL_IPA_MDCX_ACK(template (value) RslChannelNr chan_nr,
2070 uint16_t ipa_conn_id,
2071 uint32_t local_ip, uint16_t local_port,
2072 uint7_t rtp_pt2) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002073 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte71b5ec82017-12-16 23:01:10 +01002074 msg_type := RSL_MT_IPAC_MDCX_ACK,
Harald Welte9958a4d2017-12-14 21:21:33 +01002075 ies := {
2076 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2077 /* optional */
2078 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
Harald Welte6cb400a2018-02-25 12:45:25 +01002079 t_RSL_IE(RSL_IE_IPAC_LOCAL_IP, RSL_IE_Body:{ipa_local_ip := local_ip}),
2080 t_RSL_IE(RSL_IE_IPAC_LOCAL_PORT, RSL_IE_Body:{ipa_local_port := local_port}),
Harald Welte9958a4d2017-12-14 21:21:33 +01002081 /* optional: RTP Payload Type */
2082 t_RSL_IE(RSL_IE_IPAC_RTP_PAYLOAD2, RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
2083 }
2084 }
Harald Welte30527452018-02-25 12:46:25 +01002085 template RSL_Message tr_RSL_IPA_MDCX_ACK(template RslChannelNr chan_nr,
2086 template uint16_t ipa_conn_id,
2087 template uint32_t local_ip,
2088 template uint16_t local_port,
2089 template uint7_t rtp_pt2) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002090 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte30527452018-02-25 12:46:25 +01002091 msg_type := RSL_MT_IPAC_MDCX_ACK,
2092 ies := {
2093 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2094 /* optional */
2095 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2096 tr_RSL_IE(RSL_IE_Body:{ipa_local_ip := local_ip}),
2097 tr_RSL_IE(RSL_IE_Body:{ipa_local_port := local_port}),
2098 /* optional: RTP Payload Type */
2099 tr_RSL_IE(RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
2100 }
2101 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002102
Harald Welteefa7d912018-04-18 23:22:15 +02002103 template (value) RSL_Message ts_RSL_IPA_MDCX_NACK(template (value) RslChannelNr chan_nr,
2104 RSL_Cause cause,
2105 template (value) uint16_t ipa_conn_id) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002106 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2107 msg_type := RSL_MT_IPAC_MDCX_NACK,
2108 ies := {
2109 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2110 /* optional connection ID */
2111 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2112 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2113 }
2114 }
Harald Welte30527452018-02-25 12:46:25 +01002115 template RSL_Message tr_RSL_IPA_MDCX_NACK(template RslChannelNr chan_nr,
2116 template RSL_Cause cause,
2117 template uint16_t ipa_conn_id) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002118 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte30527452018-02-25 12:46:25 +01002119 msg_type := RSL_MT_IPAC_MDCX_NACK,
2120 ies := {
2121 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2122 /* optional connection ID */
2123 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2124 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
2125 }
2126 }
2127
Harald Welte9958a4d2017-12-14 21:21:33 +01002128
Harald Welteefa7d912018-04-18 23:22:15 +02002129 template (value) RSL_Message ts_RSL_IPA_DLCX_IND(template (value) RslChannelNr chan_nr,
2130 uint16_t ipa_conn_id,
2131 template (value) RSL_IE_IPA_ConnectionStats stats,
2132 RSL_Cause cause) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002133 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2134 msg_type := RSL_MT_IPAC_DLCX_IND,
2135 ies := {
2136 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2137 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2138 t_RSL_IE(RSL_IE_IPAC_CONN_STAT, RSL_IE_Body:{ipa_stats := stats}),
2139 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2140 }
2141 }
2142
Harald Welteefa7d912018-04-18 23:22:15 +02002143 template (value) RSL_Message ts_RSL_IPA_DLCX(template (value) RslChannelNr chan_nr,
2144 uint16_t ipa_conn_id) := {
Harald Weltea871a382018-02-25 02:03:14 +01002145 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2146 msg_type := RSL_MT_IPAC_DLCX,
2147 ies := {
Harald Welte2a7e7162018-02-25 12:46:48 +01002148 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2149 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id})
Harald Weltea871a382018-02-25 02:03:14 +01002150 }
2151 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002152 template RSL_Message tr_RSL_IPA_DLCX(template RslChannelNr chan_nr,
2153 template uint16_t ipa_conn_id := omit) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002154 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002155 msg_type := RSL_MT_IPAC_DLCX,
2156 ies := {
2157 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2158 /* FIXME: optional conn_id */
2159 *
2160 }
2161 }
2162
Harald Welteefa7d912018-04-18 23:22:15 +02002163 template (value) RSL_Message ts_RSL_IPA_DLCX_ACK(template (value) RslChannelNr chan_nr,
2164 uint16_t ipa_conn_id,
2165 RSL_IE_IPA_ConnectionStats stats) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002166 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2167 msg_type := RSL_MT_IPAC_DLCX_ACK,
2168 ies := {
2169 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2170 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2171 t_RSL_IE(RSL_IE_IPAC_CONN_STAT, RSL_IE_Body:{ipa_stats := stats})
2172 }
2173 }
Harald Weltea871a382018-02-25 02:03:14 +01002174 template RSL_Message tr_RSL_IPA_DLCX_ACK(template RslChannelNr chan_nr,
2175 template uint16_t ipa_conn_id,
2176 template RSL_IE_IPA_ConnectionStats stats) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002177 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Weltea871a382018-02-25 02:03:14 +01002178 msg_type := RSL_MT_IPAC_DLCX_ACK,
2179 ies := {
2180 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2181 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2182 tr_RSL_IE(RSL_IE_Body:{ipa_stats := stats})
2183 }
2184 }
2185
2186
Harald Welte9958a4d2017-12-14 21:21:33 +01002187
Harald Welteefa7d912018-04-18 23:22:15 +02002188 template (value) RSL_Message ts_RSL_IPA_DLCX_NACK(template (value) RslChannelNr chan_nr,
2189 RSL_Cause cause, uint16_t ipa_conn_id) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002190 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2191 msg_type := RSL_MT_IPAC_DLCX_NACK,
2192 ies := {
2193 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2194 /* optional connection ID */
2195 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2196 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2197 }
2198 }
Harald Weltea871a382018-02-25 02:03:14 +01002199 template RSL_Message tr_RSL_IPA_DLCX_NACK(template RslChannelNr chan_nr,
2200 template RSL_Cause cause) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002201 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Weltea871a382018-02-25 02:03:14 +01002202 msg_type := RSL_MT_IPAC_DLCX_NACK,
2203 ies := {
2204 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2205 /* optional connection ID */
2206 *,
2207 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
2208 }
2209 }
2210
Harald Welte9958a4d2017-12-14 21:21:33 +01002211
Harald Welteefa7d912018-04-18 23:22:15 +02002212 template (value) RSL_Message ts_RSL_IPA_PDCH_ACT(RslChannelNr chan_nr) := {
Harald Welteee19c732018-04-05 09:08:26 +02002213 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2214 msg_type := RSL_MT_IPAC_PDCH_ACT,
2215 ies := {
2216 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
2217 }
2218 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002219 template RSL_Message tr_RSL_IPA_PDCH_ACT(template RslChannelNr chan_nr) := {
Harald Welteee19c732018-04-05 09:08:26 +02002220 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002221 msg_type := RSL_MT_IPAC_PDCH_ACT,
2222 ies := {
2223 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
2224 }
2225 }
2226
Harald Welteee19c732018-04-05 09:08:26 +02002227
Harald Welte94e0c342018-04-07 11:33:23 +02002228 template RSL_Message ts_RSL_IPA_PDCH_ACT_ACK(RslChannelNr chan_nr,
2229 template (value) RSL_IE_FrameNumber fn) := {
Harald Welteee19c732018-04-05 09:08:26 +02002230 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002231 msg_type := RSL_MT_IPAC_PDCH_ACT_ACK,
2232 ies := {
2233 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2234 t_RSL_IE(RSL_IE_FRAME_NUMBER, RSL_IE_Body:{frame_nr := fn})
2235 }
2236 }
Harald Welteee19c732018-04-05 09:08:26 +02002237 template RSL_Message tr_RSL_IPA_PDCH_ACT_ACK(template RslChannelNr chan_nr,
2238 template RSL_IE_FrameNumber fn) := {
2239 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2240 msg_type := RSL_MT_IPAC_PDCH_ACT_ACK,
2241 ies := {
2242 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2243 tr_RSL_IE(RSL_IE_Body:{frame_nr := fn})
2244 }
2245 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002246
2247 template RSL_Message ts_RSL_IPA_PDCH_ACT_NACK(RslChannelNr chan_nr, RSL_Cause cause) := {
Harald Welteee19c732018-04-05 09:08:26 +02002248 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002249 msg_type := RSL_MT_IPAC_PDCH_ACT_NACK,
2250 ies := {
2251 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2252 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2253 }
2254 }
Harald Welteee19c732018-04-05 09:08:26 +02002255 template RSL_Message tr_RSL_IPA_PDCH_ACT_NACK(template RslChannelNr chan_nr,
2256 template RSL_Cause cause) := {
2257 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2258 msg_type := RSL_MT_IPAC_PDCH_ACT_NACK,
2259 ies := {
2260 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2261 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
2262 }
2263 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002264
Harald Welteee19c732018-04-05 09:08:26 +02002265 template RSL_Message ts_RSL_IPA_PDCH_DEACT(RslChannelNr chan_nr) := {
2266 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2267 msg_type := RSL_MT_IPAC_PDCH_DEACT,
2268 ies := {
2269 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
2270 }
2271 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002272 template RSL_Message tr_RSL_IPA_PDCH_DEACT(template RslChannelNr chan_nr) := {
Harald Welteee19c732018-04-05 09:08:26 +02002273 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002274 msg_type := RSL_MT_IPAC_PDCH_DEACT,
2275 ies := {
2276 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
2277 }
2278 }
2279
2280 template RSL_Message ts_RSL_IPA_PDCH_DEACT_ACK(RslChannelNr chan_nr) := {
Harald Welteee19c732018-04-05 09:08:26 +02002281 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002282 msg_type := RSL_MT_IPAC_PDCH_DEACT_ACK,
2283 ies := {
2284 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
2285 }
2286 }
Harald Welteee19c732018-04-05 09:08:26 +02002287 template RSL_Message tr_RSL_IPA_PDCH_DEACT_ACK(template RslChannelNr chan_nr) := {
2288 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2289 msg_type := RSL_MT_IPAC_PDCH_DEACT_ACK,
2290 ies := {
2291 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
2292 }
2293 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002294
2295 template RSL_Message ts_RSL_IPA_PDCH_DEACT_NACK(RslChannelNr chan_nr, RSL_Cause cause) := {
Harald Welteee19c732018-04-05 09:08:26 +02002296 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002297 msg_type := RSL_MT_IPAC_PDCH_DEACT_NACK,
2298 ies := {
2299 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2300 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2301 }
2302 }
Harald Welteee19c732018-04-05 09:08:26 +02002303 template RSL_Message tr_RSL_IPA_PDCH_DEACT_NACK(template RslChannelNr chan_nr,
2304 template RSL_Cause cause) := {
2305 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2306 msg_type := RSL_MT_IPAC_PDCH_DEACT_NACK,
2307 ies := {
2308 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2309 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
2310 }
2311 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002312
Harald Welte908ce542019-09-04 23:05:40 +02002313 template (value) RSL_Message ts_RSL_OSMO_ETWS_CMD(template (value) octetstring msg,
2314 template (value) RslChannelNr chan_nr := ts_RslChanNr_PCH_AGCH(0)) := {
2315 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2316 msg_type := RSL_MT_OSMO_ETWS_CMD,
2317 ies := {
2318 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2319 t_RSL_IE(RSL_IE_SMSCB_MSG, RSL_IE_Body:{smscb_message := ts_RSL_LV(msg)})
2320 }
2321 }
2322 template RSL_Message tr_RSL_OSMO_ETWS_CMD(template RslChannelNr chan_nr := ?,
2323 template octetstring msg := ?) := {
2324 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2325 msg_type := RSL_MT_OSMO_ETWS_CMD,
2326 ies := {
2327 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2328 tr_RSL_IE(RSL_IE_Body:{smscb_message := tr_RSL_LV(msg)})
2329 }
2330 }
2331
2332
Harald Welte9958a4d2017-12-14 21:21:33 +01002333
Harald Welte6a8199d2018-01-29 21:58:53 +01002334 function f_rsl_find_ie(RSL_Message msg, RSL_IE_Type iei, out RSL_IE_Body ret) return boolean {
2335 for (var integer i := 0; i < sizeof(msg.ies); i := i+1) {
2336 if (msg.ies[i].iei == iei) {
2337 ret := msg.ies[i].body;
2338 return true;
2339 }
2340 }
2341 return false;
2342 }
2343
2344
Harald Welte9958a4d2017-12-14 21:21:33 +01002345
Harald Welte643e2a62017-11-27 15:03:18 +01002346} with { encode "RAW" ; variant "FIELDORDER(msb)" }