--- gvpe/src/device-tincd.C 2003/10/16 13:37:10 1.5 +++ gvpe/src/device-tincd.C 2004/09/30 12:46:16 1.11 @@ -1,6 +1,6 @@ /* device-tincd.C -- include one of the tincd low level implementations. - Copyright (C) 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 @@ -69,8 +69,6 @@ u8 data[MAXSIZE]; }; -static tap_device *self; - static bool overwrite_mac; static bool @@ -93,23 +91,36 @@ #if IF_linux # include "tincd/linux/device.c" + #elif IF_freebsd # include "tincd/freebsd/device.c" + #elif IF_netbsd -#define IF_istun 1 +# define IF_istun 1 # include "tincd/netbsd/device.c" + +#elif IF_openbsd +# define IF_istun 1 +# include "tincd/openbsd/device.c" + #elif IF_solaris +# define IF_istun 1 # include "tincd/solaris/device.c" + #elif IF_cygwin # include "tincd/cygwin/device.c" + #elif IF_mingw # include "tincd/mingw/device.c" + #elif IF_darwin -#define IF_istun 1 +# define IF_istun 1 # include "tincd/darwin/device.c" + #elif IF_raw_socket -#define IF_istun 1 +# define IF_istun 1 # include "tincd/raw_socket/device.c" + #else # error No interface implementation for your IFTYPE/IFSUBTYPE combination. #endif @@ -126,18 +137,18 @@ tap_device::tap_device () { - self = this; + device = "(null)"; if (setup_device ()) { - //slog (L_DEBUG, _("%s is a %s"), device, info ()); + slog (L_DEBUG, _("interface %s on %s initialized"), info (), device); fd = device_fd; strcpy (ifrname, iface); } else { - slog (L_ERR, _("error while configuring tincd device (%s/%s)"), device, info ()); - exit (1); + slog (L_ERR, _("error while configuring tincd device %s on %s"), info (), device); + exit (EXIT_FAILURE); } }