wpa_supplicant_i.h File Reference

wpa_supplicant - Internal definitions More...

#include "common/defs.h"

Go to the source code of this file.

Data Structures

struct  wpa_interface
 Parameters for wpa_supplicant_add_iface(). More...
struct  wpa_params
 Parameters for wpa_supplicant_init(). More...
struct  wpa_global
 Internal, global data for all wpa_supplicant interfaces. More...
struct  wpa_client_mlme
struct  wpa_supplicant
 Internal data for wpa_supplicant interface. More...

Defines

#define WILDCARD_SSID_SCAN   ((struct wpa_ssid *) 1)

Functions

int wpa_set_wep_keys (struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid)
int wpa_supplicant_reload_configuration (struct wpa_supplicant *wpa_s)
 Reload configuration data.
const char * wpa_supplicant_state_txt (int state)
 Get the connection state name as a text string.
int wpa_supplicant_driver_init (struct wpa_supplicant *wpa_s)
 Initialize driver interface parameters.
int wpa_supplicant_set_suites (struct wpa_supplicant *wpa_s, struct wpa_scan_res *bss, struct wpa_ssid *ssid, u8 *wpa_ie, size_t *wpa_ie_len)
 Set authentication and encryption parameters.
void wpa_supplicant_associate (struct wpa_supplicant *wpa_s, struct wpa_scan_res *bss, struct wpa_ssid *ssid)
 Request association.
void wpa_supplicant_set_non_wpa_policy (struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid)
 Set WPA parameters to non-WPA mode.
void wpa_supplicant_initiate_eapol (struct wpa_supplicant *wpa_s)
 Configure EAPOL state machine.
int wpa_supplicant_get_scan_results (struct wpa_supplicant *wpa_s)
 Get scan results.
void wpa_clear_keys (struct wpa_supplicant *wpa_s, const u8 *addr)
 Clear keys configured for the driver.
void wpa_supplicant_req_auth_timeout (struct wpa_supplicant *wpa_s, int sec, int usec)
 Schedule a timeout for authentication.
void wpa_supplicant_set_state (struct wpa_supplicant *wpa_s, wpa_states state)
 Set current connection state.
struct wpa_ssidwpa_supplicant_get_ssid (struct wpa_supplicant *wpa_s)
 Get a pointer to the current network structure.
void wpa_supplicant_cancel_auth_timeout (struct wpa_supplicant *wpa_s)
 Cancel authentication timeout.
void wpa_supplicant_deauthenticate (struct wpa_supplicant *wpa_s, int reason_code)
 Deauthenticate the current connection.
void wpa_supplicant_disassociate (struct wpa_supplicant *wpa_s, int reason_code)
 Disassociate the current connection.
void wpa_supplicant_enable_network (struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid)
 Mark a configured network as enabled.
void wpa_supplicant_disable_network (struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid)
 Mark a configured network as disabled.
void wpa_supplicant_select_network (struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid)
 Attempt association with a network.
int wpa_supplicant_set_ap_scan (struct wpa_supplicant *wpa_s, int ap_scan)
 Set AP scan mode for interface.
int wpa_supplicant_set_debug_params (struct wpa_global *global, int debug_level, int debug_timestamp, int debug_show_keys)
 Set global debug params.
void wpa_show_license (void)
struct wpa_supplicantwpa_supplicant_add_iface (struct wpa_global *global, struct wpa_interface *iface)
 Add a new network interface.
int wpa_supplicant_remove_iface (struct wpa_global *global, struct wpa_supplicant *wpa_s)
 Remove a network interface.
struct wpa_supplicantwpa_supplicant_get_iface (struct wpa_global *global, const char *ifname)
 Get a new network interface.
struct wpa_globalwpa_supplicant_init (struct wpa_params *params)
 Initialize wpa_supplicant.
int wpa_supplicant_run (struct wpa_global *global)
 Run the wpa_supplicant main event loop.
void wpa_supplicant_deinit (struct wpa_global *global)
 Deinitialize wpa_supplicant.
int wpa_supplicant_scard_init (struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid)
 Initialize SIM/USIM access with PC/SC.
int wpa_supplicant_enabled_networks (struct wpa_config *conf)
void wpa_supplicant_req_scan (struct wpa_supplicant *wpa_s, int sec, int usec)
 Schedule a scan for neighboring access points.
void wpa_supplicant_cancel_scan (struct wpa_supplicant *wpa_s)
 Cancel a scheduled scan request.
void wpa_supplicant_notify_scanning (struct wpa_supplicant *wpa_s, int scanning)
int wpa_supplicant_trigger_scan (struct wpa_supplicant *wpa_s, struct wpa_driver_scan_params *params)
void wpa_supplicant_mark_disassoc (struct wpa_supplicant *wpa_s)

Variables

const char * wpa_supplicant_version
const char * wpa_supplicant_license
const char * wpa_supplicant_full_license1
const char * wpa_supplicant_full_license2
const char * wpa_supplicant_full_license3
const char * wpa_supplicant_full_license4
const char * wpa_supplicant_full_license5

Detailed Description

wpa_supplicant - Internal definitions

Copyright
Copyright (c) 2003-2007, 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.


Function Documentation

void wpa_clear_keys ( struct wpa_supplicant wpa_s,
const u8 *  addr 
)

Clear keys configured for the driver.

Parameters:
wpa_s Pointer to wpa_supplicant data
addr Previously used BSSID or NULL if not available

This function clears the encryption keys that has been previously configured for the driver.

struct wpa_supplicant* wpa_supplicant_add_iface ( struct wpa_global global,
struct wpa_interface iface 
) [read]

Add a new network interface.

Parameters:
global Pointer to global data from wpa_supplicant_init()
iface Interface configuration options
Returns:
Pointer to the created interface or NULL on failure

This function is used to add new network interfaces for wpa_supplicant. This can be called before wpa_supplicant_run() to add interfaces before the main event loop has been started. In addition, new interfaces can be added dynamically while wpa_supplicant is already running. This could happen, e.g., when a hotplug network adapter is inserted.

void wpa_supplicant_associate ( struct wpa_supplicant wpa_s,
struct wpa_scan_res bss,
struct wpa_ssid ssid 
)

Request association.

Parameters:
wpa_s Pointer to wpa_supplicant data
bss Scan results for the selected BSS, or NULL if not available
ssid Configuration data for the selected network

This function is used to request wpa_supplicant to associate with a BSS.

void wpa_supplicant_cancel_auth_timeout ( struct wpa_supplicant wpa_s  ) 

Cancel authentication timeout.

Parameters:
wpa_s Pointer to wpa_supplicant data

This function is used to cancel authentication timeout scheduled with wpa_supplicant_req_auth_timeout() and it is called when authentication has been completed.

void wpa_supplicant_cancel_scan ( struct wpa_supplicant wpa_s  ) 

Cancel a scheduled scan request.

Parameters:
wpa_s Pointer to wpa_supplicant data

This function is used to cancel a scan request scheduled with wpa_supplicant_req_scan().

void wpa_supplicant_deauthenticate ( struct wpa_supplicant wpa_s,
int  reason_code 
)

Deauthenticate the current connection.

Parameters:
wpa_s Pointer to wpa_supplicant data
reason_code IEEE 802.11 reason code for the deauthenticate frame

This function is used to request wpa_supplicant to deauthenticate from the current AP.

void wpa_supplicant_deinit ( struct wpa_global global  ) 

Deinitialize wpa_supplicant.

Parameters:
global Pointer to global data from wpa_supplicant_init()

This function is called to deinitialize wpa_supplicant and to free all allocated resources. Remaining network interfaces will also be removed.

void wpa_supplicant_disable_network ( struct wpa_supplicant wpa_s,
struct wpa_ssid ssid 
)

Mark a configured network as disabled.

Parameters:
wpa_s wpa_supplicant structure for a network interface
ssid wpa_ssid structure for a configured network or NULL

Disables the specified network or all networks if no network specified.

void wpa_supplicant_disassociate ( struct wpa_supplicant wpa_s,
int  reason_code 
)

Disassociate the current connection.

Parameters:
wpa_s Pointer to wpa_supplicant data
reason_code IEEE 802.11 reason code for the disassociate frame

This function is used to request wpa_supplicant to disassociate with the current AP.

int wpa_supplicant_driver_init ( struct wpa_supplicant wpa_s  ) 

Initialize driver interface parameters.

Parameters:
wpa_s Pointer to wpa_supplicant data
Returns:
0 on success, -1 on failure

This function is called to initialize driver interface parameters. wpa_drv_init() must have been called before this function to initialize the driver interface.

void wpa_supplicant_enable_network ( struct wpa_supplicant wpa_s,
struct wpa_ssid ssid 
)

Mark a configured network as enabled.

Parameters:
wpa_s wpa_supplicant structure for a network interface
ssid wpa_ssid structure for a configured network or NULL

Enables the specified network or all networks if no network specified.

struct wpa_supplicant* wpa_supplicant_get_iface ( struct wpa_global global,
const char *  ifname 
) [read]

Get a new network interface.

Parameters:
global Pointer to global data from wpa_supplicant_init()
ifname Interface name
Returns:
Pointer to the interface or NULL if not found
int wpa_supplicant_get_scan_results ( struct wpa_supplicant wpa_s  ) 

Get scan results.

Parameters:
wpa_s Pointer to wpa_supplicant data
Returns:
0 on success, -1 on failure

This function is request the current scan results from the driver and stores a local copy of the results in wpa_s->scan_res.

struct wpa_ssid* wpa_supplicant_get_ssid ( struct wpa_supplicant wpa_s  )  [read]

Get a pointer to the current network structure.

Parameters:
wpa_s Pointer to wpa_supplicant data
Returns:
A pointer to the current network structure or NULL on failure
struct wpa_global* wpa_supplicant_init ( struct wpa_params params  )  [read]

Initialize wpa_supplicant.

Parameters:
params Parameters for wpa_supplicant
Returns:
Pointer to global wpa_supplicant data, or NULL on failure

This function is used to initialize wpa_supplicant. After successful initialization, the returned data pointer can be used to add and remove network interfaces, and eventually, to deinitialize wpa_supplicant.

void wpa_supplicant_initiate_eapol ( struct wpa_supplicant wpa_s  ) 

Configure EAPOL state machine.

Parameters:
wpa_s Pointer to wpa_supplicant data

This function is used to configure EAPOL state machine based on the selected authentication mode.

int wpa_supplicant_reload_configuration ( struct wpa_supplicant wpa_s  ) 

Reload configuration data.

Parameters:
wpa_s Pointer to wpa_supplicant data
Returns:
0 on success or -1 if configuration parsing failed

This function can be used to request that the configuration data is reloaded (e.g., after configuration file change). This function is reloading configuration only for one interface, so this may need to be called multiple times if wpa_supplicant is controlling multiple interfaces and all interfaces need reconfiguration.

int wpa_supplicant_remove_iface ( struct wpa_global global,
struct wpa_supplicant wpa_s 
)

Remove a network interface.

Parameters:
global Pointer to global data from wpa_supplicant_init()
wpa_s Pointer to the network interface to be removed
Returns:
0 if interface was removed, -1 if interface was not found

This function can be used to dynamically remove network interfaces from wpa_supplicant, e.g., when a hotplug network adapter is ejected. In addition, this function is used to remove all remaining interfaces when wpa_supplicant is terminated.

void wpa_supplicant_req_auth_timeout ( struct wpa_supplicant wpa_s,
int  sec,
int  usec 
)

Schedule a timeout for authentication.

Parameters:
wpa_s Pointer to wpa_supplicant data
sec Number of seconds after which to time out authentication
usec Number of microseconds after which to time out authentication

This function is used to schedule a timeout for the current authentication attempt.

void wpa_supplicant_req_scan ( struct wpa_supplicant wpa_s,
int  sec,
int  usec 
)

Schedule a scan for neighboring access points.

Parameters:
wpa_s Pointer to wpa_supplicant data
sec Number of seconds after which to scan
usec Number of microseconds after which to scan

This function is used to schedule a scan for neighboring access points after the specified time.

int wpa_supplicant_run ( struct wpa_global global  ) 

Run the wpa_supplicant main event loop.

Parameters:
global Pointer to global data from wpa_supplicant_init()
Returns:
0 after successful event loop run, -1 on failure

This function starts the main event loop and continues running as long as there are any remaining events. In most cases, this function is running as long as the wpa_supplicant process in still in use.

int wpa_supplicant_scard_init ( struct wpa_supplicant wpa_s,
struct wpa_ssid ssid 
)

Initialize SIM/USIM access with PC/SC.

Parameters:
wpa_s pointer to wpa_supplicant data
ssid Configuration data for the network
Returns:
0 on success, -1 on failure

This function is called when starting authentication with a network that is configured to use PC/SC for SIM/USIM access (EAP-SIM or EAP-AKA).

void wpa_supplicant_select_network ( struct wpa_supplicant wpa_s,
struct wpa_ssid ssid 
)

Attempt association with a network.

Parameters:
wpa_s wpa_supplicant structure for a network interface
ssid wpa_ssid structure for a configured network or NULL for any network
int wpa_supplicant_set_ap_scan ( struct wpa_supplicant wpa_s,
int  ap_scan 
)

Set AP scan mode for interface.

Parameters:
wpa_s wpa_supplicant structure for a network interface
ap_scan AP scan mode
Returns:
0 if succeed or -1 if ap_scan has an invalid value
int wpa_supplicant_set_debug_params ( struct wpa_global global,
int  debug_level,
int  debug_timestamp,
int  debug_show_keys 
)

Set global debug params.

Parameters:
global wpa_global structure
debug_level debug level
debug_timestamp determines if show timestamp in debug data
debug_show_keys determines if show keys in debug data
Returns:
0 if succeed or -1 if debug_level has wrong value
void wpa_supplicant_set_non_wpa_policy ( struct wpa_supplicant wpa_s,
struct wpa_ssid ssid 
)

Set WPA parameters to non-WPA mode.

Parameters:
wpa_s Pointer to wpa_supplicant data
ssid Configuration data for the network

This function is used to configure WPA state machine and related parameters to a mode where WPA is not enabled. This is called as part of the authentication configuration when the selected network does not use WPA.

void wpa_supplicant_set_state ( struct wpa_supplicant wpa_s,
wpa_states  state 
)

Set current connection state.

Parameters:
wpa_s Pointer to wpa_supplicant data
state The new connection state

This function is called whenever the connection state changes, e.g., association is completed for WPA/WPA2 4-Way Handshake is started.

int wpa_supplicant_set_suites ( struct wpa_supplicant wpa_s,
struct wpa_scan_res bss,
struct wpa_ssid ssid,
u8 *  wpa_ie,
size_t *  wpa_ie_len 
)

Set authentication and encryption parameters.

Parameters:
wpa_s Pointer to wpa_supplicant data
bss Scan results for the selected BSS, or NULL if not available
ssid Configuration data for the selected network
wpa_ie Buffer for the WPA/RSN IE
wpa_ie_len Maximum wpa_ie buffer size on input. This is changed to be the used buffer length in case the functions returns success.
Returns:
0 on success or -1 on failure

This function is used to configure authentication and encryption parameters based on the network configuration and scan result for the selected BSS (if available).

const char* wpa_supplicant_state_txt ( int  state  ) 

Get the connection state name as a text string.

Parameters:
state State (wpa_state; WPA_*)
Returns:
The state name as a printable text string
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines

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