TCP/IP Programming Manual

NOTE: In both cases, you should initialize the entire sockaddr_in6 structure to zero after your
structure declarations.
Making Library Routine Changes
You must make changes, as needed, to applications that use the following library routines:
gethostbyaddr
gethostbyname
inet_ntoa
inet_addr
gethostbyaddr Function Call
Change applications that use the gethostbyaddr function call to use the getnameinfo function
call, as shown in the following examples:
AF_INET6 CallAF_INET Call
getnameinfo(&sockaddr,sockaddr_len, node_name,
name_len,
gethostbyaddr(xxx,4,AF_INET)
service, service_len, flags);
Make the following changes in your application, as needed:
Change the function name from gethostbyaddr to getnameinfo and provide a pointer to the
socket address structure, a character string for the returned node name, an integer for the length
of the returned node name, a character string to receive the returned service name, an integer for
the length of the returned service name, and an integer that specifies the type of address processing
to be performed.
Alternatively, you can use getipnodebyaddr. The difference between getnameinfo and
getipnodebyaddr is that getnameinfo returns both the node name and the services name
and getipnodebyaddr returns just the node name. getipnodebyaddr also requires another
call, freehostent, to free the hostent structure when the call is complete.
See getnameinfo (page 117) and getipnodebyaddr (page 114) for more information about these
library routines.
gethostbyname Function Call
Applications that use the gethostbyname function call must be changed to use the getaddrinfo
function call, as shown in the following examples:
AF_INET6 CallAF_INET Call
getaddrinfo(node_name, service_name, &hints,
&result);
gethostbyname(name)
.
.
.
freeaddrinfo(result);
Make the following changes in your application, as needed:
56 Porting and Developing IPv6 Applications (NonStop TCP/IPv6 and CIP Only)