Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexey Alyaev
wine
Commits
a00e693f
Commit
a00e693f
authored
16 years ago
by
EA Durbin
Committed by
Alexandre Julliard
16 years ago
Browse files
Options
Downloads
Patches
Plain Diff
iphlpapi: Implement getIPStats on FreeBSD.
parent
6d4eab9a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/iphlpapi/ipstats.c
+52
-0
52 additions, 0 deletions
dlls/iphlpapi/ipstats.c
with
52 additions
and
0 deletions
dlls/iphlpapi/ipstats.c
+
52
−
0
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
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment