blob: 74de46a44f7964aff4be7b99fce00b4ed4706232 [file] [log] [blame]
Harald Welte643e2a62017-11-27 15:03:18 +01001module RSL_Types {
2
Harald Welte35bb7162018-01-03 21:07:52 +01003/* GSUP_Types, defining abstract TTCN-3 data types for the A-bis RSL protocol.
4 *
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.
12 */
13
Harald Welte643e2a62017-11-27 15:03:18 +010014 import from General_Types all;
15 import from Osmocom_Types all;
16 import from GSM_Types all;
17
18 /* Section 9.1 */
19 type enumerated RSL_MessageGroup {
20 RSL_MDISC_RESERVED ('0000000'B),
21 RSL_MDISC_RLL ('0000001'B),
22 RSL_MDISC_DCHAN ('0000100'B),
23 RSL_MDISC_CCHAN ('0000110'B),
24 RSL_MDISC_TRX_MGMT ('0001000'B),
25 RSL_MDISC_LCS ('0010000'B),
26 RSL_MDISC_IPACCESS ('0111111'B)
27 } with { variant "FIELDLENGTH(7)" };
28
29 /* Section 9.1 */
30 type record RSL_MessageDiscriminator {
31 RSL_MessageGroup msg_group,
32 boolean transparent
33 } with { variant "FIELDORDER(msb)" };
34
Harald Welteefa7d912018-04-18 23:22:15 +020035 template (value) RSL_MessageDiscriminator ts_RSL_MsgDisc(RSL_MessageGroup mg, boolean t := true) := {
Harald Welte643e2a62017-11-27 15:03:18 +010036 msg_group := mg,
37 transparent := t
38 }
Harald Welteefa7d912018-04-18 23:22:15 +020039 template RSL_MessageDiscriminator tr_RSL_MsgDisc(template RSL_MessageGroup mg, boolean t := true) := {
40 msg_group := mg,
41 transparent := t
42 }
43
Harald Welte643e2a62017-11-27 15:03:18 +010044
45 /* Section 9.2 */
46 type enumerated RSL_MessageType {
47 /* Radio Link Layer Management */
48 RSL_MT_DATA_REQ ('00000001'B),
49 RSL_MT_DATA_IND ('00000010'B),
50 RSL_MT_ERROR_IND ('00000011'B),
51 RSL_MT_EST_REQ ('00000100'B),
52 RSL_MT_EST_CONF ('00000101'B),
53 RSL_MT_EST_IND ('00000110'B),
54 RSL_MT_REL_REQ ('00000111'B),
55 RSL_MT_REL_CONF ('00001000'B),
56 RSL_MT_REL_IND ('00001001'B),
57 RSL_MT_UNIT_DATA_REQ ('00001010'B),
58 RSL_MT_UNIT_DATA_IND ('00001011'B),
59
60 /* non-standard below */
61 RSL_MT_SUSP_REQ ('00001100'B),
62 RSL_MT_SUSP_CONF ('00001101'B),
63 RSL_MT_RES_REQ ('00001110'B),
64 RSL_MT_RECON_REQ ('00001111'B),
65
66 /* Common Channel Management / TRX Management */
67 RSL_MT_BCCH_INFO ('00010001'B),
Harald Welte319be822017-12-07 17:50:26 +010068 RSL_MT_CCCH_LOAD_IND ('00010010'B),
69 RSL_MT_CHAN_RQD ('00010011'B),
70 RSL_MT_DELETE_IND ('00010100'B),
71 RSL_MT_PAGING_CMD ('00010101'B),
72 RSL_MT_IMMEDIATE_ASSIGN_CMD ('00010110'B),
73 RSL_MT_SMS_BC_REQ ('00010111'B),
74 RSL_MT_CHAN_CONF ('00011000'B), /* non-standard element */
Harald Welte643e2a62017-11-27 15:03:18 +010075 /* empty */
76 RSL_MT_RF_RES_IND ('00011001'B),
Harald Welte319be822017-12-07 17:50:26 +010077 RSL_MT_SACCH_FILL ('00011010'B),
78 RSL_MT_OVERLOAD ('00011011'B),
79 RSL_MT_ERROR_REPORT ('00011100'B),
80 RSL_MT_SMS_BC_CMD ('00011101'B),
81 RSL_MT_CBCH_LOAD_IND ('00011110'B),
82 RSL_MT_NOT_CMD ('00011111'B),
Harald Welte643e2a62017-11-27 15:03:18 +010083
84 /* Dedicate Channel Management */
85 RSL_MT_CHAN_ACTIV ('00100001'B),
Harald Welte319be822017-12-07 17:50:26 +010086 RSL_MT_CHAN_ACTIV_ACK ('00100010'B),
87 RSL_MT_CHAN_ACTIV_NACK ('00100011'B),
88 RSL_MT_CONN_FAIL ('00100100'B),
89 RSL_MT_DEACTIVATE_SACCH ('00100101'B),
90 RSL_MT_ENCR_CMD ('00100110'B),
91 RSL_MT_HANDO_DET ('00100111'B),
92 RSL_MT_MEAS_RES ('00101000'B),
93 RSL_MT_MODE_MODIFY_REQ ('00101001'B),
94 RSL_MT_MODE_MODIFY_ACK ('00101010'B),
95 RSL_MT_MODE_MODIFY_NACK ('00101011'B),
96 RSL_MT_PHY_CONTEXT_REQ ('00101100'B),
97 RSL_MT_PHY_CONTEXT_CONF ('00101101'B),
98 RSL_MT_RF_CHAN_REL ('00101110'B),
99 RSL_MT_MS_POWER_CONTROL ('00101111'B),
100 RSL_MT_BS_POWER_CONTROL ('00110000'B), /* 0x30 */
101 RSL_MT_PREPROC_CONFIG ('00110001'B),
102 RSL_MT_PREPROC_MEAS_RES ('00110010'B),
103 RSL_MT_RF_CHAN_REL_ACK ('00110011'B),
104 RSL_MT_SACCH_INFO_MODIFY('00110100'B),
105 RSL_MT_TALKER_DET ('00110101'B),
106 RSL_MT_LISTENER_DET ('00110110'B),
107 RSL_MT_REMOTE_CODEC_CONF_REP ('00110111'B),
108 RSL_MT_RTD_REP ('00111000'B),
109 RSL_MT_PRE_HANDO_NOTIF ('00111001'B),
110 RSL_MT_MR_CODEC_MOD_REQ ('00111010'B),
111 RSL_MT_MR_CODEC_MOD_ACK ('00111011'B),
112 RSL_MT_MR_CODEC_MOD_NACK ('00111100'B),
113 RSL_MT_MR_CODEC_MOD_PER ('00111101'B),
114 RSL_MT_TFO_REP ('00111110'B),
115 RSL_MT_TFO_MOD_REQ ('00111111'B), /* 0x3f */
Harald Welte643e2a62017-11-27 15:03:18 +0100116
117 RSL_MT_LOCATION_INFO ('01000001'B),
118
119 /* ip.access specific RSL message types */
120 RSL_MT_IPAC_DIR_RETR_ENQ ('01000000'B),
121
122 RSL_MT_IPAC_PDCH_ACT ('01001000'B),
Harald Welte319be822017-12-07 17:50:26 +0100123 RSL_MT_IPAC_PDCH_ACT_ACK ('01001001'B),
124 RSL_MT_IPAC_PDCH_ACT_NACK ('01001010'B),
Harald Welte643e2a62017-11-27 15:03:18 +0100125 RSL_MT_IPAC_PDCH_DEACT ('01001011'B),
Harald Welte319be822017-12-07 17:50:26 +0100126 RSL_MT_IPAC_PDCH_DEACT_ACK ('01001100'B),
127 RSL_MT_IPAC_PDCH_DEACT_NACK ('01001101'B),
Harald Welte643e2a62017-11-27 15:03:18 +0100128
129 RSL_MT_IPAC_CONNECT_MUX ('01010000'B),
Harald Weltef3075002017-12-16 22:31:41 +0100130 RSL_MT_IPAC_CONNECT_MUX_ACK ('01010001'B),
131 RSL_MT_IPAC_CONNECT_MUX_NACK ('01010010'B),
132 RSL_MT_IPAC_BIND_MUX ('01010011'B),
133 RSL_MT_IPAC_BIND_MUX_ACK ('01010100'B),
134 RSL_MT_IPAC_BIND_MUX_NACK ('01010101'B),
135 RSL_MT_IPAC_DISC_MUX ('01010110'B),
136 RSL_MT_IPAC_DISC_MUX_ACK ('01010111'B),
137 RSL_MT_IPAC_DISC_MUX_NACK ('01011000'B),
Harald Welte643e2a62017-11-27 15:03:18 +0100138 RSL_MT_IPAC_MEAS_PREPROC_DFT ('01100000'B),
Harald Weltef3075002017-12-16 22:31:41 +0100139 RSL_MT_IPAC_HO_CAN_ENQ ('01100001'B),
140 RSL_MT_IPAC_HO_CAN_RES ('01100010'B),
141 RSL_MT_IPAC_CRCX ('01110000'B),
142 RSL_MT_IPAC_CRCX_ACK ('01110001'B),
143 RSL_MT_IPAC_CRCX_NACK ('01110010'B),
144 RSL_MT_IPAC_MDCX ('01110011'B),
145 RSL_MT_IPAC_MDCX_ACK ('01110100'B),
146 RSL_MT_IPAC_MDCX_NACK ('01110101'B),
147 RSL_MT_IPAC_DLCX_IND ('01110110'B),
148 RSL_MT_IPAC_DLCX ('01110111'B),
149 RSL_MT_IPAC_DLCX_ACK ('01111000'B),
150 RSL_MT_IPAC_DLCX_NACK ('01111001'B)
Harald Welte643e2a62017-11-27 15:03:18 +0100151 } with { variant "FIELDLENGTH(8)" };
152
153 /*! RSL Information Element Identifiers (Chapter 9.3) */
154 type enumerated RSL_IE_Type {
155 RSL_IE_CHAN_NR ('00000001'B),
Harald Welte319be822017-12-07 17:50:26 +0100156 RSL_IE_LINK_IDENT ('00000010'B),
157 RSL_IE_ACT_TYPE ('00000011'B),
158 RSL_IE_BS_POWER ('00000100'B),
159 RSL_IE_CHAN_IDENT ('00000101'B),
160 RSL_IE_CHAN_MODE ('00000110'B),
161 RSL_IE_ENCR_INFO ('00000111'B),
162 RSL_IE_FRAME_NUMBER ('00001000'B),
163 RSL_IE_HANDO_REF ('00001001'B),
164 RSL_IE_L1_INFO ('00001010'B),
165 RSL_IE_L3_INFO ('00001011'B),
166 RSL_IE_MS_IDENTITY ('00001100'B),
167 RSL_IE_MS_POWER ('00001101'B),
168 RSL_IE_PAGING_GROUP ('00001110'B),
169 RSL_IE_PAGING_LOAD ('00001111'B),
170 RSL_IE_PYHS_CONTEXT ('00010000'B),
171 RSL_IE_ACCESS_DELAY ('00010001'B),
172 RSL_IE_RACH_LOAD ('00010010'B),
173 RSL_IE_REQ_REFERENCE ('00010011'B),
174 RSL_IE_RELEASE_MODE ('00010100'B),
175 RSL_IE_RESOURCE_INFO ('00010101'B),
176 RSL_IE_RLM_CAUSE ('00010110'B),
177 RSL_IE_STARTNG_TIME ('00010111'B),
178 RSL_IE_TIMING_ADVANCE ('00011000'B),
179 RSL_IE_UPLINK_MEAS ('00011001'B),
180 RSL_IE_CAUSE ('00011010'B),
181 RSL_IE_MEAS_RES_NR ('00011011'B),
182 RSL_IE_MSG_ID ('00011100'B),
Harald Welte643e2a62017-11-27 15:03:18 +0100183 /* reserved */
184 RSL_IE_SYSINFO_TYPE ('00011110'B),
Harald Welte319be822017-12-07 17:50:26 +0100185 RSL_IE_MS_POWER_PARAM ('00011111'B),
186 RSL_IE_BS_POWER_PARAM ('00100000'B),
187 RSL_IE_PREPROC_PARAM ('00100001'B),
188 RSL_IE_PREPROC_MEAS ('00100010'B),
189 RSL_IE_IMM_ASS_INFO ('00100011'B),/* Phase 1 (3.6.0), later Full below */
190 RSL_IE_SMSCB_INFO ('00100100'B),
191 RSL_IE_MS_TIMING_OFFSET ('00100101'B),
192 RSL_IE_ERR_MSG ('00100110'B),
193 RSL_IE_FULL_BCCH_INFO ('00100111'B),
194 RSL_IE_CHAN_NEEDED ('00101000'B),
195 RSL_IE_CB_CMD_TYPE ('00101001'B),
196 RSL_IE_SMSCB_MSG ('00101010'B),
197 RSL_IE_FULL_IMM_ASS_INFO ('00101011'B),
198 RSL_IE_SACCH_INFO ('00101100'B),
199 RSL_IE_CBCH_LOAD_INFO ('00101101'B),
200 RSL_IE_SMSCB_CHAN_INDICATOR ('00101110'B),
201 RSL_IE_GROUP_CALL_REF ('00101111'B),
202 RSL_IE_CHAN_DESC ('00110000'B),
203 RSL_IE_NCH_DRX_INFO ('00110001'B),
204 RSL_IE_CMD_INDICATOR ('00110010'B),
205 RSL_IE_EMLPP_PRIO ('00110011'B),
206 RSL_IE_UIC ('00110100'B),
207 RSL_IE_MAIN_CHAN_REF ('00110101'B),
208 RSL_IE_MR_CONFIG ('00110110'B),
209 RSL_IE_MR_CONTROL ('00110111'B),
210 RSL_IE_SUP_CODEC_TYPES ('00111000'B),
211 RSL_IE_CODEC_CONFIG ('00111001'B),
212 RSL_IE_RTD ('00111010'B),
213 RSL_IE_TFO_STATUS ('00111011'B),
214 RSL_IE_LLP_APDU ('00111100'B),
Harald Welte643e2a62017-11-27 15:03:18 +0100215
216 /* ip.access */
217 RSL_IE_IPAC_SRTP_CONFIG ('11100000'B),
Harald Welte319be822017-12-07 17:50:26 +0100218 RSL_IE_IPAC_PROXY_UDP ('11100001'B),
219 RSL_IE_IPAC_BSCMPL_TOUT ('11100010'B),
Harald Welte643e2a62017-11-27 15:03:18 +0100220
221 RSL_IE_IPAC_REMOTE_IP ('11110000'B),
Harald Welte319be822017-12-07 17:50:26 +0100222 RSL_IE_IPAC_REMOTE_PORT ('11110001'B),
223 RSL_IE_IPAC_RTP_PAYLOAD ('11110010'B),
224 RSL_IE_IPAC_LOCAL_PORT ('11110011'B),
225 RSL_IE_IPAC_SPEECH_MODE ('11110100'B),
226 RSL_IE_IPAC_LOCAL_IP ('11110101'B),
227 RSL_IE_IPAC_CONN_STAT ('11110110'B),
228 RSL_IE_IPAC_HO_C_PARMS ('11110111'B),
229 RSL_IE_IPAC_CONN_ID ('11111000'B),
230 RSL_IE_IPAC_RTP_CSD_FMT ('11111001'B),
231 RSL_IE_IPAC_RTP_JIT_BUF ('11111010'B),
232 RSL_IE_IPAC_RTP_COMPR ('11111011'B),
233 RSL_IE_IPAC_RTP_PAYLOAD2 ('11111100'B),
234 RSL_IE_IPAC_RTP_MPLEX ('11111101'B),
235 RSL_IE_IPAC_RTP_MPLEX_ID ('11111110'B)
Harald Welte643e2a62017-11-27 15:03:18 +0100236 } with { variant "FIELDLENGTH(8)" };
237
238 type record RSL_LV {
239 uint8_t len,
240 octetstring payload
241 } with { variant (len) "LENGTHTO(payload)" }
242
Harald Welteefa7d912018-04-18 23:22:15 +0200243 template (value) RSL_LV ts_RSL_LV(template (value) octetstring pl) := {
Harald Welte643e2a62017-11-27 15:03:18 +0100244 len := 0,
245 payload := pl
246 }
247
Harald Welte51d74102017-12-10 23:05:02 +0100248 template RSL_LV tr_RSL_LV(template octetstring pl) := {
249 len := ?,
250 payload := pl
251 }
252
Harald Welte15bb5b52017-12-07 17:52:04 +0100253 type record RSL_L16V {
254 uint16_t len,
255 octetstring payload
256 } with { variant (len) "LENGTHTO(payload)" }
257
Harald Welteefa7d912018-04-18 23:22:15 +0200258 template (value) RSL_L16V ts_RSL_L16V(template (value) octetstring pl) := {
Harald Welte15bb5b52017-12-07 17:52:04 +0100259 len := 0,
260 payload := pl
261 }
262
Harald Welte7794d5b2017-12-16 23:00:20 +0100263 template RSL_L16V tr_RSL_L16V(template octetstring pl) := {
264 len := ?,
265 payload := pl
266 }
267
Harald Welte643e2a62017-11-27 15:03:18 +0100268 type record RSL_IE_V {
269 uint8_t val
270 }
271
272 /* 9.3.3 */
273 type record RSL_IE_ActivationType {
274 boolean reactivation,
275 uint4_t reserved,
Harald Welte921f9e02019-05-19 22:27:11 +0200276 RSL_ActivationAbits a_bits
277 };
278 type enumerated RSL_ActivationAbits {
279 ACT_REL_TO_IMM_ASSIGN ('000'B),
280 ACT_REL_TO_NORM_ASSIGN ('001'B),
281 ACT_REL_TO_ASYNC_HANDOVER ('010'B),
282 ACT_REL_TO_SYNC_HANDOVER ('011'B),
283 ACT_REL_TO_ADDL_ASSIGN ('100'B),
284 ACT_REL_TO_MSLOT_CONFIG ('101'B),
285 ACT_REL_TO_OSMO_PDCH ('111'B)
286 } with { variant "FIELDLENGTH(3)" };
Harald Welte643e2a62017-11-27 15:03:18 +0100287
Harald Welte921f9e02019-05-19 22:27:11 +0200288 const RSL_IE_ActivationType t_RSL_IE_ActType_IA := {
Harald Welte643e2a62017-11-27 15:03:18 +0100289 reactivation := false,
290 reserved := 0,
Harald Welte921f9e02019-05-19 22:27:11 +0200291 a_bits := ACT_REL_TO_IMM_ASSIGN
292 }
293 const RSL_IE_ActivationType t_RSL_IE_ActType_ASS := {
294 reactivation := false,
295 reserved := 0,
296 a_bits := ACT_REL_TO_NORM_ASSIGN
297 }
298 const RSL_IE_ActivationType t_RSL_IE_ActType_HO_ASYNC := {
299 reactivation := false,
300 reserved := 0,
301 a_bits := ACT_REL_TO_ASYNC_HANDOVER
302 }
303 const RSL_IE_ActivationType t_RSL_IE_ActType_HO_SYNC := {
304 reactivation := false,
305 reserved := 0,
306 a_bits := ACT_REL_TO_SYNC_HANDOVER
Harald Welte643e2a62017-11-27 15:03:18 +0100307 }
308
Harald Welte94e0c342018-04-07 11:33:23 +0200309 /* osmocom-style dynamic PDCH */
Harald Welte921f9e02019-05-19 22:27:11 +0200310 const RSL_IE_ActivationType t_RSL_IE_ActType_PDCH := {
Harald Welte94e0c342018-04-07 11:33:23 +0200311 reactivation := false,
312 reserved := 1,
Harald Welte921f9e02019-05-19 22:27:11 +0200313 a_bits := ACT_REL_TO_OSMO_PDCH
Harald Welte94e0c342018-04-07 11:33:23 +0200314 }
315
Harald Welte643e2a62017-11-27 15:03:18 +0100316 /* 9.3.6 */
317 type enumerated RSL_SpeechDataInd {
318 RSL_SPDI_SPEECH ('00000001'B),
319 RSL_SPDI_DATA ('00000010'B),
320 RSL_SPDI_SIGN ('00000011'B)
321 } with { variant "FIELDLENGTH(8)" };
322 type enumerated RSL_ChanRateType {
323 RSL_CHRT_SDCCH ('00000001'B),
324 RSL_CHRT_TCH_F ('00001000'B),
325 RSL_CHRT_TCH_H ('00001001'B),
326 RSL_CHRT_TCH_F_BD_MSLOT ('00001010'B),
327 RSL_CHRT_TCH_F_DL_MSLOT ('00011010'B),
328 RSL_CHRT_TCH_F_GROUP ('00011000'B),
329 RSL_CHRT_TCH_H_GROUP ('00011001'B),
330 RSL_CHRT_TCH_F_BCAST ('00101000'B),
331 RSL_CHRT_TCH_H_BCAST ('00101001'B)
332 } with { variant "FIELDLENGTH(8)" };
333 type enumerated RSL_SpeechAlgo {
334 RSL_CMOD_NO_RESOURCE ('00000000'B),
335 RSL_CMOD_SP_GSM1 ('00000001'B),
336 RSL_CMOD_SP_GSM2 ('00010001'B),
337 RSL_CMOD_SP_GSM3 ('00100001'B),
338 RSL_CMOD_SP_GSM4 ('00110001'B),
339 RSL_CMOD_SP_GSM5 ('00001001'B),
340 RSL_CMOD_SP_GSM6 ('00001101'B)
341 } with { variant "FIELDLENGTH(8)" };
342 type record RSL_IE_ChannelMode {
Harald Welte8f2c21d2017-12-07 17:52:40 +0100343 uint8_t len,
Harald Welte643e2a62017-11-27 15:03:18 +0100344 BIT6 reserved,
345 boolean dtx_d,
346 boolean dtx_u,
347 RSL_SpeechDataInd spd_ind,
348 RSL_ChanRateType ch_rate_type,
349 RSL_SpeechAlgo coding_alg_rate
Harald Welte8f2c21d2017-12-07 17:52:40 +0100350 } with { variant (len) "LENGTHTO(reserved,dtx_d,dtx_u,spd_ind,ch_rate_type,coding_alg_rate)" }
Harald Welte643e2a62017-11-27 15:03:18 +0100351
Stefan Sperling4880be42018-08-07 18:12:59 +0200352 template (value) RSL_IE_ChannelMode ts_RSL_ChanMode_SIGN(boolean dtx_downlink := false) := {
Harald Welte8f2c21d2017-12-07 17:52:40 +0100353 len := 0, /* overwritten */
Harald Welte643e2a62017-11-27 15:03:18 +0100354 reserved := '000000'B,
Stefan Sperling4880be42018-08-07 18:12:59 +0200355 dtx_d := dtx_downlink,
Harald Welte643e2a62017-11-27 15:03:18 +0100356 dtx_u := false,
357 spd_ind := RSL_SPDI_SIGN,
358 ch_rate_type := RSL_CHRT_SDCCH,
359 coding_alg_rate := RSL_CMOD_NO_RESOURCE
360 }
361
Stefan Sperling4880be42018-08-07 18:12:59 +0200362 template (value) RSL_IE_ChannelMode ts_RSL_ChanMode(RSL_ChanRateType t, RSL_SpeechAlgo alg,
363 boolean dtx_downlink := false) := {
Harald Welte8f2c21d2017-12-07 17:52:40 +0100364 len := 0, /* overwritten */
Harald Welte643e2a62017-11-27 15:03:18 +0100365 reserved := '000000'B,
Stefan Sperling4880be42018-08-07 18:12:59 +0200366 dtx_d := dtx_downlink,
Harald Welte643e2a62017-11-27 15:03:18 +0100367 dtx_u := false,
368 spd_ind := RSL_SPDI_SPEECH,
369 ch_rate_type := t,
370 coding_alg_rate := alg
371 }
Harald Welte3618d9d2018-03-21 18:45:27 +0100372 template RSL_IE_ChannelMode tr_RSL_ChanMode(template RSL_ChanRateType t,
373 template RSL_SpeechAlgo alg) := {
374 len := ?,
375 reserved := '000000'B,
376 dtx_d := ?,
377 dtx_u := ?,
378 spd_ind := RSL_SPDI_SPEECH,
379 ch_rate_type := t,
380 coding_alg_rate := alg
381 }
Harald Welte643e2a62017-11-27 15:03:18 +0100382
383 /* 9.3.4 */
384 type record RSL_IE_BS_Power {
385 uint1_t reserved,
386 boolean epc,
387 boolean fpc,
388 uint5_t power_level
389 }
390
Harald Welte73cd2712017-12-17 00:44:52 +0100391 /* 9.3.7 */
Harald Weltee613f962018-04-18 22:38:16 +0200392 type enumerated RSL_AlgId {
393 RSL_ALG_ID_A5_0 ('00000001'B),
394 RSL_ALG_ID_A5_1 ('00000010'B),
395 RSL_ALG_ID_A5_2 ('00000011'B),
396 RSL_ALG_ID_A5_3 ('00000100'B),
397 RSL_ALG_ID_A5_4 ('00000101'B),
398 RSL_ALG_ID_A5_5 ('00000110'B),
399 RSL_ALG_ID_A5_6 ('00000111'B),
400 RSL_ALG_ID_A5_7 ('00001000'B)
401 } with { variant "FIELDLENGTH(8)" };
Harald Welte73cd2712017-12-17 00:44:52 +0100402 type record RSL_IE_EncryptionInfo {
403 uint8_t len,
Harald Weltee613f962018-04-18 22:38:16 +0200404 RSL_AlgId alg_id,
Harald Welte73cd2712017-12-17 00:44:52 +0100405 octetstring key
406 } with { variant (len) "LENGTHTO(alg_id,key)" };
407
Harald Weltee613f962018-04-18 22:38:16 +0200408 template RSL_IE_EncryptionInfo tr_RSL_IE_EncrInfo(template RSL_AlgId alg,
409 template octetstring key) := {
Harald Welte73cd2712017-12-17 00:44:52 +0100410 len := ?,
411 alg_id := alg,
412 key := key
413 }
Harald Weltee613f962018-04-18 22:38:16 +0200414 template (value) RSL_IE_EncryptionInfo ts_RSL_IE_EncrInfo(template (value) RSL_AlgId alg,
415 octetstring key) := {
Harald Welteefa7d912018-04-18 23:22:15 +0200416 len := 0, /* overwritten */
417 alg_id := alg,
418 key := key
419 }
420
421
Harald Welte73cd2712017-12-17 00:44:52 +0100422
Harald Welte643e2a62017-11-27 15:03:18 +0100423 /* 9.3.8 */
424 type record RSL_IE_FrameNumber {
425 uint5_t t1_p,
426 uint6_t t3,
427 uint5_t t2
428 }
429 type RSL_IE_FrameNumber RSL_IE_StartingTime;
430
431 /* 9.3.10 */
432 type record RSL_IE_L1Info {
433 uint5_t ms_power_lvl,
434 boolean fpc,
435 uint2_t reserved,
436 uint8_t actual_ta
437 }
438
439 /* 9.3.13 */
440 type record RSL_IE_MS_Power {
441 uint2_t reserved,
442 boolean fpc_epc,
443 uint5_t power_level
444 }
Harald Welte10280172019-05-19 22:28:04 +0200445 template (value) RSL_IE_MS_Power ts_RSL_IE_MS_Power(uint5_t power_level,
446 boolean fpc_epc := false) := {
447 reserved := 0,
448 fpc_epc := fpc_epc,
449 power_level := power_level
450 }
Harald Welte643e2a62017-11-27 15:03:18 +0100451
Harald Welted5f521e2017-12-07 17:53:06 +0100452 /* 9.3.18 */
453 type record RSL_IE_RachLoad {
454 uint8_t len,
455 uint16_t slot_count,
456 uint16_t busy_count,
457 uint16_t access_count
458 } with { variant (len) "LENGTHTO(slot_count,busy_count,access_count)" }
459
Harald Welteefa7d912018-04-18 23:22:15 +0200460 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 +0100461 len := 0, /* overwritten */
462 slot_count := slot,
463 busy_count := busy,
464 access_count := acc
465 }
466
Harald Welte68e495b2018-02-25 00:05:57 +0100467 template RSL_IE_RachLoad tr_RSL_IE_RachLoad(template uint16_t slot,
468 template uint16_t busy,
469 template uint16_t acc) := {
470 len := ?, /* overwritten */
471 slot_count := slot,
472 busy_count := busy,
473 access_count := acc
474 }
475
Harald Welte643e2a62017-11-27 15:03:18 +0100476 /* 9.3.19 */
477 type record RSL_IE_RequestRef {
478 OCT1 ra,
479 RSL_IE_FrameNumber frame_nr
480 }
481
482 /* 3GPP TS 44.018 / 10.5.2.38 Starting Time */
Harald Welte94e0c342018-04-07 11:33:23 +0200483 template (value) RSL_IE_FrameNumber ts_RSL_IE_FrameNumber(GsmFrameNumber fn) := {
Harald Welte643e2a62017-11-27 15:03:18 +0100484 t1_p := (fn / 1326) mod 32,
485 t3 := fn mod 51,
486 t2 := fn mod 26
487 }
488
Harald Welte9abd1282018-02-19 19:18:17 +0100489 function tr_RSL_IE_FrameNumber(template GsmFrameNumber fn) return template RSL_IE_FrameNumber {
490 if (istemplatekind(fn, "?")) {
491 return ?;
492 } else {
493 return ts_RSL_IE_FrameNumber(valueof(fn));
494 }
495 }
496
Harald Welteefa7d912018-04-18 23:22:15 +0200497 template (value) RSL_IE_RequestRef ts_RSL_IE_ReqRef(OCT1 ra, GsmFrameNumber frame_nr) := {
Harald Welte643e2a62017-11-27 15:03:18 +0100498 ra := ra,
499 frame_nr := ts_RSL_IE_FrameNumber(frame_nr)
500 }
501
Harald Welte9abd1282018-02-19 19:18:17 +0100502 template RSL_IE_RequestRef tr_RSL_IE_ReqRef(template OCT1 ra, template GsmFrameNumber frame_nr) := {
503 ra := ra,
504 frame_nr := tr_RSL_IE_FrameNumber(frame_nr)
505 }
506
Harald Welte15de8ba2018-06-29 08:51:42 +0200507 /* Osmocom Extension */
508 type record RSL_IE_UplinkMeasSuppMeasInfo {
509 int16_t toa256_mean,
510 int16_t toa256_min,
511 int16_t toa256_max,
512 uint16_t toa256_std_dev
513 };
514
Harald Welte2691adf2018-02-22 17:32:39 +0100515 /* 9.3.25 */
516 type record RSL_IE_UplinkMeas {
517 uint8_t len,
518 BIT1 rfu,
519 boolean dtx_d,
520 uint6_t rxlev_f_u,
521 BIT2 reserved1,
522 uint6_t rxlev_s_u,
523 BIT2 reserved2,
524 uint3_t rxq_f_u,
525 uint3_t rxq_s_u,
Harald Welte15de8ba2018-06-29 08:51:42 +0200526 RSL_IE_UplinkMeasSuppMeasInfo supp_meas_info optional
Harald Welte2691adf2018-02-22 17:32:39 +0100527 } 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 +0100528
Harald Welte643e2a62017-11-27 15:03:18 +0100529 /* 9.3.26 */
Harald Weltea8ed9062017-12-14 09:46:01 +0100530 type enumerated RSL_Cause {
531 /* normal event */
532 RSL_ERR_RADIO_IF_FAIL ('00'O),
533 RSL_ERR_RADIO_LINK_FAIL ('01'O),
534 RSL_ERR_HANDOVER_ACC_FAIL ('02'O),
535 RSL_ERR_TALKER_ACC_FAIL ('03'O),
536 RSL_ERR_OM_INTERVENTION ('07'O),
537 RSL_ERR_NORMAL_UNSPEC ('0f'O),
538 RSL_ERR_T_MSRFPCI_EXP ('18'O),
539 /* resource unavailable */
540 RSL_ERR_EQUIPMENT_FAIL ('20'O),
541 RSL_ERR_RR_UNAVAIL ('21'O),
542 RSL_ERR_TERR_CH_FAIL ('22'O),
543 RSL_ERR_CCCH_OVERLOAD ('23'O),
544 RSL_ERR_ACCH_OVERLOAD ('24'O),
545 RSL_ERR_PROCESSOR_OVERLOAD ('25'O),
546 RSL_ERR_BTS_NOT_EQUIPPED ('27'O),
547 RSL_ERR_REMOTE_TRAU_FAILURE ('28'O),
548 RSL_ERR_NOTIF_OVERFLOW ('29'O),
549 RSL_ERR_RES_UNAVAIL ('2f'O),
550 /* service or option not available */
551 RSL_ERR_TRANSC_UNAVAIL ('30'O),
552 RSL_ERR_SERV_OPT_UNAVAIL ('3f'O),
553 /* service or option not implemented */
554 RSL_ERR_ENCR_UNIMPL ('40'O),
555 RSL_ERR_SERV_OPT_UNIMPL ('4f'O),
556 /* invalid message */
557 RSL_ERR_RCH_ALR_ACTV_ALLOC ('50'O),
Harald Welte9912eb52018-02-25 13:30:15 +0100558 RSL_ERR_IPA_RCH_NOT_ACTV_ALLOC ('51'O),
559 RSL_ERR_IPA_CONN_INVALID ('52'O),
560 RSL_ERR_IPA_CONN_IN_USE ('53'O),
561 RSL_ERR_IPA_CONN_ALREADY_EXISTS ('54'O),
Harald Weltea8ed9062017-12-14 09:46:01 +0100562 RSL_ERR_INVALID_MESSAGE ('5f'O),
563 /* protocol error */
564 RSL_ERR_MSG_DISCR ('60'O),
565 RSL_ERR_MSG_TYPE ('61'O),
566 RSL_ERR_MSG_SEQ ('62'O),
567 RSL_ERR_IE_ERROR ('63'O),
568 RSL_ERR_MAND_IE_ERROR ('64'O),
569 RSL_ERR_OPT_IE_ERROR ('65'O),
570 RSL_ERR_IE_NONEXIST ('66'O),
571 RSL_ERR_IE_LENGTH ('67'O),
572 RSL_ERR_IE_CONTENT ('68'O),
573 RSL_ERR_PROTO ('6f'O),
574 /* interworking */
575 RSL_ERR_INTERWORKING ('7f'O)
576 };
Harald Welte643e2a62017-11-27 15:03:18 +0100577 type record RSL_IE_Cause {
Harald Welte6efa8e32017-12-09 22:34:06 +0100578 uint8_t len,
Harald Welte643e2a62017-11-27 15:03:18 +0100579 uint1_t e,
580 RSL_Cause cause,
581 octetstring cause_ext optional
Harald Welte6efa8e32017-12-09 22:34:06 +0100582 } with { variant (len) "LENGTHTO(e,cause,cause_ext)" }
Harald Welte643e2a62017-11-27 15:03:18 +0100583
Harald Welteefa7d912018-04-18 23:22:15 +0200584 template (value) RSL_IE_Cause ts_RSL_IE_Cause(RSL_Cause cause) := {
Harald Welte6efa8e32017-12-09 22:34:06 +0100585 len := 0, /* overwritten */
Harald Welte643e2a62017-11-27 15:03:18 +0100586 e := 0,
587 cause := cause,
588 cause_ext := omit
589 }
590
Harald Welte9abd1282018-02-19 19:18:17 +0100591 template RSL_IE_Cause tr_RSL_IE_Cause(template RSL_Cause cause) := {
592 len := ?,
593 e := 0,
594 cause := cause,
595 cause_ext := omit
596 }
597
Harald Weltec8d363c2019-05-19 20:36:48 +0200598 /* 9.3.29 */
599 type record RSL_SacchInfo {
600 uint8_t len,
601 uint8_t num_msgs,
602 RSL_SacchInfoElements elems
603 } with {
604 variant (len) "LENGTHTO(num_msgs,elems)";
605 variant (num_msgs) "LENGTHTO(elems)";
606 variant (num_msgs) "UNIT(elements)"
607 };
608 type record RSL_SacchInfoElement {
609 RSL_IE_SysinfoType si_type,
610 uint8_t len,
611 octetstring msg
612 } with {
613 variant (len) "LENGTHTO(msg)";
614 };
615 type record of RSL_SacchInfoElement RSL_SacchInfoElements;
616 template (value) RSL_SacchInfo ts_RSL_SacchInfo(template (value) RSL_SacchInfoElements elems) := {
617 len := 0, /* overwritten */
618 num_msgs := 0, /* overwritten */
619 elems := elems
620 }
621 template (value) RSL_SacchInfoElement ts_RSL_SacchInfoElem(RSL_IE_SysinfoType tp, octetstring msg) := {
622 si_type := tp,
623 len := lengthof(msg),
624 msg := msg
625 }
626
Harald Welte643e2a62017-11-27 15:03:18 +0100627 /* 9.3.40 */
628 type enumerated RSL_ChanNeeded {
629 RSL_CHANNEED_ANY ('00'B),
630 RSL_CHANNEED_SDCCH ('01'B),
631 RSL_CHANNEED_TCH_F ('10'B),
632 RSL_CHANNEED_TCH_ForH ('11'B)
Harald Welte51d74102017-12-10 23:05:02 +0100633 } with { variant "FIELDLENGTH(2)" };
Harald Welte643e2a62017-11-27 15:03:18 +0100634 type record RSL_IE_ChanNeeded {
635 uint6_t reserved,
636 RSL_ChanNeeded chan_needed
637 }
638
Harald Weltecc373202018-09-10 10:28:21 +0200639 /* 9.3.41 CB Command Type */
640 type enumerated RSL_CbCommand {
641 RSL_CB_CMD_NORMAL ('0000'B),
642 RSL_CB_CMD_SCHEDULE ('1000'B),
643 RSL_CB_CMD_DEFAULT ('1110'B),
644 RSL_CB_CMD_NULL ('1111'B)
645 } with { variant "FIELDLENGTH(4)" };
646 type record RSL_IE_CbCommandType {
647 RSL_CbCommand command,
648 boolean default_bcast_null,
649 BIT1 spare,
650 uint2_t last_block
651 };
652 template (value) RSL_IE_CbCommandType ts_RSL_IE_CbCmdType(RSL_CbCommand cmd := RSL_CB_CMD_NORMAL,
653 uint2_t last_block := 1,
654 boolean def_bcast_null := true) := {
655 command := cmd,
656 default_bcast_null := def_bcast_null,
657 spare := '0'B,
658 last_block := last_block
659 }
660
Harald Welte643e2a62017-11-27 15:03:18 +0100661 /* 9.3.53 */
662 type record RSL_IE_MultirateCtrl {
663 uint3_t spare,
664 boolean od,
665 boolean pre,
666 uint2_t rae,
667 boolean tfo
668 }
669
670 type enumerated RSL_IE_SysinfoType {
671 RSL_SYSTEM_INFO_8 ('00000000'B),
672 RSL_SYSTEM_INFO_1 ('00000001'B),
673 RSL_SYSTEM_INFO_2 ('00000010'B),
674 RSL_SYSTEM_INFO_3 ('00000011'B),
675 RSL_SYSTEM_INFO_4 ('00000100'B),
676 RSL_SYSTEM_INFO_5 ('00000101'B),
677 RSL_SYSTEM_INFO_6 ('00000110'B),
678 RSL_SYSTEM_INFO_7 ('00000111'B),
679 RSL_SYSTEM_INFO_16 ('00001000'B),
680 RSL_SYSTEM_INFO_17 ('00001001'B),
681 RSL_SYSTEM_INFO_2bis ('00001010'B),
682 RSL_SYSTEM_INFO_2ter ('00001011'B),
683 RSL_SYSTEM_INFO_5bis ('00001101'B),
684 RSL_SYSTEM_INFO_5ter ('00001110'B),
685 RSL_SYSTEM_INFO_10 ('00001111'B),
686 RSL_EXT_MEAS_ORDER ('01000111'B),
687 RSL_MEAS_INFO ('01001000'B),
688 RSL_SYSTEM_INFO_13 ('00101000'B),
689 RSL_ERIC_SYSTEM_INFO_13 ('00001100'B),
690 RSL_SYSTEM_INFO_2quater ('00101001'B),
691 RSL_SYSTEM_INFO_9 ('00101010'B),
692 RSL_SYSTEM_INFO_18 ('00101011'B),
693 RSL_SYSTEM_INFO_19 ('00101100'B),
694 RSL_SYSTEM_INFO_20 ('00101101'B)
695 } with { variant "FIELDLENGTH(8)" }
696
Harald Welte9958a4d2017-12-14 21:21:33 +0100697 type record RSL_IE_IPA_ConnectionStats {
698 uint8_t len,
699 uint32_t tx_packets,
700 uint32_t tx_octets,
701 uint32_t rx_packets,
702 uint32_t rx_octets,
703 uint32_t lost_packets,
704 uint32_t jitter,
705 uint32_t avg_delay
706 } with { variant (len) "LENGTHTO(tx_packets,tx_octets,rx_packets,rx_octets,lost_packets,jitter,avg_delay)" }
707
708 type enumerated RSL_IPA_SpeechMode {
709 RSL_IPA_SPM_SENDRECV ('00'B),
710 RSL_IPA_SPM_RECVONLY ('01'B),
711 RSL_IPA_SPM_SENDONLY ('10'B),
712 RSL_IPA_SPM_RESERVED ('11'B)
713 } with { variant "FIELDLENGTH(2)" }
714
715 type enumerated RSL_IPA_Codec {
716 RSL_IPA_CODEC_FR ('0000'B),
717 RSL_IPA_CODEC_EFR ('0001'B),
718 RSL_IPA_CODEC_AMR_F ('0010'B),
719 RSL_IPA_CODEC_HR ('0011'B),
720 RSL_IPA_CODEC_AMR_H ('0101'B),
721 RSL_IPA_CODEC_RTP_PT ('1111'B)
722 } with { variant "FIELDLENGTH(4)" }
723
724 type record RSL_IE_IPA_SpeechMode {
725 BIT2 reserved,
726 RSL_IPA_SpeechMode mode,
727 RSL_IPA_Codec codec
728 }
729
Harald Welte0472ab42018-03-12 15:02:26 +0100730 /* 9.3.20 */
731 type enumerated RSL_IE_ReleaseMode {
732 RSL_REL_MODE_NORMAL ('00'B),
733 REL_REL_MODE_LOCAL ('01'B)
734 }
735
Harald Welte643e2a62017-11-27 15:03:18 +0100736 /* union of all IE bodies */
737 type union RSL_IE_Body {
738 RslChannelNr chan_nr,
739 RslLinkId link_id,
Harald Welte15bb5b52017-12-07 17:52:04 +0100740 RSL_L16V l3_info,
Harald Welte643e2a62017-11-27 15:03:18 +0100741 RSL_LV rlm_cause,
Harald Welte0472ab42018-03-12 15:02:26 +0100742 RSL_IE_ReleaseMode release_mode,
Harald Welte643e2a62017-11-27 15:03:18 +0100743 RSL_IE_ActivationType act_type,
744 RSL_IE_ChannelMode chan_mode,
745 uint8_t handover_ref,
746 RSL_IE_BS_Power bs_power,
747 RSL_IE_MS_Power ms_power,
748 uint8_t timing_adv,
749 RSL_IE_MultirateCtrl multirate_ctrl,
Harald Weltea6706152019-05-19 20:38:18 +0200750 uint8_t msg_id,
Harald Welte643e2a62017-11-27 15:03:18 +0100751 RSL_IE_FrameNumber frame_nr,
752 RSL_IE_Cause cause,
753 uint8_t access_delay,
Harald Welted5f521e2017-12-07 17:53:06 +0100754 RSL_IE_RachLoad rach_load,
Harald Welte643e2a62017-11-27 15:03:18 +0100755 uint8_t meas_res_nr,
Harald Welte2691adf2018-02-22 17:32:39 +0100756 uint8_t ms_timing_offset,
757 RSL_IE_UplinkMeas uplink_meas,
Harald Welte643e2a62017-11-27 15:03:18 +0100758 RSL_IE_L1Info l1_info,
759 RSL_IE_SysinfoType sysinfo_type,
760 uint16_t paging_load,
761 uint8_t paging_group,
762 RSL_IE_ChanNeeded chan_needed,
Harald Weltecc373202018-09-10 10:28:21 +0200763 RSL_IE_CbCommandType cb_cmd_type,
764 RSL_LV smscb_message,
Harald Weltec8d363c2019-05-19 20:36:48 +0200765 RSL_SacchInfo sacch_info,
Harald Weltecc373202018-09-10 10:28:21 +0200766
Harald Welte643e2a62017-11-27 15:03:18 +0100767 RSL_IE_StartingTime starting_time,
Harald Welte73cd2712017-12-17 00:44:52 +0100768 RSL_IE_EncryptionInfo encr_info,
Harald Weltea3ff6702019-05-20 20:03:50 +0200769 uint8_t smscb_chan_ind,
Harald Welte643e2a62017-11-27 15:03:18 +0100770 RSL_IE_RequestRef req_ref,
771 RSL_LV full_imm_ass_info,
Harald Weltefff69302017-12-07 17:53:42 +0100772 RSL_LV ms_identity,
Harald Welte643e2a62017-11-27 15:03:18 +0100773
Harald Welte9958a4d2017-12-14 21:21:33 +0100774 uint16_t ipa_conn_id,
775 uint16_t ipa_local_port,
776 uint16_t ipa_remote_port,
777 uint32_t ipa_local_ip,
778 uint32_t ipa_remote_ip,
779 uint8_t ipa_rtp_pt,
780 uint8_t ipa_rtp_pt2,
781 RSL_IE_IPA_ConnectionStats ipa_stats,
782 RSL_IE_IPA_SpeechMode ipa_speech_mode,
783
Harald Welte643e2a62017-11-27 15:03:18 +0100784 RSL_LV other
785 }
786
787 type record RSL_IE {
788 RSL_IE_Type iei,
789 RSL_IE_Body body
790 } with { variant (body) "CROSSTAG(
791 chan_nr, iei = RSL_IE_CHAN_NR;
792 link_id, iei = RSL_IE_LINK_IDENT;
793 l3_info, iei = RSL_IE_L3_INFO;
794 rlm_cause, iei = RSL_IE_RLM_CAUSE;
795 release_mode, iei = RSL_IE_RELEASE_MODE;
796 act_type, iei = RSL_IE_ACT_TYPE;
797 chan_mode, iei = RSL_IE_CHAN_MODE;
798 handover_ref, iei = RSL_IE_HANDO_REF;
799 bs_power, iei = RSL_IE_BS_POWER;
800 ms_power, iei = RSL_IE_MS_POWER;
801 timing_adv, iei = RSL_IE_TIMING_ADVANCE;
802 multirate_ctrl, iei = RSL_IE_MR_CONTROL;
Harald Weltea6706152019-05-19 20:38:18 +0200803 msg_id, iei = RSL_IE_MSG_ID;
Harald Welte643e2a62017-11-27 15:03:18 +0100804
805 frame_nr, iei = RSL_IE_FRAME_NUMBER;
806 cause, iei = RSL_IE_CAUSE;
807 access_delay, iei = RSL_IE_ACCESS_DELAY;
Harald Welted5f521e2017-12-07 17:53:06 +0100808 rach_load, iei = RSL_IE_RACH_LOAD;
Harald Welte643e2a62017-11-27 15:03:18 +0100809 meas_res_nr, iei = RSL_IE_MEAS_RES_NR;
Harald Welte2691adf2018-02-22 17:32:39 +0100810 ms_timing_offset, iei = RSL_IE_MS_TIMING_OFFSET;
811 uplink_meas, iei = RSL_IE_UPLINK_MEAS;
Harald Welte643e2a62017-11-27 15:03:18 +0100812 l1_info, iei = RSL_IE_L1_INFO;
813 sysinfo_type, iei = RSL_IE_SYSINFO_TYPE;
814 paging_load, iei = RSL_IE_PAGING_LOAD;
815 paging_group, iei = RSL_IE_PAGING_GROUP;
816 chan_needed, iei = RSL_IE_CHAN_NEEDED;
Harald Weltecc373202018-09-10 10:28:21 +0200817 cb_cmd_type, iei = RSL_IE_CB_CMD_TYPE;
818 smscb_message, iei = RSL_IE_SMSCB_MSG;
Harald Weltec8d363c2019-05-19 20:36:48 +0200819 sacch_info, iei = RSL_IE_SACCH_INFO;
Harald Welte643e2a62017-11-27 15:03:18 +0100820 starting_time, iei = RSL_IE_STARTNG_TIME;
Harald Welte73cd2712017-12-17 00:44:52 +0100821 encr_info, iei = RSL_IE_ENCR_INFO;
Harald Weltea3ff6702019-05-20 20:03:50 +0200822 smscb_chan_ind, iei = RSL_IE_SMSCB_CHAN_INDICATOR;
Harald Welte643e2a62017-11-27 15:03:18 +0100823
824 req_ref, iei = RSL_IE_REQ_REFERENCE;
Harald Weltefff69302017-12-07 17:53:42 +0100825 full_imm_ass_info, iei = RSL_IE_FULL_IMM_ASS_INFO;
826 ms_identity, iei = RSL_IE_MS_IDENTITY;
827 other, iei = RSL_IE_FULL_BCCH_INFO;
Harald Welte643e2a62017-11-27 15:03:18 +0100828
Harald Welte9958a4d2017-12-14 21:21:33 +0100829 ipa_conn_id, iei = RSL_IE_IPAC_CONN_ID;
830 ipa_remote_ip, iei = RSL_IE_IPAC_REMOTE_IP;
831 ipa_remote_port, iei = RSL_IE_IPAC_REMOTE_PORT;
832 ipa_local_ip, iei = RSL_IE_IPAC_LOCAL_IP;
833 ipa_local_port, iei = RSL_IE_IPAC_LOCAL_PORT;
834 ipa_rtp_pt, iei = RSL_IE_IPAC_RTP_PAYLOAD;
835 ipa_rtp_pt2, iei = RSL_IE_IPAC_RTP_PAYLOAD2;
836 ipa_stats, iei = RSL_IE_IPAC_CONN_STAT;
837 ipa_speech_mode, iei = RSL_IE_IPAC_SPEECH_MODE;
838
Harald Welte643e2a62017-11-27 15:03:18 +0100839 other, OTHERWISE;
840 )" };
841
Harald Welte735dd072017-12-12 14:55:17 +0100842 /* For some reason the TTCN-3 RAW codec cannot automatically figure out the IEI
843 * that it needs to set for a given union-choice (body). So we have to explicitly
844 * specify the IEI by the caller :( */
Harald Welteefa7d912018-04-18 23:22:15 +0200845 template (value) RSL_IE t_RSL_IE(RSL_IE_Type iei, template (value) RSL_IE_Body body) := {
Harald Welte735dd072017-12-12 14:55:17 +0100846 iei := iei,
Harald Welte643e2a62017-11-27 15:03:18 +0100847 body := body
848 }
849
Harald Weltec2877752017-12-07 17:54:35 +0100850 template RSL_IE tr_RSL_IE(template RSL_IE_Body body) := {
851 iei := ?, /* overwritten? */
852 body := body
853 }
854
855
Harald Welte643e2a62017-11-27 15:03:18 +0100856 type record of RSL_IE RSL_IE_List;
857
858 type record RSL_Message {
859 RSL_MessageDiscriminator msg_disc,
860 RSL_MessageType msg_type,
861 RSL_IE_List ies optional
862 }
863
864 external function enc_RSL_Message(in RSL_Message msg) return octetstring
865 with { extension "prototype(convert) encode(RAW)" };
866 external function dec_RSL_Message(in octetstring stream) return RSL_Message
867 with { extension "prototype(convert) decode(RAW)" };
868
Harald Weltebc330be2017-12-09 00:56:36 +0100869 template RSL_Message tr_RSL_MsgDiscType(template RSL_MessageDiscriminator m_disc,
Harald Welte643e2a62017-11-27 15:03:18 +0100870 RSL_MessageType m_type) := {
871 msg_disc := m_disc,
872 msg_type := m_type,
873 ies := *
874 }
875
Harald Welteefa7d912018-04-18 23:22:15 +0200876 template (value) RSL_Message ts_RSL_MsgDiscType(template (value) RSL_MessageDiscriminator m_disc,
877 template (value) RSL_MessageType msg_type,
878 template (omit) RSL_IE_List ies := omit) := {
Harald Welte4a267362017-12-09 17:49:32 +0100879 msg_disc := m_disc,
880 msg_type := msg_type,
881 ies := ies
882 }
883
Harald Weltebc330be2017-12-09 00:56:36 +0100884template RSL_Message tr_RSL_MsgType(template RSL_MessageType msg_type) := {
885 msg_disc := ?,
886 msg_type := msg_type,
887 ies := *
888}
889
890/* Common Channel Management */
891template RSL_Message tr_RSL_MsgTypeC(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
892 msg_disc := { RSL_MDISC_CCHAN, ? }
893}
894
895/* RLL */
896template RSL_Message tr_RSL_MsgTypeR(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
897 msg_disc := { RSL_MDISC_RLL, true }
898}
899
900/* Dedicated Channel Management */
901template RSL_Message tr_RSL_MsgTypeD(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
902 msg_disc := { RSL_MDISC_DCHAN, ? }
903}
904
905/* Dedicated Channel Management */
906template RSL_Message tr_RSL_MsgTypeT(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
907 msg_disc := { RSL_MDISC_TRX_MGMT, ? }
908}
909
910
911/* dedicated channel or RLL */
912template RSL_Message tr_RSL_MsgTypeDR(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
Harald Weltee5408222018-01-29 21:57:58 +0100913 msg_disc := ({RSL_MDISC_DCHAN,?}, {RSL_MDISC_RLL,?}, {RSL_MDISC_IPACCESS,false})
Harald Weltebc330be2017-12-09 00:56:36 +0100914}
915
916
Harald Welte643e2a62017-11-27 15:03:18 +0100917 /* 8.3.1 BSC -> BTS */
Harald Welteefa7d912018-04-18 23:22:15 +0200918 template (value) RSL_Message ts_RSL_DATA_REQ(template (value) RslChannelNr chan_nr,
919 template (value) RslLinkId link_id,
920 octetstring l3_info) := {
Harald Welte643e2a62017-11-27 15:03:18 +0100921 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, true),
922 msg_type := RSL_MT_DATA_REQ,
923 ies :={
Harald Welte735dd072017-12-12 14:55:17 +0100924 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
925 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
926 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
Harald Welte643e2a62017-11-27 15:03:18 +0100927 }
928 }
929
Harald Welte7794d5b2017-12-16 23:00:20 +0100930 template RSL_Message tr_RSL_DATA_REQ(template RslChannelNr chan_nr :=?,
931 template RslLinkId link_id := ?,
932 template octetstring l3_info := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +0200933 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, true),
Harald Welte7794d5b2017-12-16 23:00:20 +0100934 msg_type := RSL_MT_DATA_REQ,
935 ies :={
936 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
937 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
938 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
939 }
940 }
941
942
Harald Welte643e2a62017-11-27 15:03:18 +0100943 /* 8.3.2 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +0200944 template (value) RSL_Message ts_RSL_DATA_IND(template (value) RslChannelNr chan_nr,
945 template (value) RslLinkId link_id,
946 octetstring l3_info) := {
Harald Welte643e2a62017-11-27 15:03:18 +0100947 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, true),
948 msg_type := RSL_MT_DATA_IND,
949 ies :={
Harald Welte735dd072017-12-12 14:55:17 +0100950 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
951 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
952 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
Harald Welte643e2a62017-11-27 15:03:18 +0100953 }
954 }
Harald Welte9abd1282018-02-19 19:18:17 +0100955 template RSL_Message tr_RSL_DATA_IND(template RslChannelNr chan_nr, template RslLinkId link_id,
956 template octetstring l3_info := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +0200957 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, true),
Harald Welte9abd1282018-02-19 19:18:17 +0100958 msg_type := RSL_MT_DATA_IND,
959 ies :={
960 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
961 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
962 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
963 }
964 }
Harald Welte643e2a62017-11-27 15:03:18 +0100965
966 /* 8.3.3 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +0200967 template (value) RSL_Message ts_RSL_ERROR_IND(template (value) RslChannelNr chan_nr,
968 template (value) RslLinkId link_id, RSL_Cause cause) := {
Harald Welte643e2a62017-11-27 15:03:18 +0100969 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
970 msg_type := RSL_MT_ERROR_IND,
971 ies :={
Harald Welte735dd072017-12-12 14:55:17 +0100972 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
973 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
974 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
Harald Welte643e2a62017-11-27 15:03:18 +0100975 }
976 }
Harald Welte9abd1282018-02-19 19:18:17 +0100977 template RSL_Message tr_RSL_ERROR_IND(template RslChannelNr chan_nr, template RslLinkId link_id,
978 template RSL_Cause cause := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +0200979 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Welte9abd1282018-02-19 19:18:17 +0100980 msg_type := RSL_MT_ERROR_IND,
981 ies :={
982 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
983 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
984 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
985 }
986 }
Harald Welte643e2a62017-11-27 15:03:18 +0100987
Harald Welteefa7d912018-04-18 23:22:15 +0200988 /* 8.3.4 BTS <- BSC */
989 template (value) RSL_Message ts_RSL_EST_REQ(template (value) RslChannelNr chan_nr,
990 template (value) RslLinkId link_id) := {
991 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
992 msg_type := RSL_MT_EST_REQ,
993 ies := {
994 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
995 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
996 }
997 }
998 template RSL_Message tr_RSL_EST_REQ(template RslChannelNr chan_nr, template RslLinkId link_id) := {
999 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
1000 msg_type := RSL_MT_EST_REQ,
1001 ies := {
1002 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1003 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1004 }
1005 }
1006
1007 /* 8.3.5 BTS -> BSC */
1008 template (value) RSL_Message ts_RSL_EST_CONF(template (value) RslChannelNr chan_nr,
1009 template (value) RslLinkId link_id) := {
1010 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1011 msg_type := RSL_MT_EST_CONF,
1012 ies := {
1013 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1014 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
1015 }
1016 }
1017 template RSL_Message tr_RSL_EST_CONF(template RslChannelNr chan_nr, template RslLinkId link_id) := {
1018 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
1019 msg_type := RSL_MT_EST_CONF,
1020 ies := {
1021 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1022 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1023 }
1024 }
1025
Harald Welte643e2a62017-11-27 15:03:18 +01001026 /* 8.3.6 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001027 template (value) RSL_Message ts_RSL_EST_IND(template (value) RslChannelNr chan_nr,
1028 template (value) RslLinkId link_id,
1029 octetstring l3_info) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001030 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1031 msg_type := RSL_MT_EST_IND,
1032 ies := {
Harald Welte735dd072017-12-12 14:55:17 +01001033 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1034 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
1035 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
Harald Welte643e2a62017-11-27 15:03:18 +01001036 }
1037 }
Harald Welte9abd1282018-02-19 19:18:17 +01001038 template RSL_Message tr_RSL_EST_IND(template RslChannelNr chan_nr, template RslLinkId link_id,
1039 template octetstring l3_info := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001040 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001041 msg_type := RSL_MT_EST_IND,
1042 ies := {
1043 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1044 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
1045 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
1046 }
1047 }
Harald Welte0472ab42018-03-12 15:02:26 +01001048 template RSL_Message tr_RSL_EST_IND_NOL3(template RslChannelNr chan_nr, template RslLinkId link_id) :=
1049{
1050 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
1051 msg_type := RSL_MT_EST_IND,
1052 ies := {
1053 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1054 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1055 }
1056 }
1057
Harald Welte643e2a62017-11-27 15:03:18 +01001058
1059 /* 8.3.7 BSC -> BTS */
Harald Welteefa7d912018-04-18 23:22:15 +02001060 template (value) RSL_Message ts_RSL_REL_REQ(template (value) RslChannelNr chan_nr,
Harald Welte0472ab42018-03-12 15:02:26 +01001061 template (value) RslLinkId link_id,
1062 template (value) RSL_IE_ReleaseMode rel_mode := RSL_REL_MODE_NORMAL) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001063 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1064 msg_type := RSL_MT_REL_REQ,
1065 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001066 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
Harald Welte0472ab42018-03-12 15:02:26 +01001067 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
1068 t_RSL_IE(RSL_IE_RELEASE_MODE, RSL_IE_Body:{release_mode := rel_mode})
Harald Welte643e2a62017-11-27 15:03:18 +01001069 }
1070 }
Harald Weltee8a5ab12017-12-09 22:34:57 +01001071 template RSL_Message tr_RSL_REL_REQ(template RslChannelNr chan_nr,
Harald Welte0472ab42018-03-12 15:02:26 +01001072 template RslLinkId link_id,
1073 template RSL_IE_ReleaseMode rel_mode := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001074 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Weltee8a5ab12017-12-09 22:34:57 +01001075 msg_type := RSL_MT_REL_REQ,
1076 ies :={
1077 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1078 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
Harald Welte0472ab42018-03-12 15:02:26 +01001079 tr_RSL_IE(RSL_IE_Body:{release_mode := rel_mode})
Harald Weltee8a5ab12017-12-09 22:34:57 +01001080 }
1081 }
Harald Welte643e2a62017-11-27 15:03:18 +01001082
1083 /* 8.3.8 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001084 template (value) RSL_Message ts_RSL_REL_CONF(template (value) RslChannelNr chan_nr,
1085 template (value) RslLinkId link_id) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001086 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1087 msg_type := RSL_MT_REL_CONF,
1088 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001089 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1090 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
Harald Welte643e2a62017-11-27 15:03:18 +01001091 }
1092 }
Harald Welte9abd1282018-02-19 19:18:17 +01001093 template RSL_Message tr_RSL_REL_CONF(template RslChannelNr chan_nr, template RslLinkId link_id) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001094 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001095 msg_type := RSL_MT_REL_CONF,
1096 ies :={
1097 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1098 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1099 }
1100 }
Harald Welte643e2a62017-11-27 15:03:18 +01001101
1102 /* 8.3.9 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001103 template (value) RSL_Message ts_RSL_REL_IND(template (value) RslChannelNr chan_nr,
1104 template (value) RslLinkId link_id) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001105 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1106 msg_type := RSL_MT_REL_IND,
1107 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001108 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1109 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
Harald Welte643e2a62017-11-27 15:03:18 +01001110 }
1111 }
Harald Welte9abd1282018-02-19 19:18:17 +01001112 template RSL_Message tr_RSL_REL_IND(template RslChannelNr chan_nr, template RslLinkId link_id) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001113 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001114 msg_type := RSL_MT_REL_IND,
1115 ies :={
1116 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1117 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1118 }
1119 }
Harald Welte643e2a62017-11-27 15:03:18 +01001120
1121 /* 8.3.10 BSC -> BTS */
Harald Welteefa7d912018-04-18 23:22:15 +02001122 template (value) RSL_Message ts_RSL_UNITDATA_REQ(template (value) RslChannelNr chan_nr,
1123 template (value) RslLinkId link_id,
1124 octetstring l3_info)
Harald Welte643e2a62017-11-27 15:03:18 +01001125 modifies ts_RSL_DATA_REQ := {
1126 msg_type := RSL_MT_UNIT_DATA_REQ
1127 }
Harald Welte0472ab42018-03-12 15:02:26 +01001128 template RSL_Message tr_RSL_UNITDATA_REQ(template RslChannelNr chan_nr,
1129 template RslLinkId link_id,
Vadim Yanitskiy8f98d3f2018-10-03 17:58:10 +07001130 template octetstring l3_info := ?)
Harald Welte0472ab42018-03-12 15:02:26 +01001131 modifies tr_RSL_DATA_REQ := {
1132 msg_type := RSL_MT_UNIT_DATA_REQ
1133 }
1134
Harald Welte643e2a62017-11-27 15:03:18 +01001135
1136 /* 8.3.11 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001137 template (value) RSL_Message ts_RSL_UNITDATA_IND(template (value) RslChannelNr chan_nr,
1138 template (value) RslLinkId link_id,
1139 octetstring l3_info)
Harald Welte643e2a62017-11-27 15:03:18 +01001140 modifies ts_RSL_DATA_IND := {
1141 msg_type := RSL_MT_UNIT_DATA_IND
1142 }
Harald Welte0472ab42018-03-12 15:02:26 +01001143 template RSL_Message tr_RSL_UNITDATA_IND(template RslChannelNr chan_nr,
Vadim Yanitskiyfabe0f22018-10-03 17:51:47 +07001144 template RslLinkId link_id,
Vadim Yanitskiy8f98d3f2018-10-03 17:58:10 +07001145 template octetstring l3_info := ?)
Harald Welte0472ab42018-03-12 15:02:26 +01001146 modifies tr_RSL_DATA_IND := {
1147 msg_type := RSL_MT_UNIT_DATA_IND
1148 }
1149
1150
Harald Welte643e2a62017-11-27 15:03:18 +01001151
1152
1153 /* DEDICATED CANNEL MANAGEMENT MESSAGES */
1154
1155 /* 8.4.1 BSC -> BTS */
Harald Welteefa7d912018-04-18 23:22:15 +02001156 template (value) RSL_Message ts_RSL_CHAN_ACT(template (value) RslChannelNr chan_nr,
Harald Welte921f9e02019-05-19 22:27:11 +02001157 template (value) RSL_IE_ChannelMode mode,
1158 template (value) RSL_IE_ActivationType at := t_RSL_IE_ActType_IA) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001159 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1160 msg_type := RSL_MT_CHAN_ACTIV,
1161 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001162 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
Harald Welte921f9e02019-05-19 22:27:11 +02001163 t_RSL_IE(RSL_IE_ACT_TYPE, RSL_IE_Body:{act_type := at}),
Harald Welte735dd072017-12-12 14:55:17 +01001164 t_RSL_IE(RSL_IE_CHAN_MODE, RSL_IE_Body:{chan_mode := mode})
Harald Welte643e2a62017-11-27 15:03:18 +01001165 /* lots of optional IEs */
1166 }
1167 }
Harald Welte94e0c342018-04-07 11:33:23 +02001168 template RSL_Message tr_RSL_CHAN_ACT(template RslChannelNr chan_nr,
Harald Welte921f9e02019-05-19 22:27:11 +02001169 template RSL_IE_ChannelMode mode,
1170 template (value) RSL_IE_ActivationType at := t_RSL_IE_ActType_IA) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001171 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte94e0c342018-04-07 11:33:23 +02001172 msg_type := RSL_MT_CHAN_ACTIV,
1173 ies :={
1174 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
Harald Welte921f9e02019-05-19 22:27:11 +02001175 tr_RSL_IE(RSL_IE_Body:{act_type := at}),
Harald Welte94e0c342018-04-07 11:33:23 +02001176 tr_RSL_IE(RSL_IE_Body:{chan_mode := mode}),
1177 /* lots of optional IEs */
1178 *
1179 }
1180 }
1181 template RSL_Message tr_RSL_CHAN_ACT_PDCH(template RslChannelNr chan_nr,
1182 template RSL_IE_ChannelMode mode) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001183 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte94e0c342018-04-07 11:33:23 +02001184 msg_type := RSL_MT_CHAN_ACTIV,
1185 ies :={
1186 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1187 tr_RSL_IE(RSL_IE_Body:{act_type := t_RSL_IE_ActType_PDCH}),
1188 /* lots of optional IEs */
1189 *
1190 }
1191 }
1192
Harald Welte643e2a62017-11-27 15:03:18 +01001193
1194 /* 8.4.2 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001195 template (value) RSL_Message ts_RSL_CHAN_ACT_ACK(template (value) RslChannelNr chan_nr,
1196 GsmFrameNumber fn) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001197 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1198 msg_type := RSL_MT_CHAN_ACTIV_ACK,
1199 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001200 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1201 t_RSL_IE(RSL_IE_FRAME_NUMBER, RSL_IE_Body:{frame_nr := ts_RSL_IE_FrameNumber(fn)})
Harald Welte643e2a62017-11-27 15:03:18 +01001202 }
1203 }
Harald Welte9abd1282018-02-19 19:18:17 +01001204 template RSL_Message tr_RSL_CHAN_ACT_ACK(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001205 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001206 msg_type := RSL_MT_CHAN_ACTIV_ACK,
1207 ies := {
1208 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1209 tr_RSL_IE(RSL_IE_Body:{frame_nr := ?})
1210 }
1211 }
Harald Welte643e2a62017-11-27 15:03:18 +01001212
1213 /* 8.4.3 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001214 template (value) RSL_Message ts_RSL_CHAN_ACT_NACK(template (value) RslChannelNr chan_nr,
1215 RSL_Cause cause) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001216 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1217 msg_type := RSL_MT_CHAN_ACTIV_NACK,
1218 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001219 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1220 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
Harald Welte643e2a62017-11-27 15:03:18 +01001221 }
1222 }
Harald Welte9abd1282018-02-19 19:18:17 +01001223 template RSL_Message tr_RSL_CHAN_ACT_NACK(template RslChannelNr chan_nr,
1224 template RSL_Cause cause := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001225 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001226 msg_type := RSL_MT_CHAN_ACTIV_NACK,
1227 ies := {
1228 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1229 tr_RSL_IE(RSL_IE_Body:{cause := ?})
1230 }
1231 }
Harald Welte643e2a62017-11-27 15:03:18 +01001232
1233 /* 8.4.4 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001234 template (value) RSL_Message ts_RSL_CONN_FAIL_IND(RslChannelNr chan_nr, RSL_Cause cause) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001235 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1236 msg_type := RSL_MT_CONN_FAIL,
1237 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001238 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1239 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
Harald Welte643e2a62017-11-27 15:03:18 +01001240 }
1241 }
Harald Welte9abd1282018-02-19 19:18:17 +01001242 template RSL_Message tr_RSL_CONN_FAIL_IND(template RslChannelNr chan_nr,
1243 template RSL_Cause cause := ?) := {
1244 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1245 msg_type := RSL_MT_CONN_FAIL,
1246 ies :={
1247 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1248 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
1249 }
1250 }
Harald Welte643e2a62017-11-27 15:03:18 +01001251
Harald Weltee8a5ab12017-12-09 22:34:57 +01001252 /* 8.4.5 BSC -> BTS */
1253 template RSL_Message tr_RSL_DEACT_SACCH(template RslChannelNr chan_nr) := {
1254 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1255 msg_type := RSL_MT_DEACTIVATE_SACCH,
1256 ies := {
1257 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
1258 }
1259 }
Harald Welteefa7d912018-04-18 23:22:15 +02001260 template (value) RSL_Message ts_RSL_DEACT_SACCH(template (value) RslChannelNr chan_nr) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001261 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1262 msg_type := RSL_MT_DEACTIVATE_SACCH,
1263 ies := {
1264 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1265 }
1266 }
1267
Harald Weltee8a5ab12017-12-09 22:34:57 +01001268
Harald Welte73cd2712017-12-17 00:44:52 +01001269 /* 8.4.6 BSC ->BTS */
1270 template RSL_Message tr_RSL_ENCR_CMD(template RslChannelNr chan_nr,
1271 template RslLinkId link_id := ?,
Harald Weltee613f962018-04-18 22:38:16 +02001272 template RSL_AlgId alg := ?,
Harald Welte73cd2712017-12-17 00:44:52 +01001273 template octetstring key := ?,
1274 template octetstring l3_info := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001275 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte73cd2712017-12-17 00:44:52 +01001276 msg_type := RSL_MT_ENCR_CMD,
1277 ies := {
1278 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1279 tr_RSL_IE(RSL_IE_Body:{encr_info := tr_RSL_IE_EncrInfo(alg, key)}),
1280 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
1281 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
1282 }
1283 }
Harald Welteefa7d912018-04-18 23:22:15 +02001284 template (value) RSL_Message ts_RSL_ENCR_CMD(template (value) RslChannelNr chan_nr,
1285 template (value) RslLinkId link_id,
Harald Weltee613f962018-04-18 22:38:16 +02001286 template (value) RSL_AlgId alg, octetstring key,
Harald Welteefa7d912018-04-18 23:22:15 +02001287 octetstring l3_info) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001288 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1289 msg_type := RSL_MT_ENCR_CMD,
1290 ies := {
1291 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
Harald Welteefa7d912018-04-18 23:22:15 +02001292 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 +01001293 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
Harald Welteefa7d912018-04-18 23:22:15 +02001294 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
Harald Welte9abd1282018-02-19 19:18:17 +01001295 }
1296 }
Harald Welte73cd2712017-12-17 00:44:52 +01001297
Harald Welte2691adf2018-02-22 17:32:39 +01001298 template RSL_Message tr_RSL_MEAS_RES(template RslChannelNr chan_nr,
1299 template uint8_t meas_res_nr := ?,
1300 template RSL_IE_UplinkMeas ul_meas := ?,
1301 template RSL_IE_BS_Power bs_power := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001302 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte2691adf2018-02-22 17:32:39 +01001303 msg_type := RSL_MT_MEAS_RES,
1304 ies := {
1305 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1306 tr_RSL_IE(RSL_IE_Body:{meas_res_nr := meas_res_nr}),
1307 tr_RSL_IE(RSL_IE_Body:{uplink_meas := ul_meas}),
1308 tr_RSL_IE(RSL_IE_Body:{bs_power := bs_power}),
1309 *
1310 }
1311 }
1312
Harald Welte39b47be2018-02-23 18:58:48 +01001313 /* Osmocom specific template, require lots of optional fields to be present */
1314 template RSL_Message tr_RSL_MEAS_RES_OSMO(template RslChannelNr chan_nr,
1315 template uint8_t meas_res_nr := ?,
1316 template RSL_IE_UplinkMeas ul_meas := ?,
1317 template RSL_IE_BS_Power bs_power := ?,
1318 template RSL_IE_L1Info l1_info := ?,
1319 template octetstring l3_info := ?,
1320 template uint8_t ms_to := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001321 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte39b47be2018-02-23 18:58:48 +01001322 msg_type := RSL_MT_MEAS_RES,
1323 ies := {
1324 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1325 tr_RSL_IE(RSL_IE_Body:{meas_res_nr := meas_res_nr}),
1326 tr_RSL_IE(RSL_IE_Body:{uplink_meas := ul_meas}),
1327 tr_RSL_IE(RSL_IE_Body:{bs_power := bs_power}),
1328 tr_RSL_IE(RSL_IE_Body:{l1_info := l1_info}),
1329 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)}),
1330 tr_RSL_IE(RSL_IE_Body:{ms_timing_offset := ms_to})
1331 }
1332 }
1333
1334
Harald Welte7794d5b2017-12-16 23:00:20 +01001335 /* 8.4.10 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001336 template (value) RSL_Message ts_RSL_MODE_MODIFY_ACK(template (value) RslChannelNr chan_nr) := {
Harald Welte7794d5b2017-12-16 23:00:20 +01001337 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1338 msg_type := RSL_MT_MODE_MODIFY_ACK,
1339 ies := {
1340 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1341 }
1342 }
Harald Welte9abd1282018-02-19 19:18:17 +01001343 template RSL_Message tr_RSL_MODE_MODIFY_ACK(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001344 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001345 msg_type := RSL_MT_MODE_MODIFY_ACK,
1346 ies := {
1347 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
1348 }
1349 }
Harald Welte7794d5b2017-12-16 23:00:20 +01001350
Harald Welte643e2a62017-11-27 15:03:18 +01001351 /* 8.4.11 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001352 template (value) RSL_Message ts_RSL_MODE_MODIFY_NACK(template (value) RslChannelNr chan_nr,
1353 RSL_Cause cause) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001354 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1355 msg_type := RSL_MT_MODE_MODIFY_NACK,
1356 ies := {
1357 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1358 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
1359 }
Harald Welte643e2a62017-11-27 15:03:18 +01001360 }
Harald Welte9abd1282018-02-19 19:18:17 +01001361 template RSL_Message tr_RSL_MODE_MODIFY_NACK(template RslChannelNr chan_nr,
1362 template RSL_Cause cause) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001363 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001364 msg_type := RSL_MT_MODE_MODIFY_NACK,
1365 ies := {
1366 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1367 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
1368 }
1369 }
1370
Harald Welte643e2a62017-11-27 15:03:18 +01001371
Harald Welte6a8199d2018-01-29 21:58:53 +01001372 /* 8.4.14: BTS <- BSC */
1373 template RSL_Message tr_RSL_RF_CHAN_REL(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001374 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte6a8199d2018-01-29 21:58:53 +01001375 msg_type := RSL_MT_RF_CHAN_REL,
1376 ies := {
1377 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
1378 }
1379 }
Harald Welteefa7d912018-04-18 23:22:15 +02001380 template (value) RSL_Message ts_RSL_RF_CHAN_REL(template (value) RslChannelNr chan_nr) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001381 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1382 msg_type := RSL_MT_RF_CHAN_REL,
1383 ies := {
1384 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1385 }
1386 }
Harald Welte6a8199d2018-01-29 21:58:53 +01001387
Philipp Maier4d1e9c92018-12-20 11:11:56 +01001388 /* 8.4.15: BTS <- BSC */
1389 template (value) RSL_Message ts_RSL_MS_PWR_CTRL(template (value) RslChannelNr chan_nr,
1390 template (value) RSL_IE_MS_Power ms_power) := {
1391 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1392 msg_type := RSL_MT_MS_POWER_CONTROL,
1393 ies := {
1394 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1395 t_RSL_IE(RSL_IE_MS_POWER, RSL_IE_Body:{ms_power := ms_power})
1396 /* One optional IE: MS POWER PARAMETERS */
1397 }
1398 }
1399
Harald Welte4a267362017-12-09 17:49:32 +01001400 /* 8.4.19 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001401 template (value) RSL_Message ts_RSL_RF_CHAN_REL_ACK(template (value) RslChannelNr chan_nr) :=
Harald Welte4a267362017-12-09 17:49:32 +01001402 ts_RSL_MsgDiscType(ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1403 RSL_MT_RF_CHAN_REL_ACK,
Harald Welte735dd072017-12-12 14:55:17 +01001404 { t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}) });
Harald Welte4a267362017-12-09 17:49:32 +01001405
Harald Welte9abd1282018-02-19 19:18:17 +01001406 template RSL_Message tr_RSL_RF_CHAN_REL_ACK(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001407 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001408 msg_type := RSL_MT_RF_CHAN_REL_ACK,
1409 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001410 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
Harald Welte9abd1282018-02-19 19:18:17 +01001411 }
1412 }
1413
Harald Welteea17b912018-03-11 22:29:31 +01001414 /* 8.6.20 BTS <- BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001415 template (value) RSL_Message ts_RSL_SACCH_INF_MOD(template (value) RslChannelNr chan_nr,
1416 RSL_IE_SysinfoType si_type,
1417 octetstring l3_info) := {
Harald Welteea17b912018-03-11 22:29:31 +01001418 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1419 msg_type := RSL_MT_SACCH_INFO_MODIFY,
1420 ies := {
1421 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1422 t_RSL_IE(RSL_IE_SYSINFO_TYPE, RSL_IE_Body:{sysinfo_type := si_type}),
1423 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
1424 }
1425 }
1426
Neels Hofmeyr378a49c2018-06-15 22:18:43 +02001427 /* 8.4.7 BTS -> BSC */
1428 template (value) RSL_Message ts_RSL_HANDO_DET(template (value) RslChannelNr chan_nr) := {
1429 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1430 msg_type := RSL_MT_HANDO_DET,
1431 ies := {
1432 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1433 }
1434 }
1435
Harald Welteea17b912018-03-11 22:29:31 +01001436
Harald Welte643e2a62017-11-27 15:03:18 +01001437 /* COMMON CHANNEL MANAGEMENT MESSAGES */
1438
Harald Welte874c2232018-02-24 04:52:43 +01001439 /* 8.5.1 BTS <- BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001440 template (value) RSL_Message ts_RSL_BCCH_INFO(RSL_IE_SysinfoType si_type,
1441 octetstring full_bcch_info) := {
Harald Welte874c2232018-02-24 04:52:43 +01001442 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1443 msg_type := RSL_MT_BCCH_INFO,
1444 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001445 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_BCCH(0)}),
Harald Welte874c2232018-02-24 04:52:43 +01001446 t_RSL_IE(RSL_IE_SYSINFO_TYPE, RSL_IE_Body:{sysinfo_type := si_type}),
1447 t_RSL_IE(RSL_IE_FULL_BCCH_INFO, RSL_IE_Body:{other := ts_RSL_LV(full_bcch_info)})
1448 }
1449 }
1450
Harald Welte7ae93142017-12-07 17:56:15 +01001451 /* 8.5.2 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001452 template (value) RSL_Message ts_RSL_RACH_LOAD_IND(uint16_t slot_ct, uint16_t busy_ct,
1453 uint16_t acc_ct) := {
Harald Welte7ae93142017-12-07 17:56:15 +01001454 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1455 msg_type := RSL_MT_CCCH_LOAD_IND,
1456 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001457 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_RACH(0)}),
Harald Welte735dd072017-12-12 14:55:17 +01001458 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 +01001459 }
1460 }
Harald Welte68e495b2018-02-25 00:05:57 +01001461 template RSL_Message tr_RSL_RACH_LOAD_IND(template uint16_t slot_ct := ?,
1462 template uint16_t busy_ct := ?,
1463 template uint16_t acc_ct) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001464 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Welte68e495b2018-02-25 00:05:57 +01001465 msg_type := RSL_MT_CCCH_LOAD_IND,
1466 ies := {
1467 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_RACH(0)}),
1468 tr_RSL_IE(RSL_IE_Body:{rach_load := tr_RSL_IE_RachLoad(slot_ct, busy_ct, acc_ct)})
1469 }
1470 }
1471
Harald Welteefa7d912018-04-18 23:22:15 +02001472 template (value) RSL_Message ts_RSL_PAGING_LOAD_IND(uint16_t buffer_space) := {
Harald Welte7ae93142017-12-07 17:56:15 +01001473 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1474 msg_type := RSL_MT_CCCH_LOAD_IND,
1475 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001476 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_PCH_AGCH(0)}),
Harald Welte735dd072017-12-12 14:55:17 +01001477 t_RSL_IE(RSL_IE_PAGING_LOAD, RSL_IE_Body:{paging_load := buffer_space})
Harald Welte7ae93142017-12-07 17:56:15 +01001478 }
1479 }
Harald Welte68e495b2018-02-25 00:05:57 +01001480 template RSL_Message tr_RSL_PAGING_LOAD_IND(template uint16_t buffer_space := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001481 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Welte68e495b2018-02-25 00:05:57 +01001482 msg_type := RSL_MT_CCCH_LOAD_IND,
1483 ies := {
1484 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(0)}),
1485 tr_RSL_IE(RSL_IE_Body:{paging_load := buffer_space})
1486 }
1487 }
1488
Harald Welte7ae93142017-12-07 17:56:15 +01001489
Harald Welte643e2a62017-11-27 15:03:18 +01001490 /* 8.5.3 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001491 template (value) RSL_Message ts_RSL_CHAN_RQD(OCT1 ra, GsmFrameNumber fn, uint8_t acc_del := 0) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001492 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1493 msg_type := RSL_MT_CHAN_RQD,
1494 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001495 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_RACH(0)}),
Harald Welte735dd072017-12-12 14:55:17 +01001496 t_RSL_IE(RSL_IE_REQ_REFERENCE, RSL_IE_Body:{req_ref := ts_RSL_IE_ReqRef(ra, fn)}),
1497 t_RSL_IE(RSL_IE_ACCESS_DELAY, RSL_IE_Body:{access_delay := acc_del})
Harald Welte643e2a62017-11-27 15:03:18 +01001498 }
1499 }
Harald Welte9abd1282018-02-19 19:18:17 +01001500 template RSL_Message tr_RSL_CHAN_RQD(template OCT1 ra, template GsmFrameNumber fn := ?,
1501 template uint8_t acc_del := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001502 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001503 msg_type := RSL_MT_CHAN_RQD,
1504 ies := {
1505 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_RACH(0)}),
1506 tr_RSL_IE(RSL_IE_Body:{req_ref := tr_RSL_IE_ReqRef(ra, fn)}),
1507 tr_RSL_IE(RSL_IE_Body:{access_delay := acc_del})
1508 }
1509 }
Harald Welte643e2a62017-11-27 15:03:18 +01001510
1511 /* 8.5.4 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001512 template (value) RSL_Message ts_DELETE_IND(template (value) RslChannelNr chan_nr,
1513 octetstring imm_ass) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001514 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1515 msg_type := RSL_MT_DELETE_IND,
1516 ies := {
Harald Welte735dd072017-12-12 14:55:17 +01001517 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1518 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 +01001519 }
1520 }
Harald Weltee8d750e2018-06-10 21:41:35 +02001521 template RSL_Message tr_RSL_DELETE_IND(template octetstring imm_ass := ?, template uint3_t tn) := {
1522 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1523 msg_type := RSL_MT_DELETE_IND,
1524 ies := {
1525 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(tn)}),
1526 tr_RSL_IE(RSL_IE_Body:{full_imm_ass_info := tr_RSL_LV(imm_ass)}),
1527 *
1528 }
1529 }
Harald Welte643e2a62017-11-27 15:03:18 +01001530
Harald Weltec2877752017-12-07 17:54:35 +01001531 /* 8.5.5 BSC -> BTS */
1532 template RSL_Message tr_RSL_PAGING_CMD(template octetstring identity, template uint3_t tn := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001533 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Weltec2877752017-12-07 17:54:35 +01001534 msg_type := RSL_MT_PAGING_CMD,
1535 ies := {
1536 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(tn)}),
1537 tr_RSL_IE(RSL_IE_Body:{paging_group := ?}),
Harald Welte51d74102017-12-10 23:05:02 +01001538 tr_RSL_IE(RSL_IE_Body:{ms_identity := tr_RSL_LV(identity)}),
Harald Weltec2877752017-12-07 17:54:35 +01001539 * /* opt: channel needed, eMLPP prio */
1540 }
1541 }
Harald Welteefa7d912018-04-18 23:22:15 +02001542 template (value) RSL_Message ts_RSL_PAGING_CMD(octetstring identity, uint8_t pg, uint3_t tn := 0) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001543 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1544 msg_type := RSL_MT_PAGING_CMD,
1545 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001546 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_PCH_AGCH(tn)}),
Harald Welte9abd1282018-02-19 19:18:17 +01001547 t_RSL_IE(RSL_IE_PAGING_GROUP, RSL_IE_Body:{paging_group := pg}),
1548 t_RSL_IE(RSL_IE_MS_IDENTITY, RSL_IE_Body:{ms_identity := ts_RSL_LV(identity)})
1549 }
1550 }
Harald Weltec2877752017-12-07 17:54:35 +01001551
1552 /* 8.5.6 BSC -> BTS */
1553 template RSL_Message tr_RSL_IMM_ASSIGN(template uint3_t tn := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001554 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Weltec2877752017-12-07 17:54:35 +01001555 msg_type := RSL_MT_IMMEDIATE_ASSIGN_CMD,
1556 ies := {
1557 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(tn)}),
1558 tr_RSL_IE(RSL_IE_Body:{full_imm_ass_info := ?})
1559 }
1560 }
Harald Welteefa7d912018-04-18 23:22:15 +02001561 template (value) RSL_Message ts_RSL_IMM_ASSIGN(octetstring f_ass_inf, uint3_t tn := 0) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001562 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1563 msg_type := RSL_MT_IMMEDIATE_ASSIGN_CMD,
1564 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001565 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_PCH_AGCH(tn)}),
Harald Welte9abd1282018-02-19 19:18:17 +01001566 t_RSL_IE(RSL_IE_FULL_IMM_ASS_INFO, RSL_IE_Body:{full_imm_ass_info := ts_RSL_LV(f_ass_inf)})
1567 }
1568 }
Harald Weltec2877752017-12-07 17:54:35 +01001569
Harald Welte68e495b2018-02-25 00:05:57 +01001570 template RSL_Message tr_RSL_RF_RES_IND := {
Harald Welteefa7d912018-04-18 23:22:15 +02001571 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
Harald Welte68e495b2018-02-25 00:05:57 +01001572 msg_type := RSL_MT_RF_RES_IND,
1573 ies := *
1574 }
1575
Harald Weltecc373202018-09-10 10:28:21 +02001576 /* 8.5.8 BTS <- BSC SMS BROADCAST COMMAND */
1577 template RSL_Message tr_RSL_SMSCB_CMD(template RSL_IE_CbCommandType cb_cmd := ?,
1578 template octetstring msg := ?,
1579 template RslChannelNr chan_nr := ?) := {
1580 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1581 msg_type := RSL_MT_SMS_BC_CMD,
1582 ies := {
1583 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1584 tr_RSL_IE(RSL_IE_Body:{cb_cmd_type := cb_cmd}),
1585 tr_RSL_IE(RSL_IE_Body:{smscb_message := tr_RSL_LV(msg)}),
1586 *
1587 }
1588 }
1589 template (value) RSL_Message ts_RSL_SMSCB_CMD(template (value) RSL_IE_CbCommandType cb_cmd,
1590 template (value) octetstring msg,
1591 template (value) RslChannelNr chan_nr :=
1592 ts_RslChanNr_SDCCH4(0, 2)) := {
1593 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1594 msg_type := RSL_MT_SMS_BC_CMD,
1595 ies := {
1596 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1597 t_RSL_IE(RSL_IE_CB_CMD_TYPE, RSL_IE_Body:{cb_cmd_type := cb_cmd}),
1598 t_RSL_IE(RSL_IE_SMSCB_MSG, RSL_IE_Body:{smscb_message := ts_RSL_LV(msg)})
1599 /* optional channel type for extended CBCH */
1600 }
1601 }
1602
Harald Welte68e495b2018-02-25 00:05:57 +01001603 /* 8.6.2 BTS <- BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001604 template (value) RSL_Message ts_RSL_SACCH_FILL(RSL_IE_SysinfoType si_type, octetstring l3_info) := {
Harald Welte68e495b2018-02-25 00:05:57 +01001605 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
1606 msg_type := RSL_MT_SACCH_FILL,
1607 ies := {
1608 t_RSL_IE(RSL_IE_SYSINFO_TYPE, RSL_IE_Body:{sysinfo_type := si_type}),
1609 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
1610 }
1611 }
1612
Harald Welte643e2a62017-11-27 15:03:18 +01001613 /* 8.6.4 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001614 template (value) RSL_Message ts_RSL_ERROR_REPORT(RSL_Cause cause) := {
Harald Welte01d982c2018-02-25 01:31:40 +01001615 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
1616 msg_type := RSL_MT_ERROR_REPORT,
Harald Welte643e2a62017-11-27 15:03:18 +01001617 ies := {
Harald Welte735dd072017-12-12 14:55:17 +01001618 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
Harald Welte643e2a62017-11-27 15:03:18 +01001619 }
1620 }
Harald Welte01d982c2018-02-25 01:31:40 +01001621 template RSL_Message tr_RSL_ERROR_REPORT(template RSL_Cause cause := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001622 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
Harald Welte01d982c2018-02-25 01:31:40 +01001623 msg_type := RSL_MT_ERROR_REPORT,
1624 ies := {
1625 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)}),
1626 *
1627 }
1628 }
1629
Harald Welte643e2a62017-11-27 15:03:18 +01001630
Harald Welte9958a4d2017-12-14 21:21:33 +01001631
1632 /* Abis/IP specific messages */
1633
1634 template RSL_Message tr_RSL_IPA_CRCX(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001635 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01001636 msg_type := RSL_MT_IPAC_CRCX,
1637 ies := {
1638 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1639 *
1640 }
1641 }
Harald Welteefa7d912018-04-18 23:22:15 +02001642 template (value) RSL_Message ts_RSL_IPA_CRCX(template (value) RslChannelNr chan_nr) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001643 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
1644 msg_type := RSL_MT_IPAC_CRCX,
1645 ies := {
1646 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1647 }
1648 }
1649
Harald Welte9958a4d2017-12-14 21:21:33 +01001650
Harald Welteefa7d912018-04-18 23:22:15 +02001651 template (value) RSL_Message ts_RSL_IPA_CRCX_ACK(template (value) RslChannelNr chan_nr,
1652 uint16_t ipa_conn_id, uint32_t local_ip,
1653 uint16_t local_port, uint7_t rtp_pt2) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01001654 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
1655 msg_type := RSL_MT_IPAC_CRCX_ACK,
1656 ies := {
1657 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1658 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
1659 t_RSL_IE(RSL_IE_IPAC_LOCAL_IP, RSL_IE_Body:{ipa_local_ip := local_ip}),
1660 t_RSL_IE(RSL_IE_IPAC_LOCAL_PORT, RSL_IE_Body:{ipa_local_port := local_port}),
1661 t_RSL_IE(RSL_IE_IPAC_RTP_PAYLOAD2, RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
1662 }
1663 }
Harald Welte9abd1282018-02-19 19:18:17 +01001664 template RSL_Message tr_RSL_IPA_CRCX_ACK(template RslChannelNr chan_nr,
1665 template uint16_t ipa_conn_id,
1666 template uint32_t local_ip,
Harald Welte8bd0f822018-02-25 12:43:28 +01001667 template uint16_t local_port) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001668 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001669 msg_type := RSL_MT_IPAC_CRCX_ACK,
1670 ies := {
1671 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1672 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
1673 tr_RSL_IE(RSL_IE_Body:{ipa_local_ip := local_ip}),
Harald Welte8bd0f822018-02-25 12:43:28 +01001674 tr_RSL_IE(RSL_IE_Body:{ipa_local_port := local_port})
1675 /* Optional: RTP Payload Type 2 IE */
Harald Welte9abd1282018-02-19 19:18:17 +01001676 }
1677 }
Harald Welte9958a4d2017-12-14 21:21:33 +01001678
Harald Welteefa7d912018-04-18 23:22:15 +02001679 template (value) RSL_Message ts_RSL_IPA_CRCX_NACK(template (value) RslChannelNr chan_nr,
1680 RSL_Cause cause) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01001681 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
1682 msg_type := RSL_MT_IPAC_CRCX_NACK,
1683 ies := {
1684 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1685 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
1686 }
1687 }
Harald Welte9abd1282018-02-19 19:18:17 +01001688 template RSL_Message tr_RSL_IPA_CRCX_NACK(template RslChannelNr chan_nr,
1689 template RSL_Cause cause := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001690 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001691 msg_type := RSL_MT_IPAC_CRCX_NACK,
1692 ies := {
1693 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1694 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
1695 }
1696 }
Harald Welte9958a4d2017-12-14 21:21:33 +01001697
Harald Welteefa7d912018-04-18 23:22:15 +02001698 template (value) RSL_Message ts_RSL_IPA_MDCX(template (value) RslChannelNr chan_nr,
1699 uint16_t ipa_conn_id,
1700 uint32_t remote_ip, uint16_t remote_port,
1701 uint7_t rtp_pt2) := {
Harald Welte30527452018-02-25 12:46:25 +01001702 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
1703 msg_type := RSL_MT_IPAC_MDCX,
1704 ies := {
1705 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1706 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
1707 t_RSL_IE(RSL_IE_IPAC_REMOTE_IP, RSL_IE_Body:{ipa_remote_ip := remote_ip}),
1708 t_RSL_IE(RSL_IE_IPAC_REMOTE_PORT, RSL_IE_Body:{ipa_remote_port := remote_port}),
1709 /* optional: RTP Payload Type */
1710 t_RSL_IE(RSL_IE_IPAC_RTP_PAYLOAD2, RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
1711 }
1712 }
Harald Welte9958a4d2017-12-14 21:21:33 +01001713 template RSL_Message tr_RSL_IPA_MDCX(template RslChannelNr chan_nr,
1714 template uint16_t ipa_conn_id) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001715 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01001716 msg_type := RSL_MT_IPAC_MDCX,
1717 ies := {
1718 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1719 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
1720 *
1721 }
1722 }
1723
Harald Welteefa7d912018-04-18 23:22:15 +02001724 template (value) RSL_Message ts_RSL_IPA_MDCX_ACK(template (value) RslChannelNr chan_nr,
1725 uint16_t ipa_conn_id,
1726 uint32_t local_ip, uint16_t local_port,
1727 uint7_t rtp_pt2) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01001728 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte71b5ec82017-12-16 23:01:10 +01001729 msg_type := RSL_MT_IPAC_MDCX_ACK,
Harald Welte9958a4d2017-12-14 21:21:33 +01001730 ies := {
1731 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1732 /* optional */
1733 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
Harald Welte6cb400a2018-02-25 12:45:25 +01001734 t_RSL_IE(RSL_IE_IPAC_LOCAL_IP, RSL_IE_Body:{ipa_local_ip := local_ip}),
1735 t_RSL_IE(RSL_IE_IPAC_LOCAL_PORT, RSL_IE_Body:{ipa_local_port := local_port}),
Harald Welte9958a4d2017-12-14 21:21:33 +01001736 /* optional: RTP Payload Type */
1737 t_RSL_IE(RSL_IE_IPAC_RTP_PAYLOAD2, RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
1738 }
1739 }
Harald Welte30527452018-02-25 12:46:25 +01001740 template RSL_Message tr_RSL_IPA_MDCX_ACK(template RslChannelNr chan_nr,
1741 template uint16_t ipa_conn_id,
1742 template uint32_t local_ip,
1743 template uint16_t local_port,
1744 template uint7_t rtp_pt2) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001745 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte30527452018-02-25 12:46:25 +01001746 msg_type := RSL_MT_IPAC_MDCX_ACK,
1747 ies := {
1748 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1749 /* optional */
1750 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
1751 tr_RSL_IE(RSL_IE_Body:{ipa_local_ip := local_ip}),
1752 tr_RSL_IE(RSL_IE_Body:{ipa_local_port := local_port}),
1753 /* optional: RTP Payload Type */
1754 tr_RSL_IE(RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
1755 }
1756 }
Harald Welte9958a4d2017-12-14 21:21:33 +01001757
Harald Welteefa7d912018-04-18 23:22:15 +02001758 template (value) RSL_Message ts_RSL_IPA_MDCX_NACK(template (value) RslChannelNr chan_nr,
1759 RSL_Cause cause,
1760 template (value) uint16_t ipa_conn_id) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01001761 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
1762 msg_type := RSL_MT_IPAC_MDCX_NACK,
1763 ies := {
1764 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1765 /* optional connection ID */
1766 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
1767 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
1768 }
1769 }
Harald Welte30527452018-02-25 12:46:25 +01001770 template RSL_Message tr_RSL_IPA_MDCX_NACK(template RslChannelNr chan_nr,
1771 template RSL_Cause cause,
1772 template uint16_t ipa_conn_id) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001773 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte30527452018-02-25 12:46:25 +01001774 msg_type := RSL_MT_IPAC_MDCX_NACK,
1775 ies := {
1776 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1777 /* optional connection ID */
1778 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
1779 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
1780 }
1781 }
1782
Harald Welte9958a4d2017-12-14 21:21:33 +01001783
Harald Welteefa7d912018-04-18 23:22:15 +02001784 template (value) RSL_Message ts_RSL_IPA_DLCX_IND(template (value) RslChannelNr chan_nr,
1785 uint16_t ipa_conn_id,
1786 template (value) RSL_IE_IPA_ConnectionStats stats,
1787 RSL_Cause cause) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01001788 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
1789 msg_type := RSL_MT_IPAC_DLCX_IND,
1790 ies := {
1791 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1792 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
1793 t_RSL_IE(RSL_IE_IPAC_CONN_STAT, RSL_IE_Body:{ipa_stats := stats}),
1794 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
1795 }
1796 }
1797
Harald Welteefa7d912018-04-18 23:22:15 +02001798 template (value) RSL_Message ts_RSL_IPA_DLCX(template (value) RslChannelNr chan_nr,
1799 uint16_t ipa_conn_id) := {
Harald Weltea871a382018-02-25 02:03:14 +01001800 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
1801 msg_type := RSL_MT_IPAC_DLCX,
1802 ies := {
Harald Welte2a7e7162018-02-25 12:46:48 +01001803 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1804 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id})
Harald Weltea871a382018-02-25 02:03:14 +01001805 }
1806 }
Harald Welte9958a4d2017-12-14 21:21:33 +01001807 template RSL_Message tr_RSL_IPA_DLCX(template RslChannelNr chan_nr,
1808 template uint16_t ipa_conn_id := omit) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001809 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01001810 msg_type := RSL_MT_IPAC_DLCX,
1811 ies := {
1812 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1813 /* FIXME: optional conn_id */
1814 *
1815 }
1816 }
1817
Harald Welteefa7d912018-04-18 23:22:15 +02001818 template (value) RSL_Message ts_RSL_IPA_DLCX_ACK(template (value) RslChannelNr chan_nr,
1819 uint16_t ipa_conn_id,
1820 RSL_IE_IPA_ConnectionStats stats) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01001821 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
1822 msg_type := RSL_MT_IPAC_DLCX_ACK,
1823 ies := {
1824 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1825 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
1826 t_RSL_IE(RSL_IE_IPAC_CONN_STAT, RSL_IE_Body:{ipa_stats := stats})
1827 }
1828 }
Harald Weltea871a382018-02-25 02:03:14 +01001829 template RSL_Message tr_RSL_IPA_DLCX_ACK(template RslChannelNr chan_nr,
1830 template uint16_t ipa_conn_id,
1831 template RSL_IE_IPA_ConnectionStats stats) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001832 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Weltea871a382018-02-25 02:03:14 +01001833 msg_type := RSL_MT_IPAC_DLCX_ACK,
1834 ies := {
1835 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1836 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
1837 tr_RSL_IE(RSL_IE_Body:{ipa_stats := stats})
1838 }
1839 }
1840
1841
Harald Welte9958a4d2017-12-14 21:21:33 +01001842
Harald Welteefa7d912018-04-18 23:22:15 +02001843 template (value) RSL_Message ts_RSL_IPA_DLCX_NACK(template (value) RslChannelNr chan_nr,
1844 RSL_Cause cause, uint16_t ipa_conn_id) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01001845 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
1846 msg_type := RSL_MT_IPAC_DLCX_NACK,
1847 ies := {
1848 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1849 /* optional connection ID */
1850 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
1851 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
1852 }
1853 }
Harald Weltea871a382018-02-25 02:03:14 +01001854 template RSL_Message tr_RSL_IPA_DLCX_NACK(template RslChannelNr chan_nr,
1855 template RSL_Cause cause) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001856 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Weltea871a382018-02-25 02:03:14 +01001857 msg_type := RSL_MT_IPAC_DLCX_NACK,
1858 ies := {
1859 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1860 /* optional connection ID */
1861 *,
1862 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
1863 }
1864 }
1865
Harald Welte9958a4d2017-12-14 21:21:33 +01001866
Harald Welteefa7d912018-04-18 23:22:15 +02001867 template (value) RSL_Message ts_RSL_IPA_PDCH_ACT(RslChannelNr chan_nr) := {
Harald Welteee19c732018-04-05 09:08:26 +02001868 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1869 msg_type := RSL_MT_IPAC_PDCH_ACT,
1870 ies := {
1871 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1872 }
1873 }
Harald Welte9958a4d2017-12-14 21:21:33 +01001874 template RSL_Message tr_RSL_IPA_PDCH_ACT(template RslChannelNr chan_nr) := {
Harald Welteee19c732018-04-05 09:08:26 +02001875 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01001876 msg_type := RSL_MT_IPAC_PDCH_ACT,
1877 ies := {
1878 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
1879 }
1880 }
1881
Harald Welteee19c732018-04-05 09:08:26 +02001882
Harald Welte94e0c342018-04-07 11:33:23 +02001883 template RSL_Message ts_RSL_IPA_PDCH_ACT_ACK(RslChannelNr chan_nr,
1884 template (value) RSL_IE_FrameNumber fn) := {
Harald Welteee19c732018-04-05 09:08:26 +02001885 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01001886 msg_type := RSL_MT_IPAC_PDCH_ACT_ACK,
1887 ies := {
1888 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1889 t_RSL_IE(RSL_IE_FRAME_NUMBER, RSL_IE_Body:{frame_nr := fn})
1890 }
1891 }
Harald Welteee19c732018-04-05 09:08:26 +02001892 template RSL_Message tr_RSL_IPA_PDCH_ACT_ACK(template RslChannelNr chan_nr,
1893 template RSL_IE_FrameNumber fn) := {
1894 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1895 msg_type := RSL_MT_IPAC_PDCH_ACT_ACK,
1896 ies := {
1897 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1898 tr_RSL_IE(RSL_IE_Body:{frame_nr := fn})
1899 }
1900 }
Harald Welte9958a4d2017-12-14 21:21:33 +01001901
1902 template RSL_Message ts_RSL_IPA_PDCH_ACT_NACK(RslChannelNr chan_nr, RSL_Cause cause) := {
Harald Welteee19c732018-04-05 09:08:26 +02001903 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01001904 msg_type := RSL_MT_IPAC_PDCH_ACT_NACK,
1905 ies := {
1906 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1907 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
1908 }
1909 }
Harald Welteee19c732018-04-05 09:08:26 +02001910 template RSL_Message tr_RSL_IPA_PDCH_ACT_NACK(template RslChannelNr chan_nr,
1911 template RSL_Cause cause) := {
1912 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1913 msg_type := RSL_MT_IPAC_PDCH_ACT_NACK,
1914 ies := {
1915 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1916 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
1917 }
1918 }
Harald Welte9958a4d2017-12-14 21:21:33 +01001919
Harald Welteee19c732018-04-05 09:08:26 +02001920 template RSL_Message ts_RSL_IPA_PDCH_DEACT(RslChannelNr chan_nr) := {
1921 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1922 msg_type := RSL_MT_IPAC_PDCH_DEACT,
1923 ies := {
1924 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1925 }
1926 }
Harald Welte9958a4d2017-12-14 21:21:33 +01001927 template RSL_Message tr_RSL_IPA_PDCH_DEACT(template RslChannelNr chan_nr) := {
Harald Welteee19c732018-04-05 09:08:26 +02001928 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01001929 msg_type := RSL_MT_IPAC_PDCH_DEACT,
1930 ies := {
1931 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
1932 }
1933 }
1934
1935 template RSL_Message ts_RSL_IPA_PDCH_DEACT_ACK(RslChannelNr chan_nr) := {
Harald Welteee19c732018-04-05 09:08:26 +02001936 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01001937 msg_type := RSL_MT_IPAC_PDCH_DEACT_ACK,
1938 ies := {
1939 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1940 }
1941 }
Harald Welteee19c732018-04-05 09:08:26 +02001942 template RSL_Message tr_RSL_IPA_PDCH_DEACT_ACK(template RslChannelNr chan_nr) := {
1943 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1944 msg_type := RSL_MT_IPAC_PDCH_DEACT_ACK,
1945 ies := {
1946 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
1947 }
1948 }
Harald Welte9958a4d2017-12-14 21:21:33 +01001949
1950 template RSL_Message ts_RSL_IPA_PDCH_DEACT_NACK(RslChannelNr chan_nr, RSL_Cause cause) := {
Harald Welteee19c732018-04-05 09:08:26 +02001951 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01001952 msg_type := RSL_MT_IPAC_PDCH_DEACT_NACK,
1953 ies := {
1954 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1955 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
1956 }
1957 }
Harald Welteee19c732018-04-05 09:08:26 +02001958 template RSL_Message tr_RSL_IPA_PDCH_DEACT_NACK(template RslChannelNr chan_nr,
1959 template RSL_Cause cause) := {
1960 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1961 msg_type := RSL_MT_IPAC_PDCH_DEACT_NACK,
1962 ies := {
1963 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1964 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
1965 }
1966 }
Harald Welte9958a4d2017-12-14 21:21:33 +01001967
1968
Harald Welte6a8199d2018-01-29 21:58:53 +01001969 function f_rsl_find_ie(RSL_Message msg, RSL_IE_Type iei, out RSL_IE_Body ret) return boolean {
1970 for (var integer i := 0; i < sizeof(msg.ies); i := i+1) {
1971 if (msg.ies[i].iei == iei) {
1972 ret := msg.ies[i].body;
1973 return true;
1974 }
1975 }
1976 return false;
1977 }
1978
1979
Harald Welte9958a4d2017-12-14 21:21:33 +01001980
Harald Welte643e2a62017-11-27 15:03:18 +01001981} with { encode "RAW" ; variant "FIELDORDER(msb)" }