| |
| INT WINAPI InetEnumNetworkAddresses(
|
| |
INT nAddressFamily, |
|
| |
LPINTERNET_ADDRESS lpAddressList, |
|
| |
INT nMaxAddresses |
|
| );
|
The InetEnumNetworkAddresses function returns the list of
network addresses that are configured for the local host.
Parameters
- nAddressFamily
- An integer which identifies the type of IP address that should
be returned by this function. It may be one of the following
values:
| Constant |
Description |
| INET_ADDRESS_UNKNOWN |
Return both IPv4 or IPv6 address for the local host, depending
on how the system is configured and which network interfaces are
enabled. This option is only recommended for applications that
support IPv6. |
| INET_ADDRESS_DEFAULT |
Return the IP addresses in the default format. This is
currently the same as specifying INET_ADDRESS_IPV4, however an
application should not depend on this behavior and for future
compatibility should be designed to handle either IPv4 or IPv6
addresses. |
| INET_ADDRESS_IPV4 |
Specifies that the addresses should be in IPv4 format. The
first four bytes of the ipNumber array are significant and
contains the IP address. The remaining bytes are not significant
and an application should not depend on them having any particular
value, including zero. |
| INET_ADDRESS_IPV6 |
Specifies that the addresses should be in IPv6 format. All
bytes in the ipNumber array are significant. |
- lpAddressList
- A pointer to an array of INTERNET_ADDRESS structures that will
contain the IP address of each local network interface.
- nMaxAddresses
- Maximum number of addresses to be returned.
Return Value
If the function succeeds, the return value is the number of
network addresses that are configured for the local host. If the
function fails, the return value is INET_ERROR. To get extended
error information, call InetGetLastError.
Remarks
If the nAddressFamily parameter is specified as
INET_ADDRESS_UNKNOWN, the application must be prepared to handle
IPv6 addresses because it is possible that an IPv6 address string
has been specified. For legacy applications that only recognize
IPv4 addresses, the nAddressFamily member should always be
specified as INET_ADDRESS_IPV4 to ensure that only IPv4 addresses
are returned.
Requirements
Client: Requires Windows 7, Windows Vista or Windows
XP.
Server: Requires Windows Server 2008 or Windows Server
2003.
Header: Include cswsock7.h.
Library: Use cswskav7.lib.
See Also
InetFormatAddress
|
|