2
* hostapd / EAP Standalone Authenticator state machine (RFC 4137)
3
* Copyright (c) 2004-2007, Jouni Malinen <j@w1.fi>
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License version 2 as
7
* published by the Free Software Foundation.
9
* Alternatively, this software may be distributed under the terms of BSD
12
* See README and COPYING for more details.
19
#include "eap_common/eap_defs.h"
20
#include "eap_server/eap_methods.h"
24
#define EAP_MAX_METHODS 8
29
} methods[EAP_MAX_METHODS];
32
int password_hash; /* whether password is hashed with
33
* nt_password_hash() */
39
EAPOL_eapSuccess, EAPOL_eapRestart, EAPOL_eapFail, EAPOL_eapResp,
40
EAPOL_eapReq, EAPOL_eapNoReq, EAPOL_portEnabled, EAPOL_eapTimeout
43
struct eapol_callbacks {
44
Boolean (*get_bool)(void *ctx, enum eapol_bool_var variable);
45
void (*set_bool)(void *ctx, enum eapol_bool_var variable,
47
void (*set_eapReqData)(void *ctx, const u8 *eapReqData,
48
size_t eapReqDataLen);
49
void (*set_eapKeyData)(void *ctx, const u8 *eapKeyData,
50
size_t eapKeyDataLen);
51
int (*get_eap_user)(void *ctx, const u8 *identity, size_t identity_len,
52
int phase2, struct eap_user *user);
53
const char * (*get_eap_req_id_text)(void *ctx, size_t *len);
58
void *eap_sim_db_priv;
65
struct eap_sm * eap_server_sm_init(void *eapol_ctx,
66
struct eapol_callbacks *eapol_cb,
67
struct eap_config *eap_conf);
68
void eap_server_sm_deinit(struct eap_sm *sm);
69
int eap_server_sm_step(struct eap_sm *sm);
70
void eap_set_eapRespData(struct eap_sm *sm, const u8 *eapRespData,
71
size_t eapRespDataLen);
72
void eap_sm_notify_cached(struct eap_sm *sm);
73
void eap_sm_pending_cb(struct eap_sm *sm);
74
int eap_sm_method_pending(struct eap_sm *sm);
76
#else /* EAP_SERVER */
78
static inline struct eap_sm *
79
eap_server_sm_init(void *eapol_ctx,
80
struct eapol_callbacks *eapol_cb,
81
struct eap_config *eap_conf)
86
static inline void eap_server_sm_deinit(struct eap_sm *sm)
90
static inline int eap_server_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 */