+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)
* added manpages for all binaries
* switched to GPLv3
-
2008.4.12 -- Version 0.2svn490
* updated to Internet Draft Revision 02
* 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
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
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
--------------------
- 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:
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
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
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
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
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
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
DESC=anytun
CONFIG_DIR=/etc/anytun
VARCONFIG_DIR=/var/run/anytun-controld
+VARRUN_DIR=/var/run/anytun
test -x $DAEMON || exit 0
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"
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"
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"
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"
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"
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"
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"
## 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
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)
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)
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/*
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/
## 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
* 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
{
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);
}
* 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
* 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
* 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
* 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
* 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
* 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
* 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
* 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
* 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
* 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
* 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
* 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
* 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
* 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
* 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
* 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
* 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
* 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
* 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
* 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"
#include "cryptinit.hpp"
#include "daemon.hpp"
-#include "sysexec.hpp"
+#include "sysExec.h"
bool disableRouting = false;
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
#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
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
<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 "C:\Program Files\boost\boost_1_35_0\""\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 "C:\Program Files\boost\boost_1_35_0\""\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
* 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
* 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_ERROR_H
-#define _ANYTUN_ERROR_H
+#ifndef ANYTUN_anytunError_h_INCLUDED
+#define ANYTUN_anytunError_h_INCLUDED
#include <sstream>
#include <boost/system/system_error.hpp>
* 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
* 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 _AUTHALGO_H_
-#define _AUTHALGO_H_
+#ifndef ANYTUN_authAlgo_h_INCLUDED
+#define ANYTUN_authAlgo_h_INCLUDED
#include "datatypes.h"
#include "buffer.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
* 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 _AUTHALGO_FACTORY_H_
-#define _AUTHALGO_FACTORY_H_
+#ifndef ANYTUN_authAlgoFactory_h_INCLUDED
+#define ANYTUN_authAlgoFactory_h_INCLUDED
#include <string>
* 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 <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;
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);
}
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)
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);
}
* 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
* 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 _BUFFER_H_
-#define _BUFFER_H_
+#ifndef ANYTUN_buffer_h_INCLUDED
+#define ANYTUN_buffer_h_INCLUDED
#include "datatypes.h"
#include <string>
* 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
* 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 _CIPHER_H_
-#define _CIPHER_H_
+#ifndef ANYTUN_cipher_h_INCLUDED
+#define ANYTUN_cipher_h_INCLUDED
#include "datatypes.h"
#include "buffer.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
* 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 _CIPHER_FACTORY_H_
-#define _CIPHER_FACTORY_H_
+#ifndef ANYTUN_cipherFactory_h_INCLUDED
+#define ANYTUN_cipherFactory_h_INCLUDED
#include <string>
# 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)
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
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
* 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
* 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 _CONNECTION_LIST_H
-#define _CONNECTION_LIST_H
+#ifndef ANYTUN_connectionList_h_INCLUDED
+#define ANYTUN_connectionList_h_INCLUDED
#include <map>
#include <deque>
* 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
* 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 _CONNECTIONPARAM_H_
-#define _CONNECTIONPARAM_H_
+#ifndef ANYTUN_connectionParam_h_INCLUDED
+#define ANYTUN_connectionParam_h_INCLUDED
#include "keyDerivation.h"
#include "seqWindow.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
* 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
#endif
#endif
-
* 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 _DAEMON_HPP
-#define _DAEMON_HPP
+#ifndef ANYTUN_daemon_hpp_INCLUDED
+#define ANYTUN_daemon_hpp_INCLUDED
#ifndef NO_DAEMON
#include <poll.h>
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;
}
#endif
#endif
-
* 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 _DATATYPES_H_
-#define _DATATYPES_H_
+#ifndef ANYTUN_datatypes_h_INCLUDED
+#define ANYTUN_datatypes_h_INCLUDED
#include <boost/cstdint.hpp>
#include <boost/integer_traits.hpp>
* 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 _DEVICE_CONFIG_HPP_
-#define _DEVICE_CONFIG_HPP_
+#ifndef ANYTUN_deviceConfig_hpp_INCLUDED
+#define ANYTUN_deviceConfig_hpp_INCLUDED
#include "networkAddress.h"
#include <boost/asio.hpp>
* 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
* 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 _ENCRYPTED_PACKET_H_
-#define _ENCRYPTED_PACKET_H_
+#ifndef ANYTUN_encryptedPacket_h_INCLUDED
+#define ANYTUN_encryptedPacket_h_INCLUDED
#include "datatypes.h"
#include "buffer.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
* 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>
* 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
#include <iostream>
#include <sstream>
#include <string>
+#include <cstring>
#ifndef NO_CRYPT
#ifndef NO_PASSPHRASE
#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)
#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
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);
* 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 _KEYDERIVATION_H_
-#define _KEYDERIVATION_H_
+#ifndef ANYTUN_keyDerivation_h_INCLUDED
+#define ANYTUN_keyDerivation_h_INCLUDED
#include "datatypes.h"
#include "buffer.h"
#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
#endif
#endif
-
* 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
* 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 _KEYDERIVATION_FACTORY_H_
-#define _KEYDERIVATION_FACTORY_H_
+#ifndef ANYTUN_keyDerivationFactory_h_INCLUDED
+#define ANYTUN_keyDerivationFactory_h_INCLUDED
#include <string>
* 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
#include <string.h>
#include <sstream>
+#include <boost/assign.hpp>
#include <fcntl.h>
#include <sys/ioctl.h>
#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)
{
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);
}
* 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
* 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 _LOG_H_
-#define _LOG_H_
+#ifndef ANYTUN_log_h_INCLUDED
+#define ANYTUN_log_h_INCLUDED
#include <string>
#include <sstream>
* 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
#include <strsafe.h>
#endif
+#include <boost/date_time/posix_time/posix_time.hpp>
+
LogTarget::LogTarget() : opened(false), enabled(false), max_prio(Log::PRIO_NOTICE)
{
}
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)
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
* 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 _LOG_TARGETS_H_
-#define _LOG_TARGETS_H_
+#ifndef ANYTUN_logTargets_h_INCLUDED
+#define ANYTUN_logTargets_h_INCLUDED
#include <string>
#include <map>
## 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)
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
*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
--------
--------------------------------------------------------------------------------------
-
-
BUGS
----
Most likely there are some bugs in *anyrtpproxy*. If you find a bug, please let
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
---------
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.
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
-----------
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
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
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
---------
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.
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
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
---------
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.
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
-------
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
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
---------
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.
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.
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
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
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
---------
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.
* 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
* 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>
* 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
* 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_PREFIX_H
-#define _NETWORK_PREFIX_H
+#ifndef ANYTUN_networkPrefix_h_INCLUDED
+#define ANYTUN_networkPrefix_h_INCLUDED
#include "threadUtils.hpp"
#include "datatypes.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
* 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 _OPTIONS_H_
-#define _OPTIONS_H_
+#ifndef ANYTUN_options_h_INCLUDED
+#define ANYTUN_options_h_INCLUDED
#include "datatypes.h"
#include "buffer.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
* 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 _PACKET_SOURCE_H_
-#define _PACKET_SOURCE_H_
+#ifndef ANYTUN_packetSource_h_INCLUDED
+#define ANYTUN_packetSource_h_INCLUDED
#include <boost/asio.hpp>
* 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
* 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 _PLAIN_PACKET_H_
-#define _PLAIN_PACKET_H_
+#ifndef ANYTUN_plainPacket_h_INCLUDED
+#define ANYTUN_plainPacket_h_INCLUDED
#include "datatypes.h"
#include "buffer.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
* 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 _RESOLVER_H_
-#define _RESOLVER_H_
+#ifndef ANYTUN_resolver_h_INCLUDED
+#define ANYTUN_resolver_h_INCLUDED
#include <queue>
#include <boost/asio.hpp>
* 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
* 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 _ROUTINGTABLE_H
-#define _ROUTINGTABLE_H
+#ifndef ANYTUN_routingTable_h_INCLUDED
+#define ANYTUN_routingTable_h_INCLUDED
#include <map>
#include <deque>
* 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 __ROUTING_TREE_
-#define __ROUTING_TREE_
+#ifndef ANYTUN_routingTree_hpp_INCLUDED
+#define ANYTUN_routingTree_hpp_INCLUDED
#include "anytunError.h"
};
#endif
-
-
* 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
* 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 _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"
* 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
#include "threadUtils.hpp"
#include "datatypes.h"
-
+#include <cstring>
#include "seqWindow.h"
SeqWindowElement::SeqWindowElement()
* 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 _SEQ_WINDOW_H_
-#define _SEQ_WINDOW_H_
+#ifndef ANYTUN_seqWindow_h_INCLUDED
+#define ANYTUN_seqWindow_h_INCLUDED
#include <map>
#include <deque>
* 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
{
for(HandlerMap::iterator it = handler.begin(); it != handler.end(); ++it)
delete it->second;
-
-#ifndef _MSC_VER
- if(thread) delete thread;
-#endif
}
#ifndef _MSC_VER
#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;
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;
}
* 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 _SIGNAL_CONTROLLER_H_
-#define _SIGNAL_CONTROLLER_H_
+#ifndef ANYTUN_signalController_h_INCLUDED
+#define ANYTUN_signalController_h_INCLUDED
#include <map>
#include <queue>
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);
Mutex sigQueueMutex;
Semaphore sigQueueSem;
-#ifndef _MSC_VER
- boost::thread* thread;
-#endif
HandlerMap handler;
};
* 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
* 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 _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>
* 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
* 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 _SYNCCLIENT_H
-#define _SYNCCLIENT_H
+#ifndef ANYTUN_syncClient_h_INCLUDED
+#define ANYTUN_syncClient_h_INCLUDED
#include <string>
#include "syncTcpConnection.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
* 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 _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>
};
-#endif // _SYNCCOMMAND_H
+#endif
* 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
* 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 _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>
};
-#endif // _SYNCCOMMAND_H
+#endif
* 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
}
}
+#endif
* 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
* 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_QUEUE_H
-#define _SYNC_QUEUE_H
+#ifndef ANYTUN_syncQueue_h_INCLUDED
+#define ANYTUN_syncQueue_h_INCLUDED
#include <deque>
#include <queue>
* 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
* 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 _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>
};
-#endif // _SYNCCOMMAND_H
+#endif
* 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
* 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>
ConnectCallback onConnect_;
Semaphore ready_sem_;
};
+
#endif
* 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
* 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_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>
size_t /*bytes_transferred*/);
proto::socket socket_;
};
+
#endif
--- /dev/null
+/*
+ * 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);
+}
--- /dev/null
+/*
+ * 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
+++ /dev/null
-/*
- * 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
-
* 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;
* 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 _TUNDEVICE_H_
-#define _TUNDEVICE_H_
+#ifndef ANYTUN_tunDevice_h_INCLUDED
+#define ANYTUN_tunDevice_h_INCLUDED
#include "buffer.h"
#include "deviceConfig.hpp"
+++ /dev/null
-/*
- * 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
* 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
// simultaneously.
//=========================================================
-#define TAP_COMPONENT_ID "tap0801"
+#define TAP_COMPONENT_ID "tap0901"
+
+#endif
* 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
* 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_win32_registryKey_h_INCLUDED
+#define ANYTUN_win32_registryKey_h_INCLUDED
#include <string.h>
#include <windows.h>
HKEY key_;
bool opened_;
std::string name_;
-};
\ No newline at end of file
+};
+
+#endif
* 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
* 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
* 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 _WIN_SERVICE_H_
-#define _WIN_SERVICE_H_
+#ifndef ANYTUN_win32_winService_h_INCLUDED
+#define ANYTUN_win32_winService_h_INCLUDED
#ifdef WIN_SERVICE
#endif
-#endif
\ No newline at end of file
+#endif
--- /dev/null
+0.3.2
\ No newline at end of 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