/*
node.c -- node tree management
- Copyright (C) 2001-2003 Guus Sliepen <guus@sliepen.eu.org>,
- 2001-2003 Ivo Timmermans <ivo@o2w.nl>
+ Copyright (C) 2001-2006 Guus Sliepen <guus@tinc-vpn.org>,
+ 2001-2005 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
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.31 2003/12/22 11:04:16 guus Exp $
+ $Id$
*/
#include "system.h"
cp();
avl_insert(node_tree, n);
- avl_insert(node_udp_tree, n);
}
void node_del(node_t *n)
}
avl_delete(node_tree, n);
- avl_delete(node_udp_tree, n);
-}
-
-void update_node_address(node_t *n, const sockaddr_t address) {
- avl_node_t *node;
-
- node = avl_unlink(node_udp_tree, n);
- sockaddrfree(&n->address);
- sockaddrcpy(&n->address, &address);
-
- if(n->hostname)
- free(n->hostname);
-
- n->hostname = sockaddr2hostname(&n->address);
- avl_insert_node(node_udp_tree, node);
-
- if(n->options & OPTION_PMTU_DISCOVERY) {
- n->mtuprobes = 0;
- n->minmtu = 0;
- n->maxmtu = MTU;
- if(n->status.validkey)
- send_mtu_probe(n);
- }
}
node_t *lookup_node(char *name)