From e3f8e33112e2191999c6d6f6b6a767c72db800a0 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Mon, 14 Dec 2009 02:45:46 +0100 Subject: [PATCH 1/1] Imported Upstream version 0.3.2 --- ChangeLog | 13 ++ LICENSE | 5 +- README | 59 +++++- doc/Makefile | 15 +- doc/uanytun.8.txt | 505 +++++++++++++++++++-------------------------- etc/uanytun/client1/config | 4 +- etc/uanytun/client2/config | 4 +- etc/uanytun/client3/config | 4 +- etc/uanytun/p2p-a/config | 4 +- etc/uanytun/p2p-b/config | 4 +- src/Makefile | 140 ++++++++----- src/auth_algo.c | 5 +- src/auth_algo.h | 9 +- src/bsd/tun.c | 32 ++- src/cipher.c | 5 +- src/cipher.h | 9 +- src/configure | 100 +++++++-- src/daemon.h | 9 +- src/datatypes.h | 9 +- src/encrypted_packet.c | 5 +- src/encrypted_packet.h | 9 +- src/key_derivation.c | 5 +- src/key_derivation.h | 9 +- src/linux/tun.c | 22 +- src/log.c | 7 +- src/log.h | 9 +- src/log_targets.h | 37 +++- src/options.c | 9 +- src/options.h | 9 +- src/plain_packet.c | 5 +- src/plain_packet.h | 9 +- src/seq_window.c | 5 +- src/seq_window.h | 9 +- src/sig_handler.c | 133 ++++++++++-- src/sig_handler.h | 18 +- src/string_list.c | 9 +- src/string_list.h | 9 +- src/sysexec.c | 115 +++++++++++ src/sysexec.h | 48 +---- src/tun.h | 9 +- src/tun_helper.h | 9 +- src/uanytun.c | 47 +++-- src/udp.c | 5 +- src/udp.h | 9 +- version | 1 + 45 files changed, 903 insertions(+), 593 deletions(-) create mode 100644 src/sysexec.c create mode 100644 version diff --git a/ChangeLog b/ChangeLog index 2034049..edeb953 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2009.12.02 -- Version 0.3.2 + +* clenaups and improvements at configure and install target of Makefile +* manpage cleanups +* moved to new svn location + +2009.11.08 -- Version 0.3.1 + +* switched to GPLv3 or higher +* improved script execution +* added signal handling without races +* all log_targets print time now too + 2009.05.01 -- Version 0.3 * updated to new protocol specification (extended label and crypto role) diff --git a/LICENSE b/LICENSE index 72582db..1406bb5 100644 --- a/LICENSE +++ b/LICENSE @@ -20,8 +20,9 @@ * This file is part of uAnytun. * * uAnytun 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. * * uAnytun is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/README b/README index a5bc7ee..00a88bc 100644 --- a/README +++ b/README @@ -5,6 +5,7 @@ uAnytun can be built by using either libgcrypt or the openssl-crypto library. The latter is more performant in most cases but there are some license issues when using this library. It also needs more space when installed. + Linux ----- @@ -18,19 +19,31 @@ using ssl crypto library: build-essential libssl-dev +only for manpage: + + asciidoc + OpenBSD/FreeBSD --------------- using libgcrypt: - gmake - libgcrypt - libgpg-error + devel/gmake + security/libgcrypt using ssl crypto library: - gmake + devel/gmake + +only for manpage: + + textproc/asciidoc + textproc/libxslt + textproc/docbook-xsl + sysutils/readlink + misc/getopt + Installation @@ -38,7 +51,10 @@ Installation Getting the source via subversion: ---------------------------------- -svn co https://svn.chaos-at-home.org/uanytun/trunk uanytun + +svn co https://svn.anytun.org/uanytun/trunk uanytun +cd uanytun + Building from source -------------------- @@ -55,7 +71,6 @@ using ssl crypto library: # ./configure --use-ssl-crypto # make - Notes: - try './configure --help' for further information - if using openssl pre 0.9.8 you have to disable passphrase @@ -70,8 +85,7 @@ Installing # sudo make install This will install anytun under the --prefix defined with configure. -It also creates a user with name --username with home --userhome -which can be changed by configure as well. + Uninstalling ------------ @@ -82,5 +96,30 @@ This removes everytthing except for the config files # sudo make purge -This also removes the config files and deletes the user and it's -home directory. +This also removes the config files + + + +Usage: +====== + +init.d script +------------- + +The init.d script can be used to start uanytun at boot time. It searches for +configuration files which reside at $CONFIG_DIR. For each instance of uanytun +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. +This is an example of how the init.d script can be used to start uanytun: + +# /etc/init.d/uanytun start client1 p2p-a + +In this case the script will start 2 instances of uanytun 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. diff --git a/doc/Makefile b/doc/Makefile index f49deda..97db23e 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -20,8 +20,9 @@ ## This file is part of uAnytun. ## ## uAnytun 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. ## ## uAnytun is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -32,10 +33,18 @@ ## along with uAnytun. If not, see . ## +VERSION=$(shell cat ../version) + +.PHONY: clean + all: manpage uanytun.8: uanytun.8.txt - a2x -f manpage uanytun.8.txt + a2x -f manpage $< + @ sed -i -e 's/\[FIXME: source\]/uanytun ${VERSION}/' $@ + @ sed -i -e 's/\[FIXME: manual\]/uanytun user manual/' $@ + @ sed -i -e 's/^uanytun$$/\\fBuanytun\\fR/' $@ + @ sed -i -e 's/^ \[ \([^ ]*\)/ [ \\fB\1\\fR/' $@ manpage: uanytun.8 diff --git a/doc/uanytun.8.txt b/doc/uanytun.8.txt index 311c54a..1ed21ca 100644 --- a/doc/uanytun.8.txt +++ b/doc/uanytun.8.txt @@ -3,40 +3,45 @@ uanytun(8) NAME ---- + uanytun - micro anycast tunneling daemon + SYNOPSIS -------- -*uanytun* -[ *-h|--help* ] -[ *-D|--nodaemonize* ] -[ *-u|--username* ] -[ *-g|--groupname* ] -[ *-C|--chroot* ] -[ *-P|--write-pid* ] -[ *-L|--log* :[,[,[..]]] ] -[ *-i|--interface* ] -[ *-p|--port* ] -[ *-r|--remote-host* ] -[ *-o|--remote-port* ] -[ *-4|--ipv4-only* ] -[ *-6|--ipv6-only* ] -[ *-d|--dev* ] -[ *-t|--type* ] -[ *-n|--ifconfig* / ] -[ *-x|--post-up-script*