Commit b35e43d9 authored by Alexandre Julliard's avatar Alexandre Julliard

iphlpapi: Move the ip/icmp/tcp/udp statistics functions to ipstats.c.

parent 566cb8c7
......@@ -733,29 +733,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.@)
*
* Get information about an interface.
......@@ -1110,29 +1087,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.@)
*
* Get the network parameters for the local computer.
......@@ -1303,29 +1257,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.@)
*
* Get the table of active TCP connections.
......@@ -1375,29 +1306,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.@)
*
* Get a table of active UDP connections.
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment