Subject: | AI_ADDRCONFIG and other constants missing from Socket::GetAddrInfo |
Dear Socket-GetAddrInfo maintainers,
There are some constants that can be used with the getaddrinfo or
getnameinfo functions, but are not exported by the
Socket-GetAddrInfo-0.21 module. All of these seem to exist or are
documented for at least one of GNU libc and OpenBSD libc.
I believe that the module should export these if the libc of the system
supports them. Please change the module to do it, and please do the
same changes on the Socket module if necessary. Don't forget to #define
_GNU_SOURCE and similar if you want to get all these constants.
Following is the list of such constants I'd like, with a brief synopsis
of what they do (these do not mean to be complete descriptions).
flags for the flags element of the hints argument of getaddrinfo.
AI_V4MAPPED allow to return ipv6-mapped ipv4 addresses as fallback if
ipv6 requested.
AI_ALL return ipv6-mapped ipv4 addresses too if AI_V4MAPPED also set.
AI_ADDRCONFIG use only address families configured on this machine.
AI_IDN encode non-ascii domain names.
AI_CANONIDN decode returned non-ascii domain names.
AI_IDN_ALLOW_UNASSIGNED see docs.
AI_IDN_USE_STD3_ASCII_RULES see docs.
flags for the flags argument of getnameinfo.
NI_NOFQDN return only hostname part for hosts on local domain.
NI_IDN decode returned non-ascii domain names.
NI_IDN_ALLOW_UNASSIGNED see docs.
NI_IDN_USE_STD3_ASCII_RULES see docs.
error codes returned by getaddrinfo and/or getnameinfo.
EAI_SYSTEM system error, check errno for details.
EAI_OVERFLOW output buffers passed to getnameinfo too small (this
probably shouldn't happen with the perl interface though).
EAI_BADHINTS bad hints value -- the OpenBSD manpage lists it.
EAI_PROTOCOL "resolved protocol is unknown", whatever that means --
again, from OpenBSD
(there are a few more error codes in the glibc header but I don't
see them documented and they're probably only relevant with nonblocking
name resolver)
In case it matters, I am using Socket-GetAddrInfo-0.21 with perl 5.12.3
vanilla on an amd64-linux system.
Ambrus