X-Git-Url: https://www.tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fnode.c;h=48a4ebd869625e99a4ec7466fa6b1e7ef1c72351;hb=c3593491d44e8e8f239bb297f5d5f6541d581b78;hp=89b1689dfa5e5f0629a151831890a31a65f42396;hpb=f75dcef72a81a337e847adf0bae54198894f65b9;p=tinc diff --git a/src/node.c b/src/node.c index 89b1689d..48a4ebd8 100644 --- a/src/node.c +++ b/src/node.c @@ -17,7 +17,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id: node.c,v 1.1.2.17 2002/09/09 21:24:41 guus Exp $ + $Id: node.c,v 1.1.2.19 2003/05/06 21:13:17 guus Exp $ */ #include "config.h" @@ -39,12 +39,12 @@ avl_tree_t *node_udp_tree; /* Known nodes, sorted by address and port */ node_t *myself; -int node_compare(node_t * a, node_t * b) +int node_compare(node_t *a, node_t *b) { return strcmp(a->name, b->name); } -int node_udp_compare(node_t * a, node_t * b) +int node_udp_compare(node_t *a, node_t *b) { int result; @@ -83,11 +83,12 @@ node_t *new_node(void) n->subnet_tree = new_subnet_tree(); n->edge_tree = new_edge_tree(); n->queue = list_alloc((list_action_t) free); + EVP_CIPHER_CTX_init(&n->packet_ctx); return n; } -void free_node(node_t * n) +void free_node(node_t *n) { cp(); @@ -109,10 +110,12 @@ void free_node(node_t * n) if(n->edge_tree) free_edge_tree(n->edge_tree); + EVP_CIPHER_CTX_cleanup(&n->packet_ctx); + free(n); } -void node_add(node_t * n) +void node_add(node_t *n) { cp(); @@ -120,7 +123,7 @@ void node_add(node_t * n) avl_insert(node_udp_tree, n); } -void node_del(node_t * n) +void node_del(node_t *n) { avl_node_t *node, *next; edge_t *e; @@ -152,7 +155,7 @@ node_t *lookup_node(char *name) return avl_search(node_tree, &n); } -node_t *lookup_node_udp(sockaddr_t * sa) +node_t *lookup_node_udp(sockaddr_t *sa) { node_t n; cp();