netstack3_tcp/
lib.rs

1// Copyright 2024 The Fuchsia Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5//! Netstack3 core TCP.
6//!
7//! This crate contains the TCP implementation for netstack3.
8
9#![no_std]
10#![warn(missing_docs, unreachable_patterns, clippy::useless_conversion, clippy::redundant_clone)]
11
12extern crate fakealloc as alloc;
13
14#[path = "."]
15mod internal {
16    pub(super) mod base;
17    pub(super) mod buffer;
18    pub(super) mod congestion;
19    pub(super) mod counters;
20    pub(super) mod rtt;
21    pub(super) mod sack_scoreboard;
22    pub(super) mod seq_ranges;
23    pub(super) mod socket;
24    pub(super) mod state;
25    #[cfg(test)]
26    pub(super) mod testutil;
27    pub(super) mod uninstantiable;
28}
29
30pub use internal::base::{
31    BufferSizes, ConnectionError, SocketOptions, TcpSocketTxMetadata, TcpState,
32    DEFAULT_FIN_WAIT2_TIMEOUT,
33};
34pub use internal::buffer::{Buffer, BufferLimits, IntoBuffers, ReceiveBuffer, SendBuffer};
35pub use internal::counters::{
36    CombinedTcpCounters, TcpCountersWithSocket, TcpCountersWithoutSocket,
37};
38pub use internal::socket::accept_queue::ListenerNotifier;
39pub use internal::socket::isn::IsnGenerator;
40pub use internal::socket::{
41    AcceptError, BindError, BoundInfo, ConnectError, ConnectionInfo, DemuxState,
42    DualStackDemuxIdConverter, DualStackIpExt, Ipv6Options, Ipv6SocketIdToIpv4DemuxIdConverter,
43    ListenError, NoConnection, OriginalDestinationError, SetDeviceError, SetReuseAddrError,
44    SocketAddr, SocketInfo, Sockets, TcpApi, TcpBindingsContext, TcpBindingsTypes, TcpContext,
45    TcpDemuxContext, TcpDualStackContext, TcpIpTransportContext, TcpSocketId, TcpSocketSet,
46    TcpSocketState, TcpTimerId, UnboundInfo, WeakTcpSocketId,
47};
48
49/// TCP test utilities.
50#[cfg(any(test, feature = "testutils"))]
51pub mod testutil {
52    pub use crate::internal::buffer::testutil::{
53        ClientBuffers, InfiniteSendBuffer, ProvidedBuffers, RepeatingSendBuffer, RingBuffer,
54        TestSendBuffer, WriteBackClientBuffers,
55    };
56}