]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/wpa_supplicant/eap.h
This commit was generated by cvs2svn to compensate for changes in r156283,
[FreeBSD/FreeBSD.git] / contrib / wpa_supplicant / eap.h
1 #ifndef EAP_H
2 #define EAP_H
3
4 #include "defs.h"
5 #include "eap_defs.h"
6
7 struct eap_sm;
8 struct wpa_ssid;
9
10
11 #ifdef IEEE8021X_EAPOL
12
13 enum eapol_bool_var {
14         EAPOL_eapSuccess, EAPOL_eapRestart, EAPOL_eapFail, EAPOL_eapResp,
15         EAPOL_eapNoResp, EAPOL_eapReq, EAPOL_portEnabled, EAPOL_altAccept,
16         EAPOL_altReject
17 };
18
19 enum eapol_int_var {
20         EAPOL_idleWhile
21 };
22
23 struct eapol_callbacks {
24         struct wpa_ssid * (*get_config)(void *ctx);
25         Boolean (*get_bool)(void *ctx, enum eapol_bool_var variable);
26         void (*set_bool)(void *ctx, enum eapol_bool_var variable,
27                          Boolean value);
28         unsigned int (*get_int)(void *ctx, enum eapol_int_var variable);
29         void (*set_int)(void *ctx, enum eapol_int_var variable,
30                         unsigned int value);
31         u8 * (*get_eapReqData)(void *ctx, size_t *len);
32 };
33
34 struct eap_sm *eap_sm_init(void *eapol_ctx, struct eapol_callbacks *eapol_cb,
35                            void *msg_ctx);
36 void eap_sm_deinit(struct eap_sm *sm);
37 int eap_sm_step(struct eap_sm *sm);
38 void eap_sm_abort(struct eap_sm *sm);
39 int eap_sm_get_status(struct eap_sm *sm, char *buf, size_t buflen,
40                       int verbose);
41 u8 *eap_sm_buildIdentity(struct eap_sm *sm, int id, size_t *len,
42                          int encrypted);
43 const struct eap_method * eap_sm_get_eap_methods(int method);
44 void eap_sm_request_identity(struct eap_sm *sm, struct wpa_ssid *config);
45 void eap_sm_request_password(struct eap_sm *sm, struct wpa_ssid *config);
46 void eap_sm_request_otp(struct eap_sm *sm, struct wpa_ssid *config,
47                         char *msg, size_t msg_len);
48 void eap_sm_notify_ctrl_attached(struct eap_sm *sm);
49 u8 eap_get_type(const char *name);
50 u8 eap_get_phase2_type(const char *name);
51 u8 *eap_get_phase2_types(struct wpa_ssid *config, size_t *count);
52 void eap_set_fast_reauth(struct eap_sm *sm, int enabled);
53 void eap_set_workaround(struct eap_sm *sm, unsigned int workaround);
54 struct wpa_ssid * eap_get_config(struct eap_sm *sm);
55 int eap_key_available(struct eap_sm *sm);
56 void eap_notify_success(struct eap_sm *sm);
57 u8 * eap_get_eapKeyData(struct eap_sm *sm, size_t *len);
58 u8 * eap_get_eapRespData(struct eap_sm *sm, size_t *len);
59 void eap_register_scard_ctx(struct eap_sm *sm, void *ctx);
60
61 #else /* IEEE8021X_EAPOL */
62
63 static inline u8 eap_get_type(const char *name)
64 {
65         return EAP_TYPE_NONE;
66 }
67
68 #endif /* IEEE8021X_EAPOL */
69
70 #endif /* EAP_H */