- connection_tree = avl_alloc_tree((avl_compare_t)connection_compare, (avl_action_t)free_connection);
- active_tree = avl_alloc_tree((avl_compare_t)active_compare, NULL);
- id_tree = avl_alloc_tree((avl_compare_t)id_compare, NULL);
-}
-
-/* Creation and deletion of connection elements */
-
-connection_t *new_connection(void)
-{
- connection_t *p = (connection_t *)xmalloc_and_zero(sizeof(*p));
-cp
- p->subnet_tree = avl_alloc_tree((avl_compare_t)subnet_compare, NULL);
- p->queue = list_alloc((list_action_t)free);
-cp
- return p;
-}
-
-void free_connection(connection_t *p)
-{
-cp
- if(p->queue)
- list_delete_list(p->queue);
- if(p->name)
- free(p->name);
- if(p->hostname)
- free(p->hostname);
- if(p->rsa_key)
- RSA_free(p->rsa_key);
- if(p->cipher_pktkey)
- free(p->cipher_pktkey);
- if(p->buffer)
- free(p->buffer);
- if(p->config)
- clear_config(&p->config);
- free(p);
-cp
-}
-
-/*
- remove all marked connections
-*/
-void prune_connection_tree(void)
-{
- avl_node_t *node, *next;
- connection_t *cl;
-cp
- for(node = connection_tree->head; node; node = next)
- {
- next = node->next;
- cl = (connection_t *)node->data;
- if(cl->status.remove)
- connection_del(cl);
- }
-cp
+ cp();
+ connection_tree = avl_alloc_tree((avl_compare_t)connection_compare, NULL);
+ cp();
+ broadcast = new_connection();
+ broadcast->name = xstrdup(_("everyone"));
+ broadcast->hostname = xstrdup(_("BROADCAST"));
+ cp();