blob: 05effa2cd26be4a8ee8c0fcf0c203c3452a8b8f6 [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
223 /* ip.access */
224 RSL_IE_IPAC_SRTP_CONFIG ('11100000'B),
Harald Welte319be822017-12-07 17:50:26 +0100225 RSL_IE_IPAC_PROXY_UDP ('11100001'B),
226 RSL_IE_IPAC_BSCMPL_TOUT ('11100010'B),
Harald Welte643e2a62017-11-27 15:03:18 +0100227
228 RSL_IE_IPAC_REMOTE_IP ('11110000'B),
Harald Welte319be822017-12-07 17:50:26 +0100229 RSL_IE_IPAC_REMOTE_PORT ('11110001'B),
230 RSL_IE_IPAC_RTP_PAYLOAD ('11110010'B),
231 RSL_IE_IPAC_LOCAL_PORT ('11110011'B),
232 RSL_IE_IPAC_SPEECH_MODE ('11110100'B),
233 RSL_IE_IPAC_LOCAL_IP ('11110101'B),
234 RSL_IE_IPAC_CONN_STAT ('11110110'B),
235 RSL_IE_IPAC_HO_C_PARMS ('11110111'B),
236 RSL_IE_IPAC_CONN_ID ('11111000'B),
237 RSL_IE_IPAC_RTP_CSD_FMT ('11111001'B),
238 RSL_IE_IPAC_RTP_JIT_BUF ('11111010'B),
239 RSL_IE_IPAC_RTP_COMPR ('11111011'B),
240 RSL_IE_IPAC_RTP_PAYLOAD2 ('11111100'B),
241 RSL_IE_IPAC_RTP_MPLEX ('11111101'B),
242 RSL_IE_IPAC_RTP_MPLEX_ID ('11111110'B)
Harald Welte643e2a62017-11-27 15:03:18 +0100243 } with { variant "FIELDLENGTH(8)" };
244
245 type record RSL_LV {
246 uint8_t len,
247 octetstring payload
248 } with { variant (len) "LENGTHTO(payload)" }
249
Harald Welteefa7d912018-04-18 23:22:15 +0200250 template (value) RSL_LV ts_RSL_LV(template (value) octetstring pl) := {
Harald Welte643e2a62017-11-27 15:03:18 +0100251 len := 0,
252 payload := pl
253 }
254
Harald Welte51d74102017-12-10 23:05:02 +0100255 template RSL_LV tr_RSL_LV(template octetstring pl) := {
256 len := ?,
257 payload := pl
258 }
259
Harald Welte15bb5b52017-12-07 17:52:04 +0100260 type record RSL_L16V {
261 uint16_t len,
262 octetstring payload
263 } with { variant (len) "LENGTHTO(payload)" }
264
Harald Welteefa7d912018-04-18 23:22:15 +0200265 template (value) RSL_L16V ts_RSL_L16V(template (value) octetstring pl) := {
Harald Welte15bb5b52017-12-07 17:52:04 +0100266 len := 0,
267 payload := pl
268 }
269
Harald Welte7794d5b2017-12-16 23:00:20 +0100270 template RSL_L16V tr_RSL_L16V(template octetstring pl) := {
271 len := ?,
272 payload := pl
273 }
274
Harald Welte643e2a62017-11-27 15:03:18 +0100275 type record RSL_IE_V {
276 uint8_t val
277 }
278
279 /* 9.3.3 */
280 type record RSL_IE_ActivationType {
281 boolean reactivation,
282 uint4_t reserved,
Harald Welte921f9e02019-05-19 22:27:11 +0200283 RSL_ActivationAbits a_bits
284 };
285 type enumerated RSL_ActivationAbits {
286 ACT_REL_TO_IMM_ASSIGN ('000'B),
287 ACT_REL_TO_NORM_ASSIGN ('001'B),
288 ACT_REL_TO_ASYNC_HANDOVER ('010'B),
289 ACT_REL_TO_SYNC_HANDOVER ('011'B),
290 ACT_REL_TO_ADDL_ASSIGN ('100'B),
291 ACT_REL_TO_MSLOT_CONFIG ('101'B),
292 ACT_REL_TO_OSMO_PDCH ('111'B)
293 } with { variant "FIELDLENGTH(3)" };
Harald Welte643e2a62017-11-27 15:03:18 +0100294
Harald Welte921f9e02019-05-19 22:27:11 +0200295 const RSL_IE_ActivationType t_RSL_IE_ActType_IA := {
Harald Welte643e2a62017-11-27 15:03:18 +0100296 reactivation := false,
297 reserved := 0,
Harald Welte921f9e02019-05-19 22:27:11 +0200298 a_bits := ACT_REL_TO_IMM_ASSIGN
299 }
300 const RSL_IE_ActivationType t_RSL_IE_ActType_ASS := {
301 reactivation := false,
302 reserved := 0,
303 a_bits := ACT_REL_TO_NORM_ASSIGN
304 }
305 const RSL_IE_ActivationType t_RSL_IE_ActType_HO_ASYNC := {
306 reactivation := false,
307 reserved := 0,
308 a_bits := ACT_REL_TO_ASYNC_HANDOVER
309 }
310 const RSL_IE_ActivationType t_RSL_IE_ActType_HO_SYNC := {
311 reactivation := false,
312 reserved := 0,
313 a_bits := ACT_REL_TO_SYNC_HANDOVER
Harald Welte643e2a62017-11-27 15:03:18 +0100314 }
315
Harald Welte94e0c342018-04-07 11:33:23 +0200316 /* osmocom-style dynamic PDCH */
Harald Welte921f9e02019-05-19 22:27:11 +0200317 const RSL_IE_ActivationType t_RSL_IE_ActType_PDCH := {
Harald Welte94e0c342018-04-07 11:33:23 +0200318 reactivation := false,
319 reserved := 1,
Harald Welte921f9e02019-05-19 22:27:11 +0200320 a_bits := ACT_REL_TO_OSMO_PDCH
Harald Welte94e0c342018-04-07 11:33:23 +0200321 }
322
Vadim Yanitskiye02dbcc2020-08-25 04:20:51 +0700323 /* 9.3.5 */
324 type record RSL_IE_ChannelIdent {
325 uint8_t len,
326 /* 3GPP TS 44.018 Channel Description IE (TV) */
327 ChannelDescriptionTV ch_desc,
328 /* 3GPP TS 44.018 Mobile Allocation IE (shall be empty) */
329 MobileAllocationTLV ma
330 } with { variant (len) "LENGTHTO(ch_desc,ma)" };
331
332 template (value) RSL_IE_ChannelIdent
333 ts_RSL_ChannelIdent(template (value) ChannelDescription ch_desc) := {
334 len := 0, /* overwritten */
335 ch_desc := {
336 iei := '64'O,
337 v := ch_desc
338 },
339 /* Shall be included but empty */
340 ma := {
341 iei := '72'O,
342 v := {
343 len := 0,
344 ma := ''B
345 }
346 }
347 };
348
349 template RSL_IE_ChannelIdent
350 tr_RSL_ChannelIdent(template (present) ChannelDescription ch_desc := ?,
351 template (present) MobileAllocationLV ma := ?) := {
352 len := ?,
353 ch_desc := {
354 iei := '64'O,
355 v := ch_desc
356 },
357 /* Shall be included but empty */
358 ma := {
359 iei := '72'O,
360 v := ma
361 }
362 };
363
Harald Welte643e2a62017-11-27 15:03:18 +0100364 /* 9.3.6 */
365 type enumerated RSL_SpeechDataInd {
366 RSL_SPDI_SPEECH ('00000001'B),
367 RSL_SPDI_DATA ('00000010'B),
368 RSL_SPDI_SIGN ('00000011'B)
369 } with { variant "FIELDLENGTH(8)" };
370 type enumerated RSL_ChanRateType {
371 RSL_CHRT_SDCCH ('00000001'B),
372 RSL_CHRT_TCH_F ('00001000'B),
373 RSL_CHRT_TCH_H ('00001001'B),
374 RSL_CHRT_TCH_F_BD_MSLOT ('00001010'B),
375 RSL_CHRT_TCH_F_DL_MSLOT ('00011010'B),
376 RSL_CHRT_TCH_F_GROUP ('00011000'B),
377 RSL_CHRT_TCH_H_GROUP ('00011001'B),
378 RSL_CHRT_TCH_F_BCAST ('00101000'B),
379 RSL_CHRT_TCH_H_BCAST ('00101001'B)
380 } with { variant "FIELDLENGTH(8)" };
381 type enumerated RSL_SpeechAlgo {
382 RSL_CMOD_NO_RESOURCE ('00000000'B),
383 RSL_CMOD_SP_GSM1 ('00000001'B),
384 RSL_CMOD_SP_GSM2 ('00010001'B),
385 RSL_CMOD_SP_GSM3 ('00100001'B),
386 RSL_CMOD_SP_GSM4 ('00110001'B),
387 RSL_CMOD_SP_GSM5 ('00001001'B),
388 RSL_CMOD_SP_GSM6 ('00001101'B)
389 } with { variant "FIELDLENGTH(8)" };
390 type record RSL_IE_ChannelMode {
Harald Welte8f2c21d2017-12-07 17:52:40 +0100391 uint8_t len,
Harald Welte643e2a62017-11-27 15:03:18 +0100392 BIT6 reserved,
393 boolean dtx_d,
394 boolean dtx_u,
395 RSL_SpeechDataInd spd_ind,
396 RSL_ChanRateType ch_rate_type,
397 RSL_SpeechAlgo coding_alg_rate
Harald Welte8f2c21d2017-12-07 17:52:40 +0100398 } with { variant (len) "LENGTHTO(reserved,dtx_d,dtx_u,spd_ind,ch_rate_type,coding_alg_rate)" }
Harald Welte643e2a62017-11-27 15:03:18 +0100399
Stefan Sperling4880be42018-08-07 18:12:59 +0200400 template (value) RSL_IE_ChannelMode ts_RSL_ChanMode_SIGN(boolean dtx_downlink := false) := {
Harald Welte8f2c21d2017-12-07 17:52:40 +0100401 len := 0, /* overwritten */
Harald Welte643e2a62017-11-27 15:03:18 +0100402 reserved := '000000'B,
Stefan Sperling4880be42018-08-07 18:12:59 +0200403 dtx_d := dtx_downlink,
Harald Welte643e2a62017-11-27 15:03:18 +0100404 dtx_u := false,
405 spd_ind := RSL_SPDI_SIGN,
406 ch_rate_type := RSL_CHRT_SDCCH,
407 coding_alg_rate := RSL_CMOD_NO_RESOURCE
408 }
409
Stefan Sperling4880be42018-08-07 18:12:59 +0200410 template (value) RSL_IE_ChannelMode ts_RSL_ChanMode(RSL_ChanRateType t, RSL_SpeechAlgo alg,
411 boolean dtx_downlink := false) := {
Harald Welte8f2c21d2017-12-07 17:52:40 +0100412 len := 0, /* overwritten */
Harald Welte643e2a62017-11-27 15:03:18 +0100413 reserved := '000000'B,
Stefan Sperling4880be42018-08-07 18:12:59 +0200414 dtx_d := dtx_downlink,
Harald Welte643e2a62017-11-27 15:03:18 +0100415 dtx_u := false,
416 spd_ind := RSL_SPDI_SPEECH,
417 ch_rate_type := t,
418 coding_alg_rate := alg
419 }
Harald Welte3618d9d2018-03-21 18:45:27 +0100420 template RSL_IE_ChannelMode tr_RSL_ChanMode(template RSL_ChanRateType t,
421 template RSL_SpeechAlgo alg) := {
422 len := ?,
423 reserved := '000000'B,
424 dtx_d := ?,
425 dtx_u := ?,
426 spd_ind := RSL_SPDI_SPEECH,
427 ch_rate_type := t,
428 coding_alg_rate := alg
429 }
Harald Welte643e2a62017-11-27 15:03:18 +0100430
Vadim Yanitskiy117c1762020-06-16 01:40:10 +0700431 /* 9.3.4 BS Power IE */
Harald Welte643e2a62017-11-27 15:03:18 +0100432 type record RSL_IE_BS_Power {
Vadim Yanitskiy117c1762020-06-16 01:40:10 +0700433 uint2_t reserved,
Harald Welte643e2a62017-11-27 15:03:18 +0100434 boolean epc,
435 boolean fpc,
Vadim Yanitskiy117c1762020-06-16 01:40:10 +0700436 uint4_t power_level
Harald Welte643e2a62017-11-27 15:03:18 +0100437 }
438
Vadim Yanitskiy117c1762020-06-16 01:40:10 +0700439 template (value) RSL_IE_BS_Power ts_RSL_IE_BS_Power(uint4_t power_level,
Eric Wildae8f2622019-06-18 17:05:11 +0200440 boolean epc := false, boolean fpc := false) := {
441 reserved := 0,
442 epc := epc,
443 fpc := fpc,
444 power_level := power_level
445 }
446
Harald Welte73cd2712017-12-17 00:44:52 +0100447 /* 9.3.7 */
Harald Weltee613f962018-04-18 22:38:16 +0200448 type enumerated RSL_AlgId {
449 RSL_ALG_ID_A5_0 ('00000001'B),
450 RSL_ALG_ID_A5_1 ('00000010'B),
451 RSL_ALG_ID_A5_2 ('00000011'B),
452 RSL_ALG_ID_A5_3 ('00000100'B),
453 RSL_ALG_ID_A5_4 ('00000101'B),
454 RSL_ALG_ID_A5_5 ('00000110'B),
455 RSL_ALG_ID_A5_6 ('00000111'B),
456 RSL_ALG_ID_A5_7 ('00001000'B)
457 } with { variant "FIELDLENGTH(8)" };
Harald Welte73cd2712017-12-17 00:44:52 +0100458 type record RSL_IE_EncryptionInfo {
459 uint8_t len,
Harald Weltee613f962018-04-18 22:38:16 +0200460 RSL_AlgId alg_id,
Harald Welte73cd2712017-12-17 00:44:52 +0100461 octetstring key
462 } with { variant (len) "LENGTHTO(alg_id,key)" };
463
Harald Weltee613f962018-04-18 22:38:16 +0200464 template RSL_IE_EncryptionInfo tr_RSL_IE_EncrInfo(template RSL_AlgId alg,
465 template octetstring key) := {
Harald Welte73cd2712017-12-17 00:44:52 +0100466 len := ?,
467 alg_id := alg,
468 key := key
469 }
Harald Weltee613f962018-04-18 22:38:16 +0200470 template (value) RSL_IE_EncryptionInfo ts_RSL_IE_EncrInfo(template (value) RSL_AlgId alg,
471 octetstring key) := {
Harald Welteefa7d912018-04-18 23:22:15 +0200472 len := 0, /* overwritten */
473 alg_id := alg,
474 key := key
475 }
476
477
Harald Welte73cd2712017-12-17 00:44:52 +0100478
Harald Welte643e2a62017-11-27 15:03:18 +0100479 /* 9.3.8 */
480 type record RSL_IE_FrameNumber {
481 uint5_t t1_p,
482 uint6_t t3,
483 uint5_t t2
484 }
485 type RSL_IE_FrameNumber RSL_IE_StartingTime;
486
487 /* 9.3.10 */
488 type record RSL_IE_L1Info {
489 uint5_t ms_power_lvl,
490 boolean fpc,
491 uint2_t reserved,
492 uint8_t actual_ta
493 }
494
495 /* 9.3.13 */
496 type record RSL_IE_MS_Power {
497 uint2_t reserved,
498 boolean fpc_epc,
499 uint5_t power_level
500 }
Pau Espin Pedrolf7630a62019-10-28 15:07:08 +0100501 template RSL_IE_MS_Power tr_RSL_IE_MS_Power(template uint5_t power_level := ?,
502 template boolean fpc_epc := false) := {
503 reserved := 0,
504 fpc_epc := fpc_epc,
505 power_level := power_level
506 }
Harald Welte10280172019-05-19 22:28:04 +0200507 template (value) RSL_IE_MS_Power ts_RSL_IE_MS_Power(uint5_t power_level,
508 boolean fpc_epc := false) := {
509 reserved := 0,
510 fpc_epc := fpc_epc,
511 power_level := power_level
512 }
Harald Welte643e2a62017-11-27 15:03:18 +0100513
Harald Welted5f521e2017-12-07 17:53:06 +0100514 /* 9.3.18 */
515 type record RSL_IE_RachLoad {
516 uint8_t len,
517 uint16_t slot_count,
518 uint16_t busy_count,
519 uint16_t access_count
520 } with { variant (len) "LENGTHTO(slot_count,busy_count,access_count)" }
521
Harald Welteefa7d912018-04-18 23:22:15 +0200522 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 +0100523 len := 0, /* overwritten */
524 slot_count := slot,
525 busy_count := busy,
526 access_count := acc
527 }
528
Harald Welte68e495b2018-02-25 00:05:57 +0100529 template RSL_IE_RachLoad tr_RSL_IE_RachLoad(template uint16_t slot,
530 template uint16_t busy,
531 template uint16_t acc) := {
532 len := ?, /* overwritten */
533 slot_count := slot,
534 busy_count := busy,
535 access_count := acc
536 }
537
Harald Welte643e2a62017-11-27 15:03:18 +0100538 /* 9.3.19 */
539 type record RSL_IE_RequestRef {
540 OCT1 ra,
541 RSL_IE_FrameNumber frame_nr
542 }
543
544 /* 3GPP TS 44.018 / 10.5.2.38 Starting Time */
Harald Welte94e0c342018-04-07 11:33:23 +0200545 template (value) RSL_IE_FrameNumber ts_RSL_IE_FrameNumber(GsmFrameNumber fn) := {
Harald Welte643e2a62017-11-27 15:03:18 +0100546 t1_p := (fn / 1326) mod 32,
547 t3 := fn mod 51,
548 t2 := fn mod 26
549 }
550
Harald Welte9abd1282018-02-19 19:18:17 +0100551 function tr_RSL_IE_FrameNumber(template GsmFrameNumber fn) return template RSL_IE_FrameNumber {
552 if (istemplatekind(fn, "?")) {
553 return ?;
554 } else {
555 return ts_RSL_IE_FrameNumber(valueof(fn));
556 }
557 }
558
Harald Welteefa7d912018-04-18 23:22:15 +0200559 template (value) RSL_IE_RequestRef ts_RSL_IE_ReqRef(OCT1 ra, GsmFrameNumber frame_nr) := {
Harald Welte643e2a62017-11-27 15:03:18 +0100560 ra := ra,
561 frame_nr := ts_RSL_IE_FrameNumber(frame_nr)
562 }
563
Harald Welte9abd1282018-02-19 19:18:17 +0100564 template RSL_IE_RequestRef tr_RSL_IE_ReqRef(template OCT1 ra, template GsmFrameNumber frame_nr) := {
565 ra := ra,
566 frame_nr := tr_RSL_IE_FrameNumber(frame_nr)
567 }
568
Harald Welte15de8ba2018-06-29 08:51:42 +0200569 /* Osmocom Extension */
570 type record RSL_IE_UplinkMeasSuppMeasInfo {
571 int16_t toa256_mean,
572 int16_t toa256_min,
573 int16_t toa256_max,
574 uint16_t toa256_std_dev
575 };
576
Harald Welte2691adf2018-02-22 17:32:39 +0100577 /* 9.3.25 */
578 type record RSL_IE_UplinkMeas {
579 uint8_t len,
580 BIT1 rfu,
581 boolean dtx_d,
582 uint6_t rxlev_f_u,
583 BIT2 reserved1,
584 uint6_t rxlev_s_u,
585 BIT2 reserved2,
586 uint3_t rxq_f_u,
587 uint3_t rxq_s_u,
Harald Welte15de8ba2018-06-29 08:51:42 +0200588 RSL_IE_UplinkMeasSuppMeasInfo supp_meas_info optional
Harald Welte2691adf2018-02-22 17:32:39 +0100589 } 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 +0100590
Harald Welte643e2a62017-11-27 15:03:18 +0100591 /* 9.3.26 */
Harald Weltea8ed9062017-12-14 09:46:01 +0100592 type enumerated RSL_Cause {
593 /* normal event */
594 RSL_ERR_RADIO_IF_FAIL ('00'O),
595 RSL_ERR_RADIO_LINK_FAIL ('01'O),
596 RSL_ERR_HANDOVER_ACC_FAIL ('02'O),
597 RSL_ERR_TALKER_ACC_FAIL ('03'O),
598 RSL_ERR_OM_INTERVENTION ('07'O),
599 RSL_ERR_NORMAL_UNSPEC ('0f'O),
600 RSL_ERR_T_MSRFPCI_EXP ('18'O),
601 /* resource unavailable */
602 RSL_ERR_EQUIPMENT_FAIL ('20'O),
603 RSL_ERR_RR_UNAVAIL ('21'O),
604 RSL_ERR_TERR_CH_FAIL ('22'O),
605 RSL_ERR_CCCH_OVERLOAD ('23'O),
606 RSL_ERR_ACCH_OVERLOAD ('24'O),
607 RSL_ERR_PROCESSOR_OVERLOAD ('25'O),
608 RSL_ERR_BTS_NOT_EQUIPPED ('27'O),
609 RSL_ERR_REMOTE_TRAU_FAILURE ('28'O),
610 RSL_ERR_NOTIF_OVERFLOW ('29'O),
611 RSL_ERR_RES_UNAVAIL ('2f'O),
612 /* service or option not available */
613 RSL_ERR_TRANSC_UNAVAIL ('30'O),
614 RSL_ERR_SERV_OPT_UNAVAIL ('3f'O),
615 /* service or option not implemented */
616 RSL_ERR_ENCR_UNIMPL ('40'O),
617 RSL_ERR_SERV_OPT_UNIMPL ('4f'O),
618 /* invalid message */
619 RSL_ERR_RCH_ALR_ACTV_ALLOC ('50'O),
Harald Welte9912eb52018-02-25 13:30:15 +0100620 RSL_ERR_IPA_RCH_NOT_ACTV_ALLOC ('51'O),
621 RSL_ERR_IPA_CONN_INVALID ('52'O),
622 RSL_ERR_IPA_CONN_IN_USE ('53'O),
623 RSL_ERR_IPA_CONN_ALREADY_EXISTS ('54'O),
Harald Weltea8ed9062017-12-14 09:46:01 +0100624 RSL_ERR_INVALID_MESSAGE ('5f'O),
625 /* protocol error */
626 RSL_ERR_MSG_DISCR ('60'O),
627 RSL_ERR_MSG_TYPE ('61'O),
628 RSL_ERR_MSG_SEQ ('62'O),
629 RSL_ERR_IE_ERROR ('63'O),
630 RSL_ERR_MAND_IE_ERROR ('64'O),
631 RSL_ERR_OPT_IE_ERROR ('65'O),
632 RSL_ERR_IE_NONEXIST ('66'O),
633 RSL_ERR_IE_LENGTH ('67'O),
634 RSL_ERR_IE_CONTENT ('68'O),
635 RSL_ERR_PROTO ('6f'O),
636 /* interworking */
637 RSL_ERR_INTERWORKING ('7f'O)
638 };
Harald Welte643e2a62017-11-27 15:03:18 +0100639 type record RSL_IE_Cause {
Harald Welte6efa8e32017-12-09 22:34:06 +0100640 uint8_t len,
Harald Welte643e2a62017-11-27 15:03:18 +0100641 uint1_t e,
642 RSL_Cause cause,
643 octetstring cause_ext optional
Harald Welte6efa8e32017-12-09 22:34:06 +0100644 } with { variant (len) "LENGTHTO(e,cause,cause_ext)" }
Harald Welte643e2a62017-11-27 15:03:18 +0100645
Harald Welteefa7d912018-04-18 23:22:15 +0200646 template (value) RSL_IE_Cause ts_RSL_IE_Cause(RSL_Cause cause) := {
Harald Welte6efa8e32017-12-09 22:34:06 +0100647 len := 0, /* overwritten */
Harald Welte643e2a62017-11-27 15:03:18 +0100648 e := 0,
649 cause := cause,
650 cause_ext := omit
651 }
652
Harald Welte9abd1282018-02-19 19:18:17 +0100653 template RSL_IE_Cause tr_RSL_IE_Cause(template RSL_Cause cause) := {
654 len := ?,
655 e := 0,
656 cause := cause,
657 cause_ext := omit
658 }
659
Harald Weltec8d363c2019-05-19 20:36:48 +0200660 /* 9.3.29 */
661 type record RSL_SacchInfo {
662 uint8_t len,
663 uint8_t num_msgs,
664 RSL_SacchInfoElements elems
665 } with {
666 variant (len) "LENGTHTO(num_msgs,elems)";
667 variant (num_msgs) "LENGTHTO(elems)";
668 variant (num_msgs) "UNIT(elements)"
669 };
670 type record RSL_SacchInfoElement {
671 RSL_IE_SysinfoType si_type,
672 uint8_t len,
673 octetstring msg
674 } with {
675 variant (len) "LENGTHTO(msg)";
676 };
677 type record of RSL_SacchInfoElement RSL_SacchInfoElements;
678 template (value) RSL_SacchInfo ts_RSL_SacchInfo(template (value) RSL_SacchInfoElements elems) := {
679 len := 0, /* overwritten */
680 num_msgs := 0, /* overwritten */
681 elems := elems
682 }
683 template (value) RSL_SacchInfoElement ts_RSL_SacchInfoElem(RSL_IE_SysinfoType tp, octetstring msg) := {
684 si_type := tp,
685 len := lengthof(msg),
686 msg := msg
687 }
688
Eric Wild61edb7e2019-06-03 12:38:31 +0200689 /* 9.3.31 */
690 type record RSL_IE_MS_Power_Parameters {
691 uint8_t len,
692 octetstring params
693 } with {
694 variant (len) "LENGTHTO(params)";
695 };
696 template (value) RSL_IE_MS_Power_Parameters ts_RSL_IE_MS_Power_Parameters(octetstring params) := {
697 len := 0, /* overwritten */
698 params := params
699 }
700
Harald Welte643e2a62017-11-27 15:03:18 +0100701 /* 9.3.40 */
702 type enumerated RSL_ChanNeeded {
703 RSL_CHANNEED_ANY ('00'B),
704 RSL_CHANNEED_SDCCH ('01'B),
705 RSL_CHANNEED_TCH_F ('10'B),
706 RSL_CHANNEED_TCH_ForH ('11'B)
Harald Welte51d74102017-12-10 23:05:02 +0100707 } with { variant "FIELDLENGTH(2)" };
Harald Welte643e2a62017-11-27 15:03:18 +0100708 type record RSL_IE_ChanNeeded {
709 uint6_t reserved,
710 RSL_ChanNeeded chan_needed
711 }
712
Harald Weltecc373202018-09-10 10:28:21 +0200713 /* 9.3.41 CB Command Type */
714 type enumerated RSL_CbCommand {
715 RSL_CB_CMD_NORMAL ('0000'B),
716 RSL_CB_CMD_SCHEDULE ('1000'B),
717 RSL_CB_CMD_DEFAULT ('1110'B),
718 RSL_CB_CMD_NULL ('1111'B)
719 } with { variant "FIELDLENGTH(4)" };
720 type record RSL_IE_CbCommandType {
721 RSL_CbCommand command,
722 boolean default_bcast_null,
723 BIT1 spare,
724 uint2_t last_block
725 };
726 template (value) RSL_IE_CbCommandType ts_RSL_IE_CbCmdType(RSL_CbCommand cmd := RSL_CB_CMD_NORMAL,
727 uint2_t last_block := 1,
728 boolean def_bcast_null := true) := {
729 command := cmd,
730 default_bcast_null := def_bcast_null,
731 spare := '0'B,
732 last_block := last_block
733 }
734
Harald Welte4a129f82019-05-21 16:35:22 +0200735 /* 9.4.43 CBCH Load Information */
736 type record RSL_IE_CbchLoadInfo {
737 boolean overflow,
738 BIT3 spare,
739 uint4_t slot_count
740 };
741 template RSL_IE_CbchLoadInfo tr_CbchLoadInfo(template boolean overflow,
742 template uint4_t slot_count) := {
743 overflow := overflow,
744 spare := ?,
745 slot_count := slot_count
746 }
747 template (value) RSL_IE_CbchLoadInfo ts_CbchLoadInfo(boolean overflow, uint4_t slot_count) := {
748 overflow := overflow,
749 spare := '000'B,
750 slot_count := slot_count
751 }
752
Harald Welte643e2a62017-11-27 15:03:18 +0100753 /* 9.3.53 */
754 type record RSL_IE_MultirateCtrl {
755 uint3_t spare,
756 boolean od,
757 boolean pre,
758 uint2_t rae,
759 boolean tfo
760 }
761
762 type enumerated RSL_IE_SysinfoType {
763 RSL_SYSTEM_INFO_8 ('00000000'B),
764 RSL_SYSTEM_INFO_1 ('00000001'B),
765 RSL_SYSTEM_INFO_2 ('00000010'B),
766 RSL_SYSTEM_INFO_3 ('00000011'B),
767 RSL_SYSTEM_INFO_4 ('00000100'B),
768 RSL_SYSTEM_INFO_5 ('00000101'B),
769 RSL_SYSTEM_INFO_6 ('00000110'B),
770 RSL_SYSTEM_INFO_7 ('00000111'B),
771 RSL_SYSTEM_INFO_16 ('00001000'B),
772 RSL_SYSTEM_INFO_17 ('00001001'B),
773 RSL_SYSTEM_INFO_2bis ('00001010'B),
774 RSL_SYSTEM_INFO_2ter ('00001011'B),
775 RSL_SYSTEM_INFO_5bis ('00001101'B),
776 RSL_SYSTEM_INFO_5ter ('00001110'B),
777 RSL_SYSTEM_INFO_10 ('00001111'B),
778 RSL_EXT_MEAS_ORDER ('01000111'B),
779 RSL_MEAS_INFO ('01001000'B),
780 RSL_SYSTEM_INFO_13 ('00101000'B),
781 RSL_ERIC_SYSTEM_INFO_13 ('00001100'B),
782 RSL_SYSTEM_INFO_2quater ('00101001'B),
783 RSL_SYSTEM_INFO_9 ('00101010'B),
784 RSL_SYSTEM_INFO_18 ('00101011'B),
785 RSL_SYSTEM_INFO_19 ('00101100'B),
786 RSL_SYSTEM_INFO_20 ('00101101'B)
787 } with { variant "FIELDLENGTH(8)" }
788
Harald Welte9958a4d2017-12-14 21:21:33 +0100789 type record RSL_IE_IPA_ConnectionStats {
790 uint8_t len,
791 uint32_t tx_packets,
792 uint32_t tx_octets,
793 uint32_t rx_packets,
794 uint32_t rx_octets,
795 uint32_t lost_packets,
796 uint32_t jitter,
797 uint32_t avg_delay
798 } with { variant (len) "LENGTHTO(tx_packets,tx_octets,rx_packets,rx_octets,lost_packets,jitter,avg_delay)" }
799
800 type enumerated RSL_IPA_SpeechMode {
801 RSL_IPA_SPM_SENDRECV ('00'B),
802 RSL_IPA_SPM_RECVONLY ('01'B),
803 RSL_IPA_SPM_SENDONLY ('10'B),
804 RSL_IPA_SPM_RESERVED ('11'B)
805 } with { variant "FIELDLENGTH(2)" }
806
807 type enumerated RSL_IPA_Codec {
808 RSL_IPA_CODEC_FR ('0000'B),
809 RSL_IPA_CODEC_EFR ('0001'B),
810 RSL_IPA_CODEC_AMR_F ('0010'B),
811 RSL_IPA_CODEC_HR ('0011'B),
812 RSL_IPA_CODEC_AMR_H ('0101'B),
813 RSL_IPA_CODEC_RTP_PT ('1111'B)
814 } with { variant "FIELDLENGTH(4)" }
815
816 type record RSL_IE_IPA_SpeechMode {
817 BIT2 reserved,
818 RSL_IPA_SpeechMode mode,
819 RSL_IPA_Codec codec
820 }
821
Harald Welte0472ab42018-03-12 15:02:26 +0100822 /* 9.3.20 */
823 type enumerated RSL_IE_ReleaseMode {
824 RSL_REL_MODE_NORMAL ('00'B),
825 REL_REL_MODE_LOCAL ('01'B)
826 }
827
Harald Welte643e2a62017-11-27 15:03:18 +0100828 /* union of all IE bodies */
829 type union RSL_IE_Body {
830 RslChannelNr chan_nr,
831 RslLinkId link_id,
Harald Welte15bb5b52017-12-07 17:52:04 +0100832 RSL_L16V l3_info,
Harald Welte643e2a62017-11-27 15:03:18 +0100833 RSL_LV rlm_cause,
Harald Welte0472ab42018-03-12 15:02:26 +0100834 RSL_IE_ReleaseMode release_mode,
Harald Welte643e2a62017-11-27 15:03:18 +0100835 RSL_IE_ActivationType act_type,
Vadim Yanitskiye02dbcc2020-08-25 04:20:51 +0700836 RSL_IE_ChannelIdent chan_ident,
Harald Welte643e2a62017-11-27 15:03:18 +0100837 RSL_IE_ChannelMode chan_mode,
838 uint8_t handover_ref,
839 RSL_IE_BS_Power bs_power,
840 RSL_IE_MS_Power ms_power,
Eric Wild61edb7e2019-06-03 12:38:31 +0200841 RSL_IE_MS_Power_Parameters ms_power_params,
Harald Welte643e2a62017-11-27 15:03:18 +0100842 uint8_t timing_adv,
843 RSL_IE_MultirateCtrl multirate_ctrl,
Harald Weltea6706152019-05-19 20:38:18 +0200844 uint8_t msg_id,
Harald Welte643e2a62017-11-27 15:03:18 +0100845 RSL_IE_FrameNumber frame_nr,
846 RSL_IE_Cause cause,
847 uint8_t access_delay,
Harald Welted5f521e2017-12-07 17:53:06 +0100848 RSL_IE_RachLoad rach_load,
Harald Welte643e2a62017-11-27 15:03:18 +0100849 uint8_t meas_res_nr,
Harald Welte2691adf2018-02-22 17:32:39 +0100850 uint8_t ms_timing_offset,
851 RSL_IE_UplinkMeas uplink_meas,
Harald Welte643e2a62017-11-27 15:03:18 +0100852 RSL_IE_L1Info l1_info,
853 RSL_IE_SysinfoType sysinfo_type,
854 uint16_t paging_load,
855 uint8_t paging_group,
856 RSL_IE_ChanNeeded chan_needed,
Harald Weltecc373202018-09-10 10:28:21 +0200857 RSL_IE_CbCommandType cb_cmd_type,
858 RSL_LV smscb_message,
Harald Welte4a129f82019-05-21 16:35:22 +0200859 RSL_IE_CbchLoadInfo cbch_load_info,
Harald Weltec8d363c2019-05-19 20:36:48 +0200860 RSL_SacchInfo sacch_info,
Harald Weltecc373202018-09-10 10:28:21 +0200861
Harald Welte643e2a62017-11-27 15:03:18 +0100862 RSL_IE_StartingTime starting_time,
Harald Welte73cd2712017-12-17 00:44:52 +0100863 RSL_IE_EncryptionInfo encr_info,
Harald Weltea3ff6702019-05-20 20:03:50 +0200864 uint8_t smscb_chan_ind,
Harald Welte643e2a62017-11-27 15:03:18 +0100865 RSL_IE_RequestRef req_ref,
866 RSL_LV full_imm_ass_info,
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +0700867 MobileIdentityLV ms_identity,
Harald Welte643e2a62017-11-27 15:03:18 +0100868
Harald Welte9958a4d2017-12-14 21:21:33 +0100869 uint16_t ipa_conn_id,
870 uint16_t ipa_local_port,
871 uint16_t ipa_remote_port,
872 uint32_t ipa_local_ip,
873 uint32_t ipa_remote_ip,
874 uint8_t ipa_rtp_pt,
875 uint8_t ipa_rtp_pt2,
876 RSL_IE_IPA_ConnectionStats ipa_stats,
877 RSL_IE_IPA_SpeechMode ipa_speech_mode,
878
Harald Welte643e2a62017-11-27 15:03:18 +0100879 RSL_LV other
880 }
881
882 type record RSL_IE {
883 RSL_IE_Type iei,
884 RSL_IE_Body body
885 } with { variant (body) "CROSSTAG(
886 chan_nr, iei = RSL_IE_CHAN_NR;
887 link_id, iei = RSL_IE_LINK_IDENT;
888 l3_info, iei = RSL_IE_L3_INFO;
889 rlm_cause, iei = RSL_IE_RLM_CAUSE;
890 release_mode, iei = RSL_IE_RELEASE_MODE;
891 act_type, iei = RSL_IE_ACT_TYPE;
Vadim Yanitskiye02dbcc2020-08-25 04:20:51 +0700892 chan_ident, iei = RSL_IE_CHAN_IDENT;
Harald Welte643e2a62017-11-27 15:03:18 +0100893 chan_mode, iei = RSL_IE_CHAN_MODE;
894 handover_ref, iei = RSL_IE_HANDO_REF;
895 bs_power, iei = RSL_IE_BS_POWER;
896 ms_power, iei = RSL_IE_MS_POWER;
Eric Wild61edb7e2019-06-03 12:38:31 +0200897 ms_power_params, iei = RSL_IE_MS_POWER_PARAM;
Harald Welte643e2a62017-11-27 15:03:18 +0100898 timing_adv, iei = RSL_IE_TIMING_ADVANCE;
899 multirate_ctrl, iei = RSL_IE_MR_CONTROL;
Harald Weltea6706152019-05-19 20:38:18 +0200900 msg_id, iei = RSL_IE_MSG_ID;
Harald Welte643e2a62017-11-27 15:03:18 +0100901
902 frame_nr, iei = RSL_IE_FRAME_NUMBER;
903 cause, iei = RSL_IE_CAUSE;
904 access_delay, iei = RSL_IE_ACCESS_DELAY;
Harald Welted5f521e2017-12-07 17:53:06 +0100905 rach_load, iei = RSL_IE_RACH_LOAD;
Harald Welte643e2a62017-11-27 15:03:18 +0100906 meas_res_nr, iei = RSL_IE_MEAS_RES_NR;
Harald Welte2691adf2018-02-22 17:32:39 +0100907 ms_timing_offset, iei = RSL_IE_MS_TIMING_OFFSET;
908 uplink_meas, iei = RSL_IE_UPLINK_MEAS;
Harald Welte643e2a62017-11-27 15:03:18 +0100909 l1_info, iei = RSL_IE_L1_INFO;
910 sysinfo_type, iei = RSL_IE_SYSINFO_TYPE;
911 paging_load, iei = RSL_IE_PAGING_LOAD;
912 paging_group, iei = RSL_IE_PAGING_GROUP;
913 chan_needed, iei = RSL_IE_CHAN_NEEDED;
Harald Weltecc373202018-09-10 10:28:21 +0200914 cb_cmd_type, iei = RSL_IE_CB_CMD_TYPE;
915 smscb_message, iei = RSL_IE_SMSCB_MSG;
Harald Welte4a129f82019-05-21 16:35:22 +0200916 cbch_load_info, iei = RSL_IE_CBCH_LOAD_INFO;
Harald Weltec8d363c2019-05-19 20:36:48 +0200917 sacch_info, iei = RSL_IE_SACCH_INFO;
Harald Welte643e2a62017-11-27 15:03:18 +0100918 starting_time, iei = RSL_IE_STARTNG_TIME;
Harald Welte73cd2712017-12-17 00:44:52 +0100919 encr_info, iei = RSL_IE_ENCR_INFO;
Harald Weltea3ff6702019-05-20 20:03:50 +0200920 smscb_chan_ind, iei = RSL_IE_SMSCB_CHAN_INDICATOR;
Harald Welte643e2a62017-11-27 15:03:18 +0100921
922 req_ref, iei = RSL_IE_REQ_REFERENCE;
Harald Weltefff69302017-12-07 17:53:42 +0100923 full_imm_ass_info, iei = RSL_IE_FULL_IMM_ASS_INFO;
924 ms_identity, iei = RSL_IE_MS_IDENTITY;
925 other, iei = RSL_IE_FULL_BCCH_INFO;
Harald Welte643e2a62017-11-27 15:03:18 +0100926
Harald Welte9958a4d2017-12-14 21:21:33 +0100927 ipa_conn_id, iei = RSL_IE_IPAC_CONN_ID;
928 ipa_remote_ip, iei = RSL_IE_IPAC_REMOTE_IP;
929 ipa_remote_port, iei = RSL_IE_IPAC_REMOTE_PORT;
930 ipa_local_ip, iei = RSL_IE_IPAC_LOCAL_IP;
931 ipa_local_port, iei = RSL_IE_IPAC_LOCAL_PORT;
932 ipa_rtp_pt, iei = RSL_IE_IPAC_RTP_PAYLOAD;
933 ipa_rtp_pt2, iei = RSL_IE_IPAC_RTP_PAYLOAD2;
934 ipa_stats, iei = RSL_IE_IPAC_CONN_STAT;
935 ipa_speech_mode, iei = RSL_IE_IPAC_SPEECH_MODE;
936
Harald Welte643e2a62017-11-27 15:03:18 +0100937 other, OTHERWISE;
938 )" };
939
Harald Welte735dd072017-12-12 14:55:17 +0100940 /* For some reason the TTCN-3 RAW codec cannot automatically figure out the IEI
941 * that it needs to set for a given union-choice (body). So we have to explicitly
942 * specify the IEI by the caller :( */
Harald Welteefa7d912018-04-18 23:22:15 +0200943 template (value) RSL_IE t_RSL_IE(RSL_IE_Type iei, template (value) RSL_IE_Body body) := {
Harald Welte735dd072017-12-12 14:55:17 +0100944 iei := iei,
Harald Welte643e2a62017-11-27 15:03:18 +0100945 body := body
946 }
947
Harald Weltec2877752017-12-07 17:54:35 +0100948 template RSL_IE tr_RSL_IE(template RSL_IE_Body body) := {
949 iei := ?, /* overwritten? */
950 body := body
951 }
952
953
Harald Welte643e2a62017-11-27 15:03:18 +0100954 type record of RSL_IE RSL_IE_List;
955
956 type record RSL_Message {
957 RSL_MessageDiscriminator msg_disc,
958 RSL_MessageType msg_type,
959 RSL_IE_List ies optional
960 }
961
962 external function enc_RSL_Message(in RSL_Message msg) return octetstring
963 with { extension "prototype(convert) encode(RAW)" };
964 external function dec_RSL_Message(in octetstring stream) return RSL_Message
965 with { extension "prototype(convert) decode(RAW)" };
966
Harald Weltebc330be2017-12-09 00:56:36 +0100967 template RSL_Message tr_RSL_MsgDiscType(template RSL_MessageDiscriminator m_disc,
Harald Welte643e2a62017-11-27 15:03:18 +0100968 RSL_MessageType m_type) := {
969 msg_disc := m_disc,
970 msg_type := m_type,
971 ies := *
972 }
973
Harald Welteefa7d912018-04-18 23:22:15 +0200974 template (value) RSL_Message ts_RSL_MsgDiscType(template (value) RSL_MessageDiscriminator m_disc,
975 template (value) RSL_MessageType msg_type,
976 template (omit) RSL_IE_List ies := omit) := {
Harald Welte4a267362017-12-09 17:49:32 +0100977 msg_disc := m_disc,
978 msg_type := msg_type,
979 ies := ies
980 }
981
Harald Weltebc330be2017-12-09 00:56:36 +0100982template RSL_Message tr_RSL_MsgType(template RSL_MessageType msg_type) := {
983 msg_disc := ?,
984 msg_type := msg_type,
985 ies := *
986}
987
988/* Common Channel Management */
989template RSL_Message tr_RSL_MsgTypeC(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
990 msg_disc := { RSL_MDISC_CCHAN, ? }
991}
992
993/* RLL */
994template RSL_Message tr_RSL_MsgTypeR(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
995 msg_disc := { RSL_MDISC_RLL, true }
996}
997
998/* Dedicated Channel Management */
999template RSL_Message tr_RSL_MsgTypeD(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
1000 msg_disc := { RSL_MDISC_DCHAN, ? }
1001}
1002
1003/* Dedicated Channel Management */
1004template RSL_Message tr_RSL_MsgTypeT(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
1005 msg_disc := { RSL_MDISC_TRX_MGMT, ? }
1006}
1007
1008
1009/* dedicated channel or RLL */
1010template RSL_Message tr_RSL_MsgTypeDR(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
Harald Weltee5408222018-01-29 21:57:58 +01001011 msg_disc := ({RSL_MDISC_DCHAN,?}, {RSL_MDISC_RLL,?}, {RSL_MDISC_IPACCESS,false})
Harald Weltebc330be2017-12-09 00:56:36 +01001012}
1013
1014
Harald Welte643e2a62017-11-27 15:03:18 +01001015 /* 8.3.1 BSC -> BTS */
Harald Welteefa7d912018-04-18 23:22:15 +02001016 template (value) RSL_Message ts_RSL_DATA_REQ(template (value) RslChannelNr chan_nr,
1017 template (value) RslLinkId link_id,
1018 octetstring l3_info) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001019 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, true),
1020 msg_type := RSL_MT_DATA_REQ,
1021 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001022 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1023 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
1024 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
Harald Welte643e2a62017-11-27 15:03:18 +01001025 }
1026 }
1027
Harald Welte7794d5b2017-12-16 23:00:20 +01001028 template RSL_Message tr_RSL_DATA_REQ(template RslChannelNr chan_nr :=?,
1029 template RslLinkId link_id := ?,
1030 template octetstring l3_info := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001031 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, true),
Harald Welte7794d5b2017-12-16 23:00:20 +01001032 msg_type := RSL_MT_DATA_REQ,
1033 ies :={
1034 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1035 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
1036 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
1037 }
1038 }
1039
1040
Harald Welte643e2a62017-11-27 15:03:18 +01001041 /* 8.3.2 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001042 template (value) RSL_Message ts_RSL_DATA_IND(template (value) RslChannelNr chan_nr,
1043 template (value) RslLinkId link_id,
1044 octetstring l3_info) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001045 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, true),
1046 msg_type := RSL_MT_DATA_IND,
1047 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001048 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1049 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
1050 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
Harald Welte643e2a62017-11-27 15:03:18 +01001051 }
1052 }
Harald Welte9abd1282018-02-19 19:18:17 +01001053 template RSL_Message tr_RSL_DATA_IND(template RslChannelNr chan_nr, template RslLinkId link_id,
1054 template octetstring l3_info := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001055 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, true),
Harald Welte9abd1282018-02-19 19:18:17 +01001056 msg_type := RSL_MT_DATA_IND,
1057 ies :={
1058 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1059 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
1060 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
1061 }
1062 }
Harald Welte643e2a62017-11-27 15:03:18 +01001063
1064 /* 8.3.3 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001065 template (value) RSL_Message ts_RSL_ERROR_IND(template (value) RslChannelNr chan_nr,
Harald Weltea7d81f12019-06-02 22:33:19 +02001066 template (value) RslLinkId link_id,
1067 template (value) octetstring rlm_cause) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001068 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1069 msg_type := RSL_MT_ERROR_IND,
1070 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001071 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1072 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
Harald Weltea7d81f12019-06-02 22:33:19 +02001073 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{rlm_cause := ts_RSL_LV(rlm_cause)})
Harald Welte643e2a62017-11-27 15:03:18 +01001074 }
1075 }
Harald Welte9abd1282018-02-19 19:18:17 +01001076 template RSL_Message tr_RSL_ERROR_IND(template RslChannelNr chan_nr, template RslLinkId link_id,
Harald Weltea7d81f12019-06-02 22:33:19 +02001077 template octetstring rlm_cause := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001078 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001079 msg_type := RSL_MT_ERROR_IND,
1080 ies :={
1081 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1082 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
Harald Weltea7d81f12019-06-02 22:33:19 +02001083 tr_RSL_IE(RSL_IE_Body:{rlm_cause := tr_RSL_LV(rlm_cause)})
Harald Welte9abd1282018-02-19 19:18:17 +01001084 }
1085 }
Harald Welte643e2a62017-11-27 15:03:18 +01001086
Harald Welteefa7d912018-04-18 23:22:15 +02001087 /* 8.3.4 BTS <- BSC */
1088 template (value) RSL_Message ts_RSL_EST_REQ(template (value) RslChannelNr chan_nr,
1089 template (value) RslLinkId link_id) := {
1090 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1091 msg_type := RSL_MT_EST_REQ,
1092 ies := {
1093 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1094 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
1095 }
1096 }
1097 template RSL_Message tr_RSL_EST_REQ(template RslChannelNr chan_nr, template RslLinkId link_id) := {
1098 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
1099 msg_type := RSL_MT_EST_REQ,
1100 ies := {
1101 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1102 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1103 }
1104 }
1105
1106 /* 8.3.5 BTS -> BSC */
1107 template (value) RSL_Message ts_RSL_EST_CONF(template (value) RslChannelNr chan_nr,
1108 template (value) RslLinkId link_id) := {
1109 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1110 msg_type := RSL_MT_EST_CONF,
1111 ies := {
1112 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1113 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
1114 }
1115 }
1116 template RSL_Message tr_RSL_EST_CONF(template RslChannelNr chan_nr, template RslLinkId link_id) := {
1117 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
1118 msg_type := RSL_MT_EST_CONF,
1119 ies := {
1120 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1121 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1122 }
1123 }
1124
Harald Welte643e2a62017-11-27 15:03:18 +01001125 /* 8.3.6 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001126 template (value) RSL_Message ts_RSL_EST_IND(template (value) RslChannelNr chan_nr,
1127 template (value) RslLinkId link_id,
1128 octetstring l3_info) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001129 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1130 msg_type := RSL_MT_EST_IND,
1131 ies := {
Harald Welte735dd072017-12-12 14:55:17 +01001132 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1133 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
1134 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
Harald Welte643e2a62017-11-27 15:03:18 +01001135 }
1136 }
Harald Welte9abd1282018-02-19 19:18:17 +01001137 template RSL_Message tr_RSL_EST_IND(template RslChannelNr chan_nr, template RslLinkId link_id,
1138 template octetstring l3_info := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001139 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001140 msg_type := RSL_MT_EST_IND,
1141 ies := {
1142 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1143 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
1144 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
1145 }
1146 }
Harald Welte0472ab42018-03-12 15:02:26 +01001147 template RSL_Message tr_RSL_EST_IND_NOL3(template RslChannelNr chan_nr, template RslLinkId link_id) :=
1148{
1149 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
1150 msg_type := RSL_MT_EST_IND,
1151 ies := {
1152 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1153 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1154 }
1155 }
1156
Harald Welte643e2a62017-11-27 15:03:18 +01001157
1158 /* 8.3.7 BSC -> BTS */
Harald Welteefa7d912018-04-18 23:22:15 +02001159 template (value) RSL_Message ts_RSL_REL_REQ(template (value) RslChannelNr chan_nr,
Harald Welte0472ab42018-03-12 15:02:26 +01001160 template (value) RslLinkId link_id,
1161 template (value) RSL_IE_ReleaseMode rel_mode := RSL_REL_MODE_NORMAL) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001162 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1163 msg_type := RSL_MT_REL_REQ,
1164 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001165 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
Harald Welte0472ab42018-03-12 15:02:26 +01001166 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
1167 t_RSL_IE(RSL_IE_RELEASE_MODE, RSL_IE_Body:{release_mode := rel_mode})
Harald Welte643e2a62017-11-27 15:03:18 +01001168 }
1169 }
Harald Weltee8a5ab12017-12-09 22:34:57 +01001170 template RSL_Message tr_RSL_REL_REQ(template RslChannelNr chan_nr,
Harald Welte0472ab42018-03-12 15:02:26 +01001171 template RslLinkId link_id,
1172 template RSL_IE_ReleaseMode rel_mode := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001173 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Weltee8a5ab12017-12-09 22:34:57 +01001174 msg_type := RSL_MT_REL_REQ,
1175 ies :={
1176 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1177 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
Harald Welte0472ab42018-03-12 15:02:26 +01001178 tr_RSL_IE(RSL_IE_Body:{release_mode := rel_mode})
Harald Weltee8a5ab12017-12-09 22:34:57 +01001179 }
1180 }
Harald Welte643e2a62017-11-27 15:03:18 +01001181
1182 /* 8.3.8 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001183 template (value) RSL_Message ts_RSL_REL_CONF(template (value) RslChannelNr chan_nr,
1184 template (value) RslLinkId link_id) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001185 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1186 msg_type := RSL_MT_REL_CONF,
1187 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001188 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1189 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
Harald Welte643e2a62017-11-27 15:03:18 +01001190 }
1191 }
Harald Welte9abd1282018-02-19 19:18:17 +01001192 template RSL_Message tr_RSL_REL_CONF(template RslChannelNr chan_nr, template RslLinkId link_id) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001193 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001194 msg_type := RSL_MT_REL_CONF,
1195 ies :={
1196 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1197 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1198 }
1199 }
Harald Welte643e2a62017-11-27 15:03:18 +01001200
1201 /* 8.3.9 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001202 template (value) RSL_Message ts_RSL_REL_IND(template (value) RslChannelNr chan_nr,
1203 template (value) RslLinkId link_id) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001204 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1205 msg_type := RSL_MT_REL_IND,
1206 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001207 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1208 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
Harald Welte643e2a62017-11-27 15:03:18 +01001209 }
1210 }
Harald Welte9abd1282018-02-19 19:18:17 +01001211 template RSL_Message tr_RSL_REL_IND(template RslChannelNr chan_nr, template RslLinkId link_id) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001212 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001213 msg_type := RSL_MT_REL_IND,
1214 ies :={
1215 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1216 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1217 }
1218 }
Harald Welte643e2a62017-11-27 15:03:18 +01001219
1220 /* 8.3.10 BSC -> BTS */
Harald Welteefa7d912018-04-18 23:22:15 +02001221 template (value) RSL_Message ts_RSL_UNITDATA_REQ(template (value) RslChannelNr chan_nr,
1222 template (value) RslLinkId link_id,
1223 octetstring l3_info)
Harald Welte643e2a62017-11-27 15:03:18 +01001224 modifies ts_RSL_DATA_REQ := {
1225 msg_type := RSL_MT_UNIT_DATA_REQ
1226 }
Harald Welte0472ab42018-03-12 15:02:26 +01001227 template RSL_Message tr_RSL_UNITDATA_REQ(template RslChannelNr chan_nr,
1228 template RslLinkId link_id,
Vadim Yanitskiy8f98d3f2018-10-03 17:58:10 +07001229 template octetstring l3_info := ?)
Harald Welte0472ab42018-03-12 15:02:26 +01001230 modifies tr_RSL_DATA_REQ := {
1231 msg_type := RSL_MT_UNIT_DATA_REQ
1232 }
1233
Harald Welte643e2a62017-11-27 15:03:18 +01001234
1235 /* 8.3.11 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001236 template (value) RSL_Message ts_RSL_UNITDATA_IND(template (value) RslChannelNr chan_nr,
1237 template (value) RslLinkId link_id,
1238 octetstring l3_info)
Harald Welte643e2a62017-11-27 15:03:18 +01001239 modifies ts_RSL_DATA_IND := {
1240 msg_type := RSL_MT_UNIT_DATA_IND
1241 }
Harald Welte0472ab42018-03-12 15:02:26 +01001242 template RSL_Message tr_RSL_UNITDATA_IND(template RslChannelNr chan_nr,
Vadim Yanitskiyfabe0f22018-10-03 17:51:47 +07001243 template RslLinkId link_id,
Vadim Yanitskiy8f98d3f2018-10-03 17:58:10 +07001244 template octetstring l3_info := ?)
Harald Welte0472ab42018-03-12 15:02:26 +01001245 modifies tr_RSL_DATA_IND := {
1246 msg_type := RSL_MT_UNIT_DATA_IND
1247 }
1248
1249
Harald Welte643e2a62017-11-27 15:03:18 +01001250
1251
1252 /* DEDICATED CANNEL MANAGEMENT MESSAGES */
1253
1254 /* 8.4.1 BSC -> BTS */
Harald Welteefa7d912018-04-18 23:22:15 +02001255 template (value) RSL_Message ts_RSL_CHAN_ACT(template (value) RslChannelNr chan_nr,
Harald Welte921f9e02019-05-19 22:27:11 +02001256 template (value) RSL_IE_ChannelMode mode,
1257 template (value) RSL_IE_ActivationType at := t_RSL_IE_ActType_IA) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001258 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1259 msg_type := RSL_MT_CHAN_ACTIV,
1260 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001261 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
Harald Welte921f9e02019-05-19 22:27:11 +02001262 t_RSL_IE(RSL_IE_ACT_TYPE, RSL_IE_Body:{act_type := at}),
Harald Welte735dd072017-12-12 14:55:17 +01001263 t_RSL_IE(RSL_IE_CHAN_MODE, RSL_IE_Body:{chan_mode := mode})
Harald Welte643e2a62017-11-27 15:03:18 +01001264 /* lots of optional IEs */
1265 }
1266 }
Harald Welte94e0c342018-04-07 11:33:23 +02001267 template RSL_Message tr_RSL_CHAN_ACT(template RslChannelNr chan_nr,
Harald Welte921f9e02019-05-19 22:27:11 +02001268 template RSL_IE_ChannelMode mode,
1269 template (value) RSL_IE_ActivationType at := t_RSL_IE_ActType_IA) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001270 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte94e0c342018-04-07 11:33:23 +02001271 msg_type := RSL_MT_CHAN_ACTIV,
1272 ies :={
1273 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
Harald Welte921f9e02019-05-19 22:27:11 +02001274 tr_RSL_IE(RSL_IE_Body:{act_type := at}),
Harald Welte94e0c342018-04-07 11:33:23 +02001275 tr_RSL_IE(RSL_IE_Body:{chan_mode := mode}),
1276 /* lots of optional IEs */
1277 *
1278 }
1279 }
1280 template RSL_Message tr_RSL_CHAN_ACT_PDCH(template RslChannelNr chan_nr,
1281 template RSL_IE_ChannelMode mode) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001282 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte94e0c342018-04-07 11:33:23 +02001283 msg_type := RSL_MT_CHAN_ACTIV,
1284 ies :={
1285 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1286 tr_RSL_IE(RSL_IE_Body:{act_type := t_RSL_IE_ActType_PDCH}),
1287 /* lots of optional IEs */
1288 *
1289 }
1290 }
1291
Harald Welte643e2a62017-11-27 15:03:18 +01001292
1293 /* 8.4.2 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001294 template (value) RSL_Message ts_RSL_CHAN_ACT_ACK(template (value) RslChannelNr chan_nr,
1295 GsmFrameNumber fn) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001296 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1297 msg_type := RSL_MT_CHAN_ACTIV_ACK,
1298 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001299 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1300 t_RSL_IE(RSL_IE_FRAME_NUMBER, RSL_IE_Body:{frame_nr := ts_RSL_IE_FrameNumber(fn)})
Harald Welte643e2a62017-11-27 15:03:18 +01001301 }
1302 }
Harald Welte9abd1282018-02-19 19:18:17 +01001303 template RSL_Message tr_RSL_CHAN_ACT_ACK(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001304 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001305 msg_type := RSL_MT_CHAN_ACTIV_ACK,
1306 ies := {
1307 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1308 tr_RSL_IE(RSL_IE_Body:{frame_nr := ?})
1309 }
1310 }
Harald Welte643e2a62017-11-27 15:03:18 +01001311
1312 /* 8.4.3 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001313 template (value) RSL_Message ts_RSL_CHAN_ACT_NACK(template (value) RslChannelNr chan_nr,
1314 RSL_Cause cause) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001315 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1316 msg_type := RSL_MT_CHAN_ACTIV_NACK,
1317 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001318 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1319 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
Harald Welte643e2a62017-11-27 15:03:18 +01001320 }
1321 }
Harald Welte9abd1282018-02-19 19:18:17 +01001322 template RSL_Message tr_RSL_CHAN_ACT_NACK(template RslChannelNr chan_nr,
1323 template RSL_Cause cause := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001324 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001325 msg_type := RSL_MT_CHAN_ACTIV_NACK,
1326 ies := {
1327 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1328 tr_RSL_IE(RSL_IE_Body:{cause := ?})
1329 }
1330 }
Harald Welte643e2a62017-11-27 15:03:18 +01001331
1332 /* 8.4.4 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001333 template (value) RSL_Message ts_RSL_CONN_FAIL_IND(RslChannelNr chan_nr, RSL_Cause cause) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001334 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1335 msg_type := RSL_MT_CONN_FAIL,
1336 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001337 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1338 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
Harald Welte643e2a62017-11-27 15:03:18 +01001339 }
1340 }
Harald Welte9abd1282018-02-19 19:18:17 +01001341 template RSL_Message tr_RSL_CONN_FAIL_IND(template RslChannelNr chan_nr,
1342 template RSL_Cause cause := ?) := {
1343 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1344 msg_type := RSL_MT_CONN_FAIL,
1345 ies :={
1346 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1347 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
1348 }
1349 }
Harald Welte643e2a62017-11-27 15:03:18 +01001350
Harald Weltee8a5ab12017-12-09 22:34:57 +01001351 /* 8.4.5 BSC -> BTS */
1352 template RSL_Message tr_RSL_DEACT_SACCH(template RslChannelNr chan_nr) := {
1353 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1354 msg_type := RSL_MT_DEACTIVATE_SACCH,
1355 ies := {
1356 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
1357 }
1358 }
Harald Welteefa7d912018-04-18 23:22:15 +02001359 template (value) RSL_Message ts_RSL_DEACT_SACCH(template (value) RslChannelNr chan_nr) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001360 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1361 msg_type := RSL_MT_DEACTIVATE_SACCH,
1362 ies := {
1363 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1364 }
1365 }
1366
Harald Weltee8a5ab12017-12-09 22:34:57 +01001367
Harald Welte73cd2712017-12-17 00:44:52 +01001368 /* 8.4.6 BSC ->BTS */
1369 template RSL_Message tr_RSL_ENCR_CMD(template RslChannelNr chan_nr,
1370 template RslLinkId link_id := ?,
Harald Weltee613f962018-04-18 22:38:16 +02001371 template RSL_AlgId alg := ?,
Harald Welte73cd2712017-12-17 00:44:52 +01001372 template octetstring key := ?,
1373 template octetstring l3_info := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001374 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte73cd2712017-12-17 00:44:52 +01001375 msg_type := RSL_MT_ENCR_CMD,
1376 ies := {
1377 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1378 tr_RSL_IE(RSL_IE_Body:{encr_info := tr_RSL_IE_EncrInfo(alg, key)}),
1379 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
1380 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
1381 }
1382 }
Harald Welteefa7d912018-04-18 23:22:15 +02001383 template (value) RSL_Message ts_RSL_ENCR_CMD(template (value) RslChannelNr chan_nr,
1384 template (value) RslLinkId link_id,
Harald Weltee613f962018-04-18 22:38:16 +02001385 template (value) RSL_AlgId alg, octetstring key,
Harald Welteefa7d912018-04-18 23:22:15 +02001386 octetstring l3_info) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001387 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1388 msg_type := RSL_MT_ENCR_CMD,
1389 ies := {
1390 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
Harald Welteefa7d912018-04-18 23:22:15 +02001391 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 +01001392 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
Harald Welteefa7d912018-04-18 23:22:15 +02001393 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
Harald Welte9abd1282018-02-19 19:18:17 +01001394 }
1395 }
Harald Welte73cd2712017-12-17 00:44:52 +01001396
Harald Welte2691adf2018-02-22 17:32:39 +01001397 template RSL_Message tr_RSL_MEAS_RES(template RslChannelNr chan_nr,
1398 template uint8_t meas_res_nr := ?,
1399 template RSL_IE_UplinkMeas ul_meas := ?,
1400 template RSL_IE_BS_Power bs_power := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001401 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte2691adf2018-02-22 17:32:39 +01001402 msg_type := RSL_MT_MEAS_RES,
1403 ies := {
1404 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1405 tr_RSL_IE(RSL_IE_Body:{meas_res_nr := meas_res_nr}),
1406 tr_RSL_IE(RSL_IE_Body:{uplink_meas := ul_meas}),
1407 tr_RSL_IE(RSL_IE_Body:{bs_power := bs_power}),
1408 *
1409 }
1410 }
1411
Philipp Maierdd841d32019-12-17 14:44:54 +01001412 /* Receive template for a measurement report that lacks the measurement report
1413 * from the MS (l1_info, l3_info and ms timing offset */
1414 template RSL_Message tr_RSL_MEAS_RES_EMPTY(template RslChannelNr chan_nr,
1415 template uint8_t meas_res_nr := ?,
1416 template RSL_IE_UplinkMeas ul_meas := ?,
1417 template RSL_IE_BS_Power bs_power := ?) := {
1418 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1419 msg_type := RSL_MT_MEAS_RES,
1420 ies := {
1421 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1422 tr_RSL_IE(RSL_IE_Body:{meas_res_nr := meas_res_nr}),
1423 tr_RSL_IE(RSL_IE_Body:{uplink_meas := ul_meas}),
1424 tr_RSL_IE(RSL_IE_Body:{bs_power := bs_power})
1425 }
1426 }
1427
Harald Welte39b47be2018-02-23 18:58:48 +01001428 /* Osmocom specific template, require lots of optional fields to be present */
1429 template RSL_Message tr_RSL_MEAS_RES_OSMO(template RslChannelNr chan_nr,
1430 template uint8_t meas_res_nr := ?,
1431 template RSL_IE_UplinkMeas ul_meas := ?,
1432 template RSL_IE_BS_Power bs_power := ?,
1433 template RSL_IE_L1Info l1_info := ?,
1434 template octetstring l3_info := ?,
1435 template uint8_t ms_to := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001436 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte39b47be2018-02-23 18:58:48 +01001437 msg_type := RSL_MT_MEAS_RES,
1438 ies := {
1439 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1440 tr_RSL_IE(RSL_IE_Body:{meas_res_nr := meas_res_nr}),
1441 tr_RSL_IE(RSL_IE_Body:{uplink_meas := ul_meas}),
1442 tr_RSL_IE(RSL_IE_Body:{bs_power := bs_power}),
1443 tr_RSL_IE(RSL_IE_Body:{l1_info := l1_info}),
1444 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)}),
1445 tr_RSL_IE(RSL_IE_Body:{ms_timing_offset := ms_to})
1446 }
1447 }
1448
Eric Wildf1827a72019-05-28 17:37:35 +02001449 /* 8.4.9 BSC -> BTS */
1450 template (value) RSL_Message ts_RSL_MODE_MODIFY_REQ(template (value) RslChannelNr chan_nr,
1451 template (value) RSL_IE_ChannelMode mode) := {
1452 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1453 msg_type := RSL_MT_MODE_MODIFY_REQ,
1454 ies :={
1455 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1456 t_RSL_IE(RSL_IE_CHAN_MODE, RSL_IE_Body:{chan_mode := mode})
1457 /* lots of optional IEs */
1458 }
1459 }
1460 template RSL_Message tr_RSL_MODE_MODIFY_REQ(template RslChannelNr chan_nr,
1461 template RSL_IE_ChannelMode mode) := {
1462 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1463 msg_type := RSL_MT_MODE_MODIFY_REQ,
1464 ies :={
1465 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1466 tr_RSL_IE(RSL_IE_Body:{chan_mode := mode}),
1467 /* lots of optional IEs */
1468 *
1469 }
1470 }
1471
Harald Welte7794d5b2017-12-16 23:00:20 +01001472 /* 8.4.10 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001473 template (value) RSL_Message ts_RSL_MODE_MODIFY_ACK(template (value) RslChannelNr chan_nr) := {
Harald Welte7794d5b2017-12-16 23:00:20 +01001474 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1475 msg_type := RSL_MT_MODE_MODIFY_ACK,
1476 ies := {
1477 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1478 }
1479 }
Harald Welte9abd1282018-02-19 19:18:17 +01001480 template RSL_Message tr_RSL_MODE_MODIFY_ACK(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001481 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001482 msg_type := RSL_MT_MODE_MODIFY_ACK,
1483 ies := {
1484 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
1485 }
1486 }
Harald Welte7794d5b2017-12-16 23:00:20 +01001487
Harald Welte643e2a62017-11-27 15:03:18 +01001488 /* 8.4.11 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001489 template (value) RSL_Message ts_RSL_MODE_MODIFY_NACK(template (value) RslChannelNr chan_nr,
1490 RSL_Cause cause) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001491 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1492 msg_type := RSL_MT_MODE_MODIFY_NACK,
1493 ies := {
1494 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1495 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
1496 }
Harald Welte643e2a62017-11-27 15:03:18 +01001497 }
Harald Welte9abd1282018-02-19 19:18:17 +01001498 template RSL_Message tr_RSL_MODE_MODIFY_NACK(template RslChannelNr chan_nr,
1499 template RSL_Cause cause) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001500 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001501 msg_type := RSL_MT_MODE_MODIFY_NACK,
1502 ies := {
1503 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1504 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
1505 }
1506 }
1507
Harald Welte643e2a62017-11-27 15:03:18 +01001508
Harald Welte6a8199d2018-01-29 21:58:53 +01001509 /* 8.4.14: BTS <- BSC */
1510 template RSL_Message tr_RSL_RF_CHAN_REL(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001511 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte6a8199d2018-01-29 21:58:53 +01001512 msg_type := RSL_MT_RF_CHAN_REL,
1513 ies := {
1514 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
1515 }
1516 }
Harald Welteefa7d912018-04-18 23:22:15 +02001517 template (value) RSL_Message ts_RSL_RF_CHAN_REL(template (value) RslChannelNr chan_nr) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001518 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1519 msg_type := RSL_MT_RF_CHAN_REL,
1520 ies := {
1521 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1522 }
1523 }
Harald Welte6a8199d2018-01-29 21:58:53 +01001524
Philipp Maier4d1e9c92018-12-20 11:11:56 +01001525 /* 8.4.15: BTS <- BSC */
1526 template (value) RSL_Message ts_RSL_MS_PWR_CTRL(template (value) RslChannelNr chan_nr,
1527 template (value) RSL_IE_MS_Power ms_power) := {
1528 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1529 msg_type := RSL_MT_MS_POWER_CONTROL,
1530 ies := {
1531 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1532 t_RSL_IE(RSL_IE_MS_POWER, RSL_IE_Body:{ms_power := ms_power})
1533 /* One optional IE: MS POWER PARAMETERS */
1534 }
1535 }
1536
Eric Wild61edb7e2019-06-03 12:38:31 +02001537 template (value) RSL_Message ts_RSL_MS_PWR_CTRL_with_pp(template (value) RslChannelNr chan_nr,
1538 integer pwr_level) := {
1539 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1540 msg_type := RSL_MT_MS_POWER_CONTROL,
1541 ies := {
1542 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1543 t_RSL_IE(RSL_IE_MS_POWER, RSL_IE_Body:{ms_power := ts_RSL_IE_MS_Power(pwr_level)}),
1544 t_RSL_IE(RSL_IE_MS_POWER_PARAM, RSL_IE_Body:{ms_power_params :=
1545 ts_RSL_IE_MS_Power_Parameters(''O)})
1546 }
1547 }
1548
Eric Wildae8f2622019-06-18 17:05:11 +02001549 /* 8.4.16: BTS <- BSC */
1550 template (value) RSL_Message ts_RSL_BS_PWR_CTRL(template (value) RslChannelNr chan_nr,
1551 template (value) RSL_IE_BS_Power bs_power) := {
1552 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1553 msg_type := RSL_MT_BS_POWER_CONTROL,
1554 ies := {
1555 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1556 t_RSL_IE(RSL_IE_BS_POWER, RSL_IE_Body:{bs_power := bs_power})
1557 /* One optional IE: BS POWER PARAMETERS */
1558 }
1559 }
1560
Harald Welte4a267362017-12-09 17:49:32 +01001561 /* 8.4.19 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001562 template (value) RSL_Message ts_RSL_RF_CHAN_REL_ACK(template (value) RslChannelNr chan_nr) :=
Harald Welte4a267362017-12-09 17:49:32 +01001563 ts_RSL_MsgDiscType(ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1564 RSL_MT_RF_CHAN_REL_ACK,
Harald Welte735dd072017-12-12 14:55:17 +01001565 { t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}) });
Harald Welte4a267362017-12-09 17:49:32 +01001566
Harald Welte9abd1282018-02-19 19:18:17 +01001567 template RSL_Message tr_RSL_RF_CHAN_REL_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_RF_CHAN_REL_ACK,
1570 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001571 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
Harald Welte9abd1282018-02-19 19:18:17 +01001572 }
1573 }
1574
Harald Welteea17b912018-03-11 22:29:31 +01001575 /* 8.6.20 BTS <- BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001576 template (value) RSL_Message ts_RSL_SACCH_INF_MOD(template (value) RslChannelNr chan_nr,
1577 RSL_IE_SysinfoType si_type,
1578 octetstring l3_info) := {
Harald Welteea17b912018-03-11 22:29:31 +01001579 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1580 msg_type := RSL_MT_SACCH_INFO_MODIFY,
1581 ies := {
1582 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1583 t_RSL_IE(RSL_IE_SYSINFO_TYPE, RSL_IE_Body:{sysinfo_type := si_type}),
1584 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
1585 }
1586 }
1587
Neels Hofmeyr378a49c2018-06-15 22:18:43 +02001588 /* 8.4.7 BTS -> BSC */
1589 template (value) RSL_Message ts_RSL_HANDO_DET(template (value) RslChannelNr chan_nr) := {
1590 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1591 msg_type := RSL_MT_HANDO_DET,
1592 ies := {
1593 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1594 }
1595 }
Vadim Yanitskiy7c2c10c2019-05-31 20:42:01 +07001596 template RSL_Message tr_RSL_HANDO_DET(template RslChannelNr chan_nr,
1597 template uint8_t acc_delay := ?) := {
1598 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1599 msg_type := RSL_MT_HANDO_DET,
1600 ies := {
1601 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1602 tr_RSL_IE(RSL_IE_Body:{access_delay := acc_delay})
1603 }
1604 }
Neels Hofmeyr378a49c2018-06-15 22:18:43 +02001605
Harald Welteea17b912018-03-11 22:29:31 +01001606
Harald Welte643e2a62017-11-27 15:03:18 +01001607 /* COMMON CHANNEL MANAGEMENT MESSAGES */
1608
Harald Welte874c2232018-02-24 04:52:43 +01001609 /* 8.5.1 BTS <- BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001610 template (value) RSL_Message ts_RSL_BCCH_INFO(RSL_IE_SysinfoType si_type,
1611 octetstring full_bcch_info) := {
Harald Welte874c2232018-02-24 04:52:43 +01001612 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1613 msg_type := RSL_MT_BCCH_INFO,
1614 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001615 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_BCCH(0)}),
Harald Welte874c2232018-02-24 04:52:43 +01001616 t_RSL_IE(RSL_IE_SYSINFO_TYPE, RSL_IE_Body:{sysinfo_type := si_type}),
1617 t_RSL_IE(RSL_IE_FULL_BCCH_INFO, RSL_IE_Body:{other := ts_RSL_LV(full_bcch_info)})
1618 }
1619 }
Harald Welte09538f82019-08-01 09:50:25 +02001620 template RSL_Message tr_RSL_NO_BCCH_INFO(template RSL_IE_SysinfoType si_type := ?) := {
1621 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1622 msg_type := RSL_MT_BCCH_INFO,
1623 ies := {
1624 tr_RSL_IE(RSL_IE_Body:{chan_nr := ts_RslChanNr_BCCH(0)}),
1625 tr_RSL_IE(RSL_IE_Body:{sysinfo_type := si_type})
1626 }
1627 }
1628 template RSL_Message tr_RSL_BCCH_INFO(template RSL_IE_SysinfoType si_type := ?,
1629 template octetstring full_bcch_info := ?) := {
1630 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1631 msg_type := RSL_MT_BCCH_INFO,
1632 ies := {
1633 tr_RSL_IE(RSL_IE_Body:{chan_nr := ts_RslChanNr_BCCH(0)}),
1634 tr_RSL_IE(RSL_IE_Body:{sysinfo_type := si_type}),
1635 tr_RSL_IE(RSL_IE_Body:{other := tr_RSL_LV(full_bcch_info)}),
1636 *
1637 }
1638 }
Harald Welte874c2232018-02-24 04:52:43 +01001639
Harald Welte7ae93142017-12-07 17:56:15 +01001640 /* 8.5.2 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001641 template (value) RSL_Message ts_RSL_RACH_LOAD_IND(uint16_t slot_ct, uint16_t busy_ct,
1642 uint16_t acc_ct) := {
Harald Welte7ae93142017-12-07 17:56:15 +01001643 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1644 msg_type := RSL_MT_CCCH_LOAD_IND,
1645 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001646 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_RACH(0)}),
Harald Welte735dd072017-12-12 14:55:17 +01001647 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 +01001648 }
1649 }
Harald Welte68e495b2018-02-25 00:05:57 +01001650 template RSL_Message tr_RSL_RACH_LOAD_IND(template uint16_t slot_ct := ?,
1651 template uint16_t busy_ct := ?,
Harald Welte09538f82019-08-01 09:50:25 +02001652 template uint16_t acc_ct := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001653 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Welte68e495b2018-02-25 00:05:57 +01001654 msg_type := RSL_MT_CCCH_LOAD_IND,
1655 ies := {
1656 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_RACH(0)}),
1657 tr_RSL_IE(RSL_IE_Body:{rach_load := tr_RSL_IE_RachLoad(slot_ct, busy_ct, acc_ct)})
1658 }
1659 }
1660
Harald Welteefa7d912018-04-18 23:22:15 +02001661 template (value) RSL_Message ts_RSL_PAGING_LOAD_IND(uint16_t buffer_space) := {
Harald Welte7ae93142017-12-07 17:56:15 +01001662 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1663 msg_type := RSL_MT_CCCH_LOAD_IND,
1664 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001665 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_PCH_AGCH(0)}),
Harald Welte735dd072017-12-12 14:55:17 +01001666 t_RSL_IE(RSL_IE_PAGING_LOAD, RSL_IE_Body:{paging_load := buffer_space})
Harald Welte7ae93142017-12-07 17:56:15 +01001667 }
1668 }
Harald Welte68e495b2018-02-25 00:05:57 +01001669 template RSL_Message tr_RSL_PAGING_LOAD_IND(template uint16_t buffer_space := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001670 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Welte68e495b2018-02-25 00:05:57 +01001671 msg_type := RSL_MT_CCCH_LOAD_IND,
1672 ies := {
1673 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(0)}),
1674 tr_RSL_IE(RSL_IE_Body:{paging_load := buffer_space})
1675 }
1676 }
1677
Harald Welte7ae93142017-12-07 17:56:15 +01001678
Harald Welte643e2a62017-11-27 15:03:18 +01001679 /* 8.5.3 BTS -> BSC */
Vadim Yanitskiyab448a52019-05-31 20:24:03 +07001680 template (value) RSL_Message ts_RSL_CHAN_RQD(OCT1 ra, GsmFrameNumber fn,
1681 template (value) RslChannelNr chan_nr := ts_RslChanNr_RACH(0),
1682 uint8_t acc_del := 0) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001683 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1684 msg_type := RSL_MT_CHAN_RQD,
1685 ies := {
Vadim Yanitskiyab448a52019-05-31 20:24:03 +07001686 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1687 /* TODO: we may need to have optional RSL_IE_LINK_IDENT IE here */
Harald Welte735dd072017-12-12 14:55:17 +01001688 t_RSL_IE(RSL_IE_REQ_REFERENCE, RSL_IE_Body:{req_ref := ts_RSL_IE_ReqRef(ra, fn)}),
1689 t_RSL_IE(RSL_IE_ACCESS_DELAY, RSL_IE_Body:{access_delay := acc_del})
Harald Welte643e2a62017-11-27 15:03:18 +01001690 }
1691 }
Harald Welte9abd1282018-02-19 19:18:17 +01001692 template RSL_Message tr_RSL_CHAN_RQD(template OCT1 ra, template GsmFrameNumber fn := ?,
Vadim Yanitskiyab448a52019-05-31 20:24:03 +07001693 template RslChannelNr chan_nr := ts_RslChanNr_RACH(0),
1694 template uint8_t acc_del := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001695 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001696 msg_type := RSL_MT_CHAN_RQD,
1697 ies := {
Vadim Yanitskiyab448a52019-05-31 20:24:03 +07001698 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1699 /* TODO: we may need to have optional RSL_IE_LINK_IDENT IE here */
Harald Welte9abd1282018-02-19 19:18:17 +01001700 tr_RSL_IE(RSL_IE_Body:{req_ref := tr_RSL_IE_ReqRef(ra, fn)}),
1701 tr_RSL_IE(RSL_IE_Body:{access_delay := acc_del})
1702 }
1703 }
Harald Welte643e2a62017-11-27 15:03:18 +01001704
1705 /* 8.5.4 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001706 template (value) RSL_Message ts_DELETE_IND(template (value) RslChannelNr chan_nr,
1707 octetstring imm_ass) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001708 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1709 msg_type := RSL_MT_DELETE_IND,
1710 ies := {
Harald Welte735dd072017-12-12 14:55:17 +01001711 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1712 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 +01001713 }
1714 }
Harald Weltee8d750e2018-06-10 21:41:35 +02001715 template RSL_Message tr_RSL_DELETE_IND(template octetstring imm_ass := ?, template uint3_t tn) := {
1716 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1717 msg_type := RSL_MT_DELETE_IND,
1718 ies := {
1719 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(tn)}),
1720 tr_RSL_IE(RSL_IE_Body:{full_imm_ass_info := tr_RSL_LV(imm_ass)}),
1721 *
1722 }
1723 }
Harald Welte643e2a62017-11-27 15:03:18 +01001724
Harald Weltec2877752017-12-07 17:54:35 +01001725 /* 8.5.5 BSC -> BTS */
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +07001726 template RSL_Message tr_RSL_PAGING_CMD(template MobileIdentityV mi, template uint3_t tn := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001727 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Weltec2877752017-12-07 17:54:35 +01001728 msg_type := RSL_MT_PAGING_CMD,
1729 ies := {
1730 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(tn)}),
1731 tr_RSL_IE(RSL_IE_Body:{paging_group := ?}),
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +07001732 tr_RSL_IE(RSL_IE_Body:{ms_identity := tr_MI_LV(mi)}),
Harald Weltec2877752017-12-07 17:54:35 +01001733 * /* opt: channel needed, eMLPP prio */
1734 }
1735 }
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +07001736 template (value) RSL_Message ts_RSL_PAGING_CMD(MobileIdentityV mi, uint8_t pg, uint3_t tn := 0) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001737 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1738 msg_type := RSL_MT_PAGING_CMD,
1739 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001740 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_PCH_AGCH(tn)}),
Harald Welte9abd1282018-02-19 19:18:17 +01001741 t_RSL_IE(RSL_IE_PAGING_GROUP, RSL_IE_Body:{paging_group := pg}),
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +07001742 t_RSL_IE(RSL_IE_MS_IDENTITY, RSL_IE_Body:{ms_identity := ts_MI_LV(mi)})
Harald Welte9abd1282018-02-19 19:18:17 +01001743 }
1744 }
Harald Weltec2877752017-12-07 17:54:35 +01001745
1746 /* 8.5.6 BSC -> BTS */
1747 template RSL_Message tr_RSL_IMM_ASSIGN(template uint3_t tn := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001748 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Weltec2877752017-12-07 17:54:35 +01001749 msg_type := RSL_MT_IMMEDIATE_ASSIGN_CMD,
1750 ies := {
1751 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(tn)}),
1752 tr_RSL_IE(RSL_IE_Body:{full_imm_ass_info := ?})
1753 }
1754 }
Harald Welteefa7d912018-04-18 23:22:15 +02001755 template (value) RSL_Message ts_RSL_IMM_ASSIGN(octetstring f_ass_inf, uint3_t tn := 0) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001756 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1757 msg_type := RSL_MT_IMMEDIATE_ASSIGN_CMD,
1758 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001759 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_PCH_AGCH(tn)}),
Harald Welte9abd1282018-02-19 19:18:17 +01001760 t_RSL_IE(RSL_IE_FULL_IMM_ASS_INFO, RSL_IE_Body:{full_imm_ass_info := ts_RSL_LV(f_ass_inf)})
1761 }
1762 }
Harald Weltec2877752017-12-07 17:54:35 +01001763
Harald Welte68e495b2018-02-25 00:05:57 +01001764 template RSL_Message tr_RSL_RF_RES_IND := {
Harald Welteefa7d912018-04-18 23:22:15 +02001765 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
Harald Welte68e495b2018-02-25 00:05:57 +01001766 msg_type := RSL_MT_RF_RES_IND,
1767 ies := *
1768 }
1769
Harald Weltecc373202018-09-10 10:28:21 +02001770 /* 8.5.8 BTS <- BSC SMS BROADCAST COMMAND */
1771 template RSL_Message tr_RSL_SMSCB_CMD(template RSL_IE_CbCommandType cb_cmd := ?,
1772 template octetstring msg := ?,
1773 template RslChannelNr chan_nr := ?) := {
1774 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1775 msg_type := RSL_MT_SMS_BC_CMD,
1776 ies := {
1777 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1778 tr_RSL_IE(RSL_IE_Body:{cb_cmd_type := cb_cmd}),
1779 tr_RSL_IE(RSL_IE_Body:{smscb_message := tr_RSL_LV(msg)}),
1780 *
1781 }
1782 }
1783 template (value) RSL_Message ts_RSL_SMSCB_CMD(template (value) RSL_IE_CbCommandType cb_cmd,
1784 template (value) octetstring msg,
1785 template (value) RslChannelNr chan_nr :=
1786 ts_RslChanNr_SDCCH4(0, 2)) := {
1787 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1788 msg_type := RSL_MT_SMS_BC_CMD,
1789 ies := {
1790 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1791 t_RSL_IE(RSL_IE_CB_CMD_TYPE, RSL_IE_Body:{cb_cmd_type := cb_cmd}),
1792 t_RSL_IE(RSL_IE_SMSCB_MSG, RSL_IE_Body:{smscb_message := ts_RSL_LV(msg)})
1793 /* optional channel type for extended CBCH */
1794 }
1795 }
1796
Harald Welte4a129f82019-05-21 16:35:22 +02001797 /* 8.5.9 BTS -> BSC CBCH LOAD INDICATION */
1798 template RSL_Message tr_RSL_CBCH_LOAD_IND_BASIC(template boolean overflow := ?,
1799 template uint4_t slot_count := ?,
1800 template RslChannelNr chan_nr := ?) := {
1801 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1802 msg_type := RSL_MT_CBCH_LOAD_IND,
1803 ies := {
1804 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1805 tr_RSL_IE(RSL_IE_Body:{cbch_load_info := tr_CbchLoadInfo(overflow, slot_count)})
1806 }
1807 }
1808 template (value) RSL_Message ts_RSL_CBCH_LOAD_IND_BASIC(boolean overflow, uint4_t slot_count,
1809 template (value) RslChannelNr chan_nr :=
1810 ts_RslChanNr_SDCCH4(0, 2)) := {
1811 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1812 msg_type := RSL_MT_CBCH_LOAD_IND,
1813 ies := {
1814 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1815 t_RSL_IE(RSL_IE_CBCH_LOAD_INFO, RSL_IE_Body:{cbch_load_info := ts_CbchLoadInfo(overflow, slot_count)})
1816 }
1817 }
1818 template RSL_Message tr_RSL_CBCH_LOAD_IND_EXTD(template boolean overflow := ?,
1819 template uint4_t slot_count := ?,
1820 template RslChannelNr chan_nr := ?) := {
1821 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1822 msg_type := RSL_MT_CBCH_LOAD_IND,
1823 ies := {
1824 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1825 tr_RSL_IE(RSL_IE_Body:{cbch_load_info := tr_CbchLoadInfo(overflow, slot_count)}),
1826 tr_RSL_IE(RSL_IE_Body:{smscb_chan_ind := 1})
1827 }
1828 }
1829 template (value) RSL_Message ts_RSL_CBCH_LOAD_IND_EXTD(boolean overflow, uint4_t slot_count,
1830 template (value) RslChannelNr chan_nr :=
1831 ts_RslChanNr_SDCCH4(0, 2)) := {
1832 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1833 msg_type := RSL_MT_CBCH_LOAD_IND,
1834 ies := {
1835 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1836 t_RSL_IE(RSL_IE_CBCH_LOAD_INFO, RSL_IE_Body:{cbch_load_info := ts_CbchLoadInfo(overflow, slot_count)}),
1837 t_RSL_IE(RSL_IE_SMSCB_CHAN_INDICATOR, RSL_IE_Body:{smscb_chan_ind := 1})
1838 }
1839 }
1840
1841
Harald Welte68e495b2018-02-25 00:05:57 +01001842 /* 8.6.2 BTS <- BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001843 template (value) RSL_Message ts_RSL_SACCH_FILL(RSL_IE_SysinfoType si_type, octetstring l3_info) := {
Harald Welte68e495b2018-02-25 00:05:57 +01001844 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
1845 msg_type := RSL_MT_SACCH_FILL,
1846 ies := {
1847 t_RSL_IE(RSL_IE_SYSINFO_TYPE, RSL_IE_Body:{sysinfo_type := si_type}),
1848 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
1849 }
1850 }
Harald Welte09538f82019-08-01 09:50:25 +02001851 template RSL_Message tr_RSL_NO_SACCH_FILL(template RSL_IE_SysinfoType si_type := ?) := {
1852 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
1853 msg_type := RSL_MT_SACCH_FILL,
1854 ies := {
1855 tr_RSL_IE(RSL_IE_Body:{sysinfo_type := si_type})
1856 }
1857 }
1858 template RSL_Message tr_RSL_SACCH_FILL(template RSL_IE_SysinfoType si_type := ?,
1859 template octetstring l3_info := ?) := {
1860 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
1861 msg_type := RSL_MT_SACCH_FILL,
1862 ies := {
1863 tr_RSL_IE(RSL_IE_Body:{sysinfo_type := si_type}),
1864 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)}),
1865 *
1866 }
1867 }
1868
Harald Welte68e495b2018-02-25 00:05:57 +01001869
Harald Welte643e2a62017-11-27 15:03:18 +01001870 /* 8.6.4 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001871 template (value) RSL_Message ts_RSL_ERROR_REPORT(RSL_Cause cause) := {
Harald Welte01d982c2018-02-25 01:31:40 +01001872 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
1873 msg_type := RSL_MT_ERROR_REPORT,
Harald Welte643e2a62017-11-27 15:03:18 +01001874 ies := {
Harald Welte735dd072017-12-12 14:55:17 +01001875 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
Harald Welte643e2a62017-11-27 15:03:18 +01001876 }
1877 }
Harald Welte01d982c2018-02-25 01:31:40 +01001878 template RSL_Message tr_RSL_ERROR_REPORT(template RSL_Cause cause := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001879 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
Harald Welte01d982c2018-02-25 01:31:40 +01001880 msg_type := RSL_MT_ERROR_REPORT,
1881 ies := {
1882 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)}),
1883 *
1884 }
1885 }
1886
Harald Welte643e2a62017-11-27 15:03:18 +01001887
Harald Welte9958a4d2017-12-14 21:21:33 +01001888
1889 /* Abis/IP specific messages */
1890
1891 template RSL_Message tr_RSL_IPA_CRCX(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001892 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01001893 msg_type := RSL_MT_IPAC_CRCX,
1894 ies := {
1895 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1896 *
1897 }
1898 }
Harald Welteefa7d912018-04-18 23:22:15 +02001899 template (value) RSL_Message ts_RSL_IPA_CRCX(template (value) RslChannelNr chan_nr) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001900 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
1901 msg_type := RSL_MT_IPAC_CRCX,
1902 ies := {
1903 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1904 }
1905 }
1906
Harald Welte9958a4d2017-12-14 21:21:33 +01001907
Harald Welteefa7d912018-04-18 23:22:15 +02001908 template (value) RSL_Message ts_RSL_IPA_CRCX_ACK(template (value) RslChannelNr chan_nr,
1909 uint16_t ipa_conn_id, uint32_t local_ip,
1910 uint16_t local_port, uint7_t rtp_pt2) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01001911 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
1912 msg_type := RSL_MT_IPAC_CRCX_ACK,
1913 ies := {
1914 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1915 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
1916 t_RSL_IE(RSL_IE_IPAC_LOCAL_IP, RSL_IE_Body:{ipa_local_ip := local_ip}),
1917 t_RSL_IE(RSL_IE_IPAC_LOCAL_PORT, RSL_IE_Body:{ipa_local_port := local_port}),
1918 t_RSL_IE(RSL_IE_IPAC_RTP_PAYLOAD2, RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
1919 }
1920 }
Harald Welte9abd1282018-02-19 19:18:17 +01001921 template RSL_Message tr_RSL_IPA_CRCX_ACK(template RslChannelNr chan_nr,
1922 template uint16_t ipa_conn_id,
1923 template uint32_t local_ip,
Harald Welte8bd0f822018-02-25 12:43:28 +01001924 template uint16_t local_port) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001925 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001926 msg_type := RSL_MT_IPAC_CRCX_ACK,
1927 ies := {
1928 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1929 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
1930 tr_RSL_IE(RSL_IE_Body:{ipa_local_ip := local_ip}),
Harald Welte8bd0f822018-02-25 12:43:28 +01001931 tr_RSL_IE(RSL_IE_Body:{ipa_local_port := local_port})
1932 /* Optional: RTP Payload Type 2 IE */
Harald Welte9abd1282018-02-19 19:18:17 +01001933 }
1934 }
Harald Welte9958a4d2017-12-14 21:21:33 +01001935
Harald Welteefa7d912018-04-18 23:22:15 +02001936 template (value) RSL_Message ts_RSL_IPA_CRCX_NACK(template (value) RslChannelNr chan_nr,
1937 RSL_Cause cause) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01001938 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
1939 msg_type := RSL_MT_IPAC_CRCX_NACK,
1940 ies := {
1941 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1942 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
1943 }
1944 }
Harald Welte9abd1282018-02-19 19:18:17 +01001945 template RSL_Message tr_RSL_IPA_CRCX_NACK(template RslChannelNr chan_nr,
1946 template RSL_Cause cause := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001947 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001948 msg_type := RSL_MT_IPAC_CRCX_NACK,
1949 ies := {
1950 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1951 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
1952 }
1953 }
Harald Welte9958a4d2017-12-14 21:21:33 +01001954
Harald Welteefa7d912018-04-18 23:22:15 +02001955 template (value) RSL_Message ts_RSL_IPA_MDCX(template (value) RslChannelNr chan_nr,
1956 uint16_t ipa_conn_id,
1957 uint32_t remote_ip, uint16_t remote_port,
1958 uint7_t rtp_pt2) := {
Harald Welte30527452018-02-25 12:46:25 +01001959 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
1960 msg_type := RSL_MT_IPAC_MDCX,
1961 ies := {
1962 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1963 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
1964 t_RSL_IE(RSL_IE_IPAC_REMOTE_IP, RSL_IE_Body:{ipa_remote_ip := remote_ip}),
1965 t_RSL_IE(RSL_IE_IPAC_REMOTE_PORT, RSL_IE_Body:{ipa_remote_port := remote_port}),
1966 /* optional: RTP Payload Type */
1967 t_RSL_IE(RSL_IE_IPAC_RTP_PAYLOAD2, RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
1968 }
1969 }
Harald Welte9958a4d2017-12-14 21:21:33 +01001970 template RSL_Message tr_RSL_IPA_MDCX(template RslChannelNr chan_nr,
1971 template uint16_t ipa_conn_id) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001972 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01001973 msg_type := RSL_MT_IPAC_MDCX,
1974 ies := {
1975 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1976 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
1977 *
1978 }
1979 }
1980
Harald Welteefa7d912018-04-18 23:22:15 +02001981 template (value) RSL_Message ts_RSL_IPA_MDCX_ACK(template (value) RslChannelNr chan_nr,
1982 uint16_t ipa_conn_id,
1983 uint32_t local_ip, uint16_t local_port,
1984 uint7_t rtp_pt2) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01001985 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte71b5ec82017-12-16 23:01:10 +01001986 msg_type := RSL_MT_IPAC_MDCX_ACK,
Harald Welte9958a4d2017-12-14 21:21:33 +01001987 ies := {
1988 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1989 /* optional */
1990 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
Harald Welte6cb400a2018-02-25 12:45:25 +01001991 t_RSL_IE(RSL_IE_IPAC_LOCAL_IP, RSL_IE_Body:{ipa_local_ip := local_ip}),
1992 t_RSL_IE(RSL_IE_IPAC_LOCAL_PORT, RSL_IE_Body:{ipa_local_port := local_port}),
Harald Welte9958a4d2017-12-14 21:21:33 +01001993 /* optional: RTP Payload Type */
1994 t_RSL_IE(RSL_IE_IPAC_RTP_PAYLOAD2, RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
1995 }
1996 }
Harald Welte30527452018-02-25 12:46:25 +01001997 template RSL_Message tr_RSL_IPA_MDCX_ACK(template RslChannelNr chan_nr,
1998 template uint16_t ipa_conn_id,
1999 template uint32_t local_ip,
2000 template uint16_t local_port,
2001 template uint7_t rtp_pt2) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002002 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte30527452018-02-25 12:46:25 +01002003 msg_type := RSL_MT_IPAC_MDCX_ACK,
2004 ies := {
2005 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2006 /* optional */
2007 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2008 tr_RSL_IE(RSL_IE_Body:{ipa_local_ip := local_ip}),
2009 tr_RSL_IE(RSL_IE_Body:{ipa_local_port := local_port}),
2010 /* optional: RTP Payload Type */
2011 tr_RSL_IE(RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
2012 }
2013 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002014
Harald Welteefa7d912018-04-18 23:22:15 +02002015 template (value) RSL_Message ts_RSL_IPA_MDCX_NACK(template (value) RslChannelNr chan_nr,
2016 RSL_Cause cause,
2017 template (value) uint16_t ipa_conn_id) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002018 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2019 msg_type := RSL_MT_IPAC_MDCX_NACK,
2020 ies := {
2021 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2022 /* optional connection ID */
2023 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2024 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2025 }
2026 }
Harald Welte30527452018-02-25 12:46:25 +01002027 template RSL_Message tr_RSL_IPA_MDCX_NACK(template RslChannelNr chan_nr,
2028 template RSL_Cause cause,
2029 template uint16_t ipa_conn_id) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002030 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte30527452018-02-25 12:46:25 +01002031 msg_type := RSL_MT_IPAC_MDCX_NACK,
2032 ies := {
2033 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2034 /* optional connection ID */
2035 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2036 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
2037 }
2038 }
2039
Harald Welte9958a4d2017-12-14 21:21:33 +01002040
Harald Welteefa7d912018-04-18 23:22:15 +02002041 template (value) RSL_Message ts_RSL_IPA_DLCX_IND(template (value) RslChannelNr chan_nr,
2042 uint16_t ipa_conn_id,
2043 template (value) RSL_IE_IPA_ConnectionStats stats,
2044 RSL_Cause cause) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002045 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2046 msg_type := RSL_MT_IPAC_DLCX_IND,
2047 ies := {
2048 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2049 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2050 t_RSL_IE(RSL_IE_IPAC_CONN_STAT, RSL_IE_Body:{ipa_stats := stats}),
2051 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2052 }
2053 }
2054
Harald Welteefa7d912018-04-18 23:22:15 +02002055 template (value) RSL_Message ts_RSL_IPA_DLCX(template (value) RslChannelNr chan_nr,
2056 uint16_t ipa_conn_id) := {
Harald Weltea871a382018-02-25 02:03:14 +01002057 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2058 msg_type := RSL_MT_IPAC_DLCX,
2059 ies := {
Harald Welte2a7e7162018-02-25 12:46:48 +01002060 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2061 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id})
Harald Weltea871a382018-02-25 02:03:14 +01002062 }
2063 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002064 template RSL_Message tr_RSL_IPA_DLCX(template RslChannelNr chan_nr,
2065 template uint16_t ipa_conn_id := omit) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002066 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002067 msg_type := RSL_MT_IPAC_DLCX,
2068 ies := {
2069 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2070 /* FIXME: optional conn_id */
2071 *
2072 }
2073 }
2074
Harald Welteefa7d912018-04-18 23:22:15 +02002075 template (value) RSL_Message ts_RSL_IPA_DLCX_ACK(template (value) RslChannelNr chan_nr,
2076 uint16_t ipa_conn_id,
2077 RSL_IE_IPA_ConnectionStats stats) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002078 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2079 msg_type := RSL_MT_IPAC_DLCX_ACK,
2080 ies := {
2081 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2082 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2083 t_RSL_IE(RSL_IE_IPAC_CONN_STAT, RSL_IE_Body:{ipa_stats := stats})
2084 }
2085 }
Harald Weltea871a382018-02-25 02:03:14 +01002086 template RSL_Message tr_RSL_IPA_DLCX_ACK(template RslChannelNr chan_nr,
2087 template uint16_t ipa_conn_id,
2088 template RSL_IE_IPA_ConnectionStats stats) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002089 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Weltea871a382018-02-25 02:03:14 +01002090 msg_type := RSL_MT_IPAC_DLCX_ACK,
2091 ies := {
2092 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2093 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2094 tr_RSL_IE(RSL_IE_Body:{ipa_stats := stats})
2095 }
2096 }
2097
2098
Harald Welte9958a4d2017-12-14 21:21:33 +01002099
Harald Welteefa7d912018-04-18 23:22:15 +02002100 template (value) RSL_Message ts_RSL_IPA_DLCX_NACK(template (value) RslChannelNr chan_nr,
2101 RSL_Cause cause, uint16_t ipa_conn_id) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002102 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2103 msg_type := RSL_MT_IPAC_DLCX_NACK,
2104 ies := {
2105 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2106 /* optional connection ID */
2107 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2108 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2109 }
2110 }
Harald Weltea871a382018-02-25 02:03:14 +01002111 template RSL_Message tr_RSL_IPA_DLCX_NACK(template RslChannelNr chan_nr,
2112 template RSL_Cause cause) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002113 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Weltea871a382018-02-25 02:03:14 +01002114 msg_type := RSL_MT_IPAC_DLCX_NACK,
2115 ies := {
2116 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2117 /* optional connection ID */
2118 *,
2119 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
2120 }
2121 }
2122
Harald Welte9958a4d2017-12-14 21:21:33 +01002123
Harald Welteefa7d912018-04-18 23:22:15 +02002124 template (value) RSL_Message ts_RSL_IPA_PDCH_ACT(RslChannelNr chan_nr) := {
Harald Welteee19c732018-04-05 09:08:26 +02002125 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2126 msg_type := RSL_MT_IPAC_PDCH_ACT,
2127 ies := {
2128 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
2129 }
2130 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002131 template RSL_Message tr_RSL_IPA_PDCH_ACT(template RslChannelNr chan_nr) := {
Harald Welteee19c732018-04-05 09:08:26 +02002132 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002133 msg_type := RSL_MT_IPAC_PDCH_ACT,
2134 ies := {
2135 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
2136 }
2137 }
2138
Harald Welteee19c732018-04-05 09:08:26 +02002139
Harald Welte94e0c342018-04-07 11:33:23 +02002140 template RSL_Message ts_RSL_IPA_PDCH_ACT_ACK(RslChannelNr chan_nr,
2141 template (value) RSL_IE_FrameNumber fn) := {
Harald Welteee19c732018-04-05 09:08:26 +02002142 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002143 msg_type := RSL_MT_IPAC_PDCH_ACT_ACK,
2144 ies := {
2145 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2146 t_RSL_IE(RSL_IE_FRAME_NUMBER, RSL_IE_Body:{frame_nr := fn})
2147 }
2148 }
Harald Welteee19c732018-04-05 09:08:26 +02002149 template RSL_Message tr_RSL_IPA_PDCH_ACT_ACK(template RslChannelNr chan_nr,
2150 template RSL_IE_FrameNumber fn) := {
2151 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2152 msg_type := RSL_MT_IPAC_PDCH_ACT_ACK,
2153 ies := {
2154 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2155 tr_RSL_IE(RSL_IE_Body:{frame_nr := fn})
2156 }
2157 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002158
2159 template RSL_Message ts_RSL_IPA_PDCH_ACT_NACK(RslChannelNr chan_nr, RSL_Cause cause) := {
Harald Welteee19c732018-04-05 09:08:26 +02002160 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002161 msg_type := RSL_MT_IPAC_PDCH_ACT_NACK,
2162 ies := {
2163 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2164 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2165 }
2166 }
Harald Welteee19c732018-04-05 09:08:26 +02002167 template RSL_Message tr_RSL_IPA_PDCH_ACT_NACK(template RslChannelNr chan_nr,
2168 template RSL_Cause cause) := {
2169 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2170 msg_type := RSL_MT_IPAC_PDCH_ACT_NACK,
2171 ies := {
2172 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2173 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
2174 }
2175 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002176
Harald Welteee19c732018-04-05 09:08:26 +02002177 template RSL_Message ts_RSL_IPA_PDCH_DEACT(RslChannelNr chan_nr) := {
2178 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2179 msg_type := RSL_MT_IPAC_PDCH_DEACT,
2180 ies := {
2181 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
2182 }
2183 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002184 template RSL_Message tr_RSL_IPA_PDCH_DEACT(template RslChannelNr chan_nr) := {
Harald Welteee19c732018-04-05 09:08:26 +02002185 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002186 msg_type := RSL_MT_IPAC_PDCH_DEACT,
2187 ies := {
2188 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
2189 }
2190 }
2191
2192 template RSL_Message ts_RSL_IPA_PDCH_DEACT_ACK(RslChannelNr chan_nr) := {
Harald Welteee19c732018-04-05 09:08:26 +02002193 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002194 msg_type := RSL_MT_IPAC_PDCH_DEACT_ACK,
2195 ies := {
2196 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
2197 }
2198 }
Harald Welteee19c732018-04-05 09:08:26 +02002199 template RSL_Message tr_RSL_IPA_PDCH_DEACT_ACK(template RslChannelNr chan_nr) := {
2200 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2201 msg_type := RSL_MT_IPAC_PDCH_DEACT_ACK,
2202 ies := {
2203 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
2204 }
2205 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002206
2207 template RSL_Message ts_RSL_IPA_PDCH_DEACT_NACK(RslChannelNr chan_nr, RSL_Cause cause) := {
Harald Welteee19c732018-04-05 09:08:26 +02002208 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002209 msg_type := RSL_MT_IPAC_PDCH_DEACT_NACK,
2210 ies := {
2211 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2212 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2213 }
2214 }
Harald Welteee19c732018-04-05 09:08:26 +02002215 template RSL_Message tr_RSL_IPA_PDCH_DEACT_NACK(template RslChannelNr chan_nr,
2216 template RSL_Cause cause) := {
2217 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2218 msg_type := RSL_MT_IPAC_PDCH_DEACT_NACK,
2219 ies := {
2220 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2221 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
2222 }
2223 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002224
Harald Welte908ce542019-09-04 23:05:40 +02002225 template (value) RSL_Message ts_RSL_OSMO_ETWS_CMD(template (value) octetstring msg,
2226 template (value) RslChannelNr chan_nr := ts_RslChanNr_PCH_AGCH(0)) := {
2227 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2228 msg_type := RSL_MT_OSMO_ETWS_CMD,
2229 ies := {
2230 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2231 t_RSL_IE(RSL_IE_SMSCB_MSG, RSL_IE_Body:{smscb_message := ts_RSL_LV(msg)})
2232 }
2233 }
2234 template RSL_Message tr_RSL_OSMO_ETWS_CMD(template RslChannelNr chan_nr := ?,
2235 template octetstring msg := ?) := {
2236 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2237 msg_type := RSL_MT_OSMO_ETWS_CMD,
2238 ies := {
2239 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2240 tr_RSL_IE(RSL_IE_Body:{smscb_message := tr_RSL_LV(msg)})
2241 }
2242 }
2243
2244
Harald Welte9958a4d2017-12-14 21:21:33 +01002245
Harald Welte6a8199d2018-01-29 21:58:53 +01002246 function f_rsl_find_ie(RSL_Message msg, RSL_IE_Type iei, out RSL_IE_Body ret) return boolean {
2247 for (var integer i := 0; i < sizeof(msg.ies); i := i+1) {
2248 if (msg.ies[i].iei == iei) {
2249 ret := msg.ies[i].body;
2250 return true;
2251 }
2252 }
2253 return false;
2254 }
2255
2256
Harald Welte9958a4d2017-12-14 21:21:33 +01002257
Harald Welte643e2a62017-11-27 15:03:18 +01002258} with { encode "RAW" ; variant "FIELDORDER(msb)" }