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
118
119
121
122
123
124
125
129
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
159
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
185
186
187
188
189
190
191
192
193
194
195
196
197
198
200
207
208
209
210
211
212
213
214
215
216
218
219
220
221
222
223
224
230
231
232
233
234
235
236
237
238
239
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
270
271
272
273
274
275
282
283
284
285
291
297
298
299
300
301
302
304
305
306
307
308
309
310
317
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
349
350
351
358
359
360
361
362
364
365
366
392
410
411
412
413
414
415
416
417
418
419
420
421
422
423
429
430
431
432
433
434
435
436
437
438
439
452
459
460
461
462
463
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
489
490
491
492
493
494
495
496
497
498
499
509
510
511
512
514
515
516
517
520
521
522
523
527
528
529
548
549
550
551
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
579
580
585
586
588
589
590
606
607
608
609
610
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
652
653
654
656
657
658
659
660
661
662
664
665
666
667
668
669
670
671
672
673
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
698
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
724
728
729
730
731
732
733
734
740
741
742
743
750
751
...
...
...
#define NX_SOURCE_CODE
#include "nx_api.h"
#include "nx_ip.h"
#include "nx_packet.h"
#include "nx_tcp.h"
#ifdef FEATURE_NX_IPV6
#include "nx_ipv6.h"
#endif
...
...
UINT _nx_tcp_socket_state_ack_check(NX_TCP_SOCKET *socket_ptr, NX_TCP_HEADER *tcp_header_ptr)
{
TX_INTERRUPT_SAVE_AREA
NX_TCP_HEADER *search_header_ptr = NX_NULL;
NX_PACKET *search_ptr;
NX_PACKET *previous_ptr;
ULONG header_length;
ULONG search_sequence;
ULONG temp;
ULONG packet_release_count;
ULONG ending_packet_sequence;
ULONG starting_tx_sequence;
ULONG ending_tx_sequence;
ULONG ending_rx_sequence;
ULONG acked_bytes;
ULONG tcp_payload_length;
UINT wrapped_flag = NX_FALSE;
/* ... */
if (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT)
{
if (socket_ptr -> nx_tcp_socket_zero_window_probe_has_data)
{
ending_tx_sequence = socket_ptr -> nx_tcp_socket_tx_sequence + 1;
}if (socket_ptr -> nx_tcp_socket_zero_window_probe_has_data) { ... }
else
{
ending_tx_sequence = socket_ptr -> nx_tcp_socket_tx_sequence;
}else { ... }
starting_tx_sequence = socket_ptr -> nx_tcp_socket_tx_sequence - socket_ptr -> nx_tcp_socket_tx_outstanding_bytes;
if (socket_ptr -> nx_tcp_socket_receive_queue_tail)
{
search_ptr = socket_ptr -> nx_tcp_socket_receive_queue_tail;
#ifndef NX_DISABLE_IPV4
if (search_ptr -> nx_packet_ip_version == NX_IP_VERSION_V4)
{
search_header_ptr = (NX_TCP_HEADER *)(search_ptr -> nx_packet_ip_header +
sizeof(NX_IPV4_HEADER));
}if (search_ptr -> nx_packet_ip_version == NX_IP_VERSION_V4) { ... }
else/* ... */
#endif
#ifdef FEATURE_NX_IPV6
if (search_ptr -> nx_packet_ip_version == NX_IP_VERSION_V6)
{
search_header_ptr = (NX_TCP_HEADER *)(search_ptr -> nx_packet_ip_header +
sizeof(NX_IPV6_HEADER));
}else if (search_ptr -> nx_packet_ip_version == NX_IP_VERSION_V6) { ... }
else
#endif
{
return(NX_FALSE);
}else { ... }
temp = search_header_ptr -> nx_tcp_header_word_3;
header_length = (temp >> NX_TCP_HEADER_SHIFT) * (ULONG)sizeof(ULONG);
search_sequence = search_header_ptr -> nx_tcp_sequence_number;
tcp_payload_length = (search_ptr -> nx_packet_length -
(header_length +
(ULONG)((ALIGN_TYPE)search_header_ptr -
(ALIGN_TYPE)search_ptr -> nx_packet_prepend_ptr)));
ending_rx_sequence = search_sequence + tcp_payload_length;
}if (socket_ptr -> nx_tcp_socket_receive_queue_tail) { ... }
else
{
ending_rx_sequence = socket_ptr -> nx_tcp_socket_rx_sequence;
}else { ... }
#ifdef NX_ENABLE_TCP_KEEPALIVE
if (socket_ptr -> nx_tcp_socket_state == NX_TCP_ESTABLISHED)
{
if (socket_ptr -> nx_tcp_socket_keepalive_enabled)
{
socket_ptr -> nx_tcp_socket_keepalive_timeout = NX_TCP_KEEPALIVE_INITIAL;
socket_ptr -> nx_tcp_socket_keepalive_retries = 0;
/* ... */
if (tcp_header_ptr -> nx_tcp_sequence_number == (socket_ptr -> nx_tcp_socket_rx_sequence - 1))
{
/* ... */
_nx_tcp_packet_send_ack(socket_ptr, ending_tx_sequence);
}if (tcp_header_ptr -> nx_tcp_sequence_number == (socket_ptr -> nx_tcp_socket_rx_sequence - 1)) { ... }
}if (socket_ptr -> nx_tcp_socket_keepalive_enabled) { ... }
}if (socket_ptr -> nx_tcp_socket_state == NX_TCP_ESTABLISHED) { ... }
/* ... */#endif
if (tcp_header_ptr -> nx_tcp_acknowledgment_number == ending_tx_sequence)
{
/* ... */
packet_release_count = socket_ptr -> nx_tcp_socket_transmit_sent_count;
previous_ptr = socket_ptr -> nx_tcp_socket_transmit_sent_tail;
if (socket_ptr -> nx_tcp_socket_state >= NX_TCP_FIN_WAIT_1)
{
socket_ptr -> nx_tcp_socket_fin_acked = NX_TRUE;
}if (socket_ptr -> nx_tcp_socket_state >= NX_TCP_FIN_WAIT_1) { ... }
}if (tcp_header_ptr -> nx_tcp_acknowledgment_number == ending_tx_sequence) { ... }
else
{
search_ptr = socket_ptr -> nx_tcp_socket_transmit_sent_head;
/* ... */
if ((search_ptr) && (search_ptr -> nx_packet_queue_next == ((NX_PACKET *)NX_DRIVER_TX_DONE)))
{
if (tcp_header_ptr -> nx_tcp_acknowledgment_number == starting_tx_sequence)
{
socket_ptr -> nx_tcp_socket_duplicated_ack_received++;
if (socket_ptr -> nx_tcp_socket_duplicated_ack_received == 3)
{
if ((INT)((tcp_header_ptr -> nx_tcp_acknowledgment_number - 1) -
socket_ptr -> nx_tcp_socket_tx_sequence_recover) > 0)
{
_nx_tcp_socket_retransmit(socket_ptr -> nx_tcp_socket_ip_ptr, socket_ptr, NX_TRUE);
}if ((INT)((tcp_header_ptr -> nx_tcp_acknowledgment_number - 1) - socket_ptr -> nx_tcp_socket_tx_sequence_recover) > 0) { ... }
else if ((socket_ptr -> nx_tcp_socket_tx_window_congestion > socket_ptr -> nx_tcp_socket_connect_mss) &&
((INT)(tcp_header_ptr -> nx_tcp_acknowledgment_number - (socket_ptr -> nx_tcp_socket_previous_highest_ack +
(socket_ptr -> nx_tcp_socket_connect_mss << 2))) < 0))
{
/* ... */
_nx_tcp_socket_retransmit(socket_ptr -> nx_tcp_socket_ip_ptr, socket_ptr, NX_TRUE);
}else if ((socket_ptr -> nx_tcp_socket_tx_window_congestion > socket_ptr -> nx_tcp_socket_connect_mss) && ((INT)(tcp_header_ptr -> nx_tcp_acknowledgment_number - (socket_ptr -> nx_tcp_socket_previous_highest_ack + (socket_ptr -> nx_tcp_socket_connect_mss << 2))) < 0)) { ... }
}if (socket_ptr -> nx_tcp_socket_duplicated_ack_received == 3) { ... }
else if ((socket_ptr -> nx_tcp_socket_duplicated_ack_received > 3) &&
(socket_ptr -> nx_tcp_socket_fast_recovery == NX_TRUE))
{
socket_ptr -> nx_tcp_socket_tx_window_congestion += socket_ptr -> nx_tcp_socket_connect_mss;
}else if ((socket_ptr -> nx_tcp_socket_duplicated_ack_received > 3) && (socket_ptr -> nx_tcp_socket_fast_recovery == NX_TRUE)) { ... }
}if (tcp_header_ptr -> nx_tcp_acknowledgment_number == starting_tx_sequence) { ... }
if (ending_tx_sequence > starting_tx_sequence)
{
wrapped_flag = NX_FALSE;
}if (ending_tx_sequence > starting_tx_sequence) { ... }
else
{
wrapped_flag = NX_TRUE;
}else { ... }
}if ((search_ptr) && (search_ptr -> nx_packet_queue_next == ((NX_PACKET *)NX_DRIVER_TX_DONE))) { ... }
packet_release_count = 0;
/* ... */
previous_ptr = NX_NULL;
while (search_ptr)
{
if (search_ptr -> nx_packet_queue_next != ((NX_PACKET *)NX_DRIVER_TX_DONE))
{
search_header_ptr = (NX_TCP_HEADER *)(search_ptr -> nx_packet_ip_header +
search_ptr -> nx_packet_ip_header_length);
}if (search_ptr -> nx_packet_queue_next != ((NX_PACKET *)NX_DRIVER_TX_DONE)) { ... }
else
{
search_header_ptr = (NX_TCP_HEADER *)search_ptr -> nx_packet_prepend_ptr;
}else { ... }
temp = search_header_ptr -> nx_tcp_header_word_3;
NX_CHANGE_ULONG_ENDIAN(temp);
header_length = (temp >> NX_TCP_HEADER_SHIFT) * (ULONG)sizeof(ULONG);
search_sequence = search_header_ptr -> nx_tcp_sequence_number;
NX_CHANGE_ULONG_ENDIAN(search_sequence);
tcp_payload_length = (search_ptr -> nx_packet_length -
(header_length +
(ULONG)((ALIGN_TYPE)search_header_ptr -
(ALIGN_TYPE)search_ptr -> nx_packet_prepend_ptr)));
ending_packet_sequence = search_sequence + tcp_payload_length;
if (wrapped_flag == NX_FALSE)
{
/* ... */
if ((tcp_header_ptr -> nx_tcp_acknowledgment_number < ending_packet_sequence) ||
(tcp_header_ptr -> nx_tcp_acknowledgment_number > ending_tx_sequence))
{
break;
}if ((tcp_header_ptr -> nx_tcp_acknowledgment_number < ending_packet_sequence) || (tcp_header_ptr -> nx_tcp_acknowledgment_number > ending_tx_sequence)) { ... }
}if (wrapped_flag == NX_FALSE) { ... }
else
{
/* ... */
if (ending_packet_sequence < starting_tx_sequence)
{
/* ... */
if (tcp_header_ptr -> nx_tcp_acknowledgment_number < starting_tx_sequence)
{
/* ... */
if (tcp_header_ptr -> nx_tcp_acknowledgment_number < ending_packet_sequence)
{
break;
}if (tcp_header_ptr -> nx_tcp_acknowledgment_number < ending_packet_sequence) { ... }
}if (tcp_header_ptr -> nx_tcp_acknowledgment_number < starting_tx_sequence) { ... }
else
{
/* ... */
break;
}else { ... }
}if (ending_packet_sequence < starting_tx_sequence) { ... }
else
{
/* ... */
if (tcp_header_ptr -> nx_tcp_acknowledgment_number >= starting_tx_sequence)
{
/* ... */
if (tcp_header_ptr -> nx_tcp_acknowledgment_number < ending_packet_sequence)
{
break;
}if (tcp_header_ptr -> nx_tcp_acknowledgment_number < ending_packet_sequence) { ... }
}if (tcp_header_ptr -> nx_tcp_acknowledgment_number >= starting_tx_sequence) { ... }
}else { ... }
}else { ... }
packet_release_count++;
previous_ptr = search_ptr;
search_ptr = search_ptr -> nx_packet_union_next.nx_packet_tcp_queue_next;
if (search_ptr == ((NX_PACKET *)NX_PACKET_ENQUEUED))
{
search_ptr = NX_NULL;
}if (search_ptr == ((NX_PACKET *)NX_PACKET_ENQUEUED)) { ... }
}while (search_ptr) { ... }
}else { ... }
if (!packet_release_count)
{
if (tcp_header_ptr -> nx_tcp_acknowledgment_number != ending_tx_sequence)
{
if ((INT)(tcp_header_ptr -> nx_tcp_acknowledgment_number - ending_tx_sequence) > 0)
{
/* ... */
_nx_tcp_packet_send_ack(socket_ptr, ending_tx_sequence);
return(NX_FALSE);
}if ((INT)(tcp_header_ptr -> nx_tcp_acknowledgment_number - ending_tx_sequence) > 0) { ... }
}if (tcp_header_ptr -> nx_tcp_acknowledgment_number != ending_tx_sequence) { ... }
else if ((socket_ptr -> nx_tcp_socket_rx_window_current == 0) &&
(tcp_header_ptr -> nx_tcp_sequence_number == socket_ptr -> nx_tcp_socket_rx_sequence))
{
_nx_tcp_packet_send_ack(socket_ptr, ending_tx_sequence);
}else if ((socket_ptr -> nx_tcp_socket_rx_window_current == 0) && (tcp_header_ptr -> nx_tcp_sequence_number == socket_ptr -> nx_tcp_socket_rx_sequence)) { ... }
}if (!packet_release_count) { ... }
else
{
/* ... */
if (socket_ptr -> nx_tcp_socket_fast_recovery == NX_TRUE)
{
if ((INT)(tcp_header_ptr -> nx_tcp_acknowledgment_number -
socket_ptr -> nx_tcp_socket_tx_sequence_recover) > 0)
{
socket_ptr -> nx_tcp_socket_fast_recovery = NX_FALSE;
socket_ptr -> nx_tcp_socket_tx_window_congestion = socket_ptr -> nx_tcp_socket_tx_slow_start_threshold;
}if ((INT)(tcp_header_ptr -> nx_tcp_acknowledgment_number - socket_ptr -> nx_tcp_socket_tx_sequence_recover) > 0) { ... }
}if (socket_ptr -> nx_tcp_socket_fast_recovery == NX_TRUE) { ... }
if ((INT)(socket_ptr -> nx_tcp_socket_tx_sequence_recover -
(tcp_header_ptr -> nx_tcp_acknowledgment_number - 2)) < 0)
{
socket_ptr -> nx_tcp_socket_tx_sequence_recover = tcp_header_ptr -> nx_tcp_acknowledgment_number - 2;
}if ((INT)(socket_ptr -> nx_tcp_socket_tx_sequence_recover - (tcp_header_ptr -> nx_tcp_acknowledgment_number - 2)) < 0) { ... }
socket_ptr -> nx_tcp_socket_duplicated_ack_received = 0;
socket_ptr -> nx_tcp_socket_previous_highest_ack = starting_tx_sequence;
acked_bytes = tcp_header_ptr -> nx_tcp_acknowledgment_number - starting_tx_sequence;
if (socket_ptr -> nx_tcp_socket_fast_recovery == NX_TRUE)
{
socket_ptr -> nx_tcp_socket_tx_window_congestion -= acked_bytes;
if (acked_bytes > socket_ptr -> nx_tcp_socket_connect_mss)
{
socket_ptr -> nx_tcp_socket_tx_window_congestion += socket_ptr -> nx_tcp_socket_connect_mss;
}if (acked_bytes > socket_ptr -> nx_tcp_socket_connect_mss) { ... }
}if (socket_ptr -> nx_tcp_socket_fast_recovery == NX_TRUE) { ... }
else
{
/* ... */
if (socket_ptr -> nx_tcp_socket_tx_window_congestion >= socket_ptr -> nx_tcp_socket_tx_slow_start_threshold)
{
/* ... */
temp = socket_ptr -> nx_tcp_socket_connect_mss2 / socket_ptr -> nx_tcp_socket_tx_window_congestion;
if (temp == 0)
{
temp = 1;
}if (temp == 0) { ... }
socket_ptr -> nx_tcp_socket_tx_window_congestion = socket_ptr -> nx_tcp_socket_tx_window_congestion + temp;
}if (socket_ptr -> nx_tcp_socket_tx_window_congestion >= socket_ptr -> nx_tcp_socket_tx_slow_start_threshold) { ... }
else
{
/* ... */
if (acked_bytes < socket_ptr -> nx_tcp_socket_connect_mss)
{
socket_ptr -> nx_tcp_socket_tx_window_congestion += acked_bytes;
}if (acked_bytes < socket_ptr -> nx_tcp_socket_connect_mss) { ... }
else
{
socket_ptr -> nx_tcp_socket_tx_window_congestion += socket_ptr -> nx_tcp_socket_connect_mss;
}else { ... }
}else { ... }
}else { ... }
}else { ... }
/* ... */
if ((((INT)(tcp_header_ptr -> nx_tcp_acknowledgment_number - starting_tx_sequence) > 0) &&
((INT)(tcp_header_ptr -> nx_tcp_acknowledgment_number - ending_tx_sequence) <= 0)) ||
((INT)(tcp_header_ptr -> nx_tcp_sequence_number - ending_rx_sequence) > 0) ||
(((INT)(tcp_header_ptr -> nx_tcp_sequence_number == ending_rx_sequence)) &&
((INT)(tcp_header_ptr -> nx_tcp_acknowledgment_number - starting_tx_sequence) >= 0)))
{
socket_ptr -> nx_tcp_socket_tx_window_advertised = (tcp_header_ptr -> nx_tcp_header_word_3) & NX_LOWER_16_MASK;
#ifdef NX_ENABLE_TCP_WINDOW_SCALING
socket_ptr -> nx_tcp_socket_tx_window_advertised <<= socket_ptr -> nx_tcp_snd_win_scale_value;
#endif
}if ((((INT)(tcp_header_ptr -> nx_tcp_acknowledgment_number - starting_tx_sequence) > 0) && ((INT)(tcp_header_ptr -> nx_tcp_acknowledgment_number - ending_tx_sequence) <= 0)) || ((INT)(tcp_header_ptr -> nx_tcp_sequence_number - ending_rx_sequence) > 0) || (((INT)(tcp_header_ptr -> nx_tcp_sequence_number == ending_rx_sequence)) && ((INT)(tcp_header_ptr -> nx_tcp_acknowledgment_number - starting_tx_sequence) >= 0))) { ... }
if ((socket_ptr -> nx_tcp_socket_tx_window_advertised <= socket_ptr -> nx_tcp_socket_tx_outstanding_bytes) &&
(tcp_header_ptr -> nx_tcp_acknowledgment_number >= socket_ptr -> nx_tcp_socket_zero_window_probe_sequence))
{
socket_ptr -> nx_tcp_socket_zero_window_probe_failure = 0;
}if ((socket_ptr -> nx_tcp_socket_tx_window_advertised <= socket_ptr -> nx_tcp_socket_tx_outstanding_bytes) && (tcp_header_ptr -> nx_tcp_acknowledgment_number >= socket_ptr -> nx_tcp_socket_zero_window_probe_sequence)) { ... }
if (!packet_release_count)
{
return(NX_TRUE);
}if (!packet_release_count) { ... }
/* ... */
#ifdef NX_ENABLE_TCP_QUEUE_DEPTH_UPDATE_NOTIFY
if (socket_ptr -> nx_tcp_socket_queue_depth_notify)
{
/* ... */
if ((socket_ptr -> nx_tcp_socket_transmit_sent_count >= socket_ptr -> nx_tcp_socket_transmit_queue_maximum) &&
((socket_ptr -> nx_tcp_socket_transmit_sent_count - packet_release_count) < socket_ptr -> nx_tcp_socket_transmit_queue_maximum))
{
(socket_ptr -> nx_tcp_socket_queue_depth_notify)(socket_ptr);
}if ((socket_ptr -> nx_tcp_socket_transmit_sent_count >= socket_ptr -> nx_tcp_socket_transmit_queue_maximum) && ((socket_ptr -> nx_tcp_socket_transmit_sent_count - packet_release_count) < socket_ptr -> nx_tcp_socket_transmit_queue_maximum)) { ... }
}if (socket_ptr -> nx_tcp_socket_queue_depth_notify) { ... }
/* ... */#endif
search_ptr = socket_ptr -> nx_tcp_socket_transmit_sent_head;
/* ... */
if (previous_ptr != socket_ptr -> nx_tcp_socket_transmit_sent_tail)
{
socket_ptr -> nx_tcp_socket_transmit_sent_head = previous_ptr -> nx_packet_union_next.nx_packet_tcp_queue_next;
socket_ptr -> nx_tcp_socket_transmit_sent_count = socket_ptr -> nx_tcp_socket_transmit_sent_count - packet_release_count;
socket_ptr -> nx_tcp_socket_timeout = socket_ptr -> nx_tcp_socket_timeout_rate;
socket_ptr -> nx_tcp_socket_timeout_retries = 0;
}if (previous_ptr != socket_ptr -> nx_tcp_socket_transmit_sent_tail) { ... }
else
{
/* ... */
socket_ptr -> nx_tcp_socket_transmit_sent_head = NX_NULL;
socket_ptr -> nx_tcp_socket_transmit_sent_tail = NX_NULL;
socket_ptr -> nx_tcp_socket_transmit_sent_count = 0;
if ((socket_ptr -> nx_tcp_socket_state == NX_TCP_FIN_WAIT_1) ||
(socket_ptr -> nx_tcp_socket_state == NX_TCP_CLOSING) ||
(socket_ptr -> nx_tcp_socket_state == NX_TCP_LAST_ACK))
{
socket_ptr -> nx_tcp_socket_timeout = socket_ptr -> nx_tcp_socket_timeout_rate;
socket_ptr -> nx_tcp_socket_timeout_retries = 0;
}if ((socket_ptr -> nx_tcp_socket_state == NX_TCP_FIN_WAIT_1) || (socket_ptr -> nx_tcp_socket_state == NX_TCP_CLOSING) || (socket_ptr -> nx_tcp_socket_state == NX_TCP_LAST_ACK)) { ... }
else if (socket_ptr -> nx_tcp_socket_tx_window_advertised != 0)
{
socket_ptr -> nx_tcp_socket_timeout = 0;
}else if (socket_ptr -> nx_tcp_socket_tx_window_advertised != 0) { ... }
}else { ... }
/* ... */
while (packet_release_count--)
{
previous_ptr = search_ptr;
/* ... */
search_ptr = search_ptr -> nx_packet_union_next.nx_packet_tcp_queue_next;
TX_DISABLE
previous_ptr -> nx_packet_union_next.nx_packet_tcp_queue_next = ((NX_PACKET *)NX_PACKET_ALLOCATED);
/* ... */
if (previous_ptr -> nx_packet_queue_next == ((NX_PACKET *)NX_DRIVER_TX_DONE))
{
TX_RESTORE
search_header_ptr = (NX_TCP_HEADER *)previous_ptr -> nx_packet_prepend_ptr;
temp = search_header_ptr -> nx_tcp_header_word_3;
NX_CHANGE_ULONG_ENDIAN(temp);
header_length = (temp >> NX_TCP_HEADER_SHIFT) * (ULONG)sizeof(ULONG);
if (socket_ptr -> nx_tcp_socket_tx_outstanding_bytes > (previous_ptr -> nx_packet_length - header_length))
{
socket_ptr -> nx_tcp_socket_tx_outstanding_bytes -= previous_ptr -> nx_packet_length - header_length;
}if (socket_ptr -> nx_tcp_socket_tx_outstanding_bytes > (previous_ptr -> nx_packet_length - header_length)) { ... }
else
{
socket_ptr -> nx_tcp_socket_tx_outstanding_bytes = 0;
}else { ... }
_nx_packet_release(previous_ptr);
}if (previous_ptr -> nx_packet_queue_next == ((NX_PACKET *)NX_DRIVER_TX_DONE)) { ... }
else
{
search_header_ptr = (NX_TCP_HEADER *)(previous_ptr -> nx_packet_ip_header +
previous_ptr -> nx_packet_ip_header_length);
temp = search_header_ptr -> nx_tcp_header_word_3;
NX_CHANGE_ULONG_ENDIAN(temp);
header_length = (temp >> NX_TCP_HEADER_SHIFT) * (ULONG)sizeof(ULONG);
tcp_payload_length = (previous_ptr -> nx_packet_length -
(header_length +
(ULONG)((ALIGN_TYPE)search_header_ptr -
(ALIGN_TYPE)(previous_ptr -> nx_packet_prepend_ptr))));
if (socket_ptr -> nx_tcp_socket_tx_outstanding_bytes > tcp_payload_length)
{
socket_ptr -> nx_tcp_socket_tx_outstanding_bytes -= tcp_payload_length;
}if (socket_ptr -> nx_tcp_socket_tx_outstanding_bytes > tcp_payload_length) { ... }
else
{
socket_ptr -> nx_tcp_socket_tx_outstanding_bytes = 0;
}else { ... }
TX_RESTORE
}else { ... }
}while (packet_release_count--) { ... }
if (socket_ptr -> nx_tcp_socket_fast_recovery == NX_TRUE)
{
_nx_tcp_socket_retransmit(socket_ptr -> nx_tcp_socket_ip_ptr, socket_ptr, NX_FALSE);
}if (socket_ptr -> nx_tcp_socket_fast_recovery == NX_TRUE) { ... }
return(NX_TRUE);
}if (tcp_header_ptr -> nx_tcp_header_word_3 & NX_TCP_ACK_BIT) { ... }
else
{
return(NX_FALSE);
}else { ... }
}{ ... }