2 * hostapd / Initialization and configuration
3 * Host AP kernel driver
4 * Copyright (c) 2002-2008, Jouni Malinen <j@w1.fi>
5 * Copyright (c) 2007-2008, Intel Corporation
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
11 * Alternatively, this software may be distributed under the terms of BSD
14 * See README and COPYING for more details.
21 #include "hostapd_defs.h"
23 struct wpa_driver_ops;
25 struct radius_server_data;
26 struct upnp_wps_device_sm;
28 #ifdef CONFIG_FULL_DYNAMIC_VLAN
29 struct full_dynamic_vlan;
30 #endif /* CONFIG_FULL_DYNAMIC_VLAN */
33 * struct hostapd_data - hostapd per-BSS data structure
36 struct hostapd_iface *iface;
37 struct hostapd_config *iconf;
38 struct hostapd_bss_config *conf;
39 int interface_added; /* virtual interface added for this BSS */
41 u8 own_addr[ETH_ALEN];
43 int num_sta; /* number of entries in sta_list */
44 struct sta_info *sta_list; /* STA info list head */
45 #define STA_HASH_SIZE 256
46 #define STA_HASH(sta) (sta[5])
47 struct sta_info *sta_hash[STA_HASH_SIZE];
50 * Bitfield for indicating which AIDs are allocated. Only AID values
51 * 1-2007 are used and as such, the bit at index 0 corresponds to AID
54 #define AID_WORDS ((2008 + 31) / 32)
55 u32 sta_aid[AID_WORDS];
57 const struct wpa_driver_ops *driver;
61 u8 default_wep_key_idx;
63 struct radius_client_data *radius;
64 int radius_client_reconfigured;
65 u32 acct_session_id_hi, acct_session_id_lo;
67 struct iapp_data *iapp;
69 struct hostapd_cached_radius_acl *acl_cache;
70 struct hostapd_acl_query_data *acl_queries;
72 struct wpa_authenticator *wpa_auth;
73 struct eapol_authenticator *eapol_auth;
75 struct rsn_preauth_interface *preauth_iface;
76 time_t michael_mic_failure;
77 int michael_mic_failures;
78 int tkip_countermeasures;
81 struct wpa_ctrl_dst *ctrl_dst;
84 void *eap_sim_db_priv;
85 struct radius_server_data *radius_srv;
87 int parameter_set_count;
89 #ifdef CONFIG_FULL_DYNAMIC_VLAN
90 struct full_dynamic_vlan *full_dynamic_vlan;
91 #endif /* CONFIG_FULL_DYNAMIC_VLAN */
93 struct l2_packet_data *l2;
94 struct wps_context *wps;
98 size_t wps_beacon_ie_len;
99 u8 *wps_probe_resp_ie;
100 size_t wps_probe_resp_ie_len;
101 unsigned int ap_pin_failures;
102 struct upnp_wps_device_sm *wps_upnp;
103 #endif /* CONFIG_WPS */
108 * struct hostapd_iface - hostapd per-interface data structure
110 struct hostapd_iface {
113 struct hostapd_config *conf;
116 struct hostapd_data **bss;
118 int num_ap; /* number of entries in ap_list */
119 struct ap_info *ap_list; /* AP info list head */
120 struct ap_info *ap_hash[STA_HASH_SIZE];
121 struct ap_info *ap_iter_list;
123 struct hostapd_hw_modes *hw_features;
125 struct hostapd_hw_modes *current_mode;
126 /* Rates that are currently used (i.e., filtered copy of
127 * current_mode->channels */
129 struct hostapd_rate_data *current_rates;
133 /* Number of associated Non-ERP stations (i.e., stations using 802.11b
137 /* Number of associated stations that do not support Short Slot Time */
138 int num_sta_no_short_slot_time;
140 /* Number of associated stations that do not support Short Preamble */
141 int num_sta_no_short_preamble;
143 int olbc; /* Overlapping Legacy BSS Condition */
145 /* Number of HT associated stations that do not support greenfield */
146 int num_sta_ht_no_gf;
148 /* Number of associated non-HT stations */
151 /* Number of HT associated stations 20 MHz */
152 int num_sta_ht_20mhz;
154 /* Overlapping BSS information */
158 void (*scan_cb)(struct hostapd_iface *iface);
161 int hostapd_reload_config(struct hostapd_iface *iface);
162 struct hostapd_data *
163 hostapd_alloc_bss_data(struct hostapd_iface *hapd_iface,
164 struct hostapd_config *conf,
165 struct hostapd_bss_config *bss);
166 int hostapd_setup_interface(struct hostapd_iface *iface);
167 int hostapd_setup_interface_complete(struct hostapd_iface *iface, int err);
168 void hostapd_interface_deinit(struct hostapd_iface *iface);
169 int handle_reload_iface(struct hostapd_iface *iface, void *ctx);
170 int handle_dump_state_iface(struct hostapd_iface *iface, void *ctx);
172 int hostapd_for_each_interface(int (*cb)(struct hostapd_iface *iface,
173 void *ctx), void *ctx);
175 #endif /* HOSTAPD_H */