mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-12-22 13:02:44 +01:00
network: Add network_remove
This commit is contained in:
parent
d0ae833edb
commit
18957e504e
@ -33,6 +33,7 @@
|
||||
#include "src/storage.h"
|
||||
#include "src/scan.h"
|
||||
#include "src/dbus.h"
|
||||
#include "src/agent.h"
|
||||
#include "src/device.h"
|
||||
#include "src/network.h"
|
||||
|
||||
@ -346,6 +347,30 @@ bool network_register(struct network *network, const char *path)
|
||||
return true;
|
||||
}
|
||||
|
||||
static void network_unregister(struct network *network)
|
||||
{
|
||||
struct l_dbus *dbus = dbus_get_bus();
|
||||
|
||||
agent_request_cancel(network->agent_request);
|
||||
network_settings_close(network);
|
||||
|
||||
l_dbus_unregister_object(dbus, network->object_path);
|
||||
network_emit_removed(network);
|
||||
|
||||
l_free(network->object_path);
|
||||
network->object_path = NULL;
|
||||
}
|
||||
|
||||
void network_remove(struct network *network)
|
||||
{
|
||||
if (network->object_path)
|
||||
network_unregister(network);
|
||||
|
||||
l_queue_destroy(network->bss_list, NULL);
|
||||
l_free(network->psk);
|
||||
l_free(network);
|
||||
}
|
||||
|
||||
void network_init()
|
||||
{
|
||||
networks = l_queue_new();
|
||||
|
@ -62,5 +62,7 @@ void network_emit_removed(struct network *network);
|
||||
|
||||
bool network_register(struct network *network, const char *path);
|
||||
|
||||
void network_remove(struct network *network);
|
||||
|
||||
void network_init();
|
||||
void network_exit();
|
||||
|
Loading…
Reference in New Issue
Block a user