From 8094722a717c708f7e8b684b3fd45612f8649b5d Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sun, 28 Dec 2008 13:15:53 +0000 Subject: added options parser --- src/uanytun.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/uanytun.c') diff --git a/src/uanytun.c b/src/uanytun.c index c302764..68df6b6 100644 --- a/src/uanytun.c +++ b/src/uanytun.c @@ -40,6 +40,8 @@ #include "log.h" #include "signal.h" +#include "options.h" + #include "tun.h" #include "udp.h" @@ -111,6 +113,13 @@ int main(int argc, char* argv[]) log_init("uanytun", DAEMON); signal_init(); + options_t* opt; + int ret = options_parse(&opt, argc, argv); + if(ret) + exit(ret); + + options_print(opt); + // chrootAndDrop("/var/run/", "nobody"); // daemonize(); // log_printf(INFO, "running in background now"); @@ -144,6 +153,7 @@ int main(int argc, char* argv[]) /* tun_close(&dev); */ /* udp_close(&sock); */ + options_clear(&opt); return 0; } -- cgit v1.2.3