Compare commits

...

56 Commits

Author SHA1 Message Date
Adrien Gallouët
b13501b9fb Update mud 2016-07-19 16:53:53 +00:00
Adrien Gallouët
3363e219a7 Update mud 2016-07-15 18:45:36 +00:00
Adrien Gallouët
00ee23b0b6 Allow IPv4 and IPv6 only on Linux 2016-07-15 18:42:28 +00:00
Adrien Gallouët
1286b0f69e Update mud 2016-07-15 17:35:45 +00:00
Adrien Gallouët
fe5bc5454e Add chacha20 option and AES-NI negotiation 2016-07-12 17:01:41 +00:00
Adrien Gallouët
f4e94a9089 Remove -flto for now 2016-07-11 10:24:47 +00:00
Adrien Gallouët
6a7da371e2 Add .build.sh 2016-07-11 09:34:16 +00:00
Adrien Gallouët
4cf5f7a118 Update mud 2016-07-07 14:39:19 +00:00
Adrien Gallouët
35fd01f9ee Update mud 2016-07-06 13:42:30 +00:00
Adrien Gallouët
04aad57789 Update mud 2016-07-05 15:41:32 +00:00
Adrien Gallouët
7a277a8810 Update configure.ac 2016-06-30 09:52:34 +00:00
Adrien Gallouët
b232a101d2 Update mud 2016-06-30 09:41:32 +00:00
Adrien Gallouët
a01dc81500 Don't wait too long when we have data to send 2016-06-27 11:19:16 +00:00
Adrien Gallouët
1db628d84a Update mud 2016-06-24 13:21:02 +00:00
Adrien Gallouët
f11cd34dc4 Update mud 2016-06-22 17:55:18 +00:00
Adrien Gallouët
d0376e3aa5 Update mud 2016-06-22 09:18:34 +00:00
Adrien Gallouët
a7518c0e5a Update mud 2016-06-21 16:51:24 +00:00
Adrien Gallouët
378316bd68 Add mtu option 2016-06-13 15:43:45 +00:00
angt
286d6abf2d Update mud 2016-05-10 10:46:15 +00:00
angt
1f1464e90d Update mud 2016-05-09 14:23:17 +00:00
angt
55d9dd9277 Update mud 2016-05-02 09:18:44 +00:00
angt
2f290dbf85 Update mud and merge from master 2016-04-26 06:54:30 +00:00
angt
39e3f53139 Add v{4,6}only option 2016-04-25 16:29:20 +00:00
angt
babe14d544 Quit on tun error 2016-04-25 10:24:42 +00:00
angt
278fc69789 Update mud 2016-04-21 15:35:35 +00:00
angt
99262777fc Update mud 2016-04-17 10:16:13 +00:00
angt
b0f60caab2 Update mud 2016-04-14 20:12:45 +00:00
angt
efd5e0bb36 Remove down-timeout and use timeout for send-timeout 2016-04-08 14:38:07 +00:00
angt
ade4617d53 Update mud 2016-04-08 13:00:52 +00:00
angt
64a5fd8227 Update mud 2016-04-05 14:23:45 +00:00
angt
eba968797c Add {down,send,pong}-timeout and time-tolerance option 2016-04-05 14:17:07 +00:00
angt
d60f28a7fe Update mud 2016-04-05 06:42:03 +00:00
angt
32069eb104 Print tun device on STARTED and STOPPED too 2016-04-04 20:05:33 +00:00
angt
a6adcefc25 Update mud 2016-04-04 16:48:11 +00:00
angt
743b0ee0da Don't check AES-NI 2016-04-01 16:50:04 +00:00
angt
ba06a6fc10 Update mud 2016-04-01 16:37:02 +00:00
Adrien Gallouët
80d4c2814f Update README.md 2016-03-24 18:52:18 +01:00
angt
b0d5007bfb Restore STARTED and STOPPED states 2016-03-24 14:45:15 +00:00
angt
d2046eb00b Revert "Add branch name in version"
This reverts commit 03cd87df1c.
2016-03-09 11:42:51 +00:00
angt
d04acc9c0f Update mud 2016-03-09 10:59:52 +00:00
angt
03cd87df1c Add branch name in version 2016-03-09 10:20:01 +00:00
angt
8e8ad7178d Update mud 2016-03-04 11:32:42 +00:00
angt
0e26b4def7 Update mud 2016-03-04 11:20:15 +00:00
angt
f800985766 Update mud 2016-03-04 11:01:43 +00:00
angt
7b88c28a45 Update mud 2016-03-03 10:49:28 +00:00
angt
194dfe17d3 Update mud 2016-03-02 12:59:33 +00:00
angt
664160e0cc Add bind-port option 2016-03-01 15:11:16 +00:00
angt
1dd760e382 Code cleanup 2016-03-01 08:13:05 +00:00
angt
05219b81f7 Update README.md 2016-02-29 16:14:08 +00:00
angt
0bb7e4f1d0 Update mud 2016-02-29 15:35:57 +00:00
angt
a7fbf806fb Use a list to setup mud_bind() 2016-02-29 15:28:37 +00:00
angt
e750c46665 Update mud 2016-02-25 15:22:47 +00:00
angt
935111cfea Fix Makefile.am 2016-02-04 11:31:02 +01:00
angt
c4b2512df4 Add .gitmodules 2016-02-04 10:44:53 +01:00
angt
27970e24fb Import and use mud 2016-02-04 10:39:36 +01:00
angt
acc3ee3461 Encrypt only one packet at a time 2016-01-26 12:18:00 +01:00
9 changed files with 240 additions and 1209 deletions

15
.build.sh Executable file
View File

@@ -0,0 +1,15 @@
#!/bin/sh
export CC="gcc -static"
git clone https://github.com/jedisct1/libsodium --depth=1 --branch stable
cd libsodium || exit 1
./autogen.sh && ./configure --enable-minimal --disable-shared --prefix=/usr && make install
cd ..
./autogen.sh && ./configure && make
[ -x glorytun ] || exit 1
mkdir -p deploy
strip -s glorytun
mv glorytun deploy/glorytun-$(cat VERSION)-$(uname -m).bin

3
.gitmodules vendored Normal file
View File

@@ -0,0 +1,3 @@
[submodule "mud"]
path = mud
url = https://github.com/angt/mud.git

View File

@@ -20,6 +20,11 @@ glorytun_SOURCES = \
src/state.c \ src/state.c \
src/state.h src/state.h
glorytun_CFLAGS += -I$(srcdir)/mud
glorytun_SOURCES += \
mud/mud.h \
mud/mud.c
EXTRA_DIST = \ EXTRA_DIST = \
LICENSE \ LICENSE \
README.md \ README.md \

View File

@@ -1,6 +1,6 @@
# Glorytun # π₁(Glorytun)=ℤ²
Small, Simple and Stupid TCP VPN. Small, Simple and Stupid VPN over [mud](https://github.com/angt/mud).
#### Work In Progress #### Work In Progress
@@ -13,7 +13,7 @@ and needs an AES-NI capable CPU.
To build and install the latest version: To build and install the latest version:
$ git clone https://github.com/angt/glorytun $ git clone https://github.com/angt/glorytun --recursive --branch mud
$ cd glorytun $ cd glorytun
$ ./autogen.sh $ ./autogen.sh
$ ./configure $ ./configure

View File

@@ -14,8 +14,9 @@ AM_SILENT_RULES([yes])
AM_PROG_CC_C_O AM_PROG_CC_C_O
AC_PROG_CC_C99 AC_PROG_CC_C99
AC_USE_SYSTEM_EXTENSIONS AC_USE_SYSTEM_EXTENSIONS
AC_SEARCH_LIBS([getaddrinfo], [resolv nsl])
AC_SEARCH_LIBS([socket], [socket]) AC_SEARCH_LIBS([socket], [socket])
AC_CHECK_LIB([rt], [clock_gettime])
AC_CHECK_FUNCS([clock_gettime])
PKG_CHECK_MODULES([libsodium], [libsodium >= 1.0.4]) PKG_CHECK_MODULES([libsodium], [libsodium >= 1.0.4])
AC_CONFIG_FILES([Makefile]) AC_CONFIG_FILES([Makefile])
AC_OUTPUT AC_OUTPUT

1
mud Submodule

Submodule mud added at c1b13488af

1371
src/main.c

File diff suppressed because it is too large Load Diff

View File

@@ -7,16 +7,14 @@
#include <fcntl.h> #include <fcntl.h>
#include <sys/stat.h> #include <sys/stat.h>
static int state_fd = -1; int state_create (const char *filename)
int state_init (const char *filename)
{ {
if (str_empty(filename)) if (str_empty(filename))
return 0; return -1;
state_fd = open(filename, O_WRONLY); int fd = open(filename, O_WRONLY);
if (state_fd==-1) { if (fd==-1) {
if (errno!=EINTR) if (errno!=EINTR)
perror("open"); perror("open");
return -1; return -1;
@@ -24,38 +22,41 @@ int state_init (const char *filename)
struct stat st = {0}; struct stat st = {0};
if (fstat(state_fd, &st)==-1) { if (fstat(fd, &st)==-1) {
perror("fstat"); perror("fstat");
close(state_fd); close(fd);
state_fd = -1;
return -1; return -1;
} }
if (!S_ISFIFO(st.st_mode)) { if (!S_ISFIFO(st.st_mode)) {
gt_log("`%s' is not a fifo\n", filename); gt_log("`%s' is not a fifo\n", filename);
close(state_fd); close(fd);
state_fd = -1;
return -1; return -1;
} }
return 0; return fd;
} }
void state (const char *state, const char *info) void state_send (int fd, const char *state, const char *info)
{ {
if (str_empty(state)) if (str_empty(state))
return; return;
if (fd==-1) {
gt_print("%s %s\n", state, info);
return;
}
const char *strs[] = { state, " ", info, "\n" }; const char *strs[] = { state, " ", info, "\n" };
char *str = str_cat(strs, COUNT(strs)); char *str = str_cat(strs, COUNT(strs));
if (!str) if (!str) {
perror("str_cat");
return; return;
if (state_fd==-1) {
gt_print("%s", str);
} else {
if (write(state_fd, str, str_len(str))==-1 && errno!=EINTR)
perror("write");
} }
if (write(fd, str, str_len(str))==-1 && errno!=EINTR)
perror("write");
free(str);
} }

View File

@@ -1,4 +1,4 @@
#pragma once #pragma once
int state_init (const char *); int state_create (const char *);
void state (const char *, const char *); void state_send (int, const char *, const char *);