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
8da2cbaa
Commit
8da2cbaa
authored
Jun 16, 2003
by
Gerald Pfeifer
Committed by
Alexandre Julliard
Jun 16, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Unbreak getTcpTable() on Linux-based systems and make it work on BSD
and Solaris as well.
parent
25b4d101
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
35 deletions
+45
-35
ipstats.c
dlls/iphlpapi/ipstats.c
+45
-35
No files found.
dlls/iphlpapi/ipstats.c
View file @
8da2cbaa
...
@@ -42,6 +42,40 @@
...
@@ -42,6 +42,40 @@
#include "ifenum.h"
#include "ifenum.h"
#include "ipstats.h"
#include "ipstats.h"
#ifndef TCPS_ESTABLISHED
# define TCPS_ESTABLISHED TCP_ESTABLISHED
#endif
#ifndef TCPS_SYN_SENT
# define TCPS_SYN_SENT TCP_SYN_SENT
#endif
#ifndef TCPS_SYN_RECEIVED
# define TCPS_SYN_RECEIVED TCP_SYN_RECV
#endif
#ifndef TCPS_FIN_WAIT_1
# define TCPS_FIN_WAIT_1 TCP_FIN_WAIT1
#endif
#ifndef TCPS_FIN_WAIT_2
# define TCPS_FIN_WAIT_2 TCP_FIN_WAIT2
#endif
#ifndef TCPS_TIME_WAIT
# define TCPS_TIME_WAIT TCP_TIME_WAIT
#endif
#ifndef TCPS_CLOSED
# define TCPS_CLOSED TCP_CLOSE
#endif
#ifndef TCPS_CLOSE_WAIT
# define TCPS_CLOSE_WAIT TCP_CLOSE_WAIT
#endif
#ifndef TCPS_LAST_ACK
# define TCPS_LAST_ACK TCP_LAST_ACK
#endif
#ifndef TCPS_LISTEN
# define TCPS_LISTEN TCP_LISTEN
#endif
#ifndef TCPS_CLOSING
# define TCPS_CLOSING TCP_CLOSING
#endif
DWORD
getInterfaceStatsByName
(
const
char
*
name
,
PMIB_IFROW
entry
)
DWORD
getInterfaceStatsByName
(
const
char
*
name
,
PMIB_IFROW
entry
)
{
{
FILE
*
fp
;
FILE
*
fp
;
...
@@ -778,67 +812,43 @@ PMIB_TCPTABLE getTcpTable(void)
...
@@ -778,67 +812,43 @@ PMIB_TCPTABLE getTcpTable(void)
if
(
ptr
&&
*
ptr
)
{
if
(
ptr
&&
*
ptr
)
{
DWORD
state
=
strtoul
(
ptr
,
&
endPtr
,
16
);
DWORD
state
=
strtoul
(
ptr
,
&
endPtr
,
16
);
#if HAVE_NETINET_TCP_H
switch
(
state
)
switch
(
state
)
{
{
#ifdef TCP_ESTABLISHED
case
TCPS_ESTABLISHED
:
case
TCP_ESTABLISHED
:
ret
->
table
[
ret
->
dwNumEntries
].
dwState
=
MIB_TCP_STATE_ESTAB
;
ret
->
table
[
ret
->
dwNumEntries
].
dwState
=
MIB_TCP_STATE_ESTAB
;
break
;
break
;
#endif
case
TCPS_SYN_SENT
:
#ifdef TCP_SYN_SEND
case
TCP_SYN_SENT
:
ret
->
table
[
ret
->
dwNumEntries
].
dwState
=
MIB_TCP_STATE_SYN_SENT
;
ret
->
table
[
ret
->
dwNumEntries
].
dwState
=
MIB_TCP_STATE_SYN_SENT
;
break
;
break
;
#endif
case
TCPS_SYN_RECEIVED
:
#ifdef TCP_SYN_RECV
case
TCP_SYN_RECV
:
ret
->
table
[
ret
->
dwNumEntries
].
dwState
=
MIB_TCP_STATE_SYN_RCVD
;
ret
->
table
[
ret
->
dwNumEntries
].
dwState
=
MIB_TCP_STATE_SYN_RCVD
;
break
;
break
;
#endif
case
TCPS_FIN_WAIT_1
:
#ifdef TCP_FIN_WAIT1
case
TCP_FIN_WAIT1
:
ret
->
table
[
ret
->
dwNumEntries
].
dwState
=
MIB_TCP_STATE_FIN_WAIT1
;
ret
->
table
[
ret
->
dwNumEntries
].
dwState
=
MIB_TCP_STATE_FIN_WAIT1
;
break
;
break
;
#endif
case
TCPS_FIN_WAIT_2
:
#ifdef TCP_FIN_WAIT2
case
TCP_FIN_WAIT2
:
ret
->
table
[
ret
->
dwNumEntries
].
dwState
=
MIB_TCP_STATE_FIN_WAIT2
;
ret
->
table
[
ret
->
dwNumEntries
].
dwState
=
MIB_TCP_STATE_FIN_WAIT2
;
break
;
break
;
#endif
case
TCPS_TIME_WAIT
:
#ifdef TCP_TIME_WAIT
case
TCP_TIME_WAIT
:
ret
->
table
[
ret
->
dwNumEntries
].
dwState
=
MIB_TCP_STATE_TIME_WAIT
;
ret
->
table
[
ret
->
dwNumEntries
].
dwState
=
MIB_TCP_STATE_TIME_WAIT
;
break
;
break
;
#endif
case
TCPS_CLOSED
:
#ifdef TCP_CLOSE
case
TCP_CLOSE
:
ret
->
table
[
ret
->
dwNumEntries
].
dwState
=
MIB_TCP_STATE_CLOSED
;
ret
->
table
[
ret
->
dwNumEntries
].
dwState
=
MIB_TCP_STATE_CLOSED
;
break
;
break
;
#endif
case
TCPS_CLOSE_WAIT
:
#ifdef TCP_CLOSE_WAIT
case
TCP_CLOSE_WAIT
:
ret
->
table
[
ret
->
dwNumEntries
].
dwState
=
ret
->
table
[
ret
->
dwNumEntries
].
dwState
=
MIB_TCP_STATE_CLOSE_WAIT
;
MIB_TCP_STATE_CLOSE_WAIT
;
break
;
break
;
#endif
case
TCPS_LAST_ACK
:
#ifdef TCP_LAST_ACK
case
TCP_LAST_ACK
:
ret
->
table
[
ret
->
dwNumEntries
].
dwState
=
MIB_TCP_STATE_LAST_ACK
;
ret
->
table
[
ret
->
dwNumEntries
].
dwState
=
MIB_TCP_STATE_LAST_ACK
;
break
;
break
;
#endif
case
TCPS_LISTEN
:
#ifdef TCP_LISTEN
case
TCP_LISTEN
:
ret
->
table
[
ret
->
dwNumEntries
].
dwState
=
MIB_TCP_STATE_LISTEN
;
ret
->
table
[
ret
->
dwNumEntries
].
dwState
=
MIB_TCP_STATE_LISTEN
;
break
;
break
;
#endif
case
TCPS_CLOSING
:
#ifdef TCP_CLOSING
case
TCP_CLOSING
:
ret
->
table
[
ret
->
dwNumEntries
].
dwState
=
MIB_TCP_STATE_CLOSING
;
ret
->
table
[
ret
->
dwNumEntries
].
dwState
=
MIB_TCP_STATE_CLOSING
;
break
;
break
;
#endif
}
}
#endif
ptr
=
endPtr
;
ptr
=
endPtr
;
}
}
ret
->
dwNumEntries
++
;
ret
->
dwNumEntries
++
;
...
...
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