]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
D-Bus: Add ConfigFile parameter into the interface properties
authorJose Blanquicet <blanquicet@gmail.com>
Tue, 23 Aug 2016 12:16:00 +0000 (14:16 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 29 Aug 2016 08:43:53 +0000 (11:43 +0300)
This patch aims to expose the configuration file path as an interface
property, like is done with the driver and the bridge name. Doing so,
higher layer programs become responsible to recreate interfaces with the
correct configuration file path when programs need to remove them.

Signed-off-by: Jose Blanquicet <blanquicet@gmail.com>
doc/dbus.doxygen
wpa_supplicant/dbus/dbus_new.c
wpa_supplicant/dbus/dbus_new_handlers.c
wpa_supplicant/dbus/dbus_new_handlers.h

index e6c70f9750114276762cd0a087847757bcd8e0b6..b0e67d45b0376d875824d61bfddbc6c483eb58fc 100644 (file)
@@ -680,6 +680,11 @@ fi.w1.wpa_supplicant1.CreateInterface.
        <p>Name of driver used by the interface, e.g., nl80211.</p>
       </li>
 
+      <li>
+       <h3>ConfigFile - s - (read)</h3>
+       <p>Configuration file path. Returns an empty string if no configuration file is in use.</p>
+      </li>
+
       <li>
        <h3>CurrentBSS - o - (read)</h3>
        <p>Path to D-Bus object representing BSS which wpa_supplicant is associated with, or "/" if is not associated at all.</p>
index 6d73bbc72d779ab30f1786e1a9928ce245dc48bb..27b3012aede8e5073e84f3779d7886afdef7651d 100644 (file)
@@ -3158,6 +3158,11 @@ static const struct wpa_dbus_property_desc wpas_dbus_interface_properties[] = {
          NULL,
          NULL
        },
+       { "ConfigFile", WPAS_DBUS_NEW_IFACE_INTERFACE, "s",
+         wpas_dbus_getter_config_file,
+         NULL,
+         NULL
+       },
        { "CurrentBSS", WPAS_DBUS_NEW_IFACE_INTERFACE, "o",
          wpas_dbus_getter_current_bss,
          NULL,
index f185f2786611d2c752eca66293b5e641161f779b..e11dd36ca23c7ad7d9f212ed5b279daccdc152b2 100644 (file)
@@ -3239,6 +3239,30 @@ dbus_bool_t wpas_dbus_getter_bridge_ifname(
 }
 
 
+/**
+ * wpas_dbus_getter_config_file - Get interface configuration file path
+ * @iter: Pointer to incoming dbus message iter
+ * @error: Location to store error on failure
+ * @user_data: Function specific data
+ * Returns: TRUE on success, FALSE on failure
+ *
+ * Getter for "ConfigFile" property.
+ */
+dbus_bool_t wpas_dbus_getter_config_file(
+       const struct wpa_dbus_property_desc *property_desc,
+       DBusMessageIter *iter, DBusError *error, void *user_data)
+{
+       struct wpa_supplicant *wpa_s = user_data;
+       char *confname = "";
+
+       if (wpa_s->confname)
+               confname = wpa_s->confname;
+
+       return wpas_dbus_simple_property_getter(iter, DBUS_TYPE_STRING,
+                                               &confname, error);
+}
+
+
 /**
  * wpas_dbus_getter_bsss - Get array of BSSs objects
  * @iter: Pointer to incoming dbus message iter
index cd299c050c09f87851d3162c6fba95d021cb1198..1d6235d6f3e4cfa0d0753bd0486dce23226dcbda 100644 (file)
@@ -150,6 +150,7 @@ DECLARE_ACCESSOR(wpas_dbus_setter_scan_interval);
 DECLARE_ACCESSOR(wpas_dbus_getter_ifname);
 DECLARE_ACCESSOR(wpas_dbus_getter_driver);
 DECLARE_ACCESSOR(wpas_dbus_getter_bridge_ifname);
+DECLARE_ACCESSOR(wpas_dbus_getter_config_file);
 DECLARE_ACCESSOR(wpas_dbus_getter_current_bss);
 DECLARE_ACCESSOR(wpas_dbus_getter_current_network);
 DECLARE_ACCESSOR(wpas_dbus_getter_current_auth_mode);