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; |
Alexander Couzens | 1e5dc48 | 2020-07-28 15:38:46 +0200 | [diff] [blame] | 16 | import from Native_Functions all; |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 17 | |
Vadim Yanitskiy | c155930 | 2020-07-19 16:39:12 +0700 | [diff] [blame] | 18 | modulepar { |
| 19 | /* PCUIF version supported by the IUT */ |
| 20 | PCUIF_Version mp_pcuif_version := 9; |
| 21 | }; |
| 22 | |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 23 | const charstring PCU_SOCK_DEFAULT := "/tmp/pcu_bts"; |
Vadim Yanitskiy | 9e1206c | 2020-07-19 15:52:31 +0700 | [diff] [blame] | 24 | type integer PCUIF_Version (9..10); /* supported versions */ |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 25 | |
| 26 | type enumerated PCUIF_MsgType { |
| 27 | PCU_IF_MSG_DATA_REQ ('00'O), |
| 28 | PCU_IF_MSG_DATA_CNF ('01'O), |
| 29 | PCU_IF_MSG_DATA_IND ('02'O), |
| 30 | PCU_IF_MSG_SUSP_REQ ('03'O), |
Harald Welte | 11b734c | 2019-09-05 14:17:54 +0200 | [diff] [blame] | 31 | PCU_IF_MSG_APP_INFO_REQ ('04'O), |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 32 | PCU_IF_MSG_RTS_REQ ('10'O), |
| 33 | PCU_IF_MSG_DATA_CNF_DT ('11'O), |
| 34 | PCU_IF_MSG_RACH_IND ('22'O), |
| 35 | PCU_IF_MSG_INFO_IND ('32'O), |
| 36 | PCU_IF_MSG_ACT_REQ ('40'O), |
| 37 | PCU_IF_MSG_TIME_IND ('52'O), |
| 38 | PCU_IF_MSG_PAG_REQ ('60'O), |
| 39 | PCU_IF_MSG_TXT_IND ('70'O) |
| 40 | } with { variant "FIELDLENGTH(8)" }; |
| 41 | |
| 42 | type enumerated PCUIF_Sapi { |
| 43 | PCU_IF_SAPI_UNKNOWN ('00'O), |
| 44 | PCU_IF_SAPI_RACH ('01'O), |
| 45 | PCU_IF_SAPI_AGCH ('02'O), |
| 46 | PCU_IF_SAPI_PCH ('03'O), |
| 47 | PCU_IF_SAPI_BCCH ('04'O), |
| 48 | PCU_IF_SAPI_PDTCH ('05'O), |
| 49 | PCU_IF_SAPI_PRACH ('06'O), |
| 50 | PCU_IF_SAPI_PTCCH ('07'O), |
| 51 | PCU_IF_SAPI_AGCH_DT ('08'O) |
| 52 | } with { variant "FIELDLENGTH(8)" }; |
| 53 | |
| 54 | type record PCUIF_Flags { |
| 55 | boolean bts_active, |
| 56 | boolean sysmo_direct_dsp, |
| 57 | BIT14 spare, |
| 58 | boolean cs1, |
| 59 | boolean cs2, |
| 60 | boolean cs3, |
| 61 | boolean cs4, |
| 62 | boolean mcs1, |
| 63 | boolean mcs2, |
| 64 | boolean mcs3, |
| 65 | boolean mcs4, |
| 66 | boolean mcs5, |
| 67 | boolean mcs6, |
| 68 | boolean mcs7, |
| 69 | boolean mcs8, |
| 70 | boolean mcs9, |
| 71 | BIT3 spare2 |
| 72 | } with { variant "" }; |
| 73 | |
| 74 | type enumerated PCUIF_TextType { |
| 75 | PCU_VERSION (0), |
| 76 | PCU_OML_ALERT (1) |
| 77 | } with { variant "FIELDLENGTH(8)" }; |
| 78 | |
Vadim Yanitskiy | e1527f7 | 2019-09-09 02:15:33 +0200 | [diff] [blame] | 79 | type charstring PCUIF_Text length(128) with { variant "FIELDLENGTH(null_terminated)" }; |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 80 | |
| 81 | type record PCUIF_txt_ind { |
| 82 | PCUIF_TextType txt_type, |
| 83 | PCUIF_Text text |
| 84 | } with { variant "" }; |
| 85 | |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 86 | type record PCUIF_data { |
| 87 | PCUIF_Sapi sapi, |
| 88 | uint8_t len, |
Vadim Yanitskiy | d8f28e6 | 2019-09-10 18:11:52 +0200 | [diff] [blame] | 89 | octetstring data length(162), |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 90 | uint32_t fn, |
| 91 | uint16_t arfcn, |
| 92 | uint8_t trx_nr, |
| 93 | uint8_t ts_nr, |
| 94 | uint8_t block_nr, |
| 95 | int8_t rssi, |
| 96 | uint16_t ber10k, |
| 97 | int16_t ta_offs_qbits, |
| 98 | int16_t lqual_cb |
Vadim Yanitskiy | d8f28e6 | 2019-09-10 18:11:52 +0200 | [diff] [blame] | 99 | } with { variant (data) "FIELDLENGTH(162), ALIGN(left)" }; |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 100 | |
| 101 | type record PCUIF_data_cnf_dt { |
| 102 | PCUIF_Sapi sapi, |
| 103 | OCT4 tlli, |
| 104 | uint32_t fn, |
| 105 | uint16_t arfcn, |
| 106 | uint8_t trx_nr, |
| 107 | uint8_t ts_nr, |
| 108 | uint8_t block_nr, |
| 109 | int8_t rssi, |
| 110 | uint16_t ber10k, |
| 111 | int16_t ta_offs_qbits, |
| 112 | int16_t lqual_cb |
| 113 | } with { variant "" }; |
| 114 | |
| 115 | type record PCUIF_rts_req { |
| 116 | PCUIF_Sapi sapi, |
| 117 | OCT3 spare, |
| 118 | uint32_t fn, |
| 119 | uint16_t arfcn, |
| 120 | uint8_t trx_nr, |
| 121 | uint8_t ts_nr, |
| 122 | uint8_t block_nr |
| 123 | } with { variant "" }; |
| 124 | |
Harald Welte | 913bbf6 | 2019-03-01 00:39:19 +0100 | [diff] [blame] | 125 | type enumerated PCUIF_BurstType { |
| 126 | BURST_TYPE_NONE (0), |
| 127 | BURST_TYPE_0 (1), |
| 128 | BURST_TYPE_1 (2), |
| 129 | BURST_TYPE_2 (3) |
| 130 | } with { variant "FIELDLENGTH(8)" }; |
| 131 | |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 132 | type record PCUIF_rach_ind { |
| 133 | PCUIF_Sapi sapi, |
| 134 | uint16_t ra, |
| 135 | int16_t qta, |
| 136 | uint32_t fn, |
| 137 | uint16_t arfcn, |
| 138 | uint8_t is_11bit, |
Vadim Yanitskiy | 36558d9 | 2019-11-17 02:23:51 +0700 | [diff] [blame] | 139 | PCUIF_BurstType burst_type, |
| 140 | uint8_t trx_nr, |
| 141 | uint8_t ts_nr |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 142 | } with { variant "" }; |
| 143 | |
Vadim Yanitskiy | 9e1206c | 2020-07-19 15:52:31 +0700 | [diff] [blame] | 144 | type record PCUIF_InfoTrxTs { |
| 145 | uint8_t tsc, |
| 146 | uint8_t hopping, |
| 147 | uint8_t hsn, |
| 148 | uint8_t maio, |
Vadim Yanitskiy | 43ccaf5 | 2020-09-05 21:35:13 +0700 | [diff] [blame] | 149 | uint8_t ma_bit_len, |
Vadim Yanitskiy | 9e1206c | 2020-07-19 15:52:31 +0700 | [diff] [blame] | 150 | bitstring ma length(64) |
| 151 | } with { variant (ma) "BYTEORDER(first), BITORDER(msb)" }; |
| 152 | private type record length(8) of PCUIF_InfoTrxTs PCUIF_InfoTrxTsList; |
| 153 | |
| 154 | /* Version >= 10 specific coding */ |
| 155 | private type record PCUIF_InfoV10Trx { |
| 156 | uint16_t arfcn, |
| 157 | BIT8 pdch_mask, |
Vadim Yanitskiy | d805172 | 2020-08-22 02:33:17 +0700 | [diff] [blame] | 158 | OCT1 spare, |
Vadim Yanitskiy | 9e1206c | 2020-07-19 15:52:31 +0700 | [diff] [blame] | 159 | uint32_t hLayer1, |
| 160 | PCUIF_InfoTrxTsList ts |
| 161 | } with { variant (pdch_mask) "BITORDER(msb)" }; |
| 162 | private type record length(8) of PCUIF_InfoV10Trx PCUIF_InfoV10TrxList; |
| 163 | |
| 164 | /* Version <= 9 specific coding */ |
| 165 | private type record PCUIF_InfoV09Trx { |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 166 | uint16_t arfcn, |
| 167 | BIT8 pdch_mask, |
| 168 | OCT1 spare, |
| 169 | OCT8 tsc, |
| 170 | uint32_t hLayer1 |
Harald Welte | f148659 | 2018-04-04 19:26:41 +0200 | [diff] [blame] | 171 | } with { variant (pdch_mask) "BITORDER(msb)" }; |
Vadim Yanitskiy | 9e1206c | 2020-07-19 15:52:31 +0700 | [diff] [blame] | 172 | private type record length(8) of PCUIF_InfoV09Trx PCUIF_InfoV09TrxList; |
| 173 | |
| 174 | type union PCUIF_InfoTrxs { |
| 175 | PCUIF_InfoV09TrxList v09, |
| 176 | PCUIF_InfoV10TrxList v10 |
| 177 | } with { variant "" }; |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 178 | |
| 179 | type record PCUIF_info_ind { |
| 180 | uint32_t version, |
| 181 | PCUIF_Flags flags, |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 182 | PCUIF_InfoTrxs trx, |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 183 | uint8_t bsic, |
| 184 | |
| 185 | uint16_t mcc, |
| 186 | uint16_t mnc, |
Harald Welte | 3568dc7 | 2018-03-13 17:06:51 +0100 | [diff] [blame] | 187 | uint8_t mnc_3_digits, |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 188 | uint16_t lac, |
| 189 | uint16_t rac, |
| 190 | |
| 191 | uint16_t nsei, |
| 192 | record length(7) of uint8_t nse_timer, |
| 193 | record length(11) of uint8_t cell_timer, |
| 194 | |
| 195 | uint16_t cell_id, |
| 196 | uint16_t repeat_time, |
| 197 | uint8_t repeat_count, |
| 198 | uint16_t bvci, |
| 199 | uint8_t t3142, |
| 200 | uint8_t t3169, |
| 201 | uint8_t t3191, |
| 202 | uint8_t t3193_10ms, |
| 203 | uint8_t t3195, |
| 204 | uint8_t t3101, |
| 205 | uint8_t t3103, |
| 206 | uint8_t t3105, |
| 207 | uint8_t cv_countdown, |
| 208 | uint16_t dl_tbf_ext, |
| 209 | uint16_t ul_tbf_ext, |
| 210 | uint8_t initial_cs, |
| 211 | uint8_t initial_mcs, |
| 212 | |
| 213 | record length(2) of uint16_t nsvci, |
Vadim Yanitskiy | 0d59080 | 2020-08-21 00:14:22 +0700 | [diff] [blame] | 214 | record length(2) of uint16_t local_port, |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 215 | record length(2) of uint16_t remote_port, |
Alexander Couzens | 1e5dc48 | 2020-07-28 15:38:46 +0200 | [diff] [blame] | 216 | PCUIF_RemoteAddr remote_addr |
Vadim Yanitskiy | 9e1206c | 2020-07-19 15:52:31 +0700 | [diff] [blame] | 217 | } with { |
| 218 | /* NOTE: TITAN is not smart enough to handle 'version < 10' and 'version > 9', |
| 219 | * so we cannot support more than two versions at the same time here. Sigh. */ |
| 220 | variant (trx) "CROSSTAG(v09, version = 9; v10, version = 10)" |
Alexander Couzens | 1e5dc48 | 2020-07-28 15:38:46 +0200 | [diff] [blame] | 221 | variant (remote_addr) "CROSSTAG(v09, version = 9; v10, version = 10)" |
Vadim Yanitskiy | 9e1206c | 2020-07-19 15:52:31 +0700 | [diff] [blame] | 222 | }; |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 223 | |
Alexander Couzens | 1e5dc48 | 2020-07-28 15:38:46 +0200 | [diff] [blame] | 224 | type union PCUIF_RemoteAddr { |
| 225 | PCUIF_RemoteAddrV09 v09, |
| 226 | PCUIF_RemoteAddrV10 v10 |
| 227 | } with { variant "" }; |
| 228 | |
| 229 | type record PCUIF_RemoteAddrV09 { |
| 230 | record length(2) of OCT4 addr |
| 231 | } with { variant "" }; |
| 232 | |
| 233 | type enumerated PCUIF_AddrType { |
| 234 | PCUIF_ADDR_TYPE_UNSPEC ('00'O), |
| 235 | PCUIF_ADDR_TYPE_IPV4 ('04'O), |
| 236 | PCUIF_ADDR_TYPE_IPV6 ('29'O) |
| 237 | } with { variant "FIELDLENGTH(8)" }; |
| 238 | |
| 239 | type record PCUIF_RemoteAddrV10 { |
| 240 | record length(2) of PCUIF_AddrType addr_type, |
| 241 | record length(2) of octetstring addr length(16) |
| 242 | } with { variant "" }; |
| 243 | |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 244 | type record PCUIF_act_req { |
| 245 | uint8_t is_activate, |
| 246 | uint8_t trx_nr, |
| 247 | uint8_t ts_nr, |
| 248 | OCT1 spare |
| 249 | } with { variant "" }; |
| 250 | |
| 251 | type record PCUIF_time_ind { |
| 252 | uint32_t fn |
| 253 | } with { variant "" }; |
| 254 | |
| 255 | type record PCUIF_pag_req { |
| 256 | PCUIF_Sapi sapi, |
| 257 | uint8_t chan_needed, |
| 258 | OCT9 identity_lv |
| 259 | } with { variant "" }; |
| 260 | |
Harald Welte | 11b734c | 2019-09-05 14:17:54 +0200 | [diff] [blame] | 261 | type record PCUIF_app_info_req { |
| 262 | uint8_t application_type, |
| 263 | uint8_t len, |
| 264 | octetstring data |
| 265 | } with { |
| 266 | variant (len) "LENGTHTO(data)" |
| 267 | } |
| 268 | |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 269 | type record PCUIF_susp_req { |
| 270 | OCT4 tlli, |
| 271 | OCT6 ra_id, |
| 272 | uint8_t cause |
Harald Welte | eaa9a86 | 2019-05-26 23:01:08 +0200 | [diff] [blame] | 273 | } with { |
| 274 | variant (tlli) "BYTEORDER(last)" |
| 275 | }; |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 276 | |
| 277 | |
| 278 | type union PCUIF_MsgUnion { |
| 279 | PCUIF_data data_req, |
| 280 | PCUIF_data data_cnf, |
| 281 | PCUIF_data_cnf_dt data_cnf_dt, |
| 282 | PCUIF_data data_ind, |
| 283 | PCUIF_susp_req susp_req, |
| 284 | PCUIF_rts_req rts_req, |
| 285 | PCUIF_rach_ind rach_ind, |
| 286 | PCUIF_txt_ind txt_ind, |
| 287 | PCUIF_info_ind info_ind, |
| 288 | PCUIF_act_req act_req, |
| 289 | PCUIF_time_ind time_ind, |
Harald Welte | 11b734c | 2019-09-05 14:17:54 +0200 | [diff] [blame] | 290 | PCUIF_pag_req pag_req, |
| 291 | PCUIF_app_info_req app_info_req |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 292 | } with { variant "" }; |
| 293 | |
| 294 | type record PCUIF_Message { |
| 295 | PCUIF_MsgType msg_type, |
| 296 | uint8_t bts_nr, |
| 297 | OCT2 spare, |
| 298 | PCUIF_MsgUnion u |
| 299 | } with { variant (u) "CROSSTAG( |
| 300 | data_req, msg_type = PCU_IF_MSG_DATA_REQ; |
| 301 | data_cnf, msg_type = PCU_IF_MSG_DATA_CNF; |
| 302 | data_cnf_dt, msg_type = PCU_IF_MSG_DATA_CNF_DT; |
| 303 | data_ind, msg_type = PCU_IF_MSG_DATA_IND; |
| 304 | susp_req, msg_type = PCU_IF_MSG_SUSP_REQ; |
| 305 | rts_req, msg_type = PCU_IF_MSG_RTS_REQ; |
| 306 | rach_ind, msg_type = PCU_IF_MSG_RACH_IND; |
| 307 | txt_ind, msg_type = PCU_IF_MSG_TXT_IND; |
| 308 | info_ind, msg_type = PCU_IF_MSG_INFO_IND; |
| 309 | act_req, msg_type = PCU_IF_MSG_ACT_REQ; |
| 310 | time_ind, msg_type = PCU_IF_MSG_TIME_IND; |
Harald Welte | 11b734c | 2019-09-05 14:17:54 +0200 | [diff] [blame] | 311 | pag_req, msg_type = PCU_IF_MSG_PAG_REQ; |
| 312 | app_info_req, msg_type = PCU_IF_MSG_APP_INFO_REQ)" |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 313 | }; |
| 314 | |
| 315 | external function enc_PCUIF_Message(in PCUIF_Message pdu) return octetstring |
| 316 | with { extension "prototype(convert) encode(RAW)" }; |
| 317 | external function dec_PCUIF_Message(in octetstring stream) return PCUIF_Message |
| 318 | with { extension "prototype(convert) decode(RAW)" }; |
| 319 | |
| 320 | |
Vadim Yanitskiy | f7d9c0f | 2019-09-06 00:08:17 +0200 | [diff] [blame] | 321 | /* Generic template for matching messages by type and/or the BTS number */ |
| 322 | template PCUIF_Message tr_PCUIF_MSG(template PCUIF_MsgType msg_type := ?, |
| 323 | template uint8_t bts_nr := ?) := { |
| 324 | msg_type := msg_type, |
| 325 | bts_nr := bts_nr, |
| 326 | spare := ?, |
| 327 | u := ? |
| 328 | } |
| 329 | |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 330 | template (value) PCUIF_Message ts_PCUIF_RTS_REQ(template (value) uint8_t bts_nr, |
| 331 | template (value) uint8_t trx_nr, |
| 332 | template (value) uint8_t ts_nr, |
| 333 | template (value) PCUIF_Sapi sapi, |
| 334 | template (value) uint32_t fn, |
| 335 | template (value) uint16_t arfcn, |
| 336 | template (value) uint8_t block_nr |
| 337 | ) := { |
| 338 | msg_type := PCU_IF_MSG_RTS_REQ, |
| 339 | bts_nr := bts_nr, |
| 340 | spare := '0000'O, |
| 341 | u := { |
| 342 | rts_req := { |
| 343 | sapi := sapi, |
| 344 | spare := '000000'O, |
| 345 | fn := fn, |
| 346 | arfcn := arfcn, |
| 347 | trx_nr := trx_nr, |
| 348 | ts_nr := ts_nr, |
| 349 | block_nr := block_nr |
| 350 | } |
| 351 | } |
| 352 | } |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 353 | template PCUIF_Message tr_PCUIF_RTS_REQ(template uint8_t bts_nr := ?, |
| 354 | template uint8_t trx_nr := ?, |
| 355 | template uint8_t ts_nr := ?, |
| 356 | template PCUIF_Sapi sapi := ?, |
| 357 | template uint32_t fn := ?, |
| 358 | template uint8_t block_nr := ? |
| 359 | ) := { |
| 360 | msg_type := PCU_IF_MSG_RTS_REQ, |
| 361 | bts_nr := bts_nr, |
| 362 | spare := ?, |
| 363 | u := { |
| 364 | rts_req := { |
| 365 | sapi := sapi, |
| 366 | spare := ?, |
| 367 | fn := fn, |
| 368 | arfcn := ?, |
| 369 | trx_nr := trx_nr, |
| 370 | ts_nr := ts_nr, |
| 371 | block_nr := block_nr |
| 372 | } |
| 373 | } |
| 374 | } |
| 375 | |
| 376 | template (value) PCUIF_Message ts_PCUIF_TXT_IND(uint8_t bts_nr, PCUIF_TextType tt, charstring text) := { |
| 377 | msg_type := PCU_IF_MSG_TXT_IND, |
| 378 | bts_nr := bts_nr, |
| 379 | spare := '0000'O, |
| 380 | u := { |
| 381 | txt_ind := { |
| 382 | txt_type := tt, |
| 383 | text := text |
| 384 | } |
| 385 | } |
| 386 | } |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 387 | template PCUIF_Message tr_PCUIF_TXT_IND(template uint8_t bts_nr, template PCUIF_TextType tt, |
| 388 | template charstring text := ?) := { |
| 389 | msg_type := PCU_IF_MSG_TXT_IND, |
| 390 | bts_nr := bts_nr, |
| 391 | spare := '0000'O, |
| 392 | u := { |
| 393 | txt_ind := { |
| 394 | txt_type := tt, |
| 395 | text := text |
| 396 | } |
| 397 | } |
| 398 | } |
| 399 | |
| 400 | |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 401 | |
| 402 | template (value) PCUIF_Message ts_PCUIF_ACT_REQ(uint8_t bts_nr, uint8_t trx_nr, uint8_t ts_nr) := { |
| 403 | msg_type := PCU_IF_MSG_ACT_REQ, |
| 404 | bts_nr := bts_nr, |
| 405 | spare := '0000'O, |
| 406 | u := { |
| 407 | act_req := { |
| 408 | is_activate := 1, |
| 409 | trx_nr := trx_nr, |
| 410 | ts_nr := ts_nr, |
| 411 | spare := '00'O |
| 412 | } |
| 413 | } |
| 414 | } |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 415 | template PCUIF_Message tr_PCUIF_ACT_REQ(template uint8_t bts_nr, template uint8_t trx_nr, |
| 416 | template uint8_t ts_nr) := { |
| 417 | msg_type := PCU_IF_MSG_ACT_REQ, |
| 418 | bts_nr := bts_nr, |
| 419 | spare := '0000'O, |
| 420 | u := { |
| 421 | act_req := { |
| 422 | is_activate := 1, |
| 423 | trx_nr := trx_nr, |
| 424 | ts_nr := ts_nr, |
| 425 | spare := '00'O |
| 426 | } |
| 427 | } |
| 428 | } |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 429 | |
| 430 | template (value) PCUIF_Message ts_PCUIF_DEACT_REQ(uint8_t bts_nr, uint8_t trx_nr, uint8_t ts_nr) := { |
| 431 | msg_type := PCU_IF_MSG_ACT_REQ, |
| 432 | bts_nr := bts_nr, |
| 433 | spare := '0000'O, |
| 434 | u := { |
| 435 | act_req := { |
| 436 | is_activate := 0, |
| 437 | trx_nr := trx_nr, |
| 438 | ts_nr := ts_nr, |
| 439 | spare := '00'O |
| 440 | } |
| 441 | } |
| 442 | } |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 443 | template PCUIF_Message tr_PCUIF_DEACT_REQ(template uint8_t bts_nr, template uint8_t trx_nr, |
| 444 | template uint8_t ts_nr) := { |
| 445 | msg_type := PCU_IF_MSG_ACT_REQ, |
| 446 | bts_nr := bts_nr, |
| 447 | spare := '0000'O, |
| 448 | u := { |
| 449 | act_req := { |
| 450 | is_activate := 0, |
| 451 | trx_nr := trx_nr, |
| 452 | ts_nr := ts_nr, |
| 453 | spare := '00'O |
| 454 | } |
| 455 | } |
| 456 | } |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 457 | |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 458 | template (value) PCUIF_Message ts_PCUIF_DATA_IND(template (value) uint8_t bts_nr, |
| 459 | template (value) uint8_t trx_nr, |
| 460 | template (value) uint8_t ts_nr, |
| 461 | template (value) uint8_t block_nr, |
| 462 | template (value) PCUIF_Sapi sapi, |
Vadim Yanitskiy | c78ea26 | 2019-05-17 01:08:08 +0700 | [diff] [blame] | 463 | template (value) octetstring data, |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 464 | template (value) uint32_t fn, |
| 465 | template (value) uint16_t arfcn, |
| 466 | template (value) int8_t rssi := -80, |
| 467 | template (value) uint16_t ber10k := 0, |
| 468 | template (value) int16_t ta_offs_qbits := 0, |
| 469 | template (value) uint16_t lqual_cb := 10) := { |
| 470 | msg_type := PCU_IF_MSG_DATA_IND, |
| 471 | bts_nr := bts_nr, |
| 472 | spare := '0000'O, |
| 473 | u := { |
| 474 | data_ind := { |
| 475 | sapi := sapi, |
| 476 | len := lengthof(valueof(data)), |
| 477 | data := data, |
| 478 | fn := fn, |
| 479 | arfcn := arfcn, |
| 480 | trx_nr := trx_nr, |
| 481 | ts_nr := ts_nr, |
| 482 | block_nr := block_nr, |
| 483 | rssi := rssi, |
| 484 | ber10k := ber10k, |
| 485 | ta_offs_qbits := ta_offs_qbits, |
| 486 | lqual_cb := lqual_cb |
| 487 | } |
| 488 | } |
| 489 | } |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 490 | template PCUIF_Message tr_PCUIF_DATA_IND(template uint8_t bts_nr := ?, |
| 491 | template uint8_t trx_nr := ?, |
| 492 | template uint8_t ts_nr := ?, |
| 493 | template uint8_t block_nr := ?, |
| 494 | template PCUIF_Sapi sapi := ?, |
Vadim Yanitskiy | c78ea26 | 2019-05-17 01:08:08 +0700 | [diff] [blame] | 495 | template octetstring data := ?) := { |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 496 | msg_type := PCU_IF_MSG_DATA_IND, |
| 497 | bts_nr := bts_nr, |
| 498 | spare := ?, |
| 499 | u := { |
| 500 | data_ind := { |
| 501 | sapi := sapi, |
| 502 | len := ?, |
| 503 | data := data, |
| 504 | fn := ?, |
| 505 | arfcn := ?, |
| 506 | trx_nr := trx_nr, |
| 507 | ts_nr := ts_nr, |
| 508 | block_nr := block_nr, |
| 509 | rssi := ?, |
| 510 | ber10k := ?, |
| 511 | ta_offs_qbits := ?, |
| 512 | lqual_cb := ? |
| 513 | } |
| 514 | } |
| 515 | } |
| 516 | |
| 517 | template (value) PCUIF_Message ts_PCUIF_DATA_REQ(uint8_t bts_nr, uint8_t trx_nr, |
| 518 | uint8_t ts_nr, uint8_t block_nr, |
| 519 | uint32_t fn, PCUIF_Sapi sapi, |
| 520 | octetstring data) := { |
| 521 | msg_type := PCU_IF_MSG_DATA_REQ, |
| 522 | bts_nr := bts_nr, |
| 523 | spare := '0000'O, |
| 524 | u := { |
| 525 | data_req := { |
| 526 | sapi := sapi, |
| 527 | len := lengthof(data), |
| 528 | data := data, |
| 529 | fn := fn, |
| 530 | arfcn := 0, /* unused in BTS */ |
| 531 | trx_nr := trx_nr, |
| 532 | ts_nr := ts_nr, |
| 533 | block_nr := block_nr, |
| 534 | /* measurement parameters below unused on Tx */ |
| 535 | rssi := 0, |
| 536 | ber10k := 0, |
| 537 | ta_offs_qbits := 0, |
| 538 | lqual_cb := 0 |
| 539 | } |
| 540 | } |
| 541 | } |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 542 | template PCUIF_Message tr_PCUIF_DATA_REQ(template uint8_t bts_nr, |
| 543 | template uint8_t trx_nr, |
| 544 | template uint8_t ts_nr, |
| 545 | template uint8_t block_nr := ?, |
| 546 | template uint32_t fn := ?, |
| 547 | template PCUIF_Sapi sapi := ?, |
| 548 | template octetstring data := ?) := { |
| 549 | msg_type := PCU_IF_MSG_DATA_REQ, |
| 550 | bts_nr := bts_nr, |
| 551 | spare := '0000'O, |
| 552 | u := { |
| 553 | data_req := { |
| 554 | sapi := sapi, |
| 555 | len := ?, |
| 556 | data := data, |
| 557 | fn := fn, |
Harald Welte | 0a3d63f | 2019-03-02 00:02:07 +0100 | [diff] [blame] | 558 | arfcn := ?, /* unused in BTS */ |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 559 | trx_nr := trx_nr, |
| 560 | ts_nr := ts_nr, |
| 561 | block_nr := block_nr, |
| 562 | /* measurement parameters below unused on Tx */ |
| 563 | rssi := 0, |
| 564 | ber10k := 0, |
| 565 | ta_offs_qbits := 0, |
| 566 | lqual_cb := 0 |
| 567 | } |
| 568 | } |
| 569 | } |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 570 | |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 571 | template (value) PCUIF_Message ts_PCUIF_DATA_CNF(template (value) uint8_t bts_nr, |
| 572 | template (value) uint8_t trx_nr, |
| 573 | template (value) uint8_t ts_nr, |
| 574 | template (value) uint8_t block_nr, |
| 575 | template (value) uint32_t fn, |
| 576 | template (value) uint16_t arfcn, |
| 577 | template (value) PCUIF_Sapi sapi, |
| 578 | template (value) octetstring data) := { |
| 579 | msg_type := PCU_IF_MSG_DATA_CNF, |
| 580 | bts_nr := bts_nr, |
| 581 | spare := '0000'O, |
| 582 | u := { |
| 583 | data_cnf := { |
| 584 | sapi := sapi, |
| 585 | len := 0, /* overwritten */ |
| 586 | data := data, |
| 587 | fn := fn, |
| 588 | arfcn := arfcn, |
| 589 | trx_nr := trx_nr, |
| 590 | ts_nr := ts_nr, |
| 591 | block_nr := block_nr, |
| 592 | rssi := 0, |
| 593 | ber10k := 0, |
| 594 | ta_offs_qbits := 0, |
| 595 | lqual_cb := 0 |
| 596 | } |
| 597 | } |
| 598 | } |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 599 | template PCUIF_Message tr_PCUIF_DATA_CNF(template uint8_t bts_nr := ?, |
| 600 | template uint8_t trx_nr := ?, |
| 601 | template uint8_t ts_nr := ?, |
| 602 | template PCUIF_Sapi sapi := ?, |
| 603 | template octetstring data := ?) := { |
| 604 | msg_type := PCU_IF_MSG_DATA_CNF, |
| 605 | bts_nr := bts_nr, |
| 606 | spare := ?, |
| 607 | u := { |
| 608 | data_cnf := { |
| 609 | sapi := sapi, |
| 610 | len := ?, |
| 611 | data := data, |
| 612 | fn := ?, |
| 613 | arfcn := ?, |
| 614 | trx_nr := trx_nr, |
| 615 | ts_nr := ts_nr, |
| 616 | block_nr := ?, |
| 617 | rssi := ?, |
| 618 | ber10k := ?, |
| 619 | ta_offs_qbits := ?, |
| 620 | lqual_cb := ? |
| 621 | } |
| 622 | } |
| 623 | } |
| 624 | |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 625 | 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] | 626 | template (value) uint8_t trx_nr, |
| 627 | template (value) uint8_t ts_nr, |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 628 | template (value) uint16_t ra, |
| 629 | template (value) uint8_t is_11bit, |
Harald Welte | 913bbf6 | 2019-03-01 00:39:19 +0100 | [diff] [blame] | 630 | template (value) PCUIF_BurstType burst_type, |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 631 | template (value) uint32_t fn, |
| 632 | template (value) uint16_t arfcn, |
Vadim Yanitskiy | 36aa611 | 2019-10-04 16:43:00 +0700 | [diff] [blame] | 633 | template (value) int16_t qta := 0, |
| 634 | template (value) PCUIF_Sapi sapi := PCU_IF_SAPI_RACH |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 635 | ) := { |
| 636 | msg_type := PCU_IF_MSG_RACH_IND, |
| 637 | bts_nr := bts_nr, |
| 638 | spare := '0000'O, |
| 639 | u := { |
| 640 | rach_ind := { |
Vadim Yanitskiy | 36aa611 | 2019-10-04 16:43:00 +0700 | [diff] [blame] | 641 | sapi := sapi, |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 642 | ra := ra, |
| 643 | qta := qta, |
| 644 | fn := fn, |
| 645 | arfcn := arfcn, |
| 646 | is_11bit := is_11bit, |
Vadim Yanitskiy | 36558d9 | 2019-11-17 02:23:51 +0700 | [diff] [blame] | 647 | burst_type := burst_type, |
| 648 | trx_nr := trx_nr, |
| 649 | ts_nr := ts_nr |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 650 | } |
| 651 | } |
| 652 | } |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 653 | template PCUIF_Message tr_PCUIF_RACH_IND(template uint8_t bts_nr := ?, |
Vadim Yanitskiy | 36558d9 | 2019-11-17 02:23:51 +0700 | [diff] [blame] | 654 | template uint8_t trx_nr := ?, |
| 655 | template uint8_t ts_nr := ?, |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 656 | template uint16_t ra := ?, |
| 657 | template uint8_t is_11bit := ?, |
Harald Welte | 913bbf6 | 2019-03-01 00:39:19 +0100 | [diff] [blame] | 658 | template PCUIF_BurstType burst_type := ?, |
Vadim Yanitskiy | 36aa611 | 2019-10-04 16:43:00 +0700 | [diff] [blame] | 659 | template uint32_t fn := ?, |
| 660 | template PCUIF_Sapi sapi := PCU_IF_SAPI_RACH) := { |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 661 | msg_type := PCU_IF_MSG_RACH_IND, |
| 662 | bts_nr := bts_nr, |
| 663 | spare := ?, |
| 664 | u := { |
| 665 | rach_ind := { |
Vadim Yanitskiy | 36aa611 | 2019-10-04 16:43:00 +0700 | [diff] [blame] | 666 | sapi := sapi, |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 667 | ra := ra, |
| 668 | qta := ?, |
| 669 | fn := fn, |
| 670 | arfcn := ?, |
| 671 | is_11bit := is_11bit, |
Vadim Yanitskiy | 36558d9 | 2019-11-17 02:23:51 +0700 | [diff] [blame] | 672 | burst_type := burst_type, |
| 673 | trx_nr := trx_nr, |
| 674 | ts_nr := ts_nr |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 675 | } |
| 676 | } |
| 677 | } |
| 678 | |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 679 | template (value) PCUIF_Message ts_PCUIF_PAG_REQ(template (value) uint8_t bts_nr, |
| 680 | template (value) OCT9 id_lv, |
| 681 | template (value) uint8_t chan_needed, |
| 682 | template (value) PCUIF_Sapi sapi) := { |
| 683 | msg_type := PCU_IF_MSG_PAG_REQ, |
| 684 | bts_nr := bts_nr, |
| 685 | spare := '0000'O, |
| 686 | u := { |
| 687 | pag_req := { |
| 688 | sapi := sapi, |
| 689 | chan_needed := chan_needed, |
| 690 | identity_lv := id_lv |
| 691 | } |
| 692 | } |
| 693 | } |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 694 | template PCUIF_Message tr_PCUIF_PAG_REQ(template uint8_t bts_nr := ?, |
| 695 | template OCT9 id_lv := ?, |
| 696 | template uint8_t chan_needed := ?, |
| 697 | template PCUIF_Sapi sapi := ?) := { |
| 698 | msg_type := PCU_IF_MSG_PAG_REQ, |
| 699 | bts_nr := bts_nr, |
| 700 | spare := ?, |
| 701 | u := { |
| 702 | pag_req := { |
| 703 | sapi := ?, |
| 704 | chan_needed := chan_needed, |
| 705 | identity_lv := id_lv |
| 706 | } |
| 707 | } |
| 708 | } |
| 709 | |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 710 | const PCUIF_Flags c_PCUIF_Flags_default := { |
| 711 | bts_active := true, |
| 712 | sysmo_direct_dsp := false, |
| 713 | spare := '00000000000000'B, |
| 714 | cs1 := true, |
| 715 | cs2 := true, |
| 716 | cs3 := true, |
| 717 | cs4 := true, |
| 718 | mcs1 := true, |
| 719 | mcs2 := true, |
| 720 | mcs3 := true, |
| 721 | mcs4 := true, |
| 722 | mcs5 := true, |
| 723 | mcs6 := true, |
| 724 | mcs7 := true, |
| 725 | mcs8 := true, |
| 726 | mcs9 := true, |
| 727 | spare2 := '000'B |
| 728 | }; |
| 729 | |
Vadim Yanitskiy | 9e1206c | 2020-07-19 15:52:31 +0700 | [diff] [blame] | 730 | template (value) PCUIF_InfoTrxTs ts_PCUIF_InfoTrxTsH0(template (value) uint3_t tsc := 7) := { |
| 731 | tsc := tsc, |
| 732 | hopping := 0, |
| 733 | hsn := 0, maio := 0, |
Vadim Yanitskiy | 43ccaf5 | 2020-09-05 21:35:13 +0700 | [diff] [blame] | 734 | ma_bit_len := 0, |
Vadim Yanitskiy | 9e1206c | 2020-07-19 15:52:31 +0700 | [diff] [blame] | 735 | ma := f_pad_bit(''B, 64, '0'B) |
| 736 | }; |
Vadim Yanitskiy | 355604c | 2020-08-03 04:19:05 +0700 | [diff] [blame] | 737 | template PCUIF_InfoTrxTs tr_PCUIF_InfoTrxTsH0(template uint3_t tsc := ?) := { |
| 738 | tsc := tsc, |
| 739 | hopping := 0, |
| 740 | hsn := ?, maio := ?, |
Vadim Yanitskiy | 43ccaf5 | 2020-09-05 21:35:13 +0700 | [diff] [blame] | 741 | ma_bit_len := ?, |
Vadim Yanitskiy | 355604c | 2020-08-03 04:19:05 +0700 | [diff] [blame] | 742 | ma := ? |
| 743 | }; |
Vadim Yanitskiy | 9e1206c | 2020-07-19 15:52:31 +0700 | [diff] [blame] | 744 | |
| 745 | template (value) PCUIF_InfoTrxTs ts_PCUIF_InfoTrxTsH1(template (value) uint3_t tsc := 7, |
| 746 | template (value) uint6_t hsn := 0, |
| 747 | template (value) uint6_t maio := 0, |
| 748 | template (value) bitstring ma := ''B) := { |
| 749 | tsc := tsc, |
| 750 | hopping := 1, |
| 751 | hsn := hsn, |
| 752 | maio := maio, |
Vadim Yanitskiy | 43ccaf5 | 2020-09-05 21:35:13 +0700 | [diff] [blame] | 753 | ma_bit_len := lengthof(valueof(ma)), |
Vadim Yanitskiy | 9e1206c | 2020-07-19 15:52:31 +0700 | [diff] [blame] | 754 | ma := f_pad_bit(valueof(ma), 64, '0'B) |
| 755 | }; |
Vadim Yanitskiy | 355604c | 2020-08-03 04:19:05 +0700 | [diff] [blame] | 756 | template PCUIF_InfoTrxTs tr_PCUIF_InfoTrxTsH1(template uint3_t tsc := ?, |
| 757 | template uint6_t hsn := ?, |
| 758 | template uint6_t maio := ?, |
Vadim Yanitskiy | 43ccaf5 | 2020-09-05 21:35:13 +0700 | [diff] [blame] | 759 | template bitstring ma := ?, |
| 760 | template uint8_t ma_bit_len := ?) := { |
Vadim Yanitskiy | 355604c | 2020-08-03 04:19:05 +0700 | [diff] [blame] | 761 | tsc := tsc, |
| 762 | hopping := 1, |
| 763 | hsn := hsn, |
| 764 | maio := maio, |
Vadim Yanitskiy | 43ccaf5 | 2020-09-05 21:35:13 +0700 | [diff] [blame] | 765 | ma_bit_len := ma_bit_len, |
Vadim Yanitskiy | 355604c | 2020-08-03 04:19:05 +0700 | [diff] [blame] | 766 | ma := ma |
| 767 | }; |
Vadim Yanitskiy | 9e1206c | 2020-07-19 15:52:31 +0700 | [diff] [blame] | 768 | |
| 769 | template (value) PCUIF_InfoV10Trx ts_PCUIF_InfoV10Trx(template (value) uint16_t arfcn := 871, |
| 770 | template (value) BIT8 pdch_mask := '00000001'B, |
| 771 | template (value) uint3_t tsc := 7) := { |
| 772 | arfcn := arfcn, |
| 773 | pdch_mask := pdch_mask, |
Vadim Yanitskiy | d805172 | 2020-08-22 02:33:17 +0700 | [diff] [blame] | 774 | spare := '00'O, |
Vadim Yanitskiy | 9e1206c | 2020-07-19 15:52:31 +0700 | [diff] [blame] | 775 | hLayer1 := 0, |
| 776 | ts := { |
| 777 | ts_PCUIF_InfoTrxTsH0(tsc), ts_PCUIF_InfoTrxTsH0(tsc), |
| 778 | ts_PCUIF_InfoTrxTsH0(tsc), ts_PCUIF_InfoTrxTsH0(tsc), |
| 779 | ts_PCUIF_InfoTrxTsH0(tsc), ts_PCUIF_InfoTrxTsH0(tsc), |
| 780 | ts_PCUIF_InfoTrxTsH0(tsc), ts_PCUIF_InfoTrxTsH0(tsc) |
| 781 | } |
| 782 | }; |
| 783 | |
| 784 | template (value) PCUIF_InfoV09Trx ts_PCUIF_InfoV09Trx(template (value) uint16_t arfcn := 871, |
| 785 | template (value) BIT8 pdch_mask := '00000001'B, |
| 786 | OCT1 tsc := '07'O) := { |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 787 | arfcn := arfcn, |
| 788 | pdch_mask := pdch_mask, |
| 789 | spare := '00'O, |
| 790 | tsc := tsc & tsc & tsc & tsc & tsc & tsc & tsc & tsc, |
| 791 | hLayer1 := 0 |
| 792 | } |
| 793 | |
Vadim Yanitskiy | 9e1206c | 2020-07-19 15:52:31 +0700 | [diff] [blame] | 794 | template (value) PCUIF_InfoV09Trx ts_PCUIF_InfoV09TrxNULL := ts_PCUIF_InfoV09Trx(0, '00000000'B, '00'O); |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 795 | |
Vadim Yanitskiy | 9e1206c | 2020-07-19 15:52:31 +0700 | [diff] [blame] | 796 | template (value) PCUIF_InfoTrxs ts_PCUIF_InfoV09Trxs_def := { |
| 797 | v09 := { |
| 798 | ts_PCUIF_InfoV09Trx, ts_PCUIF_InfoV09TrxNULL, |
| 799 | ts_PCUIF_InfoV09TrxNULL, ts_PCUIF_InfoV09TrxNULL, |
| 800 | ts_PCUIF_InfoV09TrxNULL, ts_PCUIF_InfoV09TrxNULL, |
| 801 | ts_PCUIF_InfoV09TrxNULL, ts_PCUIF_InfoV09TrxNULL |
| 802 | } |
| 803 | }; |
| 804 | |
| 805 | template (value) PCUIF_InfoTrxs ts_PCUIF_InfoV10Trxs_def := { |
| 806 | v10 := { |
| 807 | ts_PCUIF_InfoV10Trx, ts_PCUIF_InfoV10Trx, |
| 808 | ts_PCUIF_InfoV10Trx, ts_PCUIF_InfoV10Trx, |
| 809 | ts_PCUIF_InfoV10Trx, ts_PCUIF_InfoV10Trx, |
| 810 | ts_PCUIF_InfoV10Trx, ts_PCUIF_InfoV10Trx |
| 811 | } |
| 812 | }; |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 813 | |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 814 | 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] | 815 | template (value) PCUIF_info_ind info_ind) := { |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 816 | msg_type := PCU_IF_MSG_INFO_IND, |
| 817 | bts_nr := bts_nr, |
| 818 | spare := '0000'O, |
| 819 | u := { |
Pau Espin Pedrol | f787b09 | 2019-10-04 18:34:05 +0200 | [diff] [blame] | 820 | info_ind := info_ind |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 821 | } |
| 822 | } |
Harald Welte | d378a25 | 2018-03-13 17:02:14 +0100 | [diff] [blame] | 823 | template PCUIF_Message tr_PCUIF_INFO_IND(template uint8_t bts_nr := ?, |
| 824 | template PCUIF_Flags flags := ?, |
Vadim Yanitskiy | c155930 | 2020-07-19 16:39:12 +0700 | [diff] [blame] | 825 | template uint32_t version := mp_pcuif_version) := { |
Harald Welte | d378a25 | 2018-03-13 17:02:14 +0100 | [diff] [blame] | 826 | msg_type := PCU_IF_MSG_INFO_IND, |
| 827 | bts_nr := bts_nr, |
| 828 | spare := ?, |
| 829 | u := { |
| 830 | info_ind := { |
| 831 | version := version, |
| 832 | flags := flags, |
| 833 | trx := ?, |
| 834 | bsic := ?, |
| 835 | mcc := ?, |
| 836 | mnc :=?, |
Harald Welte | 3568dc7 | 2018-03-13 17:06:51 +0100 | [diff] [blame] | 837 | mnc_3_digits := ?, |
Harald Welte | d378a25 | 2018-03-13 17:02:14 +0100 | [diff] [blame] | 838 | lac := ?, |
| 839 | rac := ?, |
| 840 | nsei := ?, |
| 841 | nse_timer := ?, |
| 842 | cell_timer := ?, |
| 843 | cell_id := ?, |
| 844 | repeat_time := ?, |
| 845 | repeat_count := ?, |
| 846 | bvci := ?, |
| 847 | t3142 := ?, |
| 848 | t3169 := ?, |
| 849 | t3191 := ?, |
| 850 | t3193_10ms := ?, |
| 851 | t3195 := ?, |
| 852 | t3101 := ?, |
| 853 | t3103 := ?, |
| 854 | t3105 := ?, |
| 855 | cv_countdown := ?, |
| 856 | dl_tbf_ext := ?, |
| 857 | ul_tbf_ext := ?, |
| 858 | initial_cs := ?, |
| 859 | initial_mcs := ?, |
| 860 | nsvci := ?, |
Vadim Yanitskiy | 0d59080 | 2020-08-21 00:14:22 +0700 | [diff] [blame] | 861 | local_port := ?, |
Harald Welte | d378a25 | 2018-03-13 17:02:14 +0100 | [diff] [blame] | 862 | remote_port := ?, |
Alexander Couzens | 1e5dc48 | 2020-07-28 15:38:46 +0200 | [diff] [blame] | 863 | remote_addr := ? |
Harald Welte | d378a25 | 2018-03-13 17:02:14 +0100 | [diff] [blame] | 864 | } |
| 865 | } |
| 866 | } |
| 867 | |
Harald Welte | a321981 | 2019-03-02 00:02:28 +0100 | [diff] [blame] | 868 | template (value) PCUIF_Message ts_PCUIF_TIME_IND(template (value) uint8_t bts_nr, |
| 869 | template (value) uint32_t fn) := { |
| 870 | msg_type := PCU_IF_MSG_TIME_IND, |
| 871 | bts_nr := bts_nr, |
| 872 | spare := '0000'O, |
| 873 | u := { |
| 874 | time_ind := { |
| 875 | fn := fn |
| 876 | } |
| 877 | } |
| 878 | } |
| 879 | template PCUIF_Message tr_PCUIF_TIME_IND(template uint8_t bts_nr, |
| 880 | template uint32_t fn) := { |
| 881 | msg_type := PCU_IF_MSG_TIME_IND, |
| 882 | bts_nr := bts_nr, |
| 883 | spare := ?, |
| 884 | u := { |
| 885 | time_ind := { |
| 886 | fn := fn |
| 887 | } |
| 888 | } |
| 889 | } |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 890 | |
Harald Welte | 4bff40a | 2019-03-21 21:34:10 +0100 | [diff] [blame] | 891 | template (value) PCUIF_Message ts_PCUIF_SUSP_REQ(template (value) uint8_t bts_nr, |
| 892 | template (value) OCT4 tlli, |
| 893 | template (value) OCT6 ra_id, |
| 894 | template (value) uint8_t cause) := { |
| 895 | msg_type := PCU_IF_MSG_SUSP_REQ, |
| 896 | bts_nr := bts_nr, |
| 897 | spare := '0000'O, |
| 898 | u := { |
| 899 | susp_req := { |
| 900 | tlli := tlli, |
| 901 | ra_id := ra_id, |
| 902 | cause := cause |
| 903 | } |
| 904 | } |
| 905 | } |
| 906 | template PCUIF_Message tr_PCUIF_SUSP_REQ(template uint8_t bts_nr, |
| 907 | template OCT4 tlli, |
| 908 | template OCT6 ra_id, |
| 909 | template uint8_t cause) := { |
| 910 | msg_type := PCU_IF_MSG_SUSP_REQ, |
| 911 | bts_nr := bts_nr, |
| 912 | spare := '0000'O, |
| 913 | u := { |
| 914 | susp_req := { |
| 915 | tlli := tlli, |
| 916 | ra_id := ra_id, |
| 917 | cause := cause |
| 918 | } |
| 919 | } |
| 920 | } |
| 921 | |
Harald Welte | 11b734c | 2019-09-05 14:17:54 +0200 | [diff] [blame] | 922 | template (value) PCUIF_Message ts_PCUIF_APP_INFO_REQ(template (value) uint8_t bts_nr, |
| 923 | template (value) uint8_t app_type, |
| 924 | template (value) octetstring app_data) := { |
| 925 | msg_type := PCU_IF_MSG_APP_INFO_REQ, |
| 926 | bts_nr := bts_nr, |
| 927 | spare := '0000'O, |
| 928 | u := { |
| 929 | app_info_req := { |
| 930 | application_type := app_type, |
| 931 | len := 0, /* overwritten */ |
| 932 | data := app_data |
| 933 | } |
| 934 | } |
| 935 | } |
| 936 | template (present) PCUIF_Message tr_PCUIF_APP_INFO_REQ(template (present) uint8_t bts_nr, |
| 937 | template (present) uint8_t app_type, |
| 938 | template (present) octetstring app_data) := { |
| 939 | msg_type := PCU_IF_MSG_APP_INFO_REQ, |
| 940 | bts_nr := bts_nr, |
| 941 | spare := '0000'O, |
| 942 | u := { |
| 943 | app_info_req := { |
| 944 | application_type := app_type, |
| 945 | len := ?, |
| 946 | data := app_data |
| 947 | } |
| 948 | } |
| 949 | } |
| 950 | |
Harald Welte | 4bff40a | 2019-03-21 21:34:10 +0100 | [diff] [blame] | 951 | |
Vadim Yanitskiy | 9e1206c | 2020-07-19 15:52:31 +0700 | [diff] [blame] | 952 | /* TODO: remove this as soon as we drop version 9 support */ |
| 953 | function f_PCUIF_ver_INFO_Trxs() |
| 954 | return PCUIF_InfoTrxs { |
| 955 | if (PCUIF_Types.mp_pcuif_version >= 10) { |
| 956 | return valueof(ts_PCUIF_InfoV10Trxs_def); |
| 957 | } else { |
| 958 | return valueof(ts_PCUIF_InfoV09Trxs_def); |
| 959 | } |
| 960 | } |
| 961 | |
| 962 | function f_PCUIF_ver_INFO_PDCHMask(in PCUIF_info_ind info, uint8_t trx_nr) |
| 963 | return bitstring { |
| 964 | if (PCUIF_Types.mp_pcuif_version >= 10) { |
| 965 | return info.trx.v10[trx_nr].pdch_mask; |
| 966 | } else { |
| 967 | return info.trx.v09[trx_nr].pdch_mask; |
| 968 | } |
| 969 | } |
| 970 | |
Alexander Couzens | 1e5dc48 | 2020-07-28 15:38:46 +0200 | [diff] [blame] | 971 | /* TODO: second (redundant) NSVC connection is not (yet) supported */ |
| 972 | function f_PCUIF_ver_INFO_RemoteAddr(PCUIF_AddrType addr_type, |
| 973 | charstring addr) |
| 974 | return PCUIF_RemoteAddr { |
| 975 | var PCUIF_RemoteAddr remote_addr; |
| 976 | |
| 977 | if (PCUIF_Types.mp_pcuif_version >= 10) { |
| 978 | remote_addr.v10.addr_type[0] := addr_type; |
| 979 | if (addr_type == PCUIF_ADDR_TYPE_IPV4) { |
| 980 | remote_addr.v10.addr[0] := f_inet_addr(addr); |
| 981 | } else { |
| 982 | remote_addr.v10.addr[0] := f_inet6_addr(addr); |
| 983 | } |
| 984 | remote_addr.v10.addr_type[1] := PCUIF_ADDR_TYPE_UNSPEC; |
| 985 | remote_addr.v10.addr[1] := f_pad_oct(''O, 16, '00'O); |
| 986 | } else { |
| 987 | if (addr_type != PCUIF_ADDR_TYPE_IPV4) { |
| 988 | testcase.stop("NSVC address type := ", addr_type, |
| 989 | "is not supported in version := ", |
| 990 | PCUIF_Types.mp_pcuif_version); |
| 991 | } |
| 992 | /* v9 requires the IP in host byte order */ |
| 993 | remote_addr.v09.addr[0] := f_inet_haddr(addr); |
| 994 | remote_addr.v09.addr[0] := f_pad_oct(''O, 4, '00'O); |
| 995 | } |
| 996 | |
| 997 | return remote_addr; |
| 998 | } |
| 999 | |
Vadim Yanitskiy | 9e1206c | 2020-07-19 15:52:31 +0700 | [diff] [blame] | 1000 | |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 1001 | } with { encode "RAW" variant "BYTEORDER(first)" }; |