Tree
- Tree:
fbc0743e04e514a8fd5f46f532b4e0b54153e711
- Date:
- Message:
- 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
README
This is a port of many Plan 9 libraries and programs to Unix. * Installation To install, run ./INSTALL. It builds mk and then uses mk to run the rest of the installation. For more details, see install(1), at install.txt in this directory and at http://swtch.com/plan9port/man/man1/install.html. * Documentation See http://swtch.com/plan9port/man/ for more documentation. (Documentation is also in this tree, but you need to run a successful install first. After that, "9 man 1 intro".) Intro(1) contains a list of man pages that describe new features or differences from Plan 9. * Helping out If you'd like to help out, great! The TODO file contains a small list. If you port this code to other architectures, please share your changes so others can benefit. Please use diff -u or CVS (see below) to prepare patches. * CVS You can use CVS to keep your local copy up-to-date as we make changes and fix bugs. See the cvs(1) man page here ("9 man cvs") for details on using cvs. * Contact Russ Cox <rsc@swtch.com>