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
13 * See README and COPYING for more details.
16 #ifndef CTRL_IFACE_DBUS_NEW_H
17 #define CTRL_IFACE_DBUS_NEW_H
20 struct wpa_supplicant
;
23 struct wps_event_fail
;
24 struct wps_credential
;
28 WPAS_DBUS_PROP_AP_SCAN
,
29 WPAS_DBUS_PROP_SCANNING
,
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"
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
,
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
,
117 void wpas_dbus_signal_blob_removed(struct wpa_supplicant
*wpa_s
,
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
)
130 static inline int wpas_dbus_unregister_interface(struct wpa_supplicant
*wpa_s
)
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
,
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
,
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
)
189 static inline int wpas_dbus_unregister_network(struct wpa_supplicant
*wpa_s
,
195 static inline int wpas_dbus_unregister_bss(struct wpa_supplicant
*wpa_s
,
196 u8 bssid
[ETH_ALEN
], unsigned int id
)
201 static inline int wpas_dbus_register_bss(struct wpa_supplicant
*wpa_s
,
202 u8 bssid
[ETH_ALEN
], unsigned int id
)
207 static inline void wpas_dbus_signal_blob_added(struct wpa_supplicant
*wpa_s
,
212 static inline void wpas_dbus_signal_blob_removed(struct wpa_supplicant
*wpa_s
,
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 */