2
* WPA Supplicant / dbus-based control interface
3
* Copyright (c) 2006, Dan Williams <dcbw@redhat.com> and Red Hat, Inc.
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License version 2 as
7
* published by the Free Software Foundation.
9
* Alternatively, this software may be distributed under the terms of BSD
12
* See README and COPYING for more details.
15
#ifndef CTRL_IFACE_DBUS_H
16
#define CTRL_IFACE_DBUS_H
18
struct wps_credential;
20
#ifdef CONFIG_CTRL_IFACE_DBUS
22
#define WPAS_DBUS_OBJECT_PATH_MAX 150
24
#define WPAS_DBUS_SERVICE "fi.epitest.hostap.WPASupplicant"
25
#define WPAS_DBUS_PATH "/fi/epitest/hostap/WPASupplicant"
26
#define WPAS_DBUS_INTERFACE "fi.epitest.hostap.WPASupplicant"
28
#define WPAS_DBUS_PATH_INTERFACES WPAS_DBUS_PATH "/Interfaces"
29
#define WPAS_DBUS_IFACE_INTERFACE WPAS_DBUS_INTERFACE ".Interface"
31
#define WPAS_DBUS_NETWORKS_PART "Networks"
32
#define WPAS_DBUS_IFACE_NETWORK WPAS_DBUS_INTERFACE ".Network"
34
#define WPAS_DBUS_BSSIDS_PART "BSSIDs"
35
#define WPAS_DBUS_IFACE_BSSID WPAS_DBUS_INTERFACE ".BSSID"
39
#define WPAS_ERROR_INVALID_NETWORK \
40
WPAS_DBUS_IFACE_INTERFACE ".InvalidNetwork"
41
#define WPAS_ERROR_INVALID_BSSID \
42
WPAS_DBUS_IFACE_INTERFACE ".InvalidBSSID"
44
#define WPAS_ERROR_INVALID_OPTS \
45
WPAS_DBUS_INTERFACE ".InvalidOptions"
46
#define WPAS_ERROR_INVALID_IFACE \
47
WPAS_DBUS_INTERFACE ".InvalidInterface"
49
#define WPAS_ERROR_ADD_ERROR \
50
WPAS_DBUS_INTERFACE ".AddError"
51
#define WPAS_ERROR_EXISTS_ERROR \
52
WPAS_DBUS_INTERFACE ".ExistsError"
53
#define WPAS_ERROR_REMOVE_ERROR \
54
WPAS_DBUS_INTERFACE ".RemoveError"
56
#define WPAS_ERROR_SCAN_ERROR \
57
WPAS_DBUS_IFACE_INTERFACE ".ScanError"
58
#define WPAS_ERROR_ADD_NETWORK_ERROR \
59
WPAS_DBUS_IFACE_INTERFACE ".AddNetworkError"
60
#define WPAS_ERROR_INTERNAL_ERROR \
61
WPAS_DBUS_IFACE_INTERFACE ".InternalError"
62
#define WPAS_ERROR_REMOVE_NETWORK_ERROR \
63
WPAS_DBUS_IFACE_INTERFACE ".RemoveNetworkError"
65
#define WPAS_ERROR_WPS_PBC_ERROR \
66
WPAS_DBUS_IFACE_INTERFACE ".WpsPbcError"
67
#define WPAS_ERROR_WPS_PIN_ERROR \
68
WPAS_DBUS_IFACE_INTERFACE ".WpsPinError"
69
#define WPAS_ERROR_WPS_REG_ERROR \
70
WPAS_DBUS_IFACE_INTERFACE ".WpsRegError"
72
#define WPAS_DBUS_BSSID_FORMAT "%02x%02x%02x%02x%02x%02x"
75
struct wpa_supplicant;
77
int wpa_supplicant_dbus_ctrl_iface_init(struct wpas_dbus_priv *iface);
78
void wpa_supplicant_dbus_notify_scan_results(struct wpa_supplicant *wpa_s);
79
void wpa_supplicant_dbus_notify_scanning(struct wpa_supplicant *wpa_s);
80
void wpa_supplicant_dbus_notify_state_change(struct wpa_supplicant *wpa_s,
81
enum wpa_states new_state,
82
enum wpa_states old_state);
83
void wpa_supplicant_dbus_notify_wps_cred(struct wpa_supplicant *wpa_s,
84
const struct wps_credential *cred);
86
char * wpas_dbus_decompose_object_path(const char *path, char **network,
89
int wpas_dbus_register_iface(struct wpa_supplicant *wpa_s);
90
int wpas_dbus_unregister_iface(struct wpa_supplicant *wpa_s);
93
/* Methods internal to the dbus control interface */
94
struct wpa_supplicant * wpa_supplicant_get_iface_by_dbus_path(
95
struct wpa_global *global, const char *path);
97
#else /* CONFIG_CTRL_IFACE_DBUS */
100
wpa_supplicant_dbus_notify_scan_results(struct wpa_supplicant *wpa_s)
105
wpa_supplicant_dbus_notify_scanning(struct wpa_supplicant *wpa_s)
109
#define wpa_supplicant_dbus_notify_state_change(w,n,o) do { } while (0)
112
wpa_supplicant_dbus_notify_wps_cred(struct wpa_supplicant *wpa_s,
113
const struct wps_credential *cred)
118
wpas_dbus_register_iface(struct wpa_supplicant *wpa_s)
124
wpas_dbus_unregister_iface(struct wpa_supplicant *wpa_s)
129
#endif /* CONFIG_CTRL_IFACE_DBUS */
131
#endif /* CTRL_IFACE_DBUS_H */