blob: 1469351c1e5502b99b802c670c6118a527b01f4c [file] [log] [blame]
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001/*
2 * hostapd / IEEE 802.1X-2004 Authenticator
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07003 * Copyright (c) 2002-2012, Jouni Malinen <j@w1.fi>
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07004 *
Dmitry Shmidtc5ec7f52012-03-06 16:33:24 -08005 * This software may be distributed under the terms of the BSD license.
6 * See README for more details.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07007 */
8
9#ifndef IEEE802_1X_H
10#define IEEE802_1X_H
11
12struct hostapd_data;
13struct sta_info;
14struct eapol_state_machine;
15struct hostapd_config;
16struct hostapd_bss_config;
Dmitry Shmidt61d9df32012-08-29 16:22:06 -070017struct hostapd_radius_attr;
18struct radius_msg;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -070019
20
21void ieee802_1x_receive(struct hostapd_data *hapd, const u8 *sa, const u8 *buf,
Sunil8cd6f4d2022-06-28 18:40:46 +000022 size_t len, enum frame_encryption encrypted);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -070023void ieee802_1x_new_station(struct hostapd_data *hapd, struct sta_info *sta);
Dmitry Shmidtde47be72016-01-07 12:52:55 -080024void ieee802_1x_free_station(struct hostapd_data *hapd, struct sta_info *sta);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -070025
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -070026void ieee802_1x_abort_auth(struct hostapd_data *hapd, struct sta_info *sta);
27void ieee802_1x_set_sta_authorized(struct hostapd_data *hapd,
28 struct sta_info *sta, int authorized);
29void ieee802_1x_dump_state(FILE *f, const char *prefix, struct sta_info *sta);
30int ieee802_1x_init(struct hostapd_data *hapd);
Dmitry Shmidtfb45fd52015-01-05 13:08:17 -080031void ieee802_1x_erp_flush(struct hostapd_data *hapd);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -070032void ieee802_1x_deinit(struct hostapd_data *hapd);
33int ieee802_1x_tx_status(struct hostapd_data *hapd, struct sta_info *sta,
34 const u8 *buf, size_t len, int ack);
Dmitry Shmidt1f69aa52012-01-24 16:10:04 -080035int ieee802_1x_eapol_tx_status(struct hostapd_data *hapd, struct sta_info *sta,
36 const u8 *data, int len, int ack);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -070037u8 * 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);
Dmitry Shmidt04949592012-07-19 12:16:46 -070040struct wpabuf * ieee802_1x_get_radius_cui(struct eapol_state_machine *sm);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -070041const u8 * ieee802_1x_get_key(struct eapol_state_machine *sm, size_t *len);
Hai Shalom81f62d82019-07-22 12:10:00 -070042const u8 * ieee802_1x_get_session_id(struct eapol_state_machine *sm,
43 size_t *len);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -070044void ieee802_1x_notify_port_enabled(struct eapol_state_machine *sm,
Hai Shalome21d4e82020-04-29 16:34:06 -070045 bool enabled);
46void ieee802_1x_notify_port_valid(struct eapol_state_machine *sm, bool valid);
47void ieee802_1x_notify_pre_auth(struct eapol_state_machine *sm, bool pre_auth);
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -070048int ieee802_1x_get_mib(struct hostapd_data *hapd, char *buf, size_t buflen);
49int ieee802_1x_get_mib_sta(struct hostapd_data *hapd, struct sta_info *sta,
50 char *buf, size_t buflen);
51void hostapd_get_ntp_timestamp(u8 *buf);
52char *eap_type_text(u8 type);
53
54const char *radius_mode_txt(struct hostapd_data *hapd);
55int radius_sta_rate(struct hostapd_data *hapd, struct sta_info *sta);
56
Dmitry Shmidt61d9df32012-08-29 16:22:06 -070057int add_common_radius_attr(struct hostapd_data *hapd,
58 struct hostapd_radius_attr *req_attr,
59 struct sta_info *sta,
60 struct radius_msg *msg);
Hai Shalomc3565922019-10-28 11:58:20 -070061int add_sqlite_radius_attr(struct hostapd_data *hapd, struct sta_info *sta,
62 struct radius_msg *msg, int acct);
Dmitry Shmidt9839ecd2016-11-07 11:05:47 -080063void ieee802_1x_encapsulate_radius(struct hostapd_data *hapd,
64 struct sta_info *sta,
65 const u8 *eap, size_t len);
66struct eapol_state_machine *
67ieee802_1x_alloc_eapol_sm(struct hostapd_data *hapd, struct sta_info *sta);
Dmitry Shmidt61d9df32012-08-29 16:22:06 -070068
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -070069#endif /* IEEE802_1X_H */