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