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