return;
l_queue_destroy(agents, agent_free);
+ agents = NULL;
}
#include "mesh/mesh-io.h"
#include "mesh/node.h"
#include "mesh/net.h"
+#include "mesh/net-keys.h"
#include "mesh/provision.h"
#include "mesh/model.h"
#include "mesh/dbus.h"
}
l_queue_destroy(pending_queue, pending_request_exit);
+ mesh_agent_cleanup();
node_cleanup_all();
mesh_model_cleanup();
+ mesh_net_cleanup();
+ net_key_cleanup();
l_dbus_object_remove_interface(dbus_get_bus(), BLUEZ_MESH_PATH,
MESH_NETWORK_INTERFACE);
l_timeout_remove(key->snb.timeout);
key->snb.timeout = NULL;
}
+
+void net_key_cleanup(void)
+{
+ l_queue_destroy(keys, l_free);
+ keys = NULL;
+}
#define KEY_REFRESH 0x01
#define IV_INDEX_UPDATE 0x02
+void net_key_cleanup(void);
bool net_key_confirm(uint32_t id, const uint8_t master[16]);
bool net_key_retrieve(uint32_t id, uint8_t *master);
uint32_t net_key_add(const uint8_t master[16]);
return net;
}
-void mesh_net_free(struct mesh_net *net)
+void mesh_net_free(void *user_data)
{
+ struct mesh_net *net = user_data;
+
if (!net)
return;
l_free(net);
}
+void mesh_net_cleanup(void)
+{
+ l_queue_destroy(fast_cache, l_free);
+ fast_cache = NULL;
+ l_queue_destroy(nets, mesh_net_free);
+ nets = NULL;
+}
+
bool mesh_net_set_seq_num(struct mesh_net *net, uint32_t seq)
{
if (!net)
void *user_data);
struct mesh_net *mesh_net_new(struct mesh_node *node);
-void mesh_net_free(struct mesh_net *net);
+void mesh_net_free(void *net);
+void mesh_net_cleanup(void);
void mesh_net_flush_msg_queues(struct mesh_net *net);
void mesh_net_set_iv_index(struct mesh_net *net, uint32_t index, bool update);
bool mesh_net_iv_index_update(struct mesh_net *net);