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-bbe514683a43e81cab1d5ccc0436b9aaf984294b.tar.gz |
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); extern int setsockopt_broadcast(int fd); /* Create server TCP socket bound to bindaddr:port. bindaddr can be NULL, * numeric IP ("N.N.N.N") or numeric IPv6 address, - * and can have ":PORT" suffix. If no suffix trere, second argument is used */ + * and can have ":PORT" suffix (for IPv6 use "[X:X:...:X]:PORT"). + * If there is no suffix, port argument is used */ extern int create_and_bind_stream_or_die(const char *bindaddr, int port); /* Create client TCP socket connected to peer:port. Peer cannot be NULL. * Peer can be numeric IP ("N.N.N.N"), numeric IPv6 address or hostname, - * and can have ":PORT" suffix. If no suffix trere, second argument is used */ -extern int create_and_connect_stream_or_die(const char *peer, int def_port); + * and can have ":PORT" suffix (for IPv6 use "[X:X:...:X]:PORT"). + * If there is no suffix, port argument is used */ +extern int create_and_connect_stream_or_die(const char *peer, int port); +typedef struct len_and_sockaddr { + int len; + union { + struct sockaddr sa; + struct sockaddr_in sin; +#if ENABLE_FEATURE_IPV6 + struct sockaddr_in6 sin6; +#endif + }; +} len_and_sockaddr; +/* Return malloc'ed len_and_sockaddr with socket address of host:port + * Currently will return IPv4 or IPv6 sockaddrs only + * (depending on host), but in theory nothing prevents e.g. + * UNIX socket address being returned, IPX sockaddr etc... */ +extern len_and_sockaddr* host2sockaddr(const char *host, int port); extern char *xstrdup(const char *s); |