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