blob: ff60a37e2d05b972aa21f4dbd9536975423a92f4 [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
Philipp Maierac693462020-10-14 20:21:44 +0200400 template (value) RSL_IE_ChannelMode ts_RSL_ChanMode_SIGN(boolean dtx_downlink := false,
401 RSL_ChanRateType t := RSL_CHRT_SDCCH) := {
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,
841 RSL_IE_MS_Power ms_power,
Eric Wild61edb7e2019-06-03 12:38:31 +0200842 RSL_IE_MS_Power_Parameters ms_power_params,
Harald Welte643e2a62017-11-27 15:03:18 +0100843 uint8_t timing_adv,
844 RSL_IE_MultirateCtrl multirate_ctrl,
Harald Weltea6706152019-05-19 20:38:18 +0200845 uint8_t msg_id,
Harald Welte643e2a62017-11-27 15:03:18 +0100846 RSL_IE_FrameNumber frame_nr,
847 RSL_IE_Cause cause,
848 uint8_t access_delay,
Harald Welted5f521e2017-12-07 17:53:06 +0100849 RSL_IE_RachLoad rach_load,
Harald Welte643e2a62017-11-27 15:03:18 +0100850 uint8_t meas_res_nr,
Harald Welte2691adf2018-02-22 17:32:39 +0100851 uint8_t ms_timing_offset,
852 RSL_IE_UplinkMeas uplink_meas,
Harald Welte643e2a62017-11-27 15:03:18 +0100853 RSL_IE_L1Info l1_info,
854 RSL_IE_SysinfoType sysinfo_type,
855 uint16_t paging_load,
856 uint8_t paging_group,
857 RSL_IE_ChanNeeded chan_needed,
Harald Weltecc373202018-09-10 10:28:21 +0200858 RSL_IE_CbCommandType cb_cmd_type,
859 RSL_LV smscb_message,
Harald Welte4a129f82019-05-21 16:35:22 +0200860 RSL_IE_CbchLoadInfo cbch_load_info,
Harald Weltec8d363c2019-05-19 20:36:48 +0200861 RSL_SacchInfo sacch_info,
Harald Weltecc373202018-09-10 10:28:21 +0200862
Harald Welte643e2a62017-11-27 15:03:18 +0100863 RSL_IE_StartingTime starting_time,
Harald Welte73cd2712017-12-17 00:44:52 +0100864 RSL_IE_EncryptionInfo encr_info,
Harald Weltea3ff6702019-05-20 20:03:50 +0200865 uint8_t smscb_chan_ind,
Harald Welte643e2a62017-11-27 15:03:18 +0100866 RSL_IE_RequestRef req_ref,
867 RSL_LV full_imm_ass_info,
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +0700868 MobileIdentityLV ms_identity,
Harald Welte643e2a62017-11-27 15:03:18 +0100869
Harald Welte9958a4d2017-12-14 21:21:33 +0100870 uint16_t ipa_conn_id,
871 uint16_t ipa_local_port,
872 uint16_t ipa_remote_port,
873 uint32_t ipa_local_ip,
874 uint32_t ipa_remote_ip,
875 uint8_t ipa_rtp_pt,
876 uint8_t ipa_rtp_pt2,
877 RSL_IE_IPA_ConnectionStats ipa_stats,
878 RSL_IE_IPA_SpeechMode ipa_speech_mode,
879
Harald Welte643e2a62017-11-27 15:03:18 +0100880 RSL_LV other
881 }
882
883 type record RSL_IE {
884 RSL_IE_Type iei,
885 RSL_IE_Body body
886 } with { variant (body) "CROSSTAG(
887 chan_nr, iei = RSL_IE_CHAN_NR;
888 link_id, iei = RSL_IE_LINK_IDENT;
889 l3_info, iei = RSL_IE_L3_INFO;
890 rlm_cause, iei = RSL_IE_RLM_CAUSE;
891 release_mode, iei = RSL_IE_RELEASE_MODE;
892 act_type, iei = RSL_IE_ACT_TYPE;
Vadim Yanitskiye02dbcc2020-08-25 04:20:51 +0700893 chan_ident, iei = RSL_IE_CHAN_IDENT;
Harald Welte643e2a62017-11-27 15:03:18 +0100894 chan_mode, iei = RSL_IE_CHAN_MODE;
895 handover_ref, iei = RSL_IE_HANDO_REF;
896 bs_power, iei = RSL_IE_BS_POWER;
897 ms_power, iei = RSL_IE_MS_POWER;
Eric Wild61edb7e2019-06-03 12:38:31 +0200898 ms_power_params, iei = RSL_IE_MS_POWER_PARAM;
Harald Welte643e2a62017-11-27 15:03:18 +0100899 timing_adv, iei = RSL_IE_TIMING_ADVANCE;
900 multirate_ctrl, iei = RSL_IE_MR_CONTROL;
Harald Weltea6706152019-05-19 20:38:18 +0200901 msg_id, iei = RSL_IE_MSG_ID;
Harald Welte643e2a62017-11-27 15:03:18 +0100902
903 frame_nr, iei = RSL_IE_FRAME_NUMBER;
904 cause, iei = RSL_IE_CAUSE;
905 access_delay, iei = RSL_IE_ACCESS_DELAY;
Harald Welted5f521e2017-12-07 17:53:06 +0100906 rach_load, iei = RSL_IE_RACH_LOAD;
Harald Welte643e2a62017-11-27 15:03:18 +0100907 meas_res_nr, iei = RSL_IE_MEAS_RES_NR;
Harald Welte2691adf2018-02-22 17:32:39 +0100908 ms_timing_offset, iei = RSL_IE_MS_TIMING_OFFSET;
909 uplink_meas, iei = RSL_IE_UPLINK_MEAS;
Harald Welte643e2a62017-11-27 15:03:18 +0100910 l1_info, iei = RSL_IE_L1_INFO;
911 sysinfo_type, iei = RSL_IE_SYSINFO_TYPE;
912 paging_load, iei = RSL_IE_PAGING_LOAD;
913 paging_group, iei = RSL_IE_PAGING_GROUP;
914 chan_needed, iei = RSL_IE_CHAN_NEEDED;
Harald Weltecc373202018-09-10 10:28:21 +0200915 cb_cmd_type, iei = RSL_IE_CB_CMD_TYPE;
916 smscb_message, iei = RSL_IE_SMSCB_MSG;
Harald Welte4a129f82019-05-21 16:35:22 +0200917 cbch_load_info, iei = RSL_IE_CBCH_LOAD_INFO;
Harald Weltec8d363c2019-05-19 20:36:48 +0200918 sacch_info, iei = RSL_IE_SACCH_INFO;
Harald Welte643e2a62017-11-27 15:03:18 +0100919 starting_time, iei = RSL_IE_STARTNG_TIME;
Harald Welte73cd2712017-12-17 00:44:52 +0100920 encr_info, iei = RSL_IE_ENCR_INFO;
Harald Weltea3ff6702019-05-20 20:03:50 +0200921 smscb_chan_ind, iei = RSL_IE_SMSCB_CHAN_INDICATOR;
Harald Welte643e2a62017-11-27 15:03:18 +0100922
923 req_ref, iei = RSL_IE_REQ_REFERENCE;
Harald Weltefff69302017-12-07 17:53:42 +0100924 full_imm_ass_info, iei = RSL_IE_FULL_IMM_ASS_INFO;
925 ms_identity, iei = RSL_IE_MS_IDENTITY;
926 other, iei = RSL_IE_FULL_BCCH_INFO;
Harald Welte643e2a62017-11-27 15:03:18 +0100927
Harald Welte9958a4d2017-12-14 21:21:33 +0100928 ipa_conn_id, iei = RSL_IE_IPAC_CONN_ID;
929 ipa_remote_ip, iei = RSL_IE_IPAC_REMOTE_IP;
930 ipa_remote_port, iei = RSL_IE_IPAC_REMOTE_PORT;
931 ipa_local_ip, iei = RSL_IE_IPAC_LOCAL_IP;
932 ipa_local_port, iei = RSL_IE_IPAC_LOCAL_PORT;
933 ipa_rtp_pt, iei = RSL_IE_IPAC_RTP_PAYLOAD;
934 ipa_rtp_pt2, iei = RSL_IE_IPAC_RTP_PAYLOAD2;
935 ipa_stats, iei = RSL_IE_IPAC_CONN_STAT;
936 ipa_speech_mode, iei = RSL_IE_IPAC_SPEECH_MODE;
937
Harald Welte643e2a62017-11-27 15:03:18 +0100938 other, OTHERWISE;
939 )" };
940
Harald Welte735dd072017-12-12 14:55:17 +0100941 /* For some reason the TTCN-3 RAW codec cannot automatically figure out the IEI
942 * that it needs to set for a given union-choice (body). So we have to explicitly
943 * specify the IEI by the caller :( */
Harald Welteefa7d912018-04-18 23:22:15 +0200944 template (value) RSL_IE t_RSL_IE(RSL_IE_Type iei, template (value) RSL_IE_Body body) := {
Harald Welte735dd072017-12-12 14:55:17 +0100945 iei := iei,
Harald Welte643e2a62017-11-27 15:03:18 +0100946 body := body
947 }
948
Harald Weltec2877752017-12-07 17:54:35 +0100949 template RSL_IE tr_RSL_IE(template RSL_IE_Body body) := {
950 iei := ?, /* overwritten? */
951 body := body
952 }
953
954
Harald Welte643e2a62017-11-27 15:03:18 +0100955 type record of RSL_IE RSL_IE_List;
956
957 type record RSL_Message {
958 RSL_MessageDiscriminator msg_disc,
959 RSL_MessageType msg_type,
960 RSL_IE_List ies optional
961 }
962
963 external function enc_RSL_Message(in RSL_Message msg) return octetstring
964 with { extension "prototype(convert) encode(RAW)" };
965 external function dec_RSL_Message(in octetstring stream) return RSL_Message
966 with { extension "prototype(convert) decode(RAW)" };
967
Harald Weltebc330be2017-12-09 00:56:36 +0100968 template RSL_Message tr_RSL_MsgDiscType(template RSL_MessageDiscriminator m_disc,
Harald Welte643e2a62017-11-27 15:03:18 +0100969 RSL_MessageType m_type) := {
970 msg_disc := m_disc,
971 msg_type := m_type,
972 ies := *
973 }
974
Harald Welteefa7d912018-04-18 23:22:15 +0200975 template (value) RSL_Message ts_RSL_MsgDiscType(template (value) RSL_MessageDiscriminator m_disc,
976 template (value) RSL_MessageType msg_type,
977 template (omit) RSL_IE_List ies := omit) := {
Harald Welte4a267362017-12-09 17:49:32 +0100978 msg_disc := m_disc,
979 msg_type := msg_type,
980 ies := ies
981 }
982
Harald Weltebc330be2017-12-09 00:56:36 +0100983template RSL_Message tr_RSL_MsgType(template RSL_MessageType msg_type) := {
984 msg_disc := ?,
985 msg_type := msg_type,
986 ies := *
987}
988
989/* Common Channel Management */
990template RSL_Message tr_RSL_MsgTypeC(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
991 msg_disc := { RSL_MDISC_CCHAN, ? }
992}
993
994/* RLL */
995template RSL_Message tr_RSL_MsgTypeR(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
996 msg_disc := { RSL_MDISC_RLL, true }
997}
998
999/* Dedicated Channel Management */
1000template RSL_Message tr_RSL_MsgTypeD(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
1001 msg_disc := { RSL_MDISC_DCHAN, ? }
1002}
1003
1004/* Dedicated Channel Management */
1005template RSL_Message tr_RSL_MsgTypeT(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
1006 msg_disc := { RSL_MDISC_TRX_MGMT, ? }
1007}
1008
1009
1010/* dedicated channel or RLL */
1011template RSL_Message tr_RSL_MsgTypeDR(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
Harald Weltee5408222018-01-29 21:57:58 +01001012 msg_disc := ({RSL_MDISC_DCHAN,?}, {RSL_MDISC_RLL,?}, {RSL_MDISC_IPACCESS,false})
Harald Weltebc330be2017-12-09 00:56:36 +01001013}
1014
1015
Harald Welte643e2a62017-11-27 15:03:18 +01001016 /* 8.3.1 BSC -> BTS */
Harald Welteefa7d912018-04-18 23:22:15 +02001017 template (value) RSL_Message ts_RSL_DATA_REQ(template (value) RslChannelNr chan_nr,
1018 template (value) RslLinkId link_id,
1019 octetstring l3_info) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001020 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, true),
1021 msg_type := RSL_MT_DATA_REQ,
1022 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001023 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1024 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
1025 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
Harald Welte643e2a62017-11-27 15:03:18 +01001026 }
1027 }
1028
Harald Welte7794d5b2017-12-16 23:00:20 +01001029 template RSL_Message tr_RSL_DATA_REQ(template RslChannelNr chan_nr :=?,
1030 template RslLinkId link_id := ?,
1031 template octetstring l3_info := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001032 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, true),
Harald Welte7794d5b2017-12-16 23:00:20 +01001033 msg_type := RSL_MT_DATA_REQ,
1034 ies :={
1035 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1036 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
1037 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
1038 }
1039 }
1040
1041
Harald Welte643e2a62017-11-27 15:03:18 +01001042 /* 8.3.2 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001043 template (value) RSL_Message ts_RSL_DATA_IND(template (value) RslChannelNr chan_nr,
1044 template (value) RslLinkId link_id,
1045 octetstring l3_info) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001046 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, true),
1047 msg_type := RSL_MT_DATA_IND,
1048 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001049 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1050 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
1051 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
Harald Welte643e2a62017-11-27 15:03:18 +01001052 }
1053 }
Harald Welte9abd1282018-02-19 19:18:17 +01001054 template RSL_Message tr_RSL_DATA_IND(template RslChannelNr chan_nr, template RslLinkId link_id,
1055 template octetstring l3_info := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001056 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, true),
Harald Welte9abd1282018-02-19 19:18:17 +01001057 msg_type := RSL_MT_DATA_IND,
1058 ies :={
1059 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1060 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
1061 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
1062 }
1063 }
Harald Welte643e2a62017-11-27 15:03:18 +01001064
1065 /* 8.3.3 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001066 template (value) RSL_Message ts_RSL_ERROR_IND(template (value) RslChannelNr chan_nr,
Harald Weltea7d81f12019-06-02 22:33:19 +02001067 template (value) RslLinkId link_id,
1068 template (value) octetstring rlm_cause) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001069 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1070 msg_type := RSL_MT_ERROR_IND,
1071 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001072 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1073 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
Harald Weltea7d81f12019-06-02 22:33:19 +02001074 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{rlm_cause := ts_RSL_LV(rlm_cause)})
Harald Welte643e2a62017-11-27 15:03:18 +01001075 }
1076 }
Harald Welte9abd1282018-02-19 19:18:17 +01001077 template RSL_Message tr_RSL_ERROR_IND(template RslChannelNr chan_nr, template RslLinkId link_id,
Harald Weltea7d81f12019-06-02 22:33:19 +02001078 template octetstring rlm_cause := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001079 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001080 msg_type := RSL_MT_ERROR_IND,
1081 ies :={
1082 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1083 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
Harald Weltea7d81f12019-06-02 22:33:19 +02001084 tr_RSL_IE(RSL_IE_Body:{rlm_cause := tr_RSL_LV(rlm_cause)})
Harald Welte9abd1282018-02-19 19:18:17 +01001085 }
1086 }
Harald Welte643e2a62017-11-27 15:03:18 +01001087
Harald Welteefa7d912018-04-18 23:22:15 +02001088 /* 8.3.4 BTS <- BSC */
1089 template (value) RSL_Message ts_RSL_EST_REQ(template (value) RslChannelNr chan_nr,
1090 template (value) RslLinkId link_id) := {
1091 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1092 msg_type := RSL_MT_EST_REQ,
1093 ies := {
1094 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1095 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
1096 }
1097 }
1098 template RSL_Message tr_RSL_EST_REQ(template RslChannelNr chan_nr, template RslLinkId link_id) := {
1099 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
1100 msg_type := RSL_MT_EST_REQ,
1101 ies := {
1102 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1103 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1104 }
1105 }
1106
1107 /* 8.3.5 BTS -> BSC */
1108 template (value) RSL_Message ts_RSL_EST_CONF(template (value) RslChannelNr chan_nr,
1109 template (value) RslLinkId link_id) := {
1110 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1111 msg_type := RSL_MT_EST_CONF,
1112 ies := {
1113 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1114 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
1115 }
1116 }
1117 template RSL_Message tr_RSL_EST_CONF(template RslChannelNr chan_nr, template RslLinkId link_id) := {
1118 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
1119 msg_type := RSL_MT_EST_CONF,
1120 ies := {
1121 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1122 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1123 }
1124 }
1125
Harald Welte643e2a62017-11-27 15:03:18 +01001126 /* 8.3.6 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001127 template (value) RSL_Message ts_RSL_EST_IND(template (value) RslChannelNr chan_nr,
1128 template (value) RslLinkId link_id,
1129 octetstring l3_info) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001130 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1131 msg_type := RSL_MT_EST_IND,
1132 ies := {
Harald Welte735dd072017-12-12 14:55:17 +01001133 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1134 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
1135 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
Harald Welte643e2a62017-11-27 15:03:18 +01001136 }
1137 }
Harald Welte9abd1282018-02-19 19:18:17 +01001138 template RSL_Message tr_RSL_EST_IND(template RslChannelNr chan_nr, template RslLinkId link_id,
1139 template octetstring l3_info := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001140 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001141 msg_type := RSL_MT_EST_IND,
1142 ies := {
1143 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1144 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
1145 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
1146 }
1147 }
Harald Welte0472ab42018-03-12 15:02:26 +01001148 template RSL_Message tr_RSL_EST_IND_NOL3(template RslChannelNr chan_nr, template RslLinkId link_id) :=
1149{
1150 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
1151 msg_type := RSL_MT_EST_IND,
1152 ies := {
1153 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1154 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1155 }
1156 }
1157
Harald Welte643e2a62017-11-27 15:03:18 +01001158
1159 /* 8.3.7 BSC -> BTS */
Harald Welteefa7d912018-04-18 23:22:15 +02001160 template (value) RSL_Message ts_RSL_REL_REQ(template (value) RslChannelNr chan_nr,
Harald Welte0472ab42018-03-12 15:02:26 +01001161 template (value) RslLinkId link_id,
1162 template (value) RSL_IE_ReleaseMode rel_mode := RSL_REL_MODE_NORMAL) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001163 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1164 msg_type := RSL_MT_REL_REQ,
1165 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001166 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
Harald Welte0472ab42018-03-12 15:02:26 +01001167 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
1168 t_RSL_IE(RSL_IE_RELEASE_MODE, RSL_IE_Body:{release_mode := rel_mode})
Harald Welte643e2a62017-11-27 15:03:18 +01001169 }
1170 }
Harald Weltee8a5ab12017-12-09 22:34:57 +01001171 template RSL_Message tr_RSL_REL_REQ(template RslChannelNr chan_nr,
Harald Welte0472ab42018-03-12 15:02:26 +01001172 template RslLinkId link_id,
1173 template RSL_IE_ReleaseMode rel_mode := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001174 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Weltee8a5ab12017-12-09 22:34:57 +01001175 msg_type := RSL_MT_REL_REQ,
1176 ies :={
1177 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1178 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
Harald Welte0472ab42018-03-12 15:02:26 +01001179 tr_RSL_IE(RSL_IE_Body:{release_mode := rel_mode})
Harald Weltee8a5ab12017-12-09 22:34:57 +01001180 }
1181 }
Harald Welte643e2a62017-11-27 15:03:18 +01001182
1183 /* 8.3.8 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001184 template (value) RSL_Message ts_RSL_REL_CONF(template (value) RslChannelNr chan_nr,
1185 template (value) RslLinkId link_id) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001186 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1187 msg_type := RSL_MT_REL_CONF,
1188 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001189 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1190 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
Harald Welte643e2a62017-11-27 15:03:18 +01001191 }
1192 }
Harald Welte9abd1282018-02-19 19:18:17 +01001193 template RSL_Message tr_RSL_REL_CONF(template RslChannelNr chan_nr, template RslLinkId link_id) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001194 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001195 msg_type := RSL_MT_REL_CONF,
1196 ies :={
1197 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1198 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1199 }
1200 }
Harald Welte643e2a62017-11-27 15:03:18 +01001201
1202 /* 8.3.9 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001203 template (value) RSL_Message ts_RSL_REL_IND(template (value) RslChannelNr chan_nr,
1204 template (value) RslLinkId link_id) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001205 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1206 msg_type := RSL_MT_REL_IND,
1207 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001208 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1209 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
Harald Welte643e2a62017-11-27 15:03:18 +01001210 }
1211 }
Harald Welte9abd1282018-02-19 19:18:17 +01001212 template RSL_Message tr_RSL_REL_IND(template RslChannelNr chan_nr, template RslLinkId link_id) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001213 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001214 msg_type := RSL_MT_REL_IND,
1215 ies :={
1216 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1217 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1218 }
1219 }
Harald Welte643e2a62017-11-27 15:03:18 +01001220
1221 /* 8.3.10 BSC -> BTS */
Harald Welteefa7d912018-04-18 23:22:15 +02001222 template (value) RSL_Message ts_RSL_UNITDATA_REQ(template (value) RslChannelNr chan_nr,
1223 template (value) RslLinkId link_id,
1224 octetstring l3_info)
Harald Welte643e2a62017-11-27 15:03:18 +01001225 modifies ts_RSL_DATA_REQ := {
1226 msg_type := RSL_MT_UNIT_DATA_REQ
1227 }
Harald Welte0472ab42018-03-12 15:02:26 +01001228 template RSL_Message tr_RSL_UNITDATA_REQ(template RslChannelNr chan_nr,
1229 template RslLinkId link_id,
Vadim Yanitskiy8f98d3f2018-10-03 17:58:10 +07001230 template octetstring l3_info := ?)
Harald Welte0472ab42018-03-12 15:02:26 +01001231 modifies tr_RSL_DATA_REQ := {
1232 msg_type := RSL_MT_UNIT_DATA_REQ
1233 }
1234
Harald Welte643e2a62017-11-27 15:03:18 +01001235
1236 /* 8.3.11 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001237 template (value) RSL_Message ts_RSL_UNITDATA_IND(template (value) RslChannelNr chan_nr,
1238 template (value) RslLinkId link_id,
1239 octetstring l3_info)
Harald Welte643e2a62017-11-27 15:03:18 +01001240 modifies ts_RSL_DATA_IND := {
1241 msg_type := RSL_MT_UNIT_DATA_IND
1242 }
Harald Welte0472ab42018-03-12 15:02:26 +01001243 template RSL_Message tr_RSL_UNITDATA_IND(template RslChannelNr chan_nr,
Vadim Yanitskiyfabe0f22018-10-03 17:51:47 +07001244 template RslLinkId link_id,
Vadim Yanitskiy8f98d3f2018-10-03 17:58:10 +07001245 template octetstring l3_info := ?)
Harald Welte0472ab42018-03-12 15:02:26 +01001246 modifies tr_RSL_DATA_IND := {
1247 msg_type := RSL_MT_UNIT_DATA_IND
1248 }
1249
1250
Harald Welte643e2a62017-11-27 15:03:18 +01001251
1252
1253 /* DEDICATED CANNEL MANAGEMENT MESSAGES */
1254
1255 /* 8.4.1 BSC -> BTS */
Harald Welteefa7d912018-04-18 23:22:15 +02001256 template (value) RSL_Message ts_RSL_CHAN_ACT(template (value) RslChannelNr chan_nr,
Harald Welte921f9e02019-05-19 22:27:11 +02001257 template (value) RSL_IE_ChannelMode mode,
1258 template (value) RSL_IE_ActivationType at := t_RSL_IE_ActType_IA) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001259 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1260 msg_type := RSL_MT_CHAN_ACTIV,
1261 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001262 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
Harald Welte921f9e02019-05-19 22:27:11 +02001263 t_RSL_IE(RSL_IE_ACT_TYPE, RSL_IE_Body:{act_type := at}),
Harald Welte735dd072017-12-12 14:55:17 +01001264 t_RSL_IE(RSL_IE_CHAN_MODE, RSL_IE_Body:{chan_mode := mode})
Harald Welte643e2a62017-11-27 15:03:18 +01001265 /* lots of optional IEs */
1266 }
1267 }
Harald Welte94e0c342018-04-07 11:33:23 +02001268 template RSL_Message tr_RSL_CHAN_ACT(template RslChannelNr chan_nr,
Harald Welte921f9e02019-05-19 22:27:11 +02001269 template RSL_IE_ChannelMode mode,
1270 template (value) RSL_IE_ActivationType at := t_RSL_IE_ActType_IA) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001271 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte94e0c342018-04-07 11:33:23 +02001272 msg_type := RSL_MT_CHAN_ACTIV,
1273 ies :={
1274 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
Harald Welte921f9e02019-05-19 22:27:11 +02001275 tr_RSL_IE(RSL_IE_Body:{act_type := at}),
Harald Welte94e0c342018-04-07 11:33:23 +02001276 tr_RSL_IE(RSL_IE_Body:{chan_mode := mode}),
1277 /* lots of optional IEs */
1278 *
1279 }
1280 }
1281 template RSL_Message tr_RSL_CHAN_ACT_PDCH(template RslChannelNr chan_nr,
1282 template RSL_IE_ChannelMode mode) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001283 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte94e0c342018-04-07 11:33:23 +02001284 msg_type := RSL_MT_CHAN_ACTIV,
1285 ies :={
1286 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1287 tr_RSL_IE(RSL_IE_Body:{act_type := t_RSL_IE_ActType_PDCH}),
1288 /* lots of optional IEs */
1289 *
1290 }
1291 }
1292
Harald Welte643e2a62017-11-27 15:03:18 +01001293
1294 /* 8.4.2 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001295 template (value) RSL_Message ts_RSL_CHAN_ACT_ACK(template (value) RslChannelNr chan_nr,
1296 GsmFrameNumber fn) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001297 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1298 msg_type := RSL_MT_CHAN_ACTIV_ACK,
1299 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001300 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1301 t_RSL_IE(RSL_IE_FRAME_NUMBER, RSL_IE_Body:{frame_nr := ts_RSL_IE_FrameNumber(fn)})
Harald Welte643e2a62017-11-27 15:03:18 +01001302 }
1303 }
Harald Welte9abd1282018-02-19 19:18:17 +01001304 template RSL_Message tr_RSL_CHAN_ACT_ACK(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001305 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001306 msg_type := RSL_MT_CHAN_ACTIV_ACK,
1307 ies := {
1308 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1309 tr_RSL_IE(RSL_IE_Body:{frame_nr := ?})
1310 }
1311 }
Harald Welte643e2a62017-11-27 15:03:18 +01001312
1313 /* 8.4.3 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001314 template (value) RSL_Message ts_RSL_CHAN_ACT_NACK(template (value) RslChannelNr chan_nr,
1315 RSL_Cause cause) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001316 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1317 msg_type := RSL_MT_CHAN_ACTIV_NACK,
1318 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001319 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1320 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
Harald Welte643e2a62017-11-27 15:03:18 +01001321 }
1322 }
Harald Welte9abd1282018-02-19 19:18:17 +01001323 template RSL_Message tr_RSL_CHAN_ACT_NACK(template RslChannelNr chan_nr,
1324 template RSL_Cause cause := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001325 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001326 msg_type := RSL_MT_CHAN_ACTIV_NACK,
1327 ies := {
1328 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1329 tr_RSL_IE(RSL_IE_Body:{cause := ?})
1330 }
1331 }
Harald Welte643e2a62017-11-27 15:03:18 +01001332
1333 /* 8.4.4 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001334 template (value) RSL_Message ts_RSL_CONN_FAIL_IND(RslChannelNr chan_nr, RSL_Cause cause) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001335 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1336 msg_type := RSL_MT_CONN_FAIL,
1337 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001338 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1339 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
Harald Welte643e2a62017-11-27 15:03:18 +01001340 }
1341 }
Harald Welte9abd1282018-02-19 19:18:17 +01001342 template RSL_Message tr_RSL_CONN_FAIL_IND(template RslChannelNr chan_nr,
1343 template RSL_Cause cause := ?) := {
1344 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1345 msg_type := RSL_MT_CONN_FAIL,
1346 ies :={
1347 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1348 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
1349 }
1350 }
Harald Welte643e2a62017-11-27 15:03:18 +01001351
Harald Weltee8a5ab12017-12-09 22:34:57 +01001352 /* 8.4.5 BSC -> BTS */
1353 template RSL_Message tr_RSL_DEACT_SACCH(template RslChannelNr chan_nr) := {
1354 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1355 msg_type := RSL_MT_DEACTIVATE_SACCH,
1356 ies := {
1357 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
1358 }
1359 }
Harald Welteefa7d912018-04-18 23:22:15 +02001360 template (value) RSL_Message ts_RSL_DEACT_SACCH(template (value) RslChannelNr chan_nr) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001361 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1362 msg_type := RSL_MT_DEACTIVATE_SACCH,
1363 ies := {
1364 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1365 }
1366 }
1367
Harald Weltee8a5ab12017-12-09 22:34:57 +01001368
Harald Welte73cd2712017-12-17 00:44:52 +01001369 /* 8.4.6 BSC ->BTS */
1370 template RSL_Message tr_RSL_ENCR_CMD(template RslChannelNr chan_nr,
1371 template RslLinkId link_id := ?,
Harald Weltee613f962018-04-18 22:38:16 +02001372 template RSL_AlgId alg := ?,
Harald Welte73cd2712017-12-17 00:44:52 +01001373 template octetstring key := ?,
1374 template octetstring l3_info := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001375 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte73cd2712017-12-17 00:44:52 +01001376 msg_type := RSL_MT_ENCR_CMD,
1377 ies := {
1378 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1379 tr_RSL_IE(RSL_IE_Body:{encr_info := tr_RSL_IE_EncrInfo(alg, key)}),
1380 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
1381 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
1382 }
1383 }
Harald Welteefa7d912018-04-18 23:22:15 +02001384 template (value) RSL_Message ts_RSL_ENCR_CMD(template (value) RslChannelNr chan_nr,
1385 template (value) RslLinkId link_id,
Harald Weltee613f962018-04-18 22:38:16 +02001386 template (value) RSL_AlgId alg, octetstring key,
Harald Welteefa7d912018-04-18 23:22:15 +02001387 octetstring l3_info) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001388 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1389 msg_type := RSL_MT_ENCR_CMD,
1390 ies := {
1391 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
Harald Welteefa7d912018-04-18 23:22:15 +02001392 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 +01001393 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
Harald Welteefa7d912018-04-18 23:22:15 +02001394 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
Harald Welte9abd1282018-02-19 19:18:17 +01001395 }
1396 }
Harald Welte73cd2712017-12-17 00:44:52 +01001397
Harald Welte2691adf2018-02-22 17:32:39 +01001398 template RSL_Message tr_RSL_MEAS_RES(template RslChannelNr chan_nr,
1399 template uint8_t meas_res_nr := ?,
1400 template RSL_IE_UplinkMeas ul_meas := ?,
1401 template RSL_IE_BS_Power bs_power := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001402 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte2691adf2018-02-22 17:32:39 +01001403 msg_type := RSL_MT_MEAS_RES,
1404 ies := {
1405 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1406 tr_RSL_IE(RSL_IE_Body:{meas_res_nr := meas_res_nr}),
1407 tr_RSL_IE(RSL_IE_Body:{uplink_meas := ul_meas}),
1408 tr_RSL_IE(RSL_IE_Body:{bs_power := bs_power}),
1409 *
1410 }
1411 }
1412
Philipp Maierdd841d32019-12-17 14:44:54 +01001413 /* Receive template for a measurement report that lacks the measurement report
1414 * from the MS (l1_info, l3_info and ms timing offset */
1415 template RSL_Message tr_RSL_MEAS_RES_EMPTY(template RslChannelNr chan_nr,
1416 template uint8_t meas_res_nr := ?,
1417 template RSL_IE_UplinkMeas ul_meas := ?,
1418 template RSL_IE_BS_Power bs_power := ?) := {
1419 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1420 msg_type := RSL_MT_MEAS_RES,
1421 ies := {
1422 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1423 tr_RSL_IE(RSL_IE_Body:{meas_res_nr := meas_res_nr}),
1424 tr_RSL_IE(RSL_IE_Body:{uplink_meas := ul_meas}),
1425 tr_RSL_IE(RSL_IE_Body:{bs_power := bs_power})
1426 }
1427 }
1428
Harald Welte39b47be2018-02-23 18:58:48 +01001429 /* Osmocom specific template, require lots of optional fields to be present */
1430 template RSL_Message tr_RSL_MEAS_RES_OSMO(template RslChannelNr chan_nr,
1431 template uint8_t meas_res_nr := ?,
1432 template RSL_IE_UplinkMeas ul_meas := ?,
1433 template RSL_IE_BS_Power bs_power := ?,
1434 template RSL_IE_L1Info l1_info := ?,
1435 template octetstring l3_info := ?,
1436 template uint8_t ms_to := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001437 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte39b47be2018-02-23 18:58:48 +01001438 msg_type := RSL_MT_MEAS_RES,
1439 ies := {
1440 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1441 tr_RSL_IE(RSL_IE_Body:{meas_res_nr := meas_res_nr}),
1442 tr_RSL_IE(RSL_IE_Body:{uplink_meas := ul_meas}),
1443 tr_RSL_IE(RSL_IE_Body:{bs_power := bs_power}),
1444 tr_RSL_IE(RSL_IE_Body:{l1_info := l1_info}),
1445 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)}),
1446 tr_RSL_IE(RSL_IE_Body:{ms_timing_offset := ms_to})
1447 }
1448 }
1449
Eric Wildf1827a72019-05-28 17:37:35 +02001450 /* 8.4.9 BSC -> BTS */
1451 template (value) RSL_Message ts_RSL_MODE_MODIFY_REQ(template (value) RslChannelNr chan_nr,
1452 template (value) RSL_IE_ChannelMode mode) := {
1453 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1454 msg_type := RSL_MT_MODE_MODIFY_REQ,
1455 ies :={
1456 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1457 t_RSL_IE(RSL_IE_CHAN_MODE, RSL_IE_Body:{chan_mode := mode})
1458 /* lots of optional IEs */
1459 }
1460 }
1461 template RSL_Message tr_RSL_MODE_MODIFY_REQ(template RslChannelNr chan_nr,
1462 template RSL_IE_ChannelMode mode) := {
1463 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1464 msg_type := RSL_MT_MODE_MODIFY_REQ,
1465 ies :={
1466 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1467 tr_RSL_IE(RSL_IE_Body:{chan_mode := mode}),
1468 /* lots of optional IEs */
1469 *
1470 }
1471 }
1472
Harald Welte7794d5b2017-12-16 23:00:20 +01001473 /* 8.4.10 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001474 template (value) RSL_Message ts_RSL_MODE_MODIFY_ACK(template (value) RslChannelNr chan_nr) := {
Harald Welte7794d5b2017-12-16 23:00:20 +01001475 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1476 msg_type := RSL_MT_MODE_MODIFY_ACK,
1477 ies := {
1478 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1479 }
1480 }
Harald Welte9abd1282018-02-19 19:18:17 +01001481 template RSL_Message tr_RSL_MODE_MODIFY_ACK(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001482 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001483 msg_type := RSL_MT_MODE_MODIFY_ACK,
1484 ies := {
1485 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
1486 }
1487 }
Harald Welte7794d5b2017-12-16 23:00:20 +01001488
Harald Welte643e2a62017-11-27 15:03:18 +01001489 /* 8.4.11 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001490 template (value) RSL_Message ts_RSL_MODE_MODIFY_NACK(template (value) RslChannelNr chan_nr,
1491 RSL_Cause cause) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001492 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1493 msg_type := RSL_MT_MODE_MODIFY_NACK,
1494 ies := {
1495 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1496 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
1497 }
Harald Welte643e2a62017-11-27 15:03:18 +01001498 }
Harald Welte9abd1282018-02-19 19:18:17 +01001499 template RSL_Message tr_RSL_MODE_MODIFY_NACK(template RslChannelNr chan_nr,
1500 template RSL_Cause cause) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001501 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001502 msg_type := RSL_MT_MODE_MODIFY_NACK,
1503 ies := {
1504 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1505 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
1506 }
1507 }
1508
Harald Welte643e2a62017-11-27 15:03:18 +01001509
Harald Welte6a8199d2018-01-29 21:58:53 +01001510 /* 8.4.14: BTS <- BSC */
1511 template RSL_Message tr_RSL_RF_CHAN_REL(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001512 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte6a8199d2018-01-29 21:58:53 +01001513 msg_type := RSL_MT_RF_CHAN_REL,
1514 ies := {
1515 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
1516 }
1517 }
Harald Welteefa7d912018-04-18 23:22:15 +02001518 template (value) RSL_Message ts_RSL_RF_CHAN_REL(template (value) RslChannelNr chan_nr) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001519 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1520 msg_type := RSL_MT_RF_CHAN_REL,
1521 ies := {
1522 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1523 }
1524 }
Harald Welte6a8199d2018-01-29 21:58:53 +01001525
Philipp Maier4d1e9c92018-12-20 11:11:56 +01001526 /* 8.4.15: BTS <- BSC */
1527 template (value) RSL_Message ts_RSL_MS_PWR_CTRL(template (value) RslChannelNr chan_nr,
1528 template (value) RSL_IE_MS_Power ms_power) := {
1529 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1530 msg_type := RSL_MT_MS_POWER_CONTROL,
1531 ies := {
1532 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1533 t_RSL_IE(RSL_IE_MS_POWER, RSL_IE_Body:{ms_power := ms_power})
1534 /* One optional IE: MS POWER PARAMETERS */
1535 }
1536 }
1537
Eric Wild61edb7e2019-06-03 12:38:31 +02001538 template (value) RSL_Message ts_RSL_MS_PWR_CTRL_with_pp(template (value) RslChannelNr chan_nr,
1539 integer pwr_level) := {
1540 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1541 msg_type := RSL_MT_MS_POWER_CONTROL,
1542 ies := {
1543 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1544 t_RSL_IE(RSL_IE_MS_POWER, RSL_IE_Body:{ms_power := ts_RSL_IE_MS_Power(pwr_level)}),
1545 t_RSL_IE(RSL_IE_MS_POWER_PARAM, RSL_IE_Body:{ms_power_params :=
1546 ts_RSL_IE_MS_Power_Parameters(''O)})
1547 }
1548 }
1549
Eric Wildae8f2622019-06-18 17:05:11 +02001550 /* 8.4.16: BTS <- BSC */
1551 template (value) RSL_Message ts_RSL_BS_PWR_CTRL(template (value) RslChannelNr chan_nr,
1552 template (value) RSL_IE_BS_Power bs_power) := {
1553 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1554 msg_type := RSL_MT_BS_POWER_CONTROL,
1555 ies := {
1556 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1557 t_RSL_IE(RSL_IE_BS_POWER, RSL_IE_Body:{bs_power := bs_power})
1558 /* One optional IE: BS POWER PARAMETERS */
1559 }
1560 }
1561
Harald Welte4a267362017-12-09 17:49:32 +01001562 /* 8.4.19 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001563 template (value) RSL_Message ts_RSL_RF_CHAN_REL_ACK(template (value) RslChannelNr chan_nr) :=
Harald Welte4a267362017-12-09 17:49:32 +01001564 ts_RSL_MsgDiscType(ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1565 RSL_MT_RF_CHAN_REL_ACK,
Harald Welte735dd072017-12-12 14:55:17 +01001566 { t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}) });
Harald Welte4a267362017-12-09 17:49:32 +01001567
Harald Welte9abd1282018-02-19 19:18:17 +01001568 template RSL_Message tr_RSL_RF_CHAN_REL_ACK(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001569 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001570 msg_type := RSL_MT_RF_CHAN_REL_ACK,
1571 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001572 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
Harald Welte9abd1282018-02-19 19:18:17 +01001573 }
1574 }
1575
Harald Welteea17b912018-03-11 22:29:31 +01001576 /* 8.6.20 BTS <- BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001577 template (value) RSL_Message ts_RSL_SACCH_INF_MOD(template (value) RslChannelNr chan_nr,
1578 RSL_IE_SysinfoType si_type,
1579 octetstring l3_info) := {
Harald Welteea17b912018-03-11 22:29:31 +01001580 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1581 msg_type := RSL_MT_SACCH_INFO_MODIFY,
1582 ies := {
1583 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1584 t_RSL_IE(RSL_IE_SYSINFO_TYPE, RSL_IE_Body:{sysinfo_type := si_type}),
1585 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
1586 }
1587 }
1588
Neels Hofmeyr378a49c2018-06-15 22:18:43 +02001589 /* 8.4.7 BTS -> BSC */
1590 template (value) RSL_Message ts_RSL_HANDO_DET(template (value) RslChannelNr chan_nr) := {
1591 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1592 msg_type := RSL_MT_HANDO_DET,
1593 ies := {
1594 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1595 }
1596 }
Vadim Yanitskiy7c2c10c2019-05-31 20:42:01 +07001597 template RSL_Message tr_RSL_HANDO_DET(template RslChannelNr chan_nr,
1598 template uint8_t acc_delay := ?) := {
1599 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1600 msg_type := RSL_MT_HANDO_DET,
1601 ies := {
1602 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1603 tr_RSL_IE(RSL_IE_Body:{access_delay := acc_delay})
1604 }
1605 }
Neels Hofmeyr378a49c2018-06-15 22:18:43 +02001606
Harald Welteea17b912018-03-11 22:29:31 +01001607
Harald Welte643e2a62017-11-27 15:03:18 +01001608 /* COMMON CHANNEL MANAGEMENT MESSAGES */
1609
Harald Welte874c2232018-02-24 04:52:43 +01001610 /* 8.5.1 BTS <- BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001611 template (value) RSL_Message ts_RSL_BCCH_INFO(RSL_IE_SysinfoType si_type,
1612 octetstring full_bcch_info) := {
Harald Welte874c2232018-02-24 04:52:43 +01001613 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1614 msg_type := RSL_MT_BCCH_INFO,
1615 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001616 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_BCCH(0)}),
Harald Welte874c2232018-02-24 04:52:43 +01001617 t_RSL_IE(RSL_IE_SYSINFO_TYPE, RSL_IE_Body:{sysinfo_type := si_type}),
1618 t_RSL_IE(RSL_IE_FULL_BCCH_INFO, RSL_IE_Body:{other := ts_RSL_LV(full_bcch_info)})
1619 }
1620 }
Harald Welte09538f82019-08-01 09:50:25 +02001621 template RSL_Message tr_RSL_NO_BCCH_INFO(template RSL_IE_SysinfoType si_type := ?) := {
1622 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1623 msg_type := RSL_MT_BCCH_INFO,
1624 ies := {
1625 tr_RSL_IE(RSL_IE_Body:{chan_nr := ts_RslChanNr_BCCH(0)}),
1626 tr_RSL_IE(RSL_IE_Body:{sysinfo_type := si_type})
1627 }
1628 }
1629 template RSL_Message tr_RSL_BCCH_INFO(template RSL_IE_SysinfoType si_type := ?,
1630 template octetstring full_bcch_info := ?) := {
1631 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1632 msg_type := RSL_MT_BCCH_INFO,
1633 ies := {
1634 tr_RSL_IE(RSL_IE_Body:{chan_nr := ts_RslChanNr_BCCH(0)}),
1635 tr_RSL_IE(RSL_IE_Body:{sysinfo_type := si_type}),
1636 tr_RSL_IE(RSL_IE_Body:{other := tr_RSL_LV(full_bcch_info)}),
1637 *
1638 }
1639 }
Harald Welte874c2232018-02-24 04:52:43 +01001640
Harald Welte7ae93142017-12-07 17:56:15 +01001641 /* 8.5.2 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001642 template (value) RSL_Message ts_RSL_RACH_LOAD_IND(uint16_t slot_ct, uint16_t busy_ct,
1643 uint16_t acc_ct) := {
Harald Welte7ae93142017-12-07 17:56:15 +01001644 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1645 msg_type := RSL_MT_CCCH_LOAD_IND,
1646 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001647 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_RACH(0)}),
Harald Welte735dd072017-12-12 14:55:17 +01001648 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 +01001649 }
1650 }
Harald Welte68e495b2018-02-25 00:05:57 +01001651 template RSL_Message tr_RSL_RACH_LOAD_IND(template uint16_t slot_ct := ?,
1652 template uint16_t busy_ct := ?,
Harald Welte09538f82019-08-01 09:50:25 +02001653 template uint16_t acc_ct := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001654 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Welte68e495b2018-02-25 00:05:57 +01001655 msg_type := RSL_MT_CCCH_LOAD_IND,
1656 ies := {
1657 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_RACH(0)}),
1658 tr_RSL_IE(RSL_IE_Body:{rach_load := tr_RSL_IE_RachLoad(slot_ct, busy_ct, acc_ct)})
1659 }
1660 }
1661
Harald Welteefa7d912018-04-18 23:22:15 +02001662 template (value) RSL_Message ts_RSL_PAGING_LOAD_IND(uint16_t buffer_space) := {
Harald Welte7ae93142017-12-07 17:56:15 +01001663 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1664 msg_type := RSL_MT_CCCH_LOAD_IND,
1665 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001666 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_PCH_AGCH(0)}),
Harald Welte735dd072017-12-12 14:55:17 +01001667 t_RSL_IE(RSL_IE_PAGING_LOAD, RSL_IE_Body:{paging_load := buffer_space})
Harald Welte7ae93142017-12-07 17:56:15 +01001668 }
1669 }
Harald Welte68e495b2018-02-25 00:05:57 +01001670 template RSL_Message tr_RSL_PAGING_LOAD_IND(template uint16_t buffer_space := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001671 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Welte68e495b2018-02-25 00:05:57 +01001672 msg_type := RSL_MT_CCCH_LOAD_IND,
1673 ies := {
1674 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(0)}),
1675 tr_RSL_IE(RSL_IE_Body:{paging_load := buffer_space})
1676 }
1677 }
1678
Harald Welte7ae93142017-12-07 17:56:15 +01001679
Harald Welte643e2a62017-11-27 15:03:18 +01001680 /* 8.5.3 BTS -> BSC */
Vadim Yanitskiyab448a52019-05-31 20:24:03 +07001681 template (value) RSL_Message ts_RSL_CHAN_RQD(OCT1 ra, GsmFrameNumber fn,
1682 template (value) RslChannelNr chan_nr := ts_RslChanNr_RACH(0),
1683 uint8_t acc_del := 0) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001684 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1685 msg_type := RSL_MT_CHAN_RQD,
1686 ies := {
Vadim Yanitskiyab448a52019-05-31 20:24:03 +07001687 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1688 /* TODO: we may need to have optional RSL_IE_LINK_IDENT IE here */
Harald Welte735dd072017-12-12 14:55:17 +01001689 t_RSL_IE(RSL_IE_REQ_REFERENCE, RSL_IE_Body:{req_ref := ts_RSL_IE_ReqRef(ra, fn)}),
1690 t_RSL_IE(RSL_IE_ACCESS_DELAY, RSL_IE_Body:{access_delay := acc_del})
Harald Welte643e2a62017-11-27 15:03:18 +01001691 }
1692 }
Harald Welte9abd1282018-02-19 19:18:17 +01001693 template RSL_Message tr_RSL_CHAN_RQD(template OCT1 ra, template GsmFrameNumber fn := ?,
Vadim Yanitskiyab448a52019-05-31 20:24:03 +07001694 template RslChannelNr chan_nr := ts_RslChanNr_RACH(0),
1695 template uint8_t acc_del := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001696 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001697 msg_type := RSL_MT_CHAN_RQD,
1698 ies := {
Vadim Yanitskiyab448a52019-05-31 20:24:03 +07001699 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1700 /* TODO: we may need to have optional RSL_IE_LINK_IDENT IE here */
Harald Welte9abd1282018-02-19 19:18:17 +01001701 tr_RSL_IE(RSL_IE_Body:{req_ref := tr_RSL_IE_ReqRef(ra, fn)}),
1702 tr_RSL_IE(RSL_IE_Body:{access_delay := acc_del})
1703 }
1704 }
Harald Welte643e2a62017-11-27 15:03:18 +01001705
1706 /* 8.5.4 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001707 template (value) RSL_Message ts_DELETE_IND(template (value) RslChannelNr chan_nr,
1708 octetstring imm_ass) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001709 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1710 msg_type := RSL_MT_DELETE_IND,
1711 ies := {
Harald Welte735dd072017-12-12 14:55:17 +01001712 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1713 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 +01001714 }
1715 }
Harald Weltee8d750e2018-06-10 21:41:35 +02001716 template RSL_Message tr_RSL_DELETE_IND(template octetstring imm_ass := ?, template uint3_t tn) := {
1717 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1718 msg_type := RSL_MT_DELETE_IND,
1719 ies := {
1720 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(tn)}),
1721 tr_RSL_IE(RSL_IE_Body:{full_imm_ass_info := tr_RSL_LV(imm_ass)}),
1722 *
1723 }
1724 }
Harald Welte643e2a62017-11-27 15:03:18 +01001725
Harald Weltec2877752017-12-07 17:54:35 +01001726 /* 8.5.5 BSC -> BTS */
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +07001727 template RSL_Message tr_RSL_PAGING_CMD(template MobileIdentityV mi, template uint3_t tn := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001728 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Weltec2877752017-12-07 17:54:35 +01001729 msg_type := RSL_MT_PAGING_CMD,
1730 ies := {
1731 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(tn)}),
1732 tr_RSL_IE(RSL_IE_Body:{paging_group := ?}),
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +07001733 tr_RSL_IE(RSL_IE_Body:{ms_identity := tr_MI_LV(mi)}),
Harald Weltec2877752017-12-07 17:54:35 +01001734 * /* opt: channel needed, eMLPP prio */
1735 }
1736 }
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +07001737 template (value) RSL_Message ts_RSL_PAGING_CMD(MobileIdentityV mi, uint8_t pg, uint3_t tn := 0) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001738 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1739 msg_type := RSL_MT_PAGING_CMD,
1740 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001741 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_PCH_AGCH(tn)}),
Harald Welte9abd1282018-02-19 19:18:17 +01001742 t_RSL_IE(RSL_IE_PAGING_GROUP, RSL_IE_Body:{paging_group := pg}),
Vadim Yanitskiycc4623d2020-03-28 06:14:06 +07001743 t_RSL_IE(RSL_IE_MS_IDENTITY, RSL_IE_Body:{ms_identity := ts_MI_LV(mi)})
Harald Welte9abd1282018-02-19 19:18:17 +01001744 }
1745 }
Harald Weltec2877752017-12-07 17:54:35 +01001746
1747 /* 8.5.6 BSC -> BTS */
1748 template RSL_Message tr_RSL_IMM_ASSIGN(template uint3_t tn := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001749 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Weltec2877752017-12-07 17:54:35 +01001750 msg_type := RSL_MT_IMMEDIATE_ASSIGN_CMD,
1751 ies := {
1752 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(tn)}),
1753 tr_RSL_IE(RSL_IE_Body:{full_imm_ass_info := ?})
1754 }
1755 }
Harald Welteefa7d912018-04-18 23:22:15 +02001756 template (value) RSL_Message ts_RSL_IMM_ASSIGN(octetstring f_ass_inf, uint3_t tn := 0) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001757 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1758 msg_type := RSL_MT_IMMEDIATE_ASSIGN_CMD,
1759 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001760 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_PCH_AGCH(tn)}),
Harald Welte9abd1282018-02-19 19:18:17 +01001761 t_RSL_IE(RSL_IE_FULL_IMM_ASS_INFO, RSL_IE_Body:{full_imm_ass_info := ts_RSL_LV(f_ass_inf)})
1762 }
1763 }
Harald Weltec2877752017-12-07 17:54:35 +01001764
Harald Welte68e495b2018-02-25 00:05:57 +01001765 template RSL_Message tr_RSL_RF_RES_IND := {
Harald Welteefa7d912018-04-18 23:22:15 +02001766 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
Harald Welte68e495b2018-02-25 00:05:57 +01001767 msg_type := RSL_MT_RF_RES_IND,
1768 ies := *
1769 }
1770
Harald Weltecc373202018-09-10 10:28:21 +02001771 /* 8.5.8 BTS <- BSC SMS BROADCAST COMMAND */
1772 template RSL_Message tr_RSL_SMSCB_CMD(template RSL_IE_CbCommandType cb_cmd := ?,
1773 template octetstring msg := ?,
1774 template RslChannelNr chan_nr := ?) := {
1775 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1776 msg_type := RSL_MT_SMS_BC_CMD,
1777 ies := {
1778 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1779 tr_RSL_IE(RSL_IE_Body:{cb_cmd_type := cb_cmd}),
1780 tr_RSL_IE(RSL_IE_Body:{smscb_message := tr_RSL_LV(msg)}),
1781 *
1782 }
1783 }
1784 template (value) RSL_Message ts_RSL_SMSCB_CMD(template (value) RSL_IE_CbCommandType cb_cmd,
1785 template (value) octetstring msg,
1786 template (value) RslChannelNr chan_nr :=
1787 ts_RslChanNr_SDCCH4(0, 2)) := {
1788 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1789 msg_type := RSL_MT_SMS_BC_CMD,
1790 ies := {
1791 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1792 t_RSL_IE(RSL_IE_CB_CMD_TYPE, RSL_IE_Body:{cb_cmd_type := cb_cmd}),
1793 t_RSL_IE(RSL_IE_SMSCB_MSG, RSL_IE_Body:{smscb_message := ts_RSL_LV(msg)})
1794 /* optional channel type for extended CBCH */
1795 }
1796 }
1797
Harald Welte4a129f82019-05-21 16:35:22 +02001798 /* 8.5.9 BTS -> BSC CBCH LOAD INDICATION */
1799 template RSL_Message tr_RSL_CBCH_LOAD_IND_BASIC(template boolean overflow := ?,
1800 template uint4_t slot_count := ?,
1801 template RslChannelNr chan_nr := ?) := {
1802 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1803 msg_type := RSL_MT_CBCH_LOAD_IND,
1804 ies := {
1805 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1806 tr_RSL_IE(RSL_IE_Body:{cbch_load_info := tr_CbchLoadInfo(overflow, slot_count)})
1807 }
1808 }
1809 template (value) RSL_Message ts_RSL_CBCH_LOAD_IND_BASIC(boolean overflow, uint4_t slot_count,
1810 template (value) RslChannelNr chan_nr :=
1811 ts_RslChanNr_SDCCH4(0, 2)) := {
1812 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1813 msg_type := RSL_MT_CBCH_LOAD_IND,
1814 ies := {
1815 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1816 t_RSL_IE(RSL_IE_CBCH_LOAD_INFO, RSL_IE_Body:{cbch_load_info := ts_CbchLoadInfo(overflow, slot_count)})
1817 }
1818 }
1819 template RSL_Message tr_RSL_CBCH_LOAD_IND_EXTD(template boolean overflow := ?,
1820 template uint4_t slot_count := ?,
1821 template RslChannelNr chan_nr := ?) := {
1822 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1823 msg_type := RSL_MT_CBCH_LOAD_IND,
1824 ies := {
1825 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1826 tr_RSL_IE(RSL_IE_Body:{cbch_load_info := tr_CbchLoadInfo(overflow, slot_count)}),
1827 tr_RSL_IE(RSL_IE_Body:{smscb_chan_ind := 1})
1828 }
1829 }
1830 template (value) RSL_Message ts_RSL_CBCH_LOAD_IND_EXTD(boolean overflow, uint4_t slot_count,
1831 template (value) RslChannelNr chan_nr :=
1832 ts_RslChanNr_SDCCH4(0, 2)) := {
1833 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1834 msg_type := RSL_MT_CBCH_LOAD_IND,
1835 ies := {
1836 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1837 t_RSL_IE(RSL_IE_CBCH_LOAD_INFO, RSL_IE_Body:{cbch_load_info := ts_CbchLoadInfo(overflow, slot_count)}),
1838 t_RSL_IE(RSL_IE_SMSCB_CHAN_INDICATOR, RSL_IE_Body:{smscb_chan_ind := 1})
1839 }
1840 }
1841
1842
Harald Welte68e495b2018-02-25 00:05:57 +01001843 /* 8.6.2 BTS <- BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001844 template (value) RSL_Message ts_RSL_SACCH_FILL(RSL_IE_SysinfoType si_type, octetstring l3_info) := {
Harald Welte68e495b2018-02-25 00:05:57 +01001845 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
1846 msg_type := RSL_MT_SACCH_FILL,
1847 ies := {
1848 t_RSL_IE(RSL_IE_SYSINFO_TYPE, RSL_IE_Body:{sysinfo_type := si_type}),
1849 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
1850 }
1851 }
Harald Welte09538f82019-08-01 09:50:25 +02001852 template RSL_Message tr_RSL_NO_SACCH_FILL(template RSL_IE_SysinfoType si_type := ?) := {
1853 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
1854 msg_type := RSL_MT_SACCH_FILL,
1855 ies := {
1856 tr_RSL_IE(RSL_IE_Body:{sysinfo_type := si_type})
1857 }
1858 }
1859 template RSL_Message tr_RSL_SACCH_FILL(template RSL_IE_SysinfoType si_type := ?,
1860 template octetstring l3_info := ?) := {
1861 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
1862 msg_type := RSL_MT_SACCH_FILL,
1863 ies := {
1864 tr_RSL_IE(RSL_IE_Body:{sysinfo_type := si_type}),
1865 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)}),
1866 *
1867 }
1868 }
1869
Harald Welte68e495b2018-02-25 00:05:57 +01001870
Harald Welte643e2a62017-11-27 15:03:18 +01001871 /* 8.6.4 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001872 template (value) RSL_Message ts_RSL_ERROR_REPORT(RSL_Cause cause) := {
Harald Welte01d982c2018-02-25 01:31:40 +01001873 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
1874 msg_type := RSL_MT_ERROR_REPORT,
Harald Welte643e2a62017-11-27 15:03:18 +01001875 ies := {
Harald Welte735dd072017-12-12 14:55:17 +01001876 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
Harald Welte643e2a62017-11-27 15:03:18 +01001877 }
1878 }
Harald Welte01d982c2018-02-25 01:31:40 +01001879 template RSL_Message tr_RSL_ERROR_REPORT(template RSL_Cause cause := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001880 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
Harald Welte01d982c2018-02-25 01:31:40 +01001881 msg_type := RSL_MT_ERROR_REPORT,
1882 ies := {
1883 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)}),
1884 *
1885 }
1886 }
1887
Harald Welte643e2a62017-11-27 15:03:18 +01001888
Harald Welte9958a4d2017-12-14 21:21:33 +01001889
1890 /* Abis/IP specific messages */
1891
1892 template RSL_Message tr_RSL_IPA_CRCX(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001893 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01001894 msg_type := RSL_MT_IPAC_CRCX,
1895 ies := {
1896 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1897 *
1898 }
1899 }
Harald Welteefa7d912018-04-18 23:22:15 +02001900 template (value) RSL_Message ts_RSL_IPA_CRCX(template (value) RslChannelNr chan_nr) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001901 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
1902 msg_type := RSL_MT_IPAC_CRCX,
1903 ies := {
1904 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1905 }
1906 }
1907
Harald Welte9958a4d2017-12-14 21:21:33 +01001908
Harald Welteefa7d912018-04-18 23:22:15 +02001909 template (value) RSL_Message ts_RSL_IPA_CRCX_ACK(template (value) RslChannelNr chan_nr,
1910 uint16_t ipa_conn_id, uint32_t local_ip,
1911 uint16_t local_port, uint7_t rtp_pt2) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01001912 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
1913 msg_type := RSL_MT_IPAC_CRCX_ACK,
1914 ies := {
1915 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1916 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
1917 t_RSL_IE(RSL_IE_IPAC_LOCAL_IP, RSL_IE_Body:{ipa_local_ip := local_ip}),
1918 t_RSL_IE(RSL_IE_IPAC_LOCAL_PORT, RSL_IE_Body:{ipa_local_port := local_port}),
1919 t_RSL_IE(RSL_IE_IPAC_RTP_PAYLOAD2, RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
1920 }
1921 }
Harald Welte9abd1282018-02-19 19:18:17 +01001922 template RSL_Message tr_RSL_IPA_CRCX_ACK(template RslChannelNr chan_nr,
1923 template uint16_t ipa_conn_id,
1924 template uint32_t local_ip,
Harald Welte8bd0f822018-02-25 12:43:28 +01001925 template uint16_t local_port) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001926 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001927 msg_type := RSL_MT_IPAC_CRCX_ACK,
1928 ies := {
1929 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1930 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
1931 tr_RSL_IE(RSL_IE_Body:{ipa_local_ip := local_ip}),
Harald Welte8bd0f822018-02-25 12:43:28 +01001932 tr_RSL_IE(RSL_IE_Body:{ipa_local_port := local_port})
1933 /* Optional: RTP Payload Type 2 IE */
Harald Welte9abd1282018-02-19 19:18:17 +01001934 }
1935 }
Harald Welte9958a4d2017-12-14 21:21:33 +01001936
Harald Welteefa7d912018-04-18 23:22:15 +02001937 template (value) RSL_Message ts_RSL_IPA_CRCX_NACK(template (value) RslChannelNr chan_nr,
1938 RSL_Cause cause) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01001939 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
1940 msg_type := RSL_MT_IPAC_CRCX_NACK,
1941 ies := {
1942 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1943 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
1944 }
1945 }
Harald Welte9abd1282018-02-19 19:18:17 +01001946 template RSL_Message tr_RSL_IPA_CRCX_NACK(template RslChannelNr chan_nr,
1947 template RSL_Cause cause := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001948 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001949 msg_type := RSL_MT_IPAC_CRCX_NACK,
1950 ies := {
1951 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1952 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
1953 }
1954 }
Harald Welte9958a4d2017-12-14 21:21:33 +01001955
Harald Welteefa7d912018-04-18 23:22:15 +02001956 template (value) RSL_Message ts_RSL_IPA_MDCX(template (value) RslChannelNr chan_nr,
1957 uint16_t ipa_conn_id,
1958 uint32_t remote_ip, uint16_t remote_port,
1959 uint7_t rtp_pt2) := {
Harald Welte30527452018-02-25 12:46:25 +01001960 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
1961 msg_type := RSL_MT_IPAC_MDCX,
1962 ies := {
1963 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1964 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
1965 t_RSL_IE(RSL_IE_IPAC_REMOTE_IP, RSL_IE_Body:{ipa_remote_ip := remote_ip}),
1966 t_RSL_IE(RSL_IE_IPAC_REMOTE_PORT, RSL_IE_Body:{ipa_remote_port := remote_port}),
1967 /* optional: RTP Payload Type */
1968 t_RSL_IE(RSL_IE_IPAC_RTP_PAYLOAD2, RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
1969 }
1970 }
Harald Welte9958a4d2017-12-14 21:21:33 +01001971 template RSL_Message tr_RSL_IPA_MDCX(template RslChannelNr chan_nr,
1972 template uint16_t ipa_conn_id) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001973 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01001974 msg_type := RSL_MT_IPAC_MDCX,
1975 ies := {
1976 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1977 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
1978 *
1979 }
1980 }
1981
Harald Welteefa7d912018-04-18 23:22:15 +02001982 template (value) RSL_Message ts_RSL_IPA_MDCX_ACK(template (value) RslChannelNr chan_nr,
1983 uint16_t ipa_conn_id,
1984 uint32_t local_ip, uint16_t local_port,
1985 uint7_t rtp_pt2) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01001986 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte71b5ec82017-12-16 23:01:10 +01001987 msg_type := RSL_MT_IPAC_MDCX_ACK,
Harald Welte9958a4d2017-12-14 21:21:33 +01001988 ies := {
1989 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1990 /* optional */
1991 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
Harald Welte6cb400a2018-02-25 12:45:25 +01001992 t_RSL_IE(RSL_IE_IPAC_LOCAL_IP, RSL_IE_Body:{ipa_local_ip := local_ip}),
1993 t_RSL_IE(RSL_IE_IPAC_LOCAL_PORT, RSL_IE_Body:{ipa_local_port := local_port}),
Harald Welte9958a4d2017-12-14 21:21:33 +01001994 /* optional: RTP Payload Type */
1995 t_RSL_IE(RSL_IE_IPAC_RTP_PAYLOAD2, RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
1996 }
1997 }
Harald Welte30527452018-02-25 12:46:25 +01001998 template RSL_Message tr_RSL_IPA_MDCX_ACK(template RslChannelNr chan_nr,
1999 template uint16_t ipa_conn_id,
2000 template uint32_t local_ip,
2001 template uint16_t local_port,
2002 template uint7_t rtp_pt2) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002003 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte30527452018-02-25 12:46:25 +01002004 msg_type := RSL_MT_IPAC_MDCX_ACK,
2005 ies := {
2006 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2007 /* optional */
2008 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2009 tr_RSL_IE(RSL_IE_Body:{ipa_local_ip := local_ip}),
2010 tr_RSL_IE(RSL_IE_Body:{ipa_local_port := local_port}),
2011 /* optional: RTP Payload Type */
2012 tr_RSL_IE(RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
2013 }
2014 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002015
Harald Welteefa7d912018-04-18 23:22:15 +02002016 template (value) RSL_Message ts_RSL_IPA_MDCX_NACK(template (value) RslChannelNr chan_nr,
2017 RSL_Cause cause,
2018 template (value) uint16_t ipa_conn_id) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002019 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2020 msg_type := RSL_MT_IPAC_MDCX_NACK,
2021 ies := {
2022 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2023 /* optional connection ID */
2024 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2025 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2026 }
2027 }
Harald Welte30527452018-02-25 12:46:25 +01002028 template RSL_Message tr_RSL_IPA_MDCX_NACK(template RslChannelNr chan_nr,
2029 template RSL_Cause cause,
2030 template uint16_t ipa_conn_id) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002031 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte30527452018-02-25 12:46:25 +01002032 msg_type := RSL_MT_IPAC_MDCX_NACK,
2033 ies := {
2034 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2035 /* optional connection ID */
2036 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2037 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
2038 }
2039 }
2040
Harald Welte9958a4d2017-12-14 21:21:33 +01002041
Harald Welteefa7d912018-04-18 23:22:15 +02002042 template (value) RSL_Message ts_RSL_IPA_DLCX_IND(template (value) RslChannelNr chan_nr,
2043 uint16_t ipa_conn_id,
2044 template (value) RSL_IE_IPA_ConnectionStats stats,
2045 RSL_Cause cause) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002046 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2047 msg_type := RSL_MT_IPAC_DLCX_IND,
2048 ies := {
2049 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2050 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2051 t_RSL_IE(RSL_IE_IPAC_CONN_STAT, RSL_IE_Body:{ipa_stats := stats}),
2052 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2053 }
2054 }
2055
Harald Welteefa7d912018-04-18 23:22:15 +02002056 template (value) RSL_Message ts_RSL_IPA_DLCX(template (value) RslChannelNr chan_nr,
2057 uint16_t ipa_conn_id) := {
Harald Weltea871a382018-02-25 02:03:14 +01002058 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2059 msg_type := RSL_MT_IPAC_DLCX,
2060 ies := {
Harald Welte2a7e7162018-02-25 12:46:48 +01002061 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2062 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id})
Harald Weltea871a382018-02-25 02:03:14 +01002063 }
2064 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002065 template RSL_Message tr_RSL_IPA_DLCX(template RslChannelNr chan_nr,
2066 template uint16_t ipa_conn_id := omit) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002067 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002068 msg_type := RSL_MT_IPAC_DLCX,
2069 ies := {
2070 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2071 /* FIXME: optional conn_id */
2072 *
2073 }
2074 }
2075
Harald Welteefa7d912018-04-18 23:22:15 +02002076 template (value) RSL_Message ts_RSL_IPA_DLCX_ACK(template (value) RslChannelNr chan_nr,
2077 uint16_t ipa_conn_id,
2078 RSL_IE_IPA_ConnectionStats stats) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002079 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2080 msg_type := RSL_MT_IPAC_DLCX_ACK,
2081 ies := {
2082 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2083 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2084 t_RSL_IE(RSL_IE_IPAC_CONN_STAT, RSL_IE_Body:{ipa_stats := stats})
2085 }
2086 }
Harald Weltea871a382018-02-25 02:03:14 +01002087 template RSL_Message tr_RSL_IPA_DLCX_ACK(template RslChannelNr chan_nr,
2088 template uint16_t ipa_conn_id,
2089 template RSL_IE_IPA_ConnectionStats stats) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002090 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Weltea871a382018-02-25 02:03:14 +01002091 msg_type := RSL_MT_IPAC_DLCX_ACK,
2092 ies := {
2093 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2094 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2095 tr_RSL_IE(RSL_IE_Body:{ipa_stats := stats})
2096 }
2097 }
2098
2099
Harald Welte9958a4d2017-12-14 21:21:33 +01002100
Harald Welteefa7d912018-04-18 23:22:15 +02002101 template (value) RSL_Message ts_RSL_IPA_DLCX_NACK(template (value) RslChannelNr chan_nr,
2102 RSL_Cause cause, uint16_t ipa_conn_id) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01002103 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
2104 msg_type := RSL_MT_IPAC_DLCX_NACK,
2105 ies := {
2106 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2107 /* optional connection ID */
2108 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
2109 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2110 }
2111 }
Harald Weltea871a382018-02-25 02:03:14 +01002112 template RSL_Message tr_RSL_IPA_DLCX_NACK(template RslChannelNr chan_nr,
2113 template RSL_Cause cause) := {
Harald Welteefa7d912018-04-18 23:22:15 +02002114 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Weltea871a382018-02-25 02:03:14 +01002115 msg_type := RSL_MT_IPAC_DLCX_NACK,
2116 ies := {
2117 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2118 /* optional connection ID */
2119 *,
2120 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
2121 }
2122 }
2123
Harald Welte9958a4d2017-12-14 21:21:33 +01002124
Harald Welteefa7d912018-04-18 23:22:15 +02002125 template (value) RSL_Message ts_RSL_IPA_PDCH_ACT(RslChannelNr chan_nr) := {
Harald Welteee19c732018-04-05 09:08:26 +02002126 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2127 msg_type := RSL_MT_IPAC_PDCH_ACT,
2128 ies := {
2129 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
2130 }
2131 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002132 template RSL_Message tr_RSL_IPA_PDCH_ACT(template RslChannelNr chan_nr) := {
Harald Welteee19c732018-04-05 09:08:26 +02002133 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002134 msg_type := RSL_MT_IPAC_PDCH_ACT,
2135 ies := {
2136 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
2137 }
2138 }
2139
Harald Welteee19c732018-04-05 09:08:26 +02002140
Harald Welte94e0c342018-04-07 11:33:23 +02002141 template RSL_Message ts_RSL_IPA_PDCH_ACT_ACK(RslChannelNr chan_nr,
2142 template (value) RSL_IE_FrameNumber fn) := {
Harald Welteee19c732018-04-05 09:08:26 +02002143 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002144 msg_type := RSL_MT_IPAC_PDCH_ACT_ACK,
2145 ies := {
2146 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2147 t_RSL_IE(RSL_IE_FRAME_NUMBER, RSL_IE_Body:{frame_nr := fn})
2148 }
2149 }
Harald Welteee19c732018-04-05 09:08:26 +02002150 template RSL_Message tr_RSL_IPA_PDCH_ACT_ACK(template RslChannelNr chan_nr,
2151 template RSL_IE_FrameNumber fn) := {
2152 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2153 msg_type := RSL_MT_IPAC_PDCH_ACT_ACK,
2154 ies := {
2155 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2156 tr_RSL_IE(RSL_IE_Body:{frame_nr := fn})
2157 }
2158 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002159
2160 template RSL_Message ts_RSL_IPA_PDCH_ACT_NACK(RslChannelNr chan_nr, RSL_Cause cause) := {
Harald Welteee19c732018-04-05 09:08:26 +02002161 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002162 msg_type := RSL_MT_IPAC_PDCH_ACT_NACK,
2163 ies := {
2164 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2165 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2166 }
2167 }
Harald Welteee19c732018-04-05 09:08:26 +02002168 template RSL_Message tr_RSL_IPA_PDCH_ACT_NACK(template RslChannelNr chan_nr,
2169 template RSL_Cause cause) := {
2170 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2171 msg_type := RSL_MT_IPAC_PDCH_ACT_NACK,
2172 ies := {
2173 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2174 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
2175 }
2176 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002177
Harald Welteee19c732018-04-05 09:08:26 +02002178 template RSL_Message ts_RSL_IPA_PDCH_DEACT(RslChannelNr chan_nr) := {
2179 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2180 msg_type := RSL_MT_IPAC_PDCH_DEACT,
2181 ies := {
2182 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
2183 }
2184 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002185 template RSL_Message tr_RSL_IPA_PDCH_DEACT(template RslChannelNr chan_nr) := {
Harald Welteee19c732018-04-05 09:08:26 +02002186 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002187 msg_type := RSL_MT_IPAC_PDCH_DEACT,
2188 ies := {
2189 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
2190 }
2191 }
2192
2193 template RSL_Message ts_RSL_IPA_PDCH_DEACT_ACK(RslChannelNr chan_nr) := {
Harald Welteee19c732018-04-05 09:08:26 +02002194 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002195 msg_type := RSL_MT_IPAC_PDCH_DEACT_ACK,
2196 ies := {
2197 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
2198 }
2199 }
Harald Welteee19c732018-04-05 09:08:26 +02002200 template RSL_Message tr_RSL_IPA_PDCH_DEACT_ACK(template RslChannelNr chan_nr) := {
2201 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2202 msg_type := RSL_MT_IPAC_PDCH_DEACT_ACK,
2203 ies := {
2204 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
2205 }
2206 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002207
2208 template RSL_Message ts_RSL_IPA_PDCH_DEACT_NACK(RslChannelNr chan_nr, RSL_Cause cause) := {
Harald Welteee19c732018-04-05 09:08:26 +02002209 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01002210 msg_type := RSL_MT_IPAC_PDCH_DEACT_NACK,
2211 ies := {
2212 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2213 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
2214 }
2215 }
Harald Welteee19c732018-04-05 09:08:26 +02002216 template RSL_Message tr_RSL_IPA_PDCH_DEACT_NACK(template RslChannelNr chan_nr,
2217 template RSL_Cause cause) := {
2218 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
2219 msg_type := RSL_MT_IPAC_PDCH_DEACT_NACK,
2220 ies := {
2221 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2222 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
2223 }
2224 }
Harald Welte9958a4d2017-12-14 21:21:33 +01002225
Harald Welte908ce542019-09-04 23:05:40 +02002226 template (value) RSL_Message ts_RSL_OSMO_ETWS_CMD(template (value) octetstring msg,
2227 template (value) RslChannelNr chan_nr := ts_RslChanNr_PCH_AGCH(0)) := {
2228 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2229 msg_type := RSL_MT_OSMO_ETWS_CMD,
2230 ies := {
2231 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
2232 t_RSL_IE(RSL_IE_SMSCB_MSG, RSL_IE_Body:{smscb_message := ts_RSL_LV(msg)})
2233 }
2234 }
2235 template RSL_Message tr_RSL_OSMO_ETWS_CMD(template RslChannelNr chan_nr := ?,
2236 template octetstring msg := ?) := {
2237 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
2238 msg_type := RSL_MT_OSMO_ETWS_CMD,
2239 ies := {
2240 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
2241 tr_RSL_IE(RSL_IE_Body:{smscb_message := tr_RSL_LV(msg)})
2242 }
2243 }
2244
2245
Harald Welte9958a4d2017-12-14 21:21:33 +01002246
Harald Welte6a8199d2018-01-29 21:58:53 +01002247 function f_rsl_find_ie(RSL_Message msg, RSL_IE_Type iei, out RSL_IE_Body ret) return boolean {
2248 for (var integer i := 0; i < sizeof(msg.ies); i := i+1) {
2249 if (msg.ies[i].iei == iei) {
2250 ret := msg.ies[i].body;
2251 return true;
2252 }
2253 }
2254 return false;
2255 }
2256
2257
Harald Welte9958a4d2017-12-14 21:21:33 +01002258
Harald Welte643e2a62017-11-27 15:03:18 +01002259} with { encode "RAW" ; variant "FIELDORDER(msb)" }