X-Git-Url: https://www.tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Fconf.c;h=3be2e33eda1874f6bf71d1dbadbaa5c8eb16b55a;hp=1ac01c31b4e5727609f7bc71f501115c4384da79;hb=c2752b961c9262386b940c2c053b9909bee22859;hpb=ea607d2d9292d3969f9d164b432dc64a33c2dade diff --git a/src/conf.c b/src/conf.c index 1ac01c31..3be2e33e 100644 --- a/src/conf.c +++ b/src/conf.c @@ -19,7 +19,7 @@ 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.44 2001/10/10 20:34:27 guus Exp $ + $Id: conf.c,v 1.9.4.51 2001/11/16 22:31:41 zarq Exp $ */ #include "config.h" @@ -42,7 +42,6 @@ #include #include "conf.h" -#include "netutl.h" /* for strtoip */ #include "system.h" @@ -126,11 +125,14 @@ cp 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) @@ -164,14 +166,14 @@ cp *result = 1; return 1; } - else if(!strcasecmp(cfg->value, "np")) + else if(!strcasecmp(cfg->value, "no")) { *result = 0; return 1; } syslog(LOG_ERR, _("\"yes\" or \"no\" expected for configuration variable %s in %s line %d"), - cfg->value, cfg->file, cfg->line); + cfg->variable, cfg->file, cfg->line); return 0; } @@ -186,7 +188,7 @@ cp return 1; syslog(LOG_ERR, _("Integer expected for configuration variable %s in %s line %d"), - cfg->value, cfg->file, cfg->line); + cfg->variable, cfg->file, cfg->line); return 0; } @@ -200,24 +202,43 @@ cp return 1; } -int get_config_ip(config_t *cfg, ip_mask_t **result) +int get_config_subnet(config_t *cfg, subnet_t **result) { - ip_mask_t *ip; + subnet_t *subnet; cp if(!cfg) return 0; - ip = strtoip(cfg->value); +#warning FIXME +/* ip = strtoip(cfg->value); */ - if(ip) - { - *result = ip; - return 1; - } +/* if(!ip) */ +/* { */ +/* syslog(LOG_ERR, _("IP address expected for configuration variable %s in %s line %d"), */ +/* cfg->variable, cfg->file, cfg->line); */ +/* return 0; */ +/* } */ + + /* Teach newbies what subnets are... */ + +/* if((ip->address & ip->mask) != ip->address) */ +/* { */ +/* syslog(LOG_ERR, _("Network address and subnet mask for configuration variable %s in %s line %d"), */ +/* cfg->variable, cfg->file, cfg->line); */ +/* free(ip); */ +/* return 0; */ +/* } */ + +/* subnet = new_subnet(); */ +/* subnet->type = SUBNET_IP; */ +/* subnet->net.ip.address = ip->address; */ +/* subnet->net.ip.mask = ip->mask; */ + +/* free(ip); */ - syslog(LOG_ERR, _("IP address expected for configuration variable %s in %s line %d"), - cfg->value, cfg->file, cfg->line); - return 0; +/* *result = subnet; */ + + return 1; } /*