Expand Minimize

GetIpStatisticsEx function

The GetIpStatisticsEx function retrieves the Internet Protocol (IP) statistics for the current computer. The GetIpStatisticsEx function differs from the GetIpStatistics function in that GetIpStatisticsEx also supports the Internet Protocol version 6 (IPv6) protocol family.

Syntax


DWORD GetIpStatisticsEx(
  _Out_  PMIB_IPSTATS pStats,
  _In_   DWORD dwFamily
);

Parameters

pStats [out]

A pointer to a MIB_IPSTATS structure that receives the IP statistics for the local computer.

dwFamily [in]

The protocol family for which to retrieve statistics. This parameter must be one of the following values:

ValueMeaning
AF_INET

Internet Protocol version 4 (IPv4).

AF_INET6

Internet Protocol version 6 (IPv6).

 

Return value

If the function succeeds, the return value is NO_ERROR.

If the function fails, the return value is one of the following error codes.

Return codeDescription
ERROR_INVALID_PARAMETER

The pStats parameter is NULL or does not point to valid memory, or the dwFamily parameter is not a valid value.

ERROR_NOT_SUPPORTED

This function is not supported on the operating system on which the function call was made.

Other

Use FormatMessage to obtain the message string for the returned error.

 

Remarks

The GetIpStatisticsEx can be used to obtain the IP statistics for either IPv4 or IPv6 on the local computer.

The GetIpStatistics function returns the statistics for only IPv4 on the local computer.

Requirements

Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

Iphlpapi.h

Library

Iphlpapi.lib

DLL

Iphlpapi.dll

See also

IP Helper Start Page
IP Helper Function Reference
GetIpStatistics
GetTcpStatisticsEx
GetUdpStatisticsEx
MIB_IPSTATS

 

 

Community Additions

ADD
Show:
© 2014 Microsoft