4 * hostapd / EAP Standalone Authenticator state machine (RFC 4137)
5 * Copyright (c) 2004-2005, Jouni Malinen <j@w1.fi>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
11 * Alternatively, this software may be distributed under the terms of BSD
14 * See README and COPYING for more details.
22 #include "eap_methods.h"
26 #define EAP_MAX_METHODS 8
31 } methods[EAP_MAX_METHODS];
34 int password_hash; /* whether password is hashed with
35 * nt_password_hash() */
41 EAPOL_eapSuccess, EAPOL_eapRestart, EAPOL_eapFail, EAPOL_eapResp,
42 EAPOL_eapReq, EAPOL_eapNoReq, EAPOL_portEnabled, EAPOL_eapTimeout
45 struct eapol_callbacks {
46 Boolean (*get_bool)(void *ctx, enum eapol_bool_var variable);
47 void (*set_bool)(void *ctx, enum eapol_bool_var variable,
49 void (*set_eapReqData)(void *ctx, const u8 *eapReqData,
50 size_t eapReqDataLen);
51 void (*set_eapKeyData)(void *ctx, const u8 *eapKeyData,
52 size_t eapKeyDataLen);
53 int (*get_eap_user)(void *ctx, const u8 *identity, size_t identity_len,
54 int phase2, struct eap_user *user);
55 const char * (*get_eap_req_id_text)(void *ctx, size_t *len);
60 void *eap_sim_db_priv;
67 struct eap_sm * eap_sm_init(void *eapol_ctx, struct eapol_callbacks *eapol_cb,
68 struct eap_config *eap_conf);
69 void eap_sm_deinit(struct eap_sm *sm);
70 int eap_sm_step(struct eap_sm *sm);
71 void eap_set_eapRespData(struct eap_sm *sm, const u8 *eapRespData,
72 size_t eapRespDataLen);
73 void eap_sm_notify_cached(struct eap_sm *sm);
74 void eap_sm_pending_cb(struct eap_sm *sm);
75 int eap_sm_method_pending(struct eap_sm *sm);
77 #else /* EAP_SERVER */
79 static inline struct eap_sm * eap_sm_init(void *eapol_ctx,
80 struct eapol_callbacks *eapol_cb,
81 struct eap_config *eap_conf)
86 static inline void eap_sm_deinit(struct eap_sm *sm)
90 static inline int eap_sm_step(struct eap_sm *sm)
96 static inline void eap_set_eapRespData(struct eap_sm *sm,
97 const u8 *eapRespData,
98 size_t eapRespDataLen)
102 static inline void eap_sm_notify_cached(struct eap_sm *sm)
106 static inline void eap_sm_pending_cb(struct eap_sm *sm)
110 static inline int eap_sm_method_pending(struct eap_sm *sm)
115 #endif /* EAP_SERVER */