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§
- rcu
- Read-copy-update data structure.
- 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.
- testutil
- Test utilities provided to all crates.
Macros§
- bench
- Declare a benchmark function.
Structs§
- Address
Resolution Failed - Error when link address resolution failed for a neighbor.
- Buffer
Size Settings - Common settings applied to buffer size configuration.
- Counter
- An atomic counter for packet statistics, e.g. IPv4 packets received.
- CtxPair
- A concrete implementation of
ContextPair
. - Effective
Mss - Like
Mss
, but smaller to account for fixed-size TCP Options. - Ephemeral
Port - A witness type for a port within some ephemeral port range.
- Error
AndSerializer - An error and a serializer.
- Exists
Error - Error when something exists unexpectedly.
- Fragmented
Payload - An implementation of
Payload
backed by up toN
byte slices. - Handshake
Options - Segment options available on handshake segments.
- IpDevice
Addr - An IP address that witnesses properties needed to be assigned to a device.
- Local
Timer Heap - A local timer heap that keeps timers for core modules.
- MapDeref
- A helper type that provides mapping
Deref
implementations. - Mark
- A mark attached to packets/sockets.
- Mark
Storage - 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.
- Nested
Into Core Timer Ctx - An uninstantiable type that performs conversions based on
Into
implementations and an available outerCoreTimerContext
CC
. - NotFound
Error - Error when something unexpectedly doesn’t exist, such as trying to remove an element when the element is not present.
- NotSupported
Error - Error when something is not supported.
- Positive
Isize - An
isize
that is strictly positive (greater than 0). - Recv
IpFrame Meta - The metadata required for a packet to get into the IP layer.
- Reset
Options - Segment options available on reset segments.
- RxTimestamp
Option - Like
TimestampOption
but with units appropriate for a timestamp option sent by the peer. - Sack
Block - A selective ACK block.
- Sack
Blocks - Blocks of selective ACKs.
- Segment
- A TCP segment.
- Segment
Header - All non-data portions of a TCP segment.
- Segment
Options - Segment options available on data segments.
- SeqNum
- Sequence number of a transferred TCP segment.
- Subnet
Matcher - Matcher that matches IP addresses in a subnet.
- Timestamp
- A timestamp to be used in the TCP Timestamp Option.
- Timestamp
Option - The TCP timestamp option as defined in RFC 7323, Section 3.
- Token
Bucket - A token bucket used for rate limiting.
- TxTimestamp
Option - Like
TimestampOption
but with units appropriate for a timestamp option sent by us. - Uninstantiable
- An uninstantiable type.
- Uninstantiable
Wrapper - An uninstantiable type that wraps an instantiable type,
A
. - Unscaled
Window Size - Window size that is used in the window field of a TCP segment.
- Verified
TcpSegment - A TCP segment that has been verified to have valid flags. Can be converted
to a
Segment
. - Window
Scale - This type is a witness for a valid window scale exponent value.
- Window
Size - A witness type for TCP window size.
- Wrap
Broadcast Marker - Wrapper struct to provide a convenient
GenericOverIp
impl for use withBroadcastIpExt::BroadcastMarker
.
Enums§
- AnyDevice
- Marker type for a generic device.
- Bound
Interface Matcher - Matcher for the bound device of locally generated traffic.
- Control
- Control flags that can alter the state of a TCP control block.
- Either
Device Id - A device id that might be either in its strong or weak form.
- Frame
Destination - The type of address used as the destination address in a device-layer frame.
- Icmp
Error Code - An ICMP error of either IPv4 or IPv6.
- Icmpv4
Error Code - An ICMPv4 error type and code.
- Icmpv6
Error Code - An ICMPv6 error type and code.
- Interface
Matcher - A matcher for network interfaces.
- Into
Core Timer Ctx - An uninstantiable type that performs conversions based on
Into
implementations. - Local
Address Error - Error type for errors common to local addresses.
- Mark
Domain - Mark domains.
- Milliseconds
- A marker type indicating that the backing units of a
Timestamp
are milliseconds. - Options
- Contains all supported TCP options.
- Remote
Address Error - An error encountered when attempting to create a UDP, TCP, or ICMP connection.
- Remove
Resource Result - The result of removing some reference-counted resource from core.
- Send
Frame Error Reason - The error type for
SendFrameError
. - Socket
Error - Error type for connection errors.
- Unitless
- A marker type indicating that the backing units of a
Timestamp
are unknown. - Work
Queue Report - A common type returned by functions that perform bounded amounts of work.
- Zoned
Address Error - Indicates a problem related to an address with a zone.
Traits§
- Assigned
Addr IpExt - An extension trait adding an associated type for an IP address assigned to a device.
- Atomic
Instant - A type representing an instant in time that can be atomically updated.
- Bidirectional
Converter - Provides functions for converting infallibly between types.
- Broadcast
IpExt Ip
extension trait to assist in defining [NextHop
].- Buildable
Core Context - A core context that can be created from some builder type.
- Context
Pair - A pair of core and bindings contexts.
- Context
Provider - A type that provides a context implementation.
- Core
Timer Context - A core context providing timer type conversion.
- Core
TxMetadata Context - A core context providing tx metadata type conversion.
- Counter
Collection - A collection of counters.
- Counter
Collection Spec - The specification of a
CounterCollection
. - Counter
Context - A context that stores counters.
- Counter
Repr - A marker trait to indicate types that may be used as a counter.
- Deferred
Resource Removal Context - A context trait that allows core to defer observing proper resource cleanup to bindings.
- Device
- A device.
- Device
IdAny Compat Context - A marker trait tying
DeviceIdContext
implementations. - Device
IdContext - An execution context which provides device ID types type for various netstack internals to share.
- Device
Identifier - An identifier for a device.
- Event
Context - A context for emitting events.
- Handleable
Timer - A timer that can be handled by a pair of core context
CC
and bindings contextBC
. - Icmp
IpExt - 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
. - Inspectable
Value - A trait that marks a type as inspectable.
- Inspector
- A trait abstracting a state inspector.
- Inspector
Device Ext - An extension to
Inspector
that allows transforming and recording device identifiers. - Inspector
Ext - Extension trait for
Inspector
adding support for netstack3-specific types. - Instant
- A type representing an instant in time.
- Instant
Bindings Types - Trait defining the
Instant
type provided by bindings’InstantContext
implementation. - Instant
Context - A context that provides access to a monotonic clock.
- Interface
Properties - Allows code to match on properties of an interface (ID, name, and device class) without Netstack3 Core (or Bindings, in the case of the device class) having to specifically expose that state.
- IpAddress
Id - An IP address ID.
- IpDevice
Address IdContext - Provides the execution context related to address IDs.
- IpExt
- An
Ip
extension trait adding functionality specific to the IP layer. - IpTypes
IpExt Ip
extension trait to assist in defining [NextHop
].- Link
Address - The type of address used by a link device.
- Link
Device - A link device.
- Link
Unicast Address - A link address that can be unicast.
- MapDeref
Ext - A trait providing an easy way to instantiate
MapDeref
. - Matcher
- Common pattern to define a matcher for a metadata input
T
. - Matcher
Bindings Types - Trait defining required types for matchers provided by bindings.
- Owned
OrRefs Bidirectional Converter - A marker trait for
BidirectionalConverter
of owned or reference types. - Payload
- A TCP payload that operates around
u32
instead ofusize
. - Payload
Len - A TCP payload that only allows for getting the length of the payload.
- Port
Alloc Impl - Trait that configures the behavior of port allocation.
- Receivable
Frame Meta - A trait providing the receive implementation for some frame identified by a metadata type.
- Recv
Frame Context - A context for receiving frames.
- Reference
Notifiers - A context trait determining the types to be used for reference notifications.
- Reference
Notifiers Ext - An extension of
ReferenceNotifiers
providing extra functionality. - Resource
Counter Context - A context that provides access to per-resource counters for observation and debugging.
- RngContext
- A context that provides a random number generator (RNG).
- Send
Frame Context - A context for sending frames.
- Sendable
Frame Meta - A trait providing the send implementation for some frame identified by a metadata type.
- Settings
Context - Abstracts access to stack settings.
- Strong
Device Identifier - A strong device reference.
- Test
Only Partial Eq - Applies
PartialEq
bounds, only in tests. - Timer
Bindings Types - Opaque types provided by bindings used by
TimerContext
. - Timer
Context - A context providing time scheduling to core.
- Timer
Handler - A handler for timer firing events.
- TxMetadata
- A trait for the metadata associated with a TX frame.
- TxMetadata
Bindings Types - A trait abstracting TX frame metadata when traversing the stack.
- Weak
Device Identifier - A weak device reference.
- Weak
IpAddress Id - A weak IP address ID.
Functions§
- simple_
randomized_ port_ alloc - Implements the algorithm 1 as described in RFC 6056.
Type Aliases§
- Ipv4
Device Addr - An Ipv4 address that witnesses properties needed to be assigned to a device.
- Ipv6
Device Addr - An IPv6 address that witnesses properties needed to be assigned to a device.
- Marks
- The 2 marks that can be attached to packets.
- Remove
Resource Result With Context - An alias for
RemoveResourceResult
that extracts the receiver type from the bindings context. - Send
Frame Error - Errors returned by
SendFrameContext::send_frame
.