blob: 95a7b1ff00eb20f0926bbdd95907c51118f70c96 [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
Stefan Sperling4880be42018-08-07 18:12:59 +0200328 template (value) RSL_IE_ChannelMode ts_RSL_ChanMode_SIGN(boolean dtx_downlink := false) := {
Harald Welte8f2c21d2017-12-07 17:52:40 +0100329 len := 0, /* overwritten */
Harald Welte643e2a62017-11-27 15:03:18 +0100330 reserved := '000000'B,
Stefan Sperling4880be42018-08-07 18:12:59 +0200331 dtx_d := dtx_downlink,
Harald Welte643e2a62017-11-27 15:03:18 +0100332 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
Stefan Sperling4880be42018-08-07 18:12:59 +0200338 template (value) RSL_IE_ChannelMode ts_RSL_ChanMode(RSL_ChanRateType t, RSL_SpeechAlgo alg,
339 boolean dtx_downlink := false) := {
Harald Welte8f2c21d2017-12-07 17:52:40 +0100340 len := 0, /* overwritten */
Harald Welte643e2a62017-11-27 15:03:18 +0100341 reserved := '000000'B,
Stefan Sperling4880be42018-08-07 18:12:59 +0200342 dtx_d := dtx_downlink,
Harald Welte643e2a62017-11-27 15:03:18 +0100343 dtx_u := false,
344 spd_ind := RSL_SPDI_SPEECH,
345 ch_rate_type := t,
346 coding_alg_rate := alg
347 }
Harald Welte3618d9d2018-03-21 18:45:27 +0100348 template RSL_IE_ChannelMode tr_RSL_ChanMode(template RSL_ChanRateType t,
349 template RSL_SpeechAlgo alg) := {
350 len := ?,
351 reserved := '000000'B,
352 dtx_d := ?,
353 dtx_u := ?,
354 spd_ind := RSL_SPDI_SPEECH,
355 ch_rate_type := t,
356 coding_alg_rate := alg
357 }
Harald Welte643e2a62017-11-27 15:03:18 +0100358
359 /* 9.3.4 */
360 type record RSL_IE_BS_Power {
361 uint1_t reserved,
362 boolean epc,
363 boolean fpc,
364 uint5_t power_level
365 }
366
Harald Welte73cd2712017-12-17 00:44:52 +0100367 /* 9.3.7 */
Harald Weltee613f962018-04-18 22:38:16 +0200368 type enumerated RSL_AlgId {
369 RSL_ALG_ID_A5_0 ('00000001'B),
370 RSL_ALG_ID_A5_1 ('00000010'B),
371 RSL_ALG_ID_A5_2 ('00000011'B),
372 RSL_ALG_ID_A5_3 ('00000100'B),
373 RSL_ALG_ID_A5_4 ('00000101'B),
374 RSL_ALG_ID_A5_5 ('00000110'B),
375 RSL_ALG_ID_A5_6 ('00000111'B),
376 RSL_ALG_ID_A5_7 ('00001000'B)
377 } with { variant "FIELDLENGTH(8)" };
Harald Welte73cd2712017-12-17 00:44:52 +0100378 type record RSL_IE_EncryptionInfo {
379 uint8_t len,
Harald Weltee613f962018-04-18 22:38:16 +0200380 RSL_AlgId alg_id,
Harald Welte73cd2712017-12-17 00:44:52 +0100381 octetstring key
382 } with { variant (len) "LENGTHTO(alg_id,key)" };
383
Harald Weltee613f962018-04-18 22:38:16 +0200384 template RSL_IE_EncryptionInfo tr_RSL_IE_EncrInfo(template RSL_AlgId alg,
385 template octetstring key) := {
Harald Welte73cd2712017-12-17 00:44:52 +0100386 len := ?,
387 alg_id := alg,
388 key := key
389 }
Harald Weltee613f962018-04-18 22:38:16 +0200390 template (value) RSL_IE_EncryptionInfo ts_RSL_IE_EncrInfo(template (value) RSL_AlgId alg,
391 octetstring key) := {
Harald Welteefa7d912018-04-18 23:22:15 +0200392 len := 0, /* overwritten */
393 alg_id := alg,
394 key := key
395 }
396
397
Harald Welte73cd2712017-12-17 00:44:52 +0100398
Harald Welte643e2a62017-11-27 15:03:18 +0100399 /* 9.3.8 */
400 type record RSL_IE_FrameNumber {
401 uint5_t t1_p,
402 uint6_t t3,
403 uint5_t t2
404 }
405 type RSL_IE_FrameNumber RSL_IE_StartingTime;
406
407 /* 9.3.10 */
408 type record RSL_IE_L1Info {
409 uint5_t ms_power_lvl,
410 boolean fpc,
411 uint2_t reserved,
412 uint8_t actual_ta
413 }
414
415 /* 9.3.13 */
416 type record RSL_IE_MS_Power {
417 uint2_t reserved,
418 boolean fpc_epc,
419 uint5_t power_level
420 }
421
Harald Welted5f521e2017-12-07 17:53:06 +0100422 /* 9.3.18 */
423 type record RSL_IE_RachLoad {
424 uint8_t len,
425 uint16_t slot_count,
426 uint16_t busy_count,
427 uint16_t access_count
428 } with { variant (len) "LENGTHTO(slot_count,busy_count,access_count)" }
429
Harald Welteefa7d912018-04-18 23:22:15 +0200430 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 +0100431 len := 0, /* overwritten */
432 slot_count := slot,
433 busy_count := busy,
434 access_count := acc
435 }
436
Harald Welte68e495b2018-02-25 00:05:57 +0100437 template RSL_IE_RachLoad tr_RSL_IE_RachLoad(template uint16_t slot,
438 template uint16_t busy,
439 template uint16_t acc) := {
440 len := ?, /* overwritten */
441 slot_count := slot,
442 busy_count := busy,
443 access_count := acc
444 }
445
Harald Welte643e2a62017-11-27 15:03:18 +0100446 /* 9.3.19 */
447 type record RSL_IE_RequestRef {
448 OCT1 ra,
449 RSL_IE_FrameNumber frame_nr
450 }
451
452 /* 3GPP TS 44.018 / 10.5.2.38 Starting Time */
Harald Welte94e0c342018-04-07 11:33:23 +0200453 template (value) RSL_IE_FrameNumber ts_RSL_IE_FrameNumber(GsmFrameNumber fn) := {
Harald Welte643e2a62017-11-27 15:03:18 +0100454 t1_p := (fn / 1326) mod 32,
455 t3 := fn mod 51,
456 t2 := fn mod 26
457 }
458
Harald Welte9abd1282018-02-19 19:18:17 +0100459 function tr_RSL_IE_FrameNumber(template GsmFrameNumber fn) return template RSL_IE_FrameNumber {
460 if (istemplatekind(fn, "?")) {
461 return ?;
462 } else {
463 return ts_RSL_IE_FrameNumber(valueof(fn));
464 }
465 }
466
Harald Welteefa7d912018-04-18 23:22:15 +0200467 template (value) RSL_IE_RequestRef ts_RSL_IE_ReqRef(OCT1 ra, GsmFrameNumber frame_nr) := {
Harald Welte643e2a62017-11-27 15:03:18 +0100468 ra := ra,
469 frame_nr := ts_RSL_IE_FrameNumber(frame_nr)
470 }
471
Harald Welte9abd1282018-02-19 19:18:17 +0100472 template RSL_IE_RequestRef tr_RSL_IE_ReqRef(template OCT1 ra, template GsmFrameNumber frame_nr) := {
473 ra := ra,
474 frame_nr := tr_RSL_IE_FrameNumber(frame_nr)
475 }
476
Harald Welte15de8ba2018-06-29 08:51:42 +0200477 /* Osmocom Extension */
478 type record RSL_IE_UplinkMeasSuppMeasInfo {
479 int16_t toa256_mean,
480 int16_t toa256_min,
481 int16_t toa256_max,
482 uint16_t toa256_std_dev
483 };
484
Harald Welte2691adf2018-02-22 17:32:39 +0100485 /* 9.3.25 */
486 type record RSL_IE_UplinkMeas {
487 uint8_t len,
488 BIT1 rfu,
489 boolean dtx_d,
490 uint6_t rxlev_f_u,
491 BIT2 reserved1,
492 uint6_t rxlev_s_u,
493 BIT2 reserved2,
494 uint3_t rxq_f_u,
495 uint3_t rxq_s_u,
Harald Welte15de8ba2018-06-29 08:51:42 +0200496 RSL_IE_UplinkMeasSuppMeasInfo supp_meas_info optional
Harald Welte2691adf2018-02-22 17:32:39 +0100497 } 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 +0100498
Harald Welte643e2a62017-11-27 15:03:18 +0100499 /* 9.3.26 */
Harald Weltea8ed9062017-12-14 09:46:01 +0100500 type enumerated RSL_Cause {
501 /* normal event */
502 RSL_ERR_RADIO_IF_FAIL ('00'O),
503 RSL_ERR_RADIO_LINK_FAIL ('01'O),
504 RSL_ERR_HANDOVER_ACC_FAIL ('02'O),
505 RSL_ERR_TALKER_ACC_FAIL ('03'O),
506 RSL_ERR_OM_INTERVENTION ('07'O),
507 RSL_ERR_NORMAL_UNSPEC ('0f'O),
508 RSL_ERR_T_MSRFPCI_EXP ('18'O),
509 /* resource unavailable */
510 RSL_ERR_EQUIPMENT_FAIL ('20'O),
511 RSL_ERR_RR_UNAVAIL ('21'O),
512 RSL_ERR_TERR_CH_FAIL ('22'O),
513 RSL_ERR_CCCH_OVERLOAD ('23'O),
514 RSL_ERR_ACCH_OVERLOAD ('24'O),
515 RSL_ERR_PROCESSOR_OVERLOAD ('25'O),
516 RSL_ERR_BTS_NOT_EQUIPPED ('27'O),
517 RSL_ERR_REMOTE_TRAU_FAILURE ('28'O),
518 RSL_ERR_NOTIF_OVERFLOW ('29'O),
519 RSL_ERR_RES_UNAVAIL ('2f'O),
520 /* service or option not available */
521 RSL_ERR_TRANSC_UNAVAIL ('30'O),
522 RSL_ERR_SERV_OPT_UNAVAIL ('3f'O),
523 /* service or option not implemented */
524 RSL_ERR_ENCR_UNIMPL ('40'O),
525 RSL_ERR_SERV_OPT_UNIMPL ('4f'O),
526 /* invalid message */
527 RSL_ERR_RCH_ALR_ACTV_ALLOC ('50'O),
Harald Welte9912eb52018-02-25 13:30:15 +0100528 RSL_ERR_IPA_RCH_NOT_ACTV_ALLOC ('51'O),
529 RSL_ERR_IPA_CONN_INVALID ('52'O),
530 RSL_ERR_IPA_CONN_IN_USE ('53'O),
531 RSL_ERR_IPA_CONN_ALREADY_EXISTS ('54'O),
Harald Weltea8ed9062017-12-14 09:46:01 +0100532 RSL_ERR_INVALID_MESSAGE ('5f'O),
533 /* protocol error */
534 RSL_ERR_MSG_DISCR ('60'O),
535 RSL_ERR_MSG_TYPE ('61'O),
536 RSL_ERR_MSG_SEQ ('62'O),
537 RSL_ERR_IE_ERROR ('63'O),
538 RSL_ERR_MAND_IE_ERROR ('64'O),
539 RSL_ERR_OPT_IE_ERROR ('65'O),
540 RSL_ERR_IE_NONEXIST ('66'O),
541 RSL_ERR_IE_LENGTH ('67'O),
542 RSL_ERR_IE_CONTENT ('68'O),
543 RSL_ERR_PROTO ('6f'O),
544 /* interworking */
545 RSL_ERR_INTERWORKING ('7f'O)
546 };
Harald Welte643e2a62017-11-27 15:03:18 +0100547 type record RSL_IE_Cause {
Harald Welte6efa8e32017-12-09 22:34:06 +0100548 uint8_t len,
Harald Welte643e2a62017-11-27 15:03:18 +0100549 uint1_t e,
550 RSL_Cause cause,
551 octetstring cause_ext optional
Harald Welte6efa8e32017-12-09 22:34:06 +0100552 } with { variant (len) "LENGTHTO(e,cause,cause_ext)" }
Harald Welte643e2a62017-11-27 15:03:18 +0100553
Harald Welteefa7d912018-04-18 23:22:15 +0200554 template (value) RSL_IE_Cause ts_RSL_IE_Cause(RSL_Cause cause) := {
Harald Welte6efa8e32017-12-09 22:34:06 +0100555 len := 0, /* overwritten */
Harald Welte643e2a62017-11-27 15:03:18 +0100556 e := 0,
557 cause := cause,
558 cause_ext := omit
559 }
560
Harald Welte9abd1282018-02-19 19:18:17 +0100561 template RSL_IE_Cause tr_RSL_IE_Cause(template RSL_Cause cause) := {
562 len := ?,
563 e := 0,
564 cause := cause,
565 cause_ext := omit
566 }
567
Harald Welte643e2a62017-11-27 15:03:18 +0100568 /* 9.3.40 */
569 type enumerated RSL_ChanNeeded {
570 RSL_CHANNEED_ANY ('00'B),
571 RSL_CHANNEED_SDCCH ('01'B),
572 RSL_CHANNEED_TCH_F ('10'B),
573 RSL_CHANNEED_TCH_ForH ('11'B)
Harald Welte51d74102017-12-10 23:05:02 +0100574 } with { variant "FIELDLENGTH(2)" };
Harald Welte643e2a62017-11-27 15:03:18 +0100575 type record RSL_IE_ChanNeeded {
576 uint6_t reserved,
577 RSL_ChanNeeded chan_needed
578 }
579
580 /* 9.3.53 */
581 type record RSL_IE_MultirateCtrl {
582 uint3_t spare,
583 boolean od,
584 boolean pre,
585 uint2_t rae,
586 boolean tfo
587 }
588
589 type enumerated RSL_IE_SysinfoType {
590 RSL_SYSTEM_INFO_8 ('00000000'B),
591 RSL_SYSTEM_INFO_1 ('00000001'B),
592 RSL_SYSTEM_INFO_2 ('00000010'B),
593 RSL_SYSTEM_INFO_3 ('00000011'B),
594 RSL_SYSTEM_INFO_4 ('00000100'B),
595 RSL_SYSTEM_INFO_5 ('00000101'B),
596 RSL_SYSTEM_INFO_6 ('00000110'B),
597 RSL_SYSTEM_INFO_7 ('00000111'B),
598 RSL_SYSTEM_INFO_16 ('00001000'B),
599 RSL_SYSTEM_INFO_17 ('00001001'B),
600 RSL_SYSTEM_INFO_2bis ('00001010'B),
601 RSL_SYSTEM_INFO_2ter ('00001011'B),
602 RSL_SYSTEM_INFO_5bis ('00001101'B),
603 RSL_SYSTEM_INFO_5ter ('00001110'B),
604 RSL_SYSTEM_INFO_10 ('00001111'B),
605 RSL_EXT_MEAS_ORDER ('01000111'B),
606 RSL_MEAS_INFO ('01001000'B),
607 RSL_SYSTEM_INFO_13 ('00101000'B),
608 RSL_ERIC_SYSTEM_INFO_13 ('00001100'B),
609 RSL_SYSTEM_INFO_2quater ('00101001'B),
610 RSL_SYSTEM_INFO_9 ('00101010'B),
611 RSL_SYSTEM_INFO_18 ('00101011'B),
612 RSL_SYSTEM_INFO_19 ('00101100'B),
613 RSL_SYSTEM_INFO_20 ('00101101'B)
614 } with { variant "FIELDLENGTH(8)" }
615
Harald Welte9958a4d2017-12-14 21:21:33 +0100616 type record RSL_IE_IPA_ConnectionStats {
617 uint8_t len,
618 uint32_t tx_packets,
619 uint32_t tx_octets,
620 uint32_t rx_packets,
621 uint32_t rx_octets,
622 uint32_t lost_packets,
623 uint32_t jitter,
624 uint32_t avg_delay
625 } with { variant (len) "LENGTHTO(tx_packets,tx_octets,rx_packets,rx_octets,lost_packets,jitter,avg_delay)" }
626
627 type enumerated RSL_IPA_SpeechMode {
628 RSL_IPA_SPM_SENDRECV ('00'B),
629 RSL_IPA_SPM_RECVONLY ('01'B),
630 RSL_IPA_SPM_SENDONLY ('10'B),
631 RSL_IPA_SPM_RESERVED ('11'B)
632 } with { variant "FIELDLENGTH(2)" }
633
634 type enumerated RSL_IPA_Codec {
635 RSL_IPA_CODEC_FR ('0000'B),
636 RSL_IPA_CODEC_EFR ('0001'B),
637 RSL_IPA_CODEC_AMR_F ('0010'B),
638 RSL_IPA_CODEC_HR ('0011'B),
639 RSL_IPA_CODEC_AMR_H ('0101'B),
640 RSL_IPA_CODEC_RTP_PT ('1111'B)
641 } with { variant "FIELDLENGTH(4)" }
642
643 type record RSL_IE_IPA_SpeechMode {
644 BIT2 reserved,
645 RSL_IPA_SpeechMode mode,
646 RSL_IPA_Codec codec
647 }
648
Harald Welte0472ab42018-03-12 15:02:26 +0100649 /* 9.3.20 */
650 type enumerated RSL_IE_ReleaseMode {
651 RSL_REL_MODE_NORMAL ('00'B),
652 REL_REL_MODE_LOCAL ('01'B)
653 }
654
Harald Welte643e2a62017-11-27 15:03:18 +0100655 /* union of all IE bodies */
656 type union RSL_IE_Body {
657 RslChannelNr chan_nr,
658 RslLinkId link_id,
Harald Welte15bb5b52017-12-07 17:52:04 +0100659 RSL_L16V l3_info,
Harald Welte643e2a62017-11-27 15:03:18 +0100660 RSL_LV rlm_cause,
Harald Welte0472ab42018-03-12 15:02:26 +0100661 RSL_IE_ReleaseMode release_mode,
Harald Welte643e2a62017-11-27 15:03:18 +0100662 RSL_IE_ActivationType act_type,
663 RSL_IE_ChannelMode chan_mode,
664 uint8_t handover_ref,
665 RSL_IE_BS_Power bs_power,
666 RSL_IE_MS_Power ms_power,
667 uint8_t timing_adv,
668 RSL_IE_MultirateCtrl multirate_ctrl,
669 RSL_IE_FrameNumber frame_nr,
670 RSL_IE_Cause cause,
671 uint8_t access_delay,
Harald Welted5f521e2017-12-07 17:53:06 +0100672 RSL_IE_RachLoad rach_load,
Harald Welte643e2a62017-11-27 15:03:18 +0100673 uint8_t meas_res_nr,
Harald Welte2691adf2018-02-22 17:32:39 +0100674 uint8_t ms_timing_offset,
675 RSL_IE_UplinkMeas uplink_meas,
Harald Welte643e2a62017-11-27 15:03:18 +0100676 RSL_IE_L1Info l1_info,
677 RSL_IE_SysinfoType sysinfo_type,
678 uint16_t paging_load,
679 uint8_t paging_group,
680 RSL_IE_ChanNeeded chan_needed,
681 RSL_IE_StartingTime starting_time,
Harald Welte73cd2712017-12-17 00:44:52 +0100682 RSL_IE_EncryptionInfo encr_info,
Harald Welte643e2a62017-11-27 15:03:18 +0100683 RSL_IE_RequestRef req_ref,
684 RSL_LV full_imm_ass_info,
Harald Weltefff69302017-12-07 17:53:42 +0100685 RSL_LV ms_identity,
Harald Welte643e2a62017-11-27 15:03:18 +0100686
Harald Welte9958a4d2017-12-14 21:21:33 +0100687 uint16_t ipa_conn_id,
688 uint16_t ipa_local_port,
689 uint16_t ipa_remote_port,
690 uint32_t ipa_local_ip,
691 uint32_t ipa_remote_ip,
692 uint8_t ipa_rtp_pt,
693 uint8_t ipa_rtp_pt2,
694 RSL_IE_IPA_ConnectionStats ipa_stats,
695 RSL_IE_IPA_SpeechMode ipa_speech_mode,
696
Harald Welte643e2a62017-11-27 15:03:18 +0100697 RSL_LV other
698 }
699
700 type record RSL_IE {
701 RSL_IE_Type iei,
702 RSL_IE_Body body
703 } with { variant (body) "CROSSTAG(
704 chan_nr, iei = RSL_IE_CHAN_NR;
705 link_id, iei = RSL_IE_LINK_IDENT;
706 l3_info, iei = RSL_IE_L3_INFO;
707 rlm_cause, iei = RSL_IE_RLM_CAUSE;
708 release_mode, iei = RSL_IE_RELEASE_MODE;
709 act_type, iei = RSL_IE_ACT_TYPE;
710 chan_mode, iei = RSL_IE_CHAN_MODE;
711 handover_ref, iei = RSL_IE_HANDO_REF;
712 bs_power, iei = RSL_IE_BS_POWER;
713 ms_power, iei = RSL_IE_MS_POWER;
714 timing_adv, iei = RSL_IE_TIMING_ADVANCE;
715 multirate_ctrl, iei = RSL_IE_MR_CONTROL;
716
717 frame_nr, iei = RSL_IE_FRAME_NUMBER;
718 cause, iei = RSL_IE_CAUSE;
719 access_delay, iei = RSL_IE_ACCESS_DELAY;
Harald Welted5f521e2017-12-07 17:53:06 +0100720 rach_load, iei = RSL_IE_RACH_LOAD;
Harald Welte643e2a62017-11-27 15:03:18 +0100721 meas_res_nr, iei = RSL_IE_MEAS_RES_NR;
Harald Welte2691adf2018-02-22 17:32:39 +0100722 ms_timing_offset, iei = RSL_IE_MS_TIMING_OFFSET;
723 uplink_meas, iei = RSL_IE_UPLINK_MEAS;
Harald Welte643e2a62017-11-27 15:03:18 +0100724 l1_info, iei = RSL_IE_L1_INFO;
725 sysinfo_type, iei = RSL_IE_SYSINFO_TYPE;
726 paging_load, iei = RSL_IE_PAGING_LOAD;
727 paging_group, iei = RSL_IE_PAGING_GROUP;
728 chan_needed, iei = RSL_IE_CHAN_NEEDED;
729 starting_time, iei = RSL_IE_STARTNG_TIME;
Harald Welte73cd2712017-12-17 00:44:52 +0100730 encr_info, iei = RSL_IE_ENCR_INFO;
Harald Welte643e2a62017-11-27 15:03:18 +0100731
732 req_ref, iei = RSL_IE_REQ_REFERENCE;
Harald Weltefff69302017-12-07 17:53:42 +0100733 full_imm_ass_info, iei = RSL_IE_FULL_IMM_ASS_INFO;
734 ms_identity, iei = RSL_IE_MS_IDENTITY;
735 other, iei = RSL_IE_FULL_BCCH_INFO;
Harald Welte643e2a62017-11-27 15:03:18 +0100736
Harald Welte9958a4d2017-12-14 21:21:33 +0100737 ipa_conn_id, iei = RSL_IE_IPAC_CONN_ID;
738 ipa_remote_ip, iei = RSL_IE_IPAC_REMOTE_IP;
739 ipa_remote_port, iei = RSL_IE_IPAC_REMOTE_PORT;
740 ipa_local_ip, iei = RSL_IE_IPAC_LOCAL_IP;
741 ipa_local_port, iei = RSL_IE_IPAC_LOCAL_PORT;
742 ipa_rtp_pt, iei = RSL_IE_IPAC_RTP_PAYLOAD;
743 ipa_rtp_pt2, iei = RSL_IE_IPAC_RTP_PAYLOAD2;
744 ipa_stats, iei = RSL_IE_IPAC_CONN_STAT;
745 ipa_speech_mode, iei = RSL_IE_IPAC_SPEECH_MODE;
746
Harald Welte643e2a62017-11-27 15:03:18 +0100747 other, OTHERWISE;
748 )" };
749
Harald Welte735dd072017-12-12 14:55:17 +0100750 /* For some reason the TTCN-3 RAW codec cannot automatically figure out the IEI
751 * that it needs to set for a given union-choice (body). So we have to explicitly
752 * specify the IEI by the caller :( */
Harald Welteefa7d912018-04-18 23:22:15 +0200753 template (value) RSL_IE t_RSL_IE(RSL_IE_Type iei, template (value) RSL_IE_Body body) := {
Harald Welte735dd072017-12-12 14:55:17 +0100754 iei := iei,
Harald Welte643e2a62017-11-27 15:03:18 +0100755 body := body
756 }
757
Harald Weltec2877752017-12-07 17:54:35 +0100758 template RSL_IE tr_RSL_IE(template RSL_IE_Body body) := {
759 iei := ?, /* overwritten? */
760 body := body
761 }
762
763
Harald Welte643e2a62017-11-27 15:03:18 +0100764 type record of RSL_IE RSL_IE_List;
765
766 type record RSL_Message {
767 RSL_MessageDiscriminator msg_disc,
768 RSL_MessageType msg_type,
769 RSL_IE_List ies optional
770 }
771
772 external function enc_RSL_Message(in RSL_Message msg) return octetstring
773 with { extension "prototype(convert) encode(RAW)" };
774 external function dec_RSL_Message(in octetstring stream) return RSL_Message
775 with { extension "prototype(convert) decode(RAW)" };
776
Harald Weltebc330be2017-12-09 00:56:36 +0100777 template RSL_Message tr_RSL_MsgDiscType(template RSL_MessageDiscriminator m_disc,
Harald Welte643e2a62017-11-27 15:03:18 +0100778 RSL_MessageType m_type) := {
779 msg_disc := m_disc,
780 msg_type := m_type,
781 ies := *
782 }
783
Harald Welteefa7d912018-04-18 23:22:15 +0200784 template (value) RSL_Message ts_RSL_MsgDiscType(template (value) RSL_MessageDiscriminator m_disc,
785 template (value) RSL_MessageType msg_type,
786 template (omit) RSL_IE_List ies := omit) := {
Harald Welte4a267362017-12-09 17:49:32 +0100787 msg_disc := m_disc,
788 msg_type := msg_type,
789 ies := ies
790 }
791
Harald Weltebc330be2017-12-09 00:56:36 +0100792template RSL_Message tr_RSL_MsgType(template RSL_MessageType msg_type) := {
793 msg_disc := ?,
794 msg_type := msg_type,
795 ies := *
796}
797
798/* Common Channel Management */
799template RSL_Message tr_RSL_MsgTypeC(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
800 msg_disc := { RSL_MDISC_CCHAN, ? }
801}
802
803/* RLL */
804template RSL_Message tr_RSL_MsgTypeR(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
805 msg_disc := { RSL_MDISC_RLL, true }
806}
807
808/* Dedicated Channel Management */
809template RSL_Message tr_RSL_MsgTypeD(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
810 msg_disc := { RSL_MDISC_DCHAN, ? }
811}
812
813/* Dedicated Channel Management */
814template RSL_Message tr_RSL_MsgTypeT(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
815 msg_disc := { RSL_MDISC_TRX_MGMT, ? }
816}
817
818
819/* dedicated channel or RLL */
820template RSL_Message tr_RSL_MsgTypeDR(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
Harald Weltee5408222018-01-29 21:57:58 +0100821 msg_disc := ({RSL_MDISC_DCHAN,?}, {RSL_MDISC_RLL,?}, {RSL_MDISC_IPACCESS,false})
Harald Weltebc330be2017-12-09 00:56:36 +0100822}
823
824
Harald Welte643e2a62017-11-27 15:03:18 +0100825 /* 8.3.1 BSC -> BTS */
Harald Welteefa7d912018-04-18 23:22:15 +0200826 template (value) RSL_Message ts_RSL_DATA_REQ(template (value) RslChannelNr chan_nr,
827 template (value) RslLinkId link_id,
828 octetstring l3_info) := {
Harald Welte643e2a62017-11-27 15:03:18 +0100829 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, true),
830 msg_type := RSL_MT_DATA_REQ,
831 ies :={
Harald Welte735dd072017-12-12 14:55:17 +0100832 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
833 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
834 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
Harald Welte643e2a62017-11-27 15:03:18 +0100835 }
836 }
837
Harald Welte7794d5b2017-12-16 23:00:20 +0100838 template RSL_Message tr_RSL_DATA_REQ(template RslChannelNr chan_nr :=?,
839 template RslLinkId link_id := ?,
840 template octetstring l3_info := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +0200841 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, true),
Harald Welte7794d5b2017-12-16 23:00:20 +0100842 msg_type := RSL_MT_DATA_REQ,
843 ies :={
844 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
845 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
846 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
847 }
848 }
849
850
Harald Welte643e2a62017-11-27 15:03:18 +0100851 /* 8.3.2 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +0200852 template (value) RSL_Message ts_RSL_DATA_IND(template (value) RslChannelNr chan_nr,
853 template (value) RslLinkId link_id,
854 octetstring l3_info) := {
Harald Welte643e2a62017-11-27 15:03:18 +0100855 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, true),
856 msg_type := RSL_MT_DATA_IND,
857 ies :={
Harald Welte735dd072017-12-12 14:55:17 +0100858 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
859 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
860 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
Harald Welte643e2a62017-11-27 15:03:18 +0100861 }
862 }
Harald Welte9abd1282018-02-19 19:18:17 +0100863 template RSL_Message tr_RSL_DATA_IND(template RslChannelNr chan_nr, template RslLinkId link_id,
864 template octetstring l3_info := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +0200865 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, true),
Harald Welte9abd1282018-02-19 19:18:17 +0100866 msg_type := RSL_MT_DATA_IND,
867 ies :={
868 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
869 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
870 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
871 }
872 }
Harald Welte643e2a62017-11-27 15:03:18 +0100873
874 /* 8.3.3 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +0200875 template (value) RSL_Message ts_RSL_ERROR_IND(template (value) RslChannelNr chan_nr,
876 template (value) RslLinkId link_id, RSL_Cause cause) := {
Harald Welte643e2a62017-11-27 15:03:18 +0100877 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
878 msg_type := RSL_MT_ERROR_IND,
879 ies :={
Harald Welte735dd072017-12-12 14:55:17 +0100880 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
881 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
882 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
Harald Welte643e2a62017-11-27 15:03:18 +0100883 }
884 }
Harald Welte9abd1282018-02-19 19:18:17 +0100885 template RSL_Message tr_RSL_ERROR_IND(template RslChannelNr chan_nr, template RslLinkId link_id,
886 template RSL_Cause cause := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +0200887 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Welte9abd1282018-02-19 19:18:17 +0100888 msg_type := RSL_MT_ERROR_IND,
889 ies :={
890 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
891 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
892 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
893 }
894 }
Harald Welte643e2a62017-11-27 15:03:18 +0100895
Harald Welteefa7d912018-04-18 23:22:15 +0200896 /* 8.3.4 BTS <- BSC */
897 template (value) RSL_Message ts_RSL_EST_REQ(template (value) RslChannelNr chan_nr,
898 template (value) RslLinkId link_id) := {
899 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
900 msg_type := RSL_MT_EST_REQ,
901 ies := {
902 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
903 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
904 }
905 }
906 template RSL_Message tr_RSL_EST_REQ(template RslChannelNr chan_nr, template RslLinkId link_id) := {
907 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
908 msg_type := RSL_MT_EST_REQ,
909 ies := {
910 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
911 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
912 }
913 }
914
915 /* 8.3.5 BTS -> BSC */
916 template (value) RSL_Message ts_RSL_EST_CONF(template (value) RslChannelNr chan_nr,
917 template (value) RslLinkId link_id) := {
918 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
919 msg_type := RSL_MT_EST_CONF,
920 ies := {
921 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
922 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
923 }
924 }
925 template RSL_Message tr_RSL_EST_CONF(template RslChannelNr chan_nr, template RslLinkId link_id) := {
926 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
927 msg_type := RSL_MT_EST_CONF,
928 ies := {
929 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
930 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
931 }
932 }
933
Harald Welte643e2a62017-11-27 15:03:18 +0100934 /* 8.3.6 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +0200935 template (value) RSL_Message ts_RSL_EST_IND(template (value) RslChannelNr chan_nr,
936 template (value) RslLinkId link_id,
937 octetstring l3_info) := {
Harald Welte643e2a62017-11-27 15:03:18 +0100938 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
939 msg_type := RSL_MT_EST_IND,
940 ies := {
Harald Welte735dd072017-12-12 14:55:17 +0100941 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
942 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
943 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
Harald Welte643e2a62017-11-27 15:03:18 +0100944 }
945 }
Harald Welte9abd1282018-02-19 19:18:17 +0100946 template RSL_Message tr_RSL_EST_IND(template RslChannelNr chan_nr, template RslLinkId link_id,
947 template octetstring l3_info := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +0200948 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Welte9abd1282018-02-19 19:18:17 +0100949 msg_type := RSL_MT_EST_IND,
950 ies := {
951 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
952 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
953 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
954 }
955 }
Harald Welte0472ab42018-03-12 15:02:26 +0100956 template RSL_Message tr_RSL_EST_IND_NOL3(template RslChannelNr chan_nr, template RslLinkId link_id) :=
957{
958 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
959 msg_type := RSL_MT_EST_IND,
960 ies := {
961 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
962 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
963 }
964 }
965
Harald Welte643e2a62017-11-27 15:03:18 +0100966
967 /* 8.3.7 BSC -> BTS */
Harald Welteefa7d912018-04-18 23:22:15 +0200968 template (value) RSL_Message ts_RSL_REL_REQ(template (value) RslChannelNr chan_nr,
Harald Welte0472ab42018-03-12 15:02:26 +0100969 template (value) RslLinkId link_id,
970 template (value) RSL_IE_ReleaseMode rel_mode := RSL_REL_MODE_NORMAL) := {
Harald Welte643e2a62017-11-27 15:03:18 +0100971 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
972 msg_type := RSL_MT_REL_REQ,
973 ies :={
Harald Welte735dd072017-12-12 14:55:17 +0100974 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
Harald Welte0472ab42018-03-12 15:02:26 +0100975 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
976 t_RSL_IE(RSL_IE_RELEASE_MODE, RSL_IE_Body:{release_mode := rel_mode})
Harald Welte643e2a62017-11-27 15:03:18 +0100977 }
978 }
Harald Weltee8a5ab12017-12-09 22:34:57 +0100979 template RSL_Message tr_RSL_REL_REQ(template RslChannelNr chan_nr,
Harald Welte0472ab42018-03-12 15:02:26 +0100980 template RslLinkId link_id,
981 template RSL_IE_ReleaseMode rel_mode := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +0200982 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Weltee8a5ab12017-12-09 22:34:57 +0100983 msg_type := RSL_MT_REL_REQ,
984 ies :={
985 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
986 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
Harald Welte0472ab42018-03-12 15:02:26 +0100987 tr_RSL_IE(RSL_IE_Body:{release_mode := rel_mode})
Harald Weltee8a5ab12017-12-09 22:34:57 +0100988 }
989 }
Harald Welte643e2a62017-11-27 15:03:18 +0100990
991 /* 8.3.8 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +0200992 template (value) RSL_Message ts_RSL_REL_CONF(template (value) RslChannelNr chan_nr,
993 template (value) RslLinkId link_id) := {
Harald Welte643e2a62017-11-27 15:03:18 +0100994 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
995 msg_type := RSL_MT_REL_CONF,
996 ies :={
Harald Welte735dd072017-12-12 14:55:17 +0100997 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
998 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
Harald Welte643e2a62017-11-27 15:03:18 +0100999 }
1000 }
Harald Welte9abd1282018-02-19 19:18:17 +01001001 template RSL_Message tr_RSL_REL_CONF(template RslChannelNr chan_nr, template RslLinkId link_id) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001002 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001003 msg_type := RSL_MT_REL_CONF,
1004 ies :={
1005 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1006 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1007 }
1008 }
Harald Welte643e2a62017-11-27 15:03:18 +01001009
1010 /* 8.3.9 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001011 template (value) RSL_Message ts_RSL_REL_IND(template (value) RslChannelNr chan_nr,
1012 template (value) RslLinkId link_id) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001013 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1014 msg_type := RSL_MT_REL_IND,
1015 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001016 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1017 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
Harald Welte643e2a62017-11-27 15:03:18 +01001018 }
1019 }
Harald Welte9abd1282018-02-19 19:18:17 +01001020 template RSL_Message tr_RSL_REL_IND(template RslChannelNr chan_nr, template RslLinkId link_id) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001021 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001022 msg_type := RSL_MT_REL_IND,
1023 ies :={
1024 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1025 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1026 }
1027 }
Harald Welte643e2a62017-11-27 15:03:18 +01001028
1029 /* 8.3.10 BSC -> BTS */
Harald Welteefa7d912018-04-18 23:22:15 +02001030 template (value) RSL_Message ts_RSL_UNITDATA_REQ(template (value) RslChannelNr chan_nr,
1031 template (value) RslLinkId link_id,
1032 octetstring l3_info)
Harald Welte643e2a62017-11-27 15:03:18 +01001033 modifies ts_RSL_DATA_REQ := {
1034 msg_type := RSL_MT_UNIT_DATA_REQ
1035 }
Harald Welte0472ab42018-03-12 15:02:26 +01001036 template RSL_Message tr_RSL_UNITDATA_REQ(template RslChannelNr chan_nr,
1037 template RslLinkId link_id,
1038 template octetstring l3_info)
1039 modifies tr_RSL_DATA_REQ := {
1040 msg_type := RSL_MT_UNIT_DATA_REQ
1041 }
1042
Harald Welte643e2a62017-11-27 15:03:18 +01001043
1044 /* 8.3.11 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001045 template (value) RSL_Message ts_RSL_UNITDATA_IND(template (value) RslChannelNr chan_nr,
1046 template (value) RslLinkId link_id,
1047 octetstring l3_info)
Harald Welte643e2a62017-11-27 15:03:18 +01001048 modifies ts_RSL_DATA_IND := {
1049 msg_type := RSL_MT_UNIT_DATA_IND
1050 }
Harald Welte0472ab42018-03-12 15:02:26 +01001051 template RSL_Message tr_RSL_UNITDATA_IND(template RslChannelNr chan_nr,
1052 template (value) RslLinkId link_id,
1053 template octetstring l3_info)
1054 modifies tr_RSL_DATA_IND := {
1055 msg_type := RSL_MT_UNIT_DATA_IND
1056 }
1057
1058
Harald Welte643e2a62017-11-27 15:03:18 +01001059
1060
1061 /* DEDICATED CANNEL MANAGEMENT MESSAGES */
1062
1063 /* 8.4.1 BSC -> BTS */
Harald Welteefa7d912018-04-18 23:22:15 +02001064 template (value) RSL_Message ts_RSL_CHAN_ACT(template (value) RslChannelNr chan_nr,
1065 template (value) RSL_IE_ChannelMode mode) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001066 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1067 msg_type := RSL_MT_CHAN_ACTIV,
1068 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001069 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1070 t_RSL_IE(RSL_IE_ACT_TYPE, RSL_IE_Body:{act_type := t_RSL_IE_ActType}),
1071 t_RSL_IE(RSL_IE_CHAN_MODE, RSL_IE_Body:{chan_mode := mode})
Harald Welte643e2a62017-11-27 15:03:18 +01001072 /* lots of optional IEs */
1073 }
1074 }
Harald Welte94e0c342018-04-07 11:33:23 +02001075 template RSL_Message tr_RSL_CHAN_ACT(template RslChannelNr chan_nr,
1076 template RSL_IE_ChannelMode mode) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001077 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte94e0c342018-04-07 11:33:23 +02001078 msg_type := RSL_MT_CHAN_ACTIV,
1079 ies :={
1080 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1081 tr_RSL_IE(RSL_IE_Body:{act_type := t_RSL_IE_ActType}),
1082 tr_RSL_IE(RSL_IE_Body:{chan_mode := mode}),
1083 /* lots of optional IEs */
1084 *
1085 }
1086 }
1087 template RSL_Message tr_RSL_CHAN_ACT_PDCH(template RslChannelNr chan_nr,
1088 template RSL_IE_ChannelMode mode) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001089 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte94e0c342018-04-07 11:33:23 +02001090 msg_type := RSL_MT_CHAN_ACTIV,
1091 ies :={
1092 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1093 tr_RSL_IE(RSL_IE_Body:{act_type := t_RSL_IE_ActType_PDCH}),
1094 /* lots of optional IEs */
1095 *
1096 }
1097 }
1098
Harald Welte643e2a62017-11-27 15:03:18 +01001099
1100 /* 8.4.2 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001101 template (value) RSL_Message ts_RSL_CHAN_ACT_ACK(template (value) RslChannelNr chan_nr,
1102 GsmFrameNumber fn) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001103 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1104 msg_type := RSL_MT_CHAN_ACTIV_ACK,
1105 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001106 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1107 t_RSL_IE(RSL_IE_FRAME_NUMBER, RSL_IE_Body:{frame_nr := ts_RSL_IE_FrameNumber(fn)})
Harald Welte643e2a62017-11-27 15:03:18 +01001108 }
1109 }
Harald Welte9abd1282018-02-19 19:18:17 +01001110 template RSL_Message tr_RSL_CHAN_ACT_ACK(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001111 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001112 msg_type := RSL_MT_CHAN_ACTIV_ACK,
1113 ies := {
1114 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1115 tr_RSL_IE(RSL_IE_Body:{frame_nr := ?})
1116 }
1117 }
Harald Welte643e2a62017-11-27 15:03:18 +01001118
1119 /* 8.4.3 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001120 template (value) RSL_Message ts_RSL_CHAN_ACT_NACK(template (value) RslChannelNr chan_nr,
1121 RSL_Cause cause) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001122 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1123 msg_type := RSL_MT_CHAN_ACTIV_NACK,
1124 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001125 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1126 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
Harald Welte643e2a62017-11-27 15:03:18 +01001127 }
1128 }
Harald Welte9abd1282018-02-19 19:18:17 +01001129 template RSL_Message tr_RSL_CHAN_ACT_NACK(template RslChannelNr chan_nr,
1130 template RSL_Cause cause := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001131 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001132 msg_type := RSL_MT_CHAN_ACTIV_NACK,
1133 ies := {
1134 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1135 tr_RSL_IE(RSL_IE_Body:{cause := ?})
1136 }
1137 }
Harald Welte643e2a62017-11-27 15:03:18 +01001138
1139 /* 8.4.4 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001140 template (value) RSL_Message ts_RSL_CONN_FAIL_IND(RslChannelNr chan_nr, RSL_Cause cause) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001141 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1142 msg_type := RSL_MT_CONN_FAIL,
1143 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001144 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1145 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
Harald Welte643e2a62017-11-27 15:03:18 +01001146 }
1147 }
Harald Welte9abd1282018-02-19 19:18:17 +01001148 template RSL_Message tr_RSL_CONN_FAIL_IND(template RslChannelNr chan_nr,
1149 template RSL_Cause cause := ?) := {
1150 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1151 msg_type := RSL_MT_CONN_FAIL,
1152 ies :={
1153 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1154 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
1155 }
1156 }
Harald Welte643e2a62017-11-27 15:03:18 +01001157
Harald Weltee8a5ab12017-12-09 22:34:57 +01001158 /* 8.4.5 BSC -> BTS */
1159 template RSL_Message tr_RSL_DEACT_SACCH(template RslChannelNr chan_nr) := {
1160 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1161 msg_type := RSL_MT_DEACTIVATE_SACCH,
1162 ies := {
1163 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
1164 }
1165 }
Harald Welteefa7d912018-04-18 23:22:15 +02001166 template (value) RSL_Message ts_RSL_DEACT_SACCH(template (value) RslChannelNr chan_nr) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001167 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1168 msg_type := RSL_MT_DEACTIVATE_SACCH,
1169 ies := {
1170 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1171 }
1172 }
1173
Harald Weltee8a5ab12017-12-09 22:34:57 +01001174
Harald Welte73cd2712017-12-17 00:44:52 +01001175 /* 8.4.6 BSC ->BTS */
1176 template RSL_Message tr_RSL_ENCR_CMD(template RslChannelNr chan_nr,
1177 template RslLinkId link_id := ?,
Harald Weltee613f962018-04-18 22:38:16 +02001178 template RSL_AlgId alg := ?,
Harald Welte73cd2712017-12-17 00:44:52 +01001179 template octetstring key := ?,
1180 template octetstring l3_info := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001181 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte73cd2712017-12-17 00:44:52 +01001182 msg_type := RSL_MT_ENCR_CMD,
1183 ies := {
1184 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1185 tr_RSL_IE(RSL_IE_Body:{encr_info := tr_RSL_IE_EncrInfo(alg, key)}),
1186 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
1187 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
1188 }
1189 }
Harald Welteefa7d912018-04-18 23:22:15 +02001190 template (value) RSL_Message ts_RSL_ENCR_CMD(template (value) RslChannelNr chan_nr,
1191 template (value) RslLinkId link_id,
Harald Weltee613f962018-04-18 22:38:16 +02001192 template (value) RSL_AlgId alg, octetstring key,
Harald Welteefa7d912018-04-18 23:22:15 +02001193 octetstring l3_info) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001194 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1195 msg_type := RSL_MT_ENCR_CMD,
1196 ies := {
1197 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
Harald Welteefa7d912018-04-18 23:22:15 +02001198 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 +01001199 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
Harald Welteefa7d912018-04-18 23:22:15 +02001200 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
Harald Welte9abd1282018-02-19 19:18:17 +01001201 }
1202 }
Harald Welte73cd2712017-12-17 00:44:52 +01001203
Harald Welte2691adf2018-02-22 17:32:39 +01001204 template RSL_Message tr_RSL_MEAS_RES(template RslChannelNr chan_nr,
1205 template uint8_t meas_res_nr := ?,
1206 template RSL_IE_UplinkMeas ul_meas := ?,
1207 template RSL_IE_BS_Power bs_power := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001208 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte2691adf2018-02-22 17:32:39 +01001209 msg_type := RSL_MT_MEAS_RES,
1210 ies := {
1211 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1212 tr_RSL_IE(RSL_IE_Body:{meas_res_nr := meas_res_nr}),
1213 tr_RSL_IE(RSL_IE_Body:{uplink_meas := ul_meas}),
1214 tr_RSL_IE(RSL_IE_Body:{bs_power := bs_power}),
1215 *
1216 }
1217 }
1218
Harald Welte39b47be2018-02-23 18:58:48 +01001219 /* Osmocom specific template, require lots of optional fields to be present */
1220 template RSL_Message tr_RSL_MEAS_RES_OSMO(template RslChannelNr chan_nr,
1221 template uint8_t meas_res_nr := ?,
1222 template RSL_IE_UplinkMeas ul_meas := ?,
1223 template RSL_IE_BS_Power bs_power := ?,
1224 template RSL_IE_L1Info l1_info := ?,
1225 template octetstring l3_info := ?,
1226 template uint8_t ms_to := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001227 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte39b47be2018-02-23 18:58:48 +01001228 msg_type := RSL_MT_MEAS_RES,
1229 ies := {
1230 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1231 tr_RSL_IE(RSL_IE_Body:{meas_res_nr := meas_res_nr}),
1232 tr_RSL_IE(RSL_IE_Body:{uplink_meas := ul_meas}),
1233 tr_RSL_IE(RSL_IE_Body:{bs_power := bs_power}),
1234 tr_RSL_IE(RSL_IE_Body:{l1_info := l1_info}),
1235 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)}),
1236 tr_RSL_IE(RSL_IE_Body:{ms_timing_offset := ms_to})
1237 }
1238 }
1239
1240
Harald Welte7794d5b2017-12-16 23:00:20 +01001241 /* 8.4.10 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001242 template (value) RSL_Message ts_RSL_MODE_MODIFY_ACK(template (value) RslChannelNr chan_nr) := {
Harald Welte7794d5b2017-12-16 23:00:20 +01001243 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1244 msg_type := RSL_MT_MODE_MODIFY_ACK,
1245 ies := {
1246 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1247 }
1248 }
Harald Welte9abd1282018-02-19 19:18:17 +01001249 template RSL_Message tr_RSL_MODE_MODIFY_ACK(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001250 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001251 msg_type := RSL_MT_MODE_MODIFY_ACK,
1252 ies := {
1253 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
1254 }
1255 }
Harald Welte7794d5b2017-12-16 23:00:20 +01001256
Harald Welte643e2a62017-11-27 15:03:18 +01001257 /* 8.4.11 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001258 template (value) RSL_Message ts_RSL_MODE_MODIFY_NACK(template (value) RslChannelNr chan_nr,
1259 RSL_Cause cause) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001260 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1261 msg_type := RSL_MT_MODE_MODIFY_NACK,
1262 ies := {
1263 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1264 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
1265 }
Harald Welte643e2a62017-11-27 15:03:18 +01001266 }
Harald Welte9abd1282018-02-19 19:18:17 +01001267 template RSL_Message tr_RSL_MODE_MODIFY_NACK(template RslChannelNr chan_nr,
1268 template RSL_Cause cause) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001269 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001270 msg_type := RSL_MT_MODE_MODIFY_NACK,
1271 ies := {
1272 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1273 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
1274 }
1275 }
1276
Harald Welte643e2a62017-11-27 15:03:18 +01001277
Harald Welte6a8199d2018-01-29 21:58:53 +01001278 /* 8.4.14: BTS <- BSC */
1279 template RSL_Message tr_RSL_RF_CHAN_REL(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001280 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte6a8199d2018-01-29 21:58:53 +01001281 msg_type := RSL_MT_RF_CHAN_REL,
1282 ies := {
1283 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
1284 }
1285 }
Harald Welteefa7d912018-04-18 23:22:15 +02001286 template (value) RSL_Message ts_RSL_RF_CHAN_REL(template (value) RslChannelNr chan_nr) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001287 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1288 msg_type := RSL_MT_RF_CHAN_REL,
1289 ies := {
1290 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1291 }
1292 }
Harald Welte6a8199d2018-01-29 21:58:53 +01001293
Harald Welte4a267362017-12-09 17:49:32 +01001294 /* 8.4.19 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001295 template (value) RSL_Message ts_RSL_RF_CHAN_REL_ACK(template (value) RslChannelNr chan_nr) :=
Harald Welte4a267362017-12-09 17:49:32 +01001296 ts_RSL_MsgDiscType(ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1297 RSL_MT_RF_CHAN_REL_ACK,
Harald Welte735dd072017-12-12 14:55:17 +01001298 { t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}) });
Harald Welte4a267362017-12-09 17:49:32 +01001299
Harald Welte9abd1282018-02-19 19:18:17 +01001300 template RSL_Message tr_RSL_RF_CHAN_REL_ACK(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001301 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001302 msg_type := RSL_MT_RF_CHAN_REL_ACK,
1303 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001304 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
Harald Welte9abd1282018-02-19 19:18:17 +01001305 }
1306 }
1307
Harald Welteea17b912018-03-11 22:29:31 +01001308 /* 8.6.20 BTS <- BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001309 template (value) RSL_Message ts_RSL_SACCH_INF_MOD(template (value) RslChannelNr chan_nr,
1310 RSL_IE_SysinfoType si_type,
1311 octetstring l3_info) := {
Harald Welteea17b912018-03-11 22:29:31 +01001312 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1313 msg_type := RSL_MT_SACCH_INFO_MODIFY,
1314 ies := {
1315 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1316 t_RSL_IE(RSL_IE_SYSINFO_TYPE, RSL_IE_Body:{sysinfo_type := si_type}),
1317 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
1318 }
1319 }
1320
Neels Hofmeyr378a49c2018-06-15 22:18:43 +02001321 /* 8.4.7 BTS -> BSC */
1322 template (value) RSL_Message ts_RSL_HANDO_DET(template (value) RslChannelNr chan_nr) := {
1323 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1324 msg_type := RSL_MT_HANDO_DET,
1325 ies := {
1326 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1327 }
1328 }
1329
Harald Welteea17b912018-03-11 22:29:31 +01001330
Harald Welte643e2a62017-11-27 15:03:18 +01001331 /* COMMON CHANNEL MANAGEMENT MESSAGES */
1332
Harald Welte874c2232018-02-24 04:52:43 +01001333 /* 8.5.1 BTS <- BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001334 template (value) RSL_Message ts_RSL_BCCH_INFO(RSL_IE_SysinfoType si_type,
1335 octetstring full_bcch_info) := {
Harald Welte874c2232018-02-24 04:52:43 +01001336 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1337 msg_type := RSL_MT_BCCH_INFO,
1338 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001339 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_BCCH(0)}),
Harald Welte874c2232018-02-24 04:52:43 +01001340 t_RSL_IE(RSL_IE_SYSINFO_TYPE, RSL_IE_Body:{sysinfo_type := si_type}),
1341 t_RSL_IE(RSL_IE_FULL_BCCH_INFO, RSL_IE_Body:{other := ts_RSL_LV(full_bcch_info)})
1342 }
1343 }
1344
Harald Welte7ae93142017-12-07 17:56:15 +01001345 /* 8.5.2 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001346 template (value) RSL_Message ts_RSL_RACH_LOAD_IND(uint16_t slot_ct, uint16_t busy_ct,
1347 uint16_t acc_ct) := {
Harald Welte7ae93142017-12-07 17:56:15 +01001348 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1349 msg_type := RSL_MT_CCCH_LOAD_IND,
1350 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001351 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_RACH(0)}),
Harald Welte735dd072017-12-12 14:55:17 +01001352 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 +01001353 }
1354 }
Harald Welte68e495b2018-02-25 00:05:57 +01001355 template RSL_Message tr_RSL_RACH_LOAD_IND(template uint16_t slot_ct := ?,
1356 template uint16_t busy_ct := ?,
1357 template uint16_t acc_ct) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001358 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Welte68e495b2018-02-25 00:05:57 +01001359 msg_type := RSL_MT_CCCH_LOAD_IND,
1360 ies := {
1361 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_RACH(0)}),
1362 tr_RSL_IE(RSL_IE_Body:{rach_load := tr_RSL_IE_RachLoad(slot_ct, busy_ct, acc_ct)})
1363 }
1364 }
1365
Harald Welteefa7d912018-04-18 23:22:15 +02001366 template (value) RSL_Message ts_RSL_PAGING_LOAD_IND(uint16_t buffer_space) := {
Harald Welte7ae93142017-12-07 17:56:15 +01001367 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1368 msg_type := RSL_MT_CCCH_LOAD_IND,
1369 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001370 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_PCH_AGCH(0)}),
Harald Welte735dd072017-12-12 14:55:17 +01001371 t_RSL_IE(RSL_IE_PAGING_LOAD, RSL_IE_Body:{paging_load := buffer_space})
Harald Welte7ae93142017-12-07 17:56:15 +01001372 }
1373 }
Harald Welte68e495b2018-02-25 00:05:57 +01001374 template RSL_Message tr_RSL_PAGING_LOAD_IND(template uint16_t buffer_space := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001375 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Welte68e495b2018-02-25 00:05:57 +01001376 msg_type := RSL_MT_CCCH_LOAD_IND,
1377 ies := {
1378 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(0)}),
1379 tr_RSL_IE(RSL_IE_Body:{paging_load := buffer_space})
1380 }
1381 }
1382
Harald Welte7ae93142017-12-07 17:56:15 +01001383
Harald Welte643e2a62017-11-27 15:03:18 +01001384 /* 8.5.3 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001385 template (value) RSL_Message ts_RSL_CHAN_RQD(OCT1 ra, GsmFrameNumber fn, uint8_t acc_del := 0) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001386 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1387 msg_type := RSL_MT_CHAN_RQD,
1388 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001389 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_RACH(0)}),
Harald Welte735dd072017-12-12 14:55:17 +01001390 t_RSL_IE(RSL_IE_REQ_REFERENCE, RSL_IE_Body:{req_ref := ts_RSL_IE_ReqRef(ra, fn)}),
1391 t_RSL_IE(RSL_IE_ACCESS_DELAY, RSL_IE_Body:{access_delay := acc_del})
Harald Welte643e2a62017-11-27 15:03:18 +01001392 }
1393 }
Harald Welte9abd1282018-02-19 19:18:17 +01001394 template RSL_Message tr_RSL_CHAN_RQD(template OCT1 ra, template GsmFrameNumber fn := ?,
1395 template uint8_t acc_del := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001396 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001397 msg_type := RSL_MT_CHAN_RQD,
1398 ies := {
1399 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_RACH(0)}),
1400 tr_RSL_IE(RSL_IE_Body:{req_ref := tr_RSL_IE_ReqRef(ra, fn)}),
1401 tr_RSL_IE(RSL_IE_Body:{access_delay := acc_del})
1402 }
1403 }
Harald Welte643e2a62017-11-27 15:03:18 +01001404
1405 /* 8.5.4 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001406 template (value) RSL_Message ts_DELETE_IND(template (value) RslChannelNr chan_nr,
1407 octetstring imm_ass) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001408 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1409 msg_type := RSL_MT_DELETE_IND,
1410 ies := {
Harald Welte735dd072017-12-12 14:55:17 +01001411 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1412 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 +01001413 }
1414 }
Harald Weltee8d750e2018-06-10 21:41:35 +02001415 template RSL_Message tr_RSL_DELETE_IND(template octetstring imm_ass := ?, template uint3_t tn) := {
1416 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1417 msg_type := RSL_MT_DELETE_IND,
1418 ies := {
1419 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(tn)}),
1420 tr_RSL_IE(RSL_IE_Body:{full_imm_ass_info := tr_RSL_LV(imm_ass)}),
1421 *
1422 }
1423 }
Harald Welte643e2a62017-11-27 15:03:18 +01001424
Harald Weltec2877752017-12-07 17:54:35 +01001425 /* 8.5.5 BSC -> BTS */
1426 template RSL_Message tr_RSL_PAGING_CMD(template octetstring identity, template uint3_t tn := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001427 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Weltec2877752017-12-07 17:54:35 +01001428 msg_type := RSL_MT_PAGING_CMD,
1429 ies := {
1430 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(tn)}),
1431 tr_RSL_IE(RSL_IE_Body:{paging_group := ?}),
Harald Welte51d74102017-12-10 23:05:02 +01001432 tr_RSL_IE(RSL_IE_Body:{ms_identity := tr_RSL_LV(identity)}),
Harald Weltec2877752017-12-07 17:54:35 +01001433 * /* opt: channel needed, eMLPP prio */
1434 }
1435 }
Harald Welteefa7d912018-04-18 23:22:15 +02001436 template (value) RSL_Message ts_RSL_PAGING_CMD(octetstring identity, uint8_t pg, uint3_t tn := 0) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001437 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1438 msg_type := RSL_MT_PAGING_CMD,
1439 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001440 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_PCH_AGCH(tn)}),
Harald Welte9abd1282018-02-19 19:18:17 +01001441 t_RSL_IE(RSL_IE_PAGING_GROUP, RSL_IE_Body:{paging_group := pg}),
1442 t_RSL_IE(RSL_IE_MS_IDENTITY, RSL_IE_Body:{ms_identity := ts_RSL_LV(identity)})
1443 }
1444 }
Harald Weltec2877752017-12-07 17:54:35 +01001445
1446 /* 8.5.6 BSC -> BTS */
1447 template RSL_Message tr_RSL_IMM_ASSIGN(template uint3_t tn := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001448 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Weltec2877752017-12-07 17:54:35 +01001449 msg_type := RSL_MT_IMMEDIATE_ASSIGN_CMD,
1450 ies := {
1451 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(tn)}),
1452 tr_RSL_IE(RSL_IE_Body:{full_imm_ass_info := ?})
1453 }
1454 }
Harald Welteefa7d912018-04-18 23:22:15 +02001455 template (value) RSL_Message ts_RSL_IMM_ASSIGN(octetstring f_ass_inf, uint3_t tn := 0) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001456 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1457 msg_type := RSL_MT_IMMEDIATE_ASSIGN_CMD,
1458 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001459 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_PCH_AGCH(tn)}),
Harald Welte9abd1282018-02-19 19:18:17 +01001460 t_RSL_IE(RSL_IE_FULL_IMM_ASS_INFO, RSL_IE_Body:{full_imm_ass_info := ts_RSL_LV(f_ass_inf)})
1461 }
1462 }
Harald Weltec2877752017-12-07 17:54:35 +01001463
Harald Welte68e495b2018-02-25 00:05:57 +01001464 template RSL_Message tr_RSL_RF_RES_IND := {
Harald Welteefa7d912018-04-18 23:22:15 +02001465 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
Harald Welte68e495b2018-02-25 00:05:57 +01001466 msg_type := RSL_MT_RF_RES_IND,
1467 ies := *
1468 }
1469
1470 /* 8.6.2 BTS <- BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001471 template (value) RSL_Message ts_RSL_SACCH_FILL(RSL_IE_SysinfoType si_type, octetstring l3_info) := {
Harald Welte68e495b2018-02-25 00:05:57 +01001472 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
1473 msg_type := RSL_MT_SACCH_FILL,
1474 ies := {
1475 t_RSL_IE(RSL_IE_SYSINFO_TYPE, RSL_IE_Body:{sysinfo_type := si_type}),
1476 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
1477 }
1478 }
1479
Harald Welte643e2a62017-11-27 15:03:18 +01001480 /* 8.6.4 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001481 template (value) RSL_Message ts_RSL_ERROR_REPORT(RSL_Cause cause) := {
Harald Welte01d982c2018-02-25 01:31:40 +01001482 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
1483 msg_type := RSL_MT_ERROR_REPORT,
Harald Welte643e2a62017-11-27 15:03:18 +01001484 ies := {
Harald Welte735dd072017-12-12 14:55:17 +01001485 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
Harald Welte643e2a62017-11-27 15:03:18 +01001486 }
1487 }
Harald Welte01d982c2018-02-25 01:31:40 +01001488 template RSL_Message tr_RSL_ERROR_REPORT(template RSL_Cause cause := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001489 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
Harald Welte01d982c2018-02-25 01:31:40 +01001490 msg_type := RSL_MT_ERROR_REPORT,
1491 ies := {
1492 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)}),
1493 *
1494 }
1495 }
1496
Harald Welte643e2a62017-11-27 15:03:18 +01001497
Harald Welte9958a4d2017-12-14 21:21:33 +01001498
1499 /* Abis/IP specific messages */
1500
1501 template RSL_Message tr_RSL_IPA_CRCX(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001502 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01001503 msg_type := RSL_MT_IPAC_CRCX,
1504 ies := {
1505 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1506 *
1507 }
1508 }
Harald Welteefa7d912018-04-18 23:22:15 +02001509 template (value) RSL_Message ts_RSL_IPA_CRCX(template (value) RslChannelNr chan_nr) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001510 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
1511 msg_type := RSL_MT_IPAC_CRCX,
1512 ies := {
1513 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1514 }
1515 }
1516
Harald Welte9958a4d2017-12-14 21:21:33 +01001517
Harald Welteefa7d912018-04-18 23:22:15 +02001518 template (value) RSL_Message ts_RSL_IPA_CRCX_ACK(template (value) RslChannelNr chan_nr,
1519 uint16_t ipa_conn_id, uint32_t local_ip,
1520 uint16_t local_port, uint7_t rtp_pt2) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01001521 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
1522 msg_type := RSL_MT_IPAC_CRCX_ACK,
1523 ies := {
1524 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1525 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
1526 t_RSL_IE(RSL_IE_IPAC_LOCAL_IP, RSL_IE_Body:{ipa_local_ip := local_ip}),
1527 t_RSL_IE(RSL_IE_IPAC_LOCAL_PORT, RSL_IE_Body:{ipa_local_port := local_port}),
1528 t_RSL_IE(RSL_IE_IPAC_RTP_PAYLOAD2, RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
1529 }
1530 }
Harald Welte9abd1282018-02-19 19:18:17 +01001531 template RSL_Message tr_RSL_IPA_CRCX_ACK(template RslChannelNr chan_nr,
1532 template uint16_t ipa_conn_id,
1533 template uint32_t local_ip,
Harald Welte8bd0f822018-02-25 12:43:28 +01001534 template uint16_t local_port) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001535 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001536 msg_type := RSL_MT_IPAC_CRCX_ACK,
1537 ies := {
1538 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1539 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
1540 tr_RSL_IE(RSL_IE_Body:{ipa_local_ip := local_ip}),
Harald Welte8bd0f822018-02-25 12:43:28 +01001541 tr_RSL_IE(RSL_IE_Body:{ipa_local_port := local_port})
1542 /* Optional: RTP Payload Type 2 IE */
Harald Welte9abd1282018-02-19 19:18:17 +01001543 }
1544 }
Harald Welte9958a4d2017-12-14 21:21:33 +01001545
Harald Welteefa7d912018-04-18 23:22:15 +02001546 template (value) RSL_Message ts_RSL_IPA_CRCX_NACK(template (value) RslChannelNr chan_nr,
1547 RSL_Cause cause) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01001548 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
1549 msg_type := RSL_MT_IPAC_CRCX_NACK,
1550 ies := {
1551 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1552 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
1553 }
1554 }
Harald Welte9abd1282018-02-19 19:18:17 +01001555 template RSL_Message tr_RSL_IPA_CRCX_NACK(template RslChannelNr chan_nr,
1556 template RSL_Cause cause := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001557 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001558 msg_type := RSL_MT_IPAC_CRCX_NACK,
1559 ies := {
1560 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1561 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
1562 }
1563 }
Harald Welte9958a4d2017-12-14 21:21:33 +01001564
Harald Welteefa7d912018-04-18 23:22:15 +02001565 template (value) RSL_Message ts_RSL_IPA_MDCX(template (value) RslChannelNr chan_nr,
1566 uint16_t ipa_conn_id,
1567 uint32_t remote_ip, uint16_t remote_port,
1568 uint7_t rtp_pt2) := {
Harald Welte30527452018-02-25 12:46:25 +01001569 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
1570 msg_type := RSL_MT_IPAC_MDCX,
1571 ies := {
1572 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1573 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
1574 t_RSL_IE(RSL_IE_IPAC_REMOTE_IP, RSL_IE_Body:{ipa_remote_ip := remote_ip}),
1575 t_RSL_IE(RSL_IE_IPAC_REMOTE_PORT, RSL_IE_Body:{ipa_remote_port := remote_port}),
1576 /* optional: RTP Payload Type */
1577 t_RSL_IE(RSL_IE_IPAC_RTP_PAYLOAD2, RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
1578 }
1579 }
Harald Welte9958a4d2017-12-14 21:21:33 +01001580 template RSL_Message tr_RSL_IPA_MDCX(template RslChannelNr chan_nr,
1581 template uint16_t ipa_conn_id) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001582 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01001583 msg_type := RSL_MT_IPAC_MDCX,
1584 ies := {
1585 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1586 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
1587 *
1588 }
1589 }
1590
Harald Welteefa7d912018-04-18 23:22:15 +02001591 template (value) RSL_Message ts_RSL_IPA_MDCX_ACK(template (value) RslChannelNr chan_nr,
1592 uint16_t ipa_conn_id,
1593 uint32_t local_ip, uint16_t local_port,
1594 uint7_t rtp_pt2) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01001595 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte71b5ec82017-12-16 23:01:10 +01001596 msg_type := RSL_MT_IPAC_MDCX_ACK,
Harald Welte9958a4d2017-12-14 21:21:33 +01001597 ies := {
1598 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1599 /* optional */
1600 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
Harald Welte6cb400a2018-02-25 12:45:25 +01001601 t_RSL_IE(RSL_IE_IPAC_LOCAL_IP, RSL_IE_Body:{ipa_local_ip := local_ip}),
1602 t_RSL_IE(RSL_IE_IPAC_LOCAL_PORT, RSL_IE_Body:{ipa_local_port := local_port}),
Harald Welte9958a4d2017-12-14 21:21:33 +01001603 /* optional: RTP Payload Type */
1604 t_RSL_IE(RSL_IE_IPAC_RTP_PAYLOAD2, RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
1605 }
1606 }
Harald Welte30527452018-02-25 12:46:25 +01001607 template RSL_Message tr_RSL_IPA_MDCX_ACK(template RslChannelNr chan_nr,
1608 template uint16_t ipa_conn_id,
1609 template uint32_t local_ip,
1610 template uint16_t local_port,
1611 template uint7_t rtp_pt2) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001612 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte30527452018-02-25 12:46:25 +01001613 msg_type := RSL_MT_IPAC_MDCX_ACK,
1614 ies := {
1615 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1616 /* optional */
1617 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
1618 tr_RSL_IE(RSL_IE_Body:{ipa_local_ip := local_ip}),
1619 tr_RSL_IE(RSL_IE_Body:{ipa_local_port := local_port}),
1620 /* optional: RTP Payload Type */
1621 tr_RSL_IE(RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
1622 }
1623 }
Harald Welte9958a4d2017-12-14 21:21:33 +01001624
Harald Welteefa7d912018-04-18 23:22:15 +02001625 template (value) RSL_Message ts_RSL_IPA_MDCX_NACK(template (value) RslChannelNr chan_nr,
1626 RSL_Cause cause,
1627 template (value) uint16_t ipa_conn_id) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01001628 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
1629 msg_type := RSL_MT_IPAC_MDCX_NACK,
1630 ies := {
1631 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1632 /* optional connection ID */
1633 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
1634 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
1635 }
1636 }
Harald Welte30527452018-02-25 12:46:25 +01001637 template RSL_Message tr_RSL_IPA_MDCX_NACK(template RslChannelNr chan_nr,
1638 template RSL_Cause cause,
1639 template uint16_t ipa_conn_id) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001640 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte30527452018-02-25 12:46:25 +01001641 msg_type := RSL_MT_IPAC_MDCX_NACK,
1642 ies := {
1643 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1644 /* optional connection ID */
1645 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
1646 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
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_DLCX_IND(template (value) RslChannelNr chan_nr,
1652 uint16_t ipa_conn_id,
1653 template (value) RSL_IE_IPA_ConnectionStats stats,
1654 RSL_Cause cause) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01001655 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
1656 msg_type := RSL_MT_IPAC_DLCX_IND,
1657 ies := {
1658 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1659 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
1660 t_RSL_IE(RSL_IE_IPAC_CONN_STAT, RSL_IE_Body:{ipa_stats := stats}),
1661 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
1662 }
1663 }
1664
Harald Welteefa7d912018-04-18 23:22:15 +02001665 template (value) RSL_Message ts_RSL_IPA_DLCX(template (value) RslChannelNr chan_nr,
1666 uint16_t ipa_conn_id) := {
Harald Weltea871a382018-02-25 02:03:14 +01001667 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
1668 msg_type := RSL_MT_IPAC_DLCX,
1669 ies := {
Harald Welte2a7e7162018-02-25 12:46:48 +01001670 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1671 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id})
Harald Weltea871a382018-02-25 02:03:14 +01001672 }
1673 }
Harald Welte9958a4d2017-12-14 21:21:33 +01001674 template RSL_Message tr_RSL_IPA_DLCX(template RslChannelNr chan_nr,
1675 template uint16_t ipa_conn_id := omit) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001676 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01001677 msg_type := RSL_MT_IPAC_DLCX,
1678 ies := {
1679 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1680 /* FIXME: optional conn_id */
1681 *
1682 }
1683 }
1684
Harald Welteefa7d912018-04-18 23:22:15 +02001685 template (value) RSL_Message ts_RSL_IPA_DLCX_ACK(template (value) RslChannelNr chan_nr,
1686 uint16_t ipa_conn_id,
1687 RSL_IE_IPA_ConnectionStats stats) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01001688 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
1689 msg_type := RSL_MT_IPAC_DLCX_ACK,
1690 ies := {
1691 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1692 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
1693 t_RSL_IE(RSL_IE_IPAC_CONN_STAT, RSL_IE_Body:{ipa_stats := stats})
1694 }
1695 }
Harald Weltea871a382018-02-25 02:03:14 +01001696 template RSL_Message tr_RSL_IPA_DLCX_ACK(template RslChannelNr chan_nr,
1697 template uint16_t ipa_conn_id,
1698 template RSL_IE_IPA_ConnectionStats stats) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001699 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Weltea871a382018-02-25 02:03:14 +01001700 msg_type := RSL_MT_IPAC_DLCX_ACK,
1701 ies := {
1702 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1703 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
1704 tr_RSL_IE(RSL_IE_Body:{ipa_stats := stats})
1705 }
1706 }
1707
1708
Harald Welte9958a4d2017-12-14 21:21:33 +01001709
Harald Welteefa7d912018-04-18 23:22:15 +02001710 template (value) RSL_Message ts_RSL_IPA_DLCX_NACK(template (value) RslChannelNr chan_nr,
1711 RSL_Cause cause, uint16_t ipa_conn_id) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01001712 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
1713 msg_type := RSL_MT_IPAC_DLCX_NACK,
1714 ies := {
1715 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1716 /* optional connection ID */
1717 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
1718 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
1719 }
1720 }
Harald Weltea871a382018-02-25 02:03:14 +01001721 template RSL_Message tr_RSL_IPA_DLCX_NACK(template RslChannelNr chan_nr,
1722 template RSL_Cause cause) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001723 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Weltea871a382018-02-25 02:03:14 +01001724 msg_type := RSL_MT_IPAC_DLCX_NACK,
1725 ies := {
1726 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1727 /* optional connection ID */
1728 *,
1729 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
1730 }
1731 }
1732
Harald Welte9958a4d2017-12-14 21:21:33 +01001733
Harald Welteefa7d912018-04-18 23:22:15 +02001734 template (value) RSL_Message ts_RSL_IPA_PDCH_ACT(RslChannelNr chan_nr) := {
Harald Welteee19c732018-04-05 09:08:26 +02001735 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1736 msg_type := RSL_MT_IPAC_PDCH_ACT,
1737 ies := {
1738 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1739 }
1740 }
Harald Welte9958a4d2017-12-14 21:21:33 +01001741 template RSL_Message tr_RSL_IPA_PDCH_ACT(template RslChannelNr chan_nr) := {
Harald Welteee19c732018-04-05 09:08:26 +02001742 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01001743 msg_type := RSL_MT_IPAC_PDCH_ACT,
1744 ies := {
1745 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
1746 }
1747 }
1748
Harald Welteee19c732018-04-05 09:08:26 +02001749
Harald Welte94e0c342018-04-07 11:33:23 +02001750 template RSL_Message ts_RSL_IPA_PDCH_ACT_ACK(RslChannelNr chan_nr,
1751 template (value) RSL_IE_FrameNumber fn) := {
Harald Welteee19c732018-04-05 09:08:26 +02001752 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01001753 msg_type := RSL_MT_IPAC_PDCH_ACT_ACK,
1754 ies := {
1755 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1756 t_RSL_IE(RSL_IE_FRAME_NUMBER, RSL_IE_Body:{frame_nr := fn})
1757 }
1758 }
Harald Welteee19c732018-04-05 09:08:26 +02001759 template RSL_Message tr_RSL_IPA_PDCH_ACT_ACK(template RslChannelNr chan_nr,
1760 template RSL_IE_FrameNumber fn) := {
1761 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1762 msg_type := RSL_MT_IPAC_PDCH_ACT_ACK,
1763 ies := {
1764 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1765 tr_RSL_IE(RSL_IE_Body:{frame_nr := fn})
1766 }
1767 }
Harald Welte9958a4d2017-12-14 21:21:33 +01001768
1769 template RSL_Message ts_RSL_IPA_PDCH_ACT_NACK(RslChannelNr chan_nr, RSL_Cause cause) := {
Harald Welteee19c732018-04-05 09:08:26 +02001770 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01001771 msg_type := RSL_MT_IPAC_PDCH_ACT_NACK,
1772 ies := {
1773 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1774 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
1775 }
1776 }
Harald Welteee19c732018-04-05 09:08:26 +02001777 template RSL_Message tr_RSL_IPA_PDCH_ACT_NACK(template RslChannelNr chan_nr,
1778 template RSL_Cause cause) := {
1779 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1780 msg_type := RSL_MT_IPAC_PDCH_ACT_NACK,
1781 ies := {
1782 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1783 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
1784 }
1785 }
Harald Welte9958a4d2017-12-14 21:21:33 +01001786
Harald Welteee19c732018-04-05 09:08:26 +02001787 template RSL_Message ts_RSL_IPA_PDCH_DEACT(RslChannelNr chan_nr) := {
1788 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1789 msg_type := RSL_MT_IPAC_PDCH_DEACT,
1790 ies := {
1791 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1792 }
1793 }
Harald Welte9958a4d2017-12-14 21:21:33 +01001794 template RSL_Message tr_RSL_IPA_PDCH_DEACT(template RslChannelNr chan_nr) := {
Harald Welteee19c732018-04-05 09:08:26 +02001795 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01001796 msg_type := RSL_MT_IPAC_PDCH_DEACT,
1797 ies := {
1798 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
1799 }
1800 }
1801
1802 template RSL_Message ts_RSL_IPA_PDCH_DEACT_ACK(RslChannelNr chan_nr) := {
Harald Welteee19c732018-04-05 09:08:26 +02001803 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01001804 msg_type := RSL_MT_IPAC_PDCH_DEACT_ACK,
1805 ies := {
1806 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1807 }
1808 }
Harald Welteee19c732018-04-05 09:08:26 +02001809 template RSL_Message tr_RSL_IPA_PDCH_DEACT_ACK(template RslChannelNr chan_nr) := {
1810 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1811 msg_type := RSL_MT_IPAC_PDCH_DEACT_ACK,
1812 ies := {
1813 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
1814 }
1815 }
Harald Welte9958a4d2017-12-14 21:21:33 +01001816
1817 template RSL_Message ts_RSL_IPA_PDCH_DEACT_NACK(RslChannelNr chan_nr, RSL_Cause cause) := {
Harald Welteee19c732018-04-05 09:08:26 +02001818 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01001819 msg_type := RSL_MT_IPAC_PDCH_DEACT_NACK,
1820 ies := {
1821 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1822 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
1823 }
1824 }
Harald Welteee19c732018-04-05 09:08:26 +02001825 template RSL_Message tr_RSL_IPA_PDCH_DEACT_NACK(template RslChannelNr chan_nr,
1826 template RSL_Cause cause) := {
1827 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1828 msg_type := RSL_MT_IPAC_PDCH_DEACT_NACK,
1829 ies := {
1830 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1831 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
1832 }
1833 }
Harald Welte9958a4d2017-12-14 21:21:33 +01001834
1835
Harald Welte6a8199d2018-01-29 21:58:53 +01001836 function f_rsl_find_ie(RSL_Message msg, RSL_IE_Type iei, out RSL_IE_Body ret) return boolean {
1837 for (var integer i := 0; i < sizeof(msg.ies); i := i+1) {
1838 if (msg.ies[i].iei == iei) {
1839 ret := msg.ies[i].body;
1840 return true;
1841 }
1842 }
1843 return false;
1844 }
1845
1846
Harald Welte9958a4d2017-12-14 21:21:33 +01001847
Harald Welte643e2a62017-11-27 15:03:18 +01001848} with { encode "RAW" ; variant "FIELDORDER(msb)" }