Check for SYS/GL during library init. Reason is that
[AROS.git] / workbench / network / WirelessManager / wpa_supplicant / dbus / dbus_new.h
blob80ea98c26e230530b2b0d043986f3a95c4823aa4
1 /*
2 * WPA Supplicant / dbus-based control interface
3 * Copyright (c) 2006, Dan Williams <dcbw@redhat.com> and Red Hat, Inc.
4 * Copyright (c) 2009-2010, Witold Sowa <witold.sowa@gmail.com>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
10 * Alternatively, this software may be distributed under the terms of BSD
11 * license.
13 * See README and COPYING for more details.
16 #ifndef CTRL_IFACE_DBUS_NEW_H
17 #define CTRL_IFACE_DBUS_NEW_H
19 struct wpa_global;
20 struct wpa_supplicant;
21 struct wpa_ssid;
22 struct wps_event_m2d;
23 struct wps_event_fail;
24 struct wps_credential;
25 enum wpa_states;
27 enum wpas_dbus_prop {
28 WPAS_DBUS_PROP_AP_SCAN,
29 WPAS_DBUS_PROP_SCANNING,
30 WPAS_DBUS_PROP_STATE,
31 WPAS_DBUS_PROP_CURRENT_BSS,
32 WPAS_DBUS_PROP_CURRENT_NETWORK,
35 enum wpas_dbus_bss_prop {
36 WPAS_DBUS_BSS_PROP_SIGNAL,
37 WPAS_DBUS_BSS_PROP_FREQ,
38 WPAS_DBUS_BSS_PROP_MODE,
39 WPAS_DBUS_BSS_PROP_PRIVACY,
40 WPAS_DBUS_BSS_PROP_RATES,
41 WPAS_DBUS_BSS_PROP_WPA,
42 WPAS_DBUS_BSS_PROP_RSN,
43 WPAS_DBUS_BSS_PROP_IES,
46 #define WPAS_DBUS_OBJECT_PATH_MAX 150
48 #define WPAS_DBUS_NEW_SERVICE "fi.w1.wpa_supplicant1"
49 #define WPAS_DBUS_NEW_PATH "/fi/w1/wpa_supplicant1"
50 #define WPAS_DBUS_NEW_INTERFACE "fi.w1.wpa_supplicant1"
52 #define WPAS_DBUS_NEW_PATH_INTERFACES WPAS_DBUS_NEW_PATH "/Interfaces"
53 #define WPAS_DBUS_NEW_IFACE_INTERFACE WPAS_DBUS_NEW_INTERFACE ".Interface"
54 #define WPAS_DBUS_NEW_IFACE_WPS WPAS_DBUS_NEW_IFACE_INTERFACE ".WPS"
56 #define WPAS_DBUS_NEW_NETWORKS_PART "Networks"
57 #define WPAS_DBUS_NEW_IFACE_NETWORK WPAS_DBUS_NEW_INTERFACE ".Network"
59 #define WPAS_DBUS_NEW_BSSIDS_PART "BSSs"
60 #define WPAS_DBUS_NEW_IFACE_BSS WPAS_DBUS_NEW_INTERFACE ".BSS"
63 /* Errors */
64 #define WPAS_DBUS_ERROR_UNKNOWN_ERROR \
65 WPAS_DBUS_NEW_INTERFACE ".UnknownError"
66 #define WPAS_DBUS_ERROR_INVALID_ARGS \
67 WPAS_DBUS_NEW_INTERFACE ".InvalidArgs"
69 #define WPAS_DBUS_ERROR_IFACE_EXISTS \
70 WPAS_DBUS_NEW_INTERFACE ".InterfaceExists"
71 #define WPAS_DBUS_ERROR_IFACE_UNKNOWN \
72 WPAS_DBUS_NEW_INTERFACE ".InterfaceUnknown"
74 #define WPAS_DBUS_ERROR_NOT_CONNECTED \
75 WPAS_DBUS_NEW_INTERFACE ".NotConnected"
76 #define WPAS_DBUS_ERROR_NETWORK_UNKNOWN \
77 WPAS_DBUS_NEW_INTERFACE ".NetworkUnknown"
79 #define WPAS_DBUS_ERROR_BLOB_EXISTS \
80 WPAS_DBUS_NEW_INTERFACE ".BlobExists"
81 #define WPAS_DBUS_ERROR_BLOB_UNKNOWN \
82 WPAS_DBUS_NEW_INTERFACE ".BlobUnknown"
85 #ifdef CONFIG_CTRL_IFACE_DBUS_NEW
87 int wpas_dbus_ctrl_iface_init(struct wpas_dbus_priv *priv);
88 void wpas_dbus_ctrl_iface_deinit(struct wpas_dbus_priv *iface);
90 int wpas_dbus_register_interface(struct wpa_supplicant *wpa_s);
91 int wpas_dbus_unregister_interface(struct wpa_supplicant *wpa_s);
92 void wpas_dbus_signal_prop_changed(struct wpa_supplicant *wpa_s,
93 enum wpas_dbus_prop property);
94 void wpas_dbus_bss_signal_prop_changed(struct wpa_supplicant *wpa_s,
95 enum wpas_dbus_bss_prop property,
96 unsigned int id);
97 void wpas_dbus_signal_network_enabled_changed(struct wpa_supplicant *wpa_s,
98 struct wpa_ssid *ssid);
99 void wpas_dbus_signal_network_selected(struct wpa_supplicant *wpa_s, int id);
100 void wpas_dbus_signal_scan_done(struct wpa_supplicant *wpa_s, int success);
101 void wpas_dbus_signal_wps_cred(struct wpa_supplicant *wpa_s,
102 const struct wps_credential *cred);
103 void wpas_dbus_signal_wps_event_m2d(struct wpa_supplicant *wpa_s,
104 struct wps_event_m2d *m2d);
105 void wpas_dbus_signal_wps_event_fail(struct wpa_supplicant *wpa_s,
106 struct wps_event_fail *fail);
107 void wpas_dbus_signal_wps_event_success(struct wpa_supplicant *wpa_s);
108 int wpas_dbus_register_network(struct wpa_supplicant *wpa_s,
109 struct wpa_ssid *ssid);
110 int wpas_dbus_unregister_network(struct wpa_supplicant *wpa_s, int nid);
111 int wpas_dbus_unregister_bss(struct wpa_supplicant *wpa_s,
112 u8 bssid[ETH_ALEN], unsigned int id);
113 int wpas_dbus_register_bss(struct wpa_supplicant *wpa_s,
114 u8 bssid[ETH_ALEN], unsigned int id);
115 void wpas_dbus_signal_blob_added(struct wpa_supplicant *wpa_s,
116 const char *name);
117 void wpas_dbus_signal_blob_removed(struct wpa_supplicant *wpa_s,
118 const char *name);
119 void wpas_dbus_signal_debug_level_changed(struct wpa_global *global);
120 void wpas_dbus_signal_debug_timestamp_changed(struct wpa_global *global);
121 void wpas_dbus_signal_debug_show_keys_changed(struct wpa_global *global);
123 #else /* CONFIG_CTRL_IFACE_DBUS_NEW */
125 static inline int wpas_dbus_register_interface(struct wpa_supplicant *wpa_s)
127 return 0;
130 static inline int wpas_dbus_unregister_interface(struct wpa_supplicant *wpa_s)
132 return 0;
135 #define wpas_dbus_signal_state_changed(w, n, o) do { } while (0)
137 static inline void wpas_dbus_signal_prop_changed(struct wpa_supplicant *wpa_s,
138 enum wpas_dbus_prop property)
142 static inline void wpas_dbus_bss_signal_prop_changed(
143 struct wpa_supplicant *wpa_s, enum wpas_dbus_bss_prop property,
144 unsigned int id)
148 static inline void wpas_dbus_signal_network_enabled_changed(
149 struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid)
153 static inline void wpas_dbus_signal_network_selected(
154 struct wpa_supplicant *wpa_s, int id)
158 static inline void wpas_dbus_signal_scan_done(struct wpa_supplicant *wpa_s,
159 int success)
163 static inline void wpas_dbus_signal_wps_cred(struct wpa_supplicant *wpa_s,
164 const struct wps_credential *cred)
168 static inline void wpas_dbus_signal_wps_event_m2d(struct wpa_supplicant *wpa_s,
169 struct wps_event_m2d *m2d)
173 static inline void wpas_dbus_signal_wps_event_fail(
174 struct wpa_supplicant *wpa_s, struct wps_event_fail *fail)
178 static inline void wpas_dbus_signal_wps_event_success(
179 struct wpa_supplicant *wpa_s)
183 static inline int wpas_dbus_register_network(struct wpa_supplicant *wpa_s,
184 struct wpa_ssid *ssid)
186 return 0;
189 static inline int wpas_dbus_unregister_network(struct wpa_supplicant *wpa_s,
190 int nid)
192 return 0;
195 static inline int wpas_dbus_unregister_bss(struct wpa_supplicant *wpa_s,
196 u8 bssid[ETH_ALEN], unsigned int id)
198 return 0;
201 static inline int wpas_dbus_register_bss(struct wpa_supplicant *wpa_s,
202 u8 bssid[ETH_ALEN], unsigned int id)
204 return 0;
207 static inline void wpas_dbus_signal_blob_added(struct wpa_supplicant *wpa_s,
208 const char *name)
212 static inline void wpas_dbus_signal_blob_removed(struct wpa_supplicant *wpa_s,
213 const char *name)
217 static inline void wpas_dbus_signal_debug_level_changed(
218 struct wpa_global *global)
222 static inline void wpas_dbus_signal_debug_timestamp_changed(
223 struct wpa_global *global)
227 static inline void wpas_dbus_signal_debug_show_keys_changed(
228 struct wpa_global *global)
232 #endif /* CONFIG_CTRL_IFACE_DBUS_NEW */
234 #endif /* CTRL_IFACE_DBUS_H_NEW */