Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Sigma Control API DUT (station/AP) |
| 3 | * Copyright (c) 2010-2011, Atheros Communications, Inc. |
Amarnath Hullur Subramanyam | 9c381f5 | 2017-03-17 00:04:41 -0700 | [diff] [blame] | 4 | * Copyright (c) 2011-2017, Qualcomm Atheros, Inc. |
Jouni Malinen | 2feb913 | 2021-11-16 00:53:06 +0200 | [diff] [blame] | 5 | * Copyright (c) 2018-2021, The Linux Foundation |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 6 | * All Rights Reserved. |
| 7 | * Licensed under the Clear BSD license. See README for more details. |
| 8 | */ |
| 9 | |
| 10 | #ifndef SIGMA_DUT_H |
| 11 | #define SIGMA_DUT_H |
| 12 | |
Lior David | 9981b51 | 2017-01-20 13:16:40 +0200 | [diff] [blame] | 13 | #ifdef __GNUC__ |
| 14 | #define _GNU_SOURCE 1 |
| 15 | #endif |
| 16 | |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 17 | #include <stdlib.h> |
Veerendranath Jakkam | 2e5ef8e | 2021-02-12 15:05:16 +0530 | [diff] [blame] | 18 | #include <stdbool.h> |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 19 | #include <stdio.h> |
| 20 | #include <stdarg.h> |
| 21 | #include <string.h> |
| 22 | #include <errno.h> |
| 23 | #include <unistd.h> |
| 24 | #include <time.h> |
| 25 | #include <sys/time.h> |
Jouni Malinen | 3d972ba | 2017-03-15 20:52:20 +0200 | [diff] [blame] | 26 | #include <sys/types.h> |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 27 | #include <sys/socket.h> |
| 28 | #include <net/if.h> |
| 29 | #ifdef __QNXNTO__ |
| 30 | #include <sys/select.h> |
| 31 | #include <net/if_ether.h> |
| 32 | #endif /* __QNXNTO__ */ |
| 33 | #include <netinet/in.h> |
| 34 | #include <arpa/inet.h> |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 35 | #include <pthread.h> |
Peng Xu | 291d97d | 2018-01-31 16:34:03 -0800 | [diff] [blame] | 36 | #ifdef NL80211_SUPPORT |
| 37 | #include <netlink/genl/family.h> |
| 38 | #include <netlink/genl/ctrl.h> |
| 39 | #include <netlink/genl/genl.h> |
| 40 | #include "qca-vendor_copy.h" |
| 41 | #include "nl80211_copy.h" |
| 42 | #endif /* NL80211_SUPPORT */ |
Vinay Gannevaram | 2dfb1da | 2019-06-14 15:24:08 +0530 | [diff] [blame] | 43 | #ifdef ANDROID_WIFI_HAL |
Sunil Dutt | 437476e | 2021-04-01 13:56:44 +0530 | [diff] [blame] | 44 | /* avoid duplicate definitions from wifi_hal.h causing issues */ |
| 45 | #define u32 wifi_hal_u32 |
| 46 | #define u16 wifi_hal_u16 |
| 47 | #define u8 wifi_hal_u8 |
Vinay Gannevaram | 2dfb1da | 2019-06-14 15:24:08 +0530 | [diff] [blame] | 48 | #include "wifi_hal.h" |
Sunil Dutt | 437476e | 2021-04-01 13:56:44 +0530 | [diff] [blame] | 49 | #undef u32 |
| 50 | #undef u16 |
| 51 | #undef u8 |
Vinay Gannevaram | 2dfb1da | 2019-06-14 15:24:08 +0530 | [diff] [blame] | 52 | #endif /*ANDROID_WIFI_HAL*/ |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 53 | |
Veerendranath Jakkam | 764553e | 2020-09-10 07:27:45 +0530 | [diff] [blame] | 54 | #ifdef NL80211_SUPPORT |
| 55 | #ifndef NL_CAPABILITY_VERSION_3_5_0 |
| 56 | #define nla_nest_start(msg, attrtype) \ |
| 57 | nla_nest_start(msg, NLA_F_NESTED | (attrtype)) |
| 58 | #endif |
| 59 | #endif |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 60 | |
| 61 | #ifdef __GNUC__ |
| 62 | #define PRINTF_FORMAT(a,b) __attribute__ ((format (printf, (a), (b)))) |
| 63 | #else |
| 64 | #define PRINTF_FORMAT(a,b) |
| 65 | #endif |
| 66 | |
Jouni Malinen | da5f35b | 2019-03-26 00:25:53 +0200 | [diff] [blame] | 67 | #define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0])) |
| 68 | |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 69 | #ifndef SIGMA_TMPDIR |
| 70 | #define SIGMA_TMPDIR "/tmp" |
| 71 | #endif /* SIGMA_TMPDIR */ |
| 72 | |
| 73 | #ifndef SIGMA_DUT_VER |
| 74 | #define SIGMA_DUT_VER "(unknown)" |
| 75 | #endif /* SIGMA_DUT_VER */ |
| 76 | |
| 77 | #ifndef ETH_ALEN |
| 78 | #define ETH_ALEN 6 |
| 79 | #endif |
| 80 | |
Veerendranath Jakkam | d0ad6ef | 2020-05-21 17:09:26 +0530 | [diff] [blame] | 81 | #ifndef BIT_ULL |
| 82 | #define BIT_ULL(nr) (1ULL << (nr)) |
| 83 | #endif |
| 84 | |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 85 | #ifndef ETH_P_ARP |
| 86 | #define ETH_P_ARP 0x0806 |
| 87 | #endif |
| 88 | |
Peng Xu | 47d709b | 2019-06-04 18:14:02 -0700 | [diff] [blame] | 89 | #define IPV6_ADDR_LEN 16 |
| 90 | |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 91 | struct sigma_dut; |
| 92 | |
| 93 | #define MAX_PARAMS 100 |
Alejandro Vasquez | 363f558 | 2018-07-17 11:25:05 -0700 | [diff] [blame] | 94 | #define MAX_RADIO 3 |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 95 | |
Ajit Vaishya | c2ae961 | 2020-02-28 00:09:07 +0530 | [diff] [blame] | 96 | #define NAN_AWARE_IFACE "wifi-aware0" |
| 97 | |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 98 | /* Set default operating channel width 80 MHz */ |
| 99 | #define VHT_DEFAULT_OPER_CHWIDTH AP_80_VHT_OPER_CHWIDTH |
| 100 | |
| 101 | typedef unsigned int u32; |
Ankita Bajaj | 1bde794 | 2018-01-09 19:15:01 +0530 | [diff] [blame] | 102 | typedef uint16_t u16; |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 103 | typedef unsigned char u8; |
| 104 | |
Alexei Avshalom Lazar | a90032d | 2019-05-02 13:34:02 +0300 | [diff] [blame] | 105 | struct ieee80211_hdr_3addr { |
| 106 | uint16_t frame_control; |
| 107 | uint16_t duration_id; |
| 108 | uint8_t addr1[ETH_ALEN]; |
| 109 | uint8_t addr2[ETH_ALEN]; |
| 110 | uint8_t addr3[ETH_ALEN]; |
| 111 | uint16_t seq_ctrl; |
| 112 | } __attribute__((packed)); |
| 113 | |
| 114 | struct wfa_p2p_attribute { |
| 115 | uint8_t id; |
| 116 | uint16_t len; |
| 117 | uint8_t variable[0]; |
| 118 | } __attribute__((packed)); |
| 119 | |
Lavanya Suresh | 2e2097d | 2021-02-23 21:17:28 +0530 | [diff] [blame] | 120 | struct dut_hw_modes { |
| 121 | u16 ht_capab; |
| 122 | u8 mcs_set[16]; |
| 123 | u8 ampdu_params; |
| 124 | u32 vht_capab; |
| 125 | u8 vht_mcs_set[8]; |
Venkateswara Naralasetty | 8784fcb | 2021-10-11 13:52:15 +0530 | [diff] [blame] | 126 | u8 ap_he_phy_capab[11]; |
Hu Wang | acede50 | 2021-11-15 19:41:00 +0530 | [diff] [blame] | 127 | bool valid; |
Lavanya Suresh | 2e2097d | 2021-02-23 21:17:28 +0530 | [diff] [blame] | 128 | }; |
| 129 | |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 130 | #define WPA_GET_BE32(a) ((((u32) (a)[0]) << 24) | (((u32) (a)[1]) << 16) | \ |
| 131 | (((u32) (a)[2]) << 8) | ((u32) (a)[3])) |
| 132 | #define WPA_PUT_BE32(a, val) \ |
| 133 | do { \ |
| 134 | (a)[0] = (u8) ((((u32) (val)) >> 24) & 0xff); \ |
| 135 | (a)[1] = (u8) ((((u32) (val)) >> 16) & 0xff); \ |
| 136 | (a)[2] = (u8) ((((u32) (val)) >> 8) & 0xff); \ |
| 137 | (a)[3] = (u8) (((u32) (val)) & 0xff); \ |
| 138 | } while (0) |
| 139 | |
| 140 | struct sigma_cmd { |
| 141 | char *params[MAX_PARAMS]; |
| 142 | char *values[MAX_PARAMS]; |
| 143 | int count; |
| 144 | }; |
| 145 | |
Alejandro Vasquez | 3410aa5 | 2018-07-17 11:26:17 -0700 | [diff] [blame] | 146 | #define MAX_CMD_LEN 4096 |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 147 | |
| 148 | struct sigma_conn { |
| 149 | int s; |
| 150 | struct sockaddr_in addr; |
| 151 | socklen_t addrlen; |
| 152 | char buf[MAX_CMD_LEN + 5]; |
| 153 | int pos; |
| 154 | int waiting_completion; |
| 155 | }; |
| 156 | |
Jouni Malinen | 0e29cf2 | 2019-02-19 01:13:21 +0200 | [diff] [blame] | 157 | enum sigma_cmd_result { |
Jouni Malinen | 53264f6 | 2019-05-03 13:04:40 +0300 | [diff] [blame] | 158 | STATUS_SENT_ERROR = -3, |
Jouni Malinen | 0e29cf2 | 2019-02-19 01:13:21 +0200 | [diff] [blame] | 159 | ERROR_SEND_STATUS = -2, |
| 160 | INVALID_SEND_STATUS = -1, |
| 161 | STATUS_SENT = 0, |
| 162 | SUCCESS_SEND_STATUS = 1 |
| 163 | }; |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 164 | |
| 165 | struct sigma_cmd_handler { |
| 166 | struct sigma_cmd_handler *next; |
| 167 | char *cmd; |
| 168 | int (*validate)(struct sigma_cmd *cmd); |
| 169 | /* process return value: |
| 170 | * -2 = failed, caller will send status,ERROR |
| 171 | * -1 = failed, caller will send status,INVALID |
Jouni Malinen | 0e29cf2 | 2019-02-19 01:13:21 +0200 | [diff] [blame] | 172 | * 0 = response already sent |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 173 | * 1 = success, caller will send status,COMPLETE |
| 174 | */ |
Jouni Malinen | 26a5b76 | 2019-02-19 01:17:48 +0200 | [diff] [blame] | 175 | enum sigma_cmd_result (*process)(struct sigma_dut *dut, |
| 176 | struct sigma_conn *conn, |
| 177 | struct sigma_cmd *cmd); |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 178 | }; |
| 179 | |
| 180 | #define P2P_GRP_ID_LEN 128 |
| 181 | #define IP_ADDR_STR_LEN 16 |
| 182 | |
| 183 | struct wfa_cs_p2p_group { |
| 184 | struct wfa_cs_p2p_group *next; |
| 185 | char ifname[IFNAMSIZ]; |
| 186 | int go; |
| 187 | char grpid[P2P_GRP_ID_LEN]; |
| 188 | char ssid[33]; |
| 189 | }; |
| 190 | |
| 191 | #ifdef CONFIG_TRAFFIC_AGENT |
| 192 | |
| 193 | #define MAX_SIGMA_STREAMS 16 |
| 194 | #define MAX_SIGMA_STATS 6000 |
| 195 | |
| 196 | struct sigma_frame_stats { |
| 197 | unsigned int seqnum; |
| 198 | unsigned int local_sec; |
| 199 | unsigned int local_usec; |
| 200 | unsigned int remote_sec; |
| 201 | unsigned int remote_usec; |
| 202 | }; |
| 203 | |
| 204 | struct sigma_stream { |
| 205 | enum sigma_stream_profile { |
| 206 | SIGMA_PROFILE_FILE_TRANSFER, |
| 207 | SIGMA_PROFILE_MULTICAST, |
| 208 | SIGMA_PROFILE_IPTV, |
| 209 | SIGMA_PROFILE_TRANSACTION, |
| 210 | SIGMA_PROFILE_START_SYNC, |
| 211 | SIGMA_PROFILE_UAPSD |
| 212 | } profile; |
| 213 | int sender; |
| 214 | struct in_addr dst; |
| 215 | int dst_port; |
| 216 | struct in_addr src; |
| 217 | int src_port; |
| 218 | int frame_rate; |
| 219 | int duration; |
Jouni Malinen | c2493f8 | 2016-06-05 18:01:33 +0300 | [diff] [blame] | 220 | unsigned int payload_size; |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 221 | int start_delay; |
| 222 | int max_cnt; |
| 223 | enum sigma_traffic_class { |
| 224 | SIGMA_TC_VOICE, |
| 225 | SIGMA_TC_VIDEO, |
| 226 | SIGMA_TC_BACKGROUND, |
| 227 | SIGMA_TC_BEST_EFFORT |
| 228 | } tc; |
| 229 | int user_priority; |
| 230 | int user_priority_set; |
| 231 | int started; |
| 232 | int no_timestamps; |
| 233 | |
| 234 | int sock; |
| 235 | pthread_t thr; |
| 236 | int stop; |
| 237 | int ta_send_in_progress; |
| 238 | int trans_proto; |
| 239 | |
| 240 | /* Statistics */ |
| 241 | int tx_act_frames; /* |
| 242 | * Number of frames generated by the traffic |
| 243 | * generator application. The name is defined in the |
| 244 | * Sigma CAPI spec. |
| 245 | */ |
| 246 | int tx_frames; |
| 247 | int rx_frames; |
| 248 | unsigned long long tx_payload_bytes; |
| 249 | unsigned long long rx_payload_bytes; |
| 250 | int out_of_seq_frames; |
| 251 | struct sigma_frame_stats *stats; |
| 252 | unsigned int num_stats; |
| 253 | unsigned int stream_id; |
| 254 | |
| 255 | /* U-APSD */ |
| 256 | unsigned int sta_id; |
| 257 | unsigned int rx_cookie; |
| 258 | unsigned int uapsd_sta_tc; |
| 259 | unsigned int uapsd_rx_state; |
| 260 | unsigned int uapsd_tx_state; |
| 261 | unsigned int tx_stop_cnt; |
| 262 | unsigned int tx_hello_cnt; |
| 263 | pthread_t uapsd_send_thr; |
| 264 | pthread_cond_t tx_thr_cond; |
| 265 | pthread_mutex_t tx_thr_mutex; |
| 266 | int reset_rx; |
| 267 | int num_retry; |
| 268 | char ifname[IFNAMSIZ]; /* ifname from the command */ |
| 269 | struct sigma_dut *dut; /* for traffic agent thread to access context */ |
Pradeep Reddy POTTETI | 7959404 | 2015-11-23 12:59:12 +0530 | [diff] [blame] | 270 | /* console */ |
| 271 | char test_name[9]; /* test case name */ |
| 272 | int can_quit; |
| 273 | int reset; |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 274 | }; |
| 275 | |
| 276 | #endif /* CONFIG_TRAFFIC_AGENT */ |
| 277 | |
Alexei Avshalom Lazar | bc180dc | 2018-12-18 16:01:14 +0200 | [diff] [blame] | 278 | /* extended scheduling test */ |
| 279 | enum sigma_ese_type { |
| 280 | ESE_CBAP, |
| 281 | ESE_SP, |
| 282 | }; |
| 283 | |
| 284 | struct sigma_ese_alloc { |
| 285 | unsigned int percent_bi; |
| 286 | enum sigma_ese_type type; |
| 287 | unsigned int src_aid, dst_aid; |
| 288 | }; |
| 289 | |
| 290 | #define ESE_BCAST_AID 255 |
| 291 | #define MAX_ESE_ALLOCS 4 |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 292 | |
| 293 | #define NUM_AP_AC 4 |
| 294 | #define AP_AC_BE 0 |
| 295 | #define AP_AC_BK 1 |
| 296 | #define AP_AC_VI 2 |
| 297 | #define AP_AC_VO 3 |
| 298 | |
Adil Saeed Musthafa | b7b297f | 2017-04-10 23:13:31 -0700 | [diff] [blame] | 299 | #define MAX_WLAN_TAGS 3 |
Adil Saeed Musthafa | 6906372 | 2017-04-10 23:13:40 -0700 | [diff] [blame] | 300 | #define MBO_MAX_PREF_BSSIDS 10 |
Adil Saeed Musthafa | 4ec61bd | 2017-04-10 23:13:41 -0700 | [diff] [blame] | 301 | #define MAX_FT_BSS_LIST 10 |
Adil Saeed Musthafa | b7b297f | 2017-04-10 23:13:31 -0700 | [diff] [blame] | 302 | |
Peng Xu | 8863ec7 | 2018-08-06 11:50:37 -0700 | [diff] [blame] | 303 | #define TRANSPORT_PROTO_TYPE_TCP 0x06 |
| 304 | #define TRANSPORT_PROTO_TYPE_UDP 0x11 |
| 305 | #define NAN_TRANSPORT_PORT_DEFAULT 7000 |
| 306 | #define NAN_TRANSPORT_PROTOCOL_DEFAULT TRANSPORT_PROTO_TYPE_TCP |
| 307 | |
Jouni Malinen | 57fa3d8 | 2016-11-30 12:51:43 +0200 | [diff] [blame] | 308 | enum value_not_set_enabled_disabled { |
| 309 | VALUE_NOT_SET, |
| 310 | VALUE_ENABLED, |
| 311 | VALUE_DISABLED |
| 312 | }; |
| 313 | |
Pradeep Reddy Potteti | 4b0cdee | 2017-03-15 12:37:33 +0530 | [diff] [blame] | 314 | enum sec_ch_offset { |
| 315 | SEC_CH_NO, |
| 316 | SEC_CH_40ABOVE, |
| 317 | SEC_CH_40BELOW |
| 318 | }; |
| 319 | |
Adil Saeed Musthafa | 6906372 | 2017-04-10 23:13:40 -0700 | [diff] [blame] | 320 | struct mbo_pref_ap { |
| 321 | int ap_ne_class; |
| 322 | int ap_ne_op_ch; |
| 323 | int ap_ne_pref; |
| 324 | unsigned char mac_addr[ETH_ALEN]; |
| 325 | }; |
| 326 | |
Peng Xu | 291d97d | 2018-01-31 16:34:03 -0800 | [diff] [blame] | 327 | #ifdef NL80211_SUPPORT |
| 328 | #define SOCK_BUF_SIZE (32 * 1024) |
| 329 | struct nl80211_ctx { |
| 330 | struct nl_sock *sock; |
| 331 | int netlink_familyid; |
| 332 | int nlctrl_familyid; |
| 333 | size_t sock_buf_size; |
Kiran Kumar Lokere | f61a743 | 2021-06-24 00:19:19 -0700 | [diff] [blame] | 334 | struct nl_sock *event_sock; |
Peng Xu | 291d97d | 2018-01-31 16:34:03 -0800 | [diff] [blame] | 335 | }; |
| 336 | #endif /* NL80211_SUPPORT */ |
| 337 | |
Alexei Avshalom Lazar | 33f700c | 2018-12-18 16:00:39 +0200 | [diff] [blame] | 338 | /* hardcoded long WSC IE values to force fragmentation */ |
| 339 | #define WPS_LONG_DEVICE_NAME "Qti1234511adtest1234567890123456" |
| 340 | #define WPS_LONG_MANUFACTURER "Qti1234511adQti1234511adQti1234511adQti1234511adQti1234511ad" |
| 341 | #define WPS_LONG_MODEL_NAME "Qti1234511adtest1234567890123456" |
| 342 | #define WPS_LONG_MODEL_NUMBER "11111111111111111111111111111111" |
| 343 | #define WPS_LONG_SERIAL_NUMBER "22222222222222222222222222222222" |
| 344 | |
Jouni Malinen | e4fde73 | 2019-03-25 22:29:37 +0200 | [diff] [blame] | 345 | enum akm_suite_values { |
| 346 | AKM_WPA_EAP = 1, |
| 347 | AKM_WPA_PSK = 2, |
| 348 | AKM_FT_EAP = 3, |
| 349 | AKM_FT_PSK = 4, |
| 350 | AKM_EAP_SHA256 = 5, |
| 351 | AKM_PSK_SHA256 = 6, |
| 352 | AKM_SAE = 8, |
| 353 | AKM_FT_SAE = 9, |
| 354 | AKM_SUITE_B = 12, |
| 355 | AKM_FT_SUITE_B = 13, |
| 356 | AKM_FILS_SHA256 = 14, |
| 357 | AKM_FILS_SHA384 = 15, |
| 358 | AKM_FT_FILS_SHA256 = 16, |
| 359 | AKM_FT_FILS_SHA384 = 17, |
| 360 | |
| 361 | }; |
| 362 | |
Veerendranath Jakkam | 9ceb3b1 | 2021-09-10 03:18:17 +0530 | [diff] [blame] | 363 | enum ip_version { |
| 364 | DEFAULT_IP_VERSION = 0, |
| 365 | IPV4 = 4, |
| 366 | IPV6 = 6, |
| 367 | }; |
| 368 | |
| 369 | enum ip_protocol { |
| 370 | DEFAULT_PROTOCOL = 0, |
| 371 | PROTOCOL_UDP = 17, |
| 372 | PROTOCOL_TCP = 6, |
| 373 | PROTOCOL_ESP = 50, |
| 374 | }; |
| 375 | |
| 376 | #define DSCP_POLICY_SUCCESS 0 |
| 377 | #define DSCP_POLICY_REJECT 1 |
| 378 | |
| 379 | struct dscp_policy_status { |
| 380 | int id; |
| 381 | int status; |
| 382 | }; |
| 383 | |
| 384 | struct dscp_policy_data { |
| 385 | char domain_name[250]; |
| 386 | int policy_id; |
| 387 | enum ip_version ip_version; |
| 388 | char src_ip[INET6_ADDRSTRLEN]; |
| 389 | char dst_ip[INET6_ADDRSTRLEN]; |
| 390 | int src_port; |
| 391 | int dst_port; |
| 392 | int start_port; |
| 393 | int end_port; |
| 394 | enum ip_protocol protocol; |
| 395 | int dscp; |
Shivani Baranwal | 9cfc8d7 | 2021-11-22 11:53:19 +0530 | [diff] [blame] | 396 | int granularity_score; |
Veerendranath Jakkam | 9ceb3b1 | 2021-09-10 03:18:17 +0530 | [diff] [blame] | 397 | struct dscp_policy_data *next; |
| 398 | }; |
| 399 | |
Jouni Malinen | 29a63f4 | 2022-04-13 22:08:47 +0300 | [diff] [blame] | 400 | enum dpp_mdns_role { |
| 401 | DPP_MDNS_NOT_RUNNING, |
| 402 | DPP_MDNS_RELAY, |
| 403 | DPP_MDNS_CONTROLLER, |
| 404 | }; |
| 405 | |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 406 | struct sigma_dut { |
Jouni Malinen | d209548 | 2019-11-04 17:10:43 +0200 | [diff] [blame] | 407 | const char *main_ifname; |
Jouni Malinen | b21f054 | 2019-11-04 17:53:38 +0200 | [diff] [blame] | 408 | char *main_ifname_2g; |
| 409 | char *main_ifname_5g; |
Jouni Malinen | d209548 | 2019-11-04 17:10:43 +0200 | [diff] [blame] | 410 | const char *station_ifname; |
Jouni Malinen | b21f054 | 2019-11-04 17:53:38 +0200 | [diff] [blame] | 411 | char *station_ifname_2g; |
| 412 | char *station_ifname_5g; |
Jouni Malinen | 1f76fa6 | 2019-11-04 17:30:12 +0200 | [diff] [blame] | 413 | char *p2p_ifname_buf; |
Jouni Malinen | b21f054 | 2019-11-04 17:53:38 +0200 | [diff] [blame] | 414 | int use_5g; |
Kiran Kumar Lokere | afa02af | 2021-05-11 18:28:03 -0700 | [diff] [blame] | 415 | int ap_band_6g; |
Jouni Malinen | 78217db | 2019-11-06 18:46:08 +0200 | [diff] [blame] | 416 | int sta_2g_started; |
| 417 | int sta_5g_started; |
Jouni Malinen | d209548 | 2019-11-04 17:10:43 +0200 | [diff] [blame] | 418 | |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 419 | int s; /* server TCP socket */ |
| 420 | int debug_level; |
| 421 | int stdout_debug; |
| 422 | struct sigma_cmd_handler *cmds; |
Jouni Malinen | 0fee701 | 2019-02-19 12:41:07 +0200 | [diff] [blame] | 423 | int response_sent; |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 424 | |
Alexei Avshalom Lazar | c9bc15d | 2020-01-29 10:52:13 +0200 | [diff] [blame] | 425 | const char *sigma_tmpdir; |
| 426 | |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 427 | /* Default timeout value (seconds) for commands */ |
| 428 | unsigned int default_timeout; |
Vinita S. Maloo | f7a2cbf | 2020-11-18 19:29:44 +0530 | [diff] [blame] | 429 | unsigned int user_config_timeout; |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 430 | |
| 431 | int next_streamid; |
| 432 | |
| 433 | const char *bridge; /* bridge interface to use in AP mode */ |
| 434 | |
| 435 | enum sigma_mode { |
| 436 | SIGMA_MODE_UNKNOWN, |
| 437 | SIGMA_MODE_STATION, |
| 438 | SIGMA_MODE_AP, |
| 439 | SIGMA_MODE_SNIFFER |
| 440 | } mode; |
| 441 | |
| 442 | /* |
| 443 | * Local cached values to handle API that does not provide all the |
| 444 | * needed information with commands that actually trigger some |
| 445 | * operations. |
| 446 | */ |
| 447 | int listen_chn; |
| 448 | int persistent; |
| 449 | int intra_bss; |
| 450 | int noa_duration; |
| 451 | int noa_interval; |
| 452 | int noa_count; |
| 453 | enum wfa_cs_wps_method { |
| 454 | WFA_CS_WPS_NOT_READY, |
| 455 | WFA_CS_WPS_PBC, |
| 456 | WFA_CS_WPS_PIN_DISPLAY, |
| 457 | WFA_CS_WPS_PIN_LABEL, |
| 458 | WFA_CS_WPS_PIN_KEYPAD |
| 459 | } wps_method; |
| 460 | char wps_pin[9]; |
| 461 | |
| 462 | struct wfa_cs_p2p_group *groups; |
| 463 | |
| 464 | char infra_ssid[33]; |
| 465 | int infra_network_id; |
| 466 | |
| 467 | enum p2p_mode { |
| 468 | P2P_IDLE, P2P_DISCOVER, P2P_LISTEN, P2P_DISABLE |
| 469 | } p2p_mode; |
| 470 | |
| 471 | int go; |
| 472 | int p2p_client; |
Jouni Malinen | 016ae6c | 2019-11-04 17:00:01 +0200 | [diff] [blame] | 473 | const char *p2p_ifname; |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 474 | |
| 475 | int client_uapsd; |
| 476 | |
| 477 | char arp_ipaddr[IP_ADDR_STR_LEN]; |
| 478 | char arp_ifname[IFNAMSIZ + 1]; |
| 479 | |
| 480 | enum sta_pmf { |
| 481 | STA_PMF_DISABLED, |
| 482 | STA_PMF_OPTIONAL, |
| 483 | STA_PMF_REQUIRED |
| 484 | } sta_pmf; |
| 485 | |
Jouni Malinen | 6a7c9b4 | 2019-08-20 00:15:59 +0300 | [diff] [blame] | 486 | int sta_ft_ds; |
| 487 | |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 488 | int no_tpk_expiration; |
| 489 | |
| 490 | int er_oper_performed; |
| 491 | char er_oper_bssid[20]; |
| 492 | int amsdu_size; |
| 493 | int back_rcv_buf; |
| 494 | |
| 495 | int testbed_flag_txsp; |
| 496 | int testbed_flag_rxsp; |
| 497 | int chwidth; |
| 498 | |
Jouni Malinen | 8179fee | 2019-03-28 03:19:47 +0200 | [diff] [blame] | 499 | unsigned int akm_values; |
| 500 | |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 501 | /* AP configuration */ |
| 502 | char ap_ssid[33]; |
Adil Saeed Musthafa | b7b297f | 2017-04-10 23:13:31 -0700 | [diff] [blame] | 503 | /* |
| 504 | * WLAN-TAG of 1 will use 'ap_' variables; |
| 505 | * tag higher than 1 will use 'ap_tag_' variables. |
| 506 | */ |
| 507 | char ap_tag_ssid[MAX_WLAN_TAGS - 1][33]; |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 508 | enum ap_mode { |
| 509 | AP_11a, |
| 510 | AP_11g, |
| 511 | AP_11b, |
| 512 | AP_11na, |
| 513 | AP_11ng, |
| 514 | AP_11ac, |
Alexei Avshalom Lazar | 2712cc8 | 2018-12-23 16:29:14 +0200 | [diff] [blame] | 515 | AP_11ad, |
Priyadharshini Gowthaman | 4401cee | 2019-11-21 14:38:33 -0800 | [diff] [blame] | 516 | AP_11ax, |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 517 | AP_inval |
| 518 | } ap_mode; |
| 519 | int ap_channel; |
Xin Deng | b78d1c2 | 2021-01-20 19:54:07 +0530 | [diff] [blame] | 520 | int ap_tag_channel[MAX_WLAN_TAGS - 1]; |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 521 | int ap_rts; |
| 522 | int ap_frgmnt; |
| 523 | int ap_bcnint; |
Jouni Malinen | d2e9bb3 | 2020-05-06 01:12:03 +0300 | [diff] [blame] | 524 | int ap_start_disabled; |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 525 | struct qos_params { |
| 526 | int ac; |
| 527 | int cwmin; |
| 528 | int cwmax; |
| 529 | int aifs; |
| 530 | int txop; |
| 531 | int acm; |
| 532 | } ap_qos[NUM_AP_AC], ap_sta_qos[NUM_AP_AC]; |
Jouni Malinen | 57fa3d8 | 2016-11-30 12:51:43 +0200 | [diff] [blame] | 533 | enum value_not_set_enabled_disabled ap_noack; |
| 534 | enum value_not_set_enabled_disabled ap_ampdu; |
| 535 | enum value_not_set_enabled_disabled ap_amsdu; |
| 536 | enum value_not_set_enabled_disabled ap_rx_amsdu; |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 537 | int ap_ampdu_exp; |
Pravas Kumar Panda | baae968 | 2021-02-23 22:27:09 +0530 | [diff] [blame] | 538 | int ap_max_mpdu_len; |
Jouni Malinen | 57fa3d8 | 2016-11-30 12:51:43 +0200 | [diff] [blame] | 539 | enum value_not_set_enabled_disabled ap_addba_reject; |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 540 | int ap_fixed_rate; |
| 541 | int ap_mcs; |
| 542 | int ap_rx_streams; |
| 543 | int ap_tx_streams; |
| 544 | unsigned int ap_vhtmcs_map; |
Jouni Malinen | 57fa3d8 | 2016-11-30 12:51:43 +0200 | [diff] [blame] | 545 | enum value_not_set_enabled_disabled ap_ldpc; |
| 546 | enum value_not_set_enabled_disabled ap_sig_rts; |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 547 | enum ap_chwidth { |
| 548 | AP_20, |
| 549 | AP_40, |
| 550 | AP_80, |
| 551 | AP_160, |
priyadharshini gowthaman | 63ab848 | 2017-12-28 15:32:55 -0800 | [diff] [blame] | 552 | AP_80_80, |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 553 | AP_AUTO |
| 554 | } ap_chwidth; |
Pradeep Reddy Potteti | bf8af29 | 2017-02-15 15:28:39 +0530 | [diff] [blame] | 555 | enum ap_chwidth default_11na_ap_chwidth; |
| 556 | enum ap_chwidth default_11ng_ap_chwidth; |
Hu Wang | acede50 | 2021-11-15 19:41:00 +0530 | [diff] [blame] | 557 | enum value_not_set_enabled_disabled ap_tx_stbc; |
Jouni Malinen | 57fa3d8 | 2016-11-30 12:51:43 +0200 | [diff] [blame] | 558 | enum value_not_set_enabled_disabled ap_dyn_bw_sig; |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 559 | int ap_sgi80; |
| 560 | int ap_p2p_mgmt; |
| 561 | enum ap_key_mgmt { |
| 562 | AP_OPEN, |
| 563 | AP_WPA2_PSK, |
| 564 | AP_WPA_PSK, |
| 565 | AP_WPA2_EAP, |
| 566 | AP_WPA_EAP, |
| 567 | AP_WPA2_EAP_MIXED, |
Jouni Malinen | 30824df | 2017-08-22 21:21:38 +0300 | [diff] [blame] | 568 | AP_WPA2_PSK_MIXED, |
| 569 | AP_WPA2_SAE, |
| 570 | AP_WPA2_PSK_SAE, |
Jouni Malinen | ad395a2 | 2017-09-01 21:13:46 +0300 | [diff] [blame] | 571 | AP_SUITEB, |
Jouni Malinen | 147b3c3 | 2017-10-09 16:51:54 +0300 | [diff] [blame] | 572 | AP_WPA2_OWE, |
Jouni Malinen | 4cf699f | 2018-06-19 00:46:27 +0300 | [diff] [blame] | 573 | AP_WPA2_EAP_OSEN, |
Jouni Malinen | 6be21c8 | 2018-08-01 18:47:24 +0300 | [diff] [blame] | 574 | AP_WPA2_FT_EAP, |
| 575 | AP_WPA2_FT_PSK, |
| 576 | AP_WPA2_EAP_SHA256, |
| 577 | AP_WPA2_PSK_SHA256, |
| 578 | AP_WPA2_ENT_FT_EAP, |
Jouni Malinen | c2b9121 | 2018-09-12 02:26:39 +0300 | [diff] [blame] | 579 | AP_OSEN, |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 580 | } ap_key_mgmt; |
Adil Saeed Musthafa | b7b297f | 2017-04-10 23:13:31 -0700 | [diff] [blame] | 581 | enum ap_tag_key_mgmt { |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 582 | AP2_OPEN, |
Adil Saeed Musthafa | b7b297f | 2017-04-10 23:13:31 -0700 | [diff] [blame] | 583 | AP2_OSEN, |
Jouni Malinen | 353ba8b | 2018-01-10 17:04:12 +0200 | [diff] [blame] | 584 | AP2_WPA2_PSK, |
| 585 | AP2_WPA2_OWE, |
Adil Saeed Musthafa | b7b297f | 2017-04-10 23:13:31 -0700 | [diff] [blame] | 586 | } ap_tag_key_mgmt[MAX_WLAN_TAGS - 1]; |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 587 | int ap_add_sha256; |
priyadharshini gowthaman | de81f39 | 2017-12-28 15:28:49 -0800 | [diff] [blame] | 588 | int ap_add_sha384; |
Sarvepalli, Rajesh Babu | 24dc7e4 | 2016-03-18 21:27:26 +0530 | [diff] [blame] | 589 | int ap_rsn_preauth; |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 590 | enum ap_pmf { |
| 591 | AP_PMF_DISABLED, |
| 592 | AP_PMF_OPTIONAL, |
| 593 | AP_PMF_REQUIRED |
| 594 | } ap_pmf; |
| 595 | enum ap_cipher { |
Jouni Malinen | 2ba2449 | 2017-11-17 12:43:59 +0200 | [diff] [blame] | 596 | AP_NO_GROUP_CIPHER_SET, |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 597 | AP_CCMP, |
| 598 | AP_TKIP, |
| 599 | AP_WEP, |
| 600 | AP_PLAIN, |
Jouni Malinen | ad395a2 | 2017-09-01 21:13:46 +0300 | [diff] [blame] | 601 | AP_CCMP_TKIP, |
| 602 | AP_GCMP_256, |
Jouni Malinen | 3d633da | 2017-09-14 22:19:21 +0300 | [diff] [blame] | 603 | AP_GCMP_128, |
| 604 | AP_CCMP_256, |
Jouni Malinen | d538c78 | 2017-11-17 12:13:04 +0200 | [diff] [blame] | 605 | AP_CCMP_128_GCMP_256, |
Jouni Malinen | 2ba2449 | 2017-11-17 12:43:59 +0200 | [diff] [blame] | 606 | } ap_cipher, ap_group_cipher; |
Jouni Malinen | 3d633da | 2017-09-14 22:19:21 +0300 | [diff] [blame] | 607 | enum ap_group_mgmt_cipher { |
| 608 | AP_NO_GROUP_MGMT_CIPHER_SET, |
| 609 | AP_BIP_GMAC_256, |
| 610 | AP_BIP_CMAC_256, |
| 611 | AP_BIP_GMAC_128, |
| 612 | AP_BIP_CMAC_128, |
| 613 | } ap_group_mgmt_cipher; |
Jouni Malinen | ed670f4 | 2017-08-31 01:39:28 +0300 | [diff] [blame] | 614 | char *ap_sae_groups; |
Jouni Malinen | 2f524ce | 2017-08-31 01:43:29 +0300 | [diff] [blame] | 615 | int sae_anti_clogging_threshold; |
Jouni Malinen | b347db0 | 2017-09-02 01:36:03 +0300 | [diff] [blame] | 616 | int sae_reflection; |
Jouni Malinen | 0a9876c | 2020-06-08 19:15:36 +0300 | [diff] [blame] | 617 | int ap_sae_commit_status; |
| 618 | int ap_sae_pk_omit; |
Jouni Malinen | 3c740ab | 2019-10-10 15:55:11 +0300 | [diff] [blame] | 619 | int sae_confirm_immediate; |
Jouni Malinen | 2126f42 | 2017-10-11 23:24:33 +0300 | [diff] [blame] | 620 | char ap_passphrase[101]; |
Xin Deng | b78d1c2 | 2021-01-20 19:54:07 +0530 | [diff] [blame] | 621 | char ap_tag_passphrase[MAX_WLAN_TAGS - 1][101]; |
Jouni Malinen | 6337062 | 2017-11-18 17:47:13 +0200 | [diff] [blame] | 622 | char ap_psk[65]; |
Jouni Malinen | 09550de | 2019-03-26 00:24:11 +0200 | [diff] [blame] | 623 | char *ap_sae_passwords; |
Jouni Malinen | 59fab0f | 2020-06-05 16:59:55 +0300 | [diff] [blame] | 624 | char *ap_sae_pk_modifier; |
| 625 | char *ap_sae_pk_keypair; |
Jouni Malinen | fbf12ef | 2020-06-08 19:49:40 +0300 | [diff] [blame] | 626 | char *ap_sae_pk_keypair_sig; |
Jouni Malinen | 59fab0f | 2020-06-05 16:59:55 +0300 | [diff] [blame] | 627 | int ap_sae_pk; |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 628 | char ap_wepkey[27]; |
| 629 | char ap_radius_ipaddr[20]; |
| 630 | int ap_radius_port; |
| 631 | char ap_radius_password[200]; |
| 632 | char ap2_radius_ipaddr[20]; |
| 633 | int ap2_radius_port; |
| 634 | char ap2_radius_password[200]; |
| 635 | int ap_tdls_prohibit; |
| 636 | int ap_tdls_prohibit_chswitch; |
| 637 | int ap_hs2; |
| 638 | int ap_dgaf_disable; |
| 639 | int ap_p2p_cross_connect; |
| 640 | int ap_oper_name; |
| 641 | int ap_wan_metrics; |
| 642 | int ap_conn_capab; |
| 643 | int ap_oper_class; |
| 644 | |
| 645 | int ap_interworking; |
| 646 | int ap_access_net_type; |
| 647 | int ap_internet; |
| 648 | int ap_venue_group; |
| 649 | int ap_venue_type; |
| 650 | char ap_hessid[20]; |
| 651 | char ap_roaming_cons[100]; |
| 652 | int ap_venue_name; |
| 653 | int ap_net_auth_type; |
| 654 | int ap_nai_realm_list; |
| 655 | char ap_domain_name_list[1000]; |
| 656 | int ap_ip_addr_type_avail; |
| 657 | char ap_plmn_mcc[10][4]; |
| 658 | char ap_plmn_mnc[10][4]; |
| 659 | int ap_gas_cb_delay; |
| 660 | int ap_proxy_arp; |
| 661 | int ap2_proxy_arp; |
Jouni Malinen | dbbc2c4 | 2018-11-14 23:55:41 +0200 | [diff] [blame] | 662 | int ap2_osu; |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 663 | int ap_l2tif; |
| 664 | int ap_anqpserver; |
| 665 | int ap_anqpserver_on; |
| 666 | int ap_osu_provider_list; |
Jouni Malinen | 93a837f | 2018-11-01 17:09:22 +0200 | [diff] [blame] | 667 | int ap_osu_provider_nai_list; |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 668 | int ap_qos_map_set; |
| 669 | int ap_bss_load; |
| 670 | char ap_osu_server_uri[10][256]; |
| 671 | char ap_osu_ssid[33]; |
| 672 | int ap_osu_method[10]; |
| 673 | int ap_osu_icon_tag; |
Jouni Malinen | 54a89b0 | 2018-05-01 00:16:26 +0300 | [diff] [blame] | 674 | int ap_venue_url; |
Jouni Malinen | f7ff42b | 2018-05-01 00:21:56 +0300 | [diff] [blame] | 675 | int ap_advice_of_charge; |
Jouni Malinen | ac10453 | 2018-05-01 00:27:37 +0300 | [diff] [blame] | 676 | int ap_oper_icon_metadata; |
Jouni Malinen | ac36714 | 2018-05-01 00:32:24 +0300 | [diff] [blame] | 677 | int ap_tnc_file_name; |
| 678 | unsigned int ap_tnc_time_stamp; |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 679 | |
| 680 | int ap_fake_pkhash; |
| 681 | int ap_disable_protection; |
| 682 | int ap_allow_vht_wep; |
| 683 | int ap_allow_vht_tkip; |
| 684 | |
| 685 | enum ap_vht_chwidth { |
| 686 | AP_20_40_VHT_OPER_CHWIDTH, |
| 687 | AP_80_VHT_OPER_CHWIDTH, |
| 688 | AP_160_VHT_OPER_CHWIDTH |
| 689 | } ap_vht_chwidth; |
| 690 | int ap_txBF; |
| 691 | int ap_mu_txBF; |
Pradeep Reddy POTTETI | fba27db | 2015-11-20 16:42:22 +0530 | [diff] [blame] | 692 | enum ap_regulatory_mode { |
| 693 | AP_80211D_MODE_DISABLED, |
| 694 | AP_80211D_MODE_ENABLED, |
| 695 | } ap_regulatory_mode; |
| 696 | enum ap_dfs_mode { |
| 697 | AP_DFS_MODE_DISABLED, |
| 698 | AP_DFS_MODE_ENABLED, |
| 699 | } ap_dfs_mode; |
priyadharshini gowthaman | 264d544 | 2016-02-25 15:52:22 -0800 | [diff] [blame] | 700 | int ap_ndpa_frame; |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 701 | |
priyadharshini gowthaman | 8e26ff4 | 2016-06-22 22:47:14 -0700 | [diff] [blame] | 702 | int ap_lci; |
| 703 | char ap_val_lci[33]; |
priyadharshini gowthaman | c2357bd | 2016-06-22 22:47:14 -0700 | [diff] [blame] | 704 | char ap_infoz[17]; |
priyadharshini gowthaman | 8e26ff4 | 2016-06-22 22:47:14 -0700 | [diff] [blame] | 705 | int ap_lcr; |
| 706 | char ap_val_lcr[400]; |
| 707 | int ap_rrm; |
| 708 | int ap_rtt; |
| 709 | int ap_neighap; /* number of configured neighbor APs */ |
| 710 | unsigned char ap_val_neighap[3][6]; |
| 711 | int ap_opchannel; /* number of oper channels */ |
| 712 | int ap_val_opchannel[3]; |
| 713 | int ap_scan; |
priyadharshini gowthaman | c2357bd | 2016-06-22 22:47:14 -0700 | [diff] [blame] | 714 | int ap_fqdn_held; |
| 715 | int ap_fqdn_supl; |
priyadharshini gowthaman | a27b5b6 | 2016-06-22 22:47:14 -0700 | [diff] [blame] | 716 | int ap_msnt_type; |
| 717 | |
priyadharshini gowthaman | b4e05fc | 2016-10-13 15:02:35 -0700 | [diff] [blame] | 718 | int ap_mbo; |
| 719 | int ap_ne_class; |
| 720 | int ap_ne_op_ch; |
| 721 | int ap_set_bssidpref; |
| 722 | int ap_btmreq_disassoc_imnt; |
| 723 | int ap_btmreq_term_bit; |
Adil Saeed Musthafa | 7d9ae38 | 2017-04-10 23:13:33 -0700 | [diff] [blame] | 724 | int ap_disassoc_timer; |
| 725 | int ap_btmreq_bss_term_dur; |
Adil Saeed Musthafa | 604c826 | 2017-04-10 23:13:31 -0700 | [diff] [blame] | 726 | enum reg_domain { |
| 727 | REG_DOMAIN_NOT_SET, |
| 728 | REG_DOMAIN_LOCAL, |
| 729 | REG_DOMAIN_GLOBAL |
| 730 | } ap_reg_domain; |
Adil Saeed Musthafa | cf752fa | 2017-04-10 23:13:32 -0700 | [diff] [blame] | 731 | char ap_mobility_domain[10]; |
Adil Saeed Musthafa | 023108a | 2017-04-10 23:13:37 -0700 | [diff] [blame] | 732 | unsigned char ap_cell_cap_pref; |
Adil Saeed Musthafa | 4ec61bd | 2017-04-10 23:13:41 -0700 | [diff] [blame] | 733 | int ap_ft_oa; |
Jouni Malinen | 9f94331 | 2019-08-19 23:49:16 +0300 | [diff] [blame] | 734 | enum value_not_set_enabled_disabled ap_ft_ds; |
Adil Saeed Musthafa | 4ec61bd | 2017-04-10 23:13:41 -0700 | [diff] [blame] | 735 | int ap_name; |
priyadharshini gowthaman | 09d613e | 2017-12-20 11:43:44 -0800 | [diff] [blame] | 736 | int ap_interface_5g; |
| 737 | int ap_interface_2g; |
priyadharshini gowthaman | 776562e | 2017-12-20 12:33:34 -0800 | [diff] [blame] | 738 | int ap_assoc_delay; |
priyadharshini gowthaman | 94062b5 | 2017-12-20 12:33:34 -0800 | [diff] [blame] | 739 | int ap_btmreq_bss_term_tsf; |
priyadharshini gowthaman | 00798a2 | 2017-12-28 15:15:00 -0800 | [diff] [blame] | 740 | int ap_fils_dscv_int; |
| 741 | int ap_nairealm_int; |
| 742 | char ap_nairealm[33]; |
| 743 | int ap_blechanutil; |
| 744 | int ap_ble_admit_cap; |
| 745 | int ap_datappdudura; |
| 746 | int ap_airtimefract; |
| 747 | char ap_dhcpserv_ipaddr[20]; |
| 748 | int ap_dhcp_stop; |
| 749 | int ap_bawinsize; |
| 750 | int ap_blestacnt; |
priyadharshini gowthaman | cb22e43 | 2017-12-28 15:23:31 -0800 | [diff] [blame] | 751 | int ap_ul_availcap; |
| 752 | int ap_dl_availcap; |
priyadharshini gowthaman | de81f39 | 2017-12-28 15:28:49 -0800 | [diff] [blame] | 753 | int ap_akm; |
Jouni Malinen | da5f35b | 2019-03-26 00:25:53 +0200 | [diff] [blame] | 754 | unsigned int ap_akm_values; |
priyadharshini gowthaman | de81f39 | 2017-12-28 15:28:49 -0800 | [diff] [blame] | 755 | int ap_pmksa; |
| 756 | int ap_pmksa_caching; |
Jouni Malinen | 05d005a | 2020-03-26 12:49:33 +0200 | [diff] [blame] | 757 | int ap_beacon_prot; |
Jouni Malinen | c098c44 | 2020-03-26 13:01:50 +0200 | [diff] [blame] | 758 | u8 ap_transition_disable; |
priyadharshini gowthaman | 63ab848 | 2017-12-28 15:32:55 -0800 | [diff] [blame] | 759 | int ap_80plus80; |
priyadharshini gowthaman | 9149afc | 2018-01-15 13:40:18 -0800 | [diff] [blame] | 760 | int ap_oper_chn; |
Adil Saeed Musthafa | 4ec61bd | 2017-04-10 23:13:41 -0700 | [diff] [blame] | 761 | |
Adil Saeed Musthafa | 6906372 | 2017-04-10 23:13:40 -0700 | [diff] [blame] | 762 | struct mbo_pref_ap mbo_pref_aps[MBO_MAX_PREF_BSSIDS]; |
| 763 | struct mbo_pref_ap mbo_self_ap_tuple; |
| 764 | int mbo_pref_ap_cnt; |
Adil Saeed Musthafa | 4ec61bd | 2017-04-10 23:13:41 -0700 | [diff] [blame] | 765 | unsigned char ft_bss_mac_list[MAX_FT_BSS_LIST][ETH_ALEN]; |
| 766 | int ft_bss_mac_cnt; |
priyadharshini gowthaman | b4e05fc | 2016-10-13 15:02:35 -0700 | [diff] [blame] | 767 | |
Priyadharshini Gowthaman | c067edf | 2019-06-20 11:23:27 -0700 | [diff] [blame] | 768 | char *ar_ltf; |
| 769 | |
Priyadharshini Gowthaman | bc94889 | 2019-09-10 14:22:49 -0700 | [diff] [blame] | 770 | int ap_numsounddim; |
Priyadharshini Gowthaman | 78ee2ef | 2019-11-15 16:08:28 -0800 | [diff] [blame] | 771 | unsigned int he_mcsnssmap; |
| 772 | int he_ul_mcs; |
Priyadharshini Gowthaman | 21f7440 | 2019-11-25 15:39:09 -0800 | [diff] [blame] | 773 | int he_mmss; |
Priyadharshini Gowthaman | 88d55c8 | 2019-12-12 14:31:46 -0800 | [diff] [blame] | 774 | int he_srctrl_allow; |
Priyadharshini Gowthaman | bc94889 | 2019-09-10 14:22:49 -0700 | [diff] [blame] | 775 | |
Priyadharshini Gowthaman | ce7ba82 | 2020-05-27 13:03:09 -0700 | [diff] [blame] | 776 | int ap_ocvc; |
| 777 | |
priyadharshini gowthaman | 00798a2 | 2017-12-28 15:15:00 -0800 | [diff] [blame] | 778 | enum value_not_set_enabled_disabled ap_oce; |
| 779 | enum value_not_set_enabled_disabled ap_filsdscv; |
| 780 | enum value_not_set_enabled_disabled ap_filshlp; |
| 781 | enum value_not_set_enabled_disabled ap_broadcast_ssid; |
| 782 | enum value_not_set_enabled_disabled ap_rnr; |
| 783 | enum value_not_set_enabled_disabled ap_esp; |
| 784 | |
Priyadharshini Gowthaman | c067edf | 2019-06-20 11:23:27 -0700 | [diff] [blame] | 785 | enum value_not_set_enabled_disabled ap_he_ulofdma; |
Priyadharshini Gowthaman | fe60c50 | 2019-08-14 13:00:34 -0700 | [diff] [blame] | 786 | enum value_not_set_enabled_disabled ap_he_dlofdma; |
Priyadharshini Gowthaman | 670b323 | 2019-09-10 16:09:19 -0700 | [diff] [blame] | 787 | enum value_not_set_enabled_disabled ap_bcc; |
Priyadharshini Gowthaman | 6bc4c1e | 2019-09-10 16:24:51 -0700 | [diff] [blame] | 788 | enum value_not_set_enabled_disabled ap_he_frag; |
Priyadharshini Gowthaman | 21895a5 | 2019-10-07 16:56:16 -0700 | [diff] [blame] | 789 | enum value_not_set_enabled_disabled ap_mu_edca; |
Priyadharshini Gowthaman | 43d6b41 | 2019-10-07 16:56:37 -0700 | [diff] [blame] | 790 | enum value_not_set_enabled_disabled ap_he_rtsthrshld; |
Priyadharshini Gowthaman | 8018c98 | 2019-10-31 15:14:37 -0700 | [diff] [blame] | 791 | enum value_not_set_enabled_disabled ap_mbssid; |
Priyadharshini Gowthaman | ae0a605 | 2019-11-01 15:26:38 -0700 | [diff] [blame] | 792 | enum value_not_set_enabled_disabled ap_twtresp; |
Priyadharshini Gowthaman | 96d542e | 2019-11-21 14:25:21 -0800 | [diff] [blame] | 793 | enum value_not_set_enabled_disabled he_sounding; |
Priyadharshini Gowthaman | 9b7dbe1 | 2019-12-04 12:17:32 -0800 | [diff] [blame] | 794 | enum value_not_set_enabled_disabled he_set_sta_1x1; |
Priyadharshini Gowthaman | c067edf | 2019-06-20 11:23:27 -0700 | [diff] [blame] | 795 | |
priyadharshini gowthaman | 350f191 | 2018-06-04 13:09:12 -0700 | [diff] [blame] | 796 | enum ppdu { |
| 797 | PPDU_NOT_SET, |
| 798 | PPDU_MU, |
| 799 | PPDU_SU, |
| 800 | PPDU_ER, |
| 801 | PPDU_TB, |
Priyadharshini Gowthaman | fe60c50 | 2019-08-14 13:00:34 -0700 | [diff] [blame] | 802 | PPDU_HESU, |
priyadharshini gowthaman | 350f191 | 2018-06-04 13:09:12 -0700 | [diff] [blame] | 803 | } ap_he_ppdu; |
| 804 | |
Priyadharshini Gowthaman | 1a686bd | 2019-09-19 14:41:40 -0700 | [diff] [blame] | 805 | enum bufsize { |
| 806 | BA_BUFSIZE_NOT_SET, |
| 807 | BA_BUFSIZE_64, |
| 808 | BA_BUFSIZE_256, |
| 809 | } ap_ba_bufsize; |
| 810 | |
Priyadharshini Gowthaman | dee79e2 | 2019-10-07 16:56:27 -0700 | [diff] [blame] | 811 | enum mimo { |
| 812 | MIMO_NOT_SET, |
| 813 | MIMO_DL, |
| 814 | MIMO_UL, |
| 815 | } ap_he_mimo; |
| 816 | |
Alexei Avshalom Lazar | bc180dc | 2018-12-18 16:01:14 +0200 | [diff] [blame] | 817 | struct sigma_ese_alloc ap_ese_allocs[MAX_ESE_ALLOCS]; |
| 818 | int ap_num_ese_allocs; |
| 819 | |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 820 | const char *hostapd_debug_log; |
Alexei Avshalom Lazar | 3e8267e | 2018-12-18 15:58:54 +0200 | [diff] [blame] | 821 | const char *wpa_supplicant_debug_log; |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 822 | |
| 823 | #ifdef CONFIG_TRAFFIC_AGENT |
| 824 | /* Traffic Agent */ |
| 825 | struct sigma_stream streams[MAX_SIGMA_STREAMS]; |
| 826 | int stream_id; |
| 827 | int num_streams; |
| 828 | pthread_t thr; |
| 829 | #endif /* CONFIG_TRAFFIC_AGENT */ |
| 830 | |
Jouni Malinen | c2493f8 | 2016-06-05 18:01:33 +0300 | [diff] [blame] | 831 | unsigned int throughput_pktsize; /* If non-zero, override pktsize for |
| 832 | * throughput tests */ |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 833 | int no_timestamps; |
| 834 | |
| 835 | const char *sniffer_ifname; |
| 836 | const char *set_macaddr; |
| 837 | int tmp_mac_addr; |
| 838 | int ap_is_dual; |
| 839 | enum ap_mode ap_mode_1; |
| 840 | enum ap_chwidth ap_chwidth_1; |
| 841 | int ap_channel_1; |
| 842 | char ap_countrycode[3]; |
| 843 | |
| 844 | int ap_wpsnfc; |
| 845 | |
Pradeep Reddy POTTETI | 0d3db63 | 2016-03-11 15:21:11 +0530 | [diff] [blame] | 846 | enum ap_wme { |
| 847 | AP_WME_OFF, |
| 848 | AP_WME_ON, |
| 849 | } ap_wme; |
| 850 | |
Mohammed Shafi Shajakhan | 02e3b82 | 2017-02-23 04:15:02 +0530 | [diff] [blame] | 851 | enum ap_wmmps { |
| 852 | AP_WMMPS_OFF, |
| 853 | AP_WMMPS_ON, |
| 854 | } ap_wmmps; |
| 855 | |
Pradeep Reddy Potteti | 4b0cdee | 2017-03-15 12:37:33 +0530 | [diff] [blame] | 856 | enum sec_ch_offset ap_chwidth_offset; |
| 857 | |
Jouni Malinen | ba4f2d4 | 2019-10-04 16:13:41 +0300 | [diff] [blame] | 858 | char *ap_dpp_conf_addr; |
| 859 | char *ap_dpp_conf_pkhash; |
| 860 | |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 861 | #ifdef CONFIG_SNIFFER |
| 862 | pid_t sniffer_pid; |
| 863 | char sniffer_filename[200]; |
| 864 | #endif /* CONFIG_SNIFFER */ |
| 865 | |
| 866 | int last_set_ip_config_ipv6; |
Amarnath Hullur Subramanyam | 9c381f5 | 2017-03-17 00:04:41 -0700 | [diff] [blame] | 867 | #ifdef MIRACAST |
| 868 | pthread_t rtsp_thread_handle; |
| 869 | int wfd_device_type; /* 0 for source, 1 for sink */ |
| 870 | char peer_mac_address[32]; |
Sunil Dutt | bf9bcdf | 2020-04-02 19:14:52 +0530 | [diff] [blame] | 871 | char modified_peer_mac_address[32]; |
Amarnath Hullur Subramanyam | 9c381f5 | 2017-03-17 00:04:41 -0700 | [diff] [blame] | 872 | void *miracast_lib; |
| 873 | const char *miracast_lib_path; |
| 874 | char mdns_instance_name[64]; |
| 875 | #endif /* MIRACAST */ |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 876 | |
| 877 | int tid_to_handle[8]; /* Mapping of TID to handle */ |
| 878 | int dialog_token; /* Used for generating unique handle for an addTs */ |
| 879 | |
| 880 | enum sigma_program { |
| 881 | PROGRAM_UNKNOWN = 0, |
| 882 | PROGRAM_TDLS, |
| 883 | PROGRAM_HS2, |
| 884 | PROGRAM_HS2_R2, |
| 885 | PROGRAM_WFD, |
Amarnath Hullur Subramanyam | 659a34c | 2017-03-17 00:04:41 -0700 | [diff] [blame] | 886 | PROGRAM_DISPLAYR2, |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 887 | PROGRAM_PMF, |
| 888 | PROGRAM_WPS, |
| 889 | PROGRAM_60GHZ, |
| 890 | PROGRAM_HT, |
| 891 | PROGRAM_VHT, |
| 892 | PROGRAM_NAN, |
priyadharshini gowthaman | 12dd414 | 2016-06-22 22:47:14 -0700 | [diff] [blame] | 893 | PROGRAM_LOC, |
Adil Saeed Musthafa | 33ea287 | 2017-04-10 23:13:24 -0700 | [diff] [blame] | 894 | PROGRAM_MBO, |
Jouni Malinen | 5c3813a | 2017-08-26 13:30:39 +0300 | [diff] [blame] | 895 | PROGRAM_IOTLP, |
| 896 | PROGRAM_DPP, |
Ankita Bajaj | a2cb567 | 2017-10-25 16:08:28 +0530 | [diff] [blame] | 897 | PROGRAM_OCE, |
priyadharshini gowthaman | 0e209fc | 2018-01-26 15:15:37 -0800 | [diff] [blame] | 898 | PROGRAM_WPA3, |
Amarnath Hullur Subramanyam | 8f9c868 | 2018-01-30 19:01:51 -0800 | [diff] [blame] | 899 | PROGRAM_HE, |
Jouni Malinen | ba63045 | 2018-06-22 11:49:59 +0300 | [diff] [blame] | 900 | PROGRAM_HS2_R3, |
Vamsi Krishna | f642d6a | 2020-03-27 12:33:14 +0530 | [diff] [blame] | 901 | PROGRAM_QM, |
Jouni Malinen | 9a742ff | 2022-01-27 00:43:14 +0200 | [diff] [blame] | 902 | PROGRAM_HS2_R4, |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 903 | } program; |
| 904 | |
| 905 | enum device_type { |
| 906 | device_type_unknown, |
| 907 | AP_unknown, |
| 908 | AP_testbed, |
| 909 | AP_dut, |
| 910 | STA_unknown, |
| 911 | STA_testbed, |
| 912 | STA_dut |
| 913 | } device_type; |
| 914 | |
| 915 | enum { |
| 916 | DEVROLE_UNKNOWN = 0, |
| 917 | DEVROLE_STA, |
| 918 | DEVROLE_PCP, |
Alexei Avshalom Lazar | 2712cc8 | 2018-12-23 16:29:14 +0200 | [diff] [blame] | 919 | DEVROLE_STA_CFON, |
| 920 | DEVROLE_AP, |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 921 | } dev_role; |
| 922 | |
Alexei Avshalom Lazar | 33f700c | 2018-12-18 16:00:39 +0200 | [diff] [blame] | 923 | enum wps_band { |
| 924 | WPS_BAND_NON_60G = 0, |
| 925 | WPS_BAND_60G, |
| 926 | } band; |
| 927 | |
Alexei Avshalom Lazar | eee9ab0 | 2018-12-24 16:27:48 +0200 | [diff] [blame] | 928 | int wps_disable; /* Used for 60G to disable PCP from sending WPS IE */ |
Alexei Avshalom Lazar | 33f700c | 2018-12-18 16:00:39 +0200 | [diff] [blame] | 929 | int wsc_fragment; /* simulate WSC IE fragmentation */ |
Alexei Avshalom Lazar | 2eccf4d | 2019-01-31 10:03:59 +0200 | [diff] [blame] | 930 | int eap_fragment; /* simulate EAP fragmentation */ |
Alexei Avshalom Lazar | 744ae8a | 2019-01-31 17:26:46 +0200 | [diff] [blame] | 931 | int wps_forced_version; /* Used to force reported WPS version */ |
Alexei Avshalom Lazar | b094bf0 | 2018-12-18 16:00:53 +0200 | [diff] [blame] | 932 | enum { |
| 933 | /* no change */ |
| 934 | FORCE_RSN_IE_NONE = 0, |
| 935 | /* if exists, remove and clear privacy bit */ |
| 936 | FORCE_RSN_IE_REMOVE, |
| 937 | /* if not exists, add and set privacy bit */ |
| 938 | FORCE_RSN_IE_ADD, |
| 939 | } force_rsn_ie; /* override RSN IE in association request */ |
Alexei Avshalom Lazar | 33f700c | 2018-12-18 16:00:39 +0200 | [diff] [blame] | 940 | |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 941 | const char *version; |
| 942 | int no_ip_addr_set; |
| 943 | int sta_channel; |
| 944 | |
| 945 | const char *summary_log; |
| 946 | const char *hostapd_entropy_log; |
| 947 | |
| 948 | int iface_down_on_reset; |
| 949 | int write_stats; /* traffic stream e2e*.txt files */ |
Bala Krishna Bhamidipati | 73d7af0 | 2016-03-24 12:27:56 +0530 | [diff] [blame] | 950 | int sim_no_username; /* do not set SIM username to use real SIM */ |
Jouni Malinen | 5db3b10 | 2016-08-04 12:27:18 +0300 | [diff] [blame] | 951 | |
| 952 | const char *vendor_name; /* device_get_info vendor override */ |
| 953 | const char *model_name; /* device_get_info model override */ |
| 954 | const char *version_name; /* device_get_info version override */ |
Kiran Kumar Lokere | 0128bf9 | 2019-04-08 18:36:16 -0700 | [diff] [blame] | 955 | const char *log_file_dir; /* Directory to generate log file */ |
| 956 | FILE *log_file_fd; /* Pointer to log file */ |
Rakesh Sunki | 7d37f41 | 2017-03-30 14:47:55 -0700 | [diff] [blame] | 957 | |
Rakesh Sunki | 14cfcd2 | 2017-03-30 14:47:55 -0700 | [diff] [blame] | 958 | int ndp_enable; /* Flag which is set once the NDP is setup */ |
| 959 | |
Peng Xu | 8863ec7 | 2018-08-06 11:50:37 -0700 | [diff] [blame] | 960 | int ndpe; /* Flag indicating NDPE is supported */ |
| 961 | u16 trans_port; /* transport port number for TCP/UDP connection */ |
| 962 | u8 trans_proto; /* transport protocol, 0x06: TCP, 0x11: UDP */ |
Peng Xu | 47d709b | 2019-06-04 18:14:02 -0700 | [diff] [blame] | 963 | u8 nan_ipv6_addr[IPV6_ADDR_LEN]; /* NAN IPv6 address */ |
| 964 | u8 nan_ipv6_len; /* NAN IPv6 address length */ |
Peng Xu | 8863ec7 | 2018-08-06 11:50:37 -0700 | [diff] [blame] | 965 | |
Rakesh Sunki | 7d37f41 | 2017-03-30 14:47:55 -0700 | [diff] [blame] | 966 | /* Length of nan_pmk in octets */ |
| 967 | u8 nan_pmk_len; |
| 968 | |
| 969 | /* |
| 970 | * PMK: Info is optional in Discovery phase. PMK info can |
| 971 | * be passed during the NDP session. |
| 972 | */ |
| 973 | u8 nan_pmk[32]; |
Adil Saeed Musthafa | 33ea287 | 2017-04-10 23:13:24 -0700 | [diff] [blame] | 974 | |
| 975 | enum value_not_set_enabled_disabled wnm_bss_max_feature; |
| 976 | int wnm_bss_max_idle_time; |
| 977 | enum value_not_set_enabled_disabled wnm_bss_max_protection; |
Ashwini Patil | 0040258 | 2017-04-13 12:29:39 +0530 | [diff] [blame] | 978 | |
| 979 | char *non_pref_ch_list; /* MBO: non-preferred channel report */ |
Ashwini Patil | 5acd738 | 2017-04-13 15:55:04 +0530 | [diff] [blame] | 980 | char *btm_query_cand_list; /* Candidate list for BTM Query */ |
Jouni Malinen | 3c367e8 | 2017-06-23 17:01:47 +0300 | [diff] [blame] | 981 | |
Jouni Malinen | 6814313 | 2017-09-02 02:34:08 +0300 | [diff] [blame] | 982 | char *sae_commit_override; |
Jouni Malinen | 3c367e8 | 2017-06-23 17:01:47 +0300 | [diff] [blame] | 983 | char *rsne_override; |
Jouni Malinen | 7960e3a | 2019-12-07 17:04:35 +0200 | [diff] [blame] | 984 | char *rsnxe_override_eapol; |
Jouni Malinen | 134fe3c | 2019-06-12 04:16:49 +0300 | [diff] [blame] | 985 | int sta_associate_wait_connect; |
| 986 | char server_cert_hash[65]; |
Jouni Malinen | 37d5c69 | 2019-08-19 16:56:55 +0300 | [diff] [blame] | 987 | int server_cert_tod; |
Jouni Malinen | 134fe3c | 2019-06-12 04:16:49 +0300 | [diff] [blame] | 988 | int sta_tod_policy; |
Jouni Malinen | d6bf1b4 | 2017-06-23 17:51:01 +0300 | [diff] [blame] | 989 | const char *hostapd_bin; |
| 990 | int use_hostapd_pid_file; |
| 991 | const char *hostapd_ifname; |
Jouni Malinen | d86e582 | 2017-08-29 03:55:32 +0300 | [diff] [blame] | 992 | int hostapd_running; |
| 993 | |
Jouni Malinen | b1dd21f | 2017-11-13 19:14:29 +0200 | [diff] [blame] | 994 | char *dpp_peer_uri; |
Jouni Malinen | d86e582 | 2017-08-29 03:55:32 +0300 | [diff] [blame] | 995 | int dpp_local_bootstrap; |
| 996 | int dpp_conf_id; |
Jouni Malinen | 1dabb5a | 2020-06-26 21:05:21 +0300 | [diff] [blame] | 997 | int dpp_network_id; |
Jouni Malinen | 29a63f4 | 2022-04-13 22:08:47 +0300 | [diff] [blame] | 998 | enum dpp_mdns_role dpp_mdns; |
Ankita Bajaj | 1bde794 | 2018-01-09 19:15:01 +0530 | [diff] [blame] | 999 | |
| 1000 | u8 fils_hlp; |
| 1001 | pthread_t hlp_thread; |
Peng Xu | 291d97d | 2018-01-31 16:34:03 -0800 | [diff] [blame] | 1002 | |
| 1003 | #ifdef NL80211_SUPPORT |
| 1004 | struct nl80211_ctx *nl_ctx; |
Sunil Dutt | 076081f | 2018-02-05 19:45:50 +0530 | [diff] [blame] | 1005 | int config_rsnie; |
Peng Xu | 291d97d | 2018-01-31 16:34:03 -0800 | [diff] [blame] | 1006 | #endif /* NL80211_SUPPORT */ |
Arif Hussain | ac6c511 | 2018-05-25 17:34:00 -0700 | [diff] [blame] | 1007 | |
| 1008 | int sta_nss; |
Anurag Das | 2052daa | 2018-08-31 14:35:25 +0530 | [diff] [blame] | 1009 | |
Kiran Kumar Lokere | f61a743 | 2021-06-24 00:19:19 -0700 | [diff] [blame] | 1010 | int sta_async_twt_supp; /* Asynchronous TWT response event support */ |
| 1011 | |
Anurag Das | 2052daa | 2018-08-31 14:35:25 +0530 | [diff] [blame] | 1012 | #ifdef ANDROID |
| 1013 | int nanservicediscoveryinprogress; |
| 1014 | #endif /* ANDROID */ |
Priyadharshini Gowthaman | d06f100 | 2019-04-22 15:45:41 -0700 | [diff] [blame] | 1015 | |
| 1016 | const char *priv_cmd; /* iwpriv / cfg80211tool command name */ |
Kiran Kumar Lokere | 0128bf9 | 2019-04-08 18:36:16 -0700 | [diff] [blame] | 1017 | |
| 1018 | unsigned int wpa_log_size; |
| 1019 | char dev_start_test_runtime_id[100]; |
Vinay Gannevaram | 2dfb1da | 2019-06-14 15:24:08 +0530 | [diff] [blame] | 1020 | #ifdef ANDROID_WIFI_HAL |
| 1021 | wifi_interface_handle wifi_hal_iface_handle; |
| 1022 | wifi_handle wifi_hal_handle; |
| 1023 | bool wifi_hal_initialized; |
| 1024 | #endif /*ANDROID_WIFI_HAL*/ |
Jouni Malinen | 11e5521 | 2019-11-22 21:46:59 +0200 | [diff] [blame] | 1025 | |
| 1026 | int sae_h2e_default; |
| 1027 | enum { |
| 1028 | SAE_PWE_DEFAULT, |
| 1029 | SAE_PWE_LOOP, |
| 1030 | SAE_PWE_H2E |
| 1031 | } sae_pwe; |
Hu Wang | 6010ce7 | 2020-03-05 19:33:53 +0800 | [diff] [blame] | 1032 | int owe_ptk_workaround; |
Lavanya Suresh | 2e2097d | 2021-02-23 21:17:28 +0530 | [diff] [blame] | 1033 | struct dut_hw_modes hw_modes; |
Vamsi Krishna | c1633d2 | 2020-05-06 18:31:21 +0530 | [diff] [blame] | 1034 | int ocvc; |
Veerendranath Jakkam | c1f71b6 | 2021-01-23 03:09:51 +0530 | [diff] [blame] | 1035 | int beacon_prot; |
Jouni Malinen | 67433fc | 2020-06-26 22:50:33 +0300 | [diff] [blame] | 1036 | int client_privacy; |
Veerendranath Jakkam | 4786720 | 2020-12-21 01:53:52 +0530 | [diff] [blame] | 1037 | int client_privacy_default; |
Veerendranath Jakkam | 54ddc35 | 2020-07-05 15:47:54 +0530 | [diff] [blame] | 1038 | int saquery_oci_freq; |
Venkateswara Naralasetty | f0f8805 | 2020-11-11 19:15:17 +0530 | [diff] [blame] | 1039 | char device_driver[32]; |
Vinita S. Maloo | 1ded374 | 2021-07-28 16:55:21 +0530 | [diff] [blame] | 1040 | int user_config_ap_ocvc; |
| 1041 | int user_config_ap_beacon_prot; |
Veerendranath Jakkam | 329a3cd | 2021-09-11 18:10:13 +0530 | [diff] [blame] | 1042 | char qm_domain_name[250]; |
Veerendranath Jakkam | 9ceb3b1 | 2021-09-10 03:18:17 +0530 | [diff] [blame] | 1043 | struct dscp_policy_data *dscp_policy_table; |
| 1044 | pthread_t dscp_policy_mon_thread; |
Veerendranath Jakkam | a16cdc8 | 2021-09-12 16:44:22 +0530 | [diff] [blame] | 1045 | int reject_dscp_policies; |
| 1046 | int dscp_reject_resp_code; |
Veerendranath Jakkam | 1bf1bd6 | 2021-09-12 16:35:55 +0530 | [diff] [blame] | 1047 | struct dscp_policy_status dscp_status[5]; |
| 1048 | unsigned int num_dscp_status; |
Shivani Baranwal | ebde8f6 | 2021-10-19 12:26:02 +0530 | [diff] [blame] | 1049 | unsigned int prev_disable_scs_support; |
| 1050 | unsigned int prev_disable_mscs_support; |
Shivani Baranwal | 9cfc8d7 | 2021-11-22 11:53:19 +0530 | [diff] [blame] | 1051 | int dscp_use_iptables; |
Veerendranath Jakkam | f6c8ab5 | 2022-03-10 05:43:02 -0800 | [diff] [blame] | 1052 | int autoconnect_default; |
Veerendranath Jakkam | fc5b7d2 | 2022-04-15 02:12:12 +0530 | [diff] [blame] | 1053 | int dhcp_client_running; |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 1054 | }; |
| 1055 | |
| 1056 | |
| 1057 | enum sigma_dut_print_level { |
| 1058 | DUT_MSG_DEBUG, DUT_MSG_INFO, DUT_MSG_ERROR |
| 1059 | }; |
| 1060 | |
| 1061 | void sigma_dut_print(struct sigma_dut *dut, int level, const char *fmt, ...) |
| 1062 | PRINTF_FORMAT(3, 4); |
| 1063 | |
| 1064 | void sigma_dut_summary(struct sigma_dut *dut, const char *fmt, ...) |
| 1065 | PRINTF_FORMAT(2, 3); |
| 1066 | |
| 1067 | |
| 1068 | enum sigma_status { |
| 1069 | SIGMA_RUNNING, SIGMA_INVALID, SIGMA_ERROR, SIGMA_COMPLETE |
| 1070 | }; |
| 1071 | |
| 1072 | void send_resp(struct sigma_dut *dut, struct sigma_conn *conn, |
Jouni Malinen | 76401f5 | 2017-03-18 01:04:55 +0200 | [diff] [blame] | 1073 | enum sigma_status status, const char *buf); |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 1074 | |
| 1075 | const char * get_param(struct sigma_cmd *cmd, const char *name); |
Alexei Avshalom Lazar | bc180dc | 2018-12-18 16:01:14 +0200 | [diff] [blame] | 1076 | const char * get_param_indexed(struct sigma_cmd *cmd, const char *name, |
| 1077 | int index); |
Vinita S. Maloo | 8d7a28d | 2021-01-21 22:55:00 +0530 | [diff] [blame] | 1078 | const char * get_param_fmt(struct sigma_cmd *cmd, const char *name, ...); |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 1079 | |
| 1080 | int sigma_dut_reg_cmd(const char *cmd, |
| 1081 | int (*validate)(struct sigma_cmd *cmd), |
Jouni Malinen | 26a5b76 | 2019-02-19 01:17:48 +0200 | [diff] [blame] | 1082 | enum sigma_cmd_result (*process)(struct sigma_dut *dut, |
| 1083 | struct sigma_conn *conn, |
| 1084 | struct sigma_cmd *cmd)); |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 1085 | |
| 1086 | void sigma_dut_register_cmds(void); |
| 1087 | |
Jouni Malinen | a485fd1 | 2019-06-13 23:27:01 +0300 | [diff] [blame] | 1088 | enum sigma_cmd_result cmd_sta_send_frame(struct sigma_dut *dut, |
| 1089 | struct sigma_conn *conn, |
| 1090 | struct sigma_cmd *cmd); |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 1091 | int cmd_sta_set_parameter(struct sigma_dut *dut, struct sigma_conn *conn, |
| 1092 | struct sigma_cmd *cmd); |
Jouni Malinen | a485fd1 | 2019-06-13 23:27:01 +0300 | [diff] [blame] | 1093 | enum sigma_cmd_result cmd_ap_send_frame(struct sigma_dut *dut, |
| 1094 | struct sigma_conn *conn, |
| 1095 | struct sigma_cmd *cmd); |
| 1096 | enum sigma_cmd_result cmd_wlantest_send_frame(struct sigma_dut *dut, |
| 1097 | struct sigma_conn *conn, |
| 1098 | struct sigma_cmd *cmd); |
Ankita Bajaj | 0d5825b | 2017-10-25 16:20:17 +0530 | [diff] [blame] | 1099 | int sta_cfon_set_wireless(struct sigma_dut *dut, struct sigma_conn *conn, |
| 1100 | struct sigma_cmd *cmd); |
| 1101 | int sta_cfon_get_mac_address(struct sigma_dut *dut, struct sigma_conn *conn, |
| 1102 | struct sigma_cmd *cmd); |
| 1103 | int sta_cfon_reset_default(struct sigma_dut *dut, struct sigma_conn *conn, |
| 1104 | struct sigma_cmd *cmd); |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 1105 | |
| 1106 | enum driver_type { |
| 1107 | DRIVER_NOT_SET, |
| 1108 | DRIVER_ATHEROS, |
| 1109 | DRIVER_WCN, |
| 1110 | DRIVER_MAC80211, |
| 1111 | DRIVER_AR6003, |
| 1112 | DRIVER_WIL6210, |
| 1113 | DRIVER_QNXNTO, |
Sreelakshmi Konamki | b692f10 | 2016-04-26 19:47:00 +0530 | [diff] [blame] | 1114 | DRIVER_OPENWRT, |
| 1115 | DRIVER_LINUX_WCN, |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 1116 | }; |
| 1117 | |
| 1118 | enum openwrt_driver_type { |
| 1119 | OPENWRT_DRIVER_NOT_SET, |
| 1120 | OPENWRT_DRIVER_ATHEROS |
| 1121 | }; |
| 1122 | |
| 1123 | #define DRIVER_NAME_60G "wil6210" |
| 1124 | |
| 1125 | int set_wifi_chip(const char *chip_type); |
Jouni Malinen | 016ae6c | 2019-11-04 17:00:01 +0200 | [diff] [blame] | 1126 | enum driver_type get_driver_type(struct sigma_dut *dut); |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 1127 | enum openwrt_driver_type get_openwrt_driver_type(void); |
Venkateswara Naralasetty | f0f8805 | 2020-11-11 19:15:17 +0530 | [diff] [blame] | 1128 | void sigma_dut_get_device_driver_name(const char *ifname, char *name, |
| 1129 | size_t size); |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 1130 | int file_exists(const char *fname); |
| 1131 | |
| 1132 | struct wpa_ctrl; |
| 1133 | |
| 1134 | int wps_connection_event(struct sigma_dut *dut, struct sigma_conn *conn, |
| 1135 | struct wpa_ctrl *ctrl, const char *intf, int p2p_resp); |
| 1136 | int ascii2hexstr(const char *str, char *hex); |
| 1137 | void disconnect_station(struct sigma_dut *dut); |
| 1138 | void nfc_status(struct sigma_dut *dut, const char *state, const char *oper); |
| 1139 | int get_ip_config(struct sigma_dut *dut, const char *ifname, char *buf, |
| 1140 | size_t buf_len); |
| 1141 | int ath6kl_client_uapsd(struct sigma_dut *dut, const char *intf, int uapsd); |
| 1142 | int is_ip_addr(const char *str); |
| 1143 | int run_system(struct sigma_dut *dut, const char *cmd); |
Adil Saeed Musthafa | 5f793f0 | 2017-04-10 23:13:30 -0700 | [diff] [blame] | 1144 | int run_system_wrapper(struct sigma_dut *dut, const char *cmd, ...); |
Priyadharshini Gowthaman | d06f100 | 2019-04-22 15:45:41 -0700 | [diff] [blame] | 1145 | int run_iwpriv(struct sigma_dut *dut, const char *ifname, const char *cmd, ...); |
Jouni Malinen | a485fd1 | 2019-06-13 23:27:01 +0300 | [diff] [blame] | 1146 | enum sigma_cmd_result cmd_wlantest_set_channel(struct sigma_dut *dut, |
| 1147 | struct sigma_conn *conn, |
| 1148 | struct sigma_cmd *cmd); |
Jouni Malinen | a2df7db | 2019-06-13 02:31:24 +0300 | [diff] [blame] | 1149 | void wlantest_register_cmds(void); |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 1150 | void sniffer_close(struct sigma_dut *dut); |
| 1151 | |
Vinay Gannevaram | 2dfb1da | 2019-06-14 15:24:08 +0530 | [diff] [blame] | 1152 | /* sigma_dut.c */ |
| 1153 | int wifi_hal_initialize(struct sigma_dut *dut); |
| 1154 | |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 1155 | /* ap.c */ |
Jouni Malinen | a2df7db | 2019-06-13 02:31:24 +0300 | [diff] [blame] | 1156 | void ap_register_cmds(void); |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 1157 | void ath_disable_txbf(struct sigma_dut *dut, const char *intf); |
Priyadharshini Gowthaman | 818afef | 2015-11-09 13:28:15 -0800 | [diff] [blame] | 1158 | void ath_config_dyn_bw_sig(struct sigma_dut *dut, const char *ifname, |
| 1159 | const char *val); |
Priyadharshini Gowthaman | 8c5b9a4 | 2019-07-31 14:38:48 -0700 | [diff] [blame] | 1160 | void novap_reset(struct sigma_dut *dut, const char *ifname, int reset); |
Jouni Malinen | 2e6ccc2 | 2017-09-04 13:43:16 +0300 | [diff] [blame] | 1161 | int get_hwaddr(const char *ifname, unsigned char *hwaddr); |
Jouni Malinen | a485fd1 | 2019-06-13 23:27:01 +0300 | [diff] [blame] | 1162 | enum sigma_cmd_result cmd_ap_config_commit(struct sigma_dut *dut, |
| 1163 | struct sigma_conn *conn, |
| 1164 | struct sigma_cmd *cmd); |
Alexei Avshalom Lazar | 043230b | 2019-02-04 14:11:24 +0200 | [diff] [blame] | 1165 | int ap_wps_registration(struct sigma_dut *dut, struct sigma_conn *conn, |
| 1166 | struct sigma_cmd *cmd); |
Jouni Malinen | 314b9c6 | 2020-06-05 15:36:04 +0300 | [diff] [blame] | 1167 | const char * get_hostapd_ifname(struct sigma_dut *dut); |
Sai Pavan Akhil Remella | 6469f0c | 2021-12-20 15:49:53 +0530 | [diff] [blame] | 1168 | void get_wiphy_capabilities(struct sigma_dut *dut); |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 1169 | |
| 1170 | /* sta.c */ |
Jouni Malinen | a2df7db | 2019-06-13 02:31:24 +0300 | [diff] [blame] | 1171 | void sta_register_cmds(void); |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 1172 | int set_ps(const char *intf, struct sigma_dut *dut, int enabled); |
| 1173 | void ath_set_zero_crc(struct sigma_dut *dut, const char *val); |
| 1174 | void ath_set_cts_width(struct sigma_dut *dut, const char *ifname, |
| 1175 | const char *val); |
| 1176 | int ath_set_width(struct sigma_dut *dut, struct sigma_conn *conn, |
| 1177 | const char *intf, const char *val); |
Alexei Avshalom Lazar | 49498b8 | 2019-01-31 15:16:32 +0200 | [diff] [blame] | 1178 | int sta_set_60g_abft_len(struct sigma_dut *dut, struct sigma_conn *conn, |
| 1179 | int abft_len); |
Lior David | 0fe101e | 2017-03-09 16:09:50 +0200 | [diff] [blame] | 1180 | int wil6210_send_frame_60g(struct sigma_dut *dut, struct sigma_conn *conn, |
| 1181 | struct sigma_cmd *cmd); |
Ankita Bajaj | 1bde794 | 2018-01-09 19:15:01 +0530 | [diff] [blame] | 1182 | int hwaddr_aton(const char *txt, unsigned char *addr); |
| 1183 | int set_ipv4_addr(struct sigma_dut *dut, const char *ifname, |
| 1184 | const char *ip, const char *mask); |
| 1185 | int set_ipv4_gw(struct sigma_dut *dut, const char *gw); |
Alexei Avshalom Lazar | 79fa3fe | 2018-12-24 15:43:33 +0200 | [diff] [blame] | 1186 | int send_addba_60g(struct sigma_dut *dut, struct sigma_conn *conn, |
| 1187 | struct sigma_cmd *cmd, const char *param); |
Alexei Avshalom Lazar | bc180dc | 2018-12-18 16:01:14 +0200 | [diff] [blame] | 1188 | int wil6210_set_ese(struct sigma_dut *dut, int count, |
| 1189 | struct sigma_ese_alloc *allocs); |
| 1190 | int sta_extract_60g_ese(struct sigma_dut *dut, struct sigma_cmd *cmd, |
| 1191 | struct sigma_ese_alloc *allocs, int *allocs_size); |
Alexei Avshalom Lazar | aad97b0 | 2018-12-18 16:01:23 +0200 | [diff] [blame] | 1192 | int wil6210_set_force_mcs(struct sigma_dut *dut, int force, int mcs); |
Qiwei Cai | b680697 | 2020-01-15 13:52:11 +0800 | [diff] [blame] | 1193 | int sta_set_addba_buf_size(struct sigma_dut *dut, |
| 1194 | const char *intf, int bufsize); |
Kiran Kumar Lokere | bed8095 | 2021-11-22 22:47:25 -0800 | [diff] [blame] | 1195 | int wcn_set_he_gi(struct sigma_dut *dut, const char *intf, u8 gi_val); |
Kiran Kumar Lokere | 26c0f86 | 2020-01-22 11:15:59 -0800 | [diff] [blame] | 1196 | #ifdef NL80211_SUPPORT |
| 1197 | int wcn_set_he_ltf(struct sigma_dut *dut, const char *intf, |
| 1198 | enum qca_wlan_he_ltf_cfg ltf); |
| 1199 | #endif /* NL80211_SUPPORT */ |
Veerendranath Jakkam | 9ceb3b1 | 2021-09-10 03:18:17 +0530 | [diff] [blame] | 1200 | void stop_dscp_policy_mon_thread(struct sigma_dut *dut); |
| 1201 | void free_dscp_policy_table(struct sigma_dut *dut); |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 1202 | |
| 1203 | /* p2p.c */ |
Jouni Malinen | a2df7db | 2019-06-13 02:31:24 +0300 | [diff] [blame] | 1204 | void p2p_register_cmds(void); |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 1205 | int p2p_cmd_sta_get_parameter(struct sigma_dut *dut, struct sigma_conn *conn, |
| 1206 | struct sigma_cmd *cmd); |
Purushottam Kushwaha | 091e253 | 2016-08-23 11:52:21 +0530 | [diff] [blame] | 1207 | void p2p_create_event_thread(struct sigma_dut *dut); |
| 1208 | void stop_event_thread(void); |
Amarnath Hullur Subramanyam | 89b37cd | 2017-03-17 00:04:41 -0700 | [diff] [blame] | 1209 | void start_dhcp(struct sigma_dut *dut, const char *group_ifname, int go); |
| 1210 | void stop_dhcp(struct sigma_dut *dut, const char *group_ifname, int go); |
| 1211 | int p2p_discover_peer(struct sigma_dut *dut, const char *ifname, |
| 1212 | const char *peer, int full); |
Jouni Malinen | a0bf62a | 2019-06-13 02:22:24 +0300 | [diff] [blame] | 1213 | enum sigma_cmd_result cmd_sta_p2p_reset(struct sigma_dut *dut, |
| 1214 | struct sigma_conn *conn, |
| 1215 | struct sigma_cmd *cmd); |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 1216 | |
Jouni Malinen | c54710d | 2019-01-23 12:34:21 +0200 | [diff] [blame] | 1217 | /* basic.c */ |
Jouni Malinen | a2df7db | 2019-06-13 02:31:24 +0300 | [diff] [blame] | 1218 | void basic_register_cmds(void); |
Jouni Malinen | c54710d | 2019-01-23 12:34:21 +0200 | [diff] [blame] | 1219 | void get_ver(const char *cmd, char *buf, size_t buflen); |
| 1220 | |
priyadharshini gowthaman | 72462ef | 2016-06-22 22:47:14 -0700 | [diff] [blame] | 1221 | /* utils.c */ |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 1222 | enum sigma_program sigma_program_to_enum(const char *prog); |
Alexei Avshalom Lazar | 9a4f98d | 2019-05-02 13:35:22 +0300 | [diff] [blame] | 1223 | int hex_byte(const char *str); |
Jouni Malinen | 08cf231 | 2017-09-04 13:39:47 +0300 | [diff] [blame] | 1224 | int parse_hexstr(const char *hex, unsigned char *buf, size_t buflen); |
priyadharshini gowthaman | 72462ef | 2016-06-22 22:47:14 -0700 | [diff] [blame] | 1225 | int parse_mac_address(struct sigma_dut *dut, const char *arg, |
| 1226 | unsigned char *addr); |
Alexei Avshalom Lazar | 093569f | 2018-11-13 14:08:17 +0200 | [diff] [blame] | 1227 | int is_60g_sigma_dut(struct sigma_dut *dut); |
| 1228 | unsigned int channel_to_freq(struct sigma_dut *dut, unsigned int channel); |
Rakesh Sunki | 7192dc4 | 2017-03-30 14:47:55 -0700 | [diff] [blame] | 1229 | unsigned int freq_to_channel(unsigned int freq); |
Peng Xu | 525965b | 2018-06-26 16:40:14 -0700 | [diff] [blame] | 1230 | int is_ipv6_addr(const char *str); |
Rakesh Sunki | 8f8e74b | 2017-05-16 15:42:12 -0700 | [diff] [blame] | 1231 | void convert_mac_addr_to_ipv6_lladdr(u8 *mac_addr, char *ipv6_buf, |
| 1232 | size_t buf_len); |
Peng Xu | 8863ec7 | 2018-08-06 11:50:37 -0700 | [diff] [blame] | 1233 | size_t convert_mac_addr_to_ipv6_linklocal(const u8 *mac_addr, u8 *ipv6); |
Veerendranath Jakkam | 9ceb3b1 | 2021-09-10 03:18:17 +0530 | [diff] [blame] | 1234 | int snprintf_error(size_t size, int res); |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 1235 | |
Peng Xu | 769731a | 2017-05-10 17:27:28 -0700 | [diff] [blame] | 1236 | #ifndef ANDROID |
| 1237 | size_t strlcpy(char *dest, const char *src, size_t siz); |
| 1238 | size_t strlcat(char *dst, const char *str, size_t size); |
| 1239 | #endif /* ANDROID */ |
Ankita Bajaj | 1bde794 | 2018-01-09 19:15:01 +0530 | [diff] [blame] | 1240 | void hex_dump(struct sigma_dut *dut, u8 *data, size_t len); |
Alexei Avshalom Lazar | 0dae51c | 2018-12-18 16:00:18 +0200 | [diff] [blame] | 1241 | int get_wps_pin_from_mac(struct sigma_dut *dut, const char *macaddr, |
| 1242 | char *pin, size_t len); |
Alexei Avshalom Lazar | 6427969 | 2018-12-23 16:49:49 +0200 | [diff] [blame] | 1243 | void str_remove_chars(char *str, char ch); |
Peng Xu | 769731a | 2017-05-10 17:27:28 -0700 | [diff] [blame] | 1244 | |
Alexei Avshalom Lazar | 744ae8a | 2019-01-31 17:26:46 +0200 | [diff] [blame] | 1245 | int get_wps_forced_version(struct sigma_dut *dut, const char *str); |
Alexei Avshalom Lazar | a37dc16 | 2019-02-04 14:06:48 +0200 | [diff] [blame] | 1246 | int base64_encode(const char *src, size_t len, char *out, size_t out_len); |
Jouni Malinen | 3d6d162 | 2022-04-14 12:47:54 +0300 | [diff] [blame] | 1247 | unsigned char * base64_decode(const char *src, size_t len, size_t *out_len); |
Alexei Avshalom Lazar | a37dc16 | 2019-02-04 14:06:48 +0200 | [diff] [blame] | 1248 | int random_get_bytes(char *buf, size_t len); |
Jouni Malinen | 3c740ab | 2019-10-10 15:55:11 +0300 | [diff] [blame] | 1249 | int get_enable_disable(const char *val); |
Vinita Maloo | 54b78cf | 2020-03-30 12:18:19 +0530 | [diff] [blame] | 1250 | int wcn_driver_cmd(const char *ifname, char *buf); |
Peng Xu | 769731a | 2017-05-10 17:27:28 -0700 | [diff] [blame] | 1251 | |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 1252 | /* uapsd_stream.c */ |
| 1253 | void receive_uapsd(struct sigma_stream *s); |
Pradeep Reddy POTTETI | 7959404 | 2015-11-23 12:59:12 +0530 | [diff] [blame] | 1254 | void send_uapsd_console(struct sigma_stream *s); |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 1255 | |
| 1256 | /* nan.c */ |
| 1257 | int nan_preset_testparameters(struct sigma_dut *dut, struct sigma_conn *conn, |
| 1258 | struct sigma_cmd *cmd); |
| 1259 | int nan_cmd_sta_get_parameter(struct sigma_dut *dut, struct sigma_conn *conn, |
| 1260 | struct sigma_cmd *cmd); |
| 1261 | int nan_cmd_sta_exec_action(struct sigma_dut *dut, struct sigma_conn *conn, |
| 1262 | struct sigma_cmd *cmd); |
| 1263 | int nan_cmd_sta_get_events(struct sigma_dut *dut, struct sigma_conn *conn, |
| 1264 | struct sigma_cmd *cmd); |
| 1265 | int nan_cmd_sta_transmit_followup(struct sigma_dut *dut, |
| 1266 | struct sigma_conn *conn, |
| 1267 | struct sigma_cmd *cmd); |
| 1268 | void nan_cmd_sta_reset_default(struct sigma_dut *dut, struct sigma_conn *conn, |
| 1269 | struct sigma_cmd *cmd); |
| 1270 | int nan_cmd_sta_preset_testparameters(struct sigma_dut *dut, |
| 1271 | struct sigma_conn *conn, |
| 1272 | struct sigma_cmd *cmd); |
| 1273 | |
priyadharshini gowthaman | d66913a | 2016-07-29 15:11:17 -0700 | [diff] [blame] | 1274 | /* ftm.c */ |
| 1275 | int loc_cmd_sta_exec_action(struct sigma_dut *dut, struct sigma_conn *conn, |
| 1276 | struct sigma_cmd *cmd); |
| 1277 | int loc_cmd_sta_send_frame(struct sigma_dut *dut, struct sigma_conn *conn, |
| 1278 | struct sigma_cmd *cmd); |
| 1279 | int loc_cmd_sta_preset_testparameters(struct sigma_dut *dut, |
| 1280 | struct sigma_conn *conn, |
| 1281 | struct sigma_cmd *cmd); |
Vinay Gannevaram | 3b9fdd3 | 2019-06-14 17:55:44 +0530 | [diff] [blame] | 1282 | int lowi_cmd_sta_reset_default(struct sigma_dut *dut, struct sigma_conn *conn, |
| 1283 | struct sigma_cmd *cmd); |
priyadharshini gowthaman | d66913a | 2016-07-29 15:11:17 -0700 | [diff] [blame] | 1284 | |
Jouni Malinen | d86e582 | 2017-08-29 03:55:32 +0300 | [diff] [blame] | 1285 | /* dpp.c */ |
Jouni Malinen | 89cf6d6 | 2020-05-11 22:42:11 +0300 | [diff] [blame] | 1286 | enum sigma_cmd_result dpp_dev_exec_action(struct sigma_dut *dut, |
| 1287 | struct sigma_conn *conn, |
| 1288 | struct sigma_cmd *cmd); |
Jouni Malinen | cd208ad | 2022-04-14 13:04:00 +0300 | [diff] [blame] | 1289 | int dpp_mdns_discover_relay_params(struct sigma_dut *dut); |
Jouni Malinen | 29a63f4 | 2022-04-13 22:08:47 +0300 | [diff] [blame] | 1290 | int dpp_mdns_start(struct sigma_dut *dut, enum dpp_mdns_role role); |
| 1291 | void dpp_mdns_stop(struct sigma_dut *dut); |
Jouni Malinen | d86e582 | 2017-08-29 03:55:32 +0300 | [diff] [blame] | 1292 | |
Ankita Bajaj | 1bde794 | 2018-01-09 19:15:01 +0530 | [diff] [blame] | 1293 | /* dhcp.c */ |
| 1294 | void process_fils_hlp(struct sigma_dut *dut); |
| 1295 | void hlp_thread_cleanup(struct sigma_dut *dut); |
Jouni Malinen | d86e582 | 2017-08-29 03:55:32 +0300 | [diff] [blame] | 1296 | |
Peng Xu | 291d97d | 2018-01-31 16:34:03 -0800 | [diff] [blame] | 1297 | #ifdef NL80211_SUPPORT |
| 1298 | struct nl80211_ctx * nl80211_init(struct sigma_dut *dut); |
| 1299 | void nl80211_deinit(struct sigma_dut *dut, struct nl80211_ctx *ctx); |
Kiran Kumar Lokere | 94829ce | 2022-01-20 10:49:08 -0800 | [diff] [blame] | 1300 | int nl80211_open_event_sock(struct sigma_dut *dut); |
| 1301 | void nl80211_close_event_sock(struct sigma_dut *dut); |
Peng Xu | 291d97d | 2018-01-31 16:34:03 -0800 | [diff] [blame] | 1302 | struct nl_msg * nl80211_drv_msg(struct sigma_dut *dut, struct nl80211_ctx *ctx, |
| 1303 | int ifindex, int flags, |
| 1304 | uint8_t cmd); |
| 1305 | int send_and_recv_msgs(struct sigma_dut *dut, struct nl80211_ctx *ctx, |
| 1306 | struct nl_msg *nlmsg, |
| 1307 | int (*valid_handler)(struct nl_msg *, void *), |
| 1308 | void *valid_data); |
Veerendranath Jakkam | 050b85a | 2020-07-04 04:00:32 +0530 | [diff] [blame] | 1309 | int wcn_wifi_test_config_set_flag(struct sigma_dut *dut, const char *intf, |
| 1310 | int attr_id); |
| 1311 | int wcn_wifi_test_config_set_u8(struct sigma_dut *dut, const char *intf, |
| 1312 | int attr_id, uint8_t val); |
| 1313 | int wcn_wifi_test_config_set_u16(struct sigma_dut *dut, const char *intf, |
| 1314 | int attr_id, uint16_t val); |
Peng Xu | 291d97d | 2018-01-31 16:34:03 -0800 | [diff] [blame] | 1315 | #endif /* NL80211_SUPPORT */ |
| 1316 | |
Jouni Malinen | a2df7db | 2019-06-13 02:31:24 +0300 | [diff] [blame] | 1317 | void traffic_register_cmds(void); |
| 1318 | void traffic_agent_register_cmds(void); |
| 1319 | void powerswitch_register_cmds(void); |
| 1320 | void atheros_register_cmds(void); |
| 1321 | void dev_register_cmds(void); |
| 1322 | void sniffer_register_cmds(void); |
| 1323 | void server_register_cmds(void); |
| 1324 | void miracast_register_cmds(void); |
Veerendranath Jakkam | 176181c | 2020-05-16 00:19:21 +0530 | [diff] [blame] | 1325 | int set_ipv6_addr(struct sigma_dut *dut, const char *ip, const char *mask, |
| 1326 | const char *ifname); |
Shivani Baranwal | 3118201 | 2021-12-07 21:11:13 +0530 | [diff] [blame] | 1327 | void kill_pid(struct sigma_dut *dut, const char *pid_file); |
Jouni Malinen | a2df7db | 2019-06-13 02:31:24 +0300 | [diff] [blame] | 1328 | |
Jouni Malinen | cd4e3c3 | 2015-10-29 12:39:56 +0200 | [diff] [blame] | 1329 | #endif /* SIGMA_DUT_H */ |