-}
-
-/*
- free a conn_list_t element and all its pointers
-*/
-void free_conn_element(conn_list_t *p)
-{
- if(p->hostname)
- free(p->hostname);
- if(p->pp)
- free(p->pp);
- if(p->sq)
- destroy_queue(p->sq);
- if(p->rq)
- destroy_queue(p->rq);
- free_key(p->public_key);
- free_key(p->key);
- free(p);
-}
-
-/*
- remove all marked connections
-*/
-void prune_conn_list(void)
-{
- conn_list_t *p, *prev = NULL, *next = NULL;
-
- for(p = conn_list; p != NULL; )
- {
- next = p->next;
-
- if(p->status.remove)
- {
- if(prev)
- prev->next = next;
- else
- conn_list = next;
-
- free_conn_element(p);
- }
- else
- prev = p;
-
- p = next;
- }
-}
-
-/*
- creates new conn_list element, and initializes it
-*/
-conn_list_t *new_conn_list(void)
-{
- conn_list_t *p = xmalloc(sizeof(conn_list_t));
-
- /* initialise all those stupid pointers at once */
- memset(p, '\0', sizeof(conn_list_t));
- p->nexthop = p;
- return p;
-}
-
-/*
- free all elements of conn_list
-*/
-void destroy_conn_list(void)
-{
- conn_list_t *p, *next;