Merge branch 'moonshot' of ssh://moonshot.suchdamage.org:822/srv/git/libeap into...
[libeap.git] / wpa_supplicant / mlme.h
1 /*
2  * WPA Supplicant - Client mode MLME
3  * Copyright (c) 2003-2007, Jouni Malinen <j@w1.fi>
4  * Copyright (c) 2004, Instant802 Networks, Inc.
5  * Copyright (c) 2005-2006, Devicescape Software, Inc.
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License version 2 as
9  * published by the Free Software Foundation.
10  *
11  * Alternatively, this software may be distributed under the terms of BSD
12  * license.
13  *
14  * See README and COPYING for more details.
15  */
16
17 #ifndef MLME_H
18 #define MLME_H
19
20 struct wpa_supplicant;
21
22 struct ieee80211_rx_status {
23         int freq;
24         int channel;
25         int ssi;
26 };
27
28 #ifdef CONFIG_CLIENT_MLME
29
30 int ieee80211_sta_init(struct wpa_supplicant *wpa_s);
31 void ieee80211_sta_deinit(struct wpa_supplicant *wpa_s);
32 int ieee80211_sta_req_scan(struct wpa_supplicant *wpa_s,
33                            struct wpa_driver_scan_params *params);
34 int ieee80211_sta_deauthenticate(struct wpa_supplicant *wpa_s, u16 reason);
35 int ieee80211_sta_disassociate(struct wpa_supplicant *wpa_s, u16 reason);
36 int ieee80211_sta_associate(struct wpa_supplicant *wpa_s,
37                             struct wpa_driver_associate_params *params);
38 int ieee80211_sta_get_ssid(struct wpa_supplicant *wpa_s, u8 *ssid,
39                            size_t *len);
40 void ieee80211_sta_free_hw_features(struct hostapd_hw_modes *hw_features,
41                                     size_t num_hw_features);
42 void ieee80211_sta_rx(struct wpa_supplicant *wpa_s, const u8 *buf, size_t len,
43                       struct ieee80211_rx_status *rx_status);
44 struct wpa_scan_results *
45 ieee80211_sta_get_scan_results(struct wpa_supplicant *wpa_s);
46 int ieee80211_sta_update_ft_ies(struct wpa_supplicant *wpa_s, const u8 *md,
47                                 const u8 *ies, size_t ies_len);
48 int ieee80211_sta_send_ft_action(struct wpa_supplicant *wpa_s, u8 action,
49                                  const u8 *target_ap,
50                                  const u8 *ies, size_t ies_len);
51
52 #else /* CONFIG_CLIENT_MLME */
53
54 static inline int ieee80211_sta_init(struct wpa_supplicant *wpa_s)
55 {
56         return 0;
57 }
58
59 static inline void ieee80211_sta_deinit(struct wpa_supplicant *wpa_s)
60 {
61 }
62
63 static inline int ieee80211_sta_req_scan(struct wpa_supplicant *wpa_s,
64                                          struct wpa_driver_scan_params *params)
65 {
66         return -1;
67 }
68
69 static inline int ieee80211_sta_deauthenticate(struct wpa_supplicant *wpa_s,
70                                                u16 reason)
71 {
72         return -1;
73 }
74
75 static inline int ieee80211_sta_disassociate(struct wpa_supplicant *wpa_s,
76                                              u16 reason)
77 {
78         return -1;
79 }
80
81 static inline int
82 ieee80211_sta_associate(struct wpa_supplicant *wpa_s,
83                         struct wpa_driver_associate_params *params)
84 {
85         return -1;
86 }
87
88 static inline int ieee80211_sta_get_ssid(struct wpa_supplicant *wpa_s,
89                                          u8 *ssid, size_t *len)
90 {
91         return -1;
92 }
93
94 static inline void
95 ieee80211_sta_free_hw_features(struct hostapd_hw_modes *hw_features,
96                                size_t num_hw_features)
97 {
98 }
99
100 static inline void
101 ieee80211_sta_rx(struct wpa_supplicant *wpa_s, const u8 *buf, size_t len,
102                  struct ieee80211_rx_status *rx_status)
103 {
104 }
105
106 static inline struct wpa_scan_results *
107 ieee80211_sta_get_scan_results(struct wpa_supplicant *wpa_s)
108 {
109         return NULL;
110 }
111
112 static inline int
113 ieee80211_sta_update_ft_ies(struct wpa_supplicant *wpa_s, const u8 *md,
114                             const u8 *ies, size_t ies_len)
115 {
116         return -1;
117 }
118
119 static inline int
120 ieee80211_sta_send_ft_action(struct wpa_supplicant *wpa_s, u8 action,
121                              const u8 *target_ap,
122                              const u8 *ies, size_t ies_len)
123 {
124         return -1;
125 }
126
127 #endif /* CONFIG_CLIENT_MLME */
128
129 #endif /* MLME_H */