Subject: c-ares IPv6 support (preliminary patch)

c-ares IPv6 support (preliminary patch)

From: codemastr <codemstr_at_ptd.net>
Date: 2005-03-07

I have started to do some work on adding IPv6 support to c-ares. The
attached patch is *very* preliminary, I'm simply posting it so that others
can comment, make suggestions, and perhaps make changes.The included ahost
program can be used to test out the IPv6 functions. The patch is made
against the latest CVS version of c-ares.

What is done so far:
* ares_gethostbyname/ares_gethostbyaddr now accept a family parameter of
AF_INET6. If AF_INET6 is specified, an
   IPv6 lookup is performed. In the case of ares_gethostbyname, it will
first query for an AAAA, if no result is found, it will
   then go for an A. For ares_gethostbyaddr, it will do a PTR lookup on
ip6.arpa.
* ares_parse_aaaa_reply was added. This function takes an AAAA reply and
parses it into a hostent structure.

What needs to be done:
* OS independence. For IPv6 lookups, all we need is an AF_INET6, in6_addr
and perhaps inet_ntop/inet_pton. Hence,
   IPv6 DNS lookups should be possible regardless of whether the system
itself supports IPv6. We will simply provide the
   necessary structs/functions if they are not available.
* OS support. I've only tested this on FreeBSD. I'm sure it does NOT work on
Windows (I know very little about IPv6
   under Windows).
* addrinfo style system. I went with hostent because 1, it's what I'm
familiar with and 2, it's what the program I will be using
   c-ares in needs. However, having ares_getaddrinfo would probably be
beneficial and it seems necessary for libcurl.
* IPv6 DNS server support. c-ares needs the ability to actually communicate
with the DNS server over IPv6.
* File lookups need IPv6 support.

Hope this turns out to be a good start!
Dominick Meglio

_______________________________________________
http://cool.haxx.se/mailman/listinfo/c-ares

Received on Mon Mar 7 20:06:18 2005