3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-22 23:09:34 +01:00

network: Add network_register

This commit is contained in:
Denis Kenzior 2016-05-15 21:30:10 -05:00
parent d1948c0233
commit d0ae833edb
2 changed files with 17 additions and 0 deletions

View File

@ -331,6 +331,21 @@ void network_emit_removed(struct network *network)
l_dbus_send(dbus, signal);
}
bool network_register(struct network *network, const char *path)
{
if (!l_dbus_object_add_interface(dbus_get_bus(), path,
IWD_NETWORK_INTERFACE, network)) {
l_info("Unable to register %s interface",
IWD_NETWORK_INTERFACE);
return false;
}
network->object_path = strdup(path);
network_emit_added(network);
return true;
}
void network_init()
{
networks = l_queue_new();

View File

@ -60,5 +60,7 @@ void network_sync_psk(struct network *network);
void network_emit_added(struct network *network);
void network_emit_removed(struct network *network);
bool network_register(struct network *network, const char *path);
void network_init();
void network_exit();