summaryrefslogtreecommitdiffstats
path: root/contrib/hostapd/eap.h
diff options
context:
space:
mode:
authorsam <sam@FreeBSD.org>2005-06-05 22:35:03 +0000
committersam <sam@FreeBSD.org>2005-06-05 22:35:03 +0000
commit21e78f430e299464b3c902bec78f8daa1f0e2e71 (patch)
treea7d225a062cd128980707f3fa918dec2d015c46b /contrib/hostapd/eap.h
downloadFreeBSD-src-21e78f430e299464b3c902bec78f8daa1f0e2e71.zip
FreeBSD-src-21e78f430e299464b3c902bec78f8daa1f0e2e71.tar.gz
Stripped down import of hostapd v0.3.7
Diffstat (limited to 'contrib/hostapd/eap.h')
-rw-r--r--contrib/hostapd/eap.h83
1 files changed, 83 insertions, 0 deletions
diff --git a/contrib/hostapd/eap.h b/contrib/hostapd/eap.h
new file mode 100644
index 0000000..01f47da
--- /dev/null
+++ b/contrib/hostapd/eap.h
@@ -0,0 +1,83 @@
+#ifndef EAP_H
+#define EAP_H
+
+#include "defs.h"
+#include "eap_defs.h"
+
+struct eap_sm;
+
+#define EAP_MAX_METHODS 8
+struct eap_user {
+ u8 methods[EAP_MAX_METHODS];
+ u8 *password;
+ size_t password_len;
+ int phase2;
+ int force_version;
+};
+
+enum eapol_bool_var {
+ EAPOL_eapSuccess, EAPOL_eapRestart, EAPOL_eapFail, EAPOL_eapResp,
+ EAPOL_eapReq, EAPOL_eapNoReq, EAPOL_portEnabled, EAPOL_eapTimeout
+};
+
+struct eapol_callbacks {
+ Boolean (*get_bool)(void *ctx, enum eapol_bool_var variable);
+ void (*set_bool)(void *ctx, enum eapol_bool_var variable,
+ Boolean value);
+ void (*set_eapReqData)(void *ctx, const u8 *eapReqData,
+ size_t eapReqDataLen);
+ void (*set_eapKeyData)(void *ctx, const u8 *eapKeyData,
+ size_t eapKeyDataLen);
+ int (*get_eap_user)(void *ctx, const u8 *identity, size_t identity_len,
+ int phase2, struct eap_user *user);
+};
+
+struct eap_config {
+ void *ssl_ctx;
+ void *eap_sim_db_priv;
+ Boolean backend_auth;
+};
+
+
+#ifdef EAP_AUTHENTICATOR
+
+struct eap_sm * eap_sm_init(void *eapol_ctx, struct eapol_callbacks *eapol_cb,
+ struct eap_config *eap_conf);
+void eap_sm_deinit(struct eap_sm *sm);
+int eap_sm_step(struct eap_sm *sm);
+u8 eap_get_type(const char *name);
+void eap_set_eapRespData(struct eap_sm *sm, const u8 *eapRespData,
+ size_t eapRespDataLen);
+
+#else /* EAP_AUTHENTICATOR */
+
+static inline struct eap_sm * eap_sm_init(void *eapol_ctx,
+ struct eapol_callbacks *eapol_cb,
+ struct eap_config *eap_conf)
+{
+ return NULL;
+}
+
+static inline void eap_sm_deinit(struct eap_sm *sm)
+{
+}
+
+static inline int eap_sm_step(struct eap_sm *sm)
+{
+ return 0;
+}
+
+static inline u8 eap_get_type(const char *name)
+{
+ return EAP_TYPE_NONE;
+}
+
+static inline void eap_set_eapRespData(struct eap_sm *sm,
+ const u8 *eapRespData,
+ size_t eapRespDataLen)
+{
+}
+
+#endif /* EAP_AUTHENTICATOR */
+
+#endif /* EAP_H */
OpenPOWER on IntegriCloud