iphlpapi: Move the ip/icmp/tcp/udp statistics functions to ipstats.c.
This commit is contained in:
parent
566cb8c7a3
commit
b35e43d9a0
|
@ -732,29 +732,6 @@ DWORD WINAPI GetFriendlyIfIndex(DWORD IfIndex)
|
|||
}
|
||||
|
||||
|
||||
/******************************************************************
|
||||
* GetIcmpStatistics (IPHLPAPI.@)
|
||||
*
|
||||
* Get the ICMP statistics for the local computer.
|
||||
*
|
||||
* PARAMS
|
||||
* pStats [Out] buffer for ICMP statistics
|
||||
*
|
||||
* RETURNS
|
||||
* Success: NO_ERROR
|
||||
* Failure: error code from winerror.h
|
||||
*/
|
||||
DWORD WINAPI GetIcmpStatistics(PMIB_ICMP pStats)
|
||||
{
|
||||
DWORD ret;
|
||||
|
||||
TRACE("pStats %p\n", pStats);
|
||||
ret = getICMPStats(pStats);
|
||||
TRACE("returning %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************
|
||||
* GetIfEntry (IPHLPAPI.@)
|
||||
*
|
||||
|
@ -1109,29 +1086,6 @@ DWORD WINAPI GetIpNetTable(PMIB_IPNETTABLE pIpNetTable, PULONG pdwSize, BOOL bOr
|
|||
}
|
||||
|
||||
|
||||
/******************************************************************
|
||||
* GetIpStatistics (IPHLPAPI.@)
|
||||
*
|
||||
* Get the IP statistics for the local computer.
|
||||
*
|
||||
* PARAMS
|
||||
* pStats [Out] buffer for IP statistics
|
||||
*
|
||||
* RETURNS
|
||||
* Success: NO_ERROR
|
||||
* Failure: error code from winerror.h
|
||||
*/
|
||||
DWORD WINAPI GetIpStatistics(PMIB_IPSTATS pStats)
|
||||
{
|
||||
DWORD ret;
|
||||
|
||||
TRACE("pStats %p\n", pStats);
|
||||
ret = getIPStats(pStats);
|
||||
TRACE("returning %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************
|
||||
* GetNetworkParams (IPHLPAPI.@)
|
||||
*
|
||||
|
@ -1302,29 +1256,6 @@ BOOL WINAPI GetRTTAndHopCount(IPAddr DestIpAddress, PULONG HopCount, ULONG MaxHo
|
|||
}
|
||||
|
||||
|
||||
/******************************************************************
|
||||
* GetTcpStatistics (IPHLPAPI.@)
|
||||
*
|
||||
* Get the TCP statistics for the local computer.
|
||||
*
|
||||
* PARAMS
|
||||
* pStats [Out] buffer for TCP statistics
|
||||
*
|
||||
* RETURNS
|
||||
* Success: NO_ERROR
|
||||
* Failure: error code from winerror.h
|
||||
*/
|
||||
DWORD WINAPI GetTcpStatistics(PMIB_TCPSTATS pStats)
|
||||
{
|
||||
DWORD ret;
|
||||
|
||||
TRACE("pStats %p\n", pStats);
|
||||
ret = getTCPStats(pStats);
|
||||
TRACE("returning %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************
|
||||
* GetTcpTable (IPHLPAPI.@)
|
||||
*
|
||||
|
@ -1374,29 +1305,6 @@ DWORD WINAPI GetTcpTable(PMIB_TCPTABLE pTcpTable, PDWORD pdwSize, BOOL bOrder)
|
|||
}
|
||||
|
||||
|
||||
/******************************************************************
|
||||
* GetUdpStatistics (IPHLPAPI.@)
|
||||
*
|
||||
* Get the UDP statistics for the local computer.
|
||||
*
|
||||
* PARAMS
|
||||
* pStats [Out] buffer for UDP statistics
|
||||
*
|
||||
* RETURNS
|
||||
* Success: NO_ERROR
|
||||
* Failure: error code from winerror.h
|
||||
*/
|
||||
DWORD WINAPI GetUdpStatistics(PMIB_UDPSTATS pStats)
|
||||
{
|
||||
DWORD ret;
|
||||
|
||||
TRACE("pStats %p\n", pStats);
|
||||
ret = getUDPStats(pStats);
|
||||
TRACE("returning %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************
|
||||
* GetUdpTable (IPHLPAPI.@)
|
||||
*
|
||||
|
|
|
@ -284,7 +284,20 @@ DWORD getInterfaceStatsByName(const char *name, PMIB_IFROW entry)
|
|||
#endif
|
||||
}
|
||||
|
||||
DWORD getICMPStats(MIB_ICMP *stats)
|
||||
|
||||
/******************************************************************
|
||||
* GetIcmpStatistics (IPHLPAPI.@)
|
||||
*
|
||||
* Get the ICMP statistics for the local computer.
|
||||
*
|
||||
* PARAMS
|
||||
* stats [Out] buffer for ICMP statistics
|
||||
*
|
||||
* RETURNS
|
||||
* Success: NO_ERROR
|
||||
* Failure: error code from winerror.h
|
||||
*/
|
||||
DWORD WINAPI GetIcmpStatistics(PMIB_ICMP stats)
|
||||
{
|
||||
#if defined(HAVE_SYS_SYSCTL_H) && defined(ICMPCTL_STATS)
|
||||
int mib[] = {CTL_NET, PF_INET, IPPROTO_ICMP, ICMPCTL_STATS};
|
||||
|
@ -481,7 +494,20 @@ DWORD getICMPStats(MIB_ICMP *stats)
|
|||
#endif
|
||||
}
|
||||
|
||||
DWORD getIPStats(PMIB_IPSTATS stats)
|
||||
|
||||
/******************************************************************
|
||||
* GetIpStatistics (IPHLPAPI.@)
|
||||
*
|
||||
* Get the IP statistics for the local computer.
|
||||
*
|
||||
* PARAMS
|
||||
* stats [Out] buffer for IP statistics
|
||||
*
|
||||
* RETURNS
|
||||
* Success: NO_ERROR
|
||||
* Failure: error code from winerror.h
|
||||
*/
|
||||
DWORD WINAPI GetIpStatistics(PMIB_IPSTATS stats)
|
||||
{
|
||||
#if defined(HAVE_SYS_SYSCTL_H) && defined(IPCTL_STATS)
|
||||
int mib[] = {CTL_NET, PF_INET, IPPROTO_IP, IPCTL_STATS};
|
||||
|
@ -655,7 +681,20 @@ DWORD getIPStats(PMIB_IPSTATS stats)
|
|||
#endif
|
||||
}
|
||||
|
||||
DWORD getTCPStats(MIB_TCPSTATS *stats)
|
||||
|
||||
/******************************************************************
|
||||
* GetTcpStatistics (IPHLPAPI.@)
|
||||
*
|
||||
* Get the TCP statistics for the local computer.
|
||||
*
|
||||
* PARAMS
|
||||
* stats [Out] buffer for TCP statistics
|
||||
*
|
||||
* RETURNS
|
||||
* Success: NO_ERROR
|
||||
* Failure: error code from winerror.h
|
||||
*/
|
||||
DWORD WINAPI GetTcpStatistics(PMIB_TCPSTATS stats)
|
||||
{
|
||||
#if defined(HAVE_SYS_SYSCTL_H) && defined(UDPCTL_STATS)
|
||||
#ifndef TCPTV_MIN /* got removed in Mac OS X for some reason */
|
||||
|
@ -797,7 +836,20 @@ DWORD getTCPStats(MIB_TCPSTATS *stats)
|
|||
#endif
|
||||
}
|
||||
|
||||
DWORD getUDPStats(MIB_UDPSTATS *stats)
|
||||
|
||||
/******************************************************************
|
||||
* GetUdpStatistics (IPHLPAPI.@)
|
||||
*
|
||||
* Get the UDP statistics for the local computer.
|
||||
*
|
||||
* PARAMS
|
||||
* stats [Out] buffer for UDP statistics
|
||||
*
|
||||
* RETURNS
|
||||
* Success: NO_ERROR
|
||||
* Failure: error code from winerror.h
|
||||
*/
|
||||
DWORD WINAPI GetUdpStatistics(PMIB_UDPSTATS stats)
|
||||
{
|
||||
#if defined(HAVE_SYS_SYSCTL_H) && defined(UDPCTL_STATS)
|
||||
int mib[] = {CTL_NET, PF_INET, IPPROTO_UDP, UDPCTL_STATS};
|
||||
|
|
|
@ -32,26 +32,6 @@
|
|||
*/
|
||||
DWORD getInterfaceStatsByName(const char *name, PMIB_IFROW entry);
|
||||
|
||||
/* Gets ICMP statistics into stats. Returns ERROR_INVALID_PARAMETER if stats is
|
||||
* NULL, NO_ERROR otherwise.
|
||||
*/
|
||||
DWORD getICMPStats(MIB_ICMP *stats);
|
||||
|
||||
/* Gets IP statistics into stats. Returns ERROR_INVALID_PARAMETER if stats is
|
||||
* NULL, NO_ERROR otherwise.
|
||||
*/
|
||||
DWORD getIPStats(PMIB_IPSTATS stats);
|
||||
|
||||
/* Gets TCP statistics into stats. Returns ERROR_INVALID_PARAMETER if stats is
|
||||
* NULL, NO_ERROR otherwise.
|
||||
*/
|
||||
DWORD getTCPStats(MIB_TCPSTATS *stats);
|
||||
|
||||
/* Gets UDP statistics into stats. Returns ERROR_INVALID_PARAMETER if stats is
|
||||
* NULL, NO_ERROR otherwise.
|
||||
*/
|
||||
DWORD getUDPStats(MIB_UDPSTATS *stats);
|
||||
|
||||
DWORD WINAPI AllocateAndGetUdpTableFromStack(PMIB_UDPTABLE *ppUdpTable, BOOL bOrder, HANDLE heap, DWORD flags);
|
||||
DWORD WINAPI AllocateAndGetTcpTableFromStack(PMIB_TCPTABLE *ppTcpTable, BOOL bOrder, HANDLE heap, DWORD flags);
|
||||
DWORD WINAPI AllocateAndGetIpNetTableFromStack(PMIB_IPNETTABLE *ppIpNetTable, BOOL bOrder, HANDLE heap, DWORD flags);
|
||||
|
|
Loading…
Reference in New Issue