|
|
HP-UX IPv6 Porting Guide: HP-UX 11i v2 September 2004 > Chapter 5 Overview of IPv4 and IPv6 Call Set-upUsing AF_INET6 Socket to Send IPv4 UDP Communications |
|
You can use the AF_INET6 socket for both IPv6 and IPv4 communications; IPv6 uses the POSIX function call getaddrinfo() rather than the IPv4 gethostbyname() function call. For IPv4 communications, create an AF_INET6 socket and pass it a sockaddr_in6 structure that contains an IPv4-mapped IPv6 address (for example, ::FFFF:1.2.3.4). The figure below shows the sequence of events for an application that uses an AF_INET6 socket to send IPv4 packets.
|
|