HP-UX 11i Version 2 Release Notes (October 2003)

Internet and Networking
Networking libc APIs getaddrinfo() and getnameinfo()
Chapter 6
167
The netstat and arp manpages, netstat (1) and arp (1M), have been changed to
eliminate the syntax which allows references to crash dumps.
Obsolescence
Support for crash dump reading in arp and netstat is obsoleted as of HP-UX 11i v2.
Networking libc APIs getaddrinfo() and getnameinfo()
The C library, libc, provides the interface between the user program and the kernel.
The getnameinfo() networking libc function is used to look up a host name and service
name, given the binary address and port. The getaddrinfo() networking libc function
is used to translate the hostname-to-address in a protocol-independent fashion.
The getipnodebyname() and getipnodeaddr() functions are the two networking libc
APIs which provide the same functionality as getnameinfo() and getaddrinfo(),
respectively.
Summary of Change
The following changes are applicable to the networking APIs getaddrinfo() and
getnameinfo():
•The libc APIs getnameinfo() and getaddrinfo() look into the repositories
specified in the ipnodes directive to resolve addresses. If this resolution fails, and if
an IPv4 address is requested using a flag parameter,
getnameinfo()/getaddrinfo() additionally looks into the repositories specified
with the hosts directive of the /etc/nsswitch.conf file to resolve an IPv4 address.
This additional lookup involves getaddrinfo() calling the gethostbyname()
function, and getnameinfo() calling the gethostbyaddr() function to resolve IPv4
addresses.
•A call to getaddrinfo()/getnameinfo() may overwrite the storage which is used by
the gethostbyname()/gethostbyaddr() functions to return the result. Therefore,
the data returned by gethostbyname()/gethostbyaddr() should be copied to a
different location before a subsequent call to getaddrinfo()/getnameinfo() (or the
libc APIs getipnodebyname()/getipnodebyaddr()) is made.
1
Impact
Networking applications that call the getnameinfo()/getaddrinfo() functions may
notice a change in the value of the parameter addrinfo returned by these functions
while resolving IPv4 addresses.
1. See also “Networking libc APIs getipnodebyname() and getipnodebyaddr()” on
page 168.