diff options
author | Denis Vlasenko | 2006-11-22 16:10:39 +0000 |
---|---|---|
committer | Denis Vlasenko | 2006-11-22 16:10:39 +0000 |
commit | c8717cd8571cd35d71696aab8aa847169756bd9f (patch) | |
tree | 254a736d3e761bddc4ba4b00a8f6af1d430ad18f /include | |
parent | 0801ef28ca655a28543b28754fd804ba0616c21c (diff) | |
download | busybox-c8717cd8571cd35d71696aab8aa847169756bd9f.zip busybox-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')
-rw-r--r-- | include/libbb.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/libbb.h b/include/libbb.h index 1c82cbb..c30c5a7 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); |