Related functions
The following macros and
socket functions provide the additional functionality required
to write ``IPv6 ready'' applications.
-
The IN6_IS_ADDR_V4MAPPED macro, described on the
inet(3N)
manual page, can be used to
determine whether an
IPv6 address is an IPv4-mapped address.
-
gethostbyname2(3N)
retrieves a network host entry via its name and address family.
-
getaddrinfo(3N)
returns address information related to a specified service location.
-
getnameinfo(3N)
returns the text strings associated with the supplied IP address and port number.
-
inet_pton(3N)
converts the specified address in text form to its binary equivalent.
-
inet_ntop(3N)
converts the specified binary address into its text equivalent suitable for presentation.
getaddrinfo and getnameinfo can both be used to
retrieve information related to IPv4 and IPv6
addresses. inet_pton and inet_ntop can both convert
IPv4 and IPv6 addresses. This means that in
``IPv6 ready'' applications, you do not need to use either
inet_addr or inet_ntoa.
In addition to the new functions listed above, the following sockets
functions have been modified.
No change in the syntax of these functions is necessary
when using them for IPv6,
as all addresses are referenced by ``opaque'' address pointers.
The only difference when using these functions is that you must cast
sockaddr_in6 to struct sockaddr* when using any of these
functions except sendmsg and recvmsg. When you use
these functions, set the structure member msghdr.msg_name
to point to your sockaddr_in6 structure and store the length
of the structure in msghdr.msg_namelen
.
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 27 April 2004