wpa.h File Reference

wpa_supplicant - WPA definitions More...

#include "defs.h"
#include "wpa_common.h"

Include dependency graph for wpa.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define BIT(n)   (1 << (n))
#define WPA_CAPABILITY_PREAUTH   BIT(0)
#define WPA_CAPABILITY_MGMT_FRAME_PROTECTION   BIT(6)
#define WPA_CAPABILITY_PEERKEY_ENABLED   BIT(9)
#define GENERIC_INFO_ELEM   0xdd
#define RSN_INFO_ELEM   0x30
#define PMKID_LEN   16

Enumerations

enum  {
  REASON_UNSPECIFIED = 1, REASON_DEAUTH_LEAVING = 3, REASON_INVALID_IE = 13, REASON_MICHAEL_MIC_FAILURE = 14,
  REASON_4WAY_HANDSHAKE_TIMEOUT = 15, REASON_GROUP_KEY_UPDATE_TIMEOUT = 16, REASON_IE_IN_4WAY_DIFFERS = 17, REASON_GROUP_CIPHER_NOT_VALID = 18,
  REASON_PAIRWISE_CIPHER_NOT_VALID = 19, REASON_AKMP_NOT_VALID = 20, REASON_UNSUPPORTED_RSN_IE_VERSION = 21, REASON_INVALID_RSN_IE_CAPAB = 22,
  REASON_IEEE_802_1X_AUTH_FAILED = 23, REASON_CIPHER_SUITE_REJECTED = 24
}
enum  wpa_sm_conf_params {
  RSNA_PMK_LIFETIME, RSNA_PMK_REAUTH_THRESHOLD, RSNA_SA_TIMEOUT, WPA_PARAM_PROTO,
  WPA_PARAM_PAIRWISE, WPA_PARAM_GROUP, WPA_PARAM_KEY_MGMT, WPA_PARAM_MGMT_GROUP
}

Functions

wpa_smwpa_sm_init (struct wpa_sm_ctx *ctx)
 Initialize WPA state machine.
void wpa_sm_deinit (struct wpa_sm *sm)
 Deinitialize WPA state machine.
void wpa_sm_notify_assoc (struct wpa_sm *sm, const u8 *bssid)
 Notify WPA state machine about association.
void wpa_sm_notify_disassoc (struct wpa_sm *sm)
 Notify WPA state machine about disassociation.
void wpa_sm_set_pmk (struct wpa_sm *sm, const u8 *pmk, size_t pmk_len)
 Set PMK.
void wpa_sm_set_pmk_from_pmksa (struct wpa_sm *sm)
 Set PMK based on the current PMKSA.
void wpa_sm_set_fast_reauth (struct wpa_sm *sm, int fast_reauth)
 Set fast reauthentication (EAP) enabled/disabled.
void wpa_sm_set_scard_ctx (struct wpa_sm *sm, void *scard_ctx)
 Set context pointer for smartcard callbacks.
void wpa_sm_set_config (struct wpa_sm *sm, struct wpa_ssid *config)
 Notification of current configration change.
void wpa_sm_set_own_addr (struct wpa_sm *sm, const u8 *addr)
 Set own MAC address.
void wpa_sm_set_ifname (struct wpa_sm *sm, const char *ifname, const char *bridge_ifname)
 Set network interface name.
void wpa_sm_set_eapol (struct wpa_sm *sm, struct eapol_sm *eapol)
 Set EAPOL state machine pointer.
int wpa_sm_set_assoc_wpa_ie (struct wpa_sm *sm, const u8 *ie, size_t len)
 Set own WPA/RSN IE from (Re)AssocReq.
int wpa_sm_set_assoc_wpa_ie_default (struct wpa_sm *sm, u8 *wpa_ie, size_t *wpa_ie_len)
 Generate own WPA/RSN IE from configuration.
int wpa_sm_set_ap_wpa_ie (struct wpa_sm *sm, const u8 *ie, size_t len)
 Set AP WPA IE from Beacon/ProbeResp.
int wpa_sm_set_ap_rsn_ie (struct wpa_sm *sm, const u8 *ie, size_t len)
 Set AP RSN IE from Beacon/ProbeResp.
int wpa_sm_get_mib (struct wpa_sm *sm, char *buf, size_t buflen)
 Dump text list of MIB entries.
int wpa_sm_set_param (struct wpa_sm *sm, enum wpa_sm_conf_params param, unsigned int value)
 Set WPA state machine parameters.
unsigned int wpa_sm_get_param (struct wpa_sm *sm, enum wpa_sm_conf_params param)
 Get WPA state machine parameters.
int wpa_sm_get_status (struct wpa_sm *sm, char *buf, size_t buflen, int verbose)
 Get WPA state machine.
void wpa_sm_key_request (struct wpa_sm *sm, int error, int pairwise)
 Send EAPOL-Key Request.
int wpa_sm_stkstart (struct wpa_sm *sm, const u8 *peer)
 Send EAPOL-Key Request for STK handshake (STK M1).
int wpa_parse_wpa_ie (const u8 *wpa_ie, size_t wpa_ie_len, struct wpa_ie_data *data)
 Parse WPA/RSN IE.
void wpa_sm_aborted_cached (struct wpa_sm *sm)
 Notify WPA that PMKSA caching was aborted.
int wpa_sm_rx_eapol (struct wpa_sm *sm, const u8 *src_addr, const u8 *buf, size_t len)
 Process received WPA EAPOL frames.
int wpa_sm_parse_own_wpa_ie (struct wpa_sm *sm, struct wpa_ie_data *data)
 Parse own WPA/RSN IE.


Detailed Description

wpa_supplicant - WPA definitions

Copyright
Copyright (c) 2003-2006, Jouni Malinen <[email protected]>
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.

Definition in file wpa.h.


Function Documentation

int wpa_parse_wpa_ie const u8 *  wpa_ie,
size_t  wpa_ie_len,
struct wpa_ie_data *  data
 

Parse WPA/RSN IE.

Parameters:
wpa_ie Pointer to WPA or RSN IE
wpa_ie_len Length of the WPA/RSN IE
data Pointer to data area for parsing results
Returns:
0 on success, -1 on failure
Parse the contents of WPA or RSN IE and write the parsed data into data.

Definition at line 647 of file wpa.c.

void wpa_sm_aborted_cached struct wpa_sm sm  ) 
 

Notify WPA that PMKSA caching was aborted.

Parameters:
sm Pointer to WPA state machine data from wpa_sm_init()

Definition at line 3343 of file wpa.c.

Here is the call graph for this function:

void wpa_sm_deinit struct wpa_sm sm  ) 
 

Deinitialize WPA state machine.

Parameters:
sm Pointer to WPA state machine data from wpa_sm_init()

Definition at line 3861 of file wpa.c.

Here is the call graph for this function:

int wpa_sm_get_mib struct wpa_sm sm,
char *  buf,
size_t  buflen
 

Dump text list of MIB entries.

Parameters:
sm Pointer to WPA state machine data from wpa_sm_init()
buf Buffer for the list
buflen Length of the buffer
Returns:
Number of bytes written to buffer
This function is used fetch dot11 MIB variables.

Definition at line 3726 of file wpa.c.

Here is the call graph for this function:

unsigned int wpa_sm_get_param struct wpa_sm sm,
enum wpa_sm_conf_params  param
 

Get WPA state machine parameters.

Parameters:
sm Pointer to WPA state machine data from wpa_sm_init()
param Parameter field
Returns:
Parameter value

Definition at line 4125 of file wpa.c.

int wpa_sm_get_status struct wpa_sm sm,
char *  buf,
size_t  buflen,
int  verbose
 

Get WPA state machine.

Parameters:
sm Pointer to WPA state machine data from wpa_sm_init()
buf Buffer for status information
buflen Maximum buffer length
verbose Whether to include verbose status information
Returns:
Number of bytes written to buf.
Query WPA state machine for status information. This function fills in a text area with current status information. If the buffer (buf) is not large enough, status information will be truncated to fit the buffer.

Definition at line 4168 of file wpa.c.

struct wpa_sm* wpa_sm_init struct wpa_sm_ctx *  ctx  ) 
 

Initialize WPA state machine.

Parameters:
ctx Context pointer for callbacks; this needs to be an allocated buffer
Returns:
Pointer to the allocated WPA state machine data
This function is used to allocate a new WPA state machine and the returned value is passed to all WPA state machine calls.

Definition at line 3830 of file wpa.c.

Here is the call graph for this function:

void wpa_sm_key_request struct wpa_sm sm,
int  error,
int  pairwise
 

Send EAPOL-Key Request.

Parameters:
sm Pointer to WPA state machine data from wpa_sm_init()
error Indicate whether this is an Michael MIC error report
pairwise 1 = error report for pairwise packet, 0 = for group packet
Returns:
Pointer to the current network structure or NULL on failure
Send an EAPOL-Key Request to the current authenticator. This function is used to request rekeying and it is usually called when a local Michael MIC failure is detected.

Definition at line 990 of file wpa.c.

Here is the call graph for this function:

void wpa_sm_notify_assoc struct wpa_sm sm,
const u8 *  bssid
 

Notify WPA state machine about association.

Parameters:
sm Pointer to WPA state machine data from wpa_sm_init()
bssid The BSSID of the new association
This function is called to let WPA state machine know that the connection was established.

Definition at line 3894 of file wpa.c.

Here is the call graph for this function:

void wpa_sm_notify_disassoc struct wpa_sm sm  ) 
 

Notify WPA state machine about disassociation.

Parameters:
sm Pointer to WPA state machine data from wpa_sm_init()
This function is called to let WPA state machine know that the connection was lost. This will abort any existing pre-authentication session.

Definition at line 3917 of file wpa.c.

Here is the call graph for this function:

int wpa_sm_parse_own_wpa_ie struct wpa_sm sm,
struct wpa_ie_data *  data
 

Parse own WPA/RSN IE.

Parameters:
sm Pointer to WPA state machine data from wpa_sm_init()
data Pointer to data area for parsing results
Returns:
0 on success, -1 if IE is not known, or -2 on parsing failure
Parse the contents of the own WPA or RSN IE from (Re)AssocReq and write the parsed data into data.

Definition at line 4350 of file wpa.c.

Here is the call graph for this function:

int wpa_sm_rx_eapol struct wpa_sm sm,
const u8 *  src_addr,
const u8 *  buf,
size_t  len
 

Process received WPA EAPOL frames.

Parameters:
sm Pointer to WPA state machine data from wpa_sm_init()
src_addr Source MAC address of the EAPOL packet
buf Pointer to the beginning of the EAPOL data (EAPOL header)
len Length of the EAPOL frame
Returns:
1 = WPA EAPOL-Key processed, 0 = not a WPA EAPOL-Key, -1 failure
This function is called for each received EAPOL frame. Other than EAPOL-Key frames can be skipped if filtering is done elsewhere. wpa_sm_rx_eapol() is only processing WPA and WPA2 EAPOL-Key frames.

The received EAPOL-Key packets are validated and valid packets are replied to. In addition, key material (PTK, GTK) is configured at the end of a successful key handshake.

Definition at line 3403 of file wpa.c.

Here is the call graph for this function:

int wpa_sm_set_ap_rsn_ie struct wpa_sm sm,
const u8 *  ie,
size_t  len
 

Set AP RSN IE from Beacon/ProbeResp.

Parameters:
sm Pointer to WPA state machine data from wpa_sm_init()
ie Pointer to IE data (starting from id)
len IE length
Returns:
0 on success, -1 on failure
Inform WPA state machine about the RSN IE used in Beacon / Probe Response frame.

Definition at line 4316 of file wpa.c.

Here is the call graph for this function:

int wpa_sm_set_ap_wpa_ie struct wpa_sm sm,
const u8 *  ie,
size_t  len
 

Set AP WPA IE from Beacon/ProbeResp.

Parameters:
sm Pointer to WPA state machine data from wpa_sm_init()
ie Pointer to IE data (starting from id)
len IE length
Returns:
0 on success, -1 on failure
Inform WPA state machine about the WPA IE used in Beacon / Probe Response frame.

Definition at line 4281 of file wpa.c.

Here is the call graph for this function:

int wpa_sm_set_assoc_wpa_ie struct wpa_sm sm,
const u8 *  ie,
size_t  len
 

Set own WPA/RSN IE from (Re)AssocReq.

Parameters:
sm Pointer to WPA state machine data from wpa_sm_init()
ie Pointer to IE data (starting from id)
len IE length
Returns:
0 on success, -1 on failure
Inform WPA state machine about the WPA/RSN IE used in (Re)Association Request frame. The IE will be used to override the default value generated with wpa_sm_set_assoc_wpa_ie_default().

Definition at line 4246 of file wpa.c.

Here is the call graph for this function:

int wpa_sm_set_assoc_wpa_ie_default struct wpa_sm sm,
u8 *  wpa_ie,
size_t *  wpa_ie_len
 

Generate own WPA/RSN IE from configuration.

Parameters:
sm Pointer to WPA state machine data from wpa_sm_init()
wpa_ie Pointer to buffer for WPA/RSN IE
wpa_ie_len Pointer to the length of the wpa_ie buffer
Returns:
0 on success, -1 on failure
Inform WPA state machine about the WPA/RSN IE used in (Re)Association Request frame. The IE will be used to override the default value generated with wpa_sm_set_assoc_wpa_ie_default().

Definition at line 4200 of file wpa.c.

Here is the call graph for this function:

void wpa_sm_set_config struct wpa_sm sm,
struct wpa_ssid config
 

Notification of current configration change.

Parameters:
sm Pointer to WPA state machine data from wpa_sm_init()
config Pointer to current network configuration
Notify WPA state machine that configuration has changed. config will be stored as a backpointer to network configuration. This can be NULL to clear the stored pointed.

Definition at line 4006 of file wpa.c.

Here is the call graph for this function:

void wpa_sm_set_eapol struct wpa_sm sm,
struct eapol_sm eapol
 

Set EAPOL state machine pointer.

Parameters:
sm Pointer to WPA state machine data from wpa_sm_init()
eapol Pointer to EAPOL state machine allocated with eapol_sm_init()

Definition at line 4051 of file wpa.c.

void wpa_sm_set_fast_reauth struct wpa_sm sm,
int  fast_reauth
 

Set fast reauthentication (EAP) enabled/disabled.

Parameters:
sm Pointer to WPA state machine data from wpa_sm_init()
fast_reauth Whether fast reauthentication (EAP) is allowed

Definition at line 3973 of file wpa.c.

void wpa_sm_set_ifname struct wpa_sm sm,
const char *  ifname,
const char *  bridge_ifname
 

Set network interface name.

Parameters:
sm Pointer to WPA state machine data from wpa_sm_init()
ifname Interface name
bridge_ifname Optional bridge interface name (for pre-auth)

Definition at line 4035 of file wpa.c.

void wpa_sm_set_own_addr struct wpa_sm sm,
const u8 *  addr
 

Set own MAC address.

Parameters:
sm Pointer to WPA state machine data from wpa_sm_init()
addr Own MAC address

Definition at line 4021 of file wpa.c.

int wpa_sm_set_param struct wpa_sm sm,
enum wpa_sm_conf_params  param,
unsigned int  value
 

Set WPA state machine parameters.

Parameters:
sm Pointer to WPA state machine data from wpa_sm_init()
param Parameter field
value Parameter value
Returns:
0 on success, -1 on failure

Definition at line 4066 of file wpa.c.

void wpa_sm_set_pmk struct wpa_sm sm,
const u8 *  pmk,
size_t  pmk_len
 

Set PMK.

Parameters:
sm Pointer to WPA state machine data from wpa_sm_init()
pmk The new PMK
pmk_len The length of the new PMK in bytes
Configure the PMK for WPA state machine.

Definition at line 3934 of file wpa.c.

void wpa_sm_set_pmk_from_pmksa struct wpa_sm sm  ) 
 

Set PMK based on the current PMKSA.

Parameters:
sm Pointer to WPA state machine data from wpa_sm_init()
Take the PMK from the current PMKSA into use. If no PMKSA is active, the PMK will be cleared.

Definition at line 3952 of file wpa.c.

void wpa_sm_set_scard_ctx struct wpa_sm sm,
void *  scard_ctx
 

Set context pointer for smartcard callbacks.

Parameters:
sm Pointer to WPA state machine data from wpa_sm_init()
scard_ctx Context pointer for smartcard related callback functions

Definition at line 3986 of file wpa.c.

Here is the call graph for this function:

int wpa_sm_stkstart struct wpa_sm sm,
const u8 *  peer
 

Send EAPOL-Key Request for STK handshake (STK M1).

Parameters:
sm Pointer to WPA state machine data from wpa_sm_init()
peer MAC address of the peer STA
Returns:
0 on success, or -1 on failure
Send an EAPOL-Key Request to the current authenticator to start STK handshake with the peer.

Definition at line 1049 of file wpa.c.

Here is the call graph for this function:


Generated on Sun Dec 31 13:55:10 2006 for wpa_supplicant by  doxygen 1.4.2