aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/dbus/dbus_new_handlers.c
diff options
context:
space:
mode:
authorMAYANK HAARIT <mayank.h@samsung.com>2015-06-12 11:27:19 (GMT)
committerJouni Malinen <j@w1.fi>2015-06-14 08:33:54 (GMT)
commitb649c0afd4c5adf04fe5986b8bb2d70746ce7fac (patch)
tree44b58a42029bd6f9b1459097e232487d4594677a /wpa_supplicant/dbus/dbus_new_handlers.c
parentf4a234a1696d44bde31fdfdffcd06cbb27eb631d (diff)
downloadhostap-b649c0afd4c5adf04fe5986b8bb2d70746ce7fac.zip
hostap-b649c0afd4c5adf04fe5986b8bb2d70746ce7fac.tar.gz
hostap-b649c0afd4c5adf04fe5986b8bb2d70746ce7fac.tar.bz2
dbus: Add Reconnect command to D-Bus Interface
This has same behavior as the ctrl_iface RECONNECT command. Signed-off-by: Mayank Haarit <mayank.h@samsung.com> Signed-off-by: Purushottam Kushwaha <p.kushwaha@samsung.com>
Diffstat (limited to 'wpa_supplicant/dbus/dbus_new_handlers.c')
-rw-r--r--wpa_supplicant/dbus/dbus_new_handlers.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/wpa_supplicant/dbus/dbus_new_handlers.c b/wpa_supplicant/dbus/dbus_new_handlers.c
index 97db9a8..2a7e2cf 100644
--- a/wpa_supplicant/dbus/dbus_new_handlers.c
+++ b/wpa_supplicant/dbus/dbus_new_handlers.c
@@ -1601,6 +1601,30 @@ DBusMessage * wpas_dbus_handler_reattach(DBusMessage *message,
/**
+ * wpas_dbus_handler_reconnect - Reconnect if disconnected
+ * @message: Pointer to incoming dbus message
+ * @wpa_s: wpa_supplicant structure for a network interface
+ * Returns: InterfaceDisabled DBus error message if disabled
+ * or NULL otherwise.
+ *
+ * Handler function for "Reconnect" method call of network interface.
+ */
+DBusMessage * wpas_dbus_handler_reconnect(DBusMessage *message,
+ struct wpa_supplicant *wpa_s)
+{
+ if (wpa_s->wpa_state == WPA_INTERFACE_DISABLED) {
+ return dbus_message_new_error(message,
+ WPAS_DBUS_ERROR_IFACE_DISABLED,
+ "This interface is disabled");
+ }
+
+ if (wpa_s->disconnected)
+ wpas_request_connection(wpa_s);
+ return NULL;
+}
+
+
+/**
* wpas_dbus_handler_remove_network - Remove a configured network
* @message: Pointer to incoming dbus message
* @wpa_s: wpa_supplicant structure for a network interface