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