
InetNtop function takes an Internet address structure specified by the pAddr parameter and returns a NULL-terminated string that represents the IP address. InetNtop function provides a protocol-independent address-to-string translation. InetNtop function is supported on Windows Vista and later. This error is also returned if the length of the buffer pointed to by the pStringBuf parameter is not large enough to receive the string representation of the IP address. This error is returned if a NULL pointer is passed in the pStringBuf or the StringBufSize parameter is zero. This error is returned if the Family parameter specified was not AF_INET or AF_INET6.Īn invalid parameter was passed to the function. The address family specified in the Family parameter is not supported.
#NTOPNG CERTIFICATE CODE#
If the function fails, the extended error code returned by WSAGetLastError can be one of the following values. Otherwise, a value of NULL is returned, and a specific error code can be retrieved by calling the WSAGetLastError for extended error information. InetNtop function returns a pointer to a buffer containing the string representation of IP address in standard format. On input, the length, in characters, of the buffer pointed to by the pStringBuf parameter. When the Family parameter is AF_INET6, then the pAddr parameter must point to an IN6_ADDR structure with the IPv6 address to convert.Ī pointer to a buffer in which to store the NULL-terminated string representation of the IP address.įor an IPv4 address, this buffer should be large enough to hold at least 16 characters.įor an IPv6 address, this buffer should be large enough to hold at least 46 characters. When the Family parameter is AF_INET, then the pAddr parameter must point to an IN_ADDR structure with the IPv4 address to convert. When this parameter is specified, this function returns an IPv6 address string.Ī pointer to the IP address in network byte to convert to a string. The Internet Protocol version 6 (IPv6) address family. When this parameter is specified, this function returns an IPv4 address string. The Internet Protocol version 4 (IPv4) address family. The values currently supported are AF_INET and AF_INET6. Note that the values for the AF_ address family and PF_ protocol family constants are identical (for example, AF_INET and PF_INET), so either constant can be used. Note that the Ws2def.h header file is automatically included in Winsock2.h, and should never be used directly. Possible values for the address family are defined in the Ws2def.h header file. The ANSI version of this function is inet_ntop. The InetNtop function converts an IPv4 or IPv6 Internet network address into a string in Internet standard format.
