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
423d5f29
Commit
423d5f29
authored
Apr 30, 2013
by
Nikolay Sivov
Committed by
Alexandre Julliard
Apr 30, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
netstat: No need to allocate fixed length stats structs.
parent
bfe4d799
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
24 deletions
+16
-24
netstat.c
programs/netstat/netstat.c
+16
-24
No files found.
programs/netstat/netstat.c
View file @
423d5f29
...
@@ -274,25 +274,21 @@ static void NETSTAT_tcp_table(void)
...
@@ -274,25 +274,21 @@ static void NETSTAT_tcp_table(void)
static
void
NETSTAT_tcp_stats
(
void
)
static
void
NETSTAT_tcp_stats
(
void
)
{
{
P
MIB_TCPSTATS
stats
;
MIB_TCPSTATS
stats
;
stats
=
(
PMIB_TCPSTATS
)
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
MIB_TCPSTATS
));
if
(
GetTcpStatistics
(
&
stats
)
==
NO_ERROR
)
if
(
GetTcpStatistics
(
stats
)
==
NO_ERROR
)
{
{
NETSTAT_wprintf
(
fmtnn
,
NETSTAT_load_message
(
IDS_TCP_STAT
));
NETSTAT_wprintf
(
fmtnn
,
NETSTAT_load_message
(
IDS_TCP_STAT
));
NETSTAT_wprintf
(
fmtn
);
NETSTAT_wprintf
(
fmtn
);
NETSTAT_wprintf
(
fmttcpstat
,
NETSTAT_load_message
(
IDS_TCP_ACTIVE_OPEN
),
stats
->
dwActiveOpens
);
NETSTAT_wprintf
(
fmttcpstat
,
NETSTAT_load_message
(
IDS_TCP_ACTIVE_OPEN
),
stats
.
dwActiveOpens
);
NETSTAT_wprintf
(
fmttcpstat
,
NETSTAT_load_message
(
IDS_TCP_PASSIV_OPEN
),
stats
->
dwPassiveOpens
);
NETSTAT_wprintf
(
fmttcpstat
,
NETSTAT_load_message
(
IDS_TCP_PASSIV_OPEN
),
stats
.
dwPassiveOpens
);
NETSTAT_wprintf
(
fmttcpstat
,
NETSTAT_load_message
(
IDS_TCP_FAILED_CONN
),
stats
->
dwAttemptFails
);
NETSTAT_wprintf
(
fmttcpstat
,
NETSTAT_load_message
(
IDS_TCP_FAILED_CONN
),
stats
.
dwAttemptFails
);
NETSTAT_wprintf
(
fmttcpstat
,
NETSTAT_load_message
(
IDS_TCP_RESET_CONN
),
stats
->
dwEstabResets
);
NETSTAT_wprintf
(
fmttcpstat
,
NETSTAT_load_message
(
IDS_TCP_RESET_CONN
),
stats
.
dwEstabResets
);
NETSTAT_wprintf
(
fmttcpstat
,
NETSTAT_load_message
(
IDS_TCP_CURR_CONN
),
stats
->
dwCurrEstab
);
NETSTAT_wprintf
(
fmttcpstat
,
NETSTAT_load_message
(
IDS_TCP_CURR_CONN
),
stats
.
dwCurrEstab
);
NETSTAT_wprintf
(
fmttcpstat
,
NETSTAT_load_message
(
IDS_TCP_SEGM_RECV
),
stats
->
dwInSegs
);
NETSTAT_wprintf
(
fmttcpstat
,
NETSTAT_load_message
(
IDS_TCP_SEGM_RECV
),
stats
.
dwInSegs
);
NETSTAT_wprintf
(
fmttcpstat
,
NETSTAT_load_message
(
IDS_TCP_SEGM_SENT
),
stats
->
dwOutSegs
);
NETSTAT_wprintf
(
fmttcpstat
,
NETSTAT_load_message
(
IDS_TCP_SEGM_SENT
),
stats
.
dwOutSegs
);
NETSTAT_wprintf
(
fmttcpstat
,
NETSTAT_load_message
(
IDS_TCP_SEGM_RETRAN
),
stats
->
dwRetransSegs
);
NETSTAT_wprintf
(
fmttcpstat
,
NETSTAT_load_message
(
IDS_TCP_SEGM_RETRAN
),
stats
.
dwRetransSegs
);
}
}
HeapFree
(
GetProcessHeap
(),
0
,
stats
);
}
}
static
void
NETSTAT_udp_table
(
void
)
static
void
NETSTAT_udp_table
(
void
)
...
@@ -325,21 +321,17 @@ static void NETSTAT_udp_table(void)
...
@@ -325,21 +321,17 @@ static void NETSTAT_udp_table(void)
static
void
NETSTAT_udp_stats
(
void
)
static
void
NETSTAT_udp_stats
(
void
)
{
{
P
MIB_UDPSTATS
stats
;
MIB_UDPSTATS
stats
;
stats
=
(
PMIB_UDPSTATS
)
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
MIB_UDPSTATS
));
if
(
GetUdpStatistics
(
&
stats
)
==
NO_ERROR
)
if
(
GetUdpStatistics
(
stats
)
==
NO_ERROR
)
{
{
NETSTAT_wprintf
(
fmtnn
,
NETSTAT_load_message
(
IDS_UDP_STAT
));
NETSTAT_wprintf
(
fmtnn
,
NETSTAT_load_message
(
IDS_UDP_STAT
));
NETSTAT_wprintf
(
fmtn
);
NETSTAT_wprintf
(
fmtn
);
NETSTAT_wprintf
(
fmtudpstat
,
NETSTAT_load_message
(
IDS_UDP_DGRAMS_RECV
),
stats
->
dwInDatagrams
);
NETSTAT_wprintf
(
fmtudpstat
,
NETSTAT_load_message
(
IDS_UDP_DGRAMS_RECV
),
stats
.
dwInDatagrams
);
NETSTAT_wprintf
(
fmtudpstat
,
NETSTAT_load_message
(
IDS_UDP_NO_PORTS
),
stats
->
dwNoPorts
);
NETSTAT_wprintf
(
fmtudpstat
,
NETSTAT_load_message
(
IDS_UDP_NO_PORTS
),
stats
.
dwNoPorts
);
NETSTAT_wprintf
(
fmtudpstat
,
NETSTAT_load_message
(
IDS_UDP_RECV_ERRORS
),
stats
->
dwInErrors
);
NETSTAT_wprintf
(
fmtudpstat
,
NETSTAT_load_message
(
IDS_UDP_RECV_ERRORS
),
stats
.
dwInErrors
);
NETSTAT_wprintf
(
fmtudpstat
,
NETSTAT_load_message
(
IDS_UDP_DGRAMS_SENT
),
stats
->
dwOutDatagrams
);
NETSTAT_wprintf
(
fmtudpstat
,
NETSTAT_load_message
(
IDS_UDP_DGRAMS_SENT
),
stats
.
dwOutDatagrams
);
}
}
HeapFree
(
GetProcessHeap
(),
0
,
stats
);
}
}
static
NETSTATPROTOCOLS
NETSTAT_get_protocol
(
WCHAR
name
[])
static
NETSTATPROTOCOLS
NETSTAT_get_protocol
(
WCHAR
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