int fragm_threshold;
u8 send_probe_response;
u8 channel;
- hostapd_hw_mode hw_mode; /* HOSTAPD_MODE_IEEE80211A, .. */
+ enum hostapd_hw_mode hw_mode; /* HOSTAPD_MODE_IEEE80211A, .. */
enum {
LONG_PREAMBLE = 0,
SHORT_PREAMBLE = 1
static int hostapd_set_key(const char *ifname, struct hostapd_data *hapd,
- wpa_alg alg, const u8 *addr, int key_idx,
+ enum wpa_alg alg, const u8 *addr, int key_idx,
int set_tx, const u8 *seq, size_t seq_len,
const u8 *key, size_t key_len)
{
int (*set_authorized)(struct hostapd_data *hapd, struct sta_info *sta,
int authorized);
int (*set_key)(const char *ifname, struct hostapd_data *hapd,
- wpa_alg alg, const u8 *addr, int key_idx,
+ enum wpa_alg alg, const u8 *addr, int key_idx,
int set_tx, const u8 *seq, size_t seq_len,
const u8 *key, size_t key_len);
int (*read_sta_data)(struct hostapd_data *hapd,
static inline int wpa_auth_set_key(struct wpa_authenticator *wpa_auth,
int vlan_id,
- wpa_alg alg, const u8 *addr, int idx,
+ enum wpa_alg alg, const u8 *addr, int idx,
u8 *key, size_t key_len)
{
if (wpa_auth->cb.set_key == NULL)
}
-static wpa_alg wpa_alg_enum(int alg)
+static enum wpa_alg wpa_alg_enum(int alg)
{
switch (alg) {
case WPA_CIPHER_CCMP:
SM_ENTRY_MA(WPA_PTK, PTKINITDONE, wpa_ptk);
sm->EAPOLKeyReceived = FALSE;
if (sm->Pair) {
- wpa_alg alg;
+ enum wpa_alg alg;
int klen;
if (sm->pairwise == WPA_CIPHER_TKIP) {
alg = WPA_ALG_TKIP;
int (*get_eapol)(void *ctx, const u8 *addr, wpa_eapol_variable var);
const u8 * (*get_psk)(void *ctx, const u8 *addr, const u8 *prev_psk);
int (*get_msk)(void *ctx, const u8 *addr, u8 *msk, size_t *len);
- int (*set_key)(void *ctx, int vlan_id, wpa_alg alg, const u8 *addr,
- int idx, u8 *key, size_t key_len);
+ int (*set_key)(void *ctx, int vlan_id, enum wpa_alg alg,
+ const u8 *addr, int idx, u8 *key, size_t key_len);
int (*get_seqnum)(void *ctx, const u8 *addr, int idx, u8 *seq);
int (*send_eapol)(void *ctx, const u8 *addr, const u8 *data,
size_t data_len, int encrypt);
static inline int wpa_auth_set_key(struct wpa_authenticator *wpa_auth,
int vlan_id,
- wpa_alg alg, const u8 *addr, int idx,
+ enum wpa_alg alg, const u8 *addr, int idx,
u8 *key, size_t key_len)
{
if (wpa_auth->cb.set_key == NULL)
static void wpa_ft_install_ptk(struct wpa_state_machine *sm)
{
- wpa_alg alg;
+ enum wpa_alg alg;
int klen;
/* MLME-SETKEYS.request(PTK) */
}
-static int hostapd_wpa_auth_set_key(void *ctx, int vlan_id, wpa_alg alg,
+static int hostapd_wpa_auth_set_key(void *ctx, int vlan_id, enum wpa_alg alg,
const u8 *addr, int idx, u8 *key,
size_t key_len)
{
#define WPA_AUTH_ALG_LEAP BIT(2)
-typedef enum { WPA_ALG_NONE, WPA_ALG_WEP, WPA_ALG_TKIP, WPA_ALG_CCMP,
- WPA_ALG_IGTK, WPA_ALG_PMK } wpa_alg;
-typedef enum { CIPHER_NONE, CIPHER_WEP40, CIPHER_TKIP, CIPHER_CCMP,
- CIPHER_WEP104 } wpa_cipher;
-typedef enum { KEY_MGMT_802_1X, KEY_MGMT_PSK, KEY_MGMT_NONE,
- KEY_MGMT_802_1X_NO_WPA, KEY_MGMT_WPA_NONE,
- KEY_MGMT_FT_802_1X, KEY_MGMT_FT_PSK,
- KEY_MGMT_802_1X_SHA256, KEY_MGMT_PSK_SHA256,
- KEY_MGMT_WPS
-} wpa_key_mgmt;
+enum wpa_alg {
+ WPA_ALG_NONE,
+ WPA_ALG_WEP,
+ WPA_ALG_TKIP,
+ WPA_ALG_CCMP,
+ WPA_ALG_IGTK,
+ WPA_ALG_PMK
+};
+
+enum wpa_cipher {
+ CIPHER_NONE,
+ CIPHER_WEP40,
+ CIPHER_TKIP,
+ CIPHER_CCMP,
+ CIPHER_WEP104
+};
+
+enum wpa_key_mgmt {
+ KEY_MGMT_802_1X,
+ KEY_MGMT_PSK,
+ KEY_MGMT_NONE,
+ KEY_MGMT_802_1X_NO_WPA,
+ KEY_MGMT_WPA_NONE,
+ KEY_MGMT_FT_802_1X,
+ KEY_MGMT_FT_PSK,
+ KEY_MGMT_802_1X_SHA256,
+ KEY_MGMT_PSK_SHA256,
+ KEY_MGMT_WPS
+};
/**
* enum wpa_states - wpa_supplicant state
* wrapper functions wpa_sm_get_state() and wpa_sm_set_state() should be used
* to access the state variable.
*/
-typedef enum {
+enum wpa_states {
/**
* WPA_DISCONNECTED - Disconnected state
*
* fully configured.
*/
WPA_COMPLETED
-} wpa_states;
+};
#define MLME_SETPROTECTION_PROTECT_TYPE_NONE 0
#define MLME_SETPROTECTION_PROTECT_TYPE_RX 1
IEEE80211W_REQUIRED = 2
};
-typedef enum {
+enum hostapd_hw_mode {
HOSTAPD_MODE_IEEE80211B,
HOSTAPD_MODE_IEEE80211G,
HOSTAPD_MODE_IEEE80211A,
NUM_HOSTAPD_MODES
-} hostapd_hw_mode;
+};
#endif /* DEFS_H */
};
struct hostapd_hw_modes {
- hostapd_hw_mode mode;
+ enum hostapd_hw_mode mode;
int num_channels;
struct hostapd_channel_data *channels;
int num_rates;
/* The selected pairwise/group cipher and key management
* suites. These are usually ignored if @wpa_ie is used. */
- wpa_cipher pairwise_suite;
- wpa_cipher group_suite;
- wpa_key_mgmt key_mgmt_suite;
+ enum wpa_cipher pairwise_suite;
+ enum wpa_cipher group_suite;
+ enum wpa_key_mgmt key_mgmt_suite;
/**
* auth_alg - Allowed authentication algorithms
* in driver_*.c set_key() implementation, see driver_ndis.c for an
* example on how this can be done.
*/
- int (*set_key)(const char *ifname, void *priv, wpa_alg alg,
+ int (*set_key)(const char *ifname, void *priv, enum wpa_alg alg,
const u8 *addr, int key_idx, int set_tx,
const u8 *seq, size_t seq_len,
const u8 *key, size_t key_len);
* This function is only needed for drivers that export MLME
* (management frame processing) to wpa_supplicant.
*/
- int (*set_channel)(void *priv, hostapd_hw_mode phymode, int chan,
+ int (*set_channel)(void *priv, enum hostapd_hw_mode phymode, int chan,
int freq);
/**
}
static int
-madwifi_set_key(const char *ifname, void *priv, wpa_alg alg, const u8 *addr,
- int key_idx, int set_tx, const u8 *seq, size_t seq_len,
- const u8 *key, size_t key_len)
+madwifi_set_key(const char *ifname, void *priv, enum wpa_alg alg,
+ const u8 *addr, int key_idx, int set_tx, const u8 *seq,
+ size_t seq_len, const u8 *key, size_t key_len)
{
struct madwifi_driver_data *drv = priv;
struct ieee80211req_key wk;
static int wpa_driver_atmel_set_key(const char *ifname, void *priv,
- wpa_alg alg, const u8 *addr, int key_idx,
- int set_tx, const u8 *seq, size_t seq_len,
+ enum wpa_alg alg, const u8 *addr,
+ int key_idx, int set_tx,
+ const u8 *seq, size_t seq_len,
const u8 *key, size_t key_len)
{
struct wpa_driver_atmel_data *drv = priv;
#if 0
/* Atmel driver uses specific values for each cipher suite */
-static int convertSuiteToDriver(wpa_cipher suite)
+static int convertSuiteToDriver(enum wpa_cipher suite)
{
u8 suite_type;
}
static int wpa_driver_broadcom_set_key(const char *ifname, void *priv,
- wpa_alg alg,
+ enum wpa_alg alg,
const u8 *addr, int key_idx, int set_tx,
const u8 *seq, size_t seq_len,
const u8 *key, size_t key_len)
}
static int
-bsd_set_key(const char *ifname, void *priv, wpa_alg alg,
+bsd_set_key(const char *ifname, void *priv, enum wpa_alg alg,
const u8 *addr, int key_idx, int set_tx, const u8 *seq,
size_t seq_len, const u8 *key, size_t key_len)
{
}
static int
-wpa_driver_bsd_set_key(const char *ifname, void *priv, wpa_alg alg,
+wpa_driver_bsd_set_key(const char *ifname, void *priv, enum wpa_alg alg,
const unsigned char *addr, int key_idx, int set_tx,
const u8 *seq, size_t seq_len,
const u8 *key, size_t key_len)
static int wpa_driver_hostap_set_key(const char *ifname, void *priv,
- wpa_alg alg, const u8 *addr, int key_idx,
- int set_tx, const u8 *seq, size_t seq_len,
+ enum wpa_alg alg, const u8 *addr,
+ int key_idx, int set_tx,
+ const u8 *seq, size_t seq_len,
const u8 *key, size_t key_len)
{
struct hostap_driver_data *drv = priv;
static int wpa_driver_hostap_set_key(const char *ifname, void *priv,
- wpa_alg alg, const u8 *addr, int key_idx,
- int set_tx, const u8 *seq, size_t seq_len,
+ enum wpa_alg alg, const u8 *addr,
+ int key_idx, int set_tx,
+ const u8 *seq, size_t seq_len,
const u8 *key, size_t key_len)
{
struct wpa_driver_hostap_data *drv = priv;
}
-static int wpa_driver_ipw_set_key(const char *ifname, void *priv, wpa_alg alg,
- const u8 *addr, int key_idx, int set_tx,
+static int wpa_driver_ipw_set_key(const char *ifname, void *priv,
+ enum wpa_alg alg, const u8 *addr,
+ int key_idx, int set_tx,
const u8 *seq, size_t seq_len,
const u8 *key, size_t key_len)
{
}
static int
-wpa_driver_madwifi_set_key(const char *ifname, void *priv, wpa_alg alg,
+wpa_driver_madwifi_set_key(const char *ifname, void *priv, enum wpa_alg alg,
const u8 *addr, int key_idx, int set_tx,
const u8 *seq, size_t seq_len,
const u8 *key, size_t key_len)
}
static int
-wpa_driver_madwifi_set_key(const char *ifname, void *priv, wpa_alg alg,
+wpa_driver_madwifi_set_key(const char *ifname, void *priv, enum wpa_alg alg,
const u8 *addr, int key_idx, int set_tx,
const u8 *seq, size_t seq_len,
const u8 *key, size_t key_len)
}
-static int wpa_driver_ndis_set_key(const char *ifname, void *priv, wpa_alg alg,
- const u8 *addr, int key_idx, int set_tx,
+static int wpa_driver_ndis_set_key(const char *ifname, void *priv,
+ enum wpa_alg alg, const u8 *addr,
+ int key_idx, int set_tx,
const u8 *seq, size_t seq_len,
const u8 *key, size_t key_len)
{
};
-struct wpa_key
-{
- wpa_alg alg;
+struct wpa_key {
+ enum wpa_alg alg;
const u8 *addr;
int key_index;
int set_tx;
size_t key_len;
};
-struct wpa_assoc_info
-{
+struct wpa_assoc_info {
const u8 *bssid;
const u8 *ssid;
size_t ssid_len;
int freq;
const u8 *wpa_ie;
size_t wpa_ie_len;
- wpa_cipher pairwise_suite;
- wpa_cipher group_suite;
- wpa_key_mgmt key_mgmt_suite;
+ enum wpa_cipher pairwise_suite;
+ enum wpa_cipher group_suite;
+ enum wpa_key_mgmt key_mgmt_suite;
int auth_alg;
int mode;
};
return ret;
}
-static int wpa_ndiswrapper_set_key(const char *ifname, void *priv, wpa_alg alg,
- const u8 *addr, int key_idx, int set_tx,
+static int wpa_ndiswrapper_set_key(const char *ifname, void *priv,
+ enum wpa_alg alg, const u8 *addr,
+ int key_idx, int set_tx,
const u8 *seq, size_t seq_len,
const u8 *key, size_t key_len)
{
static int wpa_driver_nl80211_set_key(const char *ifname, void *priv,
- wpa_alg alg, const u8 *addr, int key_idx,
- int set_tx,
+ enum wpa_alg alg, const u8 *addr,
+ int key_idx, int set_tx,
const u8 *seq, size_t seq_len,
const u8 *key, size_t key_len)
{
}
-static int nl_add_key(struct nl_msg *msg, wpa_alg alg,
+static int nl_add_key(struct nl_msg *msg, enum wpa_alg alg,
int key_idx, int defkey,
const u8 *seq, size_t seq_len,
const u8 *key, size_t key_len)
static int wpa_driver_privsep_set_key(const char *ifname, void *priv,
- wpa_alg alg, const u8 *addr,
+ enum wpa_alg alg, const u8 *addr,
int key_idx, int set_tx,
const u8 *seq, size_t seq_len,
const u8 *key, size_t key_len)
}
static int wpa_driver_ralink_set_key(const char *ifname, void *priv,
- wpa_alg alg, const u8 *addr,
+ enum wpa_alg alg, const u8 *addr,
int key_idx, int set_tx,
const u8 *seq, size_t seq_len,
const u8 *key, size_t key_len)
}
-static int wpa_driver_test_set_key(const char *ifname, void *priv, wpa_alg alg,
- const u8 *addr, int key_idx, int set_tx,
+static int wpa_driver_test_set_key(const char *ifname, void *priv,
+ enum wpa_alg alg, const u8 *addr,
+ int key_idx, int set_tx,
const u8 *seq, size_t seq_len,
const u8 *key, size_t key_len)
{
}
-static int wpa_driver_test_set_channel(void *priv, hostapd_hw_mode phymode,
+static int wpa_driver_test_set_channel(void *priv,
+ enum hostapd_hw_mode phymode,
int chan, int freq)
{
wpa_printf(MSG_DEBUG, "%s: phymode=%d chan=%d freq=%d",
}
-static int wpa_driver_wext_set_key_ext(void *priv, wpa_alg alg,
+static int wpa_driver_wext_set_key_ext(void *priv, enum wpa_alg alg,
const u8 *addr, int key_idx,
int set_tx, const u8 *seq,
size_t seq_len,
* This function uses SIOCSIWENCODEEXT by default, but tries to use
* SIOCSIWENCODE if the extended ioctl fails when configuring a WEP key.
*/
-int wpa_driver_wext_set_key(const char *ifname, void *priv, wpa_alg alg,
+int wpa_driver_wext_set_key(const char *ifname, void *priv, enum wpa_alg alg,
const u8 *addr, int key_idx,
int set_tx, const u8 *seq, size_t seq_len,
const u8 *key, size_t key_len)
int wpa_driver_wext_set_ssid(void *priv, const u8 *ssid, size_t ssid_len);
int wpa_driver_wext_set_freq(void *priv, int freq);
int wpa_driver_wext_set_mode(void *priv, int mode);
-int wpa_driver_wext_set_key(const char *ifname, void *priv, wpa_alg alg,
+int wpa_driver_wext_set_key(const char *ifname, void *priv, enum wpa_alg alg,
const u8 *addr, int key_idx,
int set_tx, const u8 *seq, size_t seq_len,
const u8 *key, size_t key_len);
const struct wpa_eapol_key *key)
{
int keylen, rsclen;
- wpa_alg alg;
+ enum wpa_alg alg;
const u8 *key_rsc;
u8 null_rsc[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
static int wpa_supplicant_check_group_cipher(int group_cipher,
int keylen, int maxkeylen,
- int *key_rsc_len, wpa_alg *alg)
+ int *key_rsc_len,
+ enum wpa_alg *alg)
{
int ret = 0;
struct wpa_gtk_data {
- wpa_alg alg;
+ enum wpa_alg alg;
int tx, key_rsc_len, keyidx;
u8 gtk[32];
int gtk_len;
void *ctx; /* pointer to arbitrary upper level context */
void *msg_ctx; /* upper level context for wpa_msg() calls */
- void (*set_state)(void *ctx, wpa_states state);
- wpa_states (*get_state)(void *ctx);
+ void (*set_state)(void *ctx, enum wpa_states state);
+ enum wpa_states (*get_state)(void *ctx);
void (*deauthenticate)(void * ctx, int reason_code);
void (*disassociate)(void *ctx, int reason_code);
- int (*set_key)(void *ctx, wpa_alg alg,
+ int (*set_key)(void *ctx, enum wpa_alg alg,
const u8 *addr, int key_idx, int set_tx,
const u8 *seq, size_t seq_len,
const u8 *key, size_t key_len);
static int wpa_ft_install_ptk(struct wpa_sm *sm, const u8 *bssid)
{
int keylen;
- wpa_alg alg;
+ enum wpa_alg alg;
u8 null_rsc[6] = { 0, 0, 0, 0, 0, 0 };
wpa_printf(MSG_DEBUG, "FT: Installing PTK to the driver.");
{
u8 gtk[32];
int keyidx;
- wpa_alg alg;
+ enum wpa_alg alg;
size_t gtk_len, keylen, rsc_len;
if (gtk_elem == NULL) {
};
-static inline void wpa_sm_set_state(struct wpa_sm *sm, wpa_states state)
+static inline void wpa_sm_set_state(struct wpa_sm *sm, enum wpa_states state)
{
WPA_ASSERT(sm->ctx->set_state);
sm->ctx->set_state(sm->ctx->ctx, state);
}
-static inline wpa_states wpa_sm_get_state(struct wpa_sm *sm)
+static inline enum wpa_states wpa_sm_get_state(struct wpa_sm *sm)
{
WPA_ASSERT(sm->ctx->get_state);
return sm->ctx->get_state(sm->ctx->ctx);
sm->ctx->disassociate(sm->ctx->ctx, reason_code);
}
-static inline int wpa_sm_set_key(struct wpa_sm *sm, wpa_alg alg,
+static inline int wpa_sm_set_key(struct wpa_sm *sm, enum wpa_alg alg,
const u8 *addr, int key_idx, int set_tx,
const u8 *seq, size_t seq_len,
const u8 *key, size_t key_len)
* Notify listeners that wpa_supplicant has changed state
*/
void wpa_supplicant_dbus_notify_state_change(struct wpa_supplicant *wpa_s,
- wpa_states new_state,
- wpa_states old_state)
+ enum wpa_states new_state,
+ enum wpa_states old_state)
{
struct ctrl_iface_dbus_priv *iface;
DBusMessage *_signal = NULL;
void wpa_supplicant_dbus_notify_scan_results(struct wpa_supplicant *wpa_s);
void wpa_supplicant_dbus_notify_scanning(struct wpa_supplicant *wpa_s);
void wpa_supplicant_dbus_notify_state_change(struct wpa_supplicant *wpa_s,
- wpa_states new_state,
- wpa_states old_state);
+ enum wpa_states new_state,
+ enum wpa_states old_state);
void wpa_supplicant_dbus_notify_wps_cred(struct wpa_supplicant *wpa_s,
const struct wps_credential *cred);
static inline void
wpa_supplicant_dbus_notify_state_change(struct wpa_supplicant *wpa_s,
- wpa_states new_state,
- wpa_states old_state)
+ enum wpa_states new_state,
+ enum wpa_states old_state)
{
}
* Notify listeners that wpa_supplicant has changed state
*/
static void wpas_dbus_signal_state_changed(struct wpa_supplicant *wpa_s,
- wpa_states new_state,
- wpa_states old_state)
+ enum wpa_states new_state,
+ enum wpa_states old_state)
{
struct ctrl_iface_dbus_new_priv *iface;
DBusMessage *_signal = NULL;
void (*signal_network_selected)(struct wpa_supplicant *wpa_s, int id);
void (*signal_state_changed)(struct wpa_supplicant *wpa_s,
- wpa_states new_state,
- wpa_states old_state);
+ enum wpa_states new_state,
+ enum wpa_states old_state);
int (*register_network)(struct wpa_supplicant *wpa_s,
struct wpa_ssid *ssid);
return -1;
}
-static inline int wpa_drv_set_key(struct wpa_supplicant *wpa_s, wpa_alg alg,
- const u8 *addr, int key_idx, int set_tx,
+static inline int wpa_drv_set_key(struct wpa_supplicant *wpa_s,
+ enum wpa_alg alg, const u8 *addr,
+ int key_idx, int set_tx,
const u8 *seq, size_t seq_len,
const u8 *key, size_t key_len)
{
}
static inline int wpa_drv_set_channel(struct wpa_supplicant *wpa_s,
- hostapd_hw_mode phymode, int chan,
+ enum hostapd_hw_mode phymode, int chan,
int freq)
{
if (wpa_s->driver->set_channel)
#include "l2_packet/l2_packet.h"
#include "rsn_supp/wpa.h"
#include "rsn_supp/wpa_ie.h"
-#include "ap/wpa.h"
+#include "ap/wpa_auth.h"
#include "wpa_supplicant_i.h"
#include "driver_i.h"
#include "ibss_rsn.h"
}
-static void supp_set_state(void *ctx, wpa_states state)
+static void supp_set_state(void *ctx, enum wpa_states state)
{
struct ibss_rsn_peer *peer = ctx;
peer->supp_state = state;
}
-static int supp_set_key(void *ctx, wpa_alg alg,
+static int supp_set_key(void *ctx, enum wpa_alg alg,
const u8 *addr, int key_idx, int set_tx,
const u8 *seq, size_t seq_len,
const u8 *key, size_t key_len)
}
-static int auth_set_key(void *ctx, int vlan_id, wpa_alg alg, const u8 *addr,
- int idx, u8 *key, size_t key_len)
+static int auth_set_key(void *ctx, int vlan_id, enum wpa_alg alg,
+ const u8 *addr, int idx, u8 *key, size_t key_len)
{
struct ibss_rsn *ibss_rsn = ctx;
u8 seq[6];
u8 addr[ETH_ALEN];
struct wpa_sm *supp;
- wpa_states supp_state;
+ enum wpa_states supp_state;
u8 supp_ie[80];
size_t supp_ie_len;
static int ieee80211_sta_set_channel(struct wpa_supplicant *wpa_s,
- hostapd_hw_mode phymode, int chan,
+ enum hostapd_hw_mode phymode, int chan,
int freq)
{
size_t i;
void wpas_notify_state_changed(struct wpa_supplicant *wpa_s,
- wpa_states new_state, wpa_states old_state)
+ enum wpa_states new_state,
+ enum wpa_states old_state)
{
struct wpas_dbus_callbacks *cbs = wpas_dbus_get_callbacks();
int wpas_notify_iface_added(struct wpa_supplicant *wpa_s);
void wpas_notify_iface_removed(struct wpa_supplicant *wpa_s);
void wpas_notify_state_changed(struct wpa_supplicant *wpa_s,
- wpa_states new_state, wpa_states old_state);
+ enum wpa_states new_state,
+ enum wpa_states old_state);
void wpas_notify_network_changed(struct wpa_supplicant *wpa_s);
void wpas_notify_ap_scan_changed(struct wpa_supplicant *wpa_s);
void wpas_notify_bssid_changed(struct wpa_supplicant *wpa_s);
}
-static void _wpa_supplicant_set_state(void *ctx, wpa_states state)
+static void _wpa_supplicant_set_state(void *ctx, enum wpa_states state)
{
struct wpa_supplicant *wpa_s = ctx;
wpa_s->wpa_state = state;
}
-static wpa_states _wpa_supplicant_get_state(void *ctx)
+static enum wpa_states _wpa_supplicant_get_state(void *ctx)
{
struct wpa_supplicant *wpa_s = ctx;
return wpa_s->wpa_state;
}
-static int wpa_supplicant_set_key(void *wpa_s, wpa_alg alg,
+static int wpa_supplicant_set_key(void *wpa_s, enum wpa_alg alg,
const u8 *addr, int key_idx, int set_tx,
const u8 *seq, size_t seq_len,
const u8 *key, size_t key_len)
}
-static void supp_set_state(void *ctx, wpa_states state)
+static void supp_set_state(void *ctx, enum wpa_states state)
{
wpa_printf(MSG_DEBUG, "SUPP: %s(state=%d)", __func__, state);
}
}
-static int supp_set_key(void *ctx, wpa_alg alg,
+static int supp_set_key(void *ctx, enum wpa_alg alg,
const u8 *addr, int key_idx, int set_tx,
const u8 *seq, size_t seq_len,
const u8 *key, size_t key_len)
{
u8 key[32];
size_t keylen;
- wpa_alg alg;
+ enum wpa_alg alg;
u8 seq[6] = { 0 };
/* IBSS/WPA-None uses only one key (Group) for both receiving and
* @state: State (wpa_state; WPA_*)
* Returns: The state name as a printable text string
*/
-const char * wpa_supplicant_state_txt(int state)
+const char * wpa_supplicant_state_txt(enum wpa_states state)
{
switch (state) {
case WPA_DISCONNECTED:
* This function is called whenever the connection state changes, e.g.,
* association is completed for WPA/WPA2 4-Way Handshake is started.
*/
-void wpa_supplicant_set_state(struct wpa_supplicant *wpa_s, wpa_states state)
+void wpa_supplicant_set_state(struct wpa_supplicant *wpa_s,
+ enum wpa_states state)
{
wpa_printf(MSG_DEBUG, "State: %s -> %s",
wpa_supplicant_state_txt(wpa_s->wpa_state),
static void wpa_supplicant_clear_status(struct wpa_supplicant *wpa_s)
{
- wpa_states old_state = wpa_s->wpa_state;
+ enum wpa_states old_state = wpa_s->wpa_state;
wpa_s->pairwise_cipher = 0;
wpa_s->group_cipher = 0;
wpa_s->mgmt_group_cipher = 0;
}
-static wpa_cipher cipher_suite2driver(int cipher)
+static enum wpa_cipher cipher_suite2driver(int cipher)
{
switch (cipher) {
case WPA_CIPHER_NONE:
}
-static wpa_key_mgmt key_mgmt2driver(int key_mgmt)
+static enum wpa_key_mgmt key_mgmt2driver(int key_mgmt)
{
switch (key_mgmt) {
case WPA_KEY_MGMT_NONE:
size_t wpa_ie_len;
int use_crypt, ret, i, bssid_changed;
int algs = AUTH_ALG_OPEN_SYSTEM;
- wpa_cipher cipher_pairwise, cipher_group;
+ enum wpa_cipher cipher_pairwise, cipher_group;
struct wpa_driver_associate_params params;
int wep_keys_set = 0;
struct wpa_driver_capa capa;
size_t extra_ie_len;
u8 *extra_probe_ie; /* to be added to the end of ProbeReq */
size_t extra_probe_ie_len;
- wpa_key_mgmt key_mgmt;
+ enum wpa_key_mgmt key_mgmt;
/* The last AssocReq/Resp IEs */
u8 *assocreq_ies, *assocresp_ies;
int cts_protect_erp_frames;
- hostapd_hw_mode phymode; /* current mode */
+ enum hostapd_hw_mode phymode; /* current mode */
struct hostapd_hw_modes *modes;
size_t num_modes;
unsigned int hw_modes; /* bitfield of allowed hardware modes;
struct ctrl_iface_priv *ctrl_iface;
- wpa_states wpa_state;
+ enum wpa_states wpa_state;
int scanning;
int new_connection;
int reassociated_connection;
int wpa_supplicant_reload_configuration(struct wpa_supplicant *wpa_s);
-const char * wpa_supplicant_state_txt(int state);
+const char * wpa_supplicant_state_txt(enum wpa_states state);
int wpa_supplicant_driver_init(struct wpa_supplicant *wpa_s);
int wpa_supplicant_set_suites(struct wpa_supplicant *wpa_s,
struct wpa_scan_res *bss,
void wpa_clear_keys(struct wpa_supplicant *wpa_s, const u8 *addr);
void wpa_supplicant_req_auth_timeout(struct wpa_supplicant *wpa_s,
int sec, int usec);
-void wpa_supplicant_set_state(struct wpa_supplicant *wpa_s, wpa_states state);
+void wpa_supplicant_set_state(struct wpa_supplicant *wpa_s,
+ enum wpa_states state);
struct wpa_ssid * wpa_supplicant_get_ssid(struct wpa_supplicant *wpa_s);
void wpa_supplicant_cancel_auth_timeout(struct wpa_supplicant *wpa_s);
void wpa_supplicant_deauthenticate(struct wpa_supplicant *wpa_s,
}
-static void _wpa_supplicant_set_state(void *wpa_s, wpa_states state)
+static void _wpa_supplicant_set_state(void *wpa_s, enum wpa_states state)
{
wpa_supplicant_set_state(wpa_s, state);
}
* @wpa_s: Pointer to wpa_supplicant data
* Returns: The current connection state (WPA_*)
*/
-static wpa_states wpa_supplicant_get_state(struct wpa_supplicant *wpa_s)
+static enum wpa_states wpa_supplicant_get_state(struct wpa_supplicant *wpa_s)
{
return wpa_s->wpa_state;
}
-static wpa_states _wpa_supplicant_get_state(void *wpa_s)
+static enum wpa_states _wpa_supplicant_get_state(void *wpa_s)
{
return wpa_supplicant_get_state(wpa_s);
}
}
-static int wpa_supplicant_set_key(void *_wpa_s, wpa_alg alg,
+static int wpa_supplicant_set_key(void *_wpa_s, enum wpa_alg alg,
const u8 *addr, int key_idx, int set_tx,
const u8 *seq, size_t seq_len,
const u8 *key, size_t key_len)