aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2009-12-26 08:35:08 (GMT)
committerJouni Malinen <j@w1.fi>2009-12-26 08:35:08 (GMT)
commit719347511ad6a9b4d7ef6f1459cb08597900cbc9 (patch)
treedf673c9d05b10eaa9a346262bf0a657869eababc
parent81f4f6195ecaf4d8c24f178183c7f6237ef0073c (diff)
downloadhostap-719347511ad6a9b4d7ef6f1459cb08597900cbc9.zip
hostap-719347511ad6a9b4d7ef6f1459cb08597900cbc9.tar.gz
hostap-719347511ad6a9b4d7ef6f1459cb08597900cbc9.tar.bz2
Get rid of unnecessary typedefs for enums.
-rw-r--r--src/ap/ap_config.h2
-rw-r--r--src/ap/ap_drv_ops.c2
-rw-r--r--src/ap/hostapd.h2
-rw-r--r--src/ap/wpa_auth.c6
-rw-r--r--src/ap/wpa_auth.h4
-rw-r--r--src/ap/wpa_auth_ft.c4
-rw-r--r--src/ap/wpa_auth_glue.c2
-rw-r--r--src/common/defs.h47
-rw-r--r--src/drivers/driver.h12
-rw-r--r--src/drivers/driver_atheros.c6
-rw-r--r--src/drivers/driver_atmel.c7
-rw-r--r--src/drivers/driver_broadcom.c2
-rw-r--r--src/drivers/driver_bsd.c4
-rw-r--r--src/drivers/driver_hostap.c10
-rw-r--r--src/drivers/driver_ipw.c5
-rw-r--r--src/drivers/driver_madwifi.c4
-rw-r--r--src/drivers/driver_ndis.c5
-rw-r--r--src/drivers/driver_ndiswrapper.c19
-rw-r--r--src/drivers/driver_nl80211.c6
-rw-r--r--src/drivers/driver_privsep.c2
-rw-r--r--src/drivers/driver_ralink.c2
-rw-r--r--src/drivers/driver_test.c8
-rw-r--r--src/drivers/driver_wext.c4
-rw-r--r--src/drivers/driver_wext.h2
-rw-r--r--src/rsn_supp/wpa.c7
-rw-r--r--src/rsn_supp/wpa.h6
-rw-r--r--src/rsn_supp/wpa_ft.c4
-rw-r--r--src/rsn_supp/wpa_i.h6
-rw-r--r--wpa_supplicant/dbus/dbus.c4
-rw-r--r--wpa_supplicant/dbus/dbus.h8
-rw-r--r--wpa_supplicant/dbus/dbus_new.c4
-rw-r--r--wpa_supplicant/dbus/dbus_new.h4
-rw-r--r--wpa_supplicant/driver_i.h7
-rw-r--r--wpa_supplicant/ibss_rsn.c10
-rw-r--r--wpa_supplicant/ibss_rsn.h2
-rw-r--r--wpa_supplicant/mlme.c2
-rw-r--r--wpa_supplicant/notify.c3
-rw-r--r--wpa_supplicant/notify.h3
-rw-r--r--wpa_supplicant/preauth_test.c6
-rw-r--r--wpa_supplicant/tests/test_wpa.c4
-rw-r--r--wpa_supplicant/wpa_supplicant.c15
-rw-r--r--wpa_supplicant/wpa_supplicant_i.h11
-rw-r--r--wpa_supplicant/wpas_glue.c8
43 files changed, 156 insertions, 125 deletions
diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h
index b8ce830..3ddec9d 100644
--- a/src/ap/ap_config.h
+++ b/src/ap/ap_config.h
@@ -324,7 +324,7 @@ struct hostapd_config {
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
diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c
index 8fb9913..80beac7 100644
--- a/src/ap/ap_drv_ops.c
+++ b/src/ap/ap_drv_ops.c
@@ -86,7 +86,7 @@ static int hostapd_set_authorized(struct hostapd_data *hapd,
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)
{
diff --git a/src/ap/hostapd.h b/src/ap/hostapd.h
index 25d3c3e..27ac984 100644
--- a/src/ap/hostapd.h
+++ b/src/ap/hostapd.h
@@ -52,7 +52,7 @@ struct hostapd_driver_ops {
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,
diff --git a/src/ap/wpa_auth.c b/src/ap/wpa_auth.c
index 0c1003d..b2b4c42 100644
--- a/src/ap/wpa_auth.c
+++ b/src/ap/wpa_auth.c
@@ -104,7 +104,7 @@ static inline int wpa_auth_get_msk(struct wpa_authenticator *wpa_auth,
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)
@@ -1239,7 +1239,7 @@ void wpa_auth_sm_event(struct wpa_state_machine *sm, wpa_event event)
}
-static wpa_alg wpa_alg_enum(int alg)
+static enum wpa_alg wpa_alg_enum(int alg)
{
switch (alg) {
case WPA_CIPHER_CCMP:
@@ -1638,7 +1638,7 @@ SM_STATE(WPA_PTK, PTKINITDONE)
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;
diff --git a/src/ap/wpa_auth.h b/src/ap/wpa_auth.h
index 55d4ec2..4bd9cd7 100644
--- a/src/ap/wpa_auth.h
+++ b/src/ap/wpa_auth.h
@@ -184,8 +184,8 @@ struct wpa_auth_callbacks {
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);
diff --git a/src/ap/wpa_auth_ft.c b/src/ap/wpa_auth_ft.c
index c916ebe..ff21d60 100644
--- a/src/ap/wpa_auth_ft.c
+++ b/src/ap/wpa_auth_ft.c
@@ -832,7 +832,7 @@ static int wpa_ft_parse_ies(const u8 *ies, size_t ies_len,
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)
@@ -844,7 +844,7 @@ static inline int wpa_auth_set_key(struct wpa_authenticator *wpa_auth,
static void wpa_ft_install_ptk(struct wpa_state_machine *sm)
{
- wpa_alg alg;
+ enum wpa_alg alg;
int klen;
/* MLME-SETKEYS.request(PTK) */
diff --git a/src/ap/wpa_auth_glue.c b/src/ap/wpa_auth_glue.c
index 8a6ee83..df0415d 100644
--- a/src/ap/wpa_auth_glue.c
+++ b/src/ap/wpa_auth_glue.c
@@ -210,7 +210,7 @@ static int hostapd_wpa_auth_get_msk(void *ctx, const u8 *addr, u8 *msk,
}
-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)
{
diff --git a/src/common/defs.h b/src/common/defs.h
index 6cab26d..ab93180 100644
--- a/src/common/defs.h
+++ b/src/common/defs.h
@@ -79,16 +79,35 @@ static inline int wpa_key_mgmt_sha256(int akm)
#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
@@ -100,7 +119,7 @@ typedef enum { KEY_MGMT_802_1X, KEY_MGMT_PSK, KEY_MGMT_NONE,
* 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
*
@@ -196,7 +215,7 @@ typedef enum {
* fully configured.
*/
WPA_COMPLETED
-} wpa_states;
+};
#define MLME_SETPROTECTION_PROTECT_TYPE_NONE 0
#define MLME_SETPROTECTION_PROTECT_TYPE_RX 1
@@ -213,11 +232,11 @@ enum mfp_options {
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 */
diff --git a/src/drivers/driver.h b/src/drivers/driver.h
index f774de9..91c328b 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
@@ -32,7 +32,7 @@ struct hostapd_channel_data {
};
struct hostapd_hw_modes {
- hostapd_hw_mode mode;
+ enum hostapd_hw_mode mode;
int num_channels;
struct hostapd_channel_data *channels;
int num_rates;
@@ -243,9 +243,9 @@ struct wpa_driver_associate_params {
/* 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
@@ -586,7 +586,7 @@ struct wpa_driver_ops {
* 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);
@@ -867,7 +867,7 @@ struct wpa_driver_ops {
* 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);
/**
diff --git a/src/drivers/driver_atheros.c b/src/drivers/driver_atheros.c
index c3e09c4..0c2f81c 100644
--- a/src/drivers/driver_atheros.c
+++ b/src/drivers/driver_atheros.c
@@ -411,9 +411,9 @@ madwifi_del_key(void *priv, const u8 *addr, int key_idx)
}
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;
diff --git a/src/drivers/driver_atmel.c b/src/drivers/driver_atmel.c
index 6c857e6..cbec6c3 100644
--- a/src/drivers/driver_atmel.c
+++ b/src/drivers/driver_atmel.c
@@ -189,8 +189,9 @@ static int wpa_driver_atmel_set_wpa(void *priv, int enabled)
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;
@@ -337,7 +338,7 @@ static int wpa_driver_atmel_disassociate(void *priv, const u8 *addr,
#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;
diff --git a/src/drivers/driver_broadcom.c b/src/drivers/driver_broadcom.c
index 3a937df..9b9644f 100644
--- a/src/drivers/driver_broadcom.c
+++ b/src/drivers/driver_broadcom.c
@@ -163,7 +163,7 @@ static int wpa_driver_broadcom_set_wpa(void *priv, int enable)
}
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)
diff --git a/src/drivers/driver_bsd.c b/src/drivers/driver_bsd.c
index c3cbd09..2b83618 100644
--- a/src/drivers/driver_bsd.c
+++ b/src/drivers/driver_bsd.c
@@ -409,7 +409,7 @@ bsd_del_key(void *priv, const u8 *addr, int key_idx)
}
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)
{
@@ -1020,7 +1020,7 @@ wpa_driver_bsd_del_key(struct wpa_driver_bsd_data *drv, int key_idx,
}
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)
diff --git a/src/drivers/driver_hostap.c b/src/drivers/driver_hostap.c
index 157b326..e976c57 100644
--- a/src/drivers/driver_hostap.c
+++ b/src/drivers/driver_hostap.c
@@ -429,8 +429,9 @@ static int hostapd_ioctl(void *priv, struct prism2_hostapd_param *param,
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;
@@ -1275,8 +1276,9 @@ static void show_set_key_error(struct prism2_hostapd_param *param)
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;
diff --git a/src/drivers/driver_ipw.c b/src/drivers/driver_ipw.c
index 1f8954e..beda6d0 100644
--- a/src/drivers/driver_ipw.c
+++ b/src/drivers/driver_ipw.c
@@ -215,8 +215,9 @@ static int wpa_driver_ipw_set_wpa(void *priv, int enabled)
}
-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)
{
diff --git a/src/drivers/driver_madwifi.c b/src/drivers/driver_madwifi.c
index 857b24f..367148c 100644
--- a/src/drivers/driver_madwifi.c
+++ b/src/drivers/driver_madwifi.c
@@ -456,7 +456,7 @@ madwifi_del_key(void *priv, const u8 *addr, int key_idx)
}
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)
@@ -1462,7 +1462,7 @@ wpa_driver_madwifi_del_key(struct wpa_driver_madwifi_data *drv, int key_idx,
}
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)
diff --git a/src/drivers/driver_ndis.c b/src/drivers/driver_ndis.c
index 6fe7bcd..f3dc1cf 100644
--- a/src/drivers/driver_ndis.c
+++ b/src/drivers/driver_ndis.c
@@ -970,8 +970,9 @@ static int wpa_driver_ndis_add_wep(struct wpa_driver_ndis_data *drv,
}
-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)
{
diff --git a/src/drivers/driver_ndiswrapper.c b/src/drivers/driver_ndiswrapper.c
index 7ab272a..cd2f61e 100644
--- a/src/drivers/driver_ndiswrapper.c
+++ b/src/drivers/driver_ndiswrapper.c
@@ -33,9 +33,8 @@ struct wpa_driver_ndiswrapper_data {
};
-struct wpa_key
-{
- wpa_alg alg;
+struct wpa_key {
+ enum wpa_alg alg;
const u8 *addr;
int key_index;
int set_tx;
@@ -45,17 +44,16 @@ struct wpa_key
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;
};
@@ -113,8 +111,9 @@ static int wpa_ndiswrapper_set_wpa(void *priv, int enabled)
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)
{
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index 67043a6..ce6bedc 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -1620,8 +1620,8 @@ nla_put_failure:
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)
{
@@ -1730,7 +1730,7 @@ nla_put_failure:
}
-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)
diff --git a/src/drivers/driver_privsep.c b/src/drivers/driver_privsep.c
index baec717..077f853 100644
--- a/src/drivers/driver_privsep.c
+++ b/src/drivers/driver_privsep.c
@@ -191,7 +191,7 @@ wpa_driver_privsep_get_scan_results2(void *priv)
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)
diff --git a/src/drivers/driver_ralink.c b/src/drivers/driver_ralink.c
index 5982321..e7fbfb6 100644
--- a/src/drivers/driver_ralink.c
+++ b/src/drivers/driver_ralink.c
@@ -1191,7 +1191,7 @@ static int wpa_driver_ralink_add_wep(struct wpa_driver_ralink_data *drv,
}
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)
diff --git a/src/drivers/driver_test.c b/src/drivers/driver_test.c
index ccc47db..196112f 100644
--- a/src/drivers/driver_test.c
+++ b/src/drivers/driver_test.c
@@ -1407,8 +1407,9 @@ static struct wpa_scan_results * wpa_driver_test_get_scan_results2(void *priv)
}
-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)
{
@@ -2276,7 +2277,8 @@ static int wpa_driver_test_mlme_setprotection(void *priv, const u8 *addr,
}
-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",
diff --git a/src/drivers/driver_wext.c b/src/drivers/driver_wext.c
index 7087835..8586d4a 100644
--- a/src/drivers/driver_wext.c
+++ b/src/drivers/driver_wext.c
@@ -1532,7 +1532,7 @@ static int wpa_driver_wext_set_psk(struct wpa_driver_wext_data *drv,
}
-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,
@@ -1652,7 +1652,7 @@ static int wpa_driver_wext_set_key_ext(void *priv, wpa_alg alg,
* 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)
diff --git a/src/drivers/driver_wext.h b/src/drivers/driver_wext.h
index 8c64974..edc32a7 100644
--- a/src/drivers/driver_wext.h
+++ b/src/drivers/driver_wext.h
@@ -53,7 +53,7 @@ int wpa_driver_wext_get_ssid(void *priv, u8 *ssid);
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);
diff --git a/src/rsn_supp/wpa.c b/src/rsn_supp/wpa.c
index e84771f..78ec079 100644
--- a/src/rsn_supp/wpa.c
+++ b/src/rsn_supp/wpa.c
@@ -452,7 +452,7 @@ static int wpa_supplicant_install_ptk(struct wpa_sm *sm,
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 };
@@ -506,7 +506,8 @@ static int wpa_supplicant_install_ptk(struct wpa_sm *sm,
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;
@@ -560,7 +561,7 @@ static int wpa_supplicant_check_group_cipher(int group_cipher,
struct wpa_gtk_data {
- wpa_alg alg;
+ enum wpa_alg alg;
int tx, key_rsc_len, keyidx;
u8 gtk[32];
int gtk_len;
diff --git a/src/rsn_supp/wpa.h b/src/rsn_supp/wpa.h
index b2fa2e5..4dddee0 100644
--- a/src/rsn_supp/wpa.h
+++ b/src/rsn_supp/wpa.h
@@ -27,11 +27,11 @@ struct wpa_sm_ctx {
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);
diff --git a/src/rsn_supp/wpa_ft.c b/src/rsn_supp/wpa_ft.c
index a7da7e0..964977f 100644
--- a/src/rsn_supp/wpa_ft.c
+++ b/src/rsn_supp/wpa_ft.c
@@ -457,7 +457,7 @@ static int wpa_ft_parse_ies(const u8 *ies, size_t ies_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.");
@@ -662,7 +662,7 @@ static int wpa_ft_process_gtk_subelem(struct wpa_sm *sm, const u8 *gtk_elem,
{
u8 gtk[32];
int keyidx;
- wpa_alg alg;
+ enum wpa_alg alg;
size_t gtk_len, keylen, rsc_len;
if (gtk_elem == NULL) {
diff --git a/src/rsn_supp/wpa_i.h b/src/rsn_supp/wpa_i.h
index e0dc6bd..c7eb6e7 100644
--- a/src/rsn_supp/wpa_i.h
+++ b/src/rsn_supp/wpa_i.h
@@ -109,13 +109,13 @@ struct wpa_sm {
};
-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);
@@ -133,7 +133,7 @@ static inline void wpa_sm_disassociate(struct wpa_sm *sm, int reason_code)
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)
diff --git a/wpa_supplicant/dbus/dbus.c b/wpa_supplicant/dbus/dbus.c
index 2bf9df5..1f294c2 100644
--- a/wpa_supplicant/dbus/dbus.c
+++ b/wpa_supplicant/dbus/dbus.c
@@ -683,8 +683,8 @@ void wpa_supplicant_dbus_notify_scan_results(struct wpa_supplicant *wpa_s)
* 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;
diff --git a/wpa_supplicant/dbus/dbus.h b/wpa_supplicant/dbus/dbus.h
index 57be3a8..cab7faf 100644
--- a/wpa_supplicant/dbus/dbus.h
+++ b/wpa_supplicant/dbus/dbus.h
@@ -92,8 +92,8 @@ void wpa_supplicant_dbus_ctrl_iface_deinit(struct ctrl_iface_dbus_priv *iface);
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);
@@ -141,8 +141,8 @@ wpa_supplicant_dbus_notify_scanning(struct wpa_supplicant *wpa_s)
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)
{
}
diff --git a/wpa_supplicant/dbus/dbus_new.c b/wpa_supplicant/dbus/dbus_new.c
index d05fec5..cd4e4af 100644
--- a/wpa_supplicant/dbus/dbus_new.c
+++ b/wpa_supplicant/dbus/dbus_new.c
@@ -423,8 +423,8 @@ static void wpas_dbus_signal_network_selected(struct wpa_supplicant *wpa_s,
* 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;
diff --git a/wpa_supplicant/dbus/dbus_new.h b/wpa_supplicant/dbus/dbus_new.h
index 8d56587..e263945 100644
--- a/wpa_supplicant/dbus/dbus_new.h
+++ b/wpa_supplicant/dbus/dbus_new.h
@@ -52,8 +52,8 @@ struct wpas_dbus_callbacks {
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);
diff --git a/wpa_supplicant/driver_i.h b/wpa_supplicant/driver_i.h
index 7f20fe0..7e4af80 100644
--- a/wpa_supplicant/driver_i.h
+++ b/wpa_supplicant/driver_i.h
@@ -103,8 +103,9 @@ static inline int wpa_drv_get_ssid(struct wpa_supplicant *wpa_s, u8 *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)
{
@@ -236,7 +237,7 @@ wpa_drv_get_hw_feature_data(struct wpa_supplicant *wpa_s, u16 *num_modes,
}
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)
diff --git a/wpa_supplicant/ibss_rsn.c b/wpa_supplicant/ibss_rsn.c
index 8545eff..5c9dfa1 100644
--- a/wpa_supplicant/ibss_rsn.c
+++ b/wpa_supplicant/ibss_rsn.c
@@ -18,7 +18,7 @@
#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"
@@ -32,7 +32,7 @@ static void ibss_rsn_free(struct ibss_rsn_peer *peer)
}
-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;
@@ -100,7 +100,7 @@ static int supp_get_beacon_ie(void *ctx)
}
-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)
@@ -238,8 +238,8 @@ static int auth_send_eapol(void *ctx, const u8 *addr, const u8 *data,
}
-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];
diff --git a/wpa_supplicant/ibss_rsn.h b/wpa_supplicant/ibss_rsn.h
index 43e4d07..11e63ad 100644
--- a/wpa_supplicant/ibss_rsn.h
+++ b/wpa_supplicant/ibss_rsn.h
@@ -24,7 +24,7 @@ struct ibss_rsn_peer {
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;
diff --git a/wpa_supplicant/mlme.c b/wpa_supplicant/mlme.c
index cb2dffe..54dfc0e 100644
--- a/wpa_supplicant/mlme.c
+++ b/wpa_supplicant/mlme.c
@@ -99,7 +99,7 @@ static void ieee80211_build_tspec(struct wpabuf *buf);
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;
diff --git a/wpa_supplicant/notify.c b/wpa_supplicant/notify.c
index fa06947..f398ee9 100644
--- a/wpa_supplicant/notify.c
+++ b/wpa_supplicant/notify.c
@@ -85,7 +85,8 @@ 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)
{
struct wpas_dbus_callbacks *cbs = wpas_dbus_get_callbacks();
diff --git a/wpa_supplicant/notify.h b/wpa_supplicant/notify.h
index ca212b3..437a902 100644
--- a/wpa_supplicant/notify.h
+++ b/wpa_supplicant/notify.h
@@ -24,7 +24,8 @@ void wpas_notify_supplicant_deinitialized(struct wpa_global *global);
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);
diff --git a/wpa_supplicant/preauth_test.c b/wpa_supplicant/preauth_test.c
index cebe2ba..d38a6bb 100644
--- a/wpa_supplicant/preauth_test.c
+++ b/wpa_supplicant/preauth_test.c
@@ -91,14 +91,14 @@ static u8 * _wpa_alloc_eapol(void *wpa_s, u8 type,
}
-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;
@@ -139,7 +139,7 @@ static int wpa_supplicant_get_bssid(void *wpa_s, u8 *bssid)
}
-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)
diff --git a/wpa_supplicant/tests/test_wpa.c b/wpa_supplicant/tests/test_wpa.c
index 7249ffb..7947137 100644
--- a/wpa_supplicant/tests/test_wpa.c
+++ b/wpa_supplicant/tests/test_wpa.c
@@ -60,7 +60,7 @@ static int supp_get_bssid(void *ctx, u8 *bssid)
}
-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);
}
@@ -143,7 +143,7 @@ static int supp_get_beacon_ie(void *ctx)
}
-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)
diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index 0ad30ab..a02fd77 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -143,7 +143,7 @@ static int wpa_supplicant_set_wpa_none_key(struct wpa_supplicant *wpa_s,
{
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
@@ -478,7 +478,7 @@ void wpa_clear_keys(struct wpa_supplicant *wpa_s, const u8 *addr)
* @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:
@@ -513,7 +513,8 @@ const char * wpa_supplicant_state_txt(int state)
* 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),
@@ -577,7 +578,7 @@ static void wpa_supplicant_terminate(int sig, void *signal_ctx)
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;
@@ -676,7 +677,7 @@ static void wpa_supplicant_reconfig(int sig, void *signal_ctx)
}
-static wpa_cipher cipher_suite2driver(int cipher)
+static enum wpa_cipher cipher_suite2driver(int cipher)
{
switch (cipher) {
case WPA_CIPHER_NONE:
@@ -694,7 +695,7 @@ static wpa_cipher cipher_suite2driver(int cipher)
}
-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:
@@ -980,7 +981,7 @@ void wpa_supplicant_associate(struct wpa_supplicant *wpa_s,
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;
diff --git a/wpa_supplicant/wpa_supplicant_i.h b/wpa_supplicant/wpa_supplicant_i.h
index 77142b2..ee6dce2 100644
--- a/wpa_supplicant/wpa_supplicant_i.h
+++ b/wpa_supplicant/wpa_supplicant_i.h
@@ -215,7 +215,7 @@ struct wpa_client_mlme {
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;
@@ -269,7 +269,7 @@ struct wpa_client_mlme {
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;
@@ -353,7 +353,7 @@ struct wpa_supplicant {
struct ctrl_iface_priv *ctrl_iface;
- wpa_states wpa_state;
+ enum wpa_states wpa_state;
int scanning;
int new_connection;
int reassociated_connection;
@@ -428,7 +428,7 @@ int wpa_set_wep_keys(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid);
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,
@@ -444,7 +444,8 @@ int wpa_supplicant_get_scan_results(struct wpa_supplicant *wpa_s);
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,
diff --git a/wpa_supplicant/wpas_glue.c b/wpa_supplicant/wpas_glue.c
index 01264de..34f7bb4 100644
--- a/wpa_supplicant/wpas_glue.c
+++ b/wpa_supplicant/wpas_glue.c
@@ -377,7 +377,7 @@ static void _wpa_supplicant_cancel_auth_timeout(void *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);
}
@@ -388,13 +388,13 @@ static void _wpa_supplicant_set_state(void *wpa_s, wpa_states 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);
}
@@ -433,7 +433,7 @@ static int wpa_supplicant_get_bssid(void *ctx, u8 *bssid)
}
-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)