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 device {
37 #[path = "."]
38 pub(crate) mod integration {
39 mod base;
40 mod blackhole;
41 mod ethernet;
42 mod loopback;
43 mod pure_ip;
44 mod socket;
45
46 pub(crate) use base::{
47 device_state, device_state_and_core_ctx, get_mtu, ip_device_state,
48 ip_device_state_and_core_ctx,
49 };
50 }
51
52 pub use netstack3_base::{
54 BoundInterfaceMatcher, DeviceIdentifier, InterfaceMatcher, InterfaceProperties,
55 StrongDeviceIdentifier,
56 };
57 pub use netstack3_device::blackhole::{BlackholeDevice, BlackholeDeviceId};
58 pub use netstack3_device::ethernet::{
59 EthernetCreationProperties, EthernetDeviceEvent, EthernetDeviceId, EthernetLinkDevice,
60 EthernetWeakDeviceId, MaxEthernetFrameSize, RecvEthernetFrameMeta,
61 };
62 pub use netstack3_device::loopback::{
63 LoopbackCreationProperties, LoopbackDevice, LoopbackDeviceId, LoopbackWeakDeviceId,
64 };
65 pub use netstack3_device::pure_ip::{
66 PureIpDevice, PureIpDeviceCreationProperties, PureIpDeviceId,
67 PureIpDeviceReceiveFrameMetadata, PureIpHeaderParams, PureIpWeakDeviceId,
68 };
69 pub use netstack3_device::queue::{
70 BatchSize, ReceiveQueueBindingsContext, TransmitQueueBindingsContext,
71 TransmitQueueConfiguration, TxBufferAllocator,
72 };
73 pub use netstack3_device::{
74 ArpConfiguration, ArpConfigurationUpdate, BufferSlice, DeviceBufferBindingsTypes,
75 DeviceClassMatcher, DeviceConfiguration, DeviceConfigurationUpdate,
76 DeviceConfigurationUpdateError, DeviceCounters, DeviceId, DeviceIdAndNameMatcher,
77 DeviceLayerEventDispatcher, DeviceLayerStateTypes, DeviceProvider, DeviceSendFrameError,
78 GroBufferDestination, GroBufferStorage, GroFrameType, GroInputItem, GroIter,
79 GroOutputBuffers, GroOutputItem, MaybeContiguousBuffer, NdpConfiguration,
80 NdpConfigurationUpdate, WeakDeviceId,
81 };
82}
83
84pub mod device_socket {
86 pub use netstack3_base::{FrameDestination, PacketType, SendFrameErrorReason};
87 pub use netstack3_device::socket::{
88 DeviceSocketBindingsContext, DeviceSocketMetadata, DeviceSocketTypes, EthernetFrame,
89 EthernetHeaderParams, Frame, IpFrame, Protocol, ReceiveFrameError, ReceivedFrame,
90 SentFrame, SocketId, SocketInfo, TargetDevice, WeakDeviceSocketId,
91 };
92}
93
94pub mod error {
96 pub use netstack3_base::{
97 AddressResolutionFailed, ExistsError, LocalAddressError, NotFoundError, NotSupportedError,
98 RemoteAddressError, SocketError, ZonedAddressError,
99 };
100}
101
102pub mod filter {
104 mod integration;
105
106 pub use netstack3_filter::{
107 Action, BindingsPacketMatcher, EitherIpProto, FilterApi, FilterBindingsContext,
108 FilterBindingsTypes, FilterIpExt, FilterIpPacket, FilterPacketMetadata, FrameDestination,
109 Hook, Interfaces, IpPacket, IpRoutines, LocalFrameDestination, MarkAction, NatRoutines,
110 PacketMatcher, PacketType, ProofOfEgressCheck, RejectType, Routine, Routines, Rule,
111 SocketEgressFilterResult, SocketInfo, SocketIngressFilterResult, SocketOpsFilter,
112 SocketOpsFilterBindingContext, TransparentProxy, TransportProtocolMatcher, Tuple,
113 UninstalledRoutine, ValidationError,
114 };
115}
116
117pub mod inspect {
119 pub use netstack3_base::{
120 Inspectable, InspectableValue, Inspector, InspectorDeviceExt, InspectorExt,
121 };
122}
123
124pub mod icmp {
126 pub use netstack3_icmp_echo::{
127 IcmpEchoBindingsContext, IcmpEchoBindingsTypes, IcmpSocketId, ReceiveIcmpEchoError,
128 };
129}
130
131pub mod ip {
133 #[path = "."]
134 pub(crate) mod integration {
135 mod base;
136 mod device;
137 mod multicast_forwarding;
138 mod raw;
139
140 pub(crate) use device::CoreCtxWithIpDeviceConfiguration;
141 }
142
143 pub use netstack3_base::{
145 AddressMatcher, AddressMatcherEither, AddressMatcherType, BoundAddressMatcherEither,
146 BoundPortMatcher, Mark, MarkDomain, MarkInDomainMatcher, MarkMatcher, MarkMatchers, Marks,
147 PortMatcher, SubnetMatcher, WrapBroadcastMarker,
148 };
149 pub use netstack3_ip::device::{
150 AddIpAddrSubnetError, AddrSubnetAndManualConfigEither, AddressRemovedReason,
151 CommonAddressConfig, CommonAddressProperties, IidGenerationConfiguration, IidSecret,
152 IpAddressState, IpDeviceConfiguration, IpDeviceConfigurationAndFlags,
153 IpDeviceConfigurationUpdate, IpDeviceEvent, IpDeviceIpExt, Ipv4AddrConfig,
154 Ipv4DeviceConfiguration, Ipv4DeviceConfigurationUpdate, Ipv6AddrManualConfig,
155 Ipv6DeviceConfiguration, Ipv6DeviceConfigurationUpdate, Lifetime,
156 PendingIpDeviceConfigurationUpdate, PreferredLifetime, RouteDiscoveryConfiguration,
157 RouteDiscoveryConfigurationUpdate, SetIpAddressPropertiesError, SlaacConfiguration,
158 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 DeviceIpLayerMetadata, IpLayerEvent, IpRoutingBindingsTypes, MarksBindingsContext,
176 ResolveRouteError, RouterAdvertisementEvent, SocketMetadata,
177 };
178}
179
180pub mod neighbor {
182 pub use netstack3_ip::nud::{
184 Event, EventDynamicState, EventKind, EventState, LinkResolutionContext,
185 LinkResolutionNotifier, LinkResolutionResult, MAX_ENTRIES, NeighborRemovalError,
186 NudUserConfig, NudUserConfigUpdate, StaticNeighborInsertionError,
187 TriggerNeighborProbeError,
188 };
189}
190
191pub mod routes {
193 pub use netstack3_base::{Marks, WrapBroadcastMarker};
195 pub use netstack3_ip::{
196 AddRouteError, AddableEntry, AddableEntryEither, AddableMetric, Entry, EntryEither,
197 Generation, Metric, NextHop, RawMetric, ResolvedRoute, RoutableIpAddr, RoutePreference,
198 RouteResolveOptions, RoutingTableCookie, RoutingTableId, Rule, RuleAction, RuleMatcher,
199 TrafficOriginMatcher,
200 };
201}
202
203pub mod socket {
205 pub use netstack3_datagram::{
206 ConnInfo, ConnectError, ExpectedConnError, ExpectedUnboundError, ListenerInfo,
207 MulticastInterfaceSelector, MulticastMembershipInterfaceSelector,
208 PendingDatagramSocketError, SendError, SendToError, SetMulticastMembershipError,
209 SocketInfo,
210 };
211
212 pub use netstack3_base::socket::{
213 AddrIsMappedError, NotDualStackCapableError, ReusePortOption, SendBufferFullError,
214 SendBufferSpace, SendBufferTracking, SetDualStackEnabledError, SharingDomain, ShutdownType,
215 SocketCookie, SocketWritableListener, StrictlyZonedAddr,
216 };
217
218 pub use netstack3_base::{
219 IpSocketMatcher, SocketCookieMatcher, SocketTransportProtocolMatcher, TcpSocketMatcher,
220 TcpStateMatcher, UdpSocketMatcher, UdpStateMatcher,
221 };
222}
223
224pub mod sync {
226 use netstack3_sync as _;
231
232 pub use netstack3_base::sync::{
233 DebugReferences, DynDebugReferences, LockGuard, MapRcNotifier, Mutex, PrimaryRc,
234 RcNotifier, ResourceToken, ResourceTokenValue, RwLock, RwLockReadGuard, RwLockWriteGuard,
235 StrongRc, WeakRc,
236 };
237 pub use netstack3_base::{RemoveResourceResult, RemoveResourceResultWithContext};
238}
239
240pub mod tcp {
242 pub use netstack3_base::{FragmentedPayload, Payload, PayloadLen, TcpSocketState};
243 pub use netstack3_tcp::{
244 AcceptError, AcceptQueueChange, BindError, BoundInfo, Buffer, BufferLimits, BufferSizes,
245 CongestionControlState, ConnectError, ConnectionError, ConnectionInfo,
246 DEFAULT_FIN_WAIT2_TIMEOUT, IntoBuffers, ListenError, ListenerNotifier, NoConnection,
247 OriginalDestinationError, ReceiveBuffer, SendBuffer, SetDeviceError, SetReuseAddrError,
248 SocketAddr, SocketInfo, SocketOptions, TcpBindingsTypes, TcpSettings,
249 TcpSocketDestructionContext, TcpSocketDiagnosticTuple, TcpSocketDiagnostics, TcpSocketId,
250 TcpSocketInfo, UnboundInfo,
251 };
252}
253
254pub mod trace {
256 pub use netstack3_trace::*;
258}
259
260pub mod types {
262 pub use netstack3_base::{BufferSizeSettings, Counter, PositiveIsize, WorkQueueReport};
263}
264
265pub mod udp {
267 pub use netstack3_udp::{
268 ReceiveUdpError, SendError, SendToError, UdpBindingsTypes, UdpPacketMeta,
269 UdpReceiveBindingsContext, UdpRemotePort, UdpSocketDiagnosticTuple, UdpSocketDiagnostics,
270 UdpSocketId,
271 };
272}
273
274pub use api::CoreApi;
275pub use context::{CoreCtx, UnlockedCoreCtx};
276pub use inspect::Inspector;
277pub use marker::{BindingsContext, BindingsTypes, CoreContext, IpBindingsContext, IpExt};
278pub use netstack3_base::{
279 ChecksumOffloadResult, ChecksumOffloadSpec, ChecksumRxOffloading, CtxPair,
280 DeferredResourceRemovalContext, EventContext, GsoInfo, InstantBindingsTypes, InstantContext,
281 Ipv4IdMode, MapDerefExt, MatcherBindingsTypes, NetworkParsingContext,
282 NetworkSerializationContext, ProtocolSpecificOffloadSpec, ReferenceNotifiers, RngContext,
283 SettingsContext, SocketDiagnosticsSeed, TimerBindingsTypes, TimerContext, TxMetadata,
284 TxMetadataBindingsTypes,
285};
286pub use netstack3_datagram::PendingDatagramSocketError;
287pub use state::{StackState, StackStateBuilder};
288pub use time::{AtomicInstant, Instant, TimerId};
289pub use transport::CoreTxMetadata;
290
291pub use netstack3_device::for_any_device_id;
293pub use netstack3_macros::context_ip_bounds;
294
295