dbus: Remove unnecessary CONFIG_WPS ifdefs from header files
[hostap-gosc2009.git] / wpa_supplicant / dbus / ctrl_iface_dbus_new.h
blob8d56587b93dca2f9f7fabc96ed1a6bc7cd25a1a8
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, 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;
26 enum wpas_dbus_prop {
27 WPAS_DBUS_PROP_AP_SCAN,
28 WPAS_DBUS_PROP_SCANNING,
29 WPAS_DBUS_PROP_CURRENT_BSS,
30 WPAS_DBUS_PROP_CURRENT_NETWORK,
33 struct wpas_dbus_callbacks {
34 struct ctrl_iface_dbus_new_priv * (*dbus_ctrl_init)(
35 struct wpa_global *global);
37 void (*dbus_ctrl_deinit)(struct ctrl_iface_dbus_new_priv *iface);
39 void (*signal_interface_created)(struct wpa_supplicant *wpa_s);
40 void (*signal_interface_removed)(struct wpa_supplicant *wpa_s);
42 int (*register_interface)(struct wpa_supplicant *wpa_s);
43 int (*unregister_interface)(struct wpa_supplicant *wpa_s);
45 void (*signal_scan_done)(struct wpa_supplicant *wpa_s, int success);
47 void (*signal_blob_added)(struct wpa_supplicant *wpa_s,
48 const char *name);
49 void (*signal_blob_removed)(struct wpa_supplicant *wpa_s,
50 const char *name);
52 void (*signal_network_selected)(struct wpa_supplicant *wpa_s, int id);
54 void (*signal_state_changed)(struct wpa_supplicant *wpa_s,
55 wpa_states new_state,
56 wpa_states old_state);
58 int (*register_network)(struct wpa_supplicant *wpa_s,
59 struct wpa_ssid *ssid);
60 int (*unregister_network)(struct wpa_supplicant *wpa_s,
61 int nid);
63 void (*signal_network_enabled_changed)(struct wpa_supplicant *wpa_s,
64 struct wpa_ssid *ssid);
66 int (*register_bss)(struct wpa_supplicant *wpa_s, u8 bssid[ETH_ALEN]);
67 int (*unregister_bss)(struct wpa_supplicant *wpa_s,
68 u8 bssid[ETH_ALEN]);
70 void (*signal_prop_changed)(struct wpa_supplicant *wpa_s,
71 enum wpas_dbus_prop property);
72 void (*signal_debug_params_changed)(struct wpa_global *global);
74 void (*signal_wps_event_success)(struct wpa_supplicant *wpa_s);
75 void (*signal_wps_event_fail)(struct wpa_supplicant *wpa_s,
76 struct wps_event_fail *fail);
77 void (*signal_wps_event_m2d)(struct wpa_supplicant *wpa_s,
78 struct wps_event_m2d *m2d);
79 void (*signal_wps_credentials)(struct wpa_supplicant *wpa_s,
80 const struct wps_credential *cred);
84 #ifdef CONFIG_CTRL_IFACE_DBUS_NEW
86 #include <dbus/dbus.h>
88 #define WPAS_DBUS_OBJECT_PATH_MAX 150
90 #define WPAS_DBUS_NEW_SERVICE "fi.w1.wpa_supplicant1"
91 #define WPAS_DBUS_NEW_PATH "/fi/w1/wpa_supplicant1"
92 #define WPAS_DBUS_NEW_INTERFACE "fi.w1.wpa_supplicant1"
94 #define WPAS_DBUS_NEW_PATH_INTERFACES WPAS_DBUS_NEW_PATH "/Interfaces"
95 #define WPAS_DBUS_NEW_IFACE_INTERFACE WPAS_DBUS_NEW_INTERFACE ".Interface"
96 #define WPAS_DBUS_NEW_IFACE_WPS WPAS_DBUS_NEW_IFACE_INTERFACE ".WPS"
98 #define WPAS_DBUS_NEW_NETWORKS_PART "Networks"
99 #define WPAS_DBUS_NEW_IFACE_NETWORK WPAS_DBUS_NEW_IFACE_INTERFACE ".Network"
101 #define WPAS_DBUS_NEW_BSSIDS_PART "BSSs"
102 #define WPAS_DBUS_NEW_IFACE_BSSID WPAS_DBUS_NEW_IFACE_INTERFACE ".BSS"
105 /* Errors */
106 #define WPAS_DBUS_ERROR_UNKNOWN_ERROR \
107 WPAS_DBUS_NEW_INTERFACE ".UnknownError"
108 #define WPAS_DBUS_ERROR_INVALID_ARGS \
109 WPAS_DBUS_NEW_INTERFACE ".InvalidArgs"
111 #define WPAS_DBUS_ERROR_IFACE_EXISTS \
112 WPAS_DBUS_NEW_INTERFACE ".InterfaceExists"
113 #define WPAS_DBUS_ERROR_IFACE_UNKNOWN \
114 WPAS_DBUS_NEW_INTERFACE ".InterfaceUnknown"
116 #define WPAS_DBUS_ERROR_NOT_CONNECTED \
117 WPAS_DBUS_NEW_IFACE_INTERFACE ".NotConnected"
118 #define WPAS_DBUS_ERROR_NETWORK_UNKNOWN \
119 WPAS_DBUS_NEW_IFACE_INTERFACE ".NetworkUnknown"
121 #define WPAS_DBUS_ERROR_BLOB_EXISTS \
122 WPAS_DBUS_NEW_IFACE_INTERFACE ".BlobExists"
123 #define WPAS_DBUS_ERROR_BLOB_UNKNOWN \
124 WPAS_DBUS_NEW_IFACE_INTERFACE ".BlobUnknown"
126 #define WPAS_DBUS_BSSID_FORMAT "%02x%02x%02x%02x%02x%02x"
128 struct wpas_dbus_callbacks * wpas_dbus_get_callbacks(void);
129 const char * wpas_dbus_get_path(struct wpa_supplicant *wpa_s);
131 #else /* CONFIG_CTRL_IFACE_DBUS_NEW */
133 static inline struct wpas_dbus_callbacks * wpas_dbus_get_callbacks(void)
135 return NULL;
138 #endif /* CONFIG_CTRL_IFACE_DBUS_NEW */
140 #endif /* CTRL_IFACE_DBUS_H_NEW */