Copyright, help text, whitespace cleanups

This commit is contained in:
Denis Vlasenko 2007-04-01 09:39:03 +00:00
parent 2856dab477
commit ba2fb719b9
4 changed files with 71 additions and 41 deletions

View File

@ -3326,9 +3326,27 @@ USE_FEATURE_RUN_PARTS_FANCY("\n -l Prints names of all matching files even when
"1\n"
#define tcpsvd_trivial_usage \
"TODO"
"[-hpEvv] [-c n] [-C n:msg] [-b n] [-u user] [-l name] ip port prog..."
/* with not-implemented options: */
/* "[-hpEvv] [-c n] [-C n:msg] [-b n] [-u user] [-l name] [-i dir|-x cdb] [ -t sec] ip port prog..." */
#define tcpsvd_full_usage \
"TODO"
"tcpsvd creates TCP/IP socket, binds it to host:port\n" \
"and listens on in for incoming connections. For each connection\n" \
"it runs prog" \
"\n" \
"\nip IP to listen on. '0' = 'all'" \
"\nport Port to listen on" \
"\nprog [arg] Program to run for each connection" \
"\n-l name Local hostname (else looks up local hostname in DNS)" \
"\n-u user[:group] Change to user/group after bind" \
"\n-c n Handle up to n connections simultaneously" \
"\n-C n[:msg] Allow only up to n connections from the same IP" \
"\n New connections from this IP address are closed" \
"\n immediately. 'msg' is written to the peer before close" \
"\n-h Look up peer's hostname in DNS" \
"\n-b n Allow a backlog of approximately n TCP SYNs" \
"\n-E Do not set up TCP-related environment variables" \
"\n-v Verbose"
#define tftp_trivial_usage \
"[OPTION]... HOST [PORT]"

View File

@ -1,15 +1,20 @@
/*
# /usr/bin/tcpsvd -v 0 1234 true
tcpsvd: info: pid 24916 from 127.0.0.1
tcpsvd: info: start 24916 localhost:127.0.0.1 ::127.0.0.1:47905
tcpsvd: info: pid 24918 from 127.0.0.1
tcpsvd: info: start 24918 localhost:127.0.0.1 ::127.0.0.1:47906
# ./busybox tcpsvd -v 0 1234 true
tcpsvd: info: pid 24924 from 127.0.0.1
tcpsvd: info: start 24924 localhost:1234:127.0.0.1:1234 ::127.0.0.1:47908
tcpsvd: info: pid 24926 from 127.0.0.1
tcpsvd: info: start 24926 localhost:1234:127.0.0.1:1234 ::127.0.0.1:47909
*/
/* Based on ipsvd utilities written by Gerrit Pape <pape@smarden.org>
* which are released into public domain by the author.
* Homepage: http://smarden.sunsite.dk/ipsvd/
*
* Copyright (C) 2007 by Denis Vlasenko.
*
* Licensed under GPLv2, see file LICENSE in this tarball for details.
*/
/* Based on ipsvd ipsvd-0.12.1. This tcpsvd accepts all options
* which are supported by one from ipsvd-0.12.1, but not all are
* functional. See help text at the end of this file for details.
*
* Code inside "#ifdef SSLSVD" is for sslsvd and is currently unused.
* Code inside #if 0" is parts of original tcpsvd which are not implemented
* for busyboxed version.
*/
#include "busybox.h"
#include "ipsvd_perhost.h"
@ -445,6 +450,8 @@ host
host either is a hostname, or a dotted-decimal IP address,
or 0. If host is 0, tcpsvd accepts connections to any local
IP address.
* busybox accepts IPv6 addresses and host:port pairs too
In this case second parameter is ignored
port
tcpsvd accepts connections to host:port. port may be a name
from /etc/services or a number.
@ -457,10 +464,12 @@ prog
-i dir
read instructions for handling new connections from the instructions
directory dir. See ipsvd-instruct(5) for details.
* ignored by busyboxed version
-x cdb
read instructions for handling new connections from the constant database
cdb. The constant database normally is created from an instructions
directory by running ipsvd-cdb(8).
* ignored by busyboxed version
-t sec
timeout. This option only takes effect if the -i option is given.
While checking the instructions directory, check the time of last access
@ -469,6 +478,7 @@ prog
tcpsvd does not discard or remove a file if the user's write permission
is not set, for those files the timeout is disabled. Default is 0,
which means that the timeout is disabled.
* ignored by busyboxed version
-l name
local hostname. Do not look up the local hostname in DNS, but use name
as hostname. This option must be set if tcpsvd listens on port 53
@ -502,6 +512,7 @@ prog
if none of the addresses match the client's IP address. You should
set this option if you use hostname based instructions. The -p option
implies the -h option.
* ignored by busyboxed version
-b n
backlog. Allow a backlog of approximately n TCP SYNs. On some systems n
is silently limited. Default is 20.
@ -511,4 +522,5 @@ prog
verbose. Print verbose messsages to standard output.
-vv
more verbose. Print more verbose messages to standard output.
* no difference between -v and -vv in busyboxed version
*/