X-Git-Url: https://www.tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fedge.h;fp=src%2Fedge.h;h=775d8339d5b4ca7b44b900c2b857b2a7d42c967b;hb=ff03bb9b0a744530e1145fef656644987a10d62d;hp=0000000000000000000000000000000000000000;hpb=56c51e94a620dd91eeb510176b9c970af9a9a372;p=tinc diff --git a/src/edge.h b/src/edge.h new file mode 100644 index 00000000..775d8339 --- /dev/null +++ b/src/edge.h @@ -0,0 +1,62 @@ +/* + edge.h -- edge management + + Copyright (C) 2003-2004 Guus Sliepen , + 2003-2004 Ivo Timmermans + + 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 + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + + $Id$ +*/ + +#ifndef __EDGE_H__ +#define __EDGE_H__ + +#include "rt/node.h" +#include "support/avl.h" +#include "tnl/tnl.h" + +typedef struct edge_status { + int visited:1; + int mst:1; +} edge_status_t; + +typedef struct edge { + struct node *from; + struct node *to; + struct sockaddr_storage address; + + int weight; + + struct edge *reverse; + struct tnl *tnl; + + edge_status_t status; + node_options_t options; +} edge_t; + +extern avl_tree_t *edges; + +extern bool edge_init(void); +extern bool edge_exit(void); +extern struct edge *edge_new(void) __attribute__ ((__malloc__)); +extern void edge_free(struct edge *); +extern avl_tree_t *edge_tree_new(void) __attribute__ ((__malloc__)); +extern void edge_tree_free(avl_tree_t *); +extern void edge_add(struct edge *); +extern void edge_del(struct edge *); +extern struct edge *edge_get(struct node *, struct node *); + +#endif