aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-04-03 01:13:04 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-04-03 01:13:04 +0000
commit992e05b6f070562d83f9238b227e1ddbf951c9af (patch)
treec64729c60f929f3007b4ed93543291b52cb50a02 /include
parentcea0a8bccbb0d98eb0e7423e6fff0d8529db8efe (diff)
downloadbusybox-992e05b6f070562d83f9238b227e1ddbf951c9af.tar.gz
udpsvd: more work on it. works in limited testing.
Diffstat (limited to 'include')
-rw-r--r--include/libbb.h11
-rw-r--r--include/usage.h27
2 files changed, 29 insertions, 9 deletions
diff --git a/include/libbb.h b/include/libbb.h
index b802e01d3..e5413b1a4 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -321,6 +321,17 @@ typedef struct len_and_sockaddr {
#endif
};
} len_and_sockaddr;
+enum {
+ LSA_SIZEOF_SA = sizeof(
+ union {
+ struct sockaddr sa;
+ struct sockaddr_in sin;
+#if ENABLE_FEATURE_IPV6
+ struct sockaddr_in6 sin6;
+#endif
+ }
+ )
+};
/* Create stream socket, and allocated suitable lsa
* (lsa of correct size and lsa->sa.sa_family (AF_INET/AF_INET6)) */
int xsocket_stream(len_and_sockaddr **lsap);
diff --git a/include/usage.h b/include/usage.h
index cec2dd766..bab14f5c3 100644
--- a/include/usage.h
+++ b/include/usage.h
@@ -3326,32 +3326,41 @@ USE_FEATURE_RUN_PARTS_FANCY("\n -l Prints names of all matching files even when
"1\n"
#define tcpsvd_trivial_usage \
- "[-hpEvv] [-c n] [-C n:msg] [-b n] [-u user] [-l name] ip port prog..."
+ "[-hEv] [-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 \
- "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" \
+ "Creates TCP socket, binds it to host:port and listens on in\n" \
+ "for incoming connections. For each connection it runs prog" \
"\n" \
- "\nip IP to listen on. '0' = 'all'" \
+ "\nip IP to listen on. '0' = all" \
"\nport Port to listen on" \
- "\nprog [arg] Program to run for each connection" \
+ "\nprog [arg] Program to run" \
"\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-h Look up peer's hostname" \
"\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 udpsvd_trivial_usage \
- "TODO"
+ "[-hv] [-u user] [-l name] host port prog"
#define udpsvd_full_usage \
- "TODO"
+ "Creates UDP socket, binds it to host:port and listens on in\n" \
+ "for incoming packets. When packet arrives it runs prog.\n" \
+ "When prog exits, it start to listen on the socket again" \
+ "\n" \
+ "\nip IP to listen on. '0' = all" \
+ "\nport Port to listen on" \
+ "\nprog [arg] Program to run" \
+ "\n-l name Local hostname (else looks up local hostname in DNS)" \
+ "\n-u user[:group] Change to user/group after bind" \
+ "\n-h Look up peer's hostname" \
+ "\n-v Verbose"
#define tftp_trivial_usage \
"[OPTION]... HOST [PORT]"