aboutsummaryrefslogtreecommitdiff
path: root/include/libbb.h
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2006-11-22 16:10:39 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2006-11-22 16:10:39 +0000
commitc8717cd8571cd35d71696aab8aa847169756bd9f (patch)
tree254a736d3e761bddc4ba4b00a8f6af1d430ad18f /include/libbb.h
parent0801ef28ca655a28543b28754fd804ba0616c21c (diff)
downloadbusybox-c8717cd8571cd35d71696aab8aa847169756bd9f.tar.gz
telnetd: move generic stuff into libbb. It will make it easy
to make other server applets IPv6-aware too.
Diffstat (limited to 'include/libbb.h')
-rw-r--r--include/libbb.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/libbb.h b/include/libbb.h
index 1c82cbbba..c30c5a73d 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -226,6 +226,7 @@ extern int xopen3(const char *pathname, int flags, int mode);
extern off_t xlseek(int fd, off_t offset, int whence);
extern off_t fdlength(int fd);
+
extern int xsocket(int domain, int type, int protocol);
extern void xbind(int sockfd, struct sockaddr *my_addr, socklen_t addrlen);
extern void xlisten(int s, int backlog);
@@ -233,6 +234,17 @@ extern void xconnect(int s, const struct sockaddr *s_addr, socklen_t addrlen);
extern int xconnect_tcp_v4(struct sockaddr_in *s_addr);
extern struct hostent *xgethostbyname(const char *name);
extern struct hostent *xgethostbyname2(const char *name, int af);
+extern int xsocket_stream_ip4or6(sa_family_t *fp);
+typedef union {
+ struct sockaddr sa;
+ struct sockaddr_in sin;
+#if ENABLE_FEATURE_IPV6
+ struct sockaddr_in6 sin6;
+#endif
+} sockaddr_inet;
+extern int dotted2sockaddr(const char *dotted, struct sockaddr* sp, int socklen);
+extern int create_and_bind_socket_ip4or6(const char *hostaddr, int port);
+
extern char *xstrdup(const char *s);
extern char *xstrndup(const char *s, int n);