Imported Upstream version 0.3.2 upstream/0.3.2
authorMichael Prokop <mika@debian.org>
Mon, 14 Dec 2009 01:53:24 +0000 (02:53 +0100)
committerMichael Prokop <mika@debian.org>
Mon, 14 Dec 2009 01:53:24 +0000 (02:53 +0100)
128 files changed:
ChangeLog
LICENSE
README
etc/anytun/client1/config
etc/anytun/client2/config
etc/anytun/client3/config
etc/anytun/p2p-a/config
etc/anytun/p2p-b/config
etc/anytun/server/config
etc/init.d/anytun
src/Makefile
src/anyrtpproxy/Makefile
src/anyrtpproxy/anyrtpproxy.cpp
src/anyrtpproxy/callIdQueue.cpp
src/anyrtpproxy/callIdQueue.h
src/anyrtpproxy/commandHandler.cpp
src/anyrtpproxy/commandHandler.h
src/anyrtpproxy/connectionList.cpp
src/anyrtpproxy/connectionList.h
src/anyrtpproxy/options.cpp
src/anyrtpproxy/options.h
src/anyrtpproxy/portWindow.cpp
src/anyrtpproxy/portWindow.h
src/anyrtpproxy/rtpSession.cpp
src/anyrtpproxy/rtpSession.h
src/anyrtpproxy/rtpSessionTable.cpp
src/anyrtpproxy/rtpSessionTable.h
src/anyrtpproxy/syncRtpCommand.cpp
src/anyrtpproxy/syncRtpCommand.h
src/anytun-config.cpp
src/anytun-controld.cpp
src/anytun-showtables.cpp
src/anytun.cpp
src/anytun.sln
src/anytun.suo
src/anytun.vcproj
src/anytunError.cpp
src/anytunError.h
src/authAlgo.cpp
src/authAlgo.h
src/authAlgoFactory.cpp
src/authAlgoFactory.h
src/bsd/tunDevice.cpp
src/buffer.cpp
src/buffer.h
src/cipher.cpp
src/cipher.h
src/cipherFactory.cpp
src/cipherFactory.h
src/configure
src/connectionList.cpp
src/connectionList.h
src/connectionParam.cpp
src/connectionParam.h
src/cryptinit.hpp
src/daemon.hpp
src/datatypes.h
src/deviceConfig.hpp
src/encryptedPacket.cpp
src/encryptedPacket.h
src/endian.h
src/keyDerivation.cpp
src/keyDerivation.h
src/keyDerivationFactory.cpp
src/keyDerivationFactory.h
src/linux/tunDevice.cpp
src/log.cpp
src/log.h
src/logTargets.cpp
src/logTargets.h
src/man/Makefile
src/man/anyrtpproxy.8.txt
src/man/anytun-config.8.txt
src/man/anytun-controld.8.txt
src/man/anytun-showtables.8.txt
src/man/anytun.8.txt
src/networkAddress.cpp
src/networkAddress.h
src/networkPrefix.cpp
src/networkPrefix.h
src/options.cpp
src/options.h
src/packetSource.cpp
src/packetSource.h
src/plainPacket.cpp
src/plainPacket.h
src/resolver.cpp
src/resolver.h
src/routingTable.cpp
src/routingTable.h
src/routingTree.hpp
src/routingTreeNode.cpp
src/routingTreeNode.h
src/seqWindow.cpp
src/seqWindow.h
src/signalController.cpp
src/signalController.h
src/syncBuffer.cpp
src/syncBuffer.h
src/syncClient.cpp
src/syncClient.h
src/syncCommand.cpp
src/syncCommand.h
src/syncConnectionCommand.cpp
src/syncConnectionCommand.h
src/syncOnConnect.hpp
src/syncQueue.cpp
src/syncQueue.h
src/syncRouteCommand.cpp
src/syncRouteCommand.h
src/syncServer.cpp
src/syncServer.h
src/syncTcpConnection.cpp
src/syncTcpConnection.h
src/sysExec.cpp [new file with mode: 0644]
src/sysExec.h [new file with mode: 0644]
src/sysexec.hpp [deleted file]
src/threadUtils.hpp
src/tunDevice.h
src/win32/#winService.cpp# [deleted file]
src/win32/common.h
src/win32/registryKey.cpp
src/win32/registryKey.h
src/win32/tunDevice.cpp
src/win32/winService.cpp
src/win32/winService.h
version [new file with mode: 0644]
wireshark-lua/satp.lua

index a2736ca..f53739c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2009.12.02 -- Version 0.3.2
+
+* added 64bit build target to windows build system
+* added install target to build system
+* cleaned up manpages
+* moved to new svn location
+
+2009.10.28 -- Version 0.3.1 svn852
+* switched to GPLv3 or higher
+* Changed Windows TAP driver version to support 64-bit windows
+* fixed some memory errors
+* improved logging
+* improved post up script execution
+* builds on FreeBSD now
+
 2009.5.1 -- Version 0.3 svn834
 
 * updated to new protocol specification (extended label and crypto role)
@@ -27,7 +42,6 @@
 * added manpages for all binaries
 * switched to GPLv3
 
-
 2008.4.12 -- Version 0.2svn490
 
 * updated to Internet Draft Revision 02
diff --git a/LICENSE b/LICENSE
index 51e0b22..44d9451 100644 (file)
--- a/LICENSE
+++ b/LICENSE
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/README b/README
index b7168e2..ffceb10 100644 (file)
--- a/README
+++ b/README
@@ -20,7 +20,32 @@ common:
   libboost-thread1.35-dev
   libboost-system1.35-dev
   libboost-regex1.35-dev
-  asciidoc (only for manpage)
+
+only for manpage:
+  asciidoc
+
+
+Freebsd
+-------
+
+using libgcrypt:
+   security/libgcrypt
+
+using ssl crypto lib:
+   <nothing here>
+
+common:
+   devel/boost
+   devel/gmake
+
+only for manpage:
+
+ textproc/asciidoc
+ textproc/libxslt
+ textproc/docbook-xsl
+ sysutils/readlink
+ misc/getopt 
+
 
 
 Windows
@@ -54,7 +79,8 @@ Installation
 
 Getting the source via subversion:
 ----------------------------------
-svn co http://anytun.org/svn/anytun/
+svn co http://svn.anytun.org/anytun/trunk anytun
+cd anytun
 
 Building from source
 --------------------
@@ -77,6 +103,56 @@ Notes:
   - if using openssl pre 0.9.8 you have to disable passphrase
     because openssl had no SHA256 implementation prior to this
     version
+  - on FreeBSD you have to use gmake instead of make
+
+Installing
+----------
+
+# sudo make install
+
+This will install anytun under the --prefix defined with configure.
+
+Uninstalling
+------------
+
+# sudo make remove
+
+This removes everytthing except for the config files
+
+# sudo make purge
+
+This also removes the config files
+
+
+
+Usage:
+======
+
+init.d script
+-------------
+
+The init.d script can be used to start anytun at boot time. It searches for 
+configuration files which reside at $CONFIG_DIR. For each instance of anytun
+which should be started there must be a directory containing at least a file
+named config. This file must contain all command line parameter which should
+be used when starting the daemon. One line for each parameter. Empty lines and
+lines starting with # are ignored. Besides the config file there may be a script
+named post-up.sh which will be called when the tun/tap device comes up. 
+Furthermore there may be a directory called conf.d containing config files for 
+anytun-config. The syntax of this files is quite the same as those for anytun. 
+These files are used to configure a multi connection setup using anytun-config 
+and anytun-controld
+This is an example of how the script can be used to start anytun:
+
+# /etc/init.d/anytun start client1 p2p-a
+
+In this case the script will start 2 instances of anytun using the config files
+$CONFIG_DIR/client1/config and $CONFIG_DIR/p2p-a/config. 
+If no instance name is specified the script will use the file $CONFIG_DIR/autostart
+to determine which instances to start or stop. This file must contain a list 
+of instance names which should be used when no names are specified at the command 
+line. One line for each name. Empty lines and lines starting with # are ignored.
+
 
 
 Errors:
index da11356..dec6c97 100644 (file)
@@ -53,8 +53,8 @@ remote-port 4444
 log syslog:3,anytun-client1,daemon
 
 ## change user and group after init
-username anytun
-groupname anytun
+#username anytun
+#groupname anytun
 
 ## chroot to users home directory
 #chroot /var/run/anytun
index ff9bab7..adc1cfa 100644 (file)
@@ -53,8 +53,8 @@ remote-port 4444
 log syslog:3,anytun-client2,daemon
 
 ## change user and group after init
-username anytun
-groupname anytun
+#username anytun
+#groupname anytun
 
 ## chroot to users home directory
 #chroot /var/run/anytun
index c5f529c..9714a51 100644 (file)
@@ -53,8 +53,8 @@ remote-port 4444
 log syslog:3,anytun-client3,daemon
 
 ## change user and group after init
-username anytun
-groupname anytun
+#username anytun
+#groupname anytun
 
 ## chroot to users home directory
 #chroot /var/run/anytun
index 126f918..d7d25b0 100644 (file)
@@ -61,8 +61,8 @@ remote-port 4445
 log syslog:3,anytun-p2p-a,daemon
 
 ## change user and group after init
-username anytun
-groupname anytun
+#username anytun
+#groupname anytun
 
 ## chroot to users home directory
 #chroot /var/run/anytun
index 859b26d..6f2d7a3 100644 (file)
@@ -61,8 +61,8 @@ remote-port 4445
 log syslog:3,anytun-p2p-b,daemon
 
 ## change user and group after init
-username anytun
-groupname anytun
+#username anytun
+#groupname anytun
 
 ## chroot to users home directory
 #chroot /var/run/anytun
index 8488923..1e5786a 100644 (file)
@@ -55,8 +55,8 @@ port 4444
 log syslog:3,anytun-server,daemon
 
 ## change user and group after init
-username nobody
-groupname nogroup
+#username anytun
+#groupname anytun
 
 ## chroot to /var/run/anytun
 #chroot /var/run/anytun
index d0299d4..3bf1e91 100755 (executable)
@@ -16,6 +16,7 @@ NAME=anytun
 DESC=anytun
 CONFIG_DIR=/etc/anytun
 VARCONFIG_DIR=/var/run/anytun-controld
+VARRUN_DIR=/var/run/anytun
 
 test -x $DAEMON || exit 0
 
@@ -33,8 +34,9 @@ start_vpn () {
     if [ -n "$CHROOTDIR" ] ; then
       test -d $CHROOTDIR || mkdir -p $CHROOTDIR
     fi
+    test -d $VARRUN_DIR || mkdir -p $VARRUN_DIR
     DAEMONARG=`sed 's/#.*//' < $CONFIG_DIR/$NAME/config | grep -e '\w' | sed  's/^/--/' | tr '\n' ' '`
-    $DAEMON --write-pid /var/run/anytun.$NAME.pid $POSTUP \
+    $DAEMON --write-pid $VARRUN_DIR/$NAME.pid $POSTUP \
       $DAEMONOPTS $DAEMONARG || STATUS="FAILED"
   else
     STATUS="no config found"
@@ -99,7 +101,7 @@ case "$1" in
   stop)
   echo -n "Stoping $DESC:"
   if test -z "$2" ; then
-    for PIDFILE in `ls /var/run/anytun.*.pid 2> /dev/null`; do
+    for PIDFILE in `ls $VARRUN_DIR/*.pid 2> /dev/null`; do
       NAME=`echo $PIDFILE | cut -c17-`
       NAME=${NAME%%.pid}
       echo -n " $NAME"
@@ -108,8 +110,8 @@ case "$1" in
   else
     while shift ; do
       [ -z "$1" ] && break
-      if test -e /var/run/anytun.$1.pid ; then
-        PIDFILE=`ls /var/run/anytun.$1.pid 2> /dev/null`
+      if test -e $VARRUN_DIR/$1.pid ; then
+        PIDFILE=`ls $VARRUN_DIR/$1.pid 2> /dev/null`
         NAME=`echo $PIDFILE | cut -c17-`
         NAME=${NAME%%.pid}
         echo -n " $NAME"
@@ -124,7 +126,7 @@ case "$1" in
   reload)
   echo -n "Reloading $DESC:"
   if test -z "$2" ; then
-    for PIDFILE in `ls /var/run/anytun.*.pid 2> /dev/null`; do
+    for PIDFILE in `ls $VARRUN_DIR/*.pid 2> /dev/null`; do
       NAME=`echo $PIDFILE | cut -c17-`
       NAME=${NAME%%.pid}
       echo -n " $NAME"
@@ -139,8 +141,8 @@ case "$1" in
   else
     while shift ; do
       [ -z "$1" ] && break
-      if test -e /var/run/anytun.$1.pid ; then
-        PIDFILE=`ls /var/run/anytun.$1.pid 2> /dev/null`
+      if test -e $VARRUN_DIR/$1.pid ; then
+        PIDFILE=`ls $VARRUN_DIR/$1.pid 2> /dev/null`
         NAME=`echo $PIDFILE | cut -c17-`
         NAME=${NAME%%.pid}
         echo -n " $NAME"
@@ -161,7 +163,7 @@ case "$1" in
   force-reload)
   echo -n "Restarting $DESC:"
   if test -z "$2" ; then
-    for PIDFILE in `ls /var/run/anytun.*.pid 2> /dev/null`; do
+    for PIDFILE in `ls $VARRUN_DIR/*.pid 2> /dev/null`; do
       NAME=`echo $PIDFILE | cut -c17-`
       NAME=${NAME%%.pid}
       echo -n " $NAME"
@@ -172,8 +174,8 @@ case "$1" in
   else
     while shift ; do
       [ -z "$1" ] && break
-      if test -e /var/run/anytun.$1.pid ; then
-        PIDFILE=`ls /var/run/anytun.$1.pid 2> /dev/null`
+      if test -e $VARRUN_DIR/$1.pid ; then
+        PIDFILE=`ls $VARRUN_DIR/$1.pid 2> /dev/null`
         NAME=`echo $PIDFILE | cut -c17-`
         NAME=${NAME%%.pid}
         echo -n " $NAME"
index 4f75c70..f3c9801 100644 (file)
 ##  tunneling and relaying of packets of any protocol.
 ##
 ##
-##  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+##  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
 ##                          Christian Pointner <satp@wirdorange.org>
 ##
 ##  This file is part of Anytun.
 ##
 ##  Anytun is free software: you can redistribute it and/or modify
-##  it under the terms of the GNU General Public License version 3 as
-##  published by the Free Software Foundation.
+##  it under the terms of the GNU General Public License as published by
+##  the Free Software Foundation, either version 3 of the License, or
+##  any later version.
 ##
 ##  Anytun is distributed in the hope that it will be useful,
 ##  but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -34,73 +35,74 @@ include include.mk
 endif
 
 OBJS := tunDevice.o \
-       packetSource.o \
-       buffer.o \
-       syncBuffer.o \
-                        plainPacket.o \
-                        encryptedPacket.o \
-       cipher.o \
-       authAlgo.o \
-                        keyDerivation.o \
-                        cipherFactory.o \
-                        authAlgoFactory.o \
-                        keyDerivationFactory.o \
-                        connectionList.o \
-                        connectionParam.o \
-                        networkAddress.o \
-                        networkPrefix.o \
-                        routingTable.o \
-       signalController.o \
-       log.o \
-       logTargets.o \
-       anytunError.o \
-       options.o \
-       seqWindow.o \
-                        routingTreeNode.o \
-                        resolver.o
+        packetSource.o \
+        buffer.o \
+        syncBuffer.o \
+        plainPacket.o \
+        encryptedPacket.o \
+        cipher.o \
+        authAlgo.o \
+        keyDerivation.o \
+        cipherFactory.o \
+        authAlgoFactory.o \
+        keyDerivationFactory.o \
+        connectionList.o \
+        connectionParam.o \
+        networkAddress.o \
+        networkPrefix.o \
+        routingTable.o \
+        signalController.o \
+        log.o \
+        logTargets.o \
+        sysExec.o \
+        anytunError.o \
+        options.o \
+        seqWindow.o \
+        routingTreeNode.o \
+        resolver.o
 
 SYNCOBJS := syncServer.o \
-       syncClient.o \
-       syncQueue.o \
-                        syncCommand.o \
-       syncRouteCommand.o \
-       syncConnectionCommand.o \
-       syncTcpConnection.o
+            syncClient.o \
+            syncQueue.o \
+            syncCommand.o \
+            syncRouteCommand.o \
+            syncConnectionCommand.o \
+            syncTcpConnection.o
 
 ANYCTROBJS := signalController.o \
-                                                       anyCtrOptions.o \
-                                                buffer.o \
-                                                log.o \
-                                                logTargets.o \
-                                                anytunError.o \
-                                                syncTcpConnection.o \
-                                                syncServer.o \
-                                                resolver.o
+              anyCtrOptions.o \
+              buffer.o \
+              log.o \
+              logTargets.o \
+              anytunError.o \
+              syncTcpConnection.o \
+              syncServer.o \
+              resolver.o
 
 ANYCONFOBJS := log.o \
-                                                logTargets.o \
-                                                anytunError.o \
-                                                buffer.o \
-                                                keyDerivation.o \
-                                                keyDerivationFactory.o \
-                                                networkAddress.o \
-                                                networkPrefix.o \
-                                                connectionList.o \
-                                                connectionParam.o \
-                                                routingTreeNode.o \
-                                                anyConfOptions.o \
-                                                routingTable.o \
-                                                seqWindow.o \
-                                                syncQueue.o \
-                                                syncBuffer.o \
-                                                syncCommand.o \
-                                                syncServer.o \
-             syncTcpConnection.o \
-                                                syncRouteCommand.o \
-                                                syncConnectionCommand.o \
-                                                resolver.o
-
-EXECUTABLE := anytun anytun-config anytun-controld anytun-showtables anytun-nosync
+               logTargets.o \
+               anytunError.o \
+               buffer.o \
+               keyDerivation.o \
+               keyDerivationFactory.o \
+               networkAddress.o \
+               networkPrefix.o \
+               connectionList.o \
+               connectionParam.o \
+               routingTreeNode.o \
+               anyConfOptions.o \
+               routingTable.o \
+               seqWindow.o \
+               syncQueue.o \
+               syncBuffer.o \
+               syncCommand.o \
+               syncServer.o \
+               syncTcpConnection.o \
+               syncRouteCommand.o \
+               syncConnectionCommand.o \
+               resolver.o
+
+EXECUTABLES := anytun anytun-config anytun-controld anytun-showtables anytun-nosync
 EXEOBJS := anytun.o anytun-config.o anytun-controld.o anytun-showtables.o
 
 SRCS := $(OBJS:%.o=%.cpp)
@@ -109,29 +111,29 @@ ANYCTRSRCS := $(ANYCTROBJS:%.o=%.cpp)
 ANYCONFSRCS := $(ANYCONFOBJS:%.o=%.cpp)
 EXESRCS := $(EXEOBJS:%.o=%.cpp)
 
-.PHONY: distclean cleanall clean ctags
+.PHONY: distclean cleanall clean manpage install install-bin install-etc install-man uninstall remove purge
 
-all: $(EXECUTABLE) #libAnysync.a 
+all: $(EXECUTABLES) #libAnysync.a 
 
 %.d: %.cpp
-       @set -e; rm -f $@; \
-        $(CXX) -MM $(CXXFLAGS) $< > $@.$$$$; \
-   sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \
+       @set -e; rm -f $@;                                    \
+   $(CXX) -MM $(CXXFLAGS) $< > $@.$$$$;                 \
+   sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@;  \
    rm -f $@.$$$$; echo '(re)building $@'
 
 ifneq ($(MAKECMDGOALS),distclean)
 -include $(SRCS:%.cpp=%.d) $(SYNCSRCS:%.cpp=%.d) $(ANYCTRSRCS:%.cpp=%.d) $(ANYCONFSRCS:%.cpp=%.d) $(EXESRCS:%.cpp=%.d)
 endif
 
-strip: $(EXECUTABLE)
-       strip -s $(EXECUTABLE
+strip: $(EXECUTABLES)
+       $(STRIP) -s $(EXECUTABLES
 
 anytun: $(OBJS) $(SYNCOBJS) anytun.o
        $(LD) $(OBJS) $(SYNCOBJS) anytun.o -o $@ $(LDFLAGS)
 
 anytun-static: $(OBJS) $(SYNCOBJS) anytun-noprivdrop.o
        $(LD) $(OBJS) $(SYNCOBJS) anytun-noprivdrop.o -o $@ -Bstatic -lstdc++ -static $(LDFLAGS) -lpthread
-       strip -s anytun-static
+       $(STRIP) -s anytun-static
 
 anytun-nosync: $(OBJS) anytun-nosync.o
        $(LD) $(OBJS) anytun-nosync.o -o $@ $(LDFLAGS)
@@ -186,7 +188,7 @@ clean:
        rm -f *.o
        rm -f *.d
        rm -f *.d.*
-       rm -f $(EXECUTABLE)
+       rm -f $(EXECUTABLES)
        rm -f anytun-nosync
        rm -f -r doc/html/*
        rm -f -r doc/latex/*
@@ -196,3 +198,98 @@ clean:
 manpage:
        @cd man ; $(MAKE)
 
+
+INSTALL_TARGETS := install-bin install-etc
+REMOVE_TARGETS := remove-bin remove-etc
+
+ifdef MANDIR
+INSTALL_TARGETS += install-man
+REMOVE_TARGETS += remove-man
+endif
+
+ifdef EXAMPLESDIR
+INSTALL_TARGETS += install-examples
+REMOVE_TARGETS += remove-examples
+endif
+
+install: all $(INSTALL_TARGETS)
+
+install-bin: $(EXECUTABLES)
+       $(INSTALL) -d $(DESTDIR)$(SBINDIR)
+       $(INSTALL) -m 755 anytun $(DESTDIR)$(SBINDIR)
+       $(INSTALL) -d $(DESTDIR)$(BINDIR)
+       $(INSTALL) -m 755 anytun-config $(DESTDIR)$(BINDIR)
+       $(INSTALL) -m 755 anytun-controld $(DESTDIR)$(BINDIR)
+       $(INSTALL) -m 755 anytun-showtables $(DESTDIR)$(BINDIR)
+
+install-etc:
+       $(INSTALL) -d $(DESTDIR)$(ETCDIR)/anytun
+       @ echo "example configurations can be found at $(EXAMPLESDIR)/anytun" > $(DESTDIR)$(ETCDIR)/anytun/README
+       $(INSTALL) -d $(DESTDIR)$(ETCDIR)/init.d
+       @ sed -e 's#DAEMON=/usr/sbin/anytun#DAEMON=$(SBINDIR)/anytun#'                               \
+        -e 's#ANYTUNCONFIG=/usr/bin/anytun-config#ANYTUNCONFIG=$(BINDIR)/anytun-config#'       \
+        -e 's#CONTROLDAEMON=/usr/bin/anytun-controld#CONTROLDAEMON=$(BINDIR)/anytun-controld#' \
+        -e 's#CONFIG_DIR=/etc/anytun#CONFIG_DIR=$(ETCDIR)/anytun#' ../etc/init.d/anytun > ../etc/init.d/anytun.bak
+       $(INSTALL) -m 755 ../etc/init.d/anytun.bak $(DESTDIR)$(ETCDIR)/init.d/anytun
+       rm -f ../etc/init.d/anytun.bak
+
+install-examples:
+       $(INSTALL) -d $(DESTDIR)$(EXAMPLESDIR)/anytun
+       $(INSTALL) -m 644 ../etc/anytun/autostart $(DESTDIR)$(EXAMPLESDIR)/anytun/autostart
+       @( cd '../etc/anytun/' ;                                                                   \
+     for dir in `ls`; do                                                                     \
+       if [ -d $$dir ]; then                                                                 \
+         echo "install $$dir configuration" ;                                                \
+         cd $$dir ;                                                                          \
+         $(INSTALL) -d $(DESTDIR)$(EXAMPLESDIR)/anytun/$$dir ;                               \
+         $(INSTALL) -m 600 config $(DESTDIR)$(EXAMPLESDIR)/anytun/$$dir/config ;             \
+         if [ -e 'post-up.sh' ]; then                                                        \
+           $(INSTALL) -m 755 post-up.sh $(DESTDIR)$(EXAMPLESDIR)/anytun/$$dir/post-up.sh ;   \
+         fi ;                                                                                \
+         if [ -d 'conf.d' ]; then                                                            \
+           $(INSTALL) -d $(DESTDIR)$(EXAMPLESDIR)/anytun/$$dir/conf.d ;                      \
+           cd conf.d ;                                                                       \
+           for file in `ls`; do                                                              \
+             if [ -f $$file ]; then                                                          \
+               $(INSTALL) -m 644 $$file $(DESTDIR)$(EXAMPLESDIR)/anytun/$$dir/conf.d ;       \
+             fi ;                                                                            \
+           done ;                                                                            \
+           cd .. ;                                                                           \
+         fi ;                                                                                \
+         cd .. ;                                                                             \
+       fi ;                                                                                  \
+     done                                                                                    \
+   )
+
+install-man: manpage
+       $(INSTALL) -d $(DESTDIR)$(MANDIR)/man8/
+       $(INSTALL) -m 644 man/anytun.8 $(DESTDIR)$(MANDIR)/man8/
+       $(INSTALL) -m 644 man/anytun-config.8 $(DESTDIR)$(MANDIR)/man8/
+       $(INSTALL) -m 644 man/anytun-controld.8 $(DESTDIR)$(MANDIR)/man8/
+       $(INSTALL) -m 644 man/anytun-showtables.8 $(DESTDIR)$(MANDIR)/man8/
+
+uninstall: remove
+
+
+remove: $(REMOVE_TARGETS)
+
+remove-bin:
+       rm -f $(DESTDIR)$(SBINDIR)/anytun
+       rm -f $(DESTDIR)$(BINDIR)/anytun-config
+       rm -f $(DESTDIR)$(BINDIR)/anytun-controld
+       rm -f $(DESTDIR)$(BINDIR)/anytun-showtables
+
+remove-etc:
+       rm -f $(DESTDIR)$(ETCDIR)/init.d/anytun
+
+remove-examples:
+       rm -rf $(DESTDIR)$(EXAMPLESDIR)/anytun/
+
+remove-man:
+       rm -f $(DESTDIR)$(MANDIR)/man8/anytun.8
+       rm -f $(DESTDIR)$(MANDIR)/man8/anytun-config.8
+       rm -f $(DESTDIR)$(MANDIR)/man8/anytun-controld.8
+       rm -f $(DESTDIR)$(MANDIR)/man8/anytun-showtables.8
+
+purge: remove
+       rm -rf $(DESTDIR)$(ETCDIR)/anytun/
index 40ca273..43b6220 100644 (file)
 ##  tunneling and relaying of packets of any protocol.
 ##
 ##
-##  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+##  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
 ##                          Christian Pointner <satp@wirdorange.org>
 ##
 ##  This file is part of Anytun.
 ##
 ##  Anytun is free software: you can redistribute it and/or modify
-##  it under the terms of the GNU General Public License version 3 as
-##  published by the Free Software Foundation.
+##  it under the terms of the GNU General Public License as published by
+##  the Free Software Foundation, either version 3 of the License, or
+##  any later version.
 ##
 ##  Anytun is distributed in the hope that it will be useful,
 ##  but WITHOUT ANY WARRANTY; without even the implied warranty of
index fdb809e..7c5514c 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -211,7 +212,7 @@ void chrootAndDrop(string const& chrootdir, string const& username)
 {
        if (getuid() != 0)
        {
-         std::cerr << "this programm has to be run as root in order to run in a chroot" << std::endl;
+         std::cerr << "this program has to be run as root in order to run in a chroot" << std::endl;
                exit(-1);
        }       
 
index e2ce700..de48bab 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
index 1ffe2df..2cea155 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
index 01613ec..db0ca4d 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
index 6bd802a..6634f14 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
index eea1e38..4c274e8 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
index de45f8a..a30f6d5 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
index 6a48483..e651770 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
index af09d4f..679dace 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
index 99dafd7..3e07662 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
index f3bdffb..b5a667f 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
index a3551e3..93333ac 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
index 3716c9b..cac5115 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
index 9237866..934cf8c 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
index a37318d..49a062f 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
index f612c8a..10dfbf4 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
index 282243b..7b4c186 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
index 72e4902..f8bc4f4 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
index f32ec83..1dbc6f8 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
index 5d061d6..ff851c9 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
index 34fd5f5..de8429f 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  *  along with anytun.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#include <boost/bind.hpp>
+#include <boost/thread.hpp>
+#include <boost/assign.hpp>
 #include <iostream>
 #include <fstream>
 
-
-#include <boost/bind.hpp>
-#include <cerrno>     // for ENOMEM
-
 #include "datatypes.h"
 
 #include "log.h"
@@ -76,7 +76,7 @@
 
 #include "cryptinit.hpp"
 #include "daemon.hpp"
-#include "sysexec.hpp"
+#include "sysExec.h"
 
 bool disableRouting = false;
 
@@ -327,7 +327,7 @@ void startSendRecvThreads(TunDevice* dev, PacketSource* src)
       do_chroot(gOpt.getChrootDir());
     }
     catch(const std::runtime_error& e) {
-      cLog.msg(Log::PRIO_WARNING) << "ignroing chroot error: " << e.what();
+      cLog.msg(Log::PRIO_WARNING) << "ignoring chroot error: " << e.what();
     }
   }
 #ifndef NO_PRIVDROP
@@ -445,7 +445,8 @@ int main(int argc, char* argv[])
 #ifndef NO_EXEC
     if(gOpt.getPostUpScript() != "") {
       cLog.msg(Log::PRIO_NOTICE) << "executing post-up script '" << gOpt.getPostUpScript() << "'";
-      execScript(gOpt.getPostUpScript(), dev.getActualName(), dev.getActualNode());
+      StringVector args = boost::assign::list_of(dev.getActualName())(dev.getActualNode());
+      anytun_exec(gOpt.getPostUpScript(), args);
     }
 #endif
     
index b562246..0e5c04c 100644 (file)
@@ -6,19 +6,31 @@ EndProject
 Global\r
        GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
                Debug|Win32 = Debug|Win32\r
+               Debug|x64 = Debug|x64\r
                Release|Win32 = Release|Win32\r
+               Release|x64 = Release|x64\r
                Service Debug|Win32 = Service Debug|Win32\r
+               Service Debug|x64 = Service Debug|x64\r
                Service Release|Win32 = Service Release|Win32\r
+               Service Release|x64 = Service Release|x64\r
        EndGlobalSection\r
        GlobalSection(ProjectConfigurationPlatforms) = postSolution\r
                {12460D00-D78A-4C68-BDE2-9E3B2F9CD0F3}.Debug|Win32.ActiveCfg = Debug|Win32\r
                {12460D00-D78A-4C68-BDE2-9E3B2F9CD0F3}.Debug|Win32.Build.0 = Debug|Win32\r
+               {12460D00-D78A-4C68-BDE2-9E3B2F9CD0F3}.Debug|x64.ActiveCfg = Debug|x64\r
+               {12460D00-D78A-4C68-BDE2-9E3B2F9CD0F3}.Debug|x64.Build.0 = Debug|x64\r
                {12460D00-D78A-4C68-BDE2-9E3B2F9CD0F3}.Release|Win32.ActiveCfg = Release|Win32\r
                {12460D00-D78A-4C68-BDE2-9E3B2F9CD0F3}.Release|Win32.Build.0 = Release|Win32\r
+               {12460D00-D78A-4C68-BDE2-9E3B2F9CD0F3}.Release|x64.ActiveCfg = Release|x64\r
+               {12460D00-D78A-4C68-BDE2-9E3B2F9CD0F3}.Release|x64.Build.0 = Release|x64\r
                {12460D00-D78A-4C68-BDE2-9E3B2F9CD0F3}.Service Debug|Win32.ActiveCfg = Service Debug|Win32\r
                {12460D00-D78A-4C68-BDE2-9E3B2F9CD0F3}.Service Debug|Win32.Build.0 = Service Debug|Win32\r
+               {12460D00-D78A-4C68-BDE2-9E3B2F9CD0F3}.Service Debug|x64.ActiveCfg = Service Debug|x64\r
+               {12460D00-D78A-4C68-BDE2-9E3B2F9CD0F3}.Service Debug|x64.Build.0 = Service Debug|x64\r
                {12460D00-D78A-4C68-BDE2-9E3B2F9CD0F3}.Service Release|Win32.ActiveCfg = Service Release|Win32\r
                {12460D00-D78A-4C68-BDE2-9E3B2F9CD0F3}.Service Release|Win32.Build.0 = Service Release|Win32\r
+               {12460D00-D78A-4C68-BDE2-9E3B2F9CD0F3}.Service Release|x64.ActiveCfg = Service Release|x64\r
+               {12460D00-D78A-4C68-BDE2-9E3B2F9CD0F3}.Service Release|x64.Build.0 = Service Release|x64\r
        EndGlobalSection\r
        GlobalSection(SolutionProperties) = preSolution\r
                HideSolutionNode = FALSE\r
index a2b304d..436969a 100644 (file)
Binary files a/src/anytun.suo and b/src/anytun.suo differ
index ea6a923..c64c5da 100644 (file)
@@ -13,6 +13,9 @@
                <Platform\r
                        Name="Win32"\r
                />\r
+               <Platform\r
+                       Name="x64"\r
+               />\r
        </Platforms>\r
        <ToolFiles>\r
        </ToolFiles>\r
                                Name="VCPostBuildEventTool"\r
                        />\r
                </Configuration>\r
+               <Configuration\r
+                       Name="Debug|x64"\r
+                       OutputDirectory="$(PlatformName)\$(ConfigurationName)"\r
+                       IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"\r
+                       ConfigurationType="1"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                               TargetEnvironment="3"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               AdditionalOptions="/I &quot;C:\Program Files\boost\boost_1_35_0\&quot;"\r
+                               Optimization="0"\r
+                               PreprocessorDefinitions="LOG_FILE;LOG_STDOUT;LOG_WINEVENTLOG;USE_SSL_CRYPTO;NO_DAEMON;NO_EXEC;WIN32_LEAN_AND_MEAN;BOOST_ALL_DYN_LINK"\r
+                               MinimalRebuild="true"\r
+                               BasicRuntimeChecks="3"\r
+                               RuntimeLibrary="3"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               DebugInformationFormat="3"\r
+                               ForcedIncludeFiles=""\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               AdditionalDependencies="libeay32MDd.lib"\r
+                               LinkIncremental="2"\r
+                               AdditionalLibraryDirectories=""\r
+                               IgnoreAllDefaultLibraries="false"\r
+                               GenerateDebugInformation="true"\r
+                               SubSystem="1"\r
+                               TargetMachine="17"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+               <Configuration\r
+                       Name="Release|x64"\r
+                       OutputDirectory="$(PlatformName)\$(ConfigurationName)"\r
+                       IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"\r
+                       ConfigurationType="1"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                               TargetEnvironment="3"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               PreprocessorDefinitions="LOG_FILE;LOG_STDOUT;LOG_WINEVENTLOG;USE_SSL_CRYPTO;NO_DAEMON;NO_EXEC;WIN32_LEAN_AND_MEAN;BOOST_ALL_DYN_LINK"\r
+                               RuntimeLibrary="2"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               Detect64BitPortabilityProblems="false"\r
+                               DebugInformationFormat="3"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               AdditionalDependencies="libeay32MD.lib"\r
+                               LinkIncremental="2"\r
+                               AdditionalLibraryDirectories=""\r
+                               GenerateDebugInformation="true"\r
+                               SubSystem="1"\r
+                               OptimizeReferences="2"\r
+                               EnableCOMDATFolding="2"\r
+                               TargetMachine="17"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+               <Configuration\r
+                       Name="Service Debug|x64"\r
+                       OutputDirectory="$(PlatformName)\$(ConfigurationName)"\r
+                       IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"\r
+                       ConfigurationType="1"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                               TargetEnvironment="3"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               AdditionalOptions="/I &quot;C:\Program Files\boost\boost_1_35_0\&quot;"\r
+                               Optimization="0"\r
+                               PreprocessorDefinitions="LOG_FILE;LOG_STDOUT;LOG_WINEVENTLOG;WIN_SERVICE;USE_SSL_CRYPTO;NO_DAEMON;NO_EXEC;WIN32_LEAN_AND_MEAN;BOOST_ALL_DYN_LINK"\r
+                               MinimalRebuild="true"\r
+                               BasicRuntimeChecks="3"\r
+                               RuntimeLibrary="3"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               Detect64BitPortabilityProblems="false"\r
+                               DebugInformationFormat="3"\r
+                               ForcedIncludeFiles=""\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               AdditionalDependencies="libeay32MDd.lib"\r
+                               OutputFile="$(OutDir)\$(ProjectName)svc.exe"\r
+                               LinkIncremental="2"\r
+                               AdditionalLibraryDirectories=""\r
+                               IgnoreAllDefaultLibraries="false"\r
+                               GenerateDebugInformation="true"\r
+                               SubSystem="1"\r
+                               TargetMachine="17"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+               <Configuration\r
+                       Name="Service Release|x64"\r
+                       OutputDirectory="$(PlatformName)\$(ConfigurationName)"\r
+                       IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"\r
+                       ConfigurationType="1"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                               TargetEnvironment="3"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               PreprocessorDefinitions="LOG_FILE;LOG_STDOUT;LOG_WINEVENTLOG;WIN_SERVICE;USE_SSL_CRYPTO;NO_DAEMON;NO_EXEC;WIN32_LEAN_AND_MEAN;BOOST_ALL_DYN_LINK"\r
+                               RuntimeLibrary="2"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               Detect64BitPortabilityProblems="false"\r
+                               DebugInformationFormat="3"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               AdditionalDependencies="libeay32MD.lib"\r
+                               OutputFile="$(OutDir)\$(ProjectName)svc.exe"\r
+                               LinkIncremental="2"\r
+                               AdditionalLibraryDirectories=""\r
+                               GenerateDebugInformation="true"\r
+                               SubSystem="1"\r
+                               OptimizeReferences="2"\r
+                               EnableCOMDATFolding="2"\r
+                               TargetMachine="17"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
        </Configurations>\r
        <References>\r
        </References>\r
                                                PreprocessorDefinitions="ANYTUN_OPTIONS"\r
                                        />\r
                                </FileConfiguration>\r
+                               <FileConfiguration\r
+                                       Name="Debug|x64"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="VCCLCompilerTool"\r
+                                               PreprocessorDefinitions="ANYTUN_OPTIONS"\r
+                                       />\r
+                               </FileConfiguration>\r
+                               <FileConfiguration\r
+                                       Name="Release|x64"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="VCCLCompilerTool"\r
+                                               PreprocessorDefinitions="ANYTUN_OPTIONS"\r
+                                       />\r
+                               </FileConfiguration>\r
+                               <FileConfiguration\r
+                                       Name="Service Debug|x64"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="VCCLCompilerTool"\r
+                                               PreprocessorDefinitions="ANYTUN_OPTIONS"\r
+                                       />\r
+                               </FileConfiguration>\r
+                               <FileConfiguration\r
+                                       Name="Service Release|x64"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="VCCLCompilerTool"\r
+                                               PreprocessorDefinitions="ANYTUN_OPTIONS"\r
+                                       />\r
+                               </FileConfiguration>\r
                        </File>\r
                        <File\r
                                RelativePath=".\packetSource.cpp"\r
index 1a530a7..60bf8eb 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
index 26b4012..d500545 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -29,8 +30,8 @@
  *  along with anytun.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef _ANYTUN_ERROR_H
-#define _ANYTUN_ERROR_H
+#ifndef ANYTUN_anytunError_h_INCLUDED
+#define ANYTUN_anytunError_h_INCLUDED
 
 #include <sstream>
 #include <boost/system/system_error.hpp>
index 49974ee..f9228c6 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
index c446853..1c7fa1b 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -28,9 +29,8 @@
  *  You should have received a copy of the GNU General Public License
  *  along with anytun.  If not, see <http://www.gnu.org/licenses/>.
  */
-
-#ifndef _AUTHALGO_H_
-#define _AUTHALGO_H_
+#ifndef ANYTUN_authAlgo_h_INCLUDED
+#define ANYTUN_authAlgo_h_INCLUDED
 
 #include "datatypes.h"
 #include "buffer.h"
index c284f34..d1b2fc5 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
index 2dca567..db3125b 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -29,8 +30,8 @@
  *  along with anytun.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef _AUTHALGO_FACTORY_H_
-#define _AUTHALGO_FACTORY_H_
+#ifndef ANYTUN_authAlgoFactory_h_INCLUDED
+#define ANYTUN_authAlgoFactory_h_INCLUDED
 
 #include <string>
 
index 408434e..4fdd5fd 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -29,6 +30,9 @@
  *  along with anytun.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#include <sstream>
+#include <boost/assign.hpp>
+
 #include <fcntl.h>
 #include <unistd.h>
 #include <errno.h>
 #include <netinet/in.h>
 #include <netinet/ip.h>
 
-#include <sstream>
-
 #include "tunDevice.h"
 #include "threadUtils.hpp"
 #include "log.h"
 #include "anytunError.h"
+#include "sysExec.h"
 
 #define DEVICE_FILE_MAX 255
 
-TunDevice::TunDevice(std::string dev_name, std::string dev_type, std::string ifcfg_addr, std::string ifcfg_prefix) : conf_(dev_name, dev_type, ifcfg_addr, ifcfg_prefix, 1400)
+TunDevice::TunDevice(std::string dev_name, std::string dev_type, std::string ifcfg_addr, u_int16_t ifcfg_prefix) : conf_(dev_name, dev_type, ifcfg_addr, ifcfg_prefix, 1400)
 {
   std::string device_file = "/dev/";
   bool dynamic = true;
@@ -154,22 +157,22 @@ void TunDevice::init_post()
   if(conf_.type_ == TYPE_TAP)
     with_pi_ = false;
 
-  if(dev->type_ == TYPE_TUN) {
+  if(conf_.type_ == TYPE_TUN) {
     int arg = 0;
-    if(ioctl(dev->fd_, TUNSLMODE, &arg) < 0) {
+    if(ioctl(fd_, TUNSLMODE, &arg) < 0) {
       ::close(fd_);
       AnytunError::throwErr() << "can't disable link-layer mode for interface: " << AnytunErrno(errno);
     }
 
     arg = 1;
-    if(ioctl(dev->fd_, TUNSIFHEAD, &arg) < 0) {
+    if(ioctl(fd_, TUNSIFHEAD, &arg) < 0) {
       ::close(fd_);
       AnytunError::throwErr() << "can't enable multi-af modefor interface: " << AnytunErrno(errno);
     }
 
     arg = IFF_BROADCAST;
     arg |= IFF_MULTICAST;
-    if(ioctl(dev->fd_, TUNSIFMODE, &arg) < 0) {
+    if(ioctl(fd_, TUNSIFMODE, &arg) < 0) {
       ::close(fd_);
       AnytunError::throwErr() << "can't enable multicast for interface: " << AnytunErrno(errno);
     }
@@ -197,7 +200,7 @@ int TunDevice::fix_return(int ret, size_t pi_length) const
   if(ret < 0)
     return ret;
 
-  return (static_cast<size_t>(ret) > type_length ? (ret - type_length) : 0);
+  return (static_cast<size_t>(ret) > pi_length ? (ret - pi_length) : 0);
 }
 
 int TunDevice::read(u_int8_t* buf, u_int32_t len)
@@ -250,34 +253,23 @@ int TunDevice::write(u_int8_t* buf, u_int32_t len)
 
 void TunDevice::do_ifconfig()
 {
-  std::ostringstream command;
-  command << "/sbin/ifconfig " << actual_name_ << " " << conf_.addr_.toString()
-          << " netmask " << conf_.netmask_.toString() << " mtu " << conf_.mtu_;
+  std::ostringstream mtu_ss;
+  mtu_ss << conf_.mtu_;
+  StringVector args = boost::assign::list_of(actual_name_)(conf_.addr_.toString())("netmask")(conf_.netmask_.toString())("mtu")(mtu_ss.str());
 
   if(conf_.type_ == TYPE_TUN)
-    command << " up";
+    args.push_back("up");
   else {
 #if defined(__GNUC__) && defined(__OpenBSD__)
-    command << " link0";
+    args.push_back("link0");
 #elif defined(__GNUC__) && defined(__FreeBSD__)
-    command << " up";
+    args.push_back("up");
 #elif defined(__GNUC__) && defined(__NetBSD__)
-    command << "";
+        // nothing to be done here
 #else
  #error This Device works just for OpenBSD, FreeBSD or NetBSD
 #endif
   }
 
-  int result = system(command.str().c_str());
-  if(result == -1)
-    cLog.msg(Log::PRIO_ERROR) << "Execution of ifconfig failed" << AnytunErrno(errno);
-  else {
-    if(WIFEXITED(result))
-      cLog.msg(Log::PRIO_NOTICE) << "ifconfig returned " << WEXITSTATUS(result);  
-    else if(WIFSIGNALED(result))
-      cLog.msg(Log::PRIO_NOTICE) << "ifconfig terminated after signal " << WTERMSIG(result);
-    else
-      cLog.msg(Log::PRIO_ERROR) << "Execution of ifconfig: unkown error";
-  }
-
+  anytun_exec("/sbin/ifconfig", args);
 }
index 2597845..574c034 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
index db19947..bbece3d 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -29,8 +30,8 @@
  *  along with anytun.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef _BUFFER_H_
-#define _BUFFER_H_
+#ifndef ANYTUN_buffer_h_INCLUDED
+#define ANYTUN_buffer_h_INCLUDED
 
 #include "datatypes.h"
 #include <string>
index ddde683..5613739 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
index 3d922c0..92c4ef2 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -28,9 +29,8 @@
  *  You should have received a copy of the GNU General Public License
  *  along with anytun.  If not, see <http://www.gnu.org/licenses/>.
  */
-
-#ifndef _CIPHER_H_
-#define _CIPHER_H_
+#ifndef ANYTUN_cipher_h_INCLUDED
+#define ANYTUN_cipher_h_INCLUDED
 
 #include "datatypes.h"
 #include "buffer.h"
index e9f0292..96879b7 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
index 23d3b92..96a8d33 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -28,9 +29,8 @@
  *  You should have received a copy of the GNU General Public License
  *  along with anytun.  If not, see <http://www.gnu.org/licenses/>.
  */
-
-#ifndef _CIPHER_FACTORY_H_
-#define _CIPHER_FACTORY_H_
+#ifndef ANYTUN_cipherFactory_h_INCLUDED
+#define ANYTUN_cipherFactory_h_INCLUDED
 
 #include <string>
 
index 770318b..5381010 100755 (executable)
 #  tunneling and relaying of packets of any protocol.
 #
 #
-#  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+#  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
 #                          Christian Pointner <satp@wirdorange.org>
 #
 #  This file is part of Anytun.
 #
 #  Anytun is free software: you can redistribute it and/or modify
-#  it under the terms of the GNU General Public License version 3 as
-#  published by the Free Software Foundation.
+#  it under the terms of the GNU General Public License as published by
+#  the Free Software Foundation, either version 3 of the License, or
+#  any later version.
 #
 #  Anytun is distributed in the hope that it will be useful,
 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
 TARGET=`uname -s`
 
+EBUILD_COMPAT=0
+
 CXXFLAGS='-g -Wall -O2 -DLOG_SYSLOG -DLOG_FILE -DLOG_STDOUT'
-LDFLAGS='-g -Wall -O2 -lboost_thread -lboost_serialization -lboost_system'
+LDFLAGS='-g -Wall -O2 -lboost_thread -lboost_serialization -lboost_system -lboost_date_time'
 
 CRYPTO_LIB='gcrypt'
 PASSPHRASE=1
 ROUTING=1
 
+PREFIX='/usr/local'
+BINDIR=''
+SBINDIR=''
+ETCDIR=''
+MANDIR=''
+INSTALLMANPAGE=1
+EXAMPLESDIR=''
+INSTALLEXAMPLES=1
+
 print_usage() {
   echo "configure --help                    print this"
+  echo "          --target=<TARGET>         build target i.e. Linux (default: autodetect)"
+  echo "          --prefix=<PREFIX>         the installation prefix (default: /usr/local)"
+  echo "          --bindir=<DIR>            the path to the bin directory (default: $PREFIX/bin)"
+  echo "          --sbindir=<DIR>           the path to the sbin directory (default: $PREFIX/sbin)"
+  echo "          --sysconfdir=<DIR>        the path to the system configuration directory (default: $PREFIX/etc"
+  echo "          --mandir=<DIR>            the path to the system man pages (default: $PREFIX/share/man)"
+  echo "          --no-manpage              dont't install manpages"
+  echo "          --examplesdir=<DIR>       the path to the examples files (default: $PREFIX/share/examples)"
+  echo "          --no-examples             dont't install example files"
   echo "          --use-ssl-crypto          use ssl crypto library instead of libgcrypt"
-  echo "          --disable-crypto          disable crypto at all (only NULL cipher)"
+  echo "          --no-crypto               disable crypto at all (only NULL cipher)"
   echo "          --disable-passphrase      disable master key and salt passphrase"
+  echo "          --enable-passphrase       enable master key and salt passphrase"
   echo "          --disable-routing         disable built-in routing capability"
+  echo "          --enable-routing          enable built-in routing capability"
 }
 
 for arg
 do
   case $arg in
+  --target=*)
+    TARGET=${arg#--target=}
+  ;;
+  --prefix=*)
+    PREFIX=${arg#--prefix=}
+  ;;
+  --bindir=*)
+    SBINDIR=${arg#--bindir=}
+  ;;
+  --sbindir=*)
+    SBINDIR=${arg#--sbindir=}
+  ;;
+  --sysconfdir=*)
+    ETCDIR=${arg#--sysconfdir=}
+  ;;
+  --mandir=*)
+    MANDIR=${arg#--mandir=}
+  ;;
+  --no-manpage)
+    INSTALLMANPAGE=0
+  ;;
+  --examplesdir=*)
+    EXAMPLESDIR=${arg#--examplesdir=}
+  ;;
+  --no-examples)
+    INSTALLEXAMPLES=0
+  ;;
   --use-ssl-crypto)
     CRYPTO_LIB='ssl'
   ;;
-  --disable-crypto)
+  --no-crypto)
     CRYPTO_LIB='none'
   ;; 
+  --enable-passphrase)
+    PASSPHRASE=1
+  ;;
   --disable-passphrase)
     PASSPHRASE=0
   ;;
+  --enable-routing)
+    ROUTING=1
+  ;;
   --disable-routing)
     ROUTING=0
   ;;
+  --ebuild-compat)
+    EBUILD_COMPAT=1
+  ;;
   --help)
     print_usage
     exit 0
   ;;
   *)
-    echo "Unknown argument: $arg"
-    print_usage
-    exit 1
+    ERRORS="$ERRORS $arg"
   ;;
   esac
 done
 
+if [ -n "$ERRORS" ] && [ $EBUILD_COMPAT -ne 1 ]; then
+  for error in $ERRORS; do
+    echo "Unknown argument: $error"
+  done
+
+  print_usage
+  exit 1
+fi
+
+
 rm -f include.mk
 case $TARGET in 
        Linux)
@@ -121,6 +188,26 @@ if [ $ROUTING -eq 0 ]; then
   echo "disabling built-in routing capability"
 fi
 
+if [ -z "$BINDIR" ]; then
+  BINDIR=$PREFIX/bin
+fi
+
+if [ -z "$SBINDIR" ]; then
+  SBINDIR=$PREFIX/sbin
+fi
+
+if [ -z "$ETCDIR" ]; then
+  ETCDIR=$PREFIX/etc
+fi
+
+if [ -z "$MANDIR" ]; then
+  MANDIR=$PREFIX/share/man
+fi
+
+if [ -z "$EXAMPLESDIR" ]; then
+  EXAMPLESDIR=$PREFIX/share/examples
+fi
+
 cat >> include.mk <<EOF
 # this file was created automatically
 # do not edit this file directly 
@@ -131,6 +218,27 @@ CXX = gcc
 CXXFLAGS = $CXXFLAGS
 LD = gcc
 LDFLAGS = $LDFLAGS
+STRIP = strip
+INSTALL = install
+
+PREFIX := $PREFIX
+BINDIR := $BINDIR
+SBINDIR := $SBINDIR
+ETCDIR := $ETCDIR
 EOF
 
+if [ $INSTALLMANPAGE -eq 1 ]; then
+  echo "MANDIR := $MANDIR" >> include.mk
+  echo "installing manpage"
+else
+  echo "not installing manpage"
+fi
+
+if [ $INSTALLEXAMPLES -eq 1 ]; then
+  echo "EXAMPLESDIR := $EXAMPLESDIR" >> include.mk
+  echo "installing example files"
+else
+  echo "not installing example files"
+fi
+
 exit 0
index 6402711..9ddb277 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
index cdf5268..29eb94f 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -29,8 +30,8 @@
  *  along with anytun.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef _CONNECTION_LIST_H
-#define _CONNECTION_LIST_H
+#ifndef ANYTUN_connectionList_h_INCLUDED
+#define ANYTUN_connectionList_h_INCLUDED
 
 #include <map>
 #include <deque>
index c6b3ded..fc1e33a 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
index f929211..ed24531 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -28,9 +29,8 @@
  *  You should have received a copy of the GNU General Public License
  *  along with anytun.  If not, see <http://www.gnu.org/licenses/>.
  */
-
-#ifndef _CONNECTIONPARAM_H_
-#define _CONNECTIONPARAM_H_
+#ifndef ANYTUN_connectionParam_h_INCLUDED
+#define ANYTUN_connectionParam_h_INCLUDED
 
 #include "keyDerivation.h"
 #include "seqWindow.h"
index 4460de0..c171c15 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -29,8 +30,8 @@
  *  along with anytun.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef _CRYPTINIT_HPP
-#define _CRYPTINIT_HPP
+#ifndef ANYTUN_cryptinit_hpp_INCLUDED
+#define ANYTUN_cryptinit_hpp_INCLUDED
 
 #ifndef NO_CRYPT
 #ifndef USE_SSL_CRYPTO
@@ -110,4 +111,3 @@ bool initLibGCrypt()
 #endif
 
 #endif
-
index b62da17..04834ca 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -29,8 +30,8 @@
  *  along with anytun.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef _DAEMON_HPP
-#define _DAEMON_HPP
+#ifndef ANYTUN_daemon_hpp_INCLUDED
+#define ANYTUN_daemon_hpp_INCLUDED
 #ifndef NO_DAEMON
 
 #include <poll.h>
@@ -97,7 +98,7 @@ private:
 void do_chroot(std::string const& chrootdir)
 {
   if (getuid() != 0)
-    AnytunError::throwErr() << "this programm has to be run as root in order to run in a chroot";
+    AnytunError::throwErr() << "this program has to be run as root in order to run in a chroot";
 
   if(chroot(chrootdir.c_str()))
     AnytunError::throwErr() << "can't chroot to " << chrootdir;
@@ -162,4 +163,3 @@ void daemonize()
 }
 #endif
 #endif
-
index 141aae3..4e5977d 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -29,8 +30,8 @@
  *  along with anytun.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef _DATATYPES_H_
-#define _DATATYPES_H_
+#ifndef ANYTUN_datatypes_h_INCLUDED
+#define ANYTUN_datatypes_h_INCLUDED
 
 #include <boost/cstdint.hpp>
 #include <boost/integer_traits.hpp>
index d8702b9..6353cd1 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -29,8 +30,8 @@
  *  along with anytun.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef _DEVICE_CONFIG_HPP_
-#define _DEVICE_CONFIG_HPP_
+#ifndef ANYTUN_deviceConfig_hpp_INCLUDED
+#define ANYTUN_deviceConfig_hpp_INCLUDED
 
 #include "networkAddress.h"
 #include <boost/asio.hpp>
index a5aec86..46235c5 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
index 618fa44..bd321b3 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -29,8 +30,8 @@
  *  along with anytun.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef _ENCRYPTED_PACKET_H_
-#define _ENCRYPTED_PACKET_H_
+#ifndef ANYTUN_encryptedPacket_h_INCLUDED
+#define ANYTUN_encryptedPacket_h_INCLUDED
 
 #include "datatypes.h"
 #include "buffer.h"
index 9d96126..75646e7 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -29,8 +30,8 @@
  *  along with anytun.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef _ENDIAN_H_
-#define _ENDIAN_H_
+#ifndef ANYTUN_endian_h_INCLUDED
+#define ANYTUN_endian_h_INCLUDED
 
 #ifndef _WIN32
 #include <arpa/inet.h>
index cdf6368..6b102b9 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -41,6 +42,7 @@
 #include <iostream>
 #include <sstream>
 #include <string>
+#include <cstring>
 
 #ifndef NO_CRYPT
 #ifndef NO_PASSPHRASE
@@ -85,7 +87,7 @@ void KeyDerivation::calcMasterKey(std::string passphrase, u_int16_t length)
 #endif
   master_key_.setLength(length);
 
-  memcpy(master_key_.getBuf(), &digest.getBuf()[digest.getLength() - master_key_.getLength()], master_key_.getLength());
+  std::memcpy(master_key_.getBuf(), &digest.getBuf()[digest.getLength() - master_key_.getLength()], master_key_.getLength());
 }
 
 void KeyDerivation::calcMasterSalt(std::string passphrase, u_int16_t length)
@@ -114,7 +116,7 @@ void KeyDerivation::calcMasterSalt(std::string passphrase, u_int16_t length)
 #endif
   master_salt_.setLength(length);
 
-  memcpy(master_salt_.getBuf(), &digest.getBuf()[digest.getLength() - master_salt_.getLength()], master_salt_.getLength());
+  std::memcpy(master_salt_.getBuf(), &digest.getBuf()[digest.getLength() - master_salt_.getLength()], master_salt_.getLength());
 }
 #endif
 #endif
@@ -287,7 +289,7 @@ bool AesIcmKeyDerivation::calcCtr(kd_dir_t dir, satp_prf_label_t label, seq_nr_t
     cLog.msg(Log::PRIO_ERROR) << "KeyDerivation::calcCtr: salt lengths don't match";
     return false;
   }
-  memcpy(ctr_[dir].salt_.buf_, master_salt_.getBuf(), SALT_LENGTH);
+  std::memcpy(ctr_[dir].salt_.buf_, master_salt_.getBuf(), SALT_LENGTH);
   ctr_[dir].salt_.zero_ = 0;
   ctr_[dir].params_.label_ ^= SATP_PRF_LABEL_T_HTON(convertLabel(dir, label));
   ctr_[dir].params_.seq_ ^= SEQ_NR_T_HTON(seq_nr);
index 12d370c..eea4266 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -29,8 +30,8 @@
  *  along with anytun.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef _KEYDERIVATION_H_
-#define _KEYDERIVATION_H_
+#ifndef ANYTUN_keyDerivation_h_INCLUDED
+#define ANYTUN_keyDerivation_h_INCLUDED
 
 #include "datatypes.h"
 #include "buffer.h"
@@ -47,6 +48,7 @@
 #endif
 #include <boost/archive/text_oarchive.hpp>
 #include <boost/archive/text_iarchive.hpp>
+#include <boost/version.hpp>
 
 #define LABEL_ENC 0
 #define LABEL_AUTH 1
@@ -200,4 +202,3 @@ private:
 #endif
 
 #endif
-
index 75df38a..d325c35 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
index 77caf58..caafe7e 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -29,8 +30,8 @@
  *  along with anytun.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef _KEYDERIVATION_FACTORY_H_
-#define _KEYDERIVATION_FACTORY_H_
+#ifndef ANYTUN_keyDerivationFactory_h_INCLUDED
+#define ANYTUN_keyDerivationFactory_h_INCLUDED
 
 #include <string>
 
index b34ae9d..57b1c7c 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -31,6 +32,7 @@
 
 #include <string.h>
 #include <sstream>
+#include <boost/assign.hpp>
 
 #include <fcntl.h>
 #include <sys/ioctl.h>
@@ -46,6 +48,7 @@
 #include "threadUtils.hpp"
 #include "log.h"
 #include "anytunError.h"
+#include "sysExec.h"
 
 TunDevice::TunDevice(std::string dev_name, std::string dev_type, std::string ifcfg_addr, u_int16_t ifcfg_prefix) : conf_(dev_name, dev_type, ifcfg_addr, ifcfg_prefix, 1400)
 {
@@ -155,19 +158,8 @@ void TunDevice::init_post()
 
 void TunDevice::do_ifconfig()
 {
-  std::ostringstream command;
-  command << "/sbin/ifconfig " << actual_name_ << " " << conf_.addr_.toString()
-          << " netmask " << conf_.netmask_.toString() << " mtu " << conf_.mtu_;
-
-  int result = system(command.str().c_str());
-  if(result == -1)
-    cLog.msg(Log::PRIO_ERROR) << "Execution of ifconfig failed: " << AnytunErrno(errno);
-  else {
-    if(WIFEXITED(result))
-      cLog.msg(Log::PRIO_NOTICE) << "ifconfig returned " << WEXITSTATUS(result);  
-    else if(WIFSIGNALED(result))
-      cLog.msg(Log::PRIO_NOTICE) << "ifconfig terminated after signal " << WTERMSIG(result);
-    else
-      cLog.msg(Log::PRIO_ERROR) << "Execution of ifconfig: unkown error";
-  }
+  std::ostringstream mtu_ss;
+  mtu_ss << conf_.mtu_;
+  StringVector args = boost::assign::list_of(actual_name_)(conf_.addr_.toString())("netmask")(conf_.netmask_.toString())("mtu")(mtu_ss.str());
+  anytun_exec("/sbin/ifconfig", args);
 }
index d0ed7f8..d1049b2 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
index dcdedc4..8ff24e3 100644 (file)
--- a/src/log.h
+++ b/src/log.h
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -29,8 +30,8 @@
  *  along with anytun.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef _LOG_H_
-#define _LOG_H_
+#ifndef ANYTUN_log_h_INCLUDED
+#define ANYTUN_log_h_INCLUDED
 
 #include <string>
 #include <sstream>
index 9a07309..5b19954 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -44,6 +45,8 @@
 #include <strsafe.h>
 #endif
 
+#include <boost/date_time/posix_time/posix_time.hpp>
+
 LogTarget::LogTarget() : opened(false), enabled(false), max_prio(Log::PRIO_NOTICE)
 {
 }
@@ -326,7 +329,8 @@ void LogTargetFile::log(std::string msg, int prio)
   if(!opened)
     return;
 
-  logfile << Log::prioToString(prio) << ": " << msg << std::endl;
+  std::string timestamp = boost::posix_time::to_simple_string(boost::posix_time::second_clock::local_time());
+  logfile << timestamp << " " << Log::prioToString(prio) << ": " << msg << std::endl;
 }
 
 LogTargetFile& LogTargetFile::setLogFilename(std::string l)
@@ -366,7 +370,8 @@ void LogTargetStdout::log(std::string msg, int prio)
   if(!opened)
     return;
 
-  stream << "LOG-" << Log::prioToString(prio) << ": " << msg << std::endl;
+  std::string timestamp = boost::posix_time::to_simple_string(boost::posix_time::second_clock::local_time());
+  stream << timestamp << " " << Log::prioToString(prio) << ": " << msg << std::endl;
 }
 #endif
 
index 64ad945..63156c1 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -29,8 +30,8 @@
  *  along with anytun.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef _LOG_TARGETS_H_
-#define _LOG_TARGETS_H_
+#ifndef ANYTUN_logTargets_h_INCLUDED
+#define ANYTUN_logTargets_h_INCLUDED
 
 #include <string>
 #include <map>
index cdd45a6..adc9919 100644 (file)
 ##  tunneling and relaying of packets of any protocol.
 ##
 ##
-##  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+##  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
 ##                          Christian Pointner <satp@wirdorange.org>
 ##
 ##  This file is part of Anytun.
 ##
 ##  Anytun is free software: you can redistribute it and/or modify
-##  it under the terms of the GNU General Public License version 3 as
-##  published by the Free Software Foundation.
+##  it under the terms of the GNU General Public License as published by
+##  the Free Software Foundation, either version 3 of the License, or
+##  any later version.
 ##
 ##  Anytun is distributed in the hope that it will be useful,
 ##  but WITHOUT ANY WARRANTY; without even the implied warranty of
 ##  along with anytun.  If not, see <http://www.gnu.org/licenses/>.
 ##
 
-all: manpage
-
-anytun.8: anytun.8.txt
-       a2x -f manpage anytun.8.txt
+VERSION=$(shell cat ../../version)
 
-anytun-controld.8: anytun-controld.8.txt
-       a2x -f manpage anytun-controld.8.txt
+MANPAGES := anytun.8 anytun-controld.8 anytun-config.8 anytun-showtables.8 #anyrtpproxy.8
+XML := $(MANPAGES:%.8=%.8.xml) 
 
-anytun-config.8: anytun-config.8.txt
-       a2x -f manpage anytun-config.8.txt
+.PHONY: clean
 
-anytun-showtables.8: anytun-showtables.8.txt
-       a2x -f manpage anytun-showtables.8.txt
+all: manpage
 
-anyrtpproxy.8: anyrtpproxy.8.txt
-       a2x -f manpage anyrtpproxy.8.txt
+define create-manpage
+       a2x -f manpage $(1)
+       @ sed -i -e 's/\[FIXME: source\]/anytun ${VERSION}/' $(2)
+       @ sed -i -e 's/\[FIXME: manual\]/$(2:.8=) user manual/' $(2)
+       @ sed -i -e 's/^\($(subst -,\\-,$(2:.8=))\)$$/\\fB\1\\fR/' $(2)
+       @ sed -i -e 's/^  \[ \([^ ]*\)/  [ \\fB\1\\fR/' $(2)
+endef
 
+%.8: %.8.txt
+       $(call create-manpage,$<,$@)
 
-manpage: anytun.8 anytun-controld.8 anytun-config.8 anytun-showtables.8 anyrtpproxy.8
+manpage: $(MANPAGES)
 
 clean:
-       rm -f anytun.8 anytun.8.xml
-       rm -f anytun-controld.8 anytun-controld.8.xml
-       rm -f anytun-config.8 anytun-config.8.xml
-       rm -f anytun-showtables.8 anytun-showtables.8.xml
-       rm -f anyrtpproxy.8 anyrtpproxy.8.xml
\ No newline at end of file
+       rm -f $(MANPAGES)
+       rm -f $(XML)
index a867631..a92d2e6 100644 (file)
@@ -8,20 +8,22 @@ anyrtpproxy - anycast rtpproxy
 SYNOPSIS
 --------
 
-*anyrtpproxy*
-[ *-h|--help* ]
-[ *-D|--nodaemonize* ]
-[ *-C|--chroot* ]
-[ *-u|--username* <username> ]
-[ *-H|--chroot-dir* <directory> ]
-[ *-P|--write-pid* <filename> ]
-[ *-i|--interface* <ip-address> ]
-[ *-s|--control* <hostname|ip>[:<port>] ]
-[ *-p|--port-range* <start> <end> ]
-[ *-n|--nat* ]
-[ *-o|--no-nat-once* ]
-[ *-S|--sync-port* port> ]
-[ *-M|--sync-hosts* <hostname|ip>:<port>[,<hostname|ip>:<port>[...]] ]
+....
+anyrtpproxy
+  [ -h|--help ]
+  [ -D|--nodaemonize ]
+  [ -C|--chroot ]
+  [ -u|--username <username> ]
+  [ -H|--chroot-dir <directory> ]
+  [ -P|--write-pid <filename> ]
+  [ -i|--interface <ip-address> ]
+  [ -s|--control <hostname|ip>[:<port>] ]
+  [ -p|--port-range <start> <end> ]
+  [ -n|--nat ]
+  [ -o|--no-nat-once ]
+  [ -S|--sync-port port> ]
+  [ -M|--sync-hosts <hostname|ip>:<port>[,<hostname|ip>:<port>[...]] ]
+....
 
 
 DESCRIPTION
@@ -29,89 +31,62 @@ DESCRIPTION
 
 *anyrtpproxy* is a rtpproxy which can be used in combination with anycast. It uses
 the same control protocol than rtpproxy though it can be controled through the nathelper
-plugin of openser. *anyrtpproxy* uses the same synchronisation protocol than *anytun* 
+plugin of openser. *anyrtpproxy* uses the same synchronisation protocol than *Anytun* 
 to sync the session information among all anycast instances.
 
 
 OPTIONS
 -------
 
--D|--nodaemonize
-~~~~~~~~~~~~~~~~
+*-D, --nodaemonize*::
+   This option instructs *anyrtpproxy* to run in the foreground
+   instead of becoming a daemon.
 
-This option instructs *anyrtpproxy* to run in the foreground
-instead of becoming a daemon.
+*-C, --chroot*::
+   chroot and drop privileges
 
--C|--chroot
-~~~~~~~~~~~
+*-u, --username <username>*::
+   if chroot change to this user
 
-chroot and drop privileges
+*-H, --chroot-dir <directory>*::
+   chroot to this directory
 
--u|--username <username>
-~~~~~~~~~~~~~~~~~~~~~~~~
+*-P, --write-pid <filename>*::
+   write pid to this file
 
-if chroot change to this user
+*-i, --interface <ip address>*::
+  The local interface to listen on for RTP packets
 
--H|--chroot-dir <directory>
-~~~~~~~~~~~~~~~~~~~~~~~~~~~
+*-s, --control <hostname|ip>[:<port>]*::
+   The local address and port to listen on for control messages from openser
 
-chroot to this directory
+*-p, --port-range <start> <end>*::
+   A pool of ports which should be used by *anyrtpproxy* to relay RTP packets. 
+   The range may not overlap between the anycast instances
 
--P|--write-pid <filename>
-~~~~~~~~~~~~~~~~~~~~~~~~~
+*-n, --nat*::
+   Allow to learn the remote address and port in order to handle clients behind nat.
+   This option should only be enabled if the source is authenticated (i.e. through 
+   *anytun*) 
 
-write pid to this file
+*-o, --no-nat-once*::
+   Disable learning of remote address and port in case the first packet does not 
+   come from the client which is specified by openser during configuration. Invoking
+   this parameter increases the security level of the system but in case of nat needs
+   a working nat transversal such as stun.
 
--i|--interface <ip address>
-~~~~~~~~~~~~~~~~~~~~~~~~~~~
+*-S, --sync-port <port>*::
+   local unicast(sync) port to bind to +
+   This port is used by anycast hosts to synchronize information about tunnel
+   endpoints. No payload data is transmitted via this port. +
+   It is possible to obtain a list of active connections by telnetting into 
+   this port. This port is read-only and unprotected by default. It is advised 
+   to protect this port using firewall rules and, eventually, IPsec.
 
-The local interface to listen on for RTP packets
-
--s|--control <hostname|ip>[:<port>]
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-The local address and port to listen on for control messages from openser
-
--p|--port-range <start> <end>
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-A pool of ports which should be used by *anyrtpproxy* to relay RTP packets. 
-The range may not overlap between the anycast instances
-
--n|--nat
-~~~~~~~~
-
-Allow to learn the remote address and port in order to handle clients behind nat.
-This option should only be enabled if the source is authenticated (i.e. through 
-*anytun*) 
-
--o|--no-nat-once
-~~~~~~~~~~~~~~~~
-
-Disable learning of remote address and port in case the first packet does not 
-come from the client which is specified by openser during configuration. Invoking
-this parameter increases the security level of the system but in case of nat needs
-a working nat transversal such as stun.
-
--S|--sync-port <port>
-~~~~~~~~~~~~~~~~~~~~~
-
-local unicast(sync) port to bind to
-
-This port is used by anycast hosts to synchronize information about tunnel
-endpoints. No payload data is transmitted via this port.
-
-It is possible to obtain a list of active connections by telnetting into 
-this port. This port is read-only and unprotected by default. It is advised 
-to protect this port using firewall rules and, eventually, IPsec.
-
--M|--sync-hosts <hostname|ip>:<port>,[<hostname|ip>:<port>[...]]
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-remote hosts to sync with
-
-Here, one has to specify all unicast IP addresses of all 
-other anycast hosts that comprise the anycast tunnel endpoint.
+*-M, --sync-hosts <hostname|ip>:<port>,[<hostname|ip>:<port>[...]]*::
+   remote hosts to sync with +
+   Here, one has to specify all unicast IP addresses of all 
+   other anycast hosts that comprise the anycast tunnel endpoint.
 
 EXAMPLES
 --------
@@ -141,8 +116,6 @@ hostname anycast.anytun.org:
 --------------------------------------------------------------------------------------
 
 
-
-
 BUGS
 ----
 Most likely there are some bugs in *anyrtpproxy*. If you find a bug, please let
@@ -154,19 +127,11 @@ anytun(8)
 
 AUTHORS
 -------
-Design of SATP and wizards of this implementation:
 
 Othmar Gsenger <otti@anytun.org>
 Erwin Nindl <nine@anytun.org>
 Christian Pointner <equinox@anytun.org>
 
-Debian packaging:
-
-Andreas Hirczy <ahi@itp.tu-graz.ac.at>
-
-Manual page:
-
-Alexander List <alex@debian.org>
 
 RESOURCES
 ---------
@@ -177,8 +142,9 @@ Main web site: http://www.anytun.org/
 COPYING
 -------
 
-Copyright \(C) 2007-2008 Othmar Gsenger, Erwin Nindl and Christian
-Pointner. This  program  is  free software;  you  can redistribute
-it and/or modify it under the terms of the GNU General Public License
-version 2 as published by the Free Software Foundation.
+Copyright \(C) 2007-2009 Othmar Gsenger, Erwin Nindl and Christian
+Pointner. 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 the Free Software Foundation, either version 3 of 
+the License, or any later version.
 
index 8eb2839..6a80b4d 100644 (file)
@@ -8,21 +8,23 @@ anytun-config - anycast tunneling configuration utility
 SYNOPSIS
 --------
 
-*anytun-config*
-[ *-h|--help* ]
-[ *-L|--log* <target>:<level>[,<param1>[,<param2>[..]]]
-[ *-r|--remote-host* <hostname|ip> ]
-[ *-o|--remote-port* <port> ]
-[ *-4|--ipv4-only* ]
-[ *-6|--ipv6-only* ]
-[ *-R|--route* <net>/<prefix length> ]
-[ *-m|--mux* <mux-id> ]
-[ *-w|--window-size* <window size> ]
-[ *-k|--kd-prf* <kd-prf type> ]
-[ *-e|--role <role>* ]
-[ *-E|--passphrase* <pass phrase> ]
-[ *-K|--key* <master key> ]
-[ *-A|--salt* <master salt> ]
+....
+anytun-config
+  [ -h|--help ]
+  [ -L|--log <target>:<level>[,<param1>[,<param2>[..]]]
+  [ -r|--remote-host <hostname|ip> ]
+  [ -o|--remote-port <port> ]
+  [ -4|--ipv4-only ]
+  [ -6|--ipv6-only ]
+  [ -R|--route <net>/<prefix length> ]
+  [ -m|--mux <mux-id> ]
+  [ -w|--window-size <window size> ]
+  [ -k|--kd-prf <kd-prf type> ]
+  [ -e|--role <role> ]
+  [ -E|--passphrase <pass phrase> ]
+  [ -K|--key <master key> ]
+  [ -A|--salt <master salt> ]
+....
 
 DESCRIPTION
 -----------
@@ -32,138 +34,100 @@ DESCRIPTION
 OPTIONS
 -------
 
--L|--log <target>:<level>[,<param1>[,<param2>[..]]]
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-add log target to logging system. This can be invoked several times
-in order to log to different targets at the same time. Every target 
-hast its own log level which is a number between 0 and 5. Where 0 means
-disabling log and 5 means debug messages are enabled.
-
-The following targets are supported:
-
-* *syslog* - log to syslog daemon, parameters <level>[,<logname>[,<facility>]]
-* *file* - log to file, parameters <level>[,<path>]
-* *stdout* - log to standard output, parameters <level>
-* *stderr* - log to standard error, parameters <level> 
-
-The file target can be used more the once with different levels.
-If no target is provided at the command line a single target with the 
-following config is added:
-
-*syslog:3,uanytun,daemon*
-
--r|--remote-host <hostname|ip>
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-remote host
-
-This option can be used to specify the remote tunnel
-endpoint. In case of anycast tunnel endpoints, the
-anycast IP address has to be used. If you do not specify
-an address, it is automatically determined after receiving
-the first data packet.
-
--o|--remote-port <port>
-~~~~~~~~~~~~~~~~~~~~~~~
-remote port
-
-The UDP port used for payload data by the remote host
-(specified with -p on the remote host). If you do not specify
-a port, it is automatically determined after receiving
-the first data packet.
-
--4|--ipv4-only
-~~~~~~~~~~~~~~
-
-Resolv to IPv4 addresses only. The default is to resolv both
-IPv4 and IPv6 addresses.
-
--6|--ipv6-only
-~~~~~~~~~~~~~~
-
-Resolv to IPv6 addresses only. The default is to resolv both
-IPv4 and IPv6 addresses.
-
--R|--route <net>/<prefix length>
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-add a route to connection. This can be invoked several times.
-
--m|--mux <mux-id>
-~~~~~~~~~~~~~~~~~
-
-the multiplex id to use. default: 0
-
--w|--window-size <window size>
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-seqence window size
-
-Sometimes, packets arrive out of order on the receiver
-side. This option defines the size of a list of received
-packets' sequence numbers. If, according to this list,
-a received packet has been previously received or has
-been transmitted in the past, and is therefore not in
-the list anymore, this is interpreted as a replay attack
-and the packet is dropped. A value of 0 deactivates this
-list and, as a consequence, the replay protection employed
-by filtering packets according to their secuence number.
-By default the sequence window is disabled and therefore a
-window size of 0 is used.
-
--k|--kd--prf <kd-prf type>
-~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-key derivation pseudo random function.
-
-The pseudo random function which is used for calculating the 
-session keys and session salt.
-
-Possible values:
-
-* *null* - no random function, keys and salt are set to 0..00
-* *aes-ctr* - AES in counter mode with 128 Bits, default value
-* *aes-ctr-128* - AES in counter mode with 128 Bits
-* *aes-ctr-192* - AES in counter mode with 192 Bits
-* *aes-ctr-256* - AES in counter mode with 256 Bits
-
--e|--role <role>
-~~~~~~~~~~~~~~~~
-
-SATP uses different session keys for inbound and outbound traffic. The
-role parameter is used to determine which keys to use for outbound or
-inbound packets. On both sides of a vpn connection different roles have 
-to be used. Possible values are *left* and *right*. You may also use 
-*alice* or *server* as a replacement for *left* and *bob* or *client* as 
-a replacement for *right*. By default *left* is used.
-
--E|--passphrase <pass phrase>
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-This passphrase is used to generate the master key and master salt.
-For the master key the last n bits of the SHA256 digest of the 
-passphrase (where n is the length of the master key in bits) is used. 
-The master salt gets generated with the SHA1 digest. 
-You may force a specific key and or salt by using *--key* and *--salt*.
-
--K|--key <master key>
-~~~~~~~~~~~~~~~~~~~~~
-
-master key to use for key derivation
-
-Master key in hexadecimal notation, eg
-01a2b3c4d5e6f708a9b0cadbecfd0fa1, with a mandatory length
-of 32, 48 or 64 characters (128, 192 or 256 bits).
-
--A|--salt <master salt>
-~~~~~~~~~~~~~~~~~~~~~~~
-
-master salt to use for key derivation
-
-Master salt in hexadecimal notation, eg
-01a2b3c4d5e6f708a9b0cadbecfd, with a mandatory length
-of 28 characters (14 bytes).
+*-L, --log <target>:<level>[,<param1>[,<param2>[..]]]*::
+   add log target to logging system. This can be invoked several times
+   in order to log to different targets at the same time. Every target 
+   hast its own log level which is a number between 0 and 5. Where 0 means
+   disabling log and 5 means debug messages are enabled. +
+   The file target can be used more the once with different levels.
+   If no target is provided at the command line a single target with the 
+   config *syslog:3,anytun-config,daemon* is added. +
+   The following targets are supported:
+
+   *syslog*;; log to syslog daemon, parameters <level>[,<logname>[,<facility>]]
+   *file*;; log to file, parameters <level>[,<path>]
+   *stdout*;; log to standard output, parameters <level>
+   *stderr*;; log to standard error, parameters <level> 
+
+*-r, --remote-host <hostname|ip>*::
+   This option can be used to specify the remote tunnel
+   endpoint. In case of anycast tunnel endpoints, the
+   anycast IP address has to be used. If you do not specify
+   an address, it is automatically determined after receiving
+   the first data packet.
+
+*-o, --remote-port <port>*::
+   The UDP port used for payload data by the remote host
+   (specified with -p on the remote host). If you do not specify
+   a port, it is automatically determined after receiving
+   the first data packet.
+
+*-4, --ipv4-only*::
+   Resolv to IPv4 addresses only. The default is to resolv both
+   IPv4 and IPv6 addresses.
+
+*-6, --ipv6-only*::
+   Resolv to IPv6 addresses only. The default is to resolv both
+   IPv4 and IPv6 addresses.
+
+*-R, --route <net>/<prefix length>*::
+   add a route to connection. This can be invoked several times.
+
+*-m, --mux <mux-id>*::
+   the multiplex id to use. default: 0
+
+*-w, --window-size <window size>*::
+   seqence window size +
+   Sometimes, packets arrive out of order on the receiver
+   side. This option defines the size of a list of received
+   packets' sequence numbers. If, according to this list,
+   a received packet has been previously received or has
+   been transmitted in the past, and is therefore not in
+   the list anymore, this is interpreted as a replay attack
+   and the packet is dropped. A value of 0 deactivates this
+   list and, as a consequence, the replay protection employed
+   by filtering packets according to their secuence number.
+   By default the sequence window is disabled and therefore a
+   window size of 0 is used.
+
+*-k, --kd--prf <kd-prf type>*::
+   key derivation pseudo random function +
+   The pseudo random function which is used for calculating the 
+   session keys and session salt. +
+   Possible values:
+
+   *null*;; no random function, keys and salt are set to 0..00
+   *aes-ctr*;; AES in counter mode with 128 Bits, default value
+   *aes-ctr-128*;; AES in counter mode with 128 Bits
+   *aes-ctr-192*;; AES in counter mode with 192 Bits
+   *aes-ctr-256*;; AES in counter mode with 256 Bits
+
+*-e, --role <role>*::
+   SATP uses different session keys for inbound and outbound traffic. The
+   role parameter is used to determine which keys to use for outbound or
+   inbound packets. On both sides of a vpn connection different roles have 
+   to be used. Possible values are *left* and *right*. You may also use 
+   *alice* or *server* as a replacement for *left* and *bob* or *client* as 
+   a replacement for *right*. By default *left* is used.
+
+*-E, --passphrase <pass phrase>*::
+   This passphrase is used to generate the master key and master salt.
+   For the master key the last n bits of the SHA256 digest of the 
+   passphrase (where n is the length of the master key in bits) is used. 
+   The master salt gets generated with the SHA1 digest. 
+   You may force a specific key and or salt by using *--key* and *--salt*.
+
+*-K, --key <master key>*::
+   master key to use for key derivation +
+   Master key in hexadecimal notation, e.g.
+   01a2b3c4d5e6f708a9b0cadbecfd0fa1, with a mandatory length
+   of 32, 48 or 64 characters (128, 192 or 256 bits).
+
+*-A, --salt <master salt>*::
+   master salt to use for key derivation +
+   Master salt in hexadecimal notation, e.g.
+   01a2b3c4d5e6f708a9b0cadbecfd, with a mandatory length
+   of 28 characters (14 bytes).
 
 
 EXAMPLES
@@ -178,7 +142,7 @@ Add a client with Connection ID (Mux) 12 and add 2 Routes to this client
 
 BUGS
 ----
-Most likely there are some bugs in *anytun*. If you find a bug, please let
+Most likely there are some bugs in *Anytun*. If you find a bug, please let
 the developers know at satp@anytun.org. Of course, patches are preferred.
 
 SEE ALSO
@@ -187,19 +151,11 @@ anytun(8), anytun-controld(8), anytun-showtables(8)
 
 AUTHORS
 -------
-Design of SATP and wizards of this implementation:
 
 Othmar Gsenger <otti@anytun.org>
 Erwin Nindl <nine@anytun.org>
 Christian Pointner <equinox@anytun.org>
 
-Debian packaging:
-
-Andreas Hirczy <ahi@itp.tu-graz.ac.at>
-
-Manual page:
-
-Alexander List <alex@debian.org>
 
 RESOURCES
 ---------
@@ -210,8 +166,8 @@ Main web site: http://www.anytun.org/
 COPYING
 -------
 
-Copyright \(C) 2007-2008 Othmar Gsenger, Erwin Nindl and Christian
-Pointner. This  program  is  free software;  you  can redistribute
-it and/or modify it under the terms of the GNU General Public License
-version 2 as published by the Free Software Foundation.
-
+Copyright \(C) 2007-2009 Othmar Gsenger, Erwin Nindl and Christian
+Pointner. 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 the Free Software Foundation, either version 3 of 
+the License, or any later version.
index 2b1c7a1..0d3e0b8 100644 (file)
@@ -8,96 +8,77 @@ anytun-controld - anycast tunneling control daemon
 SYNOPSIS
 --------
 
-*anytun-controld*
-[ *-h|--help* ]
-[ *-D|--nodaemonize* ]
-[ *-u|--username* <username> ]
-[ *-g|--groupname* <groupname> ]
-[ *-C|--chroot* <path> ]
-[ *-P|--write-pid* <filename> ]
-[ *-L|--log* <target>:<level>[,<param1>[,<param2>[..]]] ]
-[ *-f|--file* <path> ]
-[ *-X|--control-host* < <host>[:port>] | :<port> > ]
+....
+anytun-controld
+  [ -h|--help ]
+  [ -D|--nodaemonize ]
+  [ -u|--username <username> ]
+  [ -g|--groupname <groupname> ]
+  [ -C|--chroot <path> ]
+  [ -P|--write-pid <filename> ]
+  [ -L|--log <target>:<level>[,<param1>[,<param2>[..]]] ]
+  [ -f|--file <path> ]
+  [ -X|--control-host < <host>[:port>] | :<port> > ]
+....
 
 DESCRIPTION
 -----------
 
-*anytun-controld* configures the multi-connection support for *anytun*. It reads a connection/routing table and outputs it via a tcp socket to all connected *anytun* servers. When the control daemon is restarted with a new connection/routing table all *anytun* servers automatically load the new configuration. Please make sure to protect that information as it contains the connection keys.
+*anytun-controld* configures the multi-connection support for *Anytun*. It reads a connection/routing table and outputs it via a tcp socket to all connected *Anytun* servers. When the control daemon is restarted with a new connection/routing table all *Anytun* servers automatically load the new configuration. Please make sure to protect that information as it contains the connection keys.
 
 OPTIONS
 -------
 
--D|--nodaemonize
-~~~~~~~~~~~~~~~~
-
-This option instructs *anytun* to run in foreground
-instead of becoming a daemon which is the default.
-
--u|--username <username>
-~~~~~~~~~~~~~~~~~~~~~~~~
-
-run as this user. If no group is specified (*-g*) the default group of 
-the user is used. The default is to not drop privileges.
-
--g|--groupname <groupname>
-~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-run as this group. If no username is specified (*-u*) this gets ignored.
-The default is to not drop privileges.
-
--C|--chroot <path>
-~~~~~~~~~~~~~~~~~~
-
-Instruct *anytun* to run in a chroot jail. The default is 
-to not run in chroot.
-
--P|--write-pid <filename>
-~~~~~~~~~~~~~~~~~~~~~~~~~
-
-Instruct *anytun* to write it's pid to this file. The default is 
-to not create a pid file.
-
--L|--log <target>:<level>[,<param1>[,<param2>[..]]]
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-add log target to logging system. This can be invoked several times
-in order to log to different targets at the same time. Every target 
-hast its own log level which is a number between 0 and 5. Where 0 means
-disabling log and 5 means debug messages are enabled.
-
-The following targets are supported:
-
-* *syslog* - log to syslog daemon, parameters <level>[,<logname>[,<facility>]]
-* *file* - log to file, parameters <level>[,<path>]
-* *stdout* - log to standard output, parameters <level>
-* *stderr* - log to standard error, parameters <level> 
-
-The file target can be used more the once with different levels.
-If no target is provided at the command line a single target with the 
-following config is added:
-
-*syslog:3,uanytun,daemon*
-
--f|--file <path>
-~~~~~~~~~~~~~~~~
-
-The path to the file which holds the sync information.
-
--X|--control-host < <host>[:<port>] | :<port> >
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-The local ip address and or tcp port to bind to. Mind that if an 
-address is given the port can be omitted in which case port 2323 
-is used. You can also specify to listen on an specific port but on
-all interfaces by omitting the address. If you want to specify an
-ipv6 address and a port you have to use [ and ] to seperate the address
-from the port, eg.: [::1]:1234. If you want to use the default port 
-[ and ] can be omitted. default: 127.0.0.1:2323
+*-D, --nodaemonize*::
+   This option instructs *anytun-controld* to run in foreground
+   instead of becoming a daemon which is the default.
+
+*-u, --username <username>*::
+   run as this user. If no group is specified (*-g*) the default group of 
+   the user is used. The default is to not drop privileges.
+
+*-g, --groupname <groupname>*::
+   run as this group. If no username is specified (*-u*) this gets ignored.
+   The default is to not drop privileges.
+
+*-C, --chroot <path>*::
+   Instruct *anytun-controld* to run in a chroot jail. The default is 
+   to not run in chroot.
+
+*-P, --write-pid <filename>*::
+   Instruct *anytun-controld* to write it's pid to this file. The default is 
+   to not create a pid file.
+
+*-L, --log <target>:<level>[,<param1>[,<param2>[..]]]*::
+   add log target to logging system. This can be invoked several times
+   in order to log to different targets at the same time. Every target 
+   hast its own log level which is a number between 0 and 5. Where 0 means
+   disabling log and 5 means debug messages are enabled. +
+   The file target can be used more the once with different levels.
+   If no target is provided at the command line a single target with the 
+   config *syslog:3,anytun-controld,daemon* is added. +
+   The following targets are supported:
+
+   *syslog*;; log to syslog daemon, parameters <level>[,<logname>[,<facility>]]
+   *file*;; log to file, parameters <level>[,<path>]
+   *stdout*;; log to standard output, parameters <level>
+   *stderr*;; log to standard error, parameters <level> 
+
+*-f, --file <path>*::
+   The path to the file which holds the sync information.
+
+*-X, --control-host <hostname|ip>[:<port>]*::
+   fetch the config from this host. The default is not to use a control
+   host and therefore this is empty. Mind that the port can be omitted 
+   in which case port 2323 is used. If you want to specify an
+   ipv6 address and a port you have to use [ and ] to seperate the address
+   from the port, eg.: [::1]:1234. If you want to use the default port 
+   [ and ] can be omitted.
 
 
 BUGS
 ----
-Most likely there are some bugs in *anytun*. If you find a bug, please let
+Most likely there are some bugs in *Anytun*. If you find a bug, please let
 the developers know at satp@anytun.org. Of course, patches are preferred.
 
 SEE ALSO
@@ -106,19 +87,11 @@ anytun(8), anytun-config(8), anytun-showtables(8)
 
 AUTHORS
 -------
-Design of SATP and wizards of this implementation:
 
 Othmar Gsenger <otti@anytun.org>
 Erwin Nindl <nine@anytun.org>
 Christian Pointner <equinox@anytun.org>
 
-Debian packaging:
-
-Andreas Hirczy <ahi@itp.tu-graz.ac.at>
-
-Manual page:
-
-Alexander List <alex@debian.org>
 
 RESOURCES
 ---------
@@ -129,8 +102,9 @@ Main web site: http://www.anytun.org/
 COPYING
 -------
 
-Copyright \(C) 2007-2008 Othmar Gsenger, Erwin Nindl and Christian
-Pointner. This  program  is  free software;  you  can redistribute
-it and/or modify it under the terms of the GNU General Public License
-version 2 as published by the Free Software Foundation.
+Copyright \(C) 2007-2009 Othmar Gsenger, Erwin Nindl and Christian
+Pointner. 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 the Free Software Foundation, either version 3 of 
+the License, or any later version.
 
index 9a04f26..3a1fa8d 100644 (file)
@@ -8,12 +8,14 @@ anytun-showtables - anycast tunneling routing table visualization utility
 SYNOPSIS
 --------
 
-*anytun-showtables*
+....
+anytun-showtables
+....
 
 DESCRIPTION
 -----------
 
-*anytun-showtables* displays routing and connection tables used by *anytun*. It can be used to display a saved routing/connection table used by *anytun-controld* or to connect to a the sync port of *anytun*.
+*anytun-showtables* displays routing and connection tables used by *Anytun*. It can be used to display a saved routing/connection table used by *anytun-controld* or to connect to a the sync port of *Anytun*.
 
 OPTIONS
 -------
@@ -38,7 +40,7 @@ Print current routing table and watch changes
 
 BUGS
 ----
-Most likely there are some bugs in *anytun*. If you find a bug, please let
+Most likely there are some bugs in *Anytun*. If you find a bug, please let
 the developers know at satp@anytun.org. Of course, patches are preferred.
 
 SEE ALSO
@@ -47,19 +49,11 @@ anytun(8), anytun-controld(8), anytun-config(8)
 
 AUTHORS
 -------
-Design of SATP and wizards of this implementation:
 
 Othmar Gsenger <otti@anytun.org>
 Erwin Nindl <nine@anytun.org>
 Christian Pointner <equinox@anytun.org>
 
-Debian packaging:
-
-Andreas Hirczy <ahi@itp.tu-graz.ac.at>
-
-Manual page:
-
-Alexander List <alex@debian.org>
 
 RESOURCES
 ---------
@@ -70,8 +64,8 @@ Main web site: http://www.anytun.org/
 COPYING
 -------
 
-Copyright \(C) 2007-2008 Othmar Gsenger, Erwin Nindl and Christian
-Pointner. This  program  is  free software;  you  can redistribute
-it and/or modify it under the terms of the GNU General Public License
-version 2 as published by the Free Software Foundation.
-
+Copyright \(C) 2007-2009 Othmar Gsenger, Erwin Nindl and Christian
+Pointner. 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 the Free Software Foundation, either version 3 of 
+the License, or any later version.
index fa30441..377bb2d 100644 (file)
@@ -8,47 +8,49 @@ anytun - anycast tunneling daemon
 SYNOPSIS
 --------
 
-*anytun*
-[ *-h|--help* ]
-[ *-D|--nodaemonize* ]
-[ *-u|--username* <username> ]
-[ *-g|--groupname* <groupname> ]
-[ *-C|--chroot* <path> ]
-[ *-P|--write-pid* <filename> ]
-[ *-L|--log* <target>:<level>[,<param1>[,<param2>[..]]] ]
-[ *-i|--interface* <ip-address> ]
-[ *-p|--port* <port> ]
-[ *-r|--remote-host* <hostname|ip> ]
-[ *-o|--remote-port* <port> ]
-[ *-4|--ipv4-only* ]
-[ *-6|--ipv6-only* ]
-[ *-I|--sync-interface* <ip-address> ]
-[ *-S|--sync-port* port> ]
-[ *-M|--sync-hosts* <hostname|ip>[:<port>][,<hostname|ip>[:<port>][...]] ]
-[ *-X|--control-host* <hostname|ip>[:<port>]
-[ *-d|--dev* <name> ]
-[ *-t|--type* <tun|tap> ]
-[ *-n|--ifconfig* <local>/<prefix> ]
-[ *-x|--post-up-script* <script> ]
-[ *-R|--route* <net>/<prefix length> ]
-[ *-m|--mux* <mux-id> ]
-[ *-s|--sender-id* <sender id> ]
-[ *-w|--window-size* <window size> ]
-[ *-k|--kd-prf* <kd-prf type> ]
-[ *-e|--role <role>* ]
-[ *-E|--passphrase* <pass phrase> ]
-[ *-K|--key* <master key> ]
-[ *-A|--salt* <master salt> ]
-[ *-c|--cipher* <cipher type> ]
-[ *-a|--auth-algo* <algo type> ]
-[ *-b|--auth-tag-length* <length> ]
+....
+anytun
+  [ -h|--help ]
+  [ -D|--nodaemonize ]
+  [ -u|--username <username> ]
+  [ -g|--groupname <groupname> ]
+  [ -C|--chroot <path> ]
+  [ -P|--write-pid <filename> ]
+  [ -L|--log <target>:<level>[,<param1>[,<param2>[..]]] ]
+  [ -i|--interface <ip-address> ]
+  [ -p|--port <port> ]
+  [ -r|--remote-host <hostname|ip> ]
+  [ -o|--remote-port <port> ]
+  [ -4|--ipv4-only ]
+  [ -6|--ipv6-only ]
+  [ -I|--sync-interface <ip-address> ]
+  [ -S|--sync-port port> ]
+  [ -M|--sync-hosts <hostname|ip>[:<port>][,<hostname|ip>[:<port>][...]] ]
+  [ -X|--control-host <hostname|ip>[:<port>]
+  [ -d|--dev <name> ]
+  [ -t|--type <tun|tap> ]
+  [ -n|--ifconfig <local>/<prefix> ]
+  [ -x|--post-up-script <script> ]
+  [ -R|--route <net>/<prefix length> ]
+  [ -m|--mux <mux-id> ]
+  [ -s|--sender-id <sender id> ]
+  [ -w|--window-size <window size> ]
+  [ -k|--kd-prf <kd-prf type> ]
+  [ -e|--role <role> ]
+  [ -E|--passphrase <pass phrase> ]
+  [ -K|--key <master key> ]
+  [ -A|--salt <master salt> ]
+  [ -c|--cipher <cipher type> ]
+  [ -a|--auth-algo <algo type> ]
+  [ -b|--auth-tag-length <length> ]
+....
 
 DESCRIPTION
 -----------
 
 *Anytun* is an implementation of the Secure Anycast Tunneling Protocol
 (SATP). It provides a complete VPN solution similar to OpenVPN or
-IPsec in tunnel mode. The main difference is that anycast enables the
+IPsec in tunnel mode. The main difference is that anycast allows a
 setup of tunnels between an arbitrary combination of anycast, unicast
 and multicast hosts.
 
@@ -59,318 +61,229 @@ OPTIONS
 no difference between client and server. The following options can be
 passed to the daemon:
 
--D|--nodaemonize
-~~~~~~~~~~~~~~~~
-
-This option instructs *anytun* to run in foreground
-instead of becoming a daemon which is the default.
-
--u|--username <username>
-~~~~~~~~~~~~~~~~~~~~~~~~
-
-run as this user. If no group is specified (*-g*) the default group of 
-the user is used. The default is to not drop privileges.
-
--g|--groupname <groupname>
-~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-run as this group. If no username is specified (*-u*) this gets ignored.
-The default is to not drop privileges.
-
--C|--chroot <path>
-~~~~~~~~~~~~~~~~~~
-
-Instruct *anytun* to run in a chroot jail. The default is 
-to not run in chroot.
-
--P|--write-pid <filename>
-~~~~~~~~~~~~~~~~~~~~~~~~~
-
-Instruct *anytun* to write it's pid to this file. The default is 
-to not create a pid file.
-
--L|--log <target>:<level>[,<param1>[,<param2>[..]]]
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-add log target to logging system. This can be invoked several times
-in order to log to different targets at the same time. Every target 
-hast its own log level which is a number between 0 and 5. Where 0 means
-disabling log and 5 means debug messages are enabled.
-
-The following targets are supported:
-
-* *syslog* - log to syslog daemon, parameters <level>[,<logname>[,<facility>]]
-* *file* - log to file, parameters <level>[,<path>]
-* *stdout* - log to standard output, parameters <level>
-* *stderr* - log to standard error, parameters <level> 
-
-The file target can be used more the once with different levels.
-If no target is provided at the command line a single target with the 
-following config is added:
-
-*syslog:3,uanytun,daemon*
-
--i|--interface <ip address>
-~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-This IP address is used as the sender address for outgoing
-packets. In case of anycast tunnel endpoints, the anycast
-IP has to be used. In case of unicast endpoints, the
-address is usually derived correctly from the routing
-table. The default is to not use a special inteface and just
-bind on all interfaces.
-
--p|--port <port>
-~~~~~~~~~~~~~~~~
-
-local anycast(data) port to bind to
-
-The local UDP port that is used to send and receive the
-payload data. The two tunnel endpoints can use different
-ports. If a tunnel endpoint consists of multiple anycast
-hosts, all hosts have to use the same port. default: 4444
-
--r|--remote-host <hostname|ip>
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-remote host
-
-This option can be used to specify the remote tunnel
-endpoint. In case of anycast tunnel endpoints, the
-anycast IP address has to be used. If you do not specify
-an address, it is automatically determined after receiving
-the first data packet.
-
--o|--remote-port <port>
-~~~~~~~~~~~~~~~~~~~~~~~
-remote port
-
-The UDP port used for payload data by the remote host
-(specified with -p on the remote host). If you do not specify
-a port, it is automatically determined after receiving
-the first data packet.
-
--4|--ipv4-only
-~~~~~~~~~~~~~~
-
-Resolv to IPv4 addresses only. The default is to resolv both
-IPv4 and IPv6 addresses.
-
--6|--ipv6-only
-~~~~~~~~~~~~~~
-
-Resolv to IPv6 addresses only. The default is to resolv both
-IPv4 and IPv6 addresses.
-
--I|--sync-interface <ip-address>
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-local unicast(sync) ip address to bind to
-
-This option is only needed for tunnel endpoints consisting
-of multiple anycast hosts. The unicast IP address of
-the anycast host can be used here. This is needed for
-communication with the other anycast hosts. The default is to 
-not use a special inteface and just bind on all interfaces. However
-this is only the case if synchronisation is active see *--sync-port*.
-
--S|--sync-port <port>
-~~~~~~~~~~~~~~~~~~~~~
-
-local unicast(sync) port to bind to
-
-This option is only needed for tunnel endpoints
-consisting of multiple anycast hosts. This port is used
-by anycast hosts to synchronize information about tunnel
-endpoints. No payload data is transmitted via this port.
-By default the synchronisation is disabled an therefore the
-port is kept empty.
-
-It is possible to obtain a list of active connections
-by telnetting into this port. This port is read-only
-and unprotected by default. It is advised to protect
-this port using firewall rules and, eventually, IPsec.
-
--M|--sync-hosts <hostname|ip>[:<port>],[<hostname|ip>[:<port>][...]]
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-remote hosts to sync with
-
-This option is only needed for tunnel endpoints consisting
-of multiple anycast hosts. Here, one has to specify all
-unicast IP addresses of all other anycast hosts that
-comprise the anycast tunnel endpoint. By default synchronisation is
-disabled and therefore this is empty. Mind that the port can be
-omitted in which case port 2323 is used. If you want to specify an
-ipv6 address and a port you have to use [ and ] to seperate the address
-from the port, eg.: [::1]:1234. If you want to use the default port 
-[ and ] can be omitted.
-
--X|--control-host <hostname|ip>[:<port>]
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-fetch the config from this host. The default is not to use a control
-host and therefore this is empty. Mind that the port can be omitted 
-in which case port 2323 is used. If you want to specify an
-ipv6 address and a port you have to use [ and ] to seperate the address
-from the port, eg.: [::1]:1234. If you want to use the default port 
-[ and ] can be omitted.
-
--d|--dev <name>
-~~~~~~~~~~~~~~~
-device name
-
-By default, tapN is used for Ethernet tunnel interfaces,
-and tunN for IP tunnels, respectively. This option can
-be used to manually override these defaults.
-
--t|--type <tun|tap>
-~~~~~~~~~~~~~~~~~~~
-
-device type
-
-Type of the tunnels to create. Use tap for Ethernet
-tunnels, tun for IP tunnels.
-
--n|--ifconfig <local>/<prefix>
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-*<local>* the local IP address for the tun/tap device
-
-*<prefix>* the prefix length of the network
-
-The local IP address and prefix length. The remote tunnel endpoint
-has to use a different IP address in the same subnet
-
--x|--post-up-script <script>
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-This option instructs *anytun* to run this script after the interface 
-is created. By default no script will be executed.
-
--R|--route <net>/<prefix length>
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-add a route to connection. This can be invoked several times.
-
--m|--mux <mux-id>
-~~~~~~~~~~~~~~~~~
-
-the multiplex id to use. default: 0
-
--s|--sender-id  <sender id>
-~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-Each anycast tunnel endpoint needs a uniqe sender id
-(1, 2, 3, ...). It is needed to distinguish the senders
-in case of replay attacks. This option can be ignored on
-unicast endpoints. default: 0
-
--w|--window-size <window size>
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-seqence window size
-
-Sometimes, packets arrive out of order on the receiver
-side. This option defines the size of a list of received
-packets' sequence numbers. If, according to this list,
-a received packet has been previously received or has
-been transmitted in the past, and is therefore not in
-the list anymore, this is interpreted as a replay attack
-and the packet is dropped. A value of 0 deactivates this
-list and, as a consequence, the replay protection employed
-by filtering packets according to their secuence number.
-By default the sequence window is disabled and therefore a
-window size of 0 is used.
-
--k|--kd--prf <kd-prf type>
-~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-key derivation pseudo random function.
-
-The pseudo random function which is used for calculating the 
-session keys and session salt.
-
-Possible values:
-
-* *null* - no random function, keys and salt are set to 0..00
-* *aes-ctr* - AES in counter mode with 128 Bits, default value
-* *aes-ctr-128* - AES in counter mode with 128 Bits
-* *aes-ctr-192* - AES in counter mode with 192 Bits
-* *aes-ctr-256* - AES in counter mode with 256 Bits
-
--e|--role <role>
-~~~~~~~~~~~~~~~~
-
-SATP uses different session keys for inbound and outbound traffic. The
-role parameter is used to determine which keys to use for outbound or
-inbound packets. On both sides of a vpn connection different roles have 
-to be used. Possible values are *left* and *right*. You may also use 
-*alice* or *server* as a replacement for *left* and *bob* or *client* as 
-a replacement for *right*. By default *left* is used.
-
--E|--passphrase <pass phrase>
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-This passphrase is used to generate the master key and master salt.
-For the master key the last n bits of the SHA256 digest of the 
-passphrase (where n is the length of the master key in bits) is used. 
-The master salt gets generated with the SHA1 digest. 
-You may force a specific key and or salt by using *--key* and *--salt*.
-
--K|--key <master key>
-~~~~~~~~~~~~~~~~~~~~~
-
-master key to use for key derivation
-
-Master key in hexadecimal notation, eg
-01a2b3c4d5e6f708a9b0cadbecfd0fa1, with a mandatory length
-of 32, 48 or 64 characters (128, 192 or 256 bits).
-
--A|--salt <master salt>
-~~~~~~~~~~~~~~~~~~~~~~~
-
-master salt to use for key derivation
-
-Master salt in hexadecimal notation, eg
-01a2b3c4d5e6f708a9b0cadbecfd, with a mandatory length
-of 28 characters (14 bytes).
-
--c|--cipher <cipher type>
-~~~~~~~~~~~~~~~~~~~~~~~~~
-
-payload encryption algorithm
-
-Encryption algorithm used for encrypting the payload
-
-Possible values:
-
-* *null* - no encryption
-* *aes-ctr* - AES in counter mode with 128 Bits, default value
-* *aes-ctr-128* - AES in counter mode with 128 Bits
-* *aes-ctr-192* - AES in counter mode with 192 Bits
-* *aes-ctr-256* - AES in counter mode with 256 Bits
-
--a|--auth-algo <algo type>
-~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-message authentication algorithm
-
-This option sets the message authentication algorithm.
-
-Possible values:
-
-* *null* - no message authentication
-* *sha1* - HMAC-SHA1, default value
-
-If HMAC-SHA1 is used, the packet length is increased. The additional bytes 
-contain the authentication data. see *-b|--auth-tag-length* for more info.
-
--b|--auth-tag-length <length>
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-The number of bytes to use for the auth tag. This value defaults to 10 bytes 
-unless the *null* auth algo is used in which case it defaults to 0. 
+*-D, --nodaemonize*::
+   This option instructs *Anytun* to run in foreground
+   instead of becoming a daemon which is the default.
+
+*-u, --username <username>*::
+   run as this user. If no group is specified (*-g*) the default group of 
+   the user is used. The default is to not drop privileges.
+
+*-g, --groupname <groupname>*::
+   run as this group. If no username is specified (*-u*) this gets ignored.
+   The default is to not drop privileges.
+
+*-C, --chroot <path>*::
+   Instruct *Anytun* to run in a chroot jail. The default is 
+   to not run in chroot.
+
+*-P, --write-pid <filename>*::
+   Instruct *Anytun* to write it's pid to this file. The default is 
+   to not create a pid file.
+
+*-L, --log <target>:<level>[,<param1>[,<param2>[..]]]*::
+   add log target to logging system. This can be invoked several times
+   in order to log to different targets at the same time. Every target 
+   hast its own log level which is a number between 0 and 5. Where 0 means
+   disabling log and 5 means debug messages are enabled. +
+   The file target can be used more the once with different levels.
+   If no target is provided at the command line a single target with the 
+   config *syslog:3,anytun,daemon* is added. +
+   The following targets are supported:
+
+   *syslog*;; log to syslog daemon, parameters <level>[,<logname>[,<facility>]]
+   *file*;; log to file, parameters <level>[,<path>]
+   *stdout*;; log to standard output, parameters <level>
+   *stderr*;; log to standard error, parameters <level> 
+
+*-i, --interface <ip address>*::
+   This IP address is used as the sender address for outgoing
+   packets. In case of anycast tunnel endpoints, the anycast
+   IP has to be used. In case of unicast endpoints, the
+   address is usually derived correctly from the routing
+   table. The default is to not use a special inteface and just
+   bind on all interfaces.
+
+*-p, --port <port>*::
+   The local UDP port that is used to send and receive the
+   payload data. The two tunnel endpoints can use different
+   ports. If a tunnel endpoint consists of multiple anycast
+   hosts, all hosts have to use the same port. default: 4444
+
+*-r, --remote-host <hostname|ip>*::
+   This option can be used to specify the remote tunnel
+   endpoint. In case of anycast tunnel endpoints, the
+   anycast IP address has to be used. If you do not specify
+   an address, it is automatically determined after receiving
+   the first data packet.
+
+*-o, --remote-port <port>*::
+   The UDP port used for payload data by the remote host
+   (specified with -p on the remote host). If you do not specify
+   a port, it is automatically determined after receiving
+   the first data packet.
+
+*-4, --ipv4-only*::
+   Resolv to IPv4 addresses only. The default is to resolv both
+   IPv4 and IPv6 addresses.
+
+*-6, --ipv6-only*::
+   Resolv to IPv6 addresses only. The default is to resolv both
+   IPv4 and IPv6 addresses.
+
+*-I, --sync-interface <ip-address>*::
+   local unicast(sync) ip address to bind to +
+   This option is only needed for tunnel endpoints consisting
+   of multiple anycast hosts. The unicast IP address of
+   the anycast host can be used here. This is needed for
+   communication with the other anycast hosts. The default is to 
+   not use a special inteface and just bind on all interfaces. However
+   this is only the case if synchronisation is active see *--sync-port*.
+
+*-S, --sync-port <port>*::
+   local unicast(sync) port to bind to +
+   This option is only needed for tunnel endpoints
+   consisting of multiple anycast hosts. This port is used
+   by anycast hosts to synchronize information about tunnel
+   endpoints. No payload data is transmitted via this port.
+   By default the synchronisation is disabled an therefore the
+   port is kept empty. +
+   It is possible to obtain a list of active connections
+   by telnetting into this port. This port is read-only
+   and unprotected by default. It is advised to protect
+   this port using firewall rules and, eventually, IPsec.
+
+*-M, --sync-hosts <hostname|ip>[:<port>],[<hostname|ip>[:<port>][...]]*::
+   remote hosts to sync with +
+   This option is only needed for tunnel endpoints consisting
+   of multiple anycast hosts. Here, one has to specify all
+   unicast IP addresses of all other anycast hosts that
+   comprise the anycast tunnel endpoint. By default synchronisation is
+   disabled and therefore this is empty. Mind that the port can be
+   omitted in which case port 2323 is used. If you want to specify an
+   ipv6 address and a port you have to use [ and ] to seperate the address
+   from the port, eg.: [::1]:1234. If you want to use the default port 
+   [ and ] can be omitted.
+
+*-X, --control-host <hostname|ip>[:<port>]*::
+   fetch the config from this host. The default is not to use a control
+   host and therefore this is empty. Mind that the port can be omitted 
+   in which case port 2323 is used. If you want to specify an
+   ipv6 address and a port you have to use [ and ] to seperate the address
+   from the port, eg.: [::1]:1234. If you want to use the default port 
+   [ and ] can be omitted.
+
+*-d, --dev <name>*::
+   device name +
+   By default, tapN is used for Ethernet tunnel interfaces,
+   and tunN for IP tunnels, respectively. This option can
+   be used to manually override these defaults.
+
+*-t, --type <tun|tap>*::
+   device type +
+   Type of the tunnels to create. Use tap for Ethernet
+   tunnels, tun for IP tunnels.
+
+*-n, --ifconfig <local>/<prefix>*::
+   The local IP address and prefix length. The remote tunnel endpoint
+   has to use a different IP address in the same subnet.
+
+   *<local>*;; the local IP address for the tun/tap device
+   *<prefix>*;; the prefix length of the network
+
+*-x, --post-up-script <script>*::
+   This option instructs *Anytun* to run this script after the interface 
+   is created. By default no script will be executed.
+
+*-R, --route <net>/<prefix length>*::
+   add a route to connection. This can be invoked several times.
+
+*-m, --mux <mux-id>*::
+   the multiplex id to use. default: 0
+
+*-s, --sender-id  <sender id>*::
+   Each anycast tunnel endpoint needs a uniqe sender id
+   (1, 2, 3, ...). It is needed to distinguish the senders
+   in case of replay attacks. This option can be ignored on
+   unicast endpoints. default: 0
+
+*-w, --window-size <window size>*::
+   seqence window size +
+   Sometimes, packets arrive out of order on the receiver
+   side. This option defines the size of a list of received
+   packets' sequence numbers. If, according to this list,
+   a received packet has been previously received or has
+   been transmitted in the past, and is therefore not in
+   the list anymore, this is interpreted as a replay attack
+   and the packet is dropped. A value of 0 deactivates this
+   list and, as a consequence, the replay protection employed
+   by filtering packets according to their secuence number.
+   By default the sequence window is disabled and therefore a
+   window size of 0 is used.
+
+*-k, --kd--prf <kd-prf type>*::
+   key derivation pseudo random function +
+   The pseudo random function which is used for calculating the 
+   session keys and session salt. +
+   Possible values:
+
+   *null*;; no random function, keys and salt are set to 0..00
+   *aes-ctr*;; AES in counter mode with 128 Bits, default value
+   *aes-ctr-128*;; AES in counter mode with 128 Bits
+   *aes-ctr-192*;; AES in counter mode with 192 Bits
+   *aes-ctr-256*;; AES in counter mode with 256 Bits
+
+*-e, --role <role>*::
+   SATP uses different session keys for inbound and outbound traffic. The
+   role parameter is used to determine which keys to use for outbound or
+   inbound packets. On both sides of a vpn connection different roles have 
+   to be used. Possible values are *left* and *right*. You may also use 
+   *alice* or *server* as a replacement for *left* and *bob* or *client* as 
+   a replacement for *right*. By default *left* is used.
+
+*-E, --passphrase <pass phrase>*::
+   This passphrase is used to generate the master key and master salt.
+   For the master key the last n bits of the SHA256 digest of the 
+   passphrase (where n is the length of the master key in bits) is used. 
+   The master salt gets generated with the SHA1 digest. 
+   You may force a specific key and or salt by using *--key* and *--salt*.
+
+*-K, --key <master key>*::
+   master key to use for key derivation +
+   Master key in hexadecimal notation, e.g.
+   01a2b3c4d5e6f708a9b0cadbecfd0fa1, with a mandatory length
+   of 32, 48 or 64 characters (128, 192 or 256 bits).
+
+*-A, --salt <master salt>*::
+   master salt to use for key derivation +
+   Master salt in hexadecimal notation, e.g.
+   01a2b3c4d5e6f708a9b0cadbecfd, with a mandatory length
+   of 28 characters (14 bytes).
+
+*-c, --cipher <cipher type>*::
+   payload encryption algorithm +
+   Encryption algorithm used for encrypting the payload +
+   Possible values:
+
+   *null*;; no encryption
+   *aes-ctr*;; AES in counter mode with 128 Bits, default value
+   *aes-ctr-128*;; AES in counter mode with 128 Bits
+   *aes-ctr-192*;; AES in counter mode with 192 Bits
+   *aes-ctr-256*;; AES in counter mode with 256 Bits
+
+*-a, --auth-algo <algo type>*::
+   message authentication algorithm +
+   This option sets the message authentication algorithm. +
+   If HMAC-SHA1 is used, the packet length is increased. The additional bytes 
+   contain the authentication data. see *--auth-tag-length* for more info. +
+   Possible values:
+
+   *null*;; no message authentication
+   *sha1*;; HMAC-SHA1, default value
+
+*-b, --auth-tag-length <length>*::
+   The number of bytes to use for the auth tag. This value defaults to 10 bytes 
+   unless the *null* auth algo is used in which case it defaults to 0. 
 
 
 EXAMPLES
@@ -429,7 +342,7 @@ anycast tunnel endpoint) please consult the man page of anytun-config(8).
 
 BUGS
 ----
-Most likely there are some bugs in *anytun*. If you find a bug, please let
+Most likely there are some bugs in *Anytun*. If you find a bug, please let
 the developers know at satp@anytun.org. Of course, patches are preferred.
 
 SEE ALSO
@@ -438,19 +351,11 @@ anytun-config(8), anytun-controld(8), anytun-showtables(8)
 
 AUTHORS
 -------
-Design of SATP and wizards of this implementation:
 
 Othmar Gsenger <otti@anytun.org>
 Erwin Nindl <nine@anytun.org>
 Christian Pointner <equinox@anytun.org>
 
-Debian packaging:
-
-Andreas Hirczy <ahi@itp.tu-graz.ac.at>
-
-Manual page:
-
-Alexander List <alex@debian.org>
 
 RESOURCES
 ---------
@@ -461,8 +366,8 @@ Main web site: http://www.anytun.org/
 COPYING
 -------
 
-Copyright \(C) 2007-2008 Othmar Gsenger, Erwin Nindl and Christian
-Pointner. This  program  is  free software;  you  can redistribute
-it and/or modify it under the terms of the GNU General Public License
-version 2 as published by the Free Software Foundation.
-
+Copyright \(C) 2007-2009 Othmar Gsenger, Erwin Nindl and Christian
+Pointner. 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 the Free Software Foundation, either version 3 of 
+the License, or any later version.
index 61c8318..7701159 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
index d683b4c..dc4c7ac 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  *  along with anytun.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef _NETWORK_ADDRESS_H
-#define _NETWORK_ADDRESS_H
+#ifndef ANYTUN_networkAddress_h_INCLUDED
+#define ANYTUN_networkAddress_h_INCLUDED
+
+// TODO not required here
 #include <boost/archive/text_oarchive.hpp>
 #include <boost/archive/text_iarchive.hpp>
 
index 045b251..31287b9 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
index 5a0a69a..1c023ed 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -29,8 +30,8 @@
  *  along with anytun.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef _NETWORK_PREFIX_H
-#define _NETWORK_PREFIX_H
+#ifndef ANYTUN_networkPrefix_h_INCLUDED
+#define ANYTUN_networkPrefix_h_INCLUDED
 
 #include "threadUtils.hpp"
 #include "datatypes.h"
index b77ab41..236acb1 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
index 9beda0c..92fc89f 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -29,8 +30,8 @@
  *  along with anytun.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef _OPTIONS_H_
-#define _OPTIONS_H_
+#ifndef ANYTUN_options_h_INCLUDED
+#define ANYTUN_options_h_INCLUDED
 
 #include "datatypes.h"
 #include "buffer.h"
index 9266b57..0882de5 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
index 1957eb8..626a259 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -29,8 +30,8 @@
  *  along with anytun.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef _PACKET_SOURCE_H_
-#define _PACKET_SOURCE_H_
+#ifndef ANYTUN_packetSource_h_INCLUDED
+#define ANYTUN_packetSource_h_INCLUDED
 
 #include <boost/asio.hpp>
 
index 9c39b63..79a72de 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
index 5919c32..8cf0368 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -29,8 +30,8 @@
  *  along with anytun.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef _PLAIN_PACKET_H_
-#define _PLAIN_PACKET_H_
+#ifndef ANYTUN_plainPacket_h_INCLUDED
+#define ANYTUN_plainPacket_h_INCLUDED
 
 #include "datatypes.h"
 #include "buffer.h"
index 06db1b4..66f1e7e 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
index b5553bc..dfec8cc 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -29,8 +30,8 @@
  *  along with anytun.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef _RESOLVER_H_
-#define _RESOLVER_H_
+#ifndef ANYTUN_resolver_h_INCLUDED
+#define ANYTUN_resolver_h_INCLUDED
 
 #include <queue>
 #include <boost/asio.hpp>
index b683dca..c64366d 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
index 9ab3260..4a60ec3 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -29,8 +30,8 @@
  *  along with anytun.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef _ROUTINGTABLE_H
-#define _ROUTINGTABLE_H
+#ifndef ANYTUN_routingTable_h_INCLUDED
+#define ANYTUN_routingTable_h_INCLUDED
 
 #include <map>
 #include <deque>
index 3a9024d..89b7c18 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -29,8 +30,8 @@
  *  along with anytun.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef __ROUTING_TREE_
-#define __ROUTING_TREE_
+#ifndef ANYTUN_routingTree_hpp_INCLUDED
+#define ANYTUN_routingTree_hpp_INCLUDED
 
 #include "anytunError.h"
 
@@ -100,5 +101,3 @@ public:
 };
 
 #endif
-  
-  
index eed501b..e50ff70 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
index 3c2d33d..9efc6f2 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -29,9 +30,8 @@
  *  along with anytun.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef _ROUTING_TREE_NODE_H
-#define _ROUTING_TREE_NODE_H
-
+#ifndef ANYTUN_routingTreeNode_h_INCLUDED
+#define ANYTUN_routingTreeNode_h_INCLUDED
 
 #include "threadUtils.hpp"
 #include "datatypes.h"
index 34ce02c..359ba63 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -31,7 +32,7 @@
 
 #include "threadUtils.hpp"
 #include "datatypes.h"
-
+#include <cstring>
 #include "seqWindow.h"
 
 SeqWindowElement::SeqWindowElement()
index e16e335..1090447 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -29,8 +30,8 @@
  *  along with anytun.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef _SEQ_WINDOW_H_
-#define _SEQ_WINDOW_H_
+#ifndef ANYTUN_seqWindow_h_INCLUDED
+#define ANYTUN_seqWindow_h_INCLUDED
 
 #include <map>
 #include <deque>
index b2017fd..2e4a53e 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -149,10 +150,6 @@ SignalController::~SignalController()
 {
   for(HandlerMap::iterator it = handler.begin(); it != handler.end(); ++it)
     delete it->second;
-
-#ifndef _MSC_VER
-  if(thread) delete thread;
-#endif
 }
 
 #ifndef _MSC_VER
@@ -193,7 +190,7 @@ void SignalController::init()
 #error The signalhandler works only with pthreads
 #endif
   
-  thread = new boost::thread(boost::bind(&SignalController::handle, this));
+  boost::thread(boost::bind(&SignalController::handle, this));
 
   handler[SIGINT] = new SigIntHandler;
   handler[SIGQUIT] = new SigQuitHandler;
@@ -248,7 +245,7 @@ int SignalController::run()
         return ret;
     }
     else
-      cLog.msg(Log::PRIO_NOTICE) << "SIG " << sig.first << " caught with message '" << sig.second << "'- ignoring";
+      cLog.msg(Log::PRIO_NOTICE) << "SIG " << sig.first << " caught with message '" << sig.second << "' - ignoring";
   }
   return 0;
 }
index 575b50b..6108bea 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -29,8 +30,8 @@
  *  along with anytun.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef _SIGNAL_CONTROLLER_H_
-#define _SIGNAL_CONTROLLER_H_
+#ifndef ANYTUN_signalController_h_INCLUDED
+#define ANYTUN_signalController_h_INCLUDED
 
 #include <map>
 #include <queue>
@@ -164,11 +165,7 @@ public:
 private:
   typedef std::map<int, SignalHandler*> HandlerMap;
 
-#ifndef _MSC_VER
-  SignalController() : thread(NULL) {};
-#else
   SignalController() {};
-#endif
   ~SignalController();
   SignalController(const SignalController &s);
   void operator=(const SignalController &s);
@@ -188,9 +185,6 @@ private:
   Mutex sigQueueMutex;
   Semaphore sigQueueSem;
 
-#ifndef _MSC_VER  
-  boost::thread* thread;
-#endif
   HandlerMap handler;
 };
 
index 9247fff..0ad2b4a 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
index f5e2ff5..a9aee4e 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -29,8 +30,8 @@
  *  along with anytun.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef _SYNCBUFFER_H_
-#define _SYNCBUFFER_H_
+#ifndef ANYTUN_syncBuffer_h_INCLUDED
+#define ANYTUN_syncBuffer_h_INCLUDED
 
 #include <boost/archive/text_oarchive.hpp>
 #include <boost/archive/text_iarchive.hpp>
index df99b83..dd6a166 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
index 08b3015..bc9d004 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -28,8 +29,8 @@
  *  You should have received a copy of the GNU General Public License
  *  along with anytun.  If not, see <http://www.gnu.org/licenses/>.
  */
-#ifndef _SYNCCLIENT_H
-#define _SYNCCLIENT_H
+#ifndef ANYTUN_syncClient_h_INCLUDED
+#define ANYTUN_syncClient_h_INCLUDED
 
 #include <string>
 #include "syncTcpConnection.h"
index 48bed3a..8668504 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
index 9f0ef2a..71c1ffe 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -28,8 +29,9 @@
  *  You should have received a copy of the GNU General Public License
  *  along with anytun.  If not, see <http://www.gnu.org/licenses/>.
  */
-#ifndef _SYNCCOMMAND_H
-#define _SYNCCOMMAND_H
+#ifndef ANYTUN_syncCommand_h_INCLUDED
+#define ANYTUN_syncCommand_h_INCLUDED
+
 #include <boost/archive/text_oarchive.hpp>
 #include <boost/archive/text_iarchive.hpp>
 
@@ -76,4 +78,4 @@ private:
 };
 
 
-#endif // _SYNCCOMMAND_H
+#endif
index 844f8bc..d0d4a9a 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
index 5debf1f..0c2eb43 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -29,8 +30,8 @@
  *  along with anytun.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef _SYNCCONNECTIONCOMMAND_H
-#define _SYNCCONNECTIONCOMMAND_H
+#ifndef ANYTUN_syncConnectionCommands_h_INCLUDED
+#define ANYTUN_syncConnectionCommands_h_INCLUDED
 
 #include <boost/archive/text_oarchive.hpp>
 #include <boost/archive/text_iarchive.hpp>
@@ -61,4 +62,4 @@ private:
 };
 
 
-#endif // _SYNCCOMMAND_H
+#endif
index 0b454e7..79df42f 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  *  along with anytun.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#ifndef ANYTUN_syncOnConnect_hpp_INCLUDED
+#define ANYTUN_syncOnConnect_hpp_INCLUDED
+
+// TODO required headers
+
 void syncOnConnect(SyncTcpConnection * connptr)
 {
   //TODO Locking here  
@@ -66,3 +72,4 @@ void syncOnConnect(SyncTcpConnection * connptr)
        }
 }
 
+#endif
index 636107b..270bb26 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
index 5cb4f6e..8da82b9 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -29,8 +30,8 @@
  *  along with anytun.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef _SYNC_QUEUE_H
-#define _SYNC_QUEUE_H
+#ifndef ANYTUN_syncQueue_h_INCLUDED
+#define ANYTUN_syncQueue_h_INCLUDED
 
 #include <deque>
 #include <queue>
index bcfb925..3c02a02 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
index 5bef2f9..e91ffd0 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -28,8 +29,9 @@
  *  You should have received a copy of the GNU General Public License
  *  along with anytun.  If not, see <http://www.gnu.org/licenses/>.
  */
-#ifndef _SYNCROUTECOMMAND_H
-#define _SYNCROUTECOMMAND_H
+#ifndef ANYTUN_syncRouteCommands_h_INCLUDED
+#define ANYTUN_syncRouteCommands_h_INCLUDED
+
 #include <boost/archive/text_oarchive.hpp>
 #include <boost/archive/text_iarchive.hpp>
 
@@ -62,4 +64,4 @@ private:
 };
 
 
-#endif // _SYNCCOMMAND_H
+#endif
index bd5120c..b61872c 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
index 138f46e..b73247f 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  *  along with anytun.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef _SYNC_SERVER_H_
-#define _SYNC_SERVER_H_
-//#include <iostream>
-//#include <string>
+#ifndef ANYTUN_syncServer_h_INCLUDED
+#define ANYTUN_syncServer_h_INCLUDED
+
 #include <boost/bind.hpp>
 #include <boost/shared_ptr.hpp>
 #include <boost/enable_shared_from_this.hpp>
@@ -68,4 +68,5 @@ private:
   ConnectCallback onConnect_;
   Semaphore ready_sem_;
 };
+
 #endif
index 17d3ddd..d243633 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
index 4bf458f..e35c574 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -28,9 +29,9 @@
  *  You should have received a copy of the GNU General Public License
  *  along with anytun.  If not, see <http://www.gnu.org/licenses/>.
  */
+#ifndef ANYTUN_syncTcpConnection_h_INCLUDED
+#define ANYTUN_syncTcpConnection_h_INCLUDED
 
-#ifndef _SYNCTCPCONNECTION_H_
-#define _SYNCTCPCONNECTION_H_
 #include <boost/shared_ptr.hpp>
 #include <boost/enable_shared_from_this.hpp>
 #include <boost/function.hpp>
@@ -62,4 +63,5 @@ private:
       size_t /*bytes_transferred*/);
   proto::socket socket_;
 };
+
 #endif
diff --git a/src/sysExec.cpp b/src/sysExec.cpp
new file mode 100644 (file)
index 0000000..49c0cae
--- /dev/null
@@ -0,0 +1,157 @@
+/*
+ *  anytun
+ *
+ *  The secure anycast tunneling protocol (satp) defines a protocol used
+ *  for communication between any combination of unicast and anycast
+ *  tunnel endpoints.  It has less protocol overhead than IPSec in Tunnel
+ *  mode and allows tunneling of every ETHER TYPE protocol (e.g.
+ *  ethernet, ip, arp ...). satp directly includes cryptography and
+ *  message authentication based on the methodes used by SRTP.  It is
+ *  intended to deliver a generic, scaleable and secure solution for
+ *  tunneling and relaying of packets of any protocol.
+ *
+ *
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
+ *                          Christian Pointner <satp@wirdorange.org>
+ *
+ *  This file is part of Anytun.
+ *
+ *  Anytun is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
+ *
+ *  Anytun is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with anytun.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <boost/bind.hpp>
+#include <boost/thread.hpp>
+
+#include "datatypes.h"
+#include "sysExec.h"
+#include "log.h"
+#include "anytunError.h"
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <sys/wait.h>
+#include <sys/select.h>
+#include <stdlib.h>
+#include <string.h>
+#include <cstring>
+
+void anytun_exec(std::string const& script)
+{
+  anytun_exec(script, StringVector(), StringList());
+}
+
+void anytun_exec(std::string const& script, StringVector const& args)
+{
+  anytun_exec(script, args, StringList());
+}
+
+void anytun_exec(std::string const& script, StringList const& env)
+{
+  anytun_exec(script, StringVector(), env);
+}
+
+void anytun_exec(std::string const& script, StringVector const& args, StringList const& env)
+{
+  int pipefd[2];
+  if(pipe(pipefd) == -1) {
+    cLog.msg(Log::PRIO_ERROR) << "executing script '" << script << "' pipe() error: " << AnytunErrno(errno);
+    return;
+  }
+
+  pid_t pid;
+  pid = fork();
+  if(pid == -1) {
+    cLog.msg(Log::PRIO_ERROR) << "executing script '" << script << "' fork() error: " << AnytunErrno(errno);
+    return;
+  }
+
+  if(pid) {
+    close(pipefd[1]);
+    boost::thread(boost::bind(waitForScript, script, pid, pipefd[0]));
+    return;
+  }
+
+// child code
+  int fd;
+  for (fd=getdtablesize();fd>=0;--fd) // close all file descriptors
+    if(fd != pipefd[1]) close(fd);
+  
+  fd = open("/dev/null",O_RDWR);        // stdin
+  if(fd == -1)
+    cLog.msg(Log::PRIO_WARNING) << "can't open stdin";
+  else {
+    if(dup(fd) == -1)   // stdout
+      cLog.msg(Log::PRIO_WARNING) << "can't open stdout";
+    if(dup(fd) == -1)   // stderr
+      cLog.msg(Log::PRIO_WARNING) << "can't open stderr";
+  }
+  
+  char** argv = new char*[args.size() + 2];
+  argv[0] = new char[script.size() + 1];
+  std::strcpy(argv[0], script.c_str());
+  for(unsigned int i=0; i<args.size(); ++i) {
+    argv[i+1] = new char[args[i].size() + 1];
+    std::strcpy(argv[i+1], args[i].c_str());
+  }
+  argv[args.size() + 1] = NULL;
+
+  char** evp;
+  evp = new char*[env.size() + 1];
+  unsigned int i = 0;
+  for(StringList::const_iterator it = env.begin(); it != env.end(); ++it) {
+    evp[i] = new char[it->size() + 1];
+    std::strcpy(evp[i], it->c_str());
+    ++i;
+  }
+  evp[env.size()] = NULL;
+  
+  execve(script.c_str(), argv, evp);
+      // if execve returns, an error occurred, but logging doesn't work 
+      // because we closed all file descriptors, so just write errno to
+      // pipe and call exit
+  int err = errno;
+  int ret = write(pipefd[1], (void*)(&err), sizeof(err));
+  if(ret != sizeof(errno))
+    exit(-2);
+  exit(-1);
+}
+
+void waitForScript(std::string const& script, pid_t pid, int pipefd)
+{
+  int status = 0;
+  waitpid(pid, &status, 0);
+
+  fd_set rfds;
+  FD_ZERO(&rfds);
+  FD_SET(pipefd, &rfds);
+  struct timeval tv = { 0 , 0 };
+  if(select(pipefd+1, &rfds, NULL, NULL, &tv) == 1) {
+    int err = 0;
+    if(read(pipefd, (void*)(&err), sizeof(err)) >= static_cast<int>(sizeof(err))) {
+      cLog.msg(Log::PRIO_NOTICE) << "script '" << script << "' exec() error: " << AnytunErrno(err);
+      close(pipefd);
+      return;
+    }
+  }
+  if(WIFEXITED(status))
+    cLog.msg(Log::PRIO_NOTICE) << "script '" << script << "' returned " << WEXITSTATUS(status);  
+  else if(WIFSIGNALED(status))
+    cLog.msg(Log::PRIO_NOTICE) << "script '" << script << "' terminated after signal " << WTERMSIG(status);
+  else
+    cLog.msg(Log::PRIO_ERROR) << "executing script '" << script << "': unkown error";
+
+  close(pipefd);
+}
diff --git a/src/sysExec.h b/src/sysExec.h
new file mode 100644 (file)
index 0000000..e608472
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+ *  anytun
+ *
+ *  The secure anycast tunneling protocol (satp) defines a protocol used
+ *  for communication between any combination of unicast and anycast
+ *  tunnel endpoints.  It has less protocol overhead than IPSec in Tunnel
+ *  mode and allows tunneling of every ETHER TYPE protocol (e.g.
+ *  ethernet, ip, arp ...). satp directly includes cryptography and
+ *  message authentication based on the methodes used by SRTP.  It is
+ *  intended to deliver a generic, scaleable and secure solution for
+ *  tunneling and relaying of packets of any protocol.
+ *
+ *
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
+ *                          Christian Pointner <satp@wirdorange.org>
+ *
+ *  This file is part of Anytun.
+ *
+ *  Anytun is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
+ *
+ *  Anytun is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with anytun.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef ANYTUN_sysExec_h_INCLUDED
+#define ANYTUN_sysExec_h_INCLUDED
+
+#ifndef NO_EXEC
+
+#include <vector>
+#include <list>
+#include <string>
+
+typedef std::vector<std::string> StringVector;
+typedef std::list<std::string> StringList;
+
+void anytun_exec(std::string const& script);
+void anytun_exec(std::string const& script, StringVector const& args);
+void anytun_exec(std::string const& script, StringList const& env);
+void anytun_exec(std::string const& script, StringVector const& args, StringList const& env);
+void waitForScript(std::string const& script, pid_t pid, int pipefd);
+
+#endif
+#endif
diff --git a/src/sysexec.hpp b/src/sysexec.hpp
deleted file mode 100644 (file)
index 90bde90..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- *  anytun
- *
- *  The secure anycast tunneling protocol (satp) defines a protocol used
- *  for communication between any combination of unicast and anycast
- *  tunnel endpoints.  It has less protocol overhead than IPSec in Tunnel
- *  mode and allows tunneling of every ETHER TYPE protocol (e.g.
- *  ethernet, ip, arp ...). satp directly includes cryptography and
- *  message authentication based on the methodes used by SRTP.  It is
- *  intended to deliver a generic, scaleable and secure solution for
- *  tunneling and relaying of packets of any protocol.
- *
- *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
- *                          Christian Pointner <satp@wirdorange.org>
- *
- *  This file is part of Anytun.
- *
- *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
- *
- *  Anytun is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with anytun.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef _SYSEXEC_HPP
-#define _SYSEXEC_HPP
-#ifndef NO_EXEC
-
-int execScript(std::string const& script, std::string const& ifname, std::string const& ifnode)
-{
-  pid_t pid;
-  pid = fork();
-  if(!pid) {
-    int fd;
-    for (fd=getdtablesize();fd>=0;--fd) // close all file descriptors
-      close(fd);
-
-    fd = open("/dev/null",O_RDWR);        // stdin
-    if(fd == -1)
-      cLog.msg(Log::PRIO_WARNING) << "can't open stdin";
-    else {
-      if(dup(fd) == -1)   // stdout
-        cLog.msg(Log::PRIO_WARNING) << "can't open stdout";
-      if(dup(fd) == -1)   // stderr
-        cLog.msg(Log::PRIO_WARNING) << "can't open stderr";
-    }
-    execl("/bin/sh", "/bin/sh", script.c_str(), ifname.c_str(), ifnode.c_str(), (char*)NULL);
-        // if execl return, an error occurred
-    cLog.msg(Log::PRIO_ERROR) << "error on executing script: " << AnytunErrno(errno);
-    return -1;
-  }
-  int status = 0;
-  waitpid(pid, &status, 0);
-  if(WIFEXITED(status))
-    cLog.msg(Log::PRIO_NOTICE) << "script '" << script << "' returned " << WEXITSTATUS(status);  
-  else if(WIFSIGNALED(status))
-    cLog.msg(Log::PRIO_NOTICE) << "script '" << script << "' terminated after signal " << WTERMSIG(status);
-  else
-    cLog.msg(Log::PRIO_ERROR) << "executing script: unkown error";
-
-  return status;
-}
-
-
-#endif
-#endif
-
index 85500c1..7e33302 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  *  You should have received a copy of the GNU General Public License
  *  along with anytun.  If not, see <http://www.gnu.org/licenses/>.
  */
+#ifndef ANYTUN_threadUtils_hpp_INCLUDED
+#define ANYTUN_threadUtils_hpp_INCLUDED
+
 #include <boost/thread.hpp>
 #include <boost/thread/mutex.hpp>
 #include <boost/thread/shared_mutex.hpp>
+#include <boost/thread/condition.hpp>
+
 #include "datatypes.h"
-#ifndef __THREADUTILS__
-#define __THREADUTILS__
+
 typedef boost::mutex::scoped_lock Lock;
 typedef boost::mutex Mutex;
 
index f37016d..e00751f 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -29,8 +30,8 @@
  *  along with anytun.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef _TUNDEVICE_H_
-#define _TUNDEVICE_H_
+#ifndef ANYTUN_tunDevice_h_INCLUDED
+#define ANYTUN_tunDevice_h_INCLUDED
 
 #include "buffer.h"
 #include "deviceConfig.hpp"
diff --git a/src/win32/#winService.cpp# b/src/win32/#winService.cpp#
deleted file mode 100644 (file)
index 5406c2d..0000000
+++ /dev/null
@@ -1,212 +0,0 @@
-/*
- *  anytun
- *
- *  The secure anycast tunneling protocol (satp) defines a protocol used
- *  for communication between any combination of unicast and anycast
- *  tunnel endpoints.  It has less protocol overhead than IPSec in Tunnel
- *  mode and allows tunneling of every ETHER TYPE protocol (e.g.
- *  ethernet, ip, arp ...). satp directly includes cryptography and
- *  message authentication based on the methodes used by SRTP.  It is
- *  intended to deliver a generic, scaleable and secure solution for
- *  tunneling and relaying of packets of any protocol.
- *
- *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
- *                          Christian Pointner <satp@wirdorange.org>
- *
- *  This file is part of Anytun.
- *
- *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
- *
- *  Anytun is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with anytun.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifdef WIN_SERVICE
-
-#include <iostream>
-
-#include <windows.h>
-
-#include "winService.h"
-#include "../log.h"
-#include "../anytunError.h"
-#include "../threadUtils.hpp"
-
-WinService* WinService::inst = NULL;
-Mutex WinService::instMutex;
-WinService& gWinService = WinService::instance();
-
-WinService& WinService::instance()
-{
-       Lock lock(instMutex);
-       static instanceCleaner c;
-       if(!inst)
-               inst = new WinService();
-       
-       return *inst;
-}
-
-WinService::~WinService()
-{
-  if(started_)
-    CloseHandle(stop_event_);
-}
-
-void WinService::install()
-{
-  SC_HANDLE schSCManager;
-  SC_HANDLE schService;
-  char szPath[MAX_PATH];
-
-  if(!GetModuleFileNameA(NULL, szPath, MAX_PATH))
-    AnytunError::throwErr() << "Error on GetModuleFileName: " << AnytunErrno(GetLastError());
-
-  schSCManager = OpenSCManagerA(NULL, NULL, SC_MANAGER_ALL_ACCESS);
-  if(NULL == schSCManager)
-    AnytunError::throwErr() << "Error on OpenSCManager: " << AnytunErrno(GetLastError());
-
-  schService = CreateServiceA(schSCManager, SVC_NAME, SVC_NAME, SERVICE_ALL_ACCESS, SERVICE_WIN32_OWN_PROCESS, 
-                              SERVICE_DEMAND_START, SERVICE_ERROR_NORMAL, szPath, NULL, NULL, NULL, NULL, NULL);
-  if(schService == NULL) {
-    CloseServiceHandle(schSCManager);
-    AnytunError::throwErr() << "Error on CreateService: " << AnytunErrno(GetLastError());
-  }
-
-  std::cout << "Service installed successfully" << std::endl; 
-
-  CloseServiceHandle(schService); 
-  CloseServiceHandle(schSCManager);
-}
-
-void WinService::uninstall()
-{
-  SC_HANDLE schSCManager;
-  SC_HANDLE schService;
-
-  schSCManager = OpenSCManagerA(NULL, NULL, SC_MANAGER_ALL_ACCESS);
-  if(NULL == schSCManager)
-    AnytunError::throwErr() << "Error on OpenSCManager: " << AnytunErrno(GetLastError());
-
-  schService = OpenServiceA(schSCManager, SVC_NAME, SERVICE_ALL_ACCESS);
-  if(schService == NULL) {
-    CloseServiceHandle(schSCManager);
-    AnytunError::throwErr() << "Error on CreateService: " << AnytunErrno(GetLastError());
-  }
-
-  if(!DeleteService(schService)) {
-    CloseServiceHandle(schService); 
-    CloseServiceHandle(schSCManager);
-    AnytunError::throwErr() << "Error on DeleteService: " << AnytunErrno(GetLastError());
-  }
-
-  std::cout << "Service uninstalled successfully" << std::endl; 
-
-  CloseServiceHandle(schService); 
-  CloseServiceHandle(schSCManager);
-}
-
-void WinService::start()
-{
-  SERVICE_TABLE_ENTRY DispatchTable[] = {
-    {SVC_NAME, (LPSERVICE_MAIN_FUNCTION)WinService::main },
-    {NULL, NULL}
-  };
-
-  if(!StartServiceCtrlDispatcherA(DispatchTable))
-    AnytunError::throwErr() << "Error on StartServiceCtrlDispatcher: " << AnytunErrno(GetLastError());
-}
-
-void WinService::waitForStop()
-{
-  if(!started_)
-    AnytunError::throwErr() << "Service not started correctly";
-  
-  reportStatus(SERVICE_RUNNING, NO_ERROR);
-  WaitForSingleObject(stop_event_, INFINITE);
-  reportStatus(SERVICE_STOP_PENDING, NO_ERROR);
-  cLog.msg(Log::PRIO_NOTICE) << "WinService received stop signal, exitting";
-}
-
-void WinService::stop()
-{
-  if(!started_)
-    AnytunError::throwErr() << "Service not started correctly";
-
-  reportStatus(SERVICE_STOPPED, NO_ERROR);
-}
-
-int real_main(int argc, char* argv[]);
-
-VOID WINAPI WinService::main(DWORD dwArgc, LPTSTR *lpszArgv)
-{
-  if(gWinService.started_) {
-    cLog.msg(Log::PRIO_ERROR) << "Service is already running";
-    return;
-  }
-
-  gWinService.status_handle_ = RegisterServiceCtrlHandlerA(SVC_NAME, WinService::ctrlHandler);
-  if(!gWinService.status_handle_) { 
-    cLog.msg(Log::PRIO_ERROR) << "Error on RegisterServiceCtrlHandler: " << AnytunErrno(GetLastError());
-    return;
-  }
-  gWinService.status_.dwServiceType = SERVICE_WIN32_OWN_PROCESS; 
-  gWinService.status_.dwServiceSpecificExitCode = 0;    
-  gWinService.reportStatus(SERVICE_START_PENDING, NO_ERROR);
-  gWinService.started_ = true;
-  
-  gWinService.stop_event_ = CreateEvent(NULL, true, false, NULL);
-  if(!gWinService.stop_event_) {
-    cLog.msg(Log::PRIO_ERROR) << "WinService Error on CreateEvent: " << AnytunErrno(GetLastError());
-    gWinService.reportStatus(SERVICE_STOPPED, -1);
-    return;
-  }
-
-  real_main(dwArgc, lpszArgv);
-}
-
-VOID WINAPI WinService::ctrlHandler(DWORD dwCtrl)
-{
-  switch(dwCtrl) {
-    case SERVICE_CONTROL_STOP: {
-      gWinService.reportStatus(SERVICE_STOP_PENDING, NO_ERROR);
-      SetEvent(gWinService.stop_event_);
-      return;
-    }
-    case SERVICE_CONTROL_INTERROGATE: break;
-    default: break;
-  }
-  gWinService.reportStatus(gWinService.status_.dwCurrentState, NO_ERROR);
-}
-
-void WinService::reportStatus(DWORD dwCurrentState, DWORD dwWin32ExitCode, DWORD dwWaitHint)
-{
-  static DWORD dwCheckPoint = 1;
-
-  status_.dwCurrentState = dwCurrentState;
-  status_.dwWin32ExitCode = dwWin32ExitCode;
-  status_.dwWaitHint = dwWaitHint;
-
-  if((dwCurrentState == SERVICE_START_PENDING) ||
-     (dwCurrentState == SERVICE_STOP_PENDING))
-    status_.dwControlsAccepted = 0;
-  else 
-    status_.dwControlsAccepted = SERVICE_ACCEPT_STOP;
-
-  if((dwCurrentState == SERVICE_RUNNING) ||
-     (dwCurrentState == SERVICE_STOPPED))
-    status_.dwCheckPoint = 0;
-  else
-    status_.dwCheckPoint = dwCheckPoint++;
-
-  SetServiceStatus(status_handle_, &status_);
-}
-
-#endif
index 3c183c2..eaab2a6 100644 (file)
@@ -25,6 +25,8 @@
  *  distribution); if not, write to the Free Software Foundation, Inc.,
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
+#ifndef ANYTUN_win32_common_h_INCLUDED
+#define ANYTUN_win32_common_h_INCLUDED
 
 //===============================================
 // This file is included both by OpenVPN and
@@ -79,4 +81,6 @@
 // simultaneously.
 //=========================================================
 
-#define TAP_COMPONENT_ID "tap0801"
+#define TAP_COMPONENT_ID "tap0901"
+
+#endif
index a6858e9..a9a0959 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
index ce79d47..6aceba0 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -28,6 +29,8 @@
  *  You should have received a copy of the GNU General Public License
  *  along with anytun.  If not, see <http://www.gnu.org/licenses/>.
  */
+#ifndef ANYTUN_win32_registryKey_h_INCLUDED
+#define ANYTUN_win32_registryKey_h_INCLUDED
 
 #include <string.h>
 #include <windows.h>
@@ -54,4 +57,6 @@ private:
   HKEY key_;
   bool opened_;
   std::string name_;
-};
\ No newline at end of file
+};
+
+#endif
index 1087092..fe6ab44 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
index b6ea67f..1b7c9f8 100644 (file)
  *  tunneling and relaying of packets of any protocol.\r
  *\r
  *\r
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, \r
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, \r
  *                          Christian Pointner <satp@wirdorange.org>\r
  *\r
  *  This file is part of Anytun.\r
  *\r
  *  Anytun is free software: you can redistribute it and/or modify\r
- *  it under the terms of the GNU General Public License version 3 as\r
- *  published by the Free Software Foundation.\r
+ *  it under the terms of the GNU General Public License as published by\r
+ *  the Free Software Foundation, either version 3 of the License, or\r
+ *  any later version.\r
  *\r
  *  Anytun is distributed in the hope that it will be useful,\r
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
index 53c2750..6867c7c 100644 (file)
  *  tunneling and relaying of packets of any protocol.
  *
  *
- *  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+ *  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
  *                          Christian Pointner <satp@wirdorange.org>
  *
  *  This file is part of Anytun.
  *
  *  Anytun is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 3 as
- *  published by the Free Software Foundation.
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  any later version.
  *
  *  Anytun is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -29,8 +30,8 @@
  *  along with anytun.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef _WIN_SERVICE_H_
-#define _WIN_SERVICE_H_
+#ifndef ANYTUN_win32_winService_h_INCLUDED
+#define ANYTUN_win32_winService_h_INCLUDED
 
 #ifdef WIN_SERVICE
 
@@ -78,4 +79,4 @@ extern WinService& gWinService;
 
 #endif
 
-#endif
\ No newline at end of file
+#endif
diff --git a/version b/version
new file mode 100644 (file)
index 0000000..9fc80f9
--- /dev/null
+++ b/version
@@ -0,0 +1 @@
+0.3.2
\ No newline at end of file
index dcf4cdf..20ece82 100644 (file)
 --  tunneling and relaying of packets of any protocol.
 --
 --
---  Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl, 
+--  Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl, 
 --                          Christian Pointner <satp@wirdorange.org>
 --
 --  This file is part of Anytun.
 --
 --  Anytun is free software: you can redistribute it and/or modify
---  it under the terms of the GNU General Public License version 3 as
---  published by the Free Software Foundation.
+--  it under the terms of the GNU General Public License as published by
+--  the Free Software Foundation, either version 3 of the License, or
+--  any later version.
 --
 --  Anytun is distributed in the hope that it will be useful,
 --  but WITHOUT ANY WARRANTY; without even the implied warranty of