wpa.c File Reference

hostapd - IEEE 802.11i-2004 / WPA Authenticator More...

#include "includes.h"
#include "common.h"
#include "config.h"
#include "eapol_sm.h"
#include "wpa.h"
#include "sha1.h"
#include "sha256.h"
#include "aes_wrap.h"
#include "crypto.h"
#include "eloop.h"
#include "ieee802_11.h"
#include "pmksa_cache.h"
#include "state_machine.h"
#include "wpa_auth_i.h"
#include "wpa_auth_ie.h"
Include dependency graph for wpa.c:

Go to the source code of this file.

Defines

#define STATE_MACHINE_DATA   struct wpa_state_machine
#define STATE_MACHINE_DEBUG_PREFIX   "WPA"
#define STATE_MACHINE_ADDR   sm->addr
#define RSN_SUITE   "%02x-%02x-%02x-%d"
#define RSN_SUITE_ARG(s)   ((s) >> 24) & 0xff, ((s) >> 16) & 0xff, ((s) >> 8) & 0xff, (s) & 0xff

Functions

int wpa_auth_for_each_sta (struct wpa_authenticator *wpa_auth, int(*cb)(struct wpa_state_machine *sm, void *ctx), void *cb_ctx)
int wpa_auth_for_each_auth (struct wpa_authenticator *wpa_auth, int(*cb)(struct wpa_authenticator *a, void *ctx), void *cb_ctx)
void wpa_auth_logger (struct wpa_authenticator *wpa_auth, const u8 *addr, logger_level level, const char *txt)
void wpa_auth_vlogger (struct wpa_authenticator *wpa_auth, const u8 *addr, logger_level level, const char *fmt,...)
struct wpa_authenticatorwpa_init (const u8 *addr, struct wpa_auth_config *conf, struct wpa_auth_callbacks *cb)
 Initialize WPA authenticator.
void wpa_deinit (struct wpa_authenticator *wpa_auth)
 Deinitialize WPA authenticator.
int wpa_reconfig (struct wpa_authenticator *wpa_auth, struct wpa_auth_config *conf)
 Update WPA authenticator configuration.
struct wpa_state_machinewpa_auth_sta_init (struct wpa_authenticator *wpa_auth, const u8 *addr)
void wpa_auth_sta_associated (struct wpa_authenticator *wpa_auth, struct wpa_state_machine *sm)
void wpa_auth_sta_no_wpa (struct wpa_state_machine *sm)
void wpa_auth_sta_deinit (struct wpa_state_machine *sm)
void wpa_receive (struct wpa_authenticator *wpa_auth, struct wpa_state_machine *sm, u8 *data, size_t data_len)
void __wpa_send_eapol (struct wpa_authenticator *wpa_auth, struct wpa_state_machine *sm, int key_info, const u8 *key_rsc, const u8 *nonce, const u8 *kde, size_t kde_len, int keyidx, int encr, int force_version)
void wpa_remove_ptk (struct wpa_state_machine *sm)
void wpa_auth_sm_event (struct wpa_state_machine *sm, wpa_event event)
 SM_STATE (WPA_PTK, INITIALIZE)
 SM_STATE (WPA_PTK, DISCONNECT)
 SM_STATE (WPA_PTK, DISCONNECTED)
 SM_STATE (WPA_PTK, AUTHENTICATION)
 SM_STATE (WPA_PTK, AUTHENTICATION2)
 SM_STATE (WPA_PTK, INITPMK)
 SM_STATE (WPA_PTK, INITPSK)
 SM_STATE (WPA_PTK, PTKSTART)
 SM_STATE (WPA_PTK, PTKCALCNEGOTIATING)
 SM_STATE (WPA_PTK, PTKCALCNEGOTIATING2)
 SM_STATE (WPA_PTK, PTKINITNEGOTIATING)
 SM_STATE (WPA_PTK, PTKINITDONE)
 SM_STEP (WPA_PTK)
 SM_STATE (WPA_PTK_GROUP, IDLE)
 SM_STATE (WPA_PTK_GROUP, REKEYNEGOTIATING)
 SM_STATE (WPA_PTK_GROUP, REKEYESTABLISHED)
 SM_STATE (WPA_PTK_GROUP, KEYERROR)
 SM_STEP (WPA_PTK_GROUP)
void wpa_auth_sm_notify (struct wpa_state_machine *sm)
void wpa_gtk_rekey (struct wpa_authenticator *wpa_auth)
int wpa_get_mib (struct wpa_authenticator *wpa_auth, char *buf, size_t buflen)
int wpa_get_mib_sta (struct wpa_state_machine *sm, char *buf, size_t buflen)
void wpa_auth_countermeasures_start (struct wpa_authenticator *wpa_auth)
int wpa_auth_pairwise_set (struct wpa_state_machine *sm)
int wpa_auth_get_pairwise (struct wpa_state_machine *sm)
int wpa_auth_sta_key_mgmt (struct wpa_state_machine *sm)
int wpa_auth_sta_wpa_version (struct wpa_state_machine *sm)
int wpa_auth_sta_clear_pmksa (struct wpa_state_machine *sm, struct rsn_pmksa_cache_entry *entry)
struct rsn_pmksa_cache_entrywpa_auth_sta_get_pmksa (struct wpa_state_machine *sm)
void wpa_auth_sta_local_mic_failure_report (struct wpa_state_machine *sm)
const u8 * wpa_auth_get_wpa_ie (struct wpa_authenticator *wpa_auth, size_t *len)
int wpa_auth_pmksa_add (struct wpa_state_machine *sm, const u8 *pmk, int session_timeout, struct eapol_state_machine *eapol)
int wpa_auth_pmksa_add_preauth (struct wpa_authenticator *wpa_auth, const u8 *pmk, size_t len, const u8 *sta_addr, int session_timeout, struct eapol_state_machine *eapol)
int wpa_auth_sta_set_vlan (struct wpa_state_machine *sm, int vlan_id)

Detailed Description

hostapd - IEEE 802.11i-2004 / WPA Authenticator

Copyright
Copyright (c) 2004-2009, 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.

Definition in file wpa.c.


Function Documentation

void wpa_deinit ( struct wpa_authenticator wpa_auth  ) 

Deinitialize WPA authenticator.

Parameters:
wpa_auth Pointer to WPA authenticator data from wpa_init()

Definition at line 425 of file wpa.c.

Here is the call graph for this function:

struct wpa_authenticator* wpa_init ( const u8 *  addr,
struct wpa_auth_config conf,
struct wpa_auth_callbacks cb 
) [read]

Initialize WPA authenticator.

Parameters:
addr Authenticator address
conf Configuration for WPA authenticator
cb Callback functions for WPA authenticator
Returns:
Pointer to WPA authenticator data or NULL on failure

Definition at line 360 of file wpa.c.

Here is the call graph for this function:

int wpa_reconfig ( struct wpa_authenticator wpa_auth,
struct wpa_auth_config conf 
)

Update WPA authenticator configuration.

Parameters:
wpa_auth Pointer to WPA authenticator data from wpa_init()
conf Configuration for WPA authenticator

Definition at line 463 of file wpa.c.

Here is the call graph for this function:

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines

Generated on Sat Nov 21 23:17:58 2009 for hostapd by  doxygen 1.6.1