Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
a82f443c
Commit
a82f443c
authored
Mar 05, 2009
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
iphlpapi: Implemented GetIcmpStatistics for Solaris.
parent
de1d7fbe
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
1 deletion
+57
-1
Makefile.in
dlls/iphlpapi/Makefile.in
+1
-1
ipstats.c
dlls/iphlpapi/ipstats.c
+56
-0
No files found.
dlls/iphlpapi/Makefile.in
View file @
a82f443c
...
...
@@ -5,7 +5,7 @@ VPATH = @srcdir@
MODULE
=
iphlpapi.dll
IMPORTLIB
=
iphlpapi
IMPORTS
=
advapi32 kernel32
EXTRALIBS
=
@RESOLVLIBS@
EXTRALIBS
=
@RESOLVLIBS@
@LIBKSTAT@
C_SRCS
=
\
icmp.c
\
...
...
dlls/iphlpapi/ipstats.c
View file @
a82f443c
...
...
@@ -107,6 +107,9 @@
#ifdef HAVE_SYS_SYSCTL_H
#include <sys/sysctl.h>
#endif
#ifdef HAVE_KSTAT_H
#include <kstat.h>
#endif
#ifndef ROUNDUP
#define ROUNDUP(a) \
...
...
@@ -148,6 +151,18 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
iphlpapi
);
#ifdef HAVE_LIBKSTAT
static
DWORD
kstat_get_ui32
(
kstat_t
*
ksp
,
const
char
*
name
)
{
unsigned
int
i
;
kstat_named_t
*
data
=
ksp
->
ks_data
;
for
(
i
=
0
;
i
<
ksp
->
ks_ndata
;
i
++
)
if
(
!
strcmp
(
data
[
i
].
name
,
name
))
return
data
[
i
].
value
.
ui32
;
return
0
;
}
#endif
DWORD
getInterfaceStatsByName
(
const
char
*
name
,
PMIB_IFROW
entry
)
{
DWORD
ret
=
ERROR_NOT_SUPPORTED
;
...
...
@@ -308,6 +323,47 @@ DWORD WINAPI GetIcmpStatistics(PMIB_ICMP stats)
ret
=
NO_ERROR
;
}
}
#elif defined(HAVE_LIBKSTAT)
{
static
char
ip
[]
=
"ip"
,
icmp
[]
=
"icmp"
;
kstat_ctl_t
*
kc
;
kstat_t
*
ksp
;
if
((
kc
=
kstat_open
())
&&
(
ksp
=
kstat_lookup
(
kc
,
ip
,
0
,
icmp
))
&&
kstat_read
(
kc
,
ksp
,
NULL
)
!=
-
1
&&
ksp
->
ks_type
==
KSTAT_TYPE_NAMED
)
{
stats
->
stats
.
icmpInStats
.
dwMsgs
=
kstat_get_ui32
(
ksp
,
"inMsgs"
);
stats
->
stats
.
icmpInStats
.
dwErrors
=
kstat_get_ui32
(
ksp
,
"inErrors"
);
stats
->
stats
.
icmpInStats
.
dwDestUnreachs
=
kstat_get_ui32
(
ksp
,
"inDestUnreachs"
);
stats
->
stats
.
icmpInStats
.
dwTimeExcds
=
kstat_get_ui32
(
ksp
,
"inTimeExcds"
);
stats
->
stats
.
icmpInStats
.
dwParmProbs
=
kstat_get_ui32
(
ksp
,
"inParmProbs"
);
stats
->
stats
.
icmpInStats
.
dwSrcQuenchs
=
kstat_get_ui32
(
ksp
,
"inSrcQuenchs"
);
stats
->
stats
.
icmpInStats
.
dwRedirects
=
kstat_get_ui32
(
ksp
,
"inRedirects"
);
stats
->
stats
.
icmpInStats
.
dwEchos
=
kstat_get_ui32
(
ksp
,
"inEchos"
);
stats
->
stats
.
icmpInStats
.
dwEchoReps
=
kstat_get_ui32
(
ksp
,
"inEchoReps"
);
stats
->
stats
.
icmpInStats
.
dwTimestamps
=
kstat_get_ui32
(
ksp
,
"inTimestamps"
);
stats
->
stats
.
icmpInStats
.
dwTimestampReps
=
kstat_get_ui32
(
ksp
,
"inTimestampReps"
);
stats
->
stats
.
icmpInStats
.
dwAddrMasks
=
kstat_get_ui32
(
ksp
,
"inAddrMasks"
);
stats
->
stats
.
icmpInStats
.
dwAddrMaskReps
=
kstat_get_ui32
(
ksp
,
"inAddrMaskReps"
);
stats
->
stats
.
icmpOutStats
.
dwMsgs
=
kstat_get_ui32
(
ksp
,
"outMsgs"
);
stats
->
stats
.
icmpOutStats
.
dwErrors
=
kstat_get_ui32
(
ksp
,
"outErrors"
);
stats
->
stats
.
icmpOutStats
.
dwDestUnreachs
=
kstat_get_ui32
(
ksp
,
"outDestUnreachs"
);
stats
->
stats
.
icmpOutStats
.
dwTimeExcds
=
kstat_get_ui32
(
ksp
,
"outTimeExcds"
);
stats
->
stats
.
icmpOutStats
.
dwParmProbs
=
kstat_get_ui32
(
ksp
,
"outParmProbs"
);
stats
->
stats
.
icmpOutStats
.
dwSrcQuenchs
=
kstat_get_ui32
(
ksp
,
"outSrcQuenchs"
);
stats
->
stats
.
icmpOutStats
.
dwRedirects
=
kstat_get_ui32
(
ksp
,
"outRedirects"
);
stats
->
stats
.
icmpOutStats
.
dwEchos
=
kstat_get_ui32
(
ksp
,
"outEchos"
);
stats
->
stats
.
icmpOutStats
.
dwEchoReps
=
kstat_get_ui32
(
ksp
,
"outEchoReps"
);
stats
->
stats
.
icmpOutStats
.
dwTimestamps
=
kstat_get_ui32
(
ksp
,
"outTimestamps"
);
stats
->
stats
.
icmpOutStats
.
dwTimestampReps
=
kstat_get_ui32
(
ksp
,
"outTimestampReps"
);
stats
->
stats
.
icmpOutStats
.
dwAddrMasks
=
kstat_get_ui32
(
ksp
,
"outAddrMasks"
);
stats
->
stats
.
icmpOutStats
.
dwAddrMaskReps
=
kstat_get_ui32
(
ksp
,
"outAddrMaskReps"
);
ret
=
NO_ERROR
;
}
if
(
kc
)
kstat_close
(
kc
);
}
#elif defined(HAVE_SYS_SYSCTL_H) && defined(ICMPCTL_STATS)
{
int
mib
[]
=
{
CTL_NET
,
PF_INET
,
IPPROTO_ICMP
,
ICMPCTL_STATS
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment