[PATCH 4/7] dbus: Add a Group property to Peer object which will hold its group path
Jouni Malinen
j
Wed May 21 14:17:15 PDT 2014
On Tue, May 20, 2014 at 02:51:11PM +0300, Tomasz Bursztyka wrote:
> If only the Peer is part of a group, this property will tell about the
> group object path.
> diff --git a/wpa_supplicant/dbus/dbus_new_handlers_p2p.c b/wpa_supplicant/dbus/dbus_new_handlers_p2p.c
> @@ -1544,6 +1544,39 @@ dbus_bool_t wpas_dbus_getter_p2p_peer_interface_address(DBusMessageIter *iter,
>
> +dbus_bool_t wpas_dbus_getter_p2p_peer_group(DBusMessageIter *iter,
> + DBusError *error,
> + void *user_data)
> +{
> + char groupobj_path[WPAS_DBUS_OBJECT_PATH_MAX], *path;
> + struct peer_handler_args *peer_args = user_data;
> + struct wpa_supplicant *wpa_s = peer_args->wpa_s;
> + struct wpa_supplicant *wpa_s_go;
> + const struct p2p_peer_info *info;
> +
> + info = p2p_get_peer_info(peer_args->wpa_s->global->p2p,
> + peer_args->p2p_device_addr, 0);
> + if (info == NULL) {
> + dbus_set_error(error, DBUS_ERROR_FAILED,
> + "failed to find peer");
> + return FALSE;
> + }
> +
> + wpa_s_go = wpas_get_go_p2p_client(wpa_s, info->p2p_device_addr);
> + if (wpa_s_go == NULL)
> + wpa_s_go = wpas_get_go_p2p_go(wpa_s, info->p2p_device_addr);
As noted in the previous emails, this may not be unique, i.e., there
could be multiple matching interfaces since P2P supports multiple
groups. Is it acceptable for this interface to support properly only the
case of a single group being in use (and have undefined behavior on
group selection if more than a single group is in place between the two
P2P Devices)?
--
Jouni Malinen PGP id EFC895FA
More information about the Hostap
mailing list