aboutsummaryrefslogtreecommitdiffstats
path: root/src/eap_common
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_common
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_common')
-rw-r--r--src/eap_common/eap_common.c8
-rw-r--r--src/eap_common/eap_common.h8
-rw-r--r--src/eap_common/eap_defs.h4
3 files changed, 10 insertions, 10 deletions
diff --git a/src/eap_common/eap_common.c b/src/eap_common/eap_common.c
index 51a15d7..e27b965 100644
--- a/src/eap_common/eap_common.c
+++ b/src/eap_common/eap_common.c
@@ -63,7 +63,7 @@ int eap_hdr_len_valid(const struct wpabuf *msg, size_t min_payload)
* the payload regardless of whether the packet used the expanded EAP header or
* not.
*/
-const u8 * eap_hdr_validate(int vendor, EapType eap_type,
+const u8 * eap_hdr_validate(int vendor, enum eap_type eap_type,
const struct wpabuf *msg, size_t *plen)
{
const struct eap_hdr *hdr;
@@ -125,8 +125,8 @@ const u8 * eap_hdr_validate(int vendor, EapType eap_type,
* function to allocate the message buffers. The returned buffer has room for
* payload_len bytes and has the EAP header and Type field already filled in.
*/
-struct wpabuf * eap_msg_alloc(int vendor, EapType type, size_t payload_len,
- u8 code, u8 identifier)
+struct wpabuf * eap_msg_alloc(int vendor, enum eap_type type,
+ size_t payload_len, u8 code, u8 identifier)
{
struct wpabuf *buf;
struct eap_hdr *hdr;
@@ -196,7 +196,7 @@ u8 eap_get_id(const struct wpabuf *msg)
* @msg: Buffer starting with an EAP header
* Returns: The EAP Type after the EAP header
*/
-EapType eap_get_type(const struct wpabuf *msg)
+enum eap_type eap_get_type(const struct wpabuf *msg)
{
if (wpabuf_len(msg) < sizeof(struct eap_hdr) + 1)
return EAP_TYPE_NONE;
diff --git a/src/eap_common/eap_common.h b/src/eap_common/eap_common.h
index e62f167..e40cabe 100644
--- a/src/eap_common/eap_common.h
+++ b/src/eap_common/eap_common.h
@@ -20,13 +20,13 @@ struct erp_tlvs {
};
int eap_hdr_len_valid(const struct wpabuf *msg, size_t min_payload);
-const u8 * eap_hdr_validate(int vendor, EapType eap_type,
+const u8 * eap_hdr_validate(int vendor, enum eap_type eap_type,
const struct wpabuf *msg, size_t *plen);
-struct wpabuf * eap_msg_alloc(int vendor, EapType type, size_t payload_len,
- u8 code, u8 identifier);
+struct wpabuf * eap_msg_alloc(int vendor, enum eap_type type,
+ size_t payload_len, u8 code, u8 identifier);
void eap_update_len(struct wpabuf *msg);
u8 eap_get_id(const struct wpabuf *msg);
-EapType eap_get_type(const struct wpabuf *msg);
+enum eap_type eap_get_type(const struct wpabuf *msg);
int erp_parse_tlvs(const u8 *pos, const u8 *end, struct erp_tlvs *tlvs,
int stop_at_keyname);
diff --git a/src/eap_common/eap_defs.h b/src/eap_common/eap_defs.h
index bc3047c..70999c4 100644
--- a/src/eap_common/eap_defs.h
+++ b/src/eap_common/eap_defs.h
@@ -64,7 +64,7 @@ enum eap_erp_cryptosuite {
* EAP Method Types as allocated by IANA:
* http://www.iana.org/assignments/eap-numbers
*/
-typedef enum {
+enum eap_type {
EAP_TYPE_NONE = 0,
EAP_TYPE_IDENTITY = 1 /* RFC 3748 */,
EAP_TYPE_NOTIFICATION = 2 /* RFC 3748 */,
@@ -94,7 +94,7 @@ typedef enum {
EAP_TYPE_EKE = 53 /* RFC 6124 */,
EAP_TYPE_TEAP = 55 /* RFC 7170 */,
EAP_TYPE_EXPANDED = 254 /* RFC 3748 */
-} EapType;
+};
/* SMI Network Management Private Enterprise Code for vendor specific types */