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