3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-12-22 13:02:44 +01:00

client: Add ops to known networks

This commit is contained in:
Tim Kourt 2017-04-21 11:14:55 -07:00 committed by Denis Kenzior
parent 21687e9a81
commit 4b4c7217fb

View File

@ -29,8 +29,45 @@
#include "command.h"
#include "dbus-proxy.h"
struct known_network {
char *name;
char *type;
char *last_seen;
char *last_connected;
};
static void known_network_destroy(void *data)
{
struct known_network *network = data;
l_free(network->last_connected);
l_free(network->last_seen);
l_free(network->name);
l_free(network->type);
l_free(network);
}
static void *known_networks_create(void)
{
return l_queue_new();
}
static void known_networks_destroy(void *data)
{
struct l_queue *networks = data;
l_queue_destroy(networks, known_network_destroy);
}
static const struct proxy_interface_type_ops known_networks_ops = {
.create = known_networks_create,
.destroy = known_networks_destroy,
};
static struct proxy_interface_type known_networks_interface_type = {
.interface = IWD_KNOWN_NETWORKS_INTREFACE,
.ops = &known_networks_ops,
};
static void cmd_list(const char *entity, char *args)