dbus: Add AbortScan method to abort ongoing scan

Signed-off-by: Saurav Babu <saurav.babu@samsung.com>
This commit is contained in:
Saurav Babu 2017-04-13 09:28:11 +05:30 committed by Jouni Malinen
parent 13d36cce89
commit 1939505419
4 changed files with 34 additions and 0 deletions

View file

@ -511,6 +511,10 @@ fi.w1.wpa_supplicant1.CreateInterface.
<h3>SaveConfig ( ) --> nothing</h3>
<p>Save configuration to the configuration file.</p>
</li>
<li>
<h3>AbortScan ( ) --> nothing</h3>
<p>Abort ongoing scan operation.</p>
</li>
<li>
<h3>EAPLogoff ( ) --> nothing</h3>
<p>IEEE 802.1X EAPOL state machine logoff.</p>

View file

@ -3119,6 +3119,12 @@ static const struct wpa_dbus_method_desc wpas_dbus_interface_methods[] = {
}
},
#endif /* CONFIG_NO_CONFIG_WRITE */
{ "AbortScan", WPAS_DBUS_NEW_IFACE_INTERFACE,
(WPADBusMethodHandler) wpas_dbus_handler_abort_scan,
{
END_ARGS
}
},
{ NULL, NULL, NULL, { END_ARGS } }
};

View file

@ -1419,6 +1419,27 @@ out:
}
/*
* wpas_dbus_handler_abort_scan - Request an ongoing scan to be aborted
* @message: Pointer to incoming dbus message
* @wpa_s: wpa_supplicant structure for a network interface
* Returns: Abort failed or no scan in progress DBus error message on failure
* or NULL otherwise.
*
* Handler function for "AbortScan" method call of network interface.
*/
DBusMessage * wpas_dbus_handler_abort_scan(DBusMessage *message,
struct wpa_supplicant *wpa_s)
{
if (wpas_abort_ongoing_scan(wpa_s) < 0)
return dbus_message_new_error(
message, WPAS_DBUS_ERROR_IFACE_SCAN_ERROR,
"Abort failed or no scan in progress");
return NULL;
}
/**
* wpas_dbus_handler_signal_poll - Request immediate signal properties
* @message: Pointer to incoming dbus message

View file

@ -74,6 +74,9 @@ DECLARE_ACCESSOR(wpas_dbus_setter_iface_global);
DBusMessage * wpas_dbus_handler_scan(DBusMessage *message,
struct wpa_supplicant *wpa_s);
DBusMessage * wpas_dbus_handler_abort_scan(DBusMessage *message,
struct wpa_supplicant *wpa_s);
DBusMessage * wpas_dbus_handler_signal_poll(DBusMessage *message,
struct wpa_supplicant *wpa_s);