ieee802_1x.h 2.4 KB

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