CInternetServer::IsAddressRoutable Method  
 
BOOL IsAddressRoutable(
  LPCTSTR lpszAddress  
);
BOOL IsAddressRoutable(
  LPINTERNET_ADDRESS lpAddress  
);

The IsAddressRoutable method determines if the IP address is routable over the Internet.

Parameters

lpszAddress
A string that specifies the IP address.
lpAddress
A pointer to an INTERNET_ADDRESS structure that specifies the IP address.

Return Value

If the method succeeds and the IP address is routable over the Internet, the return value is non-zero. If the method fails or the address is not routable, the return value is zero. If the parameter is NULL, or the address family is not supported, the last error code will be updated. If the address is valid but not routable, the last error code will be set to NO_ERROR.

Remarks

A routable IP address is one that can be reached by anyone over the public Internet. These are also commonly referred to as "public addresses" which are typically assigned to networks and individual hosts by an Internet service provider. There are also certain addresses that are not routable over the Internet, and used to address systems over a local network or private intranet. This function can be used to determine if a given IP address is public (routable) or private.

Requirements

Minimum Desktop Platform: Windows 7 Service Pack 1
Minimum Server Platform: Windows Server 2008 R2 Service Pack 1
Header File: cswsock11.h
Import Library: cswskv11.lib

See Also

GetAddress, GetExternalAddress, IsAddressNull, INTERNET_ADDRESS