NFE - Change default RX ring size from 128 -> 256, Adjust moderation timer.
[dragonfly.git] / contrib / hostapd-0.5.8 / eap.h
blob137719189dfa8916806930342b1a34baa2eb5478
1 /*
2 * hostapd / EAP Standalone Authenticator state machine (RFC 4137)
3 * Copyright (c) 2004-2005, 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
10 * license.
12 * See README and COPYING for more details.
15 #ifndef EAP_H
16 #define EAP_H
18 #include "defs.h"
19 #include "eap_defs.h"
20 #include "eap_methods.h"
22 struct eap_sm;
24 #define EAP_MAX_METHODS 8
25 struct eap_user {
26 struct {
27 int vendor;
28 u32 method;
29 } methods[EAP_MAX_METHODS];
30 u8 *password;
31 size_t password_len;
32 int password_hash; /* whether password is hashed with
33 * nt_password_hash() */
34 int phase2;
35 int force_version;
38 enum eapol_bool_var {
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,
46 Boolean value);
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);
56 struct eap_config {
57 void *ssl_ctx;
58 void *eap_sim_db_priv;
59 Boolean backend_auth;
63 #ifdef EAP_SERVER
65 struct eap_sm * eap_sm_init(void *eapol_ctx, struct eapol_callbacks *eapol_cb,
66 struct eap_config *eap_conf);
67 void eap_sm_deinit(struct eap_sm *sm);
68 int eap_sm_step(struct eap_sm *sm);
69 void eap_set_eapRespData(struct eap_sm *sm, const u8 *eapRespData,
70 size_t eapRespDataLen);
71 void eap_sm_notify_cached(struct eap_sm *sm);
72 void eap_sm_pending_cb(struct eap_sm *sm);
73 int eap_sm_method_pending(struct eap_sm *sm);
75 #else /* EAP_SERVER */
77 static inline struct eap_sm * eap_sm_init(void *eapol_ctx,
78 struct eapol_callbacks *eapol_cb,
79 struct eap_config *eap_conf)
81 return NULL;
84 static inline void eap_sm_deinit(struct eap_sm *sm)
88 static inline int eap_sm_step(struct eap_sm *sm)
90 return 0;
94 static inline void eap_set_eapRespData(struct eap_sm *sm,
95 const u8 *eapRespData,
96 size_t eapRespDataLen)
100 static inline void eap_sm_notify_cached(struct eap_sm *sm)
104 static inline void eap_sm_pending_cb(struct eap_sm *sm)
108 static inline int eap_sm_method_pending(struct eap_sm *sm)
110 return 0;
113 #endif /* EAP_SERVER */
115 #endif /* EAP_H */