blob: 28ae9711f11bc41aec5bbcd910f6eb9bb95a5ff4 [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 }
Vadim Yanitskiy2a5a1ef2021-06-30 00:51:48 +0200451 template RSL_IE_BS_Power
452 tr_RSL_IE_BS_Power(template (present) uint4_t power_level,
453 template (present) boolean epc := ?,
454 template (present) boolean fpc := ?) := {
455 reserved := ?,
456 epc := epc,
457 fpc := fpc,
458 power_level := power_level
459 }
Eric Wildae8f2622019-06-18 17:05:11 +0200460
Harald Welte73cd2712017-12-17 00:44:52 +0100461 /* 9.3.7 */
Harald Weltee613f962018-04-18 22:38:16 +0200462 type enumerated RSL_AlgId {
463 RSL_ALG_ID_A5_0 ('00000001'B),
464 RSL_ALG_ID_A5_1 ('00000010'B),
465 RSL_ALG_ID_A5_2 ('00000011'B),
466 RSL_ALG_ID_A5_3 ('00000100'B),
467 RSL_ALG_ID_A5_4 ('00000101'B),
468 RSL_ALG_ID_A5_5 ('00000110'B),
469 RSL_ALG_ID_A5_6 ('00000111'B),
470 RSL_ALG_ID_A5_7 ('00001000'B)
471 } with { variant "FIELDLENGTH(8)" };
Harald Welte73cd2712017-12-17 00:44:52 +0100472 type record RSL_IE_EncryptionInfo {
473 uint8_t len,
Harald Weltee613f962018-04-18 22:38:16 +0200474 RSL_AlgId alg_id,
Harald Welte73cd2712017-12-17 00:44:52 +0100475 octetstring key
476 } with { variant (len) "LENGTHTO(alg_id,key)" };
477
Harald Weltee613f962018-04-18 22:38:16 +0200478 template RSL_IE_EncryptionInfo tr_RSL_IE_EncrInfo(template RSL_AlgId alg,
479 template octetstring key) := {
Harald Welte73cd2712017-12-17 00:44:52 +0100480 len := ?,
481 alg_id := alg,
482 key := key
483 }
Harald Weltee613f962018-04-18 22:38:16 +0200484 template (value) RSL_IE_EncryptionInfo ts_RSL_IE_EncrInfo(template (value) RSL_AlgId alg,
485 octetstring key) := {
Harald Welteefa7d912018-04-18 23:22:15 +0200486 len := 0, /* overwritten */
487 alg_id := alg,
488 key := key
489 }
490
491
Harald Welte73cd2712017-12-17 00:44:52 +0100492
Harald Welte643e2a62017-11-27 15:03:18 +0100493 /* 9.3.8 */
494 type record RSL_IE_FrameNumber {
495 uint5_t t1_p,
496 uint6_t t3,
497 uint5_t t2
498 }
499 type RSL_IE_FrameNumber RSL_IE_StartingTime;
500
501 /* 9.3.10 */
502 type record RSL_IE_L1Info {
503 uint5_t ms_power_lvl,
504 boolean fpc,
505 uint2_t reserved,
506 uint8_t actual_ta
507 }
508
509 /* 9.3.13 */
510 type record RSL_IE_MS_Power {
511 uint2_t reserved,
512 boolean fpc_epc,
513 uint5_t power_level
514 }
Pau Espin Pedrolf7630a62019-10-28 15:07:08 +0100515 template RSL_IE_MS_Power tr_RSL_IE_MS_Power(template uint5_t power_level := ?,
516 template boolean fpc_epc := false) := {
517 reserved := 0,
518 fpc_epc := fpc_epc,
519 power_level := power_level
520 }
Harald Welte10280172019-05-19 22:28:04 +0200521 template (value) RSL_IE_MS_Power ts_RSL_IE_MS_Power(uint5_t power_level,
522 boolean fpc_epc := false) := {
523 reserved := 0,
524 fpc_epc := fpc_epc,
525 power_level := power_level
526 }
Harald Welte643e2a62017-11-27 15:03:18 +0100527
Harald Welted5f521e2017-12-07 17:53:06 +0100528 /* 9.3.18 */
529 type record RSL_IE_RachLoad {
530 uint8_t len,
531 uint16_t slot_count,
532 uint16_t busy_count,
533 uint16_t access_count
534 } with { variant (len) "LENGTHTO(slot_count,busy_count,access_count)" }
535
Harald Welteefa7d912018-04-18 23:22:15 +0200536 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 +0100537 len := 0, /* overwritten */
538 slot_count := slot,
539 busy_count := busy,
540 access_count := acc
541 }
542
Harald Welte68e495b2018-02-25 00:05:57 +0100543 template RSL_IE_RachLoad tr_RSL_IE_RachLoad(template uint16_t slot,
544 template uint16_t busy,
545 template uint16_t acc) := {
546 len := ?, /* overwritten */
547 slot_count := slot,
548 busy_count := busy,
549 access_count := acc
550 }
551
Harald Welte643e2a62017-11-27 15:03:18 +0100552 /* 9.3.19 */
553 type record RSL_IE_RequestRef {
554 OCT1 ra,
555 RSL_IE_FrameNumber frame_nr
556 }
557
558 /* 3GPP TS 44.018 / 10.5.2.38 Starting Time */
Harald Welte94e0c342018-04-07 11:33:23 +0200559 template (value) RSL_IE_FrameNumber ts_RSL_IE_FrameNumber(GsmFrameNumber fn) := {
Harald Welte643e2a62017-11-27 15:03:18 +0100560 t1_p := (fn / 1326) mod 32,
561 t3 := fn mod 51,
562 t2 := fn mod 26
563 }
564
Harald Welte9abd1282018-02-19 19:18:17 +0100565 function tr_RSL_IE_FrameNumber(template GsmFrameNumber fn) return template RSL_IE_FrameNumber {
566 if (istemplatekind(fn, "?")) {
567 return ?;
568 } else {
569 return ts_RSL_IE_FrameNumber(valueof(fn));
570 }
571 }
572
Harald Welteefa7d912018-04-18 23:22:15 +0200573 template (value) RSL_IE_RequestRef ts_RSL_IE_ReqRef(OCT1 ra, GsmFrameNumber frame_nr) := {
Harald Welte643e2a62017-11-27 15:03:18 +0100574 ra := ra,
575 frame_nr := ts_RSL_IE_FrameNumber(frame_nr)
576 }
577
Harald Welte9abd1282018-02-19 19:18:17 +0100578 template RSL_IE_RequestRef tr_RSL_IE_ReqRef(template OCT1 ra, template GsmFrameNumber frame_nr) := {
579 ra := ra,
580 frame_nr := tr_RSL_IE_FrameNumber(frame_nr)
581 }
582
Vadim Yanitskiy9f699532021-06-03 17:29:22 +0200583 /* 9.3.21 Resource Information */
584 type record RSL_IE_ResourceInfo {
585 uint8_t len,
586 RSL_ResourceInfo info
587 } with { variant (len) "LENGTHTO(info)" };
588
589 type record of RSL_ResourceInfoItem RSL_ResourceInfo;
590 type record RSL_ResourceInfoItem {
591 RslChannelNr chan_nr,
592 uint3_t interf_band,
593 BIT5 rfu ('00000'B)
594 };
595
596 template (value) RSL_ResourceInfoItem
597 ts_RSL_ResourceInfoItem(template (value) RslChannelNr chan_nr,
598 template (value) uint3_t interf_band := 0) := {
599 chan_nr := chan_nr,
600 interf_band := interf_band,
601 rfu := '00000'B
602 }
603 template RSL_ResourceInfoItem
604 tr_RSL_ResourceInfoItem(template (present) RslChannelNr chan_nr := ?,
605 template (present) uint3_t interf_band := ?) := {
606 chan_nr := chan_nr,
607 interf_band := interf_band,
608 rfu := ? /* Tolerate unknown values */
609 }
610
Harald Welte15de8ba2018-06-29 08:51:42 +0200611 /* Osmocom Extension */
612 type record RSL_IE_UplinkMeasSuppMeasInfo {
613 int16_t toa256_mean,
614 int16_t toa256_min,
615 int16_t toa256_max,
616 uint16_t toa256_std_dev
617 };
618
Harald Welte2691adf2018-02-22 17:32:39 +0100619 /* 9.3.25 */
620 type record RSL_IE_UplinkMeas {
621 uint8_t len,
622 BIT1 rfu,
623 boolean dtx_d,
624 uint6_t rxlev_f_u,
625 BIT2 reserved1,
626 uint6_t rxlev_s_u,
627 BIT2 reserved2,
628 uint3_t rxq_f_u,
629 uint3_t rxq_s_u,
Harald Welte15de8ba2018-06-29 08:51:42 +0200630 RSL_IE_UplinkMeasSuppMeasInfo supp_meas_info optional
Harald Welte2691adf2018-02-22 17:32:39 +0100631 } 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 +0100632
Harald Welte643e2a62017-11-27 15:03:18 +0100633 /* 9.3.26 */
Harald Weltea8ed9062017-12-14 09:46:01 +0100634 type enumerated RSL_Cause {
635 /* normal event */
636 RSL_ERR_RADIO_IF_FAIL ('00'O),
637 RSL_ERR_RADIO_LINK_FAIL ('01'O),
638 RSL_ERR_HANDOVER_ACC_FAIL ('02'O),
639 RSL_ERR_TALKER_ACC_FAIL ('03'O),
640 RSL_ERR_OM_INTERVENTION ('07'O),
641 RSL_ERR_NORMAL_UNSPEC ('0f'O),
642 RSL_ERR_T_MSRFPCI_EXP ('18'O),
643 /* resource unavailable */
644 RSL_ERR_EQUIPMENT_FAIL ('20'O),
645 RSL_ERR_RR_UNAVAIL ('21'O),
646 RSL_ERR_TERR_CH_FAIL ('22'O),
647 RSL_ERR_CCCH_OVERLOAD ('23'O),
648 RSL_ERR_ACCH_OVERLOAD ('24'O),
649 RSL_ERR_PROCESSOR_OVERLOAD ('25'O),
650 RSL_ERR_BTS_NOT_EQUIPPED ('27'O),
651 RSL_ERR_REMOTE_TRAU_FAILURE ('28'O),
652 RSL_ERR_NOTIF_OVERFLOW ('29'O),
653 RSL_ERR_RES_UNAVAIL ('2f'O),
654 /* service or option not available */
655 RSL_ERR_TRANSC_UNAVAIL ('30'O),
656 RSL_ERR_SERV_OPT_UNAVAIL ('3f'O),
657 /* service or option not implemented */
658 RSL_ERR_ENCR_UNIMPL ('40'O),
659 RSL_ERR_SERV_OPT_UNIMPL ('4f'O),
660 /* invalid message */
661 RSL_ERR_RCH_ALR_ACTV_ALLOC ('50'O),
Harald Welte9912eb52018-02-25 13:30:15 +0100662 RSL_ERR_IPA_RCH_NOT_ACTV_ALLOC ('51'O),
663 RSL_ERR_IPA_CONN_INVALID ('52'O),
664 RSL_ERR_IPA_CONN_IN_USE ('53'O),
665 RSL_ERR_IPA_CONN_ALREADY_EXISTS ('54'O),
Harald Weltea8ed9062017-12-14 09:46:01 +0100666 RSL_ERR_INVALID_MESSAGE ('5f'O),
667 /* protocol error */
668 RSL_ERR_MSG_DISCR ('60'O),
669 RSL_ERR_MSG_TYPE ('61'O),
670 RSL_ERR_MSG_SEQ ('62'O),
671 RSL_ERR_IE_ERROR ('63'O),
672 RSL_ERR_MAND_IE_ERROR ('64'O),
673 RSL_ERR_OPT_IE_ERROR ('65'O),
674 RSL_ERR_IE_NONEXIST ('66'O),
675 RSL_ERR_IE_LENGTH ('67'O),
676 RSL_ERR_IE_CONTENT ('68'O),
677 RSL_ERR_PROTO ('6f'O),
678 /* interworking */
679 RSL_ERR_INTERWORKING ('7f'O)
680 };
Harald Welte643e2a62017-11-27 15:03:18 +0100681 type record RSL_IE_Cause {
Harald Welte6efa8e32017-12-09 22:34:06 +0100682 uint8_t len,
Harald Welte643e2a62017-11-27 15:03:18 +0100683 uint1_t e,
684 RSL_Cause cause,
685 octetstring cause_ext optional
Harald Welte6efa8e32017-12-09 22:34:06 +0100686 } with { variant (len) "LENGTHTO(e,cause,cause_ext)" }
Harald Welte643e2a62017-11-27 15:03:18 +0100687
Harald Welteefa7d912018-04-18 23:22:15 +0200688 template (value) RSL_IE_Cause ts_RSL_IE_Cause(RSL_Cause cause) := {
Harald Welte6efa8e32017-12-09 22:34:06 +0100689 len := 0, /* overwritten */
Harald Welte643e2a62017-11-27 15:03:18 +0100690 e := 0,
691 cause := cause,
692 cause_ext := omit
693 }
694
Harald Welte9abd1282018-02-19 19:18:17 +0100695 template RSL_IE_Cause tr_RSL_IE_Cause(template RSL_Cause cause) := {
696 len := ?,
697 e := 0,
698 cause := cause,
699 cause_ext := omit
700 }
701
Harald Weltec8d363c2019-05-19 20:36:48 +0200702 /* 9.3.29 */
703 type record RSL_SacchInfo {
704 uint8_t len,
705 uint8_t num_msgs,
706 RSL_SacchInfoElements elems
707 } with {
708 variant (len) "LENGTHTO(num_msgs,elems)";
709 variant (num_msgs) "LENGTHTO(elems)";
710 variant (num_msgs) "UNIT(elements)"
711 };
712 type record RSL_SacchInfoElement {
713 RSL_IE_SysinfoType si_type,
714 uint8_t len,
715 octetstring msg
716 } with {
717 variant (len) "LENGTHTO(msg)";
718 };
719 type record of RSL_SacchInfoElement RSL_SacchInfoElements;
720 template (value) RSL_SacchInfo ts_RSL_SacchInfo(template (value) RSL_SacchInfoElements elems) := {
721 len := 0, /* overwritten */
722 num_msgs := 0, /* overwritten */
723 elems := elems
724 }
725 template (value) RSL_SacchInfoElement ts_RSL_SacchInfoElem(RSL_IE_SysinfoType tp, octetstring msg) := {
726 si_type := tp,
727 len := lengthof(msg),
728 msg := msg
729 }
730
Eric Wild61edb7e2019-06-03 12:38:31 +0200731 /* 9.3.31 */
732 type record RSL_IE_MS_Power_Parameters {
733 uint8_t len,
734 octetstring params
735 } with {
736 variant (len) "LENGTHTO(params)";
737 };
738 template (value) RSL_IE_MS_Power_Parameters ts_RSL_IE_MS_Power_Parameters(octetstring params) := {
739 len := 0, /* overwritten */
740 params := params
741 }
742
Harald Welte643e2a62017-11-27 15:03:18 +0100743 /* 9.3.40 */
744 type enumerated RSL_ChanNeeded {
745 RSL_CHANNEED_ANY ('00'B),
746 RSL_CHANNEED_SDCCH ('01'B),
747 RSL_CHANNEED_TCH_F ('10'B),
748 RSL_CHANNEED_TCH_ForH ('11'B)
Harald Welte51d74102017-12-10 23:05:02 +0100749 } with { variant "FIELDLENGTH(2)" };
Harald Welte643e2a62017-11-27 15:03:18 +0100750 type record RSL_IE_ChanNeeded {
751 uint6_t reserved,
752 RSL_ChanNeeded chan_needed
753 }
754
Harald Weltecc373202018-09-10 10:28:21 +0200755 /* 9.3.41 CB Command Type */
756 type enumerated RSL_CbCommand {
757 RSL_CB_CMD_NORMAL ('0000'B),
758 RSL_CB_CMD_SCHEDULE ('1000'B),
759 RSL_CB_CMD_DEFAULT ('1110'B),
760 RSL_CB_CMD_NULL ('1111'B)
761 } with { variant "FIELDLENGTH(4)" };
762 type record RSL_IE_CbCommandType {
763 RSL_CbCommand command,
764 boolean default_bcast_null,
765 BIT1 spare,
766 uint2_t last_block
767 };
768 template (value) RSL_IE_CbCommandType ts_RSL_IE_CbCmdType(RSL_CbCommand cmd := RSL_CB_CMD_NORMAL,
769 uint2_t last_block := 1,
770 boolean def_bcast_null := true) := {
771 command := cmd,
772 default_bcast_null := def_bcast_null,
773 spare := '0'B,
774 last_block := last_block
775 }
776
Harald Welte4a129f82019-05-21 16:35:22 +0200777 /* 9.4.43 CBCH Load Information */
778 type record RSL_IE_CbchLoadInfo {
779 boolean overflow,
780 BIT3 spare,
781 uint4_t slot_count
782 };
783 template RSL_IE_CbchLoadInfo tr_CbchLoadInfo(template boolean overflow,
784 template uint4_t slot_count) := {
785 overflow := overflow,
786 spare := ?,
787 slot_count := slot_count
788 }
789 template (value) RSL_IE_CbchLoadInfo ts_CbchLoadInfo(boolean overflow, uint4_t slot_count) := {
790 overflow := overflow,
791 spare := '000'B,
792 slot_count := slot_count
793 }
794
Harald Welte643e2a62017-11-27 15:03:18 +0100795 /* 9.3.53 */
796 type record RSL_IE_MultirateCtrl {
797 uint3_t spare,
798 boolean od,
799 boolean pre,
800 uint2_t rae,
801 boolean tfo
802 }
803
804 type enumerated RSL_IE_SysinfoType {
805 RSL_SYSTEM_INFO_8 ('00000000'B),
806 RSL_SYSTEM_INFO_1 ('00000001'B),
807 RSL_SYSTEM_INFO_2 ('00000010'B),
808 RSL_SYSTEM_INFO_3 ('00000011'B),
809 RSL_SYSTEM_INFO_4 ('00000100'B),
810 RSL_SYSTEM_INFO_5 ('00000101'B),
811 RSL_SYSTEM_INFO_6 ('00000110'B),
812 RSL_SYSTEM_INFO_7 ('00000111'B),
813 RSL_SYSTEM_INFO_16 ('00001000'B),
814 RSL_SYSTEM_INFO_17 ('00001001'B),
815 RSL_SYSTEM_INFO_2bis ('00001010'B),
816 RSL_SYSTEM_INFO_2ter ('00001011'B),
817 RSL_SYSTEM_INFO_5bis ('00001101'B),
818 RSL_SYSTEM_INFO_5ter ('00001110'B),
819 RSL_SYSTEM_INFO_10 ('00001111'B),
820 RSL_EXT_MEAS_ORDER ('01000111'B),
821 RSL_MEAS_INFO ('01001000'B),
822 RSL_SYSTEM_INFO_13 ('00101000'B),
823 RSL_ERIC_SYSTEM_INFO_13 ('00001100'B),
824 RSL_SYSTEM_INFO_2quater ('00101001'B),
825 RSL_SYSTEM_INFO_9 ('00101010'B),
826 RSL_SYSTEM_INFO_18 ('00101011'B),
827 RSL_SYSTEM_INFO_19 ('00101100'B),
828 RSL_SYSTEM_INFO_20 ('00101101'B)
829 } with { variant "FIELDLENGTH(8)" }
830
Harald Welte9958a4d2017-12-14 21:21:33 +0100831 type record RSL_IE_IPA_ConnectionStats {
832 uint8_t len,
833 uint32_t tx_packets,
834 uint32_t tx_octets,
835 uint32_t rx_packets,
836 uint32_t rx_octets,
837 uint32_t lost_packets,
838 uint32_t jitter,
839 uint32_t avg_delay
840 } with { variant (len) "LENGTHTO(tx_packets,tx_octets,rx_packets,rx_octets,lost_packets,jitter,avg_delay)" }
841
842 type enumerated RSL_IPA_SpeechMode {
843 RSL_IPA_SPM_SENDRECV ('00'B),
844 RSL_IPA_SPM_RECVONLY ('01'B),
845 RSL_IPA_SPM_SENDONLY ('10'B),
846 RSL_IPA_SPM_RESERVED ('11'B)
847 } with { variant "FIELDLENGTH(2)" }
848
849 type enumerated RSL_IPA_Codec {
850 RSL_IPA_CODEC_FR ('0000'B),
851 RSL_IPA_CODEC_EFR ('0001'B),
852 RSL_IPA_CODEC_AMR_F ('0010'B),
853 RSL_IPA_CODEC_HR ('0011'B),
854 RSL_IPA_CODEC_AMR_H ('0101'B),
855 RSL_IPA_CODEC_RTP_PT ('1111'B)
856 } with { variant "FIELDLENGTH(4)" }
857
858 type record RSL_IE_IPA_SpeechMode {
859 BIT2 reserved,
860 RSL_IPA_SpeechMode mode,
861 RSL_IPA_Codec codec
862 }
863
Harald Welte0472ab42018-03-12 15:02:26 +0100864 /* 9.3.20 */
865 type enumerated RSL_IE_ReleaseMode {
866 RSL_REL_MODE_NORMAL ('00'B),
867 REL_REL_MODE_LOCAL ('01'B)
868 }
869
Neels Hofmeyr2bef0dd2021-04-22 21:46:00 +0000870 type record RSL_IE_OSMO_TrainingSequence {
871 uint8_t len,
872 uint8_t tsc_set,
873 uint8_t tsc
874 } with { variant (len) "LENGTHTO(tsc_set,tsc)" }
875
Harald Welte643e2a62017-11-27 15:03:18 +0100876 /* union of all IE bodies */
877 type union RSL_IE_Body {
878 RslChannelNr chan_nr,
879 RslLinkId link_id,
Harald Welte15bb5b52017-12-07 17:52:04 +0100880 RSL_L16V l3_info,
Harald Welte643e2a62017-11-27 15:03:18 +0100881 RSL_LV rlm_cause,
Harald Welte0472ab42018-03-12 15:02:26 +0100882 RSL_IE_ReleaseMode release_mode,
Harald Welte643e2a62017-11-27 15:03:18 +0100883 RSL_IE_ActivationType act_type,
Vadim Yanitskiye02dbcc2020-08-25 04:20:51 +0700884 RSL_IE_ChannelIdent chan_ident,
Harald Welte643e2a62017-11-27 15:03:18 +0100885 RSL_IE_ChannelMode chan_mode,
886 uint8_t handover_ref,
887 RSL_IE_BS_Power bs_power,
Vadim Yanitskiy802508e2020-11-11 07:25:47 +0700888 RSL_LV bs_power_params,
Harald Welte643e2a62017-11-27 15:03:18 +0100889 RSL_IE_MS_Power ms_power,
Eric Wild61edb7e2019-06-03 12:38:31 +0200890 RSL_IE_MS_Power_Parameters ms_power_params,
Harald Welte643e2a62017-11-27 15:03:18 +0100891 uint8_t timing_adv,
892 RSL_IE_MultirateCtrl multirate_ctrl,
Harald Weltea6706152019-05-19 20:38:18 +0200893 uint8_t msg_id,
Harald Welte643e2a62017-11-27 15:03:18 +0100894 RSL_IE_FrameNumber frame_nr,
895 RSL_IE_Cause cause,
896 uint8_t access_delay,
Harald Welted5f521e2017-12-07 17:53:06 +0100897 RSL_IE_RachLoad rach_load,
Harald Welte643e2a62017-11-27 15:03:18 +0100898 uint8_t meas_res_nr,
Harald Welte2691adf2018-02-22 17:32:39 +0100899 uint8_t ms_timing_offset,
900 RSL_IE_UplinkMeas uplink_meas,
Harald Welte643e2a62017-11-27 15:03:18 +0100901 RSL_IE_L1Info l1_info,
902 RSL_IE_SysinfoType sysinfo_type,
903 uint16_t paging_load,
904 uint8_t paging_group,
905 RSL_IE_ChanNeeded chan_needed,
Harald Weltecc373202018-09-10 10:28:21 +0200906 RSL_IE_CbCommandType cb_cmd_type,
907 RSL_LV smscb_message,
Harald Welte4a129f82019-05-21 16:35:22 +0200908 RSL_IE_CbchLoadInfo cbch_load_info,
Vadim Yanitskiy9f699532021-06-03 17:29:22 +0200909 RSL_IE_ResourceInfo resource_info,
Harald Weltec8d363c2019-05-19 20:36:48 +0200910 RSL_SacchInfo sacch_info,
Harald Weltecc373202018-09-10 10:28:21 +0200911
Harald Welte643e2a62017-11-27 15:03:18 +0100912 RSL_IE_StartingTime starting_time,
Harald Welte73cd2712017-12-17 00:44:52 +0100913 RSL_IE_EncryptionInfo encr_info,
Harald Weltea3ff6702019-05-20 20:03:50 +0200914 uint8_t smscb_chan_ind,
Harald Welte643e2a62017-11-27 15:03:18 +0100915 RSL_IE_RequestRef req_ref,
916 RSL_LV full_imm_ass_info,
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +0700917 MobileIdentityLV ms_identity,
Harald Welte643e2a62017-11-27 15:03:18 +0100918
Harald Welte9958a4d2017-12-14 21:21:33 +0100919 uint16_t ipa_conn_id,
920 uint16_t ipa_local_port,
921 uint16_t ipa_remote_port,
922 uint32_t ipa_local_ip,
923 uint32_t ipa_remote_ip,
924 uint8_t ipa_rtp_pt,
925 uint8_t ipa_rtp_pt2,
926 RSL_IE_IPA_ConnectionStats ipa_stats,
927 RSL_IE_IPA_SpeechMode ipa_speech_mode,
928
Neels Hofmeyr2bef0dd2021-04-22 21:46:00 +0000929 RSL_IE_OSMO_TrainingSequence osmo_training_sequence,
930
Harald Welte643e2a62017-11-27 15:03:18 +0100931 RSL_LV other
932 }
933
934 type record RSL_IE {
935 RSL_IE_Type iei,
936 RSL_IE_Body body
937 } with { variant (body) "CROSSTAG(
938 chan_nr, iei = RSL_IE_CHAN_NR;
939 link_id, iei = RSL_IE_LINK_IDENT;
940 l3_info, iei = RSL_IE_L3_INFO;
941 rlm_cause, iei = RSL_IE_RLM_CAUSE;
942 release_mode, iei = RSL_IE_RELEASE_MODE;
943 act_type, iei = RSL_IE_ACT_TYPE;
Vadim Yanitskiye02dbcc2020-08-25 04:20:51 +0700944 chan_ident, iei = RSL_IE_CHAN_IDENT;
Harald Welte643e2a62017-11-27 15:03:18 +0100945 chan_mode, iei = RSL_IE_CHAN_MODE;
946 handover_ref, iei = RSL_IE_HANDO_REF;
947 bs_power, iei = RSL_IE_BS_POWER;
Vadim Yanitskiy802508e2020-11-11 07:25:47 +0700948 bs_power_params, iei = RSL_IE_BS_POWER_PARAM;
Harald Welte643e2a62017-11-27 15:03:18 +0100949 ms_power, iei = RSL_IE_MS_POWER;
Eric Wild61edb7e2019-06-03 12:38:31 +0200950 ms_power_params, iei = RSL_IE_MS_POWER_PARAM;
Harald Welte643e2a62017-11-27 15:03:18 +0100951 timing_adv, iei = RSL_IE_TIMING_ADVANCE;
952 multirate_ctrl, iei = RSL_IE_MR_CONTROL;
Harald Weltea6706152019-05-19 20:38:18 +0200953 msg_id, iei = RSL_IE_MSG_ID;
Harald Welte643e2a62017-11-27 15:03:18 +0100954
955 frame_nr, iei = RSL_IE_FRAME_NUMBER;
956 cause, iei = RSL_IE_CAUSE;
957 access_delay, iei = RSL_IE_ACCESS_DELAY;
Harald Welted5f521e2017-12-07 17:53:06 +0100958 rach_load, iei = RSL_IE_RACH_LOAD;
Harald Welte643e2a62017-11-27 15:03:18 +0100959 meas_res_nr, iei = RSL_IE_MEAS_RES_NR;
Harald Welte2691adf2018-02-22 17:32:39 +0100960 ms_timing_offset, iei = RSL_IE_MS_TIMING_OFFSET;
961 uplink_meas, iei = RSL_IE_UPLINK_MEAS;
Harald Welte643e2a62017-11-27 15:03:18 +0100962 l1_info, iei = RSL_IE_L1_INFO;
963 sysinfo_type, iei = RSL_IE_SYSINFO_TYPE;
964 paging_load, iei = RSL_IE_PAGING_LOAD;
965 paging_group, iei = RSL_IE_PAGING_GROUP;
966 chan_needed, iei = RSL_IE_CHAN_NEEDED;
Harald Weltecc373202018-09-10 10:28:21 +0200967 cb_cmd_type, iei = RSL_IE_CB_CMD_TYPE;
968 smscb_message, iei = RSL_IE_SMSCB_MSG;
Harald Welte4a129f82019-05-21 16:35:22 +0200969 cbch_load_info, iei = RSL_IE_CBCH_LOAD_INFO;
Vadim Yanitskiy9f699532021-06-03 17:29:22 +0200970 resource_info, iei = RSL_IE_RESOURCE_INFO;
Harald Weltec8d363c2019-05-19 20:36:48 +0200971 sacch_info, iei = RSL_IE_SACCH_INFO;
Harald Welte643e2a62017-11-27 15:03:18 +0100972 starting_time, iei = RSL_IE_STARTNG_TIME;
Harald Welte73cd2712017-12-17 00:44:52 +0100973 encr_info, iei = RSL_IE_ENCR_INFO;
Harald Weltea3ff6702019-05-20 20:03:50 +0200974 smscb_chan_ind, iei = RSL_IE_SMSCB_CHAN_INDICATOR;
Harald Welte643e2a62017-11-27 15:03:18 +0100975
976 req_ref, iei = RSL_IE_REQ_REFERENCE;
Harald Weltefff69302017-12-07 17:53:42 +0100977 full_imm_ass_info, iei = RSL_IE_FULL_IMM_ASS_INFO;
978 ms_identity, iei = RSL_IE_MS_IDENTITY;
979 other, iei = RSL_IE_FULL_BCCH_INFO;
Harald Welte643e2a62017-11-27 15:03:18 +0100980
Harald Welte9958a4d2017-12-14 21:21:33 +0100981 ipa_conn_id, iei = RSL_IE_IPAC_CONN_ID;
982 ipa_remote_ip, iei = RSL_IE_IPAC_REMOTE_IP;
983 ipa_remote_port, iei = RSL_IE_IPAC_REMOTE_PORT;
984 ipa_local_ip, iei = RSL_IE_IPAC_LOCAL_IP;
985 ipa_local_port, iei = RSL_IE_IPAC_LOCAL_PORT;
986 ipa_rtp_pt, iei = RSL_IE_IPAC_RTP_PAYLOAD;
987 ipa_rtp_pt2, iei = RSL_IE_IPAC_RTP_PAYLOAD2;
988 ipa_stats, iei = RSL_IE_IPAC_CONN_STAT;
989 ipa_speech_mode, iei = RSL_IE_IPAC_SPEECH_MODE;
990
Neels Hofmeyr2bef0dd2021-04-22 21:46:00 +0000991 osmo_training_sequence, iei = RSL_IE_OSMO_TRAINING_SEQUENCE;
992
Harald Welte643e2a62017-11-27 15:03:18 +0100993 other, OTHERWISE;
994 )" };
995
Harald Welte735dd072017-12-12 14:55:17 +0100996 /* For some reason the TTCN-3 RAW codec cannot automatically figure out the IEI
997 * that it needs to set for a given union-choice (body). So we have to explicitly
998 * specify the IEI by the caller :( */
Harald Welteefa7d912018-04-18 23:22:15 +0200999 template (value) RSL_IE t_RSL_IE(RSL_IE_Type iei, template (value) RSL_IE_Body body) := {
Harald Welte735dd072017-12-12 14:55:17 +01001000 iei := iei,
Harald Welte643e2a62017-11-27 15:03:18 +01001001 body := body
1002 }
1003
Harald Weltec2877752017-12-07 17:54:35 +01001004 template RSL_IE tr_RSL_IE(template RSL_IE_Body body) := {
1005 iei := ?, /* overwritten? */
1006 body := body
1007 }
1008
1009
Harald Welte643e2a62017-11-27 15:03:18 +01001010 type record of RSL_IE RSL_IE_List;
1011
1012 type record RSL_Message {
1013 RSL_MessageDiscriminator msg_disc,
1014 RSL_MessageType msg_type,
1015 RSL_IE_List ies optional
1016 }
1017
1018 external function enc_RSL_Message(in RSL_Message msg) return octetstring
1019 with { extension "prototype(convert) encode(RAW)" };
1020 external function dec_RSL_Message(in octetstring stream) return RSL_Message
1021 with { extension "prototype(convert) decode(RAW)" };
1022
Harald Weltebc330be2017-12-09 00:56:36 +01001023 template RSL_Message tr_RSL_MsgDiscType(template RSL_MessageDiscriminator m_disc,
Harald Welte643e2a62017-11-27 15:03:18 +01001024 RSL_MessageType m_type) := {
1025 msg_disc := m_disc,
1026 msg_type := m_type,
1027 ies := *
1028 }
1029
Harald Welteefa7d912018-04-18 23:22:15 +02001030 template (value) RSL_Message ts_RSL_MsgDiscType(template (value) RSL_MessageDiscriminator m_disc,
1031 template (value) RSL_MessageType msg_type,
1032 template (omit) RSL_IE_List ies := omit) := {
Harald Welte4a267362017-12-09 17:49:32 +01001033 msg_disc := m_disc,
1034 msg_type := msg_type,
1035 ies := ies
1036 }
1037
Harald Weltebc330be2017-12-09 00:56:36 +01001038template RSL_Message tr_RSL_MsgType(template RSL_MessageType msg_type) := {
1039 msg_disc := ?,
1040 msg_type := msg_type,
1041 ies := *
1042}
1043
1044/* Common Channel Management */
1045template RSL_Message tr_RSL_MsgTypeC(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
1046 msg_disc := { RSL_MDISC_CCHAN, ? }
1047}
1048
1049/* RLL */
1050template RSL_Message tr_RSL_MsgTypeR(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
1051 msg_disc := { RSL_MDISC_RLL, true }
1052}
1053
1054/* Dedicated Channel Management */
1055template RSL_Message tr_RSL_MsgTypeD(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
1056 msg_disc := { RSL_MDISC_DCHAN, ? }
1057}
1058
1059/* Dedicated Channel Management */
1060template RSL_Message tr_RSL_MsgTypeT(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
1061 msg_disc := { RSL_MDISC_TRX_MGMT, ? }
1062}
1063
1064
1065/* dedicated channel or RLL */
1066template RSL_Message tr_RSL_MsgTypeDR(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
Harald Weltee5408222018-01-29 21:57:58 +01001067 msg_disc := ({RSL_MDISC_DCHAN,?}, {RSL_MDISC_RLL,?}, {RSL_MDISC_IPACCESS,false})
Harald Weltebc330be2017-12-09 00:56:36 +01001068}
1069
1070
Harald Welte643e2a62017-11-27 15:03:18 +01001071 /* 8.3.1 BSC -> BTS */
Harald Welteefa7d912018-04-18 23:22:15 +02001072 template (value) RSL_Message ts_RSL_DATA_REQ(template (value) RslChannelNr chan_nr,
1073 template (value) RslLinkId link_id,
1074 octetstring l3_info) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001075 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, true),
1076 msg_type := RSL_MT_DATA_REQ,
1077 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001078 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1079 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
1080 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
Harald Welte643e2a62017-11-27 15:03:18 +01001081 }
1082 }
1083
Harald Welte7794d5b2017-12-16 23:00:20 +01001084 template RSL_Message tr_RSL_DATA_REQ(template RslChannelNr chan_nr :=?,
1085 template RslLinkId link_id := ?,
1086 template octetstring l3_info := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001087 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, true),
Harald Welte7794d5b2017-12-16 23:00:20 +01001088 msg_type := RSL_MT_DATA_REQ,
1089 ies :={
1090 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1091 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
1092 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
1093 }
1094 }
1095
1096
Harald Welte643e2a62017-11-27 15:03:18 +01001097 /* 8.3.2 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001098 template (value) RSL_Message ts_RSL_DATA_IND(template (value) RslChannelNr chan_nr,
1099 template (value) RslLinkId link_id,
1100 octetstring l3_info) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001101 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, true),
1102 msg_type := RSL_MT_DATA_IND,
1103 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001104 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1105 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
1106 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
Harald Welte643e2a62017-11-27 15:03:18 +01001107 }
1108 }
Harald Welte9abd1282018-02-19 19:18:17 +01001109 template RSL_Message tr_RSL_DATA_IND(template RslChannelNr chan_nr, template RslLinkId link_id,
1110 template octetstring l3_info := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001111 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, true),
Harald Welte9abd1282018-02-19 19:18:17 +01001112 msg_type := RSL_MT_DATA_IND,
1113 ies :={
1114 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1115 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
1116 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
1117 }
1118 }
Harald Welte643e2a62017-11-27 15:03:18 +01001119
1120 /* 8.3.3 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001121 template (value) RSL_Message ts_RSL_ERROR_IND(template (value) RslChannelNr chan_nr,
Harald Weltea7d81f12019-06-02 22:33:19 +02001122 template (value) RslLinkId link_id,
1123 template (value) octetstring rlm_cause) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001124 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1125 msg_type := RSL_MT_ERROR_IND,
1126 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001127 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1128 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
Harald Weltea7d81f12019-06-02 22:33:19 +02001129 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{rlm_cause := ts_RSL_LV(rlm_cause)})
Harald Welte643e2a62017-11-27 15:03:18 +01001130 }
1131 }
Harald Welte9abd1282018-02-19 19:18:17 +01001132 template RSL_Message tr_RSL_ERROR_IND(template RslChannelNr chan_nr, template RslLinkId link_id,
Harald Weltea7d81f12019-06-02 22:33:19 +02001133 template octetstring rlm_cause := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001134 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001135 msg_type := RSL_MT_ERROR_IND,
1136 ies :={
1137 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1138 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
Harald Weltea7d81f12019-06-02 22:33:19 +02001139 tr_RSL_IE(RSL_IE_Body:{rlm_cause := tr_RSL_LV(rlm_cause)})
Harald Welte9abd1282018-02-19 19:18:17 +01001140 }
1141 }
Harald Welte643e2a62017-11-27 15:03:18 +01001142
Harald Welteefa7d912018-04-18 23:22:15 +02001143 /* 8.3.4 BTS <- BSC */
1144 template (value) RSL_Message ts_RSL_EST_REQ(template (value) RslChannelNr chan_nr,
1145 template (value) RslLinkId link_id) := {
1146 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1147 msg_type := RSL_MT_EST_REQ,
1148 ies := {
1149 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1150 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
1151 }
1152 }
1153 template RSL_Message tr_RSL_EST_REQ(template RslChannelNr chan_nr, template RslLinkId link_id) := {
1154 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
1155 msg_type := RSL_MT_EST_REQ,
1156 ies := {
1157 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1158 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1159 }
1160 }
1161
1162 /* 8.3.5 BTS -> BSC */
1163 template (value) RSL_Message ts_RSL_EST_CONF(template (value) RslChannelNr chan_nr,
1164 template (value) RslLinkId link_id) := {
1165 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1166 msg_type := RSL_MT_EST_CONF,
1167 ies := {
1168 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1169 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
1170 }
1171 }
1172 template RSL_Message tr_RSL_EST_CONF(template RslChannelNr chan_nr, template RslLinkId link_id) := {
1173 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
1174 msg_type := RSL_MT_EST_CONF,
1175 ies := {
1176 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1177 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1178 }
1179 }
1180
Harald Welte643e2a62017-11-27 15:03:18 +01001181 /* 8.3.6 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001182 template (value) RSL_Message ts_RSL_EST_IND(template (value) RslChannelNr chan_nr,
1183 template (value) RslLinkId link_id,
1184 octetstring l3_info) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001185 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1186 msg_type := RSL_MT_EST_IND,
1187 ies := {
Harald Welte735dd072017-12-12 14:55:17 +01001188 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1189 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
1190 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
Harald Welte643e2a62017-11-27 15:03:18 +01001191 }
1192 }
Harald Welte9abd1282018-02-19 19:18:17 +01001193 template RSL_Message tr_RSL_EST_IND(template RslChannelNr chan_nr, template RslLinkId link_id,
1194 template octetstring l3_info := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001195 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001196 msg_type := RSL_MT_EST_IND,
1197 ies := {
1198 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1199 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
1200 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
1201 }
1202 }
Harald Welte0472ab42018-03-12 15:02:26 +01001203 template RSL_Message tr_RSL_EST_IND_NOL3(template RslChannelNr chan_nr, template RslLinkId link_id) :=
1204{
1205 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
1206 msg_type := RSL_MT_EST_IND,
1207 ies := {
1208 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1209 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1210 }
1211 }
1212
Harald Welte643e2a62017-11-27 15:03:18 +01001213
1214 /* 8.3.7 BSC -> BTS */
Harald Welteefa7d912018-04-18 23:22:15 +02001215 template (value) RSL_Message ts_RSL_REL_REQ(template (value) RslChannelNr chan_nr,
Harald Welte0472ab42018-03-12 15:02:26 +01001216 template (value) RslLinkId link_id,
1217 template (value) RSL_IE_ReleaseMode rel_mode := RSL_REL_MODE_NORMAL) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001218 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1219 msg_type := RSL_MT_REL_REQ,
1220 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001221 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
Harald Welte0472ab42018-03-12 15:02:26 +01001222 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
1223 t_RSL_IE(RSL_IE_RELEASE_MODE, RSL_IE_Body:{release_mode := rel_mode})
Harald Welte643e2a62017-11-27 15:03:18 +01001224 }
1225 }
Harald Weltee8a5ab12017-12-09 22:34:57 +01001226 template RSL_Message tr_RSL_REL_REQ(template RslChannelNr chan_nr,
Harald Welte0472ab42018-03-12 15:02:26 +01001227 template RslLinkId link_id,
1228 template RSL_IE_ReleaseMode rel_mode := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001229 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Weltee8a5ab12017-12-09 22:34:57 +01001230 msg_type := RSL_MT_REL_REQ,
1231 ies :={
1232 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1233 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
Harald Welte0472ab42018-03-12 15:02:26 +01001234 tr_RSL_IE(RSL_IE_Body:{release_mode := rel_mode})
Harald Weltee8a5ab12017-12-09 22:34:57 +01001235 }
1236 }
Harald Welte643e2a62017-11-27 15:03:18 +01001237
1238 /* 8.3.8 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001239 template (value) RSL_Message ts_RSL_REL_CONF(template (value) RslChannelNr chan_nr,
1240 template (value) RslLinkId link_id) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001241 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1242 msg_type := RSL_MT_REL_CONF,
1243 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001244 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1245 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
Harald Welte643e2a62017-11-27 15:03:18 +01001246 }
1247 }
Harald Welte9abd1282018-02-19 19:18:17 +01001248 template RSL_Message tr_RSL_REL_CONF(template RslChannelNr chan_nr, template RslLinkId link_id) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001249 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001250 msg_type := RSL_MT_REL_CONF,
1251 ies :={
1252 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1253 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1254 }
1255 }
Harald Welte643e2a62017-11-27 15:03:18 +01001256
1257 /* 8.3.9 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001258 template (value) RSL_Message ts_RSL_REL_IND(template (value) RslChannelNr chan_nr,
1259 template (value) RslLinkId link_id) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001260 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1261 msg_type := RSL_MT_REL_IND,
1262 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001263 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1264 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
Harald Welte643e2a62017-11-27 15:03:18 +01001265 }
1266 }
Harald Welte9abd1282018-02-19 19:18:17 +01001267 template RSL_Message tr_RSL_REL_IND(template RslChannelNr chan_nr, template RslLinkId link_id) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001268 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001269 msg_type := RSL_MT_REL_IND,
1270 ies :={
1271 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1272 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1273 }
1274 }
Harald Welte643e2a62017-11-27 15:03:18 +01001275
1276 /* 8.3.10 BSC -> BTS */
Harald Welteefa7d912018-04-18 23:22:15 +02001277 template (value) RSL_Message ts_RSL_UNITDATA_REQ(template (value) RslChannelNr chan_nr,
1278 template (value) RslLinkId link_id,
1279 octetstring l3_info)
Harald Welte643e2a62017-11-27 15:03:18 +01001280 modifies ts_RSL_DATA_REQ := {
1281 msg_type := RSL_MT_UNIT_DATA_REQ
1282 }
Harald Welte0472ab42018-03-12 15:02:26 +01001283 template RSL_Message tr_RSL_UNITDATA_REQ(template RslChannelNr chan_nr,
1284 template RslLinkId link_id,
Vadim Yanitskiy8f98d3f2018-10-03 17:58:10 +07001285 template octetstring l3_info := ?)
Harald Welte0472ab42018-03-12 15:02:26 +01001286 modifies tr_RSL_DATA_REQ := {
1287 msg_type := RSL_MT_UNIT_DATA_REQ
1288 }
1289
Harald Welte643e2a62017-11-27 15:03:18 +01001290
1291 /* 8.3.11 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001292 template (value) RSL_Message ts_RSL_UNITDATA_IND(template (value) RslChannelNr chan_nr,
1293 template (value) RslLinkId link_id,
1294 octetstring l3_info)
Harald Welte643e2a62017-11-27 15:03:18 +01001295 modifies ts_RSL_DATA_IND := {
1296 msg_type := RSL_MT_UNIT_DATA_IND
1297 }
Harald Welte0472ab42018-03-12 15:02:26 +01001298 template RSL_Message tr_RSL_UNITDATA_IND(template RslChannelNr chan_nr,
Vadim Yanitskiyfabe0f22018-10-03 17:51:47 +07001299 template RslLinkId link_id,
Vadim Yanitskiy8f98d3f2018-10-03 17:58:10 +07001300 template octetstring l3_info := ?)
Harald Welte0472ab42018-03-12 15:02:26 +01001301 modifies tr_RSL_DATA_IND := {
1302 msg_type := RSL_MT_UNIT_DATA_IND
1303 }
1304
1305
Harald Welte643e2a62017-11-27 15:03:18 +01001306
1307
1308 /* DEDICATED CANNEL MANAGEMENT MESSAGES */
1309
1310 /* 8.4.1 BSC -> BTS */
Harald Welteefa7d912018-04-18 23:22:15 +02001311 template (value) RSL_Message ts_RSL_CHAN_ACT(template (value) RslChannelNr chan_nr,
Harald Welte921f9e02019-05-19 22:27:11 +02001312 template (value) RSL_IE_ChannelMode mode,
1313 template (value) RSL_IE_ActivationType at := t_RSL_IE_ActType_IA) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001314 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1315 msg_type := RSL_MT_CHAN_ACTIV,
1316 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001317 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
Harald Welte921f9e02019-05-19 22:27:11 +02001318 t_RSL_IE(RSL_IE_ACT_TYPE, RSL_IE_Body:{act_type := at}),
Harald Welte735dd072017-12-12 14:55:17 +01001319 t_RSL_IE(RSL_IE_CHAN_MODE, RSL_IE_Body:{chan_mode := mode})
Harald Welte643e2a62017-11-27 15:03:18 +01001320 /* lots of optional IEs */
1321 }
1322 }
Harald Welte94e0c342018-04-07 11:33:23 +02001323 template RSL_Message tr_RSL_CHAN_ACT(template RslChannelNr chan_nr,
Harald Welte921f9e02019-05-19 22:27:11 +02001324 template RSL_IE_ChannelMode mode,
1325 template (value) RSL_IE_ActivationType at := t_RSL_IE_ActType_IA) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001326 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte94e0c342018-04-07 11:33:23 +02001327 msg_type := RSL_MT_CHAN_ACTIV,
1328 ies :={
1329 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
Harald Welte921f9e02019-05-19 22:27:11 +02001330 tr_RSL_IE(RSL_IE_Body:{act_type := at}),
Harald Welte94e0c342018-04-07 11:33:23 +02001331 tr_RSL_IE(RSL_IE_Body:{chan_mode := mode}),
1332 /* lots of optional IEs */
1333 *
1334 }
1335 }
1336 template RSL_Message tr_RSL_CHAN_ACT_PDCH(template RslChannelNr chan_nr,
1337 template RSL_IE_ChannelMode mode) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001338 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte94e0c342018-04-07 11:33:23 +02001339 msg_type := RSL_MT_CHAN_ACTIV,
1340 ies :={
1341 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1342 tr_RSL_IE(RSL_IE_Body:{act_type := t_RSL_IE_ActType_PDCH}),
1343 /* lots of optional IEs */
1344 *
1345 }
1346 }
1347
Harald Welte643e2a62017-11-27 15:03:18 +01001348
1349 /* 8.4.2 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001350 template (value) RSL_Message ts_RSL_CHAN_ACT_ACK(template (value) RslChannelNr chan_nr,
1351 GsmFrameNumber fn) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001352 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1353 msg_type := RSL_MT_CHAN_ACTIV_ACK,
1354 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001355 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1356 t_RSL_IE(RSL_IE_FRAME_NUMBER, RSL_IE_Body:{frame_nr := ts_RSL_IE_FrameNumber(fn)})
Harald Welte643e2a62017-11-27 15:03:18 +01001357 }
1358 }
Harald Welte9abd1282018-02-19 19:18:17 +01001359 template RSL_Message tr_RSL_CHAN_ACT_ACK(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001360 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001361 msg_type := RSL_MT_CHAN_ACTIV_ACK,
1362 ies := {
1363 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1364 tr_RSL_IE(RSL_IE_Body:{frame_nr := ?})
1365 }
1366 }
Harald Welte643e2a62017-11-27 15:03:18 +01001367
1368 /* 8.4.3 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001369 template (value) RSL_Message ts_RSL_CHAN_ACT_NACK(template (value) RslChannelNr chan_nr,
1370 RSL_Cause cause) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001371 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1372 msg_type := RSL_MT_CHAN_ACTIV_NACK,
1373 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001374 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1375 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
Harald Welte643e2a62017-11-27 15:03:18 +01001376 }
1377 }
Harald Welte9abd1282018-02-19 19:18:17 +01001378 template RSL_Message tr_RSL_CHAN_ACT_NACK(template RslChannelNr chan_nr,
1379 template RSL_Cause cause := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001380 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001381 msg_type := RSL_MT_CHAN_ACTIV_NACK,
1382 ies := {
1383 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1384 tr_RSL_IE(RSL_IE_Body:{cause := ?})
1385 }
1386 }
Harald Welte643e2a62017-11-27 15:03:18 +01001387
1388 /* 8.4.4 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001389 template (value) RSL_Message ts_RSL_CONN_FAIL_IND(RslChannelNr chan_nr, RSL_Cause cause) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001390 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1391 msg_type := RSL_MT_CONN_FAIL,
1392 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001393 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1394 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
Harald Welte643e2a62017-11-27 15:03:18 +01001395 }
1396 }
Harald Welte9abd1282018-02-19 19:18:17 +01001397 template RSL_Message tr_RSL_CONN_FAIL_IND(template RslChannelNr chan_nr,
1398 template RSL_Cause cause := ?) := {
1399 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1400 msg_type := RSL_MT_CONN_FAIL,
1401 ies :={
1402 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1403 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
1404 }
1405 }
Harald Welte643e2a62017-11-27 15:03:18 +01001406
Harald Weltee8a5ab12017-12-09 22:34:57 +01001407 /* 8.4.5 BSC -> BTS */
1408 template RSL_Message tr_RSL_DEACT_SACCH(template RslChannelNr chan_nr) := {
1409 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1410 msg_type := RSL_MT_DEACTIVATE_SACCH,
1411 ies := {
1412 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
1413 }
1414 }
Harald Welteefa7d912018-04-18 23:22:15 +02001415 template (value) RSL_Message ts_RSL_DEACT_SACCH(template (value) RslChannelNr chan_nr) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001416 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1417 msg_type := RSL_MT_DEACTIVATE_SACCH,
1418 ies := {
1419 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1420 }
1421 }
1422
Harald Weltee8a5ab12017-12-09 22:34:57 +01001423
Harald Welte73cd2712017-12-17 00:44:52 +01001424 /* 8.4.6 BSC ->BTS */
1425 template RSL_Message tr_RSL_ENCR_CMD(template RslChannelNr chan_nr,
1426 template RslLinkId link_id := ?,
Harald Weltee613f962018-04-18 22:38:16 +02001427 template RSL_AlgId alg := ?,
Harald Welte73cd2712017-12-17 00:44:52 +01001428 template octetstring key := ?,
1429 template octetstring l3_info := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001430 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte73cd2712017-12-17 00:44:52 +01001431 msg_type := RSL_MT_ENCR_CMD,
1432 ies := {
1433 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1434 tr_RSL_IE(RSL_IE_Body:{encr_info := tr_RSL_IE_EncrInfo(alg, key)}),
1435 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
1436 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
1437 }
1438 }
Harald Welteefa7d912018-04-18 23:22:15 +02001439 template (value) RSL_Message ts_RSL_ENCR_CMD(template (value) RslChannelNr chan_nr,
1440 template (value) RslLinkId link_id,
Harald Weltee613f962018-04-18 22:38:16 +02001441 template (value) RSL_AlgId alg, octetstring key,
Harald Welteefa7d912018-04-18 23:22:15 +02001442 octetstring l3_info) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001443 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1444 msg_type := RSL_MT_ENCR_CMD,
1445 ies := {
1446 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
Harald Welteefa7d912018-04-18 23:22:15 +02001447 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 +01001448 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
Harald Welteefa7d912018-04-18 23:22:15 +02001449 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
Harald Welte9abd1282018-02-19 19:18:17 +01001450 }
1451 }
Harald Welte73cd2712017-12-17 00:44:52 +01001452
Harald Welte2691adf2018-02-22 17:32:39 +01001453 template RSL_Message tr_RSL_MEAS_RES(template RslChannelNr chan_nr,
1454 template uint8_t meas_res_nr := ?,
1455 template RSL_IE_UplinkMeas ul_meas := ?,
1456 template RSL_IE_BS_Power bs_power := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001457 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte2691adf2018-02-22 17:32:39 +01001458 msg_type := RSL_MT_MEAS_RES,
1459 ies := {
1460 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1461 tr_RSL_IE(RSL_IE_Body:{meas_res_nr := meas_res_nr}),
1462 tr_RSL_IE(RSL_IE_Body:{uplink_meas := ul_meas}),
1463 tr_RSL_IE(RSL_IE_Body:{bs_power := bs_power}),
1464 *
1465 }
1466 }
1467
Philipp Maierdd841d32019-12-17 14:44:54 +01001468 /* Receive template for a measurement report that lacks the measurement report
1469 * from the MS (l1_info, l3_info and ms timing offset */
1470 template RSL_Message tr_RSL_MEAS_RES_EMPTY(template RslChannelNr chan_nr,
1471 template uint8_t meas_res_nr := ?,
1472 template RSL_IE_UplinkMeas ul_meas := ?,
1473 template RSL_IE_BS_Power bs_power := ?) := {
1474 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1475 msg_type := RSL_MT_MEAS_RES,
1476 ies := {
1477 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1478 tr_RSL_IE(RSL_IE_Body:{meas_res_nr := meas_res_nr}),
1479 tr_RSL_IE(RSL_IE_Body:{uplink_meas := ul_meas}),
1480 tr_RSL_IE(RSL_IE_Body:{bs_power := bs_power})
1481 }
1482 }
1483
Harald Welte39b47be2018-02-23 18:58:48 +01001484 /* Osmocom specific template, require lots of optional fields to be present */
1485 template RSL_Message tr_RSL_MEAS_RES_OSMO(template RslChannelNr chan_nr,
1486 template uint8_t meas_res_nr := ?,
1487 template RSL_IE_UplinkMeas ul_meas := ?,
1488 template RSL_IE_BS_Power bs_power := ?,
1489 template RSL_IE_L1Info l1_info := ?,
1490 template octetstring l3_info := ?,
1491 template uint8_t ms_to := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001492 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte39b47be2018-02-23 18:58:48 +01001493 msg_type := RSL_MT_MEAS_RES,
1494 ies := {
1495 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1496 tr_RSL_IE(RSL_IE_Body:{meas_res_nr := meas_res_nr}),
1497 tr_RSL_IE(RSL_IE_Body:{uplink_meas := ul_meas}),
1498 tr_RSL_IE(RSL_IE_Body:{bs_power := bs_power}),
1499 tr_RSL_IE(RSL_IE_Body:{l1_info := l1_info}),
1500 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)}),
1501 tr_RSL_IE(RSL_IE_Body:{ms_timing_offset := ms_to})
1502 }
1503 }
1504
Eric Wildf1827a72019-05-28 17:37:35 +02001505 /* 8.4.9 BSC -> BTS */
1506 template (value) RSL_Message ts_RSL_MODE_MODIFY_REQ(template (value) RslChannelNr chan_nr,
1507 template (value) RSL_IE_ChannelMode mode) := {
1508 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1509 msg_type := RSL_MT_MODE_MODIFY_REQ,
1510 ies :={
1511 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1512 t_RSL_IE(RSL_IE_CHAN_MODE, RSL_IE_Body:{chan_mode := mode})
1513 /* lots of optional IEs */
1514 }
1515 }
1516 template RSL_Message tr_RSL_MODE_MODIFY_REQ(template RslChannelNr chan_nr,
1517 template RSL_IE_ChannelMode mode) := {
1518 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1519 msg_type := RSL_MT_MODE_MODIFY_REQ,
1520 ies :={
1521 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1522 tr_RSL_IE(RSL_IE_Body:{chan_mode := mode}),
1523 /* lots of optional IEs */
1524 *
1525 }
1526 }
Neels Hofmeyr9f3e6ac2021-04-08 23:09:24 +02001527
1528 template RSL_Message tr_RSL_MODE_MODIFY_REQ_with_OSMO_TSC(template RslChannelNr chan_nr,
1529 template RSL_IE_ChannelMode mode,
1530 template uint8_t tsc_set := ?,
1531 template uint8_t tsc := ?) := {
1532 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1533 msg_type := RSL_MT_MODE_MODIFY_REQ,
1534 ies := {
1535 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1536 tr_RSL_IE(RSL_IE_Body:{chan_mode := mode}),
1537 tr_RSL_IE(RSL_IE_Body:{osmo_training_sequence := {
1538 len := ?,
1539 tsc_set := tsc_set,
1540 tsc := tsc
1541 }
1542 })
1543 }
1544 };
Eric Wildf1827a72019-05-28 17:37:35 +02001545
Harald Welte7794d5b2017-12-16 23:00:20 +01001546 /* 8.4.10 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001547 template (value) RSL_Message ts_RSL_MODE_MODIFY_ACK(template (value) RslChannelNr chan_nr) := {
Harald Welte7794d5b2017-12-16 23:00:20 +01001548 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1549 msg_type := RSL_MT_MODE_MODIFY_ACK,
1550 ies := {
1551 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1552 }
1553 }
Harald Welte9abd1282018-02-19 19:18:17 +01001554 template RSL_Message tr_RSL_MODE_MODIFY_ACK(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001555 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001556 msg_type := RSL_MT_MODE_MODIFY_ACK,
1557 ies := {
1558 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
1559 }
1560 }
Harald Welte7794d5b2017-12-16 23:00:20 +01001561
Harald Welte643e2a62017-11-27 15:03:18 +01001562 /* 8.4.11 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001563 template (value) RSL_Message ts_RSL_MODE_MODIFY_NACK(template (value) RslChannelNr chan_nr,
1564 RSL_Cause cause) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001565 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1566 msg_type := RSL_MT_MODE_MODIFY_NACK,
1567 ies := {
1568 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1569 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
1570 }
Harald Welte643e2a62017-11-27 15:03:18 +01001571 }
Harald Welte9abd1282018-02-19 19:18:17 +01001572 template RSL_Message tr_RSL_MODE_MODIFY_NACK(template RslChannelNr chan_nr,
1573 template RSL_Cause cause) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001574 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001575 msg_type := RSL_MT_MODE_MODIFY_NACK,
1576 ies := {
1577 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1578 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
1579 }
1580 }
1581
Harald Welte643e2a62017-11-27 15:03:18 +01001582
Harald Welte6a8199d2018-01-29 21:58:53 +01001583 /* 8.4.14: BTS <- BSC */
1584 template RSL_Message tr_RSL_RF_CHAN_REL(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001585 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte6a8199d2018-01-29 21:58:53 +01001586 msg_type := RSL_MT_RF_CHAN_REL,
1587 ies := {
1588 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
1589 }
1590 }
Harald Welteefa7d912018-04-18 23:22:15 +02001591 template (value) RSL_Message ts_RSL_RF_CHAN_REL(template (value) RslChannelNr chan_nr) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001592 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1593 msg_type := RSL_MT_RF_CHAN_REL,
1594 ies := {
1595 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1596 }
1597 }
Harald Welte6a8199d2018-01-29 21:58:53 +01001598
Philipp Maier4d1e9c92018-12-20 11:11:56 +01001599 /* 8.4.15: BTS <- BSC */
1600 template (value) RSL_Message ts_RSL_MS_PWR_CTRL(template (value) RslChannelNr chan_nr,
1601 template (value) RSL_IE_MS_Power ms_power) := {
1602 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1603 msg_type := RSL_MT_MS_POWER_CONTROL,
1604 ies := {
1605 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1606 t_RSL_IE(RSL_IE_MS_POWER, RSL_IE_Body:{ms_power := ms_power})
1607 /* One optional IE: MS POWER PARAMETERS */
1608 }
1609 }
1610
Eric Wild61edb7e2019-06-03 12:38:31 +02001611 template (value) RSL_Message ts_RSL_MS_PWR_CTRL_with_pp(template (value) RslChannelNr chan_nr,
1612 integer pwr_level) := {
1613 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1614 msg_type := RSL_MT_MS_POWER_CONTROL,
1615 ies := {
1616 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1617 t_RSL_IE(RSL_IE_MS_POWER, RSL_IE_Body:{ms_power := ts_RSL_IE_MS_Power(pwr_level)}),
1618 t_RSL_IE(RSL_IE_MS_POWER_PARAM, RSL_IE_Body:{ms_power_params :=
1619 ts_RSL_IE_MS_Power_Parameters(''O)})
1620 }
1621 }
1622
Eric Wildae8f2622019-06-18 17:05:11 +02001623 /* 8.4.16: BTS <- BSC */
1624 template (value) RSL_Message ts_RSL_BS_PWR_CTRL(template (value) RslChannelNr chan_nr,
1625 template (value) RSL_IE_BS_Power bs_power) := {
1626 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1627 msg_type := RSL_MT_BS_POWER_CONTROL,
1628 ies := {
1629 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1630 t_RSL_IE(RSL_IE_BS_POWER, RSL_IE_Body:{bs_power := bs_power})
1631 /* One optional IE: BS POWER PARAMETERS */
1632 }
1633 }
Vadim Yanitskiy2a5a1ef2021-06-30 00:51:48 +02001634 template RSL_Message tr_RSL_BS_PWR_CTRL(template (present) RslChannelNr chan_nr,
1635 template (present) RSL_IE_BS_Power bs_power) := {
1636 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1637 msg_type := RSL_MT_BS_POWER_CONTROL,
1638 ies := {
1639 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1640 tr_RSL_IE(RSL_IE_Body:{bs_power := bs_power})
1641 /* One optional IE: BS POWER PARAMETERS */
1642 }
1643 }
Eric Wildae8f2622019-06-18 17:05:11 +02001644
Harald Welte4a267362017-12-09 17:49:32 +01001645 /* 8.4.19 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001646 template (value) RSL_Message ts_RSL_RF_CHAN_REL_ACK(template (value) RslChannelNr chan_nr) :=
Harald Welte4a267362017-12-09 17:49:32 +01001647 ts_RSL_MsgDiscType(ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1648 RSL_MT_RF_CHAN_REL_ACK,
Harald Welte735dd072017-12-12 14:55:17 +01001649 { t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}) });
Harald Welte4a267362017-12-09 17:49:32 +01001650
Harald Welte9abd1282018-02-19 19:18:17 +01001651 template RSL_Message tr_RSL_RF_CHAN_REL_ACK(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001652 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001653 msg_type := RSL_MT_RF_CHAN_REL_ACK,
1654 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001655 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
Harald Welte9abd1282018-02-19 19:18:17 +01001656 }
1657 }
1658
Harald Welteea17b912018-03-11 22:29:31 +01001659 /* 8.6.20 BTS <- BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001660 template (value) RSL_Message ts_RSL_SACCH_INF_MOD(template (value) RslChannelNr chan_nr,
1661 RSL_IE_SysinfoType si_type,
1662 octetstring l3_info) := {
Harald Welteea17b912018-03-11 22:29:31 +01001663 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1664 msg_type := RSL_MT_SACCH_INFO_MODIFY,
1665 ies := {
1666 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1667 t_RSL_IE(RSL_IE_SYSINFO_TYPE, RSL_IE_Body:{sysinfo_type := si_type}),
1668 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
1669 }
1670 }
1671
Neels Hofmeyr378a49c2018-06-15 22:18:43 +02001672 /* 8.4.7 BTS -> BSC */
1673 template (value) RSL_Message ts_RSL_HANDO_DET(template (value) RslChannelNr chan_nr) := {
1674 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1675 msg_type := RSL_MT_HANDO_DET,
1676 ies := {
1677 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1678 }
1679 }
Vadim Yanitskiy7c2c10c2019-05-31 20:42:01 +07001680 template RSL_Message tr_RSL_HANDO_DET(template RslChannelNr chan_nr,
1681 template uint8_t acc_delay := ?) := {
1682 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1683 msg_type := RSL_MT_HANDO_DET,
1684 ies := {
1685 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1686 tr_RSL_IE(RSL_IE_Body:{access_delay := acc_delay})
1687 }
1688 }
Neels Hofmeyr378a49c2018-06-15 22:18:43 +02001689
Harald Welteea17b912018-03-11 22:29:31 +01001690
Harald Welte643e2a62017-11-27 15:03:18 +01001691 /* COMMON CHANNEL MANAGEMENT MESSAGES */
1692
Harald Welte874c2232018-02-24 04:52:43 +01001693 /* 8.5.1 BTS <- BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001694 template (value) RSL_Message ts_RSL_BCCH_INFO(RSL_IE_SysinfoType si_type,
1695 octetstring full_bcch_info) := {
Harald Welte874c2232018-02-24 04:52:43 +01001696 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1697 msg_type := RSL_MT_BCCH_INFO,
1698 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001699 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_BCCH(0)}),
Harald Welte874c2232018-02-24 04:52:43 +01001700 t_RSL_IE(RSL_IE_SYSINFO_TYPE, RSL_IE_Body:{sysinfo_type := si_type}),
1701 t_RSL_IE(RSL_IE_FULL_BCCH_INFO, RSL_IE_Body:{other := ts_RSL_LV(full_bcch_info)})
1702 }
1703 }
Harald Welte09538f82019-08-01 09:50:25 +02001704 template RSL_Message tr_RSL_NO_BCCH_INFO(template RSL_IE_SysinfoType si_type := ?) := {
1705 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1706 msg_type := RSL_MT_BCCH_INFO,
1707 ies := {
1708 tr_RSL_IE(RSL_IE_Body:{chan_nr := ts_RslChanNr_BCCH(0)}),
1709 tr_RSL_IE(RSL_IE_Body:{sysinfo_type := si_type})
1710 }
1711 }
1712 template RSL_Message tr_RSL_BCCH_INFO(template RSL_IE_SysinfoType si_type := ?,
1713 template octetstring full_bcch_info := ?) := {
1714 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1715 msg_type := RSL_MT_BCCH_INFO,
1716 ies := {
1717 tr_RSL_IE(RSL_IE_Body:{chan_nr := ts_RslChanNr_BCCH(0)}),
1718 tr_RSL_IE(RSL_IE_Body:{sysinfo_type := si_type}),
1719 tr_RSL_IE(RSL_IE_Body:{other := tr_RSL_LV(full_bcch_info)}),
1720 *
1721 }
1722 }
Harald Welte874c2232018-02-24 04:52:43 +01001723
Harald Welte7ae93142017-12-07 17:56:15 +01001724 /* 8.5.2 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001725 template (value) RSL_Message ts_RSL_RACH_LOAD_IND(uint16_t slot_ct, uint16_t busy_ct,
1726 uint16_t acc_ct) := {
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_RACH(0)}),
Harald Welte735dd072017-12-12 14:55:17 +01001731 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 +01001732 }
1733 }
Harald Welte68e495b2018-02-25 00:05:57 +01001734 template RSL_Message tr_RSL_RACH_LOAD_IND(template uint16_t slot_ct := ?,
1735 template uint16_t busy_ct := ?,
Harald Welte09538f82019-08-01 09:50:25 +02001736 template uint16_t acc_ct := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001737 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Welte68e495b2018-02-25 00:05:57 +01001738 msg_type := RSL_MT_CCCH_LOAD_IND,
1739 ies := {
1740 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_RACH(0)}),
1741 tr_RSL_IE(RSL_IE_Body:{rach_load := tr_RSL_IE_RachLoad(slot_ct, busy_ct, acc_ct)})
1742 }
1743 }
1744
Harald Welteefa7d912018-04-18 23:22:15 +02001745 template (value) RSL_Message ts_RSL_PAGING_LOAD_IND(uint16_t buffer_space) := {
Harald Welte7ae93142017-12-07 17:56:15 +01001746 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1747 msg_type := RSL_MT_CCCH_LOAD_IND,
1748 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001749 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_PCH_AGCH(0)}),
Harald Welte735dd072017-12-12 14:55:17 +01001750 t_RSL_IE(RSL_IE_PAGING_LOAD, RSL_IE_Body:{paging_load := buffer_space})
Harald Welte7ae93142017-12-07 17:56:15 +01001751 }
1752 }
Harald Welte68e495b2018-02-25 00:05:57 +01001753 template RSL_Message tr_RSL_PAGING_LOAD_IND(template uint16_t buffer_space := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001754 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Welte68e495b2018-02-25 00:05:57 +01001755 msg_type := RSL_MT_CCCH_LOAD_IND,
1756 ies := {
1757 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(0)}),
1758 tr_RSL_IE(RSL_IE_Body:{paging_load := buffer_space})
1759 }
1760 }
1761
Harald Welte7ae93142017-12-07 17:56:15 +01001762
Harald Welte643e2a62017-11-27 15:03:18 +01001763 /* 8.5.3 BTS -> BSC */
Vadim Yanitskiyab448a52019-05-31 20:24:03 +07001764 template (value) RSL_Message ts_RSL_CHAN_RQD(OCT1 ra, GsmFrameNumber fn,
1765 template (value) RslChannelNr chan_nr := ts_RslChanNr_RACH(0),
1766 uint8_t acc_del := 0) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001767 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1768 msg_type := RSL_MT_CHAN_RQD,
1769 ies := {
Vadim Yanitskiyab448a52019-05-31 20:24:03 +07001770 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1771 /* TODO: we may need to have optional RSL_IE_LINK_IDENT IE here */
Harald Welte735dd072017-12-12 14:55:17 +01001772 t_RSL_IE(RSL_IE_REQ_REFERENCE, RSL_IE_Body:{req_ref := ts_RSL_IE_ReqRef(ra, fn)}),
1773 t_RSL_IE(RSL_IE_ACCESS_DELAY, RSL_IE_Body:{access_delay := acc_del})
Harald Welte643e2a62017-11-27 15:03:18 +01001774 }
1775 }
Harald Welte9abd1282018-02-19 19:18:17 +01001776 template RSL_Message tr_RSL_CHAN_RQD(template OCT1 ra, template GsmFrameNumber fn := ?,
Vadim Yanitskiyab448a52019-05-31 20:24:03 +07001777 template RslChannelNr chan_nr := ts_RslChanNr_RACH(0),
1778 template uint8_t acc_del := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001779 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001780 msg_type := RSL_MT_CHAN_RQD,
1781 ies := {
Vadim Yanitskiyab448a52019-05-31 20:24:03 +07001782 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1783 /* TODO: we may need to have optional RSL_IE_LINK_IDENT IE here */
Harald Welte9abd1282018-02-19 19:18:17 +01001784 tr_RSL_IE(RSL_IE_Body:{req_ref := tr_RSL_IE_ReqRef(ra, fn)}),
1785 tr_RSL_IE(RSL_IE_Body:{access_delay := acc_del})
1786 }
1787 }
Harald Welte643e2a62017-11-27 15:03:18 +01001788
1789 /* 8.5.4 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001790 template (value) RSL_Message ts_DELETE_IND(template (value) RslChannelNr chan_nr,
1791 octetstring imm_ass) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001792 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1793 msg_type := RSL_MT_DELETE_IND,
1794 ies := {
Harald Welte735dd072017-12-12 14:55:17 +01001795 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1796 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 +01001797 }
1798 }
Harald Weltee8d750e2018-06-10 21:41:35 +02001799 template RSL_Message tr_RSL_DELETE_IND(template octetstring imm_ass := ?, template uint3_t tn) := {
1800 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1801 msg_type := RSL_MT_DELETE_IND,
1802 ies := {
1803 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(tn)}),
1804 tr_RSL_IE(RSL_IE_Body:{full_imm_ass_info := tr_RSL_LV(imm_ass)}),
1805 *
1806 }
1807 }
Harald Welte643e2a62017-11-27 15:03:18 +01001808
Harald Weltec2877752017-12-07 17:54:35 +01001809 /* 8.5.5 BSC -> BTS */
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +07001810 template RSL_Message tr_RSL_PAGING_CMD(template MobileIdentityV mi, template uint3_t tn := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001811 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Weltec2877752017-12-07 17:54:35 +01001812 msg_type := RSL_MT_PAGING_CMD,
1813 ies := {
1814 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(tn)}),
1815 tr_RSL_IE(RSL_IE_Body:{paging_group := ?}),
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +07001816 tr_RSL_IE(RSL_IE_Body:{ms_identity := tr_MI_LV(mi)}),
Harald Weltec2877752017-12-07 17:54:35 +01001817 * /* opt: channel needed, eMLPP prio */
1818 }
1819 }
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +07001820 template (value) RSL_Message ts_RSL_PAGING_CMD(MobileIdentityV mi, uint8_t pg, 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_PAGING_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_PAGING_GROUP, RSL_IE_Body:{paging_group := pg}),
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +07001826 t_RSL_IE(RSL_IE_MS_IDENTITY, RSL_IE_Body:{ms_identity := ts_MI_LV(mi)})
Harald Welte9abd1282018-02-19 19:18:17 +01001827 }
1828 }
Harald Weltec2877752017-12-07 17:54:35 +01001829
1830 /* 8.5.6 BSC -> BTS */
1831 template RSL_Message tr_RSL_IMM_ASSIGN(template uint3_t tn := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001832 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Weltec2877752017-12-07 17:54:35 +01001833 msg_type := RSL_MT_IMMEDIATE_ASSIGN_CMD,
1834 ies := {
1835 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(tn)}),
1836 tr_RSL_IE(RSL_IE_Body:{full_imm_ass_info := ?})
1837 }
1838 }
Harald Welteefa7d912018-04-18 23:22:15 +02001839 template (value) RSL_Message ts_RSL_IMM_ASSIGN(octetstring f_ass_inf, uint3_t tn := 0) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001840 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1841 msg_type := RSL_MT_IMMEDIATE_ASSIGN_CMD,
1842 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001843 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_PCH_AGCH(tn)}),
Harald Welte9abd1282018-02-19 19:18:17 +01001844 t_RSL_IE(RSL_IE_FULL_IMM_ASS_INFO, RSL_IE_Body:{full_imm_ass_info := ts_RSL_LV(f_ass_inf)})
1845 }
1846 }
Harald Weltec2877752017-12-07 17:54:35 +01001847
Harald Weltecc373202018-09-10 10:28:21 +02001848 /* 8.5.8 BTS <- BSC SMS BROADCAST COMMAND */
1849 template RSL_Message tr_RSL_SMSCB_CMD(template RSL_IE_CbCommandType cb_cmd := ?,
1850 template octetstring msg := ?,
1851 template RslChannelNr chan_nr := ?) := {
1852 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1853 msg_type := RSL_MT_SMS_BC_CMD,
1854 ies := {
1855 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1856 tr_RSL_IE(RSL_IE_Body:{cb_cmd_type := cb_cmd}),
1857 tr_RSL_IE(RSL_IE_Body:{smscb_message := tr_RSL_LV(msg)}),
1858 *
1859 }
1860 }
1861 template (value) RSL_Message ts_RSL_SMSCB_CMD(template (value) RSL_IE_CbCommandType cb_cmd,
1862 template (value) octetstring msg,
1863 template (value) RslChannelNr chan_nr :=
1864 ts_RslChanNr_SDCCH4(0, 2)) := {
1865 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1866 msg_type := RSL_MT_SMS_BC_CMD,
1867 ies := {
1868 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1869 t_RSL_IE(RSL_IE_CB_CMD_TYPE, RSL_IE_Body:{cb_cmd_type := cb_cmd}),
1870 t_RSL_IE(RSL_IE_SMSCB_MSG, RSL_IE_Body:{smscb_message := ts_RSL_LV(msg)})
1871 /* optional channel type for extended CBCH */
1872 }
1873 }
1874
Harald Welte4a129f82019-05-21 16:35:22 +02001875 /* 8.5.9 BTS -> BSC CBCH LOAD INDICATION */
1876 template RSL_Message tr_RSL_CBCH_LOAD_IND_BASIC(template boolean overflow := ?,
1877 template uint4_t slot_count := ?,
1878 template RslChannelNr chan_nr := ?) := {
1879 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1880 msg_type := RSL_MT_CBCH_LOAD_IND,
1881 ies := {
1882 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1883 tr_RSL_IE(RSL_IE_Body:{cbch_load_info := tr_CbchLoadInfo(overflow, slot_count)})
1884 }
1885 }
1886 template (value) RSL_Message ts_RSL_CBCH_LOAD_IND_BASIC(boolean overflow, uint4_t slot_count,
1887 template (value) RslChannelNr chan_nr :=
1888 ts_RslChanNr_SDCCH4(0, 2)) := {
1889 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1890 msg_type := RSL_MT_CBCH_LOAD_IND,
1891 ies := {
1892 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1893 t_RSL_IE(RSL_IE_CBCH_LOAD_INFO, RSL_IE_Body:{cbch_load_info := ts_CbchLoadInfo(overflow, slot_count)})
1894 }
1895 }
1896 template RSL_Message tr_RSL_CBCH_LOAD_IND_EXTD(template boolean overflow := ?,
1897 template uint4_t slot_count := ?,
1898 template RslChannelNr chan_nr := ?) := {
1899 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1900 msg_type := RSL_MT_CBCH_LOAD_IND,
1901 ies := {
1902 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1903 tr_RSL_IE(RSL_IE_Body:{cbch_load_info := tr_CbchLoadInfo(overflow, slot_count)}),
1904 tr_RSL_IE(RSL_IE_Body:{smscb_chan_ind := 1})
1905 }
1906 }
1907 template (value) RSL_Message ts_RSL_CBCH_LOAD_IND_EXTD(boolean overflow, uint4_t slot_count,
1908 template (value) RslChannelNr chan_nr :=
1909 ts_RslChanNr_SDCCH4(0, 2)) := {
1910 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1911 msg_type := RSL_MT_CBCH_LOAD_IND,
1912 ies := {
1913 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1914 t_RSL_IE(RSL_IE_CBCH_LOAD_INFO, RSL_IE_Body:{cbch_load_info := ts_CbchLoadInfo(overflow, slot_count)}),
1915 t_RSL_IE(RSL_IE_SMSCB_CHAN_INDICATOR, RSL_IE_Body:{smscb_chan_ind := 1})
1916 }
1917 }
1918
1919
Vadim Yanitskiy9f699532021-06-03 17:29:22 +02001920 /* 8.6.1 BTS -> BSC */
1921 template (value) RSL_Message
1922 ts_RSL_RF_RES_IND(template (value) RSL_ResourceInfo info) := {
1923 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
1924 msg_type := RSL_MT_RF_RES_IND,
1925 ies := {
1926 t_RSL_IE(RSL_IE_RESOURCE_INFO, RSL_IE_Body:{
1927 resource_info := {
1928 len := 0, /* overwritten */
1929 info := info
1930 }
1931 })
1932 }
1933 }
1934 template RSL_Message
1935 tr_RSL_RF_RES_IND(template (present) RSL_ResourceInfo info := ?) := {
1936 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
1937 msg_type := RSL_MT_RF_RES_IND,
1938 ies := {
1939 tr_RSL_IE(RSL_IE_Body:{
1940 resource_info := {
1941 len := ?,
1942 info := info
1943 }
1944 })
1945 }
1946 }
1947
1948
Harald Welte68e495b2018-02-25 00:05:57 +01001949 /* 8.6.2 BTS <- BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001950 template (value) RSL_Message ts_RSL_SACCH_FILL(RSL_IE_SysinfoType si_type, octetstring l3_info) := {
Harald Welte68e495b2018-02-25 00:05:57 +01001951 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
1952 msg_type := RSL_MT_SACCH_FILL,
1953 ies := {
1954 t_RSL_IE(RSL_IE_SYSINFO_TYPE, RSL_IE_Body:{sysinfo_type := si_type}),
1955 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
1956 }
1957 }
Harald Welte09538f82019-08-01 09:50:25 +02001958 template RSL_Message tr_RSL_NO_SACCH_FILL(template RSL_IE_SysinfoType si_type := ?) := {
1959 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
1960 msg_type := RSL_MT_SACCH_FILL,
1961 ies := {
1962 tr_RSL_IE(RSL_IE_Body:{sysinfo_type := si_type})
1963 }
1964 }
1965 template RSL_Message tr_RSL_SACCH_FILL(template RSL_IE_SysinfoType si_type := ?,
1966 template octetstring l3_info := ?) := {
1967 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
1968 msg_type := RSL_MT_SACCH_FILL,
1969 ies := {
1970 tr_RSL_IE(RSL_IE_Body:{sysinfo_type := si_type}),
1971 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)}),
1972 *
1973 }
1974 }
1975
Harald Welte68e495b2018-02-25 00:05:57 +01001976
Harald Welte643e2a62017-11-27 15:03:18 +01001977 /* 8.6.4 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001978 template (value) RSL_Message ts_RSL_ERROR_REPORT(RSL_Cause cause) := {
Harald Welte01d982c2018-02-25 01:31:40 +01001979 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
1980 msg_type := RSL_MT_ERROR_REPORT,
Harald Welte643e2a62017-11-27 15:03:18 +01001981 ies := {
Harald Welte735dd072017-12-12 14:55:17 +01001982 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
Harald Welte643e2a62017-11-27 15:03:18 +01001983 }
1984 }
Harald Welte01d982c2018-02-25 01:31:40 +01001985 template RSL_Message tr_RSL_ERROR_REPORT(template RSL_Cause cause := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001986 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
Harald Welte01d982c2018-02-25 01:31:40 +01001987 msg_type := RSL_MT_ERROR_REPORT,
1988 ies := {
1989 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)}),
1990 *
1991 }
1992 }
1993
Harald Welte643e2a62017-11-27 15:03:18 +01001994
Harald Welte9958a4d2017-12-14 21:21:33 +01001995
1996 /* Abis/IP specific messages */
1997
1998 template RSL_Message tr_RSL_IPA_CRCX(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001999 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002000 msg_type := RSL_MT_IPAC_CRCX,
2001 ies := {
2002 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2003 *
2004 }
2005 }
Harald Welteefa7d912018-04-18 23:22:15 +02002006 template (value) RSL_Message ts_RSL_IPA_CRCX(template (value) RslChannelNr chan_nr) := {
Harald Welte9abd1282018-02-19 19:18:17 +01002007 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2008 msg_type := RSL_MT_IPAC_CRCX,
2009 ies := {
2010 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
2011 }
2012 }
2013
Harald Welte9958a4d2017-12-14 21:21:33 +01002014
Harald Welteefa7d912018-04-18 23:22:15 +02002015 template (value) RSL_Message ts_RSL_IPA_CRCX_ACK(template (value) RslChannelNr chan_nr,
2016 uint16_t ipa_conn_id, uint32_t local_ip,
2017 uint16_t local_port, uint7_t rtp_pt2) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002018 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2019 msg_type := RSL_MT_IPAC_CRCX_ACK,
2020 ies := {
2021 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2022 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2023 t_RSL_IE(RSL_IE_IPAC_LOCAL_IP, RSL_IE_Body:{ipa_local_ip := local_ip}),
2024 t_RSL_IE(RSL_IE_IPAC_LOCAL_PORT, RSL_IE_Body:{ipa_local_port := local_port}),
2025 t_RSL_IE(RSL_IE_IPAC_RTP_PAYLOAD2, RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
2026 }
2027 }
Harald Welte9abd1282018-02-19 19:18:17 +01002028 template RSL_Message tr_RSL_IPA_CRCX_ACK(template RslChannelNr chan_nr,
2029 template uint16_t ipa_conn_id,
2030 template uint32_t local_ip,
Harald Welte8bd0f822018-02-25 12:43:28 +01002031 template uint16_t local_port) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002032 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9abd1282018-02-19 19:18:17 +01002033 msg_type := RSL_MT_IPAC_CRCX_ACK,
2034 ies := {
2035 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2036 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2037 tr_RSL_IE(RSL_IE_Body:{ipa_local_ip := local_ip}),
Harald Welte8bd0f822018-02-25 12:43:28 +01002038 tr_RSL_IE(RSL_IE_Body:{ipa_local_port := local_port})
2039 /* Optional: RTP Payload Type 2 IE */
Harald Welte9abd1282018-02-19 19:18:17 +01002040 }
2041 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002042
Harald Welteefa7d912018-04-18 23:22:15 +02002043 template (value) RSL_Message ts_RSL_IPA_CRCX_NACK(template (value) RslChannelNr chan_nr,
2044 RSL_Cause cause) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002045 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2046 msg_type := RSL_MT_IPAC_CRCX_NACK,
2047 ies := {
2048 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2049 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2050 }
2051 }
Harald Welte9abd1282018-02-19 19:18:17 +01002052 template RSL_Message tr_RSL_IPA_CRCX_NACK(template RslChannelNr chan_nr,
2053 template RSL_Cause cause := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002054 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9abd1282018-02-19 19:18:17 +01002055 msg_type := RSL_MT_IPAC_CRCX_NACK,
2056 ies := {
2057 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2058 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
2059 }
2060 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002061
Harald Welteefa7d912018-04-18 23:22:15 +02002062 template (value) RSL_Message ts_RSL_IPA_MDCX(template (value) RslChannelNr chan_nr,
2063 uint16_t ipa_conn_id,
2064 uint32_t remote_ip, uint16_t remote_port,
2065 uint7_t rtp_pt2) := {
Harald Welte30527452018-02-25 12:46:25 +01002066 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2067 msg_type := RSL_MT_IPAC_MDCX,
2068 ies := {
2069 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2070 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2071 t_RSL_IE(RSL_IE_IPAC_REMOTE_IP, RSL_IE_Body:{ipa_remote_ip := remote_ip}),
2072 t_RSL_IE(RSL_IE_IPAC_REMOTE_PORT, RSL_IE_Body:{ipa_remote_port := remote_port}),
2073 /* optional: RTP Payload Type */
2074 t_RSL_IE(RSL_IE_IPAC_RTP_PAYLOAD2, RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
2075 }
2076 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002077 template RSL_Message tr_RSL_IPA_MDCX(template RslChannelNr chan_nr,
2078 template uint16_t ipa_conn_id) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002079 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002080 msg_type := RSL_MT_IPAC_MDCX,
2081 ies := {
2082 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2083 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2084 *
2085 }
2086 }
2087
Harald Welteefa7d912018-04-18 23:22:15 +02002088 template (value) RSL_Message ts_RSL_IPA_MDCX_ACK(template (value) RslChannelNr chan_nr,
2089 uint16_t ipa_conn_id,
2090 uint32_t local_ip, uint16_t local_port,
2091 uint7_t rtp_pt2) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002092 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte71b5ec82017-12-16 23:01:10 +01002093 msg_type := RSL_MT_IPAC_MDCX_ACK,
Harald Welte9958a4d2017-12-14 21:21:33 +01002094 ies := {
2095 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2096 /* optional */
2097 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
Harald Welte6cb400a2018-02-25 12:45:25 +01002098 t_RSL_IE(RSL_IE_IPAC_LOCAL_IP, RSL_IE_Body:{ipa_local_ip := local_ip}),
2099 t_RSL_IE(RSL_IE_IPAC_LOCAL_PORT, RSL_IE_Body:{ipa_local_port := local_port}),
Harald Welte9958a4d2017-12-14 21:21:33 +01002100 /* optional: RTP Payload Type */
2101 t_RSL_IE(RSL_IE_IPAC_RTP_PAYLOAD2, RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
2102 }
2103 }
Harald Welte30527452018-02-25 12:46:25 +01002104 template RSL_Message tr_RSL_IPA_MDCX_ACK(template RslChannelNr chan_nr,
2105 template uint16_t ipa_conn_id,
2106 template uint32_t local_ip,
2107 template uint16_t local_port,
2108 template uint7_t rtp_pt2) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002109 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte30527452018-02-25 12:46:25 +01002110 msg_type := RSL_MT_IPAC_MDCX_ACK,
2111 ies := {
2112 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2113 /* optional */
2114 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2115 tr_RSL_IE(RSL_IE_Body:{ipa_local_ip := local_ip}),
2116 tr_RSL_IE(RSL_IE_Body:{ipa_local_port := local_port}),
2117 /* optional: RTP Payload Type */
2118 tr_RSL_IE(RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
2119 }
2120 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002121
Harald Welteefa7d912018-04-18 23:22:15 +02002122 template (value) RSL_Message ts_RSL_IPA_MDCX_NACK(template (value) RslChannelNr chan_nr,
2123 RSL_Cause cause,
2124 template (value) uint16_t ipa_conn_id) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002125 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2126 msg_type := RSL_MT_IPAC_MDCX_NACK,
2127 ies := {
2128 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2129 /* optional connection ID */
2130 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2131 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2132 }
2133 }
Harald Welte30527452018-02-25 12:46:25 +01002134 template RSL_Message tr_RSL_IPA_MDCX_NACK(template RslChannelNr chan_nr,
2135 template RSL_Cause cause,
2136 template uint16_t ipa_conn_id) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002137 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte30527452018-02-25 12:46:25 +01002138 msg_type := RSL_MT_IPAC_MDCX_NACK,
2139 ies := {
2140 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2141 /* optional connection ID */
2142 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2143 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
2144 }
2145 }
2146
Harald Welte9958a4d2017-12-14 21:21:33 +01002147
Harald Welteefa7d912018-04-18 23:22:15 +02002148 template (value) RSL_Message ts_RSL_IPA_DLCX_IND(template (value) RslChannelNr chan_nr,
2149 uint16_t ipa_conn_id,
2150 template (value) RSL_IE_IPA_ConnectionStats stats,
2151 RSL_Cause cause) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002152 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2153 msg_type := RSL_MT_IPAC_DLCX_IND,
2154 ies := {
2155 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2156 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2157 t_RSL_IE(RSL_IE_IPAC_CONN_STAT, RSL_IE_Body:{ipa_stats := stats}),
2158 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2159 }
2160 }
2161
Harald Welteefa7d912018-04-18 23:22:15 +02002162 template (value) RSL_Message ts_RSL_IPA_DLCX(template (value) RslChannelNr chan_nr,
2163 uint16_t ipa_conn_id) := {
Harald Weltea871a382018-02-25 02:03:14 +01002164 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2165 msg_type := RSL_MT_IPAC_DLCX,
2166 ies := {
Harald Welte2a7e7162018-02-25 12:46:48 +01002167 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2168 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id})
Harald Weltea871a382018-02-25 02:03:14 +01002169 }
2170 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002171 template RSL_Message tr_RSL_IPA_DLCX(template RslChannelNr chan_nr,
2172 template uint16_t ipa_conn_id := omit) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002173 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002174 msg_type := RSL_MT_IPAC_DLCX,
2175 ies := {
2176 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2177 /* FIXME: optional conn_id */
2178 *
2179 }
2180 }
2181
Harald Welteefa7d912018-04-18 23:22:15 +02002182 template (value) RSL_Message ts_RSL_IPA_DLCX_ACK(template (value) RslChannelNr chan_nr,
2183 uint16_t ipa_conn_id,
2184 RSL_IE_IPA_ConnectionStats stats) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002185 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2186 msg_type := RSL_MT_IPAC_DLCX_ACK,
2187 ies := {
2188 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2189 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2190 t_RSL_IE(RSL_IE_IPAC_CONN_STAT, RSL_IE_Body:{ipa_stats := stats})
2191 }
2192 }
Harald Weltea871a382018-02-25 02:03:14 +01002193 template RSL_Message tr_RSL_IPA_DLCX_ACK(template RslChannelNr chan_nr,
2194 template uint16_t ipa_conn_id,
2195 template RSL_IE_IPA_ConnectionStats stats) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002196 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Weltea871a382018-02-25 02:03:14 +01002197 msg_type := RSL_MT_IPAC_DLCX_ACK,
2198 ies := {
2199 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2200 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2201 tr_RSL_IE(RSL_IE_Body:{ipa_stats := stats})
2202 }
2203 }
2204
2205
Harald Welte9958a4d2017-12-14 21:21:33 +01002206
Harald Welteefa7d912018-04-18 23:22:15 +02002207 template (value) RSL_Message ts_RSL_IPA_DLCX_NACK(template (value) RslChannelNr chan_nr,
2208 RSL_Cause cause, uint16_t ipa_conn_id) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002209 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2210 msg_type := RSL_MT_IPAC_DLCX_NACK,
2211 ies := {
2212 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2213 /* optional connection ID */
2214 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2215 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2216 }
2217 }
Harald Weltea871a382018-02-25 02:03:14 +01002218 template RSL_Message tr_RSL_IPA_DLCX_NACK(template RslChannelNr chan_nr,
2219 template RSL_Cause cause) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002220 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Weltea871a382018-02-25 02:03:14 +01002221 msg_type := RSL_MT_IPAC_DLCX_NACK,
2222 ies := {
2223 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2224 /* optional connection ID */
2225 *,
2226 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
2227 }
2228 }
2229
Harald Welte9958a4d2017-12-14 21:21:33 +01002230
Harald Welteefa7d912018-04-18 23:22:15 +02002231 template (value) RSL_Message ts_RSL_IPA_PDCH_ACT(RslChannelNr chan_nr) := {
Harald Welteee19c732018-04-05 09:08:26 +02002232 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2233 msg_type := RSL_MT_IPAC_PDCH_ACT,
2234 ies := {
2235 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
2236 }
2237 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002238 template RSL_Message tr_RSL_IPA_PDCH_ACT(template RslChannelNr chan_nr) := {
Harald Welteee19c732018-04-05 09:08:26 +02002239 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002240 msg_type := RSL_MT_IPAC_PDCH_ACT,
2241 ies := {
2242 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
2243 }
2244 }
2245
Harald Welteee19c732018-04-05 09:08:26 +02002246
Harald Welte94e0c342018-04-07 11:33:23 +02002247 template RSL_Message ts_RSL_IPA_PDCH_ACT_ACK(RslChannelNr chan_nr,
2248 template (value) RSL_IE_FrameNumber fn) := {
Harald Welteee19c732018-04-05 09:08:26 +02002249 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002250 msg_type := RSL_MT_IPAC_PDCH_ACT_ACK,
2251 ies := {
2252 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2253 t_RSL_IE(RSL_IE_FRAME_NUMBER, RSL_IE_Body:{frame_nr := fn})
2254 }
2255 }
Harald Welteee19c732018-04-05 09:08:26 +02002256 template RSL_Message tr_RSL_IPA_PDCH_ACT_ACK(template RslChannelNr chan_nr,
2257 template RSL_IE_FrameNumber fn) := {
2258 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2259 msg_type := RSL_MT_IPAC_PDCH_ACT_ACK,
2260 ies := {
2261 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2262 tr_RSL_IE(RSL_IE_Body:{frame_nr := fn})
2263 }
2264 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002265
2266 template RSL_Message ts_RSL_IPA_PDCH_ACT_NACK(RslChannelNr chan_nr, RSL_Cause cause) := {
Harald Welteee19c732018-04-05 09:08:26 +02002267 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002268 msg_type := RSL_MT_IPAC_PDCH_ACT_NACK,
2269 ies := {
2270 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2271 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2272 }
2273 }
Harald Welteee19c732018-04-05 09:08:26 +02002274 template RSL_Message tr_RSL_IPA_PDCH_ACT_NACK(template RslChannelNr chan_nr,
2275 template RSL_Cause cause) := {
2276 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2277 msg_type := RSL_MT_IPAC_PDCH_ACT_NACK,
2278 ies := {
2279 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2280 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
2281 }
2282 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002283
Harald Welteee19c732018-04-05 09:08:26 +02002284 template RSL_Message ts_RSL_IPA_PDCH_DEACT(RslChannelNr chan_nr) := {
2285 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2286 msg_type := RSL_MT_IPAC_PDCH_DEACT,
2287 ies := {
2288 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
2289 }
2290 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002291 template RSL_Message tr_RSL_IPA_PDCH_DEACT(template RslChannelNr chan_nr) := {
Harald Welteee19c732018-04-05 09:08:26 +02002292 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002293 msg_type := RSL_MT_IPAC_PDCH_DEACT,
2294 ies := {
2295 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
2296 }
2297 }
2298
2299 template RSL_Message ts_RSL_IPA_PDCH_DEACT_ACK(RslChannelNr chan_nr) := {
Harald Welteee19c732018-04-05 09:08:26 +02002300 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002301 msg_type := RSL_MT_IPAC_PDCH_DEACT_ACK,
2302 ies := {
2303 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
2304 }
2305 }
Harald Welteee19c732018-04-05 09:08:26 +02002306 template RSL_Message tr_RSL_IPA_PDCH_DEACT_ACK(template RslChannelNr chan_nr) := {
2307 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2308 msg_type := RSL_MT_IPAC_PDCH_DEACT_ACK,
2309 ies := {
2310 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
2311 }
2312 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002313
2314 template RSL_Message ts_RSL_IPA_PDCH_DEACT_NACK(RslChannelNr chan_nr, RSL_Cause cause) := {
Harald Welteee19c732018-04-05 09:08:26 +02002315 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002316 msg_type := RSL_MT_IPAC_PDCH_DEACT_NACK,
2317 ies := {
2318 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2319 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2320 }
2321 }
Harald Welteee19c732018-04-05 09:08:26 +02002322 template RSL_Message tr_RSL_IPA_PDCH_DEACT_NACK(template RslChannelNr chan_nr,
2323 template RSL_Cause cause) := {
2324 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2325 msg_type := RSL_MT_IPAC_PDCH_DEACT_NACK,
2326 ies := {
2327 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2328 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
2329 }
2330 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002331
Harald Welte908ce542019-09-04 23:05:40 +02002332 template (value) RSL_Message ts_RSL_OSMO_ETWS_CMD(template (value) octetstring msg,
2333 template (value) RslChannelNr chan_nr := ts_RslChanNr_PCH_AGCH(0)) := {
2334 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2335 msg_type := RSL_MT_OSMO_ETWS_CMD,
2336 ies := {
2337 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2338 t_RSL_IE(RSL_IE_SMSCB_MSG, RSL_IE_Body:{smscb_message := ts_RSL_LV(msg)})
2339 }
2340 }
2341 template RSL_Message tr_RSL_OSMO_ETWS_CMD(template RslChannelNr chan_nr := ?,
2342 template octetstring msg := ?) := {
2343 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2344 msg_type := RSL_MT_OSMO_ETWS_CMD,
2345 ies := {
2346 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2347 tr_RSL_IE(RSL_IE_Body:{smscb_message := tr_RSL_LV(msg)})
2348 }
2349 }
2350
2351
Harald Welte9958a4d2017-12-14 21:21:33 +01002352
Harald Welte6a8199d2018-01-29 21:58:53 +01002353 function f_rsl_find_ie(RSL_Message msg, RSL_IE_Type iei, out RSL_IE_Body ret) return boolean {
2354 for (var integer i := 0; i < sizeof(msg.ies); i := i+1) {
2355 if (msg.ies[i].iei == iei) {
2356 ret := msg.ies[i].body;
2357 return true;
2358 }
2359 }
2360 return false;
2361 }
2362
2363
Harald Welte9958a4d2017-12-14 21:21:33 +01002364
Harald Welte643e2a62017-11-27 15:03:18 +01002365} with { encode "RAW" ; variant "FIELDORDER(msb)" }