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