aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant
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 /wpa_supplicant
parent81f4f6195ecaf4d8c24f178183c7f6237ef0073c (diff)
downloadhostap-719347511ad6a9b4d7ef6f1459cb08597900cbc9.zip
hostap-719347511ad6a9b4d7ef6f1459cb08597900cbc9.tar.gz
hostap-719347511ad6a9b4d7ef6f1459cb08597900cbc9.tar.bz2
Get rid of unnecessary typedefs for enums.
Diffstat (limited to 'wpa_supplicant')
-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
15 files changed, 48 insertions, 43 deletions
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)