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, TxBufferAllocator,
78 };
79 pub use netstack3_device::{
80 ArpConfiguration, ArpConfigurationUpdate, DeviceBufferBindingsTypes, DeviceClassMatcher,
81 DeviceConfiguration, DeviceConfigurationUpdate, DeviceConfigurationUpdateError,
82 DeviceCounters, DeviceId, DeviceIdAndNameMatcher, DeviceLayerEventDispatcher,
83 DeviceLayerStateTypes, DeviceProvider, DeviceSendFrameError, NdpConfiguration,
84 NdpConfigurationUpdate, WeakDeviceId,
85 };
86}
87
88pub mod device_socket {
90 pub use netstack3_base::{FrameDestination, SendFrameErrorReason};
91 pub use netstack3_device::socket::{
92 DeviceSocketBindingsContext, DeviceSocketMetadata, DeviceSocketTypes, EthernetFrame,
93 EthernetHeaderParams, Frame, IpFrame, Protocol, ReceiveFrameError, ReceivedFrame,
94 SentFrame, SocketId, SocketInfo, TargetDevice, WeakDeviceSocketId,
95 };
96}
97
98pub mod error {
100 pub use netstack3_base::{
101 AddressResolutionFailed, ExistsError, LocalAddressError, NotFoundError, NotSupportedError,
102 RemoteAddressError, SocketError, ZonedAddressError,
103 };
104}
105
106pub mod filter {
108 mod integration;
109
110 pub use netstack3_filter::{
111 Action, BindingsPacketMatcher, FilterApi, FilterBindingsContext, FilterBindingsTypes,
112 FilterIpExt, FilterIpPacket, FilterPacketMetadata, Hook, Interfaces, IpPacket, IpRoutines,
113 MarkAction, NatRoutines, PacketMatcher, ProofOfEgressCheck, RejectType, Routine, Routines,
114 Rule, SocketEgressFilterResult, SocketIngressFilterResult, SocketOpsFilter,
115 SocketOpsFilterBindingContext, TransparentProxy, TransportProtocolMatcher, Tuple,
116 UninstalledRoutine, ValidationError,
117 };
118}
119
120pub mod inspect {
122 pub use netstack3_base::{
123 Inspectable, InspectableValue, Inspector, InspectorDeviceExt, InspectorExt,
124 };
125}
126
127pub mod icmp {
129 pub use netstack3_icmp_echo::{
130 IcmpEchoBindingsContext, IcmpEchoBindingsTypes, IcmpEchoSettings, IcmpSocketId,
131 ReceiveIcmpEchoError,
132 };
133}
134
135pub mod ip {
137 #[path = "."]
138 pub(crate) mod integration {
139 mod base;
140 mod device;
141 mod multicast_forwarding;
142 mod raw;
143
144 pub(crate) use device::CoreCtxWithIpDeviceConfiguration;
145 }
146
147 pub use netstack3_base::{
149 AddressMatcher, AddressMatcherEither, AddressMatcherType, BoundAddressMatcherEither,
150 BoundPortMatcher, Mark, MarkDomain, MarkInDomainMatcher, MarkMatcher, MarkMatchers, Marks,
151 PortMatcher, SubnetMatcher, WrapBroadcastMarker,
152 };
153 pub use netstack3_ip::device::{
154 AddIpAddrSubnetError, AddrSubnetAndManualConfigEither, AddressRemovedReason,
155 CommonAddressConfig, CommonAddressProperties, IidGenerationConfiguration, IidSecret,
156 IpAddressState, IpDeviceConfiguration, IpDeviceConfigurationAndFlags,
157 IpDeviceConfigurationUpdate, IpDeviceEvent, IpDeviceIpExt, Ipv4AddrConfig,
158 Ipv4DeviceConfiguration, Ipv4DeviceConfigurationUpdate, Ipv6AddrManualConfig,
159 Ipv6DeviceConfiguration, Ipv6DeviceConfigurationUpdate, Lifetime,
160 PendingIpDeviceConfigurationUpdate, PreferredLifetime, RouteDiscoveryConfiguration,
161 RouteDiscoveryConfigurationUpdate, SetIpAddressPropertiesError, SlaacConfiguration,
162 SlaacConfigurationUpdate, StableSlaacAddressConfiguration,
163 TemporarySlaacAddressConfiguration, UpdateIpConfigurationError,
164 };
165 pub use netstack3_ip::gmp::{IgmpConfigMode, MldConfigMode};
166 pub use netstack3_ip::multicast_forwarding::{
167 ForwardMulticastRouteError, MulticastForwardingDisabledError, MulticastForwardingEvent,
168 MulticastRoute, MulticastRouteKey, MulticastRouteStats, MulticastRouteTarget,
169 };
170 pub use netstack3_ip::raw::{
171 RawIpSocketIcmpFilter, RawIpSocketIcmpFilterError, RawIpSocketId, RawIpSocketProtocol,
172 RawIpSocketSendToError, RawIpSocketsBindingsContext, RawIpSocketsBindingsTypes,
173 ReceivePacketError, WeakRawIpSocketId,
174 };
175 pub use netstack3_ip::socket::{
176 IpSockCreateAndSendError, IpSockCreationError, IpSockSendError,
177 };
178 pub use netstack3_ip::{
179 IpLayerEvent, IpRoutingBindingsTypes, MarksBindingsContext, ResolveRouteError,
180 RouterAdvertisementEvent, SocketMetadata,
181 };
182}
183
184pub mod neighbor {
186 pub use netstack3_ip::nud::{
188 Event, EventDynamicState, EventKind, EventState, LinkResolutionContext,
189 LinkResolutionNotifier, LinkResolutionResult, MAX_ENTRIES, NeighborRemovalError,
190 NudUserConfig, NudUserConfigUpdate, StaticNeighborInsertionError,
191 TriggerNeighborProbeError,
192 };
193}
194
195pub mod routes {
197 pub use netstack3_base::{Marks, WrapBroadcastMarker};
199 pub use netstack3_ip::{
200 AddRouteError, AddableEntry, AddableEntryEither, AddableMetric, Entry, EntryEither,
201 Generation, Metric, NextHop, RawMetric, ResolvedRoute, RoutableIpAddr, RoutePreference,
202 RouteResolveOptions, RoutingTableCookie, RoutingTableId, Rule, RuleAction, RuleMatcher,
203 TrafficOriginMatcher,
204 };
205}
206
207pub mod socket {
209 pub use netstack3_datagram::{
210 ConnInfo, ConnectError, ExpectedConnError, ExpectedUnboundError, ListenerInfo,
211 MulticastInterfaceSelector, MulticastMembershipInterfaceSelector,
212 PendingDatagramSocketError, SendError, SendToError, SetMulticastMembershipError,
213 SocketInfo,
214 };
215
216 pub use netstack3_base::socket::{
217 AddrIsMappedError, NotDualStackCapableError, ReusePortOption, SetDualStackEnabledError,
218 SharingDomain, ShutdownType, SocketCookie, SocketWritableListener, StrictlyZonedAddr,
219 };
220
221 pub use netstack3_base::{
222 IpSocketMatcher, SocketCookieMatcher, SocketTransportProtocolMatcher, TcpSocketMatcher,
223 TcpStateMatcher, UdpSocketMatcher, UdpStateMatcher,
224 };
225}
226
227pub mod sync {
229 use netstack3_sync as _;
234
235 pub use netstack3_base::sync::{
236 DebugReferences, DynDebugReferences, LockGuard, MapRcNotifier, Mutex, PrimaryRc,
237 RcNotifier, ResourceToken, ResourceTokenValue, RwLock, RwLockReadGuard, RwLockWriteGuard,
238 StrongRc, WeakRc,
239 };
240 pub use netstack3_base::{RemoveResourceResult, RemoveResourceResultWithContext};
241}
242
243pub mod tcp {
245 pub use netstack3_base::{FragmentedPayload, Payload, PayloadLen, TcpSocketState};
246 pub use netstack3_tcp::{
247 AcceptError, BindError, BoundInfo, Buffer, BufferLimits, BufferSizes,
248 CongestionControlState, ConnectError, ConnectionError, ConnectionInfo,
249 DEFAULT_FIN_WAIT2_TIMEOUT, IntoBuffers, ListenError, ListenerNotifier, NoConnection,
250 OriginalDestinationError, ReceiveBuffer, SendBuffer, SetDeviceError, SetReuseAddrError,
251 SocketAddr, SocketInfo, SocketOptions, TcpBindingsTypes, TcpSettings,
252 TcpSocketDiagnosticTuple, TcpSocketDiagnostics, TcpSocketId, TcpSocketInfo, UnboundInfo,
253 };
254}
255
256pub mod trace {
258 pub use netstack3_trace::*;
260}
261
262pub mod types {
264 pub use netstack3_base::{BufferSizeSettings, Counter, PositiveIsize, WorkQueueReport};
265}
266
267pub mod udp {
269 pub use netstack3_udp::{
270 ReceiveUdpError, SendError, SendToError, UdpBindingsTypes, UdpPacketMeta,
271 UdpReceiveBindingsContext, UdpRemotePort, UdpSettings, UdpSocketDiagnosticTuple,
272 UdpSocketDiagnostics, UdpSocketId,
273 };
274}
275
276pub use api::CoreApi;
277pub use context::{CoreCtx, UnlockedCoreCtx};
278pub use inspect::Inspector;
279pub use marker::{BindingsContext, BindingsTypes, CoreContext, IpBindingsContext, IpExt};
280pub use netstack3_base::{
281 ChecksumOffloadSpec, ChecksumRxOffloading, CtxPair, DeferredResourceRemovalContext,
282 EventContext, InstantBindingsTypes, InstantContext, MapDerefExt, MatcherBindingsTypes,
283 NetworkParsingContext, NetworkSerializationContext, ProtocolSpecificOffloadSpec,
284 ReferenceNotifiers, RngContext, SettingsContext, TimerBindingsTypes, TimerContext, TxMetadata,
285 TxMetadataBindingsTypes,
286};
287pub use netstack3_datagram::PendingDatagramSocketError;
288pub use state::{StackState, StackStateBuilder};
289pub use time::{AtomicInstant, Instant, TimerId};
290pub use transport::CoreTxMetadata;
291
292pub use netstack3_device::for_any_device_id;
294pub use netstack3_macros::context_ip_bounds;
295
296