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 */
32 struct hostapd_probereq_cb {
33 void (*cb)(void *ctx, const u8 *sa, const u8 *ie, size_t ie_len);
38 * struct hostapd_data - hostapd per-BSS data structure
41 struct hostapd_iface *iface;
42 struct hostapd_config *iconf;
43 struct hostapd_bss_config *conf;
44 int interface_added; /* virtual interface added for this BSS */
46 u8 own_addr[ETH_ALEN];
48 int num_sta; /* number of entries in sta_list */
49 struct sta_info *sta_list; /* STA info list head */
50 #define STA_HASH_SIZE 256
51 #define STA_HASH(sta) (sta[5])
52 struct sta_info *sta_hash[STA_HASH_SIZE];
55 * Bitfield for indicating which AIDs are allocated. Only AID values
56 * 1-2007 are used and as such, the bit at index 0 corresponds to AID
59 #define AID_WORDS ((2008 + 31) / 32)
60 u32 sta_aid[AID_WORDS];
62 const struct wpa_driver_ops *driver;
65 struct radius_client_data *radius;
66 int radius_client_reconfigured;
67 u32 acct_session_id_hi, acct_session_id_lo;
69 struct iapp_data *iapp;
71 struct hostapd_cached_radius_acl *acl_cache;
72 struct hostapd_acl_query_data *acl_queries;
74 struct wpa_authenticator *wpa_auth;
75 struct eapol_authenticator *eapol_auth;
77 struct rsn_preauth_interface *preauth_iface;
78 time_t michael_mic_failure;
79 int michael_mic_failures;
80 int tkip_countermeasures;
83 struct wpa_ctrl_dst *ctrl_dst;
86 void *eap_sim_db_priv;
87 struct radius_server_data *radius_srv;
89 int parameter_set_count;
91 #ifdef CONFIG_FULL_DYNAMIC_VLAN
92 struct full_dynamic_vlan *full_dynamic_vlan;
93 #endif /* CONFIG_FULL_DYNAMIC_VLAN */
95 struct l2_packet_data *l2;
96 struct wps_context *wps;
100 size_t wps_beacon_ie_len;
101 u8 *wps_probe_resp_ie;
102 size_t wps_probe_resp_ie_len;
103 unsigned int ap_pin_failures;
104 struct upnp_wps_device_sm *wps_upnp;
105 #endif /* CONFIG_WPS */
107 struct hostapd_probereq_cb *probereq_cb;
108 size_t num_probereq_cb;
113 * struct hostapd_iface - hostapd per-interface data structure
115 struct hostapd_iface {
118 struct hostapd_config *conf;
121 struct hostapd_data **bss;
123 int num_ap; /* number of entries in ap_list */
124 struct ap_info *ap_list; /* AP info list head */
125 struct ap_info *ap_hash[STA_HASH_SIZE];
126 struct ap_info *ap_iter_list;
128 struct hostapd_hw_modes *hw_features;
130 struct hostapd_hw_modes *current_mode;
131 /* Rates that are currently used (i.e., filtered copy of
132 * current_mode->channels */
134 struct hostapd_rate_data *current_rates;
138 /* Number of associated Non-ERP stations (i.e., stations using 802.11b
142 /* Number of associated stations that do not support Short Slot Time */
143 int num_sta_no_short_slot_time;
145 /* Number of associated stations that do not support Short Preamble */
146 int num_sta_no_short_preamble;
148 int olbc; /* Overlapping Legacy BSS Condition */
150 /* Number of HT associated stations that do not support greenfield */
151 int num_sta_ht_no_gf;
153 /* Number of associated non-HT stations */
156 /* Number of HT associated stations 20 MHz */
157 int num_sta_ht_20mhz;
159 /* Overlapping BSS information */
163 void (*scan_cb)(struct hostapd_iface *iface);
166 int hostapd_reload_config(struct hostapd_iface *iface);
167 struct hostapd_data *
168 hostapd_alloc_bss_data(struct hostapd_iface *hapd_iface,
169 struct hostapd_config *conf,
170 struct hostapd_bss_config *bss);
171 int hostapd_setup_interface(struct hostapd_iface *iface);
172 int hostapd_setup_interface_complete(struct hostapd_iface *iface, int err);
173 void hostapd_interface_deinit(struct hostapd_iface *iface);
174 int handle_reload_iface(struct hostapd_iface *iface, void *ctx);
175 int handle_dump_state_iface(struct hostapd_iface *iface, void *ctx);
177 int hostapd_for_each_interface(int (*cb)(struct hostapd_iface *iface,
178 void *ctx), void *ctx);
180 int hostapd_register_probereq_cb(struct hostapd_data *hapd,
181 void (*cb)(void *ctx, const u8 *sa,
182 const u8 *ie, size_t ie_len),
185 #endif /* HOSTAPD_H */