blob: 3804d403a282faf5b9f67a047f29c896091f8236 [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 */
Harald Weltee613f962018-04-18 22:38:16 +0200367 type enumerated RSL_AlgId {
368 RSL_ALG_ID_A5_0 ('00000001'B),
369 RSL_ALG_ID_A5_1 ('00000010'B),
370 RSL_ALG_ID_A5_2 ('00000011'B),
371 RSL_ALG_ID_A5_3 ('00000100'B),
372 RSL_ALG_ID_A5_4 ('00000101'B),
373 RSL_ALG_ID_A5_5 ('00000110'B),
374 RSL_ALG_ID_A5_6 ('00000111'B),
375 RSL_ALG_ID_A5_7 ('00001000'B)
376 } with { variant "FIELDLENGTH(8)" };
Harald Welte73cd2712017-12-17 00:44:52 +0100377 type record RSL_IE_EncryptionInfo {
378 uint8_t len,
Harald Weltee613f962018-04-18 22:38:16 +0200379 RSL_AlgId alg_id,
Harald Welte73cd2712017-12-17 00:44:52 +0100380 octetstring key
381 } with { variant (len) "LENGTHTO(alg_id,key)" };
382
Harald Weltee613f962018-04-18 22:38:16 +0200383 template RSL_IE_EncryptionInfo tr_RSL_IE_EncrInfo(template RSL_AlgId alg,
384 template octetstring key) := {
Harald Welte73cd2712017-12-17 00:44:52 +0100385 len := ?,
386 alg_id := alg,
387 key := key
388 }
Harald Weltee613f962018-04-18 22:38:16 +0200389 template (value) RSL_IE_EncryptionInfo ts_RSL_IE_EncrInfo(template (value) RSL_AlgId alg,
390 octetstring key) := {
Harald Welteefa7d912018-04-18 23:22:15 +0200391 len := 0, /* overwritten */
392 alg_id := alg,
393 key := key
394 }
395
396
Harald Welte73cd2712017-12-17 00:44:52 +0100397
Harald Welte643e2a62017-11-27 15:03:18 +0100398 /* 9.3.8 */
399 type record RSL_IE_FrameNumber {
400 uint5_t t1_p,
401 uint6_t t3,
402 uint5_t t2
403 }
404 type RSL_IE_FrameNumber RSL_IE_StartingTime;
405
406 /* 9.3.10 */
407 type record RSL_IE_L1Info {
408 uint5_t ms_power_lvl,
409 boolean fpc,
410 uint2_t reserved,
411 uint8_t actual_ta
412 }
413
414 /* 9.3.13 */
415 type record RSL_IE_MS_Power {
416 uint2_t reserved,
417 boolean fpc_epc,
418 uint5_t power_level
419 }
420
Harald Welted5f521e2017-12-07 17:53:06 +0100421 /* 9.3.18 */
422 type record RSL_IE_RachLoad {
423 uint8_t len,
424 uint16_t slot_count,
425 uint16_t busy_count,
426 uint16_t access_count
427 } with { variant (len) "LENGTHTO(slot_count,busy_count,access_count)" }
428
Harald Welteefa7d912018-04-18 23:22:15 +0200429 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 +0100430 len := 0, /* overwritten */
431 slot_count := slot,
432 busy_count := busy,
433 access_count := acc
434 }
435
Harald Welte68e495b2018-02-25 00:05:57 +0100436 template RSL_IE_RachLoad tr_RSL_IE_RachLoad(template uint16_t slot,
437 template uint16_t busy,
438 template uint16_t acc) := {
439 len := ?, /* overwritten */
440 slot_count := slot,
441 busy_count := busy,
442 access_count := acc
443 }
444
Harald Welte643e2a62017-11-27 15:03:18 +0100445 /* 9.3.19 */
446 type record RSL_IE_RequestRef {
447 OCT1 ra,
448 RSL_IE_FrameNumber frame_nr
449 }
450
451 /* 3GPP TS 44.018 / 10.5.2.38 Starting Time */
Harald Welte94e0c342018-04-07 11:33:23 +0200452 template (value) RSL_IE_FrameNumber ts_RSL_IE_FrameNumber(GsmFrameNumber fn) := {
Harald Welte643e2a62017-11-27 15:03:18 +0100453 t1_p := (fn / 1326) mod 32,
454 t3 := fn mod 51,
455 t2 := fn mod 26
456 }
457
Harald Welte9abd1282018-02-19 19:18:17 +0100458 function tr_RSL_IE_FrameNumber(template GsmFrameNumber fn) return template RSL_IE_FrameNumber {
459 if (istemplatekind(fn, "?")) {
460 return ?;
461 } else {
462 return ts_RSL_IE_FrameNumber(valueof(fn));
463 }
464 }
465
Harald Welteefa7d912018-04-18 23:22:15 +0200466 template (value) RSL_IE_RequestRef ts_RSL_IE_ReqRef(OCT1 ra, GsmFrameNumber frame_nr) := {
Harald Welte643e2a62017-11-27 15:03:18 +0100467 ra := ra,
468 frame_nr := ts_RSL_IE_FrameNumber(frame_nr)
469 }
470
Harald Welte9abd1282018-02-19 19:18:17 +0100471 template RSL_IE_RequestRef tr_RSL_IE_ReqRef(template OCT1 ra, template GsmFrameNumber frame_nr) := {
472 ra := ra,
473 frame_nr := tr_RSL_IE_FrameNumber(frame_nr)
474 }
475
Harald Welte2691adf2018-02-22 17:32:39 +0100476 /* 9.3.25 */
477 type record RSL_IE_UplinkMeas {
478 uint8_t len,
479 BIT1 rfu,
480 boolean dtx_d,
481 uint6_t rxlev_f_u,
482 BIT2 reserved1,
483 uint6_t rxlev_s_u,
484 BIT2 reserved2,
485 uint3_t rxq_f_u,
486 uint3_t rxq_s_u,
487 octetstring supp_meas_info optional
488 } 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 +0100489
Harald Welte643e2a62017-11-27 15:03:18 +0100490 /* 9.3.26 */
Harald Weltea8ed9062017-12-14 09:46:01 +0100491 type enumerated RSL_Cause {
492 /* normal event */
493 RSL_ERR_RADIO_IF_FAIL ('00'O),
494 RSL_ERR_RADIO_LINK_FAIL ('01'O),
495 RSL_ERR_HANDOVER_ACC_FAIL ('02'O),
496 RSL_ERR_TALKER_ACC_FAIL ('03'O),
497 RSL_ERR_OM_INTERVENTION ('07'O),
498 RSL_ERR_NORMAL_UNSPEC ('0f'O),
499 RSL_ERR_T_MSRFPCI_EXP ('18'O),
500 /* resource unavailable */
501 RSL_ERR_EQUIPMENT_FAIL ('20'O),
502 RSL_ERR_RR_UNAVAIL ('21'O),
503 RSL_ERR_TERR_CH_FAIL ('22'O),
504 RSL_ERR_CCCH_OVERLOAD ('23'O),
505 RSL_ERR_ACCH_OVERLOAD ('24'O),
506 RSL_ERR_PROCESSOR_OVERLOAD ('25'O),
507 RSL_ERR_BTS_NOT_EQUIPPED ('27'O),
508 RSL_ERR_REMOTE_TRAU_FAILURE ('28'O),
509 RSL_ERR_NOTIF_OVERFLOW ('29'O),
510 RSL_ERR_RES_UNAVAIL ('2f'O),
511 /* service or option not available */
512 RSL_ERR_TRANSC_UNAVAIL ('30'O),
513 RSL_ERR_SERV_OPT_UNAVAIL ('3f'O),
514 /* service or option not implemented */
515 RSL_ERR_ENCR_UNIMPL ('40'O),
516 RSL_ERR_SERV_OPT_UNIMPL ('4f'O),
517 /* invalid message */
518 RSL_ERR_RCH_ALR_ACTV_ALLOC ('50'O),
Harald Welte9912eb52018-02-25 13:30:15 +0100519 RSL_ERR_IPA_RCH_NOT_ACTV_ALLOC ('51'O),
520 RSL_ERR_IPA_CONN_INVALID ('52'O),
521 RSL_ERR_IPA_CONN_IN_USE ('53'O),
522 RSL_ERR_IPA_CONN_ALREADY_EXISTS ('54'O),
Harald Weltea8ed9062017-12-14 09:46:01 +0100523 RSL_ERR_INVALID_MESSAGE ('5f'O),
524 /* protocol error */
525 RSL_ERR_MSG_DISCR ('60'O),
526 RSL_ERR_MSG_TYPE ('61'O),
527 RSL_ERR_MSG_SEQ ('62'O),
528 RSL_ERR_IE_ERROR ('63'O),
529 RSL_ERR_MAND_IE_ERROR ('64'O),
530 RSL_ERR_OPT_IE_ERROR ('65'O),
531 RSL_ERR_IE_NONEXIST ('66'O),
532 RSL_ERR_IE_LENGTH ('67'O),
533 RSL_ERR_IE_CONTENT ('68'O),
534 RSL_ERR_PROTO ('6f'O),
535 /* interworking */
536 RSL_ERR_INTERWORKING ('7f'O)
537 };
Harald Welte643e2a62017-11-27 15:03:18 +0100538 type record RSL_IE_Cause {
Harald Welte6efa8e32017-12-09 22:34:06 +0100539 uint8_t len,
Harald Welte643e2a62017-11-27 15:03:18 +0100540 uint1_t e,
541 RSL_Cause cause,
542 octetstring cause_ext optional
Harald Welte6efa8e32017-12-09 22:34:06 +0100543 } with { variant (len) "LENGTHTO(e,cause,cause_ext)" }
Harald Welte643e2a62017-11-27 15:03:18 +0100544
Harald Welteefa7d912018-04-18 23:22:15 +0200545 template (value) RSL_IE_Cause ts_RSL_IE_Cause(RSL_Cause cause) := {
Harald Welte6efa8e32017-12-09 22:34:06 +0100546 len := 0, /* overwritten */
Harald Welte643e2a62017-11-27 15:03:18 +0100547 e := 0,
548 cause := cause,
549 cause_ext := omit
550 }
551
Harald Welte9abd1282018-02-19 19:18:17 +0100552 template RSL_IE_Cause tr_RSL_IE_Cause(template RSL_Cause cause) := {
553 len := ?,
554 e := 0,
555 cause := cause,
556 cause_ext := omit
557 }
558
Harald Welte643e2a62017-11-27 15:03:18 +0100559 /* 9.3.40 */
560 type enumerated RSL_ChanNeeded {
561 RSL_CHANNEED_ANY ('00'B),
562 RSL_CHANNEED_SDCCH ('01'B),
563 RSL_CHANNEED_TCH_F ('10'B),
564 RSL_CHANNEED_TCH_ForH ('11'B)
Harald Welte51d74102017-12-10 23:05:02 +0100565 } with { variant "FIELDLENGTH(2)" };
Harald Welte643e2a62017-11-27 15:03:18 +0100566 type record RSL_IE_ChanNeeded {
567 uint6_t reserved,
568 RSL_ChanNeeded chan_needed
569 }
570
571 /* 9.3.53 */
572 type record RSL_IE_MultirateCtrl {
573 uint3_t spare,
574 boolean od,
575 boolean pre,
576 uint2_t rae,
577 boolean tfo
578 }
579
580 type enumerated RSL_IE_SysinfoType {
581 RSL_SYSTEM_INFO_8 ('00000000'B),
582 RSL_SYSTEM_INFO_1 ('00000001'B),
583 RSL_SYSTEM_INFO_2 ('00000010'B),
584 RSL_SYSTEM_INFO_3 ('00000011'B),
585 RSL_SYSTEM_INFO_4 ('00000100'B),
586 RSL_SYSTEM_INFO_5 ('00000101'B),
587 RSL_SYSTEM_INFO_6 ('00000110'B),
588 RSL_SYSTEM_INFO_7 ('00000111'B),
589 RSL_SYSTEM_INFO_16 ('00001000'B),
590 RSL_SYSTEM_INFO_17 ('00001001'B),
591 RSL_SYSTEM_INFO_2bis ('00001010'B),
592 RSL_SYSTEM_INFO_2ter ('00001011'B),
593 RSL_SYSTEM_INFO_5bis ('00001101'B),
594 RSL_SYSTEM_INFO_5ter ('00001110'B),
595 RSL_SYSTEM_INFO_10 ('00001111'B),
596 RSL_EXT_MEAS_ORDER ('01000111'B),
597 RSL_MEAS_INFO ('01001000'B),
598 RSL_SYSTEM_INFO_13 ('00101000'B),
599 RSL_ERIC_SYSTEM_INFO_13 ('00001100'B),
600 RSL_SYSTEM_INFO_2quater ('00101001'B),
601 RSL_SYSTEM_INFO_9 ('00101010'B),
602 RSL_SYSTEM_INFO_18 ('00101011'B),
603 RSL_SYSTEM_INFO_19 ('00101100'B),
604 RSL_SYSTEM_INFO_20 ('00101101'B)
605 } with { variant "FIELDLENGTH(8)" }
606
Harald Welte9958a4d2017-12-14 21:21:33 +0100607 type record RSL_IE_IPA_ConnectionStats {
608 uint8_t len,
609 uint32_t tx_packets,
610 uint32_t tx_octets,
611 uint32_t rx_packets,
612 uint32_t rx_octets,
613 uint32_t lost_packets,
614 uint32_t jitter,
615 uint32_t avg_delay
616 } with { variant (len) "LENGTHTO(tx_packets,tx_octets,rx_packets,rx_octets,lost_packets,jitter,avg_delay)" }
617
618 type enumerated RSL_IPA_SpeechMode {
619 RSL_IPA_SPM_SENDRECV ('00'B),
620 RSL_IPA_SPM_RECVONLY ('01'B),
621 RSL_IPA_SPM_SENDONLY ('10'B),
622 RSL_IPA_SPM_RESERVED ('11'B)
623 } with { variant "FIELDLENGTH(2)" }
624
625 type enumerated RSL_IPA_Codec {
626 RSL_IPA_CODEC_FR ('0000'B),
627 RSL_IPA_CODEC_EFR ('0001'B),
628 RSL_IPA_CODEC_AMR_F ('0010'B),
629 RSL_IPA_CODEC_HR ('0011'B),
630 RSL_IPA_CODEC_AMR_H ('0101'B),
631 RSL_IPA_CODEC_RTP_PT ('1111'B)
632 } with { variant "FIELDLENGTH(4)" }
633
634 type record RSL_IE_IPA_SpeechMode {
635 BIT2 reserved,
636 RSL_IPA_SpeechMode mode,
637 RSL_IPA_Codec codec
638 }
639
Harald Welte0472ab42018-03-12 15:02:26 +0100640 /* 9.3.20 */
641 type enumerated RSL_IE_ReleaseMode {
642 RSL_REL_MODE_NORMAL ('00'B),
643 REL_REL_MODE_LOCAL ('01'B)
644 }
645
Harald Welte643e2a62017-11-27 15:03:18 +0100646 /* union of all IE bodies */
647 type union RSL_IE_Body {
648 RslChannelNr chan_nr,
649 RslLinkId link_id,
Harald Welte15bb5b52017-12-07 17:52:04 +0100650 RSL_L16V l3_info,
Harald Welte643e2a62017-11-27 15:03:18 +0100651 RSL_LV rlm_cause,
Harald Welte0472ab42018-03-12 15:02:26 +0100652 RSL_IE_ReleaseMode release_mode,
Harald Welte643e2a62017-11-27 15:03:18 +0100653 RSL_IE_ActivationType act_type,
654 RSL_IE_ChannelMode chan_mode,
655 uint8_t handover_ref,
656 RSL_IE_BS_Power bs_power,
657 RSL_IE_MS_Power ms_power,
658 uint8_t timing_adv,
659 RSL_IE_MultirateCtrl multirate_ctrl,
660 RSL_IE_FrameNumber frame_nr,
661 RSL_IE_Cause cause,
662 uint8_t access_delay,
Harald Welted5f521e2017-12-07 17:53:06 +0100663 RSL_IE_RachLoad rach_load,
Harald Welte643e2a62017-11-27 15:03:18 +0100664 uint8_t meas_res_nr,
Harald Welte2691adf2018-02-22 17:32:39 +0100665 uint8_t ms_timing_offset,
666 RSL_IE_UplinkMeas uplink_meas,
Harald Welte643e2a62017-11-27 15:03:18 +0100667 RSL_IE_L1Info l1_info,
668 RSL_IE_SysinfoType sysinfo_type,
669 uint16_t paging_load,
670 uint8_t paging_group,
671 RSL_IE_ChanNeeded chan_needed,
672 RSL_IE_StartingTime starting_time,
Harald Welte73cd2712017-12-17 00:44:52 +0100673 RSL_IE_EncryptionInfo encr_info,
Harald Welte643e2a62017-11-27 15:03:18 +0100674 RSL_IE_RequestRef req_ref,
675 RSL_LV full_imm_ass_info,
Harald Weltefff69302017-12-07 17:53:42 +0100676 RSL_LV ms_identity,
Harald Welte643e2a62017-11-27 15:03:18 +0100677
Harald Welte9958a4d2017-12-14 21:21:33 +0100678 uint16_t ipa_conn_id,
679 uint16_t ipa_local_port,
680 uint16_t ipa_remote_port,
681 uint32_t ipa_local_ip,
682 uint32_t ipa_remote_ip,
683 uint8_t ipa_rtp_pt,
684 uint8_t ipa_rtp_pt2,
685 RSL_IE_IPA_ConnectionStats ipa_stats,
686 RSL_IE_IPA_SpeechMode ipa_speech_mode,
687
Harald Welte643e2a62017-11-27 15:03:18 +0100688 RSL_LV other
689 }
690
691 type record RSL_IE {
692 RSL_IE_Type iei,
693 RSL_IE_Body body
694 } with { variant (body) "CROSSTAG(
695 chan_nr, iei = RSL_IE_CHAN_NR;
696 link_id, iei = RSL_IE_LINK_IDENT;
697 l3_info, iei = RSL_IE_L3_INFO;
698 rlm_cause, iei = RSL_IE_RLM_CAUSE;
699 release_mode, iei = RSL_IE_RELEASE_MODE;
700 act_type, iei = RSL_IE_ACT_TYPE;
701 chan_mode, iei = RSL_IE_CHAN_MODE;
702 handover_ref, iei = RSL_IE_HANDO_REF;
703 bs_power, iei = RSL_IE_BS_POWER;
704 ms_power, iei = RSL_IE_MS_POWER;
705 timing_adv, iei = RSL_IE_TIMING_ADVANCE;
706 multirate_ctrl, iei = RSL_IE_MR_CONTROL;
707
708 frame_nr, iei = RSL_IE_FRAME_NUMBER;
709 cause, iei = RSL_IE_CAUSE;
710 access_delay, iei = RSL_IE_ACCESS_DELAY;
Harald Welted5f521e2017-12-07 17:53:06 +0100711 rach_load, iei = RSL_IE_RACH_LOAD;
Harald Welte643e2a62017-11-27 15:03:18 +0100712 meas_res_nr, iei = RSL_IE_MEAS_RES_NR;
Harald Welte2691adf2018-02-22 17:32:39 +0100713 ms_timing_offset, iei = RSL_IE_MS_TIMING_OFFSET;
714 uplink_meas, iei = RSL_IE_UPLINK_MEAS;
Harald Welte643e2a62017-11-27 15:03:18 +0100715 l1_info, iei = RSL_IE_L1_INFO;
716 sysinfo_type, iei = RSL_IE_SYSINFO_TYPE;
717 paging_load, iei = RSL_IE_PAGING_LOAD;
718 paging_group, iei = RSL_IE_PAGING_GROUP;
719 chan_needed, iei = RSL_IE_CHAN_NEEDED;
720 starting_time, iei = RSL_IE_STARTNG_TIME;
Harald Welte73cd2712017-12-17 00:44:52 +0100721 encr_info, iei = RSL_IE_ENCR_INFO;
Harald Welte643e2a62017-11-27 15:03:18 +0100722
723 req_ref, iei = RSL_IE_REQ_REFERENCE;
Harald Weltefff69302017-12-07 17:53:42 +0100724 full_imm_ass_info, iei = RSL_IE_FULL_IMM_ASS_INFO;
725 ms_identity, iei = RSL_IE_MS_IDENTITY;
726 other, iei = RSL_IE_FULL_BCCH_INFO;
Harald Welte643e2a62017-11-27 15:03:18 +0100727
Harald Welte9958a4d2017-12-14 21:21:33 +0100728 ipa_conn_id, iei = RSL_IE_IPAC_CONN_ID;
729 ipa_remote_ip, iei = RSL_IE_IPAC_REMOTE_IP;
730 ipa_remote_port, iei = RSL_IE_IPAC_REMOTE_PORT;
731 ipa_local_ip, iei = RSL_IE_IPAC_LOCAL_IP;
732 ipa_local_port, iei = RSL_IE_IPAC_LOCAL_PORT;
733 ipa_rtp_pt, iei = RSL_IE_IPAC_RTP_PAYLOAD;
734 ipa_rtp_pt2, iei = RSL_IE_IPAC_RTP_PAYLOAD2;
735 ipa_stats, iei = RSL_IE_IPAC_CONN_STAT;
736 ipa_speech_mode, iei = RSL_IE_IPAC_SPEECH_MODE;
737
Harald Welte643e2a62017-11-27 15:03:18 +0100738 other, OTHERWISE;
739 )" };
740
Harald Welte735dd072017-12-12 14:55:17 +0100741 /* For some reason the TTCN-3 RAW codec cannot automatically figure out the IEI
742 * that it needs to set for a given union-choice (body). So we have to explicitly
743 * specify the IEI by the caller :( */
Harald Welteefa7d912018-04-18 23:22:15 +0200744 template (value) RSL_IE t_RSL_IE(RSL_IE_Type iei, template (value) RSL_IE_Body body) := {
Harald Welte735dd072017-12-12 14:55:17 +0100745 iei := iei,
Harald Welte643e2a62017-11-27 15:03:18 +0100746 body := body
747 }
748
Harald Weltec2877752017-12-07 17:54:35 +0100749 template RSL_IE tr_RSL_IE(template RSL_IE_Body body) := {
750 iei := ?, /* overwritten? */
751 body := body
752 }
753
754
Harald Welte643e2a62017-11-27 15:03:18 +0100755 type record of RSL_IE RSL_IE_List;
756
757 type record RSL_Message {
758 RSL_MessageDiscriminator msg_disc,
759 RSL_MessageType msg_type,
760 RSL_IE_List ies optional
761 }
762
763 external function enc_RSL_Message(in RSL_Message msg) return octetstring
764 with { extension "prototype(convert) encode(RAW)" };
765 external function dec_RSL_Message(in octetstring stream) return RSL_Message
766 with { extension "prototype(convert) decode(RAW)" };
767
Harald Weltebc330be2017-12-09 00:56:36 +0100768 template RSL_Message tr_RSL_MsgDiscType(template RSL_MessageDiscriminator m_disc,
Harald Welte643e2a62017-11-27 15:03:18 +0100769 RSL_MessageType m_type) := {
770 msg_disc := m_disc,
771 msg_type := m_type,
772 ies := *
773 }
774
Harald Welteefa7d912018-04-18 23:22:15 +0200775 template (value) RSL_Message ts_RSL_MsgDiscType(template (value) RSL_MessageDiscriminator m_disc,
776 template (value) RSL_MessageType msg_type,
777 template (omit) RSL_IE_List ies := omit) := {
Harald Welte4a267362017-12-09 17:49:32 +0100778 msg_disc := m_disc,
779 msg_type := msg_type,
780 ies := ies
781 }
782
Harald Weltebc330be2017-12-09 00:56:36 +0100783template RSL_Message tr_RSL_MsgType(template RSL_MessageType msg_type) := {
784 msg_disc := ?,
785 msg_type := msg_type,
786 ies := *
787}
788
789/* Common Channel Management */
790template RSL_Message tr_RSL_MsgTypeC(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
791 msg_disc := { RSL_MDISC_CCHAN, ? }
792}
793
794/* RLL */
795template RSL_Message tr_RSL_MsgTypeR(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
796 msg_disc := { RSL_MDISC_RLL, true }
797}
798
799/* Dedicated Channel Management */
800template RSL_Message tr_RSL_MsgTypeD(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
801 msg_disc := { RSL_MDISC_DCHAN, ? }
802}
803
804/* Dedicated Channel Management */
805template RSL_Message tr_RSL_MsgTypeT(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
806 msg_disc := { RSL_MDISC_TRX_MGMT, ? }
807}
808
809
810/* dedicated channel or RLL */
811template RSL_Message tr_RSL_MsgTypeDR(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := {
Harald Weltee5408222018-01-29 21:57:58 +0100812 msg_disc := ({RSL_MDISC_DCHAN,?}, {RSL_MDISC_RLL,?}, {RSL_MDISC_IPACCESS,false})
Harald Weltebc330be2017-12-09 00:56:36 +0100813}
814
815
Harald Welte643e2a62017-11-27 15:03:18 +0100816 /* 8.3.1 BSC -> BTS */
Harald Welteefa7d912018-04-18 23:22:15 +0200817 template (value) RSL_Message ts_RSL_DATA_REQ(template (value) RslChannelNr chan_nr,
818 template (value) RslLinkId link_id,
819 octetstring l3_info) := {
Harald Welte643e2a62017-11-27 15:03:18 +0100820 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, true),
821 msg_type := RSL_MT_DATA_REQ,
822 ies :={
Harald Welte735dd072017-12-12 14:55:17 +0100823 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
824 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
825 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
Harald Welte643e2a62017-11-27 15:03:18 +0100826 }
827 }
828
Harald Welte7794d5b2017-12-16 23:00:20 +0100829 template RSL_Message tr_RSL_DATA_REQ(template RslChannelNr chan_nr :=?,
830 template RslLinkId link_id := ?,
831 template octetstring l3_info := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +0200832 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, true),
Harald Welte7794d5b2017-12-16 23:00:20 +0100833 msg_type := RSL_MT_DATA_REQ,
834 ies :={
835 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
836 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
837 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
838 }
839 }
840
841
Harald Welte643e2a62017-11-27 15:03:18 +0100842 /* 8.3.2 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +0200843 template (value) RSL_Message ts_RSL_DATA_IND(template (value) RslChannelNr chan_nr,
844 template (value) RslLinkId link_id,
845 octetstring l3_info) := {
Harald Welte643e2a62017-11-27 15:03:18 +0100846 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, true),
847 msg_type := RSL_MT_DATA_IND,
848 ies :={
Harald Welte735dd072017-12-12 14:55:17 +0100849 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
850 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
851 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
Harald Welte643e2a62017-11-27 15:03:18 +0100852 }
853 }
Harald Welte9abd1282018-02-19 19:18:17 +0100854 template RSL_Message tr_RSL_DATA_IND(template RslChannelNr chan_nr, template RslLinkId link_id,
855 template octetstring l3_info := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +0200856 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, true),
Harald Welte9abd1282018-02-19 19:18:17 +0100857 msg_type := RSL_MT_DATA_IND,
858 ies :={
859 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
860 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
861 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
862 }
863 }
Harald Welte643e2a62017-11-27 15:03:18 +0100864
865 /* 8.3.3 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +0200866 template (value) RSL_Message ts_RSL_ERROR_IND(template (value) RslChannelNr chan_nr,
867 template (value) RslLinkId link_id, RSL_Cause cause) := {
Harald Welte643e2a62017-11-27 15:03:18 +0100868 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
869 msg_type := RSL_MT_ERROR_IND,
870 ies :={
Harald Welte735dd072017-12-12 14:55:17 +0100871 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
872 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
873 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
Harald Welte643e2a62017-11-27 15:03:18 +0100874 }
875 }
Harald Welte9abd1282018-02-19 19:18:17 +0100876 template RSL_Message tr_RSL_ERROR_IND(template RslChannelNr chan_nr, template RslLinkId link_id,
877 template RSL_Cause cause := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +0200878 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Welte9abd1282018-02-19 19:18:17 +0100879 msg_type := RSL_MT_ERROR_IND,
880 ies :={
881 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
882 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
883 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
884 }
885 }
Harald Welte643e2a62017-11-27 15:03:18 +0100886
Harald Welteefa7d912018-04-18 23:22:15 +0200887 /* 8.3.4 BTS <- BSC */
888 template (value) RSL_Message ts_RSL_EST_REQ(template (value) RslChannelNr chan_nr,
889 template (value) RslLinkId link_id) := {
890 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
891 msg_type := RSL_MT_EST_REQ,
892 ies := {
893 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
894 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
895 }
896 }
897 template RSL_Message tr_RSL_EST_REQ(template RslChannelNr chan_nr, template RslLinkId link_id) := {
898 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
899 msg_type := RSL_MT_EST_REQ,
900 ies := {
901 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
902 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
903 }
904 }
905
906 /* 8.3.5 BTS -> BSC */
907 template (value) RSL_Message ts_RSL_EST_CONF(template (value) RslChannelNr chan_nr,
908 template (value) RslLinkId link_id) := {
909 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
910 msg_type := RSL_MT_EST_CONF,
911 ies := {
912 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
913 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
914 }
915 }
916 template RSL_Message tr_RSL_EST_CONF(template RslChannelNr chan_nr, template RslLinkId link_id) := {
917 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
918 msg_type := RSL_MT_EST_CONF,
919 ies := {
920 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
921 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
922 }
923 }
924
Harald Welte643e2a62017-11-27 15:03:18 +0100925 /* 8.3.6 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +0200926 template (value) RSL_Message ts_RSL_EST_IND(template (value) RslChannelNr chan_nr,
927 template (value) RslLinkId link_id,
928 octetstring l3_info) := {
Harald Welte643e2a62017-11-27 15:03:18 +0100929 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
930 msg_type := RSL_MT_EST_IND,
931 ies := {
Harald Welte735dd072017-12-12 14:55:17 +0100932 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
933 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
934 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
Harald Welte643e2a62017-11-27 15:03:18 +0100935 }
936 }
Harald Welte9abd1282018-02-19 19:18:17 +0100937 template RSL_Message tr_RSL_EST_IND(template RslChannelNr chan_nr, template RslLinkId link_id,
938 template octetstring l3_info := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +0200939 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Welte9abd1282018-02-19 19:18:17 +0100940 msg_type := RSL_MT_EST_IND,
941 ies := {
942 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
943 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
944 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
945 }
946 }
Harald Welte0472ab42018-03-12 15:02:26 +0100947 template RSL_Message tr_RSL_EST_IND_NOL3(template RslChannelNr chan_nr, template RslLinkId link_id) :=
948{
949 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
950 msg_type := RSL_MT_EST_IND,
951 ies := {
952 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
953 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
954 }
955 }
956
Harald Welte643e2a62017-11-27 15:03:18 +0100957
958 /* 8.3.7 BSC -> BTS */
Harald Welteefa7d912018-04-18 23:22:15 +0200959 template (value) RSL_Message ts_RSL_REL_REQ(template (value) RslChannelNr chan_nr,
Harald Welte0472ab42018-03-12 15:02:26 +0100960 template (value) RslLinkId link_id,
961 template (value) RSL_IE_ReleaseMode rel_mode := RSL_REL_MODE_NORMAL) := {
Harald Welte643e2a62017-11-27 15:03:18 +0100962 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
963 msg_type := RSL_MT_REL_REQ,
964 ies :={
Harald Welte735dd072017-12-12 14:55:17 +0100965 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
Harald Welte0472ab42018-03-12 15:02:26 +0100966 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
967 t_RSL_IE(RSL_IE_RELEASE_MODE, RSL_IE_Body:{release_mode := rel_mode})
Harald Welte643e2a62017-11-27 15:03:18 +0100968 }
969 }
Harald Weltee8a5ab12017-12-09 22:34:57 +0100970 template RSL_Message tr_RSL_REL_REQ(template RslChannelNr chan_nr,
Harald Welte0472ab42018-03-12 15:02:26 +0100971 template RslLinkId link_id,
972 template RSL_IE_ReleaseMode rel_mode := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +0200973 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Weltee8a5ab12017-12-09 22:34:57 +0100974 msg_type := RSL_MT_REL_REQ,
975 ies :={
976 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
977 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
Harald Welte0472ab42018-03-12 15:02:26 +0100978 tr_RSL_IE(RSL_IE_Body:{release_mode := rel_mode})
Harald Weltee8a5ab12017-12-09 22:34:57 +0100979 }
980 }
Harald Welte643e2a62017-11-27 15:03:18 +0100981
982 /* 8.3.8 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +0200983 template (value) RSL_Message ts_RSL_REL_CONF(template (value) RslChannelNr chan_nr,
984 template (value) RslLinkId link_id) := {
Harald Welte643e2a62017-11-27 15:03:18 +0100985 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
986 msg_type := RSL_MT_REL_CONF,
987 ies :={
Harald Welte735dd072017-12-12 14:55:17 +0100988 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
989 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
Harald Welte643e2a62017-11-27 15:03:18 +0100990 }
991 }
Harald Welte9abd1282018-02-19 19:18:17 +0100992 template RSL_Message tr_RSL_REL_CONF(template RslChannelNr chan_nr, template RslLinkId link_id) := {
Harald Welteefa7d912018-04-18 23:22:15 +0200993 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Welte9abd1282018-02-19 19:18:17 +0100994 msg_type := RSL_MT_REL_CONF,
995 ies :={
996 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
997 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
998 }
999 }
Harald Welte643e2a62017-11-27 15:03:18 +01001000
1001 /* 8.3.9 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001002 template (value) RSL_Message ts_RSL_REL_IND(template (value) RslChannelNr chan_nr,
1003 template (value) RslLinkId link_id) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001004 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_RLL, false),
1005 msg_type := RSL_MT_REL_IND,
1006 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001007 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1008 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id})
Harald Welte643e2a62017-11-27 15:03:18 +01001009 }
1010 }
Harald Welte9abd1282018-02-19 19:18:17 +01001011 template RSL_Message tr_RSL_REL_IND(template RslChannelNr chan_nr, template RslLinkId link_id) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001012 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_RLL, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001013 msg_type := RSL_MT_REL_IND,
1014 ies :={
1015 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1016 tr_RSL_IE(RSL_IE_Body:{link_id := link_id})
1017 }
1018 }
Harald Welte643e2a62017-11-27 15:03:18 +01001019
1020 /* 8.3.10 BSC -> BTS */
Harald Welteefa7d912018-04-18 23:22:15 +02001021 template (value) RSL_Message ts_RSL_UNITDATA_REQ(template (value) RslChannelNr chan_nr,
1022 template (value) RslLinkId link_id,
1023 octetstring l3_info)
Harald Welte643e2a62017-11-27 15:03:18 +01001024 modifies ts_RSL_DATA_REQ := {
1025 msg_type := RSL_MT_UNIT_DATA_REQ
1026 }
Harald Welte0472ab42018-03-12 15:02:26 +01001027 template RSL_Message tr_RSL_UNITDATA_REQ(template RslChannelNr chan_nr,
1028 template RslLinkId link_id,
1029 template octetstring l3_info)
1030 modifies tr_RSL_DATA_REQ := {
1031 msg_type := RSL_MT_UNIT_DATA_REQ
1032 }
1033
Harald Welte643e2a62017-11-27 15:03:18 +01001034
1035 /* 8.3.11 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001036 template (value) RSL_Message ts_RSL_UNITDATA_IND(template (value) RslChannelNr chan_nr,
1037 template (value) RslLinkId link_id,
1038 octetstring l3_info)
Harald Welte643e2a62017-11-27 15:03:18 +01001039 modifies ts_RSL_DATA_IND := {
1040 msg_type := RSL_MT_UNIT_DATA_IND
1041 }
Harald Welte0472ab42018-03-12 15:02:26 +01001042 template RSL_Message tr_RSL_UNITDATA_IND(template RslChannelNr chan_nr,
1043 template (value) RslLinkId link_id,
1044 template octetstring l3_info)
1045 modifies tr_RSL_DATA_IND := {
1046 msg_type := RSL_MT_UNIT_DATA_IND
1047 }
1048
1049
Harald Welte643e2a62017-11-27 15:03:18 +01001050
1051
1052 /* DEDICATED CANNEL MANAGEMENT MESSAGES */
1053
1054 /* 8.4.1 BSC -> BTS */
Harald Welteefa7d912018-04-18 23:22:15 +02001055 template (value) RSL_Message ts_RSL_CHAN_ACT(template (value) RslChannelNr chan_nr,
1056 template (value) RSL_IE_ChannelMode mode) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001057 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1058 msg_type := RSL_MT_CHAN_ACTIV,
1059 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001060 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1061 t_RSL_IE(RSL_IE_ACT_TYPE, RSL_IE_Body:{act_type := t_RSL_IE_ActType}),
1062 t_RSL_IE(RSL_IE_CHAN_MODE, RSL_IE_Body:{chan_mode := mode})
Harald Welte643e2a62017-11-27 15:03:18 +01001063 /* lots of optional IEs */
1064 }
1065 }
Harald Welte94e0c342018-04-07 11:33:23 +02001066 template RSL_Message tr_RSL_CHAN_ACT(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}),
1073 tr_RSL_IE(RSL_IE_Body:{chan_mode := mode}),
1074 /* lots of optional IEs */
1075 *
1076 }
1077 }
1078 template RSL_Message tr_RSL_CHAN_ACT_PDCH(template RslChannelNr chan_nr,
1079 template RSL_IE_ChannelMode mode) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001080 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte94e0c342018-04-07 11:33:23 +02001081 msg_type := RSL_MT_CHAN_ACTIV,
1082 ies :={
1083 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1084 tr_RSL_IE(RSL_IE_Body:{act_type := t_RSL_IE_ActType_PDCH}),
1085 /* lots of optional IEs */
1086 *
1087 }
1088 }
1089
Harald Welte643e2a62017-11-27 15:03:18 +01001090
1091 /* 8.4.2 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001092 template (value) RSL_Message ts_RSL_CHAN_ACT_ACK(template (value) RslChannelNr chan_nr,
1093 GsmFrameNumber fn) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001094 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1095 msg_type := RSL_MT_CHAN_ACTIV_ACK,
1096 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001097 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1098 t_RSL_IE(RSL_IE_FRAME_NUMBER, RSL_IE_Body:{frame_nr := ts_RSL_IE_FrameNumber(fn)})
Harald Welte643e2a62017-11-27 15:03:18 +01001099 }
1100 }
Harald Welte9abd1282018-02-19 19:18:17 +01001101 template RSL_Message tr_RSL_CHAN_ACT_ACK(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001102 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001103 msg_type := RSL_MT_CHAN_ACTIV_ACK,
1104 ies := {
1105 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1106 tr_RSL_IE(RSL_IE_Body:{frame_nr := ?})
1107 }
1108 }
Harald Welte643e2a62017-11-27 15:03:18 +01001109
1110 /* 8.4.3 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001111 template (value) RSL_Message ts_RSL_CHAN_ACT_NACK(template (value) RslChannelNr chan_nr,
1112 RSL_Cause cause) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001113 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1114 msg_type := RSL_MT_CHAN_ACTIV_NACK,
1115 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001116 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1117 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
Harald Welte643e2a62017-11-27 15:03:18 +01001118 }
1119 }
Harald Welte9abd1282018-02-19 19:18:17 +01001120 template RSL_Message tr_RSL_CHAN_ACT_NACK(template RslChannelNr chan_nr,
1121 template RSL_Cause cause := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001122 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001123 msg_type := RSL_MT_CHAN_ACTIV_NACK,
1124 ies := {
1125 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1126 tr_RSL_IE(RSL_IE_Body:{cause := ?})
1127 }
1128 }
Harald Welte643e2a62017-11-27 15:03:18 +01001129
1130 /* 8.4.4 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001131 template (value) RSL_Message ts_RSL_CONN_FAIL_IND(RslChannelNr chan_nr, RSL_Cause cause) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001132 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1133 msg_type := RSL_MT_CONN_FAIL,
1134 ies :={
Harald Welte735dd072017-12-12 14:55:17 +01001135 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1136 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
Harald Welte643e2a62017-11-27 15:03:18 +01001137 }
1138 }
Harald Welte9abd1282018-02-19 19:18:17 +01001139 template RSL_Message tr_RSL_CONN_FAIL_IND(template RslChannelNr chan_nr,
1140 template RSL_Cause cause := ?) := {
1141 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1142 msg_type := RSL_MT_CONN_FAIL,
1143 ies :={
1144 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1145 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
1146 }
1147 }
Harald Welte643e2a62017-11-27 15:03:18 +01001148
Harald Weltee8a5ab12017-12-09 22:34:57 +01001149 /* 8.4.5 BSC -> BTS */
1150 template RSL_Message tr_RSL_DEACT_SACCH(template RslChannelNr chan_nr) := {
1151 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1152 msg_type := RSL_MT_DEACTIVATE_SACCH,
1153 ies := {
1154 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
1155 }
1156 }
Harald Welteefa7d912018-04-18 23:22:15 +02001157 template (value) RSL_Message ts_RSL_DEACT_SACCH(template (value) RslChannelNr chan_nr) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001158 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1159 msg_type := RSL_MT_DEACTIVATE_SACCH,
1160 ies := {
1161 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1162 }
1163 }
1164
Harald Weltee8a5ab12017-12-09 22:34:57 +01001165
Harald Welte73cd2712017-12-17 00:44:52 +01001166 /* 8.4.6 BSC ->BTS */
1167 template RSL_Message tr_RSL_ENCR_CMD(template RslChannelNr chan_nr,
1168 template RslLinkId link_id := ?,
Harald Weltee613f962018-04-18 22:38:16 +02001169 template RSL_AlgId alg := ?,
Harald Welte73cd2712017-12-17 00:44:52 +01001170 template octetstring key := ?,
1171 template octetstring l3_info := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001172 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte73cd2712017-12-17 00:44:52 +01001173 msg_type := RSL_MT_ENCR_CMD,
1174 ies := {
1175 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1176 tr_RSL_IE(RSL_IE_Body:{encr_info := tr_RSL_IE_EncrInfo(alg, key)}),
1177 tr_RSL_IE(RSL_IE_Body:{link_id := link_id}),
1178 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)})
1179 }
1180 }
Harald Welteefa7d912018-04-18 23:22:15 +02001181 template (value) RSL_Message ts_RSL_ENCR_CMD(template (value) RslChannelNr chan_nr,
1182 template (value) RslLinkId link_id,
Harald Weltee613f962018-04-18 22:38:16 +02001183 template (value) RSL_AlgId alg, octetstring key,
Harald Welteefa7d912018-04-18 23:22:15 +02001184 octetstring l3_info) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001185 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1186 msg_type := RSL_MT_ENCR_CMD,
1187 ies := {
1188 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
Harald Welteefa7d912018-04-18 23:22:15 +02001189 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 +01001190 t_RSL_IE(RSL_IE_LINK_IDENT, RSL_IE_Body:{link_id := link_id}),
Harald Welteefa7d912018-04-18 23:22:15 +02001191 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
Harald Welte9abd1282018-02-19 19:18:17 +01001192 }
1193 }
Harald Welte73cd2712017-12-17 00:44:52 +01001194
Harald Welte2691adf2018-02-22 17:32:39 +01001195 template RSL_Message tr_RSL_MEAS_RES(template RslChannelNr chan_nr,
1196 template uint8_t meas_res_nr := ?,
1197 template RSL_IE_UplinkMeas ul_meas := ?,
1198 template RSL_IE_BS_Power bs_power := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001199 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte2691adf2018-02-22 17:32:39 +01001200 msg_type := RSL_MT_MEAS_RES,
1201 ies := {
1202 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1203 tr_RSL_IE(RSL_IE_Body:{meas_res_nr := meas_res_nr}),
1204 tr_RSL_IE(RSL_IE_Body:{uplink_meas := ul_meas}),
1205 tr_RSL_IE(RSL_IE_Body:{bs_power := bs_power}),
1206 *
1207 }
1208 }
1209
Harald Welte39b47be2018-02-23 18:58:48 +01001210 /* Osmocom specific template, require lots of optional fields to be present */
1211 template RSL_Message tr_RSL_MEAS_RES_OSMO(template RslChannelNr chan_nr,
1212 template uint8_t meas_res_nr := ?,
1213 template RSL_IE_UplinkMeas ul_meas := ?,
1214 template RSL_IE_BS_Power bs_power := ?,
1215 template RSL_IE_L1Info l1_info := ?,
1216 template octetstring l3_info := ?,
1217 template uint8_t ms_to := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001218 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte39b47be2018-02-23 18:58:48 +01001219 msg_type := RSL_MT_MEAS_RES,
1220 ies := {
1221 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1222 tr_RSL_IE(RSL_IE_Body:{meas_res_nr := meas_res_nr}),
1223 tr_RSL_IE(RSL_IE_Body:{uplink_meas := ul_meas}),
1224 tr_RSL_IE(RSL_IE_Body:{bs_power := bs_power}),
1225 tr_RSL_IE(RSL_IE_Body:{l1_info := l1_info}),
1226 tr_RSL_IE(RSL_IE_Body:{l3_info := tr_RSL_L16V(l3_info)}),
1227 tr_RSL_IE(RSL_IE_Body:{ms_timing_offset := ms_to})
1228 }
1229 }
1230
1231
Harald Welte7794d5b2017-12-16 23:00:20 +01001232 /* 8.4.10 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001233 template (value) RSL_Message ts_RSL_MODE_MODIFY_ACK(template (value) RslChannelNr chan_nr) := {
Harald Welte7794d5b2017-12-16 23:00:20 +01001234 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1235 msg_type := RSL_MT_MODE_MODIFY_ACK,
1236 ies := {
1237 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1238 }
1239 }
Harald Welte9abd1282018-02-19 19:18:17 +01001240 template RSL_Message tr_RSL_MODE_MODIFY_ACK(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001241 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001242 msg_type := RSL_MT_MODE_MODIFY_ACK,
1243 ies := {
1244 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
1245 }
1246 }
Harald Welte7794d5b2017-12-16 23:00:20 +01001247
Harald Welte643e2a62017-11-27 15:03:18 +01001248 /* 8.4.11 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001249 template (value) RSL_Message ts_RSL_MODE_MODIFY_NACK(template (value) RslChannelNr chan_nr,
1250 RSL_Cause cause) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001251 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1252 msg_type := RSL_MT_MODE_MODIFY_NACK,
1253 ies := {
1254 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1255 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
1256 }
Harald Welte643e2a62017-11-27 15:03:18 +01001257 }
Harald Welte9abd1282018-02-19 19:18:17 +01001258 template RSL_Message tr_RSL_MODE_MODIFY_NACK(template RslChannelNr chan_nr,
1259 template RSL_Cause cause) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001260 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001261 msg_type := RSL_MT_MODE_MODIFY_NACK,
1262 ies := {
1263 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1264 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
1265 }
1266 }
1267
Harald Welte643e2a62017-11-27 15:03:18 +01001268
Harald Welte6a8199d2018-01-29 21:58:53 +01001269 /* 8.4.14: BTS <- BSC */
1270 template RSL_Message tr_RSL_RF_CHAN_REL(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001271 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte6a8199d2018-01-29 21:58:53 +01001272 msg_type := RSL_MT_RF_CHAN_REL,
1273 ies := {
1274 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
1275 }
1276 }
Harald Welteefa7d912018-04-18 23:22:15 +02001277 template (value) RSL_Message ts_RSL_RF_CHAN_REL(template (value) RslChannelNr chan_nr) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001278 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1279 msg_type := RSL_MT_RF_CHAN_REL,
1280 ies := {
1281 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1282 }
1283 }
Harald Welte6a8199d2018-01-29 21:58:53 +01001284
Harald Welte4a267362017-12-09 17:49:32 +01001285 /* 8.4.19 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001286 template (value) RSL_Message ts_RSL_RF_CHAN_REL_ACK(template (value) RslChannelNr chan_nr) :=
Harald Welte4a267362017-12-09 17:49:32 +01001287 ts_RSL_MsgDiscType(ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1288 RSL_MT_RF_CHAN_REL_ACK,
Harald Welte735dd072017-12-12 14:55:17 +01001289 { t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}) });
Harald Welte4a267362017-12-09 17:49:32 +01001290
Harald Welte9abd1282018-02-19 19:18:17 +01001291 template RSL_Message tr_RSL_RF_CHAN_REL_ACK(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001292 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001293 msg_type := RSL_MT_RF_CHAN_REL_ACK,
1294 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001295 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
Harald Welte9abd1282018-02-19 19:18:17 +01001296 }
1297 }
1298
Harald Welteea17b912018-03-11 22:29:31 +01001299 /* 8.6.20 BTS <- BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001300 template (value) RSL_Message ts_RSL_SACCH_INF_MOD(template (value) RslChannelNr chan_nr,
1301 RSL_IE_SysinfoType si_type,
1302 octetstring l3_info) := {
Harald Welteea17b912018-03-11 22:29:31 +01001303 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1304 msg_type := RSL_MT_SACCH_INFO_MODIFY,
1305 ies := {
1306 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1307 t_RSL_IE(RSL_IE_SYSINFO_TYPE, RSL_IE_Body:{sysinfo_type := si_type}),
1308 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
1309 }
1310 }
1311
1312
Harald Welte643e2a62017-11-27 15:03:18 +01001313 /* COMMON CHANNEL MANAGEMENT MESSAGES */
1314
Harald Welte874c2232018-02-24 04:52:43 +01001315 /* 8.5.1 BTS <- BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001316 template (value) RSL_Message ts_RSL_BCCH_INFO(RSL_IE_SysinfoType si_type,
1317 octetstring full_bcch_info) := {
Harald Welte874c2232018-02-24 04:52:43 +01001318 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1319 msg_type := RSL_MT_BCCH_INFO,
1320 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001321 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_BCCH(0)}),
Harald Welte874c2232018-02-24 04:52:43 +01001322 t_RSL_IE(RSL_IE_SYSINFO_TYPE, RSL_IE_Body:{sysinfo_type := si_type}),
1323 t_RSL_IE(RSL_IE_FULL_BCCH_INFO, RSL_IE_Body:{other := ts_RSL_LV(full_bcch_info)})
1324 }
1325 }
1326
Harald Welte7ae93142017-12-07 17:56:15 +01001327 /* 8.5.2 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001328 template (value) RSL_Message ts_RSL_RACH_LOAD_IND(uint16_t slot_ct, uint16_t busy_ct,
1329 uint16_t acc_ct) := {
Harald Welte7ae93142017-12-07 17:56:15 +01001330 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1331 msg_type := RSL_MT_CCCH_LOAD_IND,
1332 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001333 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_RACH(0)}),
Harald Welte735dd072017-12-12 14:55:17 +01001334 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 +01001335 }
1336 }
Harald Welte68e495b2018-02-25 00:05:57 +01001337 template RSL_Message tr_RSL_RACH_LOAD_IND(template uint16_t slot_ct := ?,
1338 template uint16_t busy_ct := ?,
1339 template uint16_t acc_ct) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001340 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Welte68e495b2018-02-25 00:05:57 +01001341 msg_type := RSL_MT_CCCH_LOAD_IND,
1342 ies := {
1343 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_RACH(0)}),
1344 tr_RSL_IE(RSL_IE_Body:{rach_load := tr_RSL_IE_RachLoad(slot_ct, busy_ct, acc_ct)})
1345 }
1346 }
1347
Harald Welteefa7d912018-04-18 23:22:15 +02001348 template (value) RSL_Message ts_RSL_PAGING_LOAD_IND(uint16_t buffer_space) := {
Harald Welte7ae93142017-12-07 17:56:15 +01001349 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1350 msg_type := RSL_MT_CCCH_LOAD_IND,
1351 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001352 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_PCH_AGCH(0)}),
Harald Welte735dd072017-12-12 14:55:17 +01001353 t_RSL_IE(RSL_IE_PAGING_LOAD, RSL_IE_Body:{paging_load := buffer_space})
Harald Welte7ae93142017-12-07 17:56:15 +01001354 }
1355 }
Harald Welte68e495b2018-02-25 00:05:57 +01001356 template RSL_Message tr_RSL_PAGING_LOAD_IND(template uint16_t buffer_space := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001357 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Welte68e495b2018-02-25 00:05:57 +01001358 msg_type := RSL_MT_CCCH_LOAD_IND,
1359 ies := {
1360 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(0)}),
1361 tr_RSL_IE(RSL_IE_Body:{paging_load := buffer_space})
1362 }
1363 }
1364
Harald Welte7ae93142017-12-07 17:56:15 +01001365
Harald Welte643e2a62017-11-27 15:03:18 +01001366 /* 8.5.3 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001367 template (value) RSL_Message ts_RSL_CHAN_RQD(OCT1 ra, GsmFrameNumber fn, uint8_t acc_del := 0) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001368 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1369 msg_type := RSL_MT_CHAN_RQD,
1370 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001371 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_RACH(0)}),
Harald Welte735dd072017-12-12 14:55:17 +01001372 t_RSL_IE(RSL_IE_REQ_REFERENCE, RSL_IE_Body:{req_ref := ts_RSL_IE_ReqRef(ra, fn)}),
1373 t_RSL_IE(RSL_IE_ACCESS_DELAY, RSL_IE_Body:{access_delay := acc_del})
Harald Welte643e2a62017-11-27 15:03:18 +01001374 }
1375 }
Harald Welte9abd1282018-02-19 19:18:17 +01001376 template RSL_Message tr_RSL_CHAN_RQD(template OCT1 ra, template GsmFrameNumber fn := ?,
1377 template uint8_t acc_del := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001378 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001379 msg_type := RSL_MT_CHAN_RQD,
1380 ies := {
1381 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_RACH(0)}),
1382 tr_RSL_IE(RSL_IE_Body:{req_ref := tr_RSL_IE_ReqRef(ra, fn)}),
1383 tr_RSL_IE(RSL_IE_Body:{access_delay := acc_del})
1384 }
1385 }
Harald Welte643e2a62017-11-27 15:03:18 +01001386
1387 /* 8.5.4 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001388 template (value) RSL_Message ts_DELETE_IND(template (value) RslChannelNr chan_nr,
1389 octetstring imm_ass) := {
Harald Welte643e2a62017-11-27 15:03:18 +01001390 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1391 msg_type := RSL_MT_DELETE_IND,
1392 ies := {
Harald Welte735dd072017-12-12 14:55:17 +01001393 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1394 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 +01001395 }
1396 }
Harald Weltee8d750e2018-06-10 21:41:35 +02001397 template RSL_Message tr_RSL_DELETE_IND(template octetstring imm_ass := ?, template uint3_t tn) := {
1398 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1399 msg_type := RSL_MT_DELETE_IND,
1400 ies := {
1401 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(tn)}),
1402 tr_RSL_IE(RSL_IE_Body:{full_imm_ass_info := tr_RSL_LV(imm_ass)}),
1403 *
1404 }
1405 }
Harald Welte643e2a62017-11-27 15:03:18 +01001406
Harald Weltec2877752017-12-07 17:54:35 +01001407 /* 8.5.5 BSC -> BTS */
1408 template RSL_Message tr_RSL_PAGING_CMD(template octetstring identity, 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_PAGING_CMD,
1411 ies := {
1412 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(tn)}),
1413 tr_RSL_IE(RSL_IE_Body:{paging_group := ?}),
Harald Welte51d74102017-12-10 23:05:02 +01001414 tr_RSL_IE(RSL_IE_Body:{ms_identity := tr_RSL_LV(identity)}),
Harald Weltec2877752017-12-07 17:54:35 +01001415 * /* opt: channel needed, eMLPP prio */
1416 }
1417 }
Harald Welteefa7d912018-04-18 23:22:15 +02001418 template (value) RSL_Message ts_RSL_PAGING_CMD(octetstring identity, uint8_t pg, uint3_t tn := 0) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001419 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1420 msg_type := RSL_MT_PAGING_CMD,
1421 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001422 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_PCH_AGCH(tn)}),
Harald Welte9abd1282018-02-19 19:18:17 +01001423 t_RSL_IE(RSL_IE_PAGING_GROUP, RSL_IE_Body:{paging_group := pg}),
1424 t_RSL_IE(RSL_IE_MS_IDENTITY, RSL_IE_Body:{ms_identity := ts_RSL_LV(identity)})
1425 }
1426 }
Harald Weltec2877752017-12-07 17:54:35 +01001427
1428 /* 8.5.6 BSC -> BTS */
1429 template RSL_Message tr_RSL_IMM_ASSIGN(template uint3_t tn := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001430 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
Harald Weltec2877752017-12-07 17:54:35 +01001431 msg_type := RSL_MT_IMMEDIATE_ASSIGN_CMD,
1432 ies := {
1433 tr_RSL_IE(RSL_IE_Body:{chan_nr := t_RslChanNr_PCH_AGCH(tn)}),
1434 tr_RSL_IE(RSL_IE_Body:{full_imm_ass_info := ?})
1435 }
1436 }
Harald Welteefa7d912018-04-18 23:22:15 +02001437 template (value) RSL_Message ts_RSL_IMM_ASSIGN(octetstring f_ass_inf, uint3_t tn := 0) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001438 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_CCHAN, false),
1439 msg_type := RSL_MT_IMMEDIATE_ASSIGN_CMD,
1440 ies := {
Harald Welteefa7d912018-04-18 23:22:15 +02001441 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := ts_RslChanNr_PCH_AGCH(tn)}),
Harald Welte9abd1282018-02-19 19:18:17 +01001442 t_RSL_IE(RSL_IE_FULL_IMM_ASS_INFO, RSL_IE_Body:{full_imm_ass_info := ts_RSL_LV(f_ass_inf)})
1443 }
1444 }
Harald Weltec2877752017-12-07 17:54:35 +01001445
Harald Welte68e495b2018-02-25 00:05:57 +01001446 template RSL_Message tr_RSL_RF_RES_IND := {
Harald Welteefa7d912018-04-18 23:22:15 +02001447 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
Harald Welte68e495b2018-02-25 00:05:57 +01001448 msg_type := RSL_MT_RF_RES_IND,
1449 ies := *
1450 }
1451
1452 /* 8.6.2 BTS <- BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001453 template (value) RSL_Message ts_RSL_SACCH_FILL(RSL_IE_SysinfoType si_type, octetstring l3_info) := {
Harald Welte68e495b2018-02-25 00:05:57 +01001454 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
1455 msg_type := RSL_MT_SACCH_FILL,
1456 ies := {
1457 t_RSL_IE(RSL_IE_SYSINFO_TYPE, RSL_IE_Body:{sysinfo_type := si_type}),
1458 t_RSL_IE(RSL_IE_L3_INFO, RSL_IE_Body:{l3_info := ts_RSL_L16V(l3_info)})
1459 }
1460 }
1461
Harald Welte643e2a62017-11-27 15:03:18 +01001462 /* 8.6.4 BTS -> BSC */
Harald Welteefa7d912018-04-18 23:22:15 +02001463 template (value) RSL_Message ts_RSL_ERROR_REPORT(RSL_Cause cause) := {
Harald Welte01d982c2018-02-25 01:31:40 +01001464 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
1465 msg_type := RSL_MT_ERROR_REPORT,
Harald Welte643e2a62017-11-27 15:03:18 +01001466 ies := {
Harald Welte735dd072017-12-12 14:55:17 +01001467 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
Harald Welte643e2a62017-11-27 15:03:18 +01001468 }
1469 }
Harald Welte01d982c2018-02-25 01:31:40 +01001470 template RSL_Message tr_RSL_ERROR_REPORT(template RSL_Cause cause := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001471 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_TRX_MGMT, false),
Harald Welte01d982c2018-02-25 01:31:40 +01001472 msg_type := RSL_MT_ERROR_REPORT,
1473 ies := {
1474 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)}),
1475 *
1476 }
1477 }
1478
Harald Welte643e2a62017-11-27 15:03:18 +01001479
Harald Welte9958a4d2017-12-14 21:21:33 +01001480
1481 /* Abis/IP specific messages */
1482
1483 template RSL_Message tr_RSL_IPA_CRCX(template RslChannelNr chan_nr) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001484 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01001485 msg_type := RSL_MT_IPAC_CRCX,
1486 ies := {
1487 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1488 *
1489 }
1490 }
Harald Welteefa7d912018-04-18 23:22:15 +02001491 template (value) RSL_Message ts_RSL_IPA_CRCX(template (value) RslChannelNr chan_nr) := {
Harald Welte9abd1282018-02-19 19:18:17 +01001492 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
1493 msg_type := RSL_MT_IPAC_CRCX,
1494 ies := {
1495 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1496 }
1497 }
1498
Harald Welte9958a4d2017-12-14 21:21:33 +01001499
Harald Welteefa7d912018-04-18 23:22:15 +02001500 template (value) RSL_Message ts_RSL_IPA_CRCX_ACK(template (value) RslChannelNr chan_nr,
1501 uint16_t ipa_conn_id, uint32_t local_ip,
1502 uint16_t local_port, uint7_t rtp_pt2) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01001503 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
1504 msg_type := RSL_MT_IPAC_CRCX_ACK,
1505 ies := {
1506 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1507 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
1508 t_RSL_IE(RSL_IE_IPAC_LOCAL_IP, RSL_IE_Body:{ipa_local_ip := local_ip}),
1509 t_RSL_IE(RSL_IE_IPAC_LOCAL_PORT, RSL_IE_Body:{ipa_local_port := local_port}),
1510 t_RSL_IE(RSL_IE_IPAC_RTP_PAYLOAD2, RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
1511 }
1512 }
Harald Welte9abd1282018-02-19 19:18:17 +01001513 template RSL_Message tr_RSL_IPA_CRCX_ACK(template RslChannelNr chan_nr,
1514 template uint16_t ipa_conn_id,
1515 template uint32_t local_ip,
Harald Welte8bd0f822018-02-25 12:43:28 +01001516 template uint16_t local_port) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001517 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001518 msg_type := RSL_MT_IPAC_CRCX_ACK,
1519 ies := {
1520 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1521 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
1522 tr_RSL_IE(RSL_IE_Body:{ipa_local_ip := local_ip}),
Harald Welte8bd0f822018-02-25 12:43:28 +01001523 tr_RSL_IE(RSL_IE_Body:{ipa_local_port := local_port})
1524 /* Optional: RTP Payload Type 2 IE */
Harald Welte9abd1282018-02-19 19:18:17 +01001525 }
1526 }
Harald Welte9958a4d2017-12-14 21:21:33 +01001527
Harald Welteefa7d912018-04-18 23:22:15 +02001528 template (value) RSL_Message ts_RSL_IPA_CRCX_NACK(template (value) RslChannelNr chan_nr,
1529 RSL_Cause cause) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01001530 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
1531 msg_type := RSL_MT_IPAC_CRCX_NACK,
1532 ies := {
1533 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1534 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
1535 }
1536 }
Harald Welte9abd1282018-02-19 19:18:17 +01001537 template RSL_Message tr_RSL_IPA_CRCX_NACK(template RslChannelNr chan_nr,
1538 template RSL_Cause cause := ?) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001539 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9abd1282018-02-19 19:18:17 +01001540 msg_type := RSL_MT_IPAC_CRCX_NACK,
1541 ies := {
1542 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1543 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
1544 }
1545 }
Harald Welte9958a4d2017-12-14 21:21:33 +01001546
Harald Welteefa7d912018-04-18 23:22:15 +02001547 template (value) RSL_Message ts_RSL_IPA_MDCX(template (value) RslChannelNr chan_nr,
1548 uint16_t ipa_conn_id,
1549 uint32_t remote_ip, uint16_t remote_port,
1550 uint7_t rtp_pt2) := {
Harald Welte30527452018-02-25 12:46:25 +01001551 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
1552 msg_type := RSL_MT_IPAC_MDCX,
1553 ies := {
1554 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1555 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
1556 t_RSL_IE(RSL_IE_IPAC_REMOTE_IP, RSL_IE_Body:{ipa_remote_ip := remote_ip}),
1557 t_RSL_IE(RSL_IE_IPAC_REMOTE_PORT, RSL_IE_Body:{ipa_remote_port := remote_port}),
1558 /* optional: RTP Payload Type */
1559 t_RSL_IE(RSL_IE_IPAC_RTP_PAYLOAD2, RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
1560 }
1561 }
Harald Welte9958a4d2017-12-14 21:21:33 +01001562 template RSL_Message tr_RSL_IPA_MDCX(template RslChannelNr chan_nr,
1563 template uint16_t ipa_conn_id) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001564 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01001565 msg_type := RSL_MT_IPAC_MDCX,
1566 ies := {
1567 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1568 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
1569 *
1570 }
1571 }
1572
Harald Welteefa7d912018-04-18 23:22:15 +02001573 template (value) RSL_Message ts_RSL_IPA_MDCX_ACK(template (value) RslChannelNr chan_nr,
1574 uint16_t ipa_conn_id,
1575 uint32_t local_ip, uint16_t local_port,
1576 uint7_t rtp_pt2) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01001577 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte71b5ec82017-12-16 23:01:10 +01001578 msg_type := RSL_MT_IPAC_MDCX_ACK,
Harald Welte9958a4d2017-12-14 21:21:33 +01001579 ies := {
1580 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1581 /* optional */
1582 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
Harald Welte6cb400a2018-02-25 12:45:25 +01001583 t_RSL_IE(RSL_IE_IPAC_LOCAL_IP, RSL_IE_Body:{ipa_local_ip := local_ip}),
1584 t_RSL_IE(RSL_IE_IPAC_LOCAL_PORT, RSL_IE_Body:{ipa_local_port := local_port}),
Harald Welte9958a4d2017-12-14 21:21:33 +01001585 /* optional: RTP Payload Type */
1586 t_RSL_IE(RSL_IE_IPAC_RTP_PAYLOAD2, RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
1587 }
1588 }
Harald Welte30527452018-02-25 12:46:25 +01001589 template RSL_Message tr_RSL_IPA_MDCX_ACK(template RslChannelNr chan_nr,
1590 template uint16_t ipa_conn_id,
1591 template uint32_t local_ip,
1592 template uint16_t local_port,
1593 template uint7_t rtp_pt2) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001594 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte30527452018-02-25 12:46:25 +01001595 msg_type := RSL_MT_IPAC_MDCX_ACK,
1596 ies := {
1597 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1598 /* optional */
1599 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
1600 tr_RSL_IE(RSL_IE_Body:{ipa_local_ip := local_ip}),
1601 tr_RSL_IE(RSL_IE_Body:{ipa_local_port := local_port}),
1602 /* optional: RTP Payload Type */
1603 tr_RSL_IE(RSL_IE_Body:{ipa_rtp_pt2 := rtp_pt2})
1604 }
1605 }
Harald Welte9958a4d2017-12-14 21:21:33 +01001606
Harald Welteefa7d912018-04-18 23:22:15 +02001607 template (value) RSL_Message ts_RSL_IPA_MDCX_NACK(template (value) RslChannelNr chan_nr,
1608 RSL_Cause cause,
1609 template (value) uint16_t ipa_conn_id) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01001610 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
1611 msg_type := RSL_MT_IPAC_MDCX_NACK,
1612 ies := {
1613 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1614 /* optional connection ID */
1615 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
1616 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
1617 }
1618 }
Harald Welte30527452018-02-25 12:46:25 +01001619 template RSL_Message tr_RSL_IPA_MDCX_NACK(template RslChannelNr chan_nr,
1620 template RSL_Cause cause,
1621 template uint16_t ipa_conn_id) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001622 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte30527452018-02-25 12:46:25 +01001623 msg_type := RSL_MT_IPAC_MDCX_NACK,
1624 ies := {
1625 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1626 /* optional connection ID */
1627 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
1628 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
1629 }
1630 }
1631
Harald Welte9958a4d2017-12-14 21:21:33 +01001632
Harald Welteefa7d912018-04-18 23:22:15 +02001633 template (value) RSL_Message ts_RSL_IPA_DLCX_IND(template (value) RslChannelNr chan_nr,
1634 uint16_t ipa_conn_id,
1635 template (value) RSL_IE_IPA_ConnectionStats stats,
1636 RSL_Cause cause) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01001637 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
1638 msg_type := RSL_MT_IPAC_DLCX_IND,
1639 ies := {
1640 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1641 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
1642 t_RSL_IE(RSL_IE_IPAC_CONN_STAT, RSL_IE_Body:{ipa_stats := stats}),
1643 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
1644 }
1645 }
1646
Harald Welteefa7d912018-04-18 23:22:15 +02001647 template (value) RSL_Message ts_RSL_IPA_DLCX(template (value) RslChannelNr chan_nr,
1648 uint16_t ipa_conn_id) := {
Harald Weltea871a382018-02-25 02:03:14 +01001649 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
1650 msg_type := RSL_MT_IPAC_DLCX,
1651 ies := {
Harald Welte2a7e7162018-02-25 12:46:48 +01001652 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})
Harald Weltea871a382018-02-25 02:03:14 +01001654 }
1655 }
Harald Welte9958a4d2017-12-14 21:21:33 +01001656 template RSL_Message tr_RSL_IPA_DLCX(template RslChannelNr chan_nr,
1657 template uint16_t ipa_conn_id := omit) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001658 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01001659 msg_type := RSL_MT_IPAC_DLCX,
1660 ies := {
1661 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1662 /* FIXME: optional conn_id */
1663 *
1664 }
1665 }
1666
Harald Welteefa7d912018-04-18 23:22:15 +02001667 template (value) RSL_Message ts_RSL_IPA_DLCX_ACK(template (value) RslChannelNr chan_nr,
1668 uint16_t ipa_conn_id,
1669 RSL_IE_IPA_ConnectionStats stats) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01001670 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
1671 msg_type := RSL_MT_IPAC_DLCX_ACK,
1672 ies := {
1673 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1674 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
1675 t_RSL_IE(RSL_IE_IPAC_CONN_STAT, RSL_IE_Body:{ipa_stats := stats})
1676 }
1677 }
Harald Weltea871a382018-02-25 02:03:14 +01001678 template RSL_Message tr_RSL_IPA_DLCX_ACK(template RslChannelNr chan_nr,
1679 template uint16_t ipa_conn_id,
1680 template RSL_IE_IPA_ConnectionStats stats) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001681 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Weltea871a382018-02-25 02:03:14 +01001682 msg_type := RSL_MT_IPAC_DLCX_ACK,
1683 ies := {
1684 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1685 tr_RSL_IE(RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
1686 tr_RSL_IE(RSL_IE_Body:{ipa_stats := stats})
1687 }
1688 }
1689
1690
Harald Welte9958a4d2017-12-14 21:21:33 +01001691
Harald Welteefa7d912018-04-18 23:22:15 +02001692 template (value) RSL_Message ts_RSL_IPA_DLCX_NACK(template (value) RslChannelNr chan_nr,
1693 RSL_Cause cause, uint16_t ipa_conn_id) := {
Harald Welte9958a4d2017-12-14 21:21:33 +01001694 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
1695 msg_type := RSL_MT_IPAC_DLCX_NACK,
1696 ies := {
1697 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1698 /* optional connection ID */
1699 t_RSL_IE(RSL_IE_IPAC_CONN_ID, RSL_IE_Body:{ipa_conn_id := ipa_conn_id}),
1700 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
1701 }
1702 }
Harald Weltea871a382018-02-25 02:03:14 +01001703 template RSL_Message tr_RSL_IPA_DLCX_NACK(template RslChannelNr chan_nr,
1704 template RSL_Cause cause) := {
Harald Welteefa7d912018-04-18 23:22:15 +02001705 msg_disc := tr_RSL_MsgDisc(RSL_MDISC_IPACCESS, false),
Harald Weltea871a382018-02-25 02:03:14 +01001706 msg_type := RSL_MT_IPAC_DLCX_NACK,
1707 ies := {
1708 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1709 /* optional connection ID */
1710 *,
1711 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
1712 }
1713 }
1714
Harald Welte9958a4d2017-12-14 21:21:33 +01001715
Harald Welteefa7d912018-04-18 23:22:15 +02001716 template (value) RSL_Message ts_RSL_IPA_PDCH_ACT(RslChannelNr chan_nr) := {
Harald Welteee19c732018-04-05 09:08:26 +02001717 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1718 msg_type := RSL_MT_IPAC_PDCH_ACT,
1719 ies := {
1720 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1721 }
1722 }
Harald Welte9958a4d2017-12-14 21:21:33 +01001723 template RSL_Message tr_RSL_IPA_PDCH_ACT(template RslChannelNr chan_nr) := {
Harald Welteee19c732018-04-05 09:08:26 +02001724 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01001725 msg_type := RSL_MT_IPAC_PDCH_ACT,
1726 ies := {
1727 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
1728 }
1729 }
1730
Harald Welteee19c732018-04-05 09:08:26 +02001731
Harald Welte94e0c342018-04-07 11:33:23 +02001732 template RSL_Message ts_RSL_IPA_PDCH_ACT_ACK(RslChannelNr chan_nr,
1733 template (value) RSL_IE_FrameNumber fn) := {
Harald Welteee19c732018-04-05 09:08:26 +02001734 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01001735 msg_type := RSL_MT_IPAC_PDCH_ACT_ACK,
1736 ies := {
1737 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1738 t_RSL_IE(RSL_IE_FRAME_NUMBER, RSL_IE_Body:{frame_nr := fn})
1739 }
1740 }
Harald Welteee19c732018-04-05 09:08:26 +02001741 template RSL_Message tr_RSL_IPA_PDCH_ACT_ACK(template RslChannelNr chan_nr,
1742 template RSL_IE_FrameNumber fn) := {
1743 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1744 msg_type := RSL_MT_IPAC_PDCH_ACT_ACK,
1745 ies := {
1746 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1747 tr_RSL_IE(RSL_IE_Body:{frame_nr := fn})
1748 }
1749 }
Harald Welte9958a4d2017-12-14 21:21:33 +01001750
1751 template RSL_Message ts_RSL_IPA_PDCH_ACT_NACK(RslChannelNr chan_nr, RSL_Cause cause) := {
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_NACK,
1754 ies := {
1755 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1756 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
1757 }
1758 }
Harald Welteee19c732018-04-05 09:08:26 +02001759 template RSL_Message tr_RSL_IPA_PDCH_ACT_NACK(template RslChannelNr chan_nr,
1760 template RSL_Cause cause) := {
1761 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1762 msg_type := RSL_MT_IPAC_PDCH_ACT_NACK,
1763 ies := {
1764 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1765 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
1766 }
1767 }
Harald Welte9958a4d2017-12-14 21:21:33 +01001768
Harald Welteee19c732018-04-05 09:08:26 +02001769 template RSL_Message ts_RSL_IPA_PDCH_DEACT(RslChannelNr chan_nr) := {
1770 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1771 msg_type := RSL_MT_IPAC_PDCH_DEACT,
1772 ies := {
1773 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1774 }
1775 }
Harald Welte9958a4d2017-12-14 21:21:33 +01001776 template RSL_Message tr_RSL_IPA_PDCH_DEACT(template RslChannelNr chan_nr) := {
Harald Welteee19c732018-04-05 09:08:26 +02001777 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01001778 msg_type := RSL_MT_IPAC_PDCH_DEACT,
1779 ies := {
1780 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
1781 }
1782 }
1783
1784 template RSL_Message ts_RSL_IPA_PDCH_DEACT_ACK(RslChannelNr chan_nr) := {
Harald Welteee19c732018-04-05 09:08:26 +02001785 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01001786 msg_type := RSL_MT_IPAC_PDCH_DEACT_ACK,
1787 ies := {
1788 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr})
1789 }
1790 }
Harald Welteee19c732018-04-05 09:08:26 +02001791 template RSL_Message tr_RSL_IPA_PDCH_DEACT_ACK(template RslChannelNr chan_nr) := {
1792 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1793 msg_type := RSL_MT_IPAC_PDCH_DEACT_ACK,
1794 ies := {
1795 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr})
1796 }
1797 }
Harald Welte9958a4d2017-12-14 21:21:33 +01001798
1799 template RSL_Message ts_RSL_IPA_PDCH_DEACT_NACK(RslChannelNr chan_nr, RSL_Cause cause) := {
Harald Welteee19c732018-04-05 09:08:26 +02001800 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
Harald Welte9958a4d2017-12-14 21:21:33 +01001801 msg_type := RSL_MT_IPAC_PDCH_DEACT_NACK,
1802 ies := {
1803 t_RSL_IE(RSL_IE_CHAN_NR, RSL_IE_Body:{chan_nr := chan_nr}),
1804 t_RSL_IE(RSL_IE_CAUSE, RSL_IE_Body:{cause := ts_RSL_IE_Cause(cause)})
1805 }
1806 }
Harald Welteee19c732018-04-05 09:08:26 +02001807 template RSL_Message tr_RSL_IPA_PDCH_DEACT_NACK(template RslChannelNr chan_nr,
1808 template RSL_Cause cause) := {
1809 msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false),
1810 msg_type := RSL_MT_IPAC_PDCH_DEACT_NACK,
1811 ies := {
1812 tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}),
1813 tr_RSL_IE(RSL_IE_Body:{cause := tr_RSL_IE_Cause(cause)})
1814 }
1815 }
Harald Welte9958a4d2017-12-14 21:21:33 +01001816
1817
Harald Welte6a8199d2018-01-29 21:58:53 +01001818 function f_rsl_find_ie(RSL_Message msg, RSL_IE_Type iei, out RSL_IE_Body ret) return boolean {
1819 for (var integer i := 0; i < sizeof(msg.ies); i := i+1) {
1820 if (msg.ies[i].iei == iei) {
1821 ret := msg.ies[i].body;
1822 return true;
1823 }
1824 }
1825 return false;
1826 }
1827
1828
Harald Welte9958a4d2017-12-14 21:21:33 +01001829
Harald Welte643e2a62017-11-27 15:03:18 +01001830} with { encode "RAW" ; variant "FIELDORDER(msb)" }