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 | 3568dc7 | 2018-03-13 17:06:51 +0100 | [diff] [blame] | 313 | variant "PADDING(1696)" /* 212 * 8 */ |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 314 | }; |
| 315 | |
| 316 | external function enc_PCUIF_Message(in PCUIF_Message pdu) return octetstring |
| 317 | with { extension "prototype(convert) encode(RAW)" }; |
| 318 | external function dec_PCUIF_Message(in octetstring stream) return PCUIF_Message |
| 319 | with { extension "prototype(convert) decode(RAW)" }; |
| 320 | |
| 321 | |
Vadim Yanitskiy | f7d9c0f | 2019-09-06 00:08:17 +0200 | [diff] [blame] | 322 | /* Generic template for matching messages by type and/or the BTS number */ |
| 323 | template PCUIF_Message tr_PCUIF_MSG(template PCUIF_MsgType msg_type := ?, |
| 324 | template uint8_t bts_nr := ?) := { |
| 325 | msg_type := msg_type, |
| 326 | bts_nr := bts_nr, |
| 327 | spare := ?, |
| 328 | u := ? |
| 329 | } |
| 330 | |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 331 | template (value) PCUIF_Message ts_PCUIF_RTS_REQ(template (value) uint8_t bts_nr, |
| 332 | template (value) uint8_t trx_nr, |
| 333 | template (value) uint8_t ts_nr, |
| 334 | template (value) PCUIF_Sapi sapi, |
| 335 | template (value) uint32_t fn, |
| 336 | template (value) uint16_t arfcn, |
| 337 | template (value) uint8_t block_nr |
| 338 | ) := { |
| 339 | msg_type := PCU_IF_MSG_RTS_REQ, |
| 340 | bts_nr := bts_nr, |
| 341 | spare := '0000'O, |
| 342 | u := { |
| 343 | rts_req := { |
| 344 | sapi := sapi, |
| 345 | spare := '000000'O, |
| 346 | fn := fn, |
| 347 | arfcn := arfcn, |
| 348 | trx_nr := trx_nr, |
| 349 | ts_nr := ts_nr, |
| 350 | block_nr := block_nr |
| 351 | } |
| 352 | } |
| 353 | } |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 354 | template PCUIF_Message tr_PCUIF_RTS_REQ(template uint8_t bts_nr := ?, |
| 355 | template uint8_t trx_nr := ?, |
| 356 | template uint8_t ts_nr := ?, |
| 357 | template PCUIF_Sapi sapi := ?, |
| 358 | template uint32_t fn := ?, |
| 359 | template uint8_t block_nr := ? |
| 360 | ) := { |
| 361 | msg_type := PCU_IF_MSG_RTS_REQ, |
| 362 | bts_nr := bts_nr, |
| 363 | spare := ?, |
| 364 | u := { |
| 365 | rts_req := { |
| 366 | sapi := sapi, |
| 367 | spare := ?, |
| 368 | fn := fn, |
| 369 | arfcn := ?, |
| 370 | trx_nr := trx_nr, |
| 371 | ts_nr := ts_nr, |
| 372 | block_nr := block_nr |
| 373 | } |
| 374 | } |
| 375 | } |
| 376 | |
| 377 | template (value) PCUIF_Message ts_PCUIF_TXT_IND(uint8_t bts_nr, PCUIF_TextType tt, charstring text) := { |
| 378 | msg_type := PCU_IF_MSG_TXT_IND, |
| 379 | bts_nr := bts_nr, |
| 380 | spare := '0000'O, |
| 381 | u := { |
| 382 | txt_ind := { |
| 383 | txt_type := tt, |
| 384 | text := text |
| 385 | } |
| 386 | } |
| 387 | } |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 388 | template PCUIF_Message tr_PCUIF_TXT_IND(template uint8_t bts_nr, template PCUIF_TextType tt, |
| 389 | template charstring text := ?) := { |
| 390 | msg_type := PCU_IF_MSG_TXT_IND, |
| 391 | bts_nr := bts_nr, |
| 392 | spare := '0000'O, |
| 393 | u := { |
| 394 | txt_ind := { |
| 395 | txt_type := tt, |
| 396 | text := text |
| 397 | } |
| 398 | } |
| 399 | } |
| 400 | |
| 401 | |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 402 | |
| 403 | template (value) PCUIF_Message ts_PCUIF_ACT_REQ(uint8_t bts_nr, uint8_t trx_nr, uint8_t ts_nr) := { |
| 404 | msg_type := PCU_IF_MSG_ACT_REQ, |
| 405 | bts_nr := bts_nr, |
| 406 | spare := '0000'O, |
| 407 | u := { |
| 408 | act_req := { |
| 409 | is_activate := 1, |
| 410 | trx_nr := trx_nr, |
| 411 | ts_nr := ts_nr, |
| 412 | spare := '00'O |
| 413 | } |
| 414 | } |
| 415 | } |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 416 | template PCUIF_Message tr_PCUIF_ACT_REQ(template uint8_t bts_nr, template uint8_t trx_nr, |
| 417 | template uint8_t ts_nr) := { |
| 418 | msg_type := PCU_IF_MSG_ACT_REQ, |
| 419 | bts_nr := bts_nr, |
| 420 | spare := '0000'O, |
| 421 | u := { |
| 422 | act_req := { |
| 423 | is_activate := 1, |
| 424 | trx_nr := trx_nr, |
| 425 | ts_nr := ts_nr, |
| 426 | spare := '00'O |
| 427 | } |
| 428 | } |
| 429 | } |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 430 | |
| 431 | template (value) PCUIF_Message ts_PCUIF_DEACT_REQ(uint8_t bts_nr, uint8_t trx_nr, uint8_t ts_nr) := { |
| 432 | msg_type := PCU_IF_MSG_ACT_REQ, |
| 433 | bts_nr := bts_nr, |
| 434 | spare := '0000'O, |
| 435 | u := { |
| 436 | act_req := { |
| 437 | is_activate := 0, |
| 438 | trx_nr := trx_nr, |
| 439 | ts_nr := ts_nr, |
| 440 | spare := '00'O |
| 441 | } |
| 442 | } |
| 443 | } |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 444 | template PCUIF_Message tr_PCUIF_DEACT_REQ(template uint8_t bts_nr, template uint8_t trx_nr, |
| 445 | template uint8_t ts_nr) := { |
| 446 | msg_type := PCU_IF_MSG_ACT_REQ, |
| 447 | bts_nr := bts_nr, |
| 448 | spare := '0000'O, |
| 449 | u := { |
| 450 | act_req := { |
| 451 | is_activate := 0, |
| 452 | trx_nr := trx_nr, |
| 453 | ts_nr := ts_nr, |
| 454 | spare := '00'O |
| 455 | } |
| 456 | } |
| 457 | } |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 458 | |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 459 | template (value) PCUIF_Message ts_PCUIF_DATA_IND(template (value) uint8_t bts_nr, |
| 460 | template (value) uint8_t trx_nr, |
| 461 | template (value) uint8_t ts_nr, |
| 462 | template (value) uint8_t block_nr, |
| 463 | template (value) PCUIF_Sapi sapi, |
Vadim Yanitskiy | c78ea26 | 2019-05-17 01:08:08 +0700 | [diff] [blame] | 464 | template (value) octetstring data, |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 465 | template (value) uint32_t fn, |
| 466 | template (value) uint16_t arfcn, |
| 467 | template (value) int8_t rssi := -80, |
| 468 | template (value) uint16_t ber10k := 0, |
| 469 | template (value) int16_t ta_offs_qbits := 0, |
| 470 | template (value) uint16_t lqual_cb := 10) := { |
| 471 | msg_type := PCU_IF_MSG_DATA_IND, |
| 472 | bts_nr := bts_nr, |
| 473 | spare := '0000'O, |
| 474 | u := { |
| 475 | data_ind := { |
| 476 | sapi := sapi, |
| 477 | len := lengthof(valueof(data)), |
| 478 | data := data, |
| 479 | fn := fn, |
| 480 | arfcn := arfcn, |
| 481 | trx_nr := trx_nr, |
| 482 | ts_nr := ts_nr, |
| 483 | block_nr := block_nr, |
| 484 | rssi := rssi, |
| 485 | ber10k := ber10k, |
| 486 | ta_offs_qbits := ta_offs_qbits, |
| 487 | lqual_cb := lqual_cb |
| 488 | } |
| 489 | } |
| 490 | } |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 491 | template PCUIF_Message tr_PCUIF_DATA_IND(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 PCUIF_Sapi sapi := ?, |
Vadim Yanitskiy | c78ea26 | 2019-05-17 01:08:08 +0700 | [diff] [blame] | 496 | template octetstring data := ?) := { |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 497 | msg_type := PCU_IF_MSG_DATA_IND, |
| 498 | bts_nr := bts_nr, |
| 499 | spare := ?, |
| 500 | u := { |
| 501 | data_ind := { |
| 502 | sapi := sapi, |
| 503 | len := ?, |
| 504 | data := data, |
| 505 | fn := ?, |
| 506 | arfcn := ?, |
| 507 | trx_nr := trx_nr, |
| 508 | ts_nr := ts_nr, |
| 509 | block_nr := block_nr, |
| 510 | rssi := ?, |
| 511 | ber10k := ?, |
| 512 | ta_offs_qbits := ?, |
| 513 | lqual_cb := ? |
| 514 | } |
| 515 | } |
| 516 | } |
| 517 | |
| 518 | template (value) PCUIF_Message ts_PCUIF_DATA_REQ(uint8_t bts_nr, uint8_t trx_nr, |
| 519 | uint8_t ts_nr, uint8_t block_nr, |
| 520 | uint32_t fn, PCUIF_Sapi sapi, |
| 521 | octetstring data) := { |
| 522 | msg_type := PCU_IF_MSG_DATA_REQ, |
| 523 | bts_nr := bts_nr, |
| 524 | spare := '0000'O, |
| 525 | u := { |
| 526 | data_req := { |
| 527 | sapi := sapi, |
| 528 | len := lengthof(data), |
| 529 | data := data, |
| 530 | fn := fn, |
| 531 | arfcn := 0, /* unused in BTS */ |
| 532 | trx_nr := trx_nr, |
| 533 | ts_nr := ts_nr, |
| 534 | block_nr := block_nr, |
| 535 | /* measurement parameters below unused on Tx */ |
| 536 | rssi := 0, |
| 537 | ber10k := 0, |
| 538 | ta_offs_qbits := 0, |
| 539 | lqual_cb := 0 |
| 540 | } |
| 541 | } |
| 542 | } |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 543 | template PCUIF_Message tr_PCUIF_DATA_REQ(template uint8_t bts_nr, |
| 544 | template uint8_t trx_nr, |
| 545 | template uint8_t ts_nr, |
| 546 | template uint8_t block_nr := ?, |
| 547 | template uint32_t fn := ?, |
| 548 | template PCUIF_Sapi sapi := ?, |
| 549 | template octetstring data := ?) := { |
| 550 | msg_type := PCU_IF_MSG_DATA_REQ, |
| 551 | bts_nr := bts_nr, |
| 552 | spare := '0000'O, |
| 553 | u := { |
| 554 | data_req := { |
| 555 | sapi := sapi, |
| 556 | len := ?, |
| 557 | data := data, |
| 558 | fn := fn, |
Harald Welte | 0a3d63f | 2019-03-02 00:02:07 +0100 | [diff] [blame] | 559 | arfcn := ?, /* unused in BTS */ |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 560 | trx_nr := trx_nr, |
| 561 | ts_nr := ts_nr, |
| 562 | block_nr := block_nr, |
| 563 | /* measurement parameters below unused on Tx */ |
| 564 | rssi := 0, |
| 565 | ber10k := 0, |
| 566 | ta_offs_qbits := 0, |
| 567 | lqual_cb := 0 |
| 568 | } |
| 569 | } |
| 570 | } |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 571 | |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 572 | template (value) PCUIF_Message ts_PCUIF_DATA_CNF(template (value) uint8_t bts_nr, |
| 573 | template (value) uint8_t trx_nr, |
| 574 | template (value) uint8_t ts_nr, |
| 575 | template (value) uint8_t block_nr, |
| 576 | template (value) uint32_t fn, |
| 577 | template (value) uint16_t arfcn, |
| 578 | template (value) PCUIF_Sapi sapi, |
| 579 | template (value) octetstring data) := { |
| 580 | msg_type := PCU_IF_MSG_DATA_CNF, |
| 581 | bts_nr := bts_nr, |
| 582 | spare := '0000'O, |
| 583 | u := { |
| 584 | data_cnf := { |
| 585 | sapi := sapi, |
| 586 | len := 0, /* overwritten */ |
| 587 | data := data, |
| 588 | fn := fn, |
| 589 | arfcn := arfcn, |
| 590 | trx_nr := trx_nr, |
| 591 | ts_nr := ts_nr, |
| 592 | block_nr := block_nr, |
| 593 | rssi := 0, |
| 594 | ber10k := 0, |
| 595 | ta_offs_qbits := 0, |
| 596 | lqual_cb := 0 |
| 597 | } |
| 598 | } |
| 599 | } |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 600 | template PCUIF_Message tr_PCUIF_DATA_CNF(template uint8_t bts_nr := ?, |
| 601 | template uint8_t trx_nr := ?, |
| 602 | template uint8_t ts_nr := ?, |
| 603 | template PCUIF_Sapi sapi := ?, |
| 604 | template octetstring data := ?) := { |
| 605 | msg_type := PCU_IF_MSG_DATA_CNF, |
| 606 | bts_nr := bts_nr, |
| 607 | spare := ?, |
| 608 | u := { |
| 609 | data_cnf := { |
| 610 | sapi := sapi, |
| 611 | len := ?, |
| 612 | data := data, |
| 613 | fn := ?, |
| 614 | arfcn := ?, |
| 615 | trx_nr := trx_nr, |
| 616 | ts_nr := ts_nr, |
| 617 | block_nr := ?, |
| 618 | rssi := ?, |
| 619 | ber10k := ?, |
| 620 | ta_offs_qbits := ?, |
| 621 | lqual_cb := ? |
| 622 | } |
| 623 | } |
| 624 | } |
| 625 | |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 626 | 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] | 627 | template (value) uint8_t trx_nr, |
| 628 | template (value) uint8_t ts_nr, |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 629 | template (value) uint16_t ra, |
| 630 | template (value) uint8_t is_11bit, |
Harald Welte | 913bbf6 | 2019-03-01 00:39:19 +0100 | [diff] [blame] | 631 | template (value) PCUIF_BurstType burst_type, |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 632 | template (value) uint32_t fn, |
| 633 | template (value) uint16_t arfcn, |
Vadim Yanitskiy | 36aa611 | 2019-10-04 16:43:00 +0700 | [diff] [blame] | 634 | template (value) int16_t qta := 0, |
| 635 | template (value) PCUIF_Sapi sapi := PCU_IF_SAPI_RACH |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 636 | ) := { |
| 637 | msg_type := PCU_IF_MSG_RACH_IND, |
| 638 | bts_nr := bts_nr, |
| 639 | spare := '0000'O, |
| 640 | u := { |
| 641 | rach_ind := { |
Vadim Yanitskiy | 36aa611 | 2019-10-04 16:43:00 +0700 | [diff] [blame] | 642 | sapi := sapi, |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 643 | ra := ra, |
| 644 | qta := qta, |
| 645 | fn := fn, |
| 646 | arfcn := arfcn, |
| 647 | is_11bit := is_11bit, |
Vadim Yanitskiy | 36558d9 | 2019-11-17 02:23:51 +0700 | [diff] [blame] | 648 | burst_type := burst_type, |
| 649 | trx_nr := trx_nr, |
| 650 | ts_nr := ts_nr |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 651 | } |
| 652 | } |
| 653 | } |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 654 | template PCUIF_Message tr_PCUIF_RACH_IND(template uint8_t bts_nr := ?, |
Vadim Yanitskiy | 36558d9 | 2019-11-17 02:23:51 +0700 | [diff] [blame] | 655 | template uint8_t trx_nr := ?, |
| 656 | template uint8_t ts_nr := ?, |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 657 | template uint16_t ra := ?, |
| 658 | template uint8_t is_11bit := ?, |
Harald Welte | 913bbf6 | 2019-03-01 00:39:19 +0100 | [diff] [blame] | 659 | template PCUIF_BurstType burst_type := ?, |
Vadim Yanitskiy | 36aa611 | 2019-10-04 16:43:00 +0700 | [diff] [blame] | 660 | template uint32_t fn := ?, |
| 661 | template PCUIF_Sapi sapi := PCU_IF_SAPI_RACH) := { |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 662 | msg_type := PCU_IF_MSG_RACH_IND, |
| 663 | bts_nr := bts_nr, |
| 664 | spare := ?, |
| 665 | u := { |
| 666 | rach_ind := { |
Vadim Yanitskiy | 36aa611 | 2019-10-04 16:43:00 +0700 | [diff] [blame] | 667 | sapi := sapi, |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 668 | ra := ra, |
| 669 | qta := ?, |
| 670 | fn := fn, |
| 671 | arfcn := ?, |
| 672 | is_11bit := is_11bit, |
Vadim Yanitskiy | 36558d9 | 2019-11-17 02:23:51 +0700 | [diff] [blame] | 673 | burst_type := burst_type, |
| 674 | trx_nr := trx_nr, |
| 675 | ts_nr := ts_nr |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 676 | } |
| 677 | } |
| 678 | } |
| 679 | |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 680 | template (value) PCUIF_Message ts_PCUIF_PAG_REQ(template (value) uint8_t bts_nr, |
| 681 | template (value) OCT9 id_lv, |
| 682 | template (value) uint8_t chan_needed, |
| 683 | template (value) PCUIF_Sapi sapi) := { |
| 684 | msg_type := PCU_IF_MSG_PAG_REQ, |
| 685 | bts_nr := bts_nr, |
| 686 | spare := '0000'O, |
| 687 | u := { |
| 688 | pag_req := { |
| 689 | sapi := sapi, |
| 690 | chan_needed := chan_needed, |
| 691 | identity_lv := id_lv |
| 692 | } |
| 693 | } |
| 694 | } |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 695 | template PCUIF_Message tr_PCUIF_PAG_REQ(template uint8_t bts_nr := ?, |
| 696 | template OCT9 id_lv := ?, |
| 697 | template uint8_t chan_needed := ?, |
| 698 | template PCUIF_Sapi sapi := ?) := { |
| 699 | msg_type := PCU_IF_MSG_PAG_REQ, |
| 700 | bts_nr := bts_nr, |
| 701 | spare := ?, |
| 702 | u := { |
| 703 | pag_req := { |
| 704 | sapi := ?, |
| 705 | chan_needed := chan_needed, |
| 706 | identity_lv := id_lv |
| 707 | } |
| 708 | } |
| 709 | } |
| 710 | |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 711 | const PCUIF_Flags c_PCUIF_Flags_default := { |
| 712 | bts_active := true, |
| 713 | sysmo_direct_dsp := false, |
| 714 | spare := '00000000000000'B, |
| 715 | cs1 := true, |
| 716 | cs2 := true, |
| 717 | cs3 := true, |
| 718 | cs4 := true, |
| 719 | mcs1 := true, |
| 720 | mcs2 := true, |
| 721 | mcs3 := true, |
| 722 | mcs4 := true, |
| 723 | mcs5 := true, |
| 724 | mcs6 := true, |
| 725 | mcs7 := true, |
| 726 | mcs8 := true, |
| 727 | mcs9 := true, |
| 728 | spare2 := '000'B |
| 729 | }; |
| 730 | |
Vadim Yanitskiy | 9e1206c | 2020-07-19 15:52:31 +0700 | [diff] [blame] | 731 | template (value) PCUIF_InfoTrxTs ts_PCUIF_InfoTrxTsH0(template (value) uint3_t tsc := 7) := { |
| 732 | tsc := tsc, |
| 733 | hopping := 0, |
| 734 | hsn := 0, maio := 0, |
Vadim Yanitskiy | 43ccaf5 | 2020-09-05 21:35:13 +0700 | [diff] [blame] | 735 | ma_bit_len := 0, |
Vadim Yanitskiy | 9e1206c | 2020-07-19 15:52:31 +0700 | [diff] [blame] | 736 | ma := f_pad_bit(''B, 64, '0'B) |
| 737 | }; |
Vadim Yanitskiy | 355604c | 2020-08-03 04:19:05 +0700 | [diff] [blame] | 738 | template PCUIF_InfoTrxTs tr_PCUIF_InfoTrxTsH0(template uint3_t tsc := ?) := { |
| 739 | tsc := tsc, |
| 740 | hopping := 0, |
| 741 | hsn := ?, maio := ?, |
Vadim Yanitskiy | 43ccaf5 | 2020-09-05 21:35:13 +0700 | [diff] [blame] | 742 | ma_bit_len := ?, |
Vadim Yanitskiy | 355604c | 2020-08-03 04:19:05 +0700 | [diff] [blame] | 743 | ma := ? |
| 744 | }; |
Vadim Yanitskiy | 9e1206c | 2020-07-19 15:52:31 +0700 | [diff] [blame] | 745 | |
| 746 | template (value) PCUIF_InfoTrxTs ts_PCUIF_InfoTrxTsH1(template (value) uint3_t tsc := 7, |
| 747 | template (value) uint6_t hsn := 0, |
| 748 | template (value) uint6_t maio := 0, |
| 749 | template (value) bitstring ma := ''B) := { |
| 750 | tsc := tsc, |
| 751 | hopping := 1, |
| 752 | hsn := hsn, |
| 753 | maio := maio, |
Vadim Yanitskiy | 43ccaf5 | 2020-09-05 21:35:13 +0700 | [diff] [blame] | 754 | ma_bit_len := lengthof(valueof(ma)), |
Vadim Yanitskiy | 9e1206c | 2020-07-19 15:52:31 +0700 | [diff] [blame] | 755 | ma := f_pad_bit(valueof(ma), 64, '0'B) |
| 756 | }; |
Vadim Yanitskiy | 355604c | 2020-08-03 04:19:05 +0700 | [diff] [blame] | 757 | template PCUIF_InfoTrxTs tr_PCUIF_InfoTrxTsH1(template uint3_t tsc := ?, |
| 758 | template uint6_t hsn := ?, |
| 759 | template uint6_t maio := ?, |
Vadim Yanitskiy | 43ccaf5 | 2020-09-05 21:35:13 +0700 | [diff] [blame] | 760 | template bitstring ma := ?, |
| 761 | template uint8_t ma_bit_len := ?) := { |
Vadim Yanitskiy | 355604c | 2020-08-03 04:19:05 +0700 | [diff] [blame] | 762 | tsc := tsc, |
| 763 | hopping := 1, |
| 764 | hsn := hsn, |
| 765 | maio := maio, |
Vadim Yanitskiy | 43ccaf5 | 2020-09-05 21:35:13 +0700 | [diff] [blame] | 766 | ma_bit_len := ma_bit_len, |
Vadim Yanitskiy | 355604c | 2020-08-03 04:19:05 +0700 | [diff] [blame] | 767 | ma := ma |
| 768 | }; |
Vadim Yanitskiy | 9e1206c | 2020-07-19 15:52:31 +0700 | [diff] [blame] | 769 | |
| 770 | template (value) PCUIF_InfoV10Trx ts_PCUIF_InfoV10Trx(template (value) uint16_t arfcn := 871, |
| 771 | template (value) BIT8 pdch_mask := '00000001'B, |
| 772 | template (value) uint3_t tsc := 7) := { |
| 773 | arfcn := arfcn, |
| 774 | pdch_mask := pdch_mask, |
Vadim Yanitskiy | d805172 | 2020-08-22 02:33:17 +0700 | [diff] [blame] | 775 | spare := '00'O, |
Vadim Yanitskiy | 9e1206c | 2020-07-19 15:52:31 +0700 | [diff] [blame] | 776 | hLayer1 := 0, |
| 777 | ts := { |
| 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 | ts_PCUIF_InfoTrxTsH0(tsc), ts_PCUIF_InfoTrxTsH0(tsc) |
| 782 | } |
| 783 | }; |
| 784 | |
| 785 | template (value) PCUIF_InfoV09Trx ts_PCUIF_InfoV09Trx(template (value) uint16_t arfcn := 871, |
| 786 | template (value) BIT8 pdch_mask := '00000001'B, |
| 787 | OCT1 tsc := '07'O) := { |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 788 | arfcn := arfcn, |
| 789 | pdch_mask := pdch_mask, |
| 790 | spare := '00'O, |
| 791 | tsc := tsc & tsc & tsc & tsc & tsc & tsc & tsc & tsc, |
| 792 | hLayer1 := 0 |
| 793 | } |
| 794 | |
Vadim Yanitskiy | 9e1206c | 2020-07-19 15:52:31 +0700 | [diff] [blame] | 795 | 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] | 796 | |
Vadim Yanitskiy | 9e1206c | 2020-07-19 15:52:31 +0700 | [diff] [blame] | 797 | template (value) PCUIF_InfoTrxs ts_PCUIF_InfoV09Trxs_def := { |
| 798 | v09 := { |
| 799 | ts_PCUIF_InfoV09Trx, ts_PCUIF_InfoV09TrxNULL, |
| 800 | ts_PCUIF_InfoV09TrxNULL, ts_PCUIF_InfoV09TrxNULL, |
| 801 | ts_PCUIF_InfoV09TrxNULL, ts_PCUIF_InfoV09TrxNULL, |
| 802 | ts_PCUIF_InfoV09TrxNULL, ts_PCUIF_InfoV09TrxNULL |
| 803 | } |
| 804 | }; |
| 805 | |
| 806 | template (value) PCUIF_InfoTrxs ts_PCUIF_InfoV10Trxs_def := { |
| 807 | v10 := { |
| 808 | ts_PCUIF_InfoV10Trx, ts_PCUIF_InfoV10Trx, |
| 809 | ts_PCUIF_InfoV10Trx, ts_PCUIF_InfoV10Trx, |
| 810 | ts_PCUIF_InfoV10Trx, ts_PCUIF_InfoV10Trx, |
| 811 | ts_PCUIF_InfoV10Trx, ts_PCUIF_InfoV10Trx |
| 812 | } |
| 813 | }; |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 814 | |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 815 | 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] | 816 | template (value) PCUIF_info_ind info_ind) := { |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 817 | msg_type := PCU_IF_MSG_INFO_IND, |
| 818 | bts_nr := bts_nr, |
| 819 | spare := '0000'O, |
| 820 | u := { |
Pau Espin Pedrol | f787b09 | 2019-10-04 18:34:05 +0200 | [diff] [blame] | 821 | info_ind := info_ind |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 822 | } |
| 823 | } |
Harald Welte | d378a25 | 2018-03-13 17:02:14 +0100 | [diff] [blame] | 824 | template PCUIF_Message tr_PCUIF_INFO_IND(template uint8_t bts_nr := ?, |
| 825 | template PCUIF_Flags flags := ?, |
Vadim Yanitskiy | c155930 | 2020-07-19 16:39:12 +0700 | [diff] [blame] | 826 | template uint32_t version := mp_pcuif_version) := { |
Harald Welte | d378a25 | 2018-03-13 17:02:14 +0100 | [diff] [blame] | 827 | msg_type := PCU_IF_MSG_INFO_IND, |
| 828 | bts_nr := bts_nr, |
| 829 | spare := ?, |
| 830 | u := { |
| 831 | info_ind := { |
| 832 | version := version, |
| 833 | flags := flags, |
| 834 | trx := ?, |
| 835 | bsic := ?, |
| 836 | mcc := ?, |
| 837 | mnc :=?, |
Harald Welte | 3568dc7 | 2018-03-13 17:06:51 +0100 | [diff] [blame] | 838 | mnc_3_digits := ?, |
Harald Welte | d378a25 | 2018-03-13 17:02:14 +0100 | [diff] [blame] | 839 | lac := ?, |
| 840 | rac := ?, |
| 841 | nsei := ?, |
| 842 | nse_timer := ?, |
| 843 | cell_timer := ?, |
| 844 | cell_id := ?, |
| 845 | repeat_time := ?, |
| 846 | repeat_count := ?, |
| 847 | bvci := ?, |
| 848 | t3142 := ?, |
| 849 | t3169 := ?, |
| 850 | t3191 := ?, |
| 851 | t3193_10ms := ?, |
| 852 | t3195 := ?, |
| 853 | t3101 := ?, |
| 854 | t3103 := ?, |
| 855 | t3105 := ?, |
| 856 | cv_countdown := ?, |
| 857 | dl_tbf_ext := ?, |
| 858 | ul_tbf_ext := ?, |
| 859 | initial_cs := ?, |
| 860 | initial_mcs := ?, |
| 861 | nsvci := ?, |
Vadim Yanitskiy | 0d59080 | 2020-08-21 00:14:22 +0700 | [diff] [blame] | 862 | local_port := ?, |
Harald Welte | d378a25 | 2018-03-13 17:02:14 +0100 | [diff] [blame] | 863 | remote_port := ?, |
Alexander Couzens | 1e5dc48 | 2020-07-28 15:38:46 +0200 | [diff] [blame^] | 864 | remote_addr := ? |
Harald Welte | d378a25 | 2018-03-13 17:02:14 +0100 | [diff] [blame] | 865 | } |
| 866 | } |
| 867 | } |
| 868 | |
Harald Welte | a321981 | 2019-03-02 00:02:28 +0100 | [diff] [blame] | 869 | template (value) PCUIF_Message ts_PCUIF_TIME_IND(template (value) uint8_t bts_nr, |
| 870 | template (value) uint32_t fn) := { |
| 871 | msg_type := PCU_IF_MSG_TIME_IND, |
| 872 | bts_nr := bts_nr, |
| 873 | spare := '0000'O, |
| 874 | u := { |
| 875 | time_ind := { |
| 876 | fn := fn |
| 877 | } |
| 878 | } |
| 879 | } |
| 880 | template PCUIF_Message tr_PCUIF_TIME_IND(template uint8_t bts_nr, |
| 881 | template uint32_t fn) := { |
| 882 | msg_type := PCU_IF_MSG_TIME_IND, |
| 883 | bts_nr := bts_nr, |
| 884 | spare := ?, |
| 885 | u := { |
| 886 | time_ind := { |
| 887 | fn := fn |
| 888 | } |
| 889 | } |
| 890 | } |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 891 | |
Harald Welte | 4bff40a | 2019-03-21 21:34:10 +0100 | [diff] [blame] | 892 | template (value) PCUIF_Message ts_PCUIF_SUSP_REQ(template (value) uint8_t bts_nr, |
| 893 | template (value) OCT4 tlli, |
| 894 | template (value) OCT6 ra_id, |
| 895 | template (value) uint8_t cause) := { |
| 896 | msg_type := PCU_IF_MSG_SUSP_REQ, |
| 897 | bts_nr := bts_nr, |
| 898 | spare := '0000'O, |
| 899 | u := { |
| 900 | susp_req := { |
| 901 | tlli := tlli, |
| 902 | ra_id := ra_id, |
| 903 | cause := cause |
| 904 | } |
| 905 | } |
| 906 | } |
| 907 | template PCUIF_Message tr_PCUIF_SUSP_REQ(template uint8_t bts_nr, |
| 908 | template OCT4 tlli, |
| 909 | template OCT6 ra_id, |
| 910 | template uint8_t cause) := { |
| 911 | msg_type := PCU_IF_MSG_SUSP_REQ, |
| 912 | bts_nr := bts_nr, |
| 913 | spare := '0000'O, |
| 914 | u := { |
| 915 | susp_req := { |
| 916 | tlli := tlli, |
| 917 | ra_id := ra_id, |
| 918 | cause := cause |
| 919 | } |
| 920 | } |
| 921 | } |
| 922 | |
Harald Welte | 11b734c | 2019-09-05 14:17:54 +0200 | [diff] [blame] | 923 | template (value) PCUIF_Message ts_PCUIF_APP_INFO_REQ(template (value) uint8_t bts_nr, |
| 924 | template (value) uint8_t app_type, |
| 925 | template (value) octetstring app_data) := { |
| 926 | msg_type := PCU_IF_MSG_APP_INFO_REQ, |
| 927 | bts_nr := bts_nr, |
| 928 | spare := '0000'O, |
| 929 | u := { |
| 930 | app_info_req := { |
| 931 | application_type := app_type, |
| 932 | len := 0, /* overwritten */ |
| 933 | data := app_data |
| 934 | } |
| 935 | } |
| 936 | } |
| 937 | template (present) PCUIF_Message tr_PCUIF_APP_INFO_REQ(template (present) uint8_t bts_nr, |
| 938 | template (present) uint8_t app_type, |
| 939 | template (present) octetstring app_data) := { |
| 940 | msg_type := PCU_IF_MSG_APP_INFO_REQ, |
| 941 | bts_nr := bts_nr, |
| 942 | spare := '0000'O, |
| 943 | u := { |
| 944 | app_info_req := { |
| 945 | application_type := app_type, |
| 946 | len := ?, |
| 947 | data := app_data |
| 948 | } |
| 949 | } |
| 950 | } |
| 951 | |
Harald Welte | 4bff40a | 2019-03-21 21:34:10 +0100 | [diff] [blame] | 952 | |
Vadim Yanitskiy | 9e1206c | 2020-07-19 15:52:31 +0700 | [diff] [blame] | 953 | /* TODO: remove this as soon as we drop version 9 support */ |
| 954 | function f_PCUIF_ver_INFO_Trxs() |
| 955 | return PCUIF_InfoTrxs { |
| 956 | if (PCUIF_Types.mp_pcuif_version >= 10) { |
| 957 | return valueof(ts_PCUIF_InfoV10Trxs_def); |
| 958 | } else { |
| 959 | return valueof(ts_PCUIF_InfoV09Trxs_def); |
| 960 | } |
| 961 | } |
| 962 | |
| 963 | function f_PCUIF_ver_INFO_PDCHMask(in PCUIF_info_ind info, uint8_t trx_nr) |
| 964 | return bitstring { |
| 965 | if (PCUIF_Types.mp_pcuif_version >= 10) { |
| 966 | return info.trx.v10[trx_nr].pdch_mask; |
| 967 | } else { |
| 968 | return info.trx.v09[trx_nr].pdch_mask; |
| 969 | } |
| 970 | } |
| 971 | |
Alexander Couzens | 1e5dc48 | 2020-07-28 15:38:46 +0200 | [diff] [blame^] | 972 | /* TODO: second (redundant) NSVC connection is not (yet) supported */ |
| 973 | function f_PCUIF_ver_INFO_RemoteAddr(PCUIF_AddrType addr_type, |
| 974 | charstring addr) |
| 975 | return PCUIF_RemoteAddr { |
| 976 | var PCUIF_RemoteAddr remote_addr; |
| 977 | |
| 978 | if (PCUIF_Types.mp_pcuif_version >= 10) { |
| 979 | remote_addr.v10.addr_type[0] := addr_type; |
| 980 | if (addr_type == PCUIF_ADDR_TYPE_IPV4) { |
| 981 | remote_addr.v10.addr[0] := f_inet_addr(addr); |
| 982 | } else { |
| 983 | remote_addr.v10.addr[0] := f_inet6_addr(addr); |
| 984 | } |
| 985 | remote_addr.v10.addr_type[1] := PCUIF_ADDR_TYPE_UNSPEC; |
| 986 | remote_addr.v10.addr[1] := f_pad_oct(''O, 16, '00'O); |
| 987 | } else { |
| 988 | if (addr_type != PCUIF_ADDR_TYPE_IPV4) { |
| 989 | testcase.stop("NSVC address type := ", addr_type, |
| 990 | "is not supported in version := ", |
| 991 | PCUIF_Types.mp_pcuif_version); |
| 992 | } |
| 993 | /* v9 requires the IP in host byte order */ |
| 994 | remote_addr.v09.addr[0] := f_inet_haddr(addr); |
| 995 | remote_addr.v09.addr[0] := f_pad_oct(''O, 4, '00'O); |
| 996 | } |
| 997 | |
| 998 | return remote_addr; |
| 999 | } |
| 1000 | |
Vadim Yanitskiy | 9e1206c | 2020-07-19 15:52:31 +0700 | [diff] [blame] | 1001 | |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 1002 | } with { encode "RAW" variant "BYTEORDER(first)" }; |