summaryrefslogtreecommitdiff
path: root/net-vpn/vtun/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /net-vpn/vtun/files
reinit the tree, so we can have metadata
Diffstat (limited to 'net-vpn/vtun/files')
-rw-r--r--net-vpn/vtun/files/vtun-3.0.2-remove-config-presence-check.patch13
-rw-r--r--net-vpn/vtun/files/vtun-3.0.3-gcc5.patch13
-rw-r--r--net-vpn/vtun/files/vtun-3.0.3-includes.patch62
-rw-r--r--net-vpn/vtun/files/vtun.rc32
-rw-r--r--net-vpn/vtun/files/vtund-start.conf33
5 files changed, 153 insertions, 0 deletions
diff --git a/net-vpn/vtun/files/vtun-3.0.2-remove-config-presence-check.patch b/net-vpn/vtun/files/vtun-3.0.2-remove-config-presence-check.patch
new file mode 100644
index 000000000000..15b3bf273c34
--- /dev/null
+++ b/net-vpn/vtun/files/vtun-3.0.2-remove-config-presence-check.patch
@@ -0,0 +1,13 @@
+--- Makefile.in.orig 2012-06-11 23:31:11.416075337 +0400
++++ Makefile.in 2012-06-11 23:31:21.247324839 +0400
+@@ -86,9 +86,7 @@
+
+ install_config:
+ $(INSTALL) -d -m 755 $(INSTALL_OWNER) $(DESTDIR)$(ETC_DIR)
+- if [ ! -f $(ETC_DIR)/vtund.conf ]; then \
+- $(INSTALL) -m 600 $(INSTALL_OWNER) vtund.conf $(DESTDIR)$(ETC_DIR); \
+- fi
++ $(INSTALL) -m 600 $(INSTALL_OWNER) vtund.conf $(DESTDIR)$(ETC_DIR); \
+
+ install: vtund install_config install_man
+ $(INSTALL) -d -m 755 $(INSTALL_OWNER) $(DESTDIR)$(VAR_DIR)/run
diff --git a/net-vpn/vtun/files/vtun-3.0.3-gcc5.patch b/net-vpn/vtun/files/vtun-3.0.3-gcc5.patch
new file mode 100644
index 000000000000..99c6531d7268
--- /dev/null
+++ b/net-vpn/vtun/files/vtun-3.0.3-gcc5.patch
@@ -0,0 +1,13 @@
+Index: vtun-3.0.3/cfg_file.y
+===================================================================
+--- vtun-3.0.3.orig/cfg_file.y
++++ vtun-3.0.3/cfg_file.y
+@@ -624,7 +624,7 @@ int clear_nat_hack_client(void *d, void
+ }
+
+ /* Clear the VTUN_NAT_HACK flag which are not relevant to the current operation mode */
+-inline void clear_nat_hack_flags(int svr)
++extern inline void clear_nat_hack_flags(int svr)
+ {
+ if (svr)
+ llist_trav(&host_list,clear_nat_hack_server,NULL);
diff --git a/net-vpn/vtun/files/vtun-3.0.3-includes.patch b/net-vpn/vtun/files/vtun-3.0.3-includes.patch
new file mode 100644
index 000000000000..cd7cf6a2a2ee
--- /dev/null
+++ b/net-vpn/vtun/files/vtun-3.0.3-includes.patch
@@ -0,0 +1,62 @@
+--- a/lfd_encrypt.c 2008-01-07 23:35:32.000000000 +0100
++++ b/lfd_encrypt.c 2010-09-18 04:53:31.000000000 +0200
+@@ -44,6 +44,7 @@
+ #include <strings.h>
+ #include <string.h>
+ #include <time.h>
++#include <arpa/inet.h> /* htonl() */
+
+ #include "vtun.h"
+ #include "linkfd.h"
+--- a/lib.c 2008-01-07 23:35:40.000000000 +0100
++++ b/lib.c 2010-09-18 04:52:51.000000000 +0200
+@@ -34,6 +34,7 @@
+ #include <sys/wait.h>
+ #include <syslog.h>
+ #include <errno.h>
++#include <time.h> /* nanosleep() */
+
+ #include "vtun.h"
+ #include "linkfd.h"
+--- a/lib.h 2008-01-07 23:35:41.000000000 +0100
++++ b/lib.h 2010-09-18 04:56:50.000000000 +0200
+@@ -26,6 +26,7 @@
+ #include <sys/types.h>
+ #include <signal.h>
+ #include <errno.h>
++#include <unistd.h> /* read(), write() */
+
+ #ifdef HAVE_LIBUTIL_H
+ #include <libutil.h>
+--- a/vtun.h 2008-01-07 23:36:07.000000000 +0100
++++ b/vtun.h 2010-09-18 04:56:08.000000000 +0200
+@@ -232,5 +232,9 @@
+ int read_config(char *file);
+ struct vtun_host * find_host(char *host);
+ inline void clear_nat_hack_flags(int svr);
++int send_msg(int len, char *in, char **out);
++int send_ib_mesg(int *len, char **in);
++int recv_msg(int len, char *in, char **out);
++int recv_ib_mesg(int *len, char **in);
+
+ #endif
+--- a/lock.c 2008-01-07 23:35:50.000000000 +0100
++++ b/lock.c 2010-09-18 05:01:21.000000000 +0200
+@@ -32,6 +32,7 @@
+ #include <sys/types.h>
+ #include <signal.h>
+ #include <errno.h>
++#include <time.h> /* nanosleep() */
+
+ #include "vtun.h"
+ #include "linkfd.h"
+--- a/lfd_shaper.c 2008-01-07 23:35:36.000000000 +0100
++++ b/lfd_shaper.c 2010-09-18 05:07:12.000000000 +0200
+@@ -27,6 +27,7 @@
+ #include <stdlib.h>
+ #include <sys/time.h>
+ #include <syslog.h>
++#include <time.h> /* nanosleep() */
+
+ #include "vtun.h"
+ #include "linkfd.h"
diff --git a/net-vpn/vtun/files/vtun.rc b/net-vpn/vtun/files/vtun.rc
new file mode 100644
index 000000000000..7ef322985043
--- /dev/null
+++ b/net-vpn/vtun/files/vtun.rc
@@ -0,0 +1,32 @@
+#!/sbin/openrc-run
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+depend() {
+ need net
+}
+
+start() {
+ IFS=$'\n'
+ for line in `grep -v '^[[:space:]]*#' /etc/vtund-start.conf | grep -v '^[[:space:]]*$'`
+ do
+ echo $line |
+ (IFS=" "
+ read host server args
+ if [ "$host" = "--server--" ]; then
+ ebegin "Starting vtund server"
+ /usr/sbin/vtund -s -P $server $args
+ eend $?
+ else
+ ebegin "Starting vtund client $host to $server"
+ /usr/sbin/vtund $args -- $host $server
+ eend $?
+ fi)
+ done
+}
+
+stop() {
+ ebegin "Stopping all vtund servers and clients"
+ killall vtund
+ eend $?
+}
diff --git a/net-vpn/vtun/files/vtund-start.conf b/net-vpn/vtun/files/vtund-start.conf
new file mode 100644
index 000000000000..01de38322f48
--- /dev/null
+++ b/net-vpn/vtun/files/vtund-start.conf
@@ -0,0 +1,33 @@
+### this file defines whether vtund is run as a client or a server
+###
+### format is "[host] [server] <args>" or "--server-- [portnumber] <args>".
+###
+### [host] is the hostname to use as a client
+###
+### [server] is the server to connect to
+###
+### [args] is optional for both server and client and contains any additional
+### command line args for that instance of vtund. not needed by most people.
+###
+### --server-- is the literal string '--server--'. nothing more, nothing less.
+###
+### [portnumber] is the port number to run the server on.
+###
+###
+### you can have more than one client "host server" line if required,
+### and in theory, it should be possible to run as both a client and a
+### server simultaneously, but i haven't tested that.
+
+
+### examples:
+
+### to run as a client using hostname 'viper'.
+#viper vtun-server.somewhere.com.au
+
+### to run a persistent client connection using hostname 'viper'
+### connecting to a server on port 6000 and using /etc/vtun.viper.conf
+### as the config file.
+#viper vtun-server.somewhere.com.au -f /etc/vtun.viper.conf -s -P 6000
+
+### to run vtund as a server on port 5000, uncomment the following line:
+#--server-- 5000