|
@ -138,6 +138,7 @@ static void exithelp(void) |
|
|
" * multiple binds are supported. each bind-addr, bind-iface* start new bind\n" |
|
|
" * multiple binds are supported. each bind-addr, bind-iface* start new bind\n" |
|
|
" --port=<port>\t\t\t\t; only one port number for all binds is supported\n" |
|
|
" --port=<port>\t\t\t\t; only one port number for all binds is supported\n" |
|
|
" --socks\t\t\t\t; implement socks4/5 proxy instead of transparent proxy\n" |
|
|
" --socks\t\t\t\t; implement socks4/5 proxy instead of transparent proxy\n" |
|
|
|
|
|
" --connect-bind-addr=<v4_addr>|<v6_addr> ; address for outbound connections\n" |
|
|
" --no-resolve\t\t\t\t; disable socks5 remote dns ability\n" |
|
|
" --no-resolve\t\t\t\t; disable socks5 remote dns ability\n" |
|
|
" --resolver-threads=<int>\t\t; number of resolver worker threads\n" |
|
|
" --resolver-threads=<int>\t\t; number of resolver worker threads\n" |
|
|
" --local-rcvbuf=<bytes>\n" |
|
|
" --local-rcvbuf=<bytes>\n" |
|
@ -355,13 +356,14 @@ void parse_params(int argc, char *argv[]) |
|
|
{ "skip-nodelay",no_argument,0,0 },// optidx=51
|
|
|
{ "skip-nodelay",no_argument,0,0 },// optidx=51
|
|
|
{ "tamper-start",required_argument,0,0 },// optidx=52
|
|
|
{ "tamper-start",required_argument,0,0 },// optidx=52
|
|
|
{ "tamper-cutoff",required_argument,0,0 },// optidx=53
|
|
|
{ "tamper-cutoff",required_argument,0,0 },// optidx=53
|
|
|
|
|
|
{ "connect-bind-addr",required_argument,0,0 },// optidx=54
|
|
|
#if defined(BSD) && !defined(__OpenBSD__) && !defined(__APPLE__) |
|
|
#if defined(BSD) && !defined(__OpenBSD__) && !defined(__APPLE__) |
|
|
{ "enable-pf",no_argument,0,0 },// optidx=54
|
|
|
{ "enable-pf",no_argument,0,0 },// optidx=55
|
|
|
#elif defined(__linux__) |
|
|
#elif defined(__linux__) |
|
|
{ "mss",required_argument,0,0 },// optidx=54
|
|
|
{ "mss",required_argument,0,0 },// optidx=55
|
|
|
{ "mss-pf",required_argument,0,0 },// optidx=55
|
|
|
{ "mss-pf",required_argument,0,0 },// optidx=56
|
|
|
#ifdef SPLICE_PRESENT |
|
|
#ifdef SPLICE_PRESENT |
|
|
{ "nosplice",no_argument,0,0 },// optidx=55
|
|
|
{ "nosplice",no_argument,0,0 },// optidx=57
|
|
|
#endif |
|
|
#endif |
|
|
#endif |
|
|
#endif |
|
|
{ "hostlist-auto-retrans-threshold",optional_argument,0,0}, // ignored. for nfqws command line compatibility
|
|
|
{ "hostlist-auto-retrans-threshold",optional_argument,0,0}, // ignored. for nfqws command line compatibility
|
|
@ -784,12 +786,29 @@ void parse_params(int argc, char *argv[]) |
|
|
params.tamper_cutoff = atoi(p); |
|
|
params.tamper_cutoff = atoi(p); |
|
|
} |
|
|
} |
|
|
break; |
|
|
break; |
|
|
|
|
|
case 54: /* connect-bind-addr */ |
|
|
|
|
|
{ |
|
|
|
|
|
if (inet_pton(AF_INET, optarg, ¶ms.connect_bind4.sin_addr)) |
|
|
|
|
|
{ |
|
|
|
|
|
params.connect_bind4.sin_family = AF_INET; |
|
|
|
|
|
} |
|
|
|
|
|
else if (inet_pton(AF_INET6, optarg, ¶ms.connect_bind6.sin6_addr)) |
|
|
|
|
|
{ |
|
|
|
|
|
params.connect_bind6.sin6_family = AF_INET6; |
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
fprintf(stderr, "bad bind addr : %s\n", optarg); |
|
|
|
|
|
exit_clean(1); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
break; |
|
|
#if defined(BSD) && !defined(__OpenBSD__) && !defined(__APPLE__) |
|
|
#if defined(BSD) && !defined(__OpenBSD__) && !defined(__APPLE__) |
|
|
case 54: /* enable-pf */ |
|
|
case 55: /* enable-pf */ |
|
|
params.pf_enable = true; |
|
|
params.pf_enable = true; |
|
|
break; |
|
|
break; |
|
|
#elif defined(__linux__) |
|
|
#elif defined(__linux__) |
|
|
case 54: /* mss */ |
|
|
case 55: /* mss */ |
|
|
// this option does not work in any BSD and MacOS. OS may accept but it changes nothing
|
|
|
// this option does not work in any BSD and MacOS. OS may accept but it changes nothing
|
|
|
params.mss = atoi(optarg); |
|
|
params.mss = atoi(optarg); |
|
|
if (params.mss<88 || params.mss>32767) |
|
|
if (params.mss<88 || params.mss>32767) |
|
@ -798,7 +817,7 @@ void parse_params(int argc, char *argv[]) |
|
|
exit_clean(1); |
|
|
exit_clean(1); |
|
|
} |
|
|
} |
|
|
break; |
|
|
break; |
|
|
case 55: /* mss-pf */ |
|
|
case 56: /* mss-pf */ |
|
|
if (!pf_parse(optarg,¶ms.mss_pf)) |
|
|
if (!pf_parse(optarg,¶ms.mss_pf)) |
|
|
{ |
|
|
{ |
|
|
fprintf(stderr, "Invalid MSS port filter.\n"); |
|
|
fprintf(stderr, "Invalid MSS port filter.\n"); |
|
@ -806,7 +825,7 @@ void parse_params(int argc, char *argv[]) |
|
|
} |
|
|
} |
|
|
break; |
|
|
break; |
|
|
#ifdef SPLICE_PRESENT |
|
|
#ifdef SPLICE_PRESENT |
|
|
case 56: /* nosplice */ |
|
|
case 57: /* nosplice */ |
|
|
params.nosplice = true; |
|
|
params.nosplice = true; |
|
|
break; |
|
|
break; |
|
|
#endif |
|
|
#endif |
|
|