hostapd.h

Go to the documentation of this file.
00001 
00018 #ifndef HOSTAPD_H
00019 #define HOSTAPD_H
00020 
00021 #include "common.h"
00022 
00023 #define MAX_VLAN_ID 4094
00024 
00025 struct wpa_driver_ops;
00026 struct wpa_ctrl_dst;
00027 struct radius_server_data;
00028 struct upnp_wps_device_sm;
00029 
00030 #ifdef CONFIG_FULL_DYNAMIC_VLAN
00031 struct full_dynamic_vlan;
00032 #endif /* CONFIG_FULL_DYNAMIC_VLAN */
00033 
00034 struct hostapd_probereq_cb {
00035         void (*cb)(void *ctx, const u8 *sa, const u8 *ie, size_t ie_len);
00036         void *ctx;
00037 };
00038 
00043 struct hostapd_data {
00044         struct hostapd_iface *iface;
00045         struct hostapd_config *iconf;
00046         struct hostapd_bss_config *conf;
00047         int interface_added; /* virtual interface added for this BSS */
00048 
00049         u8 own_addr[ETH_ALEN];
00050 
00051         int num_sta; /* number of entries in sta_list */
00052         struct sta_info *sta_list; /* STA info list head */
00053 #define STA_HASH_SIZE 256
00054 #define STA_HASH(sta) (sta[5])
00055         struct sta_info *sta_hash[STA_HASH_SIZE];
00056 
00057         /*
00058          * Bitfield for indicating which AIDs are allocated. Only AID values
00059          * 1-2007 are used and as such, the bit at index 0 corresponds to AID
00060          * 1.
00061          */
00062 #define AID_WORDS ((2008 + 31) / 32)
00063         u32 sta_aid[AID_WORDS];
00064 
00065         const struct wpa_driver_ops *driver;
00066         void *drv_priv;
00067 
00068         void *msg_ctx; /* ctx for wpa_msg() calls */
00069 
00070         struct radius_client_data *radius;
00071         int radius_client_reconfigured;
00072         u32 acct_session_id_hi, acct_session_id_lo;
00073 
00074         struct iapp_data *iapp;
00075 
00076         struct hostapd_cached_radius_acl *acl_cache;
00077         struct hostapd_acl_query_data *acl_queries;
00078 
00079         struct wpa_authenticator *wpa_auth;
00080         struct eapol_authenticator *eapol_auth;
00081 
00082         struct rsn_preauth_interface *preauth_iface;
00083         time_t michael_mic_failure;
00084         int michael_mic_failures;
00085         int tkip_countermeasures;
00086 
00087         int ctrl_sock;
00088         struct wpa_ctrl_dst *ctrl_dst;
00089 
00090         void *ssl_ctx;
00091         void *eap_sim_db_priv;
00092         struct radius_server_data *radius_srv;
00093 
00094         int parameter_set_count;
00095 
00096 #ifdef CONFIG_FULL_DYNAMIC_VLAN
00097         struct full_dynamic_vlan *full_dynamic_vlan;
00098 #endif /* CONFIG_FULL_DYNAMIC_VLAN */
00099 
00100         struct l2_packet_data *l2;
00101         struct wps_context *wps;
00102 
00103 #ifdef CONFIG_WPS
00104         u8 *wps_beacon_ie;
00105         size_t wps_beacon_ie_len;
00106         u8 *wps_probe_resp_ie;
00107         size_t wps_probe_resp_ie_len;
00108         unsigned int ap_pin_failures;
00109         struct upnp_wps_device_sm *wps_upnp;
00110 #endif /* CONFIG_WPS */
00111 
00112         struct hostapd_probereq_cb *probereq_cb;
00113         size_t num_probereq_cb;
00114 };
00115 
00116 
00121 struct hostapd_iface {
00122         void *owner;
00123         char *config_fname;
00124         struct hostapd_config *conf;
00125 
00126         size_t num_bss;
00127         struct hostapd_data **bss;
00128 
00129         int num_ap; /* number of entries in ap_list */
00130         struct ap_info *ap_list; /* AP info list head */
00131         struct ap_info *ap_hash[STA_HASH_SIZE];
00132         struct ap_info *ap_iter_list;
00133 
00134         struct hostapd_hw_modes *hw_features;
00135         int num_hw_features;
00136         struct hostapd_hw_modes *current_mode;
00137         /* Rates that are currently used (i.e., filtered copy of
00138          * current_mode->channels */
00139         int num_rates;
00140         struct hostapd_rate_data *current_rates;
00141 
00142         u16 hw_flags;
00143 
00144         /* Number of associated Non-ERP stations (i.e., stations using 802.11b
00145          * in 802.11g BSS) */
00146         int num_sta_non_erp;
00147 
00148         /* Number of associated stations that do not support Short Slot Time */
00149         int num_sta_no_short_slot_time;
00150 
00151         /* Number of associated stations that do not support Short Preamble */
00152         int num_sta_no_short_preamble;
00153 
00154         int olbc; /* Overlapping Legacy BSS Condition */
00155 
00156         /* Number of HT associated stations that do not support greenfield */
00157         int num_sta_ht_no_gf;
00158 
00159         /* Number of associated non-HT stations */
00160         int num_sta_no_ht;
00161 
00162         /* Number of HT associated stations 20 MHz */
00163         int num_sta_ht_20mhz;
00164 
00165         /* Overlapping BSS information */
00166         int olbc_ht;
00167 
00168         u16 ht_op_mode;
00169         void (*scan_cb)(struct hostapd_iface *iface);
00170 };
00171 
00172 int hostapd_reload_config(struct hostapd_iface *iface);
00173 struct hostapd_data *
00174 hostapd_alloc_bss_data(struct hostapd_iface *hapd_iface,
00175                        struct hostapd_config *conf,
00176                        struct hostapd_bss_config *bss);
00177 int hostapd_setup_interface(struct hostapd_iface *iface);
00178 int hostapd_setup_interface_complete(struct hostapd_iface *iface, int err);
00179 void hostapd_interface_deinit(struct hostapd_iface *iface);
00180 int handle_reload_iface(struct hostapd_iface *iface, void *ctx);
00181 int handle_dump_state_iface(struct hostapd_iface *iface, void *ctx);
00182 
00183 int hostapd_for_each_interface(int (*cb)(struct hostapd_iface *iface,
00184                                          void *ctx), void *ctx);
00185 
00186 int hostapd_register_probereq_cb(struct hostapd_data *hapd,
00187                                  void (*cb)(void *ctx, const u8 *sa,
00188                                             const u8 *ie, size_t ie_len),
00189                                  void *ctx);
00190 
00191 #endif /* HOSTAPD_H */
00192 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines

Generated on Sat Nov 28 23:07:46 2009 for wpa_supplicant/hostapd by  doxygen 1.6.1