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
beea4d30
Commit
beea4d30
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 getTCPStats on FreeBSD.
parent
3d122aec
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
50 additions
and
2 deletions
+50
-2
configure
configure
+2
-1
configure.ac
configure.ac
+1
-1
ipstats.c
dlls/iphlpapi/ipstats.c
+40
-0
config.h.in
include/config.h.in
+3
-0
iprtrmib.h
include/iprtrmib.h
+4
-0
No files found.
configure
View file @
beea4d30
...
...
@@ -7559,7 +7559,8 @@ done
for
ac_header
in
netinet/tcp_var.h netinet/udp_var.h netinet/icmp_var.h
for
ac_header
in
netinet/tcp_var.h netinet/udp_var.h netinet/icmp_var.h netinet/tcp_timer.h
do
as_ac_Header
=
`
echo
"ac_cv_header_
$ac_header
"
|
$as_tr_sh
`
{
echo
"
$as_me
:
$LINENO
: checking for
$ac_header
"
>
&5
...
...
configure.ac
View file @
beea4d30
...
...
@@ -362,7 +362,7 @@ AC_CHECK_HEADERS([netinet/in_pcb.h netinet/ip_var.h net/if.h net/if_arp.h net/if
# include <netinet/in.h>
#endif])
AC_CHECK_HEADERS([netinet/tcp_var.h netinet/udp_var.h netinet/icmp_var.h],,,
AC_CHECK_HEADERS([netinet/tcp_var.h netinet/udp_var.h netinet/icmp_var.h
netinet/tcp_timer.h
],,,
[#include <sys/types.h>
#ifdef HAVE_ALIAS_H
# include <alias.h>
...
...
dlls/iphlpapi/ipstats.c
View file @
beea4d30
...
...
@@ -68,6 +68,9 @@
#ifdef HAVE_NETINET_TCP_VAR_H
#include <netinet/tcp_var.h>
#endif
#ifdef HAVE_NETINET_TCP_TIMER_H
#include <netinet/tcp_timer.h>
#endif
#ifdef HAVE_NETINET_IP_ICMP_H
#include <netinet/ip_icmp.h>
#endif
...
...
@@ -618,6 +621,42 @@ DWORD getIPStats(PMIB_IPSTATS stats)
DWORD
getTCPStats
(
MIB_TCPSTATS
*
stats
)
{
#if defined(HAVE_SYS_SYSCTL_H) && defined(UDPCTL_STATS)
int
mib
[]
=
{
CTL_NET
,
PF_INET
,
IPPROTO_TCP
,
TCPCTL_STATS
};
#define MIB_LEN (sizeof(mib) / sizeof(mib[0]))
#define hz 1000
struct
tcpstat
tcp_stat
;
size_t
needed
;
if
(
!
stats
)
return
ERROR_INVALID_PARAMETER
;
needed
=
sizeof
(
tcp_stat
);
if
(
sysctl
(
mib
,
MIB_LEN
,
&
tcp_stat
,
&
needed
,
NULL
,
0
)
==
-
1
)
{
ERR
(
"failed to get tcpstat
\n
"
);
return
ERROR_NOT_SUPPORTED
;
}
stats
->
dwRtoAlgorithm
=
MIB_TCP_RTO_VANJ
;
stats
->
dwRtoMin
=
TCPTV_MIN
;
stats
->
dwRtoMax
=
TCPTV_REXMTMAX
;
stats
->
dwMaxConn
=
-
1
;
stats
->
dwActiveOpens
=
tcp_stat
.
tcps_connattempt
;
stats
->
dwPassiveOpens
=
tcp_stat
.
tcps_accepts
;
stats
->
dwAttemptFails
=
tcp_stat
.
tcps_conndrops
;
stats
->
dwEstabResets
=
tcp_stat
.
tcps_drops
;
stats
->
dwCurrEstab
=
0
;
stats
->
dwInSegs
=
tcp_stat
.
tcps_rcvtotal
;
stats
->
dwOutSegs
=
tcp_stat
.
tcps_sndtotal
-
tcp_stat
.
tcps_sndrexmitpack
;
stats
->
dwRetransSegs
=
tcp_stat
.
tcps_sndrexmitpack
;
stats
->
dwInErrs
=
tcp_stat
.
tcps_rcvbadsum
+
tcp_stat
.
tcps_rcvbadoff
+
tcp_stat
.
tcps_rcvmemdrop
+
tcp_stat
.
tcps_rcvshort
;
stats
->
dwOutRsts
=
tcp_stat
.
tcps_sndctrl
-
tcp_stat
.
tcps_closed
;
stats
->
dwNumConns
=
tcp_stat
.
tcps_connects
;
return
NO_ERROR
;
#else
FILE
*
fp
;
if
(
!
stats
)
...
...
@@ -710,6 +749,7 @@ DWORD getTCPStats(MIB_TCPSTATS *stats)
}
return
NO_ERROR
;
#endif
}
DWORD
getUDPStats
(
MIB_UDPSTATS
*
stats
)
...
...
include/config.h.in
View file @
beea4d30
...
...
@@ -462,6 +462,9 @@
/* Define to 1 if you have the <netinet/tcp.h> header file. */
#undef HAVE_NETINET_TCP_H
/* Define to 1 if you have the <netinet/tcp_timer.h> header file. */
#undef HAVE_NETINET_TCP_TIMER_H
/* Define to 1 if you have the <netinet/tcp_var.h> header file. */
#undef HAVE_NETINET_TCP_VAR_H
...
...
include/iprtrmib.h
View file @
beea4d30
...
...
@@ -261,6 +261,10 @@ typedef struct _MIB_IPNETROW
DWORD
dwType
;
}
MIB_IPNETROW
,
*
PMIB_IPNETROW
;
#define MIB_TCP_RTO_OTHER 1
#define MIB_TCP_RTO_CONSTANT 2
#define MIB_TCP_RTO_RSRE 3
#define MIB_TCP_RTO_VANJ 4
#define MIB_IPNET_TYPE_OTHER 1
#define MIB_IPNET_TYPE_INVALID 2
#define MIB_IPNET_TYPE_DYNAMIC 3
...
...
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