whitequark
9b8671ce15
Fix the TCP FIN emission with queued data rolling over TX buffer.
2017-01-25 06:20:57 +00:00
whitequark
9fbb5cfff1
Fix the TCP ACK handling in FIN-WAIT-1 state with queued data.
2017-01-25 06:01:58 +00:00
whitequark
68064c3725
Refactor the TCP ACK handling in ESTABLISHED/CLOSE-WAIT states.
2017-01-25 05:50:14 +00:00
whitequark
8b292c6dd8
Don't switch TCP state from FIN-WAIT-1 to FIN-WAIT-2 with queued data.
2017-01-25 05:36:42 +00:00
whitequark
bef01740a7
If a TCP FIN|ACK also ACKs our FIN, transition to TIME-WAIT.
2017-01-25 03:58:03 +00:00
whitequark
497aa5919a
Correctly treat TCP ACKs that acknowledge both data and a FIN.
2017-01-23 22:17:04 +00:00
whitequark
92fde3d18b
Don't send TCP FIN flag yet if next segment will also have data.
2017-01-23 12:07:07 +00:00
whitequark
507af2b0c3
Reset the TCP retransmit timer on valid ACK if transmit half is open.
2017-01-23 11:34:36 +00:00
whitequark
62f094d276
Fix build with no alloc or collections.
2017-01-22 20:29:45 +00:00
whitequark
34d32f67a2
Gate the really verbose log messages behind a feature.
...
Otherwise, trying to use the socket buffers instead of BufReader/
BufWriter is doomed to overwhelm the application logic.
2017-01-19 12:23:32 +00:00
whitequark
15a344f1d3
Don't respond with RST to ACKs in TCP LISTEN state.
...
These packets may have been destined for a different socket.
2017-01-17 04:43:51 +00:00
whitequark
591993014e
Reject, not accept, TCP RST packets in LISTEN state.
...
These packets may have been destined for a different socket.
2017-01-17 04:33:37 +00:00
whitequark
74d1eb86b6
Add TcpSocket::abort().
2017-01-17 01:24:51 +00:00
whitequark
a75f7d4bf0
Reject all TCP packets in the CLOSED state.
2017-01-17 00:24:47 +00:00
whitequark
4da2598ea7
Properly document TCP state machine query methods.
2017-01-17 00:21:07 +00:00
whitequark
f126eab193
Distinguish sockets by debug identifiers (socket set indexes).
2017-01-16 23:35:21 +00:00
whitequark
40716a348d
Do not send RST in response to invalid SEQ or ACK.
2017-01-16 16:58:45 +00:00
whitequark
bd01cdef78
Always display meaningful endpoint in trace messages.
2017-01-16 16:34:24 +00:00
whitequark
51d8afe579
Fix inverted meaning of TcpSocketBuffer::empty().
2017-01-15 11:00:04 +00:00
whitequark
c0697cf37d
Add lots of sanity checking to TCP test helpers.
2017-01-14 12:56:58 +00:00
whitequark
a864157feb
Do not try to retransmit SYN as if it was in data stream.
2017-01-14 12:18:00 +00:00
whitequark
578d7bce5f
Calculate IP payload length from the total length field.
...
Before this commit, IP payload length was calculated by subtracting
the IP header length from the total underlying buffer length, which
fails if the underlying buffer has padding, e.g. like Ethernet
does.
2017-01-14 11:07:06 +00:00
whitequark
8b04d8bebe
Try to get TCP state query methods into a saner state.
2017-01-14 09:13:25 +00:00
whitequark
f7bc7fe364
Do not use UTF-8 in net_trace!().
...
This may interact badly with other tooling.
2017-01-14 07:10:20 +00:00
whitequark
dc8809288f
Fix a bug that caused .send();.close(); to result in a lost FIN.
2017-01-14 06:59:58 +00:00
whitequark
cca835a45a
Update TcpSocket::{can,may}_{send,recv} APIs.
2017-01-14 06:59:58 +00:00
whitequark
67430aa589
Use the managed crate.
2017-01-10 11:04:00 +00:00
whitequark
27ccfc1bb0
Implement TCP retransmission.
2016-12-31 08:35:46 +00:00
whitequark
818e98f47a
TCP: retransmit ACK when receiving duplicate SEQ.
2016-12-31 01:33:46 +00:00
whitequark
be68066152
#[inline(always)] → #[inline]
2016-12-30 16:55:31 +00:00
whitequark
287affb447
Implement the TCP TIME-WAIT state.
2016-12-28 05:33:12 +00:00
whitequark
94963faf12
Implement the TCP CLOSING state.
2016-12-28 04:56:49 +00:00
whitequark
3e7a1ee575
Implement the TCP FIN-WAIT-2 state.
2016-12-28 04:10:17 +00:00
whitequark
9dc931dbe2
Implement the TCP FIN-WAIT-1 state.
2016-12-28 04:02:43 +00:00
whitequark
71268ace88
Get rid of the #![feature(const_fn)].
2016-12-28 00:08:51 +00:00
whitequark
df69303624
Fix state names in documentation.
2016-12-27 23:28:57 +00:00
whitequark
979cd4c1bf
Implement the TCP LAST-ACK state.
2016-12-27 23:27:33 +00:00
whitequark
874264503d
Implement the TCP close operation.
2016-12-27 22:43:16 +00:00
whitequark
feaef0d7c4
Fix TCP sequence number in multiple consecutive non-ACKed data packets.
2016-12-27 20:39:46 +00:00
whitequark
17f96ba929
Fix TcpSocket::can_recv().
2016-12-27 20:17:46 +00:00
whitequark
71d1b4061f
Fix ACK validation of TCP RST packets.
2016-12-27 20:17:35 +00:00
whitequark
867dda659d
Fix several TCP out-of-bounds reads from the transmit buffer.
2016-12-27 20:17:03 +00:00
whitequark
69427c9e2f
Add TcpSocket::is_connected().
2016-12-27 18:54:45 +00:00
whitequark
6b592742fd
Use the correct wrapping operations on TCP sequence numbers.
2016-12-27 18:34:13 +00:00
whitequark
bbff907e87
Fix examples.
2016-12-27 18:04:39 +00:00
whitequark
a8fc4fd832
Improve the user-facing TCP socket API.
2016-12-27 17:49:40 +00:00
whitequark
09040f3e91
Accept TCP ACK packets in CLOSE_WAIT state.
2016-12-27 14:13:42 +00:00
whitequark
d11016b138
Simplify TCP ACK handling.
2016-12-27 14:04:30 +00:00
whitequark
751a2269c3
Add support for TCP FIN in ESTABLISHED state.
2016-12-27 13:34:48 +00:00
whitequark
79553e81d4
Fix TCP incoming sequence number check.
2016-12-26 17:24:37 +00:00