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
a00e693f
Commit
a00e693f
authored
Jun 24, 2008
by
Eric Durbin
Committed by
Alexandre Julliard
Jun 26, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
iphlpapi: Implement getIPStats on FreeBSD.
parent
6d4eab9a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
0 deletions
+52
-0
ipstats.c
dlls/iphlpapi/ipstats.c
+52
-0
No files found.
dlls/iphlpapi/ipstats.c
View file @
a00e693f
...
...
@@ -380,6 +380,57 @@ DWORD getICMPStats(MIB_ICMP *stats)
DWORD
getIPStats
(
PMIB_IPSTATS
stats
)
{
#if defined(HAVE_SYS_SYSCTL_H) && defined(IPCTL_STATS)
int
mib
[]
=
{
CTL_NET
,
PF_INET
,
IPPROTO_IP
,
IPCTL_STATS
};
#define MIB_LEN (sizeof(mib) / sizeof(mib[0]))
int
ip_ttl
,
ip_forwarding
;
struct
ipstat
ip_stat
;
size_t
needed
;
if
(
!
stats
)
return
ERROR_INVALID_PARAMETER
;
needed
=
sizeof
(
ip_stat
);
if
(
sysctl
(
mib
,
MIB_LEN
,
&
ip_stat
,
&
needed
,
NULL
,
0
)
==
-
1
)
{
ERR
(
"failed to get ipstat
\n
"
);
return
ERROR_NOT_SUPPORTED
;
}
needed
=
sizeof
(
ip_ttl
);
if
(
sysctlbyname
(
"net.inet.ip.ttl"
,
&
ip_ttl
,
&
needed
,
NULL
,
0
)
==
-
1
)
{
ERR
(
"failed to get ip Default TTL
\n
"
);
return
ERROR_NOT_SUPPORTED
;
}
needed
=
sizeof
(
ip_forwarding
);
if
(
sysctlbyname
(
"net.inet.ip.forwarding"
,
&
ip_forwarding
,
&
needed
,
NULL
,
0
)
==
-
1
)
{
ERR
(
"failed to get ip forwarding
\n
"
);
return
ERROR_NOT_SUPPORTED
;
}
stats
->
dwForwarding
=
ip_forwarding
;
stats
->
dwDefaultTTL
=
ip_ttl
;
stats
->
dwInDelivers
=
ip_stat
.
ips_delivered
;
stats
->
dwInHdrErrors
=
ip_stat
.
ips_badhlen
+
ip_stat
.
ips_badsum
+
ip_stat
.
ips_tooshort
+
ip_stat
.
ips_badlen
;
stats
->
dwInAddrErrors
=
ip_stat
.
ips_cantforward
;
stats
->
dwInReceives
=
ip_stat
.
ips_total
;
stats
->
dwForwDatagrams
=
ip_stat
.
ips_forward
;
stats
->
dwInUnknownProtos
=
ip_stat
.
ips_noproto
;
stats
->
dwInDiscards
=
ip_stat
.
ips_fragdropped
;
stats
->
dwOutDiscards
=
ip_stat
.
ips_odropped
;
stats
->
dwReasmOks
=
ip_stat
.
ips_reassembled
;
stats
->
dwFragOks
=
ip_stat
.
ips_fragmented
;
stats
->
dwFragFails
=
ip_stat
.
ips_cantfrag
;
stats
->
dwReasmTimeout
=
ip_stat
.
ips_fragtimeout
;
stats
->
dwOutNoRoutes
=
ip_stat
.
ips_noroute
;
stats
->
dwOutRequests
=
ip_stat
.
ips_localout
;
stats
->
dwReasmReqds
=
ip_stat
.
ips_fragments
;
return
NO_ERROR
;
#else
FILE
*
fp
;
if
(
!
stats
)
...
...
@@ -493,6 +544,7 @@ DWORD getIPStats(PMIB_IPSTATS stats)
}
return
NO_ERROR
;
#endif
}
DWORD
getTCPStats
(
MIB_TCPSTATS
*
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