blob: 132b72df27a3d74190512cc5b4e3c5a128e11fc0 [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),
25 PCU_IF_MSG_RTS_REQ ('10'O),
26 PCU_IF_MSG_DATA_CNF_DT ('11'O),
27 PCU_IF_MSG_RACH_IND ('22'O),
28 PCU_IF_MSG_INFO_IND ('32'O),
29 PCU_IF_MSG_ACT_REQ ('40'O),
30 PCU_IF_MSG_TIME_IND ('52'O),
31 PCU_IF_MSG_PAG_REQ ('60'O),
32 PCU_IF_MSG_TXT_IND ('70'O)
33} with { variant "FIELDLENGTH(8)" };
34
35type enumerated PCUIF_Sapi {
36 PCU_IF_SAPI_UNKNOWN ('00'O),
37 PCU_IF_SAPI_RACH ('01'O),
38 PCU_IF_SAPI_AGCH ('02'O),
39 PCU_IF_SAPI_PCH ('03'O),
40 PCU_IF_SAPI_BCCH ('04'O),
41 PCU_IF_SAPI_PDTCH ('05'O),
42 PCU_IF_SAPI_PRACH ('06'O),
43 PCU_IF_SAPI_PTCCH ('07'O),
44 PCU_IF_SAPI_AGCH_DT ('08'O)
45} with { variant "FIELDLENGTH(8)" };
46
47type record PCUIF_Flags {
48 boolean bts_active,
49 boolean sysmo_direct_dsp,
50 BIT14 spare,
51 boolean cs1,
52 boolean cs2,
53 boolean cs3,
54 boolean cs4,
55 boolean mcs1,
56 boolean mcs2,
57 boolean mcs3,
58 boolean mcs4,
59 boolean mcs5,
60 boolean mcs6,
61 boolean mcs7,
62 boolean mcs8,
63 boolean mcs9,
64 BIT3 spare2
65} with { variant "" };
66
67type enumerated PCUIF_TextType {
68 PCU_VERSION (0),
69 PCU_OML_ALERT (1)
70} with { variant "FIELDLENGTH(8)" };
71
72type charstring PCUIF_Text length(128) with { variant "FIELDLENGTH(128)" };
73
74type record PCUIF_txt_ind {
75 PCUIF_TextType txt_type,
76 PCUIF_Text text
77} with { variant "" };
78
Harald Welte883340c2018-02-28 18:59:29 +010079type record PCUIF_data {
80 PCUIF_Sapi sapi,
81 uint8_t len,
Vadim Yanitskiyc78ea262019-05-17 01:08:08 +070082 octetstring data length(162),
Harald Welte883340c2018-02-28 18:59:29 +010083 uint32_t fn,
84 uint16_t arfcn,
85 uint8_t trx_nr,
86 uint8_t ts_nr,
87 uint8_t block_nr,
88 int8_t rssi,
89 uint16_t ber10k,
90 int16_t ta_offs_qbits,
91 int16_t lqual_cb
Vadim Yanitskiyc78ea262019-05-17 01:08:08 +070092} with { variant (data) "FIELDLENGTH(162), ALIGN(left)" };
Harald Welte883340c2018-02-28 18:59:29 +010093
94type record PCUIF_data_cnf_dt {
95 PCUIF_Sapi sapi,
96 OCT4 tlli,
97 uint32_t fn,
98 uint16_t arfcn,
99 uint8_t trx_nr,
100 uint8_t ts_nr,
101 uint8_t block_nr,
102 int8_t rssi,
103 uint16_t ber10k,
104 int16_t ta_offs_qbits,
105 int16_t lqual_cb
106} with { variant "" };
107
108type record PCUIF_rts_req {
109 PCUIF_Sapi sapi,
110 OCT3 spare,
111 uint32_t fn,
112 uint16_t arfcn,
113 uint8_t trx_nr,
114 uint8_t ts_nr,
115 uint8_t block_nr
116} with { variant "" };
117
Harald Welte913bbf62019-03-01 00:39:19 +0100118type enumerated PCUIF_BurstType {
119 BURST_TYPE_NONE (0),
120 BURST_TYPE_0 (1),
121 BURST_TYPE_1 (2),
122 BURST_TYPE_2 (3)
123} with { variant "FIELDLENGTH(8)" };
124
Harald Welte883340c2018-02-28 18:59:29 +0100125type record PCUIF_rach_ind {
126 PCUIF_Sapi sapi,
127 uint16_t ra,
128 int16_t qta,
129 uint32_t fn,
130 uint16_t arfcn,
131 uint8_t is_11bit,
Harald Welte913bbf62019-03-01 00:39:19 +0100132 PCUIF_BurstType burst_type
Harald Welte883340c2018-02-28 18:59:29 +0100133} with { variant "" };
134
135type record PCUIF_InfoTrx {
136 uint16_t arfcn,
137 BIT8 pdch_mask,
138 OCT1 spare,
139 OCT8 tsc,
140 uint32_t hLayer1
Harald Weltef1486592018-04-04 19:26:41 +0200141} with { variant (pdch_mask) "BITORDER(msb)" };
Harald Weltee1fd9162019-02-18 19:47:53 +0100142type record length(8) of PCUIF_InfoTrx PCUIF_InfoTrxs;
Harald Welte883340c2018-02-28 18:59:29 +0100143
144type record PCUIF_info_ind {
145 uint32_t version,
146 PCUIF_Flags flags,
Harald Weltee1fd9162019-02-18 19:47:53 +0100147 PCUIF_InfoTrxs trx,
Harald Welte883340c2018-02-28 18:59:29 +0100148 uint8_t bsic,
149
150 uint16_t mcc,
151 uint16_t mnc,
Harald Welte3568dc72018-03-13 17:06:51 +0100152 uint8_t mnc_3_digits,
Harald Welte883340c2018-02-28 18:59:29 +0100153 uint16_t lac,
154 uint16_t rac,
155
156 uint16_t nsei,
157 record length(7) of uint8_t nse_timer,
158 record length(11) of uint8_t cell_timer,
159
160 uint16_t cell_id,
161 uint16_t repeat_time,
162 uint8_t repeat_count,
163 uint16_t bvci,
164 uint8_t t3142,
165 uint8_t t3169,
166 uint8_t t3191,
167 uint8_t t3193_10ms,
168 uint8_t t3195,
169 uint8_t t3101,
170 uint8_t t3103,
171 uint8_t t3105,
172 uint8_t cv_countdown,
173 uint16_t dl_tbf_ext,
174 uint16_t ul_tbf_ext,
175 uint8_t initial_cs,
176 uint8_t initial_mcs,
177
178 record length(2) of uint16_t nsvci,
179 record length(2) of uint16_t local_pprt,
180 record length(2) of uint16_t remote_port,
Harald Welte07e8dde2019-02-18 20:38:45 +0100181 record length(2) of OCT4 remote_ip
Harald Welte883340c2018-02-28 18:59:29 +0100182} with { variant "" }
183
184type record PCUIF_act_req {
185 uint8_t is_activate,
186 uint8_t trx_nr,
187 uint8_t ts_nr,
188 OCT1 spare
189} with { variant "" };
190
191type record PCUIF_time_ind {
192 uint32_t fn
193} with { variant "" };
194
195type record PCUIF_pag_req {
196 PCUIF_Sapi sapi,
197 uint8_t chan_needed,
198 OCT9 identity_lv
199} with { variant "" };
200
201type record PCUIF_susp_req {
202 OCT4 tlli,
203 OCT6 ra_id,
204 uint8_t cause
Harald Welteeaa9a862019-05-26 23:01:08 +0200205} with {
206 variant (tlli) "BYTEORDER(last)"
207};
Harald Welte883340c2018-02-28 18:59:29 +0100208
209
210type union PCUIF_MsgUnion {
211 PCUIF_data data_req,
212 PCUIF_data data_cnf,
213 PCUIF_data_cnf_dt data_cnf_dt,
214 PCUIF_data data_ind,
215 PCUIF_susp_req susp_req,
216 PCUIF_rts_req rts_req,
217 PCUIF_rach_ind rach_ind,
218 PCUIF_txt_ind txt_ind,
219 PCUIF_info_ind info_ind,
220 PCUIF_act_req act_req,
221 PCUIF_time_ind time_ind,
222 PCUIF_pag_req pag_req
223} with { variant "" };
224
225type record PCUIF_Message {
226 PCUIF_MsgType msg_type,
227 uint8_t bts_nr,
228 OCT2 spare,
229 PCUIF_MsgUnion u
230} with { variant (u) "CROSSTAG(
231 data_req, msg_type = PCU_IF_MSG_DATA_REQ;
232 data_cnf, msg_type = PCU_IF_MSG_DATA_CNF;
233 data_cnf_dt, msg_type = PCU_IF_MSG_DATA_CNF_DT;
234 data_ind, msg_type = PCU_IF_MSG_DATA_IND;
235 susp_req, msg_type = PCU_IF_MSG_SUSP_REQ;
236 rts_req, msg_type = PCU_IF_MSG_RTS_REQ;
237 rach_ind, msg_type = PCU_IF_MSG_RACH_IND;
238 txt_ind, msg_type = PCU_IF_MSG_TXT_IND;
239 info_ind, msg_type = PCU_IF_MSG_INFO_IND;
240 act_req, msg_type = PCU_IF_MSG_ACT_REQ;
241 time_ind, msg_type = PCU_IF_MSG_TIME_IND;
242 pag_req, msg_type = PCU_IF_MSG_PAG_REQ)"
Harald Welte3568dc72018-03-13 17:06:51 +0100243 variant "PADDING(1696)" /* 212 * 8 */
Harald Welte883340c2018-02-28 18:59:29 +0100244};
245
246external function enc_PCUIF_Message(in PCUIF_Message pdu) return octetstring
247 with { extension "prototype(convert) encode(RAW)" };
248external function dec_PCUIF_Message(in octetstring stream) return PCUIF_Message
249 with { extension "prototype(convert) decode(RAW)" };
250
251
Harald Weltee1fd9162019-02-18 19:47:53 +0100252template (value) PCUIF_Message ts_PCUIF_RTS_REQ(template (value) uint8_t bts_nr,
253 template (value) uint8_t trx_nr,
254 template (value) uint8_t ts_nr,
255 template (value) PCUIF_Sapi sapi,
256 template (value) uint32_t fn,
257 template (value) uint16_t arfcn,
258 template (value) uint8_t block_nr
259 ) := {
260 msg_type := PCU_IF_MSG_RTS_REQ,
261 bts_nr := bts_nr,
262 spare := '0000'O,
263 u := {
264 rts_req := {
265 sapi := sapi,
266 spare := '000000'O,
267 fn := fn,
268 arfcn := arfcn,
269 trx_nr := trx_nr,
270 ts_nr := ts_nr,
271 block_nr := block_nr
272 }
273 }
274}
Harald Welte883340c2018-02-28 18:59:29 +0100275template PCUIF_Message tr_PCUIF_RTS_REQ(template uint8_t bts_nr := ?,
276 template uint8_t trx_nr := ?,
277 template uint8_t ts_nr := ?,
278 template PCUIF_Sapi sapi := ?,
279 template uint32_t fn := ?,
280 template uint8_t block_nr := ?
281 ) := {
282 msg_type := PCU_IF_MSG_RTS_REQ,
283 bts_nr := bts_nr,
284 spare := ?,
285 u := {
286 rts_req := {
287 sapi := sapi,
288 spare := ?,
289 fn := fn,
290 arfcn := ?,
291 trx_nr := trx_nr,
292 ts_nr := ts_nr,
293 block_nr := block_nr
294 }
295 }
296}
297
298template (value) PCUIF_Message ts_PCUIF_TXT_IND(uint8_t bts_nr, PCUIF_TextType tt, charstring text) := {
299 msg_type := PCU_IF_MSG_TXT_IND,
300 bts_nr := bts_nr,
301 spare := '0000'O,
302 u := {
303 txt_ind := {
304 txt_type := tt,
305 text := text
306 }
307 }
308}
Harald Weltee1fd9162019-02-18 19:47:53 +0100309template PCUIF_Message tr_PCUIF_TXT_IND(template uint8_t bts_nr, template PCUIF_TextType tt,
310 template charstring text := ?) := {
311 msg_type := PCU_IF_MSG_TXT_IND,
312 bts_nr := bts_nr,
313 spare := '0000'O,
314 u := {
315 txt_ind := {
316 txt_type := tt,
317 text := text
318 }
319 }
320}
321
322
Harald Welte883340c2018-02-28 18:59:29 +0100323
324template (value) PCUIF_Message ts_PCUIF_ACT_REQ(uint8_t bts_nr, uint8_t trx_nr, uint8_t ts_nr) := {
325 msg_type := PCU_IF_MSG_ACT_REQ,
326 bts_nr := bts_nr,
327 spare := '0000'O,
328 u := {
329 act_req := {
330 is_activate := 1,
331 trx_nr := trx_nr,
332 ts_nr := ts_nr,
333 spare := '00'O
334 }
335 }
336}
Harald Weltee1fd9162019-02-18 19:47:53 +0100337template PCUIF_Message tr_PCUIF_ACT_REQ(template uint8_t bts_nr, template uint8_t trx_nr,
338 template uint8_t ts_nr) := {
339 msg_type := PCU_IF_MSG_ACT_REQ,
340 bts_nr := bts_nr,
341 spare := '0000'O,
342 u := {
343 act_req := {
344 is_activate := 1,
345 trx_nr := trx_nr,
346 ts_nr := ts_nr,
347 spare := '00'O
348 }
349 }
350}
Harald Welte883340c2018-02-28 18:59:29 +0100351
352template (value) PCUIF_Message ts_PCUIF_DEACT_REQ(uint8_t bts_nr, uint8_t trx_nr, uint8_t ts_nr) := {
353 msg_type := PCU_IF_MSG_ACT_REQ,
354 bts_nr := bts_nr,
355 spare := '0000'O,
356 u := {
357 act_req := {
358 is_activate := 0,
359 trx_nr := trx_nr,
360 ts_nr := ts_nr,
361 spare := '00'O
362 }
363 }
364}
Harald Weltee1fd9162019-02-18 19:47:53 +0100365template PCUIF_Message tr_PCUIF_DEACT_REQ(template uint8_t bts_nr, template uint8_t trx_nr,
366 template uint8_t ts_nr) := {
367 msg_type := PCU_IF_MSG_ACT_REQ,
368 bts_nr := bts_nr,
369 spare := '0000'O,
370 u := {
371 act_req := {
372 is_activate := 0,
373 trx_nr := trx_nr,
374 ts_nr := ts_nr,
375 spare := '00'O
376 }
377 }
378}
Harald Welte883340c2018-02-28 18:59:29 +0100379
Harald Weltee1fd9162019-02-18 19:47:53 +0100380template (value) PCUIF_Message ts_PCUIF_DATA_IND(template (value) uint8_t bts_nr,
381 template (value) uint8_t trx_nr,
382 template (value) uint8_t ts_nr,
383 template (value) uint8_t block_nr,
384 template (value) PCUIF_Sapi sapi,
Vadim Yanitskiyc78ea262019-05-17 01:08:08 +0700385 template (value) octetstring data,
Harald Weltee1fd9162019-02-18 19:47:53 +0100386 template (value) uint32_t fn,
387 template (value) uint16_t arfcn,
388 template (value) int8_t rssi := -80,
389 template (value) uint16_t ber10k := 0,
390 template (value) int16_t ta_offs_qbits := 0,
391 template (value) uint16_t lqual_cb := 10) := {
392 msg_type := PCU_IF_MSG_DATA_IND,
393 bts_nr := bts_nr,
394 spare := '0000'O,
395 u := {
396 data_ind := {
397 sapi := sapi,
398 len := lengthof(valueof(data)),
399 data := data,
400 fn := fn,
401 arfcn := arfcn,
402 trx_nr := trx_nr,
403 ts_nr := ts_nr,
404 block_nr := block_nr,
405 rssi := rssi,
406 ber10k := ber10k,
407 ta_offs_qbits := ta_offs_qbits,
408 lqual_cb := lqual_cb
409 }
410 }
411}
Harald Welte883340c2018-02-28 18:59:29 +0100412template PCUIF_Message tr_PCUIF_DATA_IND(template uint8_t bts_nr := ?,
413 template uint8_t trx_nr := ?,
414 template uint8_t ts_nr := ?,
415 template uint8_t block_nr := ?,
416 template PCUIF_Sapi sapi := ?,
Vadim Yanitskiyc78ea262019-05-17 01:08:08 +0700417 template octetstring data := ?) := {
Harald Welte883340c2018-02-28 18:59:29 +0100418 msg_type := PCU_IF_MSG_DATA_IND,
419 bts_nr := bts_nr,
420 spare := ?,
421 u := {
422 data_ind := {
423 sapi := sapi,
424 len := ?,
425 data := data,
426 fn := ?,
427 arfcn := ?,
428 trx_nr := trx_nr,
429 ts_nr := ts_nr,
430 block_nr := block_nr,
431 rssi := ?,
432 ber10k := ?,
433 ta_offs_qbits := ?,
434 lqual_cb := ?
435 }
436 }
437}
438
439template (value) PCUIF_Message ts_PCUIF_DATA_REQ(uint8_t bts_nr, uint8_t trx_nr,
440 uint8_t ts_nr, uint8_t block_nr,
441 uint32_t fn, PCUIF_Sapi sapi,
442 octetstring data) := {
443 msg_type := PCU_IF_MSG_DATA_REQ,
444 bts_nr := bts_nr,
445 spare := '0000'O,
446 u := {
447 data_req := {
448 sapi := sapi,
449 len := lengthof(data),
450 data := data,
451 fn := fn,
452 arfcn := 0, /* unused in BTS */
453 trx_nr := trx_nr,
454 ts_nr := ts_nr,
455 block_nr := block_nr,
456 /* measurement parameters below unused on Tx */
457 rssi := 0,
458 ber10k := 0,
459 ta_offs_qbits := 0,
460 lqual_cb := 0
461 }
462 }
463}
Harald Weltee1fd9162019-02-18 19:47:53 +0100464template PCUIF_Message tr_PCUIF_DATA_REQ(template uint8_t bts_nr,
465 template uint8_t trx_nr,
466 template uint8_t ts_nr,
467 template uint8_t block_nr := ?,
468 template uint32_t fn := ?,
469 template PCUIF_Sapi sapi := ?,
470 template octetstring data := ?) := {
471 msg_type := PCU_IF_MSG_DATA_REQ,
472 bts_nr := bts_nr,
473 spare := '0000'O,
474 u := {
475 data_req := {
476 sapi := sapi,
477 len := ?,
478 data := data,
479 fn := fn,
Harald Welte0a3d63f2019-03-02 00:02:07 +0100480 arfcn := ?, /* unused in BTS */
Harald Weltee1fd9162019-02-18 19:47:53 +0100481 trx_nr := trx_nr,
482 ts_nr := ts_nr,
483 block_nr := block_nr,
484 /* measurement parameters below unused on Tx */
485 rssi := 0,
486 ber10k := 0,
487 ta_offs_qbits := 0,
488 lqual_cb := 0
489 }
490 }
491}
Harald Welte883340c2018-02-28 18:59:29 +0100492
Harald Weltee1fd9162019-02-18 19:47:53 +0100493template (value) PCUIF_Message ts_PCUIF_DATA_CNF(template (value) uint8_t bts_nr,
494 template (value) uint8_t trx_nr,
495 template (value) uint8_t ts_nr,
496 template (value) uint8_t block_nr,
497 template (value) uint32_t fn,
498 template (value) uint16_t arfcn,
499 template (value) PCUIF_Sapi sapi,
500 template (value) octetstring data) := {
501 msg_type := PCU_IF_MSG_DATA_CNF,
502 bts_nr := bts_nr,
503 spare := '0000'O,
504 u := {
505 data_cnf := {
506 sapi := sapi,
507 len := 0, /* overwritten */
508 data := data,
509 fn := fn,
510 arfcn := arfcn,
511 trx_nr := trx_nr,
512 ts_nr := ts_nr,
513 block_nr := block_nr,
514 rssi := 0,
515 ber10k := 0,
516 ta_offs_qbits := 0,
517 lqual_cb := 0
518 }
519 }
520}
Harald Welte883340c2018-02-28 18:59:29 +0100521template PCUIF_Message tr_PCUIF_DATA_CNF(template uint8_t bts_nr := ?,
522 template uint8_t trx_nr := ?,
523 template uint8_t ts_nr := ?,
524 template PCUIF_Sapi sapi := ?,
525 template octetstring data := ?) := {
526 msg_type := PCU_IF_MSG_DATA_CNF,
527 bts_nr := bts_nr,
528 spare := ?,
529 u := {
530 data_cnf := {
531 sapi := sapi,
532 len := ?,
533 data := data,
534 fn := ?,
535 arfcn := ?,
536 trx_nr := trx_nr,
537 ts_nr := ts_nr,
538 block_nr := ?,
539 rssi := ?,
540 ber10k := ?,
541 ta_offs_qbits := ?,
542 lqual_cb := ?
543 }
544 }
545}
546
Harald Weltee1fd9162019-02-18 19:47:53 +0100547template (value) PCUIF_Message ts_PCUIF_RACH_IND(template (value) uint8_t bts_nr,
548 template (value) uint16_t ra,
549 template (value) uint8_t is_11bit,
Harald Welte913bbf62019-03-01 00:39:19 +0100550 template (value) PCUIF_BurstType burst_type,
Harald Weltee1fd9162019-02-18 19:47:53 +0100551 template (value) uint32_t fn,
552 template (value) uint16_t arfcn,
553 template (value) int16_t qta := 0
554) := {
555 msg_type := PCU_IF_MSG_RACH_IND,
556 bts_nr := bts_nr,
557 spare := '0000'O,
558 u := {
559 rach_ind := {
560 sapi := PCU_IF_SAPI_RACH,
561 ra := ra,
562 qta := qta,
563 fn := fn,
564 arfcn := arfcn,
565 is_11bit := is_11bit,
566 burst_type := burst_type
567 }
568 }
569}
Harald Welte883340c2018-02-28 18:59:29 +0100570template PCUIF_Message tr_PCUIF_RACH_IND(template uint8_t bts_nr := ?,
571 template uint16_t ra := ?,
572 template uint8_t is_11bit := ?,
Harald Welte913bbf62019-03-01 00:39:19 +0100573 template PCUIF_BurstType burst_type := ?,
Harald Welte883340c2018-02-28 18:59:29 +0100574 template uint32_t fn := ?) := {
575 msg_type := PCU_IF_MSG_RACH_IND,
576 bts_nr := bts_nr,
577 spare := ?,
578 u := {
579 rach_ind := {
580 sapi := PCU_IF_SAPI_RACH,
581 ra := ra,
582 qta := ?,
583 fn := fn,
584 arfcn := ?,
585 is_11bit := is_11bit,
586 burst_type := burst_type
587 }
588 }
589}
590
Harald Weltee1fd9162019-02-18 19:47:53 +0100591template (value) PCUIF_Message ts_PCUIF_PAG_REQ(template (value) uint8_t bts_nr,
592 template (value) OCT9 id_lv,
593 template (value) uint8_t chan_needed,
594 template (value) PCUIF_Sapi sapi) := {
595 msg_type := PCU_IF_MSG_PAG_REQ,
596 bts_nr := bts_nr,
597 spare := '0000'O,
598 u := {
599 pag_req := {
600 sapi := sapi,
601 chan_needed := chan_needed,
602 identity_lv := id_lv
603 }
604 }
605}
Harald Welte883340c2018-02-28 18:59:29 +0100606template PCUIF_Message tr_PCUIF_PAG_REQ(template uint8_t bts_nr := ?,
607 template OCT9 id_lv := ?,
608 template uint8_t chan_needed := ?,
609 template PCUIF_Sapi sapi := ?) := {
610 msg_type := PCU_IF_MSG_PAG_REQ,
611 bts_nr := bts_nr,
612 spare := ?,
613 u := {
614 pag_req := {
615 sapi := ?,
616 chan_needed := chan_needed,
617 identity_lv := id_lv
618 }
619 }
620}
621
Harald Weltee1fd9162019-02-18 19:47:53 +0100622const PCUIF_Flags c_PCUIF_Flags_default := {
623 bts_active := true,
624 sysmo_direct_dsp := false,
625 spare := '00000000000000'B,
626 cs1 := true,
627 cs2 := true,
628 cs3 := true,
629 cs4 := true,
630 mcs1 := true,
631 mcs2 := true,
632 mcs3 := true,
633 mcs4 := true,
634 mcs5 := true,
635 mcs6 := true,
636 mcs7 := true,
637 mcs8 := true,
638 mcs9 := true,
639 spare2 := '000'B
640};
641
642template (value) PCUIF_InfoTrx ts_PCUIF_InfoTrx(template (value) uint16_t arfcn := 871,
643 template (value) BIT8 pdch_mask := '00000001'B,
644 OCT1 tsc := '07'O) := {
645 arfcn := arfcn,
646 pdch_mask := pdch_mask,
647 spare := '00'O,
648 tsc := tsc & tsc & tsc & tsc & tsc & tsc & tsc & tsc,
649 hLayer1 := 0
650}
651
652template (value) PCUIF_InfoTrx ts_PCUIF_InfoTrxNULL := ts_PCUIF_InfoTrx(0, '00000000'B, '00'O);
653
654template (value) PCUIF_InfoTrxs ts_PCUIF_InfoTrxs_def := {
655 ts_PCUIF_InfoTrx, ts_PCUIF_InfoTrxNULL, ts_PCUIF_InfoTrxNULL, ts_PCUIF_InfoTrxNULL,
656 ts_PCUIF_InfoTrxNULL, ts_PCUIF_InfoTrxNULL, ts_PCUIF_InfoTrxNULL, ts_PCUIF_InfoTrxNULL };
657
658
659template (value) PCUIF_Message ts_PCUIF_INFO_IND(template (value) uint8_t bts_nr,
660 template (value) uint16_t nsei,
661 template (value) uint16_t nsvci,
662 template (value) uint16_t bvci,
663 template (value) uint16_t local_port,
664 template (value) uint16_t remote_port,
Harald Welte07e8dde2019-02-18 20:38:45 +0100665 template (value) OCT4 remote_ip,
Harald Weltee1fd9162019-02-18 19:47:53 +0100666 template (value) PCUIF_Flags flags := c_PCUIF_Flags_default,
667 template (value) uint16_t mcc := 262,
668 template (value) uint16_t mnc := 42,
Harald Weltef12b5a42019-03-21 19:50:21 +0100669 template (value) uint16_t lac := 13135,
Harald Weltee1fd9162019-02-18 19:47:53 +0100670 template (value) uint8_t rac := 0,
Harald Weltef12b5a42019-03-21 19:50:21 +0100671 template (value) uint16_t cell_id := 20960,
Harald Weltee1fd9162019-02-18 19:47:53 +0100672 template (value) uint8_t bsic := 7,
673 template (value) PCUIF_InfoTrxs trx := ts_PCUIF_InfoTrxs_def,
674 template (value) uint32_t version := PCU_IF_VERSION) := {
675 msg_type := PCU_IF_MSG_INFO_IND,
676 bts_nr := bts_nr,
677 spare := '0000'O,
678 u := {
679 info_ind := {
680 version := version,
681 flags := flags,
682 trx := trx,
683 bsic := bsic,
684 mcc := mcc,
685 mnc := mnc,
686 mnc_3_digits := 0,
687 lac := lac,
688 rac := rac,
689 nsei := nsei,
690 nse_timer := { 3, 3, 3, 3, 30, 3, 10 },
691 cell_timer := { 3, 3, 3, 3, 3, 10, 3, 10, 3, 10, 3 },
692 cell_id := cell_id,
693 repeat_time := 5 * 50,
694 repeat_count := 3,
695 bvci := bvci,
696 t3142 := 20,
697 t3169 := 5,
698 t3191 := 5,
699 t3193_10ms := 160,
700 t3195 := 5,
701 t3101 := 10,
702 t3103 := 4,
703 t3105 := 8,
704 cv_countdown := 15,
705 dl_tbf_ext := 250 * 10, /* ms */
706 ul_tbf_ext := 250 * 10, /* ms */
707 initial_cs := 2,
708 initial_mcs := 6,
709 nsvci := { nsvci, 0 },
710 local_pprt := { local_port, 0 },
711 remote_port := { remote_port, 0 },
Harald Welte07e8dde2019-02-18 20:38:45 +0100712 remote_ip := { remote_ip , '00000000'O }
Harald Weltee1fd9162019-02-18 19:47:53 +0100713 }
714 }
715}
Harald Welted378a252018-03-13 17:02:14 +0100716template PCUIF_Message tr_PCUIF_INFO_IND(template uint8_t bts_nr := ?,
717 template PCUIF_Flags flags := ?,
718 template uint32_t version := PCU_IF_VERSION) := {
719 msg_type := PCU_IF_MSG_INFO_IND,
720 bts_nr := bts_nr,
721 spare := ?,
722 u := {
723 info_ind := {
724 version := version,
725 flags := flags,
726 trx := ?,
727 bsic := ?,
728 mcc := ?,
729 mnc :=?,
Harald Welte3568dc72018-03-13 17:06:51 +0100730 mnc_3_digits := ?,
Harald Welted378a252018-03-13 17:02:14 +0100731 lac := ?,
732 rac := ?,
733 nsei := ?,
734 nse_timer := ?,
735 cell_timer := ?,
736 cell_id := ?,
737 repeat_time := ?,
738 repeat_count := ?,
739 bvci := ?,
740 t3142 := ?,
741 t3169 := ?,
742 t3191 := ?,
743 t3193_10ms := ?,
744 t3195 := ?,
745 t3101 := ?,
746 t3103 := ?,
747 t3105 := ?,
748 cv_countdown := ?,
749 dl_tbf_ext := ?,
750 ul_tbf_ext := ?,
751 initial_cs := ?,
752 initial_mcs := ?,
753 nsvci := ?,
754 local_pprt := ?,
755 remote_port := ?,
756 remote_ip := ?
757 }
758 }
759}
760
Harald Weltea3219812019-03-02 00:02:28 +0100761template (value) PCUIF_Message ts_PCUIF_TIME_IND(template (value) uint8_t bts_nr,
762 template (value) uint32_t fn) := {
763 msg_type := PCU_IF_MSG_TIME_IND,
764 bts_nr := bts_nr,
765 spare := '0000'O,
766 u := {
767 time_ind := {
768 fn := fn
769 }
770 }
771}
772template PCUIF_Message tr_PCUIF_TIME_IND(template uint8_t bts_nr,
773 template uint32_t fn) := {
774 msg_type := PCU_IF_MSG_TIME_IND,
775 bts_nr := bts_nr,
776 spare := ?,
777 u := {
778 time_ind := {
779 fn := fn
780 }
781 }
782}
Harald Welte883340c2018-02-28 18:59:29 +0100783
Harald Welte4bff40a2019-03-21 21:34:10 +0100784template (value) PCUIF_Message ts_PCUIF_SUSP_REQ(template (value) uint8_t bts_nr,
785 template (value) OCT4 tlli,
786 template (value) OCT6 ra_id,
787 template (value) uint8_t cause) := {
788 msg_type := PCU_IF_MSG_SUSP_REQ,
789 bts_nr := bts_nr,
790 spare := '0000'O,
791 u := {
792 susp_req := {
793 tlli := tlli,
794 ra_id := ra_id,
795 cause := cause
796 }
797 }
798}
799template PCUIF_Message tr_PCUIF_SUSP_REQ(template uint8_t bts_nr,
800 template OCT4 tlli,
801 template OCT6 ra_id,
802 template uint8_t cause) := {
803 msg_type := PCU_IF_MSG_SUSP_REQ,
804 bts_nr := bts_nr,
805 spare := '0000'O,
806 u := {
807 susp_req := {
808 tlli := tlli,
809 ra_id := ra_id,
810 cause := cause
811 }
812 }
813}
814
815
Harald Welte883340c2018-02-28 18:59:29 +0100816} with { encode "RAW" variant "BYTEORDER(first)" };