gboolean connection_has_pending(const char *path)
{
struct network_conn *nc;
+ GSList *l;
- if (!dbus_connection_get_object_user_data(connection,
- path, (void *) &nc))
+ l = g_slist_find_custom(connections, path, find_connection);
+ if (!l)
return FALSE;
+ nc = l->data;
+
return (nc->state == CONNECTING);
}
char filename[PATH_MAX + 1];
char src_addr[18], dst_addr[18];
int err;
+ GSList *l;
- if (!dbus_connection_get_object_user_data(connection,
- path, (void *) &nc))
+ l = g_slist_find_custom(connections, path, find_connection);
+ if (!l)
return -ENOENT;
+ nc = l->data;
+
ba2str(&nc->dst, dst_addr);
role = bnep_name(nc->id);
snprintf(key, 32, "%s#%s", dst_addr, role);
gboolean connection_is_connected(const char *path)
{
struct network_conn *nc;
+ GSList *l;
- if (!dbus_connection_get_object_user_data(connection,
- path, (void *) &nc))
+ l = g_slist_find_custom(connections, path, find_connection);
+ if (!l)
return FALSE;
+ nc = l->data;
+
return (nc->state == CONNECTED);
}