blob: 16ce5066935892f29cbb095da4576e8c2e0c6a4d [file] [log] [blame]
Harald Welte643e2a62017-11-27 15:03:18 +01001module RSL_Types {
2
Vadim Yanitskiyc06688e2020-05-06 15:22:45 +07003/* RSL types defining abstract TTCN-3 data types for the A-bis RSL protocol.
Harald Welte35bb7162018-01-03 21:07:52 +01004 *
5 * RSL is a 3GPP standard protocol used between BTS and BSC in a GSM network.
6 *
7 * (C) 2017 by Harald Welte <laforge@gnumonks.org>
8 * All rights reserved.
9 *
10 * Released under the terms of GNU General Public License, Version 2 or
11 * (at your option) any later version.
Harald Welte34b5a952019-05-27 11:54:11 +020012 *
13 * SPDX-License-Identifier: GPL-2.0-or-later
Harald Welte35bb7162018-01-03 21:07:52 +010014 */
15
Harald Welte643e2a62017-11-27 15:03:18 +010016 import from General_Types all;
17 import from Osmocom_Types all;
Vadim Yanitskiye02dbcc2020-08-25 04:20:51 +070018 import from GSM_RR_Types all;
Harald Welte643e2a62017-11-27 15:03:18 +010019 import from GSM_Types all;
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +070020 import from MobileL3_CommonIE_Types all;
21 import from L3_Templates all;
Harald Welte643e2a62017-11-27 15:03:18 +010022
23 /* Section 9.1 */
24 type enumerated RSL_MessageGroup {
25 RSL_MDISC_RESERVED ('0000000'B),
26 RSL_MDISC_RLL ('0000001'B),
27 RSL_MDISC_DCHAN ('0000100'B),
28 RSL_MDISC_CCHAN ('0000110'B),
29 RSL_MDISC_TRX_MGMT ('0001000'B),
30 RSL_MDISC_LCS ('0010000'B),
31 RSL_MDISC_IPACCESS ('0111111'B)
32 } with { variant "FIELDLENGTH(7)" };
33
34 /* Section 9.1 */
35 type record RSL_MessageDiscriminator {
36 RSL_MessageGroup msg_group,
37 boolean transparent
38 } with { variant "FIELDORDER(msb)" };
39
Harald Welteefa7d912018-04-18 23:22:15 +020040 template (value) RSL_MessageDiscriminator ts_RSL_MsgDisc(RSL_MessageGroup mg, boolean t := true) := {
Harald Welte643e2a62017-11-27 15:03:18 +010041 msg_group := mg,
42 transparent := t
43 }
Harald Welteefa7d912018-04-18 23:22:15 +020044 template RSL_MessageDiscriminator tr_RSL_MsgDisc(template RSL_MessageGroup mg, boolean t := true) := {
45 msg_group := mg,
46 transparent := t
47 }
48
Harald Welte643e2a62017-11-27 15:03:18 +010049
50 /* Section 9.2 */
51 type enumerated RSL_MessageType {
52 /* Radio Link Layer Management */
53 RSL_MT_DATA_REQ ('00000001'B),
54 RSL_MT_DATA_IND ('00000010'B),
55 RSL_MT_ERROR_IND ('00000011'B),
56 RSL_MT_EST_REQ ('00000100'B),
57 RSL_MT_EST_CONF ('00000101'B),
58 RSL_MT_EST_IND ('00000110'B),
59 RSL_MT_REL_REQ ('00000111'B),
60 RSL_MT_REL_CONF ('00001000'B),
61 RSL_MT_REL_IND ('00001001'B),
62 RSL_MT_UNIT_DATA_REQ ('00001010'B),
63 RSL_MT_UNIT_DATA_IND ('00001011'B),
64
65 /* non-standard below */
66 RSL_MT_SUSP_REQ ('00001100'B),
67 RSL_MT_SUSP_CONF ('00001101'B),
68 RSL_MT_RES_REQ ('00001110'B),
69 RSL_MT_RECON_REQ ('00001111'B),
70
71 /* Common Channel Management / TRX Management */
72 RSL_MT_BCCH_INFO ('00010001'B),
Harald Welte319be822017-12-07 17:50:26 +010073 RSL_MT_CCCH_LOAD_IND ('00010010'B),
74 RSL_MT_CHAN_RQD ('00010011'B),
75 RSL_MT_DELETE_IND ('00010100'B),
76 RSL_MT_PAGING_CMD ('00010101'B),
77 RSL_MT_IMMEDIATE_ASSIGN_CMD ('00010110'B),
78 RSL_MT_SMS_BC_REQ ('00010111'B),
79 RSL_MT_CHAN_CONF ('00011000'B), /* non-standard element */
Harald Welte643e2a62017-11-27 15:03:18 +010080 /* empty */
81 RSL_MT_RF_RES_IND ('00011001'B),
Harald Welte319be822017-12-07 17:50:26 +010082 RSL_MT_SACCH_FILL ('00011010'B),
83 RSL_MT_OVERLOAD ('00011011'B),
84 RSL_MT_ERROR_REPORT ('00011100'B),
85 RSL_MT_SMS_BC_CMD ('00011101'B),
86 RSL_MT_CBCH_LOAD_IND ('00011110'B),
87 RSL_MT_NOT_CMD ('00011111'B),
Harald Welte643e2a62017-11-27 15:03:18 +010088
89 /* Dedicate Channel Management */
90 RSL_MT_CHAN_ACTIV ('00100001'B),
Harald Welte319be822017-12-07 17:50:26 +010091 RSL_MT_CHAN_ACTIV_ACK ('00100010'B),
92 RSL_MT_CHAN_ACTIV_NACK ('00100011'B),
93 RSL_MT_CONN_FAIL ('00100100'B),
94 RSL_MT_DEACTIVATE_SACCH ('00100101'B),
95 RSL_MT_ENCR_CMD ('00100110'B),
96 RSL_MT_HANDO_DET ('00100111'B),
97 RSL_MT_MEAS_RES ('00101000'B),
98 RSL_MT_MODE_MODIFY_REQ ('00101001'B),
99 RSL_MT_MODE_MODIFY_ACK ('00101010'B),
100 RSL_MT_MODE_MODIFY_NACK ('00101011'B),
101 RSL_MT_PHY_CONTEXT_REQ ('00101100'B),
102 RSL_MT_PHY_CONTEXT_CONF ('00101101'B),
103 RSL_MT_RF_CHAN_REL ('00101110'B),
104 RSL_MT_MS_POWER_CONTROL ('00101111'B),
105 RSL_MT_BS_POWER_CONTROL ('00110000'B), /* 0x30 */
106 RSL_MT_PREPROC_CONFIG ('00110001'B),
107 RSL_MT_PREPROC_MEAS_RES ('00110010'B),
108 RSL_MT_RF_CHAN_REL_ACK ('00110011'B),
109 RSL_MT_SACCH_INFO_MODIFY('00110100'B),
110 RSL_MT_TALKER_DET ('00110101'B),
111 RSL_MT_LISTENER_DET ('00110110'B),
112 RSL_MT_REMOTE_CODEC_CONF_REP ('00110111'B),
113 RSL_MT_RTD_REP ('00111000'B),
114 RSL_MT_PRE_HANDO_NOTIF ('00111001'B),
115 RSL_MT_MR_CODEC_MOD_REQ ('00111010'B),
116 RSL_MT_MR_CODEC_MOD_ACK ('00111011'B),
117 RSL_MT_MR_CODEC_MOD_NACK ('00111100'B),
118 RSL_MT_MR_CODEC_MOD_PER ('00111101'B),
119 RSL_MT_TFO_REP ('00111110'B),
120 RSL_MT_TFO_MOD_REQ ('00111111'B), /* 0x3f */
Harald Welte643e2a62017-11-27 15:03:18 +0100121
122 RSL_MT_LOCATION_INFO ('01000001'B),
123
124 /* ip.access specific RSL message types */
125 RSL_MT_IPAC_DIR_RETR_ENQ ('01000000'B),
126
127 RSL_MT_IPAC_PDCH_ACT ('01001000'B),
Harald Welte319be822017-12-07 17:50:26 +0100128 RSL_MT_IPAC_PDCH_ACT_ACK ('01001001'B),
129 RSL_MT_IPAC_PDCH_ACT_NACK ('01001010'B),
Harald Welte643e2a62017-11-27 15:03:18 +0100130 RSL_MT_IPAC_PDCH_DEACT ('01001011'B),
Harald Welte319be822017-12-07 17:50:26 +0100131 RSL_MT_IPAC_PDCH_DEACT_ACK ('01001100'B),
132 RSL_MT_IPAC_PDCH_DEACT_NACK ('01001101'B),
Harald Welte643e2a62017-11-27 15:03:18 +0100133
134 RSL_MT_IPAC_CONNECT_MUX ('01010000'B),
Harald Weltef3075002017-12-16 22:31:41 +0100135 RSL_MT_IPAC_CONNECT_MUX_ACK ('01010001'B),
136 RSL_MT_IPAC_CONNECT_MUX_NACK ('01010010'B),
137 RSL_MT_IPAC_BIND_MUX ('01010011'B),
138 RSL_MT_IPAC_BIND_MUX_ACK ('01010100'B),
139 RSL_MT_IPAC_BIND_MUX_NACK ('01010101'B),
140 RSL_MT_IPAC_DISC_MUX ('01010110'B),
141 RSL_MT_IPAC_DISC_MUX_ACK ('01010111'B),
142 RSL_MT_IPAC_DISC_MUX_NACK ('01011000'B),
Harald Welte643e2a62017-11-27 15:03:18 +0100143 RSL_MT_IPAC_MEAS_PREPROC_DFT ('01100000'B),
Harald Weltef3075002017-12-16 22:31:41 +0100144 RSL_MT_IPAC_HO_CAN_ENQ ('01100001'B),
145 RSL_MT_IPAC_HO_CAN_RES ('01100010'B),
146 RSL_MT_IPAC_CRCX ('01110000'B),
147 RSL_MT_IPAC_CRCX_ACK ('01110001'B),
148 RSL_MT_IPAC_CRCX_NACK ('01110010'B),
149 RSL_MT_IPAC_MDCX ('01110011'B),
150 RSL_MT_IPAC_MDCX_ACK ('01110100'B),
151 RSL_MT_IPAC_MDCX_NACK ('01110101'B),
152 RSL_MT_IPAC_DLCX_IND ('01110110'B),
153 RSL_MT_IPAC_DLCX ('01110111'B),
154 RSL_MT_IPAC_DLCX_ACK ('01111000'B),
Harald Welte908ce542019-09-04 23:05:40 +0200155 RSL_MT_IPAC_DLCX_NACK ('01111001'B),
156
157 RSL_MT_OSMO_ETWS_CMD ('01111111'B)
Harald Welte643e2a62017-11-27 15:03:18 +0100158 } with { variant "FIELDLENGTH(8)" };
159
160 /*! RSL Information Element Identifiers (Chapter 9.3) */
161 type enumerated RSL_IE_Type {
162 RSL_IE_CHAN_NR ('00000001'B),
Harald Welte319be822017-12-07 17:50:26 +0100163 RSL_IE_LINK_IDENT ('00000010'B),
164 RSL_IE_ACT_TYPE ('00000011'B),
165 RSL_IE_BS_POWER ('00000100'B),
166 RSL_IE_CHAN_IDENT ('00000101'B),
167 RSL_IE_CHAN_MODE ('00000110'B),
168 RSL_IE_ENCR_INFO ('00000111'B),
169 RSL_IE_FRAME_NUMBER ('00001000'B),
170 RSL_IE_HANDO_REF ('00001001'B),
171 RSL_IE_L1_INFO ('00001010'B),
172 RSL_IE_L3_INFO ('00001011'B),
173 RSL_IE_MS_IDENTITY ('00001100'B),
174 RSL_IE_MS_POWER ('00001101'B),
175 RSL_IE_PAGING_GROUP ('00001110'B),
176 RSL_IE_PAGING_LOAD ('00001111'B),
177 RSL_IE_PYHS_CONTEXT ('00010000'B),
178 RSL_IE_ACCESS_DELAY ('00010001'B),
179 RSL_IE_RACH_LOAD ('00010010'B),
180 RSL_IE_REQ_REFERENCE ('00010011'B),
181 RSL_IE_RELEASE_MODE ('00010100'B),
182 RSL_IE_RESOURCE_INFO ('00010101'B),
183 RSL_IE_RLM_CAUSE ('00010110'B),
184 RSL_IE_STARTNG_TIME ('00010111'B),
185 RSL_IE_TIMING_ADVANCE ('00011000'B),
186 RSL_IE_UPLINK_MEAS ('00011001'B),
187 RSL_IE_CAUSE ('00011010'B),
188 RSL_IE_MEAS_RES_NR ('00011011'B),
189 RSL_IE_MSG_ID ('00011100'B),
Harald Welte643e2a62017-11-27 15:03:18 +0100190 /* reserved */
191 RSL_IE_SYSINFO_TYPE ('00011110'B),
Harald Welte319be822017-12-07 17:50:26 +0100192 RSL_IE_MS_POWER_PARAM ('00011111'B),
193 RSL_IE_BS_POWER_PARAM ('00100000'B),
194 RSL_IE_PREPROC_PARAM ('00100001'B),
195 RSL_IE_PREPROC_MEAS ('00100010'B),
196 RSL_IE_IMM_ASS_INFO ('00100011'B),/* Phase 1 (3.6.0), later Full below */
197 RSL_IE_SMSCB_INFO ('00100100'B),
198 RSL_IE_MS_TIMING_OFFSET ('00100101'B),
199 RSL_IE_ERR_MSG ('00100110'B),
200 RSL_IE_FULL_BCCH_INFO ('00100111'B),
201 RSL_IE_CHAN_NEEDED ('00101000'B),
202 RSL_IE_CB_CMD_TYPE ('00101001'B),
203 RSL_IE_SMSCB_MSG ('00101010'B),
204 RSL_IE_FULL_IMM_ASS_INFO ('00101011'B),
205 RSL_IE_SACCH_INFO ('00101100'B),
206 RSL_IE_CBCH_LOAD_INFO ('00101101'B),
207 RSL_IE_SMSCB_CHAN_INDICATOR ('00101110'B),
208 RSL_IE_GROUP_CALL_REF ('00101111'B),
209 RSL_IE_CHAN_DESC ('00110000'B),
210 RSL_IE_NCH_DRX_INFO ('00110001'B),
211 RSL_IE_CMD_INDICATOR ('00110010'B),
212 RSL_IE_EMLPP_PRIO ('00110011'B),
213 RSL_IE_UIC ('00110100'B),
214 RSL_IE_MAIN_CHAN_REF ('00110101'B),
215 RSL_IE_MR_CONFIG ('00110110'B),
216 RSL_IE_MR_CONTROL ('00110111'B),
217 RSL_IE_SUP_CODEC_TYPES ('00111000'B),
218 RSL_IE_CODEC_CONFIG ('00111001'B),
219 RSL_IE_RTD ('00111010'B),
220 RSL_IE_TFO_STATUS ('00111011'B),
221 RSL_IE_LLP_APDU ('00111100'B),
Harald Welte643e2a62017-11-27 15:03:18 +0100222
Neels Hofmeyr2bef0dd2021-04-22 21:46:00 +0000223 RSL_IE_OSMO_TRAINING_SEQUENCE ('01100001'B),
224
Harald Welte643e2a62017-11-27 15:03:18 +0100225 /* ip.access */
226 RSL_IE_IPAC_SRTP_CONFIG ('11100000'B),
Harald Welte319be822017-12-07 17:50:26 +0100227 RSL_IE_IPAC_PROXY_UDP ('11100001'B),
228 RSL_IE_IPAC_BSCMPL_TOUT ('11100010'B),
Harald Welte643e2a62017-11-27 15:03:18 +0100229
230 RSL_IE_IPAC_REMOTE_IP ('11110000'B),
Harald Welte319be822017-12-07 17:50:26 +0100231 RSL_IE_IPAC_REMOTE_PORT ('11110001'B),
232 RSL_IE_IPAC_RTP_PAYLOAD ('11110010'B),
233 RSL_IE_IPAC_LOCAL_PORT ('11110011'B),
234 RSL_IE_IPAC_SPEECH_MODE ('11110100'B),
235 RSL_IE_IPAC_LOCAL_IP ('11110101'B),
236 RSL_IE_IPAC_CONN_STAT ('11110110'B),
237 RSL_IE_IPAC_HO_C_PARMS ('11110111'B),
238 RSL_IE_IPAC_CONN_ID ('11111000'B),
239 RSL_IE_IPAC_RTP_CSD_FMT ('11111001'B),
240 RSL_IE_IPAC_RTP_JIT_BUF ('11111010'B),
241 RSL_IE_IPAC_RTP_COMPR ('11111011'B),
242 RSL_IE_IPAC_RTP_PAYLOAD2 ('11111100'B),
243 RSL_IE_IPAC_RTP_MPLEX ('11111101'B),
244 RSL_IE_IPAC_RTP_MPLEX_ID ('11111110'B)
Harald Welte643e2a62017-11-27 15:03:18 +0100245 } with { variant "FIELDLENGTH(8)" };
246
247 type record RSL_LV {
248 uint8_t len,
249 octetstring payload
250 } with { variant (len) "LENGTHTO(payload)" }
251
Harald Welteefa7d912018-04-18 23:22:15 +0200252 template (value) RSL_LV ts_RSL_LV(template (value) octetstring pl) := {
Harald Welte643e2a62017-11-27 15:03:18 +0100253 len := 0,
254 payload := pl
255 }
256
Harald Welte51d74102017-12-10 23:05:02 +0100257 template RSL_LV tr_RSL_LV(template octetstring pl) := {
258 len := ?,
259 payload := pl
260 }
261
Harald Welte15bb5b52017-12-07 17:52:04 +0100262 type record RSL_L16V {
263 uint16_t len,
264 octetstring payload
265 } with { variant (len) "LENGTHTO(payload)" }
266
Harald Welteefa7d912018-04-18 23:22:15 +0200267 template (value) RSL_L16V ts_RSL_L16V(template (value) octetstring pl) := {
Harald Welte15bb5b52017-12-07 17:52:04 +0100268 len := 0,
269 payload := pl
270 }
271
Harald Welte7794d5b2017-12-16 23:00:20 +0100272 template RSL_L16V tr_RSL_L16V(template octetstring pl) := {
273 len := ?,
274 payload := pl
275 }
276
Harald Welte643e2a62017-11-27 15:03:18 +0100277 type record RSL_IE_V {
278 uint8_t val
279 }
280
281 /* 9.3.3 */
282 type record RSL_IE_ActivationType {
283 boolean reactivation,
284 uint4_t reserved,
Harald Welte921f9e02019-05-19 22:27:11 +0200285 RSL_ActivationAbits a_bits
286 };
287 type enumerated RSL_ActivationAbits {
288 ACT_REL_TO_IMM_ASSIGN ('000'B),
289 ACT_REL_TO_NORM_ASSIGN ('001'B),
290 ACT_REL_TO_ASYNC_HANDOVER ('010'B),
291 ACT_REL_TO_SYNC_HANDOVER ('011'B),
292 ACT_REL_TO_ADDL_ASSIGN ('100'B),
293 ACT_REL_TO_MSLOT_CONFIG ('101'B),
294 ACT_REL_TO_OSMO_PDCH ('111'B)
295 } with { variant "FIELDLENGTH(3)" };
Harald Welte643e2a62017-11-27 15:03:18 +0100296
Harald Welte921f9e02019-05-19 22:27:11 +0200297 const RSL_IE_ActivationType t_RSL_IE_ActType_IA := {
Harald Welte643e2a62017-11-27 15:03:18 +0100298 reactivation := false,
299 reserved := 0,
Harald Welte921f9e02019-05-19 22:27:11 +0200300 a_bits := ACT_REL_TO_IMM_ASSIGN
301 }
302 const RSL_IE_ActivationType t_RSL_IE_ActType_ASS := {
303 reactivation := false,
304 reserved := 0,
305 a_bits := ACT_REL_TO_NORM_ASSIGN
306 }
307 const RSL_IE_ActivationType t_RSL_IE_ActType_HO_ASYNC := {
308 reactivation := false,
309 reserved := 0,
310 a_bits := ACT_REL_TO_ASYNC_HANDOVER
311 }
312 const RSL_IE_ActivationType t_RSL_IE_ActType_HO_SYNC := {
313 reactivation := false,
314 reserved := 0,
315 a_bits := ACT_REL_TO_SYNC_HANDOVER
Harald Welte643e2a62017-11-27 15:03:18 +0100316 }
317
Harald Welte94e0c342018-04-07 11:33:23 +0200318 /* osmocom-style dynamic PDCH */
Harald Welte921f9e02019-05-19 22:27:11 +0200319 const RSL_IE_ActivationType t_RSL_IE_ActType_PDCH := {
Harald Welte94e0c342018-04-07 11:33:23 +0200320 reactivation := false,
321 reserved := 1,
Harald Welte921f9e02019-05-19 22:27:11 +0200322 a_bits := ACT_REL_TO_OSMO_PDCH
Harald Welte94e0c342018-04-07 11:33:23 +0200323 }
324
Vadim Yanitskiye02dbcc2020-08-25 04:20:51 +0700325 /* 9.3.5 */
326 type record RSL_IE_ChannelIdent {
327 uint8_t len,
328 /* 3GPP TS 44.018 Channel Description IE (TV) */
329 ChannelDescriptionTV ch_desc,
330 /* 3GPP TS 44.018 Mobile Allocation IE (shall be empty) */
331 MobileAllocationTLV ma
332 } with { variant (len) "LENGTHTO(ch_desc,ma)" };
333
334 template (value) RSL_IE_ChannelIdent
335 ts_RSL_ChannelIdent(template (value) ChannelDescription ch_desc) := {
336 len := 0, /* overwritten */
337 ch_desc := {
338 iei := '64'O,
339 v := ch_desc
340 },
341 /* Shall be included but empty */
342 ma := {
343 iei := '72'O,
344 v := {
345 len := 0,
346 ma := ''B
347 }
348 }
349 };
350
351 template RSL_IE_ChannelIdent
352 tr_RSL_ChannelIdent(template (present) ChannelDescription ch_desc := ?,
353 template (present) MobileAllocationLV ma := ?) := {
354 len := ?,
355 ch_desc := {
356 iei := '64'O,
357 v := ch_desc
358 },
359 /* Shall be included but empty */
360 ma := {
361 iei := '72'O,
362 v := ma
363 }
364 };
365
Harald Welte643e2a62017-11-27 15:03:18 +0100366 /* 9.3.6 */
367 type enumerated RSL_SpeechDataInd {
368 RSL_SPDI_SPEECH ('00000001'B),
369 RSL_SPDI_DATA ('00000010'B),
370 RSL_SPDI_SIGN ('00000011'B)
371 } with { variant "FIELDLENGTH(8)" };
372 type enumerated RSL_ChanRateType {
373 RSL_CHRT_SDCCH ('00000001'B),
374 RSL_CHRT_TCH_F ('00001000'B),
375 RSL_CHRT_TCH_H ('00001001'B),
376 RSL_CHRT_TCH_F_BD_MSLOT ('00001010'B),
377 RSL_CHRT_TCH_F_DL_MSLOT ('00011010'B),
378 RSL_CHRT_TCH_F_GROUP ('00011000'B),
379 RSL_CHRT_TCH_H_GROUP ('00011001'B),
380 RSL_CHRT_TCH_F_BCAST ('00101000'B),
Neels Hofmeyr2bef0dd2021-04-22 21:46:00 +0000381 RSL_CHRT_TCH_H_BCAST ('00101001'B),
382 RSL_CHRT_OSMO_TCH_F_VAMOS ('10001000'B),
383 RSL_CHRT_OSMO_TCH_H_VAMOS ('10001001'B)
Harald Welte643e2a62017-11-27 15:03:18 +0100384 } with { variant "FIELDLENGTH(8)" };
385 type enumerated RSL_SpeechAlgo {
386 RSL_CMOD_NO_RESOURCE ('00000000'B),
387 RSL_CMOD_SP_GSM1 ('00000001'B),
388 RSL_CMOD_SP_GSM2 ('00010001'B),
389 RSL_CMOD_SP_GSM3 ('00100001'B),
390 RSL_CMOD_SP_GSM4 ('00110001'B),
391 RSL_CMOD_SP_GSM5 ('00001001'B),
392 RSL_CMOD_SP_GSM6 ('00001101'B)
393 } with { variant "FIELDLENGTH(8)" };
394 type record RSL_IE_ChannelMode {
Harald Welte8f2c21d2017-12-07 17:52:40 +0100395 uint8_t len,
Harald Welte643e2a62017-11-27 15:03:18 +0100396 BIT6 reserved,
397 boolean dtx_d,
398 boolean dtx_u,
399 RSL_SpeechDataInd spd_ind,
400 RSL_ChanRateType ch_rate_type,
401 RSL_SpeechAlgo coding_alg_rate
Harald Welte8f2c21d2017-12-07 17:52:40 +0100402 } with { variant (len) "LENGTHTO(reserved,dtx_d,dtx_u,spd_ind,ch_rate_type,coding_alg_rate)" }
Harald Welte643e2a62017-11-27 15:03:18 +0100403
Vadim Yanitskiy8fc43df2020-10-20 02:11:05 +0700404 template (value) RSL_IE_ChannelMode ts_RSL_ChanMode_SIGN(RSL_ChanRateType t := RSL_CHRT_SDCCH,
405 boolean dtx_downlink := false) := {
Harald Welte8f2c21d2017-12-07 17:52:40 +0100406 len := 0, /* overwritten */
Harald Welte643e2a62017-11-27 15:03:18 +0100407 reserved := '000000'B,
Stefan Sperling4880be42018-08-07 18:12:59 +0200408 dtx_d := dtx_downlink,
Harald Welte643e2a62017-11-27 15:03:18 +0100409 dtx_u := false,
410 spd_ind := RSL_SPDI_SIGN,
Philipp Maierac693462020-10-14 20:21:44 +0200411 ch_rate_type := t,
Harald Welte643e2a62017-11-27 15:03:18 +0100412 coding_alg_rate := RSL_CMOD_NO_RESOURCE
413 }
414
Stefan Sperling4880be42018-08-07 18:12:59 +0200415 template (value) RSL_IE_ChannelMode ts_RSL_ChanMode(RSL_ChanRateType t, RSL_SpeechAlgo alg,
416 boolean dtx_downlink := false) := {
Harald Welte8f2c21d2017-12-07 17:52:40 +0100417 len := 0, /* overwritten */
Harald Welte643e2a62017-11-27 15:03:18 +0100418 reserved := '000000'B,
Stefan Sperling4880be42018-08-07 18:12:59 +0200419 dtx_d := dtx_downlink,
Harald Welte643e2a62017-11-27 15:03:18 +0100420 dtx_u := false,
421 spd_ind := RSL_SPDI_SPEECH,
422 ch_rate_type := t,
423 coding_alg_rate := alg
424 }
Harald Welte3618d9d2018-03-21 18:45:27 +0100425 template RSL_IE_ChannelMode tr_RSL_ChanMode(template RSL_ChanRateType t,
426 template RSL_SpeechAlgo alg) := {
427 len := ?,
428 reserved := '000000'B,
429 dtx_d := ?,
430 dtx_u := ?,
431 spd_ind := RSL_SPDI_SPEECH,
432 ch_rate_type := t,
433 coding_alg_rate := alg
434 }
Harald Welte643e2a62017-11-27 15:03:18 +0100435
Vadim Yanitskiy117c1762020-06-16 01:40:10 +0700436 /* 9.3.4 BS Power IE */
Harald Welte643e2a62017-11-27 15:03:18 +0100437 type record RSL_IE_BS_Power {
Vadim Yanitskiy117c1762020-06-16 01:40:10 +0700438 uint2_t reserved,
Harald Welte643e2a62017-11-27 15:03:18 +0100439 boolean epc,
440 boolean fpc,
Vadim Yanitskiy117c1762020-06-16 01:40:10 +0700441 uint4_t power_level
Harald Welte643e2a62017-11-27 15:03:18 +0100442 }
443
Vadim Yanitskiy117c1762020-06-16 01:40:10 +0700444 template (value) RSL_IE_BS_Power ts_RSL_IE_BS_Power(uint4_t power_level,
Eric Wildae8f2622019-06-18 17:05:11 +0200445 boolean epc := false, boolean fpc := false) := {
446 reserved := 0,
447 epc := epc,
448 fpc := fpc,
449 power_level := power_level
450 }
451
Harald Welte73cd2712017-12-17 00:44:52 +0100452 /* 9.3.7 */
Harald Weltee613f962018-04-18 22:38:16 +0200453 type enumerated RSL_AlgId {
454 RSL_ALG_ID_A5_0 ('00000001'B),
455 RSL_ALG_ID_A5_1 ('00000010'B),
456 RSL_ALG_ID_A5_2 ('00000011'B),
457 RSL_ALG_ID_A5_3 ('00000100'B),
458 RSL_ALG_ID_A5_4 ('00000101'B),
459 RSL_ALG_ID_A5_5 ('00000110'B),
460 RSL_ALG_ID_A5_6 ('00000111'B),
461 RSL_ALG_ID_A5_7 ('00001000'B)
462 } with { variant "FIELDLENGTH(8)" };
Harald Welte73cd2712017-12-17 00:44:52 +0100463 type record RSL_IE_EncryptionInfo {
464 uint8_t len,
Harald Weltee613f962018-04-18 22:38:16 +0200465 RSL_AlgId alg_id,
Harald Welte73cd2712017-12-17 00:44:52 +0100466 octetstring key
467 } with { variant (len) "LENGTHTO(alg_id,key)" };
468
Harald Weltee613f962018-04-18 22:38:16 +0200469 template RSL_IE_EncryptionInfo tr_RSL_IE_EncrInfo(template RSL_AlgId alg,
470 template octetstring key) := {
Harald Welte73cd2712017-12-17 00:44:52 +0100471 len := ?,
472 alg_id := alg,
473 key := key
474 }
Harald Weltee613f962018-04-18 22:38:16 +0200475 template (value) RSL_IE_EncryptionInfo ts_RSL_IE_EncrInfo(template (value) RSL_AlgId alg,
476 octetstring key) := {
Harald Welteefa7d912018-04-18 23:22:15 +0200477 len := 0, /* overwritten */
478 alg_id := alg,
479 key := key
480 }
481
482
Harald Welte73cd2712017-12-17 00:44:52 +0100483
Harald Welte643e2a62017-11-27 15:03:18 +0100484 /* 9.3.8 */
485 type record RSL_IE_FrameNumber {
486 uint5_t t1_p,
487 uint6_t t3,
488 uint5_t t2
489 }
490 type RSL_IE_FrameNumber RSL_IE_StartingTime;
491
492 /* 9.3.10 */
493 type record RSL_IE_L1Info {
494 uint5_t ms_power_lvl,
495 boolean fpc,
496 uint2_t reserved,
497 uint8_t actual_ta
498 }
499
500 /* 9.3.13 */
501 type record RSL_IE_MS_Power {
502 uint2_t reserved,
503 boolean fpc_epc,
504 uint5_t power_level
505 }
Pau Espin Pedrolf7630a62019-10-28 15:07:08 +0100506 template RSL_IE_MS_Power tr_RSL_IE_MS_Power(template uint5_t power_level := ?,
507 template boolean fpc_epc := false) := {
508 reserved := 0,
509 fpc_epc := fpc_epc,
510 power_level := power_level
511 }
Harald Welte10280172019-05-19 22:28:04 +0200512 template (value) RSL_IE_MS_Power ts_RSL_IE_MS_Power(uint5_t power_level,
513 boolean fpc_epc := false) := {
514 reserved := 0,
515 fpc_epc := fpc_epc,
516 power_level := power_level
517 }
Harald Welte643e2a62017-11-27 15:03:18 +0100518
Harald Welted5f521e2017-12-07 17:53:06 +0100519 /* 9.3.18 */
520 type record RSL_IE_RachLoad {
521 uint8_t len,
522 uint16_t slot_count,
523 uint16_t busy_count,
524 uint16_t access_count
525 } with { variant (len) "LENGTHTO(slot_count,busy_count,access_count)" }
526
Harald Welteefa7d912018-04-18 23:22:15 +0200527 template (value) RSL_IE_RachLoad ts_RSL_IE_RachLoad(uint16_t slot, uint16_t busy, uint16_t acc) := {
Harald Welted5f521e2017-12-07 17:53:06 +0100528 len := 0, /* overwritten */
529 slot_count := slot,
530 busy_count := busy,
531 access_count := acc
532 }
533
Harald Welte68e495b2018-02-25 00:05:57 +0100534 template RSL_IE_RachLoad tr_RSL_IE_RachLoad(template uint16_t slot,
535 template uint16_t busy,
536 template uint16_t acc) := {
537 len := ?, /* overwritten */
538 slot_count := slot,
539 busy_count := busy,
540 access_count := acc
541 }
542
Harald Welte643e2a62017-11-27 15:03:18 +0100543 /* 9.3.19 */
544 type record RSL_IE_RequestRef {
545 OCT1 ra,
546 RSL_IE_FrameNumber frame_nr
547 }
548
549 /* 3GPP TS 44.018 / 10.5.2.38 Starting Time */
Harald Welte94e0c342018-04-07 11:33:23 +0200550 template (value) RSL_IE_FrameNumber ts_RSL_IE_FrameNumber(GsmFrameNumber fn) := {
Harald Welte643e2a62017-11-27 15:03:18 +0100551 t1_p := (fn / 1326) mod 32,
552 t3 := fn mod 51,
553 t2 := fn mod 26
554 }
555
Harald Welte9abd1282018-02-19 19:18:17 +0100556 function tr_RSL_IE_FrameNumber(template GsmFrameNumber fn) return template RSL_IE_FrameNumber {
557 if (istemplatekind(fn, "?")) {
558 return ?;
559 } else {
560 return ts_RSL_IE_FrameNumber(valueof(fn));
561 }
562 }
563
Harald Welteefa7d912018-04-18 23:22:15 +0200564 template (value) RSL_IE_RequestRef ts_RSL_IE_ReqRef(OCT1 ra, GsmFrameNumber frame_nr) := {
Harald Welte643e2a62017-11-27 15:03:18 +0100565 ra := ra,
566 frame_nr := ts_RSL_IE_FrameNumber(frame_nr)
567 }
568
Harald Welte9abd1282018-02-19 19:18:17 +0100569 template RSL_IE_RequestRef tr_RSL_IE_ReqRef(template OCT1 ra, template GsmFrameNumber frame_nr) := {
570 ra := ra,
571 frame_nr := tr_RSL_IE_FrameNumber(frame_nr)
572 }
573
Vadim Yanitskiy9f699532021-06-03 17:29:22 +0200574 /* 9.3.21 Resource Information */
575 type record RSL_IE_ResourceInfo {
576 uint8_t len,
577 RSL_ResourceInfo info
578 } with { variant (len) "LENGTHTO(info)" };
579
580 type record of RSL_ResourceInfoItem RSL_ResourceInfo;
581 type record RSL_ResourceInfoItem {
582 RslChannelNr chan_nr,
583 uint3_t interf_band,
584 BIT5 rfu ('00000'B)
585 };
586
587 template (value) RSL_ResourceInfoItem
588 ts_RSL_ResourceInfoItem(template (value) RslChannelNr chan_nr,
589 template (value) uint3_t interf_band := 0) := {
590 chan_nr := chan_nr,
591 interf_band := interf_band,
592 rfu := '00000'B
593 }
594 template RSL_ResourceInfoItem
595 tr_RSL_ResourceInfoItem(template (present) RslChannelNr chan_nr := ?,
596 template (present) uint3_t interf_band := ?) := {
597 chan_nr := chan_nr,
598 interf_band := interf_band,
599 rfu := ? /* Tolerate unknown values */
600 }
601
Harald Welte15de8ba2018-06-29 08:51:42 +0200602 /* Osmocom Extension */
603 type record RSL_IE_UplinkMeasSuppMeasInfo {
604 int16_t toa256_mean,
605 int16_t toa256_min,
606 int16_t toa256_max,
607 uint16_t toa256_std_dev
608 };
609
Harald Welte2691adf2018-02-22 17:32:39 +0100610 /* 9.3.25 */
611 type record RSL_IE_UplinkMeas {
612 uint8_t len,
613 BIT1 rfu,
614 boolean dtx_d,
615 uint6_t rxlev_f_u,
616 BIT2 reserved1,
617 uint6_t rxlev_s_u,
618 BIT2 reserved2,
619 uint3_t rxq_f_u,
620 uint3_t rxq_s_u,
Harald Welte15de8ba2018-06-29 08:51:42 +0200621 RSL_IE_UplinkMeasSuppMeasInfo supp_meas_info optional
Harald Welte2691adf2018-02-22 17:32:39 +0100622 } with { variant (len) "LENGTHTO(rfu,dtx_d,rxlev_f_u,reserved1,rxlev_s_u,reserved2,rxq_f_u,rxq_s_u,supp_meas_info)" };
Harald Welte9abd1282018-02-19 19:18:17 +0100623
Harald Welte643e2a62017-11-27 15:03:18 +0100624 /* 9.3.26 */
Harald Weltea8ed9062017-12-14 09:46:01 +0100625 type enumerated RSL_Cause {
626 /* normal event */
627 RSL_ERR_RADIO_IF_FAIL ('00'O),
628 RSL_ERR_RADIO_LINK_FAIL ('01'O),
629 RSL_ERR_HANDOVER_ACC_FAIL ('02'O),
630 RSL_ERR_TALKER_ACC_FAIL ('03'O),
631 RSL_ERR_OM_INTERVENTION ('07'O),
632 RSL_ERR_NORMAL_UNSPEC ('0f'O),
633 RSL_ERR_T_MSRFPCI_EXP ('18'O),
634 /* resource unavailable */
635 RSL_ERR_EQUIPMENT_FAIL ('20'O),
636 RSL_ERR_RR_UNAVAIL ('21'O),
637 RSL_ERR_TERR_CH_FAIL ('22'O),
638 RSL_ERR_CCCH_OVERLOAD ('23'O),
639 RSL_ERR_ACCH_OVERLOAD ('24'O),
640 RSL_ERR_PROCESSOR_OVERLOAD ('25'O),
641 RSL_ERR_BTS_NOT_EQUIPPED ('27'O),
642 RSL_ERR_REMOTE_TRAU_FAILURE ('28'O),
643 RSL_ERR_NOTIF_OVERFLOW ('29'O),
644 RSL_ERR_RES_UNAVAIL ('2f'O),
645 /* service or option not available */
646 RSL_ERR_TRANSC_UNAVAIL ('30'O),
647 RSL_ERR_SERV_OPT_UNAVAIL ('3f'O),
648 /* service or option not implemented */
649 RSL_ERR_ENCR_UNIMPL ('40'O),
650 RSL_ERR_SERV_OPT_UNIMPL ('4f'O),
651 /* invalid message */
652 RSL_ERR_RCH_ALR_ACTV_ALLOC ('50'O),
Harald Welte9912eb52018-02-25 13:30:15 +0100653 RSL_ERR_IPA_RCH_NOT_ACTV_ALLOC ('51'O),
654 RSL_ERR_IPA_CONN_INVALID ('52'O),
655 RSL_ERR_IPA_CONN_IN_USE ('53'O),
656 RSL_ERR_IPA_CONN_ALREADY_EXISTS ('54'O),
Harald Weltea8ed9062017-12-14 09:46:01 +0100657 RSL_ERR_INVALID_MESSAGE ('5f'O),
658 /* protocol error */
659 RSL_ERR_MSG_DISCR ('60'O),
660 RSL_ERR_MSG_TYPE ('61'O),
661 RSL_ERR_MSG_SEQ ('62'O),
662 RSL_ERR_IE_ERROR ('63'O),
663 RSL_ERR_MAND_IE_ERROR ('64'O),
664 RSL_ERR_OPT_IE_ERROR ('65'O),
665 RSL_ERR_IE_NONEXIST ('66'O),
666 RSL_ERR_IE_LENGTH ('67'O),
667 RSL_ERR_IE_CONTENT ('68'O),
668 RSL_ERR_PROTO ('6f'O),
669 /* interworking */
670 RSL_ERR_INTERWORKING ('7f'O)
671 };
Harald Welte643e2a62017-11-27 15:03:18 +0100672 type record RSL_IE_Cause {
Harald Welte6efa8e32017-12-09 22:34:06 +0100673 uint8_t len,
Harald Welte643e2a62017-11-27 15:03:18 +0100674 uint1_t e,
675 RSL_Cause cause,
676 octetstring cause_ext optional
Harald Welte6efa8e32017-12-09 22:34:06 +0100677 } with { variant (len) "LENGTHTO(e,cause,cause_ext)" }
Harald Welte643e2a62017-11-27 15:03:18 +0100678
Harald Welteefa7d912018-04-18 23:22:15 +0200679 template (value) RSL_IE_Cause ts_RSL_IE_Cause(RSL_Cause cause) := {
Harald Welte6efa8e32017-12-09 22:34:06 +0100680 len := 0, /* overwritten */
Harald Welte643e2a62017-11-27 15:03:18 +0100681 e := 0,
682 cause := cause,
683 cause_ext := omit
684 }
685
Harald Welte9abd1282018-02-19 19:18:17 +0100686 template RSL_IE_Cause tr_RSL_IE_Cause(template RSL_Cause cause) := {
687 len := ?,
688 e := 0,
689 cause := cause,
690 cause_ext := omit
691 }
692
Harald Weltec8d363c2019-05-19 20:36:48 +0200693 /* 9.3.29 */
694 type record RSL_SacchInfo {
695 uint8_t len,
696 uint8_t num_msgs,
697 RSL_SacchInfoElements elems
698 } with {
699 variant (len) "LENGTHTO(num_msgs,elems)";
700 variant (num_msgs) "LENGTHTO(elems)";
701 variant (num_msgs) "UNIT(elements)"
702 };
703 type record RSL_SacchInfoElement {
704 RSL_IE_SysinfoType si_type,
705 uint8_t len,
706 octetstring msg
707 } with {
708 variant (len) "LENGTHTO(msg)";
709 };
710 type record of RSL_SacchInfoElement RSL_SacchInfoElements;
711 template (value) RSL_SacchInfo ts_RSL_SacchInfo(template (value) RSL_SacchInfoElements elems) := {
712 len := 0, /* overwritten */
713 num_msgs := 0, /* overwritten */
714 elems := elems
715 }
716 template (value) RSL_SacchInfoElement ts_RSL_SacchInfoElem(RSL_IE_SysinfoType tp, octetstring msg) := {
717 si_type := tp,
718 len := lengthof(msg),
719 msg := msg
720 }
721
Eric Wild61edb7e2019-06-03 12:38:31 +0200722 /* 9.3.31 */
723 type record RSL_IE_MS_Power_Parameters {
724 uint8_t len,
725 octetstring params
726 } with {
727 variant (len) "LENGTHTO(params)";
728 };
729 template (value) RSL_IE_MS_Power_Parameters ts_RSL_IE_MS_Power_Parameters(octetstring params) := {
730 len := 0, /* overwritten */
731 params := params
732 }
733
Harald Welte643e2a62017-11-27 15:03:18 +0100734 /* 9.3.40 */
735 type enumerated RSL_ChanNeeded {
736 RSL_CHANNEED_ANY ('00'B),
737 RSL_CHANNEED_SDCCH ('01'B),
738 RSL_CHANNEED_TCH_F ('10'B),
739 RSL_CHANNEED_TCH_ForH ('11'B)
Harald Welte51d74102017-12-10 23:05:02 +0100740 } with { variant "FIELDLENGTH(2)" };
Harald Welte643e2a62017-11-27 15:03:18 +0100741 type record RSL_IE_ChanNeeded {
742 uint6_t reserved,
743 RSL_ChanNeeded chan_needed
744 }
745
Harald Weltecc373202018-09-10 10:28:21 +0200746 /* 9.3.41 CB Command Type */
747 type enumerated RSL_CbCommand {
748 RSL_CB_CMD_NORMAL ('0000'B),
749 RSL_CB_CMD_SCHEDULE ('1000'B),
750 RSL_CB_CMD_DEFAULT ('1110'B),
751 RSL_CB_CMD_NULL ('1111'B)
752 } with { variant "FIELDLENGTH(4)" };
753 type record RSL_IE_CbCommandType {
754 RSL_CbCommand command,
755 boolean default_bcast_null,
756 BIT1 spare,
757 uint2_t last_block
758 };
759 template (value) RSL_IE_CbCommandType ts_RSL_IE_CbCmdType(RSL_CbCommand cmd := RSL_CB_CMD_NORMAL,
760 uint2_t last_block := 1,
761 boolean def_bcast_null := true) := {
762 command := cmd,
763 default_bcast_null := def_bcast_null,
764 spare := '0'B,
765 last_block := last_block
766 }
767
Harald Welte4a129f82019-05-21 16:35:22 +0200768 /* 9.4.43 CBCH Load Information */
769 type record RSL_IE_CbchLoadInfo {
770 boolean overflow,
771 BIT3 spare,
772 uint4_t slot_count
773 };
774 template RSL_IE_CbchLoadInfo tr_CbchLoadInfo(template boolean overflow,
775 template uint4_t slot_count) := {
776 overflow := overflow,
777 spare := ?,
778 slot_count := slot_count
779 }
780 template (value) RSL_IE_CbchLoadInfo ts_CbchLoadInfo(boolean overflow, uint4_t slot_count) := {
781 overflow := overflow,
782 spare := '000'B,
783 slot_count := slot_count
784 }
785
Harald Welte643e2a62017-11-27 15:03:18 +0100786 /* 9.3.53 */
787 type record RSL_IE_MultirateCtrl {
788 uint3_t spare,
789 boolean od,
790 boolean pre,
791 uint2_t rae,
792 boolean tfo
793 }
794
795 type enumerated RSL_IE_SysinfoType {
796 RSL_SYSTEM_INFO_8 ('00000000'B),
797 RSL_SYSTEM_INFO_1 ('00000001'B),
798 RSL_SYSTEM_INFO_2 ('00000010'B),
799 RSL_SYSTEM_INFO_3 ('00000011'B),
800 RSL_SYSTEM_INFO_4 ('00000100'B),
801 RSL_SYSTEM_INFO_5 ('00000101'B),
802 RSL_SYSTEM_INFO_6 ('00000110'B),
803 RSL_SYSTEM_INFO_7 ('00000111'B),
804 RSL_SYSTEM_INFO_16 ('00001000'B),
805 RSL_SYSTEM_INFO_17 ('00001001'B),
806 RSL_SYSTEM_INFO_2bis ('00001010'B),
807 RSL_SYSTEM_INFO_2ter ('00001011'B),
808 RSL_SYSTEM_INFO_5bis ('00001101'B),
809 RSL_SYSTEM_INFO_5ter ('00001110'B),
810 RSL_SYSTEM_INFO_10 ('00001111'B),
811 RSL_EXT_MEAS_ORDER ('01000111'B),
812 RSL_MEAS_INFO ('01001000'B),
813 RSL_SYSTEM_INFO_13 ('00101000'B),
814 RSL_ERIC_SYSTEM_INFO_13 ('00001100'B),
815 RSL_SYSTEM_INFO_2quater ('00101001'B),
816 RSL_SYSTEM_INFO_9 ('00101010'B),
817 RSL_SYSTEM_INFO_18 ('00101011'B),
818 RSL_SYSTEM_INFO_19 ('00101100'B),
819 RSL_SYSTEM_INFO_20 ('00101101'B)
820 } with { variant "FIELDLENGTH(8)" }
821
Harald Welte9958a4d2017-12-14 21:21:33 +0100822 type record RSL_IE_IPA_ConnectionStats {
823 uint8_t len,
824 uint32_t tx_packets,
825 uint32_t tx_octets,
826 uint32_t rx_packets,
827 uint32_t rx_octets,
828 uint32_t lost_packets,
829 uint32_t jitter,
830 uint32_t avg_delay
831 } with { variant (len) "LENGTHTO(tx_packets,tx_octets,rx_packets,rx_octets,lost_packets,jitter,avg_delay)" }
832
833 type enumerated RSL_IPA_SpeechMode {
834 RSL_IPA_SPM_SENDRECV ('00'B),
835 RSL_IPA_SPM_RECVONLY ('01'B),
836 RSL_IPA_SPM_SENDONLY ('10'B),
837 RSL_IPA_SPM_RESERVED ('11'B)
838 } with { variant "FIELDLENGTH(2)" }
839
840 type enumerated RSL_IPA_Codec {
841 RSL_IPA_CODEC_FR ('0000'B),
842 RSL_IPA_CODEC_EFR ('0001'B),
843 RSL_IPA_CODEC_AMR_F ('0010'B),
844 RSL_IPA_CODEC_HR ('0011'B),
845 RSL_IPA_CODEC_AMR_H ('0101'B),
846 RSL_IPA_CODEC_RTP_PT ('1111'B)
847 } with { variant "FIELDLENGTH(4)" }
848
849 type record RSL_IE_IPA_SpeechMode {
850 BIT2 reserved,
851 RSL_IPA_SpeechMode mode,
852 RSL_IPA_Codec codec
853 }
854
Harald Welte0472ab42018-03-12 15:02:26 +0100855 /* 9.3.20 */
856 type enumerated RSL_IE_ReleaseMode {
857 RSL_REL_MODE_NORMAL ('00'B),
858 REL_REL_MODE_LOCAL ('01'B)
859 }
860
Neels Hofmeyr2bef0dd2021-04-22 21:46:00 +0000861 type record RSL_IE_OSMO_TrainingSequence {
862 uint8_t len,
863 uint8_t tsc_set,
864 uint8_t tsc
865 } with { variant (len) "LENGTHTO(tsc_set,tsc)" }
866
Harald Welte643e2a62017-11-27 15:03:18 +0100867 /* union of all IE bodies */
868 type union RSL_IE_Body {
869 RslChannelNr chan_nr,
870 RslLinkId link_id,
Harald Welte15bb5b52017-12-07 17:52:04 +0100871 RSL_L16V l3_info,
Harald Welte643e2a62017-11-27 15:03:18 +0100872 RSL_LV rlm_cause,
Harald Welte0472ab42018-03-12 15:02:26 +0100873 RSL_IE_ReleaseMode release_mode,
Harald Welte643e2a62017-11-27 15:03:18 +0100874 RSL_IE_ActivationType act_type,
Vadim Yanitskiye02dbcc2020-08-25 04:20:51 +0700875 RSL_IE_ChannelIdent chan_ident,
Harald Welte643e2a62017-11-27 15:03:18 +0100876 RSL_IE_ChannelMode chan_mode,
877 uint8_t handover_ref,
878 RSL_IE_BS_Power bs_power,
Vadim Yanitskiy802508e2020-11-11 07:25:47 +0700879 RSL_LV bs_power_params,
Harald Welte643e2a62017-11-27 15:03:18 +0100880 RSL_IE_MS_Power ms_power,
Eric Wild61edb7e2019-06-03 12:38:31 +0200881 RSL_IE_MS_Power_Parameters ms_power_params,
Harald Welte643e2a62017-11-27 15:03:18 +0100882 uint8_t timing_adv,
883 RSL_IE_MultirateCtrl multirate_ctrl,
Harald Weltea6706152019-05-19 20:38:18 +0200884 uint8_t msg_id,
Harald Welte643e2a62017-11-27 15:03:18 +0100885 RSL_IE_FrameNumber frame_nr,
886 RSL_IE_Cause cause,
887 uint8_t access_delay,
Harald Welted5f521e2017-12-07 17:53:06 +0100888 RSL_IE_RachLoad rach_load,
Harald Welte643e2a62017-11-27 15:03:18 +0100889 uint8_t meas_res_nr,
Harald Welte2691adf2018-02-22 17:32:39 +0100890 uint8_t ms_timing_offset,
891 RSL_IE_UplinkMeas uplink_meas,
Harald Welte643e2a62017-11-27 15:03:18 +0100892 RSL_IE_L1Info l1_info,
893 RSL_IE_SysinfoType sysinfo_type,
894 uint16_t paging_load,
895 uint8_t paging_group,
896 RSL_IE_ChanNeeded chan_needed,
Harald Weltecc373202018-09-10 10:28:21 +0200897 RSL_IE_CbCommandType cb_cmd_type,
898 RSL_LV smscb_message,
Harald Welte4a129f82019-05-21 16:35:22 +0200899 RSL_IE_CbchLoadInfo cbch_load_info,
Vadim Yanitskiy9f699532021-06-03 17:29:22 +0200900 RSL_IE_ResourceInfo resource_info,
Harald Weltec8d363c2019-05-19 20:36:48 +0200901 RSL_SacchInfo sacch_info,
Harald Weltecc373202018-09-10 10:28:21 +0200902
Harald Welte643e2a62017-11-27 15:03:18 +0100903 RSL_IE_StartingTime starting_time,
Harald Welte73cd2712017-12-17 00:44:52 +0100904 RSL_IE_EncryptionInfo encr_info,
Harald Weltea3ff6702019-05-20 20:03:50 +0200905 uint8_t smscb_chan_ind,
Harald Welte643e2a62017-11-27 15:03:18 +0100906 RSL_IE_RequestRef req_ref,
907 RSL_LV full_imm_ass_info,
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +0700908 MobileIdentityLV ms_identity,
Harald Welte643e2a62017-11-27 15:03:18 +0100909
Harald Welte9958a4d2017-12-14 21:21:33 +0100910 uint16_t ipa_conn_id,
911 uint16_t ipa_local_port,
912 uint16_t ipa_remote_port,
913 uint32_t ipa_local_ip,
914 uint32_t ipa_remote_ip,
915 uint8_t ipa_rtp_pt,
916 uint8_t ipa_rtp_pt2,
917 RSL_IE_IPA_ConnectionStats ipa_stats,
918 RSL_IE_IPA_SpeechMode ipa_speech_mode,
919
Neels Hofmeyr2bef0dd2021-04-22 21:46:00 +0000920 RSL_IE_OSMO_TrainingSequence osmo_training_sequence,
921
Harald Welte643e2a62017-11-27 15:03:18 +0100922 RSL_LV other
923 }
924
925 type record RSL_IE {
926 RSL_IE_Type iei,
927 RSL_IE_Body body
928 } with { variant (body) "CROSSTAG(
929 chan_nr, iei = RSL_IE_CHAN_NR;
930 link_id, iei = RSL_IE_LINK_IDENT;
931 l3_info, iei = RSL_IE_L3_INFO;
932 rlm_cause, iei = RSL_IE_RLM_CAUSE;
933 release_mode, iei = RSL_IE_RELEASE_MODE;
934 act_type, iei = RSL_IE_ACT_TYPE;
Vadim Yanitskiye02dbcc2020-08-25 04:20:51 +0700935 chan_ident, iei = RSL_IE_CHAN_IDENT;
Harald Welte643e2a62017-11-27 15:03:18 +0100936 chan_mode, iei = RSL_IE_CHAN_MODE;
937 handover_ref, iei = RSL_IE_HANDO_REF;
938 bs_power, iei = RSL_IE_BS_POWER;
Vadim Yanitskiy802508e2020-11-11 07:25:47 +0700939 bs_power_params, iei = RSL_IE_BS_POWER_PARAM;
Harald Welte643e2a62017-11-27 15:03:18 +0100940 ms_power, iei = RSL_IE_MS_POWER;
Eric Wild61edb7e2019-06-03 12:38:31 +0200941 ms_power_params, iei = RSL_IE_MS_POWER_PARAM;
Harald Welte643e2a62017-11-27 15:03:18 +0100942 timing_adv, iei = RSL_IE_TIMING_ADVANCE;
943 multirate_ctrl, iei = RSL_IE_MR_CONTROL;
Harald Weltea6706152019-05-19 20:38:18 +0200944 msg_id, iei = RSL_IE_MSG_ID;
Harald Welte643e2a62017-11-27 15:03:18 +0100945
946 frame_nr, iei = RSL_IE_FRAME_NUMBER;
947 cause, iei = RSL_IE_CAUSE;
948 access_delay, iei = RSL_IE_ACCESS_DELAY;
Harald Welted5f521e2017-12-07 17:53:06 +0100949 rach_load, iei = RSL_IE_RACH_LOAD;
Harald Welte643e2a62017-11-27 15:03:18 +0100950 meas_res_nr, iei = RSL_IE_MEAS_RES_NR;
Harald Welte2691adf2018-02-22 17:32:39 +0100951 ms_timing_offset, iei = RSL_IE_MS_TIMING_OFFSET;
952 uplink_meas, iei = RSL_IE_UPLINK_MEAS;
Harald Welte643e2a62017-11-27 15:03:18 +0100953 l1_info, iei = RSL_IE_L1_INFO;
954 sysinfo_type, iei = RSL_IE_SYSINFO_TYPE;
955 paging_load, iei = RSL_IE_PAGING_LOAD;
956 paging_group, iei = RSL_IE_PAGING_GROUP;
957 chan_needed, iei = RSL_IE_CHAN_NEEDED;
Harald Weltecc373202018-09-10 10:28:21 +0200958 cb_cmd_type, iei = RSL_IE_CB_CMD_TYPE;
959 smscb_message, iei = RSL_IE_SMSCB_MSG;
Harald Welte4a129f82019-05-21 16:35:22 +0200960 cbch_load_info, iei = RSL_IE_CBCH_LOAD_INFO;
Vadim Yanitskiy9f699532021-06-03 17:29:22 +0200961 resource_info, iei = RSL_IE_RESOURCE_INFO;
Harald Weltec8d363c2019-05-19 20:36:48 +0200962 sacch_info, iei = RSL_IE_SACCH_INFO;
Harald Welte643e2a62017-11-27 15:03:18 +0100963 starting_time, iei = RSL_IE_STARTNG_TIME;
Harald Welte73cd2712017-12-17 00:44:52 +0100964 encr_info, iei = RSL_IE_ENCR_INFO;
Harald Weltea3ff6702019-05-20 20:03:50 +0200965 smscb_chan_ind, iei = RSL_IE_SMSCB_CHAN_INDICATOR;
Harald Welte643e2a62017-11-27 15:03:18 +0100966
967 req_ref, iei = RSL_IE_REQ_REFERENCE;
Harald Weltefff69302017-12-07 17:53:42 +0100968 full_imm_ass_info, iei = RSL_IE_FULL_IMM_ASS_INFO;
969 ms_identity, iei = RSL_IE_MS_IDENTITY;
970 other, iei = RSL_IE_FULL_BCCH_INFO;
Harald Welte643e2a62017-11-27 15:03:18 +0100971
Harald Welte9958a4d2017-12-14 21:21:33 +0100972 ipa_conn_id, iei = RSL_IE_IPAC_CONN_ID;
973 ipa_remote_ip, iei = RSL_IE_IPAC_REMOTE_IP;
974 ipa_remote_port, iei = RSL_IE_IPAC_REMOTE_PORT;
975 ipa_local_ip, iei = RSL_IE_IPAC_LOCAL_IP;
976 ipa_local_port, iei = RSL_IE_IPAC_LOCAL_PORT;
977 ipa_rtp_pt, iei = RSL_IE_IPAC_RTP_PAYLOAD;
978 ipa_rtp_pt2, iei = RSL_IE_IPAC_RTP_PAYLOAD2;
979 ipa_stats, iei = RSL_IE_IPAC_CONN_STAT;
980 ipa_speech_mode, iei = RSL_IE_IPAC_SPEECH_MODE;
981
Neels Hofmeyr2bef0dd2021-04-22 21:46:00 +0000982 osmo_training_sequence, iei = RSL_IE_OSMO_TRAINING_SEQUENCE;
983
Harald Welte643e2a62017-11-27 15:03:18 +0100984 other, OTHERWISE;
985 )" };
986
Harald Welte735dd072017-12-12 14:55:17 +0100987 /* For some reason the TTCN-3 RAW codec cannot automatically figure out the IEI
988 * that it needs to set for a given union-choice (body). So we have to explicitly
989 * specify the IEI by the caller :( */
Harald Welteefa7d912018-04-18 23:22:15 +0200990 template (value) RSL_IE t_RSL_IE(RSL_IE_Type iei, template (value) RSL_IE_Body body) := {
Harald Welte735dd072017-12-12 14:55:17 +0100991 iei := iei,
Harald Welte643e2a62017-11-27 15:03:18 +0100992 body := body
993 }
994
Harald Weltec2877752017-12-07 17:54:35 +0100995 template RSL_IE tr_RSL_IE(template RSL_IE_Body body) := {
996 iei := ?, /* overwritten? */
997 body := body
998 }
999
1000
Harald Welte643e2a62017-11-27 15:03:18 +01001001 type record of RSL_IE RSL_IE_List;
1002
1003 type record RSL_Message {
1004 RSL_MessageDiscriminator msg_disc,
1005 RSL_MessageType msg_type,
1006 RSL_IE_List ies optional
1007 }
1008
1009 external function enc_RSL_Message(in RSL_Message msg) return octetstring
1010 with { extension "prototype(convert) encode(RAW)" };
1011 external function dec_RSL_Message(in octetstring stream) return RSL_Message
1012 with { extension "prototype(convert) decode(RAW)" };
1013
Harald Weltebc330be2017-12-09 00:56:36 +01001014 template RSL_Message tr_RSL_MsgDiscType(template RSL_MessageDiscriminator m_disc,
Harald Welte643e2a62017-11-27 15:03:18 +01001015 RSL_MessageType m_type) := {
1016 msg_disc := m_disc,
1017 msg_type := m_type,
1018 ies := *
1019 }
1020
Harald Welteefa7d912018-04-18 23:22:15 +02001021 template (value) RSL_Message ts_RSL_MsgDiscType(template (value) RSL_MessageDiscriminator m_disc,
1022 template (value) RSL_MessageType msg_type,
1023 template (omit) RSL_IE_List ies := omit) := {
Harald Welte4a267362017-12-09 17:49:32 +01001024 msg_disc := m_disc,
1025 msg_type := msg_type,
1026 ies := ies
1027 }
1028
Harald Weltebc330be2017-12-09 00:56:36 +01001029template RSL_Message tr_RSL_MsgType(template RSL_MessageType msg_type) := {
1030 msg_disc := ?,
1031 msg_type := msg_type,
1032 ies := *
1033}
1034
1035/* Common Channel Management */
1036template RSL_Message tr_RSL_MsgTypeC(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
1037 msg_disc := { RSL_MDISC_CCHAN, ? }
1038}
1039
1040/* RLL */
1041template RSL_Message tr_RSL_MsgTypeR(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
1042 msg_disc := { RSL_MDISC_RLL, true }
1043}
1044
1045/* Dedicated Channel Management */
1046template RSL_Message tr_RSL_MsgTypeD(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
1047 msg_disc := { RSL_MDISC_DCHAN, ? }
1048}
1049
1050/* Dedicated Channel Management */
1051template RSL_Message tr_RSL_MsgTypeT(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
1052 msg_disc := { RSL_MDISC_TRX_MGMT, ? }
1053}
1054
1055
1056/* dedicated channel or RLL */
1057template RSL_Message tr_RSL_MsgTypeDR(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
Harald Weltee5408222018-01-29 21:57:58 +01001058 msg_disc := ({RSL_MDISC_DCHAN,?}, {RSL_MDISC_RLL,?}, {RSL_MDISC_IPACCESS,false})
Harald Weltebc330be2017-12-09 00:56:36 +01001059}
1060
1061
Harald Welte643e2a62017-11-27 15:03:18 +01001062 /* 8.3.1 BSC -> BTS */
Harald Welteefa7d912018-04-18 23:22:15 +02001063 template (value) RSL_Message ts_RSL_DATA_REQ(template (value) RslChannelNr chan_nr,
1064 template (value) RslLinkId link_id,
1065 octetstring l3_info) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001066 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, true),
1067 msg_type := RSL_MT_DATA_REQ,
1068 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001069 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1070 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
1071 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
Harald Welte643e2a62017-11-27 15:03:18 +01001072 }
1073 }
1074
Harald Welte7794d5b2017-12-16 23:00:20 +01001075 template RSL_Message tr_RSL_DATA_REQ(template RslChannelNr chan_nr :=?,
1076 template RslLinkId link_id := ?,
1077 template octetstring l3_info := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001078 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, true),
Harald Welte7794d5b2017-12-16 23:00:20 +01001079 msg_type := RSL_MT_DATA_REQ,
1080 ies :={
1081 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1082 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
1083 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
1084 }
1085 }
1086
1087
Harald Welte643e2a62017-11-27 15:03:18 +01001088 /* 8.3.2 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001089 template (value) RSL_Message ts_RSL_DATA_IND(template (value) RslChannelNr chan_nr,
1090 template (value) RslLinkId link_id,
1091 octetstring l3_info) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001092 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, true),
1093 msg_type := RSL_MT_DATA_IND,
1094 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001095 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1096 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
1097 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
Harald Welte643e2a62017-11-27 15:03:18 +01001098 }
1099 }
Harald Welte9abd1282018-02-19 19:18:17 +01001100 template RSL_Message tr_RSL_DATA_IND(template RslChannelNr chan_nr, template RslLinkId link_id,
1101 template octetstring l3_info := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001102 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, true),
Harald Welte9abd1282018-02-19 19:18:17 +01001103 msg_type := RSL_MT_DATA_IND,
1104 ies :={
1105 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1106 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
1107 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
1108 }
1109 }
Harald Welte643e2a62017-11-27 15:03:18 +01001110
1111 /* 8.3.3 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001112 template (value) RSL_Message ts_RSL_ERROR_IND(template (value) RslChannelNr chan_nr,
Harald Weltea7d81f12019-06-02 22:33:19 +02001113 template (value) RslLinkId link_id,
1114 template (value) octetstring rlm_cause) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001115 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1116 msg_type := RSL_MT_ERROR_IND,
1117 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001118 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1119 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
Harald Weltea7d81f12019-06-02 22:33:19 +02001120 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{rlm_cause := ts_RSL_LV(rlm_cause)})
Harald Welte643e2a62017-11-27 15:03:18 +01001121 }
1122 }
Harald Welte9abd1282018-02-19 19:18:17 +01001123 template RSL_Message tr_RSL_ERROR_IND(template RslChannelNr chan_nr, template RslLinkId link_id,
Harald Weltea7d81f12019-06-02 22:33:19 +02001124 template octetstring rlm_cause := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001125 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001126 msg_type := RSL_MT_ERROR_IND,
1127 ies :={
1128 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1129 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
Harald Weltea7d81f12019-06-02 22:33:19 +02001130 tr_RSL_IE(RSL_IE_Body:{rlm_cause := tr_RSL_LV(rlm_cause)})
Harald Welte9abd1282018-02-19 19:18:17 +01001131 }
1132 }
Harald Welte643e2a62017-11-27 15:03:18 +01001133
Harald Welteefa7d912018-04-18 23:22:15 +02001134 /* 8.3.4 BTS <- BSC */
1135 template (value) RSL_Message ts_RSL_EST_REQ(template (value) RslChannelNr chan_nr,
1136 template (value) RslLinkId link_id) := {
1137 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1138 msg_type := RSL_MT_EST_REQ,
1139 ies := {
1140 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1141 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
1142 }
1143 }
1144 template RSL_Message tr_RSL_EST_REQ(template RslChannelNr chan_nr, template RslLinkId link_id) := {
1145 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
1146 msg_type := RSL_MT_EST_REQ,
1147 ies := {
1148 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1149 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1150 }
1151 }
1152
1153 /* 8.3.5 BTS -> BSC */
1154 template (value) RSL_Message ts_RSL_EST_CONF(template (value) RslChannelNr chan_nr,
1155 template (value) RslLinkId link_id) := {
1156 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1157 msg_type := RSL_MT_EST_CONF,
1158 ies := {
1159 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1160 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
1161 }
1162 }
1163 template RSL_Message tr_RSL_EST_CONF(template RslChannelNr chan_nr, template RslLinkId link_id) := {
1164 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
1165 msg_type := RSL_MT_EST_CONF,
1166 ies := {
1167 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1168 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1169 }
1170 }
1171
Harald Welte643e2a62017-11-27 15:03:18 +01001172 /* 8.3.6 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001173 template (value) RSL_Message ts_RSL_EST_IND(template (value) RslChannelNr chan_nr,
1174 template (value) RslLinkId link_id,
1175 octetstring l3_info) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001176 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1177 msg_type := RSL_MT_EST_IND,
1178 ies := {
Harald Welte735dd072017-12-12 14:55:17 +01001179 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1180 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
1181 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
Harald Welte643e2a62017-11-27 15:03:18 +01001182 }
1183 }
Harald Welte9abd1282018-02-19 19:18:17 +01001184 template RSL_Message tr_RSL_EST_IND(template RslChannelNr chan_nr, template RslLinkId link_id,
1185 template octetstring l3_info := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001186 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001187 msg_type := RSL_MT_EST_IND,
1188 ies := {
1189 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1190 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
1191 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
1192 }
1193 }
Harald Welte0472ab42018-03-12 15:02:26 +01001194 template RSL_Message tr_RSL_EST_IND_NOL3(template RslChannelNr chan_nr, template RslLinkId link_id) :=
1195{
1196 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
1197 msg_type := RSL_MT_EST_IND,
1198 ies := {
1199 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1200 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1201 }
1202 }
1203
Harald Welte643e2a62017-11-27 15:03:18 +01001204
1205 /* 8.3.7 BSC -> BTS */
Harald Welteefa7d912018-04-18 23:22:15 +02001206 template (value) RSL_Message ts_RSL_REL_REQ(template (value) RslChannelNr chan_nr,
Harald Welte0472ab42018-03-12 15:02:26 +01001207 template (value) RslLinkId link_id,
1208 template (value) RSL_IE_ReleaseMode rel_mode := RSL_REL_MODE_NORMAL) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001209 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1210 msg_type := RSL_MT_REL_REQ,
1211 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001212 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
Harald Welte0472ab42018-03-12 15:02:26 +01001213 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
1214 t_RSL_IE(RSL_IE_RELEASE_MODE, RSL_IE_Body:{release_mode := rel_mode})
Harald Welte643e2a62017-11-27 15:03:18 +01001215 }
1216 }
Harald Weltee8a5ab12017-12-09 22:34:57 +01001217 template RSL_Message tr_RSL_REL_REQ(template RslChannelNr chan_nr,
Harald Welte0472ab42018-03-12 15:02:26 +01001218 template RslLinkId link_id,
1219 template RSL_IE_ReleaseMode rel_mode := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001220 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Weltee8a5ab12017-12-09 22:34:57 +01001221 msg_type := RSL_MT_REL_REQ,
1222 ies :={
1223 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1224 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
Harald Welte0472ab42018-03-12 15:02:26 +01001225 tr_RSL_IE(RSL_IE_Body:{release_mode := rel_mode})
Harald Weltee8a5ab12017-12-09 22:34:57 +01001226 }
1227 }
Harald Welte643e2a62017-11-27 15:03:18 +01001228
1229 /* 8.3.8 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001230 template (value) RSL_Message ts_RSL_REL_CONF(template (value) RslChannelNr chan_nr,
1231 template (value) RslLinkId link_id) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001232 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1233 msg_type := RSL_MT_REL_CONF,
1234 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001235 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1236 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
Harald Welte643e2a62017-11-27 15:03:18 +01001237 }
1238 }
Harald Welte9abd1282018-02-19 19:18:17 +01001239 template RSL_Message tr_RSL_REL_CONF(template RslChannelNr chan_nr, template RslLinkId link_id) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001240 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001241 msg_type := RSL_MT_REL_CONF,
1242 ies :={
1243 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1244 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1245 }
1246 }
Harald Welte643e2a62017-11-27 15:03:18 +01001247
1248 /* 8.3.9 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001249 template (value) RSL_Message ts_RSL_REL_IND(template (value) RslChannelNr chan_nr,
1250 template (value) RslLinkId link_id) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001251 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1252 msg_type := RSL_MT_REL_IND,
1253 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001254 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1255 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
Harald Welte643e2a62017-11-27 15:03:18 +01001256 }
1257 }
Harald Welte9abd1282018-02-19 19:18:17 +01001258 template RSL_Message tr_RSL_REL_IND(template RslChannelNr chan_nr, template RslLinkId link_id) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001259 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001260 msg_type := RSL_MT_REL_IND,
1261 ies :={
1262 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1263 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1264 }
1265 }
Harald Welte643e2a62017-11-27 15:03:18 +01001266
1267 /* 8.3.10 BSC -> BTS */
Harald Welteefa7d912018-04-18 23:22:15 +02001268 template (value) RSL_Message ts_RSL_UNITDATA_REQ(template (value) RslChannelNr chan_nr,
1269 template (value) RslLinkId link_id,
1270 octetstring l3_info)
Harald Welte643e2a62017-11-27 15:03:18 +01001271 modifies ts_RSL_DATA_REQ := {
1272 msg_type := RSL_MT_UNIT_DATA_REQ
1273 }
Harald Welte0472ab42018-03-12 15:02:26 +01001274 template RSL_Message tr_RSL_UNITDATA_REQ(template RslChannelNr chan_nr,
1275 template RslLinkId link_id,
Vadim Yanitskiy8f98d3f2018-10-03 17:58:10 +07001276 template octetstring l3_info := ?)
Harald Welte0472ab42018-03-12 15:02:26 +01001277 modifies tr_RSL_DATA_REQ := {
1278 msg_type := RSL_MT_UNIT_DATA_REQ
1279 }
1280
Harald Welte643e2a62017-11-27 15:03:18 +01001281
1282 /* 8.3.11 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001283 template (value) RSL_Message ts_RSL_UNITDATA_IND(template (value) RslChannelNr chan_nr,
1284 template (value) RslLinkId link_id,
1285 octetstring l3_info)
Harald Welte643e2a62017-11-27 15:03:18 +01001286 modifies ts_RSL_DATA_IND := {
1287 msg_type := RSL_MT_UNIT_DATA_IND
1288 }
Harald Welte0472ab42018-03-12 15:02:26 +01001289 template RSL_Message tr_RSL_UNITDATA_IND(template RslChannelNr chan_nr,
Vadim Yanitskiyfabe0f22018-10-03 17:51:47 +07001290 template RslLinkId link_id,
Vadim Yanitskiy8f98d3f2018-10-03 17:58:10 +07001291 template octetstring l3_info := ?)
Harald Welte0472ab42018-03-12 15:02:26 +01001292 modifies tr_RSL_DATA_IND := {
1293 msg_type := RSL_MT_UNIT_DATA_IND
1294 }
1295
1296
Harald Welte643e2a62017-11-27 15:03:18 +01001297
1298
1299 /* DEDICATED CANNEL MANAGEMENT MESSAGES */
1300
1301 /* 8.4.1 BSC -> BTS */
Harald Welteefa7d912018-04-18 23:22:15 +02001302 template (value) RSL_Message ts_RSL_CHAN_ACT(template (value) RslChannelNr chan_nr,
Harald Welte921f9e02019-05-19 22:27:11 +02001303 template (value) RSL_IE_ChannelMode mode,
1304 template (value) RSL_IE_ActivationType at := t_RSL_IE_ActType_IA) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001305 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1306 msg_type := RSL_MT_CHAN_ACTIV,
1307 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001308 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
Harald Welte921f9e02019-05-19 22:27:11 +02001309 t_RSL_IE(RSL_IE_ACT_TYPE, RSL_IE_Body:{act_type := at}),
Harald Welte735dd072017-12-12 14:55:17 +01001310 t_RSL_IE(RSL_IE_CHAN_MODE, RSL_IE_Body:{chan_mode := mode})
Harald Welte643e2a62017-11-27 15:03:18 +01001311 /* lots of optional IEs */
1312 }
1313 }
Harald Welte94e0c342018-04-07 11:33:23 +02001314 template RSL_Message tr_RSL_CHAN_ACT(template RslChannelNr chan_nr,
Harald Welte921f9e02019-05-19 22:27:11 +02001315 template RSL_IE_ChannelMode mode,
1316 template (value) RSL_IE_ActivationType at := t_RSL_IE_ActType_IA) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001317 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte94e0c342018-04-07 11:33:23 +02001318 msg_type := RSL_MT_CHAN_ACTIV,
1319 ies :={
1320 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
Harald Welte921f9e02019-05-19 22:27:11 +02001321 tr_RSL_IE(RSL_IE_Body:{act_type := at}),
Harald Welte94e0c342018-04-07 11:33:23 +02001322 tr_RSL_IE(RSL_IE_Body:{chan_mode := mode}),
1323 /* lots of optional IEs */
1324 *
1325 }
1326 }
1327 template RSL_Message tr_RSL_CHAN_ACT_PDCH(template RslChannelNr chan_nr,
1328 template RSL_IE_ChannelMode mode) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001329 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte94e0c342018-04-07 11:33:23 +02001330 msg_type := RSL_MT_CHAN_ACTIV,
1331 ies :={
1332 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1333 tr_RSL_IE(RSL_IE_Body:{act_type := t_RSL_IE_ActType_PDCH}),
1334 /* lots of optional IEs */
1335 *
1336 }
1337 }
1338
Harald Welte643e2a62017-11-27 15:03:18 +01001339
1340 /* 8.4.2 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001341 template (value) RSL_Message ts_RSL_CHAN_ACT_ACK(template (value) RslChannelNr chan_nr,
1342 GsmFrameNumber fn) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001343 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1344 msg_type := RSL_MT_CHAN_ACTIV_ACK,
1345 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001346 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1347 t_RSL_IE(RSL_IE_FRAME_NUMBER, RSL_IE_Body:{frame_nr := ts_RSL_IE_FrameNumber(fn)})
Harald Welte643e2a62017-11-27 15:03:18 +01001348 }
1349 }
Harald Welte9abd1282018-02-19 19:18:17 +01001350 template RSL_Message tr_RSL_CHAN_ACT_ACK(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001351 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001352 msg_type := RSL_MT_CHAN_ACTIV_ACK,
1353 ies := {
1354 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1355 tr_RSL_IE(RSL_IE_Body:{frame_nr := ?})
1356 }
1357 }
Harald Welte643e2a62017-11-27 15:03:18 +01001358
1359 /* 8.4.3 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001360 template (value) RSL_Message ts_RSL_CHAN_ACT_NACK(template (value) RslChannelNr chan_nr,
1361 RSL_Cause cause) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001362 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1363 msg_type := RSL_MT_CHAN_ACTIV_NACK,
1364 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001365 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1366 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
Harald Welte643e2a62017-11-27 15:03:18 +01001367 }
1368 }
Harald Welte9abd1282018-02-19 19:18:17 +01001369 template RSL_Message tr_RSL_CHAN_ACT_NACK(template RslChannelNr chan_nr,
1370 template RSL_Cause cause := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001371 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001372 msg_type := RSL_MT_CHAN_ACTIV_NACK,
1373 ies := {
1374 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1375 tr_RSL_IE(RSL_IE_Body:{cause := ?})
1376 }
1377 }
Harald Welte643e2a62017-11-27 15:03:18 +01001378
1379 /* 8.4.4 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001380 template (value) RSL_Message ts_RSL_CONN_FAIL_IND(RslChannelNr chan_nr, RSL_Cause cause) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001381 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1382 msg_type := RSL_MT_CONN_FAIL,
1383 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001384 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1385 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
Harald Welte643e2a62017-11-27 15:03:18 +01001386 }
1387 }
Harald Welte9abd1282018-02-19 19:18:17 +01001388 template RSL_Message tr_RSL_CONN_FAIL_IND(template RslChannelNr chan_nr,
1389 template RSL_Cause cause := ?) := {
1390 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1391 msg_type := RSL_MT_CONN_FAIL,
1392 ies :={
1393 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1394 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
1395 }
1396 }
Harald Welte643e2a62017-11-27 15:03:18 +01001397
Harald Weltee8a5ab12017-12-09 22:34:57 +01001398 /* 8.4.5 BSC -> BTS */
1399 template RSL_Message tr_RSL_DEACT_SACCH(template RslChannelNr chan_nr) := {
1400 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1401 msg_type := RSL_MT_DEACTIVATE_SACCH,
1402 ies := {
1403 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
1404 }
1405 }
Harald Welteefa7d912018-04-18 23:22:15 +02001406 template (value) RSL_Message ts_RSL_DEACT_SACCH(template (value) RslChannelNr chan_nr) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001407 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1408 msg_type := RSL_MT_DEACTIVATE_SACCH,
1409 ies := {
1410 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1411 }
1412 }
1413
Harald Weltee8a5ab12017-12-09 22:34:57 +01001414
Harald Welte73cd2712017-12-17 00:44:52 +01001415 /* 8.4.6 BSC ->BTS */
1416 template RSL_Message tr_RSL_ENCR_CMD(template RslChannelNr chan_nr,
1417 template RslLinkId link_id := ?,
Harald Weltee613f962018-04-18 22:38:16 +02001418 template RSL_AlgId alg := ?,
Harald Welte73cd2712017-12-17 00:44:52 +01001419 template octetstring key := ?,
1420 template octetstring l3_info := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001421 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte73cd2712017-12-17 00:44:52 +01001422 msg_type := RSL_MT_ENCR_CMD,
1423 ies := {
1424 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1425 tr_RSL_IE(RSL_IE_Body:{encr_info := tr_RSL_IE_EncrInfo(alg, key)}),
1426 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
1427 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
1428 }
1429 }
Harald Welteefa7d912018-04-18 23:22:15 +02001430 template (value) RSL_Message ts_RSL_ENCR_CMD(template (value) RslChannelNr chan_nr,
1431 template (value) RslLinkId link_id,
Harald Weltee613f962018-04-18 22:38:16 +02001432 template (value) RSL_AlgId alg, octetstring key,
Harald Welteefa7d912018-04-18 23:22:15 +02001433 octetstring l3_info) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001434 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1435 msg_type := RSL_MT_ENCR_CMD,
1436 ies := {
1437 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
Harald Welteefa7d912018-04-18 23:22:15 +02001438 t_RSL_IE(RSL_IE_ENCR_INFO, RSL_IE_Body:{encr_info := ts_RSL_IE_EncrInfo(alg, key)}),
Harald Welte9abd1282018-02-19 19:18:17 +01001439 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
Harald Welteefa7d912018-04-18 23:22:15 +02001440 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
Harald Welte9abd1282018-02-19 19:18:17 +01001441 }
1442 }
Harald Welte73cd2712017-12-17 00:44:52 +01001443
Harald Welte2691adf2018-02-22 17:32:39 +01001444 template RSL_Message tr_RSL_MEAS_RES(template RslChannelNr chan_nr,
1445 template uint8_t meas_res_nr := ?,
1446 template RSL_IE_UplinkMeas ul_meas := ?,
1447 template RSL_IE_BS_Power bs_power := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001448 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte2691adf2018-02-22 17:32:39 +01001449 msg_type := RSL_MT_MEAS_RES,
1450 ies := {
1451 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1452 tr_RSL_IE(RSL_IE_Body:{meas_res_nr := meas_res_nr}),
1453 tr_RSL_IE(RSL_IE_Body:{uplink_meas := ul_meas}),
1454 tr_RSL_IE(RSL_IE_Body:{bs_power := bs_power}),
1455 *
1456 }
1457 }
1458
Philipp Maierdd841d32019-12-17 14:44:54 +01001459 /* Receive template for a measurement report that lacks the measurement report
1460 * from the MS (l1_info, l3_info and ms timing offset */
1461 template RSL_Message tr_RSL_MEAS_RES_EMPTY(template RslChannelNr chan_nr,
1462 template uint8_t meas_res_nr := ?,
1463 template RSL_IE_UplinkMeas ul_meas := ?,
1464 template RSL_IE_BS_Power bs_power := ?) := {
1465 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1466 msg_type := RSL_MT_MEAS_RES,
1467 ies := {
1468 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1469 tr_RSL_IE(RSL_IE_Body:{meas_res_nr := meas_res_nr}),
1470 tr_RSL_IE(RSL_IE_Body:{uplink_meas := ul_meas}),
1471 tr_RSL_IE(RSL_IE_Body:{bs_power := bs_power})
1472 }
1473 }
1474
Harald Welte39b47be2018-02-23 18:58:48 +01001475 /* Osmocom specific template, require lots of optional fields to be present */
1476 template RSL_Message tr_RSL_MEAS_RES_OSMO(template RslChannelNr chan_nr,
1477 template uint8_t meas_res_nr := ?,
1478 template RSL_IE_UplinkMeas ul_meas := ?,
1479 template RSL_IE_BS_Power bs_power := ?,
1480 template RSL_IE_L1Info l1_info := ?,
1481 template octetstring l3_info := ?,
1482 template uint8_t ms_to := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001483 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte39b47be2018-02-23 18:58:48 +01001484 msg_type := RSL_MT_MEAS_RES,
1485 ies := {
1486 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1487 tr_RSL_IE(RSL_IE_Body:{meas_res_nr := meas_res_nr}),
1488 tr_RSL_IE(RSL_IE_Body:{uplink_meas := ul_meas}),
1489 tr_RSL_IE(RSL_IE_Body:{bs_power := bs_power}),
1490 tr_RSL_IE(RSL_IE_Body:{l1_info := l1_info}),
1491 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)}),
1492 tr_RSL_IE(RSL_IE_Body:{ms_timing_offset := ms_to})
1493 }
1494 }
1495
Eric Wildf1827a72019-05-28 17:37:35 +02001496 /* 8.4.9 BSC -> BTS */
1497 template (value) RSL_Message ts_RSL_MODE_MODIFY_REQ(template (value) RslChannelNr chan_nr,
1498 template (value) RSL_IE_ChannelMode mode) := {
1499 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1500 msg_type := RSL_MT_MODE_MODIFY_REQ,
1501 ies :={
1502 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1503 t_RSL_IE(RSL_IE_CHAN_MODE, RSL_IE_Body:{chan_mode := mode})
1504 /* lots of optional IEs */
1505 }
1506 }
1507 template RSL_Message tr_RSL_MODE_MODIFY_REQ(template RslChannelNr chan_nr,
1508 template RSL_IE_ChannelMode mode) := {
1509 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1510 msg_type := RSL_MT_MODE_MODIFY_REQ,
1511 ies :={
1512 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1513 tr_RSL_IE(RSL_IE_Body:{chan_mode := mode}),
1514 /* lots of optional IEs */
1515 *
1516 }
1517 }
1518
Harald Welte7794d5b2017-12-16 23:00:20 +01001519 /* 8.4.10 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001520 template (value) RSL_Message ts_RSL_MODE_MODIFY_ACK(template (value) RslChannelNr chan_nr) := {
Harald Welte7794d5b2017-12-16 23:00:20 +01001521 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1522 msg_type := RSL_MT_MODE_MODIFY_ACK,
1523 ies := {
1524 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1525 }
1526 }
Harald Welte9abd1282018-02-19 19:18:17 +01001527 template RSL_Message tr_RSL_MODE_MODIFY_ACK(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001528 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001529 msg_type := RSL_MT_MODE_MODIFY_ACK,
1530 ies := {
1531 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
1532 }
1533 }
Harald Welte7794d5b2017-12-16 23:00:20 +01001534
Harald Welte643e2a62017-11-27 15:03:18 +01001535 /* 8.4.11 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001536 template (value) RSL_Message ts_RSL_MODE_MODIFY_NACK(template (value) RslChannelNr chan_nr,
1537 RSL_Cause cause) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001538 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1539 msg_type := RSL_MT_MODE_MODIFY_NACK,
1540 ies := {
1541 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1542 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
1543 }
Harald Welte643e2a62017-11-27 15:03:18 +01001544 }
Harald Welte9abd1282018-02-19 19:18:17 +01001545 template RSL_Message tr_RSL_MODE_MODIFY_NACK(template RslChannelNr chan_nr,
1546 template RSL_Cause cause) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001547 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001548 msg_type := RSL_MT_MODE_MODIFY_NACK,
1549 ies := {
1550 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1551 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
1552 }
1553 }
1554
Harald Welte643e2a62017-11-27 15:03:18 +01001555
Harald Welte6a8199d2018-01-29 21:58:53 +01001556 /* 8.4.14: BTS <- BSC */
1557 template RSL_Message tr_RSL_RF_CHAN_REL(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001558 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte6a8199d2018-01-29 21:58:53 +01001559 msg_type := RSL_MT_RF_CHAN_REL,
1560 ies := {
1561 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
1562 }
1563 }
Harald Welteefa7d912018-04-18 23:22:15 +02001564 template (value) RSL_Message ts_RSL_RF_CHAN_REL(template (value) RslChannelNr chan_nr) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001565 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1566 msg_type := RSL_MT_RF_CHAN_REL,
1567 ies := {
1568 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1569 }
1570 }
Harald Welte6a8199d2018-01-29 21:58:53 +01001571
Philipp Maier4d1e9c92018-12-20 11:11:56 +01001572 /* 8.4.15: BTS <- BSC */
1573 template (value) RSL_Message ts_RSL_MS_PWR_CTRL(template (value) RslChannelNr chan_nr,
1574 template (value) RSL_IE_MS_Power ms_power) := {
1575 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1576 msg_type := RSL_MT_MS_POWER_CONTROL,
1577 ies := {
1578 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1579 t_RSL_IE(RSL_IE_MS_POWER, RSL_IE_Body:{ms_power := ms_power})
1580 /* One optional IE: MS POWER PARAMETERS */
1581 }
1582 }
1583
Eric Wild61edb7e2019-06-03 12:38:31 +02001584 template (value) RSL_Message ts_RSL_MS_PWR_CTRL_with_pp(template (value) RslChannelNr chan_nr,
1585 integer pwr_level) := {
1586 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1587 msg_type := RSL_MT_MS_POWER_CONTROL,
1588 ies := {
1589 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1590 t_RSL_IE(RSL_IE_MS_POWER, RSL_IE_Body:{ms_power := ts_RSL_IE_MS_Power(pwr_level)}),
1591 t_RSL_IE(RSL_IE_MS_POWER_PARAM, RSL_IE_Body:{ms_power_params :=
1592 ts_RSL_IE_MS_Power_Parameters(''O)})
1593 }
1594 }
1595
Eric Wildae8f2622019-06-18 17:05:11 +02001596 /* 8.4.16: BTS <- BSC */
1597 template (value) RSL_Message ts_RSL_BS_PWR_CTRL(template (value) RslChannelNr chan_nr,
1598 template (value) RSL_IE_BS_Power bs_power) := {
1599 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1600 msg_type := RSL_MT_BS_POWER_CONTROL,
1601 ies := {
1602 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1603 t_RSL_IE(RSL_IE_BS_POWER, RSL_IE_Body:{bs_power := bs_power})
1604 /* One optional IE: BS POWER PARAMETERS */
1605 }
1606 }
1607
Harald Welte4a267362017-12-09 17:49:32 +01001608 /* 8.4.19 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001609 template (value) RSL_Message ts_RSL_RF_CHAN_REL_ACK(template (value) RslChannelNr chan_nr) :=
Harald Welte4a267362017-12-09 17:49:32 +01001610 ts_RSL_MsgDiscType(ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1611 RSL_MT_RF_CHAN_REL_ACK,
Harald Welte735dd072017-12-12 14:55:17 +01001612 { t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}) });
Harald Welte4a267362017-12-09 17:49:32 +01001613
Harald Welte9abd1282018-02-19 19:18:17 +01001614 template RSL_Message tr_RSL_RF_CHAN_REL_ACK(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001615 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001616 msg_type := RSL_MT_RF_CHAN_REL_ACK,
1617 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001618 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
Harald Welte9abd1282018-02-19 19:18:17 +01001619 }
1620 }
1621
Harald Welteea17b912018-03-11 22:29:31 +01001622 /* 8.6.20 BTS <- BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001623 template (value) RSL_Message ts_RSL_SACCH_INF_MOD(template (value) RslChannelNr chan_nr,
1624 RSL_IE_SysinfoType si_type,
1625 octetstring l3_info) := {
Harald Welteea17b912018-03-11 22:29:31 +01001626 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1627 msg_type := RSL_MT_SACCH_INFO_MODIFY,
1628 ies := {
1629 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1630 t_RSL_IE(RSL_IE_SYSINFO_TYPE, RSL_IE_Body:{sysinfo_type := si_type}),
1631 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
1632 }
1633 }
1634
Neels Hofmeyr378a49c2018-06-15 22:18:43 +02001635 /* 8.4.7 BTS -> BSC */
1636 template (value) RSL_Message ts_RSL_HANDO_DET(template (value) RslChannelNr chan_nr) := {
1637 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1638 msg_type := RSL_MT_HANDO_DET,
1639 ies := {
1640 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1641 }
1642 }
Vadim Yanitskiy7c2c10c2019-05-31 20:42:01 +07001643 template RSL_Message tr_RSL_HANDO_DET(template RslChannelNr chan_nr,
1644 template uint8_t acc_delay := ?) := {
1645 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1646 msg_type := RSL_MT_HANDO_DET,
1647 ies := {
1648 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1649 tr_RSL_IE(RSL_IE_Body:{access_delay := acc_delay})
1650 }
1651 }
Neels Hofmeyr378a49c2018-06-15 22:18:43 +02001652
Harald Welteea17b912018-03-11 22:29:31 +01001653
Harald Welte643e2a62017-11-27 15:03:18 +01001654 /* COMMON CHANNEL MANAGEMENT MESSAGES */
1655
Harald Welte874c2232018-02-24 04:52:43 +01001656 /* 8.5.1 BTS <- BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001657 template (value) RSL_Message ts_RSL_BCCH_INFO(RSL_IE_SysinfoType si_type,
1658 octetstring full_bcch_info) := {
Harald Welte874c2232018-02-24 04:52:43 +01001659 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1660 msg_type := RSL_MT_BCCH_INFO,
1661 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001662 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_BCCH(0)}),
Harald Welte874c2232018-02-24 04:52:43 +01001663 t_RSL_IE(RSL_IE_SYSINFO_TYPE, RSL_IE_Body:{sysinfo_type := si_type}),
1664 t_RSL_IE(RSL_IE_FULL_BCCH_INFO, RSL_IE_Body:{other := ts_RSL_LV(full_bcch_info)})
1665 }
1666 }
Harald Welte09538f82019-08-01 09:50:25 +02001667 template RSL_Message tr_RSL_NO_BCCH_INFO(template RSL_IE_SysinfoType si_type := ?) := {
1668 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1669 msg_type := RSL_MT_BCCH_INFO,
1670 ies := {
1671 tr_RSL_IE(RSL_IE_Body:{chan_nr := ts_RslChanNr_BCCH(0)}),
1672 tr_RSL_IE(RSL_IE_Body:{sysinfo_type := si_type})
1673 }
1674 }
1675 template RSL_Message tr_RSL_BCCH_INFO(template RSL_IE_SysinfoType si_type := ?,
1676 template octetstring full_bcch_info := ?) := {
1677 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1678 msg_type := RSL_MT_BCCH_INFO,
1679 ies := {
1680 tr_RSL_IE(RSL_IE_Body:{chan_nr := ts_RslChanNr_BCCH(0)}),
1681 tr_RSL_IE(RSL_IE_Body:{sysinfo_type := si_type}),
1682 tr_RSL_IE(RSL_IE_Body:{other := tr_RSL_LV(full_bcch_info)}),
1683 *
1684 }
1685 }
Harald Welte874c2232018-02-24 04:52:43 +01001686
Harald Welte7ae93142017-12-07 17:56:15 +01001687 /* 8.5.2 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001688 template (value) RSL_Message ts_RSL_RACH_LOAD_IND(uint16_t slot_ct, uint16_t busy_ct,
1689 uint16_t acc_ct) := {
Harald Welte7ae93142017-12-07 17:56:15 +01001690 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1691 msg_type := RSL_MT_CCCH_LOAD_IND,
1692 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001693 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_RACH(0)}),
Harald Welte735dd072017-12-12 14:55:17 +01001694 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 +01001695 }
1696 }
Harald Welte68e495b2018-02-25 00:05:57 +01001697 template RSL_Message tr_RSL_RACH_LOAD_IND(template uint16_t slot_ct := ?,
1698 template uint16_t busy_ct := ?,
Harald Welte09538f82019-08-01 09:50:25 +02001699 template uint16_t acc_ct := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001700 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Welte68e495b2018-02-25 00:05:57 +01001701 msg_type := RSL_MT_CCCH_LOAD_IND,
1702 ies := {
1703 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_RACH(0)}),
1704 tr_RSL_IE(RSL_IE_Body:{rach_load := tr_RSL_IE_RachLoad(slot_ct, busy_ct, acc_ct)})
1705 }
1706 }
1707
Harald Welteefa7d912018-04-18 23:22:15 +02001708 template (value) RSL_Message ts_RSL_PAGING_LOAD_IND(uint16_t buffer_space) := {
Harald Welte7ae93142017-12-07 17:56:15 +01001709 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1710 msg_type := RSL_MT_CCCH_LOAD_IND,
1711 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001712 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_PCH_AGCH(0)}),
Harald Welte735dd072017-12-12 14:55:17 +01001713 t_RSL_IE(RSL_IE_PAGING_LOAD, RSL_IE_Body:{paging_load := buffer_space})
Harald Welte7ae93142017-12-07 17:56:15 +01001714 }
1715 }
Harald Welte68e495b2018-02-25 00:05:57 +01001716 template RSL_Message tr_RSL_PAGING_LOAD_IND(template uint16_t buffer_space := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001717 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Welte68e495b2018-02-25 00:05:57 +01001718 msg_type := RSL_MT_CCCH_LOAD_IND,
1719 ies := {
1720 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(0)}),
1721 tr_RSL_IE(RSL_IE_Body:{paging_load := buffer_space})
1722 }
1723 }
1724
Harald Welte7ae93142017-12-07 17:56:15 +01001725
Harald Welte643e2a62017-11-27 15:03:18 +01001726 /* 8.5.3 BTS -> BSC */
Vadim Yanitskiyab448a52019-05-31 20:24:03 +07001727 template (value) RSL_Message ts_RSL_CHAN_RQD(OCT1 ra, GsmFrameNumber fn,
1728 template (value) RslChannelNr chan_nr := ts_RslChanNr_RACH(0),
1729 uint8_t acc_del := 0) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001730 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1731 msg_type := RSL_MT_CHAN_RQD,
1732 ies := {
Vadim Yanitskiyab448a52019-05-31 20:24:03 +07001733 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1734 /* TODO: we may need to have optional RSL_IE_LINK_IDENT IE here */
Harald Welte735dd072017-12-12 14:55:17 +01001735 t_RSL_IE(RSL_IE_REQ_REFERENCE, RSL_IE_Body:{req_ref := ts_RSL_IE_ReqRef(ra, fn)}),
1736 t_RSL_IE(RSL_IE_ACCESS_DELAY, RSL_IE_Body:{access_delay := acc_del})
Harald Welte643e2a62017-11-27 15:03:18 +01001737 }
1738 }
Harald Welte9abd1282018-02-19 19:18:17 +01001739 template RSL_Message tr_RSL_CHAN_RQD(template OCT1 ra, template GsmFrameNumber fn := ?,
Vadim Yanitskiyab448a52019-05-31 20:24:03 +07001740 template RslChannelNr chan_nr := ts_RslChanNr_RACH(0),
1741 template uint8_t acc_del := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001742 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001743 msg_type := RSL_MT_CHAN_RQD,
1744 ies := {
Vadim Yanitskiyab448a52019-05-31 20:24:03 +07001745 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1746 /* TODO: we may need to have optional RSL_IE_LINK_IDENT IE here */
Harald Welte9abd1282018-02-19 19:18:17 +01001747 tr_RSL_IE(RSL_IE_Body:{req_ref := tr_RSL_IE_ReqRef(ra, fn)}),
1748 tr_RSL_IE(RSL_IE_Body:{access_delay := acc_del})
1749 }
1750 }
Harald Welte643e2a62017-11-27 15:03:18 +01001751
1752 /* 8.5.4 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001753 template (value) RSL_Message ts_DELETE_IND(template (value) RslChannelNr chan_nr,
1754 octetstring imm_ass) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001755 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1756 msg_type := RSL_MT_DELETE_IND,
1757 ies := {
Harald Welte735dd072017-12-12 14:55:17 +01001758 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1759 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 +01001760 }
1761 }
Harald Weltee8d750e2018-06-10 21:41:35 +02001762 template RSL_Message tr_RSL_DELETE_IND(template octetstring imm_ass := ?, template uint3_t tn) := {
1763 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1764 msg_type := RSL_MT_DELETE_IND,
1765 ies := {
1766 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(tn)}),
1767 tr_RSL_IE(RSL_IE_Body:{full_imm_ass_info := tr_RSL_LV(imm_ass)}),
1768 *
1769 }
1770 }
Harald Welte643e2a62017-11-27 15:03:18 +01001771
Harald Weltec2877752017-12-07 17:54:35 +01001772 /* 8.5.5 BSC -> BTS */
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +07001773 template RSL_Message tr_RSL_PAGING_CMD(template MobileIdentityV mi, template uint3_t tn := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001774 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Weltec2877752017-12-07 17:54:35 +01001775 msg_type := RSL_MT_PAGING_CMD,
1776 ies := {
1777 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(tn)}),
1778 tr_RSL_IE(RSL_IE_Body:{paging_group := ?}),
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +07001779 tr_RSL_IE(RSL_IE_Body:{ms_identity := tr_MI_LV(mi)}),
Harald Weltec2877752017-12-07 17:54:35 +01001780 * /* opt: channel needed, eMLPP prio */
1781 }
1782 }
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +07001783 template (value) RSL_Message ts_RSL_PAGING_CMD(MobileIdentityV mi, uint8_t pg, uint3_t tn := 0) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001784 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1785 msg_type := RSL_MT_PAGING_CMD,
1786 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001787 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_PCH_AGCH(tn)}),
Harald Welte9abd1282018-02-19 19:18:17 +01001788 t_RSL_IE(RSL_IE_PAGING_GROUP, RSL_IE_Body:{paging_group := pg}),
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +07001789 t_RSL_IE(RSL_IE_MS_IDENTITY, RSL_IE_Body:{ms_identity := ts_MI_LV(mi)})
Harald Welte9abd1282018-02-19 19:18:17 +01001790 }
1791 }
Harald Weltec2877752017-12-07 17:54:35 +01001792
1793 /* 8.5.6 BSC -> BTS */
1794 template RSL_Message tr_RSL_IMM_ASSIGN(template uint3_t tn := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001795 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Weltec2877752017-12-07 17:54:35 +01001796 msg_type := RSL_MT_IMMEDIATE_ASSIGN_CMD,
1797 ies := {
1798 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(tn)}),
1799 tr_RSL_IE(RSL_IE_Body:{full_imm_ass_info := ?})
1800 }
1801 }
Harald Welteefa7d912018-04-18 23:22:15 +02001802 template (value) RSL_Message ts_RSL_IMM_ASSIGN(octetstring f_ass_inf, uint3_t tn := 0) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001803 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1804 msg_type := RSL_MT_IMMEDIATE_ASSIGN_CMD,
1805 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001806 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_PCH_AGCH(tn)}),
Harald Welte9abd1282018-02-19 19:18:17 +01001807 t_RSL_IE(RSL_IE_FULL_IMM_ASS_INFO, RSL_IE_Body:{full_imm_ass_info := ts_RSL_LV(f_ass_inf)})
1808 }
1809 }
Harald Weltec2877752017-12-07 17:54:35 +01001810
Harald Weltecc373202018-09-10 10:28:21 +02001811 /* 8.5.8 BTS <- BSC SMS BROADCAST COMMAND */
1812 template RSL_Message tr_RSL_SMSCB_CMD(template RSL_IE_CbCommandType cb_cmd := ?,
1813 template octetstring msg := ?,
1814 template RslChannelNr chan_nr := ?) := {
1815 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1816 msg_type := RSL_MT_SMS_BC_CMD,
1817 ies := {
1818 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1819 tr_RSL_IE(RSL_IE_Body:{cb_cmd_type := cb_cmd}),
1820 tr_RSL_IE(RSL_IE_Body:{smscb_message := tr_RSL_LV(msg)}),
1821 *
1822 }
1823 }
1824 template (value) RSL_Message ts_RSL_SMSCB_CMD(template (value) RSL_IE_CbCommandType cb_cmd,
1825 template (value) octetstring msg,
1826 template (value) RslChannelNr chan_nr :=
1827 ts_RslChanNr_SDCCH4(0, 2)) := {
1828 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1829 msg_type := RSL_MT_SMS_BC_CMD,
1830 ies := {
1831 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1832 t_RSL_IE(RSL_IE_CB_CMD_TYPE, RSL_IE_Body:{cb_cmd_type := cb_cmd}),
1833 t_RSL_IE(RSL_IE_SMSCB_MSG, RSL_IE_Body:{smscb_message := ts_RSL_LV(msg)})
1834 /* optional channel type for extended CBCH */
1835 }
1836 }
1837
Harald Welte4a129f82019-05-21 16:35:22 +02001838 /* 8.5.9 BTS -> BSC CBCH LOAD INDICATION */
1839 template RSL_Message tr_RSL_CBCH_LOAD_IND_BASIC(template boolean overflow := ?,
1840 template uint4_t slot_count := ?,
1841 template RslChannelNr chan_nr := ?) := {
1842 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1843 msg_type := RSL_MT_CBCH_LOAD_IND,
1844 ies := {
1845 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1846 tr_RSL_IE(RSL_IE_Body:{cbch_load_info := tr_CbchLoadInfo(overflow, slot_count)})
1847 }
1848 }
1849 template (value) RSL_Message ts_RSL_CBCH_LOAD_IND_BASIC(boolean overflow, uint4_t slot_count,
1850 template (value) RslChannelNr chan_nr :=
1851 ts_RslChanNr_SDCCH4(0, 2)) := {
1852 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1853 msg_type := RSL_MT_CBCH_LOAD_IND,
1854 ies := {
1855 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1856 t_RSL_IE(RSL_IE_CBCH_LOAD_INFO, RSL_IE_Body:{cbch_load_info := ts_CbchLoadInfo(overflow, slot_count)})
1857 }
1858 }
1859 template RSL_Message tr_RSL_CBCH_LOAD_IND_EXTD(template boolean overflow := ?,
1860 template uint4_t slot_count := ?,
1861 template RslChannelNr chan_nr := ?) := {
1862 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1863 msg_type := RSL_MT_CBCH_LOAD_IND,
1864 ies := {
1865 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1866 tr_RSL_IE(RSL_IE_Body:{cbch_load_info := tr_CbchLoadInfo(overflow, slot_count)}),
1867 tr_RSL_IE(RSL_IE_Body:{smscb_chan_ind := 1})
1868 }
1869 }
1870 template (value) RSL_Message ts_RSL_CBCH_LOAD_IND_EXTD(boolean overflow, uint4_t slot_count,
1871 template (value) RslChannelNr chan_nr :=
1872 ts_RslChanNr_SDCCH4(0, 2)) := {
1873 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1874 msg_type := RSL_MT_CBCH_LOAD_IND,
1875 ies := {
1876 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1877 t_RSL_IE(RSL_IE_CBCH_LOAD_INFO, RSL_IE_Body:{cbch_load_info := ts_CbchLoadInfo(overflow, slot_count)}),
1878 t_RSL_IE(RSL_IE_SMSCB_CHAN_INDICATOR, RSL_IE_Body:{smscb_chan_ind := 1})
1879 }
1880 }
1881
1882
Vadim Yanitskiy9f699532021-06-03 17:29:22 +02001883 /* 8.6.1 BTS -> BSC */
1884 template (value) RSL_Message
1885 ts_RSL_RF_RES_IND(template (value) RSL_ResourceInfo info) := {
1886 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
1887 msg_type := RSL_MT_RF_RES_IND,
1888 ies := {
1889 t_RSL_IE(RSL_IE_RESOURCE_INFO, RSL_IE_Body:{
1890 resource_info := {
1891 len := 0, /* overwritten */
1892 info := info
1893 }
1894 })
1895 }
1896 }
1897 template RSL_Message
1898 tr_RSL_RF_RES_IND(template (present) RSL_ResourceInfo info := ?) := {
1899 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
1900 msg_type := RSL_MT_RF_RES_IND,
1901 ies := {
1902 tr_RSL_IE(RSL_IE_Body:{
1903 resource_info := {
1904 len := ?,
1905 info := info
1906 }
1907 })
1908 }
1909 }
1910
1911
Harald Welte68e495b2018-02-25 00:05:57 +01001912 /* 8.6.2 BTS <- BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001913 template (value) RSL_Message ts_RSL_SACCH_FILL(RSL_IE_SysinfoType si_type, octetstring l3_info) := {
Harald Welte68e495b2018-02-25 00:05:57 +01001914 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
1915 msg_type := RSL_MT_SACCH_FILL,
1916 ies := {
1917 t_RSL_IE(RSL_IE_SYSINFO_TYPE, RSL_IE_Body:{sysinfo_type := si_type}),
1918 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
1919 }
1920 }
Harald Welte09538f82019-08-01 09:50:25 +02001921 template RSL_Message tr_RSL_NO_SACCH_FILL(template RSL_IE_SysinfoType si_type := ?) := {
1922 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
1923 msg_type := RSL_MT_SACCH_FILL,
1924 ies := {
1925 tr_RSL_IE(RSL_IE_Body:{sysinfo_type := si_type})
1926 }
1927 }
1928 template RSL_Message tr_RSL_SACCH_FILL(template RSL_IE_SysinfoType si_type := ?,
1929 template octetstring l3_info := ?) := {
1930 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
1931 msg_type := RSL_MT_SACCH_FILL,
1932 ies := {
1933 tr_RSL_IE(RSL_IE_Body:{sysinfo_type := si_type}),
1934 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)}),
1935 *
1936 }
1937 }
1938
Harald Welte68e495b2018-02-25 00:05:57 +01001939
Harald Welte643e2a62017-11-27 15:03:18 +01001940 /* 8.6.4 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001941 template (value) RSL_Message ts_RSL_ERROR_REPORT(RSL_Cause cause) := {
Harald Welte01d982c2018-02-25 01:31:40 +01001942 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
1943 msg_type := RSL_MT_ERROR_REPORT,
Harald Welte643e2a62017-11-27 15:03:18 +01001944 ies := {
Harald Welte735dd072017-12-12 14:55:17 +01001945 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
Harald Welte643e2a62017-11-27 15:03:18 +01001946 }
1947 }
Harald Welte01d982c2018-02-25 01:31:40 +01001948 template RSL_Message tr_RSL_ERROR_REPORT(template RSL_Cause cause := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001949 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
Harald Welte01d982c2018-02-25 01:31:40 +01001950 msg_type := RSL_MT_ERROR_REPORT,
1951 ies := {
1952 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)}),
1953 *
1954 }
1955 }
1956
Harald Welte643e2a62017-11-27 15:03:18 +01001957
Harald Welte9958a4d2017-12-14 21:21:33 +01001958
1959 /* Abis/IP specific messages */
1960
1961 template RSL_Message tr_RSL_IPA_CRCX(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001962 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01001963 msg_type := RSL_MT_IPAC_CRCX,
1964 ies := {
1965 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1966 *
1967 }
1968 }
Harald Welteefa7d912018-04-18 23:22:15 +02001969 template (value) RSL_Message ts_RSL_IPA_CRCX(template (value) RslChannelNr chan_nr) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001970 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
1971 msg_type := RSL_MT_IPAC_CRCX,
1972 ies := {
1973 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1974 }
1975 }
1976
Harald Welte9958a4d2017-12-14 21:21:33 +01001977
Harald Welteefa7d912018-04-18 23:22:15 +02001978 template (value) RSL_Message ts_RSL_IPA_CRCX_ACK(template (value) RslChannelNr chan_nr,
1979 uint16_t ipa_conn_id, uint32_t local_ip,
1980 uint16_t local_port, uint7_t rtp_pt2) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01001981 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
1982 msg_type := RSL_MT_IPAC_CRCX_ACK,
1983 ies := {
1984 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1985 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
1986 t_RSL_IE(RSL_IE_IPAC_LOCAL_IP, RSL_IE_Body:{ipa_local_ip := local_ip}),
1987 t_RSL_IE(RSL_IE_IPAC_LOCAL_PORT, RSL_IE_Body:{ipa_local_port := local_port}),
1988 t_RSL_IE(RSL_IE_IPAC_RTP_PAYLOAD2, RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
1989 }
1990 }
Harald Welte9abd1282018-02-19 19:18:17 +01001991 template RSL_Message tr_RSL_IPA_CRCX_ACK(template RslChannelNr chan_nr,
1992 template uint16_t ipa_conn_id,
1993 template uint32_t local_ip,
Harald Welte8bd0f822018-02-25 12:43:28 +01001994 template uint16_t local_port) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001995 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001996 msg_type := RSL_MT_IPAC_CRCX_ACK,
1997 ies := {
1998 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1999 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2000 tr_RSL_IE(RSL_IE_Body:{ipa_local_ip := local_ip}),
Harald Welte8bd0f822018-02-25 12:43:28 +01002001 tr_RSL_IE(RSL_IE_Body:{ipa_local_port := local_port})
2002 /* Optional: RTP Payload Type 2 IE */
Harald Welte9abd1282018-02-19 19:18:17 +01002003 }
2004 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002005
Harald Welteefa7d912018-04-18 23:22:15 +02002006 template (value) RSL_Message ts_RSL_IPA_CRCX_NACK(template (value) RslChannelNr chan_nr,
2007 RSL_Cause cause) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002008 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2009 msg_type := RSL_MT_IPAC_CRCX_NACK,
2010 ies := {
2011 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2012 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2013 }
2014 }
Harald Welte9abd1282018-02-19 19:18:17 +01002015 template RSL_Message tr_RSL_IPA_CRCX_NACK(template RslChannelNr chan_nr,
2016 template RSL_Cause cause := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002017 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9abd1282018-02-19 19:18:17 +01002018 msg_type := RSL_MT_IPAC_CRCX_NACK,
2019 ies := {
2020 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2021 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
2022 }
2023 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002024
Harald Welteefa7d912018-04-18 23:22:15 +02002025 template (value) RSL_Message ts_RSL_IPA_MDCX(template (value) RslChannelNr chan_nr,
2026 uint16_t ipa_conn_id,
2027 uint32_t remote_ip, uint16_t remote_port,
2028 uint7_t rtp_pt2) := {
Harald Welte30527452018-02-25 12:46:25 +01002029 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2030 msg_type := RSL_MT_IPAC_MDCX,
2031 ies := {
2032 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2033 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2034 t_RSL_IE(RSL_IE_IPAC_REMOTE_IP, RSL_IE_Body:{ipa_remote_ip := remote_ip}),
2035 t_RSL_IE(RSL_IE_IPAC_REMOTE_PORT, RSL_IE_Body:{ipa_remote_port := remote_port}),
2036 /* optional: RTP Payload Type */
2037 t_RSL_IE(RSL_IE_IPAC_RTP_PAYLOAD2, RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
2038 }
2039 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002040 template RSL_Message tr_RSL_IPA_MDCX(template RslChannelNr chan_nr,
2041 template uint16_t ipa_conn_id) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002042 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002043 msg_type := RSL_MT_IPAC_MDCX,
2044 ies := {
2045 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2046 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2047 *
2048 }
2049 }
2050
Harald Welteefa7d912018-04-18 23:22:15 +02002051 template (value) RSL_Message ts_RSL_IPA_MDCX_ACK(template (value) RslChannelNr chan_nr,
2052 uint16_t ipa_conn_id,
2053 uint32_t local_ip, uint16_t local_port,
2054 uint7_t rtp_pt2) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002055 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte71b5ec82017-12-16 23:01:10 +01002056 msg_type := RSL_MT_IPAC_MDCX_ACK,
Harald Welte9958a4d2017-12-14 21:21:33 +01002057 ies := {
2058 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2059 /* optional */
2060 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
Harald Welte6cb400a2018-02-25 12:45:25 +01002061 t_RSL_IE(RSL_IE_IPAC_LOCAL_IP, RSL_IE_Body:{ipa_local_ip := local_ip}),
2062 t_RSL_IE(RSL_IE_IPAC_LOCAL_PORT, RSL_IE_Body:{ipa_local_port := local_port}),
Harald Welte9958a4d2017-12-14 21:21:33 +01002063 /* optional: RTP Payload Type */
2064 t_RSL_IE(RSL_IE_IPAC_RTP_PAYLOAD2, RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
2065 }
2066 }
Harald Welte30527452018-02-25 12:46:25 +01002067 template RSL_Message tr_RSL_IPA_MDCX_ACK(template RslChannelNr chan_nr,
2068 template uint16_t ipa_conn_id,
2069 template uint32_t local_ip,
2070 template uint16_t local_port,
2071 template uint7_t rtp_pt2) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002072 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte30527452018-02-25 12:46:25 +01002073 msg_type := RSL_MT_IPAC_MDCX_ACK,
2074 ies := {
2075 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2076 /* optional */
2077 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2078 tr_RSL_IE(RSL_IE_Body:{ipa_local_ip := local_ip}),
2079 tr_RSL_IE(RSL_IE_Body:{ipa_local_port := local_port}),
2080 /* optional: RTP Payload Type */
2081 tr_RSL_IE(RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
2082 }
2083 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002084
Harald Welteefa7d912018-04-18 23:22:15 +02002085 template (value) RSL_Message ts_RSL_IPA_MDCX_NACK(template (value) RslChannelNr chan_nr,
2086 RSL_Cause cause,
2087 template (value) uint16_t ipa_conn_id) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002088 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2089 msg_type := RSL_MT_IPAC_MDCX_NACK,
2090 ies := {
2091 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2092 /* optional connection ID */
2093 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2094 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2095 }
2096 }
Harald Welte30527452018-02-25 12:46:25 +01002097 template RSL_Message tr_RSL_IPA_MDCX_NACK(template RslChannelNr chan_nr,
2098 template RSL_Cause cause,
2099 template uint16_t ipa_conn_id) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002100 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte30527452018-02-25 12:46:25 +01002101 msg_type := RSL_MT_IPAC_MDCX_NACK,
2102 ies := {
2103 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2104 /* optional connection ID */
2105 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2106 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
2107 }
2108 }
2109
Harald Welte9958a4d2017-12-14 21:21:33 +01002110
Harald Welteefa7d912018-04-18 23:22:15 +02002111 template (value) RSL_Message ts_RSL_IPA_DLCX_IND(template (value) RslChannelNr chan_nr,
2112 uint16_t ipa_conn_id,
2113 template (value) RSL_IE_IPA_ConnectionStats stats,
2114 RSL_Cause cause) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002115 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2116 msg_type := RSL_MT_IPAC_DLCX_IND,
2117 ies := {
2118 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2119 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2120 t_RSL_IE(RSL_IE_IPAC_CONN_STAT, RSL_IE_Body:{ipa_stats := stats}),
2121 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2122 }
2123 }
2124
Harald Welteefa7d912018-04-18 23:22:15 +02002125 template (value) RSL_Message ts_RSL_IPA_DLCX(template (value) RslChannelNr chan_nr,
2126 uint16_t ipa_conn_id) := {
Harald Weltea871a382018-02-25 02:03:14 +01002127 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2128 msg_type := RSL_MT_IPAC_DLCX,
2129 ies := {
Harald Welte2a7e7162018-02-25 12:46:48 +01002130 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2131 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id})
Harald Weltea871a382018-02-25 02:03:14 +01002132 }
2133 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002134 template RSL_Message tr_RSL_IPA_DLCX(template RslChannelNr chan_nr,
2135 template uint16_t ipa_conn_id := omit) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002136 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002137 msg_type := RSL_MT_IPAC_DLCX,
2138 ies := {
2139 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2140 /* FIXME: optional conn_id */
2141 *
2142 }
2143 }
2144
Harald Welteefa7d912018-04-18 23:22:15 +02002145 template (value) RSL_Message ts_RSL_IPA_DLCX_ACK(template (value) RslChannelNr chan_nr,
2146 uint16_t ipa_conn_id,
2147 RSL_IE_IPA_ConnectionStats stats) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002148 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2149 msg_type := RSL_MT_IPAC_DLCX_ACK,
2150 ies := {
2151 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2152 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2153 t_RSL_IE(RSL_IE_IPAC_CONN_STAT, RSL_IE_Body:{ipa_stats := stats})
2154 }
2155 }
Harald Weltea871a382018-02-25 02:03:14 +01002156 template RSL_Message tr_RSL_IPA_DLCX_ACK(template RslChannelNr chan_nr,
2157 template uint16_t ipa_conn_id,
2158 template RSL_IE_IPA_ConnectionStats stats) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002159 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Weltea871a382018-02-25 02:03:14 +01002160 msg_type := RSL_MT_IPAC_DLCX_ACK,
2161 ies := {
2162 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2163 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2164 tr_RSL_IE(RSL_IE_Body:{ipa_stats := stats})
2165 }
2166 }
2167
2168
Harald Welte9958a4d2017-12-14 21:21:33 +01002169
Harald Welteefa7d912018-04-18 23:22:15 +02002170 template (value) RSL_Message ts_RSL_IPA_DLCX_NACK(template (value) RslChannelNr chan_nr,
2171 RSL_Cause cause, uint16_t ipa_conn_id) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002172 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2173 msg_type := RSL_MT_IPAC_DLCX_NACK,
2174 ies := {
2175 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2176 /* optional connection ID */
2177 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2178 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2179 }
2180 }
Harald Weltea871a382018-02-25 02:03:14 +01002181 template RSL_Message tr_RSL_IPA_DLCX_NACK(template RslChannelNr chan_nr,
2182 template RSL_Cause cause) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002183 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Weltea871a382018-02-25 02:03:14 +01002184 msg_type := RSL_MT_IPAC_DLCX_NACK,
2185 ies := {
2186 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2187 /* optional connection ID */
2188 *,
2189 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
2190 }
2191 }
2192
Harald Welte9958a4d2017-12-14 21:21:33 +01002193
Harald Welteefa7d912018-04-18 23:22:15 +02002194 template (value) RSL_Message ts_RSL_IPA_PDCH_ACT(RslChannelNr chan_nr) := {
Harald Welteee19c732018-04-05 09:08:26 +02002195 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2196 msg_type := RSL_MT_IPAC_PDCH_ACT,
2197 ies := {
2198 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
2199 }
2200 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002201 template RSL_Message tr_RSL_IPA_PDCH_ACT(template RslChannelNr chan_nr) := {
Harald Welteee19c732018-04-05 09:08:26 +02002202 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002203 msg_type := RSL_MT_IPAC_PDCH_ACT,
2204 ies := {
2205 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
2206 }
2207 }
2208
Harald Welteee19c732018-04-05 09:08:26 +02002209
Harald Welte94e0c342018-04-07 11:33:23 +02002210 template RSL_Message ts_RSL_IPA_PDCH_ACT_ACK(RslChannelNr chan_nr,
2211 template (value) RSL_IE_FrameNumber fn) := {
Harald Welteee19c732018-04-05 09:08:26 +02002212 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002213 msg_type := RSL_MT_IPAC_PDCH_ACT_ACK,
2214 ies := {
2215 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2216 t_RSL_IE(RSL_IE_FRAME_NUMBER, RSL_IE_Body:{frame_nr := fn})
2217 }
2218 }
Harald Welteee19c732018-04-05 09:08:26 +02002219 template RSL_Message tr_RSL_IPA_PDCH_ACT_ACK(template RslChannelNr chan_nr,
2220 template RSL_IE_FrameNumber fn) := {
2221 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2222 msg_type := RSL_MT_IPAC_PDCH_ACT_ACK,
2223 ies := {
2224 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2225 tr_RSL_IE(RSL_IE_Body:{frame_nr := fn})
2226 }
2227 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002228
2229 template RSL_Message ts_RSL_IPA_PDCH_ACT_NACK(RslChannelNr chan_nr, RSL_Cause cause) := {
Harald Welteee19c732018-04-05 09:08:26 +02002230 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002231 msg_type := RSL_MT_IPAC_PDCH_ACT_NACK,
2232 ies := {
2233 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2234 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2235 }
2236 }
Harald Welteee19c732018-04-05 09:08:26 +02002237 template RSL_Message tr_RSL_IPA_PDCH_ACT_NACK(template RslChannelNr chan_nr,
2238 template RSL_Cause cause) := {
2239 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2240 msg_type := RSL_MT_IPAC_PDCH_ACT_NACK,
2241 ies := {
2242 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2243 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
2244 }
2245 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002246
Harald Welteee19c732018-04-05 09:08:26 +02002247 template RSL_Message ts_RSL_IPA_PDCH_DEACT(RslChannelNr chan_nr) := {
2248 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2249 msg_type := RSL_MT_IPAC_PDCH_DEACT,
2250 ies := {
2251 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
2252 }
2253 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002254 template RSL_Message tr_RSL_IPA_PDCH_DEACT(template RslChannelNr chan_nr) := {
Harald Welteee19c732018-04-05 09:08:26 +02002255 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002256 msg_type := RSL_MT_IPAC_PDCH_DEACT,
2257 ies := {
2258 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
2259 }
2260 }
2261
2262 template RSL_Message ts_RSL_IPA_PDCH_DEACT_ACK(RslChannelNr chan_nr) := {
Harald Welteee19c732018-04-05 09:08:26 +02002263 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002264 msg_type := RSL_MT_IPAC_PDCH_DEACT_ACK,
2265 ies := {
2266 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
2267 }
2268 }
Harald Welteee19c732018-04-05 09:08:26 +02002269 template RSL_Message tr_RSL_IPA_PDCH_DEACT_ACK(template RslChannelNr chan_nr) := {
2270 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2271 msg_type := RSL_MT_IPAC_PDCH_DEACT_ACK,
2272 ies := {
2273 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
2274 }
2275 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002276
2277 template RSL_Message ts_RSL_IPA_PDCH_DEACT_NACK(RslChannelNr chan_nr, RSL_Cause cause) := {
Harald Welteee19c732018-04-05 09:08:26 +02002278 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002279 msg_type := RSL_MT_IPAC_PDCH_DEACT_NACK,
2280 ies := {
2281 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2282 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2283 }
2284 }
Harald Welteee19c732018-04-05 09:08:26 +02002285 template RSL_Message tr_RSL_IPA_PDCH_DEACT_NACK(template RslChannelNr chan_nr,
2286 template RSL_Cause cause) := {
2287 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2288 msg_type := RSL_MT_IPAC_PDCH_DEACT_NACK,
2289 ies := {
2290 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2291 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
2292 }
2293 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002294
Harald Welte908ce542019-09-04 23:05:40 +02002295 template (value) RSL_Message ts_RSL_OSMO_ETWS_CMD(template (value) octetstring msg,
2296 template (value) RslChannelNr chan_nr := ts_RslChanNr_PCH_AGCH(0)) := {
2297 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2298 msg_type := RSL_MT_OSMO_ETWS_CMD,
2299 ies := {
2300 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2301 t_RSL_IE(RSL_IE_SMSCB_MSG, RSL_IE_Body:{smscb_message := ts_RSL_LV(msg)})
2302 }
2303 }
2304 template RSL_Message tr_RSL_OSMO_ETWS_CMD(template RslChannelNr chan_nr := ?,
2305 template octetstring msg := ?) := {
2306 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2307 msg_type := RSL_MT_OSMO_ETWS_CMD,
2308 ies := {
2309 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2310 tr_RSL_IE(RSL_IE_Body:{smscb_message := tr_RSL_LV(msg)})
2311 }
2312 }
2313
2314
Harald Welte9958a4d2017-12-14 21:21:33 +01002315
Harald Welte6a8199d2018-01-29 21:58:53 +01002316 function f_rsl_find_ie(RSL_Message msg, RSL_IE_Type iei, out RSL_IE_Body ret) return boolean {
2317 for (var integer i := 0; i < sizeof(msg.ies); i := i+1) {
2318 if (msg.ies[i].iei == iei) {
2319 ret := msg.ies[i].body;
2320 return true;
2321 }
2322 }
2323 return false;
2324 }
2325
2326
Harald Welte9958a4d2017-12-14 21:21:33 +01002327
Harald Welte643e2a62017-11-27 15:03:18 +01002328} with { encode "RAW" ; variant "FIELDORDER(msb)" }