projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Cleanups:
[tinc]
/
src
/
node.c
diff --git
a/src/node.c
b/src/node.c
index
e4581cc
..
4fdb99c
100644
(file)
--- a/
src/node.c
+++ b/
src/node.c
@@
-1,7
+1,7
@@
/*
node.c -- node tree management
/*
node.c -- node tree management
- Copyright (C) 2001-2002 Guus Sliepen <guus@sliepen.
warande.net
>,
- 2001-2002 Ivo Timmermans <i
timmermans@bigfoot.com
>
+ Copyright (C) 2001-2002 Guus Sliepen <guus@sliepen.
eu.org
>,
+ 2001-2002 Ivo Timmermans <i
vo@o2w.nl
>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@
-17,7
+17,7
@@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
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.1
1 2002/03/22 13:31:18
guus Exp $
+ $Id: node.c,v 1.1.2.1
6 2002/09/09 19:39:59
guus Exp $
*/
#include "config.h"
*/
#include "config.h"
@@
-47,7
+47,7
@@
int node_compare(node_t *a, node_t *b)
int node_udp_compare(node_t *a, node_t *b)
{
int result;
int node_udp_compare(node_t *a, node_t *b)
{
int result;
-cp
+ cp();
result = sockaddrcmp(&a->address, &b->address);
if(result)
result = sockaddrcmp(&a->address, &b->address);
if(result)
@@
-58,34
+58,34
@@
cp
void init_nodes(void)
{
void init_nodes(void)
{
-cp
+ cp();
node_tree = avl_alloc_tree((avl_compare_t)node_compare, NULL);
node_udp_tree = avl_alloc_tree((avl_compare_t)node_udp_compare, NULL);
node_tree = avl_alloc_tree((avl_compare_t)node_compare, NULL);
node_udp_tree = avl_alloc_tree((avl_compare_t)node_udp_compare, NULL);
-cp
+ cp();
}
void exit_nodes(void)
{
}
void exit_nodes(void)
{
-cp
+ cp();
avl_delete_tree(node_tree);
avl_delete_tree(node_udp_tree);
avl_delete_tree(node_tree);
avl_delete_tree(node_udp_tree);
-cp
+ cp();
}
node_t *new_node(void)
{
node_t *n = (node_t *)xmalloc_and_zero(sizeof(*n));
}
node_t *new_node(void)
{
node_t *n = (node_t *)xmalloc_and_zero(sizeof(*n));
-cp
+ cp();
n->subnet_tree = new_subnet_tree();
n->edge_tree = new_edge_tree();
n->queue = list_alloc((list_action_t)free);
n->subnet_tree = new_subnet_tree();
n->edge_tree = new_edge_tree();
n->queue = list_alloc((list_action_t)free);
-cp
+ cp();
return n;
}
void free_node(node_t *n)
{
return n;
}
void free_node(node_t *n)
{
-cp
+ cp();
if(n->queue)
list_delete_list(n->queue);
if(n->name)
if(n->queue)
list_delete_list(n->queue);
if(n->name)
@@
-99,15
+99,15
@@
cp
if(n->edge_tree)
free_edge_tree(n->edge_tree);
free(n);
if(n->edge_tree)
free_edge_tree(n->edge_tree);
free(n);
-cp
+ cp();
}
void node_add(node_t *n)
{
}
void node_add(node_t *n)
{
-cp
+ cp();
avl_insert(node_tree, n);
avl_insert(node_udp_tree, n);
avl_insert(node_tree, n);
avl_insert(node_udp_tree, n);
-cp
+ cp();
}
void node_del(node_t *n)
}
void node_del(node_t *n)
@@
-115,7
+115,7
@@
void node_del(node_t *n)
avl_node_t *node, *next;
edge_t *e;
subnet_t *s;
avl_node_t *node, *next;
edge_t *e;
subnet_t *s;
-cp
+ cp();
for(node = n->subnet_tree->head; node; node = next)
{
next = node->next;
for(node = n->subnet_tree->head; node; node = next)
{
next = node->next;
@@
-123,22
+123,22
@@
cp
subnet_del(n, s);
}
subnet_del(n, s);
}
- for(node = n->
subnet
_tree->head; node; node = next)
+ for(node = n->
edge
_tree->head; node; node = next)
{
next = node->next;
e = (edge_t *)node->data;
edge_del(e);
}
{
next = node->next;
e = (edge_t *)node->data;
edge_del(e);
}
-cp
+ cp();
avl_delete(node_tree, n);
avl_delete(node_udp_tree, n);
avl_delete(node_tree, n);
avl_delete(node_udp_tree, n);
-cp
+ cp();
}
node_t *lookup_node(char *name)
{
node_t n;
}
node_t *lookup_node(char *name)
{
node_t n;
-cp
+ cp();
n.name = name;
return avl_search(node_tree, &n);
}
n.name = name;
return avl_search(node_tree, &n);
}
@@
-146,7
+146,7
@@
cp
node_t *lookup_node_udp(sockaddr_t *sa)
{
node_t n;
node_t *lookup_node_udp(sockaddr_t *sa)
{
node_t n;
-cp
+ cp();
n.address = *sa;
n.name = NULL;
n.address = *sa;
n.name = NULL;
@@
-157,7
+157,7
@@
void dump_nodes(void)
{
avl_node_t *node;
node_t *n;
{
avl_node_t *node;
node_t *n;
-cp
+ cp();
syslog(LOG_DEBUG, _("Nodes:"));
for(node = node_tree->head; node; node = node->next)
syslog(LOG_DEBUG, _("Nodes:"));
for(node = node_tree->head; node; node = node->next)
@@
-169,5
+169,5
@@
cp
}
syslog(LOG_DEBUG, _("End of nodes."));
}
syslog(LOG_DEBUG, _("End of nodes."));
-cp
+ cp();
}
}