00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef IEEE802_1X_H
00016 #define IEEE802_1X_H
00017
00018 struct hostapd_data;
00019 struct sta_info;
00020 struct eapol_state_machine;
00021 struct hostapd_config;
00022 struct hostapd_bss_config;
00023
00024 #ifdef _MSC_VER
00025 #pragma pack(push, 1)
00026 #endif
00027
00028
00029
00030 struct ieee802_1x_eapol_key {
00031 u8 type;
00032 u16 key_length;
00033 u8 replay_counter[8];
00034
00035
00036 u8 key_iv[16];
00037 u8 key_index;
00038
00039
00040
00041 u8 key_signature[16];
00042
00043
00044
00045
00046
00047
00048
00049
00050 } STRUCT_PACKED;
00051
00052 #ifdef _MSC_VER
00053 #pragma pack(pop)
00054 #endif
00055
00056
00057 void ieee802_1x_receive(struct hostapd_data *hapd, const u8 *sa, const u8 *buf,
00058 size_t len);
00059 void ieee802_1x_new_station(struct hostapd_data *hapd, struct sta_info *sta);
00060 void ieee802_1x_free_station(struct sta_info *sta);
00061
00062 void ieee802_1x_tx_key(struct hostapd_data *hapd, struct sta_info *sta);
00063 void ieee802_1x_abort_auth(struct hostapd_data *hapd, struct sta_info *sta);
00064 void ieee802_1x_set_sta_authorized(struct hostapd_data *hapd,
00065 struct sta_info *sta, int authorized);
00066 void ieee802_1x_dump_state(FILE *f, const char *prefix, struct sta_info *sta);
00067 int ieee802_1x_init(struct hostapd_data *hapd);
00068 void ieee802_1x_deinit(struct hostapd_data *hapd);
00069 int ieee802_1x_tx_status(struct hostapd_data *hapd, struct sta_info *sta,
00070 const u8 *buf, size_t len, int ack);
00071 u8 * ieee802_1x_get_identity(struct eapol_state_machine *sm, size_t *len);
00072 u8 * ieee802_1x_get_radius_class(struct eapol_state_machine *sm, size_t *len,
00073 int idx);
00074 const u8 * ieee802_1x_get_key(struct eapol_state_machine *sm, size_t *len);
00075 void ieee802_1x_notify_port_enabled(struct eapol_state_machine *sm,
00076 int enabled);
00077 void ieee802_1x_notify_port_valid(struct eapol_state_machine *sm,
00078 int valid);
00079 void ieee802_1x_notify_pre_auth(struct eapol_state_machine *sm, int pre_auth);
00080 int ieee802_1x_get_mib(struct hostapd_data *hapd, char *buf, size_t buflen);
00081 int ieee802_1x_get_mib_sta(struct hostapd_data *hapd, struct sta_info *sta,
00082 char *buf, size_t buflen);
00083 void hostapd_get_ntp_timestamp(u8 *buf);
00084 char *eap_type_text(u8 type);
00085
00086 const char *radius_mode_txt(struct hostapd_data *hapd);
00087 int radius_sta_rate(struct hostapd_data *hapd, struct sta_info *sta);
00088
00089 #endif