Crate netstack3_base

Source
Expand description

Base type definitions for netstack3 core.

This crate contains definitions common to the other netstack3 core crates and is the base dependency for most of them.

Modules§

ref_counted_hash_map
Reference counted hash map data structure.
socket
Common types and utilities for sockets.
socketmap
Defines generic data structures used to implement common application socket functionality for multiple protocols.
sync
Sync utilities common to netstack3.

Structs§

AddressResolutionFailed
Error when link address resolution failed for a neighbor.
Counter
An atomic counter for packet statistics, e.g. IPv4 packets received.
CtxPair
A concrete implementation of ContextPair.
DeviceNameMatcher
Matcher that matches devices with the name.
EphemeralPort
A witness type for a port within some ephemeral port range.
ErrorAndSerializer
An error and a serializer.
ExistsError
Error when something exists unexpectedly.
FragmentedPayload
An implementation of Payload backed by up to N byte slices.
HandshakeOptions
Segment options only set on handshake.
IpDeviceAddr
An IP address that witnesses properties needed to be assigned to a device.
LocalTimerHeap
A local timer heap that keeps timers for core modules.
Mark
A mark attached to packets/sockets.
MarkStorage
A storage backed by an array with the same cardinality of MarkDomain.
Mms
Maximum packet size, that is the maximum IP payload one packet can carry.
Mss
Maximum segment size, that is the maximum TCP payload one segment can carry.
NestedIntoCoreTimerCtx
An uninstantiable type that performs conversions based on Into implementations and an available outer CoreTimerContext CC.
NotFoundError
Error when something unexpectedly doesn’t exist, such as trying to remove an element when the element is not present.
NotSupportedError
Error when something is not supported.
PositiveIsize
An isize that is strictly positive (greater than 0).
RecvIpFrameMeta
The metadata required for a packet to get into the IP layer.
SackBlock
A selective ACK block.
SackBlocks
Blocks of selective ACKs.
Segment
A TCP segment.
SegmentHeader
All non-data portions of a TCP segment.
SegmentOptions
Segment options set on non-handshake segments.
SeqNum
Sequence number of a transferred TCP segment.
SubnetMatcher
Matcher that matches IP addresses in a subnet.
TokenBucket
A token bucket used for rate limiting.
Uninstantiable
An uninstantiable type.
UninstantiableWrapper
An uninstantiable type that wraps an instantiable type, A.
UnscaledWindowSize
Window size that is used in the window field of a TCP segment.
WindowScale
This type is a witness for a valid window scale exponent value.
WindowSize
A witness type for TCP window size.
WrapBroadcastMarker
Wrapper struct to provide a convenient GenericOverIp impl for use with BroadcastIpExt::BroadcastMarker.

Enums§

AnyDevice
Marker type for a generic device.
Control
Control flags that can alter the state of a TCP control block.
EitherDeviceId
A device id that might be either in its strong or weak form.
FrameDestination
The type of address used as the destination address in a device-layer frame.
IcmpErrorCode
An ICMP error of either IPv4 or IPv6.
Icmpv4ErrorCode
An ICMPv4 error type and code.
Icmpv6ErrorCode
An ICMPv6 error type and code.
IntoCoreTimerCtx
An uninstantiable type that performs conversions based on Into implementations.
LocalAddressError
Error type for errors common to local addresses.
MarkDomain
Mark domains.
Options
Contains all supported TCP options.
RemoteAddressError
An error encountered when attempting to create a UDP, TCP, or ICMP connection.
RemoveResourceResult
The result of removing some reference-counted resource from core.
SendFrameErrorReason
The error type for SendFrameError.
SocketError
Error type for connection errors.
WorkQueueReport
A common type returned by functions that perform bounded amounts of work.
ZonedAddressError
Indicates a problem related to an address with a zone.

Traits§

AssignedAddrIpExt
An extension trait adding an associated type for an IP address assigned to a device.
AtomicInstant
A type representing an instant in time that can be atomically updated.
BidirectionalConverter
Provides functions for converting infallibly between types.
BroadcastIpExt
Ip extension trait to assist in defining [NextHop].
BuildableCoreContext
A core context that can be created from some builder type.
ContextPair
A pair of core and bindings contexts.
ContextProvider
A type that provides a context implementation.
CoreEventContext
An event context implemented by core contexts to wrap event types that are not exposed to bindings.
CoreTimerContext
A core context providing timer type conversion.
CoreTxMetadataContext
A core context providing tx metadata type conversion.
CounterContext
A context that stores counters.
DeferredResourceRemovalContext
A context trait that allows core to defer observing proper resource cleanup to bindings.
Device
A device.
DeviceIdAnyCompatContext
A marker trait tying DeviceIdContext implementations.
DeviceIdContext
An execution context which provides device ID types type for various netstack internals to share.
DeviceIdentifier
An identifier for a device.
DeviceWithName
Allows the user to match a device with a name.
EventContext
A context for emitting events.
HandleableTimer
A timer that can be handled by a pair of core context CC and bindings context BC.
IcmpIpExt
An extension trait adding extra ICMP-related functionality to IP versions.
Inspectable
A trait that allows a type to record its fields to an inspector.
InspectableValue
A trait that marks a type as inspectable.
Inspector
A trait abstracting a state inspector.
InspectorDeviceExt
An extension to Inspector that allows transforming and recording device identifiers.
InspectorExt
Extension trait for Inspector adding support for netstack3-specific types.
Instant
A type representing an instant in time.
InstantBindingsTypes
Trait defining the Instant type provided by bindings’ InstantContext implementation.
InstantContext
A context that provides access to a monotonic clock.
IpAddressId
An IP address ID.
IpDeviceAddressIdContext
Provides the execution context related to address IDs.
IpExt
An Ip extension trait adding functionality specific to the IP layer.
IpTypesIpExt
Ip extension trait to assist in defining [NextHop].
LinkAddress
The type of address used by a link device.
LinkDevice
A link device.
LinkUnicastAddress
A link address that can be unicast.
Matcher
Common pattern to define a matcher for a metadata input T.
OwnedOrRefsBidirectionalConverter
A marker trait for BidirectionalConverter of owned or reference types.
Payload
A TCP payload that operates around u32 instead of usize.
PayloadLen
A TCP payload that only allows for getting the length of the payload.
PortAllocImpl
Trait that configures the behavior of port allocation.
ReceivableFrameMeta
A trait providing the receive implementation for some frame identified by a metadata type.
RecvFrameContext
A context for receiving frames.
ReferenceNotifiers
A context trait determining the types to be used for reference notifications.
ReferenceNotifiersExt
An extension of ReferenceNotifiers providing extra functionality.
ResourceCounterContext
A context that provides access to per-resource counters for observation and debugging.
RngContext
A context that provides a random number generator (RNG).
SendFrameContext
A context for sending frames.
SendableFrameMeta
A trait providing the send implementation for some frame identified by a metadata type.
StrongDeviceIdentifier
A strong device reference.
TimerBindingsTypes
Opaque types provided by bindings used by TimerContext.
TimerContext
A context providing time scheduling to core.
TimerHandler
A handler for timer firing events.
TxMetadataBindingsTypes
A trait abstracting TX frame metadata when traversing the stack.
WeakDeviceIdentifier
A weak device reference.
WeakIpAddressId
A weak IP address ID.

Functions§

simple_randomized_port_alloc
Implements the algorithm 1 as described in RFC 6056.

Type Aliases§

Ipv4DeviceAddr
An Ipv4 address that witnesses properties needed to be assigned to a device.
Ipv6DeviceAddr
An IPv6 address that witnesses properties needed to be assigned to a device.
Marks
The 2 marks that can be attached to packets.
RemoveResourceResultWithContext
An alias for RemoveResourceResult that extracts the receiver type from the bindings context.
SendFrameError
Errors returned by SendFrameContext::send_frame.