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

wpa_supplicant - Internal definitions More...

#include "utils/list.h"
#include "common/defs.h"
#include "common/sae.h"
#include "common/wpa_ctrl.h"
#include "wps/wps_defs.h"
#include "config_ssid.h"
#include "wmm_ac.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  p2p_srv_bonjour
 
struct  p2p_srv_upnp
 
struct  wpa_global
 Internal, global data for all wpa_supplicant interfaces. More...
 
struct  wpa_radio
 Internal data for per-radio information. More...
 
struct  wpa_radio_work
 Radio work item. More...
 
struct  wpa_connect_work
 
struct  wpa_external_work
 
struct  wps_ap_info
 
struct  wpa_ssid_value
 
struct  wpa_used_freq_data
 
struct  rrm_data
 
struct  wpa_supplicant
 Internal data for wpa_supplicant interface. More...
 

Macros

#define WPA_FREQ_USED_BY_INFRA_STATION   BIT(0)
 
#define WPA_FREQ_USED_BY_P2P_CLIENT   BIT(1)
 
#define RRM_NEIGHBOR_REPORT_TIMEOUT   1 /* 1 second for AP to send a report */
 
#define WILDCARD_SSID_SCAN   ((struct wpa_ssid *) 1)
 
#define MAX_SCAN_ID   16
 
#define MAC_ADDR_RAND_SCAN   BIT(0)
 
#define MAC_ADDR_RAND_SCHED_SCAN   BIT(1)
 
#define MAC_ADDR_RAND_PNO   BIT(2)
 
#define MAC_ADDR_RAND_ALL
 

Enumerations

enum  offchannel_send_action_result { OFFCHANNEL_SEND_ACTION_SUCCESS, OFFCHANNEL_SEND_ACTION_NO_ACK, OFFCHANNEL_SEND_ACTION_FAILED }
 Result of offchannel send Action frame. More...
 
enum  wpa_supplicant_test_failure { WPAS_TEST_FAILURE_NONE, WPAS_TEST_FAILURE_SCAN_TRIGGER }
 

Functions

int radio_add_work (struct wpa_supplicant *wpa_s, unsigned int freq, const char *type, int next, void(*cb)(struct wpa_radio_work *work, int deinit), void *ctx)
 Add a radio work item. More...
 
void radio_work_done (struct wpa_radio_work *work)
 Indicate that a radio work item has been completed. More...
 
void radio_remove_works (struct wpa_supplicant *wpa_s, const char *type, int remove_all)
 
void radio_work_check_next (struct wpa_supplicant *wpa_s)
 
struct wpa_radio_workradio_work_pending (struct wpa_supplicant *wpa_s, const char *type)
 
int wpas_valid_bss_ssid (struct wpa_supplicant *wpa_s, struct wpa_bss *test_bss, struct wpa_ssid *test_ssid)
 
void wpas_connect_work_free (struct wpa_connect_work *cwork)
 
void wpas_connect_work_done (struct wpa_supplicant *wpa_s)
 
void wpa_supplicant_apply_ht_overrides (struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid, struct wpa_driver_associate_params *params)
 
void wpa_supplicant_apply_vht_overrides (struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid, struct wpa_driver_associate_params *params)
 
int wpa_set_wep_keys (struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid)
 
int wpa_supplicant_set_wpa_none_key (struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid)
 
int wpa_supplicant_reload_configuration (struct wpa_supplicant *wpa_s)
 Reload configuration data. More...
 
const char * wpa_supplicant_state_txt (enum wpa_states state)
 Get the connection state name as a text string. More...
 
int wpa_supplicant_update_mac_addr (struct wpa_supplicant *wpa_s)
 
int wpa_supplicant_driver_init (struct wpa_supplicant *wpa_s)
 Initialize driver interface parameters. More...
 
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)
 Set authentication and encryption parameters. More...
 
void wpa_supplicant_associate (struct wpa_supplicant *wpa_s, struct wpa_bss *bss, struct wpa_ssid *ssid)
 Request association. More...
 
void wpa_supplicant_set_non_wpa_policy (struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid)
 Set WPA parameters to non-WPA mode. More...
 
void wpa_supplicant_initiate_eapol (struct wpa_supplicant *wpa_s)
 Configure EAPOL state machine. More...
 
void wpa_clear_keys (struct wpa_supplicant *wpa_s, const u8 *addr)
 Clear keys configured for the driver. More...
 
void wpa_supplicant_req_auth_timeout (struct wpa_supplicant *wpa_s, int sec, int usec)
 Schedule a timeout for authentication. More...
 
void wpa_supplicant_reinit_autoscan (struct wpa_supplicant *wpa_s)
 
void wpa_supplicant_set_state (struct wpa_supplicant *wpa_s, enum wpa_states state)
 Set current connection state. More...
 
struct wpa_ssidwpa_supplicant_get_ssid (struct wpa_supplicant *wpa_s)
 Get a pointer to the current network structure. More...
 
const char * wpa_supplicant_get_eap_mode (struct wpa_supplicant *wpa_s)
 Get the current EAP mode. More...
 
void wpa_supplicant_cancel_auth_timeout (struct wpa_supplicant *wpa_s)
 Cancel authentication timeout. More...
 
void wpa_supplicant_deauthenticate (struct wpa_supplicant *wpa_s, int reason_code)
 Deauthenticate the current connection. More...
 
void wpa_supplicant_enable_network (struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid)
 Mark a configured network as enabled. More...
 
void wpa_supplicant_disable_network (struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid)
 Mark a configured network as disabled. More...
 
void wpa_supplicant_select_network (struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid)
 Attempt association with a network. More...
 
int wpas_set_pkcs11_engine_and_module_path (struct wpa_supplicant *wpa_s, const char *pkcs11_engine_path, const char *pkcs11_module_path)
 Set PKCS #11 engine and module path. More...
 
int wpa_supplicant_set_ap_scan (struct wpa_supplicant *wpa_s, int ap_scan)
 Set AP scan mode for interface. More...
 
int wpa_supplicant_set_bss_expiration_age (struct wpa_supplicant *wpa_s, unsigned int expire_age)
 Set BSS entry expiration age. More...
 
int wpa_supplicant_set_bss_expiration_count (struct wpa_supplicant *wpa_s, unsigned int expire_count)
 Set BSS entry expiration scan count. More...
 
int wpa_supplicant_set_scan_interval (struct wpa_supplicant *wpa_s, int scan_interval)
 Set scan interval. More...
 
int wpa_supplicant_set_debug_params (struct wpa_global *global, int debug_level, int debug_timestamp, int debug_show_keys)
 Set global debug params. More...
 
void free_hw_features (struct wpa_supplicant *wpa_s)
 
void wpa_show_license (void)
 
struct wpa_supplicantwpa_supplicant_add_iface (struct wpa_global *global, struct wpa_interface *iface, struct wpa_supplicant *parent)
 Add a new network interface. More...
 
int wpa_supplicant_remove_iface (struct wpa_global *global, struct wpa_supplicant *wpa_s, int terminate)
 Remove a network interface. More...
 
struct wpa_supplicantwpa_supplicant_get_iface (struct wpa_global *global, const char *ifname)
 Get a new network interface. More...
 
struct wpa_globalwpa_supplicant_init (struct wpa_params *params)
 Initialize wpa_supplicant. More...
 
int wpa_supplicant_run (struct wpa_global *global)
 Run the wpa_supplicant main event loop. More...
 
void wpa_supplicant_deinit (struct wpa_global *global)
 Deinitialize wpa_supplicant. More...
 
int wpa_supplicant_scard_init (struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid)
 Initialize SIM/USIM access with PC/SC. More...
 
void wpa_supplicant_terminate_proc (struct wpa_global *global)
 
void wpa_supplicant_rx_eapol (void *ctx, const u8 *src_addr, const u8 *buf, size_t len)
 Deliver a received EAPOL frame to wpa_supplicant. More...
 
void wpa_supplicant_update_config (struct wpa_supplicant *wpa_s)
 
void wpa_supplicant_clear_status (struct wpa_supplicant *wpa_s)
 
void wpas_connection_failed (struct wpa_supplicant *wpa_s, const u8 *bssid)
 
int wpas_driver_bss_selection (struct wpa_supplicant *wpa_s)
 
int wpas_is_p2p_prioritized (struct wpa_supplicant *wpa_s)
 
void wpas_auth_failed (struct wpa_supplicant *wpa_s, char *reason)
 
void wpas_clear_temp_disabled (struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid, int clear_failures)
 
int disallowed_bssid (struct wpa_supplicant *wpa_s, const u8 *bssid)
 
int disallowed_ssid (struct wpa_supplicant *wpa_s, const u8 *ssid, size_t ssid_len)
 
void wpas_request_connection (struct wpa_supplicant *wpa_s)
 Request a new connection. More...
 
int wpas_build_ext_capab (struct wpa_supplicant *wpa_s, u8 *buf, size_t buflen)
 
int wpas_update_random_addr (struct wpa_supplicant *wpa_s, int style)
 
int wpas_update_random_addr_disassoc (struct wpa_supplicant *wpa_s)
 
void add_freq (int *freqs, int *num_freqs, int freq)
 
void wpas_rrm_reset (struct wpa_supplicant *wpa_s)
 
void wpas_rrm_process_neighbor_rep (struct wpa_supplicant *wpa_s, const u8 *report, size_t report_len)
 
int wpas_rrm_send_neighbor_rep_request (struct wpa_supplicant *wpa_s, const struct wpa_ssid *ssid, void(*cb)(void *ctx, struct wpabuf *neighbor_rep), void *cb_ctx)
 Request a neighbor report from our AP. More...
 
void wpas_rrm_handle_link_measurement_request (struct wpa_supplicant *wpa_s, const u8 *src, const u8 *frame, size_t len, int rssi)
 
int wpa_supplicant_ctrl_iface_ctrl_rsp_handle (struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid, const char *field, const char *value)
 Handle a control response. More...
 
void ibss_mesh_setup_freq (struct wpa_supplicant *wpa_s, const struct wpa_ssid *ssid, struct hostapd_freq_params *freq)
 
void wpa_supplicant_mark_disassoc (struct wpa_supplicant *wpa_s)
 
int wpa_supplicant_connect (struct wpa_supplicant *wpa_s, struct wpa_bss *selected, struct wpa_ssid *ssid)
 
void wpa_supplicant_stop_countermeasures (void *eloop_ctx, void *sock_ctx)
 
void wpa_supplicant_delayed_mic_error_report (void *eloop_ctx, void *sock_ctx)
 
void wnm_bss_keep_alive_deinit (struct wpa_supplicant *wpa_s)
 
int wpa_supplicant_fast_associate (struct wpa_supplicant *wpa_s)
 
struct wpa_bsswpa_supplicant_pick_network (struct wpa_supplicant *wpa_s, struct wpa_ssid **selected_ssid)
 
int eap_register_methods (void)
 Register statically linked EAP methods. More...
 
int wpas_network_disabled (struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid)
 
int wpas_get_ssid_pmf (struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid)
 
int wpas_init_ext_pw (struct wpa_supplicant *wpa_s)
 
void dump_freq_data (struct wpa_supplicant *wpa_s, const char *title, struct wpa_used_freq_data *freqs_data, unsigned int len)
 
int get_shared_radio_freqs_data (struct wpa_supplicant *wpa_s, struct wpa_used_freq_data *freqs_data, unsigned int len)
 
int get_shared_radio_freqs (struct wpa_supplicant *wpa_s, int *freq_array, unsigned int len)
 
void wpas_network_reenabled (void *eloop_ctx, void *timeout_ctx)
 

Variables

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

Detailed Description

wpa_supplicant - Internal definitions

Macro Definition Documentation

#define MAC_ADDR_RAND_ALL
Value:
(MAC_ADDR_RAND_SCAN | \
MAC_ADDR_RAND_SCHED_SCAN | \
MAC_ADDR_RAND_PNO)

Enumeration Type Documentation

Result of offchannel send Action frame.

Enumerator
OFFCHANNEL_SEND_ACTION_SUCCESS 

Frame was send and acknowledged

OFFCHANNEL_SEND_ACTION_NO_ACK 

Frame was sent, but not acknowledged

OFFCHANNEL_SEND_ACTION_FAILED 

Frame was not sent due to a failure

Function Documentation

int eap_register_methods ( void  )

Register statically linked EAP methods.

Returns
0 on success, -1 or -2 on failure

This function is called at program initialization to register all EAP methods that were linked in statically.

int radio_add_work ( struct wpa_supplicant wpa_s,
unsigned int  freq,
const char *  type,
int  next,
void(*)(struct wpa_radio_work *work, int deinit)  cb,
void *  ctx 
)

Add a radio work item.

Parameters
wpa_sPointer to wpa_supplicant data
freqFrequency of the offchannel operation in MHz or 0
typeUnique identifier for each type of work
nextForce as the next work to be executed
cbCallback function for indicating when radio is available
ctxContext pointer for the work (work->ctx in cb())
Returns
0 on success, -1 on failure

This function is used to request time for an operation that requires exclusive radio control. Once the radio is available, the registered callback function will be called. radio_work_done() must be called once the exclusive radio operation has been completed, so that the radio is freed for other operations. The special case of deinit=1 is used to free the context data during interface removal. That does not allow the callback function to start the radio operation, i.e., it must free any resources allocated for the radio work and return.

The freq parameter can be used to indicate a single channel on which the offchannel operation will occur. This may allow multiple radio work operations to be performed in parallel if they apply for the same channel. Setting this to 0 indicates that the work item may use multiple channels or requires exclusive control of the radio.

void radio_work_done ( struct wpa_radio_work work)

Indicate that a radio work item has been completed.

Parameters
workCompleted work

This function is called once the callback function registered with radio_add_work() has completed its work.

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

Clear keys configured for the driver.

Parameters
wpa_sPointer to wpa_supplicant data
addrPreviously 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,
struct wpa_supplicant parent 
)

Add a new network interface.

Parameters
globalPointer to global data from wpa_supplicant_init()
ifaceInterface configuration options
parentParent interface or NULL to assign new interface as parent
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_bss bss,
struct wpa_ssid ssid 
)

Request association.

Parameters
wpa_sPointer to wpa_supplicant data
bssScan results for the selected BSS, or NULL if not available
ssidConfiguration 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_sPointer 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.

int wpa_supplicant_ctrl_iface_ctrl_rsp_handle ( struct wpa_supplicant wpa_s,
struct wpa_ssid ssid,
const char *  field,
const char *  value 
)

Handle a control response.

Parameters
wpa_sPointer to wpa_supplicant data
ssidPointer to the network block the reply is for
fieldfield the response is a reply for
valuevalue (ie, password, etc) for field
Returns
0 on success, non-zero on error

Helper function to handle replies to control interface requests.

void wpa_supplicant_deauthenticate ( struct wpa_supplicant wpa_s,
int  reason_code 
)

Deauthenticate the current connection.

Parameters
wpa_sPointer to wpa_supplicant data
reason_codeIEEE 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
globalPointer 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_swpa_supplicant structure for a network interface
ssidwpa_ssid structure for a configured network or NULL

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

int wpa_supplicant_driver_init ( struct wpa_supplicant wpa_s)

Initialize driver interface parameters.

Parameters
wpa_sPointer 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_swpa_supplicant structure for a network interface
ssidwpa_ssid structure for a configured network or NULL

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

const char* wpa_supplicant_get_eap_mode ( struct wpa_supplicant wpa_s)

Get the current EAP mode.

Parameters
wpa_sPointer to the network interface
Returns
Pointer to the eap mode or the string "UNKNOWN" if not found
struct wpa_supplicant* wpa_supplicant_get_iface ( struct wpa_global global,
const char *  ifname 
)

Get a new network interface.

Parameters
globalPointer to global data from wpa_supplicant_init()
ifnameInterface name
Returns
Pointer to the interface or NULL if not found
struct wpa_ssid* wpa_supplicant_get_ssid ( struct wpa_supplicant wpa_s)

Get a pointer to the current network structure.

Parameters
wpa_sPointer 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)

Initialize wpa_supplicant.

Parameters
paramsParameters 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_sPointer 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_sPointer 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,
int  terminate 
)

Remove a network interface.

Parameters
globalPointer to global data from wpa_supplicant_init()
wpa_sPointer 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_sPointer to wpa_supplicant data
secNumber of seconds after which to time out authentication
usecNumber of microseconds after which to time out authentication

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

int wpa_supplicant_run ( struct wpa_global global)

Run the wpa_supplicant main event loop.

Parameters
globalPointer 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.

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

Deliver a received EAPOL frame to wpa_supplicant.

Parameters
ctxContext pointer (wpa_s); this is the ctx variable registered with struct wpa_driver_ops::init()
src_addrSource address of the EAPOL frame
bufEAPOL data starting from the EAPOL header (i.e., no Ethernet header)
lenLength 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.

int wpa_supplicant_scard_init ( struct wpa_supplicant wpa_s,
struct wpa_ssid ssid 
)

Initialize SIM/USIM access with PC/SC.

Parameters
wpa_spointer to wpa_supplicant data
ssidConfiguration 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_swpa_supplicant structure for a network interface
ssidwpa_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_swpa_supplicant structure for a network interface
ap_scanAP scan mode
Returns
0 if succeed or -1 if ap_scan has an invalid value
int wpa_supplicant_set_bss_expiration_age ( struct wpa_supplicant wpa_s,
unsigned int  bss_expire_age 
)

Set BSS entry expiration age.

Parameters
wpa_swpa_supplicant structure for a network interface
expire_ageExpiration age in seconds
Returns
0 if succeed or -1 if expire_age has an invalid value
int wpa_supplicant_set_bss_expiration_count ( struct wpa_supplicant wpa_s,
unsigned int  bss_expire_count 
)

Set BSS entry expiration scan count.

Parameters
wpa_swpa_supplicant structure for a network interface
expire_countnumber of scans after which an unseen BSS is reclaimed
Returns
0 if succeed or -1 if expire_count 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
globalwpa_global structure
debug_leveldebug level
debug_timestampdetermines if show timestamp in debug data
debug_show_keysdetermines 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_sPointer to wpa_supplicant data
ssidConfiguration 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.

int wpa_supplicant_set_scan_interval ( struct wpa_supplicant wpa_s,
int  scan_interval 
)

Set scan interval.

Parameters
wpa_swpa_supplicant structure for a network interface
scan_intervalscan interval in seconds
Returns
0 if succeed or -1 if scan_interval has an invalid value
void wpa_supplicant_set_state ( struct wpa_supplicant wpa_s,
enum wpa_states  state 
)

Set current connection state.

Parameters
wpa_sPointer to wpa_supplicant data
stateThe 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_bss bss,
struct wpa_ssid ssid,
u8 *  wpa_ie,
size_t *  wpa_ie_len 
)

Set authentication and encryption parameters.

Parameters
wpa_sPointer to wpa_supplicant data
bssScan results for the selected BSS, or NULL if not available
ssidConfiguration data for the selected network
wpa_ieBuffer for the WPA/RSN IE
wpa_ie_lenMaximum 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 ( enum wpa_states  state)

Get the connection state name as a text string.

Parameters
stateState (wpa_state; WPA_*)
Returns
The state name as a printable text string
void wpas_request_connection ( struct wpa_supplicant wpa_s)

Request a new connection.

Parameters
wpa_sPointer to the network interface

This function is used to request a new connection to be found. It will mark the interface to allow reassociation and request a new scan to find a suitable network to connect to.

int wpas_rrm_send_neighbor_rep_request ( struct wpa_supplicant wpa_s,
const struct wpa_ssid ssid,
void(*)(void *ctx, struct wpabuf *neighbor_rep)  cb,
void *  cb_ctx 
)

Request a neighbor report from our AP.

Parameters
wpa_sPointer to wpa_supplicant
ssidif not null, this is sent in the request. Otherwise, no SSID IE is sent in the request.
cbCallback function to be called once the requested report arrives, or timed out after RRM_NEIGHBOR_REPORT_TIMEOUT seconds. In the former case, 'neighbor_rep' is a newly allocated wpabuf, and it's the requester's responsibility to free it. In the latter case NULL will be sent in 'neighbor_rep'.
cb_ctxContext value to send the callback function
Returns
0 in case of success, negative error code otherwise

In case there is a previous request which has not been answered yet, the new request fails. The caller may retry after RRM_NEIGHBOR_REPORT_TIMEOUT. Request must contain a callback function.

int wpas_set_pkcs11_engine_and_module_path ( struct wpa_supplicant wpa_s,
const char *  pkcs11_engine_path,
const char *  pkcs11_module_path 
)

Set PKCS #11 engine and module path.

Parameters
wpa_swpa_supplicant structure for a network interface
pkcs11_engine_pathPKCS #11 engine path or NULL
pkcs11_module_pathPKCS #11 module path or NULL
Returns
0 on success; -1 on failure

Sets the PKCS #11 engine and module path. Both have to be NULL or a valid path. If resetting the EAPOL state machine with the new PKCS #11 engine and module path fails the paths will be reset to the default value (NULL).