#include "includes.h"
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <net/if_arp.h>
#include "wireless_copy.h"
#include "common.h"
#include "eloop.h"
#include "common/ieee802_11_defs.h"
#include "common/wpa_common.h"
#include "priv_netlink.h"
#include "netlink.h"
#include "linux_ioctl.h"
#include "driver.h"
#include "driver_wext.h"
Go to the source code of this file.
Classes | |
struct | wext_scan_data |
Functions | |
static int | wext_19_iw_point (struct wpa_driver_wext_data *drv, u16 cmd) |
static void | wext_get_scan_custom (struct iw_event *iwe, struct wext_scan_data *res, char *custom, char *end) |
static void | wext_get_scan_encode (struct iw_event *iwe, struct wext_scan_data *res) |
static void | wext_get_scan_freq (struct iw_event *iwe, struct wext_scan_data *res) |
static void | wext_get_scan_iwevgenie (struct iw_event *iwe, struct wext_scan_data *res, char *custom, char *end) |
static void | wext_get_scan_mode (struct iw_event *iwe, struct wext_scan_data *res) |
static void | wext_get_scan_qual (struct iw_event *iwe, struct wext_scan_data *res) |
static void | wext_get_scan_rate (struct iw_event *iwe, struct wext_scan_data *res, char *pos, char *end) |
static void | wext_get_scan_ssid (struct iw_event *iwe, struct wext_scan_data *res, char *custom, char *end) |
static int | wpa_driver_wext_add_pmkid (void *priv, const u8 *bssid, const u8 *pmkid) |
static void | wpa_driver_wext_add_scan_entry (struct wpa_scan_results *res, struct wext_scan_data *data) |
int | wpa_driver_wext_alternative_ifindex (struct wpa_driver_wext_data *drv, const char *ifname) |
int | wpa_driver_wext_associate (void *priv, struct wpa_driver_associate_params *params) |
static int | wpa_driver_wext_auth_alg_fallback (struct wpa_driver_wext_data *drv, struct wpa_driver_associate_params *params) |
int | wpa_driver_wext_cipher2wext (int cipher) |
static int | wpa_driver_wext_deauthenticate (void *priv, const u8 *addr, int reason_code) |
void | wpa_driver_wext_deinit (void *priv) |
static int | wpa_driver_wext_disassociate (void *priv, const u8 *addr, int reason_code) |
static void | wpa_driver_wext_disconnect (struct wpa_driver_wext_data *drv) |
static void | wpa_driver_wext_event_assoc_ies (struct wpa_driver_wext_data *drv) |
static void | wpa_driver_wext_event_link (struct wpa_driver_wext_data *drv, char *buf, size_t len, int del) |
static void | wpa_driver_wext_event_rtm_dellink (void *ctx, struct ifinfomsg *ifi, u8 *buf, size_t len) |
static void | wpa_driver_wext_event_rtm_newlink (void *ctx, struct ifinfomsg *ifi, u8 *buf, size_t len) |
static void | wpa_driver_wext_event_wireless (struct wpa_driver_wext_data *drv, char *data, int len) |
static int | wpa_driver_wext_event_wireless_assocreqie (struct wpa_driver_wext_data *drv, const char *ev, int len) |
static int | wpa_driver_wext_event_wireless_assocrespie (struct wpa_driver_wext_data *drv, const char *ev, int len) |
static void | wpa_driver_wext_event_wireless_custom (void *ctx, char *custom) |
static int | wpa_driver_wext_event_wireless_michaelmicfailure (void *ctx, const char *ev, size_t len) |
static int | wpa_driver_wext_event_wireless_pmkidcand (struct wpa_driver_wext_data *drv, const char *ev, size_t len) |
static int | wpa_driver_wext_finish_drv_init (struct wpa_driver_wext_data *drv) |
static int | wpa_driver_wext_flush_pmkid (void *priv) |
int | wpa_driver_wext_get_bssid (void *priv, u8 *bssid) |
int | wpa_driver_wext_get_capa (void *priv, struct wpa_driver_capa *capa) |
static int | wpa_driver_wext_get_range (void *priv) |
struct wpa_scan_results * | wpa_driver_wext_get_scan_results (void *priv) |
int | wpa_driver_wext_get_ssid (void *priv, u8 *ssid) |
int | wpa_driver_wext_get_version (struct wpa_driver_wext_data *drv) |
static u8 * | wpa_driver_wext_giwscan (struct wpa_driver_wext_data *drv, size_t *len) |
void * | wpa_driver_wext_init (void *ctx, const char *ifname) |
int | wpa_driver_wext_keymgmt2wext (int keymgmt) |
static int | wpa_driver_wext_mlme (struct wpa_driver_wext_data *drv, const u8 *addr, int cmd, int reason_code) |
static int | wpa_driver_wext_own_ifindex (struct wpa_driver_wext_data *drv, int ifindex, u8 *buf, size_t len) |
static int | wpa_driver_wext_own_ifname (struct wpa_driver_wext_data *drv, u8 *buf, size_t len) |
static int | wpa_driver_wext_pmksa (struct wpa_driver_wext_data *drv, u32 cmd, const u8 *bssid, const u8 *pmkid) |
static int | wpa_driver_wext_remove_pmkid (void *priv, const u8 *bssid, const u8 *pmkid) |
int | wpa_driver_wext_scan (void *priv, struct wpa_driver_scan_params *params) |
void | wpa_driver_wext_scan_timeout (void *eloop_ctx, void *timeout_ctx) |
static int | wpa_driver_wext_set_auth_alg (void *priv, int auth_alg) |
int | wpa_driver_wext_set_auth_param (struct wpa_driver_wext_data *drv, int idx, u32 value) |
int | wpa_driver_wext_set_bssid (void *priv, const u8 *bssid) |
static int | wpa_driver_wext_set_countermeasures (void *priv, int enabled) |
static int | wpa_driver_wext_set_drop_unencrypted (void *priv, int enabled) |
int | wpa_driver_wext_set_freq (void *priv, int freq) |
static int | wpa_driver_wext_set_gen_ie (void *priv, const u8 *ie, size_t ie_len) |
int | wpa_driver_wext_set_key (const char *ifname, void *priv, enum 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) |
static int | wpa_driver_wext_set_key_ext (void *priv, enum 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 | wpa_driver_wext_set_mode (void *priv, int mode) |
int | wpa_driver_wext_set_operstate (void *priv, int state) |
static int | wpa_driver_wext_set_psk (struct wpa_driver_wext_data *drv, const u8 *psk) |
int | wpa_driver_wext_set_ssid (void *priv, const u8 *ssid, size_t ssid_len) |
Variables | |
struct wpa_driver_ops | wpa_driver_wext_ops |
static int wext_19_iw_point | ( | struct wpa_driver_wext_data * | drv, |
u16 | cmd | ||
) | [static] |
Definition at line 1184 of file driver_wext.c.
static void wext_get_scan_custom | ( | struct iw_event * | iwe, |
struct wext_scan_data * | res, | ||
char * | custom, | ||
char * | end | ||
) | [static] |
Definition at line 1123 of file driver_wext.c.
static void wext_get_scan_encode | ( | struct iw_event * | iwe, |
struct wext_scan_data * | res | ||
) | [static] |
Definition at line 1060 of file driver_wext.c.
static void wext_get_scan_freq | ( | struct iw_event * | iwe, |
struct wext_scan_data * | res | ||
) | [static] |
Definition at line 1002 of file driver_wext.c.
static void wext_get_scan_iwevgenie | ( | struct iw_event * | iwe, |
struct wext_scan_data * | res, | ||
char * | custom, | ||
char * | end | ||
) | [static] |
Definition at line 1097 of file driver_wext.c.
static void wext_get_scan_mode | ( | struct iw_event * | iwe, |
struct wext_scan_data * | res | ||
) | [static] |
Definition at line 976 of file driver_wext.c.
static void wext_get_scan_qual | ( | struct iw_event * | iwe, |
struct wext_scan_data * | res | ||
) | [static] |
Definition at line 1043 of file driver_wext.c.
static void wext_get_scan_rate | ( | struct iw_event * | iwe, |
struct wext_scan_data * | res, | ||
char * | pos, | ||
char * | end | ||
) | [static] |
Definition at line 1068 of file driver_wext.c.
static void wext_get_scan_ssid | ( | struct iw_event * | iwe, |
struct wext_scan_data * | res, | ||
char * | custom, | ||
char * | end | ||
) | [static] |
Definition at line 986 of file driver_wext.c.
static int wpa_driver_wext_add_pmkid | ( | void * | priv, |
const u8 * | bssid, | ||
const u8 * | pmkid | ||
) | [static] |
Definition at line 2100 of file driver_wext.c.
static void wpa_driver_wext_add_scan_entry | ( | struct wpa_scan_results * | res, |
struct wext_scan_data * | data | ||
) | [static] |
Definition at line 1192 of file driver_wext.c.
int wpa_driver_wext_alternative_ifindex | ( | struct wpa_driver_wext_data * | drv, |
const char * | ifname | ||
) |
Definition at line 2133 of file driver_wext.c.
int wpa_driver_wext_associate | ( | void * | priv, |
struct wpa_driver_associate_params * | params | ||
) |
Definition at line 1873 of file driver_wext.c.
static int wpa_driver_wext_auth_alg_fallback | ( | struct wpa_driver_wext_data * | drv, |
struct wpa_driver_associate_params * | params | ||
) | [static] |
Definition at line 1830 of file driver_wext.c.
int wpa_driver_wext_cipher2wext | ( | int | cipher | ) |
Definition at line 1796 of file driver_wext.c.
static int wpa_driver_wext_deauthenticate | ( | void * | priv, |
const u8 * | addr, | ||
int | reason_code | ||
) | [static] |
Definition at line 1751 of file driver_wext.c.
void wpa_driver_wext_deinit | ( | void * | priv | ) |
wpa_driver_wext_deinit - Deinitialize WE driver interface : Pointer to private wext data from wpa_driver_wext_init()
Shut down driver interface and processing of driver events. Free private data buffer if one was allocated in wpa_driver_wext_init().
Definition at line 809 of file driver_wext.c.
static int wpa_driver_wext_disassociate | ( | void * | priv, |
const u8 * | addr, | ||
int | reason_code | ||
) | [static] |
Definition at line 1763 of file driver_wext.c.
static void wpa_driver_wext_disconnect | ( | struct wpa_driver_wext_data * | drv | ) | [static] |
Definition at line 1701 of file driver_wext.c.
static void wpa_driver_wext_event_assoc_ies | ( | struct wpa_driver_wext_data * | drv | ) | [static] |
Definition at line 398 of file driver_wext.c.
static void wpa_driver_wext_event_link | ( | struct wpa_driver_wext_data * | drv, |
char * | buf, | ||
size_t | len, | ||
int | del | ||
) | [static] |
Definition at line 546 of file driver_wext.c.
static void wpa_driver_wext_event_rtm_dellink | ( | void * | ctx, |
struct ifinfomsg * | ifi, | ||
u8 * | buf, | ||
size_t | len | ||
) | [static] |
Definition at line 668 of file driver_wext.c.
static void wpa_driver_wext_event_rtm_newlink | ( | void * | ctx, |
struct ifinfomsg * | ifi, | ||
u8 * | buf, | ||
size_t | len | ||
) | [static] |
Definition at line 617 of file driver_wext.c.
static void wpa_driver_wext_event_wireless | ( | struct wpa_driver_wext_data * | drv, |
char * | data, | ||
int | len | ||
) | [static] |
Definition at line 424 of file driver_wext.c.
static int wpa_driver_wext_event_wireless_assocreqie | ( | struct wpa_driver_wext_data * | drv, |
const char * | ev, | ||
int | len | ||
) | [static] |
Definition at line 356 of file driver_wext.c.
static int wpa_driver_wext_event_wireless_assocrespie | ( | struct wpa_driver_wext_data * | drv, |
const char * | ev, | ||
int | len | ||
) | [static] |
Definition at line 377 of file driver_wext.c.
static void wpa_driver_wext_event_wireless_custom | ( | void * | ctx, |
char * | custom | ||
) | [static] |
Definition at line 234 of file driver_wext.c.
static int wpa_driver_wext_event_wireless_michaelmicfailure | ( | void * | ctx, |
const char * | ev, | ||
size_t | len | ||
) | [static] |
Definition at line 306 of file driver_wext.c.
static int wpa_driver_wext_event_wireless_pmkidcand | ( | struct wpa_driver_wext_data * | drv, |
const char * | ev, | ||
size_t | len | ||
) | [static] |
Definition at line 329 of file driver_wext.c.
static int wpa_driver_wext_finish_drv_init | ( | struct wpa_driver_wext_data * | drv | ) | [static] |
Definition at line 753 of file driver_wext.c.
static int wpa_driver_wext_flush_pmkid | ( | void * | priv | ) | [static] |
Definition at line 2116 of file driver_wext.c.
int wpa_driver_wext_get_bssid | ( | void * | priv, |
u8 * | bssid | ||
) |
wpa_driver_wext_get_bssid - Get BSSID, SIOCGIWAP : Pointer to private wext data from wpa_driver_wext_init() : Buffer for BSSID Returns: 0 on success, -1 on failure
Definition at line 75 of file driver_wext.c.
int wpa_driver_wext_get_capa | ( | void * | priv, |
struct wpa_driver_capa * | capa | ||
) |
Definition at line 2123 of file driver_wext.c.
static int wpa_driver_wext_get_range | ( | void * | priv | ) | [static] |
Definition at line 1363 of file driver_wext.c.
struct wpa_scan_results* wpa_driver_wext_get_scan_results | ( | void * | priv | ) | [read] |
wpa_driver_wext_get_scan_results - Fetch the latest scan results : Pointer to private wext data from wpa_driver_wext_init() Returns: Scan results on success, -1 on failure
Definition at line 1265 of file driver_wext.c.
int wpa_driver_wext_get_ssid | ( | void * | priv, |
u8 * | ssid | ||
) |
wpa_driver_wext_get_ssid - Get SSID, SIOCGIWESSID : Pointer to private wext data from wpa_driver_wext_init() : Buffer for the SSID; must be at least 32 bytes long Returns: SSID length on success, -1 on failure
Definition at line 129 of file driver_wext.c.
int wpa_driver_wext_get_version | ( | struct wpa_driver_wext_data * | drv | ) |
Definition at line 2164 of file driver_wext.c.
static u8* wpa_driver_wext_giwscan | ( | struct wpa_driver_wext_data * | drv, |
size_t * | len | ||
) | [static] |
Definition at line 916 of file driver_wext.c.
void* wpa_driver_wext_init | ( | void * | ctx, |
const char * | ifname | ||
) |
wpa_driver_wext_init - Initialize WE driver interface : context to be used when calling wpa_supplicant functions, e.g., wpa_supplicant_event() : interface name, e.g., wlan0 Returns: Pointer to private data, NULL on failure
Definition at line 697 of file driver_wext.c.
int wpa_driver_wext_keymgmt2wext | ( | int | keymgmt | ) |
Definition at line 1815 of file driver_wext.c.
static int wpa_driver_wext_mlme | ( | struct wpa_driver_wext_data * | drv, |
const u8 * | addr, | ||
int | cmd, | ||
int | reason_code | ||
) | [static] |
Definition at line 1675 of file driver_wext.c.
static int wpa_driver_wext_own_ifindex | ( | struct wpa_driver_wext_data * | drv, |
int | ifindex, | ||
u8 * | buf, | ||
size_t | len | ||
) | [static] |
Definition at line 599 of file driver_wext.c.
static int wpa_driver_wext_own_ifname | ( | struct wpa_driver_wext_data * | drv, |
u8 * | buf, | ||
size_t | len | ||
) | [static] |
Definition at line 574 of file driver_wext.c.
static int wpa_driver_wext_pmksa | ( | struct wpa_driver_wext_data * | drv, |
u32 | cmd, | ||
const u8 * | bssid, | ||
const u8 * | pmkid | ||
) | [static] |
Definition at line 2071 of file driver_wext.c.
static int wpa_driver_wext_remove_pmkid | ( | void * | priv, |
const u8 * | bssid, | ||
const u8 * | pmkid | ||
) | [static] |
Definition at line 2108 of file driver_wext.c.
int wpa_driver_wext_scan | ( | void * | priv, |
struct wpa_driver_scan_params * | params | ||
) |
wpa_driver_wext_scan - Request the driver to initiate scan : Pointer to private wext data from wpa_driver_wext_init()
Scan parameters (specific SSID to scan for (ProbeReq), etc.) Returns: 0 on success, -1 on failure |
Definition at line 861 of file driver_wext.c.
void wpa_driver_wext_scan_timeout | ( | void * | eloop_ctx, |
void * | timeout_ctx | ||
) |
wpa_driver_wext_scan_timeout - Scan timeout to report scan completion : Unused : ctx argument given to wpa_driver_wext_init()
This function can be used as registered timeout when starting a scan to generate a scan completed event if the driver does not report this.
Definition at line 848 of file driver_wext.c.
static int wpa_driver_wext_set_auth_alg | ( | void * | priv, |
int | auth_alg | ||
) | [static] |
Definition at line 1992 of file driver_wext.c.
int wpa_driver_wext_set_auth_param | ( | struct wpa_driver_wext_data * | drv, |
int | idx, | ||
u32 | value | ||
) |
Definition at line 45 of file driver_wext.c.
int wpa_driver_wext_set_bssid | ( | void * | priv, |
const u8 * | bssid | ||
) |
wpa_driver_wext_set_bssid - Set BSSID, SIOCSIWAP : Pointer to private wext data from wpa_driver_wext_init() : BSSID Returns: 0 on success, -1 on failure
Definition at line 100 of file driver_wext.c.
static int wpa_driver_wext_set_countermeasures | ( | void * | priv, |
int | enabled | ||
) | [static] |
Definition at line 1653 of file driver_wext.c.
static int wpa_driver_wext_set_drop_unencrypted | ( | void * | priv, |
int | enabled | ||
) | [static] |
Definition at line 1664 of file driver_wext.c.
int wpa_driver_wext_set_freq | ( | void * | priv, |
int | freq | ||
) |
wpa_driver_wext_set_freq - Set frequency/channel, SIOCSIWFREQ : Pointer to private wext data from wpa_driver_wext_init() : Frequency in MHz Returns: 0 on success, -1 on failure
Definition at line 213 of file driver_wext.c.
static int wpa_driver_wext_set_gen_ie | ( | void * | priv, |
const u8 * | ie, | ||
size_t | ie_len | ||
) | [static] |
Definition at line 1775 of file driver_wext.c.
int wpa_driver_wext_set_key | ( | const char * | ifname, |
void * | priv, | ||
enum 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 | ||
) |
wpa_driver_wext_set_key - Configure encryption key : Pointer to private wext data from wpa_driver_wext_init() : Private driver interface data : Encryption algorithm (WPA_ALG_NONE, WPA_ALG_WEP, WPA_ALG_TKIP, WPA_ALG_CCMP); WPA_ALG_NONE clears the key. : Address of the peer STA or ff:ff:ff:ff:ff:ff for broadcast/default keys : key index (0..3), usually 0 for unicast keys : Configure this key as the default Tx key (only used when driver does not support separate unicast/individual key : Sequence number/packet number, seq_len octets, the next packet number to be used for in replay protection; configured for Rx keys (in most cases, this is only used with broadcast keys and set to zero for unicast keys) : Length of the seq, depends on the algorithm: TKIP: 6 octets, CCMP: 6 octets : Key buffer; TKIP: 16-byte temporal key, 8-byte Tx Mic key, 8-byte Rx Mic Key : Length of the key buffer in octets (WEP: 5 or 13, TKIP: 32, CCMP: 16) Returns: 0 on success, -1 on failure
This function uses SIOCSIWENCODEEXT by default, but tries to use SIOCSIWENCODE if the extended ioctl fails when configuring a WEP key.
Definition at line 1592 of file driver_wext.c.
static int wpa_driver_wext_set_key_ext | ( | void * | priv, |
enum 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 | ||
) | [static] |
Definition at line 1472 of file driver_wext.c.
int wpa_driver_wext_set_mode | ( | void * | priv, |
int | mode | ||
) |
wpa_driver_wext_set_mode - Set wireless mode (infra/adhoc), SIOCSIWMODE : Pointer to private wext data from wpa_driver_wext_init() : 0 = infra/BSS (associate with an AP), 1 = adhoc/IBSS Returns: 0 on success, -1 on failure
Definition at line 2021 of file driver_wext.c.
int wpa_driver_wext_set_operstate | ( | void * | priv, |
int | state | ||
) |
Definition at line 2152 of file driver_wext.c.
static int wpa_driver_wext_set_psk | ( | struct wpa_driver_wext_data * | drv, |
const u8 * | psk | ||
) | [static] |
Definition at line 1435 of file driver_wext.c.
int wpa_driver_wext_set_ssid | ( | void * | priv, |
const u8 * | ssid, | ||
size_t | ssid_len | ||
) |
wpa_driver_wext_set_ssid - Set SSID, SIOCSIWESSID : Pointer to private wext data from wpa_driver_wext_init() : SSID : Length of SSID (0..32) Returns: 0 on success, -1 on failure
Definition at line 167 of file driver_wext.c.
{ .name = "wext", .desc = "Linux wireless extensions (generic)", .get_bssid = wpa_driver_wext_get_bssid, .get_ssid = wpa_driver_wext_get_ssid, .set_key = wpa_driver_wext_set_key, .set_countermeasures = wpa_driver_wext_set_countermeasures, .scan2 = wpa_driver_wext_scan, .get_scan_results2 = wpa_driver_wext_get_scan_results, .deauthenticate = wpa_driver_wext_deauthenticate, .disassociate = wpa_driver_wext_disassociate, .associate = wpa_driver_wext_associate, .init = wpa_driver_wext_init, .deinit = wpa_driver_wext_deinit, .add_pmkid = wpa_driver_wext_add_pmkid, .remove_pmkid = wpa_driver_wext_remove_pmkid, .flush_pmkid = wpa_driver_wext_flush_pmkid, .get_capa = wpa_driver_wext_get_capa, .set_operstate = wpa_driver_wext_set_operstate, }
Definition at line 2170 of file driver_wext.c.