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(
11    missing_docs,
12    unreachable_patterns,
13    clippy::useless_conversion,
14    clippy::redundant_clone,
15    clippy::precedence
16)]
17
18extern crate alloc;
19
20#[path = "."]
21mod internal {
22    pub(super) mod base;
23    pub(super) mod buffer;
24    pub(super) mod congestion;
25    pub(super) mod counters;
26    pub(super) mod rtt;
27    pub(super) mod sack_scoreboard;
28    pub(super) mod seq_ranges;
29    pub(super) mod settings;
30    pub(super) mod socket;
31    pub(super) mod state;
32    #[cfg(test)]
33    pub(super) mod testutil;
34    mod timestamp;
35    pub(super) mod uninstantiable;
36}
37
38pub use internal::base::{
39    BufferSizes, ConnectionError, DEFAULT_FIN_WAIT2_TIMEOUT, SocketOptions, TcpSocketTxMetadata,
40    TcpState,
41};
42pub use internal::buffer::{Buffer, BufferLimits, IntoBuffers, ReceiveBuffer, SendBuffer};
43pub use internal::counters::{
44    CombinedTcpCounters, TcpCountersWithSocket, TcpCountersWithoutSocket,
45};
46pub use internal::settings::TcpSettings;
47pub use internal::socket::accept_queue::ListenerNotifier;
48pub use internal::socket::diagnostics::{TcpSocketDiagnosticTuple, TcpSocketDiagnostics};
49pub use internal::socket::generators::{IsnGenerator, TimestampOffsetGenerator};
50pub use internal::socket::{
51    AcceptError, BindError, BoundInfo, ConnectError, ConnectionInfo, DemuxState,
52    DualStackDemuxIdConverter, DualStackIpExt, Ipv6Options, Ipv6SocketIdToIpv4DemuxIdConverter,
53    ListenError, NoConnection, OriginalDestinationError, SetDeviceError, SetReuseAddrError,
54    SocketAddr, SocketInfo, Sockets, TcpApi, TcpBindingsContext, TcpBindingsTypes, TcpContext,
55    TcpDemuxContext, TcpDualStackContext, TcpIpTransportContext, TcpSocketId, TcpSocketSet,
56    TcpSocketState, TcpTimerId, UnboundInfo, WeakTcpSocketId,
57};
58
59/// TCP test utilities.
60#[cfg(any(test, feature = "testutils"))]
61pub mod testutil {
62    pub use crate::internal::buffer::testutil::{
63        ClientBuffers, InfiniteSendBuffer, ProvidedBuffers, RepeatingSendBuffer, RingBuffer,
64        TestSendBuffer, WriteBackClientBuffers,
65    };
66}