blob: 6118dcf3b5dcf52af8397867dca8aa7264c5dec8 [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
Vadim Yanitskiy8fc43df2020-10-20 02:11:05 +0700400 template (value) RSL_IE_ChannelMode ts_RSL_ChanMode_SIGN(RSL_ChanRateType t := RSL_CHRT_SDCCH,
401 boolean dtx_downlink := false) := {
Harald Welte8f2c21d2017-12-07 17:52:40 +0100402 len := 0, /* overwritten */
Harald Welte643e2a62017-11-27 15:03:18 +0100403 reserved := '000000'B,
Stefan Sperling4880be42018-08-07 18:12:59 +0200404 dtx_d := dtx_downlink,
Harald Welte643e2a62017-11-27 15:03:18 +0100405 dtx_u := false,
406 spd_ind := RSL_SPDI_SIGN,
Philipp Maierac693462020-10-14 20:21:44 +0200407 ch_rate_type := t,
Harald Welte643e2a62017-11-27 15:03:18 +0100408 coding_alg_rate := RSL_CMOD_NO_RESOURCE
409 }
410
Stefan Sperling4880be42018-08-07 18:12:59 +0200411 template (value) RSL_IE_ChannelMode ts_RSL_ChanMode(RSL_ChanRateType t, RSL_SpeechAlgo alg,
412 boolean dtx_downlink := false) := {
Harald Welte8f2c21d2017-12-07 17:52:40 +0100413 len := 0, /* overwritten */
Harald Welte643e2a62017-11-27 15:03:18 +0100414 reserved := '000000'B,
Stefan Sperling4880be42018-08-07 18:12:59 +0200415 dtx_d := dtx_downlink,
Harald Welte643e2a62017-11-27 15:03:18 +0100416 dtx_u := false,
417 spd_ind := RSL_SPDI_SPEECH,
418 ch_rate_type := t,
419 coding_alg_rate := alg
420 }
Harald Welte3618d9d2018-03-21 18:45:27 +0100421 template RSL_IE_ChannelMode tr_RSL_ChanMode(template RSL_ChanRateType t,
422 template RSL_SpeechAlgo alg) := {
423 len := ?,
424 reserved := '000000'B,
425 dtx_d := ?,
426 dtx_u := ?,
427 spd_ind := RSL_SPDI_SPEECH,
428 ch_rate_type := t,
429 coding_alg_rate := alg
430 }
Harald Welte643e2a62017-11-27 15:03:18 +0100431
Vadim Yanitskiy117c1762020-06-16 01:40:10 +0700432 /* 9.3.4 BS Power IE */
Harald Welte643e2a62017-11-27 15:03:18 +0100433 type record RSL_IE_BS_Power {
Vadim Yanitskiy117c1762020-06-16 01:40:10 +0700434 uint2_t reserved,
Harald Welte643e2a62017-11-27 15:03:18 +0100435 boolean epc,
436 boolean fpc,
Vadim Yanitskiy117c1762020-06-16 01:40:10 +0700437 uint4_t power_level
Harald Welte643e2a62017-11-27 15:03:18 +0100438 }
439
Vadim Yanitskiy117c1762020-06-16 01:40:10 +0700440 template (value) RSL_IE_BS_Power ts_RSL_IE_BS_Power(uint4_t power_level,
Eric Wildae8f2622019-06-18 17:05:11 +0200441 boolean epc := false, boolean fpc := false) := {
442 reserved := 0,
443 epc := epc,
444 fpc := fpc,
445 power_level := power_level
446 }
447
Harald Welte73cd2712017-12-17 00:44:52 +0100448 /* 9.3.7 */
Harald Weltee613f962018-04-18 22:38:16 +0200449 type enumerated RSL_AlgId {
450 RSL_ALG_ID_A5_0 ('00000001'B),
451 RSL_ALG_ID_A5_1 ('00000010'B),
452 RSL_ALG_ID_A5_2 ('00000011'B),
453 RSL_ALG_ID_A5_3 ('00000100'B),
454 RSL_ALG_ID_A5_4 ('00000101'B),
455 RSL_ALG_ID_A5_5 ('00000110'B),
456 RSL_ALG_ID_A5_6 ('00000111'B),
457 RSL_ALG_ID_A5_7 ('00001000'B)
458 } with { variant "FIELDLENGTH(8)" };
Harald Welte73cd2712017-12-17 00:44:52 +0100459 type record RSL_IE_EncryptionInfo {
460 uint8_t len,
Harald Weltee613f962018-04-18 22:38:16 +0200461 RSL_AlgId alg_id,
Harald Welte73cd2712017-12-17 00:44:52 +0100462 octetstring key
463 } with { variant (len) "LENGTHTO(alg_id,key)" };
464
Harald Weltee613f962018-04-18 22:38:16 +0200465 template RSL_IE_EncryptionInfo tr_RSL_IE_EncrInfo(template RSL_AlgId alg,
466 template octetstring key) := {
Harald Welte73cd2712017-12-17 00:44:52 +0100467 len := ?,
468 alg_id := alg,
469 key := key
470 }
Harald Weltee613f962018-04-18 22:38:16 +0200471 template (value) RSL_IE_EncryptionInfo ts_RSL_IE_EncrInfo(template (value) RSL_AlgId alg,
472 octetstring key) := {
Harald Welteefa7d912018-04-18 23:22:15 +0200473 len := 0, /* overwritten */
474 alg_id := alg,
475 key := key
476 }
477
478
Harald Welte73cd2712017-12-17 00:44:52 +0100479
Harald Welte643e2a62017-11-27 15:03:18 +0100480 /* 9.3.8 */
481 type record RSL_IE_FrameNumber {
482 uint5_t t1_p,
483 uint6_t t3,
484 uint5_t t2
485 }
486 type RSL_IE_FrameNumber RSL_IE_StartingTime;
487
488 /* 9.3.10 */
489 type record RSL_IE_L1Info {
490 uint5_t ms_power_lvl,
491 boolean fpc,
492 uint2_t reserved,
493 uint8_t actual_ta
494 }
495
496 /* 9.3.13 */
497 type record RSL_IE_MS_Power {
498 uint2_t reserved,
499 boolean fpc_epc,
500 uint5_t power_level
501 }
Pau Espin Pedrolf7630a62019-10-28 15:07:08 +0100502 template RSL_IE_MS_Power tr_RSL_IE_MS_Power(template uint5_t power_level := ?,
503 template boolean fpc_epc := false) := {
504 reserved := 0,
505 fpc_epc := fpc_epc,
506 power_level := power_level
507 }
Harald Welte10280172019-05-19 22:28:04 +0200508 template (value) RSL_IE_MS_Power ts_RSL_IE_MS_Power(uint5_t power_level,
509 boolean fpc_epc := false) := {
510 reserved := 0,
511 fpc_epc := fpc_epc,
512 power_level := power_level
513 }
Harald Welte643e2a62017-11-27 15:03:18 +0100514
Harald Welted5f521e2017-12-07 17:53:06 +0100515 /* 9.3.18 */
516 type record RSL_IE_RachLoad {
517 uint8_t len,
518 uint16_t slot_count,
519 uint16_t busy_count,
520 uint16_t access_count
521 } with { variant (len) "LENGTHTO(slot_count,busy_count,access_count)" }
522
Harald Welteefa7d912018-04-18 23:22:15 +0200523 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 +0100524 len := 0, /* overwritten */
525 slot_count := slot,
526 busy_count := busy,
527 access_count := acc
528 }
529
Harald Welte68e495b2018-02-25 00:05:57 +0100530 template RSL_IE_RachLoad tr_RSL_IE_RachLoad(template uint16_t slot,
531 template uint16_t busy,
532 template uint16_t acc) := {
533 len := ?, /* overwritten */
534 slot_count := slot,
535 busy_count := busy,
536 access_count := acc
537 }
538
Harald Welte643e2a62017-11-27 15:03:18 +0100539 /* 9.3.19 */
540 type record RSL_IE_RequestRef {
541 OCT1 ra,
542 RSL_IE_FrameNumber frame_nr
543 }
544
545 /* 3GPP TS 44.018 / 10.5.2.38 Starting Time */
Harald Welte94e0c342018-04-07 11:33:23 +0200546 template (value) RSL_IE_FrameNumber ts_RSL_IE_FrameNumber(GsmFrameNumber fn) := {
Harald Welte643e2a62017-11-27 15:03:18 +0100547 t1_p := (fn / 1326) mod 32,
548 t3 := fn mod 51,
549 t2 := fn mod 26
550 }
551
Harald Welte9abd1282018-02-19 19:18:17 +0100552 function tr_RSL_IE_FrameNumber(template GsmFrameNumber fn) return template RSL_IE_FrameNumber {
553 if (istemplatekind(fn, "?")) {
554 return ?;
555 } else {
556 return ts_RSL_IE_FrameNumber(valueof(fn));
557 }
558 }
559
Harald Welteefa7d912018-04-18 23:22:15 +0200560 template (value) RSL_IE_RequestRef ts_RSL_IE_ReqRef(OCT1 ra, GsmFrameNumber frame_nr) := {
Harald Welte643e2a62017-11-27 15:03:18 +0100561 ra := ra,
562 frame_nr := ts_RSL_IE_FrameNumber(frame_nr)
563 }
564
Harald Welte9abd1282018-02-19 19:18:17 +0100565 template RSL_IE_RequestRef tr_RSL_IE_ReqRef(template OCT1 ra, template GsmFrameNumber frame_nr) := {
566 ra := ra,
567 frame_nr := tr_RSL_IE_FrameNumber(frame_nr)
568 }
569
Harald Welte15de8ba2018-06-29 08:51:42 +0200570 /* Osmocom Extension */
571 type record RSL_IE_UplinkMeasSuppMeasInfo {
572 int16_t toa256_mean,
573 int16_t toa256_min,
574 int16_t toa256_max,
575 uint16_t toa256_std_dev
576 };
577
Harald Welte2691adf2018-02-22 17:32:39 +0100578 /* 9.3.25 */
579 type record RSL_IE_UplinkMeas {
580 uint8_t len,
581 BIT1 rfu,
582 boolean dtx_d,
583 uint6_t rxlev_f_u,
584 BIT2 reserved1,
585 uint6_t rxlev_s_u,
586 BIT2 reserved2,
587 uint3_t rxq_f_u,
588 uint3_t rxq_s_u,
Harald Welte15de8ba2018-06-29 08:51:42 +0200589 RSL_IE_UplinkMeasSuppMeasInfo supp_meas_info optional
Harald Welte2691adf2018-02-22 17:32:39 +0100590 } 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 +0100591
Harald Welte643e2a62017-11-27 15:03:18 +0100592 /* 9.3.26 */
Harald Weltea8ed9062017-12-14 09:46:01 +0100593 type enumerated RSL_Cause {
594 /* normal event */
595 RSL_ERR_RADIO_IF_FAIL ('00'O),
596 RSL_ERR_RADIO_LINK_FAIL ('01'O),
597 RSL_ERR_HANDOVER_ACC_FAIL ('02'O),
598 RSL_ERR_TALKER_ACC_FAIL ('03'O),
599 RSL_ERR_OM_INTERVENTION ('07'O),
600 RSL_ERR_NORMAL_UNSPEC ('0f'O),
601 RSL_ERR_T_MSRFPCI_EXP ('18'O),
602 /* resource unavailable */
603 RSL_ERR_EQUIPMENT_FAIL ('20'O),
604 RSL_ERR_RR_UNAVAIL ('21'O),
605 RSL_ERR_TERR_CH_FAIL ('22'O),
606 RSL_ERR_CCCH_OVERLOAD ('23'O),
607 RSL_ERR_ACCH_OVERLOAD ('24'O),
608 RSL_ERR_PROCESSOR_OVERLOAD ('25'O),
609 RSL_ERR_BTS_NOT_EQUIPPED ('27'O),
610 RSL_ERR_REMOTE_TRAU_FAILURE ('28'O),
611 RSL_ERR_NOTIF_OVERFLOW ('29'O),
612 RSL_ERR_RES_UNAVAIL ('2f'O),
613 /* service or option not available */
614 RSL_ERR_TRANSC_UNAVAIL ('30'O),
615 RSL_ERR_SERV_OPT_UNAVAIL ('3f'O),
616 /* service or option not implemented */
617 RSL_ERR_ENCR_UNIMPL ('40'O),
618 RSL_ERR_SERV_OPT_UNIMPL ('4f'O),
619 /* invalid message */
620 RSL_ERR_RCH_ALR_ACTV_ALLOC ('50'O),
Harald Welte9912eb52018-02-25 13:30:15 +0100621 RSL_ERR_IPA_RCH_NOT_ACTV_ALLOC ('51'O),
622 RSL_ERR_IPA_CONN_INVALID ('52'O),
623 RSL_ERR_IPA_CONN_IN_USE ('53'O),
624 RSL_ERR_IPA_CONN_ALREADY_EXISTS ('54'O),
Harald Weltea8ed9062017-12-14 09:46:01 +0100625 RSL_ERR_INVALID_MESSAGE ('5f'O),
626 /* protocol error */
627 RSL_ERR_MSG_DISCR ('60'O),
628 RSL_ERR_MSG_TYPE ('61'O),
629 RSL_ERR_MSG_SEQ ('62'O),
630 RSL_ERR_IE_ERROR ('63'O),
631 RSL_ERR_MAND_IE_ERROR ('64'O),
632 RSL_ERR_OPT_IE_ERROR ('65'O),
633 RSL_ERR_IE_NONEXIST ('66'O),
634 RSL_ERR_IE_LENGTH ('67'O),
635 RSL_ERR_IE_CONTENT ('68'O),
636 RSL_ERR_PROTO ('6f'O),
637 /* interworking */
638 RSL_ERR_INTERWORKING ('7f'O)
639 };
Harald Welte643e2a62017-11-27 15:03:18 +0100640 type record RSL_IE_Cause {
Harald Welte6efa8e32017-12-09 22:34:06 +0100641 uint8_t len,
Harald Welte643e2a62017-11-27 15:03:18 +0100642 uint1_t e,
643 RSL_Cause cause,
644 octetstring cause_ext optional
Harald Welte6efa8e32017-12-09 22:34:06 +0100645 } with { variant (len) "LENGTHTO(e,cause,cause_ext)" }
Harald Welte643e2a62017-11-27 15:03:18 +0100646
Harald Welteefa7d912018-04-18 23:22:15 +0200647 template (value) RSL_IE_Cause ts_RSL_IE_Cause(RSL_Cause cause) := {
Harald Welte6efa8e32017-12-09 22:34:06 +0100648 len := 0, /* overwritten */
Harald Welte643e2a62017-11-27 15:03:18 +0100649 e := 0,
650 cause := cause,
651 cause_ext := omit
652 }
653
Harald Welte9abd1282018-02-19 19:18:17 +0100654 template RSL_IE_Cause tr_RSL_IE_Cause(template RSL_Cause cause) := {
655 len := ?,
656 e := 0,
657 cause := cause,
658 cause_ext := omit
659 }
660
Harald Weltec8d363c2019-05-19 20:36:48 +0200661 /* 9.3.29 */
662 type record RSL_SacchInfo {
663 uint8_t len,
664 uint8_t num_msgs,
665 RSL_SacchInfoElements elems
666 } with {
667 variant (len) "LENGTHTO(num_msgs,elems)";
668 variant (num_msgs) "LENGTHTO(elems)";
669 variant (num_msgs) "UNIT(elements)"
670 };
671 type record RSL_SacchInfoElement {
672 RSL_IE_SysinfoType si_type,
673 uint8_t len,
674 octetstring msg
675 } with {
676 variant (len) "LENGTHTO(msg)";
677 };
678 type record of RSL_SacchInfoElement RSL_SacchInfoElements;
679 template (value) RSL_SacchInfo ts_RSL_SacchInfo(template (value) RSL_SacchInfoElements elems) := {
680 len := 0, /* overwritten */
681 num_msgs := 0, /* overwritten */
682 elems := elems
683 }
684 template (value) RSL_SacchInfoElement ts_RSL_SacchInfoElem(RSL_IE_SysinfoType tp, octetstring msg) := {
685 si_type := tp,
686 len := lengthof(msg),
687 msg := msg
688 }
689
Eric Wild61edb7e2019-06-03 12:38:31 +0200690 /* 9.3.31 */
691 type record RSL_IE_MS_Power_Parameters {
692 uint8_t len,
693 octetstring params
694 } with {
695 variant (len) "LENGTHTO(params)";
696 };
697 template (value) RSL_IE_MS_Power_Parameters ts_RSL_IE_MS_Power_Parameters(octetstring params) := {
698 len := 0, /* overwritten */
699 params := params
700 }
701
Harald Welte643e2a62017-11-27 15:03:18 +0100702 /* 9.3.40 */
703 type enumerated RSL_ChanNeeded {
704 RSL_CHANNEED_ANY ('00'B),
705 RSL_CHANNEED_SDCCH ('01'B),
706 RSL_CHANNEED_TCH_F ('10'B),
707 RSL_CHANNEED_TCH_ForH ('11'B)
Harald Welte51d74102017-12-10 23:05:02 +0100708 } with { variant "FIELDLENGTH(2)" };
Harald Welte643e2a62017-11-27 15:03:18 +0100709 type record RSL_IE_ChanNeeded {
710 uint6_t reserved,
711 RSL_ChanNeeded chan_needed
712 }
713
Harald Weltecc373202018-09-10 10:28:21 +0200714 /* 9.3.41 CB Command Type */
715 type enumerated RSL_CbCommand {
716 RSL_CB_CMD_NORMAL ('0000'B),
717 RSL_CB_CMD_SCHEDULE ('1000'B),
718 RSL_CB_CMD_DEFAULT ('1110'B),
719 RSL_CB_CMD_NULL ('1111'B)
720 } with { variant "FIELDLENGTH(4)" };
721 type record RSL_IE_CbCommandType {
722 RSL_CbCommand command,
723 boolean default_bcast_null,
724 BIT1 spare,
725 uint2_t last_block
726 };
727 template (value) RSL_IE_CbCommandType ts_RSL_IE_CbCmdType(RSL_CbCommand cmd := RSL_CB_CMD_NORMAL,
728 uint2_t last_block := 1,
729 boolean def_bcast_null := true) := {
730 command := cmd,
731 default_bcast_null := def_bcast_null,
732 spare := '0'B,
733 last_block := last_block
734 }
735
Harald Welte4a129f82019-05-21 16:35:22 +0200736 /* 9.4.43 CBCH Load Information */
737 type record RSL_IE_CbchLoadInfo {
738 boolean overflow,
739 BIT3 spare,
740 uint4_t slot_count
741 };
742 template RSL_IE_CbchLoadInfo tr_CbchLoadInfo(template boolean overflow,
743 template uint4_t slot_count) := {
744 overflow := overflow,
745 spare := ?,
746 slot_count := slot_count
747 }
748 template (value) RSL_IE_CbchLoadInfo ts_CbchLoadInfo(boolean overflow, uint4_t slot_count) := {
749 overflow := overflow,
750 spare := '000'B,
751 slot_count := slot_count
752 }
753
Harald Welte643e2a62017-11-27 15:03:18 +0100754 /* 9.3.53 */
755 type record RSL_IE_MultirateCtrl {
756 uint3_t spare,
757 boolean od,
758 boolean pre,
759 uint2_t rae,
760 boolean tfo
761 }
762
763 type enumerated RSL_IE_SysinfoType {
764 RSL_SYSTEM_INFO_8 ('00000000'B),
765 RSL_SYSTEM_INFO_1 ('00000001'B),
766 RSL_SYSTEM_INFO_2 ('00000010'B),
767 RSL_SYSTEM_INFO_3 ('00000011'B),
768 RSL_SYSTEM_INFO_4 ('00000100'B),
769 RSL_SYSTEM_INFO_5 ('00000101'B),
770 RSL_SYSTEM_INFO_6 ('00000110'B),
771 RSL_SYSTEM_INFO_7 ('00000111'B),
772 RSL_SYSTEM_INFO_16 ('00001000'B),
773 RSL_SYSTEM_INFO_17 ('00001001'B),
774 RSL_SYSTEM_INFO_2bis ('00001010'B),
775 RSL_SYSTEM_INFO_2ter ('00001011'B),
776 RSL_SYSTEM_INFO_5bis ('00001101'B),
777 RSL_SYSTEM_INFO_5ter ('00001110'B),
778 RSL_SYSTEM_INFO_10 ('00001111'B),
779 RSL_EXT_MEAS_ORDER ('01000111'B),
780 RSL_MEAS_INFO ('01001000'B),
781 RSL_SYSTEM_INFO_13 ('00101000'B),
782 RSL_ERIC_SYSTEM_INFO_13 ('00001100'B),
783 RSL_SYSTEM_INFO_2quater ('00101001'B),
784 RSL_SYSTEM_INFO_9 ('00101010'B),
785 RSL_SYSTEM_INFO_18 ('00101011'B),
786 RSL_SYSTEM_INFO_19 ('00101100'B),
787 RSL_SYSTEM_INFO_20 ('00101101'B)
788 } with { variant "FIELDLENGTH(8)" }
789
Harald Welte9958a4d2017-12-14 21:21:33 +0100790 type record RSL_IE_IPA_ConnectionStats {
791 uint8_t len,
792 uint32_t tx_packets,
793 uint32_t tx_octets,
794 uint32_t rx_packets,
795 uint32_t rx_octets,
796 uint32_t lost_packets,
797 uint32_t jitter,
798 uint32_t avg_delay
799 } with { variant (len) "LENGTHTO(tx_packets,tx_octets,rx_packets,rx_octets,lost_packets,jitter,avg_delay)" }
800
801 type enumerated RSL_IPA_SpeechMode {
802 RSL_IPA_SPM_SENDRECV ('00'B),
803 RSL_IPA_SPM_RECVONLY ('01'B),
804 RSL_IPA_SPM_SENDONLY ('10'B),
805 RSL_IPA_SPM_RESERVED ('11'B)
806 } with { variant "FIELDLENGTH(2)" }
807
808 type enumerated RSL_IPA_Codec {
809 RSL_IPA_CODEC_FR ('0000'B),
810 RSL_IPA_CODEC_EFR ('0001'B),
811 RSL_IPA_CODEC_AMR_F ('0010'B),
812 RSL_IPA_CODEC_HR ('0011'B),
813 RSL_IPA_CODEC_AMR_H ('0101'B),
814 RSL_IPA_CODEC_RTP_PT ('1111'B)
815 } with { variant "FIELDLENGTH(4)" }
816
817 type record RSL_IE_IPA_SpeechMode {
818 BIT2 reserved,
819 RSL_IPA_SpeechMode mode,
820 RSL_IPA_Codec codec
821 }
822
Harald Welte0472ab42018-03-12 15:02:26 +0100823 /* 9.3.20 */
824 type enumerated RSL_IE_ReleaseMode {
825 RSL_REL_MODE_NORMAL ('00'B),
826 REL_REL_MODE_LOCAL ('01'B)
827 }
828
Harald Welte643e2a62017-11-27 15:03:18 +0100829 /* union of all IE bodies */
830 type union RSL_IE_Body {
831 RslChannelNr chan_nr,
832 RslLinkId link_id,
Harald Welte15bb5b52017-12-07 17:52:04 +0100833 RSL_L16V l3_info,
Harald Welte643e2a62017-11-27 15:03:18 +0100834 RSL_LV rlm_cause,
Harald Welte0472ab42018-03-12 15:02:26 +0100835 RSL_IE_ReleaseMode release_mode,
Harald Welte643e2a62017-11-27 15:03:18 +0100836 RSL_IE_ActivationType act_type,
Vadim Yanitskiye02dbcc2020-08-25 04:20:51 +0700837 RSL_IE_ChannelIdent chan_ident,
Harald Welte643e2a62017-11-27 15:03:18 +0100838 RSL_IE_ChannelMode chan_mode,
839 uint8_t handover_ref,
840 RSL_IE_BS_Power bs_power,
Vadim Yanitskiy802508e2020-11-11 07:25:47 +0700841 RSL_LV bs_power_params,
Harald Welte643e2a62017-11-27 15:03:18 +0100842 RSL_IE_MS_Power ms_power,
Eric Wild61edb7e2019-06-03 12:38:31 +0200843 RSL_IE_MS_Power_Parameters ms_power_params,
Harald Welte643e2a62017-11-27 15:03:18 +0100844 uint8_t timing_adv,
845 RSL_IE_MultirateCtrl multirate_ctrl,
Harald Weltea6706152019-05-19 20:38:18 +0200846 uint8_t msg_id,
Harald Welte643e2a62017-11-27 15:03:18 +0100847 RSL_IE_FrameNumber frame_nr,
848 RSL_IE_Cause cause,
849 uint8_t access_delay,
Harald Welted5f521e2017-12-07 17:53:06 +0100850 RSL_IE_RachLoad rach_load,
Harald Welte643e2a62017-11-27 15:03:18 +0100851 uint8_t meas_res_nr,
Harald Welte2691adf2018-02-22 17:32:39 +0100852 uint8_t ms_timing_offset,
853 RSL_IE_UplinkMeas uplink_meas,
Harald Welte643e2a62017-11-27 15:03:18 +0100854 RSL_IE_L1Info l1_info,
855 RSL_IE_SysinfoType sysinfo_type,
856 uint16_t paging_load,
857 uint8_t paging_group,
858 RSL_IE_ChanNeeded chan_needed,
Harald Weltecc373202018-09-10 10:28:21 +0200859 RSL_IE_CbCommandType cb_cmd_type,
860 RSL_LV smscb_message,
Harald Welte4a129f82019-05-21 16:35:22 +0200861 RSL_IE_CbchLoadInfo cbch_load_info,
Harald Weltec8d363c2019-05-19 20:36:48 +0200862 RSL_SacchInfo sacch_info,
Harald Weltecc373202018-09-10 10:28:21 +0200863
Harald Welte643e2a62017-11-27 15:03:18 +0100864 RSL_IE_StartingTime starting_time,
Harald Welte73cd2712017-12-17 00:44:52 +0100865 RSL_IE_EncryptionInfo encr_info,
Harald Weltea3ff6702019-05-20 20:03:50 +0200866 uint8_t smscb_chan_ind,
Harald Welte643e2a62017-11-27 15:03:18 +0100867 RSL_IE_RequestRef req_ref,
868 RSL_LV full_imm_ass_info,
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +0700869 MobileIdentityLV ms_identity,
Harald Welte643e2a62017-11-27 15:03:18 +0100870
Harald Welte9958a4d2017-12-14 21:21:33 +0100871 uint16_t ipa_conn_id,
872 uint16_t ipa_local_port,
873 uint16_t ipa_remote_port,
874 uint32_t ipa_local_ip,
875 uint32_t ipa_remote_ip,
876 uint8_t ipa_rtp_pt,
877 uint8_t ipa_rtp_pt2,
878 RSL_IE_IPA_ConnectionStats ipa_stats,
879 RSL_IE_IPA_SpeechMode ipa_speech_mode,
880
Harald Welte643e2a62017-11-27 15:03:18 +0100881 RSL_LV other
882 }
883
884 type record RSL_IE {
885 RSL_IE_Type iei,
886 RSL_IE_Body body
887 } with { variant (body) "CROSSTAG(
888 chan_nr, iei = RSL_IE_CHAN_NR;
889 link_id, iei = RSL_IE_LINK_IDENT;
890 l3_info, iei = RSL_IE_L3_INFO;
891 rlm_cause, iei = RSL_IE_RLM_CAUSE;
892 release_mode, iei = RSL_IE_RELEASE_MODE;
893 act_type, iei = RSL_IE_ACT_TYPE;
Vadim Yanitskiye02dbcc2020-08-25 04:20:51 +0700894 chan_ident, iei = RSL_IE_CHAN_IDENT;
Harald Welte643e2a62017-11-27 15:03:18 +0100895 chan_mode, iei = RSL_IE_CHAN_MODE;
896 handover_ref, iei = RSL_IE_HANDO_REF;
897 bs_power, iei = RSL_IE_BS_POWER;
Vadim Yanitskiy802508e2020-11-11 07:25:47 +0700898 bs_power_params, iei = RSL_IE_BS_POWER_PARAM;
Harald Welte643e2a62017-11-27 15:03:18 +0100899 ms_power, iei = RSL_IE_MS_POWER;
Eric Wild61edb7e2019-06-03 12:38:31 +0200900 ms_power_params, iei = RSL_IE_MS_POWER_PARAM;
Harald Welte643e2a62017-11-27 15:03:18 +0100901 timing_adv, iei = RSL_IE_TIMING_ADVANCE;
902 multirate_ctrl, iei = RSL_IE_MR_CONTROL;
Harald Weltea6706152019-05-19 20:38:18 +0200903 msg_id, iei = RSL_IE_MSG_ID;
Harald Welte643e2a62017-11-27 15:03:18 +0100904
905 frame_nr, iei = RSL_IE_FRAME_NUMBER;
906 cause, iei = RSL_IE_CAUSE;
907 access_delay, iei = RSL_IE_ACCESS_DELAY;
Harald Welted5f521e2017-12-07 17:53:06 +0100908 rach_load, iei = RSL_IE_RACH_LOAD;
Harald Welte643e2a62017-11-27 15:03:18 +0100909 meas_res_nr, iei = RSL_IE_MEAS_RES_NR;
Harald Welte2691adf2018-02-22 17:32:39 +0100910 ms_timing_offset, iei = RSL_IE_MS_TIMING_OFFSET;
911 uplink_meas, iei = RSL_IE_UPLINK_MEAS;
Harald Welte643e2a62017-11-27 15:03:18 +0100912 l1_info, iei = RSL_IE_L1_INFO;
913 sysinfo_type, iei = RSL_IE_SYSINFO_TYPE;
914 paging_load, iei = RSL_IE_PAGING_LOAD;
915 paging_group, iei = RSL_IE_PAGING_GROUP;
916 chan_needed, iei = RSL_IE_CHAN_NEEDED;
Harald Weltecc373202018-09-10 10:28:21 +0200917 cb_cmd_type, iei = RSL_IE_CB_CMD_TYPE;
918 smscb_message, iei = RSL_IE_SMSCB_MSG;
Harald Welte4a129f82019-05-21 16:35:22 +0200919 cbch_load_info, iei = RSL_IE_CBCH_LOAD_INFO;
Harald Weltec8d363c2019-05-19 20:36:48 +0200920 sacch_info, iei = RSL_IE_SACCH_INFO;
Harald Welte643e2a62017-11-27 15:03:18 +0100921 starting_time, iei = RSL_IE_STARTNG_TIME;
Harald Welte73cd2712017-12-17 00:44:52 +0100922 encr_info, iei = RSL_IE_ENCR_INFO;
Harald Weltea3ff6702019-05-20 20:03:50 +0200923 smscb_chan_ind, iei = RSL_IE_SMSCB_CHAN_INDICATOR;
Harald Welte643e2a62017-11-27 15:03:18 +0100924
925 req_ref, iei = RSL_IE_REQ_REFERENCE;
Harald Weltefff69302017-12-07 17:53:42 +0100926 full_imm_ass_info, iei = RSL_IE_FULL_IMM_ASS_INFO;
927 ms_identity, iei = RSL_IE_MS_IDENTITY;
928 other, iei = RSL_IE_FULL_BCCH_INFO;
Harald Welte643e2a62017-11-27 15:03:18 +0100929
Harald Welte9958a4d2017-12-14 21:21:33 +0100930 ipa_conn_id, iei = RSL_IE_IPAC_CONN_ID;
931 ipa_remote_ip, iei = RSL_IE_IPAC_REMOTE_IP;
932 ipa_remote_port, iei = RSL_IE_IPAC_REMOTE_PORT;
933 ipa_local_ip, iei = RSL_IE_IPAC_LOCAL_IP;
934 ipa_local_port, iei = RSL_IE_IPAC_LOCAL_PORT;
935 ipa_rtp_pt, iei = RSL_IE_IPAC_RTP_PAYLOAD;
936 ipa_rtp_pt2, iei = RSL_IE_IPAC_RTP_PAYLOAD2;
937 ipa_stats, iei = RSL_IE_IPAC_CONN_STAT;
938 ipa_speech_mode, iei = RSL_IE_IPAC_SPEECH_MODE;
939
Harald Welte643e2a62017-11-27 15:03:18 +0100940 other, OTHERWISE;
941 )" };
942
Harald Welte735dd072017-12-12 14:55:17 +0100943 /* For some reason the TTCN-3 RAW codec cannot automatically figure out the IEI
944 * that it needs to set for a given union-choice (body). So we have to explicitly
945 * specify the IEI by the caller :( */
Harald Welteefa7d912018-04-18 23:22:15 +0200946 template (value) RSL_IE t_RSL_IE(RSL_IE_Type iei, template (value) RSL_IE_Body body) := {
Harald Welte735dd072017-12-12 14:55:17 +0100947 iei := iei,
Harald Welte643e2a62017-11-27 15:03:18 +0100948 body := body
949 }
950
Harald Weltec2877752017-12-07 17:54:35 +0100951 template RSL_IE tr_RSL_IE(template RSL_IE_Body body) := {
952 iei := ?, /* overwritten? */
953 body := body
954 }
955
956
Harald Welte643e2a62017-11-27 15:03:18 +0100957 type record of RSL_IE RSL_IE_List;
958
959 type record RSL_Message {
960 RSL_MessageDiscriminator msg_disc,
961 RSL_MessageType msg_type,
962 RSL_IE_List ies optional
963 }
964
965 external function enc_RSL_Message(in RSL_Message msg) return octetstring
966 with { extension "prototype(convert) encode(RAW)" };
967 external function dec_RSL_Message(in octetstring stream) return RSL_Message
968 with { extension "prototype(convert) decode(RAW)" };
969
Harald Weltebc330be2017-12-09 00:56:36 +0100970 template RSL_Message tr_RSL_MsgDiscType(template RSL_MessageDiscriminator m_disc,
Harald Welte643e2a62017-11-27 15:03:18 +0100971 RSL_MessageType m_type) := {
972 msg_disc := m_disc,
973 msg_type := m_type,
974 ies := *
975 }
976
Harald Welteefa7d912018-04-18 23:22:15 +0200977 template (value) RSL_Message ts_RSL_MsgDiscType(template (value) RSL_MessageDiscriminator m_disc,
978 template (value) RSL_MessageType msg_type,
979 template (omit) RSL_IE_List ies := omit) := {
Harald Welte4a267362017-12-09 17:49:32 +0100980 msg_disc := m_disc,
981 msg_type := msg_type,
982 ies := ies
983 }
984
Harald Weltebc330be2017-12-09 00:56:36 +0100985template RSL_Message tr_RSL_MsgType(template RSL_MessageType msg_type) := {
986 msg_disc := ?,
987 msg_type := msg_type,
988 ies := *
989}
990
991/* Common Channel Management */
992template RSL_Message tr_RSL_MsgTypeC(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
993 msg_disc := { RSL_MDISC_CCHAN, ? }
994}
995
996/* RLL */
997template RSL_Message tr_RSL_MsgTypeR(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
998 msg_disc := { RSL_MDISC_RLL, true }
999}
1000
1001/* Dedicated Channel Management */
1002template RSL_Message tr_RSL_MsgTypeD(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
1003 msg_disc := { RSL_MDISC_DCHAN, ? }
1004}
1005
1006/* Dedicated Channel Management */
1007template RSL_Message tr_RSL_MsgTypeT(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
1008 msg_disc := { RSL_MDISC_TRX_MGMT, ? }
1009}
1010
1011
1012/* dedicated channel or RLL */
1013template RSL_Message tr_RSL_MsgTypeDR(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
Harald Weltee5408222018-01-29 21:57:58 +01001014 msg_disc := ({RSL_MDISC_DCHAN,?}, {RSL_MDISC_RLL,?}, {RSL_MDISC_IPACCESS,false})
Harald Weltebc330be2017-12-09 00:56:36 +01001015}
1016
1017
Harald Welte643e2a62017-11-27 15:03:18 +01001018 /* 8.3.1 BSC -> BTS */
Harald Welteefa7d912018-04-18 23:22:15 +02001019 template (value) RSL_Message ts_RSL_DATA_REQ(template (value) RslChannelNr chan_nr,
1020 template (value) RslLinkId link_id,
1021 octetstring l3_info) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001022 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, true),
1023 msg_type := RSL_MT_DATA_REQ,
1024 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001025 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1026 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
1027 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
Harald Welte643e2a62017-11-27 15:03:18 +01001028 }
1029 }
1030
Harald Welte7794d5b2017-12-16 23:00:20 +01001031 template RSL_Message tr_RSL_DATA_REQ(template RslChannelNr chan_nr :=?,
1032 template RslLinkId link_id := ?,
1033 template octetstring l3_info := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001034 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, true),
Harald Welte7794d5b2017-12-16 23:00:20 +01001035 msg_type := RSL_MT_DATA_REQ,
1036 ies :={
1037 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1038 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
1039 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
1040 }
1041 }
1042
1043
Harald Welte643e2a62017-11-27 15:03:18 +01001044 /* 8.3.2 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001045 template (value) RSL_Message ts_RSL_DATA_IND(template (value) RslChannelNr chan_nr,
1046 template (value) RslLinkId link_id,
1047 octetstring l3_info) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001048 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, true),
1049 msg_type := RSL_MT_DATA_IND,
1050 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001051 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1052 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
1053 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
Harald Welte643e2a62017-11-27 15:03:18 +01001054 }
1055 }
Harald Welte9abd1282018-02-19 19:18:17 +01001056 template RSL_Message tr_RSL_DATA_IND(template RslChannelNr chan_nr, template RslLinkId link_id,
1057 template octetstring l3_info := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001058 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, true),
Harald Welte9abd1282018-02-19 19:18:17 +01001059 msg_type := RSL_MT_DATA_IND,
1060 ies :={
1061 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1062 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
1063 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
1064 }
1065 }
Harald Welte643e2a62017-11-27 15:03:18 +01001066
1067 /* 8.3.3 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001068 template (value) RSL_Message ts_RSL_ERROR_IND(template (value) RslChannelNr chan_nr,
Harald Weltea7d81f12019-06-02 22:33:19 +02001069 template (value) RslLinkId link_id,
1070 template (value) octetstring rlm_cause) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001071 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1072 msg_type := RSL_MT_ERROR_IND,
1073 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001074 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1075 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
Harald Weltea7d81f12019-06-02 22:33:19 +02001076 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{rlm_cause := ts_RSL_LV(rlm_cause)})
Harald Welte643e2a62017-11-27 15:03:18 +01001077 }
1078 }
Harald Welte9abd1282018-02-19 19:18:17 +01001079 template RSL_Message tr_RSL_ERROR_IND(template RslChannelNr chan_nr, template RslLinkId link_id,
Harald Weltea7d81f12019-06-02 22:33:19 +02001080 template octetstring rlm_cause := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001081 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001082 msg_type := RSL_MT_ERROR_IND,
1083 ies :={
1084 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1085 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
Harald Weltea7d81f12019-06-02 22:33:19 +02001086 tr_RSL_IE(RSL_IE_Body:{rlm_cause := tr_RSL_LV(rlm_cause)})
Harald Welte9abd1282018-02-19 19:18:17 +01001087 }
1088 }
Harald Welte643e2a62017-11-27 15:03:18 +01001089
Harald Welteefa7d912018-04-18 23:22:15 +02001090 /* 8.3.4 BTS <- BSC */
1091 template (value) RSL_Message ts_RSL_EST_REQ(template (value) RslChannelNr chan_nr,
1092 template (value) RslLinkId link_id) := {
1093 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1094 msg_type := RSL_MT_EST_REQ,
1095 ies := {
1096 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1097 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
1098 }
1099 }
1100 template RSL_Message tr_RSL_EST_REQ(template RslChannelNr chan_nr, template RslLinkId link_id) := {
1101 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
1102 msg_type := RSL_MT_EST_REQ,
1103 ies := {
1104 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1105 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1106 }
1107 }
1108
1109 /* 8.3.5 BTS -> BSC */
1110 template (value) RSL_Message ts_RSL_EST_CONF(template (value) RslChannelNr chan_nr,
1111 template (value) RslLinkId link_id) := {
1112 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1113 msg_type := RSL_MT_EST_CONF,
1114 ies := {
1115 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1116 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
1117 }
1118 }
1119 template RSL_Message tr_RSL_EST_CONF(template RslChannelNr chan_nr, template RslLinkId link_id) := {
1120 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
1121 msg_type := RSL_MT_EST_CONF,
1122 ies := {
1123 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1124 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1125 }
1126 }
1127
Harald Welte643e2a62017-11-27 15:03:18 +01001128 /* 8.3.6 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001129 template (value) RSL_Message ts_RSL_EST_IND(template (value) RslChannelNr chan_nr,
1130 template (value) RslLinkId link_id,
1131 octetstring l3_info) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001132 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1133 msg_type := RSL_MT_EST_IND,
1134 ies := {
Harald Welte735dd072017-12-12 14:55:17 +01001135 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1136 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
1137 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
Harald Welte643e2a62017-11-27 15:03:18 +01001138 }
1139 }
Harald Welte9abd1282018-02-19 19:18:17 +01001140 template RSL_Message tr_RSL_EST_IND(template RslChannelNr chan_nr, template RslLinkId link_id,
1141 template octetstring l3_info := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001142 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001143 msg_type := RSL_MT_EST_IND,
1144 ies := {
1145 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1146 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
1147 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
1148 }
1149 }
Harald Welte0472ab42018-03-12 15:02:26 +01001150 template RSL_Message tr_RSL_EST_IND_NOL3(template RslChannelNr chan_nr, template RslLinkId link_id) :=
1151{
1152 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
1153 msg_type := RSL_MT_EST_IND,
1154 ies := {
1155 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1156 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1157 }
1158 }
1159
Harald Welte643e2a62017-11-27 15:03:18 +01001160
1161 /* 8.3.7 BSC -> BTS */
Harald Welteefa7d912018-04-18 23:22:15 +02001162 template (value) RSL_Message ts_RSL_REL_REQ(template (value) RslChannelNr chan_nr,
Harald Welte0472ab42018-03-12 15:02:26 +01001163 template (value) RslLinkId link_id,
1164 template (value) RSL_IE_ReleaseMode rel_mode := RSL_REL_MODE_NORMAL) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001165 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1166 msg_type := RSL_MT_REL_REQ,
1167 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001168 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
Harald Welte0472ab42018-03-12 15:02:26 +01001169 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
1170 t_RSL_IE(RSL_IE_RELEASE_MODE, RSL_IE_Body:{release_mode := rel_mode})
Harald Welte643e2a62017-11-27 15:03:18 +01001171 }
1172 }
Harald Weltee8a5ab12017-12-09 22:34:57 +01001173 template RSL_Message tr_RSL_REL_REQ(template RslChannelNr chan_nr,
Harald Welte0472ab42018-03-12 15:02:26 +01001174 template RslLinkId link_id,
1175 template RSL_IE_ReleaseMode rel_mode := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001176 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Weltee8a5ab12017-12-09 22:34:57 +01001177 msg_type := RSL_MT_REL_REQ,
1178 ies :={
1179 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1180 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
Harald Welte0472ab42018-03-12 15:02:26 +01001181 tr_RSL_IE(RSL_IE_Body:{release_mode := rel_mode})
Harald Weltee8a5ab12017-12-09 22:34:57 +01001182 }
1183 }
Harald Welte643e2a62017-11-27 15:03:18 +01001184
1185 /* 8.3.8 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001186 template (value) RSL_Message ts_RSL_REL_CONF(template (value) RslChannelNr chan_nr,
1187 template (value) RslLinkId link_id) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001188 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1189 msg_type := RSL_MT_REL_CONF,
1190 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001191 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1192 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
Harald Welte643e2a62017-11-27 15:03:18 +01001193 }
1194 }
Harald Welte9abd1282018-02-19 19:18:17 +01001195 template RSL_Message tr_RSL_REL_CONF(template RslChannelNr chan_nr, template RslLinkId link_id) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001196 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001197 msg_type := RSL_MT_REL_CONF,
1198 ies :={
1199 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1200 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1201 }
1202 }
Harald Welte643e2a62017-11-27 15:03:18 +01001203
1204 /* 8.3.9 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001205 template (value) RSL_Message ts_RSL_REL_IND(template (value) RslChannelNr chan_nr,
1206 template (value) RslLinkId link_id) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001207 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1208 msg_type := RSL_MT_REL_IND,
1209 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001210 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1211 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
Harald Welte643e2a62017-11-27 15:03:18 +01001212 }
1213 }
Harald Welte9abd1282018-02-19 19:18:17 +01001214 template RSL_Message tr_RSL_REL_IND(template RslChannelNr chan_nr, template RslLinkId link_id) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001215 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001216 msg_type := RSL_MT_REL_IND,
1217 ies :={
1218 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1219 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1220 }
1221 }
Harald Welte643e2a62017-11-27 15:03:18 +01001222
1223 /* 8.3.10 BSC -> BTS */
Harald Welteefa7d912018-04-18 23:22:15 +02001224 template (value) RSL_Message ts_RSL_UNITDATA_REQ(template (value) RslChannelNr chan_nr,
1225 template (value) RslLinkId link_id,
1226 octetstring l3_info)
Harald Welte643e2a62017-11-27 15:03:18 +01001227 modifies ts_RSL_DATA_REQ := {
1228 msg_type := RSL_MT_UNIT_DATA_REQ
1229 }
Harald Welte0472ab42018-03-12 15:02:26 +01001230 template RSL_Message tr_RSL_UNITDATA_REQ(template RslChannelNr chan_nr,
1231 template RslLinkId link_id,
Vadim Yanitskiy8f98d3f2018-10-03 17:58:10 +07001232 template octetstring l3_info := ?)
Harald Welte0472ab42018-03-12 15:02:26 +01001233 modifies tr_RSL_DATA_REQ := {
1234 msg_type := RSL_MT_UNIT_DATA_REQ
1235 }
1236
Harald Welte643e2a62017-11-27 15:03:18 +01001237
1238 /* 8.3.11 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001239 template (value) RSL_Message ts_RSL_UNITDATA_IND(template (value) RslChannelNr chan_nr,
1240 template (value) RslLinkId link_id,
1241 octetstring l3_info)
Harald Welte643e2a62017-11-27 15:03:18 +01001242 modifies ts_RSL_DATA_IND := {
1243 msg_type := RSL_MT_UNIT_DATA_IND
1244 }
Harald Welte0472ab42018-03-12 15:02:26 +01001245 template RSL_Message tr_RSL_UNITDATA_IND(template RslChannelNr chan_nr,
Vadim Yanitskiyfabe0f22018-10-03 17:51:47 +07001246 template RslLinkId link_id,
Vadim Yanitskiy8f98d3f2018-10-03 17:58:10 +07001247 template octetstring l3_info := ?)
Harald Welte0472ab42018-03-12 15:02:26 +01001248 modifies tr_RSL_DATA_IND := {
1249 msg_type := RSL_MT_UNIT_DATA_IND
1250 }
1251
1252
Harald Welte643e2a62017-11-27 15:03:18 +01001253
1254
1255 /* DEDICATED CANNEL MANAGEMENT MESSAGES */
1256
1257 /* 8.4.1 BSC -> BTS */
Harald Welteefa7d912018-04-18 23:22:15 +02001258 template (value) RSL_Message ts_RSL_CHAN_ACT(template (value) RslChannelNr chan_nr,
Harald Welte921f9e02019-05-19 22:27:11 +02001259 template (value) RSL_IE_ChannelMode mode,
1260 template (value) RSL_IE_ActivationType at := t_RSL_IE_ActType_IA) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001261 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1262 msg_type := RSL_MT_CHAN_ACTIV,
1263 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001264 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
Harald Welte921f9e02019-05-19 22:27:11 +02001265 t_RSL_IE(RSL_IE_ACT_TYPE, RSL_IE_Body:{act_type := at}),
Harald Welte735dd072017-12-12 14:55:17 +01001266 t_RSL_IE(RSL_IE_CHAN_MODE, RSL_IE_Body:{chan_mode := mode})
Harald Welte643e2a62017-11-27 15:03:18 +01001267 /* lots of optional IEs */
1268 }
1269 }
Harald Welte94e0c342018-04-07 11:33:23 +02001270 template RSL_Message tr_RSL_CHAN_ACT(template RslChannelNr chan_nr,
Harald Welte921f9e02019-05-19 22:27:11 +02001271 template RSL_IE_ChannelMode mode,
1272 template (value) RSL_IE_ActivationType at := t_RSL_IE_ActType_IA) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001273 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte94e0c342018-04-07 11:33:23 +02001274 msg_type := RSL_MT_CHAN_ACTIV,
1275 ies :={
1276 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
Harald Welte921f9e02019-05-19 22:27:11 +02001277 tr_RSL_IE(RSL_IE_Body:{act_type := at}),
Harald Welte94e0c342018-04-07 11:33:23 +02001278 tr_RSL_IE(RSL_IE_Body:{chan_mode := mode}),
1279 /* lots of optional IEs */
1280 *
1281 }
1282 }
1283 template RSL_Message tr_RSL_CHAN_ACT_PDCH(template RslChannelNr chan_nr,
1284 template RSL_IE_ChannelMode mode) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001285 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte94e0c342018-04-07 11:33:23 +02001286 msg_type := RSL_MT_CHAN_ACTIV,
1287 ies :={
1288 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1289 tr_RSL_IE(RSL_IE_Body:{act_type := t_RSL_IE_ActType_PDCH}),
1290 /* lots of optional IEs */
1291 *
1292 }
1293 }
1294
Harald Welte643e2a62017-11-27 15:03:18 +01001295
1296 /* 8.4.2 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001297 template (value) RSL_Message ts_RSL_CHAN_ACT_ACK(template (value) RslChannelNr chan_nr,
1298 GsmFrameNumber fn) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001299 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1300 msg_type := RSL_MT_CHAN_ACTIV_ACK,
1301 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001302 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1303 t_RSL_IE(RSL_IE_FRAME_NUMBER, RSL_IE_Body:{frame_nr := ts_RSL_IE_FrameNumber(fn)})
Harald Welte643e2a62017-11-27 15:03:18 +01001304 }
1305 }
Harald Welte9abd1282018-02-19 19:18:17 +01001306 template RSL_Message tr_RSL_CHAN_ACT_ACK(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001307 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001308 msg_type := RSL_MT_CHAN_ACTIV_ACK,
1309 ies := {
1310 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1311 tr_RSL_IE(RSL_IE_Body:{frame_nr := ?})
1312 }
1313 }
Harald Welte643e2a62017-11-27 15:03:18 +01001314
1315 /* 8.4.3 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001316 template (value) RSL_Message ts_RSL_CHAN_ACT_NACK(template (value) RslChannelNr chan_nr,
1317 RSL_Cause cause) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001318 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1319 msg_type := RSL_MT_CHAN_ACTIV_NACK,
1320 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001321 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1322 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
Harald Welte643e2a62017-11-27 15:03:18 +01001323 }
1324 }
Harald Welte9abd1282018-02-19 19:18:17 +01001325 template RSL_Message tr_RSL_CHAN_ACT_NACK(template RslChannelNr chan_nr,
1326 template RSL_Cause cause := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001327 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001328 msg_type := RSL_MT_CHAN_ACTIV_NACK,
1329 ies := {
1330 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1331 tr_RSL_IE(RSL_IE_Body:{cause := ?})
1332 }
1333 }
Harald Welte643e2a62017-11-27 15:03:18 +01001334
1335 /* 8.4.4 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001336 template (value) RSL_Message ts_RSL_CONN_FAIL_IND(RslChannelNr chan_nr, RSL_Cause cause) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001337 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1338 msg_type := RSL_MT_CONN_FAIL,
1339 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001340 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1341 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
Harald Welte643e2a62017-11-27 15:03:18 +01001342 }
1343 }
Harald Welte9abd1282018-02-19 19:18:17 +01001344 template RSL_Message tr_RSL_CONN_FAIL_IND(template RslChannelNr chan_nr,
1345 template RSL_Cause cause := ?) := {
1346 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1347 msg_type := RSL_MT_CONN_FAIL,
1348 ies :={
1349 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1350 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
1351 }
1352 }
Harald Welte643e2a62017-11-27 15:03:18 +01001353
Harald Weltee8a5ab12017-12-09 22:34:57 +01001354 /* 8.4.5 BSC -> BTS */
1355 template RSL_Message tr_RSL_DEACT_SACCH(template RslChannelNr chan_nr) := {
1356 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1357 msg_type := RSL_MT_DEACTIVATE_SACCH,
1358 ies := {
1359 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
1360 }
1361 }
Harald Welteefa7d912018-04-18 23:22:15 +02001362 template (value) RSL_Message ts_RSL_DEACT_SACCH(template (value) RslChannelNr chan_nr) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001363 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1364 msg_type := RSL_MT_DEACTIVATE_SACCH,
1365 ies := {
1366 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1367 }
1368 }
1369
Harald Weltee8a5ab12017-12-09 22:34:57 +01001370
Harald Welte73cd2712017-12-17 00:44:52 +01001371 /* 8.4.6 BSC ->BTS */
1372 template RSL_Message tr_RSL_ENCR_CMD(template RslChannelNr chan_nr,
1373 template RslLinkId link_id := ?,
Harald Weltee613f962018-04-18 22:38:16 +02001374 template RSL_AlgId alg := ?,
Harald Welte73cd2712017-12-17 00:44:52 +01001375 template octetstring key := ?,
1376 template octetstring l3_info := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001377 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte73cd2712017-12-17 00:44:52 +01001378 msg_type := RSL_MT_ENCR_CMD,
1379 ies := {
1380 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1381 tr_RSL_IE(RSL_IE_Body:{encr_info := tr_RSL_IE_EncrInfo(alg, key)}),
1382 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
1383 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
1384 }
1385 }
Harald Welteefa7d912018-04-18 23:22:15 +02001386 template (value) RSL_Message ts_RSL_ENCR_CMD(template (value) RslChannelNr chan_nr,
1387 template (value) RslLinkId link_id,
Harald Weltee613f962018-04-18 22:38:16 +02001388 template (value) RSL_AlgId alg, octetstring key,
Harald Welteefa7d912018-04-18 23:22:15 +02001389 octetstring l3_info) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001390 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1391 msg_type := RSL_MT_ENCR_CMD,
1392 ies := {
1393 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
Harald Welteefa7d912018-04-18 23:22:15 +02001394 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 +01001395 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
Harald Welteefa7d912018-04-18 23:22:15 +02001396 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
Harald Welte9abd1282018-02-19 19:18:17 +01001397 }
1398 }
Harald Welte73cd2712017-12-17 00:44:52 +01001399
Harald Welte2691adf2018-02-22 17:32:39 +01001400 template RSL_Message tr_RSL_MEAS_RES(template RslChannelNr chan_nr,
1401 template uint8_t meas_res_nr := ?,
1402 template RSL_IE_UplinkMeas ul_meas := ?,
1403 template RSL_IE_BS_Power bs_power := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001404 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte2691adf2018-02-22 17:32:39 +01001405 msg_type := RSL_MT_MEAS_RES,
1406 ies := {
1407 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1408 tr_RSL_IE(RSL_IE_Body:{meas_res_nr := meas_res_nr}),
1409 tr_RSL_IE(RSL_IE_Body:{uplink_meas := ul_meas}),
1410 tr_RSL_IE(RSL_IE_Body:{bs_power := bs_power}),
1411 *
1412 }
1413 }
1414
Philipp Maierdd841d32019-12-17 14:44:54 +01001415 /* Receive template for a measurement report that lacks the measurement report
1416 * from the MS (l1_info, l3_info and ms timing offset */
1417 template RSL_Message tr_RSL_MEAS_RES_EMPTY(template RslChannelNr chan_nr,
1418 template uint8_t meas_res_nr := ?,
1419 template RSL_IE_UplinkMeas ul_meas := ?,
1420 template RSL_IE_BS_Power bs_power := ?) := {
1421 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1422 msg_type := RSL_MT_MEAS_RES,
1423 ies := {
1424 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1425 tr_RSL_IE(RSL_IE_Body:{meas_res_nr := meas_res_nr}),
1426 tr_RSL_IE(RSL_IE_Body:{uplink_meas := ul_meas}),
1427 tr_RSL_IE(RSL_IE_Body:{bs_power := bs_power})
1428 }
1429 }
1430
Harald Welte39b47be2018-02-23 18:58:48 +01001431 /* Osmocom specific template, require lots of optional fields to be present */
1432 template RSL_Message tr_RSL_MEAS_RES_OSMO(template RslChannelNr chan_nr,
1433 template uint8_t meas_res_nr := ?,
1434 template RSL_IE_UplinkMeas ul_meas := ?,
1435 template RSL_IE_BS_Power bs_power := ?,
1436 template RSL_IE_L1Info l1_info := ?,
1437 template octetstring l3_info := ?,
1438 template uint8_t ms_to := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001439 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte39b47be2018-02-23 18:58:48 +01001440 msg_type := RSL_MT_MEAS_RES,
1441 ies := {
1442 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1443 tr_RSL_IE(RSL_IE_Body:{meas_res_nr := meas_res_nr}),
1444 tr_RSL_IE(RSL_IE_Body:{uplink_meas := ul_meas}),
1445 tr_RSL_IE(RSL_IE_Body:{bs_power := bs_power}),
1446 tr_RSL_IE(RSL_IE_Body:{l1_info := l1_info}),
1447 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)}),
1448 tr_RSL_IE(RSL_IE_Body:{ms_timing_offset := ms_to})
1449 }
1450 }
1451
Eric Wildf1827a72019-05-28 17:37:35 +02001452 /* 8.4.9 BSC -> BTS */
1453 template (value) RSL_Message ts_RSL_MODE_MODIFY_REQ(template (value) RslChannelNr chan_nr,
1454 template (value) RSL_IE_ChannelMode mode) := {
1455 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1456 msg_type := RSL_MT_MODE_MODIFY_REQ,
1457 ies :={
1458 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1459 t_RSL_IE(RSL_IE_CHAN_MODE, RSL_IE_Body:{chan_mode := mode})
1460 /* lots of optional IEs */
1461 }
1462 }
1463 template RSL_Message tr_RSL_MODE_MODIFY_REQ(template RslChannelNr chan_nr,
1464 template RSL_IE_ChannelMode mode) := {
1465 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1466 msg_type := RSL_MT_MODE_MODIFY_REQ,
1467 ies :={
1468 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1469 tr_RSL_IE(RSL_IE_Body:{chan_mode := mode}),
1470 /* lots of optional IEs */
1471 *
1472 }
1473 }
1474
Harald Welte7794d5b2017-12-16 23:00:20 +01001475 /* 8.4.10 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001476 template (value) RSL_Message ts_RSL_MODE_MODIFY_ACK(template (value) RslChannelNr chan_nr) := {
Harald Welte7794d5b2017-12-16 23:00:20 +01001477 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1478 msg_type := RSL_MT_MODE_MODIFY_ACK,
1479 ies := {
1480 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1481 }
1482 }
Harald Welte9abd1282018-02-19 19:18:17 +01001483 template RSL_Message tr_RSL_MODE_MODIFY_ACK(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001484 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001485 msg_type := RSL_MT_MODE_MODIFY_ACK,
1486 ies := {
1487 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
1488 }
1489 }
Harald Welte7794d5b2017-12-16 23:00:20 +01001490
Harald Welte643e2a62017-11-27 15:03:18 +01001491 /* 8.4.11 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001492 template (value) RSL_Message ts_RSL_MODE_MODIFY_NACK(template (value) RslChannelNr chan_nr,
1493 RSL_Cause cause) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001494 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1495 msg_type := RSL_MT_MODE_MODIFY_NACK,
1496 ies := {
1497 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1498 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
1499 }
Harald Welte643e2a62017-11-27 15:03:18 +01001500 }
Harald Welte9abd1282018-02-19 19:18:17 +01001501 template RSL_Message tr_RSL_MODE_MODIFY_NACK(template RslChannelNr chan_nr,
1502 template RSL_Cause cause) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001503 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001504 msg_type := RSL_MT_MODE_MODIFY_NACK,
1505 ies := {
1506 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1507 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
1508 }
1509 }
1510
Harald Welte643e2a62017-11-27 15:03:18 +01001511
Harald Welte6a8199d2018-01-29 21:58:53 +01001512 /* 8.4.14: BTS <- BSC */
1513 template RSL_Message tr_RSL_RF_CHAN_REL(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001514 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte6a8199d2018-01-29 21:58:53 +01001515 msg_type := RSL_MT_RF_CHAN_REL,
1516 ies := {
1517 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
1518 }
1519 }
Harald Welteefa7d912018-04-18 23:22:15 +02001520 template (value) RSL_Message ts_RSL_RF_CHAN_REL(template (value) RslChannelNr chan_nr) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001521 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1522 msg_type := RSL_MT_RF_CHAN_REL,
1523 ies := {
1524 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1525 }
1526 }
Harald Welte6a8199d2018-01-29 21:58:53 +01001527
Philipp Maier4d1e9c92018-12-20 11:11:56 +01001528 /* 8.4.15: BTS <- BSC */
1529 template (value) RSL_Message ts_RSL_MS_PWR_CTRL(template (value) RslChannelNr chan_nr,
1530 template (value) RSL_IE_MS_Power ms_power) := {
1531 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1532 msg_type := RSL_MT_MS_POWER_CONTROL,
1533 ies := {
1534 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1535 t_RSL_IE(RSL_IE_MS_POWER, RSL_IE_Body:{ms_power := ms_power})
1536 /* One optional IE: MS POWER PARAMETERS */
1537 }
1538 }
1539
Eric Wild61edb7e2019-06-03 12:38:31 +02001540 template (value) RSL_Message ts_RSL_MS_PWR_CTRL_with_pp(template (value) RslChannelNr chan_nr,
1541 integer pwr_level) := {
1542 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1543 msg_type := RSL_MT_MS_POWER_CONTROL,
1544 ies := {
1545 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1546 t_RSL_IE(RSL_IE_MS_POWER, RSL_IE_Body:{ms_power := ts_RSL_IE_MS_Power(pwr_level)}),
1547 t_RSL_IE(RSL_IE_MS_POWER_PARAM, RSL_IE_Body:{ms_power_params :=
1548 ts_RSL_IE_MS_Power_Parameters(''O)})
1549 }
1550 }
1551
Eric Wildae8f2622019-06-18 17:05:11 +02001552 /* 8.4.16: BTS <- BSC */
1553 template (value) RSL_Message ts_RSL_BS_PWR_CTRL(template (value) RslChannelNr chan_nr,
1554 template (value) RSL_IE_BS_Power bs_power) := {
1555 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1556 msg_type := RSL_MT_BS_POWER_CONTROL,
1557 ies := {
1558 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1559 t_RSL_IE(RSL_IE_BS_POWER, RSL_IE_Body:{bs_power := bs_power})
1560 /* One optional IE: BS POWER PARAMETERS */
1561 }
1562 }
1563
Harald Welte4a267362017-12-09 17:49:32 +01001564 /* 8.4.19 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001565 template (value) RSL_Message ts_RSL_RF_CHAN_REL_ACK(template (value) RslChannelNr chan_nr) :=
Harald Welte4a267362017-12-09 17:49:32 +01001566 ts_RSL_MsgDiscType(ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1567 RSL_MT_RF_CHAN_REL_ACK,
Harald Welte735dd072017-12-12 14:55:17 +01001568 { t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}) });
Harald Welte4a267362017-12-09 17:49:32 +01001569
Harald Welte9abd1282018-02-19 19:18:17 +01001570 template RSL_Message tr_RSL_RF_CHAN_REL_ACK(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001571 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001572 msg_type := RSL_MT_RF_CHAN_REL_ACK,
1573 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001574 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
Harald Welte9abd1282018-02-19 19:18:17 +01001575 }
1576 }
1577
Harald Welteea17b912018-03-11 22:29:31 +01001578 /* 8.6.20 BTS <- BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001579 template (value) RSL_Message ts_RSL_SACCH_INF_MOD(template (value) RslChannelNr chan_nr,
1580 RSL_IE_SysinfoType si_type,
1581 octetstring l3_info) := {
Harald Welteea17b912018-03-11 22:29:31 +01001582 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1583 msg_type := RSL_MT_SACCH_INFO_MODIFY,
1584 ies := {
1585 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1586 t_RSL_IE(RSL_IE_SYSINFO_TYPE, RSL_IE_Body:{sysinfo_type := si_type}),
1587 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
1588 }
1589 }
1590
Neels Hofmeyr378a49c2018-06-15 22:18:43 +02001591 /* 8.4.7 BTS -> BSC */
1592 template (value) RSL_Message ts_RSL_HANDO_DET(template (value) RslChannelNr chan_nr) := {
1593 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1594 msg_type := RSL_MT_HANDO_DET,
1595 ies := {
1596 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1597 }
1598 }
Vadim Yanitskiy7c2c10c2019-05-31 20:42:01 +07001599 template RSL_Message tr_RSL_HANDO_DET(template RslChannelNr chan_nr,
1600 template uint8_t acc_delay := ?) := {
1601 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1602 msg_type := RSL_MT_HANDO_DET,
1603 ies := {
1604 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1605 tr_RSL_IE(RSL_IE_Body:{access_delay := acc_delay})
1606 }
1607 }
Neels Hofmeyr378a49c2018-06-15 22:18:43 +02001608
Harald Welteea17b912018-03-11 22:29:31 +01001609
Harald Welte643e2a62017-11-27 15:03:18 +01001610 /* COMMON CHANNEL MANAGEMENT MESSAGES */
1611
Harald Welte874c2232018-02-24 04:52:43 +01001612 /* 8.5.1 BTS <- BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001613 template (value) RSL_Message ts_RSL_BCCH_INFO(RSL_IE_SysinfoType si_type,
1614 octetstring full_bcch_info) := {
Harald Welte874c2232018-02-24 04:52:43 +01001615 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1616 msg_type := RSL_MT_BCCH_INFO,
1617 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001618 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_BCCH(0)}),
Harald Welte874c2232018-02-24 04:52:43 +01001619 t_RSL_IE(RSL_IE_SYSINFO_TYPE, RSL_IE_Body:{sysinfo_type := si_type}),
1620 t_RSL_IE(RSL_IE_FULL_BCCH_INFO, RSL_IE_Body:{other := ts_RSL_LV(full_bcch_info)})
1621 }
1622 }
Harald Welte09538f82019-08-01 09:50:25 +02001623 template RSL_Message tr_RSL_NO_BCCH_INFO(template RSL_IE_SysinfoType si_type := ?) := {
1624 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1625 msg_type := RSL_MT_BCCH_INFO,
1626 ies := {
1627 tr_RSL_IE(RSL_IE_Body:{chan_nr := ts_RslChanNr_BCCH(0)}),
1628 tr_RSL_IE(RSL_IE_Body:{sysinfo_type := si_type})
1629 }
1630 }
1631 template RSL_Message tr_RSL_BCCH_INFO(template RSL_IE_SysinfoType si_type := ?,
1632 template octetstring full_bcch_info := ?) := {
1633 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1634 msg_type := RSL_MT_BCCH_INFO,
1635 ies := {
1636 tr_RSL_IE(RSL_IE_Body:{chan_nr := ts_RslChanNr_BCCH(0)}),
1637 tr_RSL_IE(RSL_IE_Body:{sysinfo_type := si_type}),
1638 tr_RSL_IE(RSL_IE_Body:{other := tr_RSL_LV(full_bcch_info)}),
1639 *
1640 }
1641 }
Harald Welte874c2232018-02-24 04:52:43 +01001642
Harald Welte7ae93142017-12-07 17:56:15 +01001643 /* 8.5.2 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001644 template (value) RSL_Message ts_RSL_RACH_LOAD_IND(uint16_t slot_ct, uint16_t busy_ct,
1645 uint16_t acc_ct) := {
Harald Welte7ae93142017-12-07 17:56:15 +01001646 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1647 msg_type := RSL_MT_CCCH_LOAD_IND,
1648 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001649 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_RACH(0)}),
Harald Welte735dd072017-12-12 14:55:17 +01001650 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 +01001651 }
1652 }
Harald Welte68e495b2018-02-25 00:05:57 +01001653 template RSL_Message tr_RSL_RACH_LOAD_IND(template uint16_t slot_ct := ?,
1654 template uint16_t busy_ct := ?,
Harald Welte09538f82019-08-01 09:50:25 +02001655 template uint16_t acc_ct := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001656 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Welte68e495b2018-02-25 00:05:57 +01001657 msg_type := RSL_MT_CCCH_LOAD_IND,
1658 ies := {
1659 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_RACH(0)}),
1660 tr_RSL_IE(RSL_IE_Body:{rach_load := tr_RSL_IE_RachLoad(slot_ct, busy_ct, acc_ct)})
1661 }
1662 }
1663
Harald Welteefa7d912018-04-18 23:22:15 +02001664 template (value) RSL_Message ts_RSL_PAGING_LOAD_IND(uint16_t buffer_space) := {
Harald Welte7ae93142017-12-07 17:56:15 +01001665 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1666 msg_type := RSL_MT_CCCH_LOAD_IND,
1667 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001668 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_PCH_AGCH(0)}),
Harald Welte735dd072017-12-12 14:55:17 +01001669 t_RSL_IE(RSL_IE_PAGING_LOAD, RSL_IE_Body:{paging_load := buffer_space})
Harald Welte7ae93142017-12-07 17:56:15 +01001670 }
1671 }
Harald Welte68e495b2018-02-25 00:05:57 +01001672 template RSL_Message tr_RSL_PAGING_LOAD_IND(template uint16_t buffer_space := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001673 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Welte68e495b2018-02-25 00:05:57 +01001674 msg_type := RSL_MT_CCCH_LOAD_IND,
1675 ies := {
1676 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(0)}),
1677 tr_RSL_IE(RSL_IE_Body:{paging_load := buffer_space})
1678 }
1679 }
1680
Harald Welte7ae93142017-12-07 17:56:15 +01001681
Harald Welte643e2a62017-11-27 15:03:18 +01001682 /* 8.5.3 BTS -> BSC */
Vadim Yanitskiyab448a52019-05-31 20:24:03 +07001683 template (value) RSL_Message ts_RSL_CHAN_RQD(OCT1 ra, GsmFrameNumber fn,
1684 template (value) RslChannelNr chan_nr := ts_RslChanNr_RACH(0),
1685 uint8_t acc_del := 0) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001686 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1687 msg_type := RSL_MT_CHAN_RQD,
1688 ies := {
Vadim Yanitskiyab448a52019-05-31 20:24:03 +07001689 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1690 /* TODO: we may need to have optional RSL_IE_LINK_IDENT IE here */
Harald Welte735dd072017-12-12 14:55:17 +01001691 t_RSL_IE(RSL_IE_REQ_REFERENCE, RSL_IE_Body:{req_ref := ts_RSL_IE_ReqRef(ra, fn)}),
1692 t_RSL_IE(RSL_IE_ACCESS_DELAY, RSL_IE_Body:{access_delay := acc_del})
Harald Welte643e2a62017-11-27 15:03:18 +01001693 }
1694 }
Harald Welte9abd1282018-02-19 19:18:17 +01001695 template RSL_Message tr_RSL_CHAN_RQD(template OCT1 ra, template GsmFrameNumber fn := ?,
Vadim Yanitskiyab448a52019-05-31 20:24:03 +07001696 template RslChannelNr chan_nr := ts_RslChanNr_RACH(0),
1697 template uint8_t acc_del := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001698 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001699 msg_type := RSL_MT_CHAN_RQD,
1700 ies := {
Vadim Yanitskiyab448a52019-05-31 20:24:03 +07001701 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1702 /* TODO: we may need to have optional RSL_IE_LINK_IDENT IE here */
Harald Welte9abd1282018-02-19 19:18:17 +01001703 tr_RSL_IE(RSL_IE_Body:{req_ref := tr_RSL_IE_ReqRef(ra, fn)}),
1704 tr_RSL_IE(RSL_IE_Body:{access_delay := acc_del})
1705 }
1706 }
Harald Welte643e2a62017-11-27 15:03:18 +01001707
1708 /* 8.5.4 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001709 template (value) RSL_Message ts_DELETE_IND(template (value) RslChannelNr chan_nr,
1710 octetstring imm_ass) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001711 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1712 msg_type := RSL_MT_DELETE_IND,
1713 ies := {
Harald Welte735dd072017-12-12 14:55:17 +01001714 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1715 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 +01001716 }
1717 }
Harald Weltee8d750e2018-06-10 21:41:35 +02001718 template RSL_Message tr_RSL_DELETE_IND(template octetstring imm_ass := ?, template uint3_t tn) := {
1719 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1720 msg_type := RSL_MT_DELETE_IND,
1721 ies := {
1722 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(tn)}),
1723 tr_RSL_IE(RSL_IE_Body:{full_imm_ass_info := tr_RSL_LV(imm_ass)}),
1724 *
1725 }
1726 }
Harald Welte643e2a62017-11-27 15:03:18 +01001727
Harald Weltec2877752017-12-07 17:54:35 +01001728 /* 8.5.5 BSC -> BTS */
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +07001729 template RSL_Message tr_RSL_PAGING_CMD(template MobileIdentityV mi, template uint3_t tn := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001730 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Weltec2877752017-12-07 17:54:35 +01001731 msg_type := RSL_MT_PAGING_CMD,
1732 ies := {
1733 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(tn)}),
1734 tr_RSL_IE(RSL_IE_Body:{paging_group := ?}),
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +07001735 tr_RSL_IE(RSL_IE_Body:{ms_identity := tr_MI_LV(mi)}),
Harald Weltec2877752017-12-07 17:54:35 +01001736 * /* opt: channel needed, eMLPP prio */
1737 }
1738 }
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +07001739 template (value) RSL_Message ts_RSL_PAGING_CMD(MobileIdentityV mi, uint8_t pg, uint3_t tn := 0) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001740 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1741 msg_type := RSL_MT_PAGING_CMD,
1742 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001743 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_PCH_AGCH(tn)}),
Harald Welte9abd1282018-02-19 19:18:17 +01001744 t_RSL_IE(RSL_IE_PAGING_GROUP, RSL_IE_Body:{paging_group := pg}),
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +07001745 t_RSL_IE(RSL_IE_MS_IDENTITY, RSL_IE_Body:{ms_identity := ts_MI_LV(mi)})
Harald Welte9abd1282018-02-19 19:18:17 +01001746 }
1747 }
Harald Weltec2877752017-12-07 17:54:35 +01001748
1749 /* 8.5.6 BSC -> BTS */
1750 template RSL_Message tr_RSL_IMM_ASSIGN(template uint3_t tn := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001751 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Weltec2877752017-12-07 17:54:35 +01001752 msg_type := RSL_MT_IMMEDIATE_ASSIGN_CMD,
1753 ies := {
1754 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(tn)}),
1755 tr_RSL_IE(RSL_IE_Body:{full_imm_ass_info := ?})
1756 }
1757 }
Harald Welteefa7d912018-04-18 23:22:15 +02001758 template (value) RSL_Message ts_RSL_IMM_ASSIGN(octetstring f_ass_inf, uint3_t tn := 0) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001759 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1760 msg_type := RSL_MT_IMMEDIATE_ASSIGN_CMD,
1761 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001762 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_PCH_AGCH(tn)}),
Harald Welte9abd1282018-02-19 19:18:17 +01001763 t_RSL_IE(RSL_IE_FULL_IMM_ASS_INFO, RSL_IE_Body:{full_imm_ass_info := ts_RSL_LV(f_ass_inf)})
1764 }
1765 }
Harald Weltec2877752017-12-07 17:54:35 +01001766
Harald Welte68e495b2018-02-25 00:05:57 +01001767 template RSL_Message tr_RSL_RF_RES_IND := {
Harald Welteefa7d912018-04-18 23:22:15 +02001768 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
Harald Welte68e495b2018-02-25 00:05:57 +01001769 msg_type := RSL_MT_RF_RES_IND,
1770 ies := *
1771 }
1772
Harald Weltecc373202018-09-10 10:28:21 +02001773 /* 8.5.8 BTS <- BSC SMS BROADCAST COMMAND */
1774 template RSL_Message tr_RSL_SMSCB_CMD(template RSL_IE_CbCommandType cb_cmd := ?,
1775 template octetstring msg := ?,
1776 template RslChannelNr chan_nr := ?) := {
1777 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1778 msg_type := RSL_MT_SMS_BC_CMD,
1779 ies := {
1780 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1781 tr_RSL_IE(RSL_IE_Body:{cb_cmd_type := cb_cmd}),
1782 tr_RSL_IE(RSL_IE_Body:{smscb_message := tr_RSL_LV(msg)}),
1783 *
1784 }
1785 }
1786 template (value) RSL_Message ts_RSL_SMSCB_CMD(template (value) RSL_IE_CbCommandType cb_cmd,
1787 template (value) octetstring msg,
1788 template (value) RslChannelNr chan_nr :=
1789 ts_RslChanNr_SDCCH4(0, 2)) := {
1790 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1791 msg_type := RSL_MT_SMS_BC_CMD,
1792 ies := {
1793 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1794 t_RSL_IE(RSL_IE_CB_CMD_TYPE, RSL_IE_Body:{cb_cmd_type := cb_cmd}),
1795 t_RSL_IE(RSL_IE_SMSCB_MSG, RSL_IE_Body:{smscb_message := ts_RSL_LV(msg)})
1796 /* optional channel type for extended CBCH */
1797 }
1798 }
1799
Harald Welte4a129f82019-05-21 16:35:22 +02001800 /* 8.5.9 BTS -> BSC CBCH LOAD INDICATION */
1801 template RSL_Message tr_RSL_CBCH_LOAD_IND_BASIC(template boolean overflow := ?,
1802 template uint4_t slot_count := ?,
1803 template RslChannelNr chan_nr := ?) := {
1804 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1805 msg_type := RSL_MT_CBCH_LOAD_IND,
1806 ies := {
1807 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1808 tr_RSL_IE(RSL_IE_Body:{cbch_load_info := tr_CbchLoadInfo(overflow, slot_count)})
1809 }
1810 }
1811 template (value) RSL_Message ts_RSL_CBCH_LOAD_IND_BASIC(boolean overflow, uint4_t slot_count,
1812 template (value) RslChannelNr chan_nr :=
1813 ts_RslChanNr_SDCCH4(0, 2)) := {
1814 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1815 msg_type := RSL_MT_CBCH_LOAD_IND,
1816 ies := {
1817 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1818 t_RSL_IE(RSL_IE_CBCH_LOAD_INFO, RSL_IE_Body:{cbch_load_info := ts_CbchLoadInfo(overflow, slot_count)})
1819 }
1820 }
1821 template RSL_Message tr_RSL_CBCH_LOAD_IND_EXTD(template boolean overflow := ?,
1822 template uint4_t slot_count := ?,
1823 template RslChannelNr chan_nr := ?) := {
1824 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1825 msg_type := RSL_MT_CBCH_LOAD_IND,
1826 ies := {
1827 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1828 tr_RSL_IE(RSL_IE_Body:{cbch_load_info := tr_CbchLoadInfo(overflow, slot_count)}),
1829 tr_RSL_IE(RSL_IE_Body:{smscb_chan_ind := 1})
1830 }
1831 }
1832 template (value) RSL_Message ts_RSL_CBCH_LOAD_IND_EXTD(boolean overflow, uint4_t slot_count,
1833 template (value) RslChannelNr chan_nr :=
1834 ts_RslChanNr_SDCCH4(0, 2)) := {
1835 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1836 msg_type := RSL_MT_CBCH_LOAD_IND,
1837 ies := {
1838 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1839 t_RSL_IE(RSL_IE_CBCH_LOAD_INFO, RSL_IE_Body:{cbch_load_info := ts_CbchLoadInfo(overflow, slot_count)}),
1840 t_RSL_IE(RSL_IE_SMSCB_CHAN_INDICATOR, RSL_IE_Body:{smscb_chan_ind := 1})
1841 }
1842 }
1843
1844
Harald Welte68e495b2018-02-25 00:05:57 +01001845 /* 8.6.2 BTS <- BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001846 template (value) RSL_Message ts_RSL_SACCH_FILL(RSL_IE_SysinfoType si_type, octetstring l3_info) := {
Harald Welte68e495b2018-02-25 00:05:57 +01001847 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
1848 msg_type := RSL_MT_SACCH_FILL,
1849 ies := {
1850 t_RSL_IE(RSL_IE_SYSINFO_TYPE, RSL_IE_Body:{sysinfo_type := si_type}),
1851 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
1852 }
1853 }
Harald Welte09538f82019-08-01 09:50:25 +02001854 template RSL_Message tr_RSL_NO_SACCH_FILL(template RSL_IE_SysinfoType si_type := ?) := {
1855 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
1856 msg_type := RSL_MT_SACCH_FILL,
1857 ies := {
1858 tr_RSL_IE(RSL_IE_Body:{sysinfo_type := si_type})
1859 }
1860 }
1861 template RSL_Message tr_RSL_SACCH_FILL(template RSL_IE_SysinfoType si_type := ?,
1862 template octetstring l3_info := ?) := {
1863 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
1864 msg_type := RSL_MT_SACCH_FILL,
1865 ies := {
1866 tr_RSL_IE(RSL_IE_Body:{sysinfo_type := si_type}),
1867 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)}),
1868 *
1869 }
1870 }
1871
Harald Welte68e495b2018-02-25 00:05:57 +01001872
Harald Welte643e2a62017-11-27 15:03:18 +01001873 /* 8.6.4 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001874 template (value) RSL_Message ts_RSL_ERROR_REPORT(RSL_Cause cause) := {
Harald Welte01d982c2018-02-25 01:31:40 +01001875 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
1876 msg_type := RSL_MT_ERROR_REPORT,
Harald Welte643e2a62017-11-27 15:03:18 +01001877 ies := {
Harald Welte735dd072017-12-12 14:55:17 +01001878 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
Harald Welte643e2a62017-11-27 15:03:18 +01001879 }
1880 }
Harald Welte01d982c2018-02-25 01:31:40 +01001881 template RSL_Message tr_RSL_ERROR_REPORT(template RSL_Cause cause := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001882 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
Harald Welte01d982c2018-02-25 01:31:40 +01001883 msg_type := RSL_MT_ERROR_REPORT,
1884 ies := {
1885 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)}),
1886 *
1887 }
1888 }
1889
Harald Welte643e2a62017-11-27 15:03:18 +01001890
Harald Welte9958a4d2017-12-14 21:21:33 +01001891
1892 /* Abis/IP specific messages */
1893
1894 template RSL_Message tr_RSL_IPA_CRCX(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001895 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01001896 msg_type := RSL_MT_IPAC_CRCX,
1897 ies := {
1898 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1899 *
1900 }
1901 }
Harald Welteefa7d912018-04-18 23:22:15 +02001902 template (value) RSL_Message ts_RSL_IPA_CRCX(template (value) RslChannelNr chan_nr) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001903 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
1904 msg_type := RSL_MT_IPAC_CRCX,
1905 ies := {
1906 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1907 }
1908 }
1909
Harald Welte9958a4d2017-12-14 21:21:33 +01001910
Harald Welteefa7d912018-04-18 23:22:15 +02001911 template (value) RSL_Message ts_RSL_IPA_CRCX_ACK(template (value) RslChannelNr chan_nr,
1912 uint16_t ipa_conn_id, uint32_t local_ip,
1913 uint16_t local_port, uint7_t rtp_pt2) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01001914 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
1915 msg_type := RSL_MT_IPAC_CRCX_ACK,
1916 ies := {
1917 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1918 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
1919 t_RSL_IE(RSL_IE_IPAC_LOCAL_IP, RSL_IE_Body:{ipa_local_ip := local_ip}),
1920 t_RSL_IE(RSL_IE_IPAC_LOCAL_PORT, RSL_IE_Body:{ipa_local_port := local_port}),
1921 t_RSL_IE(RSL_IE_IPAC_RTP_PAYLOAD2, RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
1922 }
1923 }
Harald Welte9abd1282018-02-19 19:18:17 +01001924 template RSL_Message tr_RSL_IPA_CRCX_ACK(template RslChannelNr chan_nr,
1925 template uint16_t ipa_conn_id,
1926 template uint32_t local_ip,
Harald Welte8bd0f822018-02-25 12:43:28 +01001927 template uint16_t local_port) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001928 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001929 msg_type := RSL_MT_IPAC_CRCX_ACK,
1930 ies := {
1931 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1932 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
1933 tr_RSL_IE(RSL_IE_Body:{ipa_local_ip := local_ip}),
Harald Welte8bd0f822018-02-25 12:43:28 +01001934 tr_RSL_IE(RSL_IE_Body:{ipa_local_port := local_port})
1935 /* Optional: RTP Payload Type 2 IE */
Harald Welte9abd1282018-02-19 19:18:17 +01001936 }
1937 }
Harald Welte9958a4d2017-12-14 21:21:33 +01001938
Harald Welteefa7d912018-04-18 23:22:15 +02001939 template (value) RSL_Message ts_RSL_IPA_CRCX_NACK(template (value) RslChannelNr chan_nr,
1940 RSL_Cause cause) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01001941 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
1942 msg_type := RSL_MT_IPAC_CRCX_NACK,
1943 ies := {
1944 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1945 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
1946 }
1947 }
Harald Welte9abd1282018-02-19 19:18:17 +01001948 template RSL_Message tr_RSL_IPA_CRCX_NACK(template RslChannelNr chan_nr,
1949 template RSL_Cause cause := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001950 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001951 msg_type := RSL_MT_IPAC_CRCX_NACK,
1952 ies := {
1953 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1954 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
1955 }
1956 }
Harald Welte9958a4d2017-12-14 21:21:33 +01001957
Harald Welteefa7d912018-04-18 23:22:15 +02001958 template (value) RSL_Message ts_RSL_IPA_MDCX(template (value) RslChannelNr chan_nr,
1959 uint16_t ipa_conn_id,
1960 uint32_t remote_ip, uint16_t remote_port,
1961 uint7_t rtp_pt2) := {
Harald Welte30527452018-02-25 12:46:25 +01001962 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
1963 msg_type := RSL_MT_IPAC_MDCX,
1964 ies := {
1965 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1966 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
1967 t_RSL_IE(RSL_IE_IPAC_REMOTE_IP, RSL_IE_Body:{ipa_remote_ip := remote_ip}),
1968 t_RSL_IE(RSL_IE_IPAC_REMOTE_PORT, RSL_IE_Body:{ipa_remote_port := remote_port}),
1969 /* optional: RTP Payload Type */
1970 t_RSL_IE(RSL_IE_IPAC_RTP_PAYLOAD2, RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
1971 }
1972 }
Harald Welte9958a4d2017-12-14 21:21:33 +01001973 template RSL_Message tr_RSL_IPA_MDCX(template RslChannelNr chan_nr,
1974 template uint16_t ipa_conn_id) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001975 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01001976 msg_type := RSL_MT_IPAC_MDCX,
1977 ies := {
1978 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1979 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
1980 *
1981 }
1982 }
1983
Harald Welteefa7d912018-04-18 23:22:15 +02001984 template (value) RSL_Message ts_RSL_IPA_MDCX_ACK(template (value) RslChannelNr chan_nr,
1985 uint16_t ipa_conn_id,
1986 uint32_t local_ip, uint16_t local_port,
1987 uint7_t rtp_pt2) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01001988 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte71b5ec82017-12-16 23:01:10 +01001989 msg_type := RSL_MT_IPAC_MDCX_ACK,
Harald Welte9958a4d2017-12-14 21:21:33 +01001990 ies := {
1991 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1992 /* optional */
1993 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
Harald Welte6cb400a2018-02-25 12:45:25 +01001994 t_RSL_IE(RSL_IE_IPAC_LOCAL_IP, RSL_IE_Body:{ipa_local_ip := local_ip}),
1995 t_RSL_IE(RSL_IE_IPAC_LOCAL_PORT, RSL_IE_Body:{ipa_local_port := local_port}),
Harald Welte9958a4d2017-12-14 21:21:33 +01001996 /* optional: RTP Payload Type */
1997 t_RSL_IE(RSL_IE_IPAC_RTP_PAYLOAD2, RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
1998 }
1999 }
Harald Welte30527452018-02-25 12:46:25 +01002000 template RSL_Message tr_RSL_IPA_MDCX_ACK(template RslChannelNr chan_nr,
2001 template uint16_t ipa_conn_id,
2002 template uint32_t local_ip,
2003 template uint16_t local_port,
2004 template uint7_t rtp_pt2) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002005 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte30527452018-02-25 12:46:25 +01002006 msg_type := RSL_MT_IPAC_MDCX_ACK,
2007 ies := {
2008 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2009 /* optional */
2010 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2011 tr_RSL_IE(RSL_IE_Body:{ipa_local_ip := local_ip}),
2012 tr_RSL_IE(RSL_IE_Body:{ipa_local_port := local_port}),
2013 /* optional: RTP Payload Type */
2014 tr_RSL_IE(RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
2015 }
2016 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002017
Harald Welteefa7d912018-04-18 23:22:15 +02002018 template (value) RSL_Message ts_RSL_IPA_MDCX_NACK(template (value) RslChannelNr chan_nr,
2019 RSL_Cause cause,
2020 template (value) uint16_t ipa_conn_id) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002021 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2022 msg_type := RSL_MT_IPAC_MDCX_NACK,
2023 ies := {
2024 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2025 /* optional connection ID */
2026 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2027 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2028 }
2029 }
Harald Welte30527452018-02-25 12:46:25 +01002030 template RSL_Message tr_RSL_IPA_MDCX_NACK(template RslChannelNr chan_nr,
2031 template RSL_Cause cause,
2032 template uint16_t ipa_conn_id) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002033 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte30527452018-02-25 12:46:25 +01002034 msg_type := RSL_MT_IPAC_MDCX_NACK,
2035 ies := {
2036 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2037 /* optional connection ID */
2038 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2039 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
2040 }
2041 }
2042
Harald Welte9958a4d2017-12-14 21:21:33 +01002043
Harald Welteefa7d912018-04-18 23:22:15 +02002044 template (value) RSL_Message ts_RSL_IPA_DLCX_IND(template (value) RslChannelNr chan_nr,
2045 uint16_t ipa_conn_id,
2046 template (value) RSL_IE_IPA_ConnectionStats stats,
2047 RSL_Cause cause) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002048 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2049 msg_type := RSL_MT_IPAC_DLCX_IND,
2050 ies := {
2051 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2052 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2053 t_RSL_IE(RSL_IE_IPAC_CONN_STAT, RSL_IE_Body:{ipa_stats := stats}),
2054 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2055 }
2056 }
2057
Harald Welteefa7d912018-04-18 23:22:15 +02002058 template (value) RSL_Message ts_RSL_IPA_DLCX(template (value) RslChannelNr chan_nr,
2059 uint16_t ipa_conn_id) := {
Harald Weltea871a382018-02-25 02:03:14 +01002060 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2061 msg_type := RSL_MT_IPAC_DLCX,
2062 ies := {
Harald Welte2a7e7162018-02-25 12:46:48 +01002063 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2064 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id})
Harald Weltea871a382018-02-25 02:03:14 +01002065 }
2066 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002067 template RSL_Message tr_RSL_IPA_DLCX(template RslChannelNr chan_nr,
2068 template uint16_t ipa_conn_id := omit) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002069 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002070 msg_type := RSL_MT_IPAC_DLCX,
2071 ies := {
2072 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2073 /* FIXME: optional conn_id */
2074 *
2075 }
2076 }
2077
Harald Welteefa7d912018-04-18 23:22:15 +02002078 template (value) RSL_Message ts_RSL_IPA_DLCX_ACK(template (value) RslChannelNr chan_nr,
2079 uint16_t ipa_conn_id,
2080 RSL_IE_IPA_ConnectionStats stats) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002081 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2082 msg_type := RSL_MT_IPAC_DLCX_ACK,
2083 ies := {
2084 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2085 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2086 t_RSL_IE(RSL_IE_IPAC_CONN_STAT, RSL_IE_Body:{ipa_stats := stats})
2087 }
2088 }
Harald Weltea871a382018-02-25 02:03:14 +01002089 template RSL_Message tr_RSL_IPA_DLCX_ACK(template RslChannelNr chan_nr,
2090 template uint16_t ipa_conn_id,
2091 template RSL_IE_IPA_ConnectionStats stats) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002092 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Weltea871a382018-02-25 02:03:14 +01002093 msg_type := RSL_MT_IPAC_DLCX_ACK,
2094 ies := {
2095 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2096 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2097 tr_RSL_IE(RSL_IE_Body:{ipa_stats := stats})
2098 }
2099 }
2100
2101
Harald Welte9958a4d2017-12-14 21:21:33 +01002102
Harald Welteefa7d912018-04-18 23:22:15 +02002103 template (value) RSL_Message ts_RSL_IPA_DLCX_NACK(template (value) RslChannelNr chan_nr,
2104 RSL_Cause cause, uint16_t ipa_conn_id) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002105 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2106 msg_type := RSL_MT_IPAC_DLCX_NACK,
2107 ies := {
2108 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2109 /* optional connection ID */
2110 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2111 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2112 }
2113 }
Harald Weltea871a382018-02-25 02:03:14 +01002114 template RSL_Message tr_RSL_IPA_DLCX_NACK(template RslChannelNr chan_nr,
2115 template RSL_Cause cause) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002116 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Weltea871a382018-02-25 02:03:14 +01002117 msg_type := RSL_MT_IPAC_DLCX_NACK,
2118 ies := {
2119 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2120 /* optional connection ID */
2121 *,
2122 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
2123 }
2124 }
2125
Harald Welte9958a4d2017-12-14 21:21:33 +01002126
Harald Welteefa7d912018-04-18 23:22:15 +02002127 template (value) RSL_Message ts_RSL_IPA_PDCH_ACT(RslChannelNr chan_nr) := {
Harald Welteee19c732018-04-05 09:08:26 +02002128 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2129 msg_type := RSL_MT_IPAC_PDCH_ACT,
2130 ies := {
2131 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
2132 }
2133 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002134 template RSL_Message tr_RSL_IPA_PDCH_ACT(template RslChannelNr chan_nr) := {
Harald Welteee19c732018-04-05 09:08:26 +02002135 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002136 msg_type := RSL_MT_IPAC_PDCH_ACT,
2137 ies := {
2138 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
2139 }
2140 }
2141
Harald Welteee19c732018-04-05 09:08:26 +02002142
Harald Welte94e0c342018-04-07 11:33:23 +02002143 template RSL_Message ts_RSL_IPA_PDCH_ACT_ACK(RslChannelNr chan_nr,
2144 template (value) RSL_IE_FrameNumber fn) := {
Harald Welteee19c732018-04-05 09:08:26 +02002145 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002146 msg_type := RSL_MT_IPAC_PDCH_ACT_ACK,
2147 ies := {
2148 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2149 t_RSL_IE(RSL_IE_FRAME_NUMBER, RSL_IE_Body:{frame_nr := fn})
2150 }
2151 }
Harald Welteee19c732018-04-05 09:08:26 +02002152 template RSL_Message tr_RSL_IPA_PDCH_ACT_ACK(template RslChannelNr chan_nr,
2153 template RSL_IE_FrameNumber fn) := {
2154 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2155 msg_type := RSL_MT_IPAC_PDCH_ACT_ACK,
2156 ies := {
2157 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2158 tr_RSL_IE(RSL_IE_Body:{frame_nr := fn})
2159 }
2160 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002161
2162 template RSL_Message ts_RSL_IPA_PDCH_ACT_NACK(RslChannelNr chan_nr, RSL_Cause cause) := {
Harald Welteee19c732018-04-05 09:08:26 +02002163 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002164 msg_type := RSL_MT_IPAC_PDCH_ACT_NACK,
2165 ies := {
2166 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2167 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2168 }
2169 }
Harald Welteee19c732018-04-05 09:08:26 +02002170 template RSL_Message tr_RSL_IPA_PDCH_ACT_NACK(template RslChannelNr chan_nr,
2171 template RSL_Cause cause) := {
2172 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2173 msg_type := RSL_MT_IPAC_PDCH_ACT_NACK,
2174 ies := {
2175 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2176 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
2177 }
2178 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002179
Harald Welteee19c732018-04-05 09:08:26 +02002180 template RSL_Message ts_RSL_IPA_PDCH_DEACT(RslChannelNr chan_nr) := {
2181 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2182 msg_type := RSL_MT_IPAC_PDCH_DEACT,
2183 ies := {
2184 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
2185 }
2186 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002187 template RSL_Message tr_RSL_IPA_PDCH_DEACT(template RslChannelNr chan_nr) := {
Harald Welteee19c732018-04-05 09:08:26 +02002188 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002189 msg_type := RSL_MT_IPAC_PDCH_DEACT,
2190 ies := {
2191 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
2192 }
2193 }
2194
2195 template RSL_Message ts_RSL_IPA_PDCH_DEACT_ACK(RslChannelNr chan_nr) := {
Harald Welteee19c732018-04-05 09:08:26 +02002196 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002197 msg_type := RSL_MT_IPAC_PDCH_DEACT_ACK,
2198 ies := {
2199 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
2200 }
2201 }
Harald Welteee19c732018-04-05 09:08:26 +02002202 template RSL_Message tr_RSL_IPA_PDCH_DEACT_ACK(template RslChannelNr chan_nr) := {
2203 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2204 msg_type := RSL_MT_IPAC_PDCH_DEACT_ACK,
2205 ies := {
2206 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
2207 }
2208 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002209
2210 template RSL_Message ts_RSL_IPA_PDCH_DEACT_NACK(RslChannelNr chan_nr, RSL_Cause cause) := {
Harald Welteee19c732018-04-05 09:08:26 +02002211 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002212 msg_type := RSL_MT_IPAC_PDCH_DEACT_NACK,
2213 ies := {
2214 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2215 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2216 }
2217 }
Harald Welteee19c732018-04-05 09:08:26 +02002218 template RSL_Message tr_RSL_IPA_PDCH_DEACT_NACK(template RslChannelNr chan_nr,
2219 template RSL_Cause cause) := {
2220 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2221 msg_type := RSL_MT_IPAC_PDCH_DEACT_NACK,
2222 ies := {
2223 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2224 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
2225 }
2226 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002227
Harald Welte908ce542019-09-04 23:05:40 +02002228 template (value) RSL_Message ts_RSL_OSMO_ETWS_CMD(template (value) octetstring msg,
2229 template (value) RslChannelNr chan_nr := ts_RslChanNr_PCH_AGCH(0)) := {
2230 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2231 msg_type := RSL_MT_OSMO_ETWS_CMD,
2232 ies := {
2233 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2234 t_RSL_IE(RSL_IE_SMSCB_MSG, RSL_IE_Body:{smscb_message := ts_RSL_LV(msg)})
2235 }
2236 }
2237 template RSL_Message tr_RSL_OSMO_ETWS_CMD(template RslChannelNr chan_nr := ?,
2238 template octetstring msg := ?) := {
2239 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2240 msg_type := RSL_MT_OSMO_ETWS_CMD,
2241 ies := {
2242 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2243 tr_RSL_IE(RSL_IE_Body:{smscb_message := tr_RSL_LV(msg)})
2244 }
2245 }
2246
2247
Harald Welte9958a4d2017-12-14 21:21:33 +01002248
Harald Welte6a8199d2018-01-29 21:58:53 +01002249 function f_rsl_find_ie(RSL_Message msg, RSL_IE_Type iei, out RSL_IE_Body ret) return boolean {
2250 for (var integer i := 0; i < sizeof(msg.ies); i := i+1) {
2251 if (msg.ies[i].iei == iei) {
2252 ret := msg.ies[i].body;
2253 return true;
2254 }
2255 }
2256 return false;
2257 }
2258
2259
Harald Welte9958a4d2017-12-14 21:21:33 +01002260
Harald Welte643e2a62017-11-27 15:03:18 +01002261} with { encode "RAW" ; variant "FIELDORDER(msb)" }