Disconnect hostapd from building in base
[dragonfly.git] / contrib / hostapd / src / ap / ieee802_1x.h
CommitLineData
ebfa2275 1/*
a875087d 2 * hostapd / IEEE 802.1X-2004 Authenticator
4781064b 3 * Copyright (c) 2002-2012, Jouni Malinen <j@w1.fi>
ebfa2275 4 *
4781064b
JM
5 * This software may be distributed under the terms of the BSD license.
6 * See README for more details.
ebfa2275
SZ
7 */
8
9#ifndef IEEE802_1X_H
10#define IEEE802_1X_H
11
a875087d
JL
12struct hostapd_data;
13struct sta_info;
14struct eapol_state_machine;
15struct hostapd_config;
16struct hostapd_bss_config;
4781064b
JM
17struct hostapd_radius_attr;
18struct radius_msg;
ebfa2275
SZ
19
20
21void ieee802_1x_receive(struct hostapd_data *hapd, const u8 *sa, const u8 *buf,
22 size_t len);
23void ieee802_1x_new_station(struct hostapd_data *hapd, struct sta_info *sta);
24void ieee802_1x_free_station(struct sta_info *sta);
25
ebfa2275 26void ieee802_1x_tx_key(struct hostapd_data *hapd, struct sta_info *sta);
ebfa2275
SZ
27void ieee802_1x_abort_auth(struct hostapd_data *hapd, struct sta_info *sta);
28void ieee802_1x_set_sta_authorized(struct hostapd_data *hapd,
29 struct sta_info *sta, int authorized);
30void ieee802_1x_dump_state(FILE *f, const char *prefix, struct sta_info *sta);
31int ieee802_1x_init(struct hostapd_data *hapd);
32void ieee802_1x_deinit(struct hostapd_data *hapd);
ebfa2275 33int ieee802_1x_tx_status(struct hostapd_data *hapd, struct sta_info *sta,
4781064b
JM
34 const u8 *buf, size_t len, int ack);
35int ieee802_1x_eapol_tx_status(struct hostapd_data *hapd, struct sta_info *sta,
36 const u8 *data, int len, int ack);
ebfa2275
SZ
37u8 * ieee802_1x_get_identity(struct eapol_state_machine *sm, size_t *len);
38u8 * ieee802_1x_get_radius_class(struct eapol_state_machine *sm, size_t *len,
39 int idx);
4781064b 40struct wpabuf * ieee802_1x_get_radius_cui(struct eapol_state_machine *sm);
a875087d 41const u8 * ieee802_1x_get_key(struct eapol_state_machine *sm, size_t *len);
ebfa2275
SZ
42void ieee802_1x_notify_port_enabled(struct eapol_state_machine *sm,
43 int enabled);
44void ieee802_1x_notify_port_valid(struct eapol_state_machine *sm,
45 int valid);
46void ieee802_1x_notify_pre_auth(struct eapol_state_machine *sm, int pre_auth);
47int ieee802_1x_get_mib(struct hostapd_data *hapd, char *buf, size_t buflen);
48int ieee802_1x_get_mib_sta(struct hostapd_data *hapd, struct sta_info *sta,
49 char *buf, size_t buflen);
50void hostapd_get_ntp_timestamp(u8 *buf);
ebfa2275
SZ
51char *eap_type_text(u8 type);
52
a875087d
JL
53const char *radius_mode_txt(struct hostapd_data *hapd);
54int radius_sta_rate(struct hostapd_data *hapd, struct sta_info *sta);
ebfa2275 55
4781064b
JM
56int add_common_radius_attr(struct hostapd_data *hapd,
57 struct hostapd_radius_attr *req_attr,
58 struct sta_info *sta,
59 struct radius_msg *msg);
60
ebfa2275 61#endif /* IEEE802_1X_H */