Get rid of unnecessary typedefs for enums.

This commit is contained in:
Jouni Malinen 2009-12-26 10:35:08 +02:00
parent 81f4f6195e
commit 719347511a
43 changed files with 156 additions and 125 deletions

View file

@ -324,7 +324,7 @@ struct hostapd_config {
int fragm_threshold; int fragm_threshold;
u8 send_probe_response; u8 send_probe_response;
u8 channel; u8 channel;
hostapd_hw_mode hw_mode; /* HOSTAPD_MODE_IEEE80211A, .. */ enum hostapd_hw_mode hw_mode; /* HOSTAPD_MODE_IEEE80211A, .. */
enum { enum {
LONG_PREAMBLE = 0, LONG_PREAMBLE = 0,
SHORT_PREAMBLE = 1 SHORT_PREAMBLE = 1

View file

@ -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, 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, int set_tx, const u8 *seq, size_t seq_len,
const u8 *key, size_t key_len) const u8 *key, size_t key_len)
{ {

View file

@ -52,7 +52,7 @@ struct hostapd_driver_ops {
int (*set_authorized)(struct hostapd_data *hapd, struct sta_info *sta, int (*set_authorized)(struct hostapd_data *hapd, struct sta_info *sta,
int authorized); int authorized);
int (*set_key)(const char *ifname, struct hostapd_data *hapd, 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, int set_tx, const u8 *seq, size_t seq_len,
const u8 *key, size_t key_len); const u8 *key, size_t key_len);
int (*read_sta_data)(struct hostapd_data *hapd, int (*read_sta_data)(struct hostapd_data *hapd,

View file

@ -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, static inline int wpa_auth_set_key(struct wpa_authenticator *wpa_auth,
int vlan_id, 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) u8 *key, size_t key_len)
{ {
if (wpa_auth->cb.set_key == NULL) 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) { switch (alg) {
case WPA_CIPHER_CCMP: case WPA_CIPHER_CCMP:
@ -1638,7 +1638,7 @@ SM_STATE(WPA_PTK, PTKINITDONE)
SM_ENTRY_MA(WPA_PTK, PTKINITDONE, wpa_ptk); SM_ENTRY_MA(WPA_PTK, PTKINITDONE, wpa_ptk);
sm->EAPOLKeyReceived = FALSE; sm->EAPOLKeyReceived = FALSE;
if (sm->Pair) { if (sm->Pair) {
wpa_alg alg; enum wpa_alg alg;
int klen; int klen;
if (sm->pairwise == WPA_CIPHER_TKIP) { if (sm->pairwise == WPA_CIPHER_TKIP) {
alg = WPA_ALG_TKIP; alg = WPA_ALG_TKIP;

View file

@ -184,8 +184,8 @@ struct wpa_auth_callbacks {
int (*get_eapol)(void *ctx, const u8 *addr, wpa_eapol_variable var); 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); 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 (*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 (*set_key)(void *ctx, int vlan_id, enum wpa_alg alg,
int idx, u8 *key, size_t key_len); const u8 *addr, int idx, u8 *key, size_t key_len);
int (*get_seqnum)(void *ctx, const u8 *addr, int idx, u8 *seq); int (*get_seqnum)(void *ctx, const u8 *addr, int idx, u8 *seq);
int (*send_eapol)(void *ctx, const u8 *addr, const u8 *data, int (*send_eapol)(void *ctx, const u8 *addr, const u8 *data,
size_t data_len, int encrypt); size_t data_len, int encrypt);

View file

@ -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, static inline int wpa_auth_set_key(struct wpa_authenticator *wpa_auth,
int vlan_id, 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) u8 *key, size_t key_len)
{ {
if (wpa_auth->cb.set_key == NULL) 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) static void wpa_ft_install_ptk(struct wpa_state_machine *sm)
{ {
wpa_alg alg; enum wpa_alg alg;
int klen; int klen;
/* MLME-SETKEYS.request(PTK) */ /* MLME-SETKEYS.request(PTK) */

View file

@ -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, const u8 *addr, int idx, u8 *key,
size_t key_len) size_t key_len)
{ {

View file

@ -79,16 +79,35 @@ static inline int wpa_key_mgmt_sha256(int akm)
#define WPA_AUTH_ALG_LEAP BIT(2) #define WPA_AUTH_ALG_LEAP BIT(2)
typedef enum { WPA_ALG_NONE, WPA_ALG_WEP, WPA_ALG_TKIP, WPA_ALG_CCMP, enum wpa_alg {
WPA_ALG_IGTK, WPA_ALG_PMK } wpa_alg; WPA_ALG_NONE,
typedef enum { CIPHER_NONE, CIPHER_WEP40, CIPHER_TKIP, CIPHER_CCMP, WPA_ALG_WEP,
CIPHER_WEP104 } wpa_cipher; WPA_ALG_TKIP,
typedef enum { KEY_MGMT_802_1X, KEY_MGMT_PSK, KEY_MGMT_NONE, WPA_ALG_CCMP,
KEY_MGMT_802_1X_NO_WPA, KEY_MGMT_WPA_NONE, WPA_ALG_IGTK,
KEY_MGMT_FT_802_1X, KEY_MGMT_FT_PSK, WPA_ALG_PMK
KEY_MGMT_802_1X_SHA256, KEY_MGMT_PSK_SHA256, };
KEY_MGMT_WPS
} wpa_key_mgmt; 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 * 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 * wrapper functions wpa_sm_get_state() and wpa_sm_set_state() should be used
* to access the state variable. * to access the state variable.
*/ */
typedef enum { enum wpa_states {
/** /**
* WPA_DISCONNECTED - Disconnected state * WPA_DISCONNECTED - Disconnected state
* *
@ -196,7 +215,7 @@ typedef enum {
* fully configured. * fully configured.
*/ */
WPA_COMPLETED WPA_COMPLETED
} wpa_states; };
#define MLME_SETPROTECTION_PROTECT_TYPE_NONE 0 #define MLME_SETPROTECTION_PROTECT_TYPE_NONE 0
#define MLME_SETPROTECTION_PROTECT_TYPE_RX 1 #define MLME_SETPROTECTION_PROTECT_TYPE_RX 1
@ -213,11 +232,11 @@ enum mfp_options {
IEEE80211W_REQUIRED = 2 IEEE80211W_REQUIRED = 2
}; };
typedef enum { enum hostapd_hw_mode {
HOSTAPD_MODE_IEEE80211B, HOSTAPD_MODE_IEEE80211B,
HOSTAPD_MODE_IEEE80211G, HOSTAPD_MODE_IEEE80211G,
HOSTAPD_MODE_IEEE80211A, HOSTAPD_MODE_IEEE80211A,
NUM_HOSTAPD_MODES NUM_HOSTAPD_MODES
} hostapd_hw_mode; };
#endif /* DEFS_H */ #endif /* DEFS_H */

View file

@ -32,7 +32,7 @@ struct hostapd_channel_data {
}; };
struct hostapd_hw_modes { struct hostapd_hw_modes {
hostapd_hw_mode mode; enum hostapd_hw_mode mode;
int num_channels; int num_channels;
struct hostapd_channel_data *channels; struct hostapd_channel_data *channels;
int num_rates; int num_rates;
@ -243,9 +243,9 @@ struct wpa_driver_associate_params {
/* The selected pairwise/group cipher and key management /* The selected pairwise/group cipher and key management
* suites. These are usually ignored if @wpa_ie is used. */ * suites. These are usually ignored if @wpa_ie is used. */
wpa_cipher pairwise_suite; enum wpa_cipher pairwise_suite;
wpa_cipher group_suite; enum wpa_cipher group_suite;
wpa_key_mgmt key_mgmt_suite; enum wpa_key_mgmt key_mgmt_suite;
/** /**
* auth_alg - Allowed authentication algorithms * 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 * in driver_*.c set_key() implementation, see driver_ndis.c for an
* example on how this can be done. * 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 *addr, int key_idx, int set_tx,
const u8 *seq, size_t seq_len, const u8 *seq, size_t seq_len,
const u8 *key, size_t key_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 * This function is only needed for drivers that export MLME
* (management frame processing) to wpa_supplicant. * (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); int freq);
/** /**

View file

@ -411,9 +411,9 @@ madwifi_del_key(void *priv, const u8 *addr, int key_idx)
} }
static int static int
madwifi_set_key(const char *ifname, void *priv, wpa_alg alg, const u8 *addr, madwifi_set_key(const char *ifname, void *priv, enum wpa_alg alg,
int key_idx, int set_tx, const u8 *seq, size_t seq_len, const u8 *addr, int key_idx, int set_tx, const u8 *seq,
const u8 *key, size_t key_len) size_t seq_len, const u8 *key, size_t key_len)
{ {
struct madwifi_driver_data *drv = priv; struct madwifi_driver_data *drv = priv;
struct ieee80211req_key wk; struct ieee80211req_key wk;

View file

@ -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, static int wpa_driver_atmel_set_key(const char *ifname, void *priv,
wpa_alg alg, const u8 *addr, int key_idx, enum wpa_alg alg, const u8 *addr,
int set_tx, const u8 *seq, size_t seq_len, int key_idx, int set_tx,
const u8 *seq, size_t seq_len,
const u8 *key, size_t key_len) const u8 *key, size_t key_len)
{ {
struct wpa_driver_atmel_data *drv = priv; struct wpa_driver_atmel_data *drv = priv;
@ -337,7 +338,7 @@ static int wpa_driver_atmel_disassociate(void *priv, const u8 *addr,
#if 0 #if 0
/* Atmel driver uses specific values for each cipher suite */ /* 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; u8 suite_type;

View file

@ -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, 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 *addr, int key_idx, int set_tx,
const u8 *seq, size_t seq_len, const u8 *seq, size_t seq_len,
const u8 *key, size_t key_len) const u8 *key, size_t key_len)

View file

@ -409,7 +409,7 @@ bsd_del_key(void *priv, const u8 *addr, int key_idx)
} }
static int 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, const u8 *addr, int key_idx, int set_tx, const u8 *seq,
size_t seq_len, const u8 *key, size_t key_len) 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 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 unsigned char *addr, int key_idx, int set_tx,
const u8 *seq, size_t seq_len, const u8 *seq, size_t seq_len,
const u8 *key, size_t key_len) const u8 *key, size_t key_len)

View file

@ -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, static int wpa_driver_hostap_set_key(const char *ifname, void *priv,
wpa_alg alg, const u8 *addr, int key_idx, enum wpa_alg alg, const u8 *addr,
int set_tx, const u8 *seq, size_t seq_len, int key_idx, int set_tx,
const u8 *seq, size_t seq_len,
const u8 *key, size_t key_len) const u8 *key, size_t key_len)
{ {
struct hostap_driver_data *drv = priv; 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, static int wpa_driver_hostap_set_key(const char *ifname, void *priv,
wpa_alg alg, const u8 *addr, int key_idx, enum wpa_alg alg, const u8 *addr,
int set_tx, const u8 *seq, size_t seq_len, int key_idx, int set_tx,
const u8 *seq, size_t seq_len,
const u8 *key, size_t key_len) const u8 *key, size_t key_len)
{ {
struct wpa_driver_hostap_data *drv = priv; struct wpa_driver_hostap_data *drv = priv;

View file

@ -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, static int wpa_driver_ipw_set_key(const char *ifname, void *priv,
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 *seq, size_t seq_len,
const u8 *key, size_t key_len) const u8 *key, size_t key_len)
{ {

View file

@ -456,7 +456,7 @@ madwifi_del_key(void *priv, const u8 *addr, int key_idx)
} }
static int 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 *addr, int key_idx, int set_tx,
const u8 *seq, size_t seq_len, const u8 *seq, size_t seq_len,
const u8 *key, size_t key_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 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 *addr, int key_idx, int set_tx,
const u8 *seq, size_t seq_len, const u8 *seq, size_t seq_len,
const u8 *key, size_t key_len) const u8 *key, size_t key_len)

View file

@ -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, static int wpa_driver_ndis_set_key(const char *ifname, void *priv,
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 *seq, size_t seq_len,
const u8 *key, size_t key_len) const u8 *key, size_t key_len)
{ {

View file

@ -33,9 +33,8 @@ struct wpa_driver_ndiswrapper_data {
}; };
struct wpa_key struct wpa_key {
{ enum wpa_alg alg;
wpa_alg alg;
const u8 *addr; const u8 *addr;
int key_index; int key_index;
int set_tx; int set_tx;
@ -45,17 +44,16 @@ struct wpa_key
size_t key_len; size_t key_len;
}; };
struct wpa_assoc_info struct wpa_assoc_info {
{
const u8 *bssid; const u8 *bssid;
const u8 *ssid; const u8 *ssid;
size_t ssid_len; size_t ssid_len;
int freq; int freq;
const u8 *wpa_ie; const u8 *wpa_ie;
size_t wpa_ie_len; size_t wpa_ie_len;
wpa_cipher pairwise_suite; enum wpa_cipher pairwise_suite;
wpa_cipher group_suite; enum wpa_cipher group_suite;
wpa_key_mgmt key_mgmt_suite; enum wpa_key_mgmt key_mgmt_suite;
int auth_alg; int auth_alg;
int mode; int mode;
}; };
@ -113,8 +111,9 @@ static int wpa_ndiswrapper_set_wpa(void *priv, int enabled)
return ret; return ret;
} }
static int wpa_ndiswrapper_set_key(const char *ifname, void *priv, wpa_alg alg, static int wpa_ndiswrapper_set_key(const char *ifname, void *priv,
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 *seq, size_t seq_len,
const u8 *key, size_t key_len) const u8 *key, size_t key_len)
{ {

View file

@ -1620,8 +1620,8 @@ nla_put_failure:
static int wpa_driver_nl80211_set_key(const char *ifname, void *priv, static int wpa_driver_nl80211_set_key(const char *ifname, void *priv,
wpa_alg alg, const u8 *addr, int key_idx, enum wpa_alg alg, const u8 *addr,
int set_tx, int key_idx, int set_tx,
const u8 *seq, size_t seq_len, const u8 *seq, size_t seq_len,
const u8 *key, size_t key_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, int key_idx, int defkey,
const u8 *seq, size_t seq_len, const u8 *seq, size_t seq_len,
const u8 *key, size_t key_len) const u8 *key, size_t key_len)

View file

@ -191,7 +191,7 @@ wpa_driver_privsep_get_scan_results2(void *priv)
static int wpa_driver_privsep_set_key(const char *ifname, 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, int key_idx, int set_tx,
const u8 *seq, size_t seq_len, const u8 *seq, size_t seq_len,
const u8 *key, size_t key_len) const u8 *key, size_t key_len)

View file

@ -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, 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, int key_idx, int set_tx,
const u8 *seq, size_t seq_len, const u8 *seq, size_t seq_len,
const u8 *key, size_t key_len) const u8 *key, size_t key_len)

View file

@ -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, static int wpa_driver_test_set_key(const char *ifname, void *priv,
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 *seq, size_t seq_len,
const u8 *key, size_t key_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) int chan, int freq)
{ {
wpa_printf(MSG_DEBUG, "%s: phymode=%d chan=%d freq=%d", wpa_printf(MSG_DEBUG, "%s: phymode=%d chan=%d freq=%d",

View file

@ -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, const u8 *addr, int key_idx,
int set_tx, const u8 *seq, int set_tx, const u8 *seq,
size_t seq_len, 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 * This function uses SIOCSIWENCODEEXT by default, but tries to use
* SIOCSIWENCODE if the extended ioctl fails when configuring a WEP key. * 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, const u8 *addr, int key_idx,
int set_tx, const u8 *seq, size_t seq_len, int set_tx, const u8 *seq, size_t seq_len,
const u8 *key, size_t key_len) const u8 *key, size_t key_len)

View file

@ -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_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_freq(void *priv, int freq);
int wpa_driver_wext_set_mode(void *priv, int mode); 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, const u8 *addr, int key_idx,
int set_tx, const u8 *seq, size_t seq_len, int set_tx, const u8 *seq, size_t seq_len,
const u8 *key, size_t key_len); const u8 *key, size_t key_len);

View file

@ -452,7 +452,7 @@ static int wpa_supplicant_install_ptk(struct wpa_sm *sm,
const struct wpa_eapol_key *key) const struct wpa_eapol_key *key)
{ {
int keylen, rsclen; int keylen, rsclen;
wpa_alg alg; enum wpa_alg alg;
const u8 *key_rsc; const u8 *key_rsc;
u8 null_rsc[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; 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, static int wpa_supplicant_check_group_cipher(int group_cipher,
int keylen, int maxkeylen, int keylen, int maxkeylen,
int *key_rsc_len, wpa_alg *alg) int *key_rsc_len,
enum wpa_alg *alg)
{ {
int ret = 0; int ret = 0;
@ -560,7 +561,7 @@ static int wpa_supplicant_check_group_cipher(int group_cipher,
struct wpa_gtk_data { struct wpa_gtk_data {
wpa_alg alg; enum wpa_alg alg;
int tx, key_rsc_len, keyidx; int tx, key_rsc_len, keyidx;
u8 gtk[32]; u8 gtk[32];
int gtk_len; int gtk_len;

View file

@ -27,11 +27,11 @@ struct wpa_sm_ctx {
void *ctx; /* pointer to arbitrary upper level context */ void *ctx; /* pointer to arbitrary upper level context */
void *msg_ctx; /* upper level context for wpa_msg() calls */ void *msg_ctx; /* upper level context for wpa_msg() calls */
void (*set_state)(void *ctx, wpa_states state); void (*set_state)(void *ctx, enum wpa_states state);
wpa_states (*get_state)(void *ctx); enum wpa_states (*get_state)(void *ctx);
void (*deauthenticate)(void * ctx, int reason_code); void (*deauthenticate)(void * ctx, int reason_code);
void (*disassociate)(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 *addr, int key_idx, int set_tx,
const u8 *seq, size_t seq_len, const u8 *seq, size_t seq_len,
const u8 *key, size_t key_len); const u8 *key, size_t key_len);

View file

@ -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) static int wpa_ft_install_ptk(struct wpa_sm *sm, const u8 *bssid)
{ {
int keylen; int keylen;
wpa_alg alg; enum wpa_alg alg;
u8 null_rsc[6] = { 0, 0, 0, 0, 0, 0 }; u8 null_rsc[6] = { 0, 0, 0, 0, 0, 0 };
wpa_printf(MSG_DEBUG, "FT: Installing PTK to the driver."); 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]; u8 gtk[32];
int keyidx; int keyidx;
wpa_alg alg; enum wpa_alg alg;
size_t gtk_len, keylen, rsc_len; size_t gtk_len, keylen, rsc_len;
if (gtk_elem == NULL) { if (gtk_elem == NULL) {

View file

@ -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); WPA_ASSERT(sm->ctx->set_state);
sm->ctx->set_state(sm->ctx->ctx, 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); WPA_ASSERT(sm->ctx->get_state);
return sm->ctx->get_state(sm->ctx->ctx); 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); 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 *addr, int key_idx, int set_tx,
const u8 *seq, size_t seq_len, const u8 *seq, size_t seq_len,
const u8 *key, size_t key_len) const u8 *key, size_t key_len)

View file

@ -683,8 +683,8 @@ void wpa_supplicant_dbus_notify_scan_results(struct wpa_supplicant *wpa_s)
* Notify listeners that wpa_supplicant has changed state * Notify listeners that wpa_supplicant has changed state
*/ */
void wpa_supplicant_dbus_notify_state_change(struct wpa_supplicant *wpa_s, void wpa_supplicant_dbus_notify_state_change(struct wpa_supplicant *wpa_s,
wpa_states new_state, enum wpa_states new_state,
wpa_states old_state) enum wpa_states old_state)
{ {
struct ctrl_iface_dbus_priv *iface; struct ctrl_iface_dbus_priv *iface;
DBusMessage *_signal = NULL; DBusMessage *_signal = NULL;

View file

@ -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_scan_results(struct wpa_supplicant *wpa_s);
void wpa_supplicant_dbus_notify_scanning(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, void wpa_supplicant_dbus_notify_state_change(struct wpa_supplicant *wpa_s,
wpa_states new_state, enum wpa_states new_state,
wpa_states old_state); enum wpa_states old_state);
void wpa_supplicant_dbus_notify_wps_cred(struct wpa_supplicant *wpa_s, void wpa_supplicant_dbus_notify_wps_cred(struct wpa_supplicant *wpa_s,
const struct wps_credential *cred); const struct wps_credential *cred);
@ -141,8 +141,8 @@ wpa_supplicant_dbus_notify_scanning(struct wpa_supplicant *wpa_s)
static inline void static inline void
wpa_supplicant_dbus_notify_state_change(struct wpa_supplicant *wpa_s, wpa_supplicant_dbus_notify_state_change(struct wpa_supplicant *wpa_s,
wpa_states new_state, enum wpa_states new_state,
wpa_states old_state) enum wpa_states old_state)
{ {
} }

View file

@ -423,8 +423,8 @@ static void wpas_dbus_signal_network_selected(struct wpa_supplicant *wpa_s,
* Notify listeners that wpa_supplicant has changed state * Notify listeners that wpa_supplicant has changed state
*/ */
static void wpas_dbus_signal_state_changed(struct wpa_supplicant *wpa_s, static void wpas_dbus_signal_state_changed(struct wpa_supplicant *wpa_s,
wpa_states new_state, enum wpa_states new_state,
wpa_states old_state) enum wpa_states old_state)
{ {
struct ctrl_iface_dbus_new_priv *iface; struct ctrl_iface_dbus_new_priv *iface;
DBusMessage *_signal = NULL; DBusMessage *_signal = NULL;

View file

@ -52,8 +52,8 @@ struct wpas_dbus_callbacks {
void (*signal_network_selected)(struct wpa_supplicant *wpa_s, int id); void (*signal_network_selected)(struct wpa_supplicant *wpa_s, int id);
void (*signal_state_changed)(struct wpa_supplicant *wpa_s, void (*signal_state_changed)(struct wpa_supplicant *wpa_s,
wpa_states new_state, enum wpa_states new_state,
wpa_states old_state); enum wpa_states old_state);
int (*register_network)(struct wpa_supplicant *wpa_s, int (*register_network)(struct wpa_supplicant *wpa_s,
struct wpa_ssid *ssid); struct wpa_ssid *ssid);

View file

@ -103,8 +103,9 @@ static inline int wpa_drv_get_ssid(struct wpa_supplicant *wpa_s, u8 *ssid)
return -1; return -1;
} }
static inline int wpa_drv_set_key(struct wpa_supplicant *wpa_s, wpa_alg alg, static inline int wpa_drv_set_key(struct wpa_supplicant *wpa_s,
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 *seq, size_t seq_len,
const u8 *key, size_t key_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, 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) int freq)
{ {
if (wpa_s->driver->set_channel) if (wpa_s->driver->set_channel)

View file

@ -18,7 +18,7 @@
#include "l2_packet/l2_packet.h" #include "l2_packet/l2_packet.h"
#include "rsn_supp/wpa.h" #include "rsn_supp/wpa.h"
#include "rsn_supp/wpa_ie.h" #include "rsn_supp/wpa_ie.h"
#include "ap/wpa.h" #include "ap/wpa_auth.h"
#include "wpa_supplicant_i.h" #include "wpa_supplicant_i.h"
#include "driver_i.h" #include "driver_i.h"
#include "ibss_rsn.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; struct ibss_rsn_peer *peer = ctx;
peer->supp_state = state; 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 *addr, int key_idx, int set_tx,
const u8 *seq, size_t seq_len, const u8 *seq, size_t seq_len,
const u8 *key, size_t key_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, static int auth_set_key(void *ctx, int vlan_id, enum wpa_alg alg,
int idx, u8 *key, size_t key_len) const u8 *addr, int idx, u8 *key, size_t key_len)
{ {
struct ibss_rsn *ibss_rsn = ctx; struct ibss_rsn *ibss_rsn = ctx;
u8 seq[6]; u8 seq[6];

View file

@ -24,7 +24,7 @@ struct ibss_rsn_peer {
u8 addr[ETH_ALEN]; u8 addr[ETH_ALEN];
struct wpa_sm *supp; struct wpa_sm *supp;
wpa_states supp_state; enum wpa_states supp_state;
u8 supp_ie[80]; u8 supp_ie[80];
size_t supp_ie_len; size_t supp_ie_len;

View file

@ -99,7 +99,7 @@ static void ieee80211_build_tspec(struct wpabuf *buf);
static int ieee80211_sta_set_channel(struct wpa_supplicant *wpa_s, 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) int freq)
{ {
size_t i; size_t i;

View file

@ -85,7 +85,8 @@ void wpas_notify_iface_removed(struct wpa_supplicant *wpa_s)
void wpas_notify_state_changed(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(); struct wpas_dbus_callbacks *cbs = wpas_dbus_get_callbacks();

View file

@ -24,7 +24,8 @@ void wpas_notify_supplicant_deinitialized(struct wpa_global *global);
int wpas_notify_iface_added(struct wpa_supplicant *wpa_s); int wpas_notify_iface_added(struct wpa_supplicant *wpa_s);
void wpas_notify_iface_removed(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, 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_network_changed(struct wpa_supplicant *wpa_s);
void wpas_notify_ap_scan_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); void wpas_notify_bssid_changed(struct wpa_supplicant *wpa_s);

View file

@ -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; struct wpa_supplicant *wpa_s = ctx;
wpa_s->wpa_state = state; 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; struct wpa_supplicant *wpa_s = ctx;
return wpa_s->wpa_state; 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 *addr, int key_idx, int set_tx,
const u8 *seq, size_t seq_len, const u8 *seq, size_t seq_len,
const u8 *key, size_t key_len) const u8 *key, size_t key_len)

View file

@ -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); 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 *addr, int key_idx, int set_tx,
const u8 *seq, size_t seq_len, const u8 *seq, size_t seq_len,
const u8 *key, size_t key_len) const u8 *key, size_t key_len)

View file

@ -143,7 +143,7 @@ static int wpa_supplicant_set_wpa_none_key(struct wpa_supplicant *wpa_s,
{ {
u8 key[32]; u8 key[32];
size_t keylen; size_t keylen;
wpa_alg alg; enum wpa_alg alg;
u8 seq[6] = { 0 }; u8 seq[6] = { 0 };
/* IBSS/WPA-None uses only one key (Group) for both receiving and /* 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_*) * @state: State (wpa_state; WPA_*)
* Returns: The state name as a printable text string * 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) { switch (state) {
case WPA_DISCONNECTED: 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., * This function is called whenever the connection state changes, e.g.,
* association is completed for WPA/WPA2 4-Way Handshake is started. * 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_printf(MSG_DEBUG, "State: %s -> %s",
wpa_supplicant_state_txt(wpa_s->wpa_state), 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) 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->pairwise_cipher = 0;
wpa_s->group_cipher = 0; wpa_s->group_cipher = 0;
wpa_s->mgmt_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) { switch (cipher) {
case WPA_CIPHER_NONE: 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) { switch (key_mgmt) {
case WPA_KEY_MGMT_NONE: case WPA_KEY_MGMT_NONE:
@ -980,7 +981,7 @@ void wpa_supplicant_associate(struct wpa_supplicant *wpa_s,
size_t wpa_ie_len; size_t wpa_ie_len;
int use_crypt, ret, i, bssid_changed; int use_crypt, ret, i, bssid_changed;
int algs = AUTH_ALG_OPEN_SYSTEM; 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; struct wpa_driver_associate_params params;
int wep_keys_set = 0; int wep_keys_set = 0;
struct wpa_driver_capa capa; struct wpa_driver_capa capa;

View file

@ -215,7 +215,7 @@ struct wpa_client_mlme {
size_t extra_ie_len; size_t extra_ie_len;
u8 *extra_probe_ie; /* to be added to the end of ProbeReq */ u8 *extra_probe_ie; /* to be added to the end of ProbeReq */
size_t extra_probe_ie_len; size_t extra_probe_ie_len;
wpa_key_mgmt key_mgmt; enum wpa_key_mgmt key_mgmt;
/* The last AssocReq/Resp IEs */ /* The last AssocReq/Resp IEs */
u8 *assocreq_ies, *assocresp_ies; u8 *assocreq_ies, *assocresp_ies;
@ -269,7 +269,7 @@ struct wpa_client_mlme {
int cts_protect_erp_frames; int cts_protect_erp_frames;
hostapd_hw_mode phymode; /* current mode */ enum hostapd_hw_mode phymode; /* current mode */
struct hostapd_hw_modes *modes; struct hostapd_hw_modes *modes;
size_t num_modes; size_t num_modes;
unsigned int hw_modes; /* bitfield of allowed hardware modes; unsigned int hw_modes; /* bitfield of allowed hardware modes;
@ -353,7 +353,7 @@ struct wpa_supplicant {
struct ctrl_iface_priv *ctrl_iface; struct ctrl_iface_priv *ctrl_iface;
wpa_states wpa_state; enum wpa_states wpa_state;
int scanning; int scanning;
int new_connection; int new_connection;
int reassociated_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); 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_driver_init(struct wpa_supplicant *wpa_s);
int wpa_supplicant_set_suites(struct wpa_supplicant *wpa_s, int wpa_supplicant_set_suites(struct wpa_supplicant *wpa_s,
struct wpa_scan_res *bss, 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_clear_keys(struct wpa_supplicant *wpa_s, const u8 *addr);
void wpa_supplicant_req_auth_timeout(struct wpa_supplicant *wpa_s, void wpa_supplicant_req_auth_timeout(struct wpa_supplicant *wpa_s,
int sec, int usec); 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); 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_cancel_auth_timeout(struct wpa_supplicant *wpa_s);
void wpa_supplicant_deauthenticate(struct wpa_supplicant *wpa_s, void wpa_supplicant_deauthenticate(struct wpa_supplicant *wpa_s,

View file

@ -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); 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 * @wpa_s: Pointer to wpa_supplicant data
* Returns: The current connection state (WPA_*) * 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; 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); 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 *addr, int key_idx, int set_tx,
const u8 *seq, size_t seq_len, const u8 *seq, size_t seq_len,
const u8 *key, size_t key_len) const u8 *key, size_t key_len)