blob: ae0762a4bd367fa4368aaccb90781a82b15302f6 [file] [log] [blame]
Harald Welte34b5a952019-05-27 11:54:11 +02001/* Osmocom PCU Interface Types, as per osmo-pcu/include/osmocom/pcu/pcuif_proto.h
2 * (C) 2018-2019 Harald Welte <laforge@gnumonks.org>
3 * contributions by Vadim Yanitskiy <axilirator@gmail.com>
4 * All rights reserved.
5 *
6 * Released under the terms of GNU General Public License, Version 2 or
7 * (at your option) any later version.
8 *
9 * SPDX-License-Identifier: GPL-2.0-or-later
10 */
11
Harald Welte883340c2018-02-28 18:59:29 +010012module PCUIF_Types {
13
14import from General_Types all;
15import from Osmocom_Types all;
16
Harald Welte883340c2018-02-28 18:59:29 +010017const charstring PCU_SOCK_DEFAULT := "/tmp/pcu_bts";
Harald Welte3568dc72018-03-13 17:06:51 +010018const uint32_t PCU_IF_VERSION := 9;
Harald Welte883340c2018-02-28 18:59:29 +010019
20type enumerated PCUIF_MsgType {
21 PCU_IF_MSG_DATA_REQ ('00'O),
22 PCU_IF_MSG_DATA_CNF ('01'O),
23 PCU_IF_MSG_DATA_IND ('02'O),
24 PCU_IF_MSG_SUSP_REQ ('03'O),
Harald Welte11b734c2019-09-05 14:17:54 +020025 PCU_IF_MSG_APP_INFO_REQ ('04'O),
Harald Welte883340c2018-02-28 18:59:29 +010026 PCU_IF_MSG_RTS_REQ ('10'O),
27 PCU_IF_MSG_DATA_CNF_DT ('11'O),
28 PCU_IF_MSG_RACH_IND ('22'O),
29 PCU_IF_MSG_INFO_IND ('32'O),
30 PCU_IF_MSG_ACT_REQ ('40'O),
31 PCU_IF_MSG_TIME_IND ('52'O),
32 PCU_IF_MSG_PAG_REQ ('60'O),
33 PCU_IF_MSG_TXT_IND ('70'O)
34} with { variant "FIELDLENGTH(8)" };
35
36type enumerated PCUIF_Sapi {
37 PCU_IF_SAPI_UNKNOWN ('00'O),
38 PCU_IF_SAPI_RACH ('01'O),
39 PCU_IF_SAPI_AGCH ('02'O),
40 PCU_IF_SAPI_PCH ('03'O),
41 PCU_IF_SAPI_BCCH ('04'O),
42 PCU_IF_SAPI_PDTCH ('05'O),
43 PCU_IF_SAPI_PRACH ('06'O),
44 PCU_IF_SAPI_PTCCH ('07'O),
45 PCU_IF_SAPI_AGCH_DT ('08'O)
46} with { variant "FIELDLENGTH(8)" };
47
48type record PCUIF_Flags {
49 boolean bts_active,
50 boolean sysmo_direct_dsp,
51 BIT14 spare,
52 boolean cs1,
53 boolean cs2,
54 boolean cs3,
55 boolean cs4,
56 boolean mcs1,
57 boolean mcs2,
58 boolean mcs3,
59 boolean mcs4,
60 boolean mcs5,
61 boolean mcs6,
62 boolean mcs7,
63 boolean mcs8,
64 boolean mcs9,
65 BIT3 spare2
66} with { variant "" };
67
68type enumerated PCUIF_TextType {
69 PCU_VERSION (0),
70 PCU_OML_ALERT (1)
71} with { variant "FIELDLENGTH(8)" };
72
Vadim Yanitskiye1527f72019-09-09 02:15:33 +020073type charstring PCUIF_Text length(128) with { variant "FIELDLENGTH(null_terminated)" };
Harald Welte883340c2018-02-28 18:59:29 +010074
75type record PCUIF_txt_ind {
76 PCUIF_TextType txt_type,
77 PCUIF_Text text
78} with { variant "" };
79
Harald Welte883340c2018-02-28 18:59:29 +010080type record PCUIF_data {
81 PCUIF_Sapi sapi,
82 uint8_t len,
Vadim Yanitskiyd8f28e62019-09-10 18:11:52 +020083 octetstring data length(162),
Harald Welte883340c2018-02-28 18:59:29 +010084 uint32_t fn,
85 uint16_t arfcn,
86 uint8_t trx_nr,
87 uint8_t ts_nr,
88 uint8_t block_nr,
89 int8_t rssi,
90 uint16_t ber10k,
91 int16_t ta_offs_qbits,
92 int16_t lqual_cb
Vadim Yanitskiyd8f28e62019-09-10 18:11:52 +020093} with { variant (data) "FIELDLENGTH(162), ALIGN(left)" };
Harald Welte883340c2018-02-28 18:59:29 +010094
95type record PCUIF_data_cnf_dt {
96 PCUIF_Sapi sapi,
97 OCT4 tlli,
98 uint32_t fn,
99 uint16_t arfcn,
100 uint8_t trx_nr,
101 uint8_t ts_nr,
102 uint8_t block_nr,
103 int8_t rssi,
104 uint16_t ber10k,
105 int16_t ta_offs_qbits,
106 int16_t lqual_cb
107} with { variant "" };
108
109type record PCUIF_rts_req {
110 PCUIF_Sapi sapi,
111 OCT3 spare,
112 uint32_t fn,
113 uint16_t arfcn,
114 uint8_t trx_nr,
115 uint8_t ts_nr,
116 uint8_t block_nr
117} with { variant "" };
118
Harald Welte913bbf62019-03-01 00:39:19 +0100119type enumerated PCUIF_BurstType {
120 BURST_TYPE_NONE (0),
121 BURST_TYPE_0 (1),
122 BURST_TYPE_1 (2),
123 BURST_TYPE_2 (3)
124} with { variant "FIELDLENGTH(8)" };
125
Harald Welte883340c2018-02-28 18:59:29 +0100126type record PCUIF_rach_ind {
127 PCUIF_Sapi sapi,
128 uint16_t ra,
129 int16_t qta,
130 uint32_t fn,
131 uint16_t arfcn,
132 uint8_t is_11bit,
Harald Welte913bbf62019-03-01 00:39:19 +0100133 PCUIF_BurstType burst_type
Harald Welte883340c2018-02-28 18:59:29 +0100134} with { variant "" };
135
136type record PCUIF_InfoTrx {
137 uint16_t arfcn,
138 BIT8 pdch_mask,
139 OCT1 spare,
140 OCT8 tsc,
141 uint32_t hLayer1
Harald Weltef1486592018-04-04 19:26:41 +0200142} with { variant (pdch_mask) "BITORDER(msb)" };
Harald Weltee1fd9162019-02-18 19:47:53 +0100143type record length(8) of PCUIF_InfoTrx PCUIF_InfoTrxs;
Harald Welte883340c2018-02-28 18:59:29 +0100144
145type record PCUIF_info_ind {
146 uint32_t version,
147 PCUIF_Flags flags,
Harald Weltee1fd9162019-02-18 19:47:53 +0100148 PCUIF_InfoTrxs trx,
Harald Welte883340c2018-02-28 18:59:29 +0100149 uint8_t bsic,
150
151 uint16_t mcc,
152 uint16_t mnc,
Harald Welte3568dc72018-03-13 17:06:51 +0100153 uint8_t mnc_3_digits,
Harald Welte883340c2018-02-28 18:59:29 +0100154 uint16_t lac,
155 uint16_t rac,
156
157 uint16_t nsei,
158 record length(7) of uint8_t nse_timer,
159 record length(11) of uint8_t cell_timer,
160
161 uint16_t cell_id,
162 uint16_t repeat_time,
163 uint8_t repeat_count,
164 uint16_t bvci,
165 uint8_t t3142,
166 uint8_t t3169,
167 uint8_t t3191,
168 uint8_t t3193_10ms,
169 uint8_t t3195,
170 uint8_t t3101,
171 uint8_t t3103,
172 uint8_t t3105,
173 uint8_t cv_countdown,
174 uint16_t dl_tbf_ext,
175 uint16_t ul_tbf_ext,
176 uint8_t initial_cs,
177 uint8_t initial_mcs,
178
179 record length(2) of uint16_t nsvci,
180 record length(2) of uint16_t local_pprt,
181 record length(2) of uint16_t remote_port,
Harald Welte07e8dde2019-02-18 20:38:45 +0100182 record length(2) of OCT4 remote_ip
Harald Welte883340c2018-02-28 18:59:29 +0100183} with { variant "" }
184
185type record PCUIF_act_req {
186 uint8_t is_activate,
187 uint8_t trx_nr,
188 uint8_t ts_nr,
189 OCT1 spare
190} with { variant "" };
191
192type record PCUIF_time_ind {
193 uint32_t fn
194} with { variant "" };
195
196type record PCUIF_pag_req {
197 PCUIF_Sapi sapi,
198 uint8_t chan_needed,
199 OCT9 identity_lv
200} with { variant "" };
201
Harald Welte11b734c2019-09-05 14:17:54 +0200202type record PCUIF_app_info_req {
203 uint8_t application_type,
204 uint8_t len,
205 octetstring data
206} with {
207 variant (len) "LENGTHTO(data)"
208}
209
Harald Welte883340c2018-02-28 18:59:29 +0100210type record PCUIF_susp_req {
211 OCT4 tlli,
212 OCT6 ra_id,
213 uint8_t cause
Harald Welteeaa9a862019-05-26 23:01:08 +0200214} with {
215 variant (tlli) "BYTEORDER(last)"
216};
Harald Welte883340c2018-02-28 18:59:29 +0100217
218
219type union PCUIF_MsgUnion {
220 PCUIF_data data_req,
221 PCUIF_data data_cnf,
222 PCUIF_data_cnf_dt data_cnf_dt,
223 PCUIF_data data_ind,
224 PCUIF_susp_req susp_req,
225 PCUIF_rts_req rts_req,
226 PCUIF_rach_ind rach_ind,
227 PCUIF_txt_ind txt_ind,
228 PCUIF_info_ind info_ind,
229 PCUIF_act_req act_req,
230 PCUIF_time_ind time_ind,
Harald Welte11b734c2019-09-05 14:17:54 +0200231 PCUIF_pag_req pag_req,
232 PCUIF_app_info_req app_info_req
Harald Welte883340c2018-02-28 18:59:29 +0100233} with { variant "" };
234
235type record PCUIF_Message {
236 PCUIF_MsgType msg_type,
237 uint8_t bts_nr,
238 OCT2 spare,
239 PCUIF_MsgUnion u
240} with { variant (u) "CROSSTAG(
241 data_req, msg_type = PCU_IF_MSG_DATA_REQ;
242 data_cnf, msg_type = PCU_IF_MSG_DATA_CNF;
243 data_cnf_dt, msg_type = PCU_IF_MSG_DATA_CNF_DT;
244 data_ind, msg_type = PCU_IF_MSG_DATA_IND;
245 susp_req, msg_type = PCU_IF_MSG_SUSP_REQ;
246 rts_req, msg_type = PCU_IF_MSG_RTS_REQ;
247 rach_ind, msg_type = PCU_IF_MSG_RACH_IND;
248 txt_ind, msg_type = PCU_IF_MSG_TXT_IND;
249 info_ind, msg_type = PCU_IF_MSG_INFO_IND;
250 act_req, msg_type = PCU_IF_MSG_ACT_REQ;
251 time_ind, msg_type = PCU_IF_MSG_TIME_IND;
Harald Welte11b734c2019-09-05 14:17:54 +0200252 pag_req, msg_type = PCU_IF_MSG_PAG_REQ;
253 app_info_req, msg_type = PCU_IF_MSG_APP_INFO_REQ)"
Harald Welte3568dc72018-03-13 17:06:51 +0100254 variant "PADDING(1696)" /* 212 * 8 */
Harald Welte883340c2018-02-28 18:59:29 +0100255};
256
257external function enc_PCUIF_Message(in PCUIF_Message pdu) return octetstring
258 with { extension "prototype(convert) encode(RAW)" };
259external function dec_PCUIF_Message(in octetstring stream) return PCUIF_Message
260 with { extension "prototype(convert) decode(RAW)" };
261
262
Vadim Yanitskiyf7d9c0f2019-09-06 00:08:17 +0200263/* Generic template for matching messages by type and/or the BTS number */
264template PCUIF_Message tr_PCUIF_MSG(template PCUIF_MsgType msg_type := ?,
265 template uint8_t bts_nr := ?) := {
266 msg_type := msg_type,
267 bts_nr := bts_nr,
268 spare := ?,
269 u := ?
270}
271
Harald Weltee1fd9162019-02-18 19:47:53 +0100272template (value) PCUIF_Message ts_PCUIF_RTS_REQ(template (value) uint8_t bts_nr,
273 template (value) uint8_t trx_nr,
274 template (value) uint8_t ts_nr,
275 template (value) PCUIF_Sapi sapi,
276 template (value) uint32_t fn,
277 template (value) uint16_t arfcn,
278 template (value) uint8_t block_nr
279 ) := {
280 msg_type := PCU_IF_MSG_RTS_REQ,
281 bts_nr := bts_nr,
282 spare := '0000'O,
283 u := {
284 rts_req := {
285 sapi := sapi,
286 spare := '000000'O,
287 fn := fn,
288 arfcn := arfcn,
289 trx_nr := trx_nr,
290 ts_nr := ts_nr,
291 block_nr := block_nr
292 }
293 }
294}
Harald Welte883340c2018-02-28 18:59:29 +0100295template PCUIF_Message tr_PCUIF_RTS_REQ(template uint8_t bts_nr := ?,
296 template uint8_t trx_nr := ?,
297 template uint8_t ts_nr := ?,
298 template PCUIF_Sapi sapi := ?,
299 template uint32_t fn := ?,
300 template uint8_t block_nr := ?
301 ) := {
302 msg_type := PCU_IF_MSG_RTS_REQ,
303 bts_nr := bts_nr,
304 spare := ?,
305 u := {
306 rts_req := {
307 sapi := sapi,
308 spare := ?,
309 fn := fn,
310 arfcn := ?,
311 trx_nr := trx_nr,
312 ts_nr := ts_nr,
313 block_nr := block_nr
314 }
315 }
316}
317
318template (value) PCUIF_Message ts_PCUIF_TXT_IND(uint8_t bts_nr, PCUIF_TextType tt, charstring text) := {
319 msg_type := PCU_IF_MSG_TXT_IND,
320 bts_nr := bts_nr,
321 spare := '0000'O,
322 u := {
323 txt_ind := {
324 txt_type := tt,
325 text := text
326 }
327 }
328}
Harald Weltee1fd9162019-02-18 19:47:53 +0100329template PCUIF_Message tr_PCUIF_TXT_IND(template uint8_t bts_nr, template PCUIF_TextType tt,
330 template charstring text := ?) := {
331 msg_type := PCU_IF_MSG_TXT_IND,
332 bts_nr := bts_nr,
333 spare := '0000'O,
334 u := {
335 txt_ind := {
336 txt_type := tt,
337 text := text
338 }
339 }
340}
341
342
Harald Welte883340c2018-02-28 18:59:29 +0100343
344template (value) PCUIF_Message ts_PCUIF_ACT_REQ(uint8_t bts_nr, uint8_t trx_nr, uint8_t ts_nr) := {
345 msg_type := PCU_IF_MSG_ACT_REQ,
346 bts_nr := bts_nr,
347 spare := '0000'O,
348 u := {
349 act_req := {
350 is_activate := 1,
351 trx_nr := trx_nr,
352 ts_nr := ts_nr,
353 spare := '00'O
354 }
355 }
356}
Harald Weltee1fd9162019-02-18 19:47:53 +0100357template PCUIF_Message tr_PCUIF_ACT_REQ(template uint8_t bts_nr, template uint8_t trx_nr,
358 template uint8_t ts_nr) := {
359 msg_type := PCU_IF_MSG_ACT_REQ,
360 bts_nr := bts_nr,
361 spare := '0000'O,
362 u := {
363 act_req := {
364 is_activate := 1,
365 trx_nr := trx_nr,
366 ts_nr := ts_nr,
367 spare := '00'O
368 }
369 }
370}
Harald Welte883340c2018-02-28 18:59:29 +0100371
372template (value) PCUIF_Message ts_PCUIF_DEACT_REQ(uint8_t bts_nr, uint8_t trx_nr, uint8_t ts_nr) := {
373 msg_type := PCU_IF_MSG_ACT_REQ,
374 bts_nr := bts_nr,
375 spare := '0000'O,
376 u := {
377 act_req := {
378 is_activate := 0,
379 trx_nr := trx_nr,
380 ts_nr := ts_nr,
381 spare := '00'O
382 }
383 }
384}
Harald Weltee1fd9162019-02-18 19:47:53 +0100385template PCUIF_Message tr_PCUIF_DEACT_REQ(template uint8_t bts_nr, template uint8_t trx_nr,
386 template uint8_t ts_nr) := {
387 msg_type := PCU_IF_MSG_ACT_REQ,
388 bts_nr := bts_nr,
389 spare := '0000'O,
390 u := {
391 act_req := {
392 is_activate := 0,
393 trx_nr := trx_nr,
394 ts_nr := ts_nr,
395 spare := '00'O
396 }
397 }
398}
Harald Welte883340c2018-02-28 18:59:29 +0100399
Harald Weltee1fd9162019-02-18 19:47:53 +0100400template (value) PCUIF_Message ts_PCUIF_DATA_IND(template (value) uint8_t bts_nr,
401 template (value) uint8_t trx_nr,
402 template (value) uint8_t ts_nr,
403 template (value) uint8_t block_nr,
404 template (value) PCUIF_Sapi sapi,
Vadim Yanitskiyc78ea262019-05-17 01:08:08 +0700405 template (value) octetstring data,
Harald Weltee1fd9162019-02-18 19:47:53 +0100406 template (value) uint32_t fn,
407 template (value) uint16_t arfcn,
408 template (value) int8_t rssi := -80,
409 template (value) uint16_t ber10k := 0,
410 template (value) int16_t ta_offs_qbits := 0,
411 template (value) uint16_t lqual_cb := 10) := {
412 msg_type := PCU_IF_MSG_DATA_IND,
413 bts_nr := bts_nr,
414 spare := '0000'O,
415 u := {
416 data_ind := {
417 sapi := sapi,
418 len := lengthof(valueof(data)),
419 data := data,
420 fn := fn,
421 arfcn := arfcn,
422 trx_nr := trx_nr,
423 ts_nr := ts_nr,
424 block_nr := block_nr,
425 rssi := rssi,
426 ber10k := ber10k,
427 ta_offs_qbits := ta_offs_qbits,
428 lqual_cb := lqual_cb
429 }
430 }
431}
Harald Welte883340c2018-02-28 18:59:29 +0100432template PCUIF_Message tr_PCUIF_DATA_IND(template uint8_t bts_nr := ?,
433 template uint8_t trx_nr := ?,
434 template uint8_t ts_nr := ?,
435 template uint8_t block_nr := ?,
436 template PCUIF_Sapi sapi := ?,
Vadim Yanitskiyc78ea262019-05-17 01:08:08 +0700437 template octetstring data := ?) := {
Harald Welte883340c2018-02-28 18:59:29 +0100438 msg_type := PCU_IF_MSG_DATA_IND,
439 bts_nr := bts_nr,
440 spare := ?,
441 u := {
442 data_ind := {
443 sapi := sapi,
444 len := ?,
445 data := data,
446 fn := ?,
447 arfcn := ?,
448 trx_nr := trx_nr,
449 ts_nr := ts_nr,
450 block_nr := block_nr,
451 rssi := ?,
452 ber10k := ?,
453 ta_offs_qbits := ?,
454 lqual_cb := ?
455 }
456 }
457}
458
459template (value) PCUIF_Message ts_PCUIF_DATA_REQ(uint8_t bts_nr, uint8_t trx_nr,
460 uint8_t ts_nr, uint8_t block_nr,
461 uint32_t fn, PCUIF_Sapi sapi,
462 octetstring data) := {
463 msg_type := PCU_IF_MSG_DATA_REQ,
464 bts_nr := bts_nr,
465 spare := '0000'O,
466 u := {
467 data_req := {
468 sapi := sapi,
469 len := lengthof(data),
470 data := data,
471 fn := fn,
472 arfcn := 0, /* unused in BTS */
473 trx_nr := trx_nr,
474 ts_nr := ts_nr,
475 block_nr := block_nr,
476 /* measurement parameters below unused on Tx */
477 rssi := 0,
478 ber10k := 0,
479 ta_offs_qbits := 0,
480 lqual_cb := 0
481 }
482 }
483}
Harald Weltee1fd9162019-02-18 19:47:53 +0100484template PCUIF_Message tr_PCUIF_DATA_REQ(template uint8_t bts_nr,
485 template uint8_t trx_nr,
486 template uint8_t ts_nr,
487 template uint8_t block_nr := ?,
488 template uint32_t fn := ?,
489 template PCUIF_Sapi sapi := ?,
490 template octetstring data := ?) := {
491 msg_type := PCU_IF_MSG_DATA_REQ,
492 bts_nr := bts_nr,
493 spare := '0000'O,
494 u := {
495 data_req := {
496 sapi := sapi,
497 len := ?,
498 data := data,
499 fn := fn,
Harald Welte0a3d63f2019-03-02 00:02:07 +0100500 arfcn := ?, /* unused in BTS */
Harald Weltee1fd9162019-02-18 19:47:53 +0100501 trx_nr := trx_nr,
502 ts_nr := ts_nr,
503 block_nr := block_nr,
504 /* measurement parameters below unused on Tx */
505 rssi := 0,
506 ber10k := 0,
507 ta_offs_qbits := 0,
508 lqual_cb := 0
509 }
510 }
511}
Harald Welte883340c2018-02-28 18:59:29 +0100512
Harald Weltee1fd9162019-02-18 19:47:53 +0100513template (value) PCUIF_Message ts_PCUIF_DATA_CNF(template (value) uint8_t bts_nr,
514 template (value) uint8_t trx_nr,
515 template (value) uint8_t ts_nr,
516 template (value) uint8_t block_nr,
517 template (value) uint32_t fn,
518 template (value) uint16_t arfcn,
519 template (value) PCUIF_Sapi sapi,
520 template (value) octetstring data) := {
521 msg_type := PCU_IF_MSG_DATA_CNF,
522 bts_nr := bts_nr,
523 spare := '0000'O,
524 u := {
525 data_cnf := {
526 sapi := sapi,
527 len := 0, /* overwritten */
528 data := data,
529 fn := fn,
530 arfcn := arfcn,
531 trx_nr := trx_nr,
532 ts_nr := ts_nr,
533 block_nr := block_nr,
534 rssi := 0,
535 ber10k := 0,
536 ta_offs_qbits := 0,
537 lqual_cb := 0
538 }
539 }
540}
Harald Welte883340c2018-02-28 18:59:29 +0100541template PCUIF_Message tr_PCUIF_DATA_CNF(template uint8_t bts_nr := ?,
542 template uint8_t trx_nr := ?,
543 template uint8_t ts_nr := ?,
544 template PCUIF_Sapi sapi := ?,
545 template octetstring data := ?) := {
546 msg_type := PCU_IF_MSG_DATA_CNF,
547 bts_nr := bts_nr,
548 spare := ?,
549 u := {
550 data_cnf := {
551 sapi := sapi,
552 len := ?,
553 data := data,
554 fn := ?,
555 arfcn := ?,
556 trx_nr := trx_nr,
557 ts_nr := ts_nr,
558 block_nr := ?,
559 rssi := ?,
560 ber10k := ?,
561 ta_offs_qbits := ?,
562 lqual_cb := ?
563 }
564 }
565}
566
Harald Weltee1fd9162019-02-18 19:47:53 +0100567template (value) PCUIF_Message ts_PCUIF_RACH_IND(template (value) uint8_t bts_nr,
568 template (value) uint16_t ra,
569 template (value) uint8_t is_11bit,
Harald Welte913bbf62019-03-01 00:39:19 +0100570 template (value) PCUIF_BurstType burst_type,
Harald Weltee1fd9162019-02-18 19:47:53 +0100571 template (value) uint32_t fn,
572 template (value) uint16_t arfcn,
Vadim Yanitskiy36aa6112019-10-04 16:43:00 +0700573 template (value) int16_t qta := 0,
574 template (value) PCUIF_Sapi sapi := PCU_IF_SAPI_RACH
Harald Weltee1fd9162019-02-18 19:47:53 +0100575) := {
576 msg_type := PCU_IF_MSG_RACH_IND,
577 bts_nr := bts_nr,
578 spare := '0000'O,
579 u := {
580 rach_ind := {
Vadim Yanitskiy36aa6112019-10-04 16:43:00 +0700581 sapi := sapi,
Harald Weltee1fd9162019-02-18 19:47:53 +0100582 ra := ra,
583 qta := qta,
584 fn := fn,
585 arfcn := arfcn,
586 is_11bit := is_11bit,
587 burst_type := burst_type
588 }
589 }
590}
Harald Welte883340c2018-02-28 18:59:29 +0100591template PCUIF_Message tr_PCUIF_RACH_IND(template uint8_t bts_nr := ?,
592 template uint16_t ra := ?,
593 template uint8_t is_11bit := ?,
Harald Welte913bbf62019-03-01 00:39:19 +0100594 template PCUIF_BurstType burst_type := ?,
Vadim Yanitskiy36aa6112019-10-04 16:43:00 +0700595 template uint32_t fn := ?,
596 template PCUIF_Sapi sapi := PCU_IF_SAPI_RACH) := {
Harald Welte883340c2018-02-28 18:59:29 +0100597 msg_type := PCU_IF_MSG_RACH_IND,
598 bts_nr := bts_nr,
599 spare := ?,
600 u := {
601 rach_ind := {
Vadim Yanitskiy36aa6112019-10-04 16:43:00 +0700602 sapi := sapi,
Harald Welte883340c2018-02-28 18:59:29 +0100603 ra := ra,
604 qta := ?,
605 fn := fn,
606 arfcn := ?,
607 is_11bit := is_11bit,
608 burst_type := burst_type
609 }
610 }
611}
612
Harald Weltee1fd9162019-02-18 19:47:53 +0100613template (value) PCUIF_Message ts_PCUIF_PAG_REQ(template (value) uint8_t bts_nr,
614 template (value) OCT9 id_lv,
615 template (value) uint8_t chan_needed,
616 template (value) PCUIF_Sapi sapi) := {
617 msg_type := PCU_IF_MSG_PAG_REQ,
618 bts_nr := bts_nr,
619 spare := '0000'O,
620 u := {
621 pag_req := {
622 sapi := sapi,
623 chan_needed := chan_needed,
624 identity_lv := id_lv
625 }
626 }
627}
Harald Welte883340c2018-02-28 18:59:29 +0100628template PCUIF_Message tr_PCUIF_PAG_REQ(template uint8_t bts_nr := ?,
629 template OCT9 id_lv := ?,
630 template uint8_t chan_needed := ?,
631 template PCUIF_Sapi sapi := ?) := {
632 msg_type := PCU_IF_MSG_PAG_REQ,
633 bts_nr := bts_nr,
634 spare := ?,
635 u := {
636 pag_req := {
637 sapi := ?,
638 chan_needed := chan_needed,
639 identity_lv := id_lv
640 }
641 }
642}
643
Harald Weltee1fd9162019-02-18 19:47:53 +0100644const PCUIF_Flags c_PCUIF_Flags_default := {
645 bts_active := true,
646 sysmo_direct_dsp := false,
647 spare := '00000000000000'B,
648 cs1 := true,
649 cs2 := true,
650 cs3 := true,
651 cs4 := true,
652 mcs1 := true,
653 mcs2 := true,
654 mcs3 := true,
655 mcs4 := true,
656 mcs5 := true,
657 mcs6 := true,
658 mcs7 := true,
659 mcs8 := true,
660 mcs9 := true,
661 spare2 := '000'B
662};
663
664template (value) PCUIF_InfoTrx ts_PCUIF_InfoTrx(template (value) uint16_t arfcn := 871,
665 template (value) BIT8 pdch_mask := '00000001'B,
666 OCT1 tsc := '07'O) := {
667 arfcn := arfcn,
668 pdch_mask := pdch_mask,
669 spare := '00'O,
670 tsc := tsc & tsc & tsc & tsc & tsc & tsc & tsc & tsc,
671 hLayer1 := 0
672}
673
674template (value) PCUIF_InfoTrx ts_PCUIF_InfoTrxNULL := ts_PCUIF_InfoTrx(0, '00000000'B, '00'O);
675
676template (value) PCUIF_InfoTrxs ts_PCUIF_InfoTrxs_def := {
677 ts_PCUIF_InfoTrx, ts_PCUIF_InfoTrxNULL, ts_PCUIF_InfoTrxNULL, ts_PCUIF_InfoTrxNULL,
678 ts_PCUIF_InfoTrxNULL, ts_PCUIF_InfoTrxNULL, ts_PCUIF_InfoTrxNULL, ts_PCUIF_InfoTrxNULL };
679
Harald Weltee1fd9162019-02-18 19:47:53 +0100680template (value) PCUIF_Message ts_PCUIF_INFO_IND(template (value) uint8_t bts_nr,
Pau Espin Pedrolf787b092019-10-04 18:34:05 +0200681 template (value) PCUIF_info_ind info_ind) := {
Harald Weltee1fd9162019-02-18 19:47:53 +0100682 msg_type := PCU_IF_MSG_INFO_IND,
683 bts_nr := bts_nr,
684 spare := '0000'O,
685 u := {
Pau Espin Pedrolf787b092019-10-04 18:34:05 +0200686 info_ind := info_ind
Harald Weltee1fd9162019-02-18 19:47:53 +0100687 }
688}
Harald Welted378a252018-03-13 17:02:14 +0100689template PCUIF_Message tr_PCUIF_INFO_IND(template uint8_t bts_nr := ?,
690 template PCUIF_Flags flags := ?,
691 template uint32_t version := PCU_IF_VERSION) := {
692 msg_type := PCU_IF_MSG_INFO_IND,
693 bts_nr := bts_nr,
694 spare := ?,
695 u := {
696 info_ind := {
697 version := version,
698 flags := flags,
699 trx := ?,
700 bsic := ?,
701 mcc := ?,
702 mnc :=?,
Harald Welte3568dc72018-03-13 17:06:51 +0100703 mnc_3_digits := ?,
Harald Welted378a252018-03-13 17:02:14 +0100704 lac := ?,
705 rac := ?,
706 nsei := ?,
707 nse_timer := ?,
708 cell_timer := ?,
709 cell_id := ?,
710 repeat_time := ?,
711 repeat_count := ?,
712 bvci := ?,
713 t3142 := ?,
714 t3169 := ?,
715 t3191 := ?,
716 t3193_10ms := ?,
717 t3195 := ?,
718 t3101 := ?,
719 t3103 := ?,
720 t3105 := ?,
721 cv_countdown := ?,
722 dl_tbf_ext := ?,
723 ul_tbf_ext := ?,
724 initial_cs := ?,
725 initial_mcs := ?,
726 nsvci := ?,
727 local_pprt := ?,
728 remote_port := ?,
729 remote_ip := ?
730 }
731 }
732}
733
Harald Weltea3219812019-03-02 00:02:28 +0100734template (value) PCUIF_Message ts_PCUIF_TIME_IND(template (value) uint8_t bts_nr,
735 template (value) uint32_t fn) := {
736 msg_type := PCU_IF_MSG_TIME_IND,
737 bts_nr := bts_nr,
738 spare := '0000'O,
739 u := {
740 time_ind := {
741 fn := fn
742 }
743 }
744}
745template PCUIF_Message tr_PCUIF_TIME_IND(template uint8_t bts_nr,
746 template uint32_t fn) := {
747 msg_type := PCU_IF_MSG_TIME_IND,
748 bts_nr := bts_nr,
749 spare := ?,
750 u := {
751 time_ind := {
752 fn := fn
753 }
754 }
755}
Harald Welte883340c2018-02-28 18:59:29 +0100756
Harald Welte4bff40a2019-03-21 21:34:10 +0100757template (value) PCUIF_Message ts_PCUIF_SUSP_REQ(template (value) uint8_t bts_nr,
758 template (value) OCT4 tlli,
759 template (value) OCT6 ra_id,
760 template (value) uint8_t cause) := {
761 msg_type := PCU_IF_MSG_SUSP_REQ,
762 bts_nr := bts_nr,
763 spare := '0000'O,
764 u := {
765 susp_req := {
766 tlli := tlli,
767 ra_id := ra_id,
768 cause := cause
769 }
770 }
771}
772template PCUIF_Message tr_PCUIF_SUSP_REQ(template uint8_t bts_nr,
773 template OCT4 tlli,
774 template OCT6 ra_id,
775 template uint8_t cause) := {
776 msg_type := PCU_IF_MSG_SUSP_REQ,
777 bts_nr := bts_nr,
778 spare := '0000'O,
779 u := {
780 susp_req := {
781 tlli := tlli,
782 ra_id := ra_id,
783 cause := cause
784 }
785 }
786}
787
Harald Welte11b734c2019-09-05 14:17:54 +0200788template (value) PCUIF_Message ts_PCUIF_APP_INFO_REQ(template (value) uint8_t bts_nr,
789 template (value) uint8_t app_type,
790 template (value) octetstring app_data) := {
791 msg_type := PCU_IF_MSG_APP_INFO_REQ,
792 bts_nr := bts_nr,
793 spare := '0000'O,
794 u := {
795 app_info_req := {
796 application_type := app_type,
797 len := 0, /* overwritten */
798 data := app_data
799 }
800 }
801}
802template (present) PCUIF_Message tr_PCUIF_APP_INFO_REQ(template (present) uint8_t bts_nr,
803 template (present) uint8_t app_type,
804 template (present) octetstring app_data) := {
805 msg_type := PCU_IF_MSG_APP_INFO_REQ,
806 bts_nr := bts_nr,
807 spare := '0000'O,
808 u := {
809 app_info_req := {
810 application_type := app_type,
811 len := ?,
812 data := app_data
813 }
814 }
815}
816
Harald Welte4bff40a2019-03-21 21:34:10 +0100817
Harald Welte883340c2018-02-28 18:59:29 +0100818} with { encode "RAW" variant "BYTEORDER(first)" };