1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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
//! Virtual TCP engine.
//!
//! Pure-Rust port of the Go `vtcp` subpackage: a synchronous TCP state machine
//! operating on raw TCP segments. It is IP-agnostic and Ethernet-agnostic —
//! callers feed inbound segments via [`Conn::handle_segment`] and transmit
//! whatever the connection returns. A periodic [`Conn::tick`] drives RTO,
//! persist, keepalive, and TIME-WAIT timers; there is no background thread.
//!
//! Supported RFCs:
//! - RFC 9293 (TCP, rolled-up): state machine, basic segment processing.
//! - RFC 6298: RTO smoothing + Karn's algorithm.
//! - RFC 5681: NewReno congestion control (slow start, congestion avoidance,
//! fast retransmit/recovery).
//! - RFC 3649: HighSpeed TCP (default controller).
//! - RFC 7323: window scaling, timestamps (PAWS).
//! - RFC 2018: SACK.
//! - SYN-cookie engine for stateless half-open completion.
//!
//! # Layering: blocking I/O and accept live above this engine
//!
//! `Conn` is intentionally a pure, non-blocking, socket-less state machine —
//! it owns no I/O, so "blocking read/write" and "an accept queue" do not
//! belong here; they belong to whatever drives the engine over a real
//! transport. The crate provides exactly those drivers:
//!
//! - Blocking, `std::io::Read`/`Write` connection handles: `vclient::TcpConn`
//! (client side) and `slirp::TcpStream` (server side) wrap a `Conn` with a
//! `Condvar` and a tick thread (enable the `vclient` / `slirp` features).
//! - Accept queues: `slirp::Listener` builds one on top of
//! [`Conn::accept_syn`], and [`syncookie::SynCookies`] is available for the
//! stateless-completion variant.
//!
//! Synchronous mutual recursion is avoided by the return-segments API: methods
//! hand back outgoing bytes (`take_outgoing`) rather than calling a sink, so the
//! caller drains them explicitly and the borrow checker keeps re-entrancy out.
pub use ;
pub use ;
pub use ;
pub use RecvBuf;
pub use ;
pub use ;
pub use SendBuf;
pub use ;
pub use SynCookies;