From b35e43d9a0e23e56cfe859217728b0bb702b83b8 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Tue, 3 Mar 2009 19:46:03 +0100 Subject: [PATCH] iphlpapi: Move the ip/icmp/tcp/udp statistics functions to ipstats.c. --- dlls/iphlpapi/iphlpapi_main.c | 92 ----------------------------------- dlls/iphlpapi/ipstats.c | 60 +++++++++++++++++++++-- dlls/iphlpapi/ipstats.h | 20 -------- 3 files changed, 56 insertions(+), 116 deletions(-) diff --git a/dlls/iphlpapi/iphlpapi_main.c b/dlls/iphlpapi/iphlpapi_main.c index 3481f869c8..547b6667b4 100644 --- a/dlls/iphlpapi/iphlpapi_main.c +++ b/dlls/iphlpapi/iphlpapi_main.c @@ -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.@) * diff --git a/dlls/iphlpapi/ipstats.c b/dlls/iphlpapi/ipstats.c index f630906cd2..c50d611c5f 100644 --- a/dlls/iphlpapi/ipstats.c +++ b/dlls/iphlpapi/ipstats.c @@ -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}; diff --git a/dlls/iphlpapi/ipstats.h b/dlls/iphlpapi/ipstats.h index aad931c4ba..d7aeb658cf 100644 --- a/dlls/iphlpapi/ipstats.h +++ b/dlls/iphlpapi/ipstats.h @@ -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); -- 2.32.0.93.g670b81a890