wpa_supplicant_i.h
Go to the documentation of this file.00001
00016 #ifndef WPA_SUPPLICANT_I_H
00017 #define WPA_SUPPLICANT_I_H
00018
00019 #include "common/defs.h"
00020
00021 extern const char *wpa_supplicant_version;
00022 extern const char *wpa_supplicant_license;
00023 #ifndef CONFIG_NO_STDOUT_DEBUG
00024 extern const char *wpa_supplicant_full_license1;
00025 extern const char *wpa_supplicant_full_license2;
00026 extern const char *wpa_supplicant_full_license3;
00027 extern const char *wpa_supplicant_full_license4;
00028 extern const char *wpa_supplicant_full_license5;
00029 #endif
00030
00031 struct wpa_scan_result;
00032 struct wpa_scan_res;
00033 struct wpa_sm;
00034 struct wpa_supplicant;
00035 struct ibss_rsn;
00036
00037
00038
00039
00040
00041
00042 struct ctrl_iface_priv;
00043 struct ctrl_iface_global_priv;
00044 struct ctrl_iface_dbus_priv;
00045
00050 struct wpa_interface {
00059 const char *confname;
00060
00071 const char *ctrl_interface;
00072
00077 const char *driver;
00078
00089 const char *driver_param;
00090
00095 const char *ifname;
00096
00106 const char *bridge_ifname;
00107 };
00108
00113 struct wpa_params {
00118 int daemonize;
00119
00124 int wait_for_monitor;
00125
00133 char *pid_file;
00134
00139 int wpa_debug_level;
00140
00151 int wpa_debug_show_keys;
00152
00157 int wpa_debug_timestamp;
00158
00163 char *ctrl_interface;
00164
00169 int dbus_ctrl_interface;
00170
00175 const char *wpa_debug_file_path;
00176
00181 int wpa_debug_syslog;
00182
00191 char *override_driver;
00192
00201 char *override_ctrl_interface;
00202 };
00203
00211 struct wpa_global {
00212 struct wpa_supplicant *ifaces;
00213 struct wpa_params params;
00214 struct ctrl_iface_global_priv *ctrl_iface;
00215
00216 struct ctrl_iface_dbus_priv *dbus_ctrl_iface;
00217
00218 struct ctrl_iface_dbus_new_priv *dbus_new_ctrl_iface;
00219 void **drv_priv;
00220 size_t drv_count;
00221 };
00222
00223
00224 struct wpa_client_mlme {
00225 #ifdef CONFIG_CLIENT_MLME
00226 enum {
00227 IEEE80211_DISABLED, IEEE80211_AUTHENTICATE,
00228 IEEE80211_ASSOCIATE, IEEE80211_ASSOCIATED,
00229 IEEE80211_IBSS_SEARCH, IEEE80211_IBSS_JOINED
00230 } state;
00231 u8 prev_bssid[ETH_ALEN];
00232 u8 ssid[32];
00233 size_t ssid_len;
00234 u16 aid;
00235 u16 ap_capab, capab;
00236 u8 *extra_ie;
00237 size_t extra_ie_len;
00238 u8 *extra_probe_ie;
00239 size_t extra_probe_ie_len;
00240 wpa_key_mgmt key_mgmt;
00241
00242
00243 u8 *assocreq_ies, *assocresp_ies;
00244 size_t assocreq_ies_len, assocresp_ies_len;
00245
00246 int auth_tries, assoc_tries;
00247
00248 unsigned int ssid_set:1;
00249 unsigned int bssid_set:1;
00250 unsigned int prev_bssid_set:1;
00251 unsigned int authenticated:1;
00252 unsigned int associated:1;
00253 unsigned int probereq_poll:1;
00254 unsigned int use_protection:1;
00255 unsigned int create_ibss:1;
00256 unsigned int mixed_cell:1;
00257 unsigned int wmm_enabled:1;
00258
00259 struct os_time last_probe;
00260
00261 #define IEEE80211_AUTH_ALG_OPEN BIT(0)
00262 #define IEEE80211_AUTH_ALG_SHARED_KEY BIT(1)
00263 #define IEEE80211_AUTH_ALG_LEAP BIT(2)
00264 unsigned int auth_algs;
00265 int auth_alg;
00266 int auth_transaction;
00267
00268 struct os_time ibss_join_req;
00269 u8 *probe_resp;
00270 size_t probe_resp_len;
00271 u32 supp_rates_bits;
00272
00273 int wmm_last_param_set;
00274
00275 int sta_scanning;
00276 int scan_hw_mode_idx;
00277 int scan_channel_idx;
00278 enum { SCAN_SET_CHANNEL, SCAN_SEND_PROBE } scan_state;
00279 struct os_time last_scan_completed;
00280 int scan_oper_channel;
00281 int scan_oper_freq;
00282 int scan_oper_phymode;
00283 u8 scan_ssid[32];
00284 size_t scan_ssid_len;
00285 int scan_skip_11b;
00286
00287 struct ieee80211_sta_bss *sta_bss_list;
00288 #define STA_HASH_SIZE 256
00289 #define STA_HASH(sta) (sta[5])
00290 struct ieee80211_sta_bss *sta_bss_hash[STA_HASH_SIZE];
00291
00292 int cts_protect_erp_frames;
00293
00294 hostapd_hw_mode phymode;
00295 struct hostapd_hw_modes *modes;
00296 size_t num_modes;
00297 unsigned int hw_modes;
00298
00299 int num_curr_rates;
00300 struct hostapd_rate_data *curr_rates;
00301 int freq;
00302 int channel;
00303
00304 #ifdef CONFIG_IEEE80211R
00305 u8 current_md[6];
00306 u8 *ft_ies;
00307 size_t ft_ies_len;
00308 #endif
00309
00310 #else
00311 int dummy;
00312 #endif
00313 };
00314
00324 struct wpa_supplicant {
00325 struct wpa_global *global;
00326 struct wpa_supplicant *next;
00327 struct l2_packet_data *l2;
00328 struct l2_packet_data *l2_br;
00329 unsigned char own_addr[ETH_ALEN];
00330 char ifname[100];
00331 #ifdef CONFIG_CTRL_IFACE_DBUS
00332 char *dbus_path;
00333 #endif
00334 #ifdef CONFIG_CTRL_IFACE_DBUS_NEW
00335 char *dbus_new_path;
00336 #endif
00337 char bridge_ifname[16];
00338
00339 char *confname;
00340 struct wpa_config *conf;
00341 int countermeasures;
00342 os_time_t last_michael_mic_error;
00343 u8 bssid[ETH_ALEN];
00344 u8 pending_bssid[ETH_ALEN];
00345
00346 int reassociate;
00347 int disconnected;
00348
00349 struct wpa_ssid *current_ssid;
00350 int ap_ies_from_associnfo;
00351
00352
00353 int pairwise_cipher;
00354 int group_cipher;
00355 int key_mgmt;
00356 int mgmt_group_cipher;
00357
00358 void *drv_priv;
00359 void *global_drv_priv;
00360
00361 struct wpa_ssid *prev_scan_ssid;
00362
00363
00364
00365
00366
00367 #define WILDCARD_SSID_SCAN ((struct wpa_ssid *) 1)
00368
00369 struct wpa_scan_results *scan_res;
00370
00371 struct wpa_driver_ops *driver;
00372 int interface_removed;
00373
00374 struct wpa_sm *wpa;
00375 struct eapol_sm *eapol;
00376
00377 struct ctrl_iface_priv *ctrl_iface;
00378
00379 wpa_states wpa_state;
00380 int scanning;
00381 int new_connection;
00382 int reassociated_connection;
00383
00384 int eapol_received;
00385
00386
00387 struct scard_data *scard;
00388
00389 unsigned char last_eapol_src[ETH_ALEN];
00390
00391 int keys_cleared;
00392
00393 struct wpa_blacklist *blacklist;
00394
00395 int scan_req;
00396
00397 int scan_res_tried;
00398
00399
00400
00401 int scan_runs;
00402
00403 struct wpa_client_mlme mlme;
00404 unsigned int drv_flags;
00405 int max_scan_ssids;
00406
00407 int pending_mic_error_report;
00408 int pending_mic_error_pairwise;
00409 int mic_errors_seen;
00410
00411 struct wps_context *wps;
00412 int wps_success;
00413 struct wps_er *wps_er;
00414 int blacklist_cleared;
00415
00416 struct wpabuf *pending_eapol_rx;
00417 struct os_time pending_eapol_rx_time;
00418 u8 pending_eapol_rx_src[ETH_ALEN];
00419
00420 struct ibss_rsn *ibss_rsn;
00421
00422 #ifdef CONFIG_SME
00423 struct {
00424 u8 ssid[32];
00425 size_t ssid_len;
00426 int freq;
00427 u8 assoc_req_ie[80];
00428 size_t assoc_req_ie_len;
00429 int mfp;
00430 int ft_used;
00431 u8 mobility_domain[2];
00432 u8 *ft_ies;
00433 size_t ft_ies_len;
00434 u8 prev_bssid[ETH_ALEN];
00435 int prev_bssid_set;
00436 } sme;
00437 #endif
00438
00439 #ifdef CONFIG_AP
00440 struct hostapd_iface *ap_iface;
00441 #endif
00442
00443 struct wpa_ssid *bgscan_ssid;
00444 const struct bgscan_ops *bgscan;
00445 void *bgscan_priv;
00446 };
00447
00448
00449
00450 int wpa_set_wep_keys(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid);
00451
00452 int wpa_supplicant_reload_configuration(struct wpa_supplicant *wpa_s);
00453
00454 const char * wpa_supplicant_state_txt(int state);
00455 int wpa_supplicant_driver_init(struct wpa_supplicant *wpa_s);
00456 int wpa_supplicant_set_suites(struct wpa_supplicant *wpa_s,
00457 struct wpa_scan_res *bss,
00458 struct wpa_ssid *ssid,
00459 u8 *wpa_ie, size_t *wpa_ie_len);
00460 void wpa_supplicant_associate(struct wpa_supplicant *wpa_s,
00461 struct wpa_scan_res *bss,
00462 struct wpa_ssid *ssid);
00463 void wpa_supplicant_set_non_wpa_policy(struct wpa_supplicant *wpa_s,
00464 struct wpa_ssid *ssid);
00465 void wpa_supplicant_initiate_eapol(struct wpa_supplicant *wpa_s);
00466 int wpa_supplicant_get_scan_results(struct wpa_supplicant *wpa_s);
00467 void wpa_clear_keys(struct wpa_supplicant *wpa_s, const u8 *addr);
00468 void wpa_supplicant_req_auth_timeout(struct wpa_supplicant *wpa_s,
00469 int sec, int usec);
00470 void wpa_supplicant_set_state(struct wpa_supplicant *wpa_s, wpa_states state);
00471 struct wpa_ssid * wpa_supplicant_get_ssid(struct wpa_supplicant *wpa_s);
00472 void wpa_supplicant_cancel_auth_timeout(struct wpa_supplicant *wpa_s);
00473 void wpa_supplicant_deauthenticate(struct wpa_supplicant *wpa_s,
00474 int reason_code);
00475 void wpa_supplicant_disassociate(struct wpa_supplicant *wpa_s,
00476 int reason_code);
00477
00478 void wpa_supplicant_enable_network(struct wpa_supplicant *wpa_s,
00479 struct wpa_ssid *ssid);
00480 void wpa_supplicant_disable_network(struct wpa_supplicant *wpa_s,
00481 struct wpa_ssid *ssid);
00482 void wpa_supplicant_select_network(struct wpa_supplicant *wpa_s,
00483 struct wpa_ssid *ssid);
00484 int wpa_supplicant_set_ap_scan(struct wpa_supplicant *wpa_s,
00485 int ap_scan);
00486 int wpa_supplicant_set_debug_params(struct wpa_global *global,
00487 int debug_level, int debug_timestamp,
00488 int debug_show_keys);
00489
00490 void wpa_show_license(void);
00491
00492 struct wpa_supplicant * wpa_supplicant_add_iface(struct wpa_global *global,
00493 struct wpa_interface *iface);
00494 int wpa_supplicant_remove_iface(struct wpa_global *global,
00495 struct wpa_supplicant *wpa_s);
00496 struct wpa_supplicant * wpa_supplicant_get_iface(struct wpa_global *global,
00497 const char *ifname);
00498 struct wpa_global * wpa_supplicant_init(struct wpa_params *params);
00499 int wpa_supplicant_run(struct wpa_global *global);
00500 void wpa_supplicant_deinit(struct wpa_global *global);
00501
00502 int wpa_supplicant_scard_init(struct wpa_supplicant *wpa_s,
00503 struct wpa_ssid *ssid);
00504
00505
00506 int wpa_supplicant_enabled_networks(struct wpa_config *conf);
00507 void wpa_supplicant_req_scan(struct wpa_supplicant *wpa_s, int sec, int usec);
00508 void wpa_supplicant_cancel_scan(struct wpa_supplicant *wpa_s);
00509 void wpa_supplicant_notify_scanning(struct wpa_supplicant *wpa_s,
00510 int scanning);
00511 struct wpa_driver_scan_params;
00512 int wpa_supplicant_trigger_scan(struct wpa_supplicant *wpa_s,
00513 struct wpa_driver_scan_params *params);
00514
00515
00516 void wpa_supplicant_mark_disassoc(struct wpa_supplicant *wpa_s);
00517
00518 #endif
00519