From 9290ff8baa69f9afe77503a2c3694b1059b9d9aa Mon Sep 17 00:00:00 2001 From: sin Date: Tue, 23 Sep 2014 13:20:41 +0100 Subject: Add TCP mode --- ratox.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'ratox.c') diff --git a/ratox.c b/ratox.c index 32e6f60..aa4773a 100644 --- a/ratox.c +++ b/ratox.c @@ -757,6 +757,7 @@ static int toxinit(void) { toxopt.ipv6enabled = ipv6; + toxopt.udp_disabled = tcpenabled; tox = tox_new(&toxopt); dataload(); datasave(); @@ -1246,7 +1247,10 @@ shutdown(void) static void usage(void) { - fprintf(stderr, "usage: %s [-4|-6]\n", argv0); + fprintf(stderr, "usage: %s [-4|-6] [-t]\n", argv0); + fprintf(stderr, " -4\tIPv4 only\n"); + fprintf(stderr, " -6\tIPv6 only\n"); + fprintf(stderr, " -t\tEnable TCP mode (UDP by default)\n"); exit(EXIT_FAILURE); } @@ -1259,6 +1263,9 @@ main(int argc, char *argv[]) case '6': ipv6 = 1; break; + case 't': + tcpenabled = 1; + break; default: usage(); } ARGEND; -- cgit v1.2.3