Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 1 | /* |
| 2 | * hostapd / IEEE 802.1X-2004 Authenticator |
Dmitry Shmidt | 61d9df3 | 2012-08-29 16:22:06 -0700 | [diff] [blame] | 3 | * Copyright (c) 2002-2012, Jouni Malinen <j@w1.fi> |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 4 | * |
Dmitry Shmidt | c5ec7f5 | 2012-03-06 16:33:24 -0800 | [diff] [blame] | 5 | * This software may be distributed under the terms of the BSD license. |
| 6 | * See README for more details. |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 7 | */ |
| 8 | |
| 9 | #ifndef IEEE802_1X_H |
| 10 | #define IEEE802_1X_H |
| 11 | |
| 12 | struct hostapd_data; |
| 13 | struct sta_info; |
| 14 | struct eapol_state_machine; |
| 15 | struct hostapd_config; |
| 16 | struct hostapd_bss_config; |
Dmitry Shmidt | 61d9df3 | 2012-08-29 16:22:06 -0700 | [diff] [blame] | 17 | struct hostapd_radius_attr; |
| 18 | struct radius_msg; |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 19 | |
| 20 | |
| 21 | void ieee802_1x_receive(struct hostapd_data *hapd, const u8 *sa, const u8 *buf, |
| 22 | size_t len); |
| 23 | void ieee802_1x_new_station(struct hostapd_data *hapd, struct sta_info *sta); |
Dmitry Shmidt | de47be7 | 2016-01-07 12:52:55 -0800 | [diff] [blame] | 24 | void ieee802_1x_free_station(struct hostapd_data *hapd, struct sta_info *sta); |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 25 | |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 26 | void ieee802_1x_abort_auth(struct hostapd_data *hapd, struct sta_info *sta); |
| 27 | void ieee802_1x_set_sta_authorized(struct hostapd_data *hapd, |
| 28 | struct sta_info *sta, int authorized); |
| 29 | void ieee802_1x_dump_state(FILE *f, const char *prefix, struct sta_info *sta); |
| 30 | int ieee802_1x_init(struct hostapd_data *hapd); |
Dmitry Shmidt | fb45fd5 | 2015-01-05 13:08:17 -0800 | [diff] [blame] | 31 | void ieee802_1x_erp_flush(struct hostapd_data *hapd); |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 32 | void ieee802_1x_deinit(struct hostapd_data *hapd); |
| 33 | int ieee802_1x_tx_status(struct hostapd_data *hapd, struct sta_info *sta, |
| 34 | const u8 *buf, size_t len, int ack); |
Dmitry Shmidt | 1f69aa5 | 2012-01-24 16:10:04 -0800 | [diff] [blame] | 35 | int ieee802_1x_eapol_tx_status(struct hostapd_data *hapd, struct sta_info *sta, |
| 36 | const u8 *data, int len, int ack); |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 37 | u8 * ieee802_1x_get_identity(struct eapol_state_machine *sm, size_t *len); |
| 38 | u8 * ieee802_1x_get_radius_class(struct eapol_state_machine *sm, size_t *len, |
| 39 | int idx); |
Dmitry Shmidt | 0494959 | 2012-07-19 12:16:46 -0700 | [diff] [blame] | 40 | struct wpabuf * ieee802_1x_get_radius_cui(struct eapol_state_machine *sm); |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 41 | const u8 * ieee802_1x_get_key(struct eapol_state_machine *sm, size_t *len); |
| 42 | void ieee802_1x_notify_port_enabled(struct eapol_state_machine *sm, |
| 43 | int enabled); |
| 44 | void ieee802_1x_notify_port_valid(struct eapol_state_machine *sm, |
| 45 | int valid); |
| 46 | void ieee802_1x_notify_pre_auth(struct eapol_state_machine *sm, int pre_auth); |
| 47 | int ieee802_1x_get_mib(struct hostapd_data *hapd, char *buf, size_t buflen); |
| 48 | int ieee802_1x_get_mib_sta(struct hostapd_data *hapd, struct sta_info *sta, |
| 49 | char *buf, size_t buflen); |
| 50 | void hostapd_get_ntp_timestamp(u8 *buf); |
| 51 | char *eap_type_text(u8 type); |
| 52 | |
| 53 | const char *radius_mode_txt(struct hostapd_data *hapd); |
| 54 | int radius_sta_rate(struct hostapd_data *hapd, struct sta_info *sta); |
| 55 | |
Dmitry Shmidt | 61d9df3 | 2012-08-29 16:22:06 -0700 | [diff] [blame] | 56 | int 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); |
Dmitry Shmidt | 9839ecd | 2016-11-07 11:05:47 -0800 | [diff] [blame] | 60 | void ieee802_1x_encapsulate_radius(struct hostapd_data *hapd, |
| 61 | struct sta_info *sta, |
| 62 | const u8 *eap, size_t len); |
| 63 | struct eapol_state_machine * |
| 64 | ieee802_1x_alloc_eapol_sm(struct hostapd_data *hapd, struct sta_info *sta); |
Dmitry Shmidt | 61d9df3 | 2012-08-29 16:22:06 -0700 | [diff] [blame] | 65 | |
Dmitry Shmidt | 8d520ff | 2011-05-09 14:06:53 -0700 | [diff] [blame] | 66 | #endif /* IEEE802_1X_H */ |