Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
e8f9a6fc
Commit
e8f9a6fc
authored
Mar 05, 2009
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
iphlpapi: Implemented getInterfaceStatsByName for Solaris.
parent
026491d8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
0 deletions
+40
-0
ipstats.c
dlls/iphlpapi/ipstats.c
+40
-0
No files found.
dlls/iphlpapi/ipstats.c
View file @
e8f9a6fc
...
...
@@ -161,6 +161,16 @@ static DWORD kstat_get_ui32( kstat_t *ksp, const char *name )
if
(
!
strcmp
(
data
[
i
].
name
,
name
))
return
data
[
i
].
value
.
ui32
;
return
0
;
}
static
ULONGLONG
kstat_get_ui64
(
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
.
ui64
;
return
0
;
}
#endif
DWORD
getInterfaceStatsByName
(
const
char
*
name
,
PMIB_IFROW
entry
)
...
...
@@ -199,6 +209,36 @@ DWORD getInterfaceStatsByName(const char *name, PMIB_IFROW entry)
ret
=
NO_ERROR
;
}
}
#elif defined(HAVE_LIBKSTAT)
{
kstat_ctl_t
*
kc
;
kstat_t
*
ksp
;
if
((
kc
=
kstat_open
())
&&
(
ksp
=
kstat_lookup
(
kc
,
NULL
,
-
1
,
(
char
*
)
name
))
&&
kstat_read
(
kc
,
ksp
,
NULL
)
!=
-
1
&&
ksp
->
ks_type
==
KSTAT_TYPE_NAMED
)
{
entry
->
dwMtu
=
1500
;
/* FIXME */
entry
->
dwSpeed
=
min
(
kstat_get_ui64
(
ksp
,
"ifspeed"
),
~
0u
);
entry
->
dwInOctets
=
kstat_get_ui32
(
ksp
,
"rbytes"
);
entry
->
dwInNUcastPkts
=
kstat_get_ui32
(
ksp
,
"multircv"
);
entry
->
dwInNUcastPkts
+=
kstat_get_ui32
(
ksp
,
"brdcstrcv"
);
entry
->
dwInUcastPkts
=
kstat_get_ui32
(
ksp
,
"ipackets"
)
-
entry
->
dwInNUcastPkts
;
entry
->
dwInDiscards
=
kstat_get_ui32
(
ksp
,
"norcvbuf"
);
entry
->
dwInErrors
=
kstat_get_ui32
(
ksp
,
"ierrors"
);
entry
->
dwInUnknownProtos
=
kstat_get_ui32
(
ksp
,
"unknowns"
);
entry
->
dwOutOctets
=
kstat_get_ui32
(
ksp
,
"obytes"
);
entry
->
dwOutNUcastPkts
=
kstat_get_ui32
(
ksp
,
"multixmt"
);
entry
->
dwOutNUcastPkts
+=
kstat_get_ui32
(
ksp
,
"brdcstxmt"
);
entry
->
dwOutUcastPkts
=
kstat_get_ui32
(
ksp
,
"opackets"
)
-
entry
->
dwOutNUcastPkts
;
entry
->
dwOutDiscards
=
0
;
/* FIXME */
entry
->
dwOutErrors
=
kstat_get_ui32
(
ksp
,
"oerrors"
);
entry
->
dwOutQLen
=
kstat_get_ui32
(
ksp
,
"noxmtbuf"
);
ret
=
NO_ERROR
;
}
if
(
kc
)
kstat_close
(
kc
);
}
#elif defined(HAVE_SYS_SYSCTL_H) && defined(NET_RT_IFLIST)
{
int
mib
[]
=
{
CTL_NET
,
PF_ROUTE
,
0
,
AF_INET
,
NET_RT_IFLIST
,
if_nametoindex
(
name
)};
...
...
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