1e28a4053SRui Paulo /* 2e28a4053SRui Paulo * hostapd / Configuration definitions and helpers functions 3325151a3SRui Paulo * Copyright (c) 2003-2015, 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" 18*206b73d0SCy Schubert #include "crypto/sha256.h" 19f05cddf9SRui Paulo #include "wps/wps.h" 20325151a3SRui Paulo #include "fst/fst.h" 21780fb4a2SCy Schubert #include "vlan.h" 22e28a4053SRui Paulo 235b9c547cSRui Paulo /** 245b9c547cSRui Paulo * mesh_conf - local MBSS state and settings 255b9c547cSRui Paulo */ 265b9c547cSRui Paulo struct mesh_conf { 275b9c547cSRui Paulo u8 meshid[32]; 285b9c547cSRui Paulo u8 meshid_len; 295b9c547cSRui Paulo /* Active Path Selection Protocol Identifier */ 305b9c547cSRui Paulo u8 mesh_pp_id; 315b9c547cSRui Paulo /* Active Path Selection Metric Identifier */ 325b9c547cSRui Paulo u8 mesh_pm_id; 335b9c547cSRui Paulo /* Congestion Control Mode Identifier */ 345b9c547cSRui Paulo u8 mesh_cc_id; 355b9c547cSRui Paulo /* Synchronization Protocol Identifier */ 365b9c547cSRui Paulo u8 mesh_sp_id; 375b9c547cSRui Paulo /* Authentication Protocol Identifier */ 385b9c547cSRui Paulo u8 mesh_auth_id; 39325151a3SRui Paulo u8 *rsn_ie; 40325151a3SRui Paulo int rsn_ie_len; 415b9c547cSRui Paulo #define MESH_CONF_SEC_NONE BIT(0) 425b9c547cSRui Paulo #define MESH_CONF_SEC_AUTH BIT(1) 435b9c547cSRui Paulo #define MESH_CONF_SEC_AMPE BIT(2) 445b9c547cSRui Paulo unsigned int security; 45780fb4a2SCy Schubert enum mfp_options ieee80211w; 464bc52338SCy Schubert int ocv; 47780fb4a2SCy Schubert unsigned int pairwise_cipher; 48780fb4a2SCy Schubert unsigned int group_cipher; 49780fb4a2SCy Schubert unsigned int mgmt_group_cipher; 505b9c547cSRui Paulo int dot11MeshMaxRetries; 515b9c547cSRui Paulo int dot11MeshRetryTimeout; /* msec */ 525b9c547cSRui Paulo int dot11MeshConfirmTimeout; /* msec */ 535b9c547cSRui Paulo int dot11MeshHoldingTimeout; /* msec */ 545b9c547cSRui Paulo }; 555b9c547cSRui Paulo 56e28a4053SRui Paulo #define MAX_STA_COUNT 2007 57e28a4053SRui Paulo #define MAX_VLAN_ID 4094 58e28a4053SRui Paulo 59e28a4053SRui Paulo typedef u8 macaddr[ETH_ALEN]; 60e28a4053SRui Paulo 61e28a4053SRui Paulo struct mac_acl_entry { 62e28a4053SRui Paulo macaddr addr; 63780fb4a2SCy Schubert struct vlan_description vlan_id; 64e28a4053SRui Paulo }; 65e28a4053SRui Paulo 66e28a4053SRui Paulo struct hostapd_radius_servers; 67e28a4053SRui Paulo struct ft_remote_r0kh; 68e28a4053SRui Paulo struct ft_remote_r1kh; 69e28a4053SRui Paulo 70e28a4053SRui Paulo #define NUM_WEP_KEYS 4 71e28a4053SRui Paulo struct hostapd_wep_keys { 72e28a4053SRui Paulo u8 idx; 73e28a4053SRui Paulo u8 *key[NUM_WEP_KEYS]; 74e28a4053SRui Paulo size_t len[NUM_WEP_KEYS]; 75e28a4053SRui Paulo int keys_set; 76e28a4053SRui Paulo size_t default_len; /* key length used for dynamic key generation */ 77e28a4053SRui Paulo }; 78e28a4053SRui Paulo 79e28a4053SRui Paulo typedef enum hostap_security_policy { 80e28a4053SRui Paulo SECURITY_PLAINTEXT = 0, 81e28a4053SRui Paulo SECURITY_STATIC_WEP = 1, 82e28a4053SRui Paulo SECURITY_IEEE_802_1X = 2, 83e28a4053SRui Paulo SECURITY_WPA_PSK = 3, 845b9c547cSRui Paulo SECURITY_WPA = 4, 855b9c547cSRui Paulo SECURITY_OSEN = 5 86e28a4053SRui Paulo } secpolicy; 87e28a4053SRui Paulo 88e28a4053SRui Paulo struct hostapd_ssid { 89325151a3SRui Paulo u8 ssid[SSID_MAX_LEN]; 90e28a4053SRui Paulo size_t ssid_len; 91f05cddf9SRui Paulo unsigned int ssid_set:1; 92f05cddf9SRui Paulo unsigned int utf8_ssid:1; 935b9c547cSRui Paulo unsigned int wpa_passphrase_set:1; 945b9c547cSRui Paulo unsigned int wpa_psk_set:1; 95e28a4053SRui Paulo 96e28a4053SRui Paulo char vlan[IFNAMSIZ + 1]; 97e28a4053SRui Paulo secpolicy security_policy; 98e28a4053SRui Paulo 99e28a4053SRui Paulo struct hostapd_wpa_psk *wpa_psk; 100e28a4053SRui Paulo char *wpa_passphrase; 101e28a4053SRui Paulo char *wpa_psk_file; 102e28a4053SRui Paulo 103e28a4053SRui Paulo struct hostapd_wep_keys wep; 104e28a4053SRui Paulo 105e28a4053SRui Paulo #define DYNAMIC_VLAN_DISABLED 0 106e28a4053SRui Paulo #define DYNAMIC_VLAN_OPTIONAL 1 107e28a4053SRui Paulo #define DYNAMIC_VLAN_REQUIRED 2 108e28a4053SRui Paulo int dynamic_vlan; 109f05cddf9SRui Paulo #define DYNAMIC_VLAN_NAMING_WITHOUT_DEVICE 0 110f05cddf9SRui Paulo #define DYNAMIC_VLAN_NAMING_WITH_DEVICE 1 111f05cddf9SRui Paulo #define DYNAMIC_VLAN_NAMING_END 2 112f05cddf9SRui Paulo int vlan_naming; 113780fb4a2SCy Schubert int per_sta_vif; 114e28a4053SRui Paulo #ifdef CONFIG_FULL_DYNAMIC_VLAN 115e28a4053SRui Paulo char *vlan_tagged_interface; 116e28a4053SRui Paulo #endif /* CONFIG_FULL_DYNAMIC_VLAN */ 117e28a4053SRui Paulo }; 118e28a4053SRui Paulo 119e28a4053SRui Paulo 120e28a4053SRui Paulo #define VLAN_ID_WILDCARD -1 121e28a4053SRui Paulo 122e28a4053SRui Paulo struct hostapd_vlan { 123e28a4053SRui Paulo struct hostapd_vlan *next; 124e28a4053SRui Paulo int vlan_id; /* VLAN ID or -1 (VLAN_ID_WILDCARD) for wildcard entry */ 125780fb4a2SCy Schubert struct vlan_description vlan_desc; 126e28a4053SRui Paulo char ifname[IFNAMSIZ + 1]; 1274bc52338SCy Schubert char bridge[IFNAMSIZ + 1]; 128325151a3SRui Paulo int configured; 129e28a4053SRui Paulo int dynamic_vlan; 130e28a4053SRui Paulo #ifdef CONFIG_FULL_DYNAMIC_VLAN 131e28a4053SRui Paulo 132e28a4053SRui Paulo #define DVLAN_CLEAN_WLAN_PORT 0x8 133e28a4053SRui Paulo int clean; 134e28a4053SRui Paulo #endif /* CONFIG_FULL_DYNAMIC_VLAN */ 135e28a4053SRui Paulo }; 136e28a4053SRui Paulo 137e28a4053SRui Paulo #define PMK_LEN 32 1384bc52338SCy Schubert #define KEYID_LEN 32 139780fb4a2SCy Schubert #define MIN_PASSPHRASE_LEN 8 140780fb4a2SCy Schubert #define MAX_PASSPHRASE_LEN 63 141f05cddf9SRui Paulo struct hostapd_sta_wpa_psk_short { 142f05cddf9SRui Paulo struct hostapd_sta_wpa_psk_short *next; 143780fb4a2SCy Schubert unsigned int is_passphrase:1; 144f05cddf9SRui Paulo u8 psk[PMK_LEN]; 145780fb4a2SCy Schubert char passphrase[MAX_PASSPHRASE_LEN + 1]; 146780fb4a2SCy Schubert int ref; /* (number of references held) - 1 */ 147f05cddf9SRui Paulo }; 148f05cddf9SRui Paulo 149e28a4053SRui Paulo struct hostapd_wpa_psk { 150e28a4053SRui Paulo struct hostapd_wpa_psk *next; 151e28a4053SRui Paulo int group; 1524bc52338SCy Schubert char keyid[KEYID_LEN]; 153e28a4053SRui Paulo u8 psk[PMK_LEN]; 154e28a4053SRui Paulo u8 addr[ETH_ALEN]; 1555b9c547cSRui Paulo u8 p2p_dev_addr[ETH_ALEN]; 1564bc52338SCy Schubert int vlan_id; 157e28a4053SRui Paulo }; 158e28a4053SRui Paulo 159e28a4053SRui Paulo struct hostapd_eap_user { 160e28a4053SRui Paulo struct hostapd_eap_user *next; 161e28a4053SRui Paulo u8 *identity; 162e28a4053SRui Paulo size_t identity_len; 163e28a4053SRui Paulo struct { 164e28a4053SRui Paulo int vendor; 165e28a4053SRui Paulo u32 method; 166f05cddf9SRui Paulo } methods[EAP_MAX_METHODS]; 167e28a4053SRui Paulo u8 *password; 168e28a4053SRui Paulo size_t password_len; 16985732ac8SCy Schubert u8 *salt; 17085732ac8SCy Schubert size_t salt_len; /* non-zero when password is salted */ 171e28a4053SRui Paulo int phase2; 172e28a4053SRui Paulo int force_version; 173e28a4053SRui Paulo unsigned int wildcard_prefix:1; 174e28a4053SRui Paulo unsigned int password_hash:1; /* whether password is hashed with 175e28a4053SRui Paulo * nt_password_hash() */ 1765b9c547cSRui Paulo unsigned int remediation:1; 1775b9c547cSRui Paulo unsigned int macacl:1; 178e28a4053SRui Paulo int ttls_auth; /* EAP_TTLS_AUTH_* bitfield */ 1795b9c547cSRui Paulo struct hostapd_radius_attr *accept_attr; 18085732ac8SCy Schubert u32 t_c_timestamp; 181e28a4053SRui Paulo }; 182e28a4053SRui Paulo 183f05cddf9SRui Paulo struct hostapd_radius_attr { 184f05cddf9SRui Paulo u8 type; 185f05cddf9SRui Paulo struct wpabuf *val; 186f05cddf9SRui Paulo struct hostapd_radius_attr *next; 187f05cddf9SRui Paulo }; 188e28a4053SRui Paulo 189f05cddf9SRui Paulo 190f05cddf9SRui Paulo #define NUM_TX_QUEUES 4 191e28a4053SRui Paulo 192e28a4053SRui Paulo struct hostapd_tx_queue_params { 193e28a4053SRui Paulo int aifs; 194e28a4053SRui Paulo int cwmin; 195e28a4053SRui Paulo int cwmax; 196e28a4053SRui Paulo int burst; /* maximum burst time in 0.1 ms, i.e., 10 = 1 ms */ 197e28a4053SRui Paulo }; 198e28a4053SRui Paulo 199f05cddf9SRui Paulo 200f05cddf9SRui Paulo #define MAX_ROAMING_CONSORTIUM_LEN 15 201f05cddf9SRui Paulo 202f05cddf9SRui Paulo struct hostapd_roaming_consortium { 203f05cddf9SRui Paulo u8 len; 204f05cddf9SRui Paulo u8 oi[MAX_ROAMING_CONSORTIUM_LEN]; 205e28a4053SRui Paulo }; 206e28a4053SRui Paulo 207f05cddf9SRui Paulo struct hostapd_lang_string { 208f05cddf9SRui Paulo u8 lang[3]; 209f05cddf9SRui Paulo u8 name_len; 210f05cddf9SRui Paulo u8 name[252]; 211f05cddf9SRui Paulo }; 212f05cddf9SRui Paulo 21385732ac8SCy Schubert struct hostapd_venue_url { 21485732ac8SCy Schubert u8 venue_number; 21585732ac8SCy Schubert u8 url_len; 21685732ac8SCy Schubert u8 url[254]; 21785732ac8SCy Schubert }; 21885732ac8SCy Schubert 219f05cddf9SRui Paulo #define MAX_NAI_REALMS 10 220f05cddf9SRui Paulo #define MAX_NAI_REALMLEN 255 221f05cddf9SRui Paulo #define MAX_NAI_EAP_METHODS 5 222f05cddf9SRui Paulo #define MAX_NAI_AUTH_TYPES 4 223f05cddf9SRui Paulo struct hostapd_nai_realm_data { 224f05cddf9SRui Paulo u8 encoding; 225f05cddf9SRui Paulo char realm_buf[MAX_NAI_REALMLEN + 1]; 226f05cddf9SRui Paulo char *realm[MAX_NAI_REALMS]; 227f05cddf9SRui Paulo u8 eap_method_count; 228f05cddf9SRui Paulo struct hostapd_nai_realm_eap { 229f05cddf9SRui Paulo u8 eap_method; 230f05cddf9SRui Paulo u8 num_auths; 231f05cddf9SRui Paulo u8 auth_id[MAX_NAI_AUTH_TYPES]; 232f05cddf9SRui Paulo u8 auth_val[MAX_NAI_AUTH_TYPES]; 233f05cddf9SRui Paulo } eap_method[MAX_NAI_EAP_METHODS]; 234f05cddf9SRui Paulo }; 235e28a4053SRui Paulo 236780fb4a2SCy Schubert struct anqp_element { 237780fb4a2SCy Schubert struct dl_list list; 238780fb4a2SCy Schubert u16 infoid; 239780fb4a2SCy Schubert struct wpabuf *payload; 240780fb4a2SCy Schubert }; 241780fb4a2SCy Schubert 24285732ac8SCy Schubert struct fils_realm { 24385732ac8SCy Schubert struct dl_list list; 24485732ac8SCy Schubert u8 hash[2]; 24585732ac8SCy Schubert char realm[]; 24685732ac8SCy Schubert }; 24785732ac8SCy Schubert 24885732ac8SCy Schubert struct sae_password_entry { 24985732ac8SCy Schubert struct sae_password_entry *next; 25085732ac8SCy Schubert char *password; 25185732ac8SCy Schubert char *identifier; 25285732ac8SCy Schubert u8 peer_addr[ETH_ALEN]; 2534bc52338SCy Schubert int vlan_id; 25485732ac8SCy Schubert }; 255780fb4a2SCy Schubert 256*206b73d0SCy Schubert struct dpp_controller_conf { 257*206b73d0SCy Schubert struct dpp_controller_conf *next; 258*206b73d0SCy Schubert u8 pkhash[SHA256_MAC_LEN]; 259*206b73d0SCy Schubert struct hostapd_ip_addr ipaddr; 260*206b73d0SCy Schubert }; 261*206b73d0SCy Schubert 262*206b73d0SCy Schubert struct airtime_sta_weight { 263*206b73d0SCy Schubert struct airtime_sta_weight *next; 264*206b73d0SCy Schubert unsigned int weight; 265*206b73d0SCy Schubert u8 addr[ETH_ALEN]; 266*206b73d0SCy Schubert }; 267*206b73d0SCy Schubert 268e28a4053SRui Paulo /** 269e28a4053SRui Paulo * struct hostapd_bss_config - Per-BSS configuration 270e28a4053SRui Paulo */ 271e28a4053SRui Paulo struct hostapd_bss_config { 272e28a4053SRui Paulo char iface[IFNAMSIZ + 1]; 273e28a4053SRui Paulo char bridge[IFNAMSIZ + 1]; 2745b9c547cSRui Paulo char vlan_bridge[IFNAMSIZ + 1]; 275f05cddf9SRui Paulo char wds_bridge[IFNAMSIZ + 1]; 276e28a4053SRui Paulo 277e28a4053SRui Paulo enum hostapd_logger_level logger_syslog_level, logger_stdout_level; 278e28a4053SRui Paulo 279e28a4053SRui Paulo unsigned int logger_syslog; /* module bitfield */ 280e28a4053SRui Paulo unsigned int logger_stdout; /* module bitfield */ 281e28a4053SRui Paulo 282e28a4053SRui Paulo int max_num_sta; /* maximum number of STAs in station table */ 283e28a4053SRui Paulo 284e28a4053SRui Paulo int dtim_period; 28585732ac8SCy Schubert unsigned int bss_load_update_period; 28685732ac8SCy Schubert unsigned int chan_util_avg_period; 287e28a4053SRui Paulo 288e28a4053SRui Paulo int ieee802_1x; /* use IEEE 802.1X */ 289e28a4053SRui Paulo int eapol_version; 290e28a4053SRui Paulo int eap_server; /* Use internal EAP server instead of external 291e28a4053SRui Paulo * RADIUS server */ 292e28a4053SRui Paulo struct hostapd_eap_user *eap_user; 293f05cddf9SRui Paulo char *eap_user_sqlite; 294e28a4053SRui Paulo char *eap_sim_db; 295780fb4a2SCy Schubert unsigned int eap_sim_db_timeout; 2965b9c547cSRui Paulo int eap_server_erp; /* Whether ERP is enabled on internal EAP server */ 297e28a4053SRui Paulo struct hostapd_ip_addr own_ip_addr; 298e28a4053SRui Paulo char *nas_identifier; 299e28a4053SRui Paulo struct hostapd_radius_servers *radius; 300e28a4053SRui Paulo int acct_interim_interval; 301f05cddf9SRui Paulo int radius_request_cui; 302f05cddf9SRui Paulo struct hostapd_radius_attr *radius_auth_req_attr; 303f05cddf9SRui Paulo struct hostapd_radius_attr *radius_acct_req_attr; 304*206b73d0SCy Schubert char *radius_req_attr_sqlite; 305f05cddf9SRui Paulo int radius_das_port; 306f05cddf9SRui Paulo unsigned int radius_das_time_window; 307f05cddf9SRui Paulo int radius_das_require_event_timestamp; 308780fb4a2SCy Schubert int radius_das_require_message_authenticator; 309f05cddf9SRui Paulo struct hostapd_ip_addr radius_das_client_addr; 310f05cddf9SRui Paulo u8 *radius_das_shared_secret; 311f05cddf9SRui Paulo size_t radius_das_shared_secret_len; 312e28a4053SRui Paulo 313e28a4053SRui Paulo struct hostapd_ssid ssid; 314e28a4053SRui Paulo 315e28a4053SRui Paulo char *eap_req_id_text; /* optional displayable message sent with 316e28a4053SRui Paulo * EAP Request-Identity */ 317e28a4053SRui Paulo size_t eap_req_id_text_len; 318e28a4053SRui Paulo int eapol_key_index_workaround; 319e28a4053SRui Paulo 320e28a4053SRui Paulo size_t default_wep_key_len; 321e28a4053SRui Paulo int individual_wep_key_len; 322e28a4053SRui Paulo int wep_rekeying_period; 323e28a4053SRui Paulo int broadcast_key_idx_min, broadcast_key_idx_max; 324e28a4053SRui Paulo int eap_reauth_period; 3255b9c547cSRui Paulo int erp_send_reauth_start; 3265b9c547cSRui Paulo char *erp_domain; 327e28a4053SRui Paulo 328e28a4053SRui Paulo int ieee802_11f; /* use IEEE 802.11f (IAPP) */ 329e28a4053SRui Paulo char iapp_iface[IFNAMSIZ + 1]; /* interface used with IAPP broadcast 330e28a4053SRui Paulo * frames */ 331e28a4053SRui Paulo 33285732ac8SCy Schubert enum macaddr_acl { 333e28a4053SRui Paulo ACCEPT_UNLESS_DENIED = 0, 334e28a4053SRui Paulo DENY_UNLESS_ACCEPTED = 1, 335e28a4053SRui Paulo USE_EXTERNAL_RADIUS_AUTH = 2 336e28a4053SRui Paulo } macaddr_acl; 337e28a4053SRui Paulo struct mac_acl_entry *accept_mac; 338e28a4053SRui Paulo int num_accept_mac; 339e28a4053SRui Paulo struct mac_acl_entry *deny_mac; 340e28a4053SRui Paulo int num_deny_mac; 341e28a4053SRui Paulo int wds_sta; 342f05cddf9SRui Paulo int isolate; 3435b9c547cSRui Paulo int start_disabled; 344e28a4053SRui Paulo 345e28a4053SRui Paulo int auth_algs; /* bitfield of allowed IEEE 802.11 authentication 346e28a4053SRui Paulo * algorithms, WPA_AUTH_ALG_{OPEN,SHARED,LEAP} */ 347e28a4053SRui Paulo 348e28a4053SRui Paulo int wpa; /* bitfield of WPA_PROTO_WPA, WPA_PROTO_RSN */ 349e28a4053SRui Paulo int wpa_key_mgmt; 350e28a4053SRui Paulo #ifdef CONFIG_IEEE80211W 351e28a4053SRui Paulo enum mfp_options ieee80211w; 3525b9c547cSRui Paulo int group_mgmt_cipher; 353e28a4053SRui Paulo /* dot11AssociationSAQueryMaximumTimeout (in TUs) */ 354e28a4053SRui Paulo unsigned int assoc_sa_query_max_timeout; 355e28a4053SRui Paulo /* dot11AssociationSAQueryRetryTimeout (in TUs) */ 356e28a4053SRui Paulo int assoc_sa_query_retry_timeout; 357e28a4053SRui Paulo #endif /* CONFIG_IEEE80211W */ 3584bc52338SCy Schubert #ifdef CONFIG_OCV 3594bc52338SCy Schubert int ocv; /* Operating Channel Validation */ 3604bc52338SCy Schubert #endif /* CONFIG_OCV */ 361f05cddf9SRui Paulo enum { 362f05cddf9SRui Paulo PSK_RADIUS_IGNORED = 0, 363f05cddf9SRui Paulo PSK_RADIUS_ACCEPTED = 1, 364f05cddf9SRui Paulo PSK_RADIUS_REQUIRED = 2 365f05cddf9SRui Paulo } wpa_psk_radius; 366e28a4053SRui Paulo int wpa_pairwise; 36785732ac8SCy Schubert int group_cipher; /* wpa_group value override from configuation */ 368e28a4053SRui Paulo int wpa_group; 369e28a4053SRui Paulo int wpa_group_rekey; 37085732ac8SCy Schubert int wpa_group_rekey_set; 371e28a4053SRui Paulo int wpa_strict_rekey; 372e28a4053SRui Paulo int wpa_gmk_rekey; 373e28a4053SRui Paulo int wpa_ptk_rekey; 37485732ac8SCy Schubert u32 wpa_group_update_count; 37585732ac8SCy Schubert u32 wpa_pairwise_update_count; 37685732ac8SCy Schubert int wpa_disable_eapol_key_retries; 377e28a4053SRui Paulo int rsn_pairwise; 378e28a4053SRui Paulo int rsn_preauth; 379e28a4053SRui Paulo char *rsn_preauth_interfaces; 380e28a4053SRui Paulo 38185732ac8SCy Schubert #ifdef CONFIG_IEEE80211R_AP 382e28a4053SRui Paulo /* IEEE 802.11r - Fast BSS Transition */ 383e28a4053SRui Paulo u8 mobility_domain[MOBILITY_DOMAIN_ID_LEN]; 384e28a4053SRui Paulo u8 r1_key_holder[FT_R1KH_ID_LEN]; 38585732ac8SCy Schubert u32 r0_key_lifetime; /* PMK-R0 lifetime seconds */ 38685732ac8SCy Schubert int rkh_pos_timeout; 38785732ac8SCy Schubert int rkh_neg_timeout; 38885732ac8SCy Schubert int rkh_pull_timeout; /* ms */ 38985732ac8SCy Schubert int rkh_pull_retries; 390e28a4053SRui Paulo u32 reassociation_deadline; 391e28a4053SRui Paulo struct ft_remote_r0kh *r0kh_list; 392e28a4053SRui Paulo struct ft_remote_r1kh *r1kh_list; 393e28a4053SRui Paulo int pmk_r1_push; 394f05cddf9SRui Paulo int ft_over_ds; 39585732ac8SCy Schubert int ft_psk_generate_local; 39685732ac8SCy Schubert int r1_max_key_lifetime; 39785732ac8SCy Schubert #endif /* CONFIG_IEEE80211R_AP */ 398e28a4053SRui Paulo 399e28a4053SRui Paulo char *ctrl_interface; /* directory for UNIX domain sockets */ 400e28a4053SRui Paulo #ifndef CONFIG_NATIVE_WINDOWS 401e28a4053SRui Paulo gid_t ctrl_interface_gid; 402e28a4053SRui Paulo #endif /* CONFIG_NATIVE_WINDOWS */ 403e28a4053SRui Paulo int ctrl_interface_gid_set; 404e28a4053SRui Paulo 405e28a4053SRui Paulo char *ca_cert; 406e28a4053SRui Paulo char *server_cert; 407*206b73d0SCy Schubert char *server_cert2; 408e28a4053SRui Paulo char *private_key; 409*206b73d0SCy Schubert char *private_key2; 410e28a4053SRui Paulo char *private_key_passwd; 411*206b73d0SCy Schubert char *private_key_passwd2; 4124bc52338SCy Schubert char *check_cert_subject; 413e28a4053SRui Paulo int check_crl; 4144bc52338SCy Schubert int check_crl_strict; 4154bc52338SCy Schubert unsigned int crl_reload_interval; 416325151a3SRui Paulo unsigned int tls_session_lifetime; 41785732ac8SCy Schubert unsigned int tls_flags; 4185b9c547cSRui Paulo char *ocsp_stapling_response; 419780fb4a2SCy Schubert char *ocsp_stapling_response_multi; 420e28a4053SRui Paulo char *dh_file; 4215b9c547cSRui Paulo char *openssl_ciphers; 4224bc52338SCy Schubert char *openssl_ecdh_curves; 423e28a4053SRui Paulo u8 *pac_opaque_encr_key; 424e28a4053SRui Paulo u8 *eap_fast_a_id; 425e28a4053SRui Paulo size_t eap_fast_a_id_len; 426e28a4053SRui Paulo char *eap_fast_a_id_info; 427e28a4053SRui Paulo int eap_fast_prov; 428e28a4053SRui Paulo int pac_key_lifetime; 429e28a4053SRui Paulo int pac_key_refresh_time; 430*206b73d0SCy Schubert int eap_teap_auth; 431*206b73d0SCy Schubert int eap_teap_pac_no_inner; 432e28a4053SRui Paulo int eap_sim_aka_result_ind; 433*206b73d0SCy Schubert int eap_sim_id; 434e28a4053SRui Paulo int tnc; 435f05cddf9SRui Paulo int fragment_size; 436f05cddf9SRui Paulo u16 pwd_group; 437e28a4053SRui Paulo 438e28a4053SRui Paulo char *radius_server_clients; 439e28a4053SRui Paulo int radius_server_auth_port; 4405b9c547cSRui Paulo int radius_server_acct_port; 441e28a4053SRui Paulo int radius_server_ipv6; 442e28a4053SRui Paulo 443e28a4053SRui Paulo int use_pae_group_addr; /* Whether to send EAPOL frames to PAE group 444e28a4053SRui Paulo * address instead of individual address 445e28a4053SRui Paulo * (for driver_wired.c). 446e28a4053SRui Paulo */ 447e28a4053SRui Paulo 448e28a4053SRui Paulo int ap_max_inactivity; 449e28a4053SRui Paulo int ignore_broadcast_ssid; 450780fb4a2SCy Schubert int no_probe_resp_if_max_sta; 451e28a4053SRui Paulo 452e28a4053SRui Paulo int wmm_enabled; 453e28a4053SRui Paulo int wmm_uapsd; 454e28a4053SRui Paulo 4555b9c547cSRui Paulo struct hostapd_vlan *vlan; 456e28a4053SRui Paulo 457e28a4053SRui Paulo macaddr bssid; 458e28a4053SRui Paulo 459e28a4053SRui Paulo /* 460e28a4053SRui Paulo * Maximum listen interval that STAs can use when associating with this 461e28a4053SRui Paulo * BSS. If a STA tries to use larger value, the association will be 462e28a4053SRui Paulo * denied with status code 51. 463e28a4053SRui Paulo */ 464e28a4053SRui Paulo u16 max_listen_interval; 465e28a4053SRui Paulo 466f05cddf9SRui Paulo int disable_pmksa_caching; 467e28a4053SRui Paulo int okc; /* Opportunistic Key Caching */ 468e28a4053SRui Paulo 469e28a4053SRui Paulo int wps_state; 470e28a4053SRui Paulo #ifdef CONFIG_WPS 4715b9c547cSRui Paulo int wps_independent; 472e28a4053SRui Paulo int ap_setup_locked; 473e28a4053SRui Paulo u8 uuid[16]; 474e28a4053SRui Paulo char *wps_pin_requests; 475e28a4053SRui Paulo char *device_name; 476e28a4053SRui Paulo char *manufacturer; 477e28a4053SRui Paulo char *model_name; 478e28a4053SRui Paulo char *model_number; 479e28a4053SRui Paulo char *serial_number; 480f05cddf9SRui Paulo u8 device_type[WPS_DEV_TYPE_LEN]; 481e28a4053SRui Paulo char *config_methods; 482e28a4053SRui Paulo u8 os_version[4]; 483e28a4053SRui Paulo char *ap_pin; 484e28a4053SRui Paulo int skip_cred_build; 485e28a4053SRui Paulo u8 *extra_cred; 486e28a4053SRui Paulo size_t extra_cred_len; 487e28a4053SRui Paulo int wps_cred_processing; 4884bc52338SCy Schubert int wps_cred_add_sae; 4895b9c547cSRui Paulo int force_per_enrollee_psk; 490e28a4053SRui Paulo u8 *ap_settings; 491e28a4053SRui Paulo size_t ap_settings_len; 4924bc52338SCy Schubert struct hostapd_ssid multi_ap_backhaul_ssid; 493e28a4053SRui Paulo char *upnp_iface; 494e28a4053SRui Paulo char *friendly_name; 495e28a4053SRui Paulo char *manufacturer_url; 496e28a4053SRui Paulo char *model_description; 497e28a4053SRui Paulo char *model_url; 498e28a4053SRui Paulo char *upc; 499f05cddf9SRui Paulo struct wpabuf *wps_vendor_ext[MAX_WPS_VENDOR_EXTENSIONS]; 5005b9c547cSRui Paulo int wps_nfc_pw_from_config; 501f05cddf9SRui Paulo int wps_nfc_dev_pw_id; 502f05cddf9SRui Paulo struct wpabuf *wps_nfc_dh_pubkey; 503f05cddf9SRui Paulo struct wpabuf *wps_nfc_dh_privkey; 504f05cddf9SRui Paulo struct wpabuf *wps_nfc_dev_pw; 505e28a4053SRui Paulo #endif /* CONFIG_WPS */ 506f05cddf9SRui Paulo int pbc_in_m1; 5075b9c547cSRui Paulo char *server_id; 508f05cddf9SRui Paulo 509f05cddf9SRui Paulo #define P2P_ENABLED BIT(0) 510f05cddf9SRui Paulo #define P2P_GROUP_OWNER BIT(1) 511f05cddf9SRui Paulo #define P2P_GROUP_FORMATION BIT(2) 512f05cddf9SRui Paulo #define P2P_MANAGE BIT(3) 513f05cddf9SRui Paulo #define P2P_ALLOW_CROSS_CONNECTION BIT(4) 514f05cddf9SRui Paulo int p2p; 5155b9c547cSRui Paulo #ifdef CONFIG_P2P 5165b9c547cSRui Paulo u8 ip_addr_go[4]; 5175b9c547cSRui Paulo u8 ip_addr_mask[4]; 5185b9c547cSRui Paulo u8 ip_addr_start[4]; 5195b9c547cSRui Paulo u8 ip_addr_end[4]; 5205b9c547cSRui Paulo #endif /* CONFIG_P2P */ 521f05cddf9SRui Paulo 522f05cddf9SRui Paulo int disassoc_low_ack; 523f05cddf9SRui Paulo int skip_inactivity_poll; 524f05cddf9SRui Paulo 525f05cddf9SRui Paulo #define TDLS_PROHIBIT BIT(0) 526f05cddf9SRui Paulo #define TDLS_PROHIBIT_CHAN_SWITCH BIT(1) 527f05cddf9SRui Paulo int tdls; 528f05cddf9SRui Paulo int disable_11n; 529f05cddf9SRui Paulo int disable_11ac; 530f05cddf9SRui Paulo 531f05cddf9SRui Paulo /* IEEE 802.11v */ 532f05cddf9SRui Paulo int time_advertisement; 533f05cddf9SRui Paulo char *time_zone; 534f05cddf9SRui Paulo int wnm_sleep_mode; 53585732ac8SCy Schubert int wnm_sleep_mode_no_keys; 536f05cddf9SRui Paulo int bss_transition; 537f05cddf9SRui Paulo 538f05cddf9SRui Paulo /* IEEE 802.11u - Interworking */ 539f05cddf9SRui Paulo int interworking; 540f05cddf9SRui Paulo int access_network_type; 541f05cddf9SRui Paulo int internet; 542f05cddf9SRui Paulo int asra; 543f05cddf9SRui Paulo int esr; 544f05cddf9SRui Paulo int uesa; 545f05cddf9SRui Paulo int venue_info_set; 546f05cddf9SRui Paulo u8 venue_group; 547f05cddf9SRui Paulo u8 venue_type; 548f05cddf9SRui Paulo u8 hessid[ETH_ALEN]; 549f05cddf9SRui Paulo 550f05cddf9SRui Paulo /* IEEE 802.11u - Roaming Consortium list */ 551f05cddf9SRui Paulo unsigned int roaming_consortium_count; 552f05cddf9SRui Paulo struct hostapd_roaming_consortium *roaming_consortium; 553f05cddf9SRui Paulo 554f05cddf9SRui Paulo /* IEEE 802.11u - Venue Name duples */ 555f05cddf9SRui Paulo unsigned int venue_name_count; 556f05cddf9SRui Paulo struct hostapd_lang_string *venue_name; 557f05cddf9SRui Paulo 55885732ac8SCy Schubert /* Venue URL duples */ 55985732ac8SCy Schubert unsigned int venue_url_count; 56085732ac8SCy Schubert struct hostapd_venue_url *venue_url; 56185732ac8SCy Schubert 562f05cddf9SRui Paulo /* IEEE 802.11u - Network Authentication Type */ 563f05cddf9SRui Paulo u8 *network_auth_type; 564f05cddf9SRui Paulo size_t network_auth_type_len; 565f05cddf9SRui Paulo 566f05cddf9SRui Paulo /* IEEE 802.11u - IP Address Type Availability */ 567f05cddf9SRui Paulo u8 ipaddr_type_availability; 568f05cddf9SRui Paulo u8 ipaddr_type_configured; 569f05cddf9SRui Paulo 570f05cddf9SRui Paulo /* IEEE 802.11u - 3GPP Cellular Network */ 571f05cddf9SRui Paulo u8 *anqp_3gpp_cell_net; 572f05cddf9SRui Paulo size_t anqp_3gpp_cell_net_len; 573f05cddf9SRui Paulo 574f05cddf9SRui Paulo /* IEEE 802.11u - Domain Name */ 575f05cddf9SRui Paulo u8 *domain_name; 576f05cddf9SRui Paulo size_t domain_name_len; 577f05cddf9SRui Paulo 578f05cddf9SRui Paulo unsigned int nai_realm_count; 579f05cddf9SRui Paulo struct hostapd_nai_realm_data *nai_realm_data; 580f05cddf9SRui Paulo 581780fb4a2SCy Schubert struct dl_list anqp_elem; /* list of struct anqp_element */ 582780fb4a2SCy Schubert 583f05cddf9SRui Paulo u16 gas_comeback_delay; 58485732ac8SCy Schubert size_t gas_frag_limit; 585780fb4a2SCy Schubert int gas_address3; 586f05cddf9SRui Paulo 5875b9c547cSRui Paulo u8 qos_map_set[16 + 2 * 21]; 5885b9c547cSRui Paulo unsigned int qos_map_set_len; 5895b9c547cSRui Paulo 5905b9c547cSRui Paulo int osen; 5915b9c547cSRui Paulo int proxy_arp; 592325151a3SRui Paulo int na_mcast_to_ucast; 593*206b73d0SCy Schubert 594f05cddf9SRui Paulo #ifdef CONFIG_HS20 595f05cddf9SRui Paulo int hs20; 5964bc52338SCy Schubert int hs20_release; 597f05cddf9SRui Paulo int disable_dgaf; 5985b9c547cSRui Paulo u16 anqp_domain_id; 599f05cddf9SRui Paulo unsigned int hs20_oper_friendly_name_count; 600f05cddf9SRui Paulo struct hostapd_lang_string *hs20_oper_friendly_name; 601f05cddf9SRui Paulo u8 *hs20_wan_metrics; 602f05cddf9SRui Paulo u8 *hs20_connection_capability; 603f05cddf9SRui Paulo size_t hs20_connection_capability_len; 604f05cddf9SRui Paulo u8 *hs20_operating_class; 605f05cddf9SRui Paulo u8 hs20_operating_class_len; 6065b9c547cSRui Paulo struct hs20_icon { 6075b9c547cSRui Paulo u16 width; 6085b9c547cSRui Paulo u16 height; 6095b9c547cSRui Paulo char language[3]; 6105b9c547cSRui Paulo char type[256]; 6115b9c547cSRui Paulo char name[256]; 6125b9c547cSRui Paulo char file[256]; 6135b9c547cSRui Paulo } *hs20_icons; 6145b9c547cSRui Paulo size_t hs20_icons_count; 615325151a3SRui Paulo u8 osu_ssid[SSID_MAX_LEN]; 6165b9c547cSRui Paulo size_t osu_ssid_len; 6175b9c547cSRui Paulo struct hs20_osu_provider { 6185b9c547cSRui Paulo unsigned int friendly_name_count; 6195b9c547cSRui Paulo struct hostapd_lang_string *friendly_name; 6205b9c547cSRui Paulo char *server_uri; 6215b9c547cSRui Paulo int *method_list; 6225b9c547cSRui Paulo char **icons; 6235b9c547cSRui Paulo size_t icons_count; 6245b9c547cSRui Paulo char *osu_nai; 62585732ac8SCy Schubert char *osu_nai2; 6265b9c547cSRui Paulo unsigned int service_desc_count; 6275b9c547cSRui Paulo struct hostapd_lang_string *service_desc; 6285b9c547cSRui Paulo } *hs20_osu_providers, *last_osu; 6295b9c547cSRui Paulo size_t hs20_osu_providers_count; 63085732ac8SCy Schubert size_t hs20_osu_providers_nai_count; 63185732ac8SCy Schubert char **hs20_operator_icon; 63285732ac8SCy Schubert size_t hs20_operator_icon_count; 6335b9c547cSRui Paulo unsigned int hs20_deauth_req_timeout; 6345b9c547cSRui Paulo char *subscr_remediation_url; 6355b9c547cSRui Paulo u8 subscr_remediation_method; 6364bc52338SCy Schubert char *hs20_sim_provisioning_url; 63785732ac8SCy Schubert char *t_c_filename; 63885732ac8SCy Schubert u32 t_c_timestamp; 63985732ac8SCy Schubert char *t_c_server_url; 640f05cddf9SRui Paulo #endif /* CONFIG_HS20 */ 641f05cddf9SRui Paulo 642f05cddf9SRui Paulo u8 wps_rf_bands; /* RF bands for WPS (WPS_RF_*) */ 643f05cddf9SRui Paulo 644f05cddf9SRui Paulo #ifdef CONFIG_RADIUS_TEST 645f05cddf9SRui Paulo char *dump_msk_file; 646f05cddf9SRui Paulo #endif /* CONFIG_RADIUS_TEST */ 647f05cddf9SRui Paulo 648f05cddf9SRui Paulo struct wpabuf *vendor_elements; 649780fb4a2SCy Schubert struct wpabuf *assocresp_elements; 6505b9c547cSRui Paulo 6515b9c547cSRui Paulo unsigned int sae_anti_clogging_threshold; 65285732ac8SCy Schubert unsigned int sae_sync; 65385732ac8SCy Schubert int sae_require_mfp; 6545b9c547cSRui Paulo int *sae_groups; 65585732ac8SCy Schubert struct sae_password_entry *sae_passwords; 6565b9c547cSRui Paulo 6575b9c547cSRui Paulo char *wowlan_triggers; /* Wake-on-WLAN triggers */ 6585b9c547cSRui Paulo 6595b9c547cSRui Paulo #ifdef CONFIG_TESTING_OPTIONS 6605b9c547cSRui Paulo u8 bss_load_test[5]; 6615b9c547cSRui Paulo u8 bss_load_test_set; 662325151a3SRui Paulo struct wpabuf *own_ie_override; 66385732ac8SCy Schubert int sae_reflection_attack; 66485732ac8SCy Schubert struct wpabuf *sae_commit_override; 6655b9c547cSRui Paulo #endif /* CONFIG_TESTING_OPTIONS */ 6665b9c547cSRui Paulo 6675b9c547cSRui Paulo #define MESH_ENABLED BIT(0) 6685b9c547cSRui Paulo int mesh; 6695b9c547cSRui Paulo 670780fb4a2SCy Schubert u8 radio_measurements[RRM_CAPABILITIES_IE_LEN]; 6715b9c547cSRui Paulo 6725b9c547cSRui Paulo int vendor_vht; 673780fb4a2SCy Schubert int use_sta_nsts; 674325151a3SRui Paulo 675325151a3SRui Paulo char *no_probe_resp_if_seen_on; 676325151a3SRui Paulo char *no_auth_if_seen_on; 677780fb4a2SCy Schubert 678780fb4a2SCy Schubert int pbss; 679780fb4a2SCy Schubert 680780fb4a2SCy Schubert #ifdef CONFIG_MBO 681780fb4a2SCy Schubert int mbo_enabled; 68285732ac8SCy Schubert /** 68385732ac8SCy Schubert * oce - Enable OCE in AP and/or STA-CFON mode 68485732ac8SCy Schubert * - BIT(0) is Reserved 68585732ac8SCy Schubert * - Set BIT(1) to enable OCE in STA-CFON mode 68685732ac8SCy Schubert * - Set BIT(2) to enable OCE in AP mode 68785732ac8SCy Schubert */ 68885732ac8SCy Schubert unsigned int oce; 68985732ac8SCy Schubert int mbo_cell_data_conn_pref; 690780fb4a2SCy Schubert #endif /* CONFIG_MBO */ 691780fb4a2SCy Schubert 692780fb4a2SCy Schubert int ftm_responder; 693780fb4a2SCy Schubert int ftm_initiator; 69485732ac8SCy Schubert 69585732ac8SCy Schubert #ifdef CONFIG_FILS 69685732ac8SCy Schubert u8 fils_cache_id[FILS_CACHE_ID_LEN]; 69785732ac8SCy Schubert int fils_cache_id_set; 69885732ac8SCy Schubert struct dl_list fils_realms; /* list of struct fils_realm */ 69985732ac8SCy Schubert int fils_dh_group; 70085732ac8SCy Schubert struct hostapd_ip_addr dhcp_server; 70185732ac8SCy Schubert int dhcp_rapid_commit_proxy; 70285732ac8SCy Schubert unsigned int fils_hlp_wait_time; 70385732ac8SCy Schubert u16 dhcp_server_port; 70485732ac8SCy Schubert u16 dhcp_relay_port; 70585732ac8SCy Schubert #endif /* CONFIG_FILS */ 70685732ac8SCy Schubert 70785732ac8SCy Schubert int multicast_to_unicast; 70885732ac8SCy Schubert 70985732ac8SCy Schubert int broadcast_deauth; 71085732ac8SCy Schubert 71185732ac8SCy Schubert #ifdef CONFIG_DPP 71285732ac8SCy Schubert char *dpp_connector; 71385732ac8SCy Schubert struct wpabuf *dpp_netaccesskey; 71485732ac8SCy Schubert unsigned int dpp_netaccesskey_expiry; 71585732ac8SCy Schubert struct wpabuf *dpp_csign; 716*206b73d0SCy Schubert #ifdef CONFIG_DPP2 717*206b73d0SCy Schubert struct dpp_controller_conf *dpp_controller; 718*206b73d0SCy Schubert #endif /* CONFIG_DPP2 */ 71985732ac8SCy Schubert #endif /* CONFIG_DPP */ 72085732ac8SCy Schubert 72185732ac8SCy Schubert #ifdef CONFIG_OWE 72285732ac8SCy Schubert macaddr owe_transition_bssid; 72385732ac8SCy Schubert u8 owe_transition_ssid[SSID_MAX_LEN]; 72485732ac8SCy Schubert size_t owe_transition_ssid_len; 72585732ac8SCy Schubert char owe_transition_ifname[IFNAMSIZ + 1]; 72685732ac8SCy Schubert int *owe_groups; 72785732ac8SCy Schubert #endif /* CONFIG_OWE */ 72885732ac8SCy Schubert 72985732ac8SCy Schubert int coloc_intf_reporting; 7304bc52338SCy Schubert 7314bc52338SCy Schubert u8 send_probe_response; 7324bc52338SCy Schubert 7334bc52338SCy Schubert #define BACKHAUL_BSS 1 7344bc52338SCy Schubert #define FRONTHAUL_BSS 2 7354bc52338SCy Schubert int multi_ap; /* bitmap of BACKHAUL_BSS, FRONTHAUL_BSS */ 736*206b73d0SCy Schubert 737*206b73d0SCy Schubert #ifdef CONFIG_AIRTIME_POLICY 738*206b73d0SCy Schubert unsigned int airtime_weight; 739*206b73d0SCy Schubert int airtime_limit; 740*206b73d0SCy Schubert struct airtime_sta_weight *airtime_weight_list; 741*206b73d0SCy Schubert #endif /* CONFIG_AIRTIME_POLICY */ 742*206b73d0SCy Schubert 743*206b73d0SCy Schubert #ifdef CONFIG_MACSEC 744*206b73d0SCy Schubert /** 745*206b73d0SCy Schubert * macsec_policy - Determines the policy for MACsec secure session 746*206b73d0SCy Schubert * 747*206b73d0SCy Schubert * 0: MACsec not in use (default) 748*206b73d0SCy Schubert * 1: MACsec enabled - Should secure, accept key server's advice to 749*206b73d0SCy Schubert * determine whether to use a secure session or not. 750*206b73d0SCy Schubert */ 751*206b73d0SCy Schubert int macsec_policy; 752*206b73d0SCy Schubert 753*206b73d0SCy Schubert /** 754*206b73d0SCy Schubert * macsec_integ_only - Determines how MACsec are transmitted 755*206b73d0SCy Schubert * 756*206b73d0SCy Schubert * This setting applies only when MACsec is in use, i.e., 757*206b73d0SCy Schubert * - macsec_policy is enabled 758*206b73d0SCy Schubert * - the key server has decided to enable MACsec 759*206b73d0SCy Schubert * 760*206b73d0SCy Schubert * 0: Encrypt traffic (default) 761*206b73d0SCy Schubert * 1: Integrity only 762*206b73d0SCy Schubert */ 763*206b73d0SCy Schubert int macsec_integ_only; 764*206b73d0SCy Schubert 765*206b73d0SCy Schubert /** 766*206b73d0SCy Schubert * macsec_replay_protect - Enable MACsec replay protection 767*206b73d0SCy Schubert * 768*206b73d0SCy Schubert * This setting applies only when MACsec is in use, i.e., 769*206b73d0SCy Schubert * - macsec_policy is enabled 770*206b73d0SCy Schubert * - the key server has decided to enable MACsec 771*206b73d0SCy Schubert * 772*206b73d0SCy Schubert * 0: Replay protection disabled (default) 773*206b73d0SCy Schubert * 1: Replay protection enabled 774*206b73d0SCy Schubert */ 775*206b73d0SCy Schubert int macsec_replay_protect; 776*206b73d0SCy Schubert 777*206b73d0SCy Schubert /** 778*206b73d0SCy Schubert * macsec_replay_window - MACsec replay protection window 779*206b73d0SCy Schubert * 780*206b73d0SCy Schubert * A window in which replay is tolerated, to allow receipt of frames 781*206b73d0SCy Schubert * that have been misordered by the network. 782*206b73d0SCy Schubert * 783*206b73d0SCy Schubert * This setting applies only when MACsec replay protection active, i.e., 784*206b73d0SCy Schubert * - macsec_replay_protect is enabled 785*206b73d0SCy Schubert * - the key server has decided to enable MACsec 786*206b73d0SCy Schubert * 787*206b73d0SCy Schubert * 0: No replay window, strict check (default) 788*206b73d0SCy Schubert * 1..2^32-1: number of packets that could be misordered 789*206b73d0SCy Schubert */ 790*206b73d0SCy Schubert u32 macsec_replay_window; 791*206b73d0SCy Schubert 792*206b73d0SCy Schubert /** 793*206b73d0SCy Schubert * macsec_port - MACsec port (in SCI) 794*206b73d0SCy Schubert * 795*206b73d0SCy Schubert * Port component of the SCI. 796*206b73d0SCy Schubert * 797*206b73d0SCy Schubert * Range: 1-65534 (default: 1) 798*206b73d0SCy Schubert */ 799*206b73d0SCy Schubert int macsec_port; 800*206b73d0SCy Schubert 801*206b73d0SCy Schubert /** 802*206b73d0SCy Schubert * mka_priority - Priority of MKA Actor 803*206b73d0SCy Schubert * 804*206b73d0SCy Schubert * Range: 0-255 (default: 255) 805*206b73d0SCy Schubert */ 806*206b73d0SCy Schubert int mka_priority; 807*206b73d0SCy Schubert 808*206b73d0SCy Schubert /** 809*206b73d0SCy Schubert * mka_ckn - MKA pre-shared CKN 810*206b73d0SCy Schubert */ 811*206b73d0SCy Schubert #define MACSEC_CKN_MAX_LEN 32 812*206b73d0SCy Schubert size_t mka_ckn_len; 813*206b73d0SCy Schubert u8 mka_ckn[MACSEC_CKN_MAX_LEN]; 814*206b73d0SCy Schubert 815*206b73d0SCy Schubert /** 816*206b73d0SCy Schubert * mka_cak - MKA pre-shared CAK 817*206b73d0SCy Schubert */ 818*206b73d0SCy Schubert #define MACSEC_CAK_MAX_LEN 32 819*206b73d0SCy Schubert size_t mka_cak_len; 820*206b73d0SCy Schubert u8 mka_cak[MACSEC_CAK_MAX_LEN]; 821*206b73d0SCy Schubert 822*206b73d0SCy Schubert #define MKA_PSK_SET_CKN BIT(0) 823*206b73d0SCy Schubert #define MKA_PSK_SET_CAK BIT(1) 824*206b73d0SCy Schubert #define MKA_PSK_SET (MKA_PSK_SET_CKN | MKA_PSK_SET_CAK) 825*206b73d0SCy Schubert /** 826*206b73d0SCy Schubert * mka_psk_set - Whether mka_ckn and mka_cak are set 827*206b73d0SCy Schubert */ 828*206b73d0SCy Schubert u8 mka_psk_set; 829*206b73d0SCy Schubert #endif /* CONFIG_MACSEC */ 830e28a4053SRui Paulo }; 831e28a4053SRui Paulo 83285732ac8SCy Schubert /** 83385732ac8SCy Schubert * struct he_phy_capabilities_info - HE PHY capabilities 83485732ac8SCy Schubert */ 83585732ac8SCy Schubert struct he_phy_capabilities_info { 83685732ac8SCy Schubert Boolean he_su_beamformer; 83785732ac8SCy Schubert Boolean he_su_beamformee; 83885732ac8SCy Schubert Boolean he_mu_beamformer; 83985732ac8SCy Schubert }; 84085732ac8SCy Schubert 84185732ac8SCy Schubert /** 84285732ac8SCy Schubert * struct he_operation - HE operation 84385732ac8SCy Schubert */ 84485732ac8SCy Schubert struct he_operation { 84585732ac8SCy Schubert u8 he_bss_color; 84685732ac8SCy Schubert u8 he_default_pe_duration; 84785732ac8SCy Schubert u8 he_twt_required; 848*206b73d0SCy Schubert u16 he_rts_threshold; 849*206b73d0SCy Schubert u16 he_basic_mcs_nss_set; 850*206b73d0SCy Schubert }; 851*206b73d0SCy Schubert 852*206b73d0SCy Schubert /** 853*206b73d0SCy Schubert * struct spatial_reuse - Spatial reuse 854*206b73d0SCy Schubert */ 855*206b73d0SCy Schubert struct spatial_reuse { 856*206b73d0SCy Schubert u8 sr_control; 857*206b73d0SCy Schubert u8 non_srg_obss_pd_max_offset; 858*206b73d0SCy Schubert u8 srg_obss_pd_min_offset; 859*206b73d0SCy Schubert u8 srg_obss_pd_max_offset; 860*206b73d0SCy Schubert u8 srg_obss_color_bitmap; 861*206b73d0SCy Schubert u8 srg_obss_color_partial_bitmap; 86285732ac8SCy Schubert }; 863e28a4053SRui Paulo 864e28a4053SRui Paulo /** 865e28a4053SRui Paulo * struct hostapd_config - Per-radio interface configuration 866e28a4053SRui Paulo */ 867e28a4053SRui Paulo struct hostapd_config { 8685b9c547cSRui Paulo struct hostapd_bss_config **bss, *last_bss; 869e28a4053SRui Paulo size_t num_bss; 870e28a4053SRui Paulo 871e28a4053SRui Paulo u16 beacon_int; 872e28a4053SRui Paulo int rts_threshold; 873e28a4053SRui Paulo int fragm_threshold; 874e28a4053SRui Paulo u8 channel; 875325151a3SRui Paulo u8 acs; 876325151a3SRui Paulo struct wpa_freq_range_list acs_ch_list; 87785732ac8SCy Schubert int acs_exclude_dfs; 878e28a4053SRui Paulo enum hostapd_hw_mode hw_mode; /* HOSTAPD_MODE_IEEE80211A, .. */ 879e28a4053SRui Paulo enum { 880e28a4053SRui Paulo LONG_PREAMBLE = 0, 881e28a4053SRui Paulo SHORT_PREAMBLE = 1 882e28a4053SRui Paulo } preamble; 883e28a4053SRui Paulo 884e28a4053SRui Paulo int *supported_rates; 885e28a4053SRui Paulo int *basic_rates; 88685732ac8SCy Schubert unsigned int beacon_rate; 88785732ac8SCy Schubert enum beacon_rate_type rate_type; 888e28a4053SRui Paulo 889e28a4053SRui Paulo const struct wpa_driver_ops *driver; 8905b9c547cSRui Paulo char *driver_params; 891e28a4053SRui Paulo 892e28a4053SRui Paulo int ap_table_max_size; 893e28a4053SRui Paulo int ap_table_expiration_time; 894e28a4053SRui Paulo 895325151a3SRui Paulo unsigned int track_sta_max_num; 896325151a3SRui Paulo unsigned int track_sta_max_age; 897325151a3SRui Paulo 898e28a4053SRui Paulo char country[3]; /* first two octets: country code as described in 899e28a4053SRui Paulo * ISO/IEC 3166-1. Third octet: 900e28a4053SRui Paulo * ' ' (ascii 32): all environments 901e28a4053SRui Paulo * 'O': Outdoor environemnt only 902e28a4053SRui Paulo * 'I': Indoor environment only 90385732ac8SCy Schubert * 'X': Used with noncountry entity ("XXX") 90485732ac8SCy Schubert * 0x00..0x31: identifying IEEE 802.11 standard 90585732ac8SCy Schubert * Annex E table (0x04 = global table) 906e28a4053SRui Paulo */ 907e28a4053SRui Paulo 908e28a4053SRui Paulo int ieee80211d; 909e28a4053SRui Paulo 9105b9c547cSRui Paulo int ieee80211h; /* DFS */ 9115b9c547cSRui Paulo 9125b9c547cSRui Paulo /* 9135b9c547cSRui Paulo * Local power constraint is an octet encoded as an unsigned integer in 9145b9c547cSRui Paulo * units of decibels. Invalid value -1 indicates that Power Constraint 9155b9c547cSRui Paulo * element will not be added. 9165b9c547cSRui Paulo */ 9175b9c547cSRui Paulo int local_pwr_constraint; 9185b9c547cSRui Paulo 9195b9c547cSRui Paulo /* Control Spectrum Management bit */ 9205b9c547cSRui Paulo int spectrum_mgmt_required; 9215b9c547cSRui Paulo 922e28a4053SRui Paulo struct hostapd_tx_queue_params tx_queue[NUM_TX_QUEUES]; 923e28a4053SRui Paulo 924e28a4053SRui Paulo /* 925e28a4053SRui Paulo * WMM AC parameters, in same order as 802.1D, i.e. 926e28a4053SRui Paulo * 0 = BE (best effort) 927e28a4053SRui Paulo * 1 = BK (background) 928e28a4053SRui Paulo * 2 = VI (video) 929e28a4053SRui Paulo * 3 = VO (voice) 930e28a4053SRui Paulo */ 931e28a4053SRui Paulo struct hostapd_wmm_ac_params wmm_ac_params[4]; 932e28a4053SRui Paulo 933e28a4053SRui Paulo int ht_op_mode_fixed; 934e28a4053SRui Paulo u16 ht_capab; 935e28a4053SRui Paulo int ieee80211n; 936e28a4053SRui Paulo int secondary_channel; 937325151a3SRui Paulo int no_pri_sec_switch; 938f05cddf9SRui Paulo int require_ht; 9395b9c547cSRui Paulo int obss_interval; 940f05cddf9SRui Paulo u32 vht_capab; 941f05cddf9SRui Paulo int ieee80211ac; 942f05cddf9SRui Paulo int require_vht; 943f05cddf9SRui Paulo u8 vht_oper_chwidth; 944f05cddf9SRui Paulo u8 vht_oper_centr_freq_seg0_idx; 945f05cddf9SRui Paulo u8 vht_oper_centr_freq_seg1_idx; 94685732ac8SCy Schubert u8 ht40_plus_minus_allowed; 9475b9c547cSRui Paulo 948780fb4a2SCy Schubert /* Use driver-generated interface addresses when adding multiple BSSs */ 949780fb4a2SCy Schubert u8 use_driver_iface_addr; 950780fb4a2SCy Schubert 951325151a3SRui Paulo #ifdef CONFIG_FST 952325151a3SRui Paulo struct fst_iface_cfg fst_cfg; 953325151a3SRui Paulo #endif /* CONFIG_FST */ 954325151a3SRui Paulo 9555b9c547cSRui Paulo #ifdef CONFIG_P2P 9565b9c547cSRui Paulo u8 p2p_go_ctwindow; 9575b9c547cSRui Paulo #endif /* CONFIG_P2P */ 9585b9c547cSRui Paulo 9595b9c547cSRui Paulo #ifdef CONFIG_TESTING_OPTIONS 9605b9c547cSRui Paulo double ignore_probe_probability; 9615b9c547cSRui Paulo double ignore_auth_probability; 9625b9c547cSRui Paulo double ignore_assoc_probability; 9635b9c547cSRui Paulo double ignore_reassoc_probability; 9645b9c547cSRui Paulo double corrupt_gtk_rekey_mic_probability; 965780fb4a2SCy Schubert int ecsa_ie_only; 9665b9c547cSRui Paulo #endif /* CONFIG_TESTING_OPTIONS */ 9675b9c547cSRui Paulo 9685b9c547cSRui Paulo #ifdef CONFIG_ACS 9695b9c547cSRui Paulo unsigned int acs_num_scans; 9705b9c547cSRui Paulo struct acs_bias { 9715b9c547cSRui Paulo int channel; 9725b9c547cSRui Paulo double bias; 9735b9c547cSRui Paulo } *acs_chan_bias; 9745b9c547cSRui Paulo unsigned int num_acs_chan_bias; 9755b9c547cSRui Paulo #endif /* CONFIG_ACS */ 976780fb4a2SCy Schubert 977780fb4a2SCy Schubert struct wpabuf *lci; 978780fb4a2SCy Schubert struct wpabuf *civic; 97985732ac8SCy Schubert int stationary_ap; 98085732ac8SCy Schubert 98185732ac8SCy Schubert int ieee80211ax; 98285732ac8SCy Schubert #ifdef CONFIG_IEEE80211AX 98385732ac8SCy Schubert struct he_phy_capabilities_info he_phy_capab; 98485732ac8SCy Schubert struct he_operation he_op; 9854bc52338SCy Schubert struct ieee80211_he_mu_edca_parameter_set he_mu_edca; 986*206b73d0SCy Schubert struct spatial_reuse spr; 987*206b73d0SCy Schubert u8 he_oper_chwidth; 988*206b73d0SCy Schubert u8 he_oper_centr_freq_seg0_idx; 989*206b73d0SCy Schubert u8 he_oper_centr_freq_seg1_idx; 99085732ac8SCy Schubert #endif /* CONFIG_IEEE80211AX */ 99185732ac8SCy Schubert 99285732ac8SCy Schubert /* VHT enable/disable config from CHAN_SWITCH */ 99385732ac8SCy Schubert #define CH_SWITCH_VHT_ENABLED BIT(0) 99485732ac8SCy Schubert #define CH_SWITCH_VHT_DISABLED BIT(1) 99585732ac8SCy Schubert unsigned int ch_switch_vht_config; 9964bc52338SCy Schubert 9974bc52338SCy Schubert int rssi_reject_assoc_rssi; 9984bc52338SCy Schubert int rssi_reject_assoc_timeout; 999*206b73d0SCy Schubert 1000*206b73d0SCy Schubert #ifdef CONFIG_AIRTIME_POLICY 1001*206b73d0SCy Schubert enum { 1002*206b73d0SCy Schubert AIRTIME_MODE_OFF = 0, 1003*206b73d0SCy Schubert AIRTIME_MODE_STATIC = 1, 1004*206b73d0SCy Schubert AIRTIME_MODE_DYNAMIC = 2, 1005*206b73d0SCy Schubert AIRTIME_MODE_LIMIT = 3, 1006*206b73d0SCy Schubert __AIRTIME_MODE_MAX, 1007*206b73d0SCy Schubert } airtime_mode; 1008*206b73d0SCy Schubert unsigned int airtime_update_interval; 1009*206b73d0SCy Schubert #define AIRTIME_MODE_MAX (__AIRTIME_MODE_MAX - 1) 1010*206b73d0SCy Schubert #endif /* CONFIG_AIRTIME_POLICY */ 1011e28a4053SRui Paulo }; 1012e28a4053SRui Paulo 1013e28a4053SRui Paulo 1014*206b73d0SCy Schubert static inline u8 hostapd_get_oper_chwidth(struct hostapd_config *conf) 1015*206b73d0SCy Schubert { 1016*206b73d0SCy Schubert #ifdef CONFIG_IEEE80211AX 1017*206b73d0SCy Schubert if (conf->ieee80211ax) 1018*206b73d0SCy Schubert return conf->he_oper_chwidth; 1019*206b73d0SCy Schubert #endif /* CONFIG_IEEE80211AX */ 1020*206b73d0SCy Schubert return conf->vht_oper_chwidth; 1021*206b73d0SCy Schubert } 1022*206b73d0SCy Schubert 1023*206b73d0SCy Schubert static inline void 1024*206b73d0SCy Schubert hostapd_set_oper_chwidth(struct hostapd_config *conf, u8 oper_chwidth) 1025*206b73d0SCy Schubert { 1026*206b73d0SCy Schubert #ifdef CONFIG_IEEE80211AX 1027*206b73d0SCy Schubert if (conf->ieee80211ax) 1028*206b73d0SCy Schubert conf->he_oper_chwidth = oper_chwidth; 1029*206b73d0SCy Schubert #endif /* CONFIG_IEEE80211AX */ 1030*206b73d0SCy Schubert conf->vht_oper_chwidth = oper_chwidth; 1031*206b73d0SCy Schubert } 1032*206b73d0SCy Schubert 1033*206b73d0SCy Schubert static inline u8 1034*206b73d0SCy Schubert hostapd_get_oper_centr_freq_seg0_idx(struct hostapd_config *conf) 1035*206b73d0SCy Schubert { 1036*206b73d0SCy Schubert #ifdef CONFIG_IEEE80211AX 1037*206b73d0SCy Schubert if (conf->ieee80211ax) 1038*206b73d0SCy Schubert return conf->he_oper_centr_freq_seg0_idx; 1039*206b73d0SCy Schubert #endif /* CONFIG_IEEE80211AX */ 1040*206b73d0SCy Schubert return conf->vht_oper_centr_freq_seg0_idx; 1041*206b73d0SCy Schubert } 1042*206b73d0SCy Schubert 1043*206b73d0SCy Schubert static inline void 1044*206b73d0SCy Schubert hostapd_set_oper_centr_freq_seg0_idx(struct hostapd_config *conf, 1045*206b73d0SCy Schubert u8 oper_centr_freq_seg0_idx) 1046*206b73d0SCy Schubert { 1047*206b73d0SCy Schubert #ifdef CONFIG_IEEE80211AX 1048*206b73d0SCy Schubert if (conf->ieee80211ax) 1049*206b73d0SCy Schubert conf->he_oper_centr_freq_seg0_idx = oper_centr_freq_seg0_idx; 1050*206b73d0SCy Schubert #endif /* CONFIG_IEEE80211AX */ 1051*206b73d0SCy Schubert conf->vht_oper_centr_freq_seg0_idx = oper_centr_freq_seg0_idx; 1052*206b73d0SCy Schubert } 1053*206b73d0SCy Schubert 1054*206b73d0SCy Schubert static inline u8 1055*206b73d0SCy Schubert hostapd_get_oper_centr_freq_seg1_idx(struct hostapd_config *conf) 1056*206b73d0SCy Schubert { 1057*206b73d0SCy Schubert #ifdef CONFIG_IEEE80211AX 1058*206b73d0SCy Schubert if (conf->ieee80211ax) 1059*206b73d0SCy Schubert return conf->he_oper_centr_freq_seg1_idx; 1060*206b73d0SCy Schubert #endif /* CONFIG_IEEE80211AX */ 1061*206b73d0SCy Schubert return conf->vht_oper_centr_freq_seg1_idx; 1062*206b73d0SCy Schubert } 1063*206b73d0SCy Schubert 1064*206b73d0SCy Schubert static inline void 1065*206b73d0SCy Schubert hostapd_set_oper_centr_freq_seg1_idx(struct hostapd_config *conf, 1066*206b73d0SCy Schubert u8 oper_centr_freq_seg1_idx) 1067*206b73d0SCy Schubert { 1068*206b73d0SCy Schubert #ifdef CONFIG_IEEE80211AX 1069*206b73d0SCy Schubert if (conf->ieee80211ax) 1070*206b73d0SCy Schubert conf->he_oper_centr_freq_seg1_idx = oper_centr_freq_seg1_idx; 1071*206b73d0SCy Schubert #endif /* CONFIG_IEEE80211AX */ 1072*206b73d0SCy Schubert conf->vht_oper_centr_freq_seg1_idx = oper_centr_freq_seg1_idx; 1073*206b73d0SCy Schubert } 1074*206b73d0SCy Schubert 1075*206b73d0SCy Schubert 1076e28a4053SRui Paulo int hostapd_mac_comp(const void *a, const void *b); 1077e28a4053SRui Paulo struct hostapd_config * hostapd_config_defaults(void); 1078e28a4053SRui Paulo void hostapd_config_defaults_bss(struct hostapd_bss_config *bss); 1079*206b73d0SCy Schubert void hostapd_config_free_radius_attr(struct hostapd_radius_attr *attr); 10805b9c547cSRui Paulo void hostapd_config_free_eap_user(struct hostapd_eap_user *user); 108185732ac8SCy Schubert void hostapd_config_free_eap_users(struct hostapd_eap_user *user); 10825b9c547cSRui Paulo void hostapd_config_clear_wpa_psk(struct hostapd_wpa_psk **p); 10835b9c547cSRui Paulo void hostapd_config_free_bss(struct hostapd_bss_config *conf); 1084e28a4053SRui Paulo void hostapd_config_free(struct hostapd_config *conf); 1085e28a4053SRui Paulo int hostapd_maclist_found(struct mac_acl_entry *list, int num_entries, 1086780fb4a2SCy Schubert const u8 *addr, struct vlan_description *vlan_id); 1087e28a4053SRui Paulo int hostapd_rate_found(int *list, int rate); 1088e28a4053SRui Paulo const u8 * hostapd_get_psk(const struct hostapd_bss_config *conf, 10895b9c547cSRui Paulo const u8 *addr, const u8 *p2p_dev_addr, 10904bc52338SCy Schubert const u8 *prev_psk, int *vlan_id); 1091e28a4053SRui Paulo int hostapd_setup_wpa_psk(struct hostapd_bss_config *conf); 1092780fb4a2SCy Schubert int hostapd_vlan_valid(struct hostapd_vlan *vlan, 1093780fb4a2SCy Schubert struct vlan_description *vlan_desc); 1094e28a4053SRui Paulo const char * hostapd_get_vlan_id_ifname(struct hostapd_vlan *vlan, 1095e28a4053SRui Paulo int vlan_id); 1096f05cddf9SRui Paulo struct hostapd_radius_attr * 1097f05cddf9SRui Paulo hostapd_config_get_radius_attr(struct hostapd_radius_attr *attr, u8 type); 1098*206b73d0SCy Schubert struct hostapd_radius_attr * hostapd_parse_radius_attr(const char *value); 10995b9c547cSRui Paulo int hostapd_config_check(struct hostapd_config *conf, int full_config); 11005b9c547cSRui Paulo void hostapd_set_security_params(struct hostapd_bss_config *bss, 11015b9c547cSRui Paulo int full_config); 11024bc52338SCy Schubert int hostapd_sae_pw_id_in_use(struct hostapd_bss_config *conf); 1103e28a4053SRui Paulo 1104e28a4053SRui Paulo #endif /* HOSTAPD_CONFIG_H */ 1105