Alexandre Julliard : iphlpapi: Implemented GetTcpStatistics for Solaris.

Alexandre Julliard julliard at winehq.org
Fri Mar 6 09:49:30 CST 2009


Module: wine
Branch: master
Commit: 62740f72d75801417afc464a36978b7c12a7847b
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=62740f72d75801417afc464a36978b7c12a7847b

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Thu Mar  5 19:27:54 2009 +0100

iphlpapi: Implemented GetTcpStatistics for Solaris.

---

 dlls/iphlpapi/ipstats.c |   30 ++++++++++++++++++++++++++++++
 1 files changed, 30 insertions(+), 0 deletions(-)

diff --git a/dlls/iphlpapi/ipstats.c b/dlls/iphlpapi/ipstats.c
index e8e8781..7db48c6 100644
--- a/dlls/iphlpapi/ipstats.c
+++ b/dlls/iphlpapi/ipstats.c
@@ -649,6 +649,36 @@ DWORD WINAPI GetTcpStatistics(PMIB_TCPSTATS stats)
             ret = NO_ERROR;
         }
     }
+#elif defined(HAVE_LIBKSTAT)
+    {
+        static char tcp[] = "tcp";
+        kstat_ctl_t *kc;
+        kstat_t *ksp;
+
+        if ((kc = kstat_open()) &&
+            (ksp = kstat_lookup( kc, tcp, 0, tcp )) &&
+            kstat_read( kc, ksp, NULL ) != -1 &&
+            ksp->ks_type == KSTAT_TYPE_NAMED)
+        {
+            stats->dwRtoAlgorithm = kstat_get_ui32( ksp, "rtoAlgorithm" );
+            stats->dwRtoMin       = kstat_get_ui32( ksp, "rtoMin" );
+            stats->dwRtoMax       = kstat_get_ui32( ksp, "rtoMax" );
+            stats->dwMaxConn      = kstat_get_ui32( ksp, "maxConn" );
+            stats->dwActiveOpens  = kstat_get_ui32( ksp, "activeOpens" );
+            stats->dwPassiveOpens = kstat_get_ui32( ksp, "passiveOpens" );
+            stats->dwAttemptFails = kstat_get_ui32( ksp, "attemptFails" );
+            stats->dwEstabResets  = kstat_get_ui32( ksp, "estabResets" );
+            stats->dwCurrEstab    = kstat_get_ui32( ksp, "currEstab" );
+            stats->dwInSegs       = kstat_get_ui32( ksp, "inSegs" );
+            stats->dwOutSegs      = kstat_get_ui32( ksp, "outSegs" );
+            stats->dwRetransSegs  = kstat_get_ui32( ksp, "retransSegs" );
+            stats->dwInErrs       = kstat_get_ui32( ksp, "inErrs" );
+            stats->dwOutRsts      = kstat_get_ui32( ksp, "outRsts" );
+            stats->dwNumConns     = kstat_get_ui32( ksp, "connTableSize" );
+            ret = NO_ERROR;
+        }
+        if (kc) kstat_close( kc );
+    }
 #elif defined(HAVE_SYS_SYSCTL_H) && defined(UDPCTL_STATS)
     {
 #ifndef TCPTV_MIN  /* got removed in Mac OS X for some reason */




More information about the wine-cvs mailing list