1#![no_std]
8#![recursion_limit = "256"]
11#![allow(stable_features)]
14#![warn(
15 missing_docs,
16 unreachable_patterns,
17 clippy::useless_conversion,
18 clippy::redundant_clone,
19 clippy::precedence
20)]
21extern crate alloc;
22
23mod api;
24mod context;
25mod counters;
26mod lock_ordering;
27mod marker;
28mod state;
29mod time;
30mod transport;
31
32#[cfg(any(test, feature = "testutils"))]
33pub mod testutil;
34
35pub mod data_structures {
37 pub mod rcu {
39 pub use netstack3_base::rcu::{ReadGuard, SynchronizedWriterRcu, WriteGuard};
40 }
41}
42pub mod device {
44 #[path = "."]
45 pub(crate) mod integration {
46 mod base;
47 mod blackhole;
48 mod ethernet;
49 mod loopback;
50 mod pure_ip;
51 mod socket;
52
53 pub(crate) use base::{
54 device_state, device_state_and_core_ctx, get_mtu, ip_device_state,
55 ip_device_state_and_core_ctx,
56 };
57 }
58
59 pub use netstack3_base::{
61 BoundInterfaceMatcher, InterfaceMatcher, InterfaceProperties, StrongDeviceIdentifier,
62 };
63 pub use netstack3_device::blackhole::{BlackholeDevice, BlackholeDeviceId};
64 pub use netstack3_device::ethernet::{
65 EthernetCreationProperties, EthernetDeviceEvent, EthernetDeviceId, EthernetLinkDevice,
66 EthernetWeakDeviceId, MaxEthernetFrameSize, RecvEthernetFrameMeta,
67 };
68 pub use netstack3_device::loopback::{
69 LoopbackCreationProperties, LoopbackDevice, LoopbackDeviceId, LoopbackWeakDeviceId,
70 };
71 pub use netstack3_device::pure_ip::{
72 PureIpDevice, PureIpDeviceCreationProperties, PureIpDeviceId,
73 PureIpDeviceReceiveFrameMetadata, PureIpHeaderParams, PureIpWeakDeviceId,
74 };
75 pub use netstack3_device::queue::{
76 BatchSize, ReceiveQueueBindingsContext, TransmitQueueBindingsContext,
77 TransmitQueueConfiguration,
78 };
79 pub use netstack3_device::{
80 ArpConfiguration, ArpConfigurationUpdate, DeviceClassMatcher, DeviceConfiguration,
81 DeviceConfigurationUpdate, DeviceConfigurationUpdateError, DeviceCounters, DeviceId,
82 DeviceIdAndNameMatcher, DeviceLayerEventDispatcher, DeviceLayerStateTypes, DeviceProvider,
83 DeviceSendFrameError, NdpConfiguration, NdpConfigurationUpdate, WeakDeviceId,
84 };
85}
86
87pub mod device_socket {
89 pub use netstack3_base::{FrameDestination, SendFrameErrorReason};
90 pub use netstack3_device::socket::{
91 DeviceSocketBindingsContext, DeviceSocketMetadata, DeviceSocketTypes, EthernetFrame,
92 EthernetHeaderParams, Frame, IpFrame, Protocol, ReceiveFrameError, ReceivedFrame,
93 SentFrame, SocketId, SocketInfo, TargetDevice, WeakDeviceSocketId,
94 };
95}
96
97pub mod error {
99 pub use netstack3_base::{
100 AddressResolutionFailed, ExistsError, LocalAddressError, NotFoundError, NotSupportedError,
101 RemoteAddressError, SocketError, ZonedAddressError,
102 };
103}
104
105pub mod filter {
107 mod integration;
108
109 pub use netstack3_filter::{
110 Action, FilterApi, FilterBindingsContext, FilterBindingsTypes, FilterIpExt, Hook, IpPacket,
111 IpRoutines, MarkAction, NatRoutines, PacketMatcher, ProofOfEgressCheck, Routine, Routines,
112 Rule, SocketEgressFilterResult, SocketIngressFilterResult, SocketOpsFilter,
113 SocketOpsFilterBindingContext, TransparentProxy, TransportProtocolMatcher, Tuple,
114 UninstalledRoutine, ValidationError,
115 };
116}
117
118pub mod inspect {
120 pub use netstack3_base::{
121 Inspectable, InspectableValue, Inspector, InspectorDeviceExt, InspectorExt,
122 };
123}
124
125pub mod icmp {
127 pub use netstack3_icmp_echo::{
128 IcmpEchoBindingsContext, IcmpEchoBindingsTypes, IcmpEchoSettings, IcmpSocketId,
129 ReceiveIcmpEchoError,
130 };
131}
132
133pub mod ip {
135 #[path = "."]
136 pub(crate) mod integration {
137 mod base;
138 mod device;
139 mod multicast_forwarding;
140 mod raw;
141
142 pub(crate) use device::CoreCtxWithIpDeviceConfiguration;
143 }
144
145 pub use netstack3_base::{
147 AddressMatcher, AddressMatcherEither, AddressMatcherType, Mark, MarkDomain,
148 MarkInDomainMatcher, MarkMatcher, MarkMatchers, Marks, PortMatcher, SubnetMatcher,
149 WrapBroadcastMarker,
150 };
151 pub use netstack3_ip::device::{
152 AddIpAddrSubnetError, AddrSubnetAndManualConfigEither, AddressRemovedReason,
153 CommonAddressConfig, CommonAddressProperties, IidGenerationConfiguration, IidSecret,
154 IpAddressState, IpDeviceConfiguration, IpDeviceConfigurationAndFlags,
155 IpDeviceConfigurationUpdate, IpDeviceEvent, Ipv4AddrConfig, Ipv4DeviceConfiguration,
156 Ipv4DeviceConfigurationUpdate, Ipv6AddrManualConfig, Ipv6DeviceConfiguration,
157 Ipv6DeviceConfigurationUpdate, Lifetime, PreferredLifetime, SetIpAddressPropertiesError,
158 SlaacConfiguration, SlaacConfigurationUpdate, StableSlaacAddressConfiguration,
159 TemporarySlaacAddressConfiguration, UpdateIpConfigurationError,
160 };
161 pub use netstack3_ip::gmp::{IgmpConfigMode, MldConfigMode};
162 pub use netstack3_ip::multicast_forwarding::{
163 ForwardMulticastRouteError, MulticastForwardingDisabledError, MulticastForwardingEvent,
164 MulticastRoute, MulticastRouteKey, MulticastRouteStats, MulticastRouteTarget,
165 };
166 pub use netstack3_ip::raw::{
167 RawIpSocketIcmpFilter, RawIpSocketIcmpFilterError, RawIpSocketId, RawIpSocketProtocol,
168 RawIpSocketSendToError, RawIpSocketsBindingsContext, RawIpSocketsBindingsTypes,
169 ReceivePacketError, WeakRawIpSocketId,
170 };
171 pub use netstack3_ip::socket::{
172 IpSockCreateAndSendError, IpSockCreationError, IpSockSendError,
173 };
174 pub use netstack3_ip::{
175 IpLayerEvent, IpRoutingBindingsTypes, ResolveRouteError, RouterAdvertisementEvent,
176 };
177}
178
179pub mod neighbor {
181 pub use netstack3_ip::nud::{
183 Event, EventDynamicState, EventKind, EventState, LinkResolutionContext,
184 LinkResolutionNotifier, LinkResolutionResult, MAX_ENTRIES, NeighborRemovalError,
185 NudUserConfig, NudUserConfigUpdate, StaticNeighborInsertionError,
186 };
187}
188
189pub mod routes {
191 pub use netstack3_base::{Marks, WrapBroadcastMarker};
193 pub use netstack3_ip::{
194 AddRouteError, AddableEntry, AddableEntryEither, AddableMetric, Entry, EntryEither,
195 Generation, Metric, NextHop, RawMetric, ResolvedRoute, RoutableIpAddr, RouteResolveOptions,
196 RoutingTableCookie, RoutingTableId, Rule, RuleAction, RuleMatcher, TrafficOriginMatcher,
197 };
198}
199
200pub mod socket {
202 pub use netstack3_datagram::{
203 ConnInfo, ConnectError, ExpectedConnError, ExpectedUnboundError, ListenerInfo,
204 MulticastInterfaceSelector, MulticastMembershipInterfaceSelector, SendError, SendToError,
205 SetMulticastMembershipError, SocketInfo,
206 };
207
208 pub use netstack3_base::socket::{
209 AddrIsMappedError, NotDualStackCapableError, ReusePortOption, SetDualStackEnabledError,
210 SharingDomain, ShutdownType, SocketCookie, SocketWritableListener, StrictlyZonedAddr,
211 };
212
213 pub use netstack3_base::{
214 IpSocketMatcher, SocketCookieMatcher, SocketTransportProtocolMatcher, TcpSocketMatcher,
215 TcpStateMatcher, UdpSocketMatcher, UdpStateMatcher,
216 };
217}
218
219pub mod sync {
221 use netstack3_sync as _;
226
227 pub use netstack3_base::sync::{
228 DebugReferences, DynDebugReferences, LockGuard, MapRcNotifier, Mutex, PrimaryRc,
229 RcNotifier, ResourceToken, ResourceTokenValue, RwLock, RwLockReadGuard, RwLockWriteGuard,
230 StrongRc, WeakRc,
231 };
232 pub use netstack3_base::{RemoveResourceResult, RemoveResourceResultWithContext};
233}
234
235pub mod tcp {
237 pub use netstack3_base::{FragmentedPayload, Payload, PayloadLen, TcpSocketState};
238 pub use netstack3_tcp::{
239 AcceptError, BindError, BoundInfo, Buffer, BufferLimits, BufferSizes, ConnectError,
240 ConnectionError, ConnectionInfo, DEFAULT_FIN_WAIT2_TIMEOUT, IntoBuffers, ListenError,
241 ListenerNotifier, NoConnection, OriginalDestinationError, ReceiveBuffer, SendBuffer,
242 SetDeviceError, SetReuseAddrError, SocketAddr, SocketInfo, SocketOptions, TcpBindingsTypes,
243 TcpSettings, TcpSocketDiagnosticTuple, TcpSocketDiagnostics, TcpSocketId, UnboundInfo,
244 };
245}
246
247pub mod trace {
249 pub use netstack3_trace::*;
251}
252
253pub mod types {
255 pub use netstack3_base::{BufferSizeSettings, Counter, PositiveIsize, WorkQueueReport};
256}
257
258pub mod udp {
260 pub use netstack3_udp::{
261 ReceiveUdpError, SendError, SendToError, UdpBindingsTypes, UdpPacketMeta,
262 UdpReceiveBindingsContext, UdpRemotePort, UdpSettings, UdpSocketDiagnosticTuple,
263 UdpSocketDiagnostics, UdpSocketId,
264 };
265}
266
267pub use api::CoreApi;
268pub use context::{CoreCtx, UnlockedCoreCtx};
269pub use inspect::Inspector;
270pub use marker::{BindingsContext, BindingsTypes, CoreContext, IpBindingsContext, IpExt};
271pub use netstack3_base::{
272 CtxPair, DeferredResourceRemovalContext, EventContext, InstantBindingsTypes, InstantContext,
273 MapDerefExt, MatcherBindingsTypes, ReferenceNotifiers, RngContext, SettingsContext,
274 TimerBindingsTypes, TimerContext, TxMetadata, TxMetadataBindingsTypes,
275};
276pub use state::{StackState, StackStateBuilder};
277pub use time::{AtomicInstant, Instant, TimerId};
278pub use transport::CoreTxMetadata;
279
280pub use netstack3_device::for_any_device_id;
282pub use netstack3_macros::context_ip_bounds;
283
284