1
10
13
14
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
123
124
125
131
132
133
139
140
141
147
148
149
155
156
157
163
164
165
171
172
173
179
180
181
187
188
189
190
191
192
193
197
201
205
209
210
211
212
218
219
220
221
222
223
224
225
...
...
...
#define NX_SOURCE_CODE
#include "nx_api.h"
#include "nx_tcp.h"
...
...
UINT _nx_tcp_socket_info_get(NX_TCP_SOCKET *socket_ptr, ULONG *tcp_packets_sent, ULONG *tcp_bytes_sent,
ULONG *tcp_packets_received, ULONG *tcp_bytes_received,
ULONG *tcp_retransmit_packets, ULONG *tcp_packets_queued,
ULONG *tcp_checksum_errors, ULONG *tcp_socket_state,
ULONG *tcp_transmit_queue_depth, ULONG *tcp_transmit_window,
ULONG *tcp_receive_window)
{
NX_IP *ip_ptr;
ip_ptr = socket_ptr -> nx_tcp_socket_ip_ptr;
NX_TRACE_IN_LINE_INSERT(NX_TRACE_TCP_SOCKET_INFO_GET, ip_ptr, socket_ptr, socket_ptr -> nx_tcp_socket_packets_sent, socket_ptr -> nx_tcp_socket_bytes_received, NX_TRACE_TCP_EVENTS, 0, 0);
tx_mutex_get(&(ip_ptr -> nx_ip_protection), TX_WAIT_FOREVER);
if (tcp_packets_sent)
{
*tcp_packets_sent = socket_ptr -> nx_tcp_socket_packets_sent;
}if (tcp_packets_sent) { ... }
if (tcp_bytes_sent)
{
*tcp_bytes_sent = socket_ptr -> nx_tcp_socket_bytes_sent;
}if (tcp_bytes_sent) { ... }
if (tcp_packets_received)
{
*tcp_packets_received = socket_ptr -> nx_tcp_socket_packets_received;
}if (tcp_packets_received) { ... }
if (tcp_bytes_received)
{
*tcp_bytes_received = socket_ptr -> nx_tcp_socket_bytes_received;
}if (tcp_bytes_received) { ... }
if (tcp_retransmit_packets)
{
*tcp_retransmit_packets = socket_ptr -> nx_tcp_socket_retransmit_packets;
}if (tcp_retransmit_packets) { ... }
if (tcp_packets_queued)
{
*tcp_packets_queued = socket_ptr -> nx_tcp_socket_receive_queue_count;
}if (tcp_packets_queued) { ... }
if (tcp_checksum_errors)
{
*tcp_checksum_errors = socket_ptr -> nx_tcp_socket_checksum_errors;
}if (tcp_checksum_errors) { ... }
if (tcp_socket_state)
{
*tcp_socket_state = socket_ptr -> nx_tcp_socket_state;
}if (tcp_socket_state) { ... }
if (tcp_transmit_queue_depth)
{
*tcp_transmit_queue_depth = socket_ptr -> nx_tcp_socket_transmit_sent_count;
}if (tcp_transmit_queue_depth) { ... }
if (tcp_transmit_window)
{
if (socket_ptr -> nx_tcp_socket_tx_window_advertised > socket_ptr -> nx_tcp_socket_tx_window_congestion)
{
*tcp_transmit_window = socket_ptr -> nx_tcp_socket_tx_window_congestion;
}if (socket_ptr -> nx_tcp_socket_tx_window_advertised > socket_ptr -> nx_tcp_socket_tx_window_congestion) { ... }
else
{
*tcp_transmit_window = socket_ptr -> nx_tcp_socket_tx_window_advertised;
}else { ... }
if (*tcp_transmit_window > socket_ptr -> nx_tcp_socket_tx_outstanding_bytes)
{
*tcp_transmit_window = *tcp_transmit_window - socket_ptr -> nx_tcp_socket_tx_outstanding_bytes;
}if (*tcp_transmit_window > socket_ptr -> nx_tcp_socket_tx_outstanding_bytes) { ... }
else
{
*tcp_transmit_window = 0;
}else { ... }
}if (tcp_transmit_window) { ... }
if (tcp_receive_window)
{
*tcp_receive_window = socket_ptr -> nx_tcp_socket_rx_window_current;
}if (tcp_receive_window) { ... }
tx_mutex_put(&(ip_ptr -> nx_ip_protection));
return(NX_SUCCESS);
}{ ... }