along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: conf.c,v 1.9.4.45 2001/10/27 12:13:17 guus Exp $
+ $Id: conf.c,v 1.9.4.46 2001/10/27 15:19:13 guus Exp $
*/
#include "config.h"
cfg.line = 0;
found = avl_search_closest_greater(config_tree, &cfg);
+
+ if(!found)
+ return NULL;
- if(!strcmp(found->variable, variable))
- return found;
- else
+ if(strcmp(found->variable, variable))
return NULL;
+
+ return found;
}
config_t *lookup_config_next(avl_tree_t *config_tree, config_t *cfg)
/* Teach newbies what subnets are... */
- if((subnet->net.ipv4.address & subnet->net.ipv4.mask) != subnet->net.ipv4.address)
+ if((ip->address & ip->mask) != ip->address)
{
syslog(LOG_ERR, _("Network address and subnet mask for configuration variable %s in %s line %d"),
cfg->value, cfg->file, cfg->line);
free(ip);
- return -1;
+ return 0;
}
subnet = new_subnet();
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: connection.c,v 1.1.2.20 2001/10/27 12:13:17 guus Exp $
+ $Id: connection.c,v 1.1.2.21 2001/10/27 15:19:13 guus Exp $
*/
#include "config.h"
connection_t *new_connection(void)
{
+ connection_t *c;
+cp
+ c = (connection_t *)xmalloc_and_zero(sizeof(connection_t));
+ init_configuration(&c->config_tree);
cp
- return (connection_t *)xmalloc_and_zero(sizeof(connection_t));
+ return c;
}
void free_connection(connection_t *c)
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: net.c,v 1.35.4.138 2001/10/27 13:13:35 guus Exp $
+ $Id: net.c,v 1.35.4.139 2001/10/27 15:19:13 guus Exp $
*/
#include "config.h"
return -1;
}
*/
- if(!get_config_port(lookup_config(myself->connection->config_tree, "Port"), &myself->connection->port))
+ if(!get_config_port(lookup_config(myself->connection->config_tree, "Port"), &myself->port))
myself->port = 655;
+ myself->connection->port = myself->port;
+
/* Read in all the subnets specified in the host configuration file */
cfg = lookup_config(myself->connection->config_tree, "Subnet");
if(myself->options & OPTION_TCPONLY)
myself->options |= OPTION_INDIRECT;
- if(get_config_string(lookup_config(myself->connection->config_tree, "Mode"), &mode))
+ if(get_config_string(lookup_config(config_tree, "Mode"), &mode))
{
if(!strcasecmp(mode, "router"))
routing_mode = RMODE_ROUTER;
myself->key = (char *)xmalloc(myself->keylength);
RAND_pseudo_bytes(myself->key, myself->keylength);
- if(!get_config_int(lookup_config(myself->connection->config_tree, "KeyExpire"), &keylifetime))
+ if(!get_config_int(lookup_config(config_tree, "KeyExpire"), &keylifetime))
keylifetime = 3600;
keyexpires = time(NULL) + keylifetime;
cp
init_connections();
init_subnets();
+ init_nodes();
- if(get_config_int(lookup_config(myself->connection->config_tree, "PingTimeout"), &timeout))
+ if(get_config_int(lookup_config(config_tree, "PingTimeout"), &timeout))
{
if(timeout < 1)
{
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: process.c,v 1.1.2.27 2001/10/27 13:13:35 guus Exp $
+ $Id: process.c,v 1.1.2.28 2001/10/27 15:19:13 guus Exp $
*/
#include "config.h"
sigaction(i, &act, NULL);
}
+ if(!do_detach)
+ sighandlers[3].handler = SIG_DFL;
+
/* Then, for each known signal that we want to catch, assign a
handler to the signal, with error checking this time. */
for(i = 0; sighandlers[i].signal; i++)
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: tincd.c,v 1.10.4.53 2001/10/27 12:13:17 guus Exp $
+ $Id: tincd.c,v 1.10.4.54 2001/10/27 15:19:13 guus Exp $
*/
#include "config.h"
g_argv = argv;
make_names();
+ init_configuration(&config_tree);
/* Slllluuuuuuurrrrp! */
cp