/*
* WPA Supplicant - driver interface definition
- * Copyright (c) 2003-2008, Jouni Malinen <j@w1.fi>
+ * 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
#include "defs.h"
+#define HOSTAPD_CHAN_DISABLED 0x00000001
+#define HOSTAPD_CHAN_PASSIVE_SCAN 0x00000002
+#define HOSTAPD_CHAN_NO_IBSS 0x00000004
+#define HOSTAPD_CHAN_RADAR 0x00000008
+
+struct hostapd_channel_data {
+ short chan; /* channel number (IEEE 802.11) */
+ short freq; /* frequency in MHz */
+ int flag; /* flag for hostapd use (HOSTAPD_CHAN_*) */
+ u8 max_tx_power; /* maximum transmit power in dBm */
+};
+
+#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
+
+struct hostapd_rate_data {
+ int rate; /* rate in 100 kbps */
+ int flags; /* HOSTAPD_RATE_ flags */
+};
+
+struct hostapd_hw_modes {
+ hostapd_hw_mode mode;
+ int num_channels;
+ struct hostapd_channel_data *channels;
+ int num_rates;
+ struct hostapd_rate_data *rates;
+ u16 ht_capab;
+};
+
+
#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 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)
+
/**
* struct wpa_scan_res - Scan result for an BSS/IBSS
+ * @flags: information flags about the BSS/IBSS (WPA_SCAN_*)
* @bssid: BSSID
* @freq: frequency of the channel in MHz (e.g., 2412 = channel 1)
* @beacon_int: beacon interval in TUs (host byte order)
* report all IEs to make it easier to support future additions.
*/
struct wpa_scan_res {
+ unsigned int flags;
u8 bssid[ETH_ALEN];
int freq;
u16 beacon_int;
};
/**
+ * struct wpa_interface_info - Network interface information
+ * @next: Pointer to the next interface or NULL if this is the last one
+ * @ifname: Interface name that can be used with init() or init2()
+ * @desc: Human readable adapter description (e.g., vendor/model) or NULL if
+ * not available
+ * @drv_bame: struct wpa_driver_ops::name (note: unlike other strings, this one
+ * is not an allocated copy, i.e., get_interfaces() caller will not free
+ * this)
+ */
+struct wpa_interface_info {
+ struct wpa_interface_info *next;
+ char *ifname;
+ char *desc;
+ const char *drv_name;
+};
+
+#define WPAS_MAX_SCAN_SSIDS 4
+
+/**
+ * struct wpa_driver_scan_params - Scan parameters
+ * Data for struct wpa_driver_ops::scan2().
+ */
+struct wpa_driver_scan_params {
+ /**
+ * ssids - SSIDs to scan for
+ */
+ struct wpa_driver_scan_ssid {
+ /**
+ * ssid - specific SSID to scan for (ProbeReq)
+ * %NULL or zero-length SSID is used to indicate active scan
+ * with wildcard SSID.
+ */
+ const u8 *ssid;
+ /**
+ * ssid_len: Length of the SSID in octets
+ */
+ size_t ssid_len;
+ } ssids[WPAS_MAX_SCAN_SSIDS];
+
+ /**
+ * num_ssids - Number of entries in ssids array
+ * Zero indicates a request for a passive scan.
+ */
+ size_t num_ssids;
+
+ /**
+ * extra_ies - Extra IE(s) to add into Probe Request or %NULL
+ */
+ const u8 *extra_ies;
+
+ /**
+ * extra_ies_len - Length of extra_ies in octets
+ */
+ size_t extra_ies_len;
+
+ /**
+ * freqs - Array of frequencies to scan or %NULL for all frequencies
+ *
+ * The frequency is set in MHz. The array is zero-terminated.
+ */
+ int *freqs;
+};
+
+/**
+ * struct wpa_driver_auth_params - Authentication parameters
+ * Data for struct wpa_driver_ops::authenticate().
+ */
+struct wpa_driver_auth_params {
+ int freq;
+ const u8 *bssid;
+ const u8 *ssid;
+ size_t ssid_len;
+ int auth_alg;
+ const u8 *ie;
+ size_t ie_len;
+ const u8 *wep_key[4];
+ size_t wep_key_len[4];
+ int wep_tx_keyidx;
+};
+
+/**
* struct wpa_driver_associate_params - Association parameters
* Data for struct wpa_driver_ops::associate().
*/
* instead. The driver can determine which version is used by
* looking at the first byte of the IE (0xdd for WPA, 0x30 for
* WPA2/RSN).
+ *
+ * When using WPS, wpa_ie is used for WPS IE instead of WPA/RSN IE.
*/
const u8 *wpa_ie;
/**
* be prepared to handle %NULL value as an error.
*/
const u8 *psk;
+
+ /**
+ * drop_unencrypted - Enable/disable unencrypted frame filtering
+ *
+ * Configure the driver to drop all non-EAPOL frames (both receive and
+ * transmit paths). Unencrypted EAPOL frames (ethertype 0x888e) must
+ * still be allowed for key negotiation.
+ */
+ int drop_unencrypted;
};
/**
/* Driver takes care of RSN 4-way handshake internally; PMK is configured with
* struct wpa_driver_ops::set_key using alg = WPA_ALG_PMK */
#define WPA_DRIVER_FLAGS_4WAY_HANDSHAKE 0x00000008
+#define WPA_DRIVER_FLAGS_WIRED 0x00000010
+/* Driver provides separate commands for authentication and association (SME in
+ * wpa_supplicant). */
+#define WPA_DRIVER_FLAGS_SME 0x00000020
+/* Driver supports AP mode */
+#define WPA_DRIVER_FLAGS_AP 0x00000040
unsigned int flags;
-};
+ int max_scan_ssids;
+};
-#define WPA_CHAN_W_SCAN 0x00000001
-#define WPA_CHAN_W_ACTIVE_SCAN 0x00000002
-#define WPA_CHAN_W_IBSS 0x00000004
-struct wpa_channel_data {
- short chan; /* channel number (IEEE 802.11) */
- short freq; /* frequency in MHz */
- int flag; /* flag for user space use (WPA_CHAN_*) */
+struct ieee80211_rx_status {
+ int channel;
+ int ssi;
};
-#define WPA_RATE_ERP 0x00000001
-#define WPA_RATE_BASIC 0x00000002
-#define WPA_RATE_PREAMBLE2 0x00000004
-#define WPA_RATE_SUPPORTED 0x00000010
-#define WPA_RATE_OFDM 0x00000020
-#define WPA_RATE_CCK 0x00000040
-#define WPA_RATE_MANDATORY 0x00000100
-struct wpa_rate_data {
- int rate; /* rate in 100 kbps */
- int flags; /* WPA_RATE_ flags */
+struct hostapd_data;
+
+struct hostap_sta_driver_data {
+ unsigned long rx_packets, tx_packets, rx_bytes, tx_bytes;
+ unsigned long current_tx_rate;
+ unsigned long inactive_msec;
+ unsigned long flags;
+ unsigned long num_ps_buf_frames;
+ unsigned long tx_retry_failed;
+ unsigned long tx_retry_count;
+ int last_rssi;
+ int last_ack_rssi;
};
-typedef enum {
- WPA_MODE_IEEE80211B,
- WPA_MODE_IEEE80211G,
- WPA_MODE_IEEE80211A,
- NUM_WPA_MODES
-} wpa_hw_mode;
+struct hostapd_sta_add_params {
+ const u8 *addr;
+ u16 aid;
+ u16 capability;
+ const u8 *supp_rates;
+ size_t supp_rates_len;
+ int flags;
+ u16 listen_interval;
+ const struct ht_cap_ie *ht_capabilities;
+};
-struct wpa_hw_modes {
- wpa_hw_mode mode;
- int num_channels;
- struct wpa_channel_data *channels;
- int num_rates;
- struct wpa_rate_data *rates;
+struct hostapd_freq_params {
+ int mode;
+ int freq;
+ int channel;
+ int ht_enabled;
+ int sec_channel_offset; /* 0 = HT40 disabled, -1 = HT40 enabled,
+ * secondary channel below primary, 1 = HT40
+ * enabled, secondary channel above primary */
};
+enum hostapd_driver_if_type {
+ HOSTAPD_IF_VLAN
+};
-struct ieee80211_rx_status {
- int channel;
- int ssi;
+struct wpa_init_params {
+ const u8 *bssid;
+ const char *ifname;
+ const u8 *ssid;
+ size_t ssid_len;
+ const char *test_socket;
+ int use_pae_group_addr;
+ char **bridge;
+ size_t num_bridge;
};
* Configure the driver to drop all non-EAPOL frames (both receive and
* transmit paths). Unencrypted EAPOL frames (ethertype 0x888e) must
* still be allowed for key negotiation.
+ *
+ * This function is deprecated. New driver wrapper implementations
+ * should use associate() parameter drop_unencrypted instead.
*/
int (*set_drop_unencrypted)(void *priv, int enabled);
/**
- * scan - Request the driver to initiate scan
+ * scan - Request the driver to initiate scan (old version)
* @priv: private driver interface data
* @ssid: specific SSID to scan for (ProbeReq) or %NULL to scan for
- * all SSIDs (either active scan with broadcast SSID or passive
- * scan
+ * all SSIDs (either active scan with wildcard SSID or passive
+ * scan)
* @ssid_len: length of the SSID
*
* Returns: 0 on success, -1 on failure
* Once the scan results are ready, the driver should report scan
* results event for wpa_supplicant which will eventually request the
* results with wpa_driver_get_scan_results().
+ *
+ * This function is deprecated. New driver wrapper implementations
+ * should implement support for scan2().
*/
int (*scan)(void *priv, const u8 *ssid, size_t ssid_len);
* returned and the remaining entries will not be included in the
* buffer.
*
- * This function is depracated. New driver wrapper implementations
+ * This function is deprecated. New driver wrapper implementations
* should implement support for get_scan_results2().
*/
int (*get_scan_results)(void *priv,
* associate() params, so set_auth_alg may not be needed in case of
* most drivers.
*
+ * This function is deprecated. New driver wrapper implementations
+ * should use associate() parameter auth_alg instead.
+ *
* Returns: 0 on success, -1 on failure
*/
int (*set_auth_alg)(void *priv, int auth_alg);
int (*flush_pmkid)(void *priv);
/**
- * flush_pmkid - Flush PMKSA cache
+ * get_capa - Get driver capabilities
* @priv: private driver interface data
*
* Returns: 0 on success, -1 on failure
* This function is only needed for drivers that export MLME
* (management frame processing) to wpa_supplicant.
*/
- struct wpa_hw_modes * (*get_hw_feature_data)(void *priv,
- u16 *num_modes,
- u16 *flags);
+ struct hostapd_hw_modes * (*get_hw_feature_data)(void *priv,
+ u16 *num_modes,
+ u16 *flags);
/**
* set_channel - Set channel
* @priv: Private driver interface data
- * @phymode: WPA_MODE_IEEE80211B, ..
+ * @phymode: HOSTAPD_MODE_IEEE80211B, ..
* @chan: IEEE 802.11 channel number
* @freq: Frequency of the channel in MHz
* Returns: 0 on success, -1 on failure
* This function is only needed for drivers that export MLME
* (management frame processing) to wpa_supplicant.
*/
- int (*set_channel)(void *priv, wpa_hw_mode phymode, int chan,
+ int (*set_channel)(void *priv, hostapd_hw_mode phymode, int chan,
int freq);
/**
struct wpa_scan_results * (*get_scan_results2)(void *priv);
/**
- * * set_probe_req_ie - Set information element(s) for Probe Request
+ * set_probe_req_ie - Set information element(s) for Probe Request
* @priv: private driver interface data
* @ies: Information elements to append or %NULL to remove extra IEs
* @ies_len: Length of the IE buffer in octets
* Returns: 0 on success, -1 on failure
*/
- int (*set_probe_req_ie)(void *, const u8 *ies, size_t ies_len);
+ int (*set_probe_req_ie)(void *priv, const u8 *ies, size_t ies_len);
/**
* set_mode - Request driver to set the operating mode
* This handler will be called before any key configuration and call to
* associate() handler in order to allow the operation mode to be
* configured as early as possible. This information is also available
- * in associate() params and as such, some driver wrappers may not need
+ * in associate() params and as such, driver wrappers may not need
* to implement set_mode() handler.
+ *
+ * This function is deprecated. New driver wrapper implementations
+ * should use associate() parameter mode instead.
+ *
* Returns: 0 on success, -1 on failure
*/
int (*set_mode)(void *priv, int mode);
-};
-/* Function to check whether a driver is for wired connections */
-static inline int IS_WIRED(const struct wpa_driver_ops *drv)
-{
- return os_strcmp(drv->name, "wired") == 0 ||
- os_strcmp(drv->name, "roboswitch") == 0;
-}
+ /**
+ * set_country - Set country
+ * @priv: Private driver interface data
+ * @alpha2: country to which to switch to
+ * Returns: 0 on success, -1 on failure
+ *
+ * This function is for drivers which support some form
+ * of setting a regulatory domain.
+ */
+ int (*set_country)(void *priv, const char *alpha2);
+
+ /**
+ * global_init - Global driver initialization
+ * Returns: Pointer to private data (global), %NULL on failure
+ *
+ * This optional function is called to initialize the driver wrapper
+ * for global data, i.e., data that applies to all interfaces. If this
+ * function is implemented, global_deinit() will also need to be
+ * implemented to free the private data. The driver will also likely
+ * use init2() function instead of init() to get the pointer to global
+ * data available to per-interface initializer.
+ */
+ void * (*global_init)(void);
+
+ /**
+ * global_deinit - Global driver deinitialization
+ * @priv: private driver global data from global_init()
+ *
+ * Terminate any global driver related functionality and free the
+ * global data structure.
+ */
+ void (*global_deinit)(void *priv);
+
+ /**
+ * init2 - Initialize driver interface (with global data)
+ * @ctx: context to be used when calling wpa_supplicant functions,
+ * e.g., wpa_supplicant_event()
+ * @ifname: interface name, e.g., wlan0
+ * @global_priv: private driver global data from global_init()
+ * Returns: Pointer to private data, %NULL on failure
+ *
+ * This function can be used instead of init() if the driver wrapper
+ * uses global data.
+ */
+ void * (*init2)(void *ctx, const char *ifname, void *global_priv);
+
+ /**
+ * get_interfaces - Get information about available interfaces
+ * @global_priv: private driver global data from global_init()
+ * Returns: Allocated buffer of interface information (caller is
+ * responsible for freeing the data structure) on success, NULL on
+ * failure
+ */
+ struct wpa_interface_info * (*get_interfaces)(void *global_priv);
+
+ /**
+ * scan2 - Request the driver to initiate scan
+ * @priv: private driver interface data
+ * @params: Scan parameters
+ *
+ * Returns: 0 on success, -1 on failure
+ *
+ * Once the scan results are ready, the driver should report scan
+ * results event for wpa_supplicant which will eventually request the
+ * results with wpa_driver_get_scan_results2().
+ */
+ int (*scan2)(void *priv, struct wpa_driver_scan_params *params);
+
+ /**
+ * authenticate - Request driver to authenticate
+ * @priv: private driver interface data
+ * @params: authentication parameters
+ * Returns: 0 on success, -1 on failure
+ *
+ * This is an optional function that can be used with drivers that
+ * support separate authentication and association steps, i.e., when
+ * wpa_supplicant can act as the SME. If not implemented, associate()
+ * function is expected to take care of IEEE 802.11 authentication,
+ * too.
+ */
+ int (*authenticate)(void *priv,
+ struct wpa_driver_auth_params *params);
+
+ int (*set_beacon)(void *priv, const u8 *head, size_t head_len,
+ const u8 *tail, size_t tail_len, int dtim_period);
+
+ int (*set_beacon_int)(void *priv, int value);
+
+ void * (*hapd_init)(struct hostapd_data *hapd,
+ struct wpa_init_params *params);
+ void (*hapd_deinit)(void *priv);
+
+ /**
+ * set_8021x - enable/disable IEEE 802.1X support
+ * @ifname: Interface name (for multi-SSID/VLAN support)
+ * @priv: driver private data
+ * @enabled: 1 = enable, 0 = disable
+ *
+ * Returns: 0 on success, -1 on failure
+ *
+ * Configure the kernel driver to enable/disable 802.1X support.
+ * This may be an empty function if 802.1X support is always enabled.
+ */
+ int (*set_ieee8021x)(const char *ifname, void *priv, int enabled);
+
+ /**
+ * set_privacy - enable/disable privacy
+ * @priv: driver private data
+ * @enabled: 1 = privacy enabled, 0 = disabled
+ *
+ * Return: 0 on success, -1 on failure
+ *
+ * Configure privacy.
+ */
+ int (*set_privacy)(const char *ifname, void *priv, int enabled);
+
+ int (*hapd_set_key)(const char *ifname, void *priv, wpa_alg alg,
+ const u8 *addr, int key_idx, int set_tx,
+ const u8 *seq, size_t seq_len,
+ const u8 *key, size_t key_len);
+ int (*get_seqnum)(const char *ifname, void *priv, const u8 *addr,
+ int idx, u8 *seq);
+ int (*get_seqnum_igtk)(const char *ifname, void *priv, const u8 *addr,
+ int idx, u8 *seq);
+ int (*flush)(void *priv);
+ int (*set_generic_elem)(const char *ifname, void *priv, const u8 *elem,
+ size_t elem_len);
+
+ int (*read_sta_data)(void *priv, struct hostap_sta_driver_data *data,
+ const u8 *addr);
+ int (*hapd_send_eapol)(void *priv, const u8 *addr, const u8 *data,
+ size_t data_len, int encrypt,
+ const u8 *own_addr);
+ int (*sta_deauth)(void *priv, const u8 *own_addr, const u8 *addr,
+ int reason);
+ int (*sta_disassoc)(void *priv, const u8 *own_addr, const u8 *addr,
+ int reason);
+ int (*sta_remove)(void *priv, const u8 *addr);
+ int (*hapd_get_ssid)(const char *ifname, void *priv, u8 *buf, int len);
+ int (*hapd_set_ssid)(const char *ifname, void *priv, const u8 *buf,
+ int len);
+ int (*hapd_set_countermeasures)(void *priv, int enabled);
+ int (*sta_add)(const char *ifname, void *priv,
+ struct hostapd_sta_add_params *params);
+ int (*get_inact_sec)(void *priv, const u8 *addr);
+ int (*sta_clear_stats)(void *priv, const u8 *addr);
+
+ int (*set_freq)(void *priv, struct hostapd_freq_params *freq);
+ int (*set_rts)(void *priv, int rts);
+ int (*set_frag)(void *priv, int frag);
+ int (*set_retry)(void *priv, int short_retry, int long_retry);
+
+ int (*sta_set_flags)(void *priv, const u8 *addr,
+ int total_flags, int flags_or, int flags_and);
+ int (*set_rate_sets)(void *priv, int *supp_rates, int *basic_rates,
+ int mode);
+ int (*set_ieee80211d)(void *priv, int enabled);
+ int (*hapd_set_beacon)(const char *ifname, void *priv,
+ const u8 *head, size_t head_len,
+ const u8 *tail, size_t tail_len,
+ int dtim_period);
+
+ /* Configure internal bridge:
+ * 0 = disabled, i.e., client separation is enabled (no bridging of
+ * packets between associated STAs
+ * 1 = enabled, i.e., bridge packets between associated STAs (default)
+ */
+ int (*set_internal_bridge)(void *priv, int value);
+ /* Configure broadcast SSID mode:
+ * 0 = include SSID in Beacon frames and reply to Probe Request frames
+ * that use broadcast SSID
+ * 1 = hide SSID from Beacon frames and ignore Probe Request frames for
+ * broadcast SSID
+ */
+ int (*set_broadcast_ssid)(void *priv, int value);
+ int (*set_cts_protect)(void *priv, int value);
+ int (*set_preamble)(void *priv, int value);
+ int (*set_short_slot_time)(void *priv, int value);
+ int (*set_tx_queue_params)(void *priv, int queue, int aifs, int cw_min,
+ int cw_max, int burst_time);
+ int (*bss_add)(void *priv, const char *ifname, const u8 *bssid);
+ int (*bss_remove)(void *priv, const char *ifname);
+ int (*valid_bss_mask)(void *priv, const u8 *addr, const u8 *mask);
+ int (*passive_scan)(void *priv, int now, int our_mode_only,
+ int interval, int _listen, int *channel,
+ int *last_rx);
+ int (*if_add)(const char *iface, void *priv,
+ enum hostapd_driver_if_type type, char *ifname,
+ const u8 *addr);
+ int (*if_update)(void *priv, enum hostapd_driver_if_type type,
+ char *ifname, const u8 *addr);
+ int (*if_remove)(void *priv, enum hostapd_driver_if_type type,
+ const char *ifname, const u8 *addr);
+ int (*set_sta_vlan)(void *priv, const u8 *addr, const char *ifname,
+ int vlan_id);
+ /**
+ * commit - Optional commit changes handler
+ * @priv: driver private data
+ * Returns: 0 on success, -1 on failure
+ *
+ * This optional handler function can be registered if the driver
+ * interface implementation needs to commit changes (e.g., by setting
+ * network interface up) at the end of initial configuration. If set,
+ * this handler will be called after initial setup has been completed.
+ */
+ int (*commit)(void *priv);
+
+ int (*send_ether)(void *priv, const u8 *dst, const u8 *src, u16 proto,
+ const u8 *data, size_t data_len);
+
+ int (*set_radius_acl_auth)(void *priv, const u8 *mac, int accepted,
+ u32 session_timeout);
+ int (*set_radius_acl_expire)(void *priv, const u8 *mac);
+
+ int (*set_ht_params)(const char *ifname, void *priv,
+ const u8 *ht_capab, size_t ht_capab_len,
+ const u8 *ht_oper, size_t ht_oper_len);
+
+ int (*set_wps_beacon_ie)(const char *ifname, void *priv,
+ const u8 *ie, size_t len);
+ int (*set_wps_probe_resp_ie)(const char *ifname, void *priv,
+ const u8 *ie, size_t len);
+};
/**
* enum wpa_event_type - Event type for wpa_supplicant_event() calls
*
* 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.
+ * 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_DISASSOC,
* FT authentication sequence from the AP. The FT IEs are included in
* the extra information in union wpa_event_data::ft_ies.
*/
- EVENT_FT_RESPONSE
+ EVENT_FT_RESPONSE,
+
+ /**
+ * 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_IBSS_RSN_START,
+
+ /**
+ * 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_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_DEAUTH,
+
+ /**
+ * 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_ASSOC_REJECT
} wpa_event_type;
*/
struct michael_mic_failure {
int unicast;
+ const u8 *src;
} michael_mic_failure;
/**
size_t ies_len;
int ft_action;
u8 target_ap[ETH_ALEN];
+ /** Optional IE(s), e.g., WMM TSPEC(s), for RIC-Request */
+ const u8 *ric_ies;
+ /** Length of ric_ies buffer in octets */
+ size_t ric_ies_len;
} ft_ies;
+
+ /**
+ * struct ibss_rsn_start - Data for EVENT_IBSS_RSN_START
+ */
+ struct ibss_rsn_start {
+ u8 peer[ETH_ALEN];
+ } ibss_rsn_start;
+
+ /**
+ * struct auth_info - Data for EVENT_AUTH events
+ */
+ struct auth_info {
+ u8 peer[ETH_ALEN];
+ u16 auth_type;
+ u16 status_code;
+ const u8 *ies;
+ size_t ies_len;
+ } auth;
+
+ /**
+ * struct assoc_reject - Data for EVENT_ASSOC_REJECT events
+ */
+ struct assoc_reject {
+ /**
+ * resp_ies - (Re)Association Response IEs
+ *
+ * Optional association data from the driver. This data is not
+ * required WPA, but may be useful for some protocols and as
+ * such, should be reported if this is available to the driver
+ * interface.
+ *
+ * This should start with the first IE (fixed fields before IEs
+ * are not included).
+ */
+ u8 *resp_ies;
+
+ /**
+ * resp_ies_len - Length of resp_ies in bytes
+ */
+ size_t resp_ies_len;
+
+ /**
+ * status_code - Status Code from (Re)association Response
+ */
+ u16 status_code;
+ } assoc_reject;
};
/**
void wpa_supplicant_sta_rx(void *ctx, const u8 *buf, size_t len,
struct ieee80211_rx_status *rx_status);
-void wpa_supplicant_sta_free_hw_features(struct wpa_hw_modes *hw_features,
- size_t num_hw_features);
const u8 * wpa_scan_get_ie(const struct wpa_scan_res *res, u8 ie);
#define WPA_IE_VENDOR_TYPE 0x0050f201
+#define WPS_IE_VENDOR_TYPE 0x0050f204
const u8 * wpa_scan_get_vendor_ie(const struct wpa_scan_res *res,
u32 vendor_type);
+struct wpabuf * wpa_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);
+/* hostapd functions for driver wrappers */
+
+struct sta_info;
+
+void hostapd_new_assoc_sta(struct hostapd_data *hapd, struct sta_info *sta,
+ int reassoc);
+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 u8 *addr);
+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);
+
+struct hostapd_frame_info {
+ u32 phytype;
+ u32 channel;
+ u32 datarate;
+ u32 ssi_signal;
+
+ unsigned int passive_scan:1;
+};
+
+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_data * hostapd_sta_get_bss(struct hostapd_data *hapd,
+ const u8 *addr);
+
#endif /* DRIVER_H */