Harald Welte | 34b5a95 | 2019-05-27 11:54:11 +0200 | [diff] [blame] | 1 | /* 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 Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 12 | module PCUIF_Types { |
| 13 | |
| 14 | import from General_Types all; |
| 15 | import from Osmocom_Types all; |
| 16 | |
Vadim Yanitskiy | c155930 | 2020-07-19 16:39:12 +0700 | [diff] [blame] | 17 | modulepar { |
| 18 | /* PCUIF version supported by the IUT */ |
| 19 | PCUIF_Version mp_pcuif_version := 9; |
| 20 | }; |
| 21 | |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 22 | const charstring PCU_SOCK_DEFAULT := "/tmp/pcu_bts"; |
Vadim Yanitskiy | c155930 | 2020-07-19 16:39:12 +0700 | [diff] [blame] | 23 | type integer PCUIF_Version (9); /* supported versions */ |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 24 | |
| 25 | type enumerated PCUIF_MsgType { |
| 26 | PCU_IF_MSG_DATA_REQ ('00'O), |
| 27 | PCU_IF_MSG_DATA_CNF ('01'O), |
| 28 | PCU_IF_MSG_DATA_IND ('02'O), |
| 29 | PCU_IF_MSG_SUSP_REQ ('03'O), |
Harald Welte | 11b734c | 2019-09-05 14:17:54 +0200 | [diff] [blame] | 30 | PCU_IF_MSG_APP_INFO_REQ ('04'O), |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 31 | PCU_IF_MSG_RTS_REQ ('10'O), |
| 32 | PCU_IF_MSG_DATA_CNF_DT ('11'O), |
| 33 | PCU_IF_MSG_RACH_IND ('22'O), |
| 34 | PCU_IF_MSG_INFO_IND ('32'O), |
| 35 | PCU_IF_MSG_ACT_REQ ('40'O), |
| 36 | PCU_IF_MSG_TIME_IND ('52'O), |
| 37 | PCU_IF_MSG_PAG_REQ ('60'O), |
| 38 | PCU_IF_MSG_TXT_IND ('70'O) |
| 39 | } with { variant "FIELDLENGTH(8)" }; |
| 40 | |
| 41 | type enumerated PCUIF_Sapi { |
| 42 | PCU_IF_SAPI_UNKNOWN ('00'O), |
| 43 | PCU_IF_SAPI_RACH ('01'O), |
| 44 | PCU_IF_SAPI_AGCH ('02'O), |
| 45 | PCU_IF_SAPI_PCH ('03'O), |
| 46 | PCU_IF_SAPI_BCCH ('04'O), |
| 47 | PCU_IF_SAPI_PDTCH ('05'O), |
| 48 | PCU_IF_SAPI_PRACH ('06'O), |
| 49 | PCU_IF_SAPI_PTCCH ('07'O), |
| 50 | PCU_IF_SAPI_AGCH_DT ('08'O) |
| 51 | } with { variant "FIELDLENGTH(8)" }; |
| 52 | |
| 53 | type record PCUIF_Flags { |
| 54 | boolean bts_active, |
| 55 | boolean sysmo_direct_dsp, |
| 56 | BIT14 spare, |
| 57 | boolean cs1, |
| 58 | boolean cs2, |
| 59 | boolean cs3, |
| 60 | boolean cs4, |
| 61 | boolean mcs1, |
| 62 | boolean mcs2, |
| 63 | boolean mcs3, |
| 64 | boolean mcs4, |
| 65 | boolean mcs5, |
| 66 | boolean mcs6, |
| 67 | boolean mcs7, |
| 68 | boolean mcs8, |
| 69 | boolean mcs9, |
| 70 | BIT3 spare2 |
| 71 | } with { variant "" }; |
| 72 | |
| 73 | type enumerated PCUIF_TextType { |
| 74 | PCU_VERSION (0), |
| 75 | PCU_OML_ALERT (1) |
| 76 | } with { variant "FIELDLENGTH(8)" }; |
| 77 | |
Vadim Yanitskiy | e1527f7 | 2019-09-09 02:15:33 +0200 | [diff] [blame] | 78 | type charstring PCUIF_Text length(128) with { variant "FIELDLENGTH(null_terminated)" }; |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 79 | |
| 80 | type record PCUIF_txt_ind { |
| 81 | PCUIF_TextType txt_type, |
| 82 | PCUIF_Text text |
| 83 | } with { variant "" }; |
| 84 | |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 85 | type record PCUIF_data { |
| 86 | PCUIF_Sapi sapi, |
| 87 | uint8_t len, |
Vadim Yanitskiy | d8f28e6 | 2019-09-10 18:11:52 +0200 | [diff] [blame] | 88 | octetstring data length(162), |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 89 | 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 Yanitskiy | d8f28e6 | 2019-09-10 18:11:52 +0200 | [diff] [blame] | 98 | } with { variant (data) "FIELDLENGTH(162), ALIGN(left)" }; |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 99 | |
| 100 | type 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 | |
| 114 | type 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 Welte | 913bbf6 | 2019-03-01 00:39:19 +0100 | [diff] [blame] | 124 | type 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 Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 131 | type 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, |
Vadim Yanitskiy | 36558d9 | 2019-11-17 02:23:51 +0700 | [diff] [blame] | 138 | PCUIF_BurstType burst_type, |
| 139 | uint8_t trx_nr, |
| 140 | uint8_t ts_nr |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 141 | } with { variant "" }; |
| 142 | |
| 143 | type record PCUIF_InfoTrx { |
| 144 | uint16_t arfcn, |
| 145 | BIT8 pdch_mask, |
| 146 | OCT1 spare, |
| 147 | OCT8 tsc, |
| 148 | uint32_t hLayer1 |
Harald Welte | f148659 | 2018-04-04 19:26:41 +0200 | [diff] [blame] | 149 | } with { variant (pdch_mask) "BITORDER(msb)" }; |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 150 | type record length(8) of PCUIF_InfoTrx PCUIF_InfoTrxs; |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 151 | |
| 152 | type record PCUIF_info_ind { |
| 153 | uint32_t version, |
| 154 | PCUIF_Flags flags, |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 155 | PCUIF_InfoTrxs trx, |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 156 | uint8_t bsic, |
| 157 | |
| 158 | uint16_t mcc, |
| 159 | uint16_t mnc, |
Harald Welte | 3568dc7 | 2018-03-13 17:06:51 +0100 | [diff] [blame] | 160 | uint8_t mnc_3_digits, |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 161 | uint16_t lac, |
| 162 | uint16_t rac, |
| 163 | |
| 164 | uint16_t nsei, |
| 165 | record length(7) of uint8_t nse_timer, |
| 166 | record length(11) of uint8_t cell_timer, |
| 167 | |
| 168 | uint16_t cell_id, |
| 169 | uint16_t repeat_time, |
| 170 | uint8_t repeat_count, |
| 171 | uint16_t bvci, |
| 172 | uint8_t t3142, |
| 173 | uint8_t t3169, |
| 174 | uint8_t t3191, |
| 175 | uint8_t t3193_10ms, |
| 176 | uint8_t t3195, |
| 177 | uint8_t t3101, |
| 178 | uint8_t t3103, |
| 179 | uint8_t t3105, |
| 180 | uint8_t cv_countdown, |
| 181 | uint16_t dl_tbf_ext, |
| 182 | uint16_t ul_tbf_ext, |
| 183 | uint8_t initial_cs, |
| 184 | uint8_t initial_mcs, |
| 185 | |
| 186 | record length(2) of uint16_t nsvci, |
| 187 | record length(2) of uint16_t local_pprt, |
| 188 | record length(2) of uint16_t remote_port, |
Harald Welte | 07e8dde | 2019-02-18 20:38:45 +0100 | [diff] [blame] | 189 | record length(2) of OCT4 remote_ip |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 190 | } with { variant "" } |
| 191 | |
| 192 | type record PCUIF_act_req { |
| 193 | uint8_t is_activate, |
| 194 | uint8_t trx_nr, |
| 195 | uint8_t ts_nr, |
| 196 | OCT1 spare |
| 197 | } with { variant "" }; |
| 198 | |
| 199 | type record PCUIF_time_ind { |
| 200 | uint32_t fn |
| 201 | } with { variant "" }; |
| 202 | |
| 203 | type record PCUIF_pag_req { |
| 204 | PCUIF_Sapi sapi, |
| 205 | uint8_t chan_needed, |
| 206 | OCT9 identity_lv |
| 207 | } with { variant "" }; |
| 208 | |
Harald Welte | 11b734c | 2019-09-05 14:17:54 +0200 | [diff] [blame] | 209 | type record PCUIF_app_info_req { |
| 210 | uint8_t application_type, |
| 211 | uint8_t len, |
| 212 | octetstring data |
| 213 | } with { |
| 214 | variant (len) "LENGTHTO(data)" |
| 215 | } |
| 216 | |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 217 | type record PCUIF_susp_req { |
| 218 | OCT4 tlli, |
| 219 | OCT6 ra_id, |
| 220 | uint8_t cause |
Harald Welte | eaa9a86 | 2019-05-26 23:01:08 +0200 | [diff] [blame] | 221 | } with { |
| 222 | variant (tlli) "BYTEORDER(last)" |
| 223 | }; |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 224 | |
| 225 | |
| 226 | type union PCUIF_MsgUnion { |
| 227 | PCUIF_data data_req, |
| 228 | PCUIF_data data_cnf, |
| 229 | PCUIF_data_cnf_dt data_cnf_dt, |
| 230 | PCUIF_data data_ind, |
| 231 | PCUIF_susp_req susp_req, |
| 232 | PCUIF_rts_req rts_req, |
| 233 | PCUIF_rach_ind rach_ind, |
| 234 | PCUIF_txt_ind txt_ind, |
| 235 | PCUIF_info_ind info_ind, |
| 236 | PCUIF_act_req act_req, |
| 237 | PCUIF_time_ind time_ind, |
Harald Welte | 11b734c | 2019-09-05 14:17:54 +0200 | [diff] [blame] | 238 | PCUIF_pag_req pag_req, |
| 239 | PCUIF_app_info_req app_info_req |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 240 | } with { variant "" }; |
| 241 | |
| 242 | type record PCUIF_Message { |
| 243 | PCUIF_MsgType msg_type, |
| 244 | uint8_t bts_nr, |
| 245 | OCT2 spare, |
| 246 | PCUIF_MsgUnion u |
| 247 | } with { variant (u) "CROSSTAG( |
| 248 | data_req, msg_type = PCU_IF_MSG_DATA_REQ; |
| 249 | data_cnf, msg_type = PCU_IF_MSG_DATA_CNF; |
| 250 | data_cnf_dt, msg_type = PCU_IF_MSG_DATA_CNF_DT; |
| 251 | data_ind, msg_type = PCU_IF_MSG_DATA_IND; |
| 252 | susp_req, msg_type = PCU_IF_MSG_SUSP_REQ; |
| 253 | rts_req, msg_type = PCU_IF_MSG_RTS_REQ; |
| 254 | rach_ind, msg_type = PCU_IF_MSG_RACH_IND; |
| 255 | txt_ind, msg_type = PCU_IF_MSG_TXT_IND; |
| 256 | info_ind, msg_type = PCU_IF_MSG_INFO_IND; |
| 257 | act_req, msg_type = PCU_IF_MSG_ACT_REQ; |
| 258 | time_ind, msg_type = PCU_IF_MSG_TIME_IND; |
Harald Welte | 11b734c | 2019-09-05 14:17:54 +0200 | [diff] [blame] | 259 | pag_req, msg_type = PCU_IF_MSG_PAG_REQ; |
| 260 | app_info_req, msg_type = PCU_IF_MSG_APP_INFO_REQ)" |
Harald Welte | 3568dc7 | 2018-03-13 17:06:51 +0100 | [diff] [blame] | 261 | variant "PADDING(1696)" /* 212 * 8 */ |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 262 | }; |
| 263 | |
| 264 | external function enc_PCUIF_Message(in PCUIF_Message pdu) return octetstring |
| 265 | with { extension "prototype(convert) encode(RAW)" }; |
| 266 | external function dec_PCUIF_Message(in octetstring stream) return PCUIF_Message |
| 267 | with { extension "prototype(convert) decode(RAW)" }; |
| 268 | |
| 269 | |
Vadim Yanitskiy | f7d9c0f | 2019-09-06 00:08:17 +0200 | [diff] [blame] | 270 | /* Generic template for matching messages by type and/or the BTS number */ |
| 271 | template PCUIF_Message tr_PCUIF_MSG(template PCUIF_MsgType msg_type := ?, |
| 272 | template uint8_t bts_nr := ?) := { |
| 273 | msg_type := msg_type, |
| 274 | bts_nr := bts_nr, |
| 275 | spare := ?, |
| 276 | u := ? |
| 277 | } |
| 278 | |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 279 | template (value) PCUIF_Message ts_PCUIF_RTS_REQ(template (value) uint8_t bts_nr, |
| 280 | template (value) uint8_t trx_nr, |
| 281 | template (value) uint8_t ts_nr, |
| 282 | template (value) PCUIF_Sapi sapi, |
| 283 | template (value) uint32_t fn, |
| 284 | template (value) uint16_t arfcn, |
| 285 | template (value) uint8_t block_nr |
| 286 | ) := { |
| 287 | msg_type := PCU_IF_MSG_RTS_REQ, |
| 288 | bts_nr := bts_nr, |
| 289 | spare := '0000'O, |
| 290 | u := { |
| 291 | rts_req := { |
| 292 | sapi := sapi, |
| 293 | spare := '000000'O, |
| 294 | fn := fn, |
| 295 | arfcn := arfcn, |
| 296 | trx_nr := trx_nr, |
| 297 | ts_nr := ts_nr, |
| 298 | block_nr := block_nr |
| 299 | } |
| 300 | } |
| 301 | } |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 302 | template PCUIF_Message tr_PCUIF_RTS_REQ(template uint8_t bts_nr := ?, |
| 303 | template uint8_t trx_nr := ?, |
| 304 | template uint8_t ts_nr := ?, |
| 305 | template PCUIF_Sapi sapi := ?, |
| 306 | template uint32_t fn := ?, |
| 307 | template uint8_t block_nr := ? |
| 308 | ) := { |
| 309 | msg_type := PCU_IF_MSG_RTS_REQ, |
| 310 | bts_nr := bts_nr, |
| 311 | spare := ?, |
| 312 | u := { |
| 313 | rts_req := { |
| 314 | sapi := sapi, |
| 315 | spare := ?, |
| 316 | fn := fn, |
| 317 | arfcn := ?, |
| 318 | trx_nr := trx_nr, |
| 319 | ts_nr := ts_nr, |
| 320 | block_nr := block_nr |
| 321 | } |
| 322 | } |
| 323 | } |
| 324 | |
| 325 | template (value) PCUIF_Message ts_PCUIF_TXT_IND(uint8_t bts_nr, PCUIF_TextType tt, charstring text) := { |
| 326 | msg_type := PCU_IF_MSG_TXT_IND, |
| 327 | bts_nr := bts_nr, |
| 328 | spare := '0000'O, |
| 329 | u := { |
| 330 | txt_ind := { |
| 331 | txt_type := tt, |
| 332 | text := text |
| 333 | } |
| 334 | } |
| 335 | } |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 336 | template PCUIF_Message tr_PCUIF_TXT_IND(template uint8_t bts_nr, template PCUIF_TextType tt, |
| 337 | template charstring text := ?) := { |
| 338 | msg_type := PCU_IF_MSG_TXT_IND, |
| 339 | bts_nr := bts_nr, |
| 340 | spare := '0000'O, |
| 341 | u := { |
| 342 | txt_ind := { |
| 343 | txt_type := tt, |
| 344 | text := text |
| 345 | } |
| 346 | } |
| 347 | } |
| 348 | |
| 349 | |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 350 | |
| 351 | template (value) PCUIF_Message ts_PCUIF_ACT_REQ(uint8_t bts_nr, uint8_t trx_nr, uint8_t ts_nr) := { |
| 352 | msg_type := PCU_IF_MSG_ACT_REQ, |
| 353 | bts_nr := bts_nr, |
| 354 | spare := '0000'O, |
| 355 | u := { |
| 356 | act_req := { |
| 357 | is_activate := 1, |
| 358 | trx_nr := trx_nr, |
| 359 | ts_nr := ts_nr, |
| 360 | spare := '00'O |
| 361 | } |
| 362 | } |
| 363 | } |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 364 | template PCUIF_Message tr_PCUIF_ACT_REQ(template uint8_t bts_nr, template uint8_t trx_nr, |
| 365 | template uint8_t ts_nr) := { |
| 366 | msg_type := PCU_IF_MSG_ACT_REQ, |
| 367 | bts_nr := bts_nr, |
| 368 | spare := '0000'O, |
| 369 | u := { |
| 370 | act_req := { |
| 371 | is_activate := 1, |
| 372 | trx_nr := trx_nr, |
| 373 | ts_nr := ts_nr, |
| 374 | spare := '00'O |
| 375 | } |
| 376 | } |
| 377 | } |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 378 | |
| 379 | template (value) PCUIF_Message ts_PCUIF_DEACT_REQ(uint8_t bts_nr, uint8_t trx_nr, uint8_t ts_nr) := { |
| 380 | msg_type := PCU_IF_MSG_ACT_REQ, |
| 381 | bts_nr := bts_nr, |
| 382 | spare := '0000'O, |
| 383 | u := { |
| 384 | act_req := { |
| 385 | is_activate := 0, |
| 386 | trx_nr := trx_nr, |
| 387 | ts_nr := ts_nr, |
| 388 | spare := '00'O |
| 389 | } |
| 390 | } |
| 391 | } |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 392 | template PCUIF_Message tr_PCUIF_DEACT_REQ(template uint8_t bts_nr, template uint8_t trx_nr, |
| 393 | template uint8_t ts_nr) := { |
| 394 | msg_type := PCU_IF_MSG_ACT_REQ, |
| 395 | bts_nr := bts_nr, |
| 396 | spare := '0000'O, |
| 397 | u := { |
| 398 | act_req := { |
| 399 | is_activate := 0, |
| 400 | trx_nr := trx_nr, |
| 401 | ts_nr := ts_nr, |
| 402 | spare := '00'O |
| 403 | } |
| 404 | } |
| 405 | } |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 406 | |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 407 | template (value) PCUIF_Message ts_PCUIF_DATA_IND(template (value) uint8_t bts_nr, |
| 408 | template (value) uint8_t trx_nr, |
| 409 | template (value) uint8_t ts_nr, |
| 410 | template (value) uint8_t block_nr, |
| 411 | template (value) PCUIF_Sapi sapi, |
Vadim Yanitskiy | c78ea26 | 2019-05-17 01:08:08 +0700 | [diff] [blame] | 412 | template (value) octetstring data, |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 413 | template (value) uint32_t fn, |
| 414 | template (value) uint16_t arfcn, |
| 415 | template (value) int8_t rssi := -80, |
| 416 | template (value) uint16_t ber10k := 0, |
| 417 | template (value) int16_t ta_offs_qbits := 0, |
| 418 | template (value) uint16_t lqual_cb := 10) := { |
| 419 | msg_type := PCU_IF_MSG_DATA_IND, |
| 420 | bts_nr := bts_nr, |
| 421 | spare := '0000'O, |
| 422 | u := { |
| 423 | data_ind := { |
| 424 | sapi := sapi, |
| 425 | len := lengthof(valueof(data)), |
| 426 | data := data, |
| 427 | fn := fn, |
| 428 | arfcn := arfcn, |
| 429 | trx_nr := trx_nr, |
| 430 | ts_nr := ts_nr, |
| 431 | block_nr := block_nr, |
| 432 | rssi := rssi, |
| 433 | ber10k := ber10k, |
| 434 | ta_offs_qbits := ta_offs_qbits, |
| 435 | lqual_cb := lqual_cb |
| 436 | } |
| 437 | } |
| 438 | } |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 439 | template PCUIF_Message tr_PCUIF_DATA_IND(template uint8_t bts_nr := ?, |
| 440 | template uint8_t trx_nr := ?, |
| 441 | template uint8_t ts_nr := ?, |
| 442 | template uint8_t block_nr := ?, |
| 443 | template PCUIF_Sapi sapi := ?, |
Vadim Yanitskiy | c78ea26 | 2019-05-17 01:08:08 +0700 | [diff] [blame] | 444 | template octetstring data := ?) := { |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 445 | msg_type := PCU_IF_MSG_DATA_IND, |
| 446 | bts_nr := bts_nr, |
| 447 | spare := ?, |
| 448 | u := { |
| 449 | data_ind := { |
| 450 | sapi := sapi, |
| 451 | len := ?, |
| 452 | data := data, |
| 453 | fn := ?, |
| 454 | arfcn := ?, |
| 455 | trx_nr := trx_nr, |
| 456 | ts_nr := ts_nr, |
| 457 | block_nr := block_nr, |
| 458 | rssi := ?, |
| 459 | ber10k := ?, |
| 460 | ta_offs_qbits := ?, |
| 461 | lqual_cb := ? |
| 462 | } |
| 463 | } |
| 464 | } |
| 465 | |
| 466 | template (value) PCUIF_Message ts_PCUIF_DATA_REQ(uint8_t bts_nr, uint8_t trx_nr, |
| 467 | uint8_t ts_nr, uint8_t block_nr, |
| 468 | uint32_t fn, PCUIF_Sapi sapi, |
| 469 | octetstring data) := { |
| 470 | msg_type := PCU_IF_MSG_DATA_REQ, |
| 471 | bts_nr := bts_nr, |
| 472 | spare := '0000'O, |
| 473 | u := { |
| 474 | data_req := { |
| 475 | sapi := sapi, |
| 476 | len := lengthof(data), |
| 477 | data := data, |
| 478 | fn := fn, |
| 479 | arfcn := 0, /* unused in BTS */ |
| 480 | trx_nr := trx_nr, |
| 481 | ts_nr := ts_nr, |
| 482 | block_nr := block_nr, |
| 483 | /* measurement parameters below unused on Tx */ |
| 484 | rssi := 0, |
| 485 | ber10k := 0, |
| 486 | ta_offs_qbits := 0, |
| 487 | lqual_cb := 0 |
| 488 | } |
| 489 | } |
| 490 | } |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 491 | template PCUIF_Message tr_PCUIF_DATA_REQ(template uint8_t bts_nr, |
| 492 | template uint8_t trx_nr, |
| 493 | template uint8_t ts_nr, |
| 494 | template uint8_t block_nr := ?, |
| 495 | template uint32_t fn := ?, |
| 496 | template PCUIF_Sapi sapi := ?, |
| 497 | template octetstring data := ?) := { |
| 498 | msg_type := PCU_IF_MSG_DATA_REQ, |
| 499 | bts_nr := bts_nr, |
| 500 | spare := '0000'O, |
| 501 | u := { |
| 502 | data_req := { |
| 503 | sapi := sapi, |
| 504 | len := ?, |
| 505 | data := data, |
| 506 | fn := fn, |
Harald Welte | 0a3d63f | 2019-03-02 00:02:07 +0100 | [diff] [blame] | 507 | arfcn := ?, /* unused in BTS */ |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 508 | trx_nr := trx_nr, |
| 509 | ts_nr := ts_nr, |
| 510 | block_nr := block_nr, |
| 511 | /* measurement parameters below unused on Tx */ |
| 512 | rssi := 0, |
| 513 | ber10k := 0, |
| 514 | ta_offs_qbits := 0, |
| 515 | lqual_cb := 0 |
| 516 | } |
| 517 | } |
| 518 | } |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 519 | |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 520 | template (value) PCUIF_Message ts_PCUIF_DATA_CNF(template (value) uint8_t bts_nr, |
| 521 | template (value) uint8_t trx_nr, |
| 522 | template (value) uint8_t ts_nr, |
| 523 | template (value) uint8_t block_nr, |
| 524 | template (value) uint32_t fn, |
| 525 | template (value) uint16_t arfcn, |
| 526 | template (value) PCUIF_Sapi sapi, |
| 527 | template (value) octetstring data) := { |
| 528 | msg_type := PCU_IF_MSG_DATA_CNF, |
| 529 | bts_nr := bts_nr, |
| 530 | spare := '0000'O, |
| 531 | u := { |
| 532 | data_cnf := { |
| 533 | sapi := sapi, |
| 534 | len := 0, /* overwritten */ |
| 535 | data := data, |
| 536 | fn := fn, |
| 537 | arfcn := arfcn, |
| 538 | trx_nr := trx_nr, |
| 539 | ts_nr := ts_nr, |
| 540 | block_nr := block_nr, |
| 541 | rssi := 0, |
| 542 | ber10k := 0, |
| 543 | ta_offs_qbits := 0, |
| 544 | lqual_cb := 0 |
| 545 | } |
| 546 | } |
| 547 | } |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 548 | template PCUIF_Message tr_PCUIF_DATA_CNF(template uint8_t bts_nr := ?, |
| 549 | template uint8_t trx_nr := ?, |
| 550 | template uint8_t ts_nr := ?, |
| 551 | template PCUIF_Sapi sapi := ?, |
| 552 | template octetstring data := ?) := { |
| 553 | msg_type := PCU_IF_MSG_DATA_CNF, |
| 554 | bts_nr := bts_nr, |
| 555 | spare := ?, |
| 556 | u := { |
| 557 | data_cnf := { |
| 558 | sapi := sapi, |
| 559 | len := ?, |
| 560 | data := data, |
| 561 | fn := ?, |
| 562 | arfcn := ?, |
| 563 | trx_nr := trx_nr, |
| 564 | ts_nr := ts_nr, |
| 565 | block_nr := ?, |
| 566 | rssi := ?, |
| 567 | ber10k := ?, |
| 568 | ta_offs_qbits := ?, |
| 569 | lqual_cb := ? |
| 570 | } |
| 571 | } |
| 572 | } |
| 573 | |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 574 | template (value) PCUIF_Message ts_PCUIF_RACH_IND(template (value) uint8_t bts_nr, |
Vadim Yanitskiy | 36558d9 | 2019-11-17 02:23:51 +0700 | [diff] [blame] | 575 | template (value) uint8_t trx_nr, |
| 576 | template (value) uint8_t ts_nr, |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 577 | template (value) uint16_t ra, |
| 578 | template (value) uint8_t is_11bit, |
Harald Welte | 913bbf6 | 2019-03-01 00:39:19 +0100 | [diff] [blame] | 579 | template (value) PCUIF_BurstType burst_type, |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 580 | template (value) uint32_t fn, |
| 581 | template (value) uint16_t arfcn, |
Vadim Yanitskiy | 36aa611 | 2019-10-04 16:43:00 +0700 | [diff] [blame] | 582 | template (value) int16_t qta := 0, |
| 583 | template (value) PCUIF_Sapi sapi := PCU_IF_SAPI_RACH |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 584 | ) := { |
| 585 | msg_type := PCU_IF_MSG_RACH_IND, |
| 586 | bts_nr := bts_nr, |
| 587 | spare := '0000'O, |
| 588 | u := { |
| 589 | rach_ind := { |
Vadim Yanitskiy | 36aa611 | 2019-10-04 16:43:00 +0700 | [diff] [blame] | 590 | sapi := sapi, |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 591 | ra := ra, |
| 592 | qta := qta, |
| 593 | fn := fn, |
| 594 | arfcn := arfcn, |
| 595 | is_11bit := is_11bit, |
Vadim Yanitskiy | 36558d9 | 2019-11-17 02:23:51 +0700 | [diff] [blame] | 596 | burst_type := burst_type, |
| 597 | trx_nr := trx_nr, |
| 598 | ts_nr := ts_nr |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 599 | } |
| 600 | } |
| 601 | } |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 602 | template PCUIF_Message tr_PCUIF_RACH_IND(template uint8_t bts_nr := ?, |
Vadim Yanitskiy | 36558d9 | 2019-11-17 02:23:51 +0700 | [diff] [blame] | 603 | template uint8_t trx_nr := ?, |
| 604 | template uint8_t ts_nr := ?, |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 605 | template uint16_t ra := ?, |
| 606 | template uint8_t is_11bit := ?, |
Harald Welte | 913bbf6 | 2019-03-01 00:39:19 +0100 | [diff] [blame] | 607 | template PCUIF_BurstType burst_type := ?, |
Vadim Yanitskiy | 36aa611 | 2019-10-04 16:43:00 +0700 | [diff] [blame] | 608 | template uint32_t fn := ?, |
| 609 | template PCUIF_Sapi sapi := PCU_IF_SAPI_RACH) := { |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 610 | msg_type := PCU_IF_MSG_RACH_IND, |
| 611 | bts_nr := bts_nr, |
| 612 | spare := ?, |
| 613 | u := { |
| 614 | rach_ind := { |
Vadim Yanitskiy | 36aa611 | 2019-10-04 16:43:00 +0700 | [diff] [blame] | 615 | sapi := sapi, |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 616 | ra := ra, |
| 617 | qta := ?, |
| 618 | fn := fn, |
| 619 | arfcn := ?, |
| 620 | is_11bit := is_11bit, |
Vadim Yanitskiy | 36558d9 | 2019-11-17 02:23:51 +0700 | [diff] [blame] | 621 | burst_type := burst_type, |
| 622 | trx_nr := trx_nr, |
| 623 | ts_nr := ts_nr |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 624 | } |
| 625 | } |
| 626 | } |
| 627 | |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 628 | template (value) PCUIF_Message ts_PCUIF_PAG_REQ(template (value) uint8_t bts_nr, |
| 629 | template (value) OCT9 id_lv, |
| 630 | template (value) uint8_t chan_needed, |
| 631 | template (value) PCUIF_Sapi sapi) := { |
| 632 | msg_type := PCU_IF_MSG_PAG_REQ, |
| 633 | bts_nr := bts_nr, |
| 634 | spare := '0000'O, |
| 635 | u := { |
| 636 | pag_req := { |
| 637 | sapi := sapi, |
| 638 | chan_needed := chan_needed, |
| 639 | identity_lv := id_lv |
| 640 | } |
| 641 | } |
| 642 | } |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 643 | template PCUIF_Message tr_PCUIF_PAG_REQ(template uint8_t bts_nr := ?, |
| 644 | template OCT9 id_lv := ?, |
| 645 | template uint8_t chan_needed := ?, |
| 646 | template PCUIF_Sapi sapi := ?) := { |
| 647 | msg_type := PCU_IF_MSG_PAG_REQ, |
| 648 | bts_nr := bts_nr, |
| 649 | spare := ?, |
| 650 | u := { |
| 651 | pag_req := { |
| 652 | sapi := ?, |
| 653 | chan_needed := chan_needed, |
| 654 | identity_lv := id_lv |
| 655 | } |
| 656 | } |
| 657 | } |
| 658 | |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 659 | const PCUIF_Flags c_PCUIF_Flags_default := { |
| 660 | bts_active := true, |
| 661 | sysmo_direct_dsp := false, |
| 662 | spare := '00000000000000'B, |
| 663 | cs1 := true, |
| 664 | cs2 := true, |
| 665 | cs3 := true, |
| 666 | cs4 := true, |
| 667 | mcs1 := true, |
| 668 | mcs2 := true, |
| 669 | mcs3 := true, |
| 670 | mcs4 := true, |
| 671 | mcs5 := true, |
| 672 | mcs6 := true, |
| 673 | mcs7 := true, |
| 674 | mcs8 := true, |
| 675 | mcs9 := true, |
| 676 | spare2 := '000'B |
| 677 | }; |
| 678 | |
| 679 | template (value) PCUIF_InfoTrx ts_PCUIF_InfoTrx(template (value) uint16_t arfcn := 871, |
| 680 | template (value) BIT8 pdch_mask := '00000001'B, |
| 681 | OCT1 tsc := '07'O) := { |
| 682 | arfcn := arfcn, |
| 683 | pdch_mask := pdch_mask, |
| 684 | spare := '00'O, |
| 685 | tsc := tsc & tsc & tsc & tsc & tsc & tsc & tsc & tsc, |
| 686 | hLayer1 := 0 |
| 687 | } |
| 688 | |
| 689 | template (value) PCUIF_InfoTrx ts_PCUIF_InfoTrxNULL := ts_PCUIF_InfoTrx(0, '00000000'B, '00'O); |
| 690 | |
| 691 | template (value) PCUIF_InfoTrxs ts_PCUIF_InfoTrxs_def := { |
| 692 | ts_PCUIF_InfoTrx, ts_PCUIF_InfoTrxNULL, ts_PCUIF_InfoTrxNULL, ts_PCUIF_InfoTrxNULL, |
| 693 | ts_PCUIF_InfoTrxNULL, ts_PCUIF_InfoTrxNULL, ts_PCUIF_InfoTrxNULL, ts_PCUIF_InfoTrxNULL }; |
| 694 | |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 695 | template (value) PCUIF_Message ts_PCUIF_INFO_IND(template (value) uint8_t bts_nr, |
Pau Espin Pedrol | f787b09 | 2019-10-04 18:34:05 +0200 | [diff] [blame] | 696 | template (value) PCUIF_info_ind info_ind) := { |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 697 | msg_type := PCU_IF_MSG_INFO_IND, |
| 698 | bts_nr := bts_nr, |
| 699 | spare := '0000'O, |
| 700 | u := { |
Pau Espin Pedrol | f787b09 | 2019-10-04 18:34:05 +0200 | [diff] [blame] | 701 | info_ind := info_ind |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 702 | } |
| 703 | } |
Harald Welte | d378a25 | 2018-03-13 17:02:14 +0100 | [diff] [blame] | 704 | template PCUIF_Message tr_PCUIF_INFO_IND(template uint8_t bts_nr := ?, |
| 705 | template PCUIF_Flags flags := ?, |
Vadim Yanitskiy | c155930 | 2020-07-19 16:39:12 +0700 | [diff] [blame] | 706 | template uint32_t version := mp_pcuif_version) := { |
Harald Welte | d378a25 | 2018-03-13 17:02:14 +0100 | [diff] [blame] | 707 | msg_type := PCU_IF_MSG_INFO_IND, |
| 708 | bts_nr := bts_nr, |
| 709 | spare := ?, |
| 710 | u := { |
| 711 | info_ind := { |
| 712 | version := version, |
| 713 | flags := flags, |
| 714 | trx := ?, |
| 715 | bsic := ?, |
| 716 | mcc := ?, |
| 717 | mnc :=?, |
Harald Welte | 3568dc7 | 2018-03-13 17:06:51 +0100 | [diff] [blame] | 718 | mnc_3_digits := ?, |
Harald Welte | d378a25 | 2018-03-13 17:02:14 +0100 | [diff] [blame] | 719 | lac := ?, |
| 720 | rac := ?, |
| 721 | nsei := ?, |
| 722 | nse_timer := ?, |
| 723 | cell_timer := ?, |
| 724 | cell_id := ?, |
| 725 | repeat_time := ?, |
| 726 | repeat_count := ?, |
| 727 | bvci := ?, |
| 728 | t3142 := ?, |
| 729 | t3169 := ?, |
| 730 | t3191 := ?, |
| 731 | t3193_10ms := ?, |
| 732 | t3195 := ?, |
| 733 | t3101 := ?, |
| 734 | t3103 := ?, |
| 735 | t3105 := ?, |
| 736 | cv_countdown := ?, |
| 737 | dl_tbf_ext := ?, |
| 738 | ul_tbf_ext := ?, |
| 739 | initial_cs := ?, |
| 740 | initial_mcs := ?, |
| 741 | nsvci := ?, |
| 742 | local_pprt := ?, |
| 743 | remote_port := ?, |
| 744 | remote_ip := ? |
| 745 | } |
| 746 | } |
| 747 | } |
| 748 | |
Harald Welte | a321981 | 2019-03-02 00:02:28 +0100 | [diff] [blame] | 749 | template (value) PCUIF_Message ts_PCUIF_TIME_IND(template (value) uint8_t bts_nr, |
| 750 | template (value) uint32_t fn) := { |
| 751 | msg_type := PCU_IF_MSG_TIME_IND, |
| 752 | bts_nr := bts_nr, |
| 753 | spare := '0000'O, |
| 754 | u := { |
| 755 | time_ind := { |
| 756 | fn := fn |
| 757 | } |
| 758 | } |
| 759 | } |
| 760 | template PCUIF_Message tr_PCUIF_TIME_IND(template uint8_t bts_nr, |
| 761 | template uint32_t fn) := { |
| 762 | msg_type := PCU_IF_MSG_TIME_IND, |
| 763 | bts_nr := bts_nr, |
| 764 | spare := ?, |
| 765 | u := { |
| 766 | time_ind := { |
| 767 | fn := fn |
| 768 | } |
| 769 | } |
| 770 | } |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 771 | |
Harald Welte | 4bff40a | 2019-03-21 21:34:10 +0100 | [diff] [blame] | 772 | template (value) PCUIF_Message ts_PCUIF_SUSP_REQ(template (value) uint8_t bts_nr, |
| 773 | template (value) OCT4 tlli, |
| 774 | template (value) OCT6 ra_id, |
| 775 | template (value) 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 | template PCUIF_Message tr_PCUIF_SUSP_REQ(template uint8_t bts_nr, |
| 788 | template OCT4 tlli, |
| 789 | template OCT6 ra_id, |
| 790 | template uint8_t cause) := { |
| 791 | msg_type := PCU_IF_MSG_SUSP_REQ, |
| 792 | bts_nr := bts_nr, |
| 793 | spare := '0000'O, |
| 794 | u := { |
| 795 | susp_req := { |
| 796 | tlli := tlli, |
| 797 | ra_id := ra_id, |
| 798 | cause := cause |
| 799 | } |
| 800 | } |
| 801 | } |
| 802 | |
Harald Welte | 11b734c | 2019-09-05 14:17:54 +0200 | [diff] [blame] | 803 | template (value) PCUIF_Message ts_PCUIF_APP_INFO_REQ(template (value) uint8_t bts_nr, |
| 804 | template (value) uint8_t app_type, |
| 805 | template (value) octetstring app_data) := { |
| 806 | msg_type := PCU_IF_MSG_APP_INFO_REQ, |
| 807 | bts_nr := bts_nr, |
| 808 | spare := '0000'O, |
| 809 | u := { |
| 810 | app_info_req := { |
| 811 | application_type := app_type, |
| 812 | len := 0, /* overwritten */ |
| 813 | data := app_data |
| 814 | } |
| 815 | } |
| 816 | } |
| 817 | template (present) PCUIF_Message tr_PCUIF_APP_INFO_REQ(template (present) uint8_t bts_nr, |
| 818 | template (present) uint8_t app_type, |
| 819 | template (present) octetstring app_data) := { |
| 820 | msg_type := PCU_IF_MSG_APP_INFO_REQ, |
| 821 | bts_nr := bts_nr, |
| 822 | spare := '0000'O, |
| 823 | u := { |
| 824 | app_info_req := { |
| 825 | application_type := app_type, |
| 826 | len := ?, |
| 827 | data := app_data |
| 828 | } |
| 829 | } |
| 830 | } |
| 831 | |
Harald Welte | 4bff40a | 2019-03-21 21:34:10 +0100 | [diff] [blame] | 832 | |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 833 | } with { encode "RAW" variant "BYTEORDER(first)" }; |