--- gvpe/src/conf.C 2004/05/12 13:32:13 1.26 +++ gvpe/src/conf.C 2005/03/01 06:27:20 1.29 @@ -95,6 +95,7 @@ free (nodename); free (hostname); + free (domain); } void configuration::init () @@ -114,9 +115,10 @@ default_node.tcp_port = DEFAULT_UDPPORT; // ehrm default_node.connectmode = conf_node::C_ALWAYS; default_node.compress = true; - default_node.protocols = PROT_UDPv4; + default_node.protocols = 0; + default_node.max_retry = DEFAULT_MAX_RETRY; - conf.pidfilename = strdup (LOCALSTATEDIR "/run/vped.pid"); + conf.pidfilename = strdup (LOCALSTATEDIR "/run/gvpe.pid"); } void configuration::cleanup() @@ -126,11 +128,14 @@ rsa_key = 0; - free (pidfilename); pidfilename = 0; - free (ifname); ifname = 0; + free (pidfilename); pidfilename = 0; + free (ifname); ifname = 0; #if ENABLE_HTTP_PROXY - free (proxy_host); proxy_host = 0; - free (proxy_auth); proxy_auth = 0; + free (proxy_host); proxy_host = 0; + free (proxy_auth); proxy_auth = 0; +#endif +#if ENABLE_DNS + free (dns_forw_host); dns_forw_host = 0; #endif } @@ -165,7 +170,7 @@ clear_config (); - asprintf (&fname, "%s/vped.conf", confbase); + asprintf (&fname, "%s/gvpe.conf", confbase); f = fopen (fname, "r"); if (f) @@ -308,6 +313,18 @@ free (script_node_down), script_node_down = strdup (val); else if (!strcmp (var, "pid-file")) free (pidfilename), pidfilename = strdup (val); + else if (!strcmp (var, "dns-forw-host")) + { +#if ENABLE_DNS + free (dns_forw_host), dns_forw_host = strdup (val); +#endif + } + else if (!strcmp (var, "dns-forw-port")) + { +#if ENABLE_DNS + dns_forw_port = atoi (val); +#endif + } else if (!strcmp (var, "http-proxy-host")) { #if ENABLE_HTTP_PROXY @@ -337,9 +354,21 @@ else if (!strcmp (var, "tcp-port")) node->tcp_port = atoi (val); else if (!strcmp (var, "dns-port")) - node->dns_port = atoi (val); + { +#if ENABLE_DNS + node->dns_port = atoi (val); +#endif + } + else if (!strcmp (var, "dns-domain")) + { +#if ENABLE_DNS + free (node->domain), node->domain = strdup (val); +#endif + } else if (!strcmp (var, "router-priority")) node->routerprio = atoi (val); + else if (!strcmp (var, "max-retry")) + node->max_retry = atoi (val); else if (!strcmp (var, "connect")) { if (!strcmp (val, "ondemand")) @@ -352,8 +381,8 @@ node->connectmode = conf_node::C_DISABLED; else slog (L_WARN, - _("illegal value for 'connectmode', use one of 'ondemand', 'never', 'always' or 'disabled', at '%s' line %d"), - var, fname, lineno); + _("illegal value for 'connectmode', use one of 'ondemand', 'never', 'always' or 'disabled', at '%s' line %d"), + var, fname, lineno); } else if (!strcmp (var, "inherit-tos")) { @@ -387,7 +416,7 @@ u8 v; parse_bool (v, "enable-udp" , PROT_UDPv4, 0); node->protocols = (node->protocols & ~PROT_UDPv4) | v; } else if (!strcmp (var, "enable-rawip")) - {; + { u8 v; parse_bool (v, "enable-rawip", PROT_IPv4, 0); node->protocols = (node->protocols & ~PROT_IPv4 ) | v; } @@ -487,7 +516,7 @@ configuration::configuration () { - asprintf (&confbase, "%s/vpe", CONFDIR); + asprintf (&confbase, "%s/gvpe", CONFDIR); init (); }