diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-01-10 20:19:56 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-01-10 20:19:56 +0000 |
commit | bbe514683a43e81cab1d5ccc0436b9aaf984294b (patch) | |
tree | 5faad36440333e8f1c46c367167e03be65ce8a93 /include | |
parent | 9de420c27cbbbd99bedc95782a6937039ff071bb (diff) | |
download | busybox-w32-bbe514683a43e81cab1d5ccc0436b9aaf984294b.tar.gz busybox-w32-bbe514683a43e81cab1d5ccc0436b9aaf984294b.tar.bz2 busybox-w32-bbe514683a43e81cab1d5ccc0436b9aaf984294b.zip |
a bit more IPv6-ization work
syslogd: converted to use it (in -R host:port)
Diffstat (limited to 'include')
-rw-r--r-- | include/libbb.h | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/include/libbb.h b/include/libbb.h index 16f092f60..62d5fcee4 100644 --- a/include/libbb.h +++ b/include/libbb.h | |||
@@ -298,12 +298,29 @@ extern int setsockopt_reuseaddr(int fd); | |||
298 | extern int setsockopt_broadcast(int fd); | 298 | extern int setsockopt_broadcast(int fd); |
299 | /* Create server TCP socket bound to bindaddr:port. bindaddr can be NULL, | 299 | /* Create server TCP socket bound to bindaddr:port. bindaddr can be NULL, |
300 | * numeric IP ("N.N.N.N") or numeric IPv6 address, | 300 | * numeric IP ("N.N.N.N") or numeric IPv6 address, |
301 | * and can have ":PORT" suffix. If no suffix trere, second argument is used */ | 301 | * and can have ":PORT" suffix (for IPv6 use "[X:X:...:X]:PORT"). |
302 | * If there is no suffix, port argument is used */ | ||
302 | extern int create_and_bind_stream_or_die(const char *bindaddr, int port); | 303 | extern int create_and_bind_stream_or_die(const char *bindaddr, int port); |
303 | /* Create client TCP socket connected to peer:port. Peer cannot be NULL. | 304 | /* Create client TCP socket connected to peer:port. Peer cannot be NULL. |
304 | * Peer can be numeric IP ("N.N.N.N"), numeric IPv6 address or hostname, | 305 | * Peer can be numeric IP ("N.N.N.N"), numeric IPv6 address or hostname, |
305 | * and can have ":PORT" suffix. If no suffix trere, second argument is used */ | 306 | * and can have ":PORT" suffix (for IPv6 use "[X:X:...:X]:PORT"). |
306 | extern int create_and_connect_stream_or_die(const char *peer, int def_port); | 307 | * If there is no suffix, port argument is used */ |
308 | extern int create_and_connect_stream_or_die(const char *peer, int port); | ||
309 | typedef struct len_and_sockaddr { | ||
310 | int len; | ||
311 | union { | ||
312 | struct sockaddr sa; | ||
313 | struct sockaddr_in sin; | ||
314 | #if ENABLE_FEATURE_IPV6 | ||
315 | struct sockaddr_in6 sin6; | ||
316 | #endif | ||
317 | }; | ||
318 | } len_and_sockaddr; | ||
319 | /* Return malloc'ed len_and_sockaddr with socket address of host:port | ||
320 | * Currently will return IPv4 or IPv6 sockaddrs only | ||
321 | * (depending on host), but in theory nothing prevents e.g. | ||
322 | * UNIX socket address being returned, IPX sockaddr etc... */ | ||
323 | extern len_and_sockaddr* host2sockaddr(const char *host, int port); | ||
307 | 324 | ||
308 | 325 | ||
309 | extern char *xstrdup(const char *s); | 326 | extern char *xstrdup(const char *s); |