ap_config.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842
  1. /*
  2. * hostapd / Configuration definitions and helpers functions
  3. * Copyright (c) 2003-2015, Jouni Malinen <j@w1.fi>
  4. *
  5. * This software may be distributed under the terms of the BSD license.
  6. * See README for more details.
  7. */
  8. #ifndef HOSTAPD_CONFIG_H
  9. #define HOSTAPD_CONFIG_H
  10. #include "common/defs.h"
  11. #include "utils/list.h"
  12. #include "ip_addr.h"
  13. #include "common/wpa_common.h"
  14. #include "common/ieee802_11_defs.h"
  15. #include "common/ieee802_11_common.h"
  16. #include "wps/wps.h"
  17. #include "fst/fst.h"
  18. #include "vlan.h"
  19. /**
  20. * mesh_conf - local MBSS state and settings
  21. */
  22. struct mesh_conf {
  23. u8 meshid[32];
  24. u8 meshid_len;
  25. /* Active Path Selection Protocol Identifier */
  26. u8 mesh_pp_id;
  27. /* Active Path Selection Metric Identifier */
  28. u8 mesh_pm_id;
  29. /* Congestion Control Mode Identifier */
  30. u8 mesh_cc_id;
  31. /* Synchronization Protocol Identifier */
  32. u8 mesh_sp_id;
  33. /* Authentication Protocol Identifier */
  34. u8 mesh_auth_id;
  35. u8 *rsn_ie;
  36. int rsn_ie_len;
  37. #define MESH_CONF_SEC_NONE BIT(0)
  38. #define MESH_CONF_SEC_AUTH BIT(1)
  39. #define MESH_CONF_SEC_AMPE BIT(2)
  40. unsigned int security;
  41. enum mfp_options ieee80211w;
  42. unsigned int pairwise_cipher;
  43. unsigned int group_cipher;
  44. unsigned int mgmt_group_cipher;
  45. int dot11MeshMaxRetries;
  46. int dot11MeshRetryTimeout; /* msec */
  47. int dot11MeshConfirmTimeout; /* msec */
  48. int dot11MeshHoldingTimeout; /* msec */
  49. };
  50. #define MAX_STA_COUNT 2007
  51. #define MAX_VLAN_ID 4094
  52. typedef u8 macaddr[ETH_ALEN];
  53. struct mac_acl_entry {
  54. macaddr addr;
  55. struct vlan_description vlan_id;
  56. };
  57. struct hostapd_radius_servers;
  58. struct ft_remote_r0kh;
  59. struct ft_remote_r1kh;
  60. #define NUM_WEP_KEYS 4
  61. struct hostapd_wep_keys {
  62. u8 idx;
  63. u8 *key[NUM_WEP_KEYS];
  64. size_t len[NUM_WEP_KEYS];
  65. int keys_set;
  66. size_t default_len; /* key length used for dynamic key generation */
  67. };
  68. typedef enum hostap_security_policy {
  69. SECURITY_PLAINTEXT = 0,
  70. SECURITY_STATIC_WEP = 1,
  71. SECURITY_IEEE_802_1X = 2,
  72. SECURITY_WPA_PSK = 3,
  73. SECURITY_WPA = 4,
  74. SECURITY_OSEN = 5
  75. } secpolicy;
  76. struct hostapd_ssid {
  77. u8 ssid[SSID_MAX_LEN];
  78. size_t ssid_len;
  79. unsigned int ssid_set:1;
  80. unsigned int utf8_ssid:1;
  81. unsigned int wpa_passphrase_set:1;
  82. unsigned int wpa_psk_set:1;
  83. char vlan[IFNAMSIZ + 1];
  84. secpolicy security_policy;
  85. struct hostapd_wpa_psk *wpa_psk;
  86. char *wpa_passphrase;
  87. char *wpa_psk_file;
  88. struct hostapd_wep_keys wep;
  89. #define DYNAMIC_VLAN_DISABLED 0
  90. #define DYNAMIC_VLAN_OPTIONAL 1
  91. #define DYNAMIC_VLAN_REQUIRED 2
  92. int dynamic_vlan;
  93. #define DYNAMIC_VLAN_NAMING_WITHOUT_DEVICE 0
  94. #define DYNAMIC_VLAN_NAMING_WITH_DEVICE 1
  95. #define DYNAMIC_VLAN_NAMING_END 2
  96. int vlan_naming;
  97. int per_sta_vif;
  98. #ifdef CONFIG_FULL_DYNAMIC_VLAN
  99. char *vlan_tagged_interface;
  100. #endif /* CONFIG_FULL_DYNAMIC_VLAN */
  101. };
  102. #define VLAN_ID_WILDCARD -1
  103. struct hostapd_vlan {
  104. struct hostapd_vlan *next;
  105. int vlan_id; /* VLAN ID or -1 (VLAN_ID_WILDCARD) for wildcard entry */
  106. struct vlan_description vlan_desc;
  107. char ifname[IFNAMSIZ + 1];
  108. int configured;
  109. int dynamic_vlan;
  110. #ifdef CONFIG_FULL_DYNAMIC_VLAN
  111. #define DVLAN_CLEAN_WLAN_PORT 0x8
  112. int clean;
  113. #endif /* CONFIG_FULL_DYNAMIC_VLAN */
  114. };
  115. #define PMK_LEN 32
  116. #define MIN_PASSPHRASE_LEN 8
  117. #define MAX_PASSPHRASE_LEN 63
  118. struct hostapd_sta_wpa_psk_short {
  119. struct hostapd_sta_wpa_psk_short *next;
  120. unsigned int is_passphrase:1;
  121. u8 psk[PMK_LEN];
  122. char passphrase[MAX_PASSPHRASE_LEN + 1];
  123. int ref; /* (number of references held) - 1 */
  124. };
  125. struct hostapd_wpa_psk {
  126. struct hostapd_wpa_psk *next;
  127. int group;
  128. u8 psk[PMK_LEN];
  129. u8 addr[ETH_ALEN];
  130. u8 p2p_dev_addr[ETH_ALEN];
  131. };
  132. struct hostapd_eap_user {
  133. struct hostapd_eap_user *next;
  134. u8 *identity;
  135. size_t identity_len;
  136. struct {
  137. int vendor;
  138. u32 method;
  139. } methods[EAP_MAX_METHODS];
  140. u8 *password;
  141. size_t password_len;
  142. int phase2;
  143. int force_version;
  144. unsigned int wildcard_prefix:1;
  145. unsigned int password_hash:1; /* whether password is hashed with
  146. * nt_password_hash() */
  147. unsigned int remediation:1;
  148. unsigned int macacl:1;
  149. int ttls_auth; /* EAP_TTLS_AUTH_* bitfield */
  150. struct hostapd_radius_attr *accept_attr;
  151. };
  152. struct hostapd_radius_attr {
  153. u8 type;
  154. struct wpabuf *val;
  155. struct hostapd_radius_attr *next;
  156. };
  157. #define NUM_TX_QUEUES 4
  158. struct hostapd_tx_queue_params {
  159. int aifs;
  160. int cwmin;
  161. int cwmax;
  162. int burst; /* maximum burst time in 0.1 ms, i.e., 10 = 1 ms */
  163. };
  164. #define MAX_ROAMING_CONSORTIUM_LEN 15
  165. struct hostapd_roaming_consortium {
  166. u8 len;
  167. u8 oi[MAX_ROAMING_CONSORTIUM_LEN];
  168. };
  169. struct hostapd_lang_string {
  170. u8 lang[3];
  171. u8 name_len;
  172. u8 name[252];
  173. };
  174. struct hostapd_venue_url {
  175. u8 venue_number;
  176. u8 url_len;
  177. u8 url[254];
  178. };
  179. #define MAX_NAI_REALMS 10
  180. #define MAX_NAI_REALMLEN 255
  181. #define MAX_NAI_EAP_METHODS 5
  182. #define MAX_NAI_AUTH_TYPES 4
  183. struct hostapd_nai_realm_data {
  184. u8 encoding;
  185. char realm_buf[MAX_NAI_REALMLEN + 1];
  186. char *realm[MAX_NAI_REALMS];
  187. u8 eap_method_count;
  188. struct hostapd_nai_realm_eap {
  189. u8 eap_method;
  190. u8 num_auths;
  191. u8 auth_id[MAX_NAI_AUTH_TYPES];
  192. u8 auth_val[MAX_NAI_AUTH_TYPES];
  193. } eap_method[MAX_NAI_EAP_METHODS];
  194. };
  195. struct anqp_element {
  196. struct dl_list list;
  197. u16 infoid;
  198. struct wpabuf *payload;
  199. };
  200. struct fils_realm {
  201. struct dl_list list;
  202. u8 hash[2];
  203. char realm[];
  204. };
  205. /**
  206. * struct hostapd_bss_config - Per-BSS configuration
  207. */
  208. struct hostapd_bss_config {
  209. char iface[IFNAMSIZ + 1];
  210. char bridge[IFNAMSIZ + 1];
  211. char vlan_bridge[IFNAMSIZ + 1];
  212. char wds_bridge[IFNAMSIZ + 1];
  213. enum hostapd_logger_level logger_syslog_level, logger_stdout_level;
  214. unsigned int logger_syslog; /* module bitfield */
  215. unsigned int logger_stdout; /* module bitfield */
  216. int max_num_sta; /* maximum number of STAs in station table */
  217. int dtim_period;
  218. unsigned int bss_load_update_period;
  219. unsigned int chan_util_avg_period;
  220. int ieee802_1x; /* use IEEE 802.1X */
  221. int eapol_version;
  222. int eap_server; /* Use internal EAP server instead of external
  223. * RADIUS server */
  224. struct hostapd_eap_user *eap_user;
  225. char *eap_user_sqlite;
  226. char *eap_sim_db;
  227. unsigned int eap_sim_db_timeout;
  228. int eap_server_erp; /* Whether ERP is enabled on internal EAP server */
  229. struct hostapd_ip_addr own_ip_addr;
  230. char *nas_identifier;
  231. struct hostapd_radius_servers *radius;
  232. int acct_interim_interval;
  233. int radius_request_cui;
  234. struct hostapd_radius_attr *radius_auth_req_attr;
  235. struct hostapd_radius_attr *radius_acct_req_attr;
  236. int radius_das_port;
  237. unsigned int radius_das_time_window;
  238. int radius_das_require_event_timestamp;
  239. int radius_das_require_message_authenticator;
  240. struct hostapd_ip_addr radius_das_client_addr;
  241. u8 *radius_das_shared_secret;
  242. size_t radius_das_shared_secret_len;
  243. struct hostapd_ssid ssid;
  244. char *eap_req_id_text; /* optional displayable message sent with
  245. * EAP Request-Identity */
  246. size_t eap_req_id_text_len;
  247. int eapol_key_index_workaround;
  248. size_t default_wep_key_len;
  249. int individual_wep_key_len;
  250. int wep_rekeying_period;
  251. int broadcast_key_idx_min, broadcast_key_idx_max;
  252. int eap_reauth_period;
  253. int erp_send_reauth_start;
  254. char *erp_domain;
  255. int ieee802_11f; /* use IEEE 802.11f (IAPP) */
  256. char iapp_iface[IFNAMSIZ + 1]; /* interface used with IAPP broadcast
  257. * frames */
  258. enum macaddr_acl {
  259. ACCEPT_UNLESS_DENIED = 0,
  260. DENY_UNLESS_ACCEPTED = 1,
  261. USE_EXTERNAL_RADIUS_AUTH = 2
  262. } macaddr_acl;
  263. struct mac_acl_entry *accept_mac;
  264. int num_accept_mac;
  265. struct mac_acl_entry *deny_mac;
  266. int num_deny_mac;
  267. int wds_sta;
  268. int isolate;
  269. int start_disabled;
  270. int auth_algs; /* bitfield of allowed IEEE 802.11 authentication
  271. * algorithms, WPA_AUTH_ALG_{OPEN,SHARED,LEAP} */
  272. int wpa; /* bitfield of WPA_PROTO_WPA, WPA_PROTO_RSN */
  273. int wpa_key_mgmt;
  274. #ifdef CONFIG_IEEE80211W
  275. enum mfp_options ieee80211w;
  276. int group_mgmt_cipher;
  277. /* dot11AssociationSAQueryMaximumTimeout (in TUs) */
  278. unsigned int assoc_sa_query_max_timeout;
  279. /* dot11AssociationSAQueryRetryTimeout (in TUs) */
  280. int assoc_sa_query_retry_timeout;
  281. #endif /* CONFIG_IEEE80211W */
  282. enum {
  283. PSK_RADIUS_IGNORED = 0,
  284. PSK_RADIUS_ACCEPTED = 1,
  285. PSK_RADIUS_REQUIRED = 2
  286. } wpa_psk_radius;
  287. int wpa_pairwise;
  288. int group_cipher; /* wpa_group value override from configuation */
  289. int wpa_group;
  290. int wpa_group_rekey;
  291. int wpa_group_rekey_set;
  292. int wpa_strict_rekey;
  293. int wpa_gmk_rekey;
  294. int wpa_ptk_rekey;
  295. u32 wpa_group_update_count;
  296. u32 wpa_pairwise_update_count;
  297. int wpa_disable_eapol_key_retries;
  298. int rsn_pairwise;
  299. int rsn_preauth;
  300. char *rsn_preauth_interfaces;
  301. #ifdef CONFIG_IEEE80211R_AP
  302. /* IEEE 802.11r - Fast BSS Transition */
  303. u8 mobility_domain[MOBILITY_DOMAIN_ID_LEN];
  304. u8 r1_key_holder[FT_R1KH_ID_LEN];
  305. u32 r0_key_lifetime;
  306. int rkh_pos_timeout;
  307. int rkh_neg_timeout;
  308. int rkh_pull_timeout; /* ms */
  309. int rkh_pull_retries;
  310. u32 reassociation_deadline;
  311. struct ft_remote_r0kh *r0kh_list;
  312. struct ft_remote_r1kh *r1kh_list;
  313. int pmk_r1_push;
  314. int ft_over_ds;
  315. int ft_psk_generate_local;
  316. #endif /* CONFIG_IEEE80211R_AP */
  317. char *ctrl_interface; /* directory for UNIX domain sockets */
  318. #ifndef CONFIG_NATIVE_WINDOWS
  319. gid_t ctrl_interface_gid;
  320. #endif /* CONFIG_NATIVE_WINDOWS */
  321. int ctrl_interface_gid_set;
  322. char *ca_cert;
  323. char *server_cert;
  324. char *private_key;
  325. char *private_key_passwd;
  326. int check_crl;
  327. unsigned int tls_session_lifetime;
  328. unsigned int tls_flags;
  329. char *ocsp_stapling_response;
  330. char *ocsp_stapling_response_multi;
  331. char *dh_file;
  332. char *openssl_ciphers;
  333. u8 *pac_opaque_encr_key;
  334. u8 *eap_fast_a_id;
  335. size_t eap_fast_a_id_len;
  336. char *eap_fast_a_id_info;
  337. int eap_fast_prov;
  338. int pac_key_lifetime;
  339. int pac_key_refresh_time;
  340. int eap_sim_aka_result_ind;
  341. int tnc;
  342. int fragment_size;
  343. u16 pwd_group;
  344. char *radius_server_clients;
  345. int radius_server_auth_port;
  346. int radius_server_acct_port;
  347. int radius_server_ipv6;
  348. int use_pae_group_addr; /* Whether to send EAPOL frames to PAE group
  349. * address instead of individual address
  350. * (for driver_wired.c).
  351. */
  352. int ap_max_inactivity;
  353. int ignore_broadcast_ssid;
  354. int no_probe_resp_if_max_sta;
  355. int wmm_enabled;
  356. int wmm_uapsd;
  357. struct hostapd_vlan *vlan;
  358. macaddr bssid;
  359. /*
  360. * Maximum listen interval that STAs can use when associating with this
  361. * BSS. If a STA tries to use larger value, the association will be
  362. * denied with status code 51.
  363. */
  364. u16 max_listen_interval;
  365. int disable_pmksa_caching;
  366. int okc; /* Opportunistic Key Caching */
  367. int wps_state;
  368. #ifdef CONFIG_WPS
  369. int wps_independent;
  370. int ap_setup_locked;
  371. u8 uuid[16];
  372. char *wps_pin_requests;
  373. char *device_name;
  374. char *manufacturer;
  375. char *model_name;
  376. char *model_number;
  377. char *serial_number;
  378. u8 device_type[WPS_DEV_TYPE_LEN];
  379. char *config_methods;
  380. u8 os_version[4];
  381. char *ap_pin;
  382. int skip_cred_build;
  383. u8 *extra_cred;
  384. size_t extra_cred_len;
  385. int wps_cred_processing;
  386. int force_per_enrollee_psk;
  387. u8 *ap_settings;
  388. size_t ap_settings_len;
  389. char *upnp_iface;
  390. char *friendly_name;
  391. char *manufacturer_url;
  392. char *model_description;
  393. char *model_url;
  394. char *upc;
  395. struct wpabuf *wps_vendor_ext[MAX_WPS_VENDOR_EXTENSIONS];
  396. int wps_nfc_pw_from_config;
  397. int wps_nfc_dev_pw_id;
  398. struct wpabuf *wps_nfc_dh_pubkey;
  399. struct wpabuf *wps_nfc_dh_privkey;
  400. struct wpabuf *wps_nfc_dev_pw;
  401. #endif /* CONFIG_WPS */
  402. int pbc_in_m1;
  403. char *server_id;
  404. #define P2P_ENABLED BIT(0)
  405. #define P2P_GROUP_OWNER BIT(1)
  406. #define P2P_GROUP_FORMATION BIT(2)
  407. #define P2P_MANAGE BIT(3)
  408. #define P2P_ALLOW_CROSS_CONNECTION BIT(4)
  409. int p2p;
  410. #ifdef CONFIG_P2P
  411. u8 ip_addr_go[4];
  412. u8 ip_addr_mask[4];
  413. u8 ip_addr_start[4];
  414. u8 ip_addr_end[4];
  415. #endif /* CONFIG_P2P */
  416. int disassoc_low_ack;
  417. int skip_inactivity_poll;
  418. #define TDLS_PROHIBIT BIT(0)
  419. #define TDLS_PROHIBIT_CHAN_SWITCH BIT(1)
  420. int tdls;
  421. int disable_11n;
  422. int disable_11ac;
  423. /* IEEE 802.11v */
  424. int time_advertisement;
  425. char *time_zone;
  426. int wnm_sleep_mode;
  427. int wnm_sleep_mode_no_keys;
  428. int bss_transition;
  429. /* IEEE 802.11u - Interworking */
  430. int interworking;
  431. int access_network_type;
  432. int internet;
  433. int asra;
  434. int esr;
  435. int uesa;
  436. int venue_info_set;
  437. u8 venue_group;
  438. u8 venue_type;
  439. u8 hessid[ETH_ALEN];
  440. /* IEEE 802.11u - Roaming Consortium list */
  441. unsigned int roaming_consortium_count;
  442. struct hostapd_roaming_consortium *roaming_consortium;
  443. /* IEEE 802.11u - Venue Name duples */
  444. unsigned int venue_name_count;
  445. struct hostapd_lang_string *venue_name;
  446. /* Venue URL duples */
  447. unsigned int venue_url_count;
  448. struct hostapd_venue_url *venue_url;
  449. /* IEEE 802.11u - Network Authentication Type */
  450. u8 *network_auth_type;
  451. size_t network_auth_type_len;
  452. /* IEEE 802.11u - IP Address Type Availability */
  453. u8 ipaddr_type_availability;
  454. u8 ipaddr_type_configured;
  455. /* IEEE 802.11u - 3GPP Cellular Network */
  456. u8 *anqp_3gpp_cell_net;
  457. size_t anqp_3gpp_cell_net_len;
  458. /* IEEE 802.11u - Domain Name */
  459. u8 *domain_name;
  460. size_t domain_name_len;
  461. unsigned int nai_realm_count;
  462. struct hostapd_nai_realm_data *nai_realm_data;
  463. struct dl_list anqp_elem; /* list of struct anqp_element */
  464. u16 gas_comeback_delay;
  465. size_t gas_frag_limit;
  466. int gas_address3;
  467. u8 qos_map_set[16 + 2 * 21];
  468. unsigned int qos_map_set_len;
  469. int osen;
  470. int proxy_arp;
  471. int na_mcast_to_ucast;
  472. #ifdef CONFIG_HS20
  473. int hs20;
  474. int disable_dgaf;
  475. u16 anqp_domain_id;
  476. unsigned int hs20_oper_friendly_name_count;
  477. struct hostapd_lang_string *hs20_oper_friendly_name;
  478. u8 *hs20_wan_metrics;
  479. u8 *hs20_connection_capability;
  480. size_t hs20_connection_capability_len;
  481. u8 *hs20_operating_class;
  482. u8 hs20_operating_class_len;
  483. struct hs20_icon {
  484. u16 width;
  485. u16 height;
  486. char language[3];
  487. char type[256];
  488. char name[256];
  489. char file[256];
  490. } *hs20_icons;
  491. size_t hs20_icons_count;
  492. u8 osu_ssid[SSID_MAX_LEN];
  493. size_t osu_ssid_len;
  494. struct hs20_osu_provider {
  495. unsigned int friendly_name_count;
  496. struct hostapd_lang_string *friendly_name;
  497. char *server_uri;
  498. int *method_list;
  499. char **icons;
  500. size_t icons_count;
  501. char *osu_nai;
  502. unsigned int service_desc_count;
  503. struct hostapd_lang_string *service_desc;
  504. } *hs20_osu_providers, *last_osu;
  505. size_t hs20_osu_providers_count;
  506. unsigned int hs20_deauth_req_timeout;
  507. char *subscr_remediation_url;
  508. u8 subscr_remediation_method;
  509. #endif /* CONFIG_HS20 */
  510. u8 wps_rf_bands; /* RF bands for WPS (WPS_RF_*) */
  511. #ifdef CONFIG_RADIUS_TEST
  512. char *dump_msk_file;
  513. #endif /* CONFIG_RADIUS_TEST */
  514. struct wpabuf *vendor_elements;
  515. struct wpabuf *assocresp_elements;
  516. unsigned int sae_anti_clogging_threshold;
  517. unsigned int sae_sync;
  518. int sae_require_mfp;
  519. int *sae_groups;
  520. char *sae_password;
  521. char *wowlan_triggers; /* Wake-on-WLAN triggers */
  522. #ifdef CONFIG_TESTING_OPTIONS
  523. u8 bss_load_test[5];
  524. u8 bss_load_test_set;
  525. struct wpabuf *own_ie_override;
  526. int sae_reflection_attack;
  527. struct wpabuf *sae_commit_override;
  528. #endif /* CONFIG_TESTING_OPTIONS */
  529. #define MESH_ENABLED BIT(0)
  530. int mesh;
  531. u8 radio_measurements[RRM_CAPABILITIES_IE_LEN];
  532. int vendor_vht;
  533. int use_sta_nsts;
  534. char *no_probe_resp_if_seen_on;
  535. char *no_auth_if_seen_on;
  536. int pbss;
  537. #ifdef CONFIG_MBO
  538. int mbo_enabled;
  539. /**
  540. * oce - Enable OCE in AP and/or STA-CFON mode
  541. * - BIT(0) is Reserved
  542. * - Set BIT(1) to enable OCE in STA-CFON mode
  543. * - Set BIT(2) to enable OCE in AP mode
  544. */
  545. unsigned int oce;
  546. int mbo_cell_data_conn_pref;
  547. #endif /* CONFIG_MBO */
  548. int ftm_responder;
  549. int ftm_initiator;
  550. #ifdef CONFIG_FILS
  551. u8 fils_cache_id[FILS_CACHE_ID_LEN];
  552. int fils_cache_id_set;
  553. struct dl_list fils_realms; /* list of struct fils_realm */
  554. int fils_dh_group;
  555. struct hostapd_ip_addr dhcp_server;
  556. int dhcp_rapid_commit_proxy;
  557. unsigned int fils_hlp_wait_time;
  558. u16 dhcp_server_port;
  559. u16 dhcp_relay_port;
  560. #endif /* CONFIG_FILS */
  561. int multicast_to_unicast;
  562. int broadcast_deauth;
  563. #ifdef CONFIG_DPP
  564. char *dpp_connector;
  565. struct wpabuf *dpp_netaccesskey;
  566. unsigned int dpp_netaccesskey_expiry;
  567. struct wpabuf *dpp_csign;
  568. #endif /* CONFIG_DPP */
  569. #ifdef CONFIG_OWE
  570. macaddr owe_transition_bssid;
  571. u8 owe_transition_ssid[SSID_MAX_LEN];
  572. size_t owe_transition_ssid_len;
  573. char owe_transition_ifname[IFNAMSIZ + 1];
  574. int *owe_groups;
  575. #endif /* CONFIG_OWE */
  576. };
  577. /**
  578. * struct he_phy_capabilities_info - HE PHY capabilities
  579. */
  580. struct he_phy_capabilities_info {
  581. Boolean he_su_beamformer;
  582. Boolean he_su_beamformee;
  583. Boolean he_mu_beamformer;
  584. };
  585. /**
  586. * struct he_operation - HE operation
  587. */
  588. struct he_operation {
  589. u8 he_bss_color;
  590. u8 he_default_pe_duration;
  591. u8 he_twt_required;
  592. u8 he_rts_threshold;
  593. };
  594. /**
  595. * struct hostapd_config - Per-radio interface configuration
  596. */
  597. struct hostapd_config {
  598. struct hostapd_bss_config **bss, *last_bss;
  599. size_t num_bss;
  600. u16 beacon_int;
  601. int rts_threshold;
  602. int fragm_threshold;
  603. u8 send_probe_response;
  604. u8 channel;
  605. u8 acs;
  606. struct wpa_freq_range_list acs_ch_list;
  607. int acs_exclude_dfs;
  608. enum hostapd_hw_mode hw_mode; /* HOSTAPD_MODE_IEEE80211A, .. */
  609. enum {
  610. LONG_PREAMBLE = 0,
  611. SHORT_PREAMBLE = 1
  612. } preamble;
  613. int *supported_rates;
  614. int *basic_rates;
  615. unsigned int beacon_rate;
  616. enum beacon_rate_type rate_type;
  617. const struct wpa_driver_ops *driver;
  618. char *driver_params;
  619. int ap_table_max_size;
  620. int ap_table_expiration_time;
  621. unsigned int track_sta_max_num;
  622. unsigned int track_sta_max_age;
  623. char country[3]; /* first two octets: country code as described in
  624. * ISO/IEC 3166-1. Third octet:
  625. * ' ' (ascii 32): all environments
  626. * 'O': Outdoor environemnt only
  627. * 'I': Indoor environment only
  628. * 'X': Used with noncountry entity ("XXX")
  629. * 0x00..0x31: identifying IEEE 802.11 standard
  630. * Annex E table (0x04 = global table)
  631. */
  632. int ieee80211d;
  633. int ieee80211h; /* DFS */
  634. /*
  635. * Local power constraint is an octet encoded as an unsigned integer in
  636. * units of decibels. Invalid value -1 indicates that Power Constraint
  637. * element will not be added.
  638. */
  639. int local_pwr_constraint;
  640. /* Control Spectrum Management bit */
  641. int spectrum_mgmt_required;
  642. struct hostapd_tx_queue_params tx_queue[NUM_TX_QUEUES];
  643. /*
  644. * WMM AC parameters, in same order as 802.1D, i.e.
  645. * 0 = BE (best effort)
  646. * 1 = BK (background)
  647. * 2 = VI (video)
  648. * 3 = VO (voice)
  649. */
  650. struct hostapd_wmm_ac_params wmm_ac_params[4];
  651. int ht_op_mode_fixed;
  652. u16 ht_capab;
  653. int ieee80211n;
  654. int secondary_channel;
  655. int no_pri_sec_switch;
  656. int require_ht;
  657. int obss_interval;
  658. u32 vht_capab;
  659. int ieee80211ac;
  660. int require_vht;
  661. u8 vht_oper_chwidth;
  662. u8 vht_oper_centr_freq_seg0_idx;
  663. u8 vht_oper_centr_freq_seg1_idx;
  664. u8 ht40_plus_minus_allowed;
  665. /* Use driver-generated interface addresses when adding multiple BSSs */
  666. u8 use_driver_iface_addr;
  667. #ifdef CONFIG_FST
  668. struct fst_iface_cfg fst_cfg;
  669. #endif /* CONFIG_FST */
  670. #ifdef CONFIG_P2P
  671. u8 p2p_go_ctwindow;
  672. #endif /* CONFIG_P2P */
  673. #ifdef CONFIG_TESTING_OPTIONS
  674. double ignore_probe_probability;
  675. double ignore_auth_probability;
  676. double ignore_assoc_probability;
  677. double ignore_reassoc_probability;
  678. double corrupt_gtk_rekey_mic_probability;
  679. int ecsa_ie_only;
  680. #endif /* CONFIG_TESTING_OPTIONS */
  681. #ifdef CONFIG_ACS
  682. unsigned int acs_num_scans;
  683. struct acs_bias {
  684. int channel;
  685. double bias;
  686. } *acs_chan_bias;
  687. unsigned int num_acs_chan_bias;
  688. #endif /* CONFIG_ACS */
  689. struct wpabuf *lci;
  690. struct wpabuf *civic;
  691. int stationary_ap;
  692. int ieee80211ax;
  693. #ifdef CONFIG_IEEE80211AX
  694. struct he_phy_capabilities_info he_phy_capab;
  695. struct he_operation he_op;
  696. #endif /* CONFIG_IEEE80211AX */
  697. };
  698. int hostapd_mac_comp(const void *a, const void *b);
  699. struct hostapd_config * hostapd_config_defaults(void);
  700. void hostapd_config_defaults_bss(struct hostapd_bss_config *bss);
  701. void hostapd_config_free_eap_user(struct hostapd_eap_user *user);
  702. void hostapd_config_free_eap_users(struct hostapd_eap_user *user);
  703. void hostapd_config_clear_wpa_psk(struct hostapd_wpa_psk **p);
  704. void hostapd_config_free_bss(struct hostapd_bss_config *conf);
  705. void hostapd_config_free(struct hostapd_config *conf);
  706. int hostapd_maclist_found(struct mac_acl_entry *list, int num_entries,
  707. const u8 *addr, struct vlan_description *vlan_id);
  708. int hostapd_rate_found(int *list, int rate);
  709. const u8 * hostapd_get_psk(const struct hostapd_bss_config *conf,
  710. const u8 *addr, const u8 *p2p_dev_addr,
  711. const u8 *prev_psk);
  712. int hostapd_setup_wpa_psk(struct hostapd_bss_config *conf);
  713. int hostapd_vlan_valid(struct hostapd_vlan *vlan,
  714. struct vlan_description *vlan_desc);
  715. const char * hostapd_get_vlan_id_ifname(struct hostapd_vlan *vlan,
  716. int vlan_id);
  717. struct hostapd_radius_attr *
  718. hostapd_config_get_radius_attr(struct hostapd_radius_attr *attr, u8 type);
  719. int hostapd_config_check(struct hostapd_config *conf, int full_config);
  720. void hostapd_set_security_params(struct hostapd_bss_config *bss,
  721. int full_config);
  722. #endif /* HOSTAPD_CONFIG_H */