blob: f13a7645c35fb397783c6e7316a7115e6e714b7f [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
Harald Weltee1fd9162019-02-18 19:47:53 +0100263template (value) PCUIF_Message ts_PCUIF_RTS_REQ(template (value) uint8_t bts_nr,
264 template (value) uint8_t trx_nr,
265 template (value) uint8_t ts_nr,
266 template (value) PCUIF_Sapi sapi,
267 template (value) uint32_t fn,
268 template (value) uint16_t arfcn,
269 template (value) uint8_t block_nr
270 ) := {
271 msg_type := PCU_IF_MSG_RTS_REQ,
272 bts_nr := bts_nr,
273 spare := '0000'O,
274 u := {
275 rts_req := {
276 sapi := sapi,
277 spare := '000000'O,
278 fn := fn,
279 arfcn := arfcn,
280 trx_nr := trx_nr,
281 ts_nr := ts_nr,
282 block_nr := block_nr
283 }
284 }
285}
Harald Welte883340c2018-02-28 18:59:29 +0100286template PCUIF_Message tr_PCUIF_RTS_REQ(template uint8_t bts_nr := ?,
287 template uint8_t trx_nr := ?,
288 template uint8_t ts_nr := ?,
289 template PCUIF_Sapi sapi := ?,
290 template uint32_t fn := ?,
291 template uint8_t block_nr := ?
292 ) := {
293 msg_type := PCU_IF_MSG_RTS_REQ,
294 bts_nr := bts_nr,
295 spare := ?,
296 u := {
297 rts_req := {
298 sapi := sapi,
299 spare := ?,
300 fn := fn,
301 arfcn := ?,
302 trx_nr := trx_nr,
303 ts_nr := ts_nr,
304 block_nr := block_nr
305 }
306 }
307}
308
309template (value) PCUIF_Message ts_PCUIF_TXT_IND(uint8_t bts_nr, PCUIF_TextType tt, charstring text) := {
310 msg_type := PCU_IF_MSG_TXT_IND,
311 bts_nr := bts_nr,
312 spare := '0000'O,
313 u := {
314 txt_ind := {
315 txt_type := tt,
316 text := text
317 }
318 }
319}
Harald Weltee1fd9162019-02-18 19:47:53 +0100320template PCUIF_Message tr_PCUIF_TXT_IND(template uint8_t bts_nr, template PCUIF_TextType tt,
321 template charstring text := ?) := {
322 msg_type := PCU_IF_MSG_TXT_IND,
323 bts_nr := bts_nr,
324 spare := '0000'O,
325 u := {
326 txt_ind := {
327 txt_type := tt,
328 text := text
329 }
330 }
331}
332
333
Harald Welte883340c2018-02-28 18:59:29 +0100334
335template (value) PCUIF_Message ts_PCUIF_ACT_REQ(uint8_t bts_nr, uint8_t trx_nr, uint8_t ts_nr) := {
336 msg_type := PCU_IF_MSG_ACT_REQ,
337 bts_nr := bts_nr,
338 spare := '0000'O,
339 u := {
340 act_req := {
341 is_activate := 1,
342 trx_nr := trx_nr,
343 ts_nr := ts_nr,
344 spare := '00'O
345 }
346 }
347}
Harald Weltee1fd9162019-02-18 19:47:53 +0100348template PCUIF_Message tr_PCUIF_ACT_REQ(template uint8_t bts_nr, template uint8_t trx_nr,
349 template uint8_t ts_nr) := {
350 msg_type := PCU_IF_MSG_ACT_REQ,
351 bts_nr := bts_nr,
352 spare := '0000'O,
353 u := {
354 act_req := {
355 is_activate := 1,
356 trx_nr := trx_nr,
357 ts_nr := ts_nr,
358 spare := '00'O
359 }
360 }
361}
Harald Welte883340c2018-02-28 18:59:29 +0100362
363template (value) PCUIF_Message ts_PCUIF_DEACT_REQ(uint8_t bts_nr, uint8_t trx_nr, uint8_t ts_nr) := {
364 msg_type := PCU_IF_MSG_ACT_REQ,
365 bts_nr := bts_nr,
366 spare := '0000'O,
367 u := {
368 act_req := {
369 is_activate := 0,
370 trx_nr := trx_nr,
371 ts_nr := ts_nr,
372 spare := '00'O
373 }
374 }
375}
Harald Weltee1fd9162019-02-18 19:47:53 +0100376template PCUIF_Message tr_PCUIF_DEACT_REQ(template uint8_t bts_nr, template uint8_t trx_nr,
377 template uint8_t ts_nr) := {
378 msg_type := PCU_IF_MSG_ACT_REQ,
379 bts_nr := bts_nr,
380 spare := '0000'O,
381 u := {
382 act_req := {
383 is_activate := 0,
384 trx_nr := trx_nr,
385 ts_nr := ts_nr,
386 spare := '00'O
387 }
388 }
389}
Harald Welte883340c2018-02-28 18:59:29 +0100390
Harald Weltee1fd9162019-02-18 19:47:53 +0100391template (value) PCUIF_Message ts_PCUIF_DATA_IND(template (value) uint8_t bts_nr,
392 template (value) uint8_t trx_nr,
393 template (value) uint8_t ts_nr,
394 template (value) uint8_t block_nr,
395 template (value) PCUIF_Sapi sapi,
Vadim Yanitskiyc78ea262019-05-17 01:08:08 +0700396 template (value) octetstring data,
Harald Weltee1fd9162019-02-18 19:47:53 +0100397 template (value) uint32_t fn,
398 template (value) uint16_t arfcn,
399 template (value) int8_t rssi := -80,
400 template (value) uint16_t ber10k := 0,
401 template (value) int16_t ta_offs_qbits := 0,
402 template (value) uint16_t lqual_cb := 10) := {
403 msg_type := PCU_IF_MSG_DATA_IND,
404 bts_nr := bts_nr,
405 spare := '0000'O,
406 u := {
407 data_ind := {
408 sapi := sapi,
409 len := lengthof(valueof(data)),
410 data := data,
411 fn := fn,
412 arfcn := arfcn,
413 trx_nr := trx_nr,
414 ts_nr := ts_nr,
415 block_nr := block_nr,
416 rssi := rssi,
417 ber10k := ber10k,
418 ta_offs_qbits := ta_offs_qbits,
419 lqual_cb := lqual_cb
420 }
421 }
422}
Harald Welte883340c2018-02-28 18:59:29 +0100423template PCUIF_Message tr_PCUIF_DATA_IND(template uint8_t bts_nr := ?,
424 template uint8_t trx_nr := ?,
425 template uint8_t ts_nr := ?,
426 template uint8_t block_nr := ?,
427 template PCUIF_Sapi sapi := ?,
Vadim Yanitskiyc78ea262019-05-17 01:08:08 +0700428 template octetstring data := ?) := {
Harald Welte883340c2018-02-28 18:59:29 +0100429 msg_type := PCU_IF_MSG_DATA_IND,
430 bts_nr := bts_nr,
431 spare := ?,
432 u := {
433 data_ind := {
434 sapi := sapi,
435 len := ?,
436 data := data,
437 fn := ?,
438 arfcn := ?,
439 trx_nr := trx_nr,
440 ts_nr := ts_nr,
441 block_nr := block_nr,
442 rssi := ?,
443 ber10k := ?,
444 ta_offs_qbits := ?,
445 lqual_cb := ?
446 }
447 }
448}
449
450template (value) PCUIF_Message ts_PCUIF_DATA_REQ(uint8_t bts_nr, uint8_t trx_nr,
451 uint8_t ts_nr, uint8_t block_nr,
452 uint32_t fn, PCUIF_Sapi sapi,
453 octetstring data) := {
454 msg_type := PCU_IF_MSG_DATA_REQ,
455 bts_nr := bts_nr,
456 spare := '0000'O,
457 u := {
458 data_req := {
459 sapi := sapi,
460 len := lengthof(data),
461 data := data,
462 fn := fn,
463 arfcn := 0, /* unused in BTS */
464 trx_nr := trx_nr,
465 ts_nr := ts_nr,
466 block_nr := block_nr,
467 /* measurement parameters below unused on Tx */
468 rssi := 0,
469 ber10k := 0,
470 ta_offs_qbits := 0,
471 lqual_cb := 0
472 }
473 }
474}
Harald Weltee1fd9162019-02-18 19:47:53 +0100475template PCUIF_Message tr_PCUIF_DATA_REQ(template uint8_t bts_nr,
476 template uint8_t trx_nr,
477 template uint8_t ts_nr,
478 template uint8_t block_nr := ?,
479 template uint32_t fn := ?,
480 template PCUIF_Sapi sapi := ?,
481 template octetstring data := ?) := {
482 msg_type := PCU_IF_MSG_DATA_REQ,
483 bts_nr := bts_nr,
484 spare := '0000'O,
485 u := {
486 data_req := {
487 sapi := sapi,
488 len := ?,
489 data := data,
490 fn := fn,
Harald Welte0a3d63f2019-03-02 00:02:07 +0100491 arfcn := ?, /* unused in BTS */
Harald Weltee1fd9162019-02-18 19:47:53 +0100492 trx_nr := trx_nr,
493 ts_nr := ts_nr,
494 block_nr := block_nr,
495 /* measurement parameters below unused on Tx */
496 rssi := 0,
497 ber10k := 0,
498 ta_offs_qbits := 0,
499 lqual_cb := 0
500 }
501 }
502}
Harald Welte883340c2018-02-28 18:59:29 +0100503
Harald Weltee1fd9162019-02-18 19:47:53 +0100504template (value) PCUIF_Message ts_PCUIF_DATA_CNF(template (value) uint8_t bts_nr,
505 template (value) uint8_t trx_nr,
506 template (value) uint8_t ts_nr,
507 template (value) uint8_t block_nr,
508 template (value) uint32_t fn,
509 template (value) uint16_t arfcn,
510 template (value) PCUIF_Sapi sapi,
511 template (value) octetstring data) := {
512 msg_type := PCU_IF_MSG_DATA_CNF,
513 bts_nr := bts_nr,
514 spare := '0000'O,
515 u := {
516 data_cnf := {
517 sapi := sapi,
518 len := 0, /* overwritten */
519 data := data,
520 fn := fn,
521 arfcn := arfcn,
522 trx_nr := trx_nr,
523 ts_nr := ts_nr,
524 block_nr := block_nr,
525 rssi := 0,
526 ber10k := 0,
527 ta_offs_qbits := 0,
528 lqual_cb := 0
529 }
530 }
531}
Harald Welte883340c2018-02-28 18:59:29 +0100532template PCUIF_Message tr_PCUIF_DATA_CNF(template uint8_t bts_nr := ?,
533 template uint8_t trx_nr := ?,
534 template uint8_t ts_nr := ?,
535 template PCUIF_Sapi sapi := ?,
536 template octetstring data := ?) := {
537 msg_type := PCU_IF_MSG_DATA_CNF,
538 bts_nr := bts_nr,
539 spare := ?,
540 u := {
541 data_cnf := {
542 sapi := sapi,
543 len := ?,
544 data := data,
545 fn := ?,
546 arfcn := ?,
547 trx_nr := trx_nr,
548 ts_nr := ts_nr,
549 block_nr := ?,
550 rssi := ?,
551 ber10k := ?,
552 ta_offs_qbits := ?,
553 lqual_cb := ?
554 }
555 }
556}
557
Harald Weltee1fd9162019-02-18 19:47:53 +0100558template (value) PCUIF_Message ts_PCUIF_RACH_IND(template (value) uint8_t bts_nr,
559 template (value) uint16_t ra,
560 template (value) uint8_t is_11bit,
Harald Welte913bbf62019-03-01 00:39:19 +0100561 template (value) PCUIF_BurstType burst_type,
Harald Weltee1fd9162019-02-18 19:47:53 +0100562 template (value) uint32_t fn,
563 template (value) uint16_t arfcn,
564 template (value) int16_t qta := 0
565) := {
566 msg_type := PCU_IF_MSG_RACH_IND,
567 bts_nr := bts_nr,
568 spare := '0000'O,
569 u := {
570 rach_ind := {
571 sapi := PCU_IF_SAPI_RACH,
572 ra := ra,
573 qta := qta,
574 fn := fn,
575 arfcn := arfcn,
576 is_11bit := is_11bit,
577 burst_type := burst_type
578 }
579 }
580}
Harald Welte883340c2018-02-28 18:59:29 +0100581template PCUIF_Message tr_PCUIF_RACH_IND(template uint8_t bts_nr := ?,
582 template uint16_t ra := ?,
583 template uint8_t is_11bit := ?,
Harald Welte913bbf62019-03-01 00:39:19 +0100584 template PCUIF_BurstType burst_type := ?,
Harald Welte883340c2018-02-28 18:59:29 +0100585 template uint32_t fn := ?) := {
586 msg_type := PCU_IF_MSG_RACH_IND,
587 bts_nr := bts_nr,
588 spare := ?,
589 u := {
590 rach_ind := {
591 sapi := PCU_IF_SAPI_RACH,
592 ra := ra,
593 qta := ?,
594 fn := fn,
595 arfcn := ?,
596 is_11bit := is_11bit,
597 burst_type := burst_type
598 }
599 }
600}
601
Harald Weltee1fd9162019-02-18 19:47:53 +0100602template (value) PCUIF_Message ts_PCUIF_PAG_REQ(template (value) uint8_t bts_nr,
603 template (value) OCT9 id_lv,
604 template (value) uint8_t chan_needed,
605 template (value) PCUIF_Sapi sapi) := {
606 msg_type := PCU_IF_MSG_PAG_REQ,
607 bts_nr := bts_nr,
608 spare := '0000'O,
609 u := {
610 pag_req := {
611 sapi := sapi,
612 chan_needed := chan_needed,
613 identity_lv := id_lv
614 }
615 }
616}
Harald Welte883340c2018-02-28 18:59:29 +0100617template PCUIF_Message tr_PCUIF_PAG_REQ(template uint8_t bts_nr := ?,
618 template OCT9 id_lv := ?,
619 template uint8_t chan_needed := ?,
620 template PCUIF_Sapi sapi := ?) := {
621 msg_type := PCU_IF_MSG_PAG_REQ,
622 bts_nr := bts_nr,
623 spare := ?,
624 u := {
625 pag_req := {
626 sapi := ?,
627 chan_needed := chan_needed,
628 identity_lv := id_lv
629 }
630 }
631}
632
Harald Weltee1fd9162019-02-18 19:47:53 +0100633const PCUIF_Flags c_PCUIF_Flags_default := {
634 bts_active := true,
635 sysmo_direct_dsp := false,
636 spare := '00000000000000'B,
637 cs1 := true,
638 cs2 := true,
639 cs3 := true,
640 cs4 := true,
641 mcs1 := true,
642 mcs2 := true,
643 mcs3 := true,
644 mcs4 := true,
645 mcs5 := true,
646 mcs6 := true,
647 mcs7 := true,
648 mcs8 := true,
649 mcs9 := true,
650 spare2 := '000'B
651};
652
653template (value) PCUIF_InfoTrx ts_PCUIF_InfoTrx(template (value) uint16_t arfcn := 871,
654 template (value) BIT8 pdch_mask := '00000001'B,
655 OCT1 tsc := '07'O) := {
656 arfcn := arfcn,
657 pdch_mask := pdch_mask,
658 spare := '00'O,
659 tsc := tsc & tsc & tsc & tsc & tsc & tsc & tsc & tsc,
660 hLayer1 := 0
661}
662
663template (value) PCUIF_InfoTrx ts_PCUIF_InfoTrxNULL := ts_PCUIF_InfoTrx(0, '00000000'B, '00'O);
664
665template (value) PCUIF_InfoTrxs ts_PCUIF_InfoTrxs_def := {
666 ts_PCUIF_InfoTrx, ts_PCUIF_InfoTrxNULL, ts_PCUIF_InfoTrxNULL, ts_PCUIF_InfoTrxNULL,
667 ts_PCUIF_InfoTrxNULL, ts_PCUIF_InfoTrxNULL, ts_PCUIF_InfoTrxNULL, ts_PCUIF_InfoTrxNULL };
668
669
670template (value) PCUIF_Message ts_PCUIF_INFO_IND(template (value) uint8_t bts_nr,
671 template (value) uint16_t nsei,
672 template (value) uint16_t nsvci,
673 template (value) uint16_t bvci,
674 template (value) uint16_t local_port,
675 template (value) uint16_t remote_port,
Harald Welte07e8dde2019-02-18 20:38:45 +0100676 template (value) OCT4 remote_ip,
Harald Weltee1fd9162019-02-18 19:47:53 +0100677 template (value) PCUIF_Flags flags := c_PCUIF_Flags_default,
678 template (value) uint16_t mcc := 262,
679 template (value) uint16_t mnc := 42,
Harald Weltef12b5a42019-03-21 19:50:21 +0100680 template (value) uint16_t lac := 13135,
Harald Weltee1fd9162019-02-18 19:47:53 +0100681 template (value) uint8_t rac := 0,
Harald Weltef12b5a42019-03-21 19:50:21 +0100682 template (value) uint16_t cell_id := 20960,
Harald Weltee1fd9162019-02-18 19:47:53 +0100683 template (value) uint8_t bsic := 7,
684 template (value) PCUIF_InfoTrxs trx := ts_PCUIF_InfoTrxs_def,
685 template (value) uint32_t version := PCU_IF_VERSION) := {
686 msg_type := PCU_IF_MSG_INFO_IND,
687 bts_nr := bts_nr,
688 spare := '0000'O,
689 u := {
690 info_ind := {
691 version := version,
692 flags := flags,
693 trx := trx,
694 bsic := bsic,
695 mcc := mcc,
696 mnc := mnc,
697 mnc_3_digits := 0,
698 lac := lac,
699 rac := rac,
700 nsei := nsei,
701 nse_timer := { 3, 3, 3, 3, 30, 3, 10 },
702 cell_timer := { 3, 3, 3, 3, 3, 10, 3, 10, 3, 10, 3 },
703 cell_id := cell_id,
704 repeat_time := 5 * 50,
705 repeat_count := 3,
706 bvci := bvci,
707 t3142 := 20,
708 t3169 := 5,
709 t3191 := 5,
710 t3193_10ms := 160,
711 t3195 := 5,
712 t3101 := 10,
713 t3103 := 4,
714 t3105 := 8,
715 cv_countdown := 15,
716 dl_tbf_ext := 250 * 10, /* ms */
717 ul_tbf_ext := 250 * 10, /* ms */
718 initial_cs := 2,
719 initial_mcs := 6,
720 nsvci := { nsvci, 0 },
721 local_pprt := { local_port, 0 },
722 remote_port := { remote_port, 0 },
Harald Welte07e8dde2019-02-18 20:38:45 +0100723 remote_ip := { remote_ip , '00000000'O }
Harald Weltee1fd9162019-02-18 19:47:53 +0100724 }
725 }
726}
Harald Welted378a252018-03-13 17:02:14 +0100727template PCUIF_Message tr_PCUIF_INFO_IND(template uint8_t bts_nr := ?,
728 template PCUIF_Flags flags := ?,
729 template uint32_t version := PCU_IF_VERSION) := {
730 msg_type := PCU_IF_MSG_INFO_IND,
731 bts_nr := bts_nr,
732 spare := ?,
733 u := {
734 info_ind := {
735 version := version,
736 flags := flags,
737 trx := ?,
738 bsic := ?,
739 mcc := ?,
740 mnc :=?,
Harald Welte3568dc72018-03-13 17:06:51 +0100741 mnc_3_digits := ?,
Harald Welted378a252018-03-13 17:02:14 +0100742 lac := ?,
743 rac := ?,
744 nsei := ?,
745 nse_timer := ?,
746 cell_timer := ?,
747 cell_id := ?,
748 repeat_time := ?,
749 repeat_count := ?,
750 bvci := ?,
751 t3142 := ?,
752 t3169 := ?,
753 t3191 := ?,
754 t3193_10ms := ?,
755 t3195 := ?,
756 t3101 := ?,
757 t3103 := ?,
758 t3105 := ?,
759 cv_countdown := ?,
760 dl_tbf_ext := ?,
761 ul_tbf_ext := ?,
762 initial_cs := ?,
763 initial_mcs := ?,
764 nsvci := ?,
765 local_pprt := ?,
766 remote_port := ?,
767 remote_ip := ?
768 }
769 }
770}
771
Harald Weltea3219812019-03-02 00:02:28 +0100772template (value) PCUIF_Message ts_PCUIF_TIME_IND(template (value) uint8_t bts_nr,
773 template (value) uint32_t fn) := {
774 msg_type := PCU_IF_MSG_TIME_IND,
775 bts_nr := bts_nr,
776 spare := '0000'O,
777 u := {
778 time_ind := {
779 fn := fn
780 }
781 }
782}
783template PCUIF_Message tr_PCUIF_TIME_IND(template uint8_t bts_nr,
784 template uint32_t fn) := {
785 msg_type := PCU_IF_MSG_TIME_IND,
786 bts_nr := bts_nr,
787 spare := ?,
788 u := {
789 time_ind := {
790 fn := fn
791 }
792 }
793}
Harald Welte883340c2018-02-28 18:59:29 +0100794
Harald Welte4bff40a2019-03-21 21:34:10 +0100795template (value) PCUIF_Message ts_PCUIF_SUSP_REQ(template (value) uint8_t bts_nr,
796 template (value) OCT4 tlli,
797 template (value) OCT6 ra_id,
798 template (value) uint8_t cause) := {
799 msg_type := PCU_IF_MSG_SUSP_REQ,
800 bts_nr := bts_nr,
801 spare := '0000'O,
802 u := {
803 susp_req := {
804 tlli := tlli,
805 ra_id := ra_id,
806 cause := cause
807 }
808 }
809}
810template PCUIF_Message tr_PCUIF_SUSP_REQ(template uint8_t bts_nr,
811 template OCT4 tlli,
812 template OCT6 ra_id,
813 template uint8_t cause) := {
814 msg_type := PCU_IF_MSG_SUSP_REQ,
815 bts_nr := bts_nr,
816 spare := '0000'O,
817 u := {
818 susp_req := {
819 tlli := tlli,
820 ra_id := ra_id,
821 cause := cause
822 }
823 }
824}
825
Harald Welte11b734c2019-09-05 14:17:54 +0200826template (value) PCUIF_Message ts_PCUIF_APP_INFO_REQ(template (value) uint8_t bts_nr,
827 template (value) uint8_t app_type,
828 template (value) octetstring app_data) := {
829 msg_type := PCU_IF_MSG_APP_INFO_REQ,
830 bts_nr := bts_nr,
831 spare := '0000'O,
832 u := {
833 app_info_req := {
834 application_type := app_type,
835 len := 0, /* overwritten */
836 data := app_data
837 }
838 }
839}
840template (present) PCUIF_Message tr_PCUIF_APP_INFO_REQ(template (present) uint8_t bts_nr,
841 template (present) uint8_t app_type,
842 template (present) octetstring app_data) := {
843 msg_type := PCU_IF_MSG_APP_INFO_REQ,
844 bts_nr := bts_nr,
845 spare := '0000'O,
846 u := {
847 app_info_req := {
848 application_type := app_type,
849 len := ?,
850 data := app_data
851 }
852 }
853}
854
Harald Welte4bff40a2019-03-21 21:34:10 +0100855
Harald Welte883340c2018-02-28 18:59:29 +0100856} with { encode "RAW" variant "BYTEORDER(first)" };