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 */ |
Philipp Maier | 3b4abb8 | 2023-06-23 16:27:46 +0200 | [diff] [blame] | 20 | PCUIF_Version mp_pcuif_version := 11; |
Vadim Yanitskiy | c155930 | 2020-07-19 16:39:12 +0700 | [diff] [blame] | 21 | }; |
| 22 | |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 23 | const charstring PCU_SOCK_DEFAULT := "/tmp/pcu_bts"; |
Philipp Maier | 3b4abb8 | 2023-06-23 16:27:46 +0200 | [diff] [blame] | 24 | type integer PCUIF_Version (9..11); /* 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), |
Philipp Maier | 310520b | 2023-05-04 13:10:18 +0200 | [diff] [blame] | 36 | PCU_IF_MSG_E1_CCU_IND ('33'O), |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 37 | PCU_IF_MSG_ACT_REQ ('40'O), |
| 38 | PCU_IF_MSG_TIME_IND ('52'O), |
Vadim Yanitskiy | d0766b2 | 2021-06-18 15:39:04 +0200 | [diff] [blame] | 39 | PCU_IF_MSG_INTERF_IND ('53'O), |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 40 | PCU_IF_MSG_PAG_REQ ('60'O), |
Pau Espin Pedrol | 65d712e | 2021-06-25 13:55:38 +0200 | [diff] [blame] | 41 | PCU_IF_MSG_TXT_IND ('70'O), |
Pau Espin Pedrol | f28fd08 | 2021-09-07 20:02:25 +0200 | [diff] [blame] | 42 | PCU_IF_MSG_CONTAINER ('80'O), |
| 43 | /* Container payload message types: */ |
| 44 | PCU_IF_MSG_NEIGH_ADDR_REQ ('81'O), |
| 45 | PCU_IF_MSG_NEIGH_ADDR_CNF ('82'O) |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 46 | } with { variant "FIELDLENGTH(8)" }; |
| 47 | |
| 48 | type enumerated PCUIF_Sapi { |
| 49 | PCU_IF_SAPI_UNKNOWN ('00'O), |
| 50 | PCU_IF_SAPI_RACH ('01'O), |
| 51 | PCU_IF_SAPI_AGCH ('02'O), |
| 52 | PCU_IF_SAPI_PCH ('03'O), |
| 53 | PCU_IF_SAPI_BCCH ('04'O), |
| 54 | PCU_IF_SAPI_PDTCH ('05'O), |
| 55 | PCU_IF_SAPI_PRACH ('06'O), |
| 56 | PCU_IF_SAPI_PTCCH ('07'O), |
Philipp Maier | 81503af | 2023-05-04 12:52:07 +0200 | [diff] [blame] | 57 | PCU_IF_SAPI_PCH_DT ('08'O) |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 58 | } with { variant "FIELDLENGTH(8)" }; |
| 59 | |
| 60 | type record PCUIF_Flags { |
| 61 | boolean bts_active, |
| 62 | boolean sysmo_direct_dsp, |
| 63 | BIT14 spare, |
| 64 | boolean cs1, |
| 65 | boolean cs2, |
| 66 | boolean cs3, |
| 67 | boolean cs4, |
| 68 | boolean mcs1, |
| 69 | boolean mcs2, |
| 70 | boolean mcs3, |
| 71 | boolean mcs4, |
| 72 | boolean mcs5, |
| 73 | boolean mcs6, |
| 74 | boolean mcs7, |
| 75 | boolean mcs8, |
| 76 | boolean mcs9, |
| 77 | BIT3 spare2 |
| 78 | } with { variant "" }; |
| 79 | |
| 80 | type enumerated PCUIF_TextType { |
| 81 | PCU_VERSION (0), |
| 82 | PCU_OML_ALERT (1) |
| 83 | } with { variant "FIELDLENGTH(8)" }; |
| 84 | |
Vadim Yanitskiy | e1527f7 | 2019-09-09 02:15:33 +0200 | [diff] [blame] | 85 | type charstring PCUIF_Text length(128) with { variant "FIELDLENGTH(null_terminated)" }; |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 86 | |
| 87 | type record PCUIF_txt_ind { |
| 88 | PCUIF_TextType txt_type, |
| 89 | PCUIF_Text text |
| 90 | } with { variant "" }; |
| 91 | |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 92 | type record PCUIF_data { |
| 93 | PCUIF_Sapi sapi, |
| 94 | uint8_t len, |
Vadim Yanitskiy | d8f28e6 | 2019-09-10 18:11:52 +0200 | [diff] [blame] | 95 | octetstring data length(162), |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 96 | uint32_t fn, |
| 97 | uint16_t arfcn, |
| 98 | uint8_t trx_nr, |
| 99 | uint8_t ts_nr, |
| 100 | uint8_t block_nr, |
| 101 | int8_t rssi, |
| 102 | uint16_t ber10k, |
| 103 | int16_t ta_offs_qbits, |
| 104 | int16_t lqual_cb |
Vadim Yanitskiy | d8f28e6 | 2019-09-10 18:11:52 +0200 | [diff] [blame] | 105 | } with { variant (data) "FIELDLENGTH(162), ALIGN(left)" }; |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 106 | |
| 107 | type record PCUIF_data_cnf_dt { |
| 108 | PCUIF_Sapi sapi, |
| 109 | OCT4 tlli, |
| 110 | uint32_t fn, |
| 111 | uint16_t arfcn, |
| 112 | uint8_t trx_nr, |
| 113 | uint8_t ts_nr, |
| 114 | uint8_t block_nr, |
| 115 | int8_t rssi, |
| 116 | uint16_t ber10k, |
| 117 | int16_t ta_offs_qbits, |
| 118 | int16_t lqual_cb |
| 119 | } with { variant "" }; |
| 120 | |
| 121 | type record PCUIF_rts_req { |
| 122 | PCUIF_Sapi sapi, |
| 123 | OCT3 spare, |
| 124 | uint32_t fn, |
| 125 | uint16_t arfcn, |
| 126 | uint8_t trx_nr, |
| 127 | uint8_t ts_nr, |
| 128 | uint8_t block_nr |
| 129 | } with { variant "" }; |
| 130 | |
Harald Welte | 913bbf6 | 2019-03-01 00:39:19 +0100 | [diff] [blame] | 131 | type enumerated PCUIF_BurstType { |
| 132 | BURST_TYPE_NONE (0), |
| 133 | BURST_TYPE_0 (1), |
| 134 | BURST_TYPE_1 (2), |
| 135 | BURST_TYPE_2 (3) |
| 136 | } with { variant "FIELDLENGTH(8)" }; |
| 137 | |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 138 | type record PCUIF_rach_ind { |
| 139 | PCUIF_Sapi sapi, |
| 140 | uint16_t ra, |
| 141 | int16_t qta, |
| 142 | uint32_t fn, |
| 143 | uint16_t arfcn, |
| 144 | uint8_t is_11bit, |
Vadim Yanitskiy | 36558d9 | 2019-11-17 02:23:51 +0700 | [diff] [blame] | 145 | PCUIF_BurstType burst_type, |
| 146 | uint8_t trx_nr, |
| 147 | uint8_t ts_nr |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 148 | } with { variant "" }; |
| 149 | |
Vadim Yanitskiy | 9e1206c | 2020-07-19 15:52:31 +0700 | [diff] [blame] | 150 | type record PCUIF_InfoTrxTs { |
| 151 | uint8_t tsc, |
| 152 | uint8_t hopping, |
| 153 | uint8_t hsn, |
| 154 | uint8_t maio, |
Vadim Yanitskiy | 43ccaf5 | 2020-09-05 21:35:13 +0700 | [diff] [blame] | 155 | uint8_t ma_bit_len, |
Vadim Yanitskiy | 9e1206c | 2020-07-19 15:52:31 +0700 | [diff] [blame] | 156 | bitstring ma length(64) |
| 157 | } with { variant (ma) "BYTEORDER(first), BITORDER(msb)" }; |
| 158 | private type record length(8) of PCUIF_InfoTrxTs PCUIF_InfoTrxTsList; |
| 159 | |
Vadim Yanitskiy | 1da1fef | 2021-03-23 04:28:18 +0100 | [diff] [blame] | 160 | private type record PCUIF_InfoTrx { |
Vadim Yanitskiy | 9e1206c | 2020-07-19 15:52:31 +0700 | [diff] [blame] | 161 | uint16_t arfcn, |
| 162 | BIT8 pdch_mask, |
Vadim Yanitskiy | d805172 | 2020-08-22 02:33:17 +0700 | [diff] [blame] | 163 | OCT1 spare, |
Vadim Yanitskiy | 9e1206c | 2020-07-19 15:52:31 +0700 | [diff] [blame] | 164 | uint32_t hLayer1, |
| 165 | PCUIF_InfoTrxTsList ts |
| 166 | } with { variant (pdch_mask) "BITORDER(msb)" }; |
Vadim Yanitskiy | 1da1fef | 2021-03-23 04:28:18 +0100 | [diff] [blame] | 167 | type record length(8) of PCUIF_InfoTrx PCUIF_InfoTrxs; |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 168 | |
| 169 | type record PCUIF_info_ind { |
| 170 | uint32_t version, |
| 171 | PCUIF_Flags flags, |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 172 | PCUIF_InfoTrxs trx, |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 173 | uint8_t bsic, |
| 174 | |
| 175 | uint16_t mcc, |
| 176 | uint16_t mnc, |
Harald Welte | 3568dc7 | 2018-03-13 17:06:51 +0100 | [diff] [blame] | 177 | uint8_t mnc_3_digits, |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 178 | uint16_t lac, |
| 179 | uint16_t rac, |
| 180 | |
| 181 | uint16_t nsei, |
| 182 | record length(7) of uint8_t nse_timer, |
| 183 | record length(11) of uint8_t cell_timer, |
| 184 | |
| 185 | uint16_t cell_id, |
| 186 | uint16_t repeat_time, |
| 187 | uint8_t repeat_count, |
| 188 | uint16_t bvci, |
| 189 | uint8_t t3142, |
| 190 | uint8_t t3169, |
| 191 | uint8_t t3191, |
| 192 | uint8_t t3193_10ms, |
| 193 | uint8_t t3195, |
Pau Espin Pedrol | 76de166 | 2021-03-01 17:40:58 +0100 | [diff] [blame] | 194 | uint8_t n3101, |
| 195 | uint8_t n3103, |
| 196 | uint8_t n3105, |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 197 | uint8_t cv_countdown, |
| 198 | uint16_t dl_tbf_ext, |
| 199 | uint16_t ul_tbf_ext, |
| 200 | uint8_t initial_cs, |
| 201 | uint8_t initial_mcs, |
| 202 | |
| 203 | record length(2) of uint16_t nsvci, |
Vadim Yanitskiy | 0d59080 | 2020-08-21 00:14:22 +0700 | [diff] [blame] | 204 | record length(2) of uint16_t local_port, |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 205 | record length(2) of uint16_t remote_port, |
Alexander Couzens | 1e5dc48 | 2020-07-28 15:38:46 +0200 | [diff] [blame] | 206 | PCUIF_RemoteAddr remote_addr |
Alexander Couzens | 1e5dc48 | 2020-07-28 15:38:46 +0200 | [diff] [blame] | 207 | } with { variant "" }; |
| 208 | |
| 209 | type enumerated PCUIF_AddrType { |
| 210 | PCUIF_ADDR_TYPE_UNSPEC ('00'O), |
| 211 | PCUIF_ADDR_TYPE_IPV4 ('04'O), |
| 212 | PCUIF_ADDR_TYPE_IPV6 ('29'O) |
| 213 | } with { variant "FIELDLENGTH(8)" }; |
| 214 | |
Vadim Yanitskiy | 1da1fef | 2021-03-23 04:28:18 +0100 | [diff] [blame] | 215 | type record PCUIF_RemoteAddr { |
Alexander Couzens | 1e5dc48 | 2020-07-28 15:38:46 +0200 | [diff] [blame] | 216 | record length(2) of PCUIF_AddrType addr_type, |
| 217 | record length(2) of octetstring addr length(16) |
| 218 | } with { variant "" }; |
| 219 | |
Philipp Maier | 310520b | 2023-05-04 13:10:18 +0200 | [diff] [blame] | 220 | /* E1 CCU connection parameters */ |
| 221 | type record PCUIF_e1_ccu_ind { |
| 222 | /* GSM/GPRS air interface */ |
| 223 | uint8_t trx_nr, |
| 224 | uint8_t ts_nr, |
| 225 | /* E1 line interface */ |
| 226 | uint8_t e1_nr, |
| 227 | uint8_t e1_ts, |
| 228 | uint8_t e1_ts_ss |
| 229 | } with { variant "" }; |
| 230 | |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 231 | type record PCUIF_act_req { |
| 232 | uint8_t is_activate, |
| 233 | uint8_t trx_nr, |
| 234 | uint8_t ts_nr, |
| 235 | OCT1 spare |
| 236 | } with { variant "" }; |
| 237 | |
| 238 | type record PCUIF_time_ind { |
| 239 | uint32_t fn |
| 240 | } with { variant "" }; |
| 241 | |
Vadim Yanitskiy | d0766b2 | 2021-06-18 15:39:04 +0200 | [diff] [blame] | 242 | type record length(8) of uint8_t PCUIF_interf; |
| 243 | type record PCUIF_interf_ind { |
| 244 | uint8_t trx_nr, |
| 245 | OCT3 spare, |
| 246 | uint32_t fn, |
| 247 | PCUIF_interf interf |
| 248 | } with { variant "" }; |
| 249 | |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 250 | type record PCUIF_pag_req { |
| 251 | PCUIF_Sapi sapi, |
| 252 | uint8_t chan_needed, |
| 253 | OCT9 identity_lv |
| 254 | } with { variant "" }; |
| 255 | |
Harald Welte | 11b734c | 2019-09-05 14:17:54 +0200 | [diff] [blame] | 256 | type record PCUIF_app_info_req { |
| 257 | uint8_t application_type, |
| 258 | uint8_t len, |
| 259 | octetstring data |
| 260 | } with { |
| 261 | variant (len) "LENGTHTO(data)" |
| 262 | } |
| 263 | |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 264 | type record PCUIF_susp_req { |
| 265 | OCT4 tlli, |
| 266 | OCT6 ra_id, |
| 267 | uint8_t cause |
Harald Welte | eaa9a86 | 2019-05-26 23:01:08 +0200 | [diff] [blame] | 268 | } with { |
| 269 | variant (tlli) "BYTEORDER(last)" |
| 270 | }; |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 271 | |
Pau Espin Pedrol | f28fd08 | 2021-09-07 20:02:25 +0200 | [diff] [blame] | 272 | type record PCUIF_neigh_addr_req { |
| 273 | uint16_t local_lac, |
| 274 | uint16_t local_ci, |
| 275 | uint16_t tgt_arfcn, |
| 276 | uint8_t tgt_bsic |
| 277 | } with { variant (local_lac) "BYTEORDER(last)" |
| 278 | variant (local_ci) "BYTEORDER(last)" |
| 279 | variant (tgt_arfcn) "BYTEORDER(last)" }; |
| 280 | |
| 281 | type record PCUIF_neigh_addr_cnf { |
| 282 | PCUIF_neigh_addr_req orig_req, |
| 283 | uint8_t error_code, |
| 284 | uint16_t mcc, |
| 285 | uint16_t mnc, |
| 286 | uint8_t mnc_3_digits, |
| 287 | uint16_t lac, |
| 288 | uint8_t rac, |
| 289 | uint16_t cell_identity |
| 290 | } with { variant (mcc) "BYTEORDER(last)" |
| 291 | variant (mnc) "BYTEORDER(last)" |
| 292 | variant (lac) "BYTEORDER(last)" |
| 293 | variant (cell_identity) "BYTEORDER(last)" }; |
| 294 | |
Pau Espin Pedrol | 65d712e | 2021-06-25 13:55:38 +0200 | [diff] [blame] | 295 | type union PCUIF_ContainerMsgUnion { |
Pau Espin Pedrol | f28fd08 | 2021-09-07 20:02:25 +0200 | [diff] [blame] | 296 | PCUIF_neigh_addr_req neigh_addr_req, |
| 297 | PCUIF_neigh_addr_cnf neigh_addr_cnf, |
Pau Espin Pedrol | 65d712e | 2021-06-25 13:55:38 +0200 | [diff] [blame] | 298 | octetstring other |
| 299 | } with { variant "" }; |
| 300 | |
| 301 | type record PCUIF_container { |
Pau Espin Pedrol | f28fd08 | 2021-09-07 20:02:25 +0200 | [diff] [blame] | 302 | PCUIF_MsgType msg_type, |
Pau Espin Pedrol | 65d712e | 2021-06-25 13:55:38 +0200 | [diff] [blame] | 303 | OCT1 spare, |
| 304 | uint16_t len, /* network byte order */ |
| 305 | PCUIF_ContainerMsgUnion u |
| 306 | } with { |
| 307 | variant (len) "BYTEORDER(last)" |
| 308 | variant (len) "LENGTHTO(u)" |
| 309 | variant (u) "CROSSTAG( |
Pau Espin Pedrol | f28fd08 | 2021-09-07 20:02:25 +0200 | [diff] [blame] | 310 | neigh_addr_req, msg_type = PCU_IF_MSG_NEIGH_ADDR_REQ; |
| 311 | neigh_addr_cnf, msg_type = PCU_IF_MSG_NEIGH_ADDR_CNF; |
Pau Espin Pedrol | 65d712e | 2021-06-25 13:55:38 +0200 | [diff] [blame] | 312 | other, OTHERWISE)" |
| 313 | }; |
| 314 | |
Philipp Maier | 3241af3 | 2023-05-04 15:17:36 +0200 | [diff] [blame] | 315 | /* Record to send a (confirmed) IMMEDIATE ASSIGNMENT message via PCH. The record is sent by the PCU to the BTS as a |
| 316 | * data request (data_req) under SAPI PCU_IF_SAPI_PCH_DT. */ |
| 317 | type record PCUIF_pch_dt { |
| 318 | OCT4 tlli, |
| 319 | charstring imsi length(17), |
| 320 | octetstring data length(23) |
| 321 | } with { |
| 322 | variant (tlli) "BYTEORDER(last)" |
Philipp Maier | 8d42651 | 2023-06-23 16:21:02 +0200 | [diff] [blame] | 323 | variant (imsi) "FIELDLENGTH(17)" |
| 324 | variant (data) "FIELDLENGTH(23)" |
Philipp Maier | 3241af3 | 2023-05-04 15:17:36 +0200 | [diff] [blame] | 325 | }; |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 326 | |
Philipp Maier | 3b4abb8 | 2023-06-23 16:27:46 +0200 | [diff] [blame] | 327 | external function enc_PCUIF_pch_dt(in PCUIF_pch_dt pdu) return octetstring |
| 328 | with { extension "prototype(convert) encode(RAW)" }; |
| 329 | |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 330 | type union PCUIF_MsgUnion { |
| 331 | PCUIF_data data_req, |
| 332 | PCUIF_data data_cnf, |
| 333 | PCUIF_data_cnf_dt data_cnf_dt, |
| 334 | PCUIF_data data_ind, |
| 335 | PCUIF_susp_req susp_req, |
| 336 | PCUIF_rts_req rts_req, |
| 337 | PCUIF_rach_ind rach_ind, |
| 338 | PCUIF_txt_ind txt_ind, |
| 339 | PCUIF_info_ind info_ind, |
Philipp Maier | 310520b | 2023-05-04 13:10:18 +0200 | [diff] [blame] | 340 | PCUIF_e1_ccu_ind e1_ccu_ind, |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 341 | PCUIF_act_req act_req, |
| 342 | PCUIF_time_ind time_ind, |
Vadim Yanitskiy | d0766b2 | 2021-06-18 15:39:04 +0200 | [diff] [blame] | 343 | PCUIF_interf_ind interf_ind, |
Harald Welte | 11b734c | 2019-09-05 14:17:54 +0200 | [diff] [blame] | 344 | PCUIF_pag_req pag_req, |
Pau Espin Pedrol | 65d712e | 2021-06-25 13:55:38 +0200 | [diff] [blame] | 345 | PCUIF_app_info_req app_info_req, |
| 346 | PCUIF_container container |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 347 | } with { variant "" }; |
| 348 | |
| 349 | type record PCUIF_Message { |
| 350 | PCUIF_MsgType msg_type, |
| 351 | uint8_t bts_nr, |
| 352 | OCT2 spare, |
| 353 | PCUIF_MsgUnion u |
| 354 | } with { variant (u) "CROSSTAG( |
| 355 | data_req, msg_type = PCU_IF_MSG_DATA_REQ; |
| 356 | data_cnf, msg_type = PCU_IF_MSG_DATA_CNF; |
| 357 | data_cnf_dt, msg_type = PCU_IF_MSG_DATA_CNF_DT; |
| 358 | data_ind, msg_type = PCU_IF_MSG_DATA_IND; |
| 359 | susp_req, msg_type = PCU_IF_MSG_SUSP_REQ; |
| 360 | rts_req, msg_type = PCU_IF_MSG_RTS_REQ; |
| 361 | rach_ind, msg_type = PCU_IF_MSG_RACH_IND; |
| 362 | txt_ind, msg_type = PCU_IF_MSG_TXT_IND; |
| 363 | info_ind, msg_type = PCU_IF_MSG_INFO_IND; |
Philipp Maier | 310520b | 2023-05-04 13:10:18 +0200 | [diff] [blame] | 364 | e1_ccu_ind, msg_type = PCU_IF_MSG_E1_CCU_IND; |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 365 | act_req, msg_type = PCU_IF_MSG_ACT_REQ; |
| 366 | time_ind, msg_type = PCU_IF_MSG_TIME_IND; |
Vadim Yanitskiy | d0766b2 | 2021-06-18 15:39:04 +0200 | [diff] [blame] | 367 | interf_ind, msg_type = PCU_IF_MSG_INTERF_IND; |
Harald Welte | 11b734c | 2019-09-05 14:17:54 +0200 | [diff] [blame] | 368 | pag_req, msg_type = PCU_IF_MSG_PAG_REQ; |
Pau Espin Pedrol | 65d712e | 2021-06-25 13:55:38 +0200 | [diff] [blame] | 369 | app_info_req, msg_type = PCU_IF_MSG_APP_INFO_REQ; |
| 370 | container, msg_type = PCU_IF_MSG_CONTAINER)" |
Vadim Yanitskiy | 204fe62 | 2021-03-23 04:49:41 +0100 | [diff] [blame] | 371 | /* PCUIFv10: 1006 * 8 = 8048 bits */ |
| 372 | variant "PADDING(8048)" |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 373 | }; |
| 374 | |
| 375 | external function enc_PCUIF_Message(in PCUIF_Message pdu) return octetstring |
| 376 | with { extension "prototype(convert) encode(RAW)" }; |
| 377 | external function dec_PCUIF_Message(in octetstring stream) return PCUIF_Message |
| 378 | with { extension "prototype(convert) decode(RAW)" }; |
| 379 | |
Vadim Yanitskiy | f7d9c0f | 2019-09-06 00:08:17 +0200 | [diff] [blame] | 380 | /* Generic template for matching messages by type and/or the BTS number */ |
| 381 | template PCUIF_Message tr_PCUIF_MSG(template PCUIF_MsgType msg_type := ?, |
| 382 | template uint8_t bts_nr := ?) := { |
| 383 | msg_type := msg_type, |
| 384 | bts_nr := bts_nr, |
| 385 | spare := ?, |
| 386 | u := ? |
| 387 | } |
| 388 | |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 389 | template (value) PCUIF_Message ts_PCUIF_RTS_REQ(template (value) uint8_t bts_nr, |
| 390 | template (value) uint8_t trx_nr, |
| 391 | template (value) uint8_t ts_nr, |
| 392 | template (value) PCUIF_Sapi sapi, |
| 393 | template (value) uint32_t fn, |
| 394 | template (value) uint16_t arfcn, |
| 395 | template (value) uint8_t block_nr |
| 396 | ) := { |
| 397 | msg_type := PCU_IF_MSG_RTS_REQ, |
| 398 | bts_nr := bts_nr, |
| 399 | spare := '0000'O, |
| 400 | u := { |
| 401 | rts_req := { |
| 402 | sapi := sapi, |
| 403 | spare := '000000'O, |
| 404 | fn := fn, |
| 405 | arfcn := arfcn, |
| 406 | trx_nr := trx_nr, |
| 407 | ts_nr := ts_nr, |
| 408 | block_nr := block_nr |
| 409 | } |
| 410 | } |
| 411 | } |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 412 | template PCUIF_Message tr_PCUIF_RTS_REQ(template uint8_t bts_nr := ?, |
| 413 | template uint8_t trx_nr := ?, |
| 414 | template uint8_t ts_nr := ?, |
| 415 | template PCUIF_Sapi sapi := ?, |
| 416 | template uint32_t fn := ?, |
| 417 | template uint8_t block_nr := ? |
| 418 | ) := { |
| 419 | msg_type := PCU_IF_MSG_RTS_REQ, |
| 420 | bts_nr := bts_nr, |
| 421 | spare := ?, |
| 422 | u := { |
| 423 | rts_req := { |
| 424 | sapi := sapi, |
| 425 | spare := ?, |
| 426 | fn := fn, |
| 427 | arfcn := ?, |
| 428 | trx_nr := trx_nr, |
| 429 | ts_nr := ts_nr, |
| 430 | block_nr := block_nr |
| 431 | } |
| 432 | } |
| 433 | } |
| 434 | |
| 435 | template (value) PCUIF_Message ts_PCUIF_TXT_IND(uint8_t bts_nr, PCUIF_TextType tt, charstring text) := { |
| 436 | msg_type := PCU_IF_MSG_TXT_IND, |
| 437 | bts_nr := bts_nr, |
| 438 | spare := '0000'O, |
| 439 | u := { |
| 440 | txt_ind := { |
| 441 | txt_type := tt, |
| 442 | text := text |
| 443 | } |
| 444 | } |
| 445 | } |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 446 | template PCUIF_Message tr_PCUIF_TXT_IND(template uint8_t bts_nr, template PCUIF_TextType tt, |
| 447 | template charstring text := ?) := { |
| 448 | msg_type := PCU_IF_MSG_TXT_IND, |
| 449 | bts_nr := bts_nr, |
| 450 | spare := '0000'O, |
| 451 | u := { |
| 452 | txt_ind := { |
| 453 | txt_type := tt, |
| 454 | text := text |
| 455 | } |
| 456 | } |
| 457 | } |
| 458 | |
| 459 | |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 460 | |
| 461 | template (value) PCUIF_Message ts_PCUIF_ACT_REQ(uint8_t bts_nr, uint8_t trx_nr, uint8_t ts_nr) := { |
| 462 | msg_type := PCU_IF_MSG_ACT_REQ, |
| 463 | bts_nr := bts_nr, |
| 464 | spare := '0000'O, |
| 465 | u := { |
| 466 | act_req := { |
| 467 | is_activate := 1, |
| 468 | trx_nr := trx_nr, |
| 469 | ts_nr := ts_nr, |
| 470 | spare := '00'O |
| 471 | } |
| 472 | } |
| 473 | } |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 474 | template PCUIF_Message tr_PCUIF_ACT_REQ(template uint8_t bts_nr, template uint8_t trx_nr, |
| 475 | template uint8_t ts_nr) := { |
| 476 | msg_type := PCU_IF_MSG_ACT_REQ, |
| 477 | bts_nr := bts_nr, |
| 478 | spare := '0000'O, |
| 479 | u := { |
| 480 | act_req := { |
| 481 | is_activate := 1, |
| 482 | trx_nr := trx_nr, |
| 483 | ts_nr := ts_nr, |
| 484 | spare := '00'O |
| 485 | } |
| 486 | } |
| 487 | } |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 488 | |
| 489 | template (value) PCUIF_Message ts_PCUIF_DEACT_REQ(uint8_t bts_nr, uint8_t trx_nr, uint8_t ts_nr) := { |
| 490 | msg_type := PCU_IF_MSG_ACT_REQ, |
| 491 | bts_nr := bts_nr, |
| 492 | spare := '0000'O, |
| 493 | u := { |
| 494 | act_req := { |
| 495 | is_activate := 0, |
| 496 | trx_nr := trx_nr, |
| 497 | ts_nr := ts_nr, |
| 498 | spare := '00'O |
| 499 | } |
| 500 | } |
| 501 | } |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 502 | template PCUIF_Message tr_PCUIF_DEACT_REQ(template uint8_t bts_nr, template uint8_t trx_nr, |
| 503 | template uint8_t ts_nr) := { |
| 504 | msg_type := PCU_IF_MSG_ACT_REQ, |
| 505 | bts_nr := bts_nr, |
| 506 | spare := '0000'O, |
| 507 | u := { |
| 508 | act_req := { |
| 509 | is_activate := 0, |
| 510 | trx_nr := trx_nr, |
| 511 | ts_nr := ts_nr, |
| 512 | spare := '00'O |
| 513 | } |
| 514 | } |
| 515 | } |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 516 | |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 517 | template (value) PCUIF_Message ts_PCUIF_DATA_IND(template (value) uint8_t bts_nr, |
| 518 | template (value) uint8_t trx_nr, |
| 519 | template (value) uint8_t ts_nr, |
| 520 | template (value) uint8_t block_nr, |
| 521 | template (value) PCUIF_Sapi sapi, |
Vadim Yanitskiy | c78ea26 | 2019-05-17 01:08:08 +0700 | [diff] [blame] | 522 | template (value) octetstring data, |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 523 | template (value) uint32_t fn, |
| 524 | template (value) uint16_t arfcn, |
| 525 | template (value) int8_t rssi := -80, |
| 526 | template (value) uint16_t ber10k := 0, |
| 527 | template (value) int16_t ta_offs_qbits := 0, |
Vadim Yanitskiy | 45749a8 | 2021-05-26 13:29:04 +0200 | [diff] [blame] | 528 | template (value) int16_t lqual_cb := 10) := { |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 529 | msg_type := PCU_IF_MSG_DATA_IND, |
| 530 | bts_nr := bts_nr, |
| 531 | spare := '0000'O, |
| 532 | u := { |
| 533 | data_ind := { |
| 534 | sapi := sapi, |
| 535 | len := lengthof(valueof(data)), |
| 536 | data := data, |
| 537 | fn := fn, |
| 538 | arfcn := arfcn, |
| 539 | trx_nr := trx_nr, |
| 540 | ts_nr := ts_nr, |
| 541 | block_nr := block_nr, |
| 542 | rssi := rssi, |
| 543 | ber10k := ber10k, |
| 544 | ta_offs_qbits := ta_offs_qbits, |
| 545 | lqual_cb := lqual_cb |
| 546 | } |
| 547 | } |
| 548 | } |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 549 | template PCUIF_Message tr_PCUIF_DATA_IND(template uint8_t bts_nr := ?, |
| 550 | template uint8_t trx_nr := ?, |
| 551 | template uint8_t ts_nr := ?, |
| 552 | template uint8_t block_nr := ?, |
| 553 | template PCUIF_Sapi sapi := ?, |
Vadim Yanitskiy | c78ea26 | 2019-05-17 01:08:08 +0700 | [diff] [blame] | 554 | template octetstring data := ?) := { |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 555 | msg_type := PCU_IF_MSG_DATA_IND, |
| 556 | bts_nr := bts_nr, |
| 557 | spare := ?, |
| 558 | u := { |
| 559 | data_ind := { |
| 560 | sapi := sapi, |
| 561 | len := ?, |
| 562 | data := data, |
| 563 | fn := ?, |
| 564 | arfcn := ?, |
| 565 | trx_nr := trx_nr, |
| 566 | ts_nr := ts_nr, |
| 567 | block_nr := block_nr, |
| 568 | rssi := ?, |
| 569 | ber10k := ?, |
| 570 | ta_offs_qbits := ?, |
| 571 | lqual_cb := ? |
| 572 | } |
| 573 | } |
| 574 | } |
| 575 | |
Pau Espin Pedrol | cf5c33e | 2021-01-19 18:56:55 +0100 | [diff] [blame] | 576 | template PCUIF_data tr_PCUIF_DATA(template uint8_t trx_nr, |
| 577 | template uint8_t ts_nr, |
| 578 | template uint8_t block_nr := ?, |
| 579 | template uint32_t fn := ?, |
| 580 | template PCUIF_Sapi sapi := ?, |
| 581 | template octetstring data := ?) := { |
| 582 | sapi := sapi, |
| 583 | len := ?, |
| 584 | data := data, |
| 585 | fn := fn, |
| 586 | arfcn := ?, /* unused in BTS */ |
| 587 | trx_nr := trx_nr, |
| 588 | ts_nr := ts_nr, |
| 589 | block_nr := block_nr, |
| 590 | /* measurement parameters below unused on Tx */ |
| 591 | rssi := 0, |
| 592 | ber10k := 0, |
| 593 | ta_offs_qbits := 0, |
| 594 | lqual_cb := 0 |
| 595 | |
| 596 | } |
| 597 | |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 598 | template (value) PCUIF_Message ts_PCUIF_DATA_REQ(uint8_t bts_nr, uint8_t trx_nr, |
| 599 | uint8_t ts_nr, uint8_t block_nr, |
| 600 | uint32_t fn, PCUIF_Sapi sapi, |
| 601 | octetstring data) := { |
| 602 | msg_type := PCU_IF_MSG_DATA_REQ, |
| 603 | bts_nr := bts_nr, |
| 604 | spare := '0000'O, |
| 605 | u := { |
| 606 | data_req := { |
| 607 | sapi := sapi, |
| 608 | len := lengthof(data), |
| 609 | data := data, |
| 610 | fn := fn, |
| 611 | arfcn := 0, /* unused in BTS */ |
| 612 | trx_nr := trx_nr, |
| 613 | ts_nr := ts_nr, |
| 614 | block_nr := block_nr, |
| 615 | /* measurement parameters below unused on Tx */ |
| 616 | rssi := 0, |
| 617 | ber10k := 0, |
| 618 | ta_offs_qbits := 0, |
| 619 | lqual_cb := 0 |
| 620 | } |
| 621 | } |
| 622 | } |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 623 | template PCUIF_Message tr_PCUIF_DATA_REQ(template uint8_t bts_nr, |
| 624 | template uint8_t trx_nr, |
| 625 | template uint8_t ts_nr, |
| 626 | template uint8_t block_nr := ?, |
| 627 | template uint32_t fn := ?, |
| 628 | template PCUIF_Sapi sapi := ?, |
| 629 | template octetstring data := ?) := { |
| 630 | msg_type := PCU_IF_MSG_DATA_REQ, |
| 631 | bts_nr := bts_nr, |
| 632 | spare := '0000'O, |
| 633 | u := { |
Pau Espin Pedrol | cf5c33e | 2021-01-19 18:56:55 +0100 | [diff] [blame] | 634 | data_req := tr_PCUIF_DATA(trx_nr, ts_nr, block_nr, fn, sapi, data) |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 635 | } |
| 636 | } |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 637 | |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 638 | template (value) PCUIF_Message ts_PCUIF_DATA_CNF(template (value) uint8_t bts_nr, |
| 639 | template (value) uint8_t trx_nr, |
| 640 | template (value) uint8_t ts_nr, |
| 641 | template (value) uint8_t block_nr, |
| 642 | template (value) uint32_t fn, |
| 643 | template (value) uint16_t arfcn, |
| 644 | template (value) PCUIF_Sapi sapi, |
| 645 | template (value) octetstring data) := { |
| 646 | msg_type := PCU_IF_MSG_DATA_CNF, |
| 647 | bts_nr := bts_nr, |
| 648 | spare := '0000'O, |
| 649 | u := { |
| 650 | data_cnf := { |
| 651 | sapi := sapi, |
| 652 | len := 0, /* overwritten */ |
| 653 | data := data, |
| 654 | fn := fn, |
| 655 | arfcn := arfcn, |
| 656 | trx_nr := trx_nr, |
| 657 | ts_nr := ts_nr, |
| 658 | block_nr := block_nr, |
| 659 | rssi := 0, |
| 660 | ber10k := 0, |
| 661 | ta_offs_qbits := 0, |
| 662 | lqual_cb := 0 |
| 663 | } |
| 664 | } |
| 665 | } |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 666 | template PCUIF_Message tr_PCUIF_DATA_CNF(template uint8_t bts_nr := ?, |
| 667 | template uint8_t trx_nr := ?, |
| 668 | template uint8_t ts_nr := ?, |
| 669 | template PCUIF_Sapi sapi := ?, |
| 670 | template octetstring data := ?) := { |
| 671 | msg_type := PCU_IF_MSG_DATA_CNF, |
| 672 | bts_nr := bts_nr, |
| 673 | spare := ?, |
| 674 | u := { |
| 675 | data_cnf := { |
| 676 | sapi := sapi, |
| 677 | len := ?, |
| 678 | data := data, |
| 679 | fn := ?, |
| 680 | arfcn := ?, |
| 681 | trx_nr := trx_nr, |
| 682 | ts_nr := ts_nr, |
| 683 | block_nr := ?, |
| 684 | rssi := ?, |
| 685 | ber10k := ?, |
| 686 | ta_offs_qbits := ?, |
| 687 | lqual_cb := ? |
| 688 | } |
| 689 | } |
| 690 | } |
| 691 | |
Philipp Maier | 704f31b | 2023-05-04 15:53:33 +0200 | [diff] [blame] | 692 | template (value) PCUIF_Message ts_PCUIF_DATA_CNF_DT(template (value) uint8_t bts_nr, |
| 693 | template (value) uint8_t trx_nr, |
| 694 | template (value) uint8_t ts_nr, |
| 695 | template (value) uint8_t block_nr, |
| 696 | template (value) uint32_t fn, |
| 697 | template (value) uint16_t arfcn, |
| 698 | template (value) PCUIF_Sapi sapi, |
| 699 | template (value) OCT4 tlli) := { |
| 700 | msg_type := PCU_IF_MSG_DATA_CNF_DT, |
| 701 | bts_nr := bts_nr, |
| 702 | spare := '0000'O, |
| 703 | u := { |
| 704 | data_cnf_dt := { |
| 705 | sapi := sapi, |
| 706 | tlli := tlli, |
| 707 | fn := fn, |
| 708 | arfcn := arfcn, |
| 709 | trx_nr := trx_nr, |
| 710 | ts_nr := ts_nr, |
| 711 | block_nr := block_nr, |
| 712 | rssi := 0, |
| 713 | ber10k := 0, |
| 714 | ta_offs_qbits := 0, |
| 715 | lqual_cb := 0 |
| 716 | } |
| 717 | } |
| 718 | } |
| 719 | template PCUIF_Message tr_PCUIF_DATA_CNF_DT(template uint8_t bts_nr := ?, |
| 720 | template uint8_t trx_nr := ?, |
| 721 | template uint8_t ts_nr := ?, |
| 722 | template PCUIF_Sapi sapi := ?, |
| 723 | template OCT4 tlli := ?) := { |
| 724 | msg_type := PCU_IF_MSG_DATA_CNF_DT, |
| 725 | bts_nr := bts_nr, |
| 726 | spare := ?, |
| 727 | u := { |
| 728 | data_cnf_dt := { |
| 729 | sapi := sapi, |
| 730 | tlli := tlli, |
| 731 | fn := ?, |
| 732 | arfcn := ?, |
| 733 | trx_nr := trx_nr, |
| 734 | ts_nr := ts_nr, |
| 735 | block_nr := ?, |
| 736 | rssi := ?, |
| 737 | ber10k := ?, |
| 738 | ta_offs_qbits := ?, |
| 739 | lqual_cb := ? |
| 740 | } |
| 741 | } |
| 742 | } |
| 743 | |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 744 | 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] | 745 | template (value) uint8_t trx_nr, |
| 746 | template (value) uint8_t ts_nr, |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 747 | template (value) uint16_t ra, |
| 748 | template (value) uint8_t is_11bit, |
Harald Welte | 913bbf6 | 2019-03-01 00:39:19 +0100 | [diff] [blame] | 749 | template (value) PCUIF_BurstType burst_type, |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 750 | template (value) uint32_t fn, |
| 751 | template (value) uint16_t arfcn, |
Vadim Yanitskiy | 36aa611 | 2019-10-04 16:43:00 +0700 | [diff] [blame] | 752 | template (value) int16_t qta := 0, |
| 753 | template (value) PCUIF_Sapi sapi := PCU_IF_SAPI_RACH |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 754 | ) := { |
| 755 | msg_type := PCU_IF_MSG_RACH_IND, |
| 756 | bts_nr := bts_nr, |
| 757 | spare := '0000'O, |
| 758 | u := { |
| 759 | rach_ind := { |
Vadim Yanitskiy | 36aa611 | 2019-10-04 16:43:00 +0700 | [diff] [blame] | 760 | sapi := sapi, |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 761 | ra := ra, |
| 762 | qta := qta, |
| 763 | fn := fn, |
| 764 | arfcn := arfcn, |
| 765 | is_11bit := is_11bit, |
Vadim Yanitskiy | 36558d9 | 2019-11-17 02:23:51 +0700 | [diff] [blame] | 766 | burst_type := burst_type, |
| 767 | trx_nr := trx_nr, |
| 768 | ts_nr := ts_nr |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 769 | } |
| 770 | } |
| 771 | } |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 772 | template PCUIF_Message tr_PCUIF_RACH_IND(template uint8_t bts_nr := ?, |
Vadim Yanitskiy | 36558d9 | 2019-11-17 02:23:51 +0700 | [diff] [blame] | 773 | template uint8_t trx_nr := ?, |
| 774 | template uint8_t ts_nr := ?, |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 775 | template uint16_t ra := ?, |
| 776 | template uint8_t is_11bit := ?, |
Harald Welte | 913bbf6 | 2019-03-01 00:39:19 +0100 | [diff] [blame] | 777 | template PCUIF_BurstType burst_type := ?, |
Vadim Yanitskiy | 36aa611 | 2019-10-04 16:43:00 +0700 | [diff] [blame] | 778 | template uint32_t fn := ?, |
| 779 | template PCUIF_Sapi sapi := PCU_IF_SAPI_RACH) := { |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 780 | msg_type := PCU_IF_MSG_RACH_IND, |
| 781 | bts_nr := bts_nr, |
| 782 | spare := ?, |
| 783 | u := { |
| 784 | rach_ind := { |
Vadim Yanitskiy | 36aa611 | 2019-10-04 16:43:00 +0700 | [diff] [blame] | 785 | sapi := sapi, |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 786 | ra := ra, |
| 787 | qta := ?, |
| 788 | fn := fn, |
| 789 | arfcn := ?, |
| 790 | is_11bit := is_11bit, |
Vadim Yanitskiy | 36558d9 | 2019-11-17 02:23:51 +0700 | [diff] [blame] | 791 | burst_type := burst_type, |
| 792 | trx_nr := trx_nr, |
| 793 | ts_nr := ts_nr |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 794 | } |
| 795 | } |
| 796 | } |
| 797 | |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 798 | template (value) PCUIF_Message ts_PCUIF_PAG_REQ(template (value) uint8_t bts_nr, |
| 799 | template (value) OCT9 id_lv, |
| 800 | template (value) uint8_t chan_needed, |
| 801 | template (value) PCUIF_Sapi sapi) := { |
| 802 | msg_type := PCU_IF_MSG_PAG_REQ, |
| 803 | bts_nr := bts_nr, |
| 804 | spare := '0000'O, |
| 805 | u := { |
| 806 | pag_req := { |
| 807 | sapi := sapi, |
| 808 | chan_needed := chan_needed, |
| 809 | identity_lv := id_lv |
| 810 | } |
| 811 | } |
| 812 | } |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 813 | template PCUIF_Message tr_PCUIF_PAG_REQ(template uint8_t bts_nr := ?, |
| 814 | template OCT9 id_lv := ?, |
| 815 | template uint8_t chan_needed := ?, |
| 816 | template PCUIF_Sapi sapi := ?) := { |
| 817 | msg_type := PCU_IF_MSG_PAG_REQ, |
| 818 | bts_nr := bts_nr, |
| 819 | spare := ?, |
| 820 | u := { |
| 821 | pag_req := { |
| 822 | sapi := ?, |
| 823 | chan_needed := chan_needed, |
| 824 | identity_lv := id_lv |
| 825 | } |
| 826 | } |
| 827 | } |
| 828 | |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 829 | const PCUIF_Flags c_PCUIF_Flags_default := { |
| 830 | bts_active := true, |
| 831 | sysmo_direct_dsp := false, |
| 832 | spare := '00000000000000'B, |
| 833 | cs1 := true, |
| 834 | cs2 := true, |
| 835 | cs3 := true, |
| 836 | cs4 := true, |
| 837 | mcs1 := true, |
| 838 | mcs2 := true, |
| 839 | mcs3 := true, |
| 840 | mcs4 := true, |
| 841 | mcs5 := true, |
| 842 | mcs6 := true, |
| 843 | mcs7 := true, |
| 844 | mcs8 := true, |
| 845 | mcs9 := true, |
| 846 | spare2 := '000'B |
| 847 | }; |
| 848 | |
Pau Espin Pedrol | 745a48b | 2020-10-30 15:31:07 +0100 | [diff] [blame] | 849 | const PCUIF_Flags c_PCUIF_Flags_noMCS := { |
| 850 | bts_active := true, |
| 851 | sysmo_direct_dsp := false, |
| 852 | spare := '00000000000000'B, |
| 853 | cs1 := true, |
| 854 | cs2 := true, |
| 855 | cs3 := true, |
| 856 | cs4 := true, |
| 857 | mcs1 := false, |
| 858 | mcs2 := false, |
| 859 | mcs3 := false, |
| 860 | mcs4 := false, |
| 861 | mcs5 := false, |
| 862 | mcs6 := false, |
| 863 | mcs7 := false, |
| 864 | mcs8 := false, |
| 865 | mcs9 := false, |
| 866 | spare2 := '000'B |
| 867 | }; |
| 868 | |
| 869 | function f_pcuif_ind_flags_egprs_enabled(PCUIF_Flags flags) return boolean { |
| 870 | return flags.mcs1 or flags.mcs2 or flags.mcs3 or flags.mcs4 or |
| 871 | flags.mcs5 or flags.mcs6 or flags.mcs7 or flags.mcs8 or |
| 872 | flags.mcs9; |
| 873 | } |
| 874 | |
Vadim Yanitskiy | 9e1206c | 2020-07-19 15:52:31 +0700 | [diff] [blame] | 875 | template (value) PCUIF_InfoTrxTs ts_PCUIF_InfoTrxTsH0(template (value) uint3_t tsc := 7) := { |
| 876 | tsc := tsc, |
| 877 | hopping := 0, |
| 878 | hsn := 0, maio := 0, |
Vadim Yanitskiy | 43ccaf5 | 2020-09-05 21:35:13 +0700 | [diff] [blame] | 879 | ma_bit_len := 0, |
Vadim Yanitskiy | 9e1206c | 2020-07-19 15:52:31 +0700 | [diff] [blame] | 880 | ma := f_pad_bit(''B, 64, '0'B) |
| 881 | }; |
Vadim Yanitskiy | 355604c | 2020-08-03 04:19:05 +0700 | [diff] [blame] | 882 | template PCUIF_InfoTrxTs tr_PCUIF_InfoTrxTsH0(template uint3_t tsc := ?) := { |
| 883 | tsc := tsc, |
| 884 | hopping := 0, |
| 885 | hsn := ?, maio := ?, |
Vadim Yanitskiy | 43ccaf5 | 2020-09-05 21:35:13 +0700 | [diff] [blame] | 886 | ma_bit_len := ?, |
Vadim Yanitskiy | 355604c | 2020-08-03 04:19:05 +0700 | [diff] [blame] | 887 | ma := ? |
| 888 | }; |
Vadim Yanitskiy | 9e1206c | 2020-07-19 15:52:31 +0700 | [diff] [blame] | 889 | |
| 890 | template (value) PCUIF_InfoTrxTs ts_PCUIF_InfoTrxTsH1(template (value) uint3_t tsc := 7, |
| 891 | template (value) uint6_t hsn := 0, |
| 892 | template (value) uint6_t maio := 0, |
| 893 | template (value) bitstring ma := ''B) := { |
| 894 | tsc := tsc, |
| 895 | hopping := 1, |
| 896 | hsn := hsn, |
| 897 | maio := maio, |
Vadim Yanitskiy | 43ccaf5 | 2020-09-05 21:35:13 +0700 | [diff] [blame] | 898 | ma_bit_len := lengthof(valueof(ma)), |
Vadim Yanitskiy | 9e1206c | 2020-07-19 15:52:31 +0700 | [diff] [blame] | 899 | ma := f_pad_bit(valueof(ma), 64, '0'B) |
| 900 | }; |
Vadim Yanitskiy | 355604c | 2020-08-03 04:19:05 +0700 | [diff] [blame] | 901 | template PCUIF_InfoTrxTs tr_PCUIF_InfoTrxTsH1(template uint3_t tsc := ?, |
| 902 | template uint6_t hsn := ?, |
| 903 | template uint6_t maio := ?, |
Vadim Yanitskiy | 43ccaf5 | 2020-09-05 21:35:13 +0700 | [diff] [blame] | 904 | template bitstring ma := ?, |
| 905 | template uint8_t ma_bit_len := ?) := { |
Vadim Yanitskiy | 355604c | 2020-08-03 04:19:05 +0700 | [diff] [blame] | 906 | tsc := tsc, |
| 907 | hopping := 1, |
| 908 | hsn := hsn, |
| 909 | maio := maio, |
Vadim Yanitskiy | 43ccaf5 | 2020-09-05 21:35:13 +0700 | [diff] [blame] | 910 | ma_bit_len := ma_bit_len, |
Vadim Yanitskiy | 355604c | 2020-08-03 04:19:05 +0700 | [diff] [blame] | 911 | ma := ma |
| 912 | }; |
Vadim Yanitskiy | 9e1206c | 2020-07-19 15:52:31 +0700 | [diff] [blame] | 913 | |
Vadim Yanitskiy | 1da1fef | 2021-03-23 04:28:18 +0100 | [diff] [blame] | 914 | template (value) PCUIF_InfoTrx |
| 915 | ts_PCUIF_InfoTrx(template (value) uint16_t arfcn := 871, |
| 916 | template (value) BIT8 pdch_mask := '00000001'B, |
| 917 | template (value) uint3_t tsc := 7) := { |
Vadim Yanitskiy | 9e1206c | 2020-07-19 15:52:31 +0700 | [diff] [blame] | 918 | arfcn := arfcn, |
| 919 | pdch_mask := pdch_mask, |
Vadim Yanitskiy | d805172 | 2020-08-22 02:33:17 +0700 | [diff] [blame] | 920 | spare := '00'O, |
Vadim Yanitskiy | 9e1206c | 2020-07-19 15:52:31 +0700 | [diff] [blame] | 921 | hLayer1 := 0, |
| 922 | ts := { |
| 923 | ts_PCUIF_InfoTrxTsH0(tsc), ts_PCUIF_InfoTrxTsH0(tsc), |
| 924 | ts_PCUIF_InfoTrxTsH0(tsc), ts_PCUIF_InfoTrxTsH0(tsc), |
| 925 | ts_PCUIF_InfoTrxTsH0(tsc), ts_PCUIF_InfoTrxTsH0(tsc), |
| 926 | ts_PCUIF_InfoTrxTsH0(tsc), ts_PCUIF_InfoTrxTsH0(tsc) |
| 927 | } |
| 928 | }; |
| 929 | |
Vadim Yanitskiy | 1da1fef | 2021-03-23 04:28:18 +0100 | [diff] [blame] | 930 | template (value) PCUIF_InfoTrxs |
| 931 | ts_PCUIF_InfoTrxs_def(uint16_t base_arfcn) := { |
| 932 | ts_PCUIF_InfoTrx(arfcn := base_arfcn + 0), |
| 933 | ts_PCUIF_InfoTrx(arfcn := base_arfcn + 1), |
| 934 | ts_PCUIF_InfoTrx(arfcn := base_arfcn + 2), |
| 935 | ts_PCUIF_InfoTrx(arfcn := base_arfcn + 3), |
| 936 | ts_PCUIF_InfoTrx(arfcn := base_arfcn + 4), |
| 937 | ts_PCUIF_InfoTrx(arfcn := base_arfcn + 5), |
| 938 | ts_PCUIF_InfoTrx(arfcn := base_arfcn + 6), |
| 939 | ts_PCUIF_InfoTrx(arfcn := base_arfcn + 7) |
Vadim Yanitskiy | 9e1206c | 2020-07-19 15:52:31 +0700 | [diff] [blame] | 940 | }; |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 941 | |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 942 | 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] | 943 | template (value) PCUIF_info_ind info_ind) := { |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 944 | msg_type := PCU_IF_MSG_INFO_IND, |
| 945 | bts_nr := bts_nr, |
| 946 | spare := '0000'O, |
| 947 | u := { |
Pau Espin Pedrol | f787b09 | 2019-10-04 18:34:05 +0200 | [diff] [blame] | 948 | info_ind := info_ind |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 949 | } |
| 950 | } |
Harald Welte | d378a25 | 2018-03-13 17:02:14 +0100 | [diff] [blame] | 951 | template PCUIF_Message tr_PCUIF_INFO_IND(template uint8_t bts_nr := ?, |
| 952 | template PCUIF_Flags flags := ?, |
Vadim Yanitskiy | c155930 | 2020-07-19 16:39:12 +0700 | [diff] [blame] | 953 | template uint32_t version := mp_pcuif_version) := { |
Harald Welte | d378a25 | 2018-03-13 17:02:14 +0100 | [diff] [blame] | 954 | msg_type := PCU_IF_MSG_INFO_IND, |
| 955 | bts_nr := bts_nr, |
| 956 | spare := ?, |
| 957 | u := { |
| 958 | info_ind := { |
| 959 | version := version, |
| 960 | flags := flags, |
| 961 | trx := ?, |
| 962 | bsic := ?, |
| 963 | mcc := ?, |
| 964 | mnc :=?, |
Harald Welte | 3568dc7 | 2018-03-13 17:06:51 +0100 | [diff] [blame] | 965 | mnc_3_digits := ?, |
Harald Welte | d378a25 | 2018-03-13 17:02:14 +0100 | [diff] [blame] | 966 | lac := ?, |
| 967 | rac := ?, |
| 968 | nsei := ?, |
| 969 | nse_timer := ?, |
| 970 | cell_timer := ?, |
| 971 | cell_id := ?, |
| 972 | repeat_time := ?, |
| 973 | repeat_count := ?, |
| 974 | bvci := ?, |
| 975 | t3142 := ?, |
| 976 | t3169 := ?, |
| 977 | t3191 := ?, |
| 978 | t3193_10ms := ?, |
| 979 | t3195 := ?, |
Pau Espin Pedrol | 76de166 | 2021-03-01 17:40:58 +0100 | [diff] [blame] | 980 | n3101 := ?, |
| 981 | n3103 := ?, |
| 982 | n3105 := ?, |
Harald Welte | d378a25 | 2018-03-13 17:02:14 +0100 | [diff] [blame] | 983 | cv_countdown := ?, |
| 984 | dl_tbf_ext := ?, |
| 985 | ul_tbf_ext := ?, |
| 986 | initial_cs := ?, |
| 987 | initial_mcs := ?, |
| 988 | nsvci := ?, |
Vadim Yanitskiy | 0d59080 | 2020-08-21 00:14:22 +0700 | [diff] [blame] | 989 | local_port := ?, |
Harald Welte | d378a25 | 2018-03-13 17:02:14 +0100 | [diff] [blame] | 990 | remote_port := ?, |
Alexander Couzens | 1e5dc48 | 2020-07-28 15:38:46 +0200 | [diff] [blame] | 991 | remote_addr := ? |
Harald Welte | d378a25 | 2018-03-13 17:02:14 +0100 | [diff] [blame] | 992 | } |
| 993 | } |
| 994 | } |
| 995 | |
Harald Welte | a321981 | 2019-03-02 00:02:28 +0100 | [diff] [blame] | 996 | template (value) PCUIF_Message ts_PCUIF_TIME_IND(template (value) uint8_t bts_nr, |
| 997 | template (value) uint32_t fn) := { |
| 998 | msg_type := PCU_IF_MSG_TIME_IND, |
| 999 | bts_nr := bts_nr, |
| 1000 | spare := '0000'O, |
| 1001 | u := { |
| 1002 | time_ind := { |
| 1003 | fn := fn |
| 1004 | } |
| 1005 | } |
| 1006 | } |
| 1007 | template PCUIF_Message tr_PCUIF_TIME_IND(template uint8_t bts_nr, |
| 1008 | template uint32_t fn) := { |
| 1009 | msg_type := PCU_IF_MSG_TIME_IND, |
| 1010 | bts_nr := bts_nr, |
| 1011 | spare := ?, |
| 1012 | u := { |
| 1013 | time_ind := { |
| 1014 | fn := fn |
| 1015 | } |
| 1016 | } |
| 1017 | } |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 1018 | |
Vadim Yanitskiy | d0766b2 | 2021-06-18 15:39:04 +0200 | [diff] [blame] | 1019 | template (value) PCUIF_Message |
| 1020 | ts_PCUIF_INTERF_IND(template (value) uint8_t bts_nr, |
| 1021 | template (value) uint8_t trx_nr, |
| 1022 | template (value) uint32_t fn, |
| 1023 | template (value) PCUIF_interf interf) := { |
| 1024 | msg_type := PCU_IF_MSG_INTERF_IND, |
| 1025 | bts_nr := bts_nr, |
| 1026 | spare := '0000'O, |
| 1027 | u := { |
| 1028 | interf_ind := { |
| 1029 | trx_nr := trx_nr, |
| 1030 | spare := '000000'O, |
| 1031 | fn := fn, |
| 1032 | interf := interf |
| 1033 | } |
| 1034 | } |
| 1035 | } |
| 1036 | template PCUIF_Message |
| 1037 | tr_PCUIF_INTERF_IND(template (present) uint8_t bts_nr := ?, |
| 1038 | template (present) uint8_t trx_nr := ?, |
| 1039 | template (present) uint32_t fn := ?, |
| 1040 | template (present) PCUIF_interf interf := ?) := { |
| 1041 | msg_type := PCU_IF_MSG_INTERF_IND, |
| 1042 | bts_nr := bts_nr, |
| 1043 | spare := ?, |
| 1044 | u := { |
| 1045 | interf_ind := { |
| 1046 | trx_nr := trx_nr, |
| 1047 | spare := ?, |
| 1048 | fn := fn, |
| 1049 | interf := interf |
| 1050 | } |
| 1051 | } |
| 1052 | } |
| 1053 | |
Harald Welte | 4bff40a | 2019-03-21 21:34:10 +0100 | [diff] [blame] | 1054 | template (value) PCUIF_Message ts_PCUIF_SUSP_REQ(template (value) uint8_t bts_nr, |
| 1055 | template (value) OCT4 tlli, |
| 1056 | template (value) OCT6 ra_id, |
| 1057 | template (value) uint8_t cause) := { |
| 1058 | msg_type := PCU_IF_MSG_SUSP_REQ, |
| 1059 | bts_nr := bts_nr, |
| 1060 | spare := '0000'O, |
| 1061 | u := { |
| 1062 | susp_req := { |
| 1063 | tlli := tlli, |
| 1064 | ra_id := ra_id, |
| 1065 | cause := cause |
| 1066 | } |
| 1067 | } |
| 1068 | } |
| 1069 | template PCUIF_Message tr_PCUIF_SUSP_REQ(template uint8_t bts_nr, |
| 1070 | template OCT4 tlli, |
| 1071 | template OCT6 ra_id, |
| 1072 | template uint8_t cause) := { |
| 1073 | msg_type := PCU_IF_MSG_SUSP_REQ, |
| 1074 | bts_nr := bts_nr, |
| 1075 | spare := '0000'O, |
| 1076 | u := { |
| 1077 | susp_req := { |
| 1078 | tlli := tlli, |
| 1079 | ra_id := ra_id, |
| 1080 | cause := cause |
| 1081 | } |
| 1082 | } |
| 1083 | } |
| 1084 | |
Harald Welte | 11b734c | 2019-09-05 14:17:54 +0200 | [diff] [blame] | 1085 | template (value) PCUIF_Message ts_PCUIF_APP_INFO_REQ(template (value) uint8_t bts_nr, |
| 1086 | template (value) uint8_t app_type, |
| 1087 | template (value) octetstring app_data) := { |
| 1088 | msg_type := PCU_IF_MSG_APP_INFO_REQ, |
| 1089 | bts_nr := bts_nr, |
| 1090 | spare := '0000'O, |
| 1091 | u := { |
| 1092 | app_info_req := { |
| 1093 | application_type := app_type, |
| 1094 | len := 0, /* overwritten */ |
| 1095 | data := app_data |
| 1096 | } |
| 1097 | } |
| 1098 | } |
| 1099 | template (present) PCUIF_Message tr_PCUIF_APP_INFO_REQ(template (present) uint8_t bts_nr, |
| 1100 | template (present) uint8_t app_type, |
| 1101 | template (present) octetstring app_data) := { |
| 1102 | msg_type := PCU_IF_MSG_APP_INFO_REQ, |
| 1103 | bts_nr := bts_nr, |
| 1104 | spare := '0000'O, |
| 1105 | u := { |
| 1106 | app_info_req := { |
| 1107 | application_type := app_type, |
| 1108 | len := ?, |
| 1109 | data := app_data |
| 1110 | } |
| 1111 | } |
| 1112 | } |
| 1113 | |
Harald Welte | 4bff40a | 2019-03-21 21:34:10 +0100 | [diff] [blame] | 1114 | |
Pau Espin Pedrol | 65d712e | 2021-06-25 13:55:38 +0200 | [diff] [blame] | 1115 | template (value) PCUIF_Message ts_PCUIF_CONTAINER(template (value) uint8_t bts_nr, |
| 1116 | template (value) PCUIF_container container) := { |
| 1117 | msg_type := PCU_IF_MSG_CONTAINER, |
| 1118 | bts_nr := bts_nr, |
| 1119 | spare := '0000'O, |
| 1120 | u := { |
| 1121 | container := container |
| 1122 | } |
| 1123 | } |
| 1124 | template (present) PCUIF_Message tr_PCUIF_CONTAINER(template (present) uint8_t bts_nr, |
| 1125 | template (present) PCUIF_container container) := { |
| 1126 | msg_type := PCU_IF_MSG_CONTAINER, |
| 1127 | bts_nr := bts_nr, |
| 1128 | spare := '0000'O, |
| 1129 | u := { |
| 1130 | container := container |
| 1131 | } |
| 1132 | } |
| 1133 | |
Pau Espin Pedrol | f28fd08 | 2021-09-07 20:02:25 +0200 | [diff] [blame] | 1134 | template (value) PCUIF_container ts_PCUIF_CONT_OTHER(PCUIF_MsgType msg_type, template (value) octetstring payload) := { |
Pau Espin Pedrol | 65d712e | 2021-06-25 13:55:38 +0200 | [diff] [blame] | 1135 | msg_type := msg_type, |
| 1136 | spare := '00'O, |
| 1137 | len := lengthof(payload), |
| 1138 | u := { |
| 1139 | other := payload |
| 1140 | } |
| 1141 | } |
Pau Espin Pedrol | f28fd08 | 2021-09-07 20:02:25 +0200 | [diff] [blame] | 1142 | template (present) PCUIF_container tr_PCUIF_CONT_OTHER(template (present) PCUIF_MsgType msg_type, |
Pau Espin Pedrol | 65d712e | 2021-06-25 13:55:38 +0200 | [diff] [blame] | 1143 | template (present) octetstring payload) := { |
| 1144 | msg_type := msg_type, |
| 1145 | spare := '00'O, |
| 1146 | len := ?, |
| 1147 | u := { |
| 1148 | other := payload |
| 1149 | } |
| 1150 | } |
| 1151 | |
Pau Espin Pedrol | f28fd08 | 2021-09-07 20:02:25 +0200 | [diff] [blame] | 1152 | template (present) PCUIF_container tr_PCUIF_CONT_NEIGH_ADDR_REQ(template (present) uint16_t local_lac := ?, |
| 1153 | template (present) uint16_t local_ci := ?, |
| 1154 | template (present) uint16_t tgt_arfcn := ?, |
| 1155 | template (present) uint8_t tgt_bsic := ?) := { |
| 1156 | msg_type := PCU_IF_MSG_NEIGH_ADDR_REQ, |
| 1157 | spare := '00'O, |
| 1158 | len := ?, |
| 1159 | u := { |
| 1160 | neigh_addr_req := { |
| 1161 | local_lac := local_lac, |
| 1162 | local_ci := local_ci, |
| 1163 | tgt_arfcn := tgt_arfcn, |
| 1164 | tgt_bsic := tgt_bsic |
| 1165 | } |
| 1166 | } |
| 1167 | } |
| 1168 | template (present) PCUIF_Message tr_PCUIF_NEIGH_ADDR_REQ(template (present) uint8_t bts_nr, |
| 1169 | template (present) uint16_t local_lac := ?, |
| 1170 | template (present) uint16_t local_ci := ?, |
| 1171 | template (present) uint16_t tgt_arfcn := ?, |
| 1172 | template (present) uint8_t tgt_bsic := ?) := { |
| 1173 | msg_type := PCU_IF_MSG_CONTAINER, |
| 1174 | bts_nr := bts_nr, |
| 1175 | spare := '0000'O, |
| 1176 | u := { |
| 1177 | container := tr_PCUIF_CONT_NEIGH_ADDR_REQ(local_lac, local_ci, tgt_arfcn, tgt_bsic) |
| 1178 | } |
| 1179 | } |
| 1180 | |
| 1181 | template (value) PCUIF_container ts_PCUIF_CONT_NEIGH_ADDR_CNF(template (value) PCUIF_neigh_addr_req orig_req, |
| 1182 | template (value) uint8_t error_code := 0, |
| 1183 | template (value) uint16_t mcc := 0, |
| 1184 | template (value) uint16_t mnc := 0, |
| 1185 | template (value) uint8_t mnc_3_digits := 0, |
| 1186 | template (value) uint16_t lac := 0, |
| 1187 | template (value) uint8_t rac := 0, |
| 1188 | template (value) uint16_t cell_identity := 0) := { |
| 1189 | msg_type := PCU_IF_MSG_NEIGH_ADDR_CNF, |
| 1190 | spare := '00'O, |
| 1191 | len := 0, /* overwritten */ |
| 1192 | u := { |
| 1193 | neigh_addr_cnf := { |
| 1194 | orig_req := orig_req, |
| 1195 | error_code := error_code, |
| 1196 | mcc := mcc, |
| 1197 | mnc := mnc, |
| 1198 | mnc_3_digits := mnc_3_digits, |
| 1199 | lac := lac, |
| 1200 | rac := rac, |
| 1201 | cell_identity := cell_identity |
| 1202 | } |
| 1203 | } |
| 1204 | } |
| 1205 | template (value) PCUIF_Message ts_PCUIF_NEIGH_ADDR_CNF(template (value) uint8_t bts_nr, |
| 1206 | template (value) PCUIF_neigh_addr_req orig_req, |
| 1207 | template (value) uint8_t error_code := 0, |
| 1208 | template (value) uint16_t mcc := 0, |
| 1209 | template (value) uint16_t mnc := 0, |
| 1210 | template (value) uint8_t mnc_3_digits := 0, |
| 1211 | template (value) uint16_t lac := 0, |
| 1212 | template (value) uint8_t rac := 0, |
| 1213 | template (value) uint16_t cell_identity := 0) := { |
| 1214 | msg_type := PCU_IF_MSG_CONTAINER, |
| 1215 | bts_nr := bts_nr, |
| 1216 | spare := '0000'O, |
| 1217 | u := { |
| 1218 | container := ts_PCUIF_CONT_NEIGH_ADDR_CNF(orig_req, error_code, mcc, mnc, mnc_3_digits, |
| 1219 | lac, rac, cell_identity) |
| 1220 | } |
| 1221 | } |
| 1222 | |
Vadim Yanitskiy | 1da1fef | 2021-03-23 04:28:18 +0100 | [diff] [blame] | 1223 | function f_PCUIF_PDCHMask_set(inout PCUIF_info_ind info, BIT8 pdch_mask, |
| 1224 | template (present) uint8_t trx_nr := ?) |
Vadim Yanitskiy | d5321fb | 2020-10-31 20:23:47 +0700 | [diff] [blame] | 1225 | { |
Vadim Yanitskiy | 1da1fef | 2021-03-23 04:28:18 +0100 | [diff] [blame] | 1226 | for (var integer nr := 0; nr < lengthof(info.trx); nr := nr + 1) { |
| 1227 | if (match(nr, trx_nr)) { |
| 1228 | info.trx[nr].pdch_mask := pdch_mask; |
Vadim Yanitskiy | d5321fb | 2020-10-31 20:23:47 +0700 | [diff] [blame] | 1229 | } |
| 1230 | } |
| 1231 | } |
| 1232 | |
Alexander Couzens | e0f7c54 | 2020-09-13 17:25:18 +0200 | [diff] [blame] | 1233 | function f_PCUIF_AF2addr_type(AddressFamily address_family) |
| 1234 | return PCUIF_AddrType { |
| 1235 | if (address_family == AF_INET) { |
| 1236 | return PCUIF_ADDR_TYPE_IPV4; |
| 1237 | } else if (address_family == AF_INET6) { |
| 1238 | return PCUIF_ADDR_TYPE_IPV6; |
| 1239 | } else { |
| 1240 | return PCUIF_ADDR_TYPE_UNSPEC; |
| 1241 | } |
| 1242 | } |
| 1243 | |
Alexander Couzens | 1e5dc48 | 2020-07-28 15:38:46 +0200 | [diff] [blame] | 1244 | /* TODO: second (redundant) NSVC connection is not (yet) supported */ |
Vadim Yanitskiy | 1da1fef | 2021-03-23 04:28:18 +0100 | [diff] [blame] | 1245 | function f_PCUIF_RemoteAddr(PCUIF_AddrType addr_type, |
| 1246 | charstring addr_str) |
Alexander Couzens | 1e5dc48 | 2020-07-28 15:38:46 +0200 | [diff] [blame] | 1247 | return PCUIF_RemoteAddr { |
| 1248 | var PCUIF_RemoteAddr remote_addr; |
| 1249 | |
Vadim Yanitskiy | 1da1fef | 2021-03-23 04:28:18 +0100 | [diff] [blame] | 1250 | remote_addr.addr_type[0] := addr_type; |
| 1251 | if (addr_type == PCUIF_ADDR_TYPE_IPV4) { |
| 1252 | remote_addr.addr[0] := f_inet_addr(addr_str); |
Alexander Couzens | 1e5dc48 | 2020-07-28 15:38:46 +0200 | [diff] [blame] | 1253 | } else { |
Vadim Yanitskiy | 1da1fef | 2021-03-23 04:28:18 +0100 | [diff] [blame] | 1254 | remote_addr.addr[0] := f_inet6_addr(addr_str); |
Alexander Couzens | 1e5dc48 | 2020-07-28 15:38:46 +0200 | [diff] [blame] | 1255 | } |
| 1256 | |
Vadim Yanitskiy | 1da1fef | 2021-03-23 04:28:18 +0100 | [diff] [blame] | 1257 | remote_addr.addr_type[1] := PCUIF_ADDR_TYPE_UNSPEC; |
| 1258 | remote_addr.addr[1] := f_pad_oct(''O, 16, '00'O); |
| 1259 | |
Alexander Couzens | 1e5dc48 | 2020-07-28 15:38:46 +0200 | [diff] [blame] | 1260 | return remote_addr; |
| 1261 | } |
| 1262 | |
Vadim Yanitskiy | 9e1206c | 2020-07-19 15:52:31 +0700 | [diff] [blame] | 1263 | |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 1264 | } with { encode "RAW" variant "BYTEORDER(first)" }; |