summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFRIGN <dev@frign.de>2014-12-23 23:17:21 +0100
committersin <sin@2f30.org>2014-12-25 10:49:04 +0000
commit318a23146680384cd2012c1dd4151bdcb2f4f430 (patch)
tree5cf8c0d9530e9f5d48dc5c161d8746c6e9c66148
parentbd272e9943127ed846c9496bee2469d247a7fe18 (diff)
Add ipv6-, tcp- and proxy-mode to config.def.h
There's no reason to prevent the user from setting this stuff at compile time.
-rw-r--r--config.def.h11
-rw-r--r--ratox.c17
2 files changed, 14 insertions, 14 deletions
diff --git a/config.def.h b/config.def.h
index 2de95d2..9dd605b 100644
--- a/config.def.h
+++ b/config.def.h
@@ -9,11 +9,14 @@
/* Maximum number of simultaneous calls */
#define MAXCALLS 8
-static char *savefile = ".ratox.tox";
-static int encryptsavefile = 0;
+static char *savefile = ".ratox.tox";
+static int encryptsavefile = 0;
-static char proxyaddr[] = "localhost";
-static uint16_t proxyport = 8080;
+static int ipv6 = 0;
+static int tcp = 0;
+static int proxy = 0;
+static char proxyaddr[] = "localhost";
+static uint16_t proxyport = 8080;
static struct node nodes[] = {
{
diff --git a/ratox.c b/ratox.c
index 35ca4f0..7149ad9 100644
--- a/ratox.c
+++ b/ratox.c
@@ -173,10 +173,6 @@ static ToxAv *toxav;
static ToxAvCSettings toxavconfig;
static int framesize;
-static int ipv6;
-static int tcpflag;
-static int proxyflag;
-
static uint8_t *passphrase;
static uint32_t pplen;
@@ -1187,10 +1183,10 @@ static int
toxinit(void)
{
toxopt.ipv6enabled = ipv6;
- toxopt.udp_disabled = tcpflag;
- if (proxyflag) {
- tcpflag = 1;
- toxopt.udp_disabled = tcpflag;
+ toxopt.udp_disabled = tcp;
+ if (proxy) {
+ tcp = 1;
+ toxopt.udp_disabled = tcp;
logmsg("Net > Forcing TCP mode\n");
snprintf(toxopt.proxy_address, sizeof(toxopt.proxy_address),
"%s", proxyaddr);
@@ -1961,6 +1957,7 @@ main(int argc, char *argv[])
{
ARGBEGIN {
case '4':
+ ipv6 = 0;
break;
case '6':
ipv6 = 1;
@@ -1972,10 +1969,10 @@ main(int argc, char *argv[])
encryptsavefile = 0;
break;
case 't':
- tcpflag = 1;
+ tcp = 1;
break;
case 'p':
- proxyflag = 1;
+ proxy = 1;
break;
default:
usage();