2 * wpa_supplicant - WPA2/RSN pre-authentication functions
3 * Copyright (c) 2003-2005, Jouni Malinen <jkmaline@cc.hut.fi>
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.
9 * Alternatively, this software may be distributed under the terms of BSD
12 * See README and COPYING for more details.
18 struct wpa_scan_result;
22 void pmksa_cache_free(struct wpa_sm *sm);
23 struct rsn_pmksa_cache * pmksa_cache_get(struct wpa_sm *sm,
24 const u8 *aa, const u8 *pmkid);
25 int pmksa_cache_list(struct wpa_sm *sm, char *buf, size_t len);
26 void pmksa_candidate_free(struct wpa_sm *sm);
27 struct rsn_pmksa_cache *
28 pmksa_cache_add(struct wpa_sm *sm, const u8 *pmk,
29 size_t pmk_len, const u8 *aa, const u8 *spa,
30 struct wpa_ssid *ssid);
31 void pmksa_cache_notify_reconfig(struct wpa_sm *sm);
32 struct rsn_pmksa_cache * pmksa_cache_get_current(struct wpa_sm *sm);
33 void pmksa_cache_clear_current(struct wpa_sm *sm);
34 int pmksa_cache_set_current(struct wpa_sm *sm, const u8 *pmkid,
35 const u8 *bssid, struct wpa_ssid *ssid,
36 int try_opportunistic);
38 #else /* CONFIG_NO_WPA */
40 static inline void pmksa_cache_free(struct wpa_sm *sm)
44 static inline void pmksa_candidate_free(struct wpa_sm *sm)
48 static inline void pmksa_cache_notify_reconfig(struct wpa_sm *sm)
52 static inline struct rsn_pmksa_cache *
53 pmksa_cache_get_current(struct wpa_sm *sm)
58 static inline int pmksa_cache_list(struct wpa_sm *sm, char *buf, size_t len)
63 static inline void pmksa_cache_clear_current(struct wpa_sm *sm)
67 static inline int pmksa_cache_set_current(struct wpa_sm *sm, const u8 *pmkid,
69 struct wpa_ssid *ssid,
70 int try_opportunistic)
75 #endif /* CONFIG_NO_WPA */
78 #if defined(IEEE8021X_EAPOL) && !defined(CONFIG_NO_WPA)
80 int rsn_preauth_init(struct wpa_sm *sm, const u8 *dst,
81 struct wpa_ssid *config);
82 void rsn_preauth_deinit(struct wpa_sm *sm);
83 void rsn_preauth_scan_results(struct wpa_sm *sm,
84 struct wpa_scan_result *results, int count);
85 void pmksa_candidate_add(struct wpa_sm *sm, const u8 *bssid,
86 int prio, int preauth);
87 void rsn_preauth_candidate_process(struct wpa_sm *sm);
88 int rsn_preauth_get_status(struct wpa_sm *sm, char *buf, size_t buflen,
90 int rsn_preauth_in_progress(struct wpa_sm *sm);
92 #else /* IEEE8021X_EAPOL and !CONFIG_NO_WPA */
94 static inline void rsn_preauth_candidate_process(struct wpa_sm *sm)
98 static inline int rsn_preauth_init(struct wpa_sm *sm, const u8 *dst,
99 struct wpa_ssid *config)
104 static inline void rsn_preauth_deinit(struct wpa_sm *sm)
107 static inline void rsn_preauth_scan_results(struct wpa_sm *sm,
108 struct wpa_scan_result *results,
113 static inline void pmksa_candidate_add(struct wpa_sm *sm,
115 int prio, int preauth)
119 static inline int rsn_preauth_get_status(struct wpa_sm *sm, char *buf,
120 size_t buflen, int verbose)
125 static inline int rsn_preauth_in_progress(struct wpa_sm *sm)
130 #endif /* IEEE8021X_EAPOL and !CONFIG_NO_WPA */
132 #endif /* PREAUTH_H */