blob: 3ac40ce24b9a5e26b4bbb2484b7059ca0ee42e79 [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
Vadim Yanitskiy1f532152021-11-01 20:37:56 +0300223 RSL_IE_OSMO_REP_ACCH_CAP ('01100000'B),
Neels Hofmeyr2bef0dd2021-04-22 21:46:00 +0000224 RSL_IE_OSMO_TRAINING_SEQUENCE ('01100001'B),
225
Harald Welte643e2a62017-11-27 15:03:18 +0100226 /* ip.access */
227 RSL_IE_IPAC_SRTP_CONFIG ('11100000'B),
Harald Welte319be822017-12-07 17:50:26 +0100228 RSL_IE_IPAC_PROXY_UDP ('11100001'B),
229 RSL_IE_IPAC_BSCMPL_TOUT ('11100010'B),
Harald Welte643e2a62017-11-27 15:03:18 +0100230
231 RSL_IE_IPAC_REMOTE_IP ('11110000'B),
Harald Welte319be822017-12-07 17:50:26 +0100232 RSL_IE_IPAC_REMOTE_PORT ('11110001'B),
233 RSL_IE_IPAC_RTP_PAYLOAD ('11110010'B),
234 RSL_IE_IPAC_LOCAL_PORT ('11110011'B),
235 RSL_IE_IPAC_SPEECH_MODE ('11110100'B),
236 RSL_IE_IPAC_LOCAL_IP ('11110101'B),
237 RSL_IE_IPAC_CONN_STAT ('11110110'B),
238 RSL_IE_IPAC_HO_C_PARMS ('11110111'B),
239 RSL_IE_IPAC_CONN_ID ('11111000'B),
240 RSL_IE_IPAC_RTP_CSD_FMT ('11111001'B),
241 RSL_IE_IPAC_RTP_JIT_BUF ('11111010'B),
242 RSL_IE_IPAC_RTP_COMPR ('11111011'B),
243 RSL_IE_IPAC_RTP_PAYLOAD2 ('11111100'B),
244 RSL_IE_IPAC_RTP_MPLEX ('11111101'B),
245 RSL_IE_IPAC_RTP_MPLEX_ID ('11111110'B)
Harald Welte643e2a62017-11-27 15:03:18 +0100246 } with { variant "FIELDLENGTH(8)" };
247
248 type record RSL_LV {
249 uint8_t len,
250 octetstring payload
251 } with { variant (len) "LENGTHTO(payload)" }
252
Harald Welteefa7d912018-04-18 23:22:15 +0200253 template (value) RSL_LV ts_RSL_LV(template (value) octetstring pl) := {
Harald Welte643e2a62017-11-27 15:03:18 +0100254 len := 0,
255 payload := pl
256 }
257
Harald Welte51d74102017-12-10 23:05:02 +0100258 template RSL_LV tr_RSL_LV(template octetstring pl) := {
259 len := ?,
260 payload := pl
261 }
262
Harald Welte15bb5b52017-12-07 17:52:04 +0100263 type record RSL_L16V {
264 uint16_t len,
265 octetstring payload
266 } with { variant (len) "LENGTHTO(payload)" }
267
Harald Welteefa7d912018-04-18 23:22:15 +0200268 template (value) RSL_L16V ts_RSL_L16V(template (value) octetstring pl) := {
Harald Welte15bb5b52017-12-07 17:52:04 +0100269 len := 0,
270 payload := pl
271 }
272
Harald Welte7794d5b2017-12-16 23:00:20 +0100273 template RSL_L16V tr_RSL_L16V(template octetstring pl) := {
274 len := ?,
275 payload := pl
276 }
277
Harald Welte643e2a62017-11-27 15:03:18 +0100278 type record RSL_IE_V {
279 uint8_t val
280 }
281
282 /* 9.3.3 */
283 type record RSL_IE_ActivationType {
284 boolean reactivation,
285 uint4_t reserved,
Harald Welte921f9e02019-05-19 22:27:11 +0200286 RSL_ActivationAbits a_bits
287 };
288 type enumerated RSL_ActivationAbits {
289 ACT_REL_TO_IMM_ASSIGN ('000'B),
290 ACT_REL_TO_NORM_ASSIGN ('001'B),
291 ACT_REL_TO_ASYNC_HANDOVER ('010'B),
292 ACT_REL_TO_SYNC_HANDOVER ('011'B),
293 ACT_REL_TO_ADDL_ASSIGN ('100'B),
294 ACT_REL_TO_MSLOT_CONFIG ('101'B),
295 ACT_REL_TO_OSMO_PDCH ('111'B)
296 } with { variant "FIELDLENGTH(3)" };
Harald Welte643e2a62017-11-27 15:03:18 +0100297
Harald Welte921f9e02019-05-19 22:27:11 +0200298 const RSL_IE_ActivationType t_RSL_IE_ActType_IA := {
Harald Welte643e2a62017-11-27 15:03:18 +0100299 reactivation := false,
300 reserved := 0,
Harald Welte921f9e02019-05-19 22:27:11 +0200301 a_bits := ACT_REL_TO_IMM_ASSIGN
302 }
303 const RSL_IE_ActivationType t_RSL_IE_ActType_ASS := {
304 reactivation := false,
305 reserved := 0,
306 a_bits := ACT_REL_TO_NORM_ASSIGN
307 }
308 const RSL_IE_ActivationType t_RSL_IE_ActType_HO_ASYNC := {
309 reactivation := false,
310 reserved := 0,
311 a_bits := ACT_REL_TO_ASYNC_HANDOVER
312 }
313 const RSL_IE_ActivationType t_RSL_IE_ActType_HO_SYNC := {
314 reactivation := false,
315 reserved := 0,
316 a_bits := ACT_REL_TO_SYNC_HANDOVER
Harald Welte643e2a62017-11-27 15:03:18 +0100317 }
318
Harald Welte94e0c342018-04-07 11:33:23 +0200319 /* osmocom-style dynamic PDCH */
Harald Welte921f9e02019-05-19 22:27:11 +0200320 const RSL_IE_ActivationType t_RSL_IE_ActType_PDCH := {
Harald Welte94e0c342018-04-07 11:33:23 +0200321 reactivation := false,
322 reserved := 1,
Harald Welte921f9e02019-05-19 22:27:11 +0200323 a_bits := ACT_REL_TO_OSMO_PDCH
Harald Welte94e0c342018-04-07 11:33:23 +0200324 }
325
Vadim Yanitskiye02dbcc2020-08-25 04:20:51 +0700326 /* 9.3.5 */
327 type record RSL_IE_ChannelIdent {
328 uint8_t len,
329 /* 3GPP TS 44.018 Channel Description IE (TV) */
330 ChannelDescriptionTV ch_desc,
331 /* 3GPP TS 44.018 Mobile Allocation IE (shall be empty) */
332 MobileAllocationTLV ma
333 } with { variant (len) "LENGTHTO(ch_desc,ma)" };
334
335 template (value) RSL_IE_ChannelIdent
336 ts_RSL_ChannelIdent(template (value) ChannelDescription ch_desc) := {
337 len := 0, /* overwritten */
338 ch_desc := {
339 iei := '64'O,
340 v := ch_desc
341 },
342 /* Shall be included but empty */
343 ma := {
344 iei := '72'O,
345 v := {
346 len := 0,
347 ma := ''B
348 }
349 }
350 };
351
352 template RSL_IE_ChannelIdent
353 tr_RSL_ChannelIdent(template (present) ChannelDescription ch_desc := ?,
354 template (present) MobileAllocationLV ma := ?) := {
355 len := ?,
356 ch_desc := {
357 iei := '64'O,
358 v := ch_desc
359 },
360 /* Shall be included but empty */
361 ma := {
362 iei := '72'O,
363 v := ma
364 }
365 };
366
Harald Welte643e2a62017-11-27 15:03:18 +0100367 /* 9.3.6 */
368 type enumerated RSL_SpeechDataInd {
369 RSL_SPDI_SPEECH ('00000001'B),
370 RSL_SPDI_DATA ('00000010'B),
371 RSL_SPDI_SIGN ('00000011'B)
372 } with { variant "FIELDLENGTH(8)" };
373 type enumerated RSL_ChanRateType {
374 RSL_CHRT_SDCCH ('00000001'B),
375 RSL_CHRT_TCH_F ('00001000'B),
376 RSL_CHRT_TCH_H ('00001001'B),
377 RSL_CHRT_TCH_F_BD_MSLOT ('00001010'B),
378 RSL_CHRT_TCH_F_DL_MSLOT ('00011010'B),
379 RSL_CHRT_TCH_F_GROUP ('00011000'B),
380 RSL_CHRT_TCH_H_GROUP ('00011001'B),
381 RSL_CHRT_TCH_F_BCAST ('00101000'B),
Neels Hofmeyr2bef0dd2021-04-22 21:46:00 +0000382 RSL_CHRT_TCH_H_BCAST ('00101001'B),
383 RSL_CHRT_OSMO_TCH_F_VAMOS ('10001000'B),
384 RSL_CHRT_OSMO_TCH_H_VAMOS ('10001001'B)
Harald Welte643e2a62017-11-27 15:03:18 +0100385 } with { variant "FIELDLENGTH(8)" };
386 type enumerated RSL_SpeechAlgo {
387 RSL_CMOD_NO_RESOURCE ('00000000'B),
388 RSL_CMOD_SP_GSM1 ('00000001'B),
389 RSL_CMOD_SP_GSM2 ('00010001'B),
390 RSL_CMOD_SP_GSM3 ('00100001'B),
391 RSL_CMOD_SP_GSM4 ('00110001'B),
392 RSL_CMOD_SP_GSM5 ('00001001'B),
393 RSL_CMOD_SP_GSM6 ('00001101'B)
394 } with { variant "FIELDLENGTH(8)" };
395 type record RSL_IE_ChannelMode {
Harald Welte8f2c21d2017-12-07 17:52:40 +0100396 uint8_t len,
Harald Welte643e2a62017-11-27 15:03:18 +0100397 BIT6 reserved,
398 boolean dtx_d,
399 boolean dtx_u,
400 RSL_SpeechDataInd spd_ind,
401 RSL_ChanRateType ch_rate_type,
402 RSL_SpeechAlgo coding_alg_rate
Harald Welte8f2c21d2017-12-07 17:52:40 +0100403 } with { variant (len) "LENGTHTO(reserved,dtx_d,dtx_u,spd_ind,ch_rate_type,coding_alg_rate)" }
Harald Welte643e2a62017-11-27 15:03:18 +0100404
Vadim Yanitskiy8fc43df2020-10-20 02:11:05 +0700405 template (value) RSL_IE_ChannelMode ts_RSL_ChanMode_SIGN(RSL_ChanRateType t := RSL_CHRT_SDCCH,
406 boolean dtx_downlink := false) := {
Harald Welte8f2c21d2017-12-07 17:52:40 +0100407 len := 0, /* overwritten */
Harald Welte643e2a62017-11-27 15:03:18 +0100408 reserved := '000000'B,
Stefan Sperling4880be42018-08-07 18:12:59 +0200409 dtx_d := dtx_downlink,
Harald Welte643e2a62017-11-27 15:03:18 +0100410 dtx_u := false,
411 spd_ind := RSL_SPDI_SIGN,
Philipp Maierac693462020-10-14 20:21:44 +0200412 ch_rate_type := t,
Harald Welte643e2a62017-11-27 15:03:18 +0100413 coding_alg_rate := RSL_CMOD_NO_RESOURCE
414 }
415
Stefan Sperling4880be42018-08-07 18:12:59 +0200416 template (value) RSL_IE_ChannelMode ts_RSL_ChanMode(RSL_ChanRateType t, RSL_SpeechAlgo alg,
417 boolean dtx_downlink := false) := {
Harald Welte8f2c21d2017-12-07 17:52:40 +0100418 len := 0, /* overwritten */
Harald Welte643e2a62017-11-27 15:03:18 +0100419 reserved := '000000'B,
Stefan Sperling4880be42018-08-07 18:12:59 +0200420 dtx_d := dtx_downlink,
Harald Welte643e2a62017-11-27 15:03:18 +0100421 dtx_u := false,
422 spd_ind := RSL_SPDI_SPEECH,
423 ch_rate_type := t,
424 coding_alg_rate := alg
425 }
Harald Welte3618d9d2018-03-21 18:45:27 +0100426 template RSL_IE_ChannelMode tr_RSL_ChanMode(template RSL_ChanRateType t,
427 template RSL_SpeechAlgo alg) := {
428 len := ?,
429 reserved := '000000'B,
430 dtx_d := ?,
431 dtx_u := ?,
432 spd_ind := RSL_SPDI_SPEECH,
433 ch_rate_type := t,
434 coding_alg_rate := alg
435 }
Harald Welte643e2a62017-11-27 15:03:18 +0100436
Vadim Yanitskiy117c1762020-06-16 01:40:10 +0700437 /* 9.3.4 BS Power IE */
Harald Welte643e2a62017-11-27 15:03:18 +0100438 type record RSL_IE_BS_Power {
Vadim Yanitskiy117c1762020-06-16 01:40:10 +0700439 uint2_t reserved,
Harald Welte643e2a62017-11-27 15:03:18 +0100440 boolean epc,
441 boolean fpc,
Vadim Yanitskiy117c1762020-06-16 01:40:10 +0700442 uint4_t power_level
Harald Welte643e2a62017-11-27 15:03:18 +0100443 }
444
Vadim Yanitskiy117c1762020-06-16 01:40:10 +0700445 template (value) RSL_IE_BS_Power ts_RSL_IE_BS_Power(uint4_t power_level,
Eric Wildae8f2622019-06-18 17:05:11 +0200446 boolean epc := false, boolean fpc := false) := {
447 reserved := 0,
448 epc := epc,
449 fpc := fpc,
450 power_level := power_level
451 }
Vadim Yanitskiy2a5a1ef2021-06-30 00:51:48 +0200452 template RSL_IE_BS_Power
453 tr_RSL_IE_BS_Power(template (present) uint4_t power_level,
454 template (present) boolean epc := ?,
455 template (present) boolean fpc := ?) := {
456 reserved := ?,
457 epc := epc,
458 fpc := fpc,
459 power_level := power_level
460 }
Eric Wildae8f2622019-06-18 17:05:11 +0200461
Harald Welte73cd2712017-12-17 00:44:52 +0100462 /* 9.3.7 */
Harald Weltee613f962018-04-18 22:38:16 +0200463 type enumerated RSL_AlgId {
464 RSL_ALG_ID_A5_0 ('00000001'B),
465 RSL_ALG_ID_A5_1 ('00000010'B),
466 RSL_ALG_ID_A5_2 ('00000011'B),
467 RSL_ALG_ID_A5_3 ('00000100'B),
468 RSL_ALG_ID_A5_4 ('00000101'B),
469 RSL_ALG_ID_A5_5 ('00000110'B),
470 RSL_ALG_ID_A5_6 ('00000111'B),
471 RSL_ALG_ID_A5_7 ('00001000'B)
472 } with { variant "FIELDLENGTH(8)" };
Harald Welte73cd2712017-12-17 00:44:52 +0100473 type record RSL_IE_EncryptionInfo {
474 uint8_t len,
Harald Weltee613f962018-04-18 22:38:16 +0200475 RSL_AlgId alg_id,
Harald Welte73cd2712017-12-17 00:44:52 +0100476 octetstring key
477 } with { variant (len) "LENGTHTO(alg_id,key)" };
478
Harald Weltee613f962018-04-18 22:38:16 +0200479 template RSL_IE_EncryptionInfo tr_RSL_IE_EncrInfo(template RSL_AlgId alg,
480 template octetstring key) := {
Harald Welte73cd2712017-12-17 00:44:52 +0100481 len := ?,
482 alg_id := alg,
483 key := key
484 }
Harald Weltee613f962018-04-18 22:38:16 +0200485 template (value) RSL_IE_EncryptionInfo ts_RSL_IE_EncrInfo(template (value) RSL_AlgId alg,
486 octetstring key) := {
Harald Welteefa7d912018-04-18 23:22:15 +0200487 len := 0, /* overwritten */
488 alg_id := alg,
489 key := key
490 }
491
492
Harald Welte73cd2712017-12-17 00:44:52 +0100493
Harald Welte643e2a62017-11-27 15:03:18 +0100494 /* 9.3.8 */
495 type record RSL_IE_FrameNumber {
496 uint5_t t1_p,
497 uint6_t t3,
498 uint5_t t2
499 }
500 type RSL_IE_FrameNumber RSL_IE_StartingTime;
501
502 /* 9.3.10 */
503 type record RSL_IE_L1Info {
504 uint5_t ms_power_lvl,
505 boolean fpc,
506 uint2_t reserved,
507 uint8_t actual_ta
508 }
509
510 /* 9.3.13 */
511 type record RSL_IE_MS_Power {
512 uint2_t reserved,
513 boolean fpc_epc,
514 uint5_t power_level
515 }
Pau Espin Pedrolf7630a62019-10-28 15:07:08 +0100516 template RSL_IE_MS_Power tr_RSL_IE_MS_Power(template uint5_t power_level := ?,
517 template boolean fpc_epc := false) := {
518 reserved := 0,
519 fpc_epc := fpc_epc,
520 power_level := power_level
521 }
Harald Welte10280172019-05-19 22:28:04 +0200522 template (value) RSL_IE_MS_Power ts_RSL_IE_MS_Power(uint5_t power_level,
523 boolean fpc_epc := false) := {
524 reserved := 0,
525 fpc_epc := fpc_epc,
526 power_level := power_level
527 }
Harald Welte643e2a62017-11-27 15:03:18 +0100528
Harald Welted5f521e2017-12-07 17:53:06 +0100529 /* 9.3.18 */
530 type record RSL_IE_RachLoad {
531 uint8_t len,
532 uint16_t slot_count,
533 uint16_t busy_count,
534 uint16_t access_count
535 } with { variant (len) "LENGTHTO(slot_count,busy_count,access_count)" }
536
Harald Welteefa7d912018-04-18 23:22:15 +0200537 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 +0100538 len := 0, /* overwritten */
539 slot_count := slot,
540 busy_count := busy,
541 access_count := acc
542 }
543
Harald Welte68e495b2018-02-25 00:05:57 +0100544 template RSL_IE_RachLoad tr_RSL_IE_RachLoad(template uint16_t slot,
545 template uint16_t busy,
546 template uint16_t acc) := {
547 len := ?, /* overwritten */
548 slot_count := slot,
549 busy_count := busy,
550 access_count := acc
551 }
552
Harald Welte643e2a62017-11-27 15:03:18 +0100553 /* 9.3.19 */
554 type record RSL_IE_RequestRef {
555 OCT1 ra,
556 RSL_IE_FrameNumber frame_nr
557 }
558
559 /* 3GPP TS 44.018 / 10.5.2.38 Starting Time */
Harald Welte94e0c342018-04-07 11:33:23 +0200560 template (value) RSL_IE_FrameNumber ts_RSL_IE_FrameNumber(GsmFrameNumber fn) := {
Harald Welte643e2a62017-11-27 15:03:18 +0100561 t1_p := (fn / 1326) mod 32,
562 t3 := fn mod 51,
563 t2 := fn mod 26
564 }
565
Harald Welte9abd1282018-02-19 19:18:17 +0100566 function tr_RSL_IE_FrameNumber(template GsmFrameNumber fn) return template RSL_IE_FrameNumber {
567 if (istemplatekind(fn, "?")) {
568 return ?;
569 } else {
570 return ts_RSL_IE_FrameNumber(valueof(fn));
571 }
572 }
573
Harald Welteefa7d912018-04-18 23:22:15 +0200574 template (value) RSL_IE_RequestRef ts_RSL_IE_ReqRef(OCT1 ra, GsmFrameNumber frame_nr) := {
Harald Welte643e2a62017-11-27 15:03:18 +0100575 ra := ra,
576 frame_nr := ts_RSL_IE_FrameNumber(frame_nr)
577 }
578
Harald Welte9abd1282018-02-19 19:18:17 +0100579 template RSL_IE_RequestRef tr_RSL_IE_ReqRef(template OCT1 ra, template GsmFrameNumber frame_nr) := {
580 ra := ra,
581 frame_nr := tr_RSL_IE_FrameNumber(frame_nr)
582 }
583
Vadim Yanitskiy9f699532021-06-03 17:29:22 +0200584 /* 9.3.21 Resource Information */
585 type record RSL_IE_ResourceInfo {
586 uint8_t len,
587 RSL_ResourceInfo info
588 } with { variant (len) "LENGTHTO(info)" };
589
590 type record of RSL_ResourceInfoItem RSL_ResourceInfo;
591 type record RSL_ResourceInfoItem {
592 RslChannelNr chan_nr,
593 uint3_t interf_band,
594 BIT5 rfu ('00000'B)
595 };
596
597 template (value) RSL_ResourceInfoItem
598 ts_RSL_ResourceInfoItem(template (value) RslChannelNr chan_nr,
599 template (value) uint3_t interf_band := 0) := {
600 chan_nr := chan_nr,
601 interf_band := interf_band,
602 rfu := '00000'B
603 }
604 template RSL_ResourceInfoItem
605 tr_RSL_ResourceInfoItem(template (present) RslChannelNr chan_nr := ?,
606 template (present) uint3_t interf_band := ?) := {
607 chan_nr := chan_nr,
608 interf_band := interf_band,
609 rfu := ? /* Tolerate unknown values */
610 }
611
Harald Welte15de8ba2018-06-29 08:51:42 +0200612 /* Osmocom Extension */
613 type record RSL_IE_UplinkMeasSuppMeasInfo {
614 int16_t toa256_mean,
615 int16_t toa256_min,
616 int16_t toa256_max,
617 uint16_t toa256_std_dev
618 };
619
Harald Welte2691adf2018-02-22 17:32:39 +0100620 /* 9.3.25 */
621 type record RSL_IE_UplinkMeas {
622 uint8_t len,
623 BIT1 rfu,
624 boolean dtx_d,
625 uint6_t rxlev_f_u,
626 BIT2 reserved1,
627 uint6_t rxlev_s_u,
628 BIT2 reserved2,
629 uint3_t rxq_f_u,
630 uint3_t rxq_s_u,
Harald Welte15de8ba2018-06-29 08:51:42 +0200631 RSL_IE_UplinkMeasSuppMeasInfo supp_meas_info optional
Harald Welte2691adf2018-02-22 17:32:39 +0100632 } 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 +0100633
Harald Welte643e2a62017-11-27 15:03:18 +0100634 /* 9.3.26 */
Harald Weltea8ed9062017-12-14 09:46:01 +0100635 type enumerated RSL_Cause {
636 /* normal event */
637 RSL_ERR_RADIO_IF_FAIL ('00'O),
638 RSL_ERR_RADIO_LINK_FAIL ('01'O),
639 RSL_ERR_HANDOVER_ACC_FAIL ('02'O),
640 RSL_ERR_TALKER_ACC_FAIL ('03'O),
641 RSL_ERR_OM_INTERVENTION ('07'O),
642 RSL_ERR_NORMAL_UNSPEC ('0f'O),
643 RSL_ERR_T_MSRFPCI_EXP ('18'O),
644 /* resource unavailable */
645 RSL_ERR_EQUIPMENT_FAIL ('20'O),
646 RSL_ERR_RR_UNAVAIL ('21'O),
647 RSL_ERR_TERR_CH_FAIL ('22'O),
648 RSL_ERR_CCCH_OVERLOAD ('23'O),
649 RSL_ERR_ACCH_OVERLOAD ('24'O),
650 RSL_ERR_PROCESSOR_OVERLOAD ('25'O),
651 RSL_ERR_BTS_NOT_EQUIPPED ('27'O),
652 RSL_ERR_REMOTE_TRAU_FAILURE ('28'O),
653 RSL_ERR_NOTIF_OVERFLOW ('29'O),
654 RSL_ERR_RES_UNAVAIL ('2f'O),
655 /* service or option not available */
656 RSL_ERR_TRANSC_UNAVAIL ('30'O),
657 RSL_ERR_SERV_OPT_UNAVAIL ('3f'O),
658 /* service or option not implemented */
659 RSL_ERR_ENCR_UNIMPL ('40'O),
660 RSL_ERR_SERV_OPT_UNIMPL ('4f'O),
661 /* invalid message */
662 RSL_ERR_RCH_ALR_ACTV_ALLOC ('50'O),
Harald Welte9912eb52018-02-25 13:30:15 +0100663 RSL_ERR_IPA_RCH_NOT_ACTV_ALLOC ('51'O),
664 RSL_ERR_IPA_CONN_INVALID ('52'O),
665 RSL_ERR_IPA_CONN_IN_USE ('53'O),
666 RSL_ERR_IPA_CONN_ALREADY_EXISTS ('54'O),
Harald Weltea8ed9062017-12-14 09:46:01 +0100667 RSL_ERR_INVALID_MESSAGE ('5f'O),
668 /* protocol error */
669 RSL_ERR_MSG_DISCR ('60'O),
670 RSL_ERR_MSG_TYPE ('61'O),
671 RSL_ERR_MSG_SEQ ('62'O),
672 RSL_ERR_IE_ERROR ('63'O),
673 RSL_ERR_MAND_IE_ERROR ('64'O),
674 RSL_ERR_OPT_IE_ERROR ('65'O),
675 RSL_ERR_IE_NONEXIST ('66'O),
676 RSL_ERR_IE_LENGTH ('67'O),
677 RSL_ERR_IE_CONTENT ('68'O),
678 RSL_ERR_PROTO ('6f'O),
679 /* interworking */
680 RSL_ERR_INTERWORKING ('7f'O)
681 };
Harald Welte643e2a62017-11-27 15:03:18 +0100682 type record RSL_IE_Cause {
Harald Welte6efa8e32017-12-09 22:34:06 +0100683 uint8_t len,
Harald Welte643e2a62017-11-27 15:03:18 +0100684 uint1_t e,
685 RSL_Cause cause,
686 octetstring cause_ext optional
Harald Welte6efa8e32017-12-09 22:34:06 +0100687 } with { variant (len) "LENGTHTO(e,cause,cause_ext)" }
Harald Welte643e2a62017-11-27 15:03:18 +0100688
Harald Welteefa7d912018-04-18 23:22:15 +0200689 template (value) RSL_IE_Cause ts_RSL_IE_Cause(RSL_Cause cause) := {
Harald Welte6efa8e32017-12-09 22:34:06 +0100690 len := 0, /* overwritten */
Harald Welte643e2a62017-11-27 15:03:18 +0100691 e := 0,
692 cause := cause,
693 cause_ext := omit
694 }
695
Harald Welte9abd1282018-02-19 19:18:17 +0100696 template RSL_IE_Cause tr_RSL_IE_Cause(template RSL_Cause cause) := {
697 len := ?,
698 e := 0,
699 cause := cause,
700 cause_ext := omit
701 }
702
Harald Weltec8d363c2019-05-19 20:36:48 +0200703 /* 9.3.29 */
704 type record RSL_SacchInfo {
705 uint8_t len,
706 uint8_t num_msgs,
707 RSL_SacchInfoElements elems
708 } with {
709 variant (len) "LENGTHTO(num_msgs,elems)";
710 variant (num_msgs) "LENGTHTO(elems)";
711 variant (num_msgs) "UNIT(elements)"
712 };
713 type record RSL_SacchInfoElement {
714 RSL_IE_SysinfoType si_type,
715 uint8_t len,
716 octetstring msg
717 } with {
718 variant (len) "LENGTHTO(msg)";
719 };
720 type record of RSL_SacchInfoElement RSL_SacchInfoElements;
721 template (value) RSL_SacchInfo ts_RSL_SacchInfo(template (value) RSL_SacchInfoElements elems) := {
722 len := 0, /* overwritten */
723 num_msgs := 0, /* overwritten */
724 elems := elems
725 }
726 template (value) RSL_SacchInfoElement ts_RSL_SacchInfoElem(RSL_IE_SysinfoType tp, octetstring msg) := {
727 si_type := tp,
728 len := lengthof(msg),
729 msg := msg
730 }
731
Eric Wild61edb7e2019-06-03 12:38:31 +0200732 /* 9.3.31 */
733 type record RSL_IE_MS_Power_Parameters {
734 uint8_t len,
735 octetstring params
736 } with {
737 variant (len) "LENGTHTO(params)";
738 };
739 template (value) RSL_IE_MS_Power_Parameters ts_RSL_IE_MS_Power_Parameters(octetstring params) := {
740 len := 0, /* overwritten */
741 params := params
742 }
743
Harald Welte643e2a62017-11-27 15:03:18 +0100744 /* 9.3.40 */
745 type enumerated RSL_ChanNeeded {
746 RSL_CHANNEED_ANY ('00'B),
747 RSL_CHANNEED_SDCCH ('01'B),
748 RSL_CHANNEED_TCH_F ('10'B),
749 RSL_CHANNEED_TCH_ForH ('11'B)
Harald Welte51d74102017-12-10 23:05:02 +0100750 } with { variant "FIELDLENGTH(2)" };
Harald Welte643e2a62017-11-27 15:03:18 +0100751 type record RSL_IE_ChanNeeded {
752 uint6_t reserved,
753 RSL_ChanNeeded chan_needed
754 }
755
Harald Weltecc373202018-09-10 10:28:21 +0200756 /* 9.3.41 CB Command Type */
757 type enumerated RSL_CbCommand {
758 RSL_CB_CMD_NORMAL ('0000'B),
759 RSL_CB_CMD_SCHEDULE ('1000'B),
760 RSL_CB_CMD_DEFAULT ('1110'B),
761 RSL_CB_CMD_NULL ('1111'B)
762 } with { variant "FIELDLENGTH(4)" };
763 type record RSL_IE_CbCommandType {
764 RSL_CbCommand command,
765 boolean default_bcast_null,
766 BIT1 spare,
767 uint2_t last_block
768 };
769 template (value) RSL_IE_CbCommandType ts_RSL_IE_CbCmdType(RSL_CbCommand cmd := RSL_CB_CMD_NORMAL,
770 uint2_t last_block := 1,
771 boolean def_bcast_null := true) := {
772 command := cmd,
773 default_bcast_null := def_bcast_null,
774 spare := '0'B,
775 last_block := last_block
776 }
777
Harald Welte4a129f82019-05-21 16:35:22 +0200778 /* 9.4.43 CBCH Load Information */
779 type record RSL_IE_CbchLoadInfo {
780 boolean overflow,
781 BIT3 spare,
782 uint4_t slot_count
783 };
784 template RSL_IE_CbchLoadInfo tr_CbchLoadInfo(template boolean overflow,
785 template uint4_t slot_count) := {
786 overflow := overflow,
787 spare := ?,
788 slot_count := slot_count
789 }
790 template (value) RSL_IE_CbchLoadInfo ts_CbchLoadInfo(boolean overflow, uint4_t slot_count) := {
791 overflow := overflow,
792 spare := '000'B,
793 slot_count := slot_count
794 }
795
Harald Welte643e2a62017-11-27 15:03:18 +0100796 /* 9.3.53 */
797 type record RSL_IE_MultirateCtrl {
798 uint3_t spare,
799 boolean od,
800 boolean pre,
801 uint2_t rae,
802 boolean tfo
803 }
804
805 type enumerated RSL_IE_SysinfoType {
806 RSL_SYSTEM_INFO_8 ('00000000'B),
807 RSL_SYSTEM_INFO_1 ('00000001'B),
808 RSL_SYSTEM_INFO_2 ('00000010'B),
809 RSL_SYSTEM_INFO_3 ('00000011'B),
810 RSL_SYSTEM_INFO_4 ('00000100'B),
811 RSL_SYSTEM_INFO_5 ('00000101'B),
812 RSL_SYSTEM_INFO_6 ('00000110'B),
813 RSL_SYSTEM_INFO_7 ('00000111'B),
814 RSL_SYSTEM_INFO_16 ('00001000'B),
815 RSL_SYSTEM_INFO_17 ('00001001'B),
816 RSL_SYSTEM_INFO_2bis ('00001010'B),
817 RSL_SYSTEM_INFO_2ter ('00001011'B),
818 RSL_SYSTEM_INFO_5bis ('00001101'B),
819 RSL_SYSTEM_INFO_5ter ('00001110'B),
820 RSL_SYSTEM_INFO_10 ('00001111'B),
821 RSL_EXT_MEAS_ORDER ('01000111'B),
822 RSL_MEAS_INFO ('01001000'B),
823 RSL_SYSTEM_INFO_13 ('00101000'B),
824 RSL_ERIC_SYSTEM_INFO_13 ('00001100'B),
825 RSL_SYSTEM_INFO_2quater ('00101001'B),
826 RSL_SYSTEM_INFO_9 ('00101010'B),
827 RSL_SYSTEM_INFO_18 ('00101011'B),
828 RSL_SYSTEM_INFO_19 ('00101100'B),
829 RSL_SYSTEM_INFO_20 ('00101101'B)
830 } with { variant "FIELDLENGTH(8)" }
831
Harald Welte9958a4d2017-12-14 21:21:33 +0100832 type record RSL_IE_IPA_ConnectionStats {
833 uint8_t len,
834 uint32_t tx_packets,
835 uint32_t tx_octets,
836 uint32_t rx_packets,
837 uint32_t rx_octets,
838 uint32_t lost_packets,
839 uint32_t jitter,
840 uint32_t avg_delay
841 } with { variant (len) "LENGTHTO(tx_packets,tx_octets,rx_packets,rx_octets,lost_packets,jitter,avg_delay)" }
842
843 type enumerated RSL_IPA_SpeechMode {
844 RSL_IPA_SPM_SENDRECV ('00'B),
845 RSL_IPA_SPM_RECVONLY ('01'B),
846 RSL_IPA_SPM_SENDONLY ('10'B),
847 RSL_IPA_SPM_RESERVED ('11'B)
848 } with { variant "FIELDLENGTH(2)" }
849
850 type enumerated RSL_IPA_Codec {
851 RSL_IPA_CODEC_FR ('0000'B),
852 RSL_IPA_CODEC_EFR ('0001'B),
853 RSL_IPA_CODEC_AMR_F ('0010'B),
854 RSL_IPA_CODEC_HR ('0011'B),
855 RSL_IPA_CODEC_AMR_H ('0101'B),
856 RSL_IPA_CODEC_RTP_PT ('1111'B)
857 } with { variant "FIELDLENGTH(4)" }
858
859 type record RSL_IE_IPA_SpeechMode {
860 BIT2 reserved,
861 RSL_IPA_SpeechMode mode,
862 RSL_IPA_Codec codec
863 }
864
Harald Welte0472ab42018-03-12 15:02:26 +0100865 /* 9.3.20 */
866 type enumerated RSL_IE_ReleaseMode {
867 RSL_REL_MODE_NORMAL ('00'B),
868 REL_REL_MODE_LOCAL ('01'B)
869 }
870
Neels Hofmeyr2bef0dd2021-04-22 21:46:00 +0000871 type record RSL_IE_OSMO_TrainingSequence {
872 uint8_t len,
873 uint8_t tsc_set,
874 uint8_t tsc
875 } with { variant (len) "LENGTHTO(tsc_set,tsc)" }
876
Vadim Yanitskiy1f532152021-11-01 20:37:56 +0300877 type record RSL_IE_OSMO_RepAcchCap {
878 uint8_t len,
879 BIT1 rfu ('0'B),
880 uint3_t rxqual,
881 boolean ul_sacch,
882 boolean dl_sacch,
883 boolean dl_facch_all,
884 boolean dl_facch_cmd
885 } with { variant (len) "LENGTHTO(rfu,rxqual,ul_sacch,dl_sacch,dl_facch_all,dl_facch_cmd)" }
886
Harald Welte643e2a62017-11-27 15:03:18 +0100887 /* union of all IE bodies */
888 type union RSL_IE_Body {
889 RslChannelNr chan_nr,
890 RslLinkId link_id,
Harald Welte15bb5b52017-12-07 17:52:04 +0100891 RSL_L16V l3_info,
Harald Welte643e2a62017-11-27 15:03:18 +0100892 RSL_LV rlm_cause,
Harald Welte0472ab42018-03-12 15:02:26 +0100893 RSL_IE_ReleaseMode release_mode,
Harald Welte643e2a62017-11-27 15:03:18 +0100894 RSL_IE_ActivationType act_type,
Vadim Yanitskiye02dbcc2020-08-25 04:20:51 +0700895 RSL_IE_ChannelIdent chan_ident,
Harald Welte643e2a62017-11-27 15:03:18 +0100896 RSL_IE_ChannelMode chan_mode,
897 uint8_t handover_ref,
898 RSL_IE_BS_Power bs_power,
Vadim Yanitskiy802508e2020-11-11 07:25:47 +0700899 RSL_LV bs_power_params,
Harald Welte643e2a62017-11-27 15:03:18 +0100900 RSL_IE_MS_Power ms_power,
Eric Wild61edb7e2019-06-03 12:38:31 +0200901 RSL_IE_MS_Power_Parameters ms_power_params,
Harald Welte643e2a62017-11-27 15:03:18 +0100902 uint8_t timing_adv,
903 RSL_IE_MultirateCtrl multirate_ctrl,
Harald Weltea6706152019-05-19 20:38:18 +0200904 uint8_t msg_id,
Harald Welte643e2a62017-11-27 15:03:18 +0100905 RSL_IE_FrameNumber frame_nr,
906 RSL_IE_Cause cause,
907 uint8_t access_delay,
Harald Welted5f521e2017-12-07 17:53:06 +0100908 RSL_IE_RachLoad rach_load,
Harald Welte643e2a62017-11-27 15:03:18 +0100909 uint8_t meas_res_nr,
Harald Welte2691adf2018-02-22 17:32:39 +0100910 uint8_t ms_timing_offset,
911 RSL_IE_UplinkMeas uplink_meas,
Harald Welte643e2a62017-11-27 15:03:18 +0100912 RSL_IE_L1Info l1_info,
913 RSL_IE_SysinfoType sysinfo_type,
914 uint16_t paging_load,
915 uint8_t paging_group,
916 RSL_IE_ChanNeeded chan_needed,
Harald Weltecc373202018-09-10 10:28:21 +0200917 RSL_IE_CbCommandType cb_cmd_type,
918 RSL_LV smscb_message,
Harald Welte4a129f82019-05-21 16:35:22 +0200919 RSL_IE_CbchLoadInfo cbch_load_info,
Vadim Yanitskiy9f699532021-06-03 17:29:22 +0200920 RSL_IE_ResourceInfo resource_info,
Harald Weltec8d363c2019-05-19 20:36:48 +0200921 RSL_SacchInfo sacch_info,
Harald Weltecc373202018-09-10 10:28:21 +0200922
Harald Welte643e2a62017-11-27 15:03:18 +0100923 RSL_IE_StartingTime starting_time,
Harald Welte73cd2712017-12-17 00:44:52 +0100924 RSL_IE_EncryptionInfo encr_info,
Harald Weltea3ff6702019-05-20 20:03:50 +0200925 uint8_t smscb_chan_ind,
Harald Welte643e2a62017-11-27 15:03:18 +0100926 RSL_IE_RequestRef req_ref,
927 RSL_LV full_imm_ass_info,
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +0700928 MobileIdentityLV ms_identity,
Harald Welte643e2a62017-11-27 15:03:18 +0100929
Harald Welte9958a4d2017-12-14 21:21:33 +0100930 uint16_t ipa_conn_id,
931 uint16_t ipa_local_port,
932 uint16_t ipa_remote_port,
Vadim Yanitskiyfc631642021-07-03 02:42:45 +0200933 OCT4 ipa_local_ip,
934 OCT4 ipa_remote_ip,
Harald Welte9958a4d2017-12-14 21:21:33 +0100935 uint8_t ipa_rtp_pt,
936 uint8_t ipa_rtp_pt2,
937 RSL_IE_IPA_ConnectionStats ipa_stats,
938 RSL_IE_IPA_SpeechMode ipa_speech_mode,
939
Neels Hofmeyr2bef0dd2021-04-22 21:46:00 +0000940 RSL_IE_OSMO_TrainingSequence osmo_training_sequence,
Vadim Yanitskiy1f532152021-11-01 20:37:56 +0300941 RSL_IE_OSMO_RepAcchCap rep_acch_cap,
Neels Hofmeyr2bef0dd2021-04-22 21:46:00 +0000942
Harald Welte643e2a62017-11-27 15:03:18 +0100943 RSL_LV other
944 }
945
946 type record RSL_IE {
947 RSL_IE_Type iei,
948 RSL_IE_Body body
949 } with { variant (body) "CROSSTAG(
950 chan_nr, iei = RSL_IE_CHAN_NR;
951 link_id, iei = RSL_IE_LINK_IDENT;
952 l3_info, iei = RSL_IE_L3_INFO;
953 rlm_cause, iei = RSL_IE_RLM_CAUSE;
954 release_mode, iei = RSL_IE_RELEASE_MODE;
955 act_type, iei = RSL_IE_ACT_TYPE;
Vadim Yanitskiye02dbcc2020-08-25 04:20:51 +0700956 chan_ident, iei = RSL_IE_CHAN_IDENT;
Harald Welte643e2a62017-11-27 15:03:18 +0100957 chan_mode, iei = RSL_IE_CHAN_MODE;
958 handover_ref, iei = RSL_IE_HANDO_REF;
959 bs_power, iei = RSL_IE_BS_POWER;
Vadim Yanitskiy802508e2020-11-11 07:25:47 +0700960 bs_power_params, iei = RSL_IE_BS_POWER_PARAM;
Harald Welte643e2a62017-11-27 15:03:18 +0100961 ms_power, iei = RSL_IE_MS_POWER;
Eric Wild61edb7e2019-06-03 12:38:31 +0200962 ms_power_params, iei = RSL_IE_MS_POWER_PARAM;
Harald Welte643e2a62017-11-27 15:03:18 +0100963 timing_adv, iei = RSL_IE_TIMING_ADVANCE;
964 multirate_ctrl, iei = RSL_IE_MR_CONTROL;
Harald Weltea6706152019-05-19 20:38:18 +0200965 msg_id, iei = RSL_IE_MSG_ID;
Harald Welte643e2a62017-11-27 15:03:18 +0100966
967 frame_nr, iei = RSL_IE_FRAME_NUMBER;
968 cause, iei = RSL_IE_CAUSE;
969 access_delay, iei = RSL_IE_ACCESS_DELAY;
Harald Welted5f521e2017-12-07 17:53:06 +0100970 rach_load, iei = RSL_IE_RACH_LOAD;
Harald Welte643e2a62017-11-27 15:03:18 +0100971 meas_res_nr, iei = RSL_IE_MEAS_RES_NR;
Harald Welte2691adf2018-02-22 17:32:39 +0100972 ms_timing_offset, iei = RSL_IE_MS_TIMING_OFFSET;
973 uplink_meas, iei = RSL_IE_UPLINK_MEAS;
Harald Welte643e2a62017-11-27 15:03:18 +0100974 l1_info, iei = RSL_IE_L1_INFO;
975 sysinfo_type, iei = RSL_IE_SYSINFO_TYPE;
976 paging_load, iei = RSL_IE_PAGING_LOAD;
977 paging_group, iei = RSL_IE_PAGING_GROUP;
978 chan_needed, iei = RSL_IE_CHAN_NEEDED;
Harald Weltecc373202018-09-10 10:28:21 +0200979 cb_cmd_type, iei = RSL_IE_CB_CMD_TYPE;
980 smscb_message, iei = RSL_IE_SMSCB_MSG;
Harald Welte4a129f82019-05-21 16:35:22 +0200981 cbch_load_info, iei = RSL_IE_CBCH_LOAD_INFO;
Vadim Yanitskiy9f699532021-06-03 17:29:22 +0200982 resource_info, iei = RSL_IE_RESOURCE_INFO;
Harald Weltec8d363c2019-05-19 20:36:48 +0200983 sacch_info, iei = RSL_IE_SACCH_INFO;
Harald Welte643e2a62017-11-27 15:03:18 +0100984 starting_time, iei = RSL_IE_STARTNG_TIME;
Harald Welte73cd2712017-12-17 00:44:52 +0100985 encr_info, iei = RSL_IE_ENCR_INFO;
Harald Weltea3ff6702019-05-20 20:03:50 +0200986 smscb_chan_ind, iei = RSL_IE_SMSCB_CHAN_INDICATOR;
Harald Welte643e2a62017-11-27 15:03:18 +0100987
988 req_ref, iei = RSL_IE_REQ_REFERENCE;
Harald Weltefff69302017-12-07 17:53:42 +0100989 full_imm_ass_info, iei = RSL_IE_FULL_IMM_ASS_INFO;
990 ms_identity, iei = RSL_IE_MS_IDENTITY;
991 other, iei = RSL_IE_FULL_BCCH_INFO;
Harald Welte643e2a62017-11-27 15:03:18 +0100992
Harald Welte9958a4d2017-12-14 21:21:33 +0100993 ipa_conn_id, iei = RSL_IE_IPAC_CONN_ID;
994 ipa_remote_ip, iei = RSL_IE_IPAC_REMOTE_IP;
995 ipa_remote_port, iei = RSL_IE_IPAC_REMOTE_PORT;
996 ipa_local_ip, iei = RSL_IE_IPAC_LOCAL_IP;
997 ipa_local_port, iei = RSL_IE_IPAC_LOCAL_PORT;
998 ipa_rtp_pt, iei = RSL_IE_IPAC_RTP_PAYLOAD;
999 ipa_rtp_pt2, iei = RSL_IE_IPAC_RTP_PAYLOAD2;
1000 ipa_stats, iei = RSL_IE_IPAC_CONN_STAT;
1001 ipa_speech_mode, iei = RSL_IE_IPAC_SPEECH_MODE;
1002
Neels Hofmeyr2bef0dd2021-04-22 21:46:00 +00001003 osmo_training_sequence, iei = RSL_IE_OSMO_TRAINING_SEQUENCE;
Vadim Yanitskiy1f532152021-11-01 20:37:56 +03001004 rep_acch_cap, iei = RSL_IE_OSMO_REP_ACCH_CAP;
Neels Hofmeyr2bef0dd2021-04-22 21:46:00 +00001005
Harald Welte643e2a62017-11-27 15:03:18 +01001006 other, OTHERWISE;
1007 )" };
1008
Harald Welte735dd072017-12-12 14:55:17 +01001009 /* For some reason the TTCN-3 RAW codec cannot automatically figure out the IEI
1010 * that it needs to set for a given union-choice (body). So we have to explicitly
1011 * specify the IEI by the caller :( */
Harald Welteefa7d912018-04-18 23:22:15 +02001012 template (value) RSL_IE t_RSL_IE(RSL_IE_Type iei, template (value) RSL_IE_Body body) := {
Harald Welte735dd072017-12-12 14:55:17 +01001013 iei := iei,
Harald Welte643e2a62017-11-27 15:03:18 +01001014 body := body
1015 }
1016
Harald Weltec2877752017-12-07 17:54:35 +01001017 template RSL_IE tr_RSL_IE(template RSL_IE_Body body) := {
1018 iei := ?, /* overwritten? */
1019 body := body
1020 }
1021
1022
Harald Welte643e2a62017-11-27 15:03:18 +01001023 type record of RSL_IE RSL_IE_List;
1024
1025 type record RSL_Message {
1026 RSL_MessageDiscriminator msg_disc,
1027 RSL_MessageType msg_type,
1028 RSL_IE_List ies optional
1029 }
1030
1031 external function enc_RSL_Message(in RSL_Message msg) return octetstring
1032 with { extension "prototype(convert) encode(RAW)" };
1033 external function dec_RSL_Message(in octetstring stream) return RSL_Message
1034 with { extension "prototype(convert) decode(RAW)" };
1035
Harald Weltebc330be2017-12-09 00:56:36 +01001036 template RSL_Message tr_RSL_MsgDiscType(template RSL_MessageDiscriminator m_disc,
Harald Welte643e2a62017-11-27 15:03:18 +01001037 RSL_MessageType m_type) := {
1038 msg_disc := m_disc,
1039 msg_type := m_type,
1040 ies := *
1041 }
1042
Harald Welteefa7d912018-04-18 23:22:15 +02001043 template (value) RSL_Message ts_RSL_MsgDiscType(template (value) RSL_MessageDiscriminator m_disc,
1044 template (value) RSL_MessageType msg_type,
1045 template (omit) RSL_IE_List ies := omit) := {
Harald Welte4a267362017-12-09 17:49:32 +01001046 msg_disc := m_disc,
1047 msg_type := msg_type,
1048 ies := ies
1049 }
1050
Harald Weltebc330be2017-12-09 00:56:36 +01001051template RSL_Message tr_RSL_MsgType(template RSL_MessageType msg_type) := {
1052 msg_disc := ?,
1053 msg_type := msg_type,
1054 ies := *
1055}
1056
1057/* Common Channel Management */
1058template RSL_Message tr_RSL_MsgTypeC(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
1059 msg_disc := { RSL_MDISC_CCHAN, ? }
1060}
1061
1062/* RLL */
1063template RSL_Message tr_RSL_MsgTypeR(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
1064 msg_disc := { RSL_MDISC_RLL, true }
1065}
1066
1067/* Dedicated Channel Management */
1068template RSL_Message tr_RSL_MsgTypeD(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
1069 msg_disc := { RSL_MDISC_DCHAN, ? }
1070}
1071
1072/* Dedicated Channel Management */
1073template RSL_Message tr_RSL_MsgTypeT(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
1074 msg_disc := { RSL_MDISC_TRX_MGMT, ? }
1075}
1076
1077
1078/* dedicated channel or RLL */
1079template RSL_Message tr_RSL_MsgTypeDR(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
Harald Weltee5408222018-01-29 21:57:58 +01001080 msg_disc := ({RSL_MDISC_DCHAN,?}, {RSL_MDISC_RLL,?}, {RSL_MDISC_IPACCESS,false})
Harald Weltebc330be2017-12-09 00:56:36 +01001081}
1082
1083
Harald Welte643e2a62017-11-27 15:03:18 +01001084 /* 8.3.1 BSC -> BTS */
Harald Welteefa7d912018-04-18 23:22:15 +02001085 template (value) RSL_Message ts_RSL_DATA_REQ(template (value) RslChannelNr chan_nr,
1086 template (value) RslLinkId link_id,
1087 octetstring l3_info) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001088 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, true),
1089 msg_type := RSL_MT_DATA_REQ,
1090 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001091 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1092 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
1093 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
Harald Welte643e2a62017-11-27 15:03:18 +01001094 }
1095 }
1096
Harald Welte7794d5b2017-12-16 23:00:20 +01001097 template RSL_Message tr_RSL_DATA_REQ(template RslChannelNr chan_nr :=?,
1098 template RslLinkId link_id := ?,
1099 template octetstring l3_info := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001100 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, true),
Harald Welte7794d5b2017-12-16 23:00:20 +01001101 msg_type := RSL_MT_DATA_REQ,
1102 ies :={
1103 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1104 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
1105 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
1106 }
1107 }
1108
1109
Harald Welte643e2a62017-11-27 15:03:18 +01001110 /* 8.3.2 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001111 template (value) RSL_Message ts_RSL_DATA_IND(template (value) RslChannelNr chan_nr,
1112 template (value) RslLinkId link_id,
1113 octetstring l3_info) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001114 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, true),
1115 msg_type := RSL_MT_DATA_IND,
1116 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001117 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1118 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
1119 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
Harald Welte643e2a62017-11-27 15:03:18 +01001120 }
1121 }
Harald Welte9abd1282018-02-19 19:18:17 +01001122 template RSL_Message tr_RSL_DATA_IND(template RslChannelNr chan_nr, template RslLinkId link_id,
1123 template octetstring l3_info := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001124 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, true),
Harald Welte9abd1282018-02-19 19:18:17 +01001125 msg_type := RSL_MT_DATA_IND,
1126 ies :={
1127 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1128 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
1129 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
1130 }
1131 }
Harald Welte643e2a62017-11-27 15:03:18 +01001132
1133 /* 8.3.3 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001134 template (value) RSL_Message ts_RSL_ERROR_IND(template (value) RslChannelNr chan_nr,
Harald Weltea7d81f12019-06-02 22:33:19 +02001135 template (value) RslLinkId link_id,
1136 template (value) octetstring rlm_cause) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001137 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1138 msg_type := RSL_MT_ERROR_IND,
1139 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001140 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}),
Harald Weltea7d81f12019-06-02 22:33:19 +02001142 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{rlm_cause := ts_RSL_LV(rlm_cause)})
Harald Welte643e2a62017-11-27 15:03:18 +01001143 }
1144 }
Harald Welte9abd1282018-02-19 19:18:17 +01001145 template RSL_Message tr_RSL_ERROR_IND(template RslChannelNr chan_nr, template RslLinkId link_id,
Harald Weltea7d81f12019-06-02 22:33:19 +02001146 template octetstring rlm_cause := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001147 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001148 msg_type := RSL_MT_ERROR_IND,
1149 ies :={
1150 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1151 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
Harald Weltea7d81f12019-06-02 22:33:19 +02001152 tr_RSL_IE(RSL_IE_Body:{rlm_cause := tr_RSL_LV(rlm_cause)})
Harald Welte9abd1282018-02-19 19:18:17 +01001153 }
1154 }
Harald Welte643e2a62017-11-27 15:03:18 +01001155
Harald Welteefa7d912018-04-18 23:22:15 +02001156 /* 8.3.4 BTS <- BSC */
1157 template (value) RSL_Message ts_RSL_EST_REQ(template (value) RslChannelNr chan_nr,
1158 template (value) RslLinkId link_id) := {
1159 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1160 msg_type := RSL_MT_EST_REQ,
1161 ies := {
1162 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1163 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
1164 }
1165 }
1166 template RSL_Message tr_RSL_EST_REQ(template RslChannelNr chan_nr, template RslLinkId link_id) := {
1167 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
1168 msg_type := RSL_MT_EST_REQ,
1169 ies := {
1170 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1171 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1172 }
1173 }
1174
1175 /* 8.3.5 BTS -> BSC */
1176 template (value) RSL_Message ts_RSL_EST_CONF(template (value) RslChannelNr chan_nr,
1177 template (value) RslLinkId link_id) := {
1178 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1179 msg_type := RSL_MT_EST_CONF,
1180 ies := {
1181 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1182 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
1183 }
1184 }
1185 template RSL_Message tr_RSL_EST_CONF(template RslChannelNr chan_nr, template RslLinkId link_id) := {
1186 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
1187 msg_type := RSL_MT_EST_CONF,
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 }
1192 }
1193
Harald Welte643e2a62017-11-27 15:03:18 +01001194 /* 8.3.6 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001195 template (value) RSL_Message ts_RSL_EST_IND(template (value) RslChannelNr chan_nr,
1196 template (value) RslLinkId link_id,
1197 octetstring l3_info) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001198 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1199 msg_type := RSL_MT_EST_IND,
1200 ies := {
Harald Welte735dd072017-12-12 14:55:17 +01001201 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1202 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
1203 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
Harald Welte643e2a62017-11-27 15:03:18 +01001204 }
1205 }
Harald Welte9abd1282018-02-19 19:18:17 +01001206 template RSL_Message tr_RSL_EST_IND(template RslChannelNr chan_nr, template RslLinkId link_id,
1207 template octetstring l3_info := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001208 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001209 msg_type := RSL_MT_EST_IND,
1210 ies := {
1211 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1212 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
1213 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
1214 }
1215 }
Harald Welte0472ab42018-03-12 15:02:26 +01001216 template RSL_Message tr_RSL_EST_IND_NOL3(template RslChannelNr chan_nr, template RslLinkId link_id) :=
1217{
1218 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
1219 msg_type := RSL_MT_EST_IND,
1220 ies := {
1221 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1222 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1223 }
1224 }
1225
Harald Welte643e2a62017-11-27 15:03:18 +01001226
1227 /* 8.3.7 BSC -> BTS */
Harald Welteefa7d912018-04-18 23:22:15 +02001228 template (value) RSL_Message ts_RSL_REL_REQ(template (value) RslChannelNr chan_nr,
Harald Welte0472ab42018-03-12 15:02:26 +01001229 template (value) RslLinkId link_id,
1230 template (value) RSL_IE_ReleaseMode rel_mode := RSL_REL_MODE_NORMAL) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001231 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1232 msg_type := RSL_MT_REL_REQ,
1233 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001234 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
Harald Welte0472ab42018-03-12 15:02:26 +01001235 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
1236 t_RSL_IE(RSL_IE_RELEASE_MODE, RSL_IE_Body:{release_mode := rel_mode})
Harald Welte643e2a62017-11-27 15:03:18 +01001237 }
1238 }
Harald Weltee8a5ab12017-12-09 22:34:57 +01001239 template RSL_Message tr_RSL_REL_REQ(template RslChannelNr chan_nr,
Harald Welte0472ab42018-03-12 15:02:26 +01001240 template RslLinkId link_id,
1241 template RSL_IE_ReleaseMode rel_mode := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001242 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Weltee8a5ab12017-12-09 22:34:57 +01001243 msg_type := RSL_MT_REL_REQ,
1244 ies :={
1245 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1246 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
Harald Welte0472ab42018-03-12 15:02:26 +01001247 tr_RSL_IE(RSL_IE_Body:{release_mode := rel_mode})
Harald Weltee8a5ab12017-12-09 22:34:57 +01001248 }
1249 }
Harald Welte643e2a62017-11-27 15:03:18 +01001250
1251 /* 8.3.8 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001252 template (value) RSL_Message ts_RSL_REL_CONF(template (value) RslChannelNr chan_nr,
1253 template (value) RslLinkId link_id) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001254 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1255 msg_type := RSL_MT_REL_CONF,
1256 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001257 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1258 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
Harald Welte643e2a62017-11-27 15:03:18 +01001259 }
1260 }
Harald Welte9abd1282018-02-19 19:18:17 +01001261 template RSL_Message tr_RSL_REL_CONF(template RslChannelNr chan_nr, template RslLinkId link_id) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001262 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001263 msg_type := RSL_MT_REL_CONF,
1264 ies :={
1265 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1266 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1267 }
1268 }
Harald Welte643e2a62017-11-27 15:03:18 +01001269
1270 /* 8.3.9 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001271 template (value) RSL_Message ts_RSL_REL_IND(template (value) RslChannelNr chan_nr,
1272 template (value) RslLinkId link_id) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001273 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1274 msg_type := RSL_MT_REL_IND,
1275 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001276 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1277 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
Harald Welte643e2a62017-11-27 15:03:18 +01001278 }
1279 }
Harald Welte9abd1282018-02-19 19:18:17 +01001280 template RSL_Message tr_RSL_REL_IND(template RslChannelNr chan_nr, template RslLinkId link_id) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001281 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001282 msg_type := RSL_MT_REL_IND,
1283 ies :={
1284 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1285 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1286 }
1287 }
Harald Welte643e2a62017-11-27 15:03:18 +01001288
1289 /* 8.3.10 BSC -> BTS */
Harald Welteefa7d912018-04-18 23:22:15 +02001290 template (value) RSL_Message ts_RSL_UNITDATA_REQ(template (value) RslChannelNr chan_nr,
1291 template (value) RslLinkId link_id,
1292 octetstring l3_info)
Harald Welte643e2a62017-11-27 15:03:18 +01001293 modifies ts_RSL_DATA_REQ := {
1294 msg_type := RSL_MT_UNIT_DATA_REQ
1295 }
Harald Welte0472ab42018-03-12 15:02:26 +01001296 template RSL_Message tr_RSL_UNITDATA_REQ(template RslChannelNr chan_nr,
1297 template RslLinkId link_id,
Vadim Yanitskiy8f98d3f2018-10-03 17:58:10 +07001298 template octetstring l3_info := ?)
Harald Welte0472ab42018-03-12 15:02:26 +01001299 modifies tr_RSL_DATA_REQ := {
1300 msg_type := RSL_MT_UNIT_DATA_REQ
1301 }
1302
Harald Welte643e2a62017-11-27 15:03:18 +01001303
1304 /* 8.3.11 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001305 template (value) RSL_Message ts_RSL_UNITDATA_IND(template (value) RslChannelNr chan_nr,
1306 template (value) RslLinkId link_id,
1307 octetstring l3_info)
Harald Welte643e2a62017-11-27 15:03:18 +01001308 modifies ts_RSL_DATA_IND := {
1309 msg_type := RSL_MT_UNIT_DATA_IND
1310 }
Harald Welte0472ab42018-03-12 15:02:26 +01001311 template RSL_Message tr_RSL_UNITDATA_IND(template RslChannelNr chan_nr,
Vadim Yanitskiyfabe0f22018-10-03 17:51:47 +07001312 template RslLinkId link_id,
Vadim Yanitskiy8f98d3f2018-10-03 17:58:10 +07001313 template octetstring l3_info := ?)
Harald Welte0472ab42018-03-12 15:02:26 +01001314 modifies tr_RSL_DATA_IND := {
1315 msg_type := RSL_MT_UNIT_DATA_IND
1316 }
1317
1318
Harald Welte643e2a62017-11-27 15:03:18 +01001319
1320
1321 /* DEDICATED CANNEL MANAGEMENT MESSAGES */
1322
1323 /* 8.4.1 BSC -> BTS */
Harald Welteefa7d912018-04-18 23:22:15 +02001324 template (value) RSL_Message ts_RSL_CHAN_ACT(template (value) RslChannelNr chan_nr,
Harald Welte921f9e02019-05-19 22:27:11 +02001325 template (value) RSL_IE_ChannelMode mode,
1326 template (value) RSL_IE_ActivationType at := t_RSL_IE_ActType_IA) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001327 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1328 msg_type := RSL_MT_CHAN_ACTIV,
1329 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001330 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
Harald Welte921f9e02019-05-19 22:27:11 +02001331 t_RSL_IE(RSL_IE_ACT_TYPE, RSL_IE_Body:{act_type := at}),
Harald Welte735dd072017-12-12 14:55:17 +01001332 t_RSL_IE(RSL_IE_CHAN_MODE, RSL_IE_Body:{chan_mode := mode})
Harald Welte643e2a62017-11-27 15:03:18 +01001333 /* lots of optional IEs */
1334 }
1335 }
Harald Welte94e0c342018-04-07 11:33:23 +02001336 template RSL_Message tr_RSL_CHAN_ACT(template RslChannelNr chan_nr,
Harald Welte921f9e02019-05-19 22:27:11 +02001337 template RSL_IE_ChannelMode mode,
1338 template (value) RSL_IE_ActivationType at := t_RSL_IE_ActType_IA) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001339 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte94e0c342018-04-07 11:33:23 +02001340 msg_type := RSL_MT_CHAN_ACTIV,
1341 ies :={
1342 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
Harald Welte921f9e02019-05-19 22:27:11 +02001343 tr_RSL_IE(RSL_IE_Body:{act_type := at}),
Harald Welte94e0c342018-04-07 11:33:23 +02001344 tr_RSL_IE(RSL_IE_Body:{chan_mode := mode}),
1345 /* lots of optional IEs */
1346 *
1347 }
1348 }
1349 template RSL_Message tr_RSL_CHAN_ACT_PDCH(template RslChannelNr chan_nr,
1350 template RSL_IE_ChannelMode mode) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001351 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte94e0c342018-04-07 11:33:23 +02001352 msg_type := RSL_MT_CHAN_ACTIV,
1353 ies :={
1354 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1355 tr_RSL_IE(RSL_IE_Body:{act_type := t_RSL_IE_ActType_PDCH}),
1356 /* lots of optional IEs */
1357 *
1358 }
1359 }
1360
Harald Welte643e2a62017-11-27 15:03:18 +01001361
1362 /* 8.4.2 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001363 template (value) RSL_Message ts_RSL_CHAN_ACT_ACK(template (value) RslChannelNr chan_nr,
1364 GsmFrameNumber fn) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001365 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1366 msg_type := RSL_MT_CHAN_ACTIV_ACK,
1367 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001368 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1369 t_RSL_IE(RSL_IE_FRAME_NUMBER, RSL_IE_Body:{frame_nr := ts_RSL_IE_FrameNumber(fn)})
Harald Welte643e2a62017-11-27 15:03:18 +01001370 }
1371 }
Harald Welte9abd1282018-02-19 19:18:17 +01001372 template RSL_Message tr_RSL_CHAN_ACT_ACK(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001373 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001374 msg_type := RSL_MT_CHAN_ACTIV_ACK,
1375 ies := {
1376 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1377 tr_RSL_IE(RSL_IE_Body:{frame_nr := ?})
1378 }
1379 }
Harald Welte643e2a62017-11-27 15:03:18 +01001380
1381 /* 8.4.3 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001382 template (value) RSL_Message ts_RSL_CHAN_ACT_NACK(template (value) RslChannelNr chan_nr,
1383 RSL_Cause cause) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001384 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1385 msg_type := RSL_MT_CHAN_ACTIV_NACK,
1386 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001387 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1388 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
Harald Welte643e2a62017-11-27 15:03:18 +01001389 }
1390 }
Harald Welte9abd1282018-02-19 19:18:17 +01001391 template RSL_Message tr_RSL_CHAN_ACT_NACK(template RslChannelNr chan_nr,
1392 template RSL_Cause cause := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001393 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001394 msg_type := RSL_MT_CHAN_ACTIV_NACK,
1395 ies := {
1396 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1397 tr_RSL_IE(RSL_IE_Body:{cause := ?})
1398 }
1399 }
Harald Welte643e2a62017-11-27 15:03:18 +01001400
1401 /* 8.4.4 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001402 template (value) RSL_Message ts_RSL_CONN_FAIL_IND(RslChannelNr chan_nr, RSL_Cause cause) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001403 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1404 msg_type := RSL_MT_CONN_FAIL,
1405 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001406 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1407 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
Harald Welte643e2a62017-11-27 15:03:18 +01001408 }
1409 }
Harald Welte9abd1282018-02-19 19:18:17 +01001410 template RSL_Message tr_RSL_CONN_FAIL_IND(template RslChannelNr chan_nr,
1411 template RSL_Cause cause := ?) := {
1412 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1413 msg_type := RSL_MT_CONN_FAIL,
1414 ies :={
1415 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1416 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
1417 }
1418 }
Harald Welte643e2a62017-11-27 15:03:18 +01001419
Harald Weltee8a5ab12017-12-09 22:34:57 +01001420 /* 8.4.5 BSC -> BTS */
1421 template RSL_Message tr_RSL_DEACT_SACCH(template RslChannelNr chan_nr) := {
1422 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1423 msg_type := RSL_MT_DEACTIVATE_SACCH,
1424 ies := {
1425 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
1426 }
1427 }
Harald Welteefa7d912018-04-18 23:22:15 +02001428 template (value) RSL_Message ts_RSL_DEACT_SACCH(template (value) RslChannelNr chan_nr) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001429 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1430 msg_type := RSL_MT_DEACTIVATE_SACCH,
1431 ies := {
1432 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1433 }
1434 }
1435
Harald Weltee8a5ab12017-12-09 22:34:57 +01001436
Harald Welte73cd2712017-12-17 00:44:52 +01001437 /* 8.4.6 BSC ->BTS */
1438 template RSL_Message tr_RSL_ENCR_CMD(template RslChannelNr chan_nr,
1439 template RslLinkId link_id := ?,
Harald Weltee613f962018-04-18 22:38:16 +02001440 template RSL_AlgId alg := ?,
Harald Welte73cd2712017-12-17 00:44:52 +01001441 template octetstring key := ?,
1442 template octetstring l3_info := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001443 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte73cd2712017-12-17 00:44:52 +01001444 msg_type := RSL_MT_ENCR_CMD,
1445 ies := {
1446 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1447 tr_RSL_IE(RSL_IE_Body:{encr_info := tr_RSL_IE_EncrInfo(alg, key)}),
1448 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
1449 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
1450 }
1451 }
Harald Welteefa7d912018-04-18 23:22:15 +02001452 template (value) RSL_Message ts_RSL_ENCR_CMD(template (value) RslChannelNr chan_nr,
1453 template (value) RslLinkId link_id,
Harald Weltee613f962018-04-18 22:38:16 +02001454 template (value) RSL_AlgId alg, octetstring key,
Harald Welteefa7d912018-04-18 23:22:15 +02001455 octetstring l3_info) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001456 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1457 msg_type := RSL_MT_ENCR_CMD,
1458 ies := {
1459 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
Harald Welteefa7d912018-04-18 23:22:15 +02001460 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 +01001461 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
Harald Welteefa7d912018-04-18 23:22:15 +02001462 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
Harald Welte9abd1282018-02-19 19:18:17 +01001463 }
1464 }
Harald Welte73cd2712017-12-17 00:44:52 +01001465
Harald Welte2691adf2018-02-22 17:32:39 +01001466 template RSL_Message tr_RSL_MEAS_RES(template RslChannelNr chan_nr,
1467 template uint8_t meas_res_nr := ?,
1468 template RSL_IE_UplinkMeas ul_meas := ?,
1469 template RSL_IE_BS_Power bs_power := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001470 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte2691adf2018-02-22 17:32:39 +01001471 msg_type := RSL_MT_MEAS_RES,
1472 ies := {
1473 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1474 tr_RSL_IE(RSL_IE_Body:{meas_res_nr := meas_res_nr}),
1475 tr_RSL_IE(RSL_IE_Body:{uplink_meas := ul_meas}),
1476 tr_RSL_IE(RSL_IE_Body:{bs_power := bs_power}),
1477 *
1478 }
1479 }
1480
Philipp Maierdd841d32019-12-17 14:44:54 +01001481 /* Receive template for a measurement report that lacks the measurement report
1482 * from the MS (l1_info, l3_info and ms timing offset */
1483 template RSL_Message tr_RSL_MEAS_RES_EMPTY(template RslChannelNr chan_nr,
1484 template uint8_t meas_res_nr := ?,
1485 template RSL_IE_UplinkMeas ul_meas := ?,
1486 template RSL_IE_BS_Power bs_power := ?) := {
1487 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1488 msg_type := RSL_MT_MEAS_RES,
1489 ies := {
1490 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1491 tr_RSL_IE(RSL_IE_Body:{meas_res_nr := meas_res_nr}),
1492 tr_RSL_IE(RSL_IE_Body:{uplink_meas := ul_meas}),
1493 tr_RSL_IE(RSL_IE_Body:{bs_power := bs_power})
1494 }
1495 }
1496
Harald Welte39b47be2018-02-23 18:58:48 +01001497 /* Osmocom specific template, require lots of optional fields to be present */
1498 template RSL_Message tr_RSL_MEAS_RES_OSMO(template RslChannelNr chan_nr,
1499 template uint8_t meas_res_nr := ?,
1500 template RSL_IE_UplinkMeas ul_meas := ?,
1501 template RSL_IE_BS_Power bs_power := ?,
1502 template RSL_IE_L1Info l1_info := ?,
1503 template octetstring l3_info := ?,
1504 template uint8_t ms_to := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001505 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte39b47be2018-02-23 18:58:48 +01001506 msg_type := RSL_MT_MEAS_RES,
1507 ies := {
1508 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1509 tr_RSL_IE(RSL_IE_Body:{meas_res_nr := meas_res_nr}),
1510 tr_RSL_IE(RSL_IE_Body:{uplink_meas := ul_meas}),
1511 tr_RSL_IE(RSL_IE_Body:{bs_power := bs_power}),
1512 tr_RSL_IE(RSL_IE_Body:{l1_info := l1_info}),
1513 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)}),
1514 tr_RSL_IE(RSL_IE_Body:{ms_timing_offset := ms_to})
1515 }
1516 }
1517
Eric Wildf1827a72019-05-28 17:37:35 +02001518 /* 8.4.9 BSC -> BTS */
1519 template (value) RSL_Message ts_RSL_MODE_MODIFY_REQ(template (value) RslChannelNr chan_nr,
1520 template (value) RSL_IE_ChannelMode mode) := {
1521 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1522 msg_type := RSL_MT_MODE_MODIFY_REQ,
1523 ies :={
1524 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1525 t_RSL_IE(RSL_IE_CHAN_MODE, RSL_IE_Body:{chan_mode := mode})
1526 /* lots of optional IEs */
1527 }
1528 }
1529 template RSL_Message tr_RSL_MODE_MODIFY_REQ(template RslChannelNr chan_nr,
1530 template RSL_IE_ChannelMode mode) := {
1531 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1532 msg_type := RSL_MT_MODE_MODIFY_REQ,
1533 ies :={
1534 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1535 tr_RSL_IE(RSL_IE_Body:{chan_mode := mode}),
1536 /* lots of optional IEs */
1537 *
1538 }
1539 }
Neels Hofmeyr9f3e6ac2021-04-08 23:09:24 +02001540
1541 template RSL_Message tr_RSL_MODE_MODIFY_REQ_with_OSMO_TSC(template RslChannelNr chan_nr,
1542 template RSL_IE_ChannelMode mode,
1543 template uint8_t tsc_set := ?,
1544 template uint8_t tsc := ?) := {
1545 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1546 msg_type := RSL_MT_MODE_MODIFY_REQ,
1547 ies := {
1548 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1549 tr_RSL_IE(RSL_IE_Body:{chan_mode := mode}),
1550 tr_RSL_IE(RSL_IE_Body:{osmo_training_sequence := {
1551 len := ?,
1552 tsc_set := tsc_set,
1553 tsc := tsc
1554 }
1555 })
1556 }
1557 };
Eric Wildf1827a72019-05-28 17:37:35 +02001558
Harald Welte7794d5b2017-12-16 23:00:20 +01001559 /* 8.4.10 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001560 template (value) RSL_Message ts_RSL_MODE_MODIFY_ACK(template (value) RslChannelNr chan_nr) := {
Harald Welte7794d5b2017-12-16 23:00:20 +01001561 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1562 msg_type := RSL_MT_MODE_MODIFY_ACK,
1563 ies := {
1564 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1565 }
1566 }
Harald Welte9abd1282018-02-19 19:18:17 +01001567 template RSL_Message tr_RSL_MODE_MODIFY_ACK(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001568 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001569 msg_type := RSL_MT_MODE_MODIFY_ACK,
1570 ies := {
1571 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
1572 }
1573 }
Harald Welte7794d5b2017-12-16 23:00:20 +01001574
Harald Welte643e2a62017-11-27 15:03:18 +01001575 /* 8.4.11 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001576 template (value) RSL_Message ts_RSL_MODE_MODIFY_NACK(template (value) RslChannelNr chan_nr,
1577 RSL_Cause cause) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001578 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1579 msg_type := RSL_MT_MODE_MODIFY_NACK,
1580 ies := {
1581 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1582 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
1583 }
Harald Welte643e2a62017-11-27 15:03:18 +01001584 }
Harald Welte9abd1282018-02-19 19:18:17 +01001585 template RSL_Message tr_RSL_MODE_MODIFY_NACK(template RslChannelNr chan_nr,
1586 template RSL_Cause cause) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001587 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001588 msg_type := RSL_MT_MODE_MODIFY_NACK,
1589 ies := {
1590 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1591 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
1592 }
1593 }
1594
Harald Welte643e2a62017-11-27 15:03:18 +01001595
Harald Welte6a8199d2018-01-29 21:58:53 +01001596 /* 8.4.14: BTS <- BSC */
1597 template RSL_Message tr_RSL_RF_CHAN_REL(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001598 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte6a8199d2018-01-29 21:58:53 +01001599 msg_type := RSL_MT_RF_CHAN_REL,
1600 ies := {
1601 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
1602 }
1603 }
Harald Welteefa7d912018-04-18 23:22:15 +02001604 template (value) RSL_Message ts_RSL_RF_CHAN_REL(template (value) RslChannelNr chan_nr) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001605 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1606 msg_type := RSL_MT_RF_CHAN_REL,
1607 ies := {
1608 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1609 }
1610 }
Harald Welte6a8199d2018-01-29 21:58:53 +01001611
Philipp Maier4d1e9c92018-12-20 11:11:56 +01001612 /* 8.4.15: BTS <- BSC */
1613 template (value) RSL_Message ts_RSL_MS_PWR_CTRL(template (value) RslChannelNr chan_nr,
1614 template (value) RSL_IE_MS_Power ms_power) := {
1615 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1616 msg_type := RSL_MT_MS_POWER_CONTROL,
1617 ies := {
1618 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1619 t_RSL_IE(RSL_IE_MS_POWER, RSL_IE_Body:{ms_power := ms_power})
1620 /* One optional IE: MS POWER PARAMETERS */
1621 }
1622 }
1623
Eric Wild61edb7e2019-06-03 12:38:31 +02001624 template (value) RSL_Message ts_RSL_MS_PWR_CTRL_with_pp(template (value) RslChannelNr chan_nr,
1625 integer pwr_level) := {
1626 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1627 msg_type := RSL_MT_MS_POWER_CONTROL,
1628 ies := {
1629 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1630 t_RSL_IE(RSL_IE_MS_POWER, RSL_IE_Body:{ms_power := ts_RSL_IE_MS_Power(pwr_level)}),
1631 t_RSL_IE(RSL_IE_MS_POWER_PARAM, RSL_IE_Body:{ms_power_params :=
1632 ts_RSL_IE_MS_Power_Parameters(''O)})
1633 }
1634 }
1635
Eric Wildae8f2622019-06-18 17:05:11 +02001636 /* 8.4.16: BTS <- BSC */
1637 template (value) RSL_Message ts_RSL_BS_PWR_CTRL(template (value) RslChannelNr chan_nr,
1638 template (value) RSL_IE_BS_Power bs_power) := {
1639 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1640 msg_type := RSL_MT_BS_POWER_CONTROL,
1641 ies := {
1642 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1643 t_RSL_IE(RSL_IE_BS_POWER, RSL_IE_Body:{bs_power := bs_power})
1644 /* One optional IE: BS POWER PARAMETERS */
1645 }
1646 }
Vadim Yanitskiy2a5a1ef2021-06-30 00:51:48 +02001647 template RSL_Message tr_RSL_BS_PWR_CTRL(template (present) RslChannelNr chan_nr,
1648 template (present) RSL_IE_BS_Power bs_power) := {
1649 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1650 msg_type := RSL_MT_BS_POWER_CONTROL,
1651 ies := {
1652 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1653 tr_RSL_IE(RSL_IE_Body:{bs_power := bs_power})
1654 /* One optional IE: BS POWER PARAMETERS */
1655 }
1656 }
Eric Wildae8f2622019-06-18 17:05:11 +02001657
Harald Welte4a267362017-12-09 17:49:32 +01001658 /* 8.4.19 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001659 template (value) RSL_Message ts_RSL_RF_CHAN_REL_ACK(template (value) RslChannelNr chan_nr) :=
Harald Welte4a267362017-12-09 17:49:32 +01001660 ts_RSL_MsgDiscType(ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1661 RSL_MT_RF_CHAN_REL_ACK,
Harald Welte735dd072017-12-12 14:55:17 +01001662 { t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}) });
Harald Welte4a267362017-12-09 17:49:32 +01001663
Harald Welte9abd1282018-02-19 19:18:17 +01001664 template RSL_Message tr_RSL_RF_CHAN_REL_ACK(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001665 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001666 msg_type := RSL_MT_RF_CHAN_REL_ACK,
1667 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001668 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
Harald Welte9abd1282018-02-19 19:18:17 +01001669 }
1670 }
1671
Harald Welteea17b912018-03-11 22:29:31 +01001672 /* 8.6.20 BTS <- BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001673 template (value) RSL_Message ts_RSL_SACCH_INF_MOD(template (value) RslChannelNr chan_nr,
1674 RSL_IE_SysinfoType si_type,
1675 octetstring l3_info) := {
Harald Welteea17b912018-03-11 22:29:31 +01001676 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1677 msg_type := RSL_MT_SACCH_INFO_MODIFY,
1678 ies := {
1679 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1680 t_RSL_IE(RSL_IE_SYSINFO_TYPE, RSL_IE_Body:{sysinfo_type := si_type}),
1681 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
1682 }
1683 }
1684
Neels Hofmeyr378a49c2018-06-15 22:18:43 +02001685 /* 8.4.7 BTS -> BSC */
1686 template (value) RSL_Message ts_RSL_HANDO_DET(template (value) RslChannelNr chan_nr) := {
1687 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1688 msg_type := RSL_MT_HANDO_DET,
1689 ies := {
1690 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1691 }
1692 }
Vadim Yanitskiy7c2c10c2019-05-31 20:42:01 +07001693 template RSL_Message tr_RSL_HANDO_DET(template RslChannelNr chan_nr,
1694 template uint8_t acc_delay := ?) := {
1695 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1696 msg_type := RSL_MT_HANDO_DET,
1697 ies := {
1698 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1699 tr_RSL_IE(RSL_IE_Body:{access_delay := acc_delay})
1700 }
1701 }
Neels Hofmeyr378a49c2018-06-15 22:18:43 +02001702
Harald Welteea17b912018-03-11 22:29:31 +01001703
Harald Welte643e2a62017-11-27 15:03:18 +01001704 /* COMMON CHANNEL MANAGEMENT MESSAGES */
1705
Harald Welte874c2232018-02-24 04:52:43 +01001706 /* 8.5.1 BTS <- BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001707 template (value) RSL_Message ts_RSL_BCCH_INFO(RSL_IE_SysinfoType si_type,
1708 octetstring full_bcch_info) := {
Harald Welte874c2232018-02-24 04:52:43 +01001709 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1710 msg_type := RSL_MT_BCCH_INFO,
1711 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001712 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_BCCH(0)}),
Harald Welte874c2232018-02-24 04:52:43 +01001713 t_RSL_IE(RSL_IE_SYSINFO_TYPE, RSL_IE_Body:{sysinfo_type := si_type}),
1714 t_RSL_IE(RSL_IE_FULL_BCCH_INFO, RSL_IE_Body:{other := ts_RSL_LV(full_bcch_info)})
1715 }
1716 }
Harald Welte09538f82019-08-01 09:50:25 +02001717 template RSL_Message tr_RSL_NO_BCCH_INFO(template RSL_IE_SysinfoType si_type := ?) := {
1718 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1719 msg_type := RSL_MT_BCCH_INFO,
1720 ies := {
1721 tr_RSL_IE(RSL_IE_Body:{chan_nr := ts_RslChanNr_BCCH(0)}),
1722 tr_RSL_IE(RSL_IE_Body:{sysinfo_type := si_type})
1723 }
1724 }
1725 template RSL_Message tr_RSL_BCCH_INFO(template RSL_IE_SysinfoType si_type := ?,
1726 template octetstring full_bcch_info := ?) := {
1727 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1728 msg_type := RSL_MT_BCCH_INFO,
1729 ies := {
1730 tr_RSL_IE(RSL_IE_Body:{chan_nr := ts_RslChanNr_BCCH(0)}),
1731 tr_RSL_IE(RSL_IE_Body:{sysinfo_type := si_type}),
1732 tr_RSL_IE(RSL_IE_Body:{other := tr_RSL_LV(full_bcch_info)}),
1733 *
1734 }
1735 }
Harald Welte874c2232018-02-24 04:52:43 +01001736
Harald Welte7ae93142017-12-07 17:56:15 +01001737 /* 8.5.2 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001738 template (value) RSL_Message ts_RSL_RACH_LOAD_IND(uint16_t slot_ct, uint16_t busy_ct,
1739 uint16_t acc_ct) := {
Harald Welte7ae93142017-12-07 17:56:15 +01001740 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1741 msg_type := RSL_MT_CCCH_LOAD_IND,
1742 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001743 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_RACH(0)}),
Harald Welte735dd072017-12-12 14:55:17 +01001744 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 +01001745 }
1746 }
Harald Welte68e495b2018-02-25 00:05:57 +01001747 template RSL_Message tr_RSL_RACH_LOAD_IND(template uint16_t slot_ct := ?,
1748 template uint16_t busy_ct := ?,
Harald Welte09538f82019-08-01 09:50:25 +02001749 template uint16_t acc_ct := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001750 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Welte68e495b2018-02-25 00:05:57 +01001751 msg_type := RSL_MT_CCCH_LOAD_IND,
1752 ies := {
1753 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_RACH(0)}),
1754 tr_RSL_IE(RSL_IE_Body:{rach_load := tr_RSL_IE_RachLoad(slot_ct, busy_ct, acc_ct)})
1755 }
1756 }
1757
Harald Welteefa7d912018-04-18 23:22:15 +02001758 template (value) RSL_Message ts_RSL_PAGING_LOAD_IND(uint16_t buffer_space) := {
Harald Welte7ae93142017-12-07 17:56:15 +01001759 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1760 msg_type := RSL_MT_CCCH_LOAD_IND,
1761 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001762 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_PCH_AGCH(0)}),
Harald Welte735dd072017-12-12 14:55:17 +01001763 t_RSL_IE(RSL_IE_PAGING_LOAD, RSL_IE_Body:{paging_load := buffer_space})
Harald Welte7ae93142017-12-07 17:56:15 +01001764 }
1765 }
Harald Welte68e495b2018-02-25 00:05:57 +01001766 template RSL_Message tr_RSL_PAGING_LOAD_IND(template uint16_t buffer_space := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001767 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Welte68e495b2018-02-25 00:05:57 +01001768 msg_type := RSL_MT_CCCH_LOAD_IND,
1769 ies := {
1770 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(0)}),
1771 tr_RSL_IE(RSL_IE_Body:{paging_load := buffer_space})
1772 }
1773 }
1774
Harald Welte7ae93142017-12-07 17:56:15 +01001775
Harald Welte643e2a62017-11-27 15:03:18 +01001776 /* 8.5.3 BTS -> BSC */
Vadim Yanitskiyab448a52019-05-31 20:24:03 +07001777 template (value) RSL_Message ts_RSL_CHAN_RQD(OCT1 ra, GsmFrameNumber fn,
1778 template (value) RslChannelNr chan_nr := ts_RslChanNr_RACH(0),
1779 uint8_t acc_del := 0) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001780 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1781 msg_type := RSL_MT_CHAN_RQD,
1782 ies := {
Vadim Yanitskiyab448a52019-05-31 20:24:03 +07001783 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1784 /* TODO: we may need to have optional RSL_IE_LINK_IDENT IE here */
Harald Welte735dd072017-12-12 14:55:17 +01001785 t_RSL_IE(RSL_IE_REQ_REFERENCE, RSL_IE_Body:{req_ref := ts_RSL_IE_ReqRef(ra, fn)}),
1786 t_RSL_IE(RSL_IE_ACCESS_DELAY, RSL_IE_Body:{access_delay := acc_del})
Harald Welte643e2a62017-11-27 15:03:18 +01001787 }
1788 }
Harald Welte9abd1282018-02-19 19:18:17 +01001789 template RSL_Message tr_RSL_CHAN_RQD(template OCT1 ra, template GsmFrameNumber fn := ?,
Vadim Yanitskiyab448a52019-05-31 20:24:03 +07001790 template RslChannelNr chan_nr := ts_RslChanNr_RACH(0),
1791 template uint8_t acc_del := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001792 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001793 msg_type := RSL_MT_CHAN_RQD,
1794 ies := {
Vadim Yanitskiyab448a52019-05-31 20:24:03 +07001795 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1796 /* TODO: we may need to have optional RSL_IE_LINK_IDENT IE here */
Harald Welte9abd1282018-02-19 19:18:17 +01001797 tr_RSL_IE(RSL_IE_Body:{req_ref := tr_RSL_IE_ReqRef(ra, fn)}),
1798 tr_RSL_IE(RSL_IE_Body:{access_delay := acc_del})
1799 }
1800 }
Harald Welte643e2a62017-11-27 15:03:18 +01001801
1802 /* 8.5.4 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001803 template (value) RSL_Message ts_DELETE_IND(template (value) RslChannelNr chan_nr,
1804 octetstring imm_ass) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001805 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1806 msg_type := RSL_MT_DELETE_IND,
1807 ies := {
Harald Welte735dd072017-12-12 14:55:17 +01001808 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1809 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 +01001810 }
1811 }
Harald Weltee8d750e2018-06-10 21:41:35 +02001812 template RSL_Message tr_RSL_DELETE_IND(template octetstring imm_ass := ?, template uint3_t tn) := {
1813 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1814 msg_type := RSL_MT_DELETE_IND,
1815 ies := {
1816 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(tn)}),
1817 tr_RSL_IE(RSL_IE_Body:{full_imm_ass_info := tr_RSL_LV(imm_ass)}),
1818 *
1819 }
1820 }
Harald Welte643e2a62017-11-27 15:03:18 +01001821
Harald Weltec2877752017-12-07 17:54:35 +01001822 /* 8.5.5 BSC -> BTS */
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +07001823 template RSL_Message tr_RSL_PAGING_CMD(template MobileIdentityV mi, template uint3_t tn := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001824 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Weltec2877752017-12-07 17:54:35 +01001825 msg_type := RSL_MT_PAGING_CMD,
1826 ies := {
1827 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(tn)}),
1828 tr_RSL_IE(RSL_IE_Body:{paging_group := ?}),
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +07001829 tr_RSL_IE(RSL_IE_Body:{ms_identity := tr_MI_LV(mi)}),
Harald Weltec2877752017-12-07 17:54:35 +01001830 * /* opt: channel needed, eMLPP prio */
1831 }
1832 }
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +07001833 template (value) RSL_Message ts_RSL_PAGING_CMD(MobileIdentityV mi, uint8_t pg, uint3_t tn := 0) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001834 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1835 msg_type := RSL_MT_PAGING_CMD,
1836 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001837 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_PCH_AGCH(tn)}),
Harald Welte9abd1282018-02-19 19:18:17 +01001838 t_RSL_IE(RSL_IE_PAGING_GROUP, RSL_IE_Body:{paging_group := pg}),
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +07001839 t_RSL_IE(RSL_IE_MS_IDENTITY, RSL_IE_Body:{ms_identity := ts_MI_LV(mi)})
Harald Welte9abd1282018-02-19 19:18:17 +01001840 }
1841 }
Harald Weltec2877752017-12-07 17:54:35 +01001842
1843 /* 8.5.6 BSC -> BTS */
1844 template RSL_Message tr_RSL_IMM_ASSIGN(template uint3_t tn := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001845 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Weltec2877752017-12-07 17:54:35 +01001846 msg_type := RSL_MT_IMMEDIATE_ASSIGN_CMD,
1847 ies := {
1848 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(tn)}),
1849 tr_RSL_IE(RSL_IE_Body:{full_imm_ass_info := ?})
1850 }
1851 }
Harald Welteefa7d912018-04-18 23:22:15 +02001852 template (value) RSL_Message ts_RSL_IMM_ASSIGN(octetstring f_ass_inf, uint3_t tn := 0) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001853 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1854 msg_type := RSL_MT_IMMEDIATE_ASSIGN_CMD,
1855 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001856 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_PCH_AGCH(tn)}),
Harald Welte9abd1282018-02-19 19:18:17 +01001857 t_RSL_IE(RSL_IE_FULL_IMM_ASS_INFO, RSL_IE_Body:{full_imm_ass_info := ts_RSL_LV(f_ass_inf)})
1858 }
1859 }
Harald Weltec2877752017-12-07 17:54:35 +01001860
Harald Weltecc373202018-09-10 10:28:21 +02001861 /* 8.5.8 BTS <- BSC SMS BROADCAST COMMAND */
1862 template RSL_Message tr_RSL_SMSCB_CMD(template RSL_IE_CbCommandType cb_cmd := ?,
1863 template octetstring msg := ?,
1864 template RslChannelNr chan_nr := ?) := {
1865 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1866 msg_type := RSL_MT_SMS_BC_CMD,
1867 ies := {
1868 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1869 tr_RSL_IE(RSL_IE_Body:{cb_cmd_type := cb_cmd}),
1870 tr_RSL_IE(RSL_IE_Body:{smscb_message := tr_RSL_LV(msg)}),
1871 *
1872 }
1873 }
1874 template (value) RSL_Message ts_RSL_SMSCB_CMD(template (value) RSL_IE_CbCommandType cb_cmd,
1875 template (value) octetstring msg,
1876 template (value) RslChannelNr chan_nr :=
1877 ts_RslChanNr_SDCCH4(0, 2)) := {
1878 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1879 msg_type := RSL_MT_SMS_BC_CMD,
1880 ies := {
1881 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1882 t_RSL_IE(RSL_IE_CB_CMD_TYPE, RSL_IE_Body:{cb_cmd_type := cb_cmd}),
1883 t_RSL_IE(RSL_IE_SMSCB_MSG, RSL_IE_Body:{smscb_message := ts_RSL_LV(msg)})
1884 /* optional channel type for extended CBCH */
1885 }
1886 }
1887
Harald Welte4a129f82019-05-21 16:35:22 +02001888 /* 8.5.9 BTS -> BSC CBCH LOAD INDICATION */
1889 template RSL_Message tr_RSL_CBCH_LOAD_IND_BASIC(template boolean overflow := ?,
1890 template uint4_t slot_count := ?,
1891 template RslChannelNr chan_nr := ?) := {
1892 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1893 msg_type := RSL_MT_CBCH_LOAD_IND,
1894 ies := {
1895 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1896 tr_RSL_IE(RSL_IE_Body:{cbch_load_info := tr_CbchLoadInfo(overflow, slot_count)})
1897 }
1898 }
1899 template (value) RSL_Message ts_RSL_CBCH_LOAD_IND_BASIC(boolean overflow, uint4_t slot_count,
1900 template (value) RslChannelNr chan_nr :=
1901 ts_RslChanNr_SDCCH4(0, 2)) := {
1902 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1903 msg_type := RSL_MT_CBCH_LOAD_IND,
1904 ies := {
1905 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1906 t_RSL_IE(RSL_IE_CBCH_LOAD_INFO, RSL_IE_Body:{cbch_load_info := ts_CbchLoadInfo(overflow, slot_count)})
1907 }
1908 }
1909 template RSL_Message tr_RSL_CBCH_LOAD_IND_EXTD(template boolean overflow := ?,
1910 template uint4_t slot_count := ?,
1911 template RslChannelNr chan_nr := ?) := {
1912 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1913 msg_type := RSL_MT_CBCH_LOAD_IND,
1914 ies := {
1915 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1916 tr_RSL_IE(RSL_IE_Body:{cbch_load_info := tr_CbchLoadInfo(overflow, slot_count)}),
1917 tr_RSL_IE(RSL_IE_Body:{smscb_chan_ind := 1})
1918 }
1919 }
1920 template (value) RSL_Message ts_RSL_CBCH_LOAD_IND_EXTD(boolean overflow, uint4_t slot_count,
1921 template (value) RslChannelNr chan_nr :=
1922 ts_RslChanNr_SDCCH4(0, 2)) := {
1923 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1924 msg_type := RSL_MT_CBCH_LOAD_IND,
1925 ies := {
1926 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1927 t_RSL_IE(RSL_IE_CBCH_LOAD_INFO, RSL_IE_Body:{cbch_load_info := ts_CbchLoadInfo(overflow, slot_count)}),
1928 t_RSL_IE(RSL_IE_SMSCB_CHAN_INDICATOR, RSL_IE_Body:{smscb_chan_ind := 1})
1929 }
1930 }
1931
1932
Vadim Yanitskiy9f699532021-06-03 17:29:22 +02001933 /* 8.6.1 BTS -> BSC */
1934 template (value) RSL_Message
1935 ts_RSL_RF_RES_IND(template (value) RSL_ResourceInfo info) := {
1936 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
1937 msg_type := RSL_MT_RF_RES_IND,
1938 ies := {
1939 t_RSL_IE(RSL_IE_RESOURCE_INFO, RSL_IE_Body:{
1940 resource_info := {
1941 len := 0, /* overwritten */
1942 info := info
1943 }
1944 })
1945 }
1946 }
1947 template RSL_Message
1948 tr_RSL_RF_RES_IND(template (present) RSL_ResourceInfo info := ?) := {
1949 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
1950 msg_type := RSL_MT_RF_RES_IND,
1951 ies := {
1952 tr_RSL_IE(RSL_IE_Body:{
1953 resource_info := {
1954 len := ?,
1955 info := info
1956 }
1957 })
1958 }
1959 }
1960
1961
Harald Welte68e495b2018-02-25 00:05:57 +01001962 /* 8.6.2 BTS <- BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001963 template (value) RSL_Message ts_RSL_SACCH_FILL(RSL_IE_SysinfoType si_type, octetstring l3_info) := {
Harald Welte68e495b2018-02-25 00:05:57 +01001964 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
1965 msg_type := RSL_MT_SACCH_FILL,
1966 ies := {
1967 t_RSL_IE(RSL_IE_SYSINFO_TYPE, RSL_IE_Body:{sysinfo_type := si_type}),
1968 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
1969 }
1970 }
Harald Welte09538f82019-08-01 09:50:25 +02001971 template RSL_Message tr_RSL_NO_SACCH_FILL(template RSL_IE_SysinfoType si_type := ?) := {
1972 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
1973 msg_type := RSL_MT_SACCH_FILL,
1974 ies := {
1975 tr_RSL_IE(RSL_IE_Body:{sysinfo_type := si_type})
1976 }
1977 }
1978 template RSL_Message tr_RSL_SACCH_FILL(template RSL_IE_SysinfoType si_type := ?,
1979 template octetstring l3_info := ?) := {
1980 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
1981 msg_type := RSL_MT_SACCH_FILL,
1982 ies := {
1983 tr_RSL_IE(RSL_IE_Body:{sysinfo_type := si_type}),
1984 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)}),
1985 *
1986 }
1987 }
1988
Harald Welte68e495b2018-02-25 00:05:57 +01001989
Harald Welte643e2a62017-11-27 15:03:18 +01001990 /* 8.6.4 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001991 template (value) RSL_Message ts_RSL_ERROR_REPORT(RSL_Cause cause) := {
Harald Welte01d982c2018-02-25 01:31:40 +01001992 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
1993 msg_type := RSL_MT_ERROR_REPORT,
Harald Welte643e2a62017-11-27 15:03:18 +01001994 ies := {
Harald Welte735dd072017-12-12 14:55:17 +01001995 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
Harald Welte643e2a62017-11-27 15:03:18 +01001996 }
1997 }
Harald Welte01d982c2018-02-25 01:31:40 +01001998 template RSL_Message tr_RSL_ERROR_REPORT(template RSL_Cause cause := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001999 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
Harald Welte01d982c2018-02-25 01:31:40 +01002000 msg_type := RSL_MT_ERROR_REPORT,
2001 ies := {
2002 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)}),
2003 *
2004 }
2005 }
2006
Harald Welte643e2a62017-11-27 15:03:18 +01002007
Harald Welte9958a4d2017-12-14 21:21:33 +01002008
2009 /* Abis/IP specific messages */
2010
2011 template RSL_Message tr_RSL_IPA_CRCX(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002012 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002013 msg_type := RSL_MT_IPAC_CRCX,
2014 ies := {
2015 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2016 *
2017 }
2018 }
Vadim Yanitskiye9141c22021-07-03 01:45:40 +02002019 template (value) RSL_Message
2020 ts_RSL_IPA_CRCX(template (value) RslChannelNr chan_nr,
Vadim Yanitskiyfc631642021-07-03 02:42:45 +02002021 template (value) OCT4 remote_ip := '7F000001'O,
Vadim Yanitskiye9141c22021-07-03 01:45:40 +02002022 template (value) uint16_t remote_port := 6766) := {
Harald Welte9abd1282018-02-19 19:18:17 +01002023 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2024 msg_type := RSL_MT_IPAC_CRCX,
2025 ies := {
Vadim Yanitskiye9141c22021-07-03 01:45:40 +02002026 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2027 t_RSL_IE(RSL_IE_IPAC_REMOTE_IP, RSL_IE_Body:{ipa_remote_ip := remote_ip}),
2028 t_RSL_IE(RSL_IE_IPAC_REMOTE_PORT, RSL_IE_Body:{ipa_remote_port := remote_port})
Harald Welte9abd1282018-02-19 19:18:17 +01002029 }
2030 }
2031
Harald Welte9958a4d2017-12-14 21:21:33 +01002032
Harald Welteefa7d912018-04-18 23:22:15 +02002033 template (value) RSL_Message ts_RSL_IPA_CRCX_ACK(template (value) RslChannelNr chan_nr,
Vadim Yanitskiyfc631642021-07-03 02:42:45 +02002034 uint16_t ipa_conn_id, OCT4 local_ip,
Harald Welteefa7d912018-04-18 23:22:15 +02002035 uint16_t local_port, uint7_t rtp_pt2) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002036 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2037 msg_type := RSL_MT_IPAC_CRCX_ACK,
2038 ies := {
2039 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2040 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2041 t_RSL_IE(RSL_IE_IPAC_LOCAL_IP, RSL_IE_Body:{ipa_local_ip := local_ip}),
2042 t_RSL_IE(RSL_IE_IPAC_LOCAL_PORT, RSL_IE_Body:{ipa_local_port := local_port}),
2043 t_RSL_IE(RSL_IE_IPAC_RTP_PAYLOAD2, RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
2044 }
2045 }
Harald Welte9abd1282018-02-19 19:18:17 +01002046 template RSL_Message tr_RSL_IPA_CRCX_ACK(template RslChannelNr chan_nr,
2047 template uint16_t ipa_conn_id,
Vadim Yanitskiyfc631642021-07-03 02:42:45 +02002048 template OCT4 local_ip,
Harald Welte8bd0f822018-02-25 12:43:28 +01002049 template uint16_t local_port) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002050 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9abd1282018-02-19 19:18:17 +01002051 msg_type := RSL_MT_IPAC_CRCX_ACK,
2052 ies := {
2053 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2054 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2055 tr_RSL_IE(RSL_IE_Body:{ipa_local_ip := local_ip}),
Harald Welte8bd0f822018-02-25 12:43:28 +01002056 tr_RSL_IE(RSL_IE_Body:{ipa_local_port := local_port})
2057 /* Optional: RTP Payload Type 2 IE */
Harald Welte9abd1282018-02-19 19:18:17 +01002058 }
2059 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002060
Harald Welteefa7d912018-04-18 23:22:15 +02002061 template (value) RSL_Message ts_RSL_IPA_CRCX_NACK(template (value) RslChannelNr chan_nr,
2062 RSL_Cause cause) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002063 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2064 msg_type := RSL_MT_IPAC_CRCX_NACK,
2065 ies := {
2066 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2067 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2068 }
2069 }
Harald Welte9abd1282018-02-19 19:18:17 +01002070 template RSL_Message tr_RSL_IPA_CRCX_NACK(template RslChannelNr chan_nr,
2071 template RSL_Cause cause := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002072 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9abd1282018-02-19 19:18:17 +01002073 msg_type := RSL_MT_IPAC_CRCX_NACK,
2074 ies := {
2075 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2076 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
2077 }
2078 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002079
Harald Welteefa7d912018-04-18 23:22:15 +02002080 template (value) RSL_Message ts_RSL_IPA_MDCX(template (value) RslChannelNr chan_nr,
2081 uint16_t ipa_conn_id,
Vadim Yanitskiyfc631642021-07-03 02:42:45 +02002082 OCT4 remote_ip, uint16_t remote_port,
Harald Welteefa7d912018-04-18 23:22:15 +02002083 uint7_t rtp_pt2) := {
Harald Welte30527452018-02-25 12:46:25 +01002084 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2085 msg_type := RSL_MT_IPAC_MDCX,
2086 ies := {
2087 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2088 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2089 t_RSL_IE(RSL_IE_IPAC_REMOTE_IP, RSL_IE_Body:{ipa_remote_ip := remote_ip}),
2090 t_RSL_IE(RSL_IE_IPAC_REMOTE_PORT, RSL_IE_Body:{ipa_remote_port := remote_port}),
2091 /* optional: RTP Payload Type */
2092 t_RSL_IE(RSL_IE_IPAC_RTP_PAYLOAD2, RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
2093 }
2094 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002095 template RSL_Message tr_RSL_IPA_MDCX(template RslChannelNr chan_nr,
2096 template uint16_t ipa_conn_id) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002097 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002098 msg_type := RSL_MT_IPAC_MDCX,
2099 ies := {
2100 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2101 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2102 *
2103 }
2104 }
2105
Harald Welteefa7d912018-04-18 23:22:15 +02002106 template (value) RSL_Message ts_RSL_IPA_MDCX_ACK(template (value) RslChannelNr chan_nr,
2107 uint16_t ipa_conn_id,
Vadim Yanitskiyfc631642021-07-03 02:42:45 +02002108 OCT4 local_ip, uint16_t local_port,
Harald Welteefa7d912018-04-18 23:22:15 +02002109 uint7_t rtp_pt2) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002110 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte71b5ec82017-12-16 23:01:10 +01002111 msg_type := RSL_MT_IPAC_MDCX_ACK,
Harald Welte9958a4d2017-12-14 21:21:33 +01002112 ies := {
2113 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2114 /* optional */
2115 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
Harald Welte6cb400a2018-02-25 12:45:25 +01002116 t_RSL_IE(RSL_IE_IPAC_LOCAL_IP, RSL_IE_Body:{ipa_local_ip := local_ip}),
2117 t_RSL_IE(RSL_IE_IPAC_LOCAL_PORT, RSL_IE_Body:{ipa_local_port := local_port}),
Harald Welte9958a4d2017-12-14 21:21:33 +01002118 /* optional: RTP Payload Type */
2119 t_RSL_IE(RSL_IE_IPAC_RTP_PAYLOAD2, RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
2120 }
2121 }
Harald Welte30527452018-02-25 12:46:25 +01002122 template RSL_Message tr_RSL_IPA_MDCX_ACK(template RslChannelNr chan_nr,
2123 template uint16_t ipa_conn_id,
Vadim Yanitskiyfc631642021-07-03 02:42:45 +02002124 template OCT4 local_ip,
Harald Welte30527452018-02-25 12:46:25 +01002125 template uint16_t local_port,
2126 template uint7_t rtp_pt2) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002127 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte30527452018-02-25 12:46:25 +01002128 msg_type := RSL_MT_IPAC_MDCX_ACK,
2129 ies := {
2130 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2131 /* optional */
2132 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2133 tr_RSL_IE(RSL_IE_Body:{ipa_local_ip := local_ip}),
2134 tr_RSL_IE(RSL_IE_Body:{ipa_local_port := local_port}),
2135 /* optional: RTP Payload Type */
2136 tr_RSL_IE(RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
2137 }
2138 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002139
Harald Welteefa7d912018-04-18 23:22:15 +02002140 template (value) RSL_Message ts_RSL_IPA_MDCX_NACK(template (value) RslChannelNr chan_nr,
2141 RSL_Cause cause,
2142 template (value) uint16_t ipa_conn_id) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002143 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2144 msg_type := RSL_MT_IPAC_MDCX_NACK,
2145 ies := {
2146 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2147 /* optional connection ID */
2148 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2149 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2150 }
2151 }
Harald Welte30527452018-02-25 12:46:25 +01002152 template RSL_Message tr_RSL_IPA_MDCX_NACK(template RslChannelNr chan_nr,
2153 template RSL_Cause cause,
2154 template uint16_t ipa_conn_id) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002155 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte30527452018-02-25 12:46:25 +01002156 msg_type := RSL_MT_IPAC_MDCX_NACK,
2157 ies := {
2158 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2159 /* optional connection ID */
2160 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2161 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
2162 }
2163 }
2164
Harald Welte9958a4d2017-12-14 21:21:33 +01002165
Harald Welteefa7d912018-04-18 23:22:15 +02002166 template (value) RSL_Message ts_RSL_IPA_DLCX_IND(template (value) RslChannelNr chan_nr,
2167 uint16_t ipa_conn_id,
2168 template (value) RSL_IE_IPA_ConnectionStats stats,
2169 RSL_Cause cause) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002170 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2171 msg_type := RSL_MT_IPAC_DLCX_IND,
2172 ies := {
2173 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2174 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2175 t_RSL_IE(RSL_IE_IPAC_CONN_STAT, RSL_IE_Body:{ipa_stats := stats}),
2176 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2177 }
2178 }
2179
Harald Welteefa7d912018-04-18 23:22:15 +02002180 template (value) RSL_Message ts_RSL_IPA_DLCX(template (value) RslChannelNr chan_nr,
2181 uint16_t ipa_conn_id) := {
Harald Weltea871a382018-02-25 02:03:14 +01002182 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2183 msg_type := RSL_MT_IPAC_DLCX,
2184 ies := {
Harald Welte2a7e7162018-02-25 12:46:48 +01002185 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2186 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id})
Harald Weltea871a382018-02-25 02:03:14 +01002187 }
2188 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002189 template RSL_Message tr_RSL_IPA_DLCX(template RslChannelNr chan_nr,
2190 template uint16_t ipa_conn_id := omit) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002191 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002192 msg_type := RSL_MT_IPAC_DLCX,
2193 ies := {
2194 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2195 /* FIXME: optional conn_id */
2196 *
2197 }
2198 }
2199
Harald Welteefa7d912018-04-18 23:22:15 +02002200 template (value) RSL_Message ts_RSL_IPA_DLCX_ACK(template (value) RslChannelNr chan_nr,
2201 uint16_t ipa_conn_id,
2202 RSL_IE_IPA_ConnectionStats stats) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002203 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2204 msg_type := RSL_MT_IPAC_DLCX_ACK,
2205 ies := {
2206 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2207 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2208 t_RSL_IE(RSL_IE_IPAC_CONN_STAT, RSL_IE_Body:{ipa_stats := stats})
2209 }
2210 }
Harald Weltea871a382018-02-25 02:03:14 +01002211 template RSL_Message tr_RSL_IPA_DLCX_ACK(template RslChannelNr chan_nr,
2212 template uint16_t ipa_conn_id,
2213 template RSL_IE_IPA_ConnectionStats stats) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002214 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Weltea871a382018-02-25 02:03:14 +01002215 msg_type := RSL_MT_IPAC_DLCX_ACK,
2216 ies := {
2217 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2218 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2219 tr_RSL_IE(RSL_IE_Body:{ipa_stats := stats})
2220 }
2221 }
2222
2223
Harald Welte9958a4d2017-12-14 21:21:33 +01002224
Harald Welteefa7d912018-04-18 23:22:15 +02002225 template (value) RSL_Message ts_RSL_IPA_DLCX_NACK(template (value) RslChannelNr chan_nr,
2226 RSL_Cause cause, uint16_t ipa_conn_id) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002227 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2228 msg_type := RSL_MT_IPAC_DLCX_NACK,
2229 ies := {
2230 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2231 /* optional connection ID */
2232 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2233 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2234 }
2235 }
Harald Weltea871a382018-02-25 02:03:14 +01002236 template RSL_Message tr_RSL_IPA_DLCX_NACK(template RslChannelNr chan_nr,
2237 template RSL_Cause cause) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002238 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Weltea871a382018-02-25 02:03:14 +01002239 msg_type := RSL_MT_IPAC_DLCX_NACK,
2240 ies := {
2241 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2242 /* optional connection ID */
2243 *,
2244 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
2245 }
2246 }
2247
Harald Welte9958a4d2017-12-14 21:21:33 +01002248
Harald Welteefa7d912018-04-18 23:22:15 +02002249 template (value) RSL_Message ts_RSL_IPA_PDCH_ACT(RslChannelNr chan_nr) := {
Harald Welteee19c732018-04-05 09:08:26 +02002250 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2251 msg_type := RSL_MT_IPAC_PDCH_ACT,
2252 ies := {
2253 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
2254 }
2255 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002256 template RSL_Message tr_RSL_IPA_PDCH_ACT(template RslChannelNr chan_nr) := {
Harald Welteee19c732018-04-05 09:08:26 +02002257 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002258 msg_type := RSL_MT_IPAC_PDCH_ACT,
2259 ies := {
2260 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
2261 }
2262 }
2263
Harald Welteee19c732018-04-05 09:08:26 +02002264
Harald Welte94e0c342018-04-07 11:33:23 +02002265 template RSL_Message ts_RSL_IPA_PDCH_ACT_ACK(RslChannelNr chan_nr,
2266 template (value) RSL_IE_FrameNumber fn) := {
Harald Welteee19c732018-04-05 09:08:26 +02002267 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002268 msg_type := RSL_MT_IPAC_PDCH_ACT_ACK,
2269 ies := {
2270 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2271 t_RSL_IE(RSL_IE_FRAME_NUMBER, RSL_IE_Body:{frame_nr := fn})
2272 }
2273 }
Harald Welteee19c732018-04-05 09:08:26 +02002274 template RSL_Message tr_RSL_IPA_PDCH_ACT_ACK(template RslChannelNr chan_nr,
2275 template RSL_IE_FrameNumber fn) := {
2276 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2277 msg_type := RSL_MT_IPAC_PDCH_ACT_ACK,
2278 ies := {
2279 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2280 tr_RSL_IE(RSL_IE_Body:{frame_nr := fn})
2281 }
2282 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002283
2284 template RSL_Message ts_RSL_IPA_PDCH_ACT_NACK(RslChannelNr chan_nr, RSL_Cause cause) := {
Harald Welteee19c732018-04-05 09:08:26 +02002285 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002286 msg_type := RSL_MT_IPAC_PDCH_ACT_NACK,
2287 ies := {
2288 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2289 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2290 }
2291 }
Harald Welteee19c732018-04-05 09:08:26 +02002292 template RSL_Message tr_RSL_IPA_PDCH_ACT_NACK(template RslChannelNr chan_nr,
2293 template RSL_Cause cause) := {
2294 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2295 msg_type := RSL_MT_IPAC_PDCH_ACT_NACK,
2296 ies := {
2297 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2298 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
2299 }
2300 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002301
Harald Welteee19c732018-04-05 09:08:26 +02002302 template RSL_Message ts_RSL_IPA_PDCH_DEACT(RslChannelNr chan_nr) := {
2303 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2304 msg_type := RSL_MT_IPAC_PDCH_DEACT,
2305 ies := {
2306 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
2307 }
2308 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002309 template RSL_Message tr_RSL_IPA_PDCH_DEACT(template RslChannelNr chan_nr) := {
Harald Welteee19c732018-04-05 09:08:26 +02002310 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002311 msg_type := RSL_MT_IPAC_PDCH_DEACT,
2312 ies := {
2313 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
2314 }
2315 }
2316
2317 template RSL_Message ts_RSL_IPA_PDCH_DEACT_ACK(RslChannelNr chan_nr) := {
Harald Welteee19c732018-04-05 09:08:26 +02002318 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002319 msg_type := RSL_MT_IPAC_PDCH_DEACT_ACK,
2320 ies := {
2321 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
2322 }
2323 }
Harald Welteee19c732018-04-05 09:08:26 +02002324 template RSL_Message tr_RSL_IPA_PDCH_DEACT_ACK(template RslChannelNr chan_nr) := {
2325 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2326 msg_type := RSL_MT_IPAC_PDCH_DEACT_ACK,
2327 ies := {
2328 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
2329 }
2330 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002331
2332 template RSL_Message ts_RSL_IPA_PDCH_DEACT_NACK(RslChannelNr chan_nr, RSL_Cause cause) := {
Harald Welteee19c732018-04-05 09:08:26 +02002333 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002334 msg_type := RSL_MT_IPAC_PDCH_DEACT_NACK,
2335 ies := {
2336 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2337 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2338 }
2339 }
Harald Welteee19c732018-04-05 09:08:26 +02002340 template RSL_Message tr_RSL_IPA_PDCH_DEACT_NACK(template RslChannelNr chan_nr,
2341 template RSL_Cause cause) := {
2342 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2343 msg_type := RSL_MT_IPAC_PDCH_DEACT_NACK,
2344 ies := {
2345 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2346 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
2347 }
2348 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002349
Harald Welte908ce542019-09-04 23:05:40 +02002350 template (value) RSL_Message ts_RSL_OSMO_ETWS_CMD(template (value) octetstring msg,
2351 template (value) RslChannelNr chan_nr := ts_RslChanNr_PCH_AGCH(0)) := {
2352 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2353 msg_type := RSL_MT_OSMO_ETWS_CMD,
2354 ies := {
2355 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2356 t_RSL_IE(RSL_IE_SMSCB_MSG, RSL_IE_Body:{smscb_message := ts_RSL_LV(msg)})
2357 }
2358 }
2359 template RSL_Message tr_RSL_OSMO_ETWS_CMD(template RslChannelNr chan_nr := ?,
2360 template octetstring msg := ?) := {
2361 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2362 msg_type := RSL_MT_OSMO_ETWS_CMD,
2363 ies := {
2364 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2365 tr_RSL_IE(RSL_IE_Body:{smscb_message := tr_RSL_LV(msg)})
2366 }
2367 }
2368
2369
Harald Welte9958a4d2017-12-14 21:21:33 +01002370
Harald Welte6a8199d2018-01-29 21:58:53 +01002371 function f_rsl_find_ie(RSL_Message msg, RSL_IE_Type iei, out RSL_IE_Body ret) return boolean {
2372 for (var integer i := 0; i < sizeof(msg.ies); i := i+1) {
2373 if (msg.ies[i].iei == iei) {
2374 ret := msg.ies[i].body;
2375 return true;
2376 }
2377 }
2378 return false;
2379 }
2380
2381
Harald Welte9958a4d2017-12-14 21:21:33 +01002382
Harald Welte643e2a62017-11-27 15:03:18 +01002383} with { encode "RAW" ; variant "FIELDORDER(msb)" }