aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDavid du Colombier <0intro@gmail.com>2012-06-02 21:50:59 +0200
committerDavid du Colombier <0intro@gmail.com>2012-06-02 21:50:59 +0200
commit3409bc9ae1614ba47430a3f593fdbe5fc177c878 (patch)
treefbc0743e04e514a8fd5f46f532b4e0b54153e711 /include
parent5d03af6557cc215cabc0f83a274d9add703f526e (diff)
downloadplan9port-3409bc9ae1614ba47430a3f593fdbe5fc177c878.tar.gz
plan9port-3409bc9ae1614ba47430a3f593fdbe5fc177c878.tar.bz2
plan9port-3409bc9ae1614ba47430a3f593fdbe5fc177c878.zip
lib9/dial: add support for IPv6
The function p9dialparse() returns the host as a sockaddr_storage structure instead of a u32int, to be able to handle both IPv4 and IPv6 addresses. Because the sockaddr_storage structure also handle port numbers and Unix path names, there is no longer need to set them in the calling functions. However, these values are still returned for convenience. The sockaddr_in and sockaddr_un structures have been replaced by sockaddr_storage to handle Unix, IPv4 and IPv6 sockets. Names and addresses are resolved using either gethostbyname() or getaddrinfo() functions. The getaddrinfo() function is documented in RFC2553 and standardized since POSIX.1-2001. It supports both IPv4 and IPv6 addresses. The gethostbyname() function is deprecated since POSIX.1-2008. However, some libc implementations don't handle getaddrinfo() properly, thus we preferred to try gethostbyname() first. I've tried to preserve most of the old code logic to prevent from surprising or unwanted behavior. R=rsc http://codereview.appspot.com/6255068
Diffstat (limited to 'include')
-rw-r--r--include/libc.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/libc.h b/include/libc.h
index d16b4043..45b22b69 100644
--- a/include/libc.h
+++ b/include/libc.h
@@ -542,7 +542,7 @@ extern void privfree(void**);
extern int p9accept(int, char*);
extern int p9announce(char*, char*);
extern int p9dial(char*, char*, char*, int*);
-extern int p9dialparse(char *ds, char **net, char **unixa, u32int *ip, int *port);
+extern int p9dialparse(char *ds, char **net, char **unixa, void *ip, int *port);
extern void p9setnetmtpt(char*, int, char*);
extern int p9listen(char*, char*);
extern char* p9netmkaddr(char*, char*, char*);