File main.c changed (mode: 100644) (index bbbebe5..a13fc46) |
... |
... |
void do_daemonize() |
1156 |
1156 |
|
|
1157 |
1157 |
void help() |
void help() |
1158 |
1158 |
{ |
{ |
1159 |
|
fprintf(stderr, "tuntox - Forward ports over the Tox protocol\n"); |
|
1160 |
|
fprintf(stderr, "USAGE:\n\n"); |
|
1161 |
|
fprintf(stderr, "-i <toxid> - remote point Tox ID\n"); |
|
1162 |
|
fprintf(stderr, "-L <localport>:<remotehostname>:<remoteport> - forward <remotehostname>:<remoteport> to 127.0.0.1:<localport>\n"); |
|
1163 |
|
fprintf(stderr, "-P <remotehostname>:<remoteport> - forward <remotehostname>:<remoteport> to stdin/stdout (SSH ProxyCommand mode)\n"); |
|
1164 |
|
fprintf(stderr, "-p - ping the server from -i and exit\n"); |
|
1165 |
|
fprintf(stderr, "-C <dir> - save private key in <dir> instead of /etc/tuntox in server mode\n"); |
|
1166 |
|
fprintf(stderr, "-s <secret> - shared secret used for connection authentication (max %u characters)\n", TOX_MAX_FRIEND_REQUEST_LENGTH-1); |
|
1167 |
|
fprintf(stderr, "-f <file> - only allow connections to hostname/port combinations contained in <file>. Rules must be entered one per line with the <hostname>:<port> format\n"); |
|
1168 |
|
fprintf(stderr, "-d - debug mode\n"); |
|
1169 |
|
fprintf(stderr, "-q - quiet mode\n"); |
|
1170 |
|
fprintf(stderr, "-S - send output to syslog instead of stderr\n"); |
|
1171 |
|
fprintf(stderr, "-D - daemonize (fork) and exit (implies -S)\n"); |
|
1172 |
|
fprintf(stderr, "-F <path> - create a PID file named <path>\n"); |
|
1173 |
|
fprintf(stderr, "-U <username|userid> - drop privileges to <username> before forking. Use numeric <userid> in static builds.\n"); |
|
1174 |
|
fprintf(stderr, "-h - this help message\n"); |
|
|
1159 |
|
fprintf(stderr, "tuntox - Forward ports over the Tox protocol\n\n"); |
|
1160 |
|
fprintf(stderr, "Usage:\n"); |
|
1161 |
|
fprintf(stderr, " tuntox ... # starts the server\n"); |
|
1162 |
|
fprintf(stderr, " tuntox -i <servertoxid> -L <localport>:<remoteaddress>:<remoteport> ... # starts the client\n\n"); |
|
1163 |
|
fprintf(stderr, "Options:\n"); |
|
1164 |
|
fprintf(stderr, " Server:\n"); |
|
1165 |
|
fprintf(stderr, " -i <toxid> - whitelisted Tox ID (can be used multiple times)\n"); |
|
1166 |
|
fprintf(stderr, " -f <file> - only allow connections to hostname/port combinations contained\n"); |
|
1167 |
|
fprintf(stderr, " in <file>. Rules must be entered one per line with the\n"); |
|
1168 |
|
fprintf(stderr, " <hostname>:<port> format\n"); |
|
1169 |
|
fprintf(stderr, " Client:\n"); |
|
1170 |
|
fprintf(stderr, " -i <toxid> - remote point Tox ID\n"); |
|
1171 |
|
fprintf(stderr, " -L <localport>:<remotehostname>:<remoteport>\n"); |
|
1172 |
|
fprintf(stderr, " - forward <remotehostname>:<remoteport> to 127.0.0.1:<localport>\n"); |
|
1173 |
|
fprintf(stderr, " -P <remotehostname>:<remoteport> - forward <remotehostname>:<remoteport> to\n"); |
|
1174 |
|
fprintf(stderr, " stdin/stdout (SSH ProxyCommand mode)\n"); |
|
1175 |
|
fprintf(stderr, " -p - ping the server from -i and exit\n"); |
|
1176 |
|
fprintf(stderr, " Common:\n"); |
|
1177 |
|
fprintf(stderr, " -C <dir> - save private key in <dir> instead of /etc/tuntox in server\n"); |
|
1178 |
|
fprintf(stderr, " mode\n"); |
|
1179 |
|
fprintf(stderr, " -s <secret> - shared secret used for connection authentication (max\n"); |
|
1180 |
|
fprintf(stderr, " %u characters)\n", TOX_MAX_FRIEND_REQUEST_LENGTH-1); |
|
1181 |
|
fprintf(stderr, " -d - debug mode\n"); |
|
1182 |
|
fprintf(stderr, " -q - quiet mode\n"); |
|
1183 |
|
fprintf(stderr, " -S - send output to syslog instead of stderr\n"); |
|
1184 |
|
fprintf(stderr, " -D - daemonize (fork) and exit (implies -S)\n"); |
|
1185 |
|
fprintf(stderr, " -F <path> - create a PID file named <path>\n"); |
|
1186 |
|
fprintf(stderr, " -U <username|userid> - drop privileges to <username> before forking. Use\n"); |
|
1187 |
|
fprintf(stderr, " numeric <userid> in static builds.\n"); |
|
1188 |
|
fprintf(stderr, " -h - this help message\n"); |
1175 |
1189 |
} |
} |
1176 |
1190 |
|
|
1177 |
1191 |
int main(int argc, char *argv[]) |
int main(int argc, char *argv[]) |