#![no_std]
#![recursion_limit = "256"]
#![allow(stable_features)]
#![deny(missing_docs, unreachable_patterns, clippy::useless_conversion, clippy::redundant_clone)]
extern crate fakealloc as alloc;
mod api;
mod context;
mod counters;
mod lock_ordering;
mod marker;
mod state;
mod time;
mod transport;
#[cfg(any(test, feature = "testutils"))]
pub mod testutil;
pub mod device {
#[path = "."]
pub(crate) mod integration {
mod base;
mod ethernet;
mod loopback;
mod pure_ip;
mod socket;
pub(crate) use base::{
device_state, device_state_and_core_ctx, get_mtu, ip_device_state,
ip_device_state_and_core_ctx,
};
}
pub use netstack3_base::DeviceNameMatcher;
pub use netstack3_device::ethernet::{
EthernetCreationProperties, EthernetDeviceId, EthernetLinkDevice, EthernetWeakDeviceId,
MaxEthernetFrameSize, RecvEthernetFrameMeta,
};
pub use netstack3_device::loopback::{
LoopbackCreationProperties, LoopbackDevice, LoopbackDeviceId,
};
pub use netstack3_device::pure_ip::{
PureIpDevice, PureIpDeviceCreationProperties, PureIpDeviceId,
PureIpDeviceReceiveFrameMetadata, PureIpHeaderParams, PureIpWeakDeviceId,
};
pub use netstack3_device::queue::{
BatchSize, ReceiveQueueBindingsContext, TransmitQueueBindingsContext,
TransmitQueueConfiguration,
};
pub use netstack3_device::{
ArpConfiguration, ArpConfigurationUpdate, DeviceClassMatcher, DeviceConfiguration,
DeviceConfigurationUpdate, DeviceConfigurationUpdateError, DeviceId,
DeviceIdAndNameMatcher, DeviceLayerEventDispatcher, DeviceLayerStateTypes, DeviceProvider,
DeviceSendFrameError, NdpConfiguration, NdpConfigurationUpdate, WeakDeviceId,
};
}
pub mod device_socket {
pub use netstack3_base::{FrameDestination, SendFrameErrorReason};
pub use netstack3_device::socket::{
DeviceSocketBindingsContext, DeviceSocketMetadata, DeviceSocketTypes, EthernetFrame,
EthernetHeaderParams, Frame, IpFrame, Protocol, ReceivedFrame, SentFrame, SocketId,
SocketInfo, TargetDevice, WeakDeviceSocketId,
};
}
pub mod error {
pub use netstack3_base::{
AddressResolutionFailed, ExistsError, LocalAddressError, NotFoundError, NotSupportedError,
RemoteAddressError, SocketError, ZonedAddressError,
};
}
pub mod filter {
mod integration;
pub use netstack3_filter::{
Action, AddressMatcher, AddressMatcherType, FilterApi, FilterBindingsContext,
FilterBindingsTypes, Hook, InterfaceMatcher, InterfaceProperties, IpRoutines, NatRoutines,
PacketMatcher, PortMatcher, ProofOfEgressCheck, Routine, Routines, Rule, TransparentProxy,
TransportProtocolMatcher, Tuple, UninstalledRoutine, ValidationError,
};
}
pub mod inspect {
pub use netstack3_base::{Inspectable, InspectableValue, Inspector, InspectorDeviceExt};
}
pub mod icmp {
pub use netstack3_icmp_echo::{IcmpEchoBindingsContext, IcmpEchoBindingsTypes, IcmpSocketId};
}
pub mod ip {
#[path = "."]
pub(crate) mod integration {
mod base;
mod device;
mod multicast_forwarding;
mod raw;
pub(crate) use device::{CoreCtxWithIpDeviceConfiguration, IpAddrCtxSpec};
}
pub use netstack3_base::{SubnetMatcher, WrapBroadcastMarker};
pub use netstack3_ip::device::{
AddIpAddrSubnetError, AddrSubnetAndManualConfigEither, AddressRemovedReason,
CommonAddressProperties, IidSecret, IpAddressState, IpDeviceConfiguration,
IpDeviceConfigurationUpdate, IpDeviceEvent, Ipv4AddrConfig,
Ipv4DeviceConfigurationAndFlags, Ipv4DeviceConfigurationUpdate, Ipv6AddrManualConfig,
Ipv6DeviceConfiguration, Ipv6DeviceConfigurationAndFlags, Ipv6DeviceConfigurationUpdate,
Lifetime, PreferredLifetime, SetIpAddressPropertiesError, SlaacConfiguration,
SlaacConfigurationUpdate, TemporarySlaacAddressConfiguration, UpdateIpConfigurationError,
};
pub use netstack3_ip::multicast_forwarding::{
ForwardMulticastRouteError, MulticastForwardingDisabledError, MulticastForwardingEvent,
MulticastRoute, MulticastRouteKey, MulticastRouteStats, MulticastRouteTarget,
};
pub use netstack3_ip::raw::{
RawIpSocketIcmpFilter, RawIpSocketIcmpFilterError, RawIpSocketId, RawIpSocketProtocol,
RawIpSocketSendToError, RawIpSocketsBindingsContext, RawIpSocketsBindingsTypes,
WeakRawIpSocketId,
};
pub use netstack3_ip::socket::{
IpSockCreateAndSendError, IpSockCreationError, IpSockSendError,
};
pub use netstack3_ip::{IpLayerEvent, ResolveRouteError};
}
pub mod neighbor {
pub use netstack3_ip::nud::{
Event, EventDynamicState, EventKind, EventState, LinkResolutionContext,
LinkResolutionNotifier, LinkResolutionResult, NeighborRemovalError, NudUserConfig,
NudUserConfigUpdate, StaticNeighborInsertionError, MAX_ENTRIES,
};
}
pub mod routes {
pub use netstack3_base::WrapBroadcastMarker;
pub use netstack3_ip::{
AddRouteError, AddableEntry, AddableEntryEither, AddableMetric, Entry, EntryEither,
Generation, Mark, MarkDomain, MarkMatcher, MarkMatchers, Metric, NextHop, RawMetric,
ResolvedRoute, RoutableIpAddr, RoutingTableId, Rule, RuleAction, RuleMatcher,
TrafficOriginMatcher,
};
}
pub mod socket {
pub use netstack3_datagram::{
ConnInfo, ConnectError, ExpectedConnError, ExpectedUnboundError, ListenerInfo,
MulticastInterfaceSelector, MulticastMembershipInterfaceSelector, SendError, SendToError,
SetMulticastMembershipError, SocketInfo,
};
pub use netstack3_base::socket::{
AddrIsMappedError, NotDualStackCapableError, SetDualStackEnabledError, ShutdownType,
StrictlyZonedAddr,
};
}
pub mod sync {
use netstack3_sync as _;
pub use netstack3_base::sync::{
DebugReferences, DynDebugReferences, LockGuard, MapRcNotifier, Mutex, PrimaryRc,
RcNotifier, RwLock, RwLockReadGuard, RwLockWriteGuard, StrongRc, WeakRc,
};
pub use netstack3_base::{RemoveResourceResult, RemoveResourceResultWithContext};
}
pub mod tcp {
pub use netstack3_base::{FragmentedPayload, Payload, PayloadLen};
pub use netstack3_tcp::{
AcceptError, BindError, BoundInfo, Buffer, BufferLimits, BufferSizes, ConnectError,
ConnectionError, ConnectionInfo, IntoBuffers, ListenError, ListenerNotifier, NoConnection,
OriginalDestinationError, ReceiveBuffer, SendBuffer, SetDeviceError, SetReuseAddrError,
SocketAddr, SocketInfo, SocketOptions, TcpBindingsTypes, TcpSocketId, UnboundInfo,
DEFAULT_FIN_WAIT2_TIMEOUT,
};
}
pub mod types {
pub use netstack3_base::{Counter, WorkQueueReport};
}
pub mod udp {
pub use netstack3_udp::{
SendError, SendToError, UdpBindingsTypes, UdpPacketMeta, UdpReceiveBindingsContext,
UdpRemotePort, UdpSocketId,
};
}
pub use api::CoreApi;
pub use context::{CoreCtx, UnlockedCoreCtx};
pub use inspect::Inspector;
pub use marker::{BindingsContext, BindingsTypes, CoreContext, IpBindingsContext, IpExt};
pub use netstack3_base::{
CtxPair, DeferredResourceRemovalContext, EventContext, InstantBindingsTypes, InstantContext,
ReferenceNotifiers, RngContext, TimerBindingsTypes, TimerContext, TracingContext,
};
pub use state::{StackState, StackStateBuilder};
pub use time::{AtomicInstant, Instant, TimerId};
pub use netstack3_device::for_any_device_id;
pub use netstack3_macros::context_ip_bounds;