Share via


RtlIpv6AddressToString (Compact 7)

3/12/2014

This function converts an IPv6 address to a string in Internet standard format.

Syntax

LPTSTR NTAPI RtlIpv6AddressToString(
  __in   const IN6_ADDR* Addr,
  __out  LPTSTR S
);

Parameters

  • Addr
    The IPv6 address in network byte order.
  • S
    A pointer to a buffer in which to store the NULL-terminated string representation of the IPv6 address. This buffer should be large enough to hold at least 46 characters.

Return Value

A pointer to the NULL character inserted at the end of the string representation of the IPv6 address. This can be used by the caller to easily append more information to the string.

Remarks

The RtlIpv6AddressToString function is used to convert an IPv6 address to the string representation of the IPv6 address in Internet standard format. The basic string representation consists of 8 hexadecimal numbers separated by colons. A string of consecutive zero numbers is replaced with a double-colon. There can only be one double-colon in the string representation of the IPv6 address. The last 32 bits are represented in IPv4-style dotted-octet notation if the address is a IPv4-compatible address.

RtlIpv6AddressToString is a convenience function that does not require that the Windows Sockets DLL be loaded to access a function that is provided in Windows Sockets to perform IP address to string conversion.

When UNICODE or _UNICODE is defined, RtlIpv6AddressToString is defined to RtlIpv6AddressToStringW, the Unicode version of this function. The string parameters are defined to the PWSTR data type.

When UNICODE or _UNICODE is not defined, RtlIpv6AddressToString is defined to RtlIpv6AddressToStringA, the ANSI version of this function. The string parameters are defined to the PSTR data type.

The IN6_ADDR structure is defined in the In6addr.h header file.

See Also

Reference

IP Helper Functions
RtlIpv4AddressToString
RtlIpv4AddressToStringEx
RtlIpv4StringToAddress
RtlIpv4StringToAddressEx
RtlIpv6AddressToStringEx
RtlIpv6StringToAddress
RtlIpv6StringToAddressEx

Other Resources

GetProcAddress
LoadLibrary