1e5b75505Sopenharmony_ci/*
2e5b75505Sopenharmony_ci * hostapd / IEEE 802.1X-2004 Authenticator
3e5b75505Sopenharmony_ci * Copyright (c) 2002-2012, Jouni Malinen <j@w1.fi>
4e5b75505Sopenharmony_ci *
5e5b75505Sopenharmony_ci * This software may be distributed under the terms of the BSD license.
6e5b75505Sopenharmony_ci * See README for more details.
7e5b75505Sopenharmony_ci */
8e5b75505Sopenharmony_ci
9e5b75505Sopenharmony_ci#ifndef IEEE802_1X_H
10e5b75505Sopenharmony_ci#define IEEE802_1X_H
11e5b75505Sopenharmony_ci
12e5b75505Sopenharmony_cistruct hostapd_data;
13e5b75505Sopenharmony_cistruct sta_info;
14e5b75505Sopenharmony_cistruct eapol_state_machine;
15e5b75505Sopenharmony_cistruct hostapd_config;
16e5b75505Sopenharmony_cistruct hostapd_bss_config;
17e5b75505Sopenharmony_cistruct hostapd_radius_attr;
18e5b75505Sopenharmony_cistruct radius_msg;
19e5b75505Sopenharmony_ci
20e5b75505Sopenharmony_ci
21e5b75505Sopenharmony_civoid ieee802_1x_receive(struct hostapd_data *hapd, const u8 *sa, const u8 *buf,
22e5b75505Sopenharmony_ci			size_t len);
23e5b75505Sopenharmony_civoid ieee802_1x_new_station(struct hostapd_data *hapd, struct sta_info *sta);
24e5b75505Sopenharmony_civoid ieee802_1x_free_station(struct hostapd_data *hapd, struct sta_info *sta);
25e5b75505Sopenharmony_ci
26e5b75505Sopenharmony_civoid ieee802_1x_abort_auth(struct hostapd_data *hapd, struct sta_info *sta);
27e5b75505Sopenharmony_civoid ieee802_1x_set_sta_authorized(struct hostapd_data *hapd,
28e5b75505Sopenharmony_ci				   struct sta_info *sta, int authorized);
29e5b75505Sopenharmony_civoid ieee802_1x_dump_state(FILE *f, const char *prefix, struct sta_info *sta);
30e5b75505Sopenharmony_ciint ieee802_1x_init(struct hostapd_data *hapd);
31e5b75505Sopenharmony_civoid ieee802_1x_erp_flush(struct hostapd_data *hapd);
32e5b75505Sopenharmony_civoid ieee802_1x_deinit(struct hostapd_data *hapd);
33e5b75505Sopenharmony_ciint ieee802_1x_tx_status(struct hostapd_data *hapd, struct sta_info *sta,
34e5b75505Sopenharmony_ci			 const u8 *buf, size_t len, int ack);
35e5b75505Sopenharmony_ciint ieee802_1x_eapol_tx_status(struct hostapd_data *hapd, struct sta_info *sta,
36e5b75505Sopenharmony_ci			       const u8 *data, int len, int ack);
37e5b75505Sopenharmony_ciu8 * ieee802_1x_get_identity(struct eapol_state_machine *sm, size_t *len);
38e5b75505Sopenharmony_ciu8 * ieee802_1x_get_radius_class(struct eapol_state_machine *sm, size_t *len,
39e5b75505Sopenharmony_ci				 int idx);
40e5b75505Sopenharmony_cistruct wpabuf * ieee802_1x_get_radius_cui(struct eapol_state_machine *sm);
41e5b75505Sopenharmony_ciconst u8 * ieee802_1x_get_key(struct eapol_state_machine *sm, size_t *len);
42e5b75505Sopenharmony_ciconst u8 * ieee802_1x_get_session_id(struct eapol_state_machine *sm,
43e5b75505Sopenharmony_ci				     size_t *len);
44e5b75505Sopenharmony_civoid ieee802_1x_notify_port_enabled(struct eapol_state_machine *sm,
45e5b75505Sopenharmony_ci				    int enabled);
46e5b75505Sopenharmony_civoid ieee802_1x_notify_port_valid(struct eapol_state_machine *sm,
47e5b75505Sopenharmony_ci				  int valid);
48e5b75505Sopenharmony_civoid ieee802_1x_notify_pre_auth(struct eapol_state_machine *sm, int pre_auth);
49e5b75505Sopenharmony_ciint ieee802_1x_get_mib(struct hostapd_data *hapd, char *buf, size_t buflen);
50e5b75505Sopenharmony_ciint ieee802_1x_get_mib_sta(struct hostapd_data *hapd, struct sta_info *sta,
51e5b75505Sopenharmony_ci			   char *buf, size_t buflen);
52e5b75505Sopenharmony_civoid hostapd_get_ntp_timestamp(u8 *buf);
53e5b75505Sopenharmony_cichar *eap_type_text(u8 type);
54e5b75505Sopenharmony_ci
55e5b75505Sopenharmony_ciconst char *radius_mode_txt(struct hostapd_data *hapd);
56e5b75505Sopenharmony_ciint radius_sta_rate(struct hostapd_data *hapd, struct sta_info *sta);
57e5b75505Sopenharmony_ci
58e5b75505Sopenharmony_ciint add_common_radius_attr(struct hostapd_data *hapd,
59e5b75505Sopenharmony_ci			   struct hostapd_radius_attr *req_attr,
60e5b75505Sopenharmony_ci			   struct sta_info *sta,
61e5b75505Sopenharmony_ci			   struct radius_msg *msg);
62e5b75505Sopenharmony_ciint add_sqlite_radius_attr(struct hostapd_data *hapd, struct sta_info *sta,
63e5b75505Sopenharmony_ci			   struct radius_msg *msg, int acct);
64e5b75505Sopenharmony_civoid ieee802_1x_encapsulate_radius(struct hostapd_data *hapd,
65e5b75505Sopenharmony_ci				   struct sta_info *sta,
66e5b75505Sopenharmony_ci				   const u8 *eap, size_t len);
67e5b75505Sopenharmony_cistruct eapol_state_machine *
68e5b75505Sopenharmony_ciieee802_1x_alloc_eapol_sm(struct hostapd_data *hapd, struct sta_info *sta);
69e5b75505Sopenharmony_ci
70e5b75505Sopenharmony_ci#endif /* IEEE802_1X_H */
71