In article <20000430151430.A26860@xxxxxxxxxxxxxxxxxx> (at Sun, 30 Apr 2000
15:14:30 -0700), John Kennedy <jk@xxxxxxxxxxxx> says:
> > <http://apps.v6.linux.or.jp/pub/Linux/glibc/getifaddrs-20000309.tgz>
> Right now that host is refusing connections. I'm specifically
> looking for that API, since both BIND & sendmail prefer it when
> trying to pick up IPv6 interfaces.
Hmm, I've restarted the httpd. Also, you can get a copy from
<ftp://ftp.nemoto.ecei.tohoku.ac.jp/pub/Net/IPv6/Patches/getifaddrs-20000309.tgz>
Here's a simple code that shows how to use getifaddrs(3):
#include <ifaddrs.h>
:
struct ifaddrs *ifa0, *ifa;
if (getifaddrs(&ifa0)){
perror("ifaddrs");
exit(1);
}
for (ifa=ifa0; ifa; ifa=ifa->ifa_next){
/* Use ifa->ifa_addr, ifa->ifa_broadaddr etc. which points
struct sockaddr and ifa->ifa_flags */
if (ifa->ifa_addr && ifa->ifa_addr == AF_INET6){
:
}
}
freeifaddrs(ifa0);
--
Hideaki YOSHIFUJI <yoshfuji@xxxxxxxxxxxxxxxxx>
Web Page: http://www.ecei.tohoku.ac.jp/%7Eyoshfuji/
PGP5i FP: F731 6599 5EB2 BBA7 1515 1323 1806 A96F 5700 6B25
|