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