]> git.ipfire.org Git - thirdparty/hostap.git/blobdiff - wpa_supplicant/dbus/dbus_new.c
Export disconnect reason code to dbus
[thirdparty/hostap.git] / wpa_supplicant / dbus / dbus_new.c
index 121033f6579c1fe5675e876b67467827cef93010..fcdf995e3b5635da1f223428a1a1398cb4cbb516 100644 (file)
 #include "../config.h"
 #include "../wpa_supplicant_i.h"
 #include "../bss.h"
+#include "../wpas_glue.h"
 #include "dbus_new_helpers.h"
 #include "dbus_dict_helpers.h"
 #include "dbus_new.h"
 #include "dbus_new_handlers.h"
-#include "dbus_common.h"
 #include "dbus_common_i.h"
 #include "dbus_new_handlers_p2p.h"
 #include "p2p/p2p.h"
 
+#ifdef CONFIG_AP /* until needed by something else */
+
+/*
+ * NameOwnerChanged handling
+ *
+ * Some services we provide allow an application to register for
+ * a signal that it needs. While it can also unregister, we must
+ * be prepared for the case where the application simply crashes
+ * and thus doesn't clean up properly. The way to handle this in
+ * DBus is to register for the NameOwnerChanged signal which will
+ * signal an owner change to NULL if the peer closes the socket
+ * for whatever reason.
+ *
+ * Handle this signal via a filter function whenever necessary.
+ * The code below also handles refcounting in case in the future
+ * there will be multiple instances of this subscription scheme.
+ */
+static const char wpas_dbus_noc_filter_str[] =
+       "interface=org.freedesktop.DBus,member=NameOwnerChanged";
+
+
+static DBusHandlerResult noc_filter(DBusConnection *conn,
+                                   DBusMessage *message, void *data)
+{
+       struct wpas_dbus_priv *priv = data;
+
+       if (dbus_message_get_type(message) != DBUS_MESSAGE_TYPE_SIGNAL)
+               return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+
+       if (dbus_message_is_signal(message, DBUS_INTERFACE_DBUS,
+                                  "NameOwnerChanged")) {
+               const char *name;
+               const char *prev_owner;
+               const char *new_owner;
+               DBusError derr;
+               struct wpa_supplicant *wpa_s;
+
+               dbus_error_init(&derr);
+
+               if (!dbus_message_get_args(message, &derr,
+                                          DBUS_TYPE_STRING, &name,
+                                          DBUS_TYPE_STRING, &prev_owner,
+                                          DBUS_TYPE_STRING, &new_owner,
+                                          DBUS_TYPE_INVALID)) {
+                       /* Ignore this error */
+                       dbus_error_free(&derr);
+                       return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+               }
+
+               for (wpa_s = priv->global->ifaces; wpa_s; wpa_s = wpa_s->next)
+               {
+                       if (wpa_s->preq_notify_peer != NULL &&
+                           os_strcmp(name, wpa_s->preq_notify_peer) == 0 &&
+                           (new_owner == NULL || os_strlen(new_owner) == 0)) {
+                               /* probe request owner disconnected */
+                               os_free(wpa_s->preq_notify_peer);
+                               wpa_s->preq_notify_peer = NULL;
+                               wpas_dbus_unsubscribe_noc(priv);
+                       }
+               }
+       }
+
+       return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+}
+
+
+void wpas_dbus_subscribe_noc(struct wpas_dbus_priv *priv)
+{
+       priv->dbus_noc_refcnt++;
+       if (priv->dbus_noc_refcnt > 1)
+               return;
+
+       if (!dbus_connection_add_filter(priv->con, noc_filter, priv, NULL)) {
+               wpa_printf(MSG_ERROR, "dbus: failed to add filter");
+               return;
+       }
+
+       dbus_bus_add_match(priv->con, wpas_dbus_noc_filter_str, NULL);
+}
+
+
+void wpas_dbus_unsubscribe_noc(struct wpas_dbus_priv *priv)
+{
+       priv->dbus_noc_refcnt--;
+       if (priv->dbus_noc_refcnt > 0)
+               return;
+
+       dbus_bus_remove_match(priv->con, wpas_dbus_noc_filter_str, NULL);
+       dbus_connection_remove_filter(priv->con, noc_filter, priv);
+}
+
+#endif /* CONFIG_AP */
+
 
 /**
  * wpas_dbus_signal_interface - Send a interface related event signal
@@ -381,6 +474,67 @@ void wpas_dbus_signal_network_selected(struct wpa_supplicant *wpa_s, int id)
 }
 
 
+/**
+ * wpas_dbus_signal_network_request - Indicate that additional information
+ * (EAP password, etc.) is required to complete the association to this SSID
+ * @wpa_s: %wpa_supplicant network interface data
+ * @rtype: The specific additional information required
+ * @default_text: Optional description of required information
+ *
+ * Request additional information or passwords to complete an association
+ * request.
+ */
+void wpas_dbus_signal_network_request(struct wpa_supplicant *wpa_s,
+                                     struct wpa_ssid *ssid,
+                                     enum wpa_ctrl_req_type rtype,
+                                     const char *default_txt)
+{
+       struct wpas_dbus_priv *iface;
+       DBusMessage *msg;
+       DBusMessageIter iter;
+       char net_obj_path[WPAS_DBUS_OBJECT_PATH_MAX];
+       const char *field, *txt = NULL, *net_ptr;
+
+       iface = wpa_s->global->dbus;
+
+       /* Do nothing if the control interface is not turned on */
+       if (iface == NULL)
+               return;
+
+       field = wpa_supplicant_ctrl_req_to_string(rtype, default_txt, &txt);
+       if (field == NULL)
+               return;
+
+       msg = dbus_message_new_signal(wpa_s->dbus_new_path,
+                                     WPAS_DBUS_NEW_IFACE_INTERFACE,
+                                     "NetworkRequest");
+       if (msg == NULL)
+               return;
+
+       os_snprintf(net_obj_path, WPAS_DBUS_OBJECT_PATH_MAX,
+                   "%s/" WPAS_DBUS_NEW_NETWORKS_PART "/%u",
+                   wpa_s->dbus_new_path, ssid->id);
+       net_ptr = &net_obj_path[0];
+
+       dbus_message_iter_init_append(msg, &iter);
+       if (!dbus_message_iter_append_basic(&iter, DBUS_TYPE_OBJECT_PATH,
+                                           &net_ptr))
+               goto err;
+       if (!dbus_message_iter_append_basic(&iter, DBUS_TYPE_STRING, &field))
+               goto err;
+       if (!dbus_message_iter_append_basic(&iter, DBUS_TYPE_STRING, &txt))
+               goto err;
+
+       dbus_connection_send(iface->con, msg, NULL);
+       dbus_message_unref(msg);
+       return;
+
+err:
+       wpa_printf(MSG_ERROR, "dbus: Failed to construct signal");
+       dbus_message_unref(msg);
+}
+
+
 /**
  * wpas_dbus_signal_network_enabled_changed - Signals Enabled property changes
  * @wpa_s: %wpa_supplicant network interface data
@@ -686,6 +840,41 @@ nomem:
        dbus_message_unref(msg);
 }
 
+
+void wpas_dbus_signal_eap_status(struct wpa_supplicant *wpa_s,
+                                const char *status, const char *parameter)
+{
+       struct wpas_dbus_priv *iface;
+       DBusMessage *msg;
+       DBusMessageIter iter;
+
+       iface = wpa_s->global->dbus;
+
+       /* Do nothing if the control interface is not turned on */
+       if (iface == NULL)
+               return;
+
+       msg = dbus_message_new_signal(wpa_s->dbus_new_path,
+                                     WPAS_DBUS_NEW_IFACE_INTERFACE,
+                                     "EAP");
+       if (msg == NULL)
+               return;
+
+       dbus_message_iter_init_append(msg, &iter);
+
+       if (!dbus_message_iter_append_basic(&iter, DBUS_TYPE_STRING, &status)
+           ||
+           !dbus_message_iter_append_basic(&iter, DBUS_TYPE_STRING,
+                                           &parameter))
+               goto nomem;
+
+       dbus_connection_send(iface->con, msg, NULL);
+
+nomem:
+       dbus_message_unref(msg);
+}
+
+
 #ifdef CONFIG_P2P
 
 /**
@@ -806,7 +995,7 @@ void wpas_dbus_signal_p2p_provision_discovery(struct wpa_supplicant *wpa_s,
                return;
 
        /* Check if this is a known peer */
-       if (p2p_get_peer_info(wpa_s->global->p2p, dev_addr, 0, NULL, 0) < 0)
+       if (!p2p_peer_known(wpa_s->global->p2p, dev_addr))
                goto error;
 
        os_snprintf(peer_obj_path, WPAS_DBUS_OBJECT_PATH_MAX,
@@ -892,7 +1081,7 @@ static int wpas_dbus_get_group_obj_path(struct wpa_supplicant *wpa_s,
        if (os_memcmp(ssid->ssid, P2P_WILDCARD_SSID, P2P_WILDCARD_SSID_LEN))
                return -1;
 
-       memcpy(group_name, ssid->ssid + P2P_WILDCARD_SSID_LEN, 2);
+       os_memcpy(group_name, ssid->ssid + P2P_WILDCARD_SSID_LEN, 2);
        group_name[2] = '\0';
 
        os_snprintf(group_obj_path, WPAS_DBUS_OBJECT_PATH_MAX,
@@ -905,7 +1094,7 @@ static int wpas_dbus_get_group_obj_path(struct wpa_supplicant *wpa_s,
 
 /**
  * wpas_dbus_signal_p2p_group_started - Signals P2P group has
- * started.Emitted when a group is succesfully started
+ * started. Emitted when a group is successfully started
  * irrespective of the role (client/GO) of the current device
  *
  * @wpa_s: %wpa_supplicant network interface data
@@ -983,35 +1172,118 @@ nomem:
  * on status.
  * @status: Status of the GO neg request. 0 for success, other for errors.
  */
-void wpas_dbus_signal_p2p_go_neg_resp(struct wpa_supplicant *wpa_s, int status)
+void wpas_dbus_signal_p2p_go_neg_resp(struct wpa_supplicant *wpa_s,
+                                     struct p2p_go_neg_results *res)
 {
        DBusMessage *msg;
-       DBusMessageIter iter;
+       DBusMessageIter iter, dict_iter;
+       DBusMessageIter iter_dict_entry, iter_dict_val, iter_dict_array;
        struct wpas_dbus_priv *iface;
+       char peer_obj_path[WPAS_DBUS_OBJECT_PATH_MAX], *path;
+       dbus_int32_t freqs[P2P_MAX_CHANNELS];
+       dbus_int32_t *f_array = freqs;
+
 
        iface = wpa_s->global->dbus;
 
+       os_memset(freqs, 0, sizeof(freqs));
        /* Do nothing if the control interface is not turned on */
        if (iface == NULL)
                return;
 
+       os_snprintf(peer_obj_path, WPAS_DBUS_OBJECT_PATH_MAX,
+                   "%s/" WPAS_DBUS_NEW_P2P_PEERS_PART "/" COMPACT_MACSTR,
+                   wpa_s->dbus_new_path, MAC2STR(res->peer_device_addr));
+       path = peer_obj_path;
+
        msg = dbus_message_new_signal(wpa_s->dbus_new_path,
                                      WPAS_DBUS_NEW_IFACE_P2PDEVICE,
-                                     status ? "GONegotiationFailure" :
-                                              "GONegotiationSuccess");
+                                     res->status ? "GONegotiationFailure" :
+                                                   "GONegotiationSuccess");
        if (msg == NULL)
                return;
 
-       if (status) {
-               dbus_message_iter_init_append(msg, &iter);
-               if (!dbus_message_iter_append_basic(&iter, DBUS_TYPE_INT32,
-                                                   &status)) {
-                       wpa_printf(MSG_ERROR,
-                                  "dbus: Failed to construct signal");
+       dbus_message_iter_init_append(msg, &iter);
+       if (!wpa_dbus_dict_open_write(&iter, &dict_iter))
+               goto err;
+       if (!wpa_dbus_dict_append_object_path(&dict_iter, "peer_object",
+                                             path) ||
+           !wpa_dbus_dict_append_int32(&dict_iter, "status", res->status))
+               goto err;
+
+       if (!res->status) {
+               int i = 0;
+               int freq_list_num = 0;
+
+               if (res->role_go) {
+                       if (!wpa_dbus_dict_append_byte_array(
+                                   &dict_iter, "passphrase",
+                                   (const char *) res->passphrase,
+                                   sizeof(res->passphrase)))
+                               goto err;
+               }
+
+               if (!wpa_dbus_dict_append_string(&dict_iter, "role_go",
+                                                res->role_go ? "GO" :
+                                                "client") ||
+                   !wpa_dbus_dict_append_int32(&dict_iter, "frequency",
+                                               res->freq) ||
+                   !wpa_dbus_dict_append_byte_array(&dict_iter, "ssid",
+                                                    (const char *) res->ssid,
+                                                    res->ssid_len) ||
+                   !wpa_dbus_dict_append_byte_array(&dict_iter,
+                                                    "peer_device_addr",
+                                                    (const char *)
+                                                    res->peer_device_addr,
+                                                    ETH_ALEN) ||
+                   !wpa_dbus_dict_append_byte_array(&dict_iter,
+                                                    "peer_interface_addr",
+                                                    (const char *)
+                                                    res->peer_interface_addr,
+                                                    ETH_ALEN) ||
+                   !wpa_dbus_dict_append_string(&dict_iter, "wps_method",
+                                                p2p_wps_method_text(
+                                                        res->wps_method)))
                        goto err;
+
+               for (i = 0; i < P2P_MAX_CHANNELS; i++) {
+                       if (res->freq_list[i]) {
+                               freqs[i] = res->freq_list[i];
+                               freq_list_num++;
+                       }
                }
+
+               if (!wpa_dbus_dict_begin_array(&dict_iter,
+                                              "frequency_list",
+                                              DBUS_TYPE_INT32_AS_STRING,
+                                              &iter_dict_entry,
+                                              &iter_dict_val,
+                                              &iter_dict_array))
+                       goto err;
+
+               if (!dbus_message_iter_append_fixed_array(&iter_dict_array,
+                                                         DBUS_TYPE_INT32,
+                                                         &f_array,
+                                                         freq_list_num))
+                       goto err;
+
+               if (!wpa_dbus_dict_end_array(&dict_iter,
+                                            &iter_dict_entry,
+                                            &iter_dict_val,
+                                            &iter_dict_array))
+                       goto err;
+
+               if (!wpa_dbus_dict_append_int32(&dict_iter, "persistent_group",
+                                               res->persistent_group) ||
+                   !wpa_dbus_dict_append_uint32(&dict_iter,
+                                                "peer_config_timeout",
+                                                res->peer_config_timeout))
+                       goto err;
        }
 
+       if (!wpa_dbus_dict_close_write(&iter, &dict_iter))
+               goto err;
+
        dbus_connection_send(iface->con, msg, NULL);
 err:
        dbus_message_unref(msg);
@@ -1213,7 +1485,7 @@ void wpas_dbus_signal_p2p_sd_request(struct wpa_supplicant *wpa_s,
                return;
 
        /* Check if this is a known peer */
-       if (p2p_get_peer_info(wpa_s->global->p2p, sa, 0, NULL, 0) < 0)
+       if (!p2p_peer_known(wpa_s->global->p2p, sa))
                goto error;
 
        os_snprintf(peer_obj_path, WPAS_DBUS_OBJECT_PATH_MAX,
@@ -1282,7 +1554,7 @@ void wpas_dbus_signal_p2p_sd_response(struct wpa_supplicant *wpa_s,
                return;
 
        /* Check if this is a known peer */
-       if (p2p_get_peer_info(wpa_s->global->p2p, sa, 0, NULL, 0) < 0)
+       if (!p2p_peer_known(wpa_s->global->p2p, sa))
                goto error;
 
        os_snprintf(peer_obj_path, WPAS_DBUS_OBJECT_PATH_MAX,
@@ -1462,41 +1734,39 @@ void wpas_dbus_signal_p2p_wps_failed(struct wpa_supplicant *wpa_s,
 void wpas_dbus_signal_prop_changed(struct wpa_supplicant *wpa_s,
                                   enum wpas_dbus_prop property)
 {
-       WPADBusPropertyAccessor getter;
        char *prop;
+       dbus_bool_t flush;
 
        if (wpa_s->dbus_new_path == NULL)
                return; /* Skip signal since D-Bus setup is not yet ready */
 
+       flush = FALSE;
        switch (property) {
        case WPAS_DBUS_PROP_AP_SCAN:
-               getter = wpas_dbus_getter_ap_scan;
                prop = "ApScan";
                break;
        case WPAS_DBUS_PROP_SCANNING:
-               getter = wpas_dbus_getter_scanning;
                prop = "Scanning";
                break;
        case WPAS_DBUS_PROP_STATE:
-               getter = wpas_dbus_getter_state;
                prop = "State";
                break;
        case WPAS_DBUS_PROP_CURRENT_BSS:
-               getter = wpas_dbus_getter_current_bss;
                prop = "CurrentBSS";
                break;
        case WPAS_DBUS_PROP_CURRENT_NETWORK:
-               getter = wpas_dbus_getter_current_network;
                prop = "CurrentNetwork";
                break;
        case WPAS_DBUS_PROP_BSSS:
-               getter = wpas_dbus_getter_bsss;
                prop = "BSSs";
                break;
        case WPAS_DBUS_PROP_CURRENT_AUTH_MODE:
-               getter = wpas_dbus_getter_current_auth_mode;
                prop = "CurrentAuthMode";
                break;
+       case WPAS_DBUS_PROP_DISCONNECT_REASON:
+               prop = "DisconnectReason";
+               flush = TRUE;
+               break;
        default:
                wpa_printf(MSG_ERROR, "dbus: %s: Unknown Property value %d",
                           __func__, property);
@@ -1506,6 +1776,10 @@ void wpas_dbus_signal_prop_changed(struct wpa_supplicant *wpa_s,
        wpa_dbus_mark_property_changed(wpa_s->global->dbus,
                                       wpa_s->dbus_new_path,
                                       WPAS_DBUS_NEW_IFACE_INTERFACE, prop);
+       if (flush) {
+               wpa_dbus_flush_object_changed_properties(
+                       wpa_s->global->dbus->con, wpa_s->dbus_new_path);
+       }
 }
 
 
@@ -1656,36 +1930,40 @@ static const struct wpa_dbus_method_desc wpas_dbus_global_methods[] = {
                  END_ARGS
          }
        },
+#ifdef CONFIG_AUTOSCAN
+       { "AutoScan", WPAS_DBUS_NEW_IFACE_INTERFACE,
+         (WPADBusMethodHandler) &wpas_dbus_handler_autoscan,
+         {
+                 { "arg", "s", ARG_IN },
+                 END_ARGS
+         }
+       },
+#endif /* CONFIG_AUTOSCAN */
        { NULL, NULL, NULL, { END_ARGS } }
 };
 
 static const struct wpa_dbus_property_desc wpas_dbus_global_properties[] = {
        { "DebugLevel", WPAS_DBUS_NEW_INTERFACE, "s",
          wpas_dbus_getter_debug_level,
-         wpas_dbus_setter_debug_level,
-         RW
+         wpas_dbus_setter_debug_level
        },
        { "DebugTimestamp", WPAS_DBUS_NEW_INTERFACE, "b",
          wpas_dbus_getter_debug_timestamp,
-         wpas_dbus_setter_debug_timestamp,
-         RW
+         wpas_dbus_setter_debug_timestamp
        },
        { "DebugShowKeys", WPAS_DBUS_NEW_INTERFACE, "b",
          wpas_dbus_getter_debug_show_keys,
-         wpas_dbus_setter_debug_show_keys,
-         RW
+         wpas_dbus_setter_debug_show_keys
        },
        { "Interfaces", WPAS_DBUS_NEW_INTERFACE, "ao",
          wpas_dbus_getter_interfaces,
-         NULL,
-         R
+         NULL
        },
        { "EapMethods", WPAS_DBUS_NEW_INTERFACE, "as",
          wpas_dbus_getter_eap_methods,
-         NULL,
-         R
+         NULL
        },
-       { NULL, NULL, NULL, NULL, NULL, 0 }
+       { NULL, NULL, NULL, NULL, NULL }
 };
 
 static const struct wpa_dbus_signal_desc wpas_dbus_global_signals[] = {
@@ -1702,6 +1980,15 @@ static const struct wpa_dbus_signal_desc wpas_dbus_global_signals[] = {
                  END_ARGS
          }
        },
+       { "NetworkRequest", WPAS_DBUS_NEW_IFACE_INTERFACE,
+         {
+                 { "path", "o", ARG_OUT },
+                 { "field", "s", ARG_OUT },
+                 { "text", "s", ARG_OUT },
+                 END_ARGS
+         }
+       },
+       /* Deprecated: use org.freedesktop.DBus.Properties.PropertiesChanged */
        { "PropertiesChanged", WPAS_DBUS_NEW_INTERFACE,
          {
                  { "properties", "a{sv}", ARG_OUT },
@@ -1779,19 +2066,18 @@ static void wpa_dbus_free(void *ptr)
 static const struct wpa_dbus_property_desc wpas_dbus_network_properties[] = {
        { "Properties", WPAS_DBUS_NEW_IFACE_NETWORK, "a{sv}",
          wpas_dbus_getter_network_properties,
-         wpas_dbus_setter_network_properties,
-         RW
+         wpas_dbus_setter_network_properties
        },
        { "Enabled", WPAS_DBUS_NEW_IFACE_NETWORK, "b",
          wpas_dbus_getter_enabled,
-         wpas_dbus_setter_enabled,
-         RW
+         wpas_dbus_setter_enabled
        },
-       { NULL, NULL, NULL, NULL, NULL, 0 }
+       { NULL, NULL, NULL, NULL, NULL }
 };
 
 
 static const struct wpa_dbus_signal_desc wpas_dbus_network_signals[] = {
+       /* Deprecated: use org.freedesktop.DBus.Properties.PropertiesChanged */
        { "PropertiesChanged", WPAS_DBUS_NEW_IFACE_NETWORK,
          {
                  { "properties", "a{sv}", ARG_OUT },
@@ -1890,19 +2176,18 @@ int wpas_dbus_unregister_network(struct wpa_supplicant *wpa_s, int nid)
        struct wpas_dbus_priv *ctrl_iface;
        char net_obj_path[WPAS_DBUS_OBJECT_PATH_MAX];
        int ret;
+#ifdef CONFIG_P2P
        struct wpa_ssid *ssid;
 
        ssid = wpa_config_get_network(wpa_s->conf, nid);
 
-#ifdef CONFIG_P2P
        /* If it is a persistent group unregister it as such */
        if (ssid && network_is_persistent_group(ssid))
                return wpas_dbus_unregister_persistent_group(wpa_s, nid);
 #endif /* CONFIG_P2P */
 
        /* Do nothing if the control interface is not turned on */
-       if (wpa_s == NULL || wpa_s->global == NULL ||
-           wpa_s->dbus_new_path == NULL)
+       if (wpa_s->global == NULL || wpa_s->dbus_new_path == NULL)
                return 0;
        ctrl_iface = wpa_s->global->dbus;
        if (ctrl_iface == NULL)
@@ -1926,59 +2211,50 @@ int wpas_dbus_unregister_network(struct wpa_supplicant *wpa_s, int nid)
 static const struct wpa_dbus_property_desc wpas_dbus_bss_properties[] = {
        { "SSID", WPAS_DBUS_NEW_IFACE_BSS, "ay",
          wpas_dbus_getter_bss_ssid,
-         NULL,
-         R
+         NULL
        },
        { "BSSID", WPAS_DBUS_NEW_IFACE_BSS, "ay",
          wpas_dbus_getter_bss_bssid,
-         NULL,
-         R
+         NULL
        },
        { "Privacy", WPAS_DBUS_NEW_IFACE_BSS, "b",
          wpas_dbus_getter_bss_privacy,
-         NULL,
-         R
+         NULL
        },
        { "Mode", WPAS_DBUS_NEW_IFACE_BSS, "s",
          wpas_dbus_getter_bss_mode,
-         NULL,
-         R
+         NULL
        },
        { "Signal", WPAS_DBUS_NEW_IFACE_BSS, "n",
          wpas_dbus_getter_bss_signal,
-         NULL,
-         R
+         NULL
        },
        { "Frequency", WPAS_DBUS_NEW_IFACE_BSS, "q",
          wpas_dbus_getter_bss_frequency,
-         NULL,
-         R
+         NULL
        },
        { "Rates", WPAS_DBUS_NEW_IFACE_BSS, "au",
          wpas_dbus_getter_bss_rates,
-         NULL,
-         R
+         NULL
        },
        { "WPA", WPAS_DBUS_NEW_IFACE_BSS, "a{sv}",
          wpas_dbus_getter_bss_wpa,
-         NULL,
-         R
+         NULL
        },
        { "RSN", WPAS_DBUS_NEW_IFACE_BSS, "a{sv}",
          wpas_dbus_getter_bss_rsn,
-         NULL,
-         R
+         NULL
        },
        { "IEs", WPAS_DBUS_NEW_IFACE_BSS, "ay",
          wpas_dbus_getter_bss_ies,
-         NULL,
-         R
+         NULL
        },
-       { NULL, NULL, NULL, NULL, NULL, 0 }
+       { NULL, NULL, NULL, NULL, NULL }
 };
 
 
 static const struct wpa_dbus_signal_desc wpas_dbus_bss_signals[] = {
+       /* Deprecated: use org.freedesktop.DBus.Properties.PropertiesChanged */
        { "PropertiesChanged", WPAS_DBUS_NEW_IFACE_BSS,
          {
                  { "properties", "a{sv}", ARG_OUT },
@@ -2141,6 +2417,15 @@ static const struct wpa_dbus_method_desc wpas_dbus_interface_methods[] = {
                  END_ARGS
          }
        },
+       { "NetworkReply", WPAS_DBUS_NEW_IFACE_INTERFACE,
+         (WPADBusMethodHandler) &wpas_dbus_handler_network_reply,
+         {
+                 { "path", "o", ARG_IN },
+                 { "field", "s", ARG_IN },
+                 { "value", "s", ARG_IN },
+                 END_ARGS
+         }
+       },
        { "AddBlob", WPAS_DBUS_NEW_IFACE_INTERFACE,
          (WPADBusMethodHandler) &wpas_dbus_handler_add_blob,
          {
@@ -2221,7 +2506,7 @@ static const struct wpa_dbus_method_desc wpas_dbus_interface_methods[] = {
          (WPADBusMethodHandler)wpas_dbus_handler_p2p_connect,
          {
                  { "args", "a{sv}", ARG_IN },
-                 { "generated_pin", "i", ARG_OUT },
+                 { "generated_pin", "s", ARG_OUT },
                  END_ARGS
          }
        },
@@ -2349,113 +2634,133 @@ static const struct wpa_dbus_method_desc wpas_dbus_interface_methods[] = {
                  END_ARGS
          }
        },
+#ifdef CONFIG_AP
+       { "SubscribeProbeReq", WPAS_DBUS_NEW_IFACE_INTERFACE,
+         (WPADBusMethodHandler) wpas_dbus_handler_subscribe_preq,
+         {
+                 END_ARGS
+         }
+       },
+       { "UnsubscribeProbeReq", WPAS_DBUS_NEW_IFACE_INTERFACE,
+         (WPADBusMethodHandler) wpas_dbus_handler_unsubscribe_preq,
+         {
+                 END_ARGS
+         }
+       },
+#endif /* CONFIG_AP */
        { NULL, NULL, NULL, { END_ARGS } }
 };
 
 static const struct wpa_dbus_property_desc wpas_dbus_interface_properties[] = {
        { "Capabilities", WPAS_DBUS_NEW_IFACE_INTERFACE, "a{sv}",
          wpas_dbus_getter_capabilities,
-         NULL, R
+         NULL
        },
        { "State", WPAS_DBUS_NEW_IFACE_INTERFACE, "s",
          wpas_dbus_getter_state,
-         NULL, R
+         NULL
        },
        { "Scanning", WPAS_DBUS_NEW_IFACE_INTERFACE, "b",
          wpas_dbus_getter_scanning,
-         NULL, R
+         NULL
        },
        { "ApScan", WPAS_DBUS_NEW_IFACE_INTERFACE, "u",
          wpas_dbus_getter_ap_scan,
-         wpas_dbus_setter_ap_scan,
-         RW
+         wpas_dbus_setter_ap_scan
        },
        { "BSSExpireAge", WPAS_DBUS_NEW_IFACE_INTERFACE, "u",
          wpas_dbus_getter_bss_expire_age,
-         wpas_dbus_setter_bss_expire_age,
-         RW
+         wpas_dbus_setter_bss_expire_age
        },
        { "BSSExpireCount", WPAS_DBUS_NEW_IFACE_INTERFACE, "u",
          wpas_dbus_getter_bss_expire_count,
-         wpas_dbus_setter_bss_expire_count,
-         RW
+         wpas_dbus_setter_bss_expire_count
        },
        { "Country", WPAS_DBUS_NEW_IFACE_INTERFACE, "s",
          wpas_dbus_getter_country,
-         wpas_dbus_setter_country,
-         RW
+         wpas_dbus_setter_country
        },
        { "Ifname", WPAS_DBUS_NEW_IFACE_INTERFACE, "s",
          wpas_dbus_getter_ifname,
-         NULL, R
+         NULL
        },
        { "Driver", WPAS_DBUS_NEW_IFACE_INTERFACE, "s",
          wpas_dbus_getter_driver,
-         NULL, R
+         NULL
        },
        { "BridgeIfname", WPAS_DBUS_NEW_IFACE_INTERFACE, "s",
          wpas_dbus_getter_bridge_ifname,
-         NULL, R
+         NULL
        },
        { "CurrentBSS", WPAS_DBUS_NEW_IFACE_INTERFACE, "o",
          wpas_dbus_getter_current_bss,
-         NULL, R
+         NULL
        },
        { "CurrentNetwork", WPAS_DBUS_NEW_IFACE_INTERFACE, "o",
          wpas_dbus_getter_current_network,
-         NULL, R
+         NULL
        },
        { "CurrentAuthMode", WPAS_DBUS_NEW_IFACE_INTERFACE, "s",
          wpas_dbus_getter_current_auth_mode,
-         NULL, R
+         NULL
        },
        { "Blobs", WPAS_DBUS_NEW_IFACE_INTERFACE, "a{say}",
          wpas_dbus_getter_blobs,
-         NULL, R
+         NULL
        },
        { "BSSs", WPAS_DBUS_NEW_IFACE_INTERFACE, "ao",
          wpas_dbus_getter_bsss,
-         NULL, R
+         NULL
        },
        { "Networks", WPAS_DBUS_NEW_IFACE_INTERFACE, "ao",
          wpas_dbus_getter_networks,
-         NULL, R
+         NULL
+       },
+       { "FastReauth", WPAS_DBUS_NEW_IFACE_INTERFACE, "b",
+         wpas_dbus_getter_fast_reauth,
+         wpas_dbus_setter_fast_reauth
+       },
+       { "ScanInterval", WPAS_DBUS_NEW_IFACE_INTERFACE, "i",
+         wpas_dbus_getter_scan_interval,
+         wpas_dbus_setter_scan_interval
        },
 #ifdef CONFIG_WPS
        { "ProcessCredentials", WPAS_DBUS_NEW_IFACE_WPS, "b",
          wpas_dbus_getter_process_credentials,
-         wpas_dbus_setter_process_credentials,
-         RW
+         wpas_dbus_setter_process_credentials
        },
 #endif /* CONFIG_WPS */
 #ifdef CONFIG_P2P
-       { "P2PDeviceProperties", WPAS_DBUS_NEW_IFACE_P2PDEVICE, "a{sv}",
-         wpas_dbus_getter_p2p_device_properties,
-         wpas_dbus_setter_p2p_device_properties,
-         RW
+       { "P2PDeviceConfig", WPAS_DBUS_NEW_IFACE_P2PDEVICE, "a{sv}",
+         wpas_dbus_getter_p2p_device_config,
+         wpas_dbus_setter_p2p_device_config
        },
        { "Peers", WPAS_DBUS_NEW_IFACE_P2PDEVICE, "ao",
          wpas_dbus_getter_p2p_peers,
-         NULL, R
+         NULL
        },
        { "Role", WPAS_DBUS_NEW_IFACE_P2PDEVICE, "s",
          wpas_dbus_getter_p2p_role,
-         NULL, R
+         NULL
        },
        { "Group", WPAS_DBUS_NEW_IFACE_P2PDEVICE, "o",
          wpas_dbus_getter_p2p_group,
-         NULL, R
+         NULL
        },
        { "PeerGO", WPAS_DBUS_NEW_IFACE_P2PDEVICE, "o",
          wpas_dbus_getter_p2p_peergo,
-         NULL, R
+         NULL
        },
        { "PersistentGroups", WPAS_DBUS_NEW_IFACE_P2PDEVICE, "ao",
          wpas_dbus_getter_persistent_groups,
-         NULL, R
+         NULL
        },
 #endif /* CONFIG_P2P */
-       { NULL, NULL, NULL, NULL, NULL, 0 }
+       { "DisconnectReason", WPAS_DBUS_NEW_IFACE_INTERFACE, "i",
+         wpas_dbus_getter_disconnect_reason,
+         NULL
+       },
+       { NULL, NULL, NULL, NULL, NULL }
 };
 
 static const struct wpa_dbus_signal_desc wpas_dbus_interface_signals[] = {
@@ -2509,6 +2814,7 @@ static const struct wpa_dbus_signal_desc wpas_dbus_interface_signals[] = {
                  END_ARGS
          }
        },
+       /* Deprecated: use org.freedesktop.DBus.Properties.PropertiesChanged */
        { "PropertiesChanged", WPAS_DBUS_NEW_IFACE_INTERFACE,
          {
                  { "properties", "a{sv}", ARG_OUT },
@@ -2529,6 +2835,7 @@ static const struct wpa_dbus_signal_desc wpas_dbus_interface_signals[] = {
                  END_ARGS
          }
        },
+       /* Deprecated: use org.freedesktop.DBus.Properties.PropertiesChanged */
        { "PropertiesChanged", WPAS_DBUS_NEW_IFACE_WPS,
          {
                  { "properties", "a{sv}", ARG_OUT },
@@ -2671,12 +2978,27 @@ static const struct wpa_dbus_signal_desc wpas_dbus_interface_signals[] = {
          }
        },
 #endif /* CONFIG_P2P */
+#ifdef CONFIG_AP
+       { "ProbeRequest", WPAS_DBUS_NEW_IFACE_INTERFACE,
+         {
+                 { "args", "a{sv}", ARG_OUT },
+                 END_ARGS
+         }
+       },
+#endif /* CONFIG_AP */
        { "Certification", WPAS_DBUS_NEW_IFACE_INTERFACE,
          {
                  { "certification", "a{sv}", ARG_OUT },
                  END_ARGS
          }
        },
+       { "EAP", WPAS_DBUS_NEW_IFACE_INTERFACE,
+         {
+                 { "status", "s", ARG_OUT },
+                 { "parameter", "s", ARG_OUT },
+                 END_ARGS
+         }
+       },
        { NULL, NULL, { END_ARGS } }
 };
 
@@ -2744,6 +3066,15 @@ int wpas_dbus_unregister_interface(struct wpa_supplicant *wpa_s)
 
        wpa_printf(MSG_DEBUG, "dbus: Unregister interface object '%s'",
                   wpa_s->dbus_new_path);
+
+#ifdef CONFIG_AP
+       if (wpa_s->preq_notify_peer) {
+               wpas_dbus_unsubscribe_noc(ctrl_iface);
+               os_free(wpa_s->preq_notify_peer);
+               wpa_s->preq_notify_peer = NULL;
+       }
+#endif /* CONFIG_AP */
+
        if (wpa_dbus_unregister_object_per_iface(ctrl_iface,
                                                 wpa_s->dbus_new_path))
                return -1;
@@ -2759,15 +3090,43 @@ int wpas_dbus_unregister_interface(struct wpa_supplicant *wpa_s)
 #ifdef CONFIG_P2P
 
 static const struct wpa_dbus_property_desc wpas_dbus_p2p_peer_properties[] = {
-       { "Properties", WPAS_DBUS_NEW_IFACE_P2P_PEER, "a{sv}",
-         wpas_dbus_getter_p2p_peer_properties,
-         NULL, R
+       { "DeviceName", WPAS_DBUS_NEW_IFACE_P2P_PEER, "s",
+         wpas_dbus_getter_p2p_peer_device_name,
+         NULL
+       },
+       { "PrimaryDeviceType", WPAS_DBUS_NEW_IFACE_P2P_PEER, "ay",
+         wpas_dbus_getter_p2p_peer_primary_device_type,
+         NULL
+       },
+       { "config_method", WPAS_DBUS_NEW_IFACE_P2P_PEER, "q",
+         wpas_dbus_getter_p2p_peer_config_method,
+         NULL
+       },
+       { "level", WPAS_DBUS_NEW_IFACE_P2P_PEER, "i",
+         wpas_dbus_getter_p2p_peer_level,
+         NULL
+       },
+       { "devicecapability", WPAS_DBUS_NEW_IFACE_P2P_PEER, "y",
+         wpas_dbus_getter_p2p_peer_device_capability,
+         NULL
+       },
+       { "groupcapability", WPAS_DBUS_NEW_IFACE_P2P_PEER, "y",
+         wpas_dbus_getter_p2p_peer_group_capability,
+         NULL
+       },
+       { "SecondaryDeviceTypes", WPAS_DBUS_NEW_IFACE_P2P_PEER, "aay",
+         wpas_dbus_getter_p2p_peer_secondary_device_types,
+         NULL
+       },
+       { "VendorExtension", WPAS_DBUS_NEW_IFACE_P2P_PEER, "aay",
+         wpas_dbus_getter_p2p_peer_vendor_extension,
+         NULL
        },
        { "IEs", WPAS_DBUS_NEW_IFACE_P2P_PEER, "ay",
          wpas_dbus_getter_p2p_peer_ies,
-         NULL, R
+         NULL
        },
-       { NULL, NULL, NULL, NULL, NULL, 0 }
+       { NULL, NULL, NULL, NULL, NULL }
 };
 
 static const struct wpa_dbus_signal_desc wpas_dbus_p2p_peer_signals[] = {
@@ -2958,15 +3317,41 @@ int wpas_dbus_unregister_peer(struct wpa_supplicant *wpa_s,
 static const struct wpa_dbus_property_desc wpas_dbus_p2p_group_properties[] = {
        { "Members", WPAS_DBUS_NEW_IFACE_P2P_GROUP, "ao",
          wpas_dbus_getter_p2p_group_members,
-         NULL, R
+         NULL
+       },
+       { "Group", WPAS_DBUS_NEW_IFACE_P2P_GROUP, "o",
+         wpas_dbus_getter_p2p_group,
+         NULL
+       },
+       { "Role", WPAS_DBUS_NEW_IFACE_P2P_GROUP, "s",
+         wpas_dbus_getter_p2p_role,
+         NULL
        },
-       { "Properties",
-         WPAS_DBUS_NEW_IFACE_P2P_GROUP, "a{sv}",
-         wpas_dbus_getter_p2p_group_properties,
-         wpas_dbus_setter_p2p_group_properties,
-         RW
+       { "SSID", WPAS_DBUS_NEW_IFACE_P2P_GROUP, "ay",
+         wpas_dbus_getter_p2p_group_ssid,
+         NULL
        },
-       { NULL, NULL, NULL, NULL, NULL, 0 }
+       { "BSSID", WPAS_DBUS_NEW_IFACE_P2P_GROUP, "ay",
+         wpas_dbus_getter_p2p_group_bssid,
+         NULL
+       },
+       { "Frequency", WPAS_DBUS_NEW_IFACE_P2P_GROUP, "q",
+         wpas_dbus_getter_p2p_group_frequency,
+         NULL
+       },
+       { "Passphrase", WPAS_DBUS_NEW_IFACE_P2P_GROUP, "s",
+         wpas_dbus_getter_p2p_group_passphrase,
+         NULL
+       },
+       { "PSK", WPAS_DBUS_NEW_IFACE_P2P_GROUP, "ay",
+         wpas_dbus_getter_p2p_group_psk,
+         NULL
+       },
+       { "WPSVendorExtensions", WPAS_DBUS_NEW_IFACE_P2P_GROUP, "aay",
+         wpas_dbus_getter_p2p_group_vendor_ext,
+         wpas_dbus_setter_p2p_group_vendor_ext
+       },
+       { NULL, NULL, NULL, NULL, NULL }
 };
 
 static const struct wpa_dbus_signal_desc wpas_dbus_p2p_group_signals[] = {
@@ -3086,11 +3471,7 @@ void wpas_dbus_unregister_p2p_group(struct wpa_supplicant *wpa_s,
 
 static const struct wpa_dbus_property_desc
 wpas_dbus_p2p_groupmember_properties[] = {
-       { "Properties", WPAS_DBUS_NEW_IFACE_P2P_GROUPMEMBER, "a{sv}",
-         wpas_dbus_getter_p2p_group_properties,
-         NULL, R
-       },
-       { NULL, NULL, NULL, NULL, NULL, 0 }
+       { NULL, NULL, NULL, NULL, NULL }
 };
 
 /**
@@ -3195,10 +3576,9 @@ static const struct wpa_dbus_property_desc
        wpas_dbus_persistent_group_properties[] = {
        { "Properties", WPAS_DBUS_NEW_IFACE_PERSISTENT_GROUP, "a{sv}",
          wpas_dbus_getter_persistent_group_properties,
-         wpas_dbus_setter_persistent_group_properties,
-         RW
+         wpas_dbus_setter_persistent_group_properties
        },
-       { NULL, NULL, NULL, NULL, NULL, 0 }
+       { NULL, NULL, NULL, NULL, NULL }
 };
 
 /* No signals intended for persistent group objects */