1 /*
2 * wpa_supplicant - WPA2/RSN pre-authentication functions
3 * Copyright (c) 2003-2005, 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
15 #ifndef PREAUTH_H
16 #define PREAUTH_H
17
18 struct wpa_scan_result;
19
20 #ifndef CONFIG_NO_WPA
21
22 void pmksa_candidate_free(struct wpa_sm *sm);
23
24 #else /* CONFIG_NO_WPA */
25
pmksa_candidate_free(struct wpa_sm * sm)26 static inline void pmksa_candidate_free(struct wpa_sm *sm)
27 {
28 }
29
30 #endif /* CONFIG_NO_WPA */
31
32
33 #if defined(IEEE8021X_EAPOL) && !defined(CONFIG_NO_WPA2)
34
35 int rsn_preauth_init(struct wpa_sm *sm, const u8 *dst,
36 struct wpa_ssid *config);
37 void rsn_preauth_deinit(struct wpa_sm *sm);
38 void rsn_preauth_scan_results(struct wpa_sm *sm,
39 struct wpa_scan_result *results, int count);
40 void pmksa_candidate_add(struct wpa_sm *sm, const u8 *bssid,
41 int prio, int preauth);
42 void rsn_preauth_candidate_process(struct wpa_sm *sm);
43 int rsn_preauth_get_status(struct wpa_sm *sm, char *buf, size_t buflen,
44 int verbose);
45 int rsn_preauth_in_progress(struct wpa_sm *sm);
46
47 #else /* IEEE8021X_EAPOL and !CONFIG_NO_WPA2 */
48
rsn_preauth_candidate_process(struct wpa_sm * sm)49 static inline void rsn_preauth_candidate_process(struct wpa_sm *sm)
50 {
51 }
52
rsn_preauth_init(struct wpa_sm * sm,const u8 * dst,struct wpa_ssid * config)53 static inline int rsn_preauth_init(struct wpa_sm *sm, const u8 *dst,
54 struct wpa_ssid *config)
55 {
56 return -1;
57 }
58
rsn_preauth_deinit(struct wpa_sm * sm)59 static inline void rsn_preauth_deinit(struct wpa_sm *sm)
60 {
61 }
rsn_preauth_scan_results(struct wpa_sm * sm,struct wpa_scan_result * results,int count)62 static inline void rsn_preauth_scan_results(struct wpa_sm *sm,
63 struct wpa_scan_result *results,
64 int count)
65 {
66 }
67
pmksa_candidate_add(struct wpa_sm * sm,const u8 * bssid,int prio,int preauth)68 static inline void pmksa_candidate_add(struct wpa_sm *sm,
69 const u8 *bssid,
70 int prio, int preauth)
71 {
72 }
73
rsn_preauth_get_status(struct wpa_sm * sm,char * buf,size_t buflen,int verbose)74 static inline int rsn_preauth_get_status(struct wpa_sm *sm, char *buf,
75 size_t buflen, int verbose)
76 {
77 return 0;
78 }
79
rsn_preauth_in_progress(struct wpa_sm * sm)80 static inline int rsn_preauth_in_progress(struct wpa_sm *sm)
81 {
82 return 0;
83 }
84
85 #endif /* IEEE8021X_EAPOL and !CONFIG_NO_WPA2 */
86
87 #endif /* PREAUTH_H */
88