blob: 721eb649ea634e0c53688f43870861533b265f25 [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
73type charstring PCUIF_Text length(128) with { variant "FIELDLENGTH(128)" };
74
75type record PCUIF_txt_ind {
76 PCUIF_TextType txt_type,
77 PCUIF_Text text
78} with { variant "" };
79
Vadim Yanitskiydd6d5d12019-09-04 23:32:11 +020080/* This is a bad side of the current protocol design: fixed-size buffer is located
81 * in between the other fields of the message, so if the payload is smaller than
82 * 162 octets (1296 bits), we need to fill the remaining space with padding. */
83type octetstring PCUIF_DataPad with { variant "ALIGN(left), PADDING(1296)" };
84
Harald Welte883340c2018-02-28 18:59:29 +010085type record PCUIF_data {
86 PCUIF_Sapi sapi,
87 uint8_t len,
Vadim Yanitskiydd6d5d12019-09-04 23:32:11 +020088 PCUIF_DataPad data,
Harald Welte883340c2018-02-28 18:59:29 +010089 uint32_t fn,
90 uint16_t arfcn,
91 uint8_t trx_nr,
92 uint8_t ts_nr,
93 uint8_t block_nr,
94 int8_t rssi,
95 uint16_t ber10k,
96 int16_t ta_offs_qbits,
97 int16_t lqual_cb
Vadim Yanitskiydd6d5d12019-09-04 23:32:11 +020098} with { variant (len) "LENGTHTO(data)" };
Harald Welte883340c2018-02-28 18:59:29 +010099
100type record PCUIF_data_cnf_dt {
101 PCUIF_Sapi sapi,
102 OCT4 tlli,
103 uint32_t fn,
104 uint16_t arfcn,
105 uint8_t trx_nr,
106 uint8_t ts_nr,
107 uint8_t block_nr,
108 int8_t rssi,
109 uint16_t ber10k,
110 int16_t ta_offs_qbits,
111 int16_t lqual_cb
112} with { variant "" };
113
114type record PCUIF_rts_req {
115 PCUIF_Sapi sapi,
116 OCT3 spare,
117 uint32_t fn,
118 uint16_t arfcn,
119 uint8_t trx_nr,
120 uint8_t ts_nr,
121 uint8_t block_nr
122} with { variant "" };
123
Harald Welte913bbf62019-03-01 00:39:19 +0100124type enumerated PCUIF_BurstType {
125 BURST_TYPE_NONE (0),
126 BURST_TYPE_0 (1),
127 BURST_TYPE_1 (2),
128 BURST_TYPE_2 (3)
129} with { variant "FIELDLENGTH(8)" };
130
Harald Welte883340c2018-02-28 18:59:29 +0100131type record PCUIF_rach_ind {
132 PCUIF_Sapi sapi,
133 uint16_t ra,
134 int16_t qta,
135 uint32_t fn,
136 uint16_t arfcn,
137 uint8_t is_11bit,
Harald Welte913bbf62019-03-01 00:39:19 +0100138 PCUIF_BurstType burst_type
Harald Welte883340c2018-02-28 18:59:29 +0100139} with { variant "" };
140
141type record PCUIF_InfoTrx {
142 uint16_t arfcn,
143 BIT8 pdch_mask,
144 OCT1 spare,
145 OCT8 tsc,
146 uint32_t hLayer1
Harald Weltef1486592018-04-04 19:26:41 +0200147} with { variant (pdch_mask) "BITORDER(msb)" };
Harald Weltee1fd9162019-02-18 19:47:53 +0100148type record length(8) of PCUIF_InfoTrx PCUIF_InfoTrxs;
Harald Welte883340c2018-02-28 18:59:29 +0100149
150type record PCUIF_info_ind {
151 uint32_t version,
152 PCUIF_Flags flags,
Harald Weltee1fd9162019-02-18 19:47:53 +0100153 PCUIF_InfoTrxs trx,
Harald Welte883340c2018-02-28 18:59:29 +0100154 uint8_t bsic,
155
156 uint16_t mcc,
157 uint16_t mnc,
Harald Welte3568dc72018-03-13 17:06:51 +0100158 uint8_t mnc_3_digits,
Harald Welte883340c2018-02-28 18:59:29 +0100159 uint16_t lac,
160 uint16_t rac,
161
162 uint16_t nsei,
163 record length(7) of uint8_t nse_timer,
164 record length(11) of uint8_t cell_timer,
165
166 uint16_t cell_id,
167 uint16_t repeat_time,
168 uint8_t repeat_count,
169 uint16_t bvci,
170 uint8_t t3142,
171 uint8_t t3169,
172 uint8_t t3191,
173 uint8_t t3193_10ms,
174 uint8_t t3195,
175 uint8_t t3101,
176 uint8_t t3103,
177 uint8_t t3105,
178 uint8_t cv_countdown,
179 uint16_t dl_tbf_ext,
180 uint16_t ul_tbf_ext,
181 uint8_t initial_cs,
182 uint8_t initial_mcs,
183
184 record length(2) of uint16_t nsvci,
185 record length(2) of uint16_t local_pprt,
186 record length(2) of uint16_t remote_port,
Harald Welte07e8dde2019-02-18 20:38:45 +0100187 record length(2) of OCT4 remote_ip
Harald Welte883340c2018-02-28 18:59:29 +0100188} with { variant "" }
189
190type record PCUIF_act_req {
191 uint8_t is_activate,
192 uint8_t trx_nr,
193 uint8_t ts_nr,
194 OCT1 spare
195} with { variant "" };
196
197type record PCUIF_time_ind {
198 uint32_t fn
199} with { variant "" };
200
201type record PCUIF_pag_req {
202 PCUIF_Sapi sapi,
203 uint8_t chan_needed,
204 OCT9 identity_lv
205} with { variant "" };
206
Harald Welte11b734c2019-09-05 14:17:54 +0200207type record PCUIF_app_info_req {
208 uint8_t application_type,
209 uint8_t len,
210 octetstring data
211} with {
212 variant (len) "LENGTHTO(data)"
213}
214
Harald Welte883340c2018-02-28 18:59:29 +0100215type record PCUIF_susp_req {
216 OCT4 tlli,
217 OCT6 ra_id,
218 uint8_t cause
Harald Welteeaa9a862019-05-26 23:01:08 +0200219} with {
220 variant (tlli) "BYTEORDER(last)"
221};
Harald Welte883340c2018-02-28 18:59:29 +0100222
223
224type union PCUIF_MsgUnion {
225 PCUIF_data data_req,
226 PCUIF_data data_cnf,
227 PCUIF_data_cnf_dt data_cnf_dt,
228 PCUIF_data data_ind,
229 PCUIF_susp_req susp_req,
230 PCUIF_rts_req rts_req,
231 PCUIF_rach_ind rach_ind,
232 PCUIF_txt_ind txt_ind,
233 PCUIF_info_ind info_ind,
234 PCUIF_act_req act_req,
235 PCUIF_time_ind time_ind,
Harald Welte11b734c2019-09-05 14:17:54 +0200236 PCUIF_pag_req pag_req,
237 PCUIF_app_info_req app_info_req
Harald Welte883340c2018-02-28 18:59:29 +0100238} with { variant "" };
239
240type record PCUIF_Message {
241 PCUIF_MsgType msg_type,
242 uint8_t bts_nr,
243 OCT2 spare,
244 PCUIF_MsgUnion u
245} with { variant (u) "CROSSTAG(
246 data_req, msg_type = PCU_IF_MSG_DATA_REQ;
247 data_cnf, msg_type = PCU_IF_MSG_DATA_CNF;
248 data_cnf_dt, msg_type = PCU_IF_MSG_DATA_CNF_DT;
249 data_ind, msg_type = PCU_IF_MSG_DATA_IND;
250 susp_req, msg_type = PCU_IF_MSG_SUSP_REQ;
251 rts_req, msg_type = PCU_IF_MSG_RTS_REQ;
252 rach_ind, msg_type = PCU_IF_MSG_RACH_IND;
253 txt_ind, msg_type = PCU_IF_MSG_TXT_IND;
254 info_ind, msg_type = PCU_IF_MSG_INFO_IND;
255 act_req, msg_type = PCU_IF_MSG_ACT_REQ;
256 time_ind, msg_type = PCU_IF_MSG_TIME_IND;
Harald Welte11b734c2019-09-05 14:17:54 +0200257 pag_req, msg_type = PCU_IF_MSG_PAG_REQ;
258 app_info_req, msg_type = PCU_IF_MSG_APP_INFO_REQ)"
Harald Welte3568dc72018-03-13 17:06:51 +0100259 variant "PADDING(1696)" /* 212 * 8 */
Harald Welte883340c2018-02-28 18:59:29 +0100260};
261
262external function enc_PCUIF_Message(in PCUIF_Message pdu) return octetstring
263 with { extension "prototype(convert) encode(RAW)" };
264external function dec_PCUIF_Message(in octetstring stream) return PCUIF_Message
265 with { extension "prototype(convert) decode(RAW)" };
266
267
Harald Weltee1fd9162019-02-18 19:47:53 +0100268template (value) PCUIF_Message ts_PCUIF_RTS_REQ(template (value) uint8_t bts_nr,
269 template (value) uint8_t trx_nr,
270 template (value) uint8_t ts_nr,
271 template (value) PCUIF_Sapi sapi,
272 template (value) uint32_t fn,
273 template (value) uint16_t arfcn,
274 template (value) uint8_t block_nr
275 ) := {
276 msg_type := PCU_IF_MSG_RTS_REQ,
277 bts_nr := bts_nr,
278 spare := '0000'O,
279 u := {
280 rts_req := {
281 sapi := sapi,
282 spare := '000000'O,
283 fn := fn,
284 arfcn := arfcn,
285 trx_nr := trx_nr,
286 ts_nr := ts_nr,
287 block_nr := block_nr
288 }
289 }
290}
Harald Welte883340c2018-02-28 18:59:29 +0100291template PCUIF_Message tr_PCUIF_RTS_REQ(template uint8_t bts_nr := ?,
292 template uint8_t trx_nr := ?,
293 template uint8_t ts_nr := ?,
294 template PCUIF_Sapi sapi := ?,
295 template uint32_t fn := ?,
296 template uint8_t block_nr := ?
297 ) := {
298 msg_type := PCU_IF_MSG_RTS_REQ,
299 bts_nr := bts_nr,
300 spare := ?,
301 u := {
302 rts_req := {
303 sapi := sapi,
304 spare := ?,
305 fn := fn,
306 arfcn := ?,
307 trx_nr := trx_nr,
308 ts_nr := ts_nr,
309 block_nr := block_nr
310 }
311 }
312}
313
314template (value) PCUIF_Message ts_PCUIF_TXT_IND(uint8_t bts_nr, PCUIF_TextType tt, charstring text) := {
315 msg_type := PCU_IF_MSG_TXT_IND,
316 bts_nr := bts_nr,
317 spare := '0000'O,
318 u := {
319 txt_ind := {
320 txt_type := tt,
321 text := text
322 }
323 }
324}
Harald Weltee1fd9162019-02-18 19:47:53 +0100325template PCUIF_Message tr_PCUIF_TXT_IND(template uint8_t bts_nr, template PCUIF_TextType tt,
326 template charstring text := ?) := {
327 msg_type := PCU_IF_MSG_TXT_IND,
328 bts_nr := bts_nr,
329 spare := '0000'O,
330 u := {
331 txt_ind := {
332 txt_type := tt,
333 text := text
334 }
335 }
336}
337
338
Harald Welte883340c2018-02-28 18:59:29 +0100339
340template (value) PCUIF_Message ts_PCUIF_ACT_REQ(uint8_t bts_nr, uint8_t trx_nr, uint8_t ts_nr) := {
341 msg_type := PCU_IF_MSG_ACT_REQ,
342 bts_nr := bts_nr,
343 spare := '0000'O,
344 u := {
345 act_req := {
346 is_activate := 1,
347 trx_nr := trx_nr,
348 ts_nr := ts_nr,
349 spare := '00'O
350 }
351 }
352}
Harald Weltee1fd9162019-02-18 19:47:53 +0100353template PCUIF_Message tr_PCUIF_ACT_REQ(template uint8_t bts_nr, template uint8_t trx_nr,
354 template uint8_t ts_nr) := {
355 msg_type := PCU_IF_MSG_ACT_REQ,
356 bts_nr := bts_nr,
357 spare := '0000'O,
358 u := {
359 act_req := {
360 is_activate := 1,
361 trx_nr := trx_nr,
362 ts_nr := ts_nr,
363 spare := '00'O
364 }
365 }
366}
Harald Welte883340c2018-02-28 18:59:29 +0100367
368template (value) PCUIF_Message ts_PCUIF_DEACT_REQ(uint8_t bts_nr, uint8_t trx_nr, uint8_t ts_nr) := {
369 msg_type := PCU_IF_MSG_ACT_REQ,
370 bts_nr := bts_nr,
371 spare := '0000'O,
372 u := {
373 act_req := {
374 is_activate := 0,
375 trx_nr := trx_nr,
376 ts_nr := ts_nr,
377 spare := '00'O
378 }
379 }
380}
Harald Weltee1fd9162019-02-18 19:47:53 +0100381template PCUIF_Message tr_PCUIF_DEACT_REQ(template uint8_t bts_nr, template uint8_t trx_nr,
382 template uint8_t ts_nr) := {
383 msg_type := PCU_IF_MSG_ACT_REQ,
384 bts_nr := bts_nr,
385 spare := '0000'O,
386 u := {
387 act_req := {
388 is_activate := 0,
389 trx_nr := trx_nr,
390 ts_nr := ts_nr,
391 spare := '00'O
392 }
393 }
394}
Harald Welte883340c2018-02-28 18:59:29 +0100395
Harald Weltee1fd9162019-02-18 19:47:53 +0100396template (value) PCUIF_Message ts_PCUIF_DATA_IND(template (value) uint8_t bts_nr,
397 template (value) uint8_t trx_nr,
398 template (value) uint8_t ts_nr,
399 template (value) uint8_t block_nr,
400 template (value) PCUIF_Sapi sapi,
Vadim Yanitskiyc78ea262019-05-17 01:08:08 +0700401 template (value) octetstring data,
Harald Weltee1fd9162019-02-18 19:47:53 +0100402 template (value) uint32_t fn,
403 template (value) uint16_t arfcn,
404 template (value) int8_t rssi := -80,
405 template (value) uint16_t ber10k := 0,
406 template (value) int16_t ta_offs_qbits := 0,
407 template (value) uint16_t lqual_cb := 10) := {
408 msg_type := PCU_IF_MSG_DATA_IND,
409 bts_nr := bts_nr,
410 spare := '0000'O,
411 u := {
412 data_ind := {
413 sapi := sapi,
414 len := lengthof(valueof(data)),
415 data := data,
416 fn := fn,
417 arfcn := arfcn,
418 trx_nr := trx_nr,
419 ts_nr := ts_nr,
420 block_nr := block_nr,
421 rssi := rssi,
422 ber10k := ber10k,
423 ta_offs_qbits := ta_offs_qbits,
424 lqual_cb := lqual_cb
425 }
426 }
427}
Harald Welte883340c2018-02-28 18:59:29 +0100428template PCUIF_Message tr_PCUIF_DATA_IND(template uint8_t bts_nr := ?,
429 template uint8_t trx_nr := ?,
430 template uint8_t ts_nr := ?,
431 template uint8_t block_nr := ?,
432 template PCUIF_Sapi sapi := ?,
Vadim Yanitskiyc78ea262019-05-17 01:08:08 +0700433 template octetstring data := ?) := {
Harald Welte883340c2018-02-28 18:59:29 +0100434 msg_type := PCU_IF_MSG_DATA_IND,
435 bts_nr := bts_nr,
436 spare := ?,
437 u := {
438 data_ind := {
439 sapi := sapi,
440 len := ?,
441 data := data,
442 fn := ?,
443 arfcn := ?,
444 trx_nr := trx_nr,
445 ts_nr := ts_nr,
446 block_nr := block_nr,
447 rssi := ?,
448 ber10k := ?,
449 ta_offs_qbits := ?,
450 lqual_cb := ?
451 }
452 }
453}
454
455template (value) PCUIF_Message ts_PCUIF_DATA_REQ(uint8_t bts_nr, uint8_t trx_nr,
456 uint8_t ts_nr, uint8_t block_nr,
457 uint32_t fn, PCUIF_Sapi sapi,
458 octetstring data) := {
459 msg_type := PCU_IF_MSG_DATA_REQ,
460 bts_nr := bts_nr,
461 spare := '0000'O,
462 u := {
463 data_req := {
464 sapi := sapi,
465 len := lengthof(data),
466 data := data,
467 fn := fn,
468 arfcn := 0, /* unused in BTS */
469 trx_nr := trx_nr,
470 ts_nr := ts_nr,
471 block_nr := block_nr,
472 /* measurement parameters below unused on Tx */
473 rssi := 0,
474 ber10k := 0,
475 ta_offs_qbits := 0,
476 lqual_cb := 0
477 }
478 }
479}
Harald Weltee1fd9162019-02-18 19:47:53 +0100480template PCUIF_Message tr_PCUIF_DATA_REQ(template uint8_t bts_nr,
481 template uint8_t trx_nr,
482 template uint8_t ts_nr,
483 template uint8_t block_nr := ?,
484 template uint32_t fn := ?,
485 template PCUIF_Sapi sapi := ?,
486 template octetstring data := ?) := {
487 msg_type := PCU_IF_MSG_DATA_REQ,
488 bts_nr := bts_nr,
489 spare := '0000'O,
490 u := {
491 data_req := {
492 sapi := sapi,
493 len := ?,
494 data := data,
495 fn := fn,
Harald Welte0a3d63f2019-03-02 00:02:07 +0100496 arfcn := ?, /* unused in BTS */
Harald Weltee1fd9162019-02-18 19:47:53 +0100497 trx_nr := trx_nr,
498 ts_nr := ts_nr,
499 block_nr := block_nr,
500 /* measurement parameters below unused on Tx */
501 rssi := 0,
502 ber10k := 0,
503 ta_offs_qbits := 0,
504 lqual_cb := 0
505 }
506 }
507}
Harald Welte883340c2018-02-28 18:59:29 +0100508
Harald Weltee1fd9162019-02-18 19:47:53 +0100509template (value) PCUIF_Message ts_PCUIF_DATA_CNF(template (value) uint8_t bts_nr,
510 template (value) uint8_t trx_nr,
511 template (value) uint8_t ts_nr,
512 template (value) uint8_t block_nr,
513 template (value) uint32_t fn,
514 template (value) uint16_t arfcn,
515 template (value) PCUIF_Sapi sapi,
516 template (value) octetstring data) := {
517 msg_type := PCU_IF_MSG_DATA_CNF,
518 bts_nr := bts_nr,
519 spare := '0000'O,
520 u := {
521 data_cnf := {
522 sapi := sapi,
523 len := 0, /* overwritten */
524 data := data,
525 fn := fn,
526 arfcn := arfcn,
527 trx_nr := trx_nr,
528 ts_nr := ts_nr,
529 block_nr := block_nr,
530 rssi := 0,
531 ber10k := 0,
532 ta_offs_qbits := 0,
533 lqual_cb := 0
534 }
535 }
536}
Harald Welte883340c2018-02-28 18:59:29 +0100537template PCUIF_Message tr_PCUIF_DATA_CNF(template uint8_t bts_nr := ?,
538 template uint8_t trx_nr := ?,
539 template uint8_t ts_nr := ?,
540 template PCUIF_Sapi sapi := ?,
541 template octetstring data := ?) := {
542 msg_type := PCU_IF_MSG_DATA_CNF,
543 bts_nr := bts_nr,
544 spare := ?,
545 u := {
546 data_cnf := {
547 sapi := sapi,
548 len := ?,
549 data := data,
550 fn := ?,
551 arfcn := ?,
552 trx_nr := trx_nr,
553 ts_nr := ts_nr,
554 block_nr := ?,
555 rssi := ?,
556 ber10k := ?,
557 ta_offs_qbits := ?,
558 lqual_cb := ?
559 }
560 }
561}
562
Harald Weltee1fd9162019-02-18 19:47:53 +0100563template (value) PCUIF_Message ts_PCUIF_RACH_IND(template (value) uint8_t bts_nr,
564 template (value) uint16_t ra,
565 template (value) uint8_t is_11bit,
Harald Welte913bbf62019-03-01 00:39:19 +0100566 template (value) PCUIF_BurstType burst_type,
Harald Weltee1fd9162019-02-18 19:47:53 +0100567 template (value) uint32_t fn,
568 template (value) uint16_t arfcn,
569 template (value) int16_t qta := 0
570) := {
571 msg_type := PCU_IF_MSG_RACH_IND,
572 bts_nr := bts_nr,
573 spare := '0000'O,
574 u := {
575 rach_ind := {
576 sapi := PCU_IF_SAPI_RACH,
577 ra := ra,
578 qta := qta,
579 fn := fn,
580 arfcn := arfcn,
581 is_11bit := is_11bit,
582 burst_type := burst_type
583 }
584 }
585}
Harald Welte883340c2018-02-28 18:59:29 +0100586template PCUIF_Message tr_PCUIF_RACH_IND(template uint8_t bts_nr := ?,
587 template uint16_t ra := ?,
588 template uint8_t is_11bit := ?,
Harald Welte913bbf62019-03-01 00:39:19 +0100589 template PCUIF_BurstType burst_type := ?,
Harald Welte883340c2018-02-28 18:59:29 +0100590 template uint32_t fn := ?) := {
591 msg_type := PCU_IF_MSG_RACH_IND,
592 bts_nr := bts_nr,
593 spare := ?,
594 u := {
595 rach_ind := {
596 sapi := PCU_IF_SAPI_RACH,
597 ra := ra,
598 qta := ?,
599 fn := fn,
600 arfcn := ?,
601 is_11bit := is_11bit,
602 burst_type := burst_type
603 }
604 }
605}
606
Harald Weltee1fd9162019-02-18 19:47:53 +0100607template (value) PCUIF_Message ts_PCUIF_PAG_REQ(template (value) uint8_t bts_nr,
608 template (value) OCT9 id_lv,
609 template (value) uint8_t chan_needed,
610 template (value) PCUIF_Sapi sapi) := {
611 msg_type := PCU_IF_MSG_PAG_REQ,
612 bts_nr := bts_nr,
613 spare := '0000'O,
614 u := {
615 pag_req := {
616 sapi := sapi,
617 chan_needed := chan_needed,
618 identity_lv := id_lv
619 }
620 }
621}
Harald Welte883340c2018-02-28 18:59:29 +0100622template PCUIF_Message tr_PCUIF_PAG_REQ(template uint8_t bts_nr := ?,
623 template OCT9 id_lv := ?,
624 template uint8_t chan_needed := ?,
625 template PCUIF_Sapi sapi := ?) := {
626 msg_type := PCU_IF_MSG_PAG_REQ,
627 bts_nr := bts_nr,
628 spare := ?,
629 u := {
630 pag_req := {
631 sapi := ?,
632 chan_needed := chan_needed,
633 identity_lv := id_lv
634 }
635 }
636}
637
Harald Weltee1fd9162019-02-18 19:47:53 +0100638const PCUIF_Flags c_PCUIF_Flags_default := {
639 bts_active := true,
640 sysmo_direct_dsp := false,
641 spare := '00000000000000'B,
642 cs1 := true,
643 cs2 := true,
644 cs3 := true,
645 cs4 := true,
646 mcs1 := true,
647 mcs2 := true,
648 mcs3 := true,
649 mcs4 := true,
650 mcs5 := true,
651 mcs6 := true,
652 mcs7 := true,
653 mcs8 := true,
654 mcs9 := true,
655 spare2 := '000'B
656};
657
658template (value) PCUIF_InfoTrx ts_PCUIF_InfoTrx(template (value) uint16_t arfcn := 871,
659 template (value) BIT8 pdch_mask := '00000001'B,
660 OCT1 tsc := '07'O) := {
661 arfcn := arfcn,
662 pdch_mask := pdch_mask,
663 spare := '00'O,
664 tsc := tsc & tsc & tsc & tsc & tsc & tsc & tsc & tsc,
665 hLayer1 := 0
666}
667
668template (value) PCUIF_InfoTrx ts_PCUIF_InfoTrxNULL := ts_PCUIF_InfoTrx(0, '00000000'B, '00'O);
669
670template (value) PCUIF_InfoTrxs ts_PCUIF_InfoTrxs_def := {
671 ts_PCUIF_InfoTrx, ts_PCUIF_InfoTrxNULL, ts_PCUIF_InfoTrxNULL, ts_PCUIF_InfoTrxNULL,
672 ts_PCUIF_InfoTrxNULL, ts_PCUIF_InfoTrxNULL, ts_PCUIF_InfoTrxNULL, ts_PCUIF_InfoTrxNULL };
673
674
675template (value) PCUIF_Message ts_PCUIF_INFO_IND(template (value) uint8_t bts_nr,
676 template (value) uint16_t nsei,
677 template (value) uint16_t nsvci,
678 template (value) uint16_t bvci,
679 template (value) uint16_t local_port,
680 template (value) uint16_t remote_port,
Harald Welte07e8dde2019-02-18 20:38:45 +0100681 template (value) OCT4 remote_ip,
Harald Weltee1fd9162019-02-18 19:47:53 +0100682 template (value) PCUIF_Flags flags := c_PCUIF_Flags_default,
683 template (value) uint16_t mcc := 262,
684 template (value) uint16_t mnc := 42,
Harald Weltef12b5a42019-03-21 19:50:21 +0100685 template (value) uint16_t lac := 13135,
Harald Weltee1fd9162019-02-18 19:47:53 +0100686 template (value) uint8_t rac := 0,
Harald Weltef12b5a42019-03-21 19:50:21 +0100687 template (value) uint16_t cell_id := 20960,
Harald Weltee1fd9162019-02-18 19:47:53 +0100688 template (value) uint8_t bsic := 7,
689 template (value) PCUIF_InfoTrxs trx := ts_PCUIF_InfoTrxs_def,
690 template (value) uint32_t version := PCU_IF_VERSION) := {
691 msg_type := PCU_IF_MSG_INFO_IND,
692 bts_nr := bts_nr,
693 spare := '0000'O,
694 u := {
695 info_ind := {
696 version := version,
697 flags := flags,
698 trx := trx,
699 bsic := bsic,
700 mcc := mcc,
701 mnc := mnc,
702 mnc_3_digits := 0,
703 lac := lac,
704 rac := rac,
705 nsei := nsei,
706 nse_timer := { 3, 3, 3, 3, 30, 3, 10 },
707 cell_timer := { 3, 3, 3, 3, 3, 10, 3, 10, 3, 10, 3 },
708 cell_id := cell_id,
709 repeat_time := 5 * 50,
710 repeat_count := 3,
711 bvci := bvci,
712 t3142 := 20,
713 t3169 := 5,
714 t3191 := 5,
715 t3193_10ms := 160,
716 t3195 := 5,
717 t3101 := 10,
718 t3103 := 4,
719 t3105 := 8,
720 cv_countdown := 15,
721 dl_tbf_ext := 250 * 10, /* ms */
722 ul_tbf_ext := 250 * 10, /* ms */
723 initial_cs := 2,
724 initial_mcs := 6,
725 nsvci := { nsvci, 0 },
726 local_pprt := { local_port, 0 },
727 remote_port := { remote_port, 0 },
Harald Welte07e8dde2019-02-18 20:38:45 +0100728 remote_ip := { remote_ip , '00000000'O }
Harald Weltee1fd9162019-02-18 19:47:53 +0100729 }
730 }
731}
Harald Welted378a252018-03-13 17:02:14 +0100732template PCUIF_Message tr_PCUIF_INFO_IND(template uint8_t bts_nr := ?,
733 template PCUIF_Flags flags := ?,
734 template uint32_t version := PCU_IF_VERSION) := {
735 msg_type := PCU_IF_MSG_INFO_IND,
736 bts_nr := bts_nr,
737 spare := ?,
738 u := {
739 info_ind := {
740 version := version,
741 flags := flags,
742 trx := ?,
743 bsic := ?,
744 mcc := ?,
745 mnc :=?,
Harald Welte3568dc72018-03-13 17:06:51 +0100746 mnc_3_digits := ?,
Harald Welted378a252018-03-13 17:02:14 +0100747 lac := ?,
748 rac := ?,
749 nsei := ?,
750 nse_timer := ?,
751 cell_timer := ?,
752 cell_id := ?,
753 repeat_time := ?,
754 repeat_count := ?,
755 bvci := ?,
756 t3142 := ?,
757 t3169 := ?,
758 t3191 := ?,
759 t3193_10ms := ?,
760 t3195 := ?,
761 t3101 := ?,
762 t3103 := ?,
763 t3105 := ?,
764 cv_countdown := ?,
765 dl_tbf_ext := ?,
766 ul_tbf_ext := ?,
767 initial_cs := ?,
768 initial_mcs := ?,
769 nsvci := ?,
770 local_pprt := ?,
771 remote_port := ?,
772 remote_ip := ?
773 }
774 }
775}
776
Harald Weltea3219812019-03-02 00:02:28 +0100777template (value) PCUIF_Message ts_PCUIF_TIME_IND(template (value) uint8_t bts_nr,
778 template (value) uint32_t fn) := {
779 msg_type := PCU_IF_MSG_TIME_IND,
780 bts_nr := bts_nr,
781 spare := '0000'O,
782 u := {
783 time_ind := {
784 fn := fn
785 }
786 }
787}
788template PCUIF_Message tr_PCUIF_TIME_IND(template uint8_t bts_nr,
789 template uint32_t fn) := {
790 msg_type := PCU_IF_MSG_TIME_IND,
791 bts_nr := bts_nr,
792 spare := ?,
793 u := {
794 time_ind := {
795 fn := fn
796 }
797 }
798}
Harald Welte883340c2018-02-28 18:59:29 +0100799
Harald Welte4bff40a2019-03-21 21:34:10 +0100800template (value) PCUIF_Message ts_PCUIF_SUSP_REQ(template (value) uint8_t bts_nr,
801 template (value) OCT4 tlli,
802 template (value) OCT6 ra_id,
803 template (value) uint8_t cause) := {
804 msg_type := PCU_IF_MSG_SUSP_REQ,
805 bts_nr := bts_nr,
806 spare := '0000'O,
807 u := {
808 susp_req := {
809 tlli := tlli,
810 ra_id := ra_id,
811 cause := cause
812 }
813 }
814}
815template PCUIF_Message tr_PCUIF_SUSP_REQ(template uint8_t bts_nr,
816 template OCT4 tlli,
817 template OCT6 ra_id,
818 template uint8_t cause) := {
819 msg_type := PCU_IF_MSG_SUSP_REQ,
820 bts_nr := bts_nr,
821 spare := '0000'O,
822 u := {
823 susp_req := {
824 tlli := tlli,
825 ra_id := ra_id,
826 cause := cause
827 }
828 }
829}
830
Harald Welte11b734c2019-09-05 14:17:54 +0200831template (value) PCUIF_Message ts_PCUIF_APP_INFO_REQ(template (value) uint8_t bts_nr,
832 template (value) uint8_t app_type,
833 template (value) octetstring app_data) := {
834 msg_type := PCU_IF_MSG_APP_INFO_REQ,
835 bts_nr := bts_nr,
836 spare := '0000'O,
837 u := {
838 app_info_req := {
839 application_type := app_type,
840 len := 0, /* overwritten */
841 data := app_data
842 }
843 }
844}
845template (present) PCUIF_Message tr_PCUIF_APP_INFO_REQ(template (present) uint8_t bts_nr,
846 template (present) uint8_t app_type,
847 template (present) octetstring app_data) := {
848 msg_type := PCU_IF_MSG_APP_INFO_REQ,
849 bts_nr := bts_nr,
850 spare := '0000'O,
851 u := {
852 app_info_req := {
853 application_type := app_type,
854 len := ?,
855 data := app_data
856 }
857 }
858}
859
Harald Welte4bff40a2019-03-21 21:34:10 +0100860
Harald Welte883340c2018-02-28 18:59:29 +0100861} with { encode "RAW" variant "BYTEORDER(first)" };