aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/libbb.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/include/libbb.h b/include/libbb.h
index e41993796..1a5ce24ad 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -316,15 +316,21 @@ int xconnect_stream(const len_and_sockaddr *lsa);
316 * (depending on host), but in theory nothing prevents e.g. 316 * (depending on host), but in theory nothing prevents e.g.
317 * UNIX socket address being returned, IPX sockaddr etc... */ 317 * UNIX socket address being returned, IPX sockaddr etc... */
318len_and_sockaddr* host2sockaddr(const char *host, int port); 318len_and_sockaddr* host2sockaddr(const char *host, int port);
319#if ENABLE_FEATURE_IPV6
320/* Same, useful if you want to force family (e.g. IPv6) */
321len_and_sockaddr* host_and_af2sockaddr(const char *host, int port, sa_family_t af);
322#endif
319/* Assign sin[6]_port member if the socket is of corresponding type, 323/* Assign sin[6]_port member if the socket is of corresponding type,
320 * otherwise no-op. Useful for ftp. 324 * otherwise no-op. Useful for ftp.
321 * NB: does NOT do htons() internally, just direct assignment. */ 325 * NB: does NOT do htons() internally, just direct assignment. */
322void set_nport(len_and_sockaddr *lsa, unsigned port); 326void set_nport(len_and_sockaddr *lsa, unsigned port);
323/* Retrieve sin[6]_port or return -1 for non-INET[6] lsa's */ 327/* Retrieve sin[6]_port or return -1 for non-INET[6] lsa's */
324int get_nport(len_and_sockaddr *lsa); 328int get_nport(len_and_sockaddr *lsa);
325/* Reverse DNS */ 329/* Reverse DNS. Returns NULL on failure. */
326char* xmalloc_sockaddr2host(const struct sockaddr *sa, socklen_t salen); 330char* xmalloc_sockaddr2host(const struct sockaddr *sa, socklen_t salen);
327/* This one deosn't fall back to dotted IP and do not append :PORTNUM */ 331/* This one doesn't append :PORTNUM */
332char* xmalloc_sockaddr2host_noport(const struct sockaddr *sa, socklen_t salen);
333/* This one also doesn't fall back to dotted IP (returns NULL) */
328char* xmalloc_sockaddr2hostonly_noport(const struct sockaddr *sa, socklen_t salen); 334char* xmalloc_sockaddr2hostonly_noport(const struct sockaddr *sa, socklen_t salen);
329/* inet_[ap]ton on steroids */ 335/* inet_[ap]ton on steroids */
330char* xmalloc_sockaddr2dotted(const struct sockaddr *sa, socklen_t salen); 336char* xmalloc_sockaddr2dotted(const struct sockaddr *sa, socklen_t salen);
@@ -334,8 +340,8 @@ char* xmalloc_sockaddr2dotted_noport(const struct sockaddr *sa, socklen_t salen)
334//int xconnect_tcp_v4(struct sockaddr_in *s_addr); 340//int xconnect_tcp_v4(struct sockaddr_in *s_addr);
335// users: traceroute.c hostname.c ifconfig.c ping.c 341// users: traceroute.c hostname.c ifconfig.c ping.c
336struct hostent *xgethostbyname(const char *name); 342struct hostent *xgethostbyname(const char *name);
337// ping6 is the only user - convert to new API 343//// ping6 is the only user - convert to new API
338struct hostent *xgethostbyname2(const char *name, int af); 344//struct hostent *xgethostbyname2(const char *name, int af);
339 345
340 346
341extern char *xstrdup(const char *s); 347extern char *xstrdup(const char *s);