projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Big bad commit:
[tinc]
/
src
/
vertex.c
diff --git
a/src/vertex.c
b/src/vertex.c
index
54da872
..
4f0b5d6
100644
(file)
--- a/
src/vertex.c
+++ b/
src/vertex.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.
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: vertex.c,v 1.1.2.
1 2001/10/10 08:49:4
7 guus Exp $
+ $Id: vertex.c,v 1.1.2.
2 2001/10/27 12:13:1
7 guus Exp $
*/
#include "config.h"
*/
#include "config.h"
@@
-44,7
+44,7
@@
avl_tree_t *connection_tree; /* Tree with all meta connections with ourself *
int connection_compare(connection_t *a, connection_t *b)
{
int connection_compare(connection_t *a, connection_t *b)
{
- return a->
meta_socket - b->meta_
socket;
+ return a->
socket - b->
socket;
}
int vertex_compare(vertex_t *a, vertex_t *b)
}
int vertex_compare(vertex_t *a, vertex_t *b)
@@
-97,29
+97,38
@@
cp
void free_vertex(vertex_t *v)
{
cp
void free_vertex(vertex_t *v)
{
cp
- if(v->from.hostname)
- free(v->from.hostname)
- if(v->to.hostname)
- free(v->to.hostname)
-
free(v);
cp
}
free(v);
cp
}
+void vertex_add(vertex_t *v)
+{
+cp
+ avl_insert(vertex_tree, v);
+cp
+}
+
+void vertex_del(vertex_t *v)
+{
+cp
+ avl_delete(vertex_tree, v);
+cp
+}
+
vertex_t *lookup_vertex(node_t *from, node_t *to)
{
vertex_t v, *result;
cp
vertex_t *lookup_vertex(node_t *from, node_t *to)
{
vertex_t v, *result;
cp
- v.from
.node
= from;
- v.to
.node
= to;
+ v.from = from;
+ v.to = to;
result = avl_search(vertex_tree, &v);
if(result)
return result;
cp
result = avl_search(vertex_tree, &v);
if(result)
return result;
cp
- v.from
.node
= to;
- v.to
.node
= from;
+ v.from = to;
+ v.to = from;
return avl_search(vertex_tree, &v);
}
return avl_search(vertex_tree, &v);
}
@@
-135,7
+144,7
@@
cp
{
v = (vertex_t *)node->data;
syslog(LOG_DEBUG, _(" %s - %s options %ld"),
{
v = (vertex_t *)node->data;
syslog(LOG_DEBUG, _(" %s - %s options %ld"),
- v->from
.node->name, v->to.node
->name, v->options);
+ v->from
->name, v->to
->name, v->options);
}
syslog(LOG_DEBUG, _("End of vertices."));
}
syslog(LOG_DEBUG, _("End of vertices."));