xref: /freebsd/contrib/wpa/wpa_supplicant/sme.h (revision c1d255d3)
1 /*
2  * wpa_supplicant - SME
3  * Copyright (c) 2009-2010, 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 
9 #ifndef SME_H
10 #define SME_H
11 
12 #ifdef CONFIG_SME
13 
14 void sme_authenticate(struct wpa_supplicant *wpa_s,
15 		      struct wpa_bss *bss, struct wpa_ssid *ssid);
16 void sme_associate(struct wpa_supplicant *wpa_s, enum wpas_mode mode,
17 		   const u8 *bssid, u16 auth_type);
18 void sme_event_auth(struct wpa_supplicant *wpa_s, union wpa_event_data *data);
19 int sme_update_ft_ies(struct wpa_supplicant *wpa_s, const u8 *md,
20 		      const u8 *ies, size_t ies_len);
21 void sme_event_assoc_reject(struct wpa_supplicant *wpa_s,
22 			    union wpa_event_data *data);
23 void sme_event_auth_timed_out(struct wpa_supplicant *wpa_s,
24 			      union wpa_event_data *data);
25 void sme_event_assoc_timed_out(struct wpa_supplicant *wpa_s,
26 			       union wpa_event_data *data);
27 void sme_event_disassoc(struct wpa_supplicant *wpa_s,
28 			struct disassoc_info *info);
29 void sme_event_unprot_disconnect(struct wpa_supplicant *wpa_s, const u8 *sa,
30 				 const u8 *da, u16 reason_code);
31 void sme_event_ch_switch(struct wpa_supplicant *wpa_s);
32 void sme_sa_query_rx(struct wpa_supplicant *wpa_s, const u8 *da, const u8 *sa,
33 		     const u8 *data, size_t len);
34 void sme_state_changed(struct wpa_supplicant *wpa_s);
35 void sme_disassoc_while_authenticating(struct wpa_supplicant *wpa_s,
36 				       const u8 *prev_pending_bssid);
37 void sme_clear_on_disassoc(struct wpa_supplicant *wpa_s);
38 void sme_deinit(struct wpa_supplicant *wpa_s);
39 
40 int sme_proc_obss_scan(struct wpa_supplicant *wpa_s,
41 		       struct wpa_scan_results *scan_res);
42 void sme_sched_obss_scan(struct wpa_supplicant *wpa_s, int enable);
43 void sme_external_auth_trigger(struct wpa_supplicant *wpa_s,
44 			       union wpa_event_data *data);
45 void sme_external_auth_mgmt_rx(struct wpa_supplicant *wpa_s,
46 			       const u8 *auth_frame, size_t len);
47 
48 #else /* CONFIG_SME */
49 
50 static inline void sme_authenticate(struct wpa_supplicant *wpa_s,
51 				    struct wpa_bss *bss,
52 				    struct wpa_ssid *ssid)
53 {
54 }
55 
56 static inline void sme_event_auth(struct wpa_supplicant *wpa_s,
57 				  union wpa_event_data *data)
58 {
59 }
60 
61 static inline int sme_update_ft_ies(struct wpa_supplicant *wpa_s, const u8 *md,
62 				    const u8 *ies, size_t ies_len)
63 {
64 	return -1;
65 }
66 
67 
68 static inline void sme_event_assoc_reject(struct wpa_supplicant *wpa_s,
69 					  union wpa_event_data *data)
70 {
71 }
72 
73 static inline void sme_event_auth_timed_out(struct wpa_supplicant *wpa_s,
74 					    union wpa_event_data *data)
75 {
76 }
77 
78 static inline void sme_event_assoc_timed_out(struct wpa_supplicant *wpa_s,
79 					     union wpa_event_data *data)
80 {
81 }
82 
83 static inline void sme_event_disassoc(struct wpa_supplicant *wpa_s,
84 				      struct disassoc_info *info)
85 {
86 }
87 
88 static inline void sme_event_unprot_disconnect(struct wpa_supplicant *wpa_s,
89 					       const u8 *sa, const u8 *da,
90 					       u16 reason_code)
91 {
92 }
93 
94 static inline void sme_event_ch_switch(struct wpa_supplicant *wpa_s)
95 {
96 }
97 
98 static inline void sme_state_changed(struct wpa_supplicant *wpa_s)
99 {
100 }
101 
102 static inline void
103 sme_disassoc_while_authenticating(struct wpa_supplicant *wpa_s,
104 				  const u8 *prev_pending_bssid)
105 {
106 }
107 
108 static inline void sme_clear_on_disassoc(struct wpa_supplicant *wpa_s)
109 {
110 }
111 
112 static inline void sme_deinit(struct wpa_supplicant *wpa_s)
113 {
114 }
115 
116 static inline int sme_proc_obss_scan(struct wpa_supplicant *wpa_s,
117 				     struct wpa_scan_results *scan_res)
118 {
119 	return 0;
120 }
121 
122 static inline void sme_sched_obss_scan(struct wpa_supplicant *wpa_s,
123 				       int enable)
124 {
125 }
126 
127 static inline void sme_external_auth_trigger(struct wpa_supplicant *wpa_s,
128 					     union wpa_event_data *data)
129 {
130 }
131 
132 static inline void sme_external_auth_mgmt_rx(struct wpa_supplicant *wpa_s,
133 					     const u8 *auth_frame, size_t len)
134 {
135 }
136 
137 #endif /* CONFIG_SME */
138 
139 #endif /* SME_H */
140