xref: /freebsd/contrib/wpa/src/ap/ap_config.h (revision a90b9d0159070121c221b966469c3e36d912bf82)
1e28a4053SRui Paulo /*
2e28a4053SRui Paulo  * hostapd / Configuration definitions and helpers functions
3*a90b9d01SCy Schubert  * Copyright (c) 2003-2024, Jouni Malinen <j@w1.fi>
4e28a4053SRui Paulo  *
5f05cddf9SRui Paulo  * This software may be distributed under the terms of the BSD license.
6f05cddf9SRui Paulo  * See README for more details.
7e28a4053SRui Paulo  */
8e28a4053SRui Paulo 
9e28a4053SRui Paulo #ifndef HOSTAPD_CONFIG_H
10e28a4053SRui Paulo #define HOSTAPD_CONFIG_H
11e28a4053SRui Paulo 
12e28a4053SRui Paulo #include "common/defs.h"
13780fb4a2SCy Schubert #include "utils/list.h"
14e28a4053SRui Paulo #include "ip_addr.h"
15e28a4053SRui Paulo #include "common/wpa_common.h"
16325151a3SRui Paulo #include "common/ieee802_11_defs.h"
17f05cddf9SRui Paulo #include "common/ieee802_11_common.h"
18206b73d0SCy Schubert #include "crypto/sha256.h"
19f05cddf9SRui Paulo #include "wps/wps.h"
20325151a3SRui Paulo #include "fst/fst.h"
21780fb4a2SCy Schubert #include "vlan.h"
22e28a4053SRui Paulo 
23*a90b9d01SCy Schubert enum macaddr_acl {
24*a90b9d01SCy Schubert 	ACCEPT_UNLESS_DENIED = 0,
25*a90b9d01SCy Schubert 	DENY_UNLESS_ACCEPTED = 1,
26*a90b9d01SCy Schubert 	USE_EXTERNAL_RADIUS_AUTH = 2
27*a90b9d01SCy Schubert };
28*a90b9d01SCy Schubert 
295b9c547cSRui Paulo /**
305b9c547cSRui Paulo  * mesh_conf - local MBSS state and settings
315b9c547cSRui Paulo  */
325b9c547cSRui Paulo struct mesh_conf {
335b9c547cSRui Paulo 	u8 meshid[32];
345b9c547cSRui Paulo 	u8 meshid_len;
355b9c547cSRui Paulo 	/* Active Path Selection Protocol Identifier */
365b9c547cSRui Paulo 	u8 mesh_pp_id;
375b9c547cSRui Paulo 	/* Active Path Selection Metric Identifier */
385b9c547cSRui Paulo 	u8 mesh_pm_id;
395b9c547cSRui Paulo 	/* Congestion Control Mode Identifier */
405b9c547cSRui Paulo 	u8 mesh_cc_id;
415b9c547cSRui Paulo 	/* Synchronization Protocol Identifier */
425b9c547cSRui Paulo 	u8 mesh_sp_id;
435b9c547cSRui Paulo 	/* Authentication Protocol Identifier */
445b9c547cSRui Paulo 	u8 mesh_auth_id;
45325151a3SRui Paulo 	u8 *rsn_ie;
46325151a3SRui Paulo 	int rsn_ie_len;
475b9c547cSRui Paulo #define MESH_CONF_SEC_NONE BIT(0)
485b9c547cSRui Paulo #define MESH_CONF_SEC_AUTH BIT(1)
495b9c547cSRui Paulo #define MESH_CONF_SEC_AMPE BIT(2)
505b9c547cSRui Paulo 	unsigned int security;
51780fb4a2SCy Schubert 	enum mfp_options ieee80211w;
524bc52338SCy Schubert 	int ocv;
53780fb4a2SCy Schubert 	unsigned int pairwise_cipher;
54780fb4a2SCy Schubert 	unsigned int group_cipher;
55780fb4a2SCy Schubert 	unsigned int mgmt_group_cipher;
565b9c547cSRui Paulo 	int dot11MeshMaxRetries;
575b9c547cSRui Paulo 	int dot11MeshRetryTimeout; /* msec */
585b9c547cSRui Paulo 	int dot11MeshConfirmTimeout; /* msec */
595b9c547cSRui Paulo 	int dot11MeshHoldingTimeout; /* msec */
6032a95656SCy Schubert 	int mesh_fwding;
615b9c547cSRui Paulo };
625b9c547cSRui Paulo 
63e28a4053SRui Paulo #define MAX_STA_COUNT 2007
64e28a4053SRui Paulo #define MAX_VLAN_ID 4094
65e28a4053SRui Paulo 
66e28a4053SRui Paulo typedef u8 macaddr[ETH_ALEN];
67e28a4053SRui Paulo 
68e28a4053SRui Paulo struct mac_acl_entry {
69e28a4053SRui Paulo 	macaddr addr;
70780fb4a2SCy Schubert 	struct vlan_description vlan_id;
71e28a4053SRui Paulo };
72e28a4053SRui Paulo 
73e28a4053SRui Paulo struct hostapd_radius_servers;
74e28a4053SRui Paulo struct ft_remote_r0kh;
75e28a4053SRui Paulo struct ft_remote_r1kh;
76e28a4053SRui Paulo 
77c1d255d3SCy Schubert #ifdef CONFIG_WEP
78e28a4053SRui Paulo #define NUM_WEP_KEYS 4
79e28a4053SRui Paulo struct hostapd_wep_keys {
80e28a4053SRui Paulo 	u8 idx;
81e28a4053SRui Paulo 	u8 *key[NUM_WEP_KEYS];
82e28a4053SRui Paulo 	size_t len[NUM_WEP_KEYS];
83e28a4053SRui Paulo 	int keys_set;
84e28a4053SRui Paulo 	size_t default_len; /* key length used for dynamic key generation */
85e28a4053SRui Paulo };
86c1d255d3SCy Schubert #endif /* CONFIG_WEP */
87e28a4053SRui Paulo 
88e28a4053SRui Paulo typedef enum hostap_security_policy {
89e28a4053SRui Paulo 	SECURITY_PLAINTEXT = 0,
90c1d255d3SCy Schubert #ifdef CONFIG_WEP
91e28a4053SRui Paulo 	SECURITY_STATIC_WEP = 1,
92c1d255d3SCy Schubert #endif /* CONFIG_WEP */
93e28a4053SRui Paulo 	SECURITY_IEEE_802_1X = 2,
94e28a4053SRui Paulo 	SECURITY_WPA_PSK = 3,
955b9c547cSRui Paulo 	SECURITY_WPA = 4,
965b9c547cSRui Paulo 	SECURITY_OSEN = 5
97e28a4053SRui Paulo } secpolicy;
98e28a4053SRui Paulo 
99e28a4053SRui Paulo struct hostapd_ssid {
100325151a3SRui Paulo 	u8 ssid[SSID_MAX_LEN];
101e28a4053SRui Paulo 	size_t ssid_len;
102c1d255d3SCy Schubert 	u32 short_ssid;
103f05cddf9SRui Paulo 	unsigned int ssid_set:1;
104f05cddf9SRui Paulo 	unsigned int utf8_ssid:1;
1055b9c547cSRui Paulo 	unsigned int wpa_passphrase_set:1;
1065b9c547cSRui Paulo 	unsigned int wpa_psk_set:1;
107e28a4053SRui Paulo 
108e28a4053SRui Paulo 	char vlan[IFNAMSIZ + 1];
109e28a4053SRui Paulo 	secpolicy security_policy;
110e28a4053SRui Paulo 
111e28a4053SRui Paulo 	struct hostapd_wpa_psk *wpa_psk;
112e28a4053SRui Paulo 	char *wpa_passphrase;
113e28a4053SRui Paulo 	char *wpa_psk_file;
114c1d255d3SCy Schubert 	struct sae_pt *pt;
115e28a4053SRui Paulo 
116c1d255d3SCy Schubert #ifdef CONFIG_WEP
117e28a4053SRui Paulo 	struct hostapd_wep_keys wep;
118c1d255d3SCy Schubert #endif /* CONFIG_WEP */
119e28a4053SRui Paulo 
120e28a4053SRui Paulo #define DYNAMIC_VLAN_DISABLED 0
121e28a4053SRui Paulo #define DYNAMIC_VLAN_OPTIONAL 1
122e28a4053SRui Paulo #define DYNAMIC_VLAN_REQUIRED 2
123e28a4053SRui Paulo 	int dynamic_vlan;
124f05cddf9SRui Paulo #define DYNAMIC_VLAN_NAMING_WITHOUT_DEVICE 0
125f05cddf9SRui Paulo #define DYNAMIC_VLAN_NAMING_WITH_DEVICE 1
126f05cddf9SRui Paulo #define DYNAMIC_VLAN_NAMING_END 2
127f05cddf9SRui Paulo 	int vlan_naming;
128780fb4a2SCy Schubert 	int per_sta_vif;
129e28a4053SRui Paulo #ifdef CONFIG_FULL_DYNAMIC_VLAN
130e28a4053SRui Paulo 	char *vlan_tagged_interface;
131e28a4053SRui Paulo #endif /* CONFIG_FULL_DYNAMIC_VLAN */
132e28a4053SRui Paulo };
133e28a4053SRui Paulo 
134e28a4053SRui Paulo 
135e28a4053SRui Paulo #define VLAN_ID_WILDCARD -1
136e28a4053SRui Paulo 
137e28a4053SRui Paulo struct hostapd_vlan {
138e28a4053SRui Paulo 	struct hostapd_vlan *next;
139e28a4053SRui Paulo 	int vlan_id; /* VLAN ID or -1 (VLAN_ID_WILDCARD) for wildcard entry */
140780fb4a2SCy Schubert 	struct vlan_description vlan_desc;
141e28a4053SRui Paulo 	char ifname[IFNAMSIZ + 1];
1424bc52338SCy Schubert 	char bridge[IFNAMSIZ + 1];
143325151a3SRui Paulo 	int configured;
144e28a4053SRui Paulo 	int dynamic_vlan;
145e28a4053SRui Paulo #ifdef CONFIG_FULL_DYNAMIC_VLAN
146e28a4053SRui Paulo 
147e28a4053SRui Paulo #define DVLAN_CLEAN_WLAN_PORT	0x8
148e28a4053SRui Paulo 	int clean;
149e28a4053SRui Paulo #endif /* CONFIG_FULL_DYNAMIC_VLAN */
150e28a4053SRui Paulo };
151e28a4053SRui Paulo 
152e28a4053SRui Paulo #define PMK_LEN 32
1534bc52338SCy Schubert #define KEYID_LEN 32
154780fb4a2SCy Schubert #define MIN_PASSPHRASE_LEN 8
155780fb4a2SCy Schubert #define MAX_PASSPHRASE_LEN 63
156f05cddf9SRui Paulo struct hostapd_sta_wpa_psk_short {
157f05cddf9SRui Paulo 	struct hostapd_sta_wpa_psk_short *next;
158780fb4a2SCy Schubert 	unsigned int is_passphrase:1;
159f05cddf9SRui Paulo 	u8 psk[PMK_LEN];
160780fb4a2SCy Schubert 	char passphrase[MAX_PASSPHRASE_LEN + 1];
161780fb4a2SCy Schubert 	int ref; /* (number of references held) - 1 */
162f05cddf9SRui Paulo };
163f05cddf9SRui Paulo 
164e28a4053SRui Paulo struct hostapd_wpa_psk {
165e28a4053SRui Paulo 	struct hostapd_wpa_psk *next;
166e28a4053SRui Paulo 	int group;
1674bc52338SCy Schubert 	char keyid[KEYID_LEN];
168c1d255d3SCy Schubert 	int wps;
169e28a4053SRui Paulo 	u8 psk[PMK_LEN];
170e28a4053SRui Paulo 	u8 addr[ETH_ALEN];
1715b9c547cSRui Paulo 	u8 p2p_dev_addr[ETH_ALEN];
1724bc52338SCy Schubert 	int vlan_id;
173e28a4053SRui Paulo };
174e28a4053SRui Paulo 
175e28a4053SRui Paulo struct hostapd_eap_user {
176e28a4053SRui Paulo 	struct hostapd_eap_user *next;
177e28a4053SRui Paulo 	u8 *identity;
178e28a4053SRui Paulo 	size_t identity_len;
179e28a4053SRui Paulo 	struct {
180e28a4053SRui Paulo 		int vendor;
181e28a4053SRui Paulo 		u32 method;
182f05cddf9SRui Paulo 	} methods[EAP_MAX_METHODS];
183e28a4053SRui Paulo 	u8 *password;
184e28a4053SRui Paulo 	size_t password_len;
18585732ac8SCy Schubert 	u8 *salt;
18685732ac8SCy Schubert 	size_t salt_len; /* non-zero when password is salted */
187e28a4053SRui Paulo 	int phase2;
188e28a4053SRui Paulo 	int force_version;
189e28a4053SRui Paulo 	unsigned int wildcard_prefix:1;
190e28a4053SRui Paulo 	unsigned int password_hash:1; /* whether password is hashed with
191e28a4053SRui Paulo 				       * nt_password_hash() */
1925b9c547cSRui Paulo 	unsigned int remediation:1;
1935b9c547cSRui Paulo 	unsigned int macacl:1;
194e28a4053SRui Paulo 	int ttls_auth; /* EAP_TTLS_AUTH_* bitfield */
1955b9c547cSRui Paulo 	struct hostapd_radius_attr *accept_attr;
19685732ac8SCy Schubert 	u32 t_c_timestamp;
197e28a4053SRui Paulo };
198e28a4053SRui Paulo 
199f05cddf9SRui Paulo struct hostapd_radius_attr {
200f05cddf9SRui Paulo 	u8 type;
201f05cddf9SRui Paulo 	struct wpabuf *val;
202f05cddf9SRui Paulo 	struct hostapd_radius_attr *next;
203f05cddf9SRui Paulo };
204e28a4053SRui Paulo 
205f05cddf9SRui Paulo 
206f05cddf9SRui Paulo #define NUM_TX_QUEUES 4
207f05cddf9SRui Paulo #define MAX_ROAMING_CONSORTIUM_LEN 15
208f05cddf9SRui Paulo 
209f05cddf9SRui Paulo struct hostapd_roaming_consortium {
210f05cddf9SRui Paulo 	u8 len;
211f05cddf9SRui Paulo 	u8 oi[MAX_ROAMING_CONSORTIUM_LEN];
212e28a4053SRui Paulo };
213e28a4053SRui Paulo 
214f05cddf9SRui Paulo struct hostapd_lang_string {
215f05cddf9SRui Paulo 	u8 lang[3];
216f05cddf9SRui Paulo 	u8 name_len;
217f05cddf9SRui Paulo 	u8 name[252];
218f05cddf9SRui Paulo };
219f05cddf9SRui Paulo 
22085732ac8SCy Schubert struct hostapd_venue_url {
22185732ac8SCy Schubert 	u8 venue_number;
22285732ac8SCy Schubert 	u8 url_len;
22385732ac8SCy Schubert 	u8 url[254];
22485732ac8SCy Schubert };
22585732ac8SCy Schubert 
226f05cddf9SRui Paulo #define MAX_NAI_REALMS 10
227f05cddf9SRui Paulo #define MAX_NAI_REALMLEN 255
228f05cddf9SRui Paulo #define MAX_NAI_EAP_METHODS 5
229f05cddf9SRui Paulo #define MAX_NAI_AUTH_TYPES 4
230f05cddf9SRui Paulo struct hostapd_nai_realm_data {
231f05cddf9SRui Paulo 	u8 encoding;
232f05cddf9SRui Paulo 	char realm_buf[MAX_NAI_REALMLEN + 1];
233f05cddf9SRui Paulo 	char *realm[MAX_NAI_REALMS];
234f05cddf9SRui Paulo 	u8 eap_method_count;
235f05cddf9SRui Paulo 	struct hostapd_nai_realm_eap {
236f05cddf9SRui Paulo 		u8 eap_method;
237f05cddf9SRui Paulo 		u8 num_auths;
238f05cddf9SRui Paulo 		u8 auth_id[MAX_NAI_AUTH_TYPES];
239f05cddf9SRui Paulo 		u8 auth_val[MAX_NAI_AUTH_TYPES];
240f05cddf9SRui Paulo 	} eap_method[MAX_NAI_EAP_METHODS];
241f05cddf9SRui Paulo };
242e28a4053SRui Paulo 
243780fb4a2SCy Schubert struct anqp_element {
244780fb4a2SCy Schubert 	struct dl_list list;
245780fb4a2SCy Schubert 	u16 infoid;
246780fb4a2SCy Schubert 	struct wpabuf *payload;
247780fb4a2SCy Schubert };
248780fb4a2SCy Schubert 
24985732ac8SCy Schubert struct fils_realm {
25085732ac8SCy Schubert 	struct dl_list list;
25185732ac8SCy Schubert 	u8 hash[2];
25285732ac8SCy Schubert 	char realm[];
25385732ac8SCy Schubert };
25485732ac8SCy Schubert 
25585732ac8SCy Schubert struct sae_password_entry {
25685732ac8SCy Schubert 	struct sae_password_entry *next;
25785732ac8SCy Schubert 	char *password;
25885732ac8SCy Schubert 	char *identifier;
25985732ac8SCy Schubert 	u8 peer_addr[ETH_ALEN];
2604bc52338SCy Schubert 	int vlan_id;
261c1d255d3SCy Schubert 	struct sae_pt *pt;
262c1d255d3SCy Schubert 	struct sae_pk *pk;
26385732ac8SCy Schubert };
264780fb4a2SCy Schubert 
265206b73d0SCy Schubert struct dpp_controller_conf {
266206b73d0SCy Schubert 	struct dpp_controller_conf *next;
267206b73d0SCy Schubert 	u8 pkhash[SHA256_MAC_LEN];
268206b73d0SCy Schubert 	struct hostapd_ip_addr ipaddr;
269206b73d0SCy Schubert };
270206b73d0SCy Schubert 
271206b73d0SCy Schubert struct airtime_sta_weight {
272206b73d0SCy Schubert 	struct airtime_sta_weight *next;
273206b73d0SCy Schubert 	unsigned int weight;
274206b73d0SCy Schubert 	u8 addr[ETH_ALEN];
275206b73d0SCy Schubert };
276206b73d0SCy Schubert 
277c1d255d3SCy Schubert #define EXT_CAPA_MAX_LEN 15
278c1d255d3SCy Schubert 
279e28a4053SRui Paulo /**
280e28a4053SRui Paulo  * struct hostapd_bss_config - Per-BSS configuration
281e28a4053SRui Paulo  */
282e28a4053SRui Paulo struct hostapd_bss_config {
283e28a4053SRui Paulo 	char iface[IFNAMSIZ + 1];
284e28a4053SRui Paulo 	char bridge[IFNAMSIZ + 1];
2855b9c547cSRui Paulo 	char vlan_bridge[IFNAMSIZ + 1];
286f05cddf9SRui Paulo 	char wds_bridge[IFNAMSIZ + 1];
287*a90b9d01SCy Schubert 	int bridge_hairpin; /* hairpin_mode on bridge members */
288e28a4053SRui Paulo 
289e28a4053SRui Paulo 	enum hostapd_logger_level logger_syslog_level, logger_stdout_level;
290e28a4053SRui Paulo 
291e28a4053SRui Paulo 	unsigned int logger_syslog; /* module bitfield */
292e28a4053SRui Paulo 	unsigned int logger_stdout; /* module bitfield */
293e28a4053SRui Paulo 
294e28a4053SRui Paulo 	int max_num_sta; /* maximum number of STAs in station table */
295e28a4053SRui Paulo 
296e28a4053SRui Paulo 	int dtim_period;
29785732ac8SCy Schubert 	unsigned int bss_load_update_period;
29885732ac8SCy Schubert 	unsigned int chan_util_avg_period;
299e28a4053SRui Paulo 
300e28a4053SRui Paulo 	int ieee802_1x; /* use IEEE 802.1X */
301e28a4053SRui Paulo 	int eapol_version;
302e28a4053SRui Paulo 	int eap_server; /* Use internal EAP server instead of external
303e28a4053SRui Paulo 			 * RADIUS server */
304e28a4053SRui Paulo 	struct hostapd_eap_user *eap_user;
305f05cddf9SRui Paulo 	char *eap_user_sqlite;
306e28a4053SRui Paulo 	char *eap_sim_db;
307780fb4a2SCy Schubert 	unsigned int eap_sim_db_timeout;
3085b9c547cSRui Paulo 	int eap_server_erp; /* Whether ERP is enabled on internal EAP server */
309e28a4053SRui Paulo 	struct hostapd_ip_addr own_ip_addr;
310e28a4053SRui Paulo 	char *nas_identifier;
311e28a4053SRui Paulo 	struct hostapd_radius_servers *radius;
312*a90b9d01SCy Schubert 	int radius_require_message_authenticator;
313e28a4053SRui Paulo 	int acct_interim_interval;
314f05cddf9SRui Paulo 	int radius_request_cui;
315f05cddf9SRui Paulo 	struct hostapd_radius_attr *radius_auth_req_attr;
316f05cddf9SRui Paulo 	struct hostapd_radius_attr *radius_acct_req_attr;
317206b73d0SCy Schubert 	char *radius_req_attr_sqlite;
318f05cddf9SRui Paulo 	int radius_das_port;
319f05cddf9SRui Paulo 	unsigned int radius_das_time_window;
320f05cddf9SRui Paulo 	int radius_das_require_event_timestamp;
321780fb4a2SCy Schubert 	int radius_das_require_message_authenticator;
322f05cddf9SRui Paulo 	struct hostapd_ip_addr radius_das_client_addr;
323f05cddf9SRui Paulo 	u8 *radius_das_shared_secret;
324f05cddf9SRui Paulo 	size_t radius_das_shared_secret_len;
325e28a4053SRui Paulo 
326e28a4053SRui Paulo 	struct hostapd_ssid ssid;
327e28a4053SRui Paulo 
328e28a4053SRui Paulo 	char *eap_req_id_text; /* optional displayable message sent with
329e28a4053SRui Paulo 				* EAP Request-Identity */
330e28a4053SRui Paulo 	size_t eap_req_id_text_len;
331e28a4053SRui Paulo 	int eapol_key_index_workaround;
332e28a4053SRui Paulo 
333c1d255d3SCy Schubert #ifdef CONFIG_WEP
334e28a4053SRui Paulo 	size_t default_wep_key_len;
335e28a4053SRui Paulo 	int individual_wep_key_len;
336e28a4053SRui Paulo 	int wep_rekeying_period;
337e28a4053SRui Paulo 	int broadcast_key_idx_min, broadcast_key_idx_max;
338c1d255d3SCy Schubert #endif /* CONFIG_WEP */
339e28a4053SRui Paulo 	int eap_reauth_period;
3405b9c547cSRui Paulo 	int erp_send_reauth_start;
3415b9c547cSRui Paulo 	char *erp_domain;
342*a90b9d01SCy Schubert #ifdef CONFIG_TESTING_OPTIONS
343*a90b9d01SCy Schubert 	bool eap_skip_prot_success;
344*a90b9d01SCy Schubert #endif /* CONFIG_TESTING_OPTIONS */
345e28a4053SRui Paulo 
346*a90b9d01SCy Schubert 	enum macaddr_acl macaddr_acl;
347e28a4053SRui Paulo 	struct mac_acl_entry *accept_mac;
348e28a4053SRui Paulo 	int num_accept_mac;
349e28a4053SRui Paulo 	struct mac_acl_entry *deny_mac;
350e28a4053SRui Paulo 	int num_deny_mac;
351e28a4053SRui Paulo 	int wds_sta;
352f05cddf9SRui Paulo 	int isolate;
3535b9c547cSRui Paulo 	int start_disabled;
354e28a4053SRui Paulo 
355e28a4053SRui Paulo 	int auth_algs; /* bitfield of allowed IEEE 802.11 authentication
356e28a4053SRui Paulo 			* algorithms, WPA_AUTH_ALG_{OPEN,SHARED,LEAP} */
357e28a4053SRui Paulo 
358e28a4053SRui Paulo 	int wpa; /* bitfield of WPA_PROTO_WPA, WPA_PROTO_RSN */
359c1d255d3SCy Schubert 	int extended_key_id;
360e28a4053SRui Paulo 	int wpa_key_mgmt;
361e28a4053SRui Paulo 	enum mfp_options ieee80211w;
3625b9c547cSRui Paulo 	int group_mgmt_cipher;
363c1d255d3SCy Schubert 	int beacon_prot;
364e28a4053SRui Paulo 	/* dot11AssociationSAQueryMaximumTimeout (in TUs) */
365e28a4053SRui Paulo 	unsigned int assoc_sa_query_max_timeout;
366e28a4053SRui Paulo 	/* dot11AssociationSAQueryRetryTimeout (in TUs) */
367e28a4053SRui Paulo 	int assoc_sa_query_retry_timeout;
3684bc52338SCy Schubert #ifdef CONFIG_OCV
3694bc52338SCy Schubert 	int ocv; /* Operating Channel Validation */
3704bc52338SCy Schubert #endif /* CONFIG_OCV */
371f05cddf9SRui Paulo 	enum {
372f05cddf9SRui Paulo 		PSK_RADIUS_IGNORED = 0,
373f05cddf9SRui Paulo 		PSK_RADIUS_ACCEPTED = 1,
374*a90b9d01SCy Schubert 		PSK_RADIUS_REQUIRED = 2,
375*a90b9d01SCy Schubert 		PSK_RADIUS_DURING_4WAY_HS = 3,
376f05cddf9SRui Paulo 	} wpa_psk_radius;
377e28a4053SRui Paulo 	int wpa_pairwise;
37885732ac8SCy Schubert 	int group_cipher; /* wpa_group value override from configuation */
379e28a4053SRui Paulo 	int wpa_group;
380e28a4053SRui Paulo 	int wpa_group_rekey;
38185732ac8SCy Schubert 	int wpa_group_rekey_set;
382e28a4053SRui Paulo 	int wpa_strict_rekey;
383e28a4053SRui Paulo 	int wpa_gmk_rekey;
384e28a4053SRui Paulo 	int wpa_ptk_rekey;
385c1d255d3SCy Schubert 	enum ptk0_rekey_handling wpa_deny_ptk0_rekey;
38685732ac8SCy Schubert 	u32 wpa_group_update_count;
38785732ac8SCy Schubert 	u32 wpa_pairwise_update_count;
38885732ac8SCy Schubert 	int wpa_disable_eapol_key_retries;
389e28a4053SRui Paulo 	int rsn_pairwise;
390e28a4053SRui Paulo 	int rsn_preauth;
391e28a4053SRui Paulo 	char *rsn_preauth_interfaces;
392e28a4053SRui Paulo 
39385732ac8SCy Schubert #ifdef CONFIG_IEEE80211R_AP
394e28a4053SRui Paulo 	/* IEEE 802.11r - Fast BSS Transition */
395e28a4053SRui Paulo 	u8 mobility_domain[MOBILITY_DOMAIN_ID_LEN];
396e28a4053SRui Paulo 	u8 r1_key_holder[FT_R1KH_ID_LEN];
39785732ac8SCy Schubert 	u32 r0_key_lifetime; /* PMK-R0 lifetime seconds */
39885732ac8SCy Schubert 	int rkh_pos_timeout;
39985732ac8SCy Schubert 	int rkh_neg_timeout;
40085732ac8SCy Schubert 	int rkh_pull_timeout; /* ms */
40185732ac8SCy Schubert 	int rkh_pull_retries;
402e28a4053SRui Paulo 	u32 reassociation_deadline;
403e28a4053SRui Paulo 	struct ft_remote_r0kh *r0kh_list;
404e28a4053SRui Paulo 	struct ft_remote_r1kh *r1kh_list;
405e28a4053SRui Paulo 	int pmk_r1_push;
406f05cddf9SRui Paulo 	int ft_over_ds;
40785732ac8SCy Schubert 	int ft_psk_generate_local;
40885732ac8SCy Schubert 	int r1_max_key_lifetime;
409*a90b9d01SCy Schubert 	char *rxkh_file;
41085732ac8SCy Schubert #endif /* CONFIG_IEEE80211R_AP */
411e28a4053SRui Paulo 
412e28a4053SRui Paulo 	char *ctrl_interface; /* directory for UNIX domain sockets */
413e28a4053SRui Paulo #ifndef CONFIG_NATIVE_WINDOWS
414e28a4053SRui Paulo 	gid_t ctrl_interface_gid;
415e28a4053SRui Paulo #endif /* CONFIG_NATIVE_WINDOWS */
416e28a4053SRui Paulo 	int ctrl_interface_gid_set;
417e28a4053SRui Paulo 
418e28a4053SRui Paulo 	char *ca_cert;
419e28a4053SRui Paulo 	char *server_cert;
420206b73d0SCy Schubert 	char *server_cert2;
421e28a4053SRui Paulo 	char *private_key;
422206b73d0SCy Schubert 	char *private_key2;
423e28a4053SRui Paulo 	char *private_key_passwd;
424206b73d0SCy Schubert 	char *private_key_passwd2;
4254bc52338SCy Schubert 	char *check_cert_subject;
426e28a4053SRui Paulo 	int check_crl;
4274bc52338SCy Schubert 	int check_crl_strict;
4284bc52338SCy Schubert 	unsigned int crl_reload_interval;
429325151a3SRui Paulo 	unsigned int tls_session_lifetime;
43085732ac8SCy Schubert 	unsigned int tls_flags;
431c1d255d3SCy Schubert 	unsigned int max_auth_rounds;
432c1d255d3SCy Schubert 	unsigned int max_auth_rounds_short;
4335b9c547cSRui Paulo 	char *ocsp_stapling_response;
434780fb4a2SCy Schubert 	char *ocsp_stapling_response_multi;
435e28a4053SRui Paulo 	char *dh_file;
4365b9c547cSRui Paulo 	char *openssl_ciphers;
4374bc52338SCy Schubert 	char *openssl_ecdh_curves;
438e28a4053SRui Paulo 	u8 *pac_opaque_encr_key;
439e28a4053SRui Paulo 	u8 *eap_fast_a_id;
440e28a4053SRui Paulo 	size_t eap_fast_a_id_len;
441e28a4053SRui Paulo 	char *eap_fast_a_id_info;
442e28a4053SRui Paulo 	int eap_fast_prov;
443e28a4053SRui Paulo 	int pac_key_lifetime;
444e28a4053SRui Paulo 	int pac_key_refresh_time;
445206b73d0SCy Schubert 	int eap_teap_auth;
446206b73d0SCy Schubert 	int eap_teap_pac_no_inner;
447c1d255d3SCy Schubert 	int eap_teap_separate_result;
448c1d255d3SCy Schubert 	int eap_teap_id;
449*a90b9d01SCy Schubert 	int eap_teap_method_sequence;
450e28a4053SRui Paulo 	int eap_sim_aka_result_ind;
451206b73d0SCy Schubert 	int eap_sim_id;
452*a90b9d01SCy Schubert 	char *imsi_privacy_key;
453*a90b9d01SCy Schubert 	int eap_sim_aka_fast_reauth_limit;
454e28a4053SRui Paulo 	int tnc;
455f05cddf9SRui Paulo 	int fragment_size;
456f05cddf9SRui Paulo 	u16 pwd_group;
457e28a4053SRui Paulo 
458e28a4053SRui Paulo 	char *radius_server_clients;
459e28a4053SRui Paulo 	int radius_server_auth_port;
4605b9c547cSRui Paulo 	int radius_server_acct_port;
461e28a4053SRui Paulo 	int radius_server_ipv6;
462e28a4053SRui Paulo 
463e28a4053SRui Paulo 	int use_pae_group_addr; /* Whether to send EAPOL frames to PAE group
464e28a4053SRui Paulo 				 * address instead of individual address
465e28a4053SRui Paulo 				 * (for driver_wired.c).
466e28a4053SRui Paulo 				 */
467e28a4053SRui Paulo 
468e28a4053SRui Paulo 	int ap_max_inactivity;
469*a90b9d01SCy Schubert 	int bss_max_idle;
470*a90b9d01SCy Schubert 	int max_acceptable_idle_period;
471*a90b9d01SCy Schubert 	bool no_disconnect_on_group_keyerror;
472e28a4053SRui Paulo 	int ignore_broadcast_ssid;
473780fb4a2SCy Schubert 	int no_probe_resp_if_max_sta;
474e28a4053SRui Paulo 
475e28a4053SRui Paulo 	int wmm_enabled;
476e28a4053SRui Paulo 	int wmm_uapsd;
477e28a4053SRui Paulo 
4785b9c547cSRui Paulo 	struct hostapd_vlan *vlan;
479e28a4053SRui Paulo 
480e28a4053SRui Paulo 	macaddr bssid;
481e28a4053SRui Paulo 
482e28a4053SRui Paulo 	/*
483e28a4053SRui Paulo 	 * Maximum listen interval that STAs can use when associating with this
484e28a4053SRui Paulo 	 * BSS. If a STA tries to use larger value, the association will be
485e28a4053SRui Paulo 	 * denied with status code 51.
486e28a4053SRui Paulo 	 */
487e28a4053SRui Paulo 	u16 max_listen_interval;
488e28a4053SRui Paulo 
489f05cddf9SRui Paulo 	int disable_pmksa_caching;
490e28a4053SRui Paulo 	int okc; /* Opportunistic Key Caching */
491e28a4053SRui Paulo 
492e28a4053SRui Paulo 	int wps_state;
493e28a4053SRui Paulo #ifdef CONFIG_WPS
4945b9c547cSRui Paulo 	int wps_independent;
495e28a4053SRui Paulo 	int ap_setup_locked;
496e28a4053SRui Paulo 	u8 uuid[16];
497e28a4053SRui Paulo 	char *wps_pin_requests;
498e28a4053SRui Paulo 	char *device_name;
499e28a4053SRui Paulo 	char *manufacturer;
500e28a4053SRui Paulo 	char *model_name;
501e28a4053SRui Paulo 	char *model_number;
502e28a4053SRui Paulo 	char *serial_number;
503f05cddf9SRui Paulo 	u8 device_type[WPS_DEV_TYPE_LEN];
504e28a4053SRui Paulo 	char *config_methods;
505e28a4053SRui Paulo 	u8 os_version[4];
506e28a4053SRui Paulo 	char *ap_pin;
507e28a4053SRui Paulo 	int skip_cred_build;
508e28a4053SRui Paulo 	u8 *extra_cred;
509e28a4053SRui Paulo 	size_t extra_cred_len;
510e28a4053SRui Paulo 	int wps_cred_processing;
5114bc52338SCy Schubert 	int wps_cred_add_sae;
5125b9c547cSRui Paulo 	int force_per_enrollee_psk;
513e28a4053SRui Paulo 	u8 *ap_settings;
514e28a4053SRui Paulo 	size_t ap_settings_len;
5154bc52338SCy Schubert 	struct hostapd_ssid multi_ap_backhaul_ssid;
516e28a4053SRui Paulo 	char *upnp_iface;
517e28a4053SRui Paulo 	char *friendly_name;
518e28a4053SRui Paulo 	char *manufacturer_url;
519e28a4053SRui Paulo 	char *model_description;
520e28a4053SRui Paulo 	char *model_url;
521e28a4053SRui Paulo 	char *upc;
522f05cddf9SRui Paulo 	struct wpabuf *wps_vendor_ext[MAX_WPS_VENDOR_EXTENSIONS];
523c1d255d3SCy Schubert 	struct wpabuf *wps_application_ext;
5245b9c547cSRui Paulo 	int wps_nfc_pw_from_config;
525f05cddf9SRui Paulo 	int wps_nfc_dev_pw_id;
526f05cddf9SRui Paulo 	struct wpabuf *wps_nfc_dh_pubkey;
527f05cddf9SRui Paulo 	struct wpabuf *wps_nfc_dh_privkey;
528f05cddf9SRui Paulo 	struct wpabuf *wps_nfc_dev_pw;
529e28a4053SRui Paulo #endif /* CONFIG_WPS */
530f05cddf9SRui Paulo 	int pbc_in_m1;
5315b9c547cSRui Paulo 	char *server_id;
532f05cddf9SRui Paulo 
533f05cddf9SRui Paulo #define P2P_ENABLED BIT(0)
534f05cddf9SRui Paulo #define P2P_GROUP_OWNER BIT(1)
535f05cddf9SRui Paulo #define P2P_GROUP_FORMATION BIT(2)
536f05cddf9SRui Paulo #define P2P_MANAGE BIT(3)
537f05cddf9SRui Paulo #define P2P_ALLOW_CROSS_CONNECTION BIT(4)
538f05cddf9SRui Paulo 	int p2p;
5395b9c547cSRui Paulo #ifdef CONFIG_P2P
5405b9c547cSRui Paulo 	u8 ip_addr_go[4];
5415b9c547cSRui Paulo 	u8 ip_addr_mask[4];
5425b9c547cSRui Paulo 	u8 ip_addr_start[4];
5435b9c547cSRui Paulo 	u8 ip_addr_end[4];
5445b9c547cSRui Paulo #endif /* CONFIG_P2P */
545f05cddf9SRui Paulo 
546f05cddf9SRui Paulo 	int disassoc_low_ack;
547f05cddf9SRui Paulo 	int skip_inactivity_poll;
548f05cddf9SRui Paulo 
549f05cddf9SRui Paulo #define TDLS_PROHIBIT BIT(0)
550f05cddf9SRui Paulo #define TDLS_PROHIBIT_CHAN_SWITCH BIT(1)
551f05cddf9SRui Paulo 	int tdls;
552c1d255d3SCy Schubert 	bool disable_11n;
553c1d255d3SCy Schubert 	bool disable_11ac;
554c1d255d3SCy Schubert 	bool disable_11ax;
555*a90b9d01SCy Schubert 	bool disable_11be;
556f05cddf9SRui Paulo 
557f05cddf9SRui Paulo 	/* IEEE 802.11v */
558f05cddf9SRui Paulo 	int time_advertisement;
559f05cddf9SRui Paulo 	char *time_zone;
560f05cddf9SRui Paulo 	int wnm_sleep_mode;
56185732ac8SCy Schubert 	int wnm_sleep_mode_no_keys;
562f05cddf9SRui Paulo 	int bss_transition;
563f05cddf9SRui Paulo 
564f05cddf9SRui Paulo 	/* IEEE 802.11u - Interworking */
565f05cddf9SRui Paulo 	int interworking;
566f05cddf9SRui Paulo 	int access_network_type;
567f05cddf9SRui Paulo 	int internet;
568f05cddf9SRui Paulo 	int asra;
569f05cddf9SRui Paulo 	int esr;
570f05cddf9SRui Paulo 	int uesa;
571f05cddf9SRui Paulo 	int venue_info_set;
572f05cddf9SRui Paulo 	u8 venue_group;
573f05cddf9SRui Paulo 	u8 venue_type;
574f05cddf9SRui Paulo 	u8 hessid[ETH_ALEN];
575f05cddf9SRui Paulo 
576f05cddf9SRui Paulo 	/* IEEE 802.11u - Roaming Consortium list */
577f05cddf9SRui Paulo 	unsigned int roaming_consortium_count;
578f05cddf9SRui Paulo 	struct hostapd_roaming_consortium *roaming_consortium;
579f05cddf9SRui Paulo 
580f05cddf9SRui Paulo 	/* IEEE 802.11u - Venue Name duples */
581f05cddf9SRui Paulo 	unsigned int venue_name_count;
582f05cddf9SRui Paulo 	struct hostapd_lang_string *venue_name;
583f05cddf9SRui Paulo 
58485732ac8SCy Schubert 	/* Venue URL duples */
58585732ac8SCy Schubert 	unsigned int venue_url_count;
58685732ac8SCy Schubert 	struct hostapd_venue_url *venue_url;
58785732ac8SCy Schubert 
588f05cddf9SRui Paulo 	/* IEEE 802.11u - Network Authentication Type */
589f05cddf9SRui Paulo 	u8 *network_auth_type;
590f05cddf9SRui Paulo 	size_t network_auth_type_len;
591f05cddf9SRui Paulo 
592f05cddf9SRui Paulo 	/* IEEE 802.11u - IP Address Type Availability */
593f05cddf9SRui Paulo 	u8 ipaddr_type_availability;
594f05cddf9SRui Paulo 	u8 ipaddr_type_configured;
595f05cddf9SRui Paulo 
596f05cddf9SRui Paulo 	/* IEEE 802.11u - 3GPP Cellular Network */
597f05cddf9SRui Paulo 	u8 *anqp_3gpp_cell_net;
598f05cddf9SRui Paulo 	size_t anqp_3gpp_cell_net_len;
599f05cddf9SRui Paulo 
600f05cddf9SRui Paulo 	/* IEEE 802.11u - Domain Name */
601f05cddf9SRui Paulo 	u8 *domain_name;
602f05cddf9SRui Paulo 	size_t domain_name_len;
603f05cddf9SRui Paulo 
604f05cddf9SRui Paulo 	unsigned int nai_realm_count;
605f05cddf9SRui Paulo 	struct hostapd_nai_realm_data *nai_realm_data;
606f05cddf9SRui Paulo 
607780fb4a2SCy Schubert 	struct dl_list anqp_elem; /* list of struct anqp_element */
608780fb4a2SCy Schubert 
609f05cddf9SRui Paulo 	u16 gas_comeback_delay;
61085732ac8SCy Schubert 	size_t gas_frag_limit;
611780fb4a2SCy Schubert 	int gas_address3;
612f05cddf9SRui Paulo 
6135b9c547cSRui Paulo 	u8 qos_map_set[16 + 2 * 21];
6145b9c547cSRui Paulo 	unsigned int qos_map_set_len;
6155b9c547cSRui Paulo 
6165b9c547cSRui Paulo 	int osen;
6175b9c547cSRui Paulo 	int proxy_arp;
618325151a3SRui Paulo 	int na_mcast_to_ucast;
619206b73d0SCy Schubert 
620f05cddf9SRui Paulo #ifdef CONFIG_HS20
621f05cddf9SRui Paulo 	int hs20;
6224bc52338SCy Schubert 	int hs20_release;
623f05cddf9SRui Paulo 	int disable_dgaf;
6245b9c547cSRui Paulo 	u16 anqp_domain_id;
625f05cddf9SRui Paulo 	unsigned int hs20_oper_friendly_name_count;
626f05cddf9SRui Paulo 	struct hostapd_lang_string *hs20_oper_friendly_name;
627f05cddf9SRui Paulo 	u8 *hs20_wan_metrics;
628f05cddf9SRui Paulo 	u8 *hs20_connection_capability;
629f05cddf9SRui Paulo 	size_t hs20_connection_capability_len;
630f05cddf9SRui Paulo 	u8 *hs20_operating_class;
631f05cddf9SRui Paulo 	u8 hs20_operating_class_len;
6325b9c547cSRui Paulo 	struct hs20_icon {
6335b9c547cSRui Paulo 		u16 width;
6345b9c547cSRui Paulo 		u16 height;
6355b9c547cSRui Paulo 		char language[3];
6365b9c547cSRui Paulo 		char type[256];
6375b9c547cSRui Paulo 		char name[256];
6385b9c547cSRui Paulo 		char file[256];
6395b9c547cSRui Paulo 	} *hs20_icons;
6405b9c547cSRui Paulo 	size_t hs20_icons_count;
641325151a3SRui Paulo 	u8 osu_ssid[SSID_MAX_LEN];
6425b9c547cSRui Paulo 	size_t osu_ssid_len;
6435b9c547cSRui Paulo 	struct hs20_osu_provider {
6445b9c547cSRui Paulo 		unsigned int friendly_name_count;
6455b9c547cSRui Paulo 		struct hostapd_lang_string *friendly_name;
6465b9c547cSRui Paulo 		char *server_uri;
6475b9c547cSRui Paulo 		int *method_list;
6485b9c547cSRui Paulo 		char **icons;
6495b9c547cSRui Paulo 		size_t icons_count;
6505b9c547cSRui Paulo 		char *osu_nai;
65185732ac8SCy Schubert 		char *osu_nai2;
6525b9c547cSRui Paulo 		unsigned int service_desc_count;
6535b9c547cSRui Paulo 		struct hostapd_lang_string *service_desc;
6545b9c547cSRui Paulo 	} *hs20_osu_providers, *last_osu;
6555b9c547cSRui Paulo 	size_t hs20_osu_providers_count;
65685732ac8SCy Schubert 	size_t hs20_osu_providers_nai_count;
65785732ac8SCy Schubert 	char **hs20_operator_icon;
65885732ac8SCy Schubert 	size_t hs20_operator_icon_count;
6595b9c547cSRui Paulo 	unsigned int hs20_deauth_req_timeout;
6605b9c547cSRui Paulo 	char *subscr_remediation_url;
6615b9c547cSRui Paulo 	u8 subscr_remediation_method;
6624bc52338SCy Schubert 	char *hs20_sim_provisioning_url;
66385732ac8SCy Schubert 	char *t_c_filename;
66485732ac8SCy Schubert 	u32 t_c_timestamp;
66585732ac8SCy Schubert 	char *t_c_server_url;
666f05cddf9SRui Paulo #endif /* CONFIG_HS20 */
667f05cddf9SRui Paulo 
668f05cddf9SRui Paulo 	u8 wps_rf_bands; /* RF bands for WPS (WPS_RF_*) */
669f05cddf9SRui Paulo 
670f05cddf9SRui Paulo #ifdef CONFIG_RADIUS_TEST
671f05cddf9SRui Paulo 	char *dump_msk_file;
672f05cddf9SRui Paulo #endif /* CONFIG_RADIUS_TEST */
673f05cddf9SRui Paulo 
674f05cddf9SRui Paulo 	struct wpabuf *vendor_elements;
675780fb4a2SCy Schubert 	struct wpabuf *assocresp_elements;
6765b9c547cSRui Paulo 
677c1d255d3SCy Schubert 	unsigned int anti_clogging_threshold;
67885732ac8SCy Schubert 	unsigned int sae_sync;
67985732ac8SCy Schubert 	int sae_require_mfp;
680c1d255d3SCy Schubert 	int sae_confirm_immediate;
681*a90b9d01SCy Schubert 	enum sae_pwe sae_pwe;
6825b9c547cSRui Paulo 	int *sae_groups;
68385732ac8SCy Schubert 	struct sae_password_entry *sae_passwords;
6845b9c547cSRui Paulo 
6855b9c547cSRui Paulo 	char *wowlan_triggers; /* Wake-on-WLAN triggers */
6865b9c547cSRui Paulo 
6875b9c547cSRui Paulo #ifdef CONFIG_TESTING_OPTIONS
6885b9c547cSRui Paulo 	u8 bss_load_test[5];
6895b9c547cSRui Paulo 	u8 bss_load_test_set;
690325151a3SRui Paulo 	struct wpabuf *own_ie_override;
69185732ac8SCy Schubert 	int sae_reflection_attack;
692c1d255d3SCy Schubert 	int sae_commit_status;
693c1d255d3SCy Schubert 	int sae_pk_omit;
694c1d255d3SCy Schubert 	int sae_pk_password_check_skip;
69585732ac8SCy Schubert 	struct wpabuf *sae_commit_override;
696c1d255d3SCy Schubert 	struct wpabuf *rsne_override_eapol;
697c1d255d3SCy Schubert 	struct wpabuf *rsnxe_override_eapol;
698c1d255d3SCy Schubert 	struct wpabuf *rsne_override_ft;
699c1d255d3SCy Schubert 	struct wpabuf *rsnxe_override_ft;
700c1d255d3SCy Schubert 	struct wpabuf *gtk_rsc_override;
701c1d255d3SCy Schubert 	struct wpabuf *igtk_rsc_override;
702c1d255d3SCy Schubert 	int no_beacon_rsnxe;
703c1d255d3SCy Schubert 	int skip_prune_assoc;
704c1d255d3SCy Schubert 	int ft_rsnxe_used;
705c1d255d3SCy Schubert 	unsigned int oci_freq_override_eapol_m3;
706c1d255d3SCy Schubert 	unsigned int oci_freq_override_eapol_g1;
707c1d255d3SCy Schubert 	unsigned int oci_freq_override_saquery_req;
708c1d255d3SCy Schubert 	unsigned int oci_freq_override_saquery_resp;
709c1d255d3SCy Schubert 	unsigned int oci_freq_override_ft_assoc;
710c1d255d3SCy Schubert 	unsigned int oci_freq_override_fils_assoc;
711c1d255d3SCy Schubert 	unsigned int oci_freq_override_wnm_sleep;
712*a90b9d01SCy Schubert 	struct wpabuf *eapol_m1_elements;
713*a90b9d01SCy Schubert 	struct wpabuf *eapol_m3_elements;
714*a90b9d01SCy Schubert 	bool eapol_m3_no_encrypt;
715*a90b9d01SCy Schubert 	int test_assoc_comeback_type;
716*a90b9d01SCy Schubert 	struct wpabuf *presp_elements;
717*a90b9d01SCy Schubert 
718*a90b9d01SCy Schubert #ifdef CONFIG_IEEE80211BE
719*a90b9d01SCy Schubert 	u16 eht_oper_puncturing_override;
720*a90b9d01SCy Schubert #endif /* CONFIG_IEEE80211BE */
7215b9c547cSRui Paulo #endif /* CONFIG_TESTING_OPTIONS */
7225b9c547cSRui Paulo 
7235b9c547cSRui Paulo #define MESH_ENABLED BIT(0)
7245b9c547cSRui Paulo 	int mesh;
72532a95656SCy Schubert 	int mesh_fwding;
7265b9c547cSRui Paulo 
727780fb4a2SCy Schubert 	u8 radio_measurements[RRM_CAPABILITIES_IE_LEN];
7285b9c547cSRui Paulo 
7295b9c547cSRui Paulo 	int vendor_vht;
730780fb4a2SCy Schubert 	int use_sta_nsts;
731325151a3SRui Paulo 
732325151a3SRui Paulo 	char *no_probe_resp_if_seen_on;
733325151a3SRui Paulo 	char *no_auth_if_seen_on;
734780fb4a2SCy Schubert 
735780fb4a2SCy Schubert 	int pbss;
736780fb4a2SCy Schubert 
737780fb4a2SCy Schubert #ifdef CONFIG_MBO
738780fb4a2SCy Schubert 	int mbo_enabled;
73985732ac8SCy Schubert 	/**
74085732ac8SCy Schubert 	 * oce - Enable OCE in AP and/or STA-CFON mode
74185732ac8SCy Schubert 	 *  - BIT(0) is Reserved
74285732ac8SCy Schubert 	 *  - Set BIT(1) to enable OCE in STA-CFON mode
74385732ac8SCy Schubert 	 *  - Set BIT(2) to enable OCE in AP mode
74485732ac8SCy Schubert 	 */
74585732ac8SCy Schubert 	unsigned int oce;
74685732ac8SCy Schubert 	int mbo_cell_data_conn_pref;
747780fb4a2SCy Schubert #endif /* CONFIG_MBO */
748780fb4a2SCy Schubert 
749780fb4a2SCy Schubert 	int ftm_responder;
750780fb4a2SCy Schubert 	int ftm_initiator;
75185732ac8SCy Schubert 
75285732ac8SCy Schubert #ifdef CONFIG_FILS
75385732ac8SCy Schubert 	u8 fils_cache_id[FILS_CACHE_ID_LEN];
75485732ac8SCy Schubert 	int fils_cache_id_set;
75585732ac8SCy Schubert 	struct dl_list fils_realms; /* list of struct fils_realm */
75685732ac8SCy Schubert 	int fils_dh_group;
75785732ac8SCy Schubert 	struct hostapd_ip_addr dhcp_server;
75885732ac8SCy Schubert 	int dhcp_rapid_commit_proxy;
75985732ac8SCy Schubert 	unsigned int fils_hlp_wait_time;
76085732ac8SCy Schubert 	u16 dhcp_server_port;
76185732ac8SCy Schubert 	u16 dhcp_relay_port;
762c1d255d3SCy Schubert 	u32 fils_discovery_min_int;
763c1d255d3SCy Schubert 	u32 fils_discovery_max_int;
76485732ac8SCy Schubert #endif /* CONFIG_FILS */
76585732ac8SCy Schubert 
76685732ac8SCy Schubert 	int multicast_to_unicast;
767*a90b9d01SCy Schubert 	int bridge_multicast_to_unicast;
76885732ac8SCy Schubert 
76985732ac8SCy Schubert 	int broadcast_deauth;
77085732ac8SCy Schubert 
771c1d255d3SCy Schubert 	int notify_mgmt_frames;
772c1d255d3SCy Schubert 
77385732ac8SCy Schubert #ifdef CONFIG_DPP
774c1d255d3SCy Schubert 	char *dpp_name;
775c1d255d3SCy Schubert 	char *dpp_mud_url;
776*a90b9d01SCy Schubert 	char *dpp_extra_conf_req_name;
777*a90b9d01SCy Schubert 	char *dpp_extra_conf_req_value;
77885732ac8SCy Schubert 	char *dpp_connector;
77985732ac8SCy Schubert 	struct wpabuf *dpp_netaccesskey;
78085732ac8SCy Schubert 	unsigned int dpp_netaccesskey_expiry;
78185732ac8SCy Schubert 	struct wpabuf *dpp_csign;
782206b73d0SCy Schubert #ifdef CONFIG_DPP2
783206b73d0SCy Schubert 	struct dpp_controller_conf *dpp_controller;
784*a90b9d01SCy Schubert 	int dpp_relay_port;
785c1d255d3SCy Schubert 	int dpp_configurator_connectivity;
786c1d255d3SCy Schubert 	int dpp_pfs;
787206b73d0SCy Schubert #endif /* CONFIG_DPP2 */
78885732ac8SCy Schubert #endif /* CONFIG_DPP */
78985732ac8SCy Schubert 
79085732ac8SCy Schubert #ifdef CONFIG_OWE
79185732ac8SCy Schubert 	macaddr owe_transition_bssid;
79285732ac8SCy Schubert 	u8 owe_transition_ssid[SSID_MAX_LEN];
79385732ac8SCy Schubert 	size_t owe_transition_ssid_len;
79485732ac8SCy Schubert 	char owe_transition_ifname[IFNAMSIZ + 1];
79585732ac8SCy Schubert 	int *owe_groups;
796c1d255d3SCy Schubert 	int owe_ptk_workaround;
79785732ac8SCy Schubert #endif /* CONFIG_OWE */
79885732ac8SCy Schubert 
79985732ac8SCy Schubert 	int coloc_intf_reporting;
8004bc52338SCy Schubert 
8014bc52338SCy Schubert 	u8 send_probe_response;
8024bc52338SCy Schubert 
803c1d255d3SCy Schubert 	u8 transition_disable;
804c1d255d3SCy Schubert 
8054bc52338SCy Schubert #define BACKHAUL_BSS 1
8064bc52338SCy Schubert #define FRONTHAUL_BSS 2
8074bc52338SCy Schubert 	int multi_ap; /* bitmap of BACKHAUL_BSS, FRONTHAUL_BSS */
808*a90b9d01SCy Schubert 	int multi_ap_profile;
809*a90b9d01SCy Schubert 	/* Multi-AP Profile-1 clients not allowed to connect */
810*a90b9d01SCy Schubert #define PROFILE1_CLIENT_ASSOC_DISALLOW BIT(0)
811*a90b9d01SCy Schubert 	/* Multi-AP Profile-2 clients not allowed to connect */
812*a90b9d01SCy Schubert #define PROFILE2_CLIENT_ASSOC_DISALLOW BIT(1)
813*a90b9d01SCy Schubert 	unsigned int multi_ap_client_disallow;
814*a90b9d01SCy Schubert 	/* Primary VLAN ID to use in Multi-AP */
815*a90b9d01SCy Schubert 	int multi_ap_vlanid;
816206b73d0SCy Schubert 
817206b73d0SCy Schubert #ifdef CONFIG_AIRTIME_POLICY
818206b73d0SCy Schubert 	unsigned int airtime_weight;
819206b73d0SCy Schubert 	int airtime_limit;
820206b73d0SCy Schubert 	struct airtime_sta_weight *airtime_weight_list;
821206b73d0SCy Schubert #endif /* CONFIG_AIRTIME_POLICY */
822206b73d0SCy Schubert 
823206b73d0SCy Schubert #ifdef CONFIG_MACSEC
824206b73d0SCy Schubert 	/**
825206b73d0SCy Schubert 	 * macsec_policy - Determines the policy for MACsec secure session
826206b73d0SCy Schubert 	 *
827206b73d0SCy Schubert 	 * 0: MACsec not in use (default)
828206b73d0SCy Schubert 	 * 1: MACsec enabled - Should secure, accept key server's advice to
829206b73d0SCy Schubert 	 *    determine whether to use a secure session or not.
830206b73d0SCy Schubert 	 */
831206b73d0SCy Schubert 	int macsec_policy;
832206b73d0SCy Schubert 
833206b73d0SCy Schubert 	/**
834206b73d0SCy Schubert 	 * macsec_integ_only - Determines how MACsec are transmitted
835206b73d0SCy Schubert 	 *
836206b73d0SCy Schubert 	 * This setting applies only when MACsec is in use, i.e.,
837206b73d0SCy Schubert 	 *  - macsec_policy is enabled
838206b73d0SCy Schubert 	 *  - the key server has decided to enable MACsec
839206b73d0SCy Schubert 	 *
840206b73d0SCy Schubert 	 * 0: Encrypt traffic (default)
841206b73d0SCy Schubert 	 * 1: Integrity only
842206b73d0SCy Schubert 	 */
843206b73d0SCy Schubert 	int macsec_integ_only;
844206b73d0SCy Schubert 
845206b73d0SCy Schubert 	/**
846206b73d0SCy Schubert 	 * macsec_replay_protect - Enable MACsec replay protection
847206b73d0SCy Schubert 	 *
848206b73d0SCy Schubert 	 * This setting applies only when MACsec is in use, i.e.,
849206b73d0SCy Schubert 	 *  - macsec_policy is enabled
850206b73d0SCy Schubert 	 *  - the key server has decided to enable MACsec
851206b73d0SCy Schubert 	 *
852206b73d0SCy Schubert 	 * 0: Replay protection disabled (default)
853206b73d0SCy Schubert 	 * 1: Replay protection enabled
854206b73d0SCy Schubert 	 */
855206b73d0SCy Schubert 	int macsec_replay_protect;
856206b73d0SCy Schubert 
857206b73d0SCy Schubert 	/**
858206b73d0SCy Schubert 	 * macsec_replay_window - MACsec replay protection window
859206b73d0SCy Schubert 	 *
860206b73d0SCy Schubert 	 * A window in which replay is tolerated, to allow receipt of frames
861206b73d0SCy Schubert 	 * that have been misordered by the network.
862206b73d0SCy Schubert 	 *
863206b73d0SCy Schubert 	 * This setting applies only when MACsec replay protection active, i.e.,
864206b73d0SCy Schubert 	 *  - macsec_replay_protect is enabled
865206b73d0SCy Schubert 	 *  - the key server has decided to enable MACsec
866206b73d0SCy Schubert 	 *
867206b73d0SCy Schubert 	 * 0: No replay window, strict check (default)
868206b73d0SCy Schubert 	 * 1..2^32-1: number of packets that could be misordered
869206b73d0SCy Schubert 	 */
870206b73d0SCy Schubert 	u32 macsec_replay_window;
871206b73d0SCy Schubert 
872206b73d0SCy Schubert 	/**
873*a90b9d01SCy Schubert 	 * macsec_offload - Enable MACsec offload
874*a90b9d01SCy Schubert 	 *
875*a90b9d01SCy Schubert 	 * This setting applies only when MACsec is in use, i.e.,
876*a90b9d01SCy Schubert 	 *  - macsec_policy is enabled
877*a90b9d01SCy Schubert 	 *  - the key server has decided to enable MACsec
878*a90b9d01SCy Schubert 	 *
879*a90b9d01SCy Schubert 	 * 0 = MACSEC_OFFLOAD_OFF (default)
880*a90b9d01SCy Schubert 	 * 1 = MACSEC_OFFLOAD_PHY
881*a90b9d01SCy Schubert 	 * 2 = MACSEC_OFFLOAD_MAC
882*a90b9d01SCy Schubert 	 */
883*a90b9d01SCy Schubert 	int macsec_offload;
884*a90b9d01SCy Schubert 
885*a90b9d01SCy Schubert 	/**
886206b73d0SCy Schubert 	 * macsec_port - MACsec port (in SCI)
887206b73d0SCy Schubert 	 *
888206b73d0SCy Schubert 	 * Port component of the SCI.
889206b73d0SCy Schubert 	 *
890206b73d0SCy Schubert 	 * Range: 1-65534 (default: 1)
891206b73d0SCy Schubert 	 */
892206b73d0SCy Schubert 	int macsec_port;
893206b73d0SCy Schubert 
894206b73d0SCy Schubert 	/**
895206b73d0SCy Schubert 	 * mka_priority - Priority of MKA Actor
896206b73d0SCy Schubert 	 *
897206b73d0SCy Schubert 	 * Range: 0-255 (default: 255)
898206b73d0SCy Schubert 	 */
899206b73d0SCy Schubert 	int mka_priority;
900206b73d0SCy Schubert 
901206b73d0SCy Schubert 	/**
902*a90b9d01SCy Schubert 	 * macsec_csindex - Cipher suite index for MACsec
903*a90b9d01SCy Schubert 	 *
904*a90b9d01SCy Schubert 	 * Range: 0-1 (default: 0)
905*a90b9d01SCy Schubert 	 */
906*a90b9d01SCy Schubert 	int macsec_csindex;
907*a90b9d01SCy Schubert 
908*a90b9d01SCy Schubert 	/**
909206b73d0SCy Schubert 	 * mka_ckn - MKA pre-shared CKN
910206b73d0SCy Schubert 	 */
911206b73d0SCy Schubert #define MACSEC_CKN_MAX_LEN 32
912206b73d0SCy Schubert 	size_t mka_ckn_len;
913206b73d0SCy Schubert 	u8 mka_ckn[MACSEC_CKN_MAX_LEN];
914206b73d0SCy Schubert 
915206b73d0SCy Schubert 	/**
916206b73d0SCy Schubert 	 * mka_cak - MKA pre-shared CAK
917206b73d0SCy Schubert 	 */
918206b73d0SCy Schubert #define MACSEC_CAK_MAX_LEN 32
919206b73d0SCy Schubert 	size_t mka_cak_len;
920206b73d0SCy Schubert 	u8 mka_cak[MACSEC_CAK_MAX_LEN];
921206b73d0SCy Schubert 
922206b73d0SCy Schubert #define MKA_PSK_SET_CKN BIT(0)
923206b73d0SCy Schubert #define MKA_PSK_SET_CAK BIT(1)
924206b73d0SCy Schubert #define MKA_PSK_SET (MKA_PSK_SET_CKN | MKA_PSK_SET_CAK)
925206b73d0SCy Schubert 	/**
926206b73d0SCy Schubert 	 * mka_psk_set - Whether mka_ckn and mka_cak are set
927206b73d0SCy Schubert 	 */
928206b73d0SCy Schubert 	u8 mka_psk_set;
929206b73d0SCy Schubert #endif /* CONFIG_MACSEC */
930c1d255d3SCy Schubert 
931c1d255d3SCy Schubert #ifdef CONFIG_PASN
932*a90b9d01SCy Schubert 	/* Whether to allow PASN-UNAUTH */
933*a90b9d01SCy Schubert 	int pasn_noauth;
934*a90b9d01SCy Schubert 
935c1d255d3SCy Schubert #ifdef CONFIG_TESTING_OPTIONS
936c1d255d3SCy Schubert 	/*
937c1d255d3SCy Schubert 	 * Normally, KDK should be derived if and only if both sides support
938c1d255d3SCy Schubert 	 * secure LTF. Allow forcing KDK derivation for testing purposes.
939c1d255d3SCy Schubert 	 */
940c1d255d3SCy Schubert 	int force_kdk_derivation;
941c1d255d3SCy Schubert 
942c1d255d3SCy Schubert 	/* If set, corrupt the MIC in the 2nd Authentication frame of PASN */
943c1d255d3SCy Schubert 	int pasn_corrupt_mic;
944c1d255d3SCy Schubert #endif /* CONFIG_TESTING_OPTIONS */
945c1d255d3SCy Schubert 
946c1d255d3SCy Schubert 	int *pasn_groups;
947c1d255d3SCy Schubert 
948c1d255d3SCy Schubert 	/*
949c1d255d3SCy Schubert 	 * The time in TUs after which the non-AP STA is requested to retry the
950c1d255d3SCy Schubert 	 * PASN authentication in case there are too many parallel operations.
951c1d255d3SCy Schubert 	 */
952c1d255d3SCy Schubert 	u16 pasn_comeback_after;
953c1d255d3SCy Schubert #endif /* CONFIG_PASN */
954c1d255d3SCy Schubert 
955c1d255d3SCy Schubert 	unsigned int unsol_bcast_probe_resp_interval;
956c1d255d3SCy Schubert 
957c1d255d3SCy Schubert 	u8 ext_capa_mask[EXT_CAPA_MAX_LEN];
958c1d255d3SCy Schubert 	u8 ext_capa[EXT_CAPA_MAX_LEN];
9594b72b91aSCy Schubert 
9604b72b91aSCy Schubert 	u8 rnr;
961*a90b9d01SCy Schubert 	char *config_id;
962*a90b9d01SCy Schubert 	bool xrates_supported;
963*a90b9d01SCy Schubert 
964*a90b9d01SCy Schubert 	bool ssid_protection;
965*a90b9d01SCy Schubert 
966*a90b9d01SCy Schubert #ifdef CONFIG_IEEE80211BE
967*a90b9d01SCy Schubert 	/* The AP is part of an AP MLD */
968*a90b9d01SCy Schubert 	u8 mld_ap;
969*a90b9d01SCy Schubert 
970*a90b9d01SCy Schubert 	/* The MLD ID to which the AP MLD is affiliated with */
971*a90b9d01SCy Schubert 	u8 mld_id;
972*a90b9d01SCy Schubert 
973*a90b9d01SCy Schubert 	/* The AP's MLD MAC address within the AP MLD */
974*a90b9d01SCy Schubert 	u8 mld_addr[ETH_ALEN];
975*a90b9d01SCy Schubert 
976*a90b9d01SCy Schubert #ifdef CONFIG_TESTING_OPTIONS
977*a90b9d01SCy Schubert 	/*
978*a90b9d01SCy Schubert 	 * If set indicate the AP as disabled in the RNR element included in the
979*a90b9d01SCy Schubert 	 * other APs in the AP MLD.
980*a90b9d01SCy Schubert 	 */
981*a90b9d01SCy Schubert 	bool mld_indicate_disabled;
982*a90b9d01SCy Schubert #endif /* CONFIG_TESTING_OPTIONS */
983*a90b9d01SCy Schubert #endif /* CONFIG_IEEE80211BE */
984e28a4053SRui Paulo };
985e28a4053SRui Paulo 
98685732ac8SCy Schubert /**
98785732ac8SCy Schubert  * struct he_phy_capabilities_info - HE PHY capabilities
98885732ac8SCy Schubert  */
98985732ac8SCy Schubert struct he_phy_capabilities_info {
990c1d255d3SCy Schubert 	bool he_su_beamformer;
991c1d255d3SCy Schubert 	bool he_su_beamformee;
992c1d255d3SCy Schubert 	bool he_mu_beamformer;
99385732ac8SCy Schubert };
99485732ac8SCy Schubert 
99585732ac8SCy Schubert /**
99685732ac8SCy Schubert  * struct he_operation - HE operation
99785732ac8SCy Schubert  */
99885732ac8SCy Schubert struct he_operation {
99985732ac8SCy Schubert 	u8 he_bss_color;
1000c1d255d3SCy Schubert 	u8 he_bss_color_disabled;
1001c1d255d3SCy Schubert 	u8 he_bss_color_partial;
100285732ac8SCy Schubert 	u8 he_default_pe_duration;
100385732ac8SCy Schubert 	u8 he_twt_required;
1004c1d255d3SCy Schubert 	u8 he_twt_responder;
1005206b73d0SCy Schubert 	u16 he_rts_threshold;
10064b72b91aSCy Schubert 	u8 he_er_su_disable;
1007206b73d0SCy Schubert 	u16 he_basic_mcs_nss_set;
1008206b73d0SCy Schubert };
1009206b73d0SCy Schubert 
1010206b73d0SCy Schubert /**
1011206b73d0SCy Schubert  * struct spatial_reuse - Spatial reuse
1012206b73d0SCy Schubert  */
1013206b73d0SCy Schubert struct spatial_reuse {
1014206b73d0SCy Schubert 	u8 sr_control;
1015206b73d0SCy Schubert 	u8 non_srg_obss_pd_max_offset;
1016206b73d0SCy Schubert 	u8 srg_obss_pd_min_offset;
1017206b73d0SCy Schubert 	u8 srg_obss_pd_max_offset;
1018c1d255d3SCy Schubert 	u8 srg_bss_color_bitmap[8];
1019c1d255d3SCy Schubert 	u8 srg_partial_bssid_bitmap[8];
102085732ac8SCy Schubert };
1021e28a4053SRui Paulo 
1022e28a4053SRui Paulo /**
1023*a90b9d01SCy Schubert  * struct eht_phy_capabilities_info - EHT PHY capabilities
1024*a90b9d01SCy Schubert  */
1025*a90b9d01SCy Schubert struct eht_phy_capabilities_info {
1026*a90b9d01SCy Schubert 	bool su_beamformer;
1027*a90b9d01SCy Schubert 	bool su_beamformee;
1028*a90b9d01SCy Schubert 	bool mu_beamformer;
1029*a90b9d01SCy Schubert };
1030*a90b9d01SCy Schubert 
1031*a90b9d01SCy Schubert /**
1032e28a4053SRui Paulo  * struct hostapd_config - Per-radio interface configuration
1033e28a4053SRui Paulo  */
1034e28a4053SRui Paulo struct hostapd_config {
10355b9c547cSRui Paulo 	struct hostapd_bss_config **bss, *last_bss;
1036e28a4053SRui Paulo 	size_t num_bss;
1037e28a4053SRui Paulo 
1038e28a4053SRui Paulo 	u16 beacon_int;
1039e28a4053SRui Paulo 	int rts_threshold;
1040e28a4053SRui Paulo 	int fragm_threshold;
1041c1d255d3SCy Schubert 	u8 op_class;
1042e28a4053SRui Paulo 	u8 channel;
1043c1d255d3SCy Schubert 	int enable_edmg;
1044c1d255d3SCy Schubert 	u8 edmg_channel;
1045325151a3SRui Paulo 	u8 acs;
1046325151a3SRui Paulo 	struct wpa_freq_range_list acs_ch_list;
1047c1d255d3SCy Schubert 	struct wpa_freq_range_list acs_freq_list;
1048c1d255d3SCy Schubert 	u8 acs_freq_list_present;
104985732ac8SCy Schubert 	int acs_exclude_dfs;
105032a95656SCy Schubert 	u8 min_tx_power;
1051e28a4053SRui Paulo 	enum hostapd_hw_mode hw_mode; /* HOSTAPD_MODE_IEEE80211A, .. */
1052*a90b9d01SCy Schubert 	bool hw_mode_set;
1053c1d255d3SCy Schubert 	int acs_exclude_6ghz_non_psc;
1054*a90b9d01SCy Schubert 	int enable_background_radar;
1055e28a4053SRui Paulo 	enum {
1056e28a4053SRui Paulo 		LONG_PREAMBLE = 0,
1057e28a4053SRui Paulo 		SHORT_PREAMBLE = 1
1058e28a4053SRui Paulo 	} preamble;
1059e28a4053SRui Paulo 
1060e28a4053SRui Paulo 	int *supported_rates;
1061e28a4053SRui Paulo 	int *basic_rates;
106285732ac8SCy Schubert 	unsigned int beacon_rate;
106385732ac8SCy Schubert 	enum beacon_rate_type rate_type;
1064e28a4053SRui Paulo 
1065e28a4053SRui Paulo 	const struct wpa_driver_ops *driver;
10665b9c547cSRui Paulo 	char *driver_params;
1067e28a4053SRui Paulo 
1068e28a4053SRui Paulo 	int ap_table_max_size;
1069e28a4053SRui Paulo 	int ap_table_expiration_time;
1070e28a4053SRui Paulo 
1071325151a3SRui Paulo 	unsigned int track_sta_max_num;
1072325151a3SRui Paulo 	unsigned int track_sta_max_age;
1073325151a3SRui Paulo 
1074e28a4053SRui Paulo 	char country[3]; /* first two octets: country code as described in
1075e28a4053SRui Paulo 			  * ISO/IEC 3166-1. Third octet:
1076e28a4053SRui Paulo 			  * ' ' (ascii 32): all environments
1077e28a4053SRui Paulo 			  * 'O': Outdoor environemnt only
1078e28a4053SRui Paulo 			  * 'I': Indoor environment only
107985732ac8SCy Schubert 			  * 'X': Used with noncountry entity ("XXX")
108085732ac8SCy Schubert 			  * 0x00..0x31: identifying IEEE 802.11 standard
108185732ac8SCy Schubert 			  *	Annex E table (0x04 = global table)
1082e28a4053SRui Paulo 			  */
1083e28a4053SRui Paulo 
1084e28a4053SRui Paulo 	int ieee80211d;
1085e28a4053SRui Paulo 
10865b9c547cSRui Paulo 	int ieee80211h; /* DFS */
10875b9c547cSRui Paulo 
10885b9c547cSRui Paulo 	/*
10895b9c547cSRui Paulo 	 * Local power constraint is an octet encoded as an unsigned integer in
10905b9c547cSRui Paulo 	 * units of decibels. Invalid value -1 indicates that Power Constraint
10915b9c547cSRui Paulo 	 * element will not be added.
10925b9c547cSRui Paulo 	 */
10935b9c547cSRui Paulo 	int local_pwr_constraint;
10945b9c547cSRui Paulo 
10955b9c547cSRui Paulo 	/* Control Spectrum Management bit */
10965b9c547cSRui Paulo 	int spectrum_mgmt_required;
10975b9c547cSRui Paulo 
1098e28a4053SRui Paulo 	struct hostapd_tx_queue_params tx_queue[NUM_TX_QUEUES];
1099e28a4053SRui Paulo 
1100e28a4053SRui Paulo 	/*
1101e28a4053SRui Paulo 	 * WMM AC parameters, in same order as 802.1D, i.e.
1102e28a4053SRui Paulo 	 * 0 = BE (best effort)
1103e28a4053SRui Paulo 	 * 1 = BK (background)
1104e28a4053SRui Paulo 	 * 2 = VI (video)
1105e28a4053SRui Paulo 	 * 3 = VO (voice)
1106e28a4053SRui Paulo 	 */
1107e28a4053SRui Paulo 	struct hostapd_wmm_ac_params wmm_ac_params[4];
1108e28a4053SRui Paulo 
1109e28a4053SRui Paulo 	int ht_op_mode_fixed;
1110e28a4053SRui Paulo 	u16 ht_capab;
1111e28a4053SRui Paulo 	int ieee80211n;
1112e28a4053SRui Paulo 	int secondary_channel;
1113325151a3SRui Paulo 	int no_pri_sec_switch;
1114f05cddf9SRui Paulo 	int require_ht;
11155b9c547cSRui Paulo 	int obss_interval;
1116f05cddf9SRui Paulo 	u32 vht_capab;
1117f05cddf9SRui Paulo 	int ieee80211ac;
1118f05cddf9SRui Paulo 	int require_vht;
1119*a90b9d01SCy Schubert 	enum oper_chan_width vht_oper_chwidth;
1120f05cddf9SRui Paulo 	u8 vht_oper_centr_freq_seg0_idx;
1121f05cddf9SRui Paulo 	u8 vht_oper_centr_freq_seg1_idx;
112285732ac8SCy Schubert 	u8 ht40_plus_minus_allowed;
11235b9c547cSRui Paulo 
1124780fb4a2SCy Schubert 	/* Use driver-generated interface addresses when adding multiple BSSs */
1125780fb4a2SCy Schubert 	u8 use_driver_iface_addr;
1126780fb4a2SCy Schubert 
1127325151a3SRui Paulo #ifdef CONFIG_FST
1128325151a3SRui Paulo 	struct fst_iface_cfg fst_cfg;
1129325151a3SRui Paulo #endif /* CONFIG_FST */
1130325151a3SRui Paulo 
11315b9c547cSRui Paulo #ifdef CONFIG_P2P
11325b9c547cSRui Paulo 	u8 p2p_go_ctwindow;
11335b9c547cSRui Paulo #endif /* CONFIG_P2P */
11345b9c547cSRui Paulo 
11355b9c547cSRui Paulo #ifdef CONFIG_TESTING_OPTIONS
11365b9c547cSRui Paulo 	double ignore_probe_probability;
11375b9c547cSRui Paulo 	double ignore_auth_probability;
11385b9c547cSRui Paulo 	double ignore_assoc_probability;
11395b9c547cSRui Paulo 	double ignore_reassoc_probability;
11405b9c547cSRui Paulo 	double corrupt_gtk_rekey_mic_probability;
1141780fb4a2SCy Schubert 	int ecsa_ie_only;
1142*a90b9d01SCy Schubert 	bool delay_eapol_tx;
11435b9c547cSRui Paulo #endif /* CONFIG_TESTING_OPTIONS */
11445b9c547cSRui Paulo 
11455b9c547cSRui Paulo #ifdef CONFIG_ACS
11465b9c547cSRui Paulo 	unsigned int acs_num_scans;
11475b9c547cSRui Paulo 	struct acs_bias {
11485b9c547cSRui Paulo 		int channel;
11495b9c547cSRui Paulo 		double bias;
11505b9c547cSRui Paulo 	} *acs_chan_bias;
11515b9c547cSRui Paulo 	unsigned int num_acs_chan_bias;
11525b9c547cSRui Paulo #endif /* CONFIG_ACS */
1153780fb4a2SCy Schubert 
1154780fb4a2SCy Schubert 	struct wpabuf *lci;
1155780fb4a2SCy Schubert 	struct wpabuf *civic;
115685732ac8SCy Schubert 	int stationary_ap;
115785732ac8SCy Schubert 
115885732ac8SCy Schubert 	int ieee80211ax;
115985732ac8SCy Schubert #ifdef CONFIG_IEEE80211AX
116085732ac8SCy Schubert 	struct he_phy_capabilities_info he_phy_capab;
116185732ac8SCy Schubert 	struct he_operation he_op;
11624bc52338SCy Schubert 	struct ieee80211_he_mu_edca_parameter_set he_mu_edca;
1163206b73d0SCy Schubert 	struct spatial_reuse spr;
1164*a90b9d01SCy Schubert 	enum oper_chan_width he_oper_chwidth;
1165206b73d0SCy Schubert 	u8 he_oper_centr_freq_seg0_idx;
1166206b73d0SCy Schubert 	u8 he_oper_centr_freq_seg1_idx;
1167c1d255d3SCy Schubert 	u8 he_6ghz_max_mpdu;
1168c1d255d3SCy Schubert 	u8 he_6ghz_max_ampdu_len_exp;
1169c1d255d3SCy Schubert 	u8 he_6ghz_rx_ant_pat;
1170c1d255d3SCy Schubert 	u8 he_6ghz_tx_ant_pat;
1171*a90b9d01SCy Schubert 	u8 he_6ghz_reg_pwr_type;
1172*a90b9d01SCy Schubert 
1173*a90b9d01SCy Schubert 	int reg_def_cli_eirp_psd;
1174*a90b9d01SCy Schubert 	int reg_sub_cli_eirp_psd;
1175*a90b9d01SCy Schubert 
1176*a90b9d01SCy Schubert 	/*
1177*a90b9d01SCy Schubert 	 * This value should be used when regulatory client EIRP PSD values
1178*a90b9d01SCy Schubert 	 * advertised by an AP that is an SP AP or an indoor SP AP are
1179*a90b9d01SCy Schubert 	 * insufficient to ensure that regulatory client limits on total EIRP
1180*a90b9d01SCy Schubert 	 * are always met for all transmission bandwidths within the bandwidth
1181*a90b9d01SCy Schubert 	 * of the AP’s BSS.
1182*a90b9d01SCy Schubert 	 */
1183*a90b9d01SCy Schubert 	int reg_def_cli_eirp;
1184*a90b9d01SCy Schubert 
1185*a90b9d01SCy Schubert 	bool require_he;
118685732ac8SCy Schubert #endif /* CONFIG_IEEE80211AX */
118785732ac8SCy Schubert 
118885732ac8SCy Schubert 	/* VHT enable/disable config from CHAN_SWITCH */
118985732ac8SCy Schubert #define CH_SWITCH_VHT_ENABLED BIT(0)
119085732ac8SCy Schubert #define CH_SWITCH_VHT_DISABLED BIT(1)
119185732ac8SCy Schubert 	unsigned int ch_switch_vht_config;
11924bc52338SCy Schubert 
1193c1d255d3SCy Schubert 	/* HE enable/disable config from CHAN_SWITCH */
1194c1d255d3SCy Schubert #define CH_SWITCH_HE_ENABLED BIT(0)
1195c1d255d3SCy Schubert #define CH_SWITCH_HE_DISABLED BIT(1)
1196c1d255d3SCy Schubert 	unsigned int ch_switch_he_config;
1197c1d255d3SCy Schubert 
11984bc52338SCy Schubert 	int rssi_reject_assoc_rssi;
11994bc52338SCy Schubert 	int rssi_reject_assoc_timeout;
1200c1d255d3SCy Schubert 	int rssi_ignore_probe_request;
1201206b73d0SCy Schubert 
1202206b73d0SCy Schubert #ifdef CONFIG_AIRTIME_POLICY
1203206b73d0SCy Schubert 	enum {
1204206b73d0SCy Schubert 		AIRTIME_MODE_OFF = 0,
1205206b73d0SCy Schubert 		AIRTIME_MODE_STATIC = 1,
1206206b73d0SCy Schubert 		AIRTIME_MODE_DYNAMIC = 2,
1207206b73d0SCy Schubert 		AIRTIME_MODE_LIMIT = 3,
1208206b73d0SCy Schubert 		__AIRTIME_MODE_MAX,
1209206b73d0SCy Schubert 	} airtime_mode;
1210206b73d0SCy Schubert 	unsigned int airtime_update_interval;
1211206b73d0SCy Schubert #define AIRTIME_MODE_MAX (__AIRTIME_MODE_MAX - 1)
1212206b73d0SCy Schubert #endif /* CONFIG_AIRTIME_POLICY */
1213*a90b9d01SCy Schubert 
1214*a90b9d01SCy Schubert 	int ieee80211be;
1215*a90b9d01SCy Schubert #ifdef CONFIG_IEEE80211BE
1216*a90b9d01SCy Schubert 	enum oper_chan_width eht_oper_chwidth;
1217*a90b9d01SCy Schubert 	u8 eht_oper_centr_freq_seg0_idx;
1218*a90b9d01SCy Schubert 	struct eht_phy_capabilities_info eht_phy_capab;
1219*a90b9d01SCy Schubert 	u16 punct_bitmap; /* a bitmap of disabled 20 MHz channels */
1220*a90b9d01SCy Schubert 	u8 punct_acs_threshold;
1221*a90b9d01SCy Schubert 	u8 eht_default_pe_duration;
1222*a90b9d01SCy Schubert 	u8 eht_bw320_offset;
1223*a90b9d01SCy Schubert #endif /* CONFIG_IEEE80211BE */
1224*a90b9d01SCy Schubert 
1225*a90b9d01SCy Schubert 	/* EHT enable/disable config from CHAN_SWITCH */
1226*a90b9d01SCy Schubert #define CH_SWITCH_EHT_ENABLED BIT(0)
1227*a90b9d01SCy Schubert #define CH_SWITCH_EHT_DISABLED BIT(1)
1228*a90b9d01SCy Schubert 	unsigned int ch_switch_eht_config;
1229*a90b9d01SCy Schubert 
1230*a90b9d01SCy Schubert 	enum mbssid {
1231*a90b9d01SCy Schubert 		MBSSID_DISABLED = 0,
1232*a90b9d01SCy Schubert 		MBSSID_ENABLED = 1,
1233*a90b9d01SCy Schubert 		ENHANCED_MBSSID_ENABLED = 2,
1234*a90b9d01SCy Schubert 	} mbssid;
1235*a90b9d01SCy Schubert 
1236*a90b9d01SCy Schubert 	/* Whether to enable TWT responder in HT and VHT modes */
1237*a90b9d01SCy Schubert 	bool ht_vht_twt_responder;
1238e28a4053SRui Paulo };
1239e28a4053SRui Paulo 
1240e28a4053SRui Paulo 
1241*a90b9d01SCy Schubert static inline enum oper_chan_width
hostapd_get_oper_chwidth(struct hostapd_config * conf)1242*a90b9d01SCy Schubert hostapd_get_oper_chwidth(struct hostapd_config *conf)
1243206b73d0SCy Schubert {
1244*a90b9d01SCy Schubert #ifdef CONFIG_IEEE80211BE
1245*a90b9d01SCy Schubert 	if (conf->ieee80211be)
1246*a90b9d01SCy Schubert 		return conf->eht_oper_chwidth;
1247*a90b9d01SCy Schubert #endif /* CONFIG_IEEE80211BE */
1248206b73d0SCy Schubert #ifdef CONFIG_IEEE80211AX
1249206b73d0SCy Schubert 	if (conf->ieee80211ax)
1250206b73d0SCy Schubert 		return conf->he_oper_chwidth;
1251206b73d0SCy Schubert #endif /* CONFIG_IEEE80211AX */
1252206b73d0SCy Schubert 	return conf->vht_oper_chwidth;
1253206b73d0SCy Schubert }
1254206b73d0SCy Schubert 
1255206b73d0SCy Schubert static inline void
hostapd_set_oper_chwidth(struct hostapd_config * conf,enum oper_chan_width oper_chwidth)1256*a90b9d01SCy Schubert hostapd_set_oper_chwidth(struct hostapd_config *conf,
1257*a90b9d01SCy Schubert 			 enum oper_chan_width oper_chwidth)
1258206b73d0SCy Schubert {
1259*a90b9d01SCy Schubert #ifdef CONFIG_IEEE80211BE
1260*a90b9d01SCy Schubert 	if (conf->ieee80211be)
1261*a90b9d01SCy Schubert 		conf->eht_oper_chwidth = oper_chwidth;
1262*a90b9d01SCy Schubert 	if (oper_chwidth == CONF_OPER_CHWIDTH_320MHZ)
1263*a90b9d01SCy Schubert 		oper_chwidth = CONF_OPER_CHWIDTH_160MHZ;
1264*a90b9d01SCy Schubert #endif /* CONFIG_IEEE80211BE */
1265206b73d0SCy Schubert #ifdef CONFIG_IEEE80211AX
1266206b73d0SCy Schubert 	if (conf->ieee80211ax)
1267206b73d0SCy Schubert 		conf->he_oper_chwidth = oper_chwidth;
1268206b73d0SCy Schubert #endif /* CONFIG_IEEE80211AX */
1269206b73d0SCy Schubert 	conf->vht_oper_chwidth = oper_chwidth;
1270206b73d0SCy Schubert }
1271206b73d0SCy Schubert 
1272206b73d0SCy Schubert static inline u8
hostapd_get_oper_centr_freq_seg0_idx(struct hostapd_config * conf)1273206b73d0SCy Schubert hostapd_get_oper_centr_freq_seg0_idx(struct hostapd_config *conf)
1274206b73d0SCy Schubert {
1275*a90b9d01SCy Schubert #ifdef CONFIG_IEEE80211BE
1276*a90b9d01SCy Schubert 	if (conf->ieee80211be)
1277*a90b9d01SCy Schubert 		return conf->eht_oper_centr_freq_seg0_idx;
1278*a90b9d01SCy Schubert #endif /* CONFIG_IEEE80211BE */
1279206b73d0SCy Schubert #ifdef CONFIG_IEEE80211AX
1280206b73d0SCy Schubert 	if (conf->ieee80211ax)
1281206b73d0SCy Schubert 		return conf->he_oper_centr_freq_seg0_idx;
1282206b73d0SCy Schubert #endif /* CONFIG_IEEE80211AX */
1283206b73d0SCy Schubert 	return conf->vht_oper_centr_freq_seg0_idx;
1284206b73d0SCy Schubert }
1285206b73d0SCy Schubert 
1286206b73d0SCy Schubert static inline void
hostapd_set_oper_centr_freq_seg0_idx(struct hostapd_config * conf,u8 oper_centr_freq_seg0_idx)1287206b73d0SCy Schubert hostapd_set_oper_centr_freq_seg0_idx(struct hostapd_config *conf,
1288206b73d0SCy Schubert 				     u8 oper_centr_freq_seg0_idx)
1289206b73d0SCy Schubert {
1290*a90b9d01SCy Schubert #ifdef CONFIG_IEEE80211BE
1291*a90b9d01SCy Schubert 	if (conf->ieee80211be)
1292*a90b9d01SCy Schubert 		conf->eht_oper_centr_freq_seg0_idx = oper_centr_freq_seg0_idx;
1293*a90b9d01SCy Schubert 	if (is_6ghz_op_class(conf->op_class) &&
1294*a90b9d01SCy Schubert 	    center_idx_to_bw_6ghz(oper_centr_freq_seg0_idx) == 4)
1295*a90b9d01SCy Schubert 		oper_centr_freq_seg0_idx +=
1296*a90b9d01SCy Schubert 			conf->channel > oper_centr_freq_seg0_idx ? 16 : -16;
1297*a90b9d01SCy Schubert #endif /* CONFIG_IEEE80211BE */
1298206b73d0SCy Schubert #ifdef CONFIG_IEEE80211AX
1299206b73d0SCy Schubert 	if (conf->ieee80211ax)
1300206b73d0SCy Schubert 		conf->he_oper_centr_freq_seg0_idx = oper_centr_freq_seg0_idx;
1301206b73d0SCy Schubert #endif /* CONFIG_IEEE80211AX */
1302206b73d0SCy Schubert 	conf->vht_oper_centr_freq_seg0_idx = oper_centr_freq_seg0_idx;
1303206b73d0SCy Schubert }
1304206b73d0SCy Schubert 
1305206b73d0SCy Schubert static inline u8
hostapd_get_oper_centr_freq_seg1_idx(struct hostapd_config * conf)1306206b73d0SCy Schubert hostapd_get_oper_centr_freq_seg1_idx(struct hostapd_config *conf)
1307206b73d0SCy Schubert {
1308206b73d0SCy Schubert #ifdef CONFIG_IEEE80211AX
1309206b73d0SCy Schubert 	if (conf->ieee80211ax)
1310206b73d0SCy Schubert 		return conf->he_oper_centr_freq_seg1_idx;
1311206b73d0SCy Schubert #endif /* CONFIG_IEEE80211AX */
1312206b73d0SCy Schubert 	return conf->vht_oper_centr_freq_seg1_idx;
1313206b73d0SCy Schubert }
1314206b73d0SCy Schubert 
1315206b73d0SCy Schubert static inline void
hostapd_set_oper_centr_freq_seg1_idx(struct hostapd_config * conf,u8 oper_centr_freq_seg1_idx)1316206b73d0SCy Schubert hostapd_set_oper_centr_freq_seg1_idx(struct hostapd_config *conf,
1317206b73d0SCy Schubert 				     u8 oper_centr_freq_seg1_idx)
1318206b73d0SCy Schubert {
1319206b73d0SCy Schubert #ifdef CONFIG_IEEE80211AX
1320206b73d0SCy Schubert 	if (conf->ieee80211ax)
1321206b73d0SCy Schubert 		conf->he_oper_centr_freq_seg1_idx = oper_centr_freq_seg1_idx;
1322206b73d0SCy Schubert #endif /* CONFIG_IEEE80211AX */
1323206b73d0SCy Schubert 	conf->vht_oper_centr_freq_seg1_idx = oper_centr_freq_seg1_idx;
1324206b73d0SCy Schubert }
1325206b73d0SCy Schubert 
1326*a90b9d01SCy Schubert static inline u8
hostapd_get_bw320_offset(struct hostapd_config * conf)1327*a90b9d01SCy Schubert hostapd_get_bw320_offset(struct hostapd_config *conf)
1328*a90b9d01SCy Schubert {
1329*a90b9d01SCy Schubert #ifdef CONFIG_IEEE80211BE
1330*a90b9d01SCy Schubert 	if (conf->ieee80211be && is_6ghz_op_class(conf->op_class) &&
1331*a90b9d01SCy Schubert 	    hostapd_get_oper_chwidth(conf) == CONF_OPER_CHWIDTH_320MHZ)
1332*a90b9d01SCy Schubert 		return conf->eht_bw320_offset;
1333*a90b9d01SCy Schubert #endif /* CONFIG_IEEE80211BE */
1334*a90b9d01SCy Schubert 	return 0;
1335*a90b9d01SCy Schubert }
1336*a90b9d01SCy Schubert 
1337*a90b9d01SCy Schubert static inline void
hostapd_set_and_check_bw320_offset(struct hostapd_config * conf,u8 bw320_offset)1338*a90b9d01SCy Schubert hostapd_set_and_check_bw320_offset(struct hostapd_config *conf,
1339*a90b9d01SCy Schubert 				   u8 bw320_offset)
1340*a90b9d01SCy Schubert {
1341*a90b9d01SCy Schubert #ifdef CONFIG_IEEE80211BE
1342*a90b9d01SCy Schubert 	if (conf->ieee80211be && is_6ghz_op_class(conf->op_class) &&
1343*a90b9d01SCy Schubert 	    op_class_to_ch_width(conf->op_class) == CONF_OPER_CHWIDTH_320MHZ) {
1344*a90b9d01SCy Schubert 		if (conf->channel) {
1345*a90b9d01SCy Schubert 			/* If the channel is set, then calculate bw320_offset
1346*a90b9d01SCy Schubert 			 * by center frequency segment 0.
1347*a90b9d01SCy Schubert 			 */
1348*a90b9d01SCy Schubert 			u8 seg0 = hostapd_get_oper_centr_freq_seg0_idx(conf);
1349*a90b9d01SCy Schubert 
1350*a90b9d01SCy Schubert 			conf->eht_bw320_offset = (seg0 - 31) % 64 ? 2 : 1;
1351*a90b9d01SCy Schubert 		} else {
1352*a90b9d01SCy Schubert 			/* If the channel is not set, bw320_offset indicates
1353*a90b9d01SCy Schubert 			 * preferred offset of 320 MHz.
1354*a90b9d01SCy Schubert 			 */
1355*a90b9d01SCy Schubert 			conf->eht_bw320_offset = bw320_offset;
1356*a90b9d01SCy Schubert 		}
1357*a90b9d01SCy Schubert 	} else {
1358*a90b9d01SCy Schubert 		conf->eht_bw320_offset = 0;
1359*a90b9d01SCy Schubert 	}
1360*a90b9d01SCy Schubert #endif /* CONFIG_IEEE80211BE */
1361*a90b9d01SCy Schubert }
1362*a90b9d01SCy Schubert 
1363206b73d0SCy Schubert 
1364e28a4053SRui Paulo int hostapd_mac_comp(const void *a, const void *b);
1365e28a4053SRui Paulo struct hostapd_config * hostapd_config_defaults(void);
1366e28a4053SRui Paulo void hostapd_config_defaults_bss(struct hostapd_bss_config *bss);
1367206b73d0SCy Schubert void hostapd_config_free_radius_attr(struct hostapd_radius_attr *attr);
13685b9c547cSRui Paulo void hostapd_config_free_eap_user(struct hostapd_eap_user *user);
136985732ac8SCy Schubert void hostapd_config_free_eap_users(struct hostapd_eap_user *user);
13705b9c547cSRui Paulo void hostapd_config_clear_wpa_psk(struct hostapd_wpa_psk **p);
1371*a90b9d01SCy Schubert void hostapd_config_clear_rxkhs(struct hostapd_bss_config *conf);
13725b9c547cSRui Paulo void hostapd_config_free_bss(struct hostapd_bss_config *conf);
1373e28a4053SRui Paulo void hostapd_config_free(struct hostapd_config *conf);
1374e28a4053SRui Paulo int hostapd_maclist_found(struct mac_acl_entry *list, int num_entries,
1375780fb4a2SCy Schubert 			  const u8 *addr, struct vlan_description *vlan_id);
1376e28a4053SRui Paulo int hostapd_rate_found(int *list, int rate);
1377e28a4053SRui Paulo const u8 * hostapd_get_psk(const struct hostapd_bss_config *conf,
13785b9c547cSRui Paulo 			   const u8 *addr, const u8 *p2p_dev_addr,
13794bc52338SCy Schubert 			   const u8 *prev_psk, int *vlan_id);
1380e28a4053SRui Paulo int hostapd_setup_wpa_psk(struct hostapd_bss_config *conf);
1381780fb4a2SCy Schubert int hostapd_vlan_valid(struct hostapd_vlan *vlan,
1382780fb4a2SCy Schubert 		       struct vlan_description *vlan_desc);
1383e28a4053SRui Paulo const char * hostapd_get_vlan_id_ifname(struct hostapd_vlan *vlan,
1384e28a4053SRui Paulo 					int vlan_id);
1385f05cddf9SRui Paulo struct hostapd_radius_attr *
1386f05cddf9SRui Paulo hostapd_config_get_radius_attr(struct hostapd_radius_attr *attr, u8 type);
1387206b73d0SCy Schubert struct hostapd_radius_attr * hostapd_parse_radius_attr(const char *value);
13885b9c547cSRui Paulo int hostapd_config_check(struct hostapd_config *conf, int full_config);
13895b9c547cSRui Paulo void hostapd_set_security_params(struct hostapd_bss_config *bss,
13905b9c547cSRui Paulo 				 int full_config);
13914bc52338SCy Schubert int hostapd_sae_pw_id_in_use(struct hostapd_bss_config *conf);
1392c1d255d3SCy Schubert bool hostapd_sae_pk_in_use(struct hostapd_bss_config *conf);
1393c1d255d3SCy Schubert bool hostapd_sae_pk_exclusively(struct hostapd_bss_config *conf);
1394c1d255d3SCy Schubert int hostapd_setup_sae_pt(struct hostapd_bss_config *conf);
1395*a90b9d01SCy Schubert int hostapd_acl_comp(const void *a, const void *b);
1396*a90b9d01SCy Schubert int hostapd_add_acl_maclist(struct mac_acl_entry **acl, int *num,
1397*a90b9d01SCy Schubert 			    int vlan_id, const u8 *addr);
1398*a90b9d01SCy Schubert void hostapd_remove_acl_mac(struct mac_acl_entry **acl, int *num,
1399*a90b9d01SCy Schubert 			    const u8 *addr);
1400e28a4053SRui Paulo 
1401e28a4053SRui Paulo #endif /* HOSTAPD_CONFIG_H */
1402