-int contradicting_add_edge = 0;
-int contradicting_del_edge = 0;
-static int sleeptime = 10;
-time_t last_config_check = 0;
-
-/* Purge edges and subnets of unreachable nodes. Use carefully. */
-
-void purge(void) {
- logger(DEBUG_PROTOCOL, LOG_DEBUG, "Purging unreachable nodes");
-
- /* Remove all edges and subnets owned by unreachable nodes. */
-
- for splay_each(node_t, n, node_tree) {
- if(!n->status.reachable) {
- logger(DEBUG_SCARY_THINGS, LOG_DEBUG, "Purging node %s (%s)", n->name, n->hostname);
-
- for splay_each(subnet_t, s, n->subnet_tree) {
- send_del_subnet(everyone, s);
- if(!strictsubnets)
- subnet_del(n, s);
- }
-
- for splay_each(edge_t, e, n->edge_tree) {
- if(!tunnelserver)
- send_del_edge(everyone, e);
- edge_del(e);
- }
- }
- }
-
- /* Check if anyone else claims to have an edge to an unreachable node. If not, delete node. */
-
- for splay_each(node_t, n, node_tree) {
- if(!n->status.reachable) {
- for splay_each(edge_t, e, edge_weight_tree)
- if(e->to == n)
- return;
-
- if(!strictsubnets || !n->subnet_tree->head)
- /* in strictsubnets mode do not delete nodes with subnets */
- node_del(n);
- }
- }
-}
-