driver.h File Reference

WPA Supplicant - driver interface definition. More...

#include "defs.h"

Go to the source code of this file.

Data Structures

struct  hostapd_channel_data
struct  hostapd_rate_data
struct  hostapd_hw_modes
struct  wpa_scan_res
 Scan result for an BSS/IBSS. More...
struct  wpa_scan_results
 Scan results. More...
struct  wpa_interface_info
 Network interface information. More...
struct  wpa_driver_scan_params
 Scan parameters. More...
struct  wpa_driver_scan_params::wpa_driver_scan_ssid
 SSIDs to scan for. More...
struct  wpa_driver_auth_params
 Authentication parameters. More...
struct  wpa_driver_associate_params
 Association parameters. More...
struct  wpa_driver_capa
 Driver capability information. More...
struct  ieee80211_rx_status
struct  hostap_sta_driver_data
struct  hostapd_sta_add_params
struct  hostapd_freq_params
struct  wpa_init_params
struct  wpa_driver_ops
 Driver interface API definition. More...
union  wpa_event_data
struct  wpa_event_data::assoc_info
 Data for EVENT_ASSOC and EVENT_ASSOCINFO events. More...
struct  wpa_event_data::michael_mic_failure
 Data for EVENT_MICHAEL_MIC_FAILURE. More...
struct  wpa_event_data::interface_status
 Data for EVENT_INTERFACE_STATUS. More...
struct  wpa_event_data::pmkid_candidate
 Data for EVENT_PMKID_CANDIDATE. More...
struct  wpa_event_data::stkstart
 Data for EVENT_STKSTART. More...
struct  wpa_event_data::ft_ies
 FT information elements (EVENT_FT_RESPONSE). More...
struct  wpa_event_data::ibss_rsn_start
 Data for EVENT_IBSS_RSN_START. More...
struct  wpa_event_data::auth_info
 Data for EVENT_AUTH events. More...
struct  wpa_event_data::assoc_reject
 Data for EVENT_ASSOC_REJECT events. More...
struct  wpa_event_data::timeout_event
struct  hostapd_frame_info

Defines

#define WPA_SUPPLICANT_DRIVER_VERSION   4
#define HOSTAPD_CHAN_DISABLED   0x00000001
#define HOSTAPD_CHAN_PASSIVE_SCAN   0x00000002
#define HOSTAPD_CHAN_NO_IBSS   0x00000004
#define HOSTAPD_CHAN_RADAR   0x00000008
#define HOSTAPD_RATE_ERP   0x00000001
#define HOSTAPD_RATE_BASIC   0x00000002
#define HOSTAPD_RATE_PREAMBLE2   0x00000004
#define HOSTAPD_RATE_SUPPORTED   0x00000010
#define HOSTAPD_RATE_OFDM   0x00000020
#define HOSTAPD_RATE_CCK   0x00000040
#define HOSTAPD_RATE_MANDATORY   0x00000100
#define AUTH_ALG_OPEN_SYSTEM   0x01
#define AUTH_ALG_SHARED_KEY   0x02
#define AUTH_ALG_LEAP   0x04
#define AUTH_ALG_FT   0x08
#define IEEE80211_MODE_INFRA   0
#define IEEE80211_MODE_IBSS   1
#define IEEE80211_MODE_AP   2
#define IEEE80211_CAP_ESS   0x0001
#define IEEE80211_CAP_IBSS   0x0002
#define IEEE80211_CAP_PRIVACY   0x0010
#define WPA_SCAN_QUAL_INVALID   BIT(0)
#define WPA_SCAN_NOISE_INVALID   BIT(1)
#define WPA_SCAN_LEVEL_INVALID   BIT(2)
#define WPA_SCAN_LEVEL_DBM   BIT(3)
#define WPAS_MAX_SCAN_SSIDS   4
#define WPA_DRIVER_CAPA_KEY_MGMT_WPA   0x00000001
#define WPA_DRIVER_CAPA_KEY_MGMT_WPA2   0x00000002
#define WPA_DRIVER_CAPA_KEY_MGMT_WPA_PSK   0x00000004
#define WPA_DRIVER_CAPA_KEY_MGMT_WPA2_PSK   0x00000008
#define WPA_DRIVER_CAPA_KEY_MGMT_WPA_NONE   0x00000010
#define WPA_DRIVER_CAPA_KEY_MGMT_FT   0x00000020
#define WPA_DRIVER_CAPA_KEY_MGMT_FT_PSK   0x00000040
#define WPA_DRIVER_CAPA_ENC_WEP40   0x00000001
#define WPA_DRIVER_CAPA_ENC_WEP104   0x00000002
#define WPA_DRIVER_CAPA_ENC_TKIP   0x00000004
#define WPA_DRIVER_CAPA_ENC_CCMP   0x00000008
#define WPA_DRIVER_AUTH_OPEN   0x00000001
#define WPA_DRIVER_AUTH_SHARED   0x00000002
#define WPA_DRIVER_AUTH_LEAP   0x00000004
#define WPA_DRIVER_FLAGS_DRIVER_IE   0x00000001
#define WPA_DRIVER_FLAGS_SET_KEYS_AFTER_ASSOC   0x00000002
#define WPA_DRIVER_FLAGS_USER_SPACE_MLME   0x00000004
#define WPA_DRIVER_FLAGS_4WAY_HANDSHAKE   0x00000008
#define WPA_DRIVER_FLAGS_WIRED   0x00000010
#define WPA_DRIVER_FLAGS_SME   0x00000020
#define WPA_DRIVER_FLAGS_AP   0x00000040
#define WPA_DRIVER_FLAGS_SET_KEYS_AFTER_ASSOC_DONE   0x00000080
#define WPA_IE_VENDOR_TYPE   0x0050f201
#define WPS_IE_VENDOR_TYPE   0x0050f204

Enumerations

enum  hostapd_driver_if_type { HOSTAPD_IF_VLAN }
enum  wpa_event_type {
  EVENT_ASSOC, EVENT_DISASSOC, EVENT_MICHAEL_MIC_FAILURE, EVENT_SCAN_RESULTS,
  EVENT_ASSOCINFO, EVENT_INTERFACE_STATUS, EVENT_PMKID_CANDIDATE, EVENT_STKSTART,
  EVENT_FT_RESPONSE, EVENT_IBSS_RSN_START, EVENT_AUTH, EVENT_DEAUTH,
  EVENT_ASSOC_REJECT, EVENT_AUTH_TIMED_OUT, EVENT_ASSOC_TIMED_OUT
}

Functions

void wpa_supplicant_event (void *ctx, wpa_event_type event, union wpa_event_data *data)
 Report a driver event for wpa_supplicant.
void wpa_supplicant_rx_eapol (void *ctx, const u8 *src_addr, const u8 *buf, size_t len)
 Deliver a received EAPOL frame to wpa_supplicant.
void wpa_supplicant_sta_rx (void *ctx, const u8 *buf, size_t len, struct ieee80211_rx_status *rx_status)
const u8 * wpa_scan_get_ie (const struct wpa_scan_res *res, u8 ie)
const u8 * wpa_scan_get_vendor_ie (const struct wpa_scan_res *res, u32 vendor_type)
struct wpabufwpa_scan_get_vendor_ie_multi (const struct wpa_scan_res *res, u32 vendor_type)
int wpa_scan_get_max_rate (const struct wpa_scan_res *res)
void wpa_scan_results_free (struct wpa_scan_results *res)
void wpa_scan_sort_results (struct wpa_scan_results *res)
void hostapd_new_assoc_sta (struct hostapd_data *hapd, struct sta_info *sta, int reassoc)
 Notify that a new station associated with the AP.
void hostapd_tx_status (struct hostapd_data *hapd, const u8 *addr, const u8 *buf, size_t len, int ack)
void hostapd_rx_from_unknown_sta (struct hostapd_data *hapd, const struct ieee80211_hdr *hdr, size_t len)
int hostapd_notif_assoc (struct hostapd_data *hapd, const u8 *addr, const u8 *ie, size_t ielen)
void hostapd_notif_disassoc (struct hostapd_data *hapd, const u8 *addr)
void hostapd_eapol_receive (struct hostapd_data *hapd, const u8 *sa, const u8 *buf, size_t len)
void hostapd_mgmt_rx (struct hostapd_data *hapd, u8 *buf, size_t len, u16 stype, struct hostapd_frame_info *fi)
void hostapd_mgmt_tx_cb (struct hostapd_data *hapd, u8 *buf, size_t len, u16 stype, int ok)
void hostapd_michael_mic_failure (struct hostapd_data *hapd, const u8 *addr)
struct hostapd_datahostapd_sta_get_bss (struct hostapd_data *hapd, const u8 *addr)
void hostapd_probe_req_rx (struct hostapd_data *hapd, const u8 *sa, const u8 *ie, size_t ie_len)

Detailed Description

WPA Supplicant - driver interface definition.

Copyright
Copyright (c) 2003-2009, Jouni Malinen <j@w1.fi>

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.

Alternatively, this software may be distributed under the terms of BSD license.

See README and COPYING for more details.


Enumeration Type Documentation

enum wpa_event_type - Event type for wpa_supplicant_event() calls

Enumerator:
EVENT_ASSOC 

Association completed.

This event needs to be delivered when the driver completes IEEE 802.11 association or reassociation successfully. wpa_driver_ops::get_bssid() is expected to provide the current BSSID after this event has been generated. In addition, optional EVENT_ASSOCINFO may be generated just before EVENT_ASSOC to provide more information about the association. If the driver interface gets both of these events at the same time, it can also include the assoc_info data in EVENT_ASSOC call.

EVENT_DISASSOC 

Association lost.

This event should be called when association is lost either due to receiving deauthenticate or disassociate frame from the AP or when sending either of these frames to the current AP. If the driver supports separate deauthentication event, EVENT_DISASSOC should only be used for disassociation and EVENT_DEAUTH for deauthentication.

EVENT_MICHAEL_MIC_FAILURE 

Michael MIC (TKIP) detected.

This event must be delivered when a Michael MIC error is detected by the local driver. Additional data for event processing is provided with union wpa_event_data::michael_mic_failure. This information is used to request new encyption key and to initiate TKIP countermeasures if needed.

EVENT_SCAN_RESULTS 

Scan results available.

This event must be called whenever scan results are available to be fetched with struct wpa_driver_ops::get_scan_results(). This event is expected to be used some time after struct wpa_driver_ops::scan() is called. If the driver provides an unsolicited event when the scan has been completed, this event can be used to trigger EVENT_SCAN_RESULTS call. If such event is not available from the driver, the driver wrapper code is expected to use a registered timeout to generate EVENT_SCAN_RESULTS call after the time that the scan is expected to be completed.

EVENT_ASSOCINFO 

Report optional extra information for association.

This event can be used to report extra association information for EVENT_ASSOC processing. This extra information includes IEs from association frames and Beacon/Probe Response frames in union wpa_event_data::assoc_info. EVENT_ASSOCINFO must be send just before EVENT_ASSOC. Alternatively, the driver interface can include assoc_info data in the EVENT_ASSOC call if it has all the information available at the same point.

EVENT_INTERFACE_STATUS 

Report interface status changes.

This optional event can be used to report changes in interface status (interface added/removed) using union wpa_event_data::interface_status. This can be used to trigger wpa_supplicant to stop and re-start processing for the interface, e.g., when a cardbus card is ejected/inserted.

EVENT_PMKID_CANDIDATE 

Report a candidate AP for pre-authentication.

This event can be used to inform wpa_supplicant about candidates for RSN (WPA2) pre-authentication. If wpa_supplicant is not responsible for scan request (ap_scan=2 mode), this event is required for pre-authentication. If wpa_supplicant is performing scan request (ap_scan=1), this event is optional since scan results can be used to add pre-authentication candidates. union wpa_event_data::pmkid_candidate is used to report the BSSID of the candidate and priority of the candidate, e.g., based on the signal strength, in order to try to pre-authenticate first with candidates that are most likely targets for re-association.

EVENT_PMKID_CANDIDATE can be called whenever the driver has updates on the candidate list. In addition, it can be called for the current AP and APs that have existing PMKSA cache entries. wpa_supplicant will automatically skip pre-authentication in cases where a valid PMKSA exists. When more than one candidate exists, this event should be generated once for each candidate.

Driver will be notified about successful pre-authentication with struct wpa_driver_ops::add_pmkid() calls.

EVENT_STKSTART 

Request STK handshake (MLME-STKSTART.request).

This event can be used to inform wpa_supplicant about desire to set up secure direct link connection between two stations as defined in IEEE 802.11e with a new PeerKey mechanism that replaced the original STAKey negotiation. The caller will need to set peer address for the event.

EVENT_FT_RESPONSE 

Report FT (IEEE 802.11r) response IEs.

The driver is expected to report the received FT IEs from FT authentication sequence from the AP. The FT IEs are included in the extra information in union wpa_event_data::ft_ies.

EVENT_IBSS_RSN_START 

Request RSN authentication in IBSS.

The driver can use this event to inform wpa_supplicant about a STA in an IBSS with which protected frames could be exchanged. This event starts RSN authentication with the other STA to authenticate the STA and set up encryption keys with it.

EVENT_AUTH 

Authentication result.

This event should be called when authentication attempt has been completed. This is only used if the driver supports separate authentication step (struct wpa_driver_ops::authenticate). Information about authentication result is included in union wpa_event_data::auth.

EVENT_DEAUTH 

Authentication lost.

This event should be called when authentication is lost either due to receiving deauthenticate frame from the AP or when sending that frame to the current AP.

EVENT_ASSOC_REJECT 

Association rejected.

This event should be called when (re)association attempt has been rejected by the AP. Information about authentication result is included in union wpa_event_data::assoc_reject.

EVENT_AUTH_TIMED_OUT 

Authentication timed out.

EVENT_ASSOC_TIMED_OUT 

Association timed out.


Function Documentation

void hostapd_new_assoc_sta ( struct hostapd_data hapd,
struct sta_info sta,
int  reassoc 
)

Notify that a new station associated with the AP.

Parameters:
hapd Pointer to BSS data
sta Pointer to the associated STA data
reassoc 1 to indicate this was a re-association; 0 = first association

This function will be called whenever a station associates with the AP. It can be called from ieee802_11.c for drivers that export MLME to hostapd and from driver_*.c for drivers that take care of management frames (IEEE 802.11 authentication and association) internally.

void wpa_supplicant_event ( void *  ctx,
wpa_event_type  event,
union wpa_event_data data 
)

Report a driver event for wpa_supplicant.

Parameters:
ctx Context pointer (wpa_s); this is the ctx variable registered with struct wpa_driver_ops::init()
event event type (defined above)
data possible extra data for the event

Driver wrapper code should call this function whenever an event is received from the driver.

void wpa_supplicant_rx_eapol ( void *  ctx,
const u8 *  src_addr,
const u8 *  buf,
size_t  len 
)

Deliver a received EAPOL frame to wpa_supplicant.

Parameters:
ctx Context pointer (wpa_s); this is the ctx variable registered with struct wpa_driver_ops::init()
src_addr Source address of the EAPOL frame
buf EAPOL data starting from the EAPOL header (i.e., no Ethernet header)
len Length of the EAPOL data

This function is called for each received EAPOL frame. Most driver interfaces rely on more generic OS mechanism for receiving frames through l2_packet, but if such a mechanism is not available, the driver wrapper may take care of received EAPOL frames and deliver them to the core supplicant code by calling this function.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines

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