wpa_supplicant / hostapd  2.5
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
eapol_auth_sm.h
Go to the documentation of this file.
1 
5 #ifndef EAPOL_AUTH_SM_H
6 #define EAPOL_AUTH_SM_H
7 
8 #define EAPOL_SM_PREAUTH BIT(0)
9 #define EAPOL_SM_WAIT_START BIT(1)
10 #define EAPOL_SM_USES_WPA BIT(2)
11 #define EAPOL_SM_FROM_PMKSA_CACHE BIT(3)
12 
14  int eap_reauth_period;
15  int wpa;
16  int individual_wep_key_len;
17  int eap_server;
18  void *ssl_ctx;
19  void *msg_ctx;
20  void *eap_sim_db_priv;
21  char *eap_req_id_text; /* a copy of this will be allocated */
22  size_t eap_req_id_text_len;
23  int erp_send_reauth_start;
24  char *erp_domain; /* a copy of this will be allocated */
25  int erp; /* Whether ERP is enabled on authentication server */
26  unsigned int tls_session_lifetime;
27  u8 *pac_opaque_encr_key;
28  u8 *eap_fast_a_id;
29  size_t eap_fast_a_id_len;
30  char *eap_fast_a_id_info;
31  int eap_fast_prov;
32  int pac_key_lifetime;
33  int pac_key_refresh_time;
34  int eap_sim_aka_result_ind;
35  int tnc;
36  struct wps_context *wps;
37  int fragment_size;
38  u16 pwd_group;
39  int pbc_in_m1;
40  const u8 *server_id;
41  size_t server_id_len;
42 
43  /* Opaque context pointer to owner data for callback functions */
44  void *ctx;
45 };
46 
47 struct eap_user;
48 struct eap_server_erp_key;
49 
50 typedef enum {
51  EAPOL_LOGGER_DEBUG, EAPOL_LOGGER_INFO, EAPOL_LOGGER_WARNING
52 } eapol_logger_level;
53 
54 enum eapol_event {
55  EAPOL_AUTH_SM_CHANGE,
56  EAPOL_AUTH_REAUTHENTICATE
57 };
58 
59 struct eapol_auth_cb {
60  void (*eapol_send)(void *ctx, void *sta_ctx, u8 type, const u8 *data,
61  size_t datalen);
62  void (*aaa_send)(void *ctx, void *sta_ctx, const u8 *data,
63  size_t datalen);
64  void (*finished)(void *ctx, void *sta_ctx, int success, int preauth,
65  int remediation);
66  int (*get_eap_user)(void *ctx, const u8 *identity, size_t identity_len,
67  int phase2, struct eap_user *user);
68  int (*sta_entry_alive)(void *ctx, const u8 *addr);
69  void (*logger)(void *ctx, const u8 *addr, eapol_logger_level level,
70  const char *txt);
71  void (*set_port_authorized)(void *ctx, void *sta_ctx, int authorized);
72  void (*abort_auth)(void *ctx, void *sta_ctx);
73  void (*tx_key)(void *ctx, void *sta_ctx);
74  void (*eapol_event)(void *ctx, void *sta_ctx, enum eapol_event type);
75  struct eap_server_erp_key * (*erp_get_key)(void *ctx,
76  const char *keyname);
77  int (*erp_add_key)(void *ctx, struct eap_server_erp_key *erp);
78 };
79 
80 
81 struct eapol_authenticator * eapol_auth_init(struct eapol_auth_config *conf,
82  struct eapol_auth_cb *cb);
83 void eapol_auth_deinit(struct eapol_authenticator *eapol);
84 struct eapol_state_machine *
85 eapol_auth_alloc(struct eapol_authenticator *eapol, const u8 *addr,
86  int flags, const struct wpabuf *assoc_wps_ie,
87  const struct wpabuf *assoc_p2p_ie, void *sta_ctx,
88  const char *identity, const char *radius_cui);
89 void eapol_auth_free(struct eapol_state_machine *sm);
90 void eapol_auth_step(struct eapol_state_machine *sm);
91 int eapol_auth_dump_state(struct eapol_state_machine *sm, char *buf,
92  size_t buflen);
93 int eapol_auth_eap_pending_cb(struct eapol_state_machine *sm, void *ctx);
94 void eapol_auth_reauthenticate(struct eapol_state_machine *sm);
95 int eapol_auth_set_conf(struct eapol_state_machine *sm, const char *param,
96  const char *value);
97 
98 #endif /* EAPOL_AUTH_SM_H */
Definition: eapol_auth_sm.h:13
void eapol_auth_step(struct eapol_state_machine *sm)
Advance EAPOL state machines.
Definition: eapol_auth_sm.c:987
Definition: eap.h:80
Definition: wpabuf.h:16
Definition: eap.h:21
Per-Supplicant Authenticator state machines.
Definition: eapol_auth_sm_i.h:40
Definition: eapol_auth_sm.h:59
Global EAPOL authenticator data.
Definition: eapol_auth_sm_i.h:24
Long term WPS context data.
Definition: wps.h:623