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