Converts and IP version 6 address to its simplest and most significant form.
function MakeCanonicalIPv6Address( const AAddr: string ): string;
Parameters |
Description |
AAddr |
IP address to be converted/normalized. |
string - IP address in colon-delimited hexadecimal form.
MakeCanonicalIPv6Address is a String function used to convert the IP version 6 address in AAddr to its simplest and most significant form as a string containing colon-delimited hexadecimal numbers. MakeCanonicalIPv6Address is used to normalize IP addresses which may contain a mixture of hexadecimal, implied, and dotted decimal values as described in the Internet Standards documents:
RFC 2373 - IP Version 6 Addressing Architecture
RFC 1883 - Internet Protocol, Version 6 (IPv6) Specification
MakeCanonicalIPv6Address attempts to normalize the value in AAddr which may contain a 128-bit identifier for IP version 6 Unicast, Anycast, or Multicast addresses. The value in AAddr may contain one of the three conventional forms for representing an IPv6 address:
Address Format Description |
-------------------------------------- -------------------------------
|
FEDC:BA98:0000:3210:0000:BA98:7654:3210 The preferred form where each of the eight 16-bit address components are expressed as hexadecimal digits. This is also the canonical form used in the return value for the function. |
FEDC:BA98:0:3210:0:BA98:7654:3210 Address form where leading zeros in an address component are omitted but contains at least one numeric value in each component. |
FEDC:BA98::3210:::7654:3210 Address form where zero values in an address component are compressed into the "::" notation that represents a 16-bit value of zero. |
0:0:0:0:0:FFFF:129.144.52.38 Alternative address form that allows mixed use of IPv4 and IPv6 nodes. The six high-order 16-bit components of the address are expressed in IPV6 as hexadecimal values, and the four low-order 8-bit components of the address are expressed in standard IPv4 dotted decimal form. |
The return value for the method is the IP address after normalization and expressed as eight 16-bit colon-delimited hexadecimal values. As an
FEDC:BA98:0000:3210:0000:BA98:7654:3210
MakeCanonicalIPv6Address may return an empty string if an invalid IP address is provided in the AAddr argument.
Copyright © 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
|
Post feedback to the Indy Docs Newsgroup.
|