Frédéric Raynal
2004-08-14 17:47:26 UTC
Hi,
Attached is a file containing the new API for name resolution. As we
talked earlier with Mike nd Kirby, it is now based on getaddrinfo()
and getnameinfo() because they are supposed to be protocol
independant. So, the functions provided here work with both IPv4 and
IPv6 ... in theory ;-)
Moreover, I have included the structure of addresses defined by Dug
Song in libdnet (once again, thanks to you for that nice libray) That
way, compatibility between the libraries will help in futur
developments.
Important
=========
Performing some tests on Linux (2.6) and Mac OS X (10.3), I noticed
different behavior ... which is quite annoying. I cant say right now
if it comes from a stupid bug I made, or if is a "normal bug".
Hence, I _really_ need you to make tests on your system
Linux Mac OS X
2.6 10.3
./gai -i 1.2.3.4 ok ok
./gai -i 1.2.3.4 -n ok ok
./gai -i 1.2.3.4 -c ok 0:1 ok 0:1
./gai -i 217.12.3.11 -c ok 0:1 ok 0:1
./gai -i google.fr -n [1] ok 1:0
./gai -i google.fr ok 1:0 ok 1:0
./gai -i google.fr -c ok 1:X ok 1:0
./gai -i yahoo.fr -c [2] 1:1 [3] 1:0
./gai -4 1.2.3.4 ok 0:1 [4]
./gai -4 1.2.3.4 -c [6] 0:1 [4]
./gai -4 1.2.3.4 -n ok [4]
[1] unable to resolve (err=-2: Name or service not known)
[2] ascii -> addr: name=yahoo.fr addr=217 12 3 11 (FQDN ok)
[3] ascii -> addr: name=yahoo.fr addr=217 12 3 11
[4] libnet_resolve_addr2ascii(): getnameinfo() failed (Unknown error: 0)
X:Y means X DNS request of type A, and Y of type PTR. When nothing is
speicied, it means there is no DNS request.
On Mac OS X, take care there is a DNS cache so there can be no DNS
request if the request is already cached.
Questions
=========
- these functions need to be tested everywhere they can (Solaris, Win,
and so on).
- why getnameinfo() fails on my iBook ?
- can someone test that with IPv6
- these functions are probably not available on all systems. OpenSSH
made their own portable one (in openbsd/fake-rfc2553.c)
Is there a volunteer to do that ? I promise to offer him a beer.
Thanks for your help
Fred
PS: I'll release an alpha version (ie not all builders and features
from 1.1 API will be available) probably tomorow or monday.
Attached is a file containing the new API for name resolution. As we
talked earlier with Mike nd Kirby, it is now based on getaddrinfo()
and getnameinfo() because they are supposed to be protocol
independant. So, the functions provided here work with both IPv4 and
IPv6 ... in theory ;-)
Moreover, I have included the structure of addresses defined by Dug
Song in libdnet (once again, thanks to you for that nice libray) That
way, compatibility between the libraries will help in futur
developments.
Important
=========
Performing some tests on Linux (2.6) and Mac OS X (10.3), I noticed
different behavior ... which is quite annoying. I cant say right now
if it comes from a stupid bug I made, or if is a "normal bug".
Hence, I _really_ need you to make tests on your system
Linux Mac OS X
2.6 10.3
./gai -i 1.2.3.4 ok ok
./gai -i 1.2.3.4 -n ok ok
./gai -i 1.2.3.4 -c ok 0:1 ok 0:1
./gai -i 217.12.3.11 -c ok 0:1 ok 0:1
./gai -i google.fr -n [1] ok 1:0
./gai -i google.fr ok 1:0 ok 1:0
./gai -i google.fr -c ok 1:X ok 1:0
./gai -i yahoo.fr -c [2] 1:1 [3] 1:0
./gai -4 1.2.3.4 ok 0:1 [4]
./gai -4 1.2.3.4 -c [6] 0:1 [4]
./gai -4 1.2.3.4 -n ok [4]
[1] unable to resolve (err=-2: Name or service not known)
[2] ascii -> addr: name=yahoo.fr addr=217 12 3 11 (FQDN ok)
[3] ascii -> addr: name=yahoo.fr addr=217 12 3 11
[4] libnet_resolve_addr2ascii(): getnameinfo() failed (Unknown error: 0)
X:Y means X DNS request of type A, and Y of type PTR. When nothing is
speicied, it means there is no DNS request.
On Mac OS X, take care there is a DNS cache so there can be no DNS
request if the request is already cached.
Questions
=========
- these functions need to be tested everywhere they can (Solaris, Win,
and so on).
- why getnameinfo() fails on my iBook ?
- can someone test that with IPv6
- these functions are probably not available on all systems. OpenSSH
made their own portable one (in openbsd/fake-rfc2553.c)
Is there a volunteer to do that ? I promise to offer him a beer.
Thanks for your help
Fred
PS: I'll release an alpha version (ie not all builders and features
from 1.1 API will be available) probably tomorow or monday.