blob: 2d9c92ecc814bef705c5688333b0e4a58b86f5d6 [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,
276 uint3_t a_bits
277 }
278
279 template RSL_IE_ActivationType t_RSL_IE_ActType := {
280 reactivation := false,
281 reserved := 0,
282 a_bits := 0 /* related to immediate assignment */
283 }
284
Harald Welte94e0c342018-04-07 11:33:23 +0200285 /* osmocom-style dynamic PDCH */
286 template RSL_IE_ActivationType t_RSL_IE_ActType_PDCH := {
287 reactivation := false,
288 reserved := 1,
289 a_bits := 7 /* related to immediate assignment */
290 }
291
Harald Welte643e2a62017-11-27 15:03:18 +0100292 /* 9.3.6 */
293 type enumerated RSL_SpeechDataInd {
294 RSL_SPDI_SPEECH ('00000001'B),
295 RSL_SPDI_DATA ('00000010'B),
296 RSL_SPDI_SIGN ('00000011'B)
297 } with { variant "FIELDLENGTH(8)" };
298 type enumerated RSL_ChanRateType {
299 RSL_CHRT_SDCCH ('00000001'B),
300 RSL_CHRT_TCH_F ('00001000'B),
301 RSL_CHRT_TCH_H ('00001001'B),
302 RSL_CHRT_TCH_F_BD_MSLOT ('00001010'B),
303 RSL_CHRT_TCH_F_DL_MSLOT ('00011010'B),
304 RSL_CHRT_TCH_F_GROUP ('00011000'B),
305 RSL_CHRT_TCH_H_GROUP ('00011001'B),
306 RSL_CHRT_TCH_F_BCAST ('00101000'B),
307 RSL_CHRT_TCH_H_BCAST ('00101001'B)
308 } with { variant "FIELDLENGTH(8)" };
309 type enumerated RSL_SpeechAlgo {
310 RSL_CMOD_NO_RESOURCE ('00000000'B),
311 RSL_CMOD_SP_GSM1 ('00000001'B),
312 RSL_CMOD_SP_GSM2 ('00010001'B),
313 RSL_CMOD_SP_GSM3 ('00100001'B),
314 RSL_CMOD_SP_GSM4 ('00110001'B),
315 RSL_CMOD_SP_GSM5 ('00001001'B),
316 RSL_CMOD_SP_GSM6 ('00001101'B)
317 } with { variant "FIELDLENGTH(8)" };
318 type record RSL_IE_ChannelMode {
Harald Welte8f2c21d2017-12-07 17:52:40 +0100319 uint8_t len,
Harald Welte643e2a62017-11-27 15:03:18 +0100320 BIT6 reserved,
321 boolean dtx_d,
322 boolean dtx_u,
323 RSL_SpeechDataInd spd_ind,
324 RSL_ChanRateType ch_rate_type,
325 RSL_SpeechAlgo coding_alg_rate
Harald Welte8f2c21d2017-12-07 17:52:40 +0100326 } with { variant (len) "LENGTHTO(reserved,dtx_d,dtx_u,spd_ind,ch_rate_type,coding_alg_rate)" }
Harald Welte643e2a62017-11-27 15:03:18 +0100327
Harald Welteefa7d912018-04-18 23:22:15 +0200328 template (value) RSL_IE_ChannelMode ts_RSL_ChanMode_SIGN := {
Harald Welte8f2c21d2017-12-07 17:52:40 +0100329 len := 0, /* overwritten */
Harald Welte643e2a62017-11-27 15:03:18 +0100330 reserved := '000000'B,
331 dtx_d := false,
332 dtx_u := false,
333 spd_ind := RSL_SPDI_SIGN,
334 ch_rate_type := RSL_CHRT_SDCCH,
335 coding_alg_rate := RSL_CMOD_NO_RESOURCE
336 }
337
Harald Welteefa7d912018-04-18 23:22:15 +0200338 template (value) RSL_IE_ChannelMode ts_RSL_ChanMode(RSL_ChanRateType t, RSL_SpeechAlgo alg) := {
Harald Welte8f2c21d2017-12-07 17:52:40 +0100339 len := 0, /* overwritten */
Harald Welte643e2a62017-11-27 15:03:18 +0100340 reserved := '000000'B,
341 dtx_d := false,
342 dtx_u := false,
343 spd_ind := RSL_SPDI_SPEECH,
344 ch_rate_type := t,
345 coding_alg_rate := alg
346 }
Harald Welte3618d9d2018-03-21 18:45:27 +0100347 template RSL_IE_ChannelMode tr_RSL_ChanMode(template RSL_ChanRateType t,
348 template RSL_SpeechAlgo alg) := {
349 len := ?,
350 reserved := '000000'B,
351 dtx_d := ?,
352 dtx_u := ?,
353 spd_ind := RSL_SPDI_SPEECH,
354 ch_rate_type := t,
355 coding_alg_rate := alg
356 }
Harald Welte643e2a62017-11-27 15:03:18 +0100357
358 /* 9.3.4 */
359 type record RSL_IE_BS_Power {
360 uint1_t reserved,
361 boolean epc,
362 boolean fpc,
363 uint5_t power_level
364 }
365
Harald Welte73cd2712017-12-17 00:44:52 +0100366 /* 9.3.7 */
367 type record RSL_IE_EncryptionInfo {
368 uint8_t len,
369 OCT1 alg_id,
370 octetstring key
371 } with { variant (len) "LENGTHTO(alg_id,key)" };
372
373 template RSL_IE_EncryptionInfo tr_RSL_IE_EncrInfo(template OCT1 alg, template octetstring key) := {
374 len := ?,
375 alg_id := alg,
376 key := key
377 }
Harald Welteefa7d912018-04-18 23:22:15 +0200378 template (value) RSL_IE_EncryptionInfo ts_RSL_IE_EncrInfo(OCT1 alg, octetstring key) := {
379 len := 0, /* overwritten */
380 alg_id := alg,
381 key := key
382 }
383
384
Harald Welte73cd2712017-12-17 00:44:52 +0100385
Harald Welte643e2a62017-11-27 15:03:18 +0100386 /* 9.3.8 */
387 type record RSL_IE_FrameNumber {
388 uint5_t t1_p,
389 uint6_t t3,
390 uint5_t t2
391 }
392 type RSL_IE_FrameNumber RSL_IE_StartingTime;
393
394 /* 9.3.10 */
395 type record RSL_IE_L1Info {
396 uint5_t ms_power_lvl,
397 boolean fpc,
398 uint2_t reserved,
399 uint8_t actual_ta
400 }
401
402 /* 9.3.13 */
403 type record RSL_IE_MS_Power {
404 uint2_t reserved,
405 boolean fpc_epc,
406 uint5_t power_level
407 }
408
Harald Welted5f521e2017-12-07 17:53:06 +0100409 /* 9.3.18 */
410 type record RSL_IE_RachLoad {
411 uint8_t len,
412 uint16_t slot_count,
413 uint16_t busy_count,
414 uint16_t access_count
415 } with { variant (len) "LENGTHTO(slot_count,busy_count,access_count)" }
416
Harald Welteefa7d912018-04-18 23:22:15 +0200417 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 +0100418 len := 0, /* overwritten */
419 slot_count := slot,
420 busy_count := busy,
421 access_count := acc
422 }
423
Harald Welte68e495b2018-02-25 00:05:57 +0100424 template RSL_IE_RachLoad tr_RSL_IE_RachLoad(template uint16_t slot,
425 template uint16_t busy,
426 template uint16_t acc) := {
427 len := ?, /* overwritten */
428 slot_count := slot,
429 busy_count := busy,
430 access_count := acc
431 }
432
Harald Welte643e2a62017-11-27 15:03:18 +0100433 /* 9.3.19 */
434 type record RSL_IE_RequestRef {
435 OCT1 ra,
436 RSL_IE_FrameNumber frame_nr
437 }
438
439 /* 3GPP TS 44.018 / 10.5.2.38 Starting Time */
Harald Welte94e0c342018-04-07 11:33:23 +0200440 template (value) RSL_IE_FrameNumber ts_RSL_IE_FrameNumber(GsmFrameNumber fn) := {
Harald Welte643e2a62017-11-27 15:03:18 +0100441 t1_p := (fn / 1326) mod 32,
442 t3 := fn mod 51,
443 t2 := fn mod 26
444 }
445
Harald Welte9abd1282018-02-19 19:18:17 +0100446 function tr_RSL_IE_FrameNumber(template GsmFrameNumber fn) return template RSL_IE_FrameNumber {
447 if (istemplatekind(fn, "?")) {
448 return ?;
449 } else {
450 return ts_RSL_IE_FrameNumber(valueof(fn));
451 }
452 }
453
Harald Welteefa7d912018-04-18 23:22:15 +0200454 template (value) RSL_IE_RequestRef ts_RSL_IE_ReqRef(OCT1 ra, GsmFrameNumber frame_nr) := {
Harald Welte643e2a62017-11-27 15:03:18 +0100455 ra := ra,
456 frame_nr := ts_RSL_IE_FrameNumber(frame_nr)
457 }
458
Harald Welte9abd1282018-02-19 19:18:17 +0100459 template RSL_IE_RequestRef tr_RSL_IE_ReqRef(template OCT1 ra, template GsmFrameNumber frame_nr) := {
460 ra := ra,
461 frame_nr := tr_RSL_IE_FrameNumber(frame_nr)
462 }
463
Harald Welte2691adf2018-02-22 17:32:39 +0100464 /* 9.3.25 */
465 type record RSL_IE_UplinkMeas {
466 uint8_t len,
467 BIT1 rfu,
468 boolean dtx_d,
469 uint6_t rxlev_f_u,
470 BIT2 reserved1,
471 uint6_t rxlev_s_u,
472 BIT2 reserved2,
473 uint3_t rxq_f_u,
474 uint3_t rxq_s_u,
475 octetstring supp_meas_info optional
476 } 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 +0100477
Harald Welte643e2a62017-11-27 15:03:18 +0100478 /* 9.3.26 */
Harald Weltea8ed9062017-12-14 09:46:01 +0100479 type enumerated RSL_Cause {
480 /* normal event */
481 RSL_ERR_RADIO_IF_FAIL ('00'O),
482 RSL_ERR_RADIO_LINK_FAIL ('01'O),
483 RSL_ERR_HANDOVER_ACC_FAIL ('02'O),
484 RSL_ERR_TALKER_ACC_FAIL ('03'O),
485 RSL_ERR_OM_INTERVENTION ('07'O),
486 RSL_ERR_NORMAL_UNSPEC ('0f'O),
487 RSL_ERR_T_MSRFPCI_EXP ('18'O),
488 /* resource unavailable */
489 RSL_ERR_EQUIPMENT_FAIL ('20'O),
490 RSL_ERR_RR_UNAVAIL ('21'O),
491 RSL_ERR_TERR_CH_FAIL ('22'O),
492 RSL_ERR_CCCH_OVERLOAD ('23'O),
493 RSL_ERR_ACCH_OVERLOAD ('24'O),
494 RSL_ERR_PROCESSOR_OVERLOAD ('25'O),
495 RSL_ERR_BTS_NOT_EQUIPPED ('27'O),
496 RSL_ERR_REMOTE_TRAU_FAILURE ('28'O),
497 RSL_ERR_NOTIF_OVERFLOW ('29'O),
498 RSL_ERR_RES_UNAVAIL ('2f'O),
499 /* service or option not available */
500 RSL_ERR_TRANSC_UNAVAIL ('30'O),
501 RSL_ERR_SERV_OPT_UNAVAIL ('3f'O),
502 /* service or option not implemented */
503 RSL_ERR_ENCR_UNIMPL ('40'O),
504 RSL_ERR_SERV_OPT_UNIMPL ('4f'O),
505 /* invalid message */
506 RSL_ERR_RCH_ALR_ACTV_ALLOC ('50'O),
Harald Welte9912eb52018-02-25 13:30:15 +0100507 RSL_ERR_IPA_RCH_NOT_ACTV_ALLOC ('51'O),
508 RSL_ERR_IPA_CONN_INVALID ('52'O),
509 RSL_ERR_IPA_CONN_IN_USE ('53'O),
510 RSL_ERR_IPA_CONN_ALREADY_EXISTS ('54'O),
Harald Weltea8ed9062017-12-14 09:46:01 +0100511 RSL_ERR_INVALID_MESSAGE ('5f'O),
512 /* protocol error */
513 RSL_ERR_MSG_DISCR ('60'O),
514 RSL_ERR_MSG_TYPE ('61'O),
515 RSL_ERR_MSG_SEQ ('62'O),
516 RSL_ERR_IE_ERROR ('63'O),
517 RSL_ERR_MAND_IE_ERROR ('64'O),
518 RSL_ERR_OPT_IE_ERROR ('65'O),
519 RSL_ERR_IE_NONEXIST ('66'O),
520 RSL_ERR_IE_LENGTH ('67'O),
521 RSL_ERR_IE_CONTENT ('68'O),
522 RSL_ERR_PROTO ('6f'O),
523 /* interworking */
524 RSL_ERR_INTERWORKING ('7f'O)
525 };
Harald Welte643e2a62017-11-27 15:03:18 +0100526 type record RSL_IE_Cause {
Harald Welte6efa8e32017-12-09 22:34:06 +0100527 uint8_t len,
Harald Welte643e2a62017-11-27 15:03:18 +0100528 uint1_t e,
529 RSL_Cause cause,
530 octetstring cause_ext optional
Harald Welte6efa8e32017-12-09 22:34:06 +0100531 } with { variant (len) "LENGTHTO(e,cause,cause_ext)" }
Harald Welte643e2a62017-11-27 15:03:18 +0100532
Harald Welteefa7d912018-04-18 23:22:15 +0200533 template (value) RSL_IE_Cause ts_RSL_IE_Cause(RSL_Cause cause) := {
Harald Welte6efa8e32017-12-09 22:34:06 +0100534 len := 0, /* overwritten */
Harald Welte643e2a62017-11-27 15:03:18 +0100535 e := 0,
536 cause := cause,
537 cause_ext := omit
538 }
539
Harald Welte9abd1282018-02-19 19:18:17 +0100540 template RSL_IE_Cause tr_RSL_IE_Cause(template RSL_Cause cause) := {
541 len := ?,
542 e := 0,
543 cause := cause,
544 cause_ext := omit
545 }
546
Harald Welte643e2a62017-11-27 15:03:18 +0100547 /* 9.3.40 */
548 type enumerated RSL_ChanNeeded {
549 RSL_CHANNEED_ANY ('00'B),
550 RSL_CHANNEED_SDCCH ('01'B),
551 RSL_CHANNEED_TCH_F ('10'B),
552 RSL_CHANNEED_TCH_ForH ('11'B)
Harald Welte51d74102017-12-10 23:05:02 +0100553 } with { variant "FIELDLENGTH(2)" };
Harald Welte643e2a62017-11-27 15:03:18 +0100554 type record RSL_IE_ChanNeeded {
555 uint6_t reserved,
556 RSL_ChanNeeded chan_needed
557 }
558
559 /* 9.3.53 */
560 type record RSL_IE_MultirateCtrl {
561 uint3_t spare,
562 boolean od,
563 boolean pre,
564 uint2_t rae,
565 boolean tfo
566 }
567
568 type enumerated RSL_IE_SysinfoType {
569 RSL_SYSTEM_INFO_8 ('00000000'B),
570 RSL_SYSTEM_INFO_1 ('00000001'B),
571 RSL_SYSTEM_INFO_2 ('00000010'B),
572 RSL_SYSTEM_INFO_3 ('00000011'B),
573 RSL_SYSTEM_INFO_4 ('00000100'B),
574 RSL_SYSTEM_INFO_5 ('00000101'B),
575 RSL_SYSTEM_INFO_6 ('00000110'B),
576 RSL_SYSTEM_INFO_7 ('00000111'B),
577 RSL_SYSTEM_INFO_16 ('00001000'B),
578 RSL_SYSTEM_INFO_17 ('00001001'B),
579 RSL_SYSTEM_INFO_2bis ('00001010'B),
580 RSL_SYSTEM_INFO_2ter ('00001011'B),
581 RSL_SYSTEM_INFO_5bis ('00001101'B),
582 RSL_SYSTEM_INFO_5ter ('00001110'B),
583 RSL_SYSTEM_INFO_10 ('00001111'B),
584 RSL_EXT_MEAS_ORDER ('01000111'B),
585 RSL_MEAS_INFO ('01001000'B),
586 RSL_SYSTEM_INFO_13 ('00101000'B),
587 RSL_ERIC_SYSTEM_INFO_13 ('00001100'B),
588 RSL_SYSTEM_INFO_2quater ('00101001'B),
589 RSL_SYSTEM_INFO_9 ('00101010'B),
590 RSL_SYSTEM_INFO_18 ('00101011'B),
591 RSL_SYSTEM_INFO_19 ('00101100'B),
592 RSL_SYSTEM_INFO_20 ('00101101'B)
593 } with { variant "FIELDLENGTH(8)" }
594
Harald Welte9958a4d2017-12-14 21:21:33 +0100595 type record RSL_IE_IPA_ConnectionStats {
596 uint8_t len,
597 uint32_t tx_packets,
598 uint32_t tx_octets,
599 uint32_t rx_packets,
600 uint32_t rx_octets,
601 uint32_t lost_packets,
602 uint32_t jitter,
603 uint32_t avg_delay
604 } with { variant (len) "LENGTHTO(tx_packets,tx_octets,rx_packets,rx_octets,lost_packets,jitter,avg_delay)" }
605
606 type enumerated RSL_IPA_SpeechMode {
607 RSL_IPA_SPM_SENDRECV ('00'B),
608 RSL_IPA_SPM_RECVONLY ('01'B),
609 RSL_IPA_SPM_SENDONLY ('10'B),
610 RSL_IPA_SPM_RESERVED ('11'B)
611 } with { variant "FIELDLENGTH(2)" }
612
613 type enumerated RSL_IPA_Codec {
614 RSL_IPA_CODEC_FR ('0000'B),
615 RSL_IPA_CODEC_EFR ('0001'B),
616 RSL_IPA_CODEC_AMR_F ('0010'B),
617 RSL_IPA_CODEC_HR ('0011'B),
618 RSL_IPA_CODEC_AMR_H ('0101'B),
619 RSL_IPA_CODEC_RTP_PT ('1111'B)
620 } with { variant "FIELDLENGTH(4)" }
621
622 type record RSL_IE_IPA_SpeechMode {
623 BIT2 reserved,
624 RSL_IPA_SpeechMode mode,
625 RSL_IPA_Codec codec
626 }
627
Harald Welte0472ab42018-03-12 15:02:26 +0100628 /* 9.3.20 */
629 type enumerated RSL_IE_ReleaseMode {
630 RSL_REL_MODE_NORMAL ('00'B),
631 REL_REL_MODE_LOCAL ('01'B)
632 }
633
Harald Welte643e2a62017-11-27 15:03:18 +0100634 /* union of all IE bodies */
635 type union RSL_IE_Body {
636 RslChannelNr chan_nr,
637 RslLinkId link_id,
Harald Welte15bb5b52017-12-07 17:52:04 +0100638 RSL_L16V l3_info,
Harald Welte643e2a62017-11-27 15:03:18 +0100639 RSL_LV rlm_cause,
Harald Welte0472ab42018-03-12 15:02:26 +0100640 RSL_IE_ReleaseMode release_mode,
Harald Welte643e2a62017-11-27 15:03:18 +0100641 RSL_IE_ActivationType act_type,
642 RSL_IE_ChannelMode chan_mode,
643 uint8_t handover_ref,
644 RSL_IE_BS_Power bs_power,
645 RSL_IE_MS_Power ms_power,
646 uint8_t timing_adv,
647 RSL_IE_MultirateCtrl multirate_ctrl,
648 RSL_IE_FrameNumber frame_nr,
649 RSL_IE_Cause cause,
650 uint8_t access_delay,
Harald Welted5f521e2017-12-07 17:53:06 +0100651 RSL_IE_RachLoad rach_load,
Harald Welte643e2a62017-11-27 15:03:18 +0100652 uint8_t meas_res_nr,
Harald Welte2691adf2018-02-22 17:32:39 +0100653 uint8_t ms_timing_offset,
654 RSL_IE_UplinkMeas uplink_meas,
Harald Welte643e2a62017-11-27 15:03:18 +0100655 RSL_IE_L1Info l1_info,
656 RSL_IE_SysinfoType sysinfo_type,
657 uint16_t paging_load,
658 uint8_t paging_group,
659 RSL_IE_ChanNeeded chan_needed,
660 RSL_IE_StartingTime starting_time,
Harald Welte73cd2712017-12-17 00:44:52 +0100661 RSL_IE_EncryptionInfo encr_info,
Harald Welte643e2a62017-11-27 15:03:18 +0100662 RSL_IE_RequestRef req_ref,
663 RSL_LV full_imm_ass_info,
Harald Weltefff69302017-12-07 17:53:42 +0100664 RSL_LV ms_identity,
Harald Welte643e2a62017-11-27 15:03:18 +0100665
Harald Welte9958a4d2017-12-14 21:21:33 +0100666 uint16_t ipa_conn_id,
667 uint16_t ipa_local_port,
668 uint16_t ipa_remote_port,
669 uint32_t ipa_local_ip,
670 uint32_t ipa_remote_ip,
671 uint8_t ipa_rtp_pt,
672 uint8_t ipa_rtp_pt2,
673 RSL_IE_IPA_ConnectionStats ipa_stats,
674 RSL_IE_IPA_SpeechMode ipa_speech_mode,
675
Harald Welte643e2a62017-11-27 15:03:18 +0100676 RSL_LV other
677 }
678
679 type record RSL_IE {
680 RSL_IE_Type iei,
681 RSL_IE_Body body
682 } with { variant (body) "CROSSTAG(
683 chan_nr, iei = RSL_IE_CHAN_NR;
684 link_id, iei = RSL_IE_LINK_IDENT;
685 l3_info, iei = RSL_IE_L3_INFO;
686 rlm_cause, iei = RSL_IE_RLM_CAUSE;
687 release_mode, iei = RSL_IE_RELEASE_MODE;
688 act_type, iei = RSL_IE_ACT_TYPE;
689 chan_mode, iei = RSL_IE_CHAN_MODE;
690 handover_ref, iei = RSL_IE_HANDO_REF;
691 bs_power, iei = RSL_IE_BS_POWER;
692 ms_power, iei = RSL_IE_MS_POWER;
693 timing_adv, iei = RSL_IE_TIMING_ADVANCE;
694 multirate_ctrl, iei = RSL_IE_MR_CONTROL;
695
696 frame_nr, iei = RSL_IE_FRAME_NUMBER;
697 cause, iei = RSL_IE_CAUSE;
698 access_delay, iei = RSL_IE_ACCESS_DELAY;
Harald Welted5f521e2017-12-07 17:53:06 +0100699 rach_load, iei = RSL_IE_RACH_LOAD;
Harald Welte643e2a62017-11-27 15:03:18 +0100700 meas_res_nr, iei = RSL_IE_MEAS_RES_NR;
Harald Welte2691adf2018-02-22 17:32:39 +0100701 ms_timing_offset, iei = RSL_IE_MS_TIMING_OFFSET;
702 uplink_meas, iei = RSL_IE_UPLINK_MEAS;
Harald Welte643e2a62017-11-27 15:03:18 +0100703 l1_info, iei = RSL_IE_L1_INFO;
704 sysinfo_type, iei = RSL_IE_SYSINFO_TYPE;
705 paging_load, iei = RSL_IE_PAGING_LOAD;
706 paging_group, iei = RSL_IE_PAGING_GROUP;
707 chan_needed, iei = RSL_IE_CHAN_NEEDED;
708 starting_time, iei = RSL_IE_STARTNG_TIME;
Harald Welte73cd2712017-12-17 00:44:52 +0100709 encr_info, iei = RSL_IE_ENCR_INFO;
Harald Welte643e2a62017-11-27 15:03:18 +0100710
711 req_ref, iei = RSL_IE_REQ_REFERENCE;
Harald Weltefff69302017-12-07 17:53:42 +0100712 full_imm_ass_info, iei = RSL_IE_FULL_IMM_ASS_INFO;
713 ms_identity, iei = RSL_IE_MS_IDENTITY;
714 other, iei = RSL_IE_FULL_BCCH_INFO;
Harald Welte643e2a62017-11-27 15:03:18 +0100715
Harald Welte9958a4d2017-12-14 21:21:33 +0100716 ipa_conn_id, iei = RSL_IE_IPAC_CONN_ID;
717 ipa_remote_ip, iei = RSL_IE_IPAC_REMOTE_IP;
718 ipa_remote_port, iei = RSL_IE_IPAC_REMOTE_PORT;
719 ipa_local_ip, iei = RSL_IE_IPAC_LOCAL_IP;
720 ipa_local_port, iei = RSL_IE_IPAC_LOCAL_PORT;
721 ipa_rtp_pt, iei = RSL_IE_IPAC_RTP_PAYLOAD;
722 ipa_rtp_pt2, iei = RSL_IE_IPAC_RTP_PAYLOAD2;
723 ipa_stats, iei = RSL_IE_IPAC_CONN_STAT;
724 ipa_speech_mode, iei = RSL_IE_IPAC_SPEECH_MODE;
725
Harald Welte643e2a62017-11-27 15:03:18 +0100726 other, OTHERWISE;
727 )" };
728
Harald Welte735dd072017-12-12 14:55:17 +0100729 /* For some reason the TTCN-3 RAW codec cannot automatically figure out the IEI
730 * that it needs to set for a given union-choice (body). So we have to explicitly
731 * specify the IEI by the caller :( */
Harald Welteefa7d912018-04-18 23:22:15 +0200732 template (value) RSL_IE t_RSL_IE(RSL_IE_Type iei, template (value) RSL_IE_Body body) := {
Harald Welte735dd072017-12-12 14:55:17 +0100733 iei := iei,
Harald Welte643e2a62017-11-27 15:03:18 +0100734 body := body
735 }
736
Harald Weltec2877752017-12-07 17:54:35 +0100737 template RSL_IE tr_RSL_IE(template RSL_IE_Body body) := {
738 iei := ?, /* overwritten? */
739 body := body
740 }
741
742
Harald Welte643e2a62017-11-27 15:03:18 +0100743 type record of RSL_IE RSL_IE_List;
744
745 type record RSL_Message {
746 RSL_MessageDiscriminator msg_disc,
747 RSL_MessageType msg_type,
748 RSL_IE_List ies optional
749 }
750
751 external function enc_RSL_Message(in RSL_Message msg) return octetstring
752 with { extension "prototype(convert) encode(RAW)" };
753 external function dec_RSL_Message(in octetstring stream) return RSL_Message
754 with { extension "prototype(convert) decode(RAW)" };
755
Harald Weltebc330be2017-12-09 00:56:36 +0100756 template RSL_Message tr_RSL_MsgDiscType(template RSL_MessageDiscriminator m_disc,
Harald Welte643e2a62017-11-27 15:03:18 +0100757 RSL_MessageType m_type) := {
758 msg_disc := m_disc,
759 msg_type := m_type,
760 ies := *
761 }
762
Harald Welteefa7d912018-04-18 23:22:15 +0200763 template (value) RSL_Message ts_RSL_MsgDiscType(template (value) RSL_MessageDiscriminator m_disc,
764 template (value) RSL_MessageType msg_type,
765 template (omit) RSL_IE_List ies := omit) := {
Harald Welte4a267362017-12-09 17:49:32 +0100766 msg_disc := m_disc,
767 msg_type := msg_type,
768 ies := ies
769 }
770
Harald Weltebc330be2017-12-09 00:56:36 +0100771template RSL_Message tr_RSL_MsgType(template RSL_MessageType msg_type) := {
772 msg_disc := ?,
773 msg_type := msg_type,
774 ies := *
775}
776
777/* Common Channel Management */
778template RSL_Message tr_RSL_MsgTypeC(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
779 msg_disc := { RSL_MDISC_CCHAN, ? }
780}
781
782/* RLL */
783template RSL_Message tr_RSL_MsgTypeR(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
784 msg_disc := { RSL_MDISC_RLL, true }
785}
786
787/* Dedicated Channel Management */
788template RSL_Message tr_RSL_MsgTypeD(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
789 msg_disc := { RSL_MDISC_DCHAN, ? }
790}
791
792/* Dedicated Channel Management */
793template RSL_Message tr_RSL_MsgTypeT(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
794 msg_disc := { RSL_MDISC_TRX_MGMT, ? }
795}
796
797
798/* dedicated channel or RLL */
799template RSL_Message tr_RSL_MsgTypeDR(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
Harald Weltee5408222018-01-29 21:57:58 +0100800 msg_disc := ({RSL_MDISC_DCHAN,?}, {RSL_MDISC_RLL,?}, {RSL_MDISC_IPACCESS,false})
Harald Weltebc330be2017-12-09 00:56:36 +0100801}
802
803
Harald Welte643e2a62017-11-27 15:03:18 +0100804 /* 8.3.1 BSC -> BTS */
Harald Welteefa7d912018-04-18 23:22:15 +0200805 template (value) RSL_Message ts_RSL_DATA_REQ(template (value) RslChannelNr chan_nr,
806 template (value) RslLinkId link_id,
807 octetstring l3_info) := {
Harald Welte643e2a62017-11-27 15:03:18 +0100808 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, true),
809 msg_type := RSL_MT_DATA_REQ,
810 ies :={
Harald Welte735dd072017-12-12 14:55:17 +0100811 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
812 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
813 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
Harald Welte643e2a62017-11-27 15:03:18 +0100814 }
815 }
816
Harald Welte7794d5b2017-12-16 23:00:20 +0100817 template RSL_Message tr_RSL_DATA_REQ(template RslChannelNr chan_nr :=?,
818 template RslLinkId link_id := ?,
819 template octetstring l3_info := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +0200820 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, true),
Harald Welte7794d5b2017-12-16 23:00:20 +0100821 msg_type := RSL_MT_DATA_REQ,
822 ies :={
823 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
824 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
825 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
826 }
827 }
828
829
Harald Welte643e2a62017-11-27 15:03:18 +0100830 /* 8.3.2 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +0200831 template (value) RSL_Message ts_RSL_DATA_IND(template (value) RslChannelNr chan_nr,
832 template (value) RslLinkId link_id,
833 octetstring l3_info) := {
Harald Welte643e2a62017-11-27 15:03:18 +0100834 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, true),
835 msg_type := RSL_MT_DATA_IND,
836 ies :={
Harald Welte735dd072017-12-12 14:55:17 +0100837 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
838 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
839 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
Harald Welte643e2a62017-11-27 15:03:18 +0100840 }
841 }
Harald Welte9abd1282018-02-19 19:18:17 +0100842 template RSL_Message tr_RSL_DATA_IND(template RslChannelNr chan_nr, template RslLinkId link_id,
843 template octetstring l3_info := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +0200844 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, true),
Harald Welte9abd1282018-02-19 19:18:17 +0100845 msg_type := RSL_MT_DATA_IND,
846 ies :={
847 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
848 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
849 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
850 }
851 }
Harald Welte643e2a62017-11-27 15:03:18 +0100852
853 /* 8.3.3 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +0200854 template (value) RSL_Message ts_RSL_ERROR_IND(template (value) RslChannelNr chan_nr,
855 template (value) RslLinkId link_id, RSL_Cause cause) := {
Harald Welte643e2a62017-11-27 15:03:18 +0100856 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
857 msg_type := RSL_MT_ERROR_IND,
858 ies :={
Harald Welte735dd072017-12-12 14:55:17 +0100859 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
860 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
861 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
Harald Welte643e2a62017-11-27 15:03:18 +0100862 }
863 }
Harald Welte9abd1282018-02-19 19:18:17 +0100864 template RSL_Message tr_RSL_ERROR_IND(template RslChannelNr chan_nr, template RslLinkId link_id,
865 template RSL_Cause cause := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +0200866 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Welte9abd1282018-02-19 19:18:17 +0100867 msg_type := RSL_MT_ERROR_IND,
868 ies :={
869 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
870 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
871 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
872 }
873 }
Harald Welte643e2a62017-11-27 15:03:18 +0100874
Harald Welteefa7d912018-04-18 23:22:15 +0200875 /* 8.3.4 BTS <- BSC */
876 template (value) RSL_Message ts_RSL_EST_REQ(template (value) RslChannelNr chan_nr,
877 template (value) RslLinkId link_id) := {
878 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
879 msg_type := RSL_MT_EST_REQ,
880 ies := {
881 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
882 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
883 }
884 }
885 template RSL_Message tr_RSL_EST_REQ(template RslChannelNr chan_nr, template RslLinkId link_id) := {
886 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
887 msg_type := RSL_MT_EST_REQ,
888 ies := {
889 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
890 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
891 }
892 }
893
894 /* 8.3.5 BTS -> BSC */
895 template (value) RSL_Message ts_RSL_EST_CONF(template (value) RslChannelNr chan_nr,
896 template (value) RslLinkId link_id) := {
897 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
898 msg_type := RSL_MT_EST_CONF,
899 ies := {
900 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
901 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
902 }
903 }
904 template RSL_Message tr_RSL_EST_CONF(template RslChannelNr chan_nr, template RslLinkId link_id) := {
905 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
906 msg_type := RSL_MT_EST_CONF,
907 ies := {
908 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
909 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
910 }
911 }
912
Harald Welte643e2a62017-11-27 15:03:18 +0100913 /* 8.3.6 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +0200914 template (value) RSL_Message ts_RSL_EST_IND(template (value) RslChannelNr chan_nr,
915 template (value) RslLinkId link_id,
916 octetstring l3_info) := {
Harald Welte643e2a62017-11-27 15:03:18 +0100917 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
918 msg_type := RSL_MT_EST_IND,
919 ies := {
Harald Welte735dd072017-12-12 14:55:17 +0100920 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
921 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
922 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
Harald Welte643e2a62017-11-27 15:03:18 +0100923 }
924 }
Harald Welte9abd1282018-02-19 19:18:17 +0100925 template RSL_Message tr_RSL_EST_IND(template RslChannelNr chan_nr, template RslLinkId link_id,
926 template octetstring l3_info := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +0200927 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Welte9abd1282018-02-19 19:18:17 +0100928 msg_type := RSL_MT_EST_IND,
929 ies := {
930 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
931 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
932 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
933 }
934 }
Harald Welte0472ab42018-03-12 15:02:26 +0100935 template RSL_Message tr_RSL_EST_IND_NOL3(template RslChannelNr chan_nr, template RslLinkId link_id) :=
936{
937 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
938 msg_type := RSL_MT_EST_IND,
939 ies := {
940 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
941 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
942 }
943 }
944
Harald Welte643e2a62017-11-27 15:03:18 +0100945
946 /* 8.3.7 BSC -> BTS */
Harald Welteefa7d912018-04-18 23:22:15 +0200947 template (value) RSL_Message ts_RSL_REL_REQ(template (value) RslChannelNr chan_nr,
Harald Welte0472ab42018-03-12 15:02:26 +0100948 template (value) RslLinkId link_id,
949 template (value) RSL_IE_ReleaseMode rel_mode := RSL_REL_MODE_NORMAL) := {
Harald Welte643e2a62017-11-27 15:03:18 +0100950 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
951 msg_type := RSL_MT_REL_REQ,
952 ies :={
Harald Welte735dd072017-12-12 14:55:17 +0100953 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
Harald Welte0472ab42018-03-12 15:02:26 +0100954 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
955 t_RSL_IE(RSL_IE_RELEASE_MODE, RSL_IE_Body:{release_mode := rel_mode})
Harald Welte643e2a62017-11-27 15:03:18 +0100956 }
957 }
Harald Weltee8a5ab12017-12-09 22:34:57 +0100958 template RSL_Message tr_RSL_REL_REQ(template RslChannelNr chan_nr,
Harald Welte0472ab42018-03-12 15:02:26 +0100959 template RslLinkId link_id,
960 template RSL_IE_ReleaseMode rel_mode := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +0200961 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Weltee8a5ab12017-12-09 22:34:57 +0100962 msg_type := RSL_MT_REL_REQ,
963 ies :={
964 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
965 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
Harald Welte0472ab42018-03-12 15:02:26 +0100966 tr_RSL_IE(RSL_IE_Body:{release_mode := rel_mode})
Harald Weltee8a5ab12017-12-09 22:34:57 +0100967 }
968 }
Harald Welte643e2a62017-11-27 15:03:18 +0100969
970 /* 8.3.8 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +0200971 template (value) RSL_Message ts_RSL_REL_CONF(template (value) RslChannelNr chan_nr,
972 template (value) RslLinkId link_id) := {
Harald Welte643e2a62017-11-27 15:03:18 +0100973 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
974 msg_type := RSL_MT_REL_CONF,
975 ies :={
Harald Welte735dd072017-12-12 14:55:17 +0100976 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
977 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
Harald Welte643e2a62017-11-27 15:03:18 +0100978 }
979 }
Harald Welte9abd1282018-02-19 19:18:17 +0100980 template RSL_Message tr_RSL_REL_CONF(template RslChannelNr chan_nr, template RslLinkId link_id) := {
Harald Welteefa7d912018-04-18 23:22:15 +0200981 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Welte9abd1282018-02-19 19:18:17 +0100982 msg_type := RSL_MT_REL_CONF,
983 ies :={
984 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
985 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
986 }
987 }
Harald Welte643e2a62017-11-27 15:03:18 +0100988
989 /* 8.3.9 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +0200990 template (value) RSL_Message ts_RSL_REL_IND(template (value) RslChannelNr chan_nr,
991 template (value) RslLinkId link_id) := {
Harald Welte643e2a62017-11-27 15:03:18 +0100992 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
993 msg_type := RSL_MT_REL_IND,
994 ies :={
Harald Welte735dd072017-12-12 14:55:17 +0100995 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
996 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
Harald Welte643e2a62017-11-27 15:03:18 +0100997 }
998 }
Harald Welte9abd1282018-02-19 19:18:17 +0100999 template RSL_Message tr_RSL_REL_IND(template RslChannelNr chan_nr, template RslLinkId link_id) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001000 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001001 msg_type := RSL_MT_REL_IND,
1002 ies :={
1003 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1004 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1005 }
1006 }
Harald Welte643e2a62017-11-27 15:03:18 +01001007
1008 /* 8.3.10 BSC -> BTS */
Harald Welteefa7d912018-04-18 23:22:15 +02001009 template (value) RSL_Message ts_RSL_UNITDATA_REQ(template (value) RslChannelNr chan_nr,
1010 template (value) RslLinkId link_id,
1011 octetstring l3_info)
Harald Welte643e2a62017-11-27 15:03:18 +01001012 modifies ts_RSL_DATA_REQ := {
1013 msg_type := RSL_MT_UNIT_DATA_REQ
1014 }
Harald Welte0472ab42018-03-12 15:02:26 +01001015 template RSL_Message tr_RSL_UNITDATA_REQ(template RslChannelNr chan_nr,
1016 template RslLinkId link_id,
1017 template octetstring l3_info)
1018 modifies tr_RSL_DATA_REQ := {
1019 msg_type := RSL_MT_UNIT_DATA_REQ
1020 }
1021
Harald Welte643e2a62017-11-27 15:03:18 +01001022
1023 /* 8.3.11 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001024 template (value) RSL_Message ts_RSL_UNITDATA_IND(template (value) RslChannelNr chan_nr,
1025 template (value) RslLinkId link_id,
1026 octetstring l3_info)
Harald Welte643e2a62017-11-27 15:03:18 +01001027 modifies ts_RSL_DATA_IND := {
1028 msg_type := RSL_MT_UNIT_DATA_IND
1029 }
Harald Welte0472ab42018-03-12 15:02:26 +01001030 template RSL_Message tr_RSL_UNITDATA_IND(template RslChannelNr chan_nr,
1031 template (value) RslLinkId link_id,
1032 template octetstring l3_info)
1033 modifies tr_RSL_DATA_IND := {
1034 msg_type := RSL_MT_UNIT_DATA_IND
1035 }
1036
1037
Harald Welte643e2a62017-11-27 15:03:18 +01001038
1039
1040 /* DEDICATED CANNEL MANAGEMENT MESSAGES */
1041
1042 /* 8.4.1 BSC -> BTS */
Harald Welteefa7d912018-04-18 23:22:15 +02001043 template (value) RSL_Message ts_RSL_CHAN_ACT(template (value) RslChannelNr chan_nr,
1044 template (value) RSL_IE_ChannelMode mode) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001045 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1046 msg_type := RSL_MT_CHAN_ACTIV,
1047 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001048 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1049 t_RSL_IE(RSL_IE_ACT_TYPE, RSL_IE_Body:{act_type := t_RSL_IE_ActType}),
1050 t_RSL_IE(RSL_IE_CHAN_MODE, RSL_IE_Body:{chan_mode := mode})
Harald Welte643e2a62017-11-27 15:03:18 +01001051 /* lots of optional IEs */
1052 }
1053 }
Harald Welte94e0c342018-04-07 11:33:23 +02001054 template RSL_Message tr_RSL_CHAN_ACT(template RslChannelNr chan_nr,
1055 template RSL_IE_ChannelMode mode) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001056 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte94e0c342018-04-07 11:33:23 +02001057 msg_type := RSL_MT_CHAN_ACTIV,
1058 ies :={
1059 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1060 tr_RSL_IE(RSL_IE_Body:{act_type := t_RSL_IE_ActType}),
1061 tr_RSL_IE(RSL_IE_Body:{chan_mode := mode}),
1062 /* lots of optional IEs */
1063 *
1064 }
1065 }
1066 template RSL_Message tr_RSL_CHAN_ACT_PDCH(template RslChannelNr chan_nr,
1067 template RSL_IE_ChannelMode mode) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001068 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte94e0c342018-04-07 11:33:23 +02001069 msg_type := RSL_MT_CHAN_ACTIV,
1070 ies :={
1071 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1072 tr_RSL_IE(RSL_IE_Body:{act_type := t_RSL_IE_ActType_PDCH}),
1073 /* lots of optional IEs */
1074 *
1075 }
1076 }
1077
Harald Welte643e2a62017-11-27 15:03:18 +01001078
1079 /* 8.4.2 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001080 template (value) RSL_Message ts_RSL_CHAN_ACT_ACK(template (value) RslChannelNr chan_nr,
1081 GsmFrameNumber fn) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001082 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1083 msg_type := RSL_MT_CHAN_ACTIV_ACK,
1084 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001085 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1086 t_RSL_IE(RSL_IE_FRAME_NUMBER, RSL_IE_Body:{frame_nr := ts_RSL_IE_FrameNumber(fn)})
Harald Welte643e2a62017-11-27 15:03:18 +01001087 }
1088 }
Harald Welte9abd1282018-02-19 19:18:17 +01001089 template RSL_Message tr_RSL_CHAN_ACT_ACK(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001090 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001091 msg_type := RSL_MT_CHAN_ACTIV_ACK,
1092 ies := {
1093 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1094 tr_RSL_IE(RSL_IE_Body:{frame_nr := ?})
1095 }
1096 }
Harald Welte643e2a62017-11-27 15:03:18 +01001097
1098 /* 8.4.3 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001099 template (value) RSL_Message ts_RSL_CHAN_ACT_NACK(template (value) RslChannelNr chan_nr,
1100 RSL_Cause cause) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001101 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1102 msg_type := RSL_MT_CHAN_ACTIV_NACK,
1103 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001104 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1105 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
Harald Welte643e2a62017-11-27 15:03:18 +01001106 }
1107 }
Harald Welte9abd1282018-02-19 19:18:17 +01001108 template RSL_Message tr_RSL_CHAN_ACT_NACK(template RslChannelNr chan_nr,
1109 template RSL_Cause cause := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001110 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001111 msg_type := RSL_MT_CHAN_ACTIV_NACK,
1112 ies := {
1113 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1114 tr_RSL_IE(RSL_IE_Body:{cause := ?})
1115 }
1116 }
Harald Welte643e2a62017-11-27 15:03:18 +01001117
1118 /* 8.4.4 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001119 template (value) RSL_Message ts_RSL_CONN_FAIL_IND(RslChannelNr chan_nr, RSL_Cause cause) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001120 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1121 msg_type := RSL_MT_CONN_FAIL,
1122 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001123 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1124 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
Harald Welte643e2a62017-11-27 15:03:18 +01001125 }
1126 }
Harald Welte9abd1282018-02-19 19:18:17 +01001127 template RSL_Message tr_RSL_CONN_FAIL_IND(template RslChannelNr chan_nr,
1128 template RSL_Cause cause := ?) := {
1129 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1130 msg_type := RSL_MT_CONN_FAIL,
1131 ies :={
1132 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1133 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
1134 }
1135 }
Harald Welte643e2a62017-11-27 15:03:18 +01001136
Harald Weltee8a5ab12017-12-09 22:34:57 +01001137 /* 8.4.5 BSC -> BTS */
1138 template RSL_Message tr_RSL_DEACT_SACCH(template RslChannelNr chan_nr) := {
1139 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1140 msg_type := RSL_MT_DEACTIVATE_SACCH,
1141 ies := {
1142 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
1143 }
1144 }
Harald Welteefa7d912018-04-18 23:22:15 +02001145 template (value) RSL_Message ts_RSL_DEACT_SACCH(template (value) RslChannelNr chan_nr) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001146 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1147 msg_type := RSL_MT_DEACTIVATE_SACCH,
1148 ies := {
1149 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1150 }
1151 }
1152
Harald Weltee8a5ab12017-12-09 22:34:57 +01001153
Harald Welte73cd2712017-12-17 00:44:52 +01001154 /* 8.4.6 BSC ->BTS */
1155 template RSL_Message tr_RSL_ENCR_CMD(template RslChannelNr chan_nr,
1156 template RslLinkId link_id := ?,
1157 template OCT1 alg := ?,
1158 template octetstring key := ?,
1159 template octetstring l3_info := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001160 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte73cd2712017-12-17 00:44:52 +01001161 msg_type := RSL_MT_ENCR_CMD,
1162 ies := {
1163 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1164 tr_RSL_IE(RSL_IE_Body:{encr_info := tr_RSL_IE_EncrInfo(alg, key)}),
1165 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
1166 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
1167 }
1168 }
Harald Welteefa7d912018-04-18 23:22:15 +02001169 template (value) RSL_Message ts_RSL_ENCR_CMD(template (value) RslChannelNr chan_nr,
1170 template (value) RslLinkId link_id,
1171 OCT1 alg, octetstring key,
1172 octetstring l3_info) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001173 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1174 msg_type := RSL_MT_ENCR_CMD,
1175 ies := {
1176 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
Harald Welteefa7d912018-04-18 23:22:15 +02001177 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 +01001178 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
Harald Welteefa7d912018-04-18 23:22:15 +02001179 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
Harald Welte9abd1282018-02-19 19:18:17 +01001180 }
1181 }
Harald Welte73cd2712017-12-17 00:44:52 +01001182
Harald Welte2691adf2018-02-22 17:32:39 +01001183 template RSL_Message tr_RSL_MEAS_RES(template RslChannelNr chan_nr,
1184 template uint8_t meas_res_nr := ?,
1185 template RSL_IE_UplinkMeas ul_meas := ?,
1186 template RSL_IE_BS_Power bs_power := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001187 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte2691adf2018-02-22 17:32:39 +01001188 msg_type := RSL_MT_MEAS_RES,
1189 ies := {
1190 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1191 tr_RSL_IE(RSL_IE_Body:{meas_res_nr := meas_res_nr}),
1192 tr_RSL_IE(RSL_IE_Body:{uplink_meas := ul_meas}),
1193 tr_RSL_IE(RSL_IE_Body:{bs_power := bs_power}),
1194 *
1195 }
1196 }
1197
Harald Welte39b47be2018-02-23 18:58:48 +01001198 /* Osmocom specific template, require lots of optional fields to be present */
1199 template RSL_Message tr_RSL_MEAS_RES_OSMO(template RslChannelNr chan_nr,
1200 template uint8_t meas_res_nr := ?,
1201 template RSL_IE_UplinkMeas ul_meas := ?,
1202 template RSL_IE_BS_Power bs_power := ?,
1203 template RSL_IE_L1Info l1_info := ?,
1204 template octetstring l3_info := ?,
1205 template uint8_t ms_to := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001206 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte39b47be2018-02-23 18:58:48 +01001207 msg_type := RSL_MT_MEAS_RES,
1208 ies := {
1209 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1210 tr_RSL_IE(RSL_IE_Body:{meas_res_nr := meas_res_nr}),
1211 tr_RSL_IE(RSL_IE_Body:{uplink_meas := ul_meas}),
1212 tr_RSL_IE(RSL_IE_Body:{bs_power := bs_power}),
1213 tr_RSL_IE(RSL_IE_Body:{l1_info := l1_info}),
1214 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)}),
1215 tr_RSL_IE(RSL_IE_Body:{ms_timing_offset := ms_to})
1216 }
1217 }
1218
1219
Harald Welte7794d5b2017-12-16 23:00:20 +01001220 /* 8.4.10 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001221 template (value) RSL_Message ts_RSL_MODE_MODIFY_ACK(template (value) RslChannelNr chan_nr) := {
Harald Welte7794d5b2017-12-16 23:00:20 +01001222 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1223 msg_type := RSL_MT_MODE_MODIFY_ACK,
1224 ies := {
1225 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1226 }
1227 }
Harald Welte9abd1282018-02-19 19:18:17 +01001228 template RSL_Message tr_RSL_MODE_MODIFY_ACK(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001229 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001230 msg_type := RSL_MT_MODE_MODIFY_ACK,
1231 ies := {
1232 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
1233 }
1234 }
Harald Welte7794d5b2017-12-16 23:00:20 +01001235
Harald Welte643e2a62017-11-27 15:03:18 +01001236 /* 8.4.11 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001237 template (value) RSL_Message ts_RSL_MODE_MODIFY_NACK(template (value) RslChannelNr chan_nr,
1238 RSL_Cause cause) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001239 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1240 msg_type := RSL_MT_MODE_MODIFY_NACK,
1241 ies := {
1242 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1243 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
1244 }
Harald Welte643e2a62017-11-27 15:03:18 +01001245 }
Harald Welte9abd1282018-02-19 19:18:17 +01001246 template RSL_Message tr_RSL_MODE_MODIFY_NACK(template RslChannelNr chan_nr,
1247 template RSL_Cause cause) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001248 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001249 msg_type := RSL_MT_MODE_MODIFY_NACK,
1250 ies := {
1251 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1252 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
1253 }
1254 }
1255
Harald Welte643e2a62017-11-27 15:03:18 +01001256
Harald Welte6a8199d2018-01-29 21:58:53 +01001257 /* 8.4.14: BTS <- BSC */
1258 template RSL_Message tr_RSL_RF_CHAN_REL(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001259 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte6a8199d2018-01-29 21:58:53 +01001260 msg_type := RSL_MT_RF_CHAN_REL,
1261 ies := {
1262 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
1263 }
1264 }
Harald Welteefa7d912018-04-18 23:22:15 +02001265 template (value) RSL_Message ts_RSL_RF_CHAN_REL(template (value) RslChannelNr chan_nr) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001266 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1267 msg_type := RSL_MT_RF_CHAN_REL,
1268 ies := {
1269 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1270 }
1271 }
Harald Welte6a8199d2018-01-29 21:58:53 +01001272
Harald Welte4a267362017-12-09 17:49:32 +01001273 /* 8.4.19 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001274 template (value) RSL_Message ts_RSL_RF_CHAN_REL_ACK(template (value) RslChannelNr chan_nr) :=
Harald Welte4a267362017-12-09 17:49:32 +01001275 ts_RSL_MsgDiscType(ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1276 RSL_MT_RF_CHAN_REL_ACK,
Harald Welte735dd072017-12-12 14:55:17 +01001277 { t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}) });
Harald Welte4a267362017-12-09 17:49:32 +01001278
Harald Welte9abd1282018-02-19 19:18:17 +01001279 template RSL_Message tr_RSL_RF_CHAN_REL_ACK(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001280 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001281 msg_type := RSL_MT_RF_CHAN_REL_ACK,
1282 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001283 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
Harald Welte9abd1282018-02-19 19:18:17 +01001284 }
1285 }
1286
Harald Welteea17b912018-03-11 22:29:31 +01001287 /* 8.6.20 BTS <- BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001288 template (value) RSL_Message ts_RSL_SACCH_INF_MOD(template (value) RslChannelNr chan_nr,
1289 RSL_IE_SysinfoType si_type,
1290 octetstring l3_info) := {
Harald Welteea17b912018-03-11 22:29:31 +01001291 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1292 msg_type := RSL_MT_SACCH_INFO_MODIFY,
1293 ies := {
1294 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1295 t_RSL_IE(RSL_IE_SYSINFO_TYPE, RSL_IE_Body:{sysinfo_type := si_type}),
1296 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
1297 }
1298 }
1299
1300
Harald Welte643e2a62017-11-27 15:03:18 +01001301 /* COMMON CHANNEL MANAGEMENT MESSAGES */
1302
Harald Welte874c2232018-02-24 04:52:43 +01001303 /* 8.5.1 BTS <- BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001304 template (value) RSL_Message ts_RSL_BCCH_INFO(RSL_IE_SysinfoType si_type,
1305 octetstring full_bcch_info) := {
Harald Welte874c2232018-02-24 04:52:43 +01001306 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1307 msg_type := RSL_MT_BCCH_INFO,
1308 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001309 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_BCCH(0)}),
Harald Welte874c2232018-02-24 04:52:43 +01001310 t_RSL_IE(RSL_IE_SYSINFO_TYPE, RSL_IE_Body:{sysinfo_type := si_type}),
1311 t_RSL_IE(RSL_IE_FULL_BCCH_INFO, RSL_IE_Body:{other := ts_RSL_LV(full_bcch_info)})
1312 }
1313 }
1314
Harald Welte7ae93142017-12-07 17:56:15 +01001315 /* 8.5.2 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001316 template (value) RSL_Message ts_RSL_RACH_LOAD_IND(uint16_t slot_ct, uint16_t busy_ct,
1317 uint16_t acc_ct) := {
Harald Welte7ae93142017-12-07 17:56:15 +01001318 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1319 msg_type := RSL_MT_CCCH_LOAD_IND,
1320 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001321 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_RACH(0)}),
Harald Welte735dd072017-12-12 14:55:17 +01001322 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 +01001323 }
1324 }
Harald Welte68e495b2018-02-25 00:05:57 +01001325 template RSL_Message tr_RSL_RACH_LOAD_IND(template uint16_t slot_ct := ?,
1326 template uint16_t busy_ct := ?,
1327 template uint16_t acc_ct) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001328 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Welte68e495b2018-02-25 00:05:57 +01001329 msg_type := RSL_MT_CCCH_LOAD_IND,
1330 ies := {
1331 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_RACH(0)}),
1332 tr_RSL_IE(RSL_IE_Body:{rach_load := tr_RSL_IE_RachLoad(slot_ct, busy_ct, acc_ct)})
1333 }
1334 }
1335
Harald Welteefa7d912018-04-18 23:22:15 +02001336 template (value) RSL_Message ts_RSL_PAGING_LOAD_IND(uint16_t buffer_space) := {
Harald Welte7ae93142017-12-07 17:56:15 +01001337 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1338 msg_type := RSL_MT_CCCH_LOAD_IND,
1339 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001340 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_PCH_AGCH(0)}),
Harald Welte735dd072017-12-12 14:55:17 +01001341 t_RSL_IE(RSL_IE_PAGING_LOAD, RSL_IE_Body:{paging_load := buffer_space})
Harald Welte7ae93142017-12-07 17:56:15 +01001342 }
1343 }
Harald Welte68e495b2018-02-25 00:05:57 +01001344 template RSL_Message tr_RSL_PAGING_LOAD_IND(template uint16_t buffer_space := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001345 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Welte68e495b2018-02-25 00:05:57 +01001346 msg_type := RSL_MT_CCCH_LOAD_IND,
1347 ies := {
1348 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(0)}),
1349 tr_RSL_IE(RSL_IE_Body:{paging_load := buffer_space})
1350 }
1351 }
1352
Harald Welte7ae93142017-12-07 17:56:15 +01001353
Harald Welte643e2a62017-11-27 15:03:18 +01001354 /* 8.5.3 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001355 template (value) RSL_Message ts_RSL_CHAN_RQD(OCT1 ra, GsmFrameNumber fn, uint8_t acc_del := 0) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001356 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1357 msg_type := RSL_MT_CHAN_RQD,
1358 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001359 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_RACH(0)}),
Harald Welte735dd072017-12-12 14:55:17 +01001360 t_RSL_IE(RSL_IE_REQ_REFERENCE, RSL_IE_Body:{req_ref := ts_RSL_IE_ReqRef(ra, fn)}),
1361 t_RSL_IE(RSL_IE_ACCESS_DELAY, RSL_IE_Body:{access_delay := acc_del})
Harald Welte643e2a62017-11-27 15:03:18 +01001362 }
1363 }
Harald Welte9abd1282018-02-19 19:18:17 +01001364 template RSL_Message tr_RSL_CHAN_RQD(template OCT1 ra, template GsmFrameNumber fn := ?,
1365 template uint8_t acc_del := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001366 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001367 msg_type := RSL_MT_CHAN_RQD,
1368 ies := {
1369 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_RACH(0)}),
1370 tr_RSL_IE(RSL_IE_Body:{req_ref := tr_RSL_IE_ReqRef(ra, fn)}),
1371 tr_RSL_IE(RSL_IE_Body:{access_delay := acc_del})
1372 }
1373 }
Harald Welte643e2a62017-11-27 15:03:18 +01001374
1375 /* 8.5.4 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001376 template (value) RSL_Message ts_DELETE_IND(template (value) RslChannelNr chan_nr,
1377 octetstring imm_ass) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001378 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1379 msg_type := RSL_MT_DELETE_IND,
1380 ies := {
Harald Welte735dd072017-12-12 14:55:17 +01001381 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1382 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 +01001383 }
1384 }
1385
Harald Weltec2877752017-12-07 17:54:35 +01001386 /* 8.5.5 BSC -> BTS */
1387 template RSL_Message tr_RSL_PAGING_CMD(template octetstring identity, template uint3_t tn := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001388 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Weltec2877752017-12-07 17:54:35 +01001389 msg_type := RSL_MT_PAGING_CMD,
1390 ies := {
1391 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(tn)}),
1392 tr_RSL_IE(RSL_IE_Body:{paging_group := ?}),
Harald Welte51d74102017-12-10 23:05:02 +01001393 tr_RSL_IE(RSL_IE_Body:{ms_identity := tr_RSL_LV(identity)}),
Harald Weltec2877752017-12-07 17:54:35 +01001394 * /* opt: channel needed, eMLPP prio */
1395 }
1396 }
Harald Welteefa7d912018-04-18 23:22:15 +02001397 template (value) RSL_Message ts_RSL_PAGING_CMD(octetstring identity, uint8_t pg, uint3_t tn := 0) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001398 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1399 msg_type := RSL_MT_PAGING_CMD,
1400 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001401 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_PCH_AGCH(tn)}),
Harald Welte9abd1282018-02-19 19:18:17 +01001402 t_RSL_IE(RSL_IE_PAGING_GROUP, RSL_IE_Body:{paging_group := pg}),
1403 t_RSL_IE(RSL_IE_MS_IDENTITY, RSL_IE_Body:{ms_identity := ts_RSL_LV(identity)})
1404 }
1405 }
Harald Weltec2877752017-12-07 17:54:35 +01001406
1407 /* 8.5.6 BSC -> BTS */
1408 template RSL_Message tr_RSL_IMM_ASSIGN(template uint3_t tn := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001409 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Weltec2877752017-12-07 17:54:35 +01001410 msg_type := RSL_MT_IMMEDIATE_ASSIGN_CMD,
1411 ies := {
1412 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(tn)}),
1413 tr_RSL_IE(RSL_IE_Body:{full_imm_ass_info := ?})
1414 }
1415 }
Harald Welteefa7d912018-04-18 23:22:15 +02001416 template (value) RSL_Message ts_RSL_IMM_ASSIGN(octetstring f_ass_inf, uint3_t tn := 0) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001417 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1418 msg_type := RSL_MT_IMMEDIATE_ASSIGN_CMD,
1419 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001420 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_PCH_AGCH(tn)}),
Harald Welte9abd1282018-02-19 19:18:17 +01001421 t_RSL_IE(RSL_IE_FULL_IMM_ASS_INFO, RSL_IE_Body:{full_imm_ass_info := ts_RSL_LV(f_ass_inf)})
1422 }
1423 }
Harald Weltec2877752017-12-07 17:54:35 +01001424
Harald Welte68e495b2018-02-25 00:05:57 +01001425 template RSL_Message tr_RSL_RF_RES_IND := {
Harald Welteefa7d912018-04-18 23:22:15 +02001426 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
Harald Welte68e495b2018-02-25 00:05:57 +01001427 msg_type := RSL_MT_RF_RES_IND,
1428 ies := *
1429 }
1430
1431 /* 8.6.2 BTS <- BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001432 template (value) RSL_Message ts_RSL_SACCH_FILL(RSL_IE_SysinfoType si_type, octetstring l3_info) := {
Harald Welte68e495b2018-02-25 00:05:57 +01001433 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
1434 msg_type := RSL_MT_SACCH_FILL,
1435 ies := {
1436 t_RSL_IE(RSL_IE_SYSINFO_TYPE, RSL_IE_Body:{sysinfo_type := si_type}),
1437 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
1438 }
1439 }
1440
Harald Welte643e2a62017-11-27 15:03:18 +01001441 /* 8.6.4 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001442 template (value) RSL_Message ts_RSL_ERROR_REPORT(RSL_Cause cause) := {
Harald Welte01d982c2018-02-25 01:31:40 +01001443 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
1444 msg_type := RSL_MT_ERROR_REPORT,
Harald Welte643e2a62017-11-27 15:03:18 +01001445 ies := {
Harald Welte735dd072017-12-12 14:55:17 +01001446 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
Harald Welte643e2a62017-11-27 15:03:18 +01001447 }
1448 }
Harald Welte01d982c2018-02-25 01:31:40 +01001449 template RSL_Message tr_RSL_ERROR_REPORT(template RSL_Cause cause := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001450 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
Harald Welte01d982c2018-02-25 01:31:40 +01001451 msg_type := RSL_MT_ERROR_REPORT,
1452 ies := {
1453 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)}),
1454 *
1455 }
1456 }
1457
Harald Welte643e2a62017-11-27 15:03:18 +01001458
Harald Welte9958a4d2017-12-14 21:21:33 +01001459
1460 /* Abis/IP specific messages */
1461
1462 template RSL_Message tr_RSL_IPA_CRCX(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001463 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01001464 msg_type := RSL_MT_IPAC_CRCX,
1465 ies := {
1466 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1467 *
1468 }
1469 }
Harald Welteefa7d912018-04-18 23:22:15 +02001470 template (value) RSL_Message ts_RSL_IPA_CRCX(template (value) RslChannelNr chan_nr) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001471 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
1472 msg_type := RSL_MT_IPAC_CRCX,
1473 ies := {
1474 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1475 }
1476 }
1477
Harald Welte9958a4d2017-12-14 21:21:33 +01001478
Harald Welteefa7d912018-04-18 23:22:15 +02001479 template (value) RSL_Message ts_RSL_IPA_CRCX_ACK(template (value) RslChannelNr chan_nr,
1480 uint16_t ipa_conn_id, uint32_t local_ip,
1481 uint16_t local_port, uint7_t rtp_pt2) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01001482 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
1483 msg_type := RSL_MT_IPAC_CRCX_ACK,
1484 ies := {
1485 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1486 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
1487 t_RSL_IE(RSL_IE_IPAC_LOCAL_IP, RSL_IE_Body:{ipa_local_ip := local_ip}),
1488 t_RSL_IE(RSL_IE_IPAC_LOCAL_PORT, RSL_IE_Body:{ipa_local_port := local_port}),
1489 t_RSL_IE(RSL_IE_IPAC_RTP_PAYLOAD2, RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
1490 }
1491 }
Harald Welte9abd1282018-02-19 19:18:17 +01001492 template RSL_Message tr_RSL_IPA_CRCX_ACK(template RslChannelNr chan_nr,
1493 template uint16_t ipa_conn_id,
1494 template uint32_t local_ip,
Harald Welte8bd0f822018-02-25 12:43:28 +01001495 template uint16_t local_port) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001496 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001497 msg_type := RSL_MT_IPAC_CRCX_ACK,
1498 ies := {
1499 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1500 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
1501 tr_RSL_IE(RSL_IE_Body:{ipa_local_ip := local_ip}),
Harald Welte8bd0f822018-02-25 12:43:28 +01001502 tr_RSL_IE(RSL_IE_Body:{ipa_local_port := local_port})
1503 /* Optional: RTP Payload Type 2 IE */
Harald Welte9abd1282018-02-19 19:18:17 +01001504 }
1505 }
Harald Welte9958a4d2017-12-14 21:21:33 +01001506
Harald Welteefa7d912018-04-18 23:22:15 +02001507 template (value) RSL_Message ts_RSL_IPA_CRCX_NACK(template (value) RslChannelNr chan_nr,
1508 RSL_Cause cause) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01001509 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
1510 msg_type := RSL_MT_IPAC_CRCX_NACK,
1511 ies := {
1512 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1513 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
1514 }
1515 }
Harald Welte9abd1282018-02-19 19:18:17 +01001516 template RSL_Message tr_RSL_IPA_CRCX_NACK(template RslChannelNr chan_nr,
1517 template RSL_Cause cause := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001518 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001519 msg_type := RSL_MT_IPAC_CRCX_NACK,
1520 ies := {
1521 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1522 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
1523 }
1524 }
Harald Welte9958a4d2017-12-14 21:21:33 +01001525
Harald Welteefa7d912018-04-18 23:22:15 +02001526 template (value) RSL_Message ts_RSL_IPA_MDCX(template (value) RslChannelNr chan_nr,
1527 uint16_t ipa_conn_id,
1528 uint32_t remote_ip, uint16_t remote_port,
1529 uint7_t rtp_pt2) := {
Harald Welte30527452018-02-25 12:46:25 +01001530 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
1531 msg_type := RSL_MT_IPAC_MDCX,
1532 ies := {
1533 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1534 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
1535 t_RSL_IE(RSL_IE_IPAC_REMOTE_IP, RSL_IE_Body:{ipa_remote_ip := remote_ip}),
1536 t_RSL_IE(RSL_IE_IPAC_REMOTE_PORT, RSL_IE_Body:{ipa_remote_port := remote_port}),
1537 /* optional: RTP Payload Type */
1538 t_RSL_IE(RSL_IE_IPAC_RTP_PAYLOAD2, RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
1539 }
1540 }
Harald Welte9958a4d2017-12-14 21:21:33 +01001541 template RSL_Message tr_RSL_IPA_MDCX(template RslChannelNr chan_nr,
1542 template uint16_t ipa_conn_id) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001543 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01001544 msg_type := RSL_MT_IPAC_MDCX,
1545 ies := {
1546 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1547 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
1548 *
1549 }
1550 }
1551
Harald Welteefa7d912018-04-18 23:22:15 +02001552 template (value) RSL_Message ts_RSL_IPA_MDCX_ACK(template (value) RslChannelNr chan_nr,
1553 uint16_t ipa_conn_id,
1554 uint32_t local_ip, uint16_t local_port,
1555 uint7_t rtp_pt2) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01001556 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte71b5ec82017-12-16 23:01:10 +01001557 msg_type := RSL_MT_IPAC_MDCX_ACK,
Harald Welte9958a4d2017-12-14 21:21:33 +01001558 ies := {
1559 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1560 /* optional */
1561 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
Harald Welte6cb400a2018-02-25 12:45:25 +01001562 t_RSL_IE(RSL_IE_IPAC_LOCAL_IP, RSL_IE_Body:{ipa_local_ip := local_ip}),
1563 t_RSL_IE(RSL_IE_IPAC_LOCAL_PORT, RSL_IE_Body:{ipa_local_port := local_port}),
Harald Welte9958a4d2017-12-14 21:21:33 +01001564 /* optional: RTP Payload Type */
1565 t_RSL_IE(RSL_IE_IPAC_RTP_PAYLOAD2, RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
1566 }
1567 }
Harald Welte30527452018-02-25 12:46:25 +01001568 template RSL_Message tr_RSL_IPA_MDCX_ACK(template RslChannelNr chan_nr,
1569 template uint16_t ipa_conn_id,
1570 template uint32_t local_ip,
1571 template uint16_t local_port,
1572 template uint7_t rtp_pt2) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001573 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte30527452018-02-25 12:46:25 +01001574 msg_type := RSL_MT_IPAC_MDCX_ACK,
1575 ies := {
1576 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1577 /* optional */
1578 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
1579 tr_RSL_IE(RSL_IE_Body:{ipa_local_ip := local_ip}),
1580 tr_RSL_IE(RSL_IE_Body:{ipa_local_port := local_port}),
1581 /* optional: RTP Payload Type */
1582 tr_RSL_IE(RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
1583 }
1584 }
Harald Welte9958a4d2017-12-14 21:21:33 +01001585
Harald Welteefa7d912018-04-18 23:22:15 +02001586 template (value) RSL_Message ts_RSL_IPA_MDCX_NACK(template (value) RslChannelNr chan_nr,
1587 RSL_Cause cause,
1588 template (value) uint16_t ipa_conn_id) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01001589 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
1590 msg_type := RSL_MT_IPAC_MDCX_NACK,
1591 ies := {
1592 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1593 /* optional connection ID */
1594 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
1595 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
1596 }
1597 }
Harald Welte30527452018-02-25 12:46:25 +01001598 template RSL_Message tr_RSL_IPA_MDCX_NACK(template RslChannelNr chan_nr,
1599 template RSL_Cause cause,
1600 template uint16_t ipa_conn_id) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001601 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte30527452018-02-25 12:46:25 +01001602 msg_type := RSL_MT_IPAC_MDCX_NACK,
1603 ies := {
1604 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1605 /* optional connection ID */
1606 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
1607 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
1608 }
1609 }
1610
Harald Welte9958a4d2017-12-14 21:21:33 +01001611
Harald Welteefa7d912018-04-18 23:22:15 +02001612 template (value) RSL_Message ts_RSL_IPA_DLCX_IND(template (value) RslChannelNr chan_nr,
1613 uint16_t ipa_conn_id,
1614 template (value) RSL_IE_IPA_ConnectionStats stats,
1615 RSL_Cause cause) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01001616 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
1617 msg_type := RSL_MT_IPAC_DLCX_IND,
1618 ies := {
1619 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1620 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
1621 t_RSL_IE(RSL_IE_IPAC_CONN_STAT, RSL_IE_Body:{ipa_stats := stats}),
1622 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
1623 }
1624 }
1625
Harald Welteefa7d912018-04-18 23:22:15 +02001626 template (value) RSL_Message ts_RSL_IPA_DLCX(template (value) RslChannelNr chan_nr,
1627 uint16_t ipa_conn_id) := {
Harald Weltea871a382018-02-25 02:03:14 +01001628 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
1629 msg_type := RSL_MT_IPAC_DLCX,
1630 ies := {
Harald Welte2a7e7162018-02-25 12:46:48 +01001631 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1632 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id})
Harald Weltea871a382018-02-25 02:03:14 +01001633 }
1634 }
Harald Welte9958a4d2017-12-14 21:21:33 +01001635 template RSL_Message tr_RSL_IPA_DLCX(template RslChannelNr chan_nr,
1636 template uint16_t ipa_conn_id := omit) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001637 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01001638 msg_type := RSL_MT_IPAC_DLCX,
1639 ies := {
1640 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1641 /* FIXME: optional conn_id */
1642 *
1643 }
1644 }
1645
Harald Welteefa7d912018-04-18 23:22:15 +02001646 template (value) RSL_Message ts_RSL_IPA_DLCX_ACK(template (value) RslChannelNr chan_nr,
1647 uint16_t ipa_conn_id,
1648 RSL_IE_IPA_ConnectionStats stats) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01001649 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
1650 msg_type := RSL_MT_IPAC_DLCX_ACK,
1651 ies := {
1652 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1653 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
1654 t_RSL_IE(RSL_IE_IPAC_CONN_STAT, RSL_IE_Body:{ipa_stats := stats})
1655 }
1656 }
Harald Weltea871a382018-02-25 02:03:14 +01001657 template RSL_Message tr_RSL_IPA_DLCX_ACK(template RslChannelNr chan_nr,
1658 template uint16_t ipa_conn_id,
1659 template RSL_IE_IPA_ConnectionStats stats) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001660 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Weltea871a382018-02-25 02:03:14 +01001661 msg_type := RSL_MT_IPAC_DLCX_ACK,
1662 ies := {
1663 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1664 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
1665 tr_RSL_IE(RSL_IE_Body:{ipa_stats := stats})
1666 }
1667 }
1668
1669
Harald Welte9958a4d2017-12-14 21:21:33 +01001670
Harald Welteefa7d912018-04-18 23:22:15 +02001671 template (value) RSL_Message ts_RSL_IPA_DLCX_NACK(template (value) RslChannelNr chan_nr,
1672 RSL_Cause cause, uint16_t ipa_conn_id) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01001673 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
1674 msg_type := RSL_MT_IPAC_DLCX_NACK,
1675 ies := {
1676 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1677 /* optional connection ID */
1678 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
1679 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
1680 }
1681 }
Harald Weltea871a382018-02-25 02:03:14 +01001682 template RSL_Message tr_RSL_IPA_DLCX_NACK(template RslChannelNr chan_nr,
1683 template RSL_Cause cause) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001684 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Weltea871a382018-02-25 02:03:14 +01001685 msg_type := RSL_MT_IPAC_DLCX_NACK,
1686 ies := {
1687 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1688 /* optional connection ID */
1689 *,
1690 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
1691 }
1692 }
1693
Harald Welte9958a4d2017-12-14 21:21:33 +01001694
Harald Welteefa7d912018-04-18 23:22:15 +02001695 template (value) RSL_Message ts_RSL_IPA_PDCH_ACT(RslChannelNr chan_nr) := {
Harald Welteee19c732018-04-05 09:08:26 +02001696 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1697 msg_type := RSL_MT_IPAC_PDCH_ACT,
1698 ies := {
1699 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1700 }
1701 }
Harald Welte9958a4d2017-12-14 21:21:33 +01001702 template RSL_Message tr_RSL_IPA_PDCH_ACT(template RslChannelNr chan_nr) := {
Harald Welteee19c732018-04-05 09:08:26 +02001703 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01001704 msg_type := RSL_MT_IPAC_PDCH_ACT,
1705 ies := {
1706 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
1707 }
1708 }
1709
Harald Welteee19c732018-04-05 09:08:26 +02001710
Harald Welte94e0c342018-04-07 11:33:23 +02001711 template RSL_Message ts_RSL_IPA_PDCH_ACT_ACK(RslChannelNr chan_nr,
1712 template (value) RSL_IE_FrameNumber fn) := {
Harald Welteee19c732018-04-05 09:08:26 +02001713 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01001714 msg_type := RSL_MT_IPAC_PDCH_ACT_ACK,
1715 ies := {
1716 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1717 t_RSL_IE(RSL_IE_FRAME_NUMBER, RSL_IE_Body:{frame_nr := fn})
1718 }
1719 }
Harald Welteee19c732018-04-05 09:08:26 +02001720 template RSL_Message tr_RSL_IPA_PDCH_ACT_ACK(template RslChannelNr chan_nr,
1721 template RSL_IE_FrameNumber fn) := {
1722 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1723 msg_type := RSL_MT_IPAC_PDCH_ACT_ACK,
1724 ies := {
1725 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1726 tr_RSL_IE(RSL_IE_Body:{frame_nr := fn})
1727 }
1728 }
Harald Welte9958a4d2017-12-14 21:21:33 +01001729
1730 template RSL_Message ts_RSL_IPA_PDCH_ACT_NACK(RslChannelNr chan_nr, RSL_Cause cause) := {
Harald Welteee19c732018-04-05 09:08:26 +02001731 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01001732 msg_type := RSL_MT_IPAC_PDCH_ACT_NACK,
1733 ies := {
1734 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1735 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
1736 }
1737 }
Harald Welteee19c732018-04-05 09:08:26 +02001738 template RSL_Message tr_RSL_IPA_PDCH_ACT_NACK(template RslChannelNr chan_nr,
1739 template RSL_Cause cause) := {
1740 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1741 msg_type := RSL_MT_IPAC_PDCH_ACT_NACK,
1742 ies := {
1743 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1744 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
1745 }
1746 }
Harald Welte9958a4d2017-12-14 21:21:33 +01001747
Harald Welteee19c732018-04-05 09:08:26 +02001748 template RSL_Message ts_RSL_IPA_PDCH_DEACT(RslChannelNr chan_nr) := {
1749 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1750 msg_type := RSL_MT_IPAC_PDCH_DEACT,
1751 ies := {
1752 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1753 }
1754 }
Harald Welte9958a4d2017-12-14 21:21:33 +01001755 template RSL_Message tr_RSL_IPA_PDCH_DEACT(template RslChannelNr chan_nr) := {
Harald Welteee19c732018-04-05 09:08:26 +02001756 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01001757 msg_type := RSL_MT_IPAC_PDCH_DEACT,
1758 ies := {
1759 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
1760 }
1761 }
1762
1763 template RSL_Message ts_RSL_IPA_PDCH_DEACT_ACK(RslChannelNr chan_nr) := {
Harald Welteee19c732018-04-05 09:08:26 +02001764 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01001765 msg_type := RSL_MT_IPAC_PDCH_DEACT_ACK,
1766 ies := {
1767 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1768 }
1769 }
Harald Welteee19c732018-04-05 09:08:26 +02001770 template RSL_Message tr_RSL_IPA_PDCH_DEACT_ACK(template RslChannelNr chan_nr) := {
1771 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1772 msg_type := RSL_MT_IPAC_PDCH_DEACT_ACK,
1773 ies := {
1774 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
1775 }
1776 }
Harald Welte9958a4d2017-12-14 21:21:33 +01001777
1778 template RSL_Message ts_RSL_IPA_PDCH_DEACT_NACK(RslChannelNr chan_nr, RSL_Cause cause) := {
Harald Welteee19c732018-04-05 09:08:26 +02001779 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01001780 msg_type := RSL_MT_IPAC_PDCH_DEACT_NACK,
1781 ies := {
1782 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1783 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
1784 }
1785 }
Harald Welteee19c732018-04-05 09:08:26 +02001786 template RSL_Message tr_RSL_IPA_PDCH_DEACT_NACK(template RslChannelNr chan_nr,
1787 template RSL_Cause cause) := {
1788 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1789 msg_type := RSL_MT_IPAC_PDCH_DEACT_NACK,
1790 ies := {
1791 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1792 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
1793 }
1794 }
Harald Welte9958a4d2017-12-14 21:21:33 +01001795
1796
Harald Welte6a8199d2018-01-29 21:58:53 +01001797 function f_rsl_find_ie(RSL_Message msg, RSL_IE_Type iei, out RSL_IE_Body ret) return boolean {
1798 for (var integer i := 0; i < sizeof(msg.ies); i := i+1) {
1799 if (msg.ies[i].iei == iei) {
1800 ret := msg.ies[i].body;
1801 return true;
1802 }
1803 }
1804 return false;
1805 }
1806
1807
Harald Welte9958a4d2017-12-14 21:21:33 +01001808
Harald Welte643e2a62017-11-27 15:03:18 +01001809} with { encode "RAW" ; variant "FIELDORDER(msb)" }