mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2025-01-29 16:24:03 -05:00
dbus: Declare and implement GroupFinished as for GroupStarted
First for better concistancy but also to tell about the group_object that is getting removed, thus the client will know about it and will be able to act accordingly. Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This commit is contained in:
parent
2fa980f0f1
commit
4a0693a4d5
@ -946,37 +946,49 @@ void wpas_dbus_signal_sta_deauthorized(struct wpa_supplicant *wpa_s,
|
|||||||
void wpas_dbus_signal_p2p_group_removed(struct wpa_supplicant *wpa_s,
|
void wpas_dbus_signal_p2p_group_removed(struct wpa_supplicant *wpa_s,
|
||||||
const char *role)
|
const char *role)
|
||||||
{
|
{
|
||||||
|
int error = 1;
|
||||||
DBusMessage *msg;
|
DBusMessage *msg;
|
||||||
DBusMessageIter iter;
|
DBusMessageIter iter, dict_iter;
|
||||||
struct wpas_dbus_priv *iface = wpa_s->global->dbus;
|
struct wpas_dbus_priv *iface = wpa_s->global->dbus;
|
||||||
char *ifname = wpa_s->ifname;
|
|
||||||
|
|
||||||
/* Do nothing if the control interface is not turned on */
|
/* Do nothing if the control interface is not turned on */
|
||||||
if (iface == NULL)
|
if (iface == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
msg = dbus_message_new_signal(wpa_s->dbus_new_path,
|
if (!wpa_s->dbus_groupobj_path)
|
||||||
|
return;
|
||||||
|
|
||||||
|
msg = dbus_message_new_signal(wpa_s->parent->dbus_new_path,
|
||||||
WPAS_DBUS_NEW_IFACE_P2PDEVICE,
|
WPAS_DBUS_NEW_IFACE_P2PDEVICE,
|
||||||
"GroupFinished");
|
"GroupFinished");
|
||||||
if (msg == NULL)
|
if (msg == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
dbus_message_iter_init_append(msg, &iter);
|
dbus_message_iter_init_append(msg, &iter);
|
||||||
|
if (!wpa_dbus_dict_open_write(&iter, &dict_iter))
|
||||||
|
goto nomem;
|
||||||
|
|
||||||
if (!dbus_message_iter_append_basic(&iter, DBUS_TYPE_STRING, &ifname)) {
|
if (!wpa_dbus_dict_append_object_path(&dict_iter,
|
||||||
wpa_printf(MSG_ERROR, "dbus: Failed to construct GroupFinished"
|
"interface_object",
|
||||||
"signal -not enough memory for ifname ");
|
wpa_s->dbus_new_path))
|
||||||
goto err;
|
goto nomem;
|
||||||
}
|
|
||||||
|
|
||||||
if (!dbus_message_iter_append_basic(&iter, DBUS_TYPE_STRING, &role))
|
if (!wpa_dbus_dict_append_string(&dict_iter, "role", role))
|
||||||
wpa_printf(MSG_ERROR, "dbus: Failed to construct GroupFinished"
|
goto nomem;
|
||||||
"signal -not enough memory for role ");
|
|
||||||
else
|
if (!wpa_dbus_dict_append_object_path(&dict_iter, "group_object",
|
||||||
|
wpa_s->dbus_groupobj_path) ||
|
||||||
|
!wpa_dbus_dict_close_write(&iter, &dict_iter))
|
||||||
|
goto nomem;
|
||||||
|
|
||||||
|
error = 0;
|
||||||
dbus_connection_send(iface->con, msg, NULL);
|
dbus_connection_send(iface->con, msg, NULL);
|
||||||
|
|
||||||
err:
|
nomem:
|
||||||
|
if (error > 0)
|
||||||
|
wpa_printf(MSG_ERROR,
|
||||||
|
"dbus: Failed to construct GroupFinished");
|
||||||
|
|
||||||
dbus_message_unref(msg);
|
dbus_message_unref(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3140,8 +3152,7 @@ static const struct wpa_dbus_signal_desc wpas_dbus_interface_signals[] = {
|
|||||||
},
|
},
|
||||||
{ "GroupFinished", WPAS_DBUS_NEW_IFACE_P2PDEVICE,
|
{ "GroupFinished", WPAS_DBUS_NEW_IFACE_P2PDEVICE,
|
||||||
{
|
{
|
||||||
{ "ifname", "s", ARG_OUT },
|
{ "properties", "a{sv}", ARG_OUT },
|
||||||
{ "role", "s", ARG_OUT },
|
|
||||||
END_ARGS
|
END_ARGS
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -438,9 +438,9 @@ void wpas_notify_p2p_group_removed(struct wpa_supplicant *wpa_s,
|
|||||||
const struct wpa_ssid *ssid,
|
const struct wpa_ssid *ssid,
|
||||||
const char *role)
|
const char *role)
|
||||||
{
|
{
|
||||||
wpas_dbus_unregister_p2p_group(wpa_s, ssid);
|
|
||||||
|
|
||||||
wpas_dbus_signal_p2p_group_removed(wpa_s, role);
|
wpas_dbus_signal_p2p_group_removed(wpa_s, role);
|
||||||
|
|
||||||
|
wpas_dbus_unregister_p2p_group(wpa_s, ssid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user