preauth.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /*
  2. * wpa_supplicant - WPA2/RSN pre-authentication functions
  3. * Copyright (c) 2003-2009, Jouni Malinen <j@w1.fi>
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License version 2 as
  7. * published by the Free Software Foundation.
  8. *
  9. * Alternatively, this software may be distributed under the terms of BSD
  10. * license.
  11. *
  12. * See README and COPYING for more details.
  13. */
  14. #ifndef PREAUTH_H
  15. #define PREAUTH_H
  16. struct wpa_scan_results;
  17. #if defined(IEEE8021X_EAPOL) && !defined(CONFIG_NO_WPA2)
  18. void pmksa_candidate_free(struct wpa_sm *sm);
  19. int rsn_preauth_init(struct wpa_sm *sm, const u8 *dst,
  20. struct eap_peer_config *eap_conf);
  21. void rsn_preauth_deinit(struct wpa_sm *sm);
  22. int rsn_preauth_scan_results(struct wpa_sm *sm);
  23. void rsn_preauth_scan_result(struct wpa_sm *sm, const u8 *bssid,
  24. const u8 *ssid, const u8 *rsn);
  25. void pmksa_candidate_add(struct wpa_sm *sm, const u8 *bssid,
  26. int prio, int preauth);
  27. void rsn_preauth_candidate_process(struct wpa_sm *sm);
  28. int rsn_preauth_get_status(struct wpa_sm *sm, char *buf, size_t buflen,
  29. int verbose);
  30. int rsn_preauth_in_progress(struct wpa_sm *sm);
  31. #else /* IEEE8021X_EAPOL and !CONFIG_NO_WPA2 */
  32. static inline void pmksa_candidate_free(struct wpa_sm *sm)
  33. {
  34. }
  35. static inline void rsn_preauth_candidate_process(struct wpa_sm *sm)
  36. {
  37. }
  38. static inline int rsn_preauth_init(struct wpa_sm *sm, const u8 *dst,
  39. struct eap_peer_config *eap_conf)
  40. {
  41. return -1;
  42. }
  43. static inline void rsn_preauth_deinit(struct wpa_sm *sm)
  44. {
  45. }
  46. static inline int rsn_preauth_scan_results(struct wpa_sm *sm)
  47. {
  48. return -1;
  49. }
  50. static inline void rsn_preauth_scan_result(struct wpa_sm *sm, const u8 *bssid,
  51. const u8 *ssid, const u8 *rsn)
  52. {
  53. }
  54. static inline void pmksa_candidate_add(struct wpa_sm *sm,
  55. const u8 *bssid,
  56. int prio, int preauth)
  57. {
  58. }
  59. static inline int rsn_preauth_get_status(struct wpa_sm *sm, char *buf,
  60. size_t buflen, int verbose)
  61. {
  62. return 0;
  63. }
  64. static inline int rsn_preauth_in_progress(struct wpa_sm *sm)
  65. {
  66. return 0;
  67. }
  68. #endif /* IEEE8021X_EAPOL and !CONFIG_NO_WPA2 */
  69. #endif /* PREAUTH_H */