aboutsummaryrefslogtreecommitdiffstats
path: root/src/eap_peer/eap_methods.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2019-08-17 08:36:20 (GMT)
committerJouni Malinen <j@w1.fi>2019-08-17 08:36:20 (GMT)
commit5f2301a6da95bb88edc56db9871fff0cf5edffc9 (patch)
treed87b3f0be212faf925c10e2e27e124e3a910b2ba /src/eap_peer/eap_methods.c
parent542913943e6a2cfae1b301aedc1e7980b5032911 (diff)
downloadhostap-5f2301a6da95bb88edc56db9871fff0cf5edffc9.zip
hostap-5f2301a6da95bb88edc56db9871fff0cf5edffc9.tar.gz
hostap-5f2301a6da95bb88edc56db9871fff0cf5edffc9.tar.bz2
Replace EapType typedef with enum eap_type
This cleans up coding style of the EAP implementation by avoiding typedef of an enum hiding the type of the variables. Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'src/eap_peer/eap_methods.c')
-rw-r--r--src/eap_peer/eap_methods.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/eap_peer/eap_methods.c b/src/eap_peer/eap_methods.c
index 9747954..f2d2947 100644
--- a/src/eap_peer/eap_methods.c
+++ b/src/eap_peer/eap_methods.c
@@ -27,7 +27,8 @@ static void eap_peer_method_free(struct eap_method *method);
* @method: EAP type number
* Returns: Pointer to EAP method or %NULL if not found
*/
-const struct eap_method * eap_peer_get_eap_method(int vendor, EapType method)
+const struct eap_method * eap_peer_get_eap_method(int vendor,
+ enum eap_type method)
{
struct eap_method *m;
for (m = eap_methods; m; m = m->next) {
@@ -47,7 +48,7 @@ const struct eap_method * eap_peer_get_eap_method(int vendor, EapType method)
* This function maps EAP type names into EAP type numbers based on the list of
* EAP methods included in the build.
*/
-EapType eap_peer_get_type(const char *name, int *vendor)
+enum eap_type eap_peer_get_type(const char *name, int *vendor)
{
struct eap_method *m;
for (m = eap_methods; m; m = m->next) {
@@ -70,7 +71,7 @@ EapType eap_peer_get_type(const char *name, int *vendor)
* This function maps EAP type numbers into EAP type names based on the list of
* EAP methods included in the build.
*/
-const char * eap_get_name(int vendor, EapType type)
+const char * eap_get_name(int vendor, enum eap_type type)
{
struct eap_method *m;
if (vendor == EAP_VENDOR_IETF && type == EAP_TYPE_EXPANDED)
@@ -169,7 +170,7 @@ const struct eap_method * eap_peer_get_methods(size_t *count)
for (m = eap_methods; m; m = m->next)
c++;
-
+
*count = c;
return eap_methods;
}
@@ -279,7 +280,8 @@ int eap_peer_method_unload(struct eap_method *method)
* is not needed anymore.
*/
struct eap_method * eap_peer_method_alloc(int version, int vendor,
- EapType method, const char *name)
+ enum eap_type method,
+ const char *name)
{
struct eap_method *eap;
eap = os_zalloc(sizeof(*eap));