aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGravatar Denis Vlasenko <vda.linux@googlemail.com>2007-01-12 20:59:31 +0000
committerGravatar Denis Vlasenko <vda.linux@googlemail.com>2007-01-12 20:59:31 +0000
commit5d68724d5b89fbf2856fdfbf36b85ac36a8f4464 (patch)
tree755b7393aab965f03de260a833f77cc4d51e6187 /include
parent2c91652bbcc82c794c26230806058b04f1711033 (diff)
downloadbusybox-5d68724d5b89fbf2856fdfbf36b85ac36a8f4464.tar.gz
busybox-5d68724d5b89fbf2856fdfbf36b85ac36a8f4464.tar.bz2
next part of ipv6-ization. mostly netcat.
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 {
#endif
};
} len_and_sockaddr;
+/* 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);
/* Create server TCP socket bound to bindaddr:port. bindaddr can be NULL,
* numeric IP ("N.N.N.N") or numeric IPv6 address,
* 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);
* (depending on host), but in theory nothing prevents e.g.
* UNIX socket address being returned, IPX sockaddr etc... */
extern len_and_sockaddr* host2sockaddr(const char *host, int port);
-/* assign sin[6]_port member if the socket is of corresponding type,
+/* Assign sin[6]_port member if the socket is of corresponding type,
* otherwise noop. Useful for ftp.
* NB: does NOT do htons() internally, just direct assignment. */
-extern void set_port(len_and_sockaddr *lsa, unsigned port);
-char* xmalloc_sockaddr2host(const struct sockaddr *sa, socklen_t salen);
-char* xmalloc_sockaddr2dotted(const struct sockaddr *sa, socklen_t salen);
+extern void set_nport(len_and_sockaddr *lsa, unsigned port);
+/* Retrieve sin[6]_port or return -1 for non-inet lsa's */
+extern int get_nport(len_and_sockaddr *lsa);
+extern char* xmalloc_sockaddr2host(const struct sockaddr *sa, socklen_t salen);
+extern char* xmalloc_sockaddr2dotted(const struct sockaddr *sa, socklen_t salen);
extern 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 @@
"\n -e Exec rest of command line after connect" \
"\n -i SECS Delay interval for lines sent" \
"\n -w SECS Timeout for connect" \
- "\n -f file Use file (ala /dev/ttyS0) instead of network" \
+ "\n -f FILE Use file (ala /dev/ttyS0) instead of network" \
) \
USE_NC_SERVER( \
"\n -l Listen mode, for inbound connects" \