hostapd.h
Go to the documentation of this file.00001
00018 #ifndef HOSTAPD_H
00019 #define HOSTAPD_H
00020
00021 #include "common.h"
00022 #include "hostapd_defs.h"
00023
00024 struct wpa_driver_ops;
00025 struct wpa_ctrl_dst;
00026 struct radius_server_data;
00027 struct upnp_wps_device_sm;
00028
00029 #ifdef CONFIG_FULL_DYNAMIC_VLAN
00030 struct full_dynamic_vlan;
00031 #endif
00032
00033 struct hostapd_probereq_cb {
00034 void (*cb)(void *ctx, const u8 *sa, const u8 *ie, size_t ie_len);
00035 void *ctx;
00036 };
00037
00042 struct hostapd_data {
00043 struct hostapd_iface *iface;
00044 struct hostapd_config *iconf;
00045 struct hostapd_bss_config *conf;
00046 int interface_added;
00047
00048 u8 own_addr[ETH_ALEN];
00049
00050 int num_sta;
00051 struct sta_info *sta_list;
00052 #define STA_HASH_SIZE 256
00053 #define STA_HASH(sta) (sta[5])
00054 struct sta_info *sta_hash[STA_HASH_SIZE];
00055
00056
00057
00058
00059
00060
00061 #define AID_WORDS ((2008 + 31) / 32)
00062 u32 sta_aid[AID_WORDS];
00063
00064 const struct wpa_driver_ops *driver;
00065 void *drv_priv;
00066
00067 void *msg_ctx;
00068
00069 struct radius_client_data *radius;
00070 int radius_client_reconfigured;
00071 u32 acct_session_id_hi, acct_session_id_lo;
00072
00073 struct iapp_data *iapp;
00074
00075 struct hostapd_cached_radius_acl *acl_cache;
00076 struct hostapd_acl_query_data *acl_queries;
00077
00078 struct wpa_authenticator *wpa_auth;
00079 struct eapol_authenticator *eapol_auth;
00080
00081 struct rsn_preauth_interface *preauth_iface;
00082 time_t michael_mic_failure;
00083 int michael_mic_failures;
00084 int tkip_countermeasures;
00085
00086 int ctrl_sock;
00087 struct wpa_ctrl_dst *ctrl_dst;
00088
00089 void *ssl_ctx;
00090 void *eap_sim_db_priv;
00091 struct radius_server_data *radius_srv;
00092
00093 int parameter_set_count;
00094
00095 #ifdef CONFIG_FULL_DYNAMIC_VLAN
00096 struct full_dynamic_vlan *full_dynamic_vlan;
00097 #endif
00098
00099 struct l2_packet_data *l2;
00100 struct wps_context *wps;
00101
00102 #ifdef CONFIG_WPS
00103 u8 *wps_beacon_ie;
00104 size_t wps_beacon_ie_len;
00105 u8 *wps_probe_resp_ie;
00106 size_t wps_probe_resp_ie_len;
00107 unsigned int ap_pin_failures;
00108 struct upnp_wps_device_sm *wps_upnp;
00109 #endif
00110
00111 struct hostapd_probereq_cb *probereq_cb;
00112 size_t num_probereq_cb;
00113 };
00114
00115
00120 struct hostapd_iface {
00121 void *owner;
00122 char *config_fname;
00123 struct hostapd_config *conf;
00124
00125 size_t num_bss;
00126 struct hostapd_data **bss;
00127
00128 int num_ap;
00129 struct ap_info *ap_list;
00130 struct ap_info *ap_hash[STA_HASH_SIZE];
00131 struct ap_info *ap_iter_list;
00132
00133 struct hostapd_hw_modes *hw_features;
00134 int num_hw_features;
00135 struct hostapd_hw_modes *current_mode;
00136
00137
00138 int num_rates;
00139 struct hostapd_rate_data *current_rates;
00140
00141 u16 hw_flags;
00142
00143
00144
00145 int num_sta_non_erp;
00146
00147
00148 int num_sta_no_short_slot_time;
00149
00150
00151 int num_sta_no_short_preamble;
00152
00153 int olbc;
00154
00155
00156 int num_sta_ht_no_gf;
00157
00158
00159 int num_sta_no_ht;
00160
00161
00162 int num_sta_ht_20mhz;
00163
00164
00165 int olbc_ht;
00166
00167 u16 ht_op_mode;
00168 void (*scan_cb)(struct hostapd_iface *iface);
00169 };
00170
00171 int hostapd_reload_config(struct hostapd_iface *iface);
00172 struct hostapd_data *
00173 hostapd_alloc_bss_data(struct hostapd_iface *hapd_iface,
00174 struct hostapd_config *conf,
00175 struct hostapd_bss_config *bss);
00176 int hostapd_setup_interface(struct hostapd_iface *iface);
00177 int hostapd_setup_interface_complete(struct hostapd_iface *iface, int err);
00178 void hostapd_interface_deinit(struct hostapd_iface *iface);
00179 int handle_reload_iface(struct hostapd_iface *iface, void *ctx);
00180 int handle_dump_state_iface(struct hostapd_iface *iface, void *ctx);
00181
00182 int hostapd_for_each_interface(int (*cb)(struct hostapd_iface *iface,
00183 void *ctx), void *ctx);
00184
00185 int hostapd_register_probereq_cb(struct hostapd_data *hapd,
00186 void (*cb)(void *ctx, const u8 *sa,
00187 const u8 *ie, size_t ie_len),
00188 void *ctx);
00189
00190 #endif
00191