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