$search

wpa_supplicant.c File Reference

#include "includes.h"
#include "common.h"
#include "eapol_supp/eapol_supp_sm.h"
#include "eap_peer/eap.h"
#include "eap_server/eap_methods.h"
#include "rsn_supp/wpa.h"
#include "eloop.h"
#include "config.h"
#include "l2_packet/l2_packet.h"
#include "wpa_supplicant_i.h"
#include "driver_i.h"
#include "ctrl_iface.h"
#include "pcsc_funcs.h"
#include "common/version.h"
#include "rsn_supp/preauth.h"
#include "rsn_supp/pmksa_cache.h"
#include "common/wpa_ctrl.h"
#include "mlme.h"
#include "common/ieee802_11_defs.h"
#include "blacklist.h"
#include "wpas_glue.h"
#include "wps_supplicant.h"
#include "ibss_rsn.h"
#include "sme.h"
#include "ap.h"
#include "notify.h"
#include "bgscan.h"
#include "bss.h"
#include "scan.h"
#include "../../src/nodes/wpa_supplicant_node.h"
Include dependency graph for wpa_supplicant.c:

Go to the source code of this file.

Functions

enum wpa_cipher cipher_suite2driver (int cipher)
enum wpa_key_mgmt key_mgmt2driver (int key_mgmt)
void wpa_clear_keys (struct wpa_supplicant *wpa_s, const u8 *addr)
int wpa_set_wep_keys (struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid)
struct wpa_supplicantwpa_supplicant_add_iface (struct wpa_global *global, struct wpa_interface *iface)
static struct wpa_supplicantwpa_supplicant_alloc (void)
void wpa_supplicant_associate (struct wpa_supplicant *wpa_s, struct wpa_bss *bss, struct wpa_ssid *ssid)
void wpa_supplicant_cancel_auth_timeout (struct wpa_supplicant *wpa_s)
static void wpa_supplicant_cleanup (struct wpa_supplicant *wpa_s)
static void wpa_supplicant_clear_status (struct wpa_supplicant *wpa_s)
static int wpa_supplicant_daemon (const char *pid_file)
void wpa_supplicant_deauthenticate (struct wpa_supplicant *wpa_s, int reason_code)
void wpa_supplicant_deinit (struct wpa_global *global)
static void wpa_supplicant_deinit_iface (struct wpa_supplicant *wpa_s, int notify)
void wpa_supplicant_disable_network (struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid)
void wpa_supplicant_disassociate (struct wpa_supplicant *wpa_s, int reason_code)
int wpa_supplicant_driver_init (struct wpa_supplicant *wpa_s)
void wpa_supplicant_enable_network (struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid)
struct wpa_supplicantwpa_supplicant_get_iface (struct wpa_global *global, const char *ifname)
struct wpa_ssidwpa_supplicant_get_ssid (struct wpa_supplicant *wpa_s)
struct wpa_globalwpa_supplicant_init (struct wpa_params *params)
static int wpa_supplicant_init_iface (struct wpa_supplicant *wpa_s, struct wpa_interface *iface)
void wpa_supplicant_initiate_eapol (struct wpa_supplicant *wpa_s)
static void wpa_supplicant_reconfig (int sig, void *signal_ctx)
int wpa_supplicant_reload_configuration (struct wpa_supplicant *wpa_s)
int wpa_supplicant_remove_iface (struct wpa_global *global, struct wpa_supplicant *wpa_s)
void wpa_supplicant_req_auth_timeout (struct wpa_supplicant *wpa_s, int sec, int usec)
int wpa_supplicant_run (struct wpa_global *global)
void wpa_supplicant_rx_eapol (void *ctx, const u8 *src_addr, const u8 *buf, size_t len)
void wpa_supplicant_select_network (struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid)
int wpa_supplicant_set_ap_scan (struct wpa_supplicant *wpa_s, int ap_scan)
int wpa_supplicant_set_debug_params (struct wpa_global *global, int debug_level, int debug_timestamp, int debug_show_keys)
static int wpa_supplicant_set_driver (struct wpa_supplicant *wpa_s, const char *name)
void wpa_supplicant_set_non_wpa_policy (struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid)
void wpa_supplicant_set_state (struct wpa_supplicant *wpa_s, enum wpa_states state)
int wpa_supplicant_set_suites (struct wpa_supplicant *wpa_s, struct wpa_bss *bss, struct wpa_ssid *ssid, u8 *wpa_ie, size_t *wpa_ie_len)
static int wpa_supplicant_set_wpa_none_key (struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid)
const char * wpa_supplicant_state_txt (enum wpa_states state)
static int wpa_supplicant_suites_from_ai (struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid, struct wpa_ie_data *ie)
static void wpa_supplicant_terminate (int sig, void *signal_ctx)
void wpa_supplicant_terminate_proc (struct wpa_global *global)
static void wpa_supplicant_timeout (void *eloop_ctx, void *timeout_ctx)

Variables

int wpa_debug_level
int wpa_debug_show_keys
int wpa_debug_timestamp
struct wpa_driver_opswpa_drivers []
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
const char * wpa_supplicant_license
const char * wpa_supplicant_version

Function Documentation

enum wpa_cipher cipher_suite2driver ( int  cipher  ) 

Definition at line 702 of file wpa_supplicant.c.

enum wpa_key_mgmt key_mgmt2driver ( int  key_mgmt  ) 

Definition at line 720 of file wpa_supplicant.c.

void wpa_clear_keys ( struct wpa_supplicant wpa_s,
const u8 addr 
)

wpa_clear_keys - Clear keys configured for the driver : Pointer to wpa_supplicant data : Previously used BSSID or NULL if not available

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

Definition at line 444 of file wpa_supplicant.c.

int wpa_set_wep_keys ( struct wpa_supplicant wpa_s,
struct wpa_ssid ssid 
)

Definition at line 126 of file wpa_supplicant.c.

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

wpa_supplicant_add_iface - Add a new network interface : Pointer to global data from wpa_supplicant_init() : 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.

Definition at line 2124 of file wpa_supplicant.c.

static struct wpa_supplicant* wpa_supplicant_alloc ( void   )  [static, read]

Definition at line 1867 of file wpa_supplicant.c.

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

wpa_supplicant_associate - Request association : Pointer to wpa_supplicant data : Scan results for the selected BSS, or NULL if not available : Configuration data for the selected network

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

Definition at line 999 of file wpa_supplicant.c.

void wpa_supplicant_cancel_auth_timeout ( struct wpa_supplicant wpa_s  ) 

wpa_supplicant_cancel_auth_timeout - Cancel authentication timeout : 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.

Definition at line 242 of file wpa_supplicant.c.

static void wpa_supplicant_cleanup ( struct wpa_supplicant wpa_s  )  [static]

Definition at line 367 of file wpa_supplicant.c.

static void wpa_supplicant_clear_status ( struct wpa_supplicant wpa_s  )  [static]

Definition at line 598 of file wpa_supplicant.c.

static int wpa_supplicant_daemon ( const char *  pid_file  )  [static]

Definition at line 1860 of file wpa_supplicant.c.

void wpa_supplicant_deauthenticate ( struct wpa_supplicant wpa_s,
int  reason_code 
)

wpa_supplicant_deauthenticate - Deauthenticate the current connection : Pointer to wpa_supplicant data : IEEE 802.11 reason code for the deauthenticate frame

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

Definition at line 1348 of file wpa_supplicant.c.

void wpa_supplicant_deinit ( struct wpa_global global  ) 

wpa_supplicant_deinit - Deinitialize wpa_supplicant : 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.

Definition at line 2381 of file wpa_supplicant.c.

static void wpa_supplicant_deinit_iface ( struct wpa_supplicant wpa_s,
int  notify 
) [static]

Definition at line 2091 of file wpa_supplicant.c.

void wpa_supplicant_disable_network ( struct wpa_supplicant wpa_s,
struct wpa_ssid ssid 
)

wpa_supplicant_disable_network - Mark a configured network as disabled : wpa_supplicant structure for a network interface : wpa_ssid structure for a configured network or NULL

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

Definition at line 1431 of file wpa_supplicant.c.

void wpa_supplicant_disassociate ( struct wpa_supplicant wpa_s,
int  reason_code 
)

wpa_supplicant_disassociate - Disassociate the current connection : Pointer to wpa_supplicant data : IEEE 802.11 reason code for the disassociate frame

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

Definition at line 1315 of file wpa_supplicant.c.

int wpa_supplicant_driver_init ( struct wpa_supplicant wpa_s  ) 

wpa_supplicant_driver_init - Initialize driver interface parameters : 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.

Definition at line 1799 of file wpa_supplicant.c.

void wpa_supplicant_enable_network ( struct wpa_supplicant wpa_s,
struct wpa_ssid ssid 
)

wpa_supplicant_enable_network - Mark a configured network as enabled : wpa_supplicant structure for a network interface : wpa_ssid structure for a configured network or NULL

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

Definition at line 1381 of file wpa_supplicant.c.

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

wpa_supplicant_get_iface - Get a new network interface : Pointer to global data from wpa_supplicant_init() : Interface name Returns: Pointer to the interface or NULL if not found

Definition at line 2229 of file wpa_supplicant.c.

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

wpa_supplicant_get_ssid - Get a pointer to the current network structure : Pointer to wpa_supplicant data Returns: A pointer to the current network structure or NULL on failure

Definition at line 1578 of file wpa_supplicant.c.

struct wpa_global* wpa_supplicant_init ( struct wpa_params params  )  [read]

wpa_supplicant_init - Initialize wpa_supplicant : 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.

Definition at line 2251 of file wpa_supplicant.c.

static int wpa_supplicant_init_iface ( struct wpa_supplicant wpa_s,
struct wpa_interface iface 
) [static]

Definition at line 1881 of file wpa_supplicant.c.

void wpa_supplicant_initiate_eapol ( struct wpa_supplicant wpa_s  ) 

wpa_supplicant_initiate_eapol - Configure EAPOL state machine : Pointer to wpa_supplicant data

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

Definition at line 257 of file wpa_supplicant.c.

static void wpa_supplicant_reconfig ( int  sig,
void *  signal_ctx 
) [static]

Definition at line 689 of file wpa_supplicant.c.

int wpa_supplicant_reload_configuration ( struct wpa_supplicant wpa_s  ) 

wpa_supplicant_reload_configuration - Reload configuration data : 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.

Definition at line 624 of file wpa_supplicant.c.

int wpa_supplicant_remove_iface ( struct wpa_global global,
struct wpa_supplicant wpa_s 
)

wpa_supplicant_remove_iface - Remove a network interface : Pointer to global data from wpa_supplicant_init() : 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.

Definition at line 2195 of file wpa_supplicant.c.

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

wpa_supplicant_req_auth_timeout - Schedule a timeout for authentication : Pointer to wpa_supplicant data : Number of seconds after which to time out authentication : Number of microseconds after which to time out authentication

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

Definition at line 220 of file wpa_supplicant.c.

int wpa_supplicant_run ( struct wpa_global global  ) 

wpa_supplicant_run - Run the wpa_supplicant main event loop : 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.

Definition at line 2350 of file wpa_supplicant.c.

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

wpa_supplicant_rx_eapol - Deliver a received EAPOL frame to wpa_supplicant : Context pointer (wpa_s); this is the ctx variable registered with struct wpa_driver_ops::init() : Source address of the EAPOL frame : EAPOL data starting from the EAPOL header (i.e., no Ethernet header) : 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.

Definition at line 1693 of file wpa_supplicant.c.

void wpa_supplicant_select_network ( struct wpa_supplicant wpa_s,
struct wpa_ssid ssid 
)

wpa_supplicant_select_network - Attempt association with a network : wpa_supplicant structure for a network interface : wpa_ssid structure for a configured network or NULL for any network

Definition at line 1473 of file wpa_supplicant.c.

int wpa_supplicant_set_ap_scan ( struct wpa_supplicant wpa_s,
int  ap_scan 
)

wpa_supplicant_set_ap_scan - Set AP scan mode for interface : wpa_supplicant structure for a network interface : AP scan mode Returns: 0 if succeed or -1 if ap_scan has an invalid value

Definition at line 1514 of file wpa_supplicant.c.

int wpa_supplicant_set_debug_params ( struct wpa_global global,
int  debug_level,
int  debug_timestamp,
int  debug_show_keys 
)

wpa_supplicant_set_debug_params - Set global debug params : wpa_global structure : debug level : determines if show timestamp in debug data : determines if show keys in debug data Returns: 0 if succeed or -1 if debug_level has wrong value

Definition at line 1540 of file wpa_supplicant.c.

static int wpa_supplicant_set_driver ( struct wpa_supplicant wpa_s,
const char *  name 
) [static]

Definition at line 1636 of file wpa_supplicant.c.

void wpa_supplicant_set_non_wpa_policy ( struct wpa_supplicant wpa_s,
struct wpa_ssid ssid 
)

wpa_supplicant_set_non_wpa_policy - Set WPA parameters to non-WPA mode : Pointer to wpa_supplicant data : 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.

Definition at line 323 of file wpa_supplicant.c.

void wpa_supplicant_set_state ( struct wpa_supplicant wpa_s,
enum wpa_states  state 
)

wpa_supplicant_set_state - Set current connection state : Pointer to wpa_supplicant data : 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.

Definition at line 523 of file wpa_supplicant.c.

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

wpa_supplicant_set_suites - Set authentication and encryption parameters : Pointer to wpa_supplicant data : Scan results for the selected BSS, or NULL if not available : Configuration data for the selected network : Buffer for the WPA/RSN IE : 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).

Definition at line 810 of file wpa_supplicant.c.

static int wpa_supplicant_set_wpa_none_key ( struct wpa_supplicant wpa_s,
struct wpa_ssid ssid 
) [static]

Definition at line 145 of file wpa_supplicant.c.

const char* wpa_supplicant_state_txt ( enum wpa_states  state  ) 

wpa_supplicant_state_txt - Get the connection state name as a text string : State (wpa_state; WPA_*) Returns: The state name as a printable text string

Definition at line 488 of file wpa_supplicant.c.

static int wpa_supplicant_suites_from_ai ( struct wpa_supplicant wpa_s,
struct wpa_ssid ssid,
struct wpa_ie_data ie 
) [static]

Definition at line 748 of file wpa_supplicant.c.

static void wpa_supplicant_terminate ( int  sig,
void *  signal_ctx 
) [static]

Definition at line 586 of file wpa_supplicant.c.

void wpa_supplicant_terminate_proc ( struct wpa_global global  ) 

Definition at line 569 of file wpa_supplicant.c.

static void wpa_supplicant_timeout ( void *  eloop_ctx,
void *  timeout_ctx 
) [static]

Definition at line 194 of file wpa_supplicant.c.


Variable Documentation

Definition at line 29 of file wpa_debug.c.

Definition at line 30 of file wpa_debug.c.

Definition at line 31 of file wpa_debug.c.

Definition at line 754 of file driver_privsep.c.

Initial value:
"This program is free software; you can redistribute it and/or modify\n"
"it under the terms of the GNU General Public License version 2 as\n"
"published by the Free Software Foundation.\n"
"\n"
"This program is distributed in the hope that it will be useful,\n"
"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n"
"GNU General Public License for more details.\n"
"\n"

Definition at line 70 of file wpa_supplicant.c.

Initial value:
"You should have received a copy of the GNU General Public License\n"
"along with this program; if not, write to the Free Software\n"
"Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n"
"\n"
"Alternatively, this software may be distributed under the terms of the\n"
"BSD license.\n"
"\n"
"Redistribution and use in source and binary forms, with or without\n"
"modification, are permitted provided that the following conditions are\n"
"met:\n"
"\n"

Definition at line 80 of file wpa_supplicant.c.

Initial value:
"1. Redistributions of source code must retain the above copyright\n"
"   notice, this list of conditions and the following disclaimer.\n"
"\n"
"2. Redistributions in binary form must reproduce the above copyright\n"
"   notice, this list of conditions and the following disclaimer in the\n"
"   documentation and/or other materials provided with the distribution.\n"
"\n"

Definition at line 92 of file wpa_supplicant.c.

Initial value:
"3. Neither the name(s) of the above-listed copyright holder(s) nor the\n"
"   names of its contributors may be used to endorse or promote products\n"
"   derived from this software without specific prior written permission.\n"
"\n"
"THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n"
"\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n"
"LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n"
"A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n"

Definition at line 100 of file wpa_supplicant.c.

Initial value:
"OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n"
"SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n"
"LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n"
"DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n"
"THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n"
"(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n"
"OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
"\n"

Definition at line 109 of file wpa_supplicant.c.

Initial value:
"This program is free software. You can distribute it and/or modify it\n"
"under the terms of the GNU General Public License version 2.\n"
"\n"
"Alternatively, this software may be distributed under the terms of the\n"
"BSD license. See README and COPYING for more details.\n"

Definition at line 56 of file wpa_supplicant.c.

Initial value:
"wpa_supplicant v" VERSION_STR "\n"
"Copyright (c) 2003-2010, Jouni Malinen <j@w1.fi> and contributors"

Definition at line 52 of file wpa_supplicant.c.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines


wpa_supplicant_node
Author(s): Package maintained by Blaise Gassend
autogenerated on Fri Mar 1 16:00:48 2013