aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/libbb.h13
-rw-r--r--include/usage.h2
2 files changed, 10 insertions, 5 deletions
diff --git a/include/libbb.h b/include/libbb.h
index 07b1d1158..c088946d9 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -307,6 +307,9 @@ typedef struct len_and_sockaddr {
307#endif 307#endif
308 }; 308 };
309} len_and_sockaddr; 309} len_and_sockaddr;
310/* Create stream socket, and allocated suitable lsa
311 * (lsa of correct size and lsa->sa.sa_family (AF_INET/AF_INET6)) */
312int xsocket_stream(len_and_sockaddr **lsap);
310/* Create server TCP socket bound to bindaddr:port. bindaddr can be NULL, 313/* Create server TCP socket bound to bindaddr:port. bindaddr can be NULL,
311 * numeric IP ("N.N.N.N") or numeric IPv6 address, 314 * numeric IP ("N.N.N.N") or numeric IPv6 address,
312 * and can have ":PORT" suffix (for IPv6 use "[X:X:...:X]:PORT"). 315 * and can have ":PORT" suffix (for IPv6 use "[X:X:...:X]:PORT").
@@ -324,12 +327,14 @@ extern int xconnect_stream(const len_and_sockaddr *lsa);
324 * (depending on host), but in theory nothing prevents e.g. 327 * (depending on host), but in theory nothing prevents e.g.
325 * UNIX socket address being returned, IPX sockaddr etc... */ 328 * UNIX socket address being returned, IPX sockaddr etc... */
326extern len_and_sockaddr* host2sockaddr(const char *host, int port); 329extern len_and_sockaddr* host2sockaddr(const char *host, int port);
327/* assign sin[6]_port member if the socket is of corresponding type, 330/* Assign sin[6]_port member if the socket is of corresponding type,
328 * otherwise noop. Useful for ftp. 331 * otherwise noop. Useful for ftp.
329 * NB: does NOT do htons() internally, just direct assignment. */ 332 * NB: does NOT do htons() internally, just direct assignment. */
330extern void set_port(len_and_sockaddr *lsa, unsigned port); 333extern void set_nport(len_and_sockaddr *lsa, unsigned port);
331char* xmalloc_sockaddr2host(const struct sockaddr *sa, socklen_t salen); 334/* Retrieve sin[6]_port or return -1 for non-inet lsa's */
332char* xmalloc_sockaddr2dotted(const struct sockaddr *sa, socklen_t salen); 335extern int get_nport(len_and_sockaddr *lsa);
336extern char* xmalloc_sockaddr2host(const struct sockaddr *sa, socklen_t salen);
337extern char* xmalloc_sockaddr2dotted(const struct sockaddr *sa, socklen_t salen);
333 338
334 339
335extern char *xstrdup(const char *s); 340extern char *xstrdup(const char *s);
diff --git a/include/usage.h b/include/usage.h
index 4e5206558..0275df3f0 100644
--- a/include/usage.h
+++ b/include/usage.h
@@ -2249,7 +2249,7 @@
2249 "\n -e Exec rest of command line after connect" \ 2249 "\n -e Exec rest of command line after connect" \
2250 "\n -i SECS Delay interval for lines sent" \ 2250 "\n -i SECS Delay interval for lines sent" \
2251 "\n -w SECS Timeout for connect" \ 2251 "\n -w SECS Timeout for connect" \
2252 "\n -f file Use file (ala /dev/ttyS0) instead of network" \ 2252 "\n -f FILE Use file (ala /dev/ttyS0) instead of network" \
2253 ) \ 2253 ) \
2254 USE_NC_SERVER( \ 2254 USE_NC_SERVER( \
2255 "\n -l Listen mode, for inbound connects" \ 2255 "\n -l Listen mode, for inbound connects" \