aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/dbus/dbus_new_handlers.c
diff options
context:
space:
mode:
authorPurushottam Kushwaha <p.kushwaha@samsung.com>2015-11-03 07:01:27 (GMT)
committerJouni Malinen <j@w1.fi>2015-11-15 17:04:15 (GMT)
commit2d0fe6bc4eabdc2396ba8eed1a5dec6a2595bb14 (patch)
tree9a181552470a0cf7b8023653ebc4a62877a7335e /wpa_supplicant/dbus/dbus_new_handlers.c
parenta3dff7dc0ccb8de764a94269318f77332f334889 (diff)
downloadhostap-2d0fe6bc4eabdc2396ba8eed1a5dec6a2595bb14.zip
hostap-2d0fe6bc4eabdc2396ba8eed1a5dec6a2595bb14.tar.gz
hostap-2d0fe6bc4eabdc2396ba8eed1a5dec6a2595bb14.tar.bz2
dbus: Add SaveConfig to update configuration file
This is similar to SAVE_CONFIG on control interface, which allow users to update the configuration file. Signed-off-by: Purushottam Kushwaha <p.kushwaha@samsung.com> Signed-off-by: Mayank Haarit <mayank.h@samsung.com>
Diffstat (limited to 'wpa_supplicant/dbus/dbus_new_handlers.c')
-rw-r--r--wpa_supplicant/dbus/dbus_new_handlers.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/wpa_supplicant/dbus/dbus_new_handlers.c b/wpa_supplicant/dbus/dbus_new_handlers.c
index 16492da..a357dcb 100644
--- a/wpa_supplicant/dbus/dbus_new_handlers.c
+++ b/wpa_supplicant/dbus/dbus_new_handlers.c
@@ -2294,6 +2294,35 @@ DBusMessage * wpas_dbus_handler_tdls_teardown(DBusMessage *message,
#endif /* CONFIG_TDLS */
+#ifndef CONFIG_NO_CONFIG_WRITE
+/**
+ * wpas_dbus_handler_save_config - Save configuration to configuration file
+ * @message: Pointer to incoming dbus message
+ * @wpa_s: wpa_supplicant structure for a network interface
+ * Returns: NULL on Success, Otherwise errror message
+ *
+ * Handler function for "SaveConfig" method call of network interface.
+ */
+DBusMessage * wpas_dbus_handler_save_config(DBusMessage *message,
+ struct wpa_supplicant *wpa_s)
+{
+ int ret;
+
+ if (!wpa_s->conf->update_config) {
+ return wpas_dbus_error_unknown_error(
+ message,
+ "Not allowed to update configuration (update_config=0)");
+ }
+
+ ret = wpa_config_write(wpa_s->confname, wpa_s->conf);
+ if (ret)
+ return wpas_dbus_error_unknown_error(
+ message, "Failed to update configuration");
+ return NULL;
+}
+#endif /* CONFIG_NO_CONFIG_WRITE */
+
+
/**
* wpas_dbus_handler_set_pkcs11_engine_and_module_path - Set PKCS #11 engine and module path
* @message: Pointer to incoming dbus message