aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar zfl9 <zfl9.com@gmail.com> 2020-03-04 20:41:06 +0800
committerGravatar zfl9 <zfl9.com@gmail.com> 2020-03-04 20:41:06 +0800
commit35323902c6dacfb1949505a1bec01509fa3de832 (patch)
tree9eeaed0d819c2f3528fe27c46d03ee54ca3702f3
parentuse libev instead of libuv (diff)
downloaddns2tcp-35323902c6dacfb1949505a1bec01509fa3de832.tar.gz
dns2tcp-35323902c6dacfb1949505a1bec01509fa3de832.tar.bz2
dns2tcp-35323902c6dacfb1949505a1bec01509fa3de832.zip
use libev instead of libuv
-rw-r--r--dnsudp2tcp.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/dnsudp2tcp.c b/dnsudp2tcp.c
index 85491bf..d64cbec 100644
--- a/dnsudp2tcp.c
+++ b/dnsudp2tcp.c
@@ -255,3 +255,21 @@ PRINT_HELP_AND_EXIT:
print_command_help();
exit(1);
}
+
+int main(int argc, char *argv[]) {
+ signal(SIGPIPE, SIG_IGN);
+ setvbuf(stdout, NULL, _IOLBF, 256);
+ parse_command_args(argc, argv);
+
+ LOGINF("[main] udp listen addr: %s#%hu", g_listen_ipstr, g_listen_portno);
+ LOGINF("[main] tcp remote addr: %s#%hu", g_remote_ipstr, g_remote_portno);
+ if (g_syn_maxcnt) LOGINF("[main] enable TCP_SYNCNT:%hhu feature", g_syn_maxcnt);
+ if (g_options & OPT_REUSE_PORT) LOGINF("[main] enable SO_REUSEPORT feature");
+ if (g_options & OPT_QUICK_ACK) LOGINF("[main] enable TCP_QUICKACK feature");
+ if (g_options & OPT_FAST_OPEN) LOGINF("[main] enable TCP_FASTOPEN feature");
+ IF_VERBOSE LOGINF("[main] verbose mode, affect performance");
+
+ // TODO
+
+ return 0;
+}