TCP/IP Programming Manual

Table 8 Summary of IPv6 Extensions to the BSD Socket API (continued)
ChangesCategory
and inet_addr functions remain for IPv4 address conversion only. See
Making Library Routine Changes (page 56) for more information.
Specifies new socket options for IPv6 multicast. See Multicast Changes for
IPv6 (page 59) for more information.
Socket options
Application Changes
This subsection describes the changes you must make in your existing application code in order
to operate in an IPv6 networking environment. When you have finished porting your applications
to IPv6, any existing IPv4 applications continue to operate as before and also interoperate with
your IPv6 application.
Changes to your applications described in this subsection include:
Making Name Changes
Making Structure Changes
Making Library Routine Changes (page 56)
Making Other Application Changes (page 57)
Making Name Changes
Most changes required are straightforward and mechanical but some may require some code
restructuring. (For example, a routine that returns an int datatype holding an IPv4 address may
need to be modified to take a pointer to an in6_addr structure as an extra parameter into which
it writes the IPv6 address). Table 9 summarizes the changes to make to your application's code.
Table 9 Name Changes
Replace with:Search file for:
AF_INET6AF_INET
PF_INET6PF_INET
in6addr_anyINADDR_ANY
Making Structure Changes
The structure names and field names have changed for the following structures:
in_addr
sockaddr_in
sockaddr
hostent
in_addr Structure Changes for Protocol-Independent Applications
Applications that use the in_addr structure must be changed, as needed, to use the in6_addr
structure, as shown in the following examples:
AF_INET6 StructureAF_INET Structure
struct in6_addrstruct in_addr
u_char sa6_addrunsigned long s_addr
54 Porting and Developing IPv6 Applications (NonStop TCP/IPv6 and CIP Only)