X-Git-Url: https://tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Fsubnet.c;h=99d97bcdbb4d4dd2aaa5b6e957ccdc78976a8613;hp=48ac45e272a26e3884965cb3ce7d5cf54b8648f9;hb=b6298e2c082035b8238ea08673ced15d0fb7b89a;hpb=82e383710980534d38bb9a8ef22f20677cd85861 diff --git a/src/subnet.c b/src/subnet.c index 48ac45e2..99d97bcd 100644 --- a/src/subnet.c +++ b/src/subnet.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: subnet.c,v 1.1.2.25 2001/10/27 12:13:17 guus Exp $ + $Id: subnet.c,v 1.1.2.27 2001/10/28 22:42:49 guus Exp $ */ #include "config.h" @@ -40,13 +40,6 @@ avl_tree_t *subnet_tree; -void init_subnets(void) -{ -cp - subnet_tree = avl_alloc_tree((avl_compare_t)subnet_compare, (avl_action_t)free_subnet); -cp -} - /* Subnet comparison */ int subnet_compare_mac(subnet_t *a, subnet_t *b) @@ -121,6 +114,36 @@ cp } } +/* Initialising trees */ + +void init_subnets(void) +{ +cp + subnet_tree = avl_alloc_tree((avl_compare_t)subnet_compare, (avl_action_t)free_subnet); +cp +} + +void exit_subnets(void) +{ +cp + avl_delete_tree(subnet_tree); +cp +} + +avl_tree_t *new_subnet_tree(void) +{ +cp + return avl_alloc_tree((avl_compare_t)subnet_compare, NULL); +cp +} + +void free_subnet_tree(avl_tree_t *subnet_tree) +{ +cp + avl_delete_tree(subnet_tree); +cp +} + /* Allocating and freeing space for subnets */ subnet_t *new_subnet(void) @@ -338,7 +361,7 @@ cp return p; } -void dump_subnet_list(void) +void dump_subnets(void) { char *netstr; subnet_t *subnet;