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