mirror of
https://github.com/yarrick/iodine.git
synced 2024-11-21 22:41:26 +00:00
Formatting: Indent multi-line prints less
This commit is contained in:
parent
4b3d6e2962
commit
cc51ee6f02
58
src/iodine.c
58
src/iodine.c
|
@ -70,38 +70,40 @@ static inline void help(FILE * stream, bool verbose) __attribute__((noreturn));
|
||||||
|
|
||||||
static void help(FILE *stream, bool verbose)
|
static void help(FILE *stream, bool verbose)
|
||||||
{
|
{
|
||||||
fprintf(stream, "iodine IP over DNS tunneling client\n\n"
|
fprintf(stream,
|
||||||
"Usage: %s [-46fhrv] [-u user] [-t chrootdir] [-d device] [-P password]\n"
|
"iodine IP over DNS tunneling client\n\n"
|
||||||
" [-m maxfragsize] [-M maxlen] [-T type] [-O enc] [-L 0|1] [-I sec]\n"
|
"Usage: %s [-46fhrv] [-u user] [-t chrootdir] [-d device] [-P password]\n"
|
||||||
" [-z context] [-F pidfile] [nameserver] topdomain\n", __progname);
|
" [-m maxfragsize] [-M maxlen] [-T type] [-O enc] [-L 0|1] [-I sec]\n"
|
||||||
|
" [-z context] [-F pidfile] [nameserver] topdomain\n", __progname);
|
||||||
|
|
||||||
if (!verbose)
|
if (!verbose)
|
||||||
exit(2);
|
exit(2);
|
||||||
|
|
||||||
fprintf(stream, "\nOptions to try if connection doesn't work:\n"
|
fprintf(stream,
|
||||||
" -4 to connect only to IPv4\n"
|
"\nOptions to try if connection doesn't work:\n"
|
||||||
" -6 to connect only to IPv6\n"
|
" -4 to connect only to IPv4\n"
|
||||||
" -T force dns type: NULL, PRIVATE, TXT, SRV, MX, CNAME, A (default: autodetect)\n"
|
" -6 to connect only to IPv6\n"
|
||||||
" -O force downstream encoding for -T other than NULL: Base32, Base64, Base64u,\n"
|
" -T force dns type: NULL, PRIVATE, TXT, SRV, MX, CNAME, A (default: autodetect)\n"
|
||||||
" Base128, or (only for TXT:) Raw (default: autodetect)\n"
|
" -O force downstream encoding for -T other than NULL: Base32, Base64, Base64u,\n"
|
||||||
" -I max interval between requests (default 4 sec) to prevent DNS timeouts\n"
|
" Base128, or (only for TXT:) Raw (default: autodetect)\n"
|
||||||
" -L 1: use lazy mode for low-latency (default). 0: don't (implies -I1)\n"
|
" -I max interval between requests (default 4 sec) to prevent DNS timeouts\n"
|
||||||
" -m max size of downstream fragments (default: autodetect)\n"
|
" -L 1: use lazy mode for low-latency (default). 0: don't (implies -I1)\n"
|
||||||
" -M max size of upstream hostnames (~100-255, default: 255)\n"
|
" -m max size of downstream fragments (default: autodetect)\n"
|
||||||
" -r to skip raw UDP mode attempt\n"
|
" -M max size of upstream hostnames (~100-255, default: 255)\n"
|
||||||
" -P password used for authentication (max 32 chars will be used)\n\n"
|
" -r to skip raw UDP mode attempt\n"
|
||||||
"Other options:\n"
|
" -P password used for authentication (max 32 chars will be used)\n\n"
|
||||||
" -v to print version info and exit\n"
|
"Other options:\n"
|
||||||
" -h to print this help and exit\n"
|
" -v to print version info and exit\n"
|
||||||
" -f to keep running in foreground\n"
|
" -h to print this help and exit\n"
|
||||||
" -u name to drop privileges and run as user 'name'\n"
|
" -f to keep running in foreground\n"
|
||||||
" -t dir to chroot to directory dir\n"
|
" -u name to drop privileges and run as user 'name'\n"
|
||||||
" -d device to set tunnel device name\n"
|
" -t dir to chroot to directory dir\n"
|
||||||
" -z context, to apply specified SELinux context after initialization\n"
|
" -d device to set tunnel device name\n"
|
||||||
" -F pidfile to write pid to a file\n\n"
|
" -z context, to apply specified SELinux context after initialization\n"
|
||||||
"nameserver is the IP number/hostname of the relaying nameserver. If absent,\n"
|
" -F pidfile to write pid to a file\n\n"
|
||||||
" /etc/resolv.conf is used\n"
|
"nameserver is the IP number/hostname of the relaying nameserver. If absent,\n"
|
||||||
"topdomain is the FQDN that is delegated to the tunnel endpoint.\n");
|
" /etc/resolv.conf is used\n"
|
||||||
|
"topdomain is the FQDN that is delegated to the tunnel endpoint.\n");
|
||||||
|
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2294,11 +2294,12 @@ write_dns(int fd, struct query *q, const char *data, int datalen, char downenc)
|
||||||
|
|
||||||
static void print_usage(FILE *stream)
|
static void print_usage(FILE *stream)
|
||||||
{
|
{
|
||||||
fprintf(stream, "Usage: %s [-46cDfsv] [-u user] [-t chrootdir] [-d device] [-m mtu]\n"
|
fprintf(stream,
|
||||||
" [-z context] [-l ipv4 listen address] [-L ipv6 listen address]\n"
|
"Usage: %s [-46cDfsv] [-u user] [-t chrootdir] [-d device] [-m mtu]\n"
|
||||||
" [-p port] [-n auto|external_ip] [-b dnsport] [-P password]\n"
|
" [-z context] [-l ipv4 listen address] [-L ipv6 listen address]\n"
|
||||||
" [-F pidfile] [-i max idle time] tunnel_ip[/netmask] topdomain\n",
|
" [-p port] [-n auto|external_ip] [-b dnsport] [-P password]\n"
|
||||||
__progname);
|
" [-F pidfile] [-i max idle time] tunnel_ip[/netmask] topdomain\n",
|
||||||
|
__progname);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void usage(void)
|
static void usage(void)
|
||||||
|
@ -2311,44 +2312,46 @@ static void help(FILE *stream)
|
||||||
{
|
{
|
||||||
fprintf(stream, "iodine IP over DNS tunneling server\n\n");
|
fprintf(stream, "iodine IP over DNS tunneling server\n\n");
|
||||||
print_usage(stream);
|
print_usage(stream);
|
||||||
fprintf(stream, "\nAvailable options:\n"
|
fprintf(stream,
|
||||||
" -v to print version info and exit\n"
|
"\nAvailable options:\n"
|
||||||
" -h to print this help and exit\n"
|
" -v to print version info and exit\n"
|
||||||
" -4 to listen only on IPv4\n"
|
" -h to print this help and exit\n"
|
||||||
" -6 to listen only on IPv6\n"
|
" -4 to listen only on IPv4\n"
|
||||||
" -c to disable check of client IP/port on each request\n"
|
" -6 to listen only on IPv6\n"
|
||||||
" -s to skip creating and configuring the tun device,\n"
|
" -c to disable check of client IP/port on each request\n"
|
||||||
" which then has to be created manually\n"
|
" -s to skip creating and configuring the tun device,\n"
|
||||||
" -f to keep running in foreground\n"
|
" which then has to be created manually\n"
|
||||||
" -D to increase debug level\n"
|
" -f to keep running in foreground\n"
|
||||||
" (using -DD in UTF-8 terminal: \"LC_ALL=C luit iodined -DD ...\")\n"
|
" -D to increase debug level\n"
|
||||||
" -u name to drop privileges and run as user 'name'\n"
|
" (using -DD in UTF-8 terminal: \"LC_ALL=C luit iodined -DD ...\")\n"
|
||||||
" -t dir to chroot to directory dir\n"
|
" -u name to drop privileges and run as user 'name'\n"
|
||||||
" -d device to set tunnel device name\n"
|
" -t dir to chroot to directory dir\n"
|
||||||
" -m mtu to set tunnel device mtu\n"
|
" -d device to set tunnel device name\n"
|
||||||
" -z context to apply SELinux context after initialization\n"
|
" -m mtu to set tunnel device mtu\n"
|
||||||
" -l IPv4 address to listen on for incoming dns traffic "
|
" -z context to apply SELinux context after initialization\n"
|
||||||
"(default 0.0.0.0)\n"
|
" -l IPv4 address to listen on for incoming dns traffic "
|
||||||
" -L IPv6 address to listen on for incoming dns traffic "
|
"(default 0.0.0.0)\n"
|
||||||
"(default ::)\n"
|
" -L IPv6 address to listen on for incoming dns traffic "
|
||||||
" -p port to listen on for incoming dns traffic (default 53)\n"
|
"(default ::)\n"
|
||||||
" -n ip to respond with to NS queries\n"
|
" -p port to listen on for incoming dns traffic (default 53)\n"
|
||||||
" (Use 'auto' to look up external IP via a service)\n"
|
" -n ip to respond with to NS queries\n"
|
||||||
" -b port to forward normal DNS queries to (on localhost)\n"
|
" (Use 'auto' to look up external IP via a service)\n"
|
||||||
" -P password used for authentication (max 32 chars will be used)\n"
|
" -b port to forward normal DNS queries to (on localhost)\n"
|
||||||
" -F pidfile to write pid to a file\n"
|
" -P password used for authentication (max 32 chars will be used)\n"
|
||||||
" -i maximum idle time before shutting down\n\n"
|
" -F pidfile to write pid to a file\n"
|
||||||
"tunnel_ip is the IP number of the local tunnel interface.\n"
|
" -i maximum idle time before shutting down\n\n"
|
||||||
" /netmask sets the size of the tunnel network.\n"
|
"tunnel_ip is the IP number of the local tunnel interface.\n"
|
||||||
"topdomain is the FQDN that is delegated to this server.\n");
|
" /netmask sets the size of the tunnel network.\n"
|
||||||
|
"topdomain is the FQDN that is delegated to this server.\n");
|
||||||
|
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void version(void)
|
static void version(void)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "iodine IP over DNS tunneling server\n"
|
fprintf(stderr,
|
||||||
"Git version: %s\n", GITREVISION);
|
"iodine IP over DNS tunneling server\n"
|
||||||
|
"Git version: %s\n", GITREVISION);
|
||||||
|
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue