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