Compare commits

..

9 Commits

Author SHA1 Message Date
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
3 changed files with 34 additions and 21 deletions

View File

@@ -1,4 +1,4 @@
# Glorytun
# π₁(Glorytun)=ℤ²
Small, Simple and Stupid VPN over [mud](https://github.com/angt/mud).

2
mud

Submodule mud updated: 1b58401095...a05381a329

View File

@@ -242,6 +242,10 @@ int main (int argc, char **argv)
gt.timeout = 5000;
long down_timeout = 0;
long send_timeout = 0;
long time_tolerance = 0;
struct option opts[] = {
{ "host", &host, option_str },
{ "port", &port, option_str },
@@ -252,6 +256,9 @@ int main (int argc, char **argv)
{ "multiqueue", NULL, option_option },
{ "statefile", &statefile, option_str },
{ "timeout", &gt.timeout, option_long },
{ "down-timeout", &down_timeout, option_long },
{ "send-timeout", &send_timeout, option_long },
{ "time-tolerance", &time_tolerance, option_long },
{ "version", NULL, option_option },
{ NULL },
};
@@ -279,11 +286,6 @@ int main (int argc, char **argv)
return 1;
}
if (!crypto_aead_aes256gcm_is_available()) {
gt_na("AES-256-GCM");
return 1;
}
if (state_init(statefile))
return 1;
@@ -310,6 +312,15 @@ int main (int argc, char **argv)
mud_set_key(mud, gt.key, sizeof(gt.key));
if (down_timeout > 0)
mud_set_down_timeout_msec(mud, down_timeout);
if (send_timeout > 0)
mud_set_send_timeout_msec(mud, send_timeout);
if (time_tolerance > 0)
mud_set_time_tolerance_sec(mud, time_tolerance);
if (bind_list) {
char tmp[1024];
char *name = &tmp[0];
@@ -367,13 +378,15 @@ int main (int argc, char **argv)
if (mud_is_up(mud)) {
if (!started) {
state("STARTED", NULL);
state("STARTED", tun_name);
started = 1;
}
} else if (started) {
state("STOPPED", NULL);
} else {
if (started) {
state("STOPPED", tun_name);
started = 0;
}
}
if (FD_ISSET(tun_fd, &rfds)) {
while (1) {