--- gvpe/src/conf.C 2003/04/08 02:00:54 1.13 +++ gvpe/src/conf.C 2004/01/17 01:18:36 1.21 @@ -1,10 +1,6 @@ /* conf.c -- configuration code - Copyright (C) 1998 Robert van der Meulen - 1998-2002 Ivo Timmermans - 2000-2002 Guus Sliepen - 2000 Cris van Pelt - 2003 Marc Lehmann + Copyright (C) 2003-2004 Marc Lehmann 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 @@ -33,8 +29,7 @@ #include #include -#include -#include +#include "netcompat.h" #include #include @@ -104,11 +99,14 @@ { memset (this, 0, sizeof (*this)); + mtu = DEFAULT_MTU; rekey = DEFAULT_REKEY; keepalive = DEFAULT_KEEPALIVE; llevel = L_INFO; ip_proto = IPPROTO_GRE; +#if ENABLE_ICMP icmp_type = ICMP_ECHOREPLY; +#endif default_node.udp_port = DEFAULT_UDPPORT; default_node.tcp_port = DEFAULT_UDPPORT; @@ -230,7 +228,11 @@ else if (!strcmp (var, "ip-proto")) ip_proto = atoi (val); else if (!strcmp (var, "icmp-type")) - icmp_type = atoi (val); + { +#if ENABLE_ICMP + icmp_type = atoi (val); +#endif + } // per config else if (!strcmp (var, "node")) @@ -299,14 +301,24 @@ script_node_up = strdup (val); else if (!strcmp (var, "node-down")) script_node_down = strdup (val); -#if ENABLE_HTTP_PROXY else if (!strcmp (var, "http-proxy-host")) - proxy_host = strdup (val); + { +#if ENABLE_HTTP_PROXY + proxy_host = strdup (val); +#endif + } else if (!strcmp (var, "http-proxy-port")) - proxy_port = atoi (val); + { +#if ENABLE_HTTP_PROXY + proxy_port = atoi (val); +#endif + } else if (!strcmp (var, "http-proxy-auth")) - proxy_auth = (char *)base64_encode ((const u8 *)val, strlen (val)); + { +#if ENABLE_HTTP_PROXY + proxy_auth = (char *)base64_encode ((const u8 *)val, strlen (val)); #endif + } /* node-specific, non-defaultable */ else if (node != &default_node && !strcmp (var, "hostname")) @@ -440,7 +452,7 @@ printf (_("keepalive interval: %d\n"), keepalive); printf (_("interface: %s\n"), ifname); printf (_("primary rsa key: %s\n"), prikeyfile ? prikeyfile : ""); - printf (_("rsa key size: %d\n"), rsa_key ? RSA_size (rsa_key) : -1); + printf (_("rsa key size: %d\n"), rsa_key ? RSA_size (rsa_key) * 8 : -1); printf ("\n"); printf ("%4s %-17s %s %-8.8s %-10.10s %s\n",