|
|
HP-UX IPv6 Porting Guide: HP-UX 11i v2 September 2004 > Chapter 2 IPv6 AddressingIPv6 Address Types |
|
Unicast addresses usually comprise a 64-bit prefix and a 64-bit interface ID. The 64-bit interface ID must be unique on the link. An interface ID often includes the interface Link-Layer Address. The loopback interface uses the IPv6 loopback address for self-testing, by sending IP datagrams to itself. The IPv6 loopback address is: 0:0:0:0:0:0:0:1 (or more simply, ::1). The LAN segment is the scope of a Link-local Address, and is used for address autoconfiguration and neighbor discovery. Use site-local addresses on networks not connecting to the Internet. IPv6 multicast addresses resemble IPv4 multicast addresses, but have an explicit field for address-scope. FF02::1 All nodes (link-local) FF02::2 All routers (link-local) FF02::9 All Routing Information Protocol next generation (RIPng) routers (link-local) In IPv4, an application can let the system choose which source IP address to bind to a socket by specifying a wildcard address: the symbolic constant INADDR_ANY in the bind() function call. In IPv6, because the IPv6 address type is a structure (struct in6_addr), a symbolic constant can initialize an IPv6 address structure variable, but cannot assign an IPv6 structure variable. Therefore, an IPv6 wildcard address requires two forms:
The IPv4 loopback address is an integer type INADDR_LOOPBACK. The IPv6 loopback address is an in6_addr structure defined in <netinet/in.h>. For example:
The symbolic constant named IN6ADDR_LOOPBACK_INIT is defined in <netinet/in.h>. Use it only when declaring a sockaddr_in6 struct. For example: struct in6_addr loopbackaddr = IN6ADDR_LOOPBACK_INIT
|
|