Add resident.conf(5) and varsym.conf(5) manual pages.
[dragonfly/vkernel-mp.git] / contrib / hostapd-0.4.9 / eap.h
blobc5c62eb57c729f55ae4f185e4e6064192804447a
1 #ifndef EAP_H
2 #define EAP_H
4 #include "defs.h"
5 #include "eap_defs.h"
7 struct eap_sm;
9 #define EAP_MAX_METHODS 8
10 struct eap_user {
11 u8 methods[EAP_MAX_METHODS];
12 u8 *password;
13 size_t password_len;
14 int phase2;
15 int force_version;
18 enum eapol_bool_var {
19 EAPOL_eapSuccess, EAPOL_eapRestart, EAPOL_eapFail, EAPOL_eapResp,
20 EAPOL_eapReq, EAPOL_eapNoReq, EAPOL_portEnabled, EAPOL_eapTimeout
23 struct eapol_callbacks {
24 Boolean (*get_bool)(void *ctx, enum eapol_bool_var variable);
25 void (*set_bool)(void *ctx, enum eapol_bool_var variable,
26 Boolean value);
27 void (*set_eapReqData)(void *ctx, const u8 *eapReqData,
28 size_t eapReqDataLen);
29 void (*set_eapKeyData)(void *ctx, const u8 *eapKeyData,
30 size_t eapKeyDataLen);
31 int (*get_eap_user)(void *ctx, const u8 *identity, size_t identity_len,
32 int phase2, struct eap_user *user);
33 const char * (*get_eap_req_id_text)(void *ctx, size_t *len);
36 struct eap_config {
37 void *ssl_ctx;
38 void *eap_sim_db_priv;
39 Boolean backend_auth;
43 #ifdef EAP_SERVER
45 struct eap_sm * eap_sm_init(void *eapol_ctx, struct eapol_callbacks *eapol_cb,
46 struct eap_config *eap_conf);
47 void eap_sm_deinit(struct eap_sm *sm);
48 int eap_sm_step(struct eap_sm *sm);
49 u8 eap_get_type(const char *name);
50 void eap_set_eapRespData(struct eap_sm *sm, const u8 *eapRespData,
51 size_t eapRespDataLen);
52 void eap_sm_notify_cached(struct eap_sm *sm);
54 #else /* EAP_SERVER */
56 static inline struct eap_sm * eap_sm_init(void *eapol_ctx,
57 struct eapol_callbacks *eapol_cb,
58 struct eap_config *eap_conf)
60 return NULL;
63 static inline void eap_sm_deinit(struct eap_sm *sm)
67 static inline int eap_sm_step(struct eap_sm *sm)
69 return 0;
72 static inline u8 eap_get_type(const char *name)
74 return EAP_TYPE_NONE;
77 static inline void eap_set_eapRespData(struct eap_sm *sm,
78 const u8 *eapRespData,
79 size_t eapRespDataLen)
83 static inline void eap_sm_notify_cached(struct eap_sm *sm)
87 #endif /* EAP_SERVER */
89 #endif /* EAP_H */