Commit Graph

51 Commits

Author SHA1 Message Date
David du Colombier 3409bc9ae1 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
2012-06-02 21:50:59 +02:00
Russ Cox 9eec023b80 libc.h: update comment for 32-bit Rune
http://codereview.appspot.com/116097
2009-09-13 17:46:46 -04:00
Russ Cox c8ae41fb03 more licensing 2009-08-14 22:49:38 -07:00
Russ Cox a58a827f2a lib9: add mode parameter to opentemp 2008-07-10 11:10:10 -04:00
Russ Cox cab935a0ba lib9: add write function that withstands interrupts 2008-07-04 12:38:26 -04:00
Russ Cox 118dfa98b8 post9pservice: accept mtpt (via fuse) 2008-05-05 23:07:54 -04:00
rsc df970459f9 pin 2006-06-26 05:47:59 +00:00
rsc 15085f7450 simpler USED 2006-06-26 00:02:52 +00:00
rsc cbeb0b26e4 Use gcc -ansi -pedantic in 9c. Fix many non-C89-isms. 2006-04-01 19:24:03 +00:00
rsc eadb18a335 add exitcode 2006-02-12 19:40:55 +00:00
rsc c54b8b69ed bsd 2006-01-27 05:51:54 +00:00
rsc 577782688c 9p2000.u 2006-01-27 03:45:30 +00:00
rsc bdbc55d352 add text version of install(1) 2005-11-28 16:36:57 +00:00
rsc 7e8769cc2a move utf, fmt to libc 2005-11-26 15:38:59 +00:00
rsc 86c2ab2caf sched_yield netbsd (anselm garbe) 2005-11-16 00:25:15 +00:00
rsc f49c5cb252 p9syslog for varargck 2005-11-07 02:47:08 +00:00
rsc 01a1c31a7d Add print pragmas back, #ifdef'ed. 2005-09-29 06:18:32 +00:00
rsc f91af8ada9 Add 9P2000.u fields. 2005-09-13 01:31:48 +00:00
rsc 04084d4e1d openbsd 2005-07-21 18:59:12 +00:00
rsc fe8c925e8a OpenBSD, thanks to Tim Wiess 2005-07-21 18:29:04 +00:00
rsc ceb21b8a90 maybe openbsd has schedyield now 2005-07-19 11:36:27 +00:00
rsc 52e6164443 OpenBSD support. 2005-05-01 18:40:01 +00:00
rsc aaa502d3a3 appease sun - nil is now just 0 instead of (void*)0
to fix function pointer problems.
2005-03-15 16:12:51 +00:00
rsc 00e0b27982 add laddr, raddr to netconninfo 2005-02-13 18:31:45 +00:00
rsc ce2a378d46 new prototypes 2005-02-10 16:08:16 +00:00
rsc afe82ee607 add crypt 2005-02-08 21:03:48 +00:00
rsc 4a62371140 Add searchpath(). 2005-01-23 22:33:59 +00:00
rsc 10f14b04f3 update return interface 2005-01-16 21:28:44 +00:00
rsc c8b6342d3c Many small edits. 2005-01-13 04:49:19 +00:00
rsc a19ff5b204 debugging for sam, and an old fix forgotten 2005-01-07 18:03:36 +00:00
rsc 3b5a5a66ac autolib, p9rand, p9execl 2005-01-04 21:17:33 +00:00
wkj 8d8865f3d0 Rename lrand to p9lrand, too. 2004-12-29 02:44:01 +00:00
wkj 6239798563 Use #define to move rand and srand to p9rand and p9srand. 2004-12-29 01:33:33 +00:00
rsc 0341761074 add awaitfor and waitfor 2004-12-27 19:11:21 +00:00
rsc 678ede7e54 various changes from plan 9 2004-12-27 00:14:43 +00:00
rsc 3286afda88 new thread library 2004-12-25 22:00:11 +00:00
rsc 4fbe07e1db Add // to acid thread line so it is executable.
Remove p9fork.
2004-09-23 03:25:29 +00:00
rsc c6687d4591 Continue the pthreads torture. 2004-09-21 01:11:28 +00:00
rsc bcf527a98e Continue switching library over to pthreads when possible.
Tprimes works on Linux 2.6.  You can only have 128 procs
though.
2004-09-17 03:34:32 +00:00
rsc 06bb4ed20d Rewrite to remove dependence on rendezvous and its bizarre
data structures.  Makes it easier to use pthreads too.
Still need to add code for non-pthreads systems.

Just a checkpoint to switch work to another machine.
2004-09-17 00:38:29 +00:00
rsc 819822c98d various fixes 2004-06-16 16:45:22 +00:00
rsc d2ffec702e add OLOCK 2004-06-11 14:38:44 +00:00
rsc 22f3ae2701 catch strdup, malloc, and friends 2004-06-09 14:25:42 +00:00
rsc 7e0e6522e5 lock malloc ourselves 2004-05-23 00:58:23 +00:00
rsc be36ff6885 add -W to specify window size.
various other little fixes.
2004-04-29 17:13:24 +00:00
rsc cf10d09666 add needstack 2004-04-21 23:34:46 +00:00
rsc 070905e215 asdf 2004-04-21 04:48:39 +00:00
rsc a67406e465 Plan 9 atoi, ... 2004-04-08 19:31:48 +00:00
rsc 924eb6424c Small changes. 2004-03-25 23:30:46 +00:00
rsc 8ad517944e Today's changes.
More changes.
2004-03-25 23:03:57 +00:00