SME: Add timers for authentication and asscoiation
[mech_eap.git] / wpa_supplicant / sme.h
1 /*
2  * wpa_supplicant - SME
3  * Copyright (c) 2009-2010, 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 SME_H
16 #define SME_H
17
18 #ifdef CONFIG_SME
19
20 void sme_authenticate(struct wpa_supplicant *wpa_s,
21                       struct wpa_bss *bss, struct wpa_ssid *ssid);
22 void sme_associate(struct wpa_supplicant *wpa_s, enum wpas_mode mode,
23                    const u8 *bssid, u16 auth_type);
24 void sme_event_auth(struct wpa_supplicant *wpa_s, union wpa_event_data *data);
25 int sme_update_ft_ies(struct wpa_supplicant *wpa_s, const u8 *md,
26                       const u8 *ies, size_t ies_len);
27 void sme_event_assoc_reject(struct wpa_supplicant *wpa_s,
28                             union wpa_event_data *data);
29 void sme_event_auth_timed_out(struct wpa_supplicant *wpa_s,
30                               union wpa_event_data *data);
31 void sme_event_assoc_timed_out(struct wpa_supplicant *wpa_s,
32                                union wpa_event_data *data);
33 void sme_event_disassoc(struct wpa_supplicant *wpa_s,
34                         union wpa_event_data *data);
35 void sme_event_unprot_disconnect(struct wpa_supplicant *wpa_s, const u8 *sa,
36                                  const u8 *da, u16 reason_code);
37 void sme_sa_query_rx(struct wpa_supplicant *wpa_s, const u8 *sa,
38                      const u8 *data, size_t len);
39 void sme_state_changed(struct wpa_supplicant *wpa_s);
40 void sme_disassoc_while_authenticating(struct wpa_supplicant *wpa_s,
41                                        const u8 *prev_pending_bssid);
42 void sme_deinit(struct wpa_supplicant *wpa_s);
43
44 #else /* CONFIG_SME */
45
46 static inline void sme_authenticate(struct wpa_supplicant *wpa_s,
47                                     struct wpa_bss *bss,
48                                     struct wpa_ssid *ssid)
49 {
50 }
51
52 static inline void sme_event_auth(struct wpa_supplicant *wpa_s,
53                                   union wpa_event_data *data)
54 {
55 }
56
57 static inline int sme_update_ft_ies(struct wpa_supplicant *wpa_s, const u8 *md,
58                                     const u8 *ies, size_t ies_len)
59 {
60         return -1;
61 }
62
63
64 static inline void sme_event_assoc_reject(struct wpa_supplicant *wpa_s,
65                                           union wpa_event_data *data)
66 {
67 }
68
69 static inline void sme_event_auth_timed_out(struct wpa_supplicant *wpa_s,
70                                             union wpa_event_data *data)
71 {
72 }
73
74 static inline void sme_event_assoc_timed_out(struct wpa_supplicant *wpa_s,
75                                              union wpa_event_data *data)
76 {
77 }
78
79 static inline void sme_event_disassoc(struct wpa_supplicant *wpa_s,
80                                       union wpa_event_data *data)
81 {
82 }
83
84 static inline void sme_event_unprot_disconnect(struct wpa_supplicant *wpa_s,
85                                                const u8 *sa, const u8 *da,
86                                                u16 reason_code)
87 {
88 }
89
90 static inline void sme_state_changed(struct wpa_supplicant *wpa_s)
91 {
92 }
93
94 static inline void
95 sme_disassoc_while_authenticating(struct wpa_supplicant *wpa_s,
96                                   const u8 *prev_pending_bssid)
97 {
98 }
99
100 static inline void sme_deinit(struct wpa_supplicant *wpa_s)
101 {
102 }
103
104 #endif /* CONFIG_SME */
105
106 #endif /* SME_H */