diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/libbb.h | 14 |
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... */ |
318 | len_and_sockaddr* host2sockaddr(const char *host, int port); | 318 | len_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) */ | ||
321 | len_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. */ |
322 | void set_nport(len_and_sockaddr *lsa, unsigned port); | 326 | void 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 */ |
324 | int get_nport(len_and_sockaddr *lsa); | 328 | int get_nport(len_and_sockaddr *lsa); |
325 | /* Reverse DNS */ | 329 | /* Reverse DNS. Returns NULL on failure. */ |
326 | char* xmalloc_sockaddr2host(const struct sockaddr *sa, socklen_t salen); | 330 | char* 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 */ |
332 | char* xmalloc_sockaddr2host_noport(const struct sockaddr *sa, socklen_t salen); | ||
333 | /* This one also doesn't fall back to dotted IP (returns NULL) */ | ||
328 | char* xmalloc_sockaddr2hostonly_noport(const struct sockaddr *sa, socklen_t salen); | 334 | char* xmalloc_sockaddr2hostonly_noport(const struct sockaddr *sa, socklen_t salen); |
329 | /* inet_[ap]ton on steroids */ | 335 | /* inet_[ap]ton on steroids */ |
330 | char* xmalloc_sockaddr2dotted(const struct sockaddr *sa, socklen_t salen); | 336 | char* 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 |
336 | struct hostent *xgethostbyname(const char *name); | 342 | struct 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 |
338 | struct hostent *xgethostbyname2(const char *name, int af); | 344 | //struct hostent *xgethostbyname2(const char *name, int af); |
339 | 345 | ||
340 | 346 | ||
341 | extern char *xstrdup(const char *s); | 347 | extern char *xstrdup(const char *s); |