wpa_supplicant / hostapd  2.5
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Data Structures | Functions
driver_wext.h File Reference

WPA Supplicant - driver_wext exported functions. More...

#include <net/if.h>

Go to the source code of this file.

Data Structures

struct  wpa_driver_wext_data
 

Functions

int wpa_driver_wext_get_bssid (void *priv, u8 *bssid)
 Get BSSID, SIOCGIWAP. More...
 
int wpa_driver_wext_set_bssid (void *priv, const u8 *bssid)
 Set BSSID, SIOCSIWAP. More...
 
int wpa_driver_wext_get_ssid (void *priv, u8 *ssid)
 Get SSID, SIOCGIWESSID. More...
 
int wpa_driver_wext_set_ssid (void *priv, const u8 *ssid, size_t ssid_len)
 Set SSID, SIOCSIWESSID. More...
 
int wpa_driver_wext_set_freq (void *priv, int freq)
 Set frequency/channel, SIOCSIWFREQ. More...
 
int wpa_driver_wext_set_mode (void *priv, int mode)
 Set wireless mode (infra/adhoc), SIOCSIWMODE. More...
 
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)
 Configure encryption key. More...
 
int wpa_driver_wext_scan (void *priv, struct wpa_driver_scan_params *params)
 Request the driver to initiate scan. More...
 
struct wpa_scan_resultswpa_driver_wext_get_scan_results (void *priv)
 Fetch the latest scan results. More...
 
void wpa_driver_wext_scan_timeout (void *eloop_ctx, void *timeout_ctx)
 Scan timeout to report scan completion. More...
 
int wpa_driver_wext_alternative_ifindex (struct wpa_driver_wext_data *drv, const char *ifname)
 
void * wpa_driver_wext_init (void *ctx, const char *ifname)
 Initialize WE driver interface. More...
 
void wpa_driver_wext_deinit (void *priv)
 Deinitialize WE driver interface. More...
 
int wpa_driver_wext_set_operstate (void *priv, int state)
 
int wpa_driver_wext_get_version (struct wpa_driver_wext_data *drv)
 
int wpa_driver_wext_associate (void *priv, struct wpa_driver_associate_params *params)
 
int wpa_driver_wext_get_capa (void *priv, struct wpa_driver_capa *capa)
 
int wpa_driver_wext_set_auth_param (struct wpa_driver_wext_data *drv, int idx, u32 value)
 
int wpa_driver_wext_cipher2wext (int cipher)
 
int wpa_driver_wext_keymgmt2wext (int keymgmt)
 

Detailed Description

WPA Supplicant - driver_wext exported functions.

Function Documentation

void wpa_driver_wext_deinit ( void *  priv)

Deinitialize WE driver interface.

Parameters
privPointer 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().

int wpa_driver_wext_get_bssid ( void *  priv,
u8 *  bssid 
)

Get BSSID, SIOCGIWAP.

Parameters
privPointer to private wext data from wpa_driver_wext_init()
bssidBuffer for BSSID
Returns
0 on success, -1 on failure
struct wpa_scan_results* wpa_driver_wext_get_scan_results ( void *  priv)

Fetch the latest scan results.

Parameters
privPointer to private wext data from wpa_driver_wext_init()
Returns
Scan results on success, -1 on failure
int wpa_driver_wext_get_ssid ( void *  priv,
u8 *  ssid 
)

Get SSID, SIOCGIWESSID.

Parameters
privPointer to private wext data from wpa_driver_wext_init()
ssidBuffer for the SSID; must be at least 32 bytes long
Returns
SSID length on success, -1 on failure
void* wpa_driver_wext_init ( void *  ctx,
const char *  ifname 
)

Initialize WE driver interface.

Parameters
ctxcontext to be used when calling wpa_supplicant functions, e.g., wpa_supplicant_event()
ifnameinterface name, e.g., wlan0
Returns
Pointer to private data, NULL on failure
int wpa_driver_wext_scan ( void *  priv,
struct wpa_driver_scan_params params 
)

Request the driver to initiate scan.

Parameters
privPointer to private wext data from wpa_driver_wext_init()
paramScan parameters (specific SSID to scan for (ProbeReq), etc.)
Returns
0 on success, -1 on failure
void wpa_driver_wext_scan_timeout ( void *  eloop_ctx,
void *  timeout_ctx 
)

Scan timeout to report scan completion.

Parameters
eloop_ctxUnused
timeout_ctxctx 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.

int wpa_driver_wext_set_bssid ( void *  priv,
const u8 *  bssid 
)

Set BSSID, SIOCSIWAP.

Parameters
privPointer to private wext data from wpa_driver_wext_init()
bssidBSSID
Returns
0 on success, -1 on failure
int wpa_driver_wext_set_freq ( void *  priv,
int  freq 
)

Set frequency/channel, SIOCSIWFREQ.

Parameters
privPointer to private wext data from wpa_driver_wext_init()
freqFrequency in MHz
Returns
0 on success, -1 on failure
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 
)

Configure encryption key.

Parameters
privPointer to private wext data from wpa_driver_wext_init()
privPrivate driver interface data
algEncryption algorithm (WPA_ALG_NONE, WPA_ALG_WEP, WPA_ALG_TKIP, WPA_ALG_CCMP); WPA_ALG_NONE clears the key.
addrAddress of the peer STA or ff:ff:ff:ff:ff:ff for broadcast/default keys
key_idxkey index (0..3), usually 0 for unicast keys
set_txConfigure this key as the default Tx key (only used when driver does not support separate unicast/individual key
seqSequence 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)
seq_lenLength of the seq, depends on the algorithm: TKIP: 6 octets, CCMP: 6 octets
keyKey buffer; TKIP: 16-byte temporal key, 8-byte Tx Mic key, 8-byte Rx Mic Key
key_lenLength 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.

int wpa_driver_wext_set_mode ( void *  priv,
int  mode 
)

Set wireless mode (infra/adhoc), SIOCSIWMODE.

Parameters
privPointer to private wext data from wpa_driver_wext_init()
mode0 = infra/BSS (associate with an AP), 1 = adhoc/IBSS
Returns
0 on success, -1 on failure
int wpa_driver_wext_set_ssid ( void *  priv,
const u8 *  ssid,
size_t  ssid_len 
)

Set SSID, SIOCSIWESSID.

Parameters
privPointer to private wext data from wpa_driver_wext_init()
ssidSSID
ssid_lenLength of SSID (0..32)
Returns
0 on success, -1 on failure