aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/dbus
diff options
context:
space:
mode:
authorAvichal Agarwal <avichal.a@samsung.com>2015-06-05 12:46:51 (GMT)
committerJouni Malinen <j@w1.fi>2015-06-10 17:51:30 (GMT)
commit1a2f7ca1b8ef1a12196193d9953ac4536c4d1f3e (patch)
treed308f52a65ee7cbe25a17a81eda4c937f4a71178 /wpa_supplicant/dbus
parent4f369652da41c6aec18e39235d4b16bd36074e35 (diff)
downloadhostap-1a2f7ca1b8ef1a12196193d9953ac4536c4d1f3e.zip
hostap-1a2f7ca1b8ef1a12196193d9953ac4536c4d1f3e.tar.gz
hostap-1a2f7ca1b8ef1a12196193d9953ac4536c4d1f3e.tar.bz2
D-Bus: Add WPS pbc-overlap Event
This sends an Event D-Bus signal with name "pbc-overlap" for WPS-EVENT-OVERLAP. Signed-off-by: Avichal Agarwal <avichal.a@samsung.com>
Diffstat (limited to 'wpa_supplicant/dbus')
-rw-r--r--wpa_supplicant/dbus/dbus_new.c38
-rw-r--r--wpa_supplicant/dbus/dbus_new.h6
2 files changed, 44 insertions, 0 deletions
diff --git a/wpa_supplicant/dbus/dbus_new.c b/wpa_supplicant/dbus/dbus_new.c
index 4318bfb..fb674d4 100644
--- a/wpa_supplicant/dbus/dbus_new.c
+++ b/wpa_supplicant/dbus/dbus_new.c
@@ -525,6 +525,44 @@ void wpas_dbus_signal_network_enabled_changed(struct wpa_supplicant *wpa_s,
#ifdef CONFIG_WPS
/**
+ * wpas_dbus_signal_wps_event_pbc_overlap - Signals PBC overlap WPS event
+ * @wpa_s: %wpa_supplicant network interface data
+ *
+ * Sends Event dbus signal with name "pbc-overlap" and empty dict as arguments
+ */
+void wpas_dbus_signal_wps_event_pbc_overlap(struct wpa_supplicant *wpa_s)
+{
+
+ DBusMessage *msg;
+ DBusMessageIter iter, dict_iter;
+ struct wpas_dbus_priv *iface;
+ char *key = "pbc-overlap";
+
+ iface = wpa_s->global->dbus;
+
+ /* Do nothing if the control interface is not turned on */
+ if (iface == NULL || !wpa_s->dbus_new_path)
+ return;
+
+ msg = dbus_message_new_signal(wpa_s->dbus_new_path,
+ WPAS_DBUS_NEW_IFACE_WPS, "Event");
+ if (msg == NULL)
+ return;
+
+ dbus_message_iter_init_append(msg, &iter);
+
+ if (!dbus_message_iter_append_basic(&iter, DBUS_TYPE_STRING, &key) ||
+ !wpa_dbus_dict_open_write(&iter, &dict_iter) ||
+ !wpa_dbus_dict_close_write(&iter, &dict_iter))
+ wpa_printf(MSG_ERROR, "dbus: Failed to construct signal");
+ else
+ dbus_connection_send(iface->con, msg, NULL);
+
+ dbus_message_unref(msg);
+}
+
+
+/**
* wpas_dbus_signal_wps_event_success - Signals Success WPS event
* @wpa_s: %wpa_supplicant network interface data
*
diff --git a/wpa_supplicant/dbus/dbus_new.h b/wpa_supplicant/dbus/dbus_new.h
index 86bcdbf..7503348 100644
--- a/wpa_supplicant/dbus/dbus_new.h
+++ b/wpa_supplicant/dbus/dbus_new.h
@@ -152,6 +152,7 @@ void wpas_dbus_signal_wps_event_m2d(struct wpa_supplicant *wpa_s,
void wpas_dbus_signal_wps_event_fail(struct wpa_supplicant *wpa_s,
struct wps_event_fail *fail);
void wpas_dbus_signal_wps_event_success(struct wpa_supplicant *wpa_s);
+void wpas_dbus_signal_wps_event_pbc_overlap(struct wpa_supplicant *wpa_s);
int wpas_dbus_register_network(struct wpa_supplicant *wpa_s,
struct wpa_ssid *ssid);
int wpas_dbus_unregister_network(struct wpa_supplicant *wpa_s, int nid);
@@ -297,6 +298,11 @@ static inline void wpas_dbus_signal_wps_event_success(
{
}
+static inline void wpas_dbus_signal_wps_event_pbc_overlap(
+ struct wpa_supplicant *wpa_s)
+{
+}
+
static inline int wpas_dbus_register_network(struct wpa_supplicant *wpa_s,
struct wpa_ssid *ssid)
{