CDnsClient::GetAddressFamily Method  
 
INT GetAddressFamily(
  LPCTSTR lpszAddress  
);

The GetAddressFamily method returns the address family for the specified IP address.

Parameters

lpszAddress
A pointer to a null-terminated string which specifies an IPv4 or IPv6 address.

Return Value

If the method succeeds, the return value is AF_INET if the address is in IPv4 format, or AF_INET6 if the address is in IPv6 format. If the address string is not in a recognized format, it returns AF_UNSPEC.

Requirements

Client: Requires Windows 7, Windows Vista or Windows XP.
Server: Requires Windows Server 2008 or Windows Server 2003.
Header: Include cstools7.h.
Library: Use csdnsav7.lib.
Unicode: Implemented as Unicode and ANSI versions.

See Also

DnsGetHostAddress, DnsGetHostInfo, DnsGetHostServices, DnsGetMailExchange, DnsGetRecord