Alexandre Julliard : iphlpapi: Move the ip/icmp/tcp/ udp statistics functions to ipstats.c.
Alexandre Julliard
julliard at winehq.org
Wed Mar 4 09:00:49 CST 2009
Module: wine
Branch: master
Commit: b35e43d9a0e23e56cfe859217728b0bb702b83b8
URL: http://source.winehq.org/git/wine.git/?a=commit;h=b35e43d9a0e23e56cfe859217728b0bb702b83b8
Author: Alexandre Julliard <julliard at winehq.org>
Date: Tue Mar 3 19:46:03 2009 +0100
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 3481f86..547b666 100644
--- a/dlls/iphlpapi/iphlpapi_main.c
+++ b/dlls/iphlpapi/iphlpapi_main.c
@@ -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.
diff --git a/dlls/iphlpapi/ipstats.c b/dlls/iphlpapi/ipstats.c
index f630906..c50d611 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 aad931c..d7aeb65 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);
More information about the wine-cvs
mailing list