Compare commits

..

8 Commits

Author SHA1 Message Date
angt
6f36424d12 Code cleanup 2016-04-26 06:18:12 +00:00
angt
fa9301da16 Show tun_name in all states and fix state_send() 2016-04-26 06:13:14 +00:00
angt
c154a00358 Use a bigger timeout when buffers are empty 2016-04-12 14:11:16 +00:00
Adrien Gallouët
4246b510d2 Never trust frank :) 2016-03-30 15:41:53 +02:00
Adrien Gallouët
c71db48ae1 Add a nice geek logo for glorytun 2016-03-23 17:44:40 +01:00
Adrien Gallouët
e3cce8aeb9 AES-NI is no longer mandatory 2016-03-18 21:19:24 +01:00
angt
ad0d205ff3 Add option chacha20
Chacha20 will be automatically used if aesni is not available.
2016-03-18 14:43:30 +00:00
angt
030087cb27 Add mptcp option 2016-02-25 14:38:51 +00:00
10 changed files with 1225 additions and 283 deletions

View File

@@ -1,15 +0,0 @@
#!/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
View File

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

View File

@@ -20,11 +20,6 @@ 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 VPN over [mud](https://github.com/angt/mud). Small, Simple and Stupid TCP VPN.
#### Work In Progress #### Work In Progress
@@ -8,12 +8,11 @@ This code will probably format your harddisk!
#### Build and Install #### Build and Install
Glorytun depends on [libsodium](https://github.com/jedisct1/libsodium) version >= 1.0.4 Glorytun depends on [libsodium](https://github.com/jedisct1/libsodium) version >= 1.0.4.
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 --recursive --branch mud $ git clone https://github.com/angt/glorytun
$ cd glorytun $ cd glorytun
$ ./autogen.sh $ ./autogen.sh
$ ./configure $ ./configure

View File

@@ -14,9 +14,8 @@ 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 mud deleted from d255074199

View File

@@ -4,7 +4,6 @@
struct ip_common { struct ip_common {
uint8_t version; uint8_t version;
uint8_t tc;
uint8_t proto; uint8_t proto;
uint8_t hdr_size; uint8_t hdr_size;
uint16_t size; uint16_t size;
@@ -25,13 +24,11 @@ static inline int ip_get_common (struct ip_common *ic, const uint8_t *data, size
switch (ic->version) { switch (ic->version) {
case 4: case 4:
ic->tc = data[1];
ic->proto = data[9]; ic->proto = data[9];
ic->hdr_size = (data[0]&0xF)<<2; ic->hdr_size = (data[0]&0xF)<<2;
ic->size = ((data[2]<<8)|data[3]); ic->size = ((data[2]<<8)|data[3]);
return 0; return 0;
case 6: case 6:
ic->tc = ((data[0]&0xF)<<4)|(data[1]>>4);
ic->proto = data[6]; ic->proto = data[6];
ic->hdr_size = 40; ic->hdr_size = 40;
ic->size = ((data[4]<<8)|data[5])+40; ic->size = ((data[4]<<8)|data[5])+40;

1442
src/main.c

File diff suppressed because it is too large Load Diff

View File

@@ -240,25 +240,3 @@ ssize_t tun_write (int fd, const void *data, size_t size)
return ret; return ret;
#endif #endif
} }
int tun_set_mtu (char *dev_name, int mtu)
{
struct ifreq ifr = {
.ifr_mtu = mtu,
};
str_cpy(ifr.ifr_name, dev_name, IFNAMSIZ-1);
int fd = socket(AF_INET, SOCK_DGRAM, 0);
if (fd==-1)
return -1;
int ret = ioctl(fd, SIOCSIFMTU, &ifr);
int err = errno;
close(fd);
errno = err;
return ret;
}

View File

@@ -2,7 +2,6 @@
#include <unistd.h> #include <unistd.h>
int tun_create (char *, char **, int); int tun_create (char *, char **, int);
ssize_t tun_read (int, void *, size_t); ssize_t tun_read (int, void *, size_t);
ssize_t tun_write (int, const void *, size_t); ssize_t tun_write (int, const void *, size_t);
int tun_set_mtu (char *, int);