Compare commits
5 Commits
v0.0.30-mu
...
v0.0.33-mu
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
64a5fd8227 | ||
|
|
eba968797c | ||
|
|
d60f28a7fe | ||
|
|
32069eb104 | ||
|
|
a6adcefc25 |
2
mud
2
mud
Submodule mud updated: a1ba274fbf...ecec237a56
51
src/main.c
51
src/main.c
@@ -242,17 +242,26 @@ int main (int argc, char **argv)
|
||||
|
||||
gt.timeout = 5000;
|
||||
|
||||
long down_timeout = 0;
|
||||
long send_timeout = 0;
|
||||
long pong_timeout = 0;
|
||||
long time_tolerance = 0;
|
||||
|
||||
struct option opts[] = {
|
||||
{ "host", &host, option_str },
|
||||
{ "port", &port, option_str },
|
||||
{ "bind", &bind_list, option_str },
|
||||
{ "bind-port", &bind_port, option_str },
|
||||
{ "dev", &dev, option_str },
|
||||
{ "keyfile", &keyfile, option_str },
|
||||
{ "multiqueue", NULL, option_option },
|
||||
{ "statefile", &statefile, option_str },
|
||||
{ "timeout", >.timeout, option_long },
|
||||
{ "version", NULL, option_option },
|
||||
{ "host", &host, option_str },
|
||||
{ "port", &port, option_str },
|
||||
{ "bind", &bind_list, option_str },
|
||||
{ "bind-port", &bind_port, option_str },
|
||||
{ "dev", &dev, option_str },
|
||||
{ "keyfile", &keyfile, option_str },
|
||||
{ "multiqueue", NULL, option_option },
|
||||
{ "statefile", &statefile, option_str },
|
||||
{ "timeout", >.timeout, option_long },
|
||||
{ "down-timeout", &down_timeout, option_long },
|
||||
{ "send-timeout", &send_timeout, option_long },
|
||||
{ "pong-timeout", &pong_timeout, option_long },
|
||||
{ "time-tolerance", &time_tolerance, option_long },
|
||||
{ "version", NULL, option_option },
|
||||
{ NULL },
|
||||
};
|
||||
|
||||
@@ -305,6 +314,18 @@ 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 (pong_timeout > 0)
|
||||
mud_set_pong_timeout_msec(mud, pong_timeout);
|
||||
|
||||
if (time_tolerance > 0)
|
||||
mud_set_time_tolerance_sec(mud, time_tolerance);
|
||||
|
||||
if (bind_list) {
|
||||
char tmp[1024];
|
||||
char *name = &tmp[0];
|
||||
@@ -362,12 +383,14 @@ 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);
|
||||
started = 0;
|
||||
} else {
|
||||
if (started) {
|
||||
state("STOPPED", tun_name);
|
||||
started = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (FD_ISSET(tun_fd, &rfds)) {
|
||||
|
||||
Reference in New Issue
Block a user