Enum netstack3_ip::ReceivePacketAction

source ·
pub enum ReceivePacketAction<I: BroadcastIpExt + IpLayerIpExt, DeviceId: StrongDeviceIdentifier> {
    Deliver {
        address_status: I::AddressStatus,
        internal_forwarding: InternalForwarding<DeviceId>,
    },
    Forward {
        original_dst: SpecifiedAddr<I::Addr>,
        dst: Destination<I::Addr, DeviceId>,
    },
    MulticastForward {
        targets: MulticastRouteTargets<DeviceId>,
        address_status: Option<I::AddressStatus>,
        dst_ip: SpecifiedAddr<I::Addr>,
    },
    SendNoRouteToDest {
        dst: SpecifiedAddr<I::Addr>,
    },
    Drop {
        reason: DropReason,
    },
}
Expand description

The action to take in order to process a received IP packet.

Variants§

§

Deliver

Deliver the packet locally.

Fields

§address_status: I::AddressStatus

Status of the receiving IP address.

§internal_forwarding: InternalForwarding<DeviceId>

InternalForwarding::Used(d) if we’re delivering the packet as a Weak Host performing internal forwarding via output device d.

§

Forward

Forward the packet to the given destination.

Fields

§original_dst: SpecifiedAddr<I::Addr>

The original destination IP address of the packet.

§dst: Destination<I::Addr, DeviceId>

The destination that the packet should be forwarded to.

§

MulticastForward

A multicast packet that should be forwarded (& optional local delivery).

The packet should be forwarded to each of the given targets. This case is only returned when the packet is eligible for multicast forwarding; Self::Deliver is used for packets that are ineligible (either because multicast forwarding is disabled, or because there are no applicable multicast routes with which to forward the packet).

Fields

§targets: MulticastRouteTargets<DeviceId>

The multicast targets to forward the packet via.

§address_status: Option<I::AddressStatus>

Some if the host is a member of the multicast group and the packet should be delivered locally (in addition to forwarding).

§dst_ip: SpecifiedAddr<I::Addr>

The multicast address the packet should be forwarded to.

§

SendNoRouteToDest

Send a Destination Unreachable ICMP error message to the packet’s sender and drop the packet.

For ICMPv4, use the code “net unreachable”. For ICMPv6, use the code “no route to destination”.

Fields

§dst: SpecifiedAddr<I::Addr>

The destination IP Address to which there was no route.

§

Drop

Silently drop the packet.

reason describes why the packet was dropped.

Fields

§reason: DropReason

Trait Implementations§

source§

impl<I: Debug + BroadcastIpExt + IpLayerIpExt, DeviceId: Debug + StrongDeviceIdentifier> Debug for ReceivePacketAction<I, DeviceId>
where I::AddressStatus: Debug, I::Addr: Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<I: PartialEq + BroadcastIpExt + IpLayerIpExt, DeviceId: PartialEq + StrongDeviceIdentifier> PartialEq for ReceivePacketAction<I, DeviceId>

source§

fn eq(&self, other: &ReceivePacketAction<I, DeviceId>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<I: BroadcastIpExt + IpLayerIpExt, DeviceId: StrongDeviceIdentifier> StructuralPartialEq for ReceivePacketAction<I, DeviceId>

Auto Trait Implementations§

§

impl<I, DeviceId> Freeze for ReceivePacketAction<I, DeviceId>
where <I as IpLayerIpExt>::AddressStatus: Freeze, DeviceId: Freeze, <I as Ip>::Addr: Freeze, <I as BroadcastIpExt>::BroadcastMarker: Freeze,

§

impl<I, DeviceId> RefUnwindSafe for ReceivePacketAction<I, DeviceId>

§

impl<I, DeviceId> Send for ReceivePacketAction<I, DeviceId>

§

impl<I, DeviceId> Sync for ReceivePacketAction<I, DeviceId>

§

impl<I, DeviceId> Unpin for ReceivePacketAction<I, DeviceId>
where <I as IpLayerIpExt>::AddressStatus: Unpin, DeviceId: Unpin, <I as Ip>::Addr: Unpin, <I as BroadcastIpExt>::BroadcastMarker: Unpin,

§

impl<I, DeviceId> UnwindSafe for ReceivePacketAction<I, DeviceId>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<CC, BC, Meta> RecvFrameContext<Meta, BC> for CC
where Meta: ReceivableFrameMeta<CC, BC>,

source§

fn receive_frame<B>(&mut self, bindings_ctx: &mut BC, metadata: Meta, frame: B)
where B: BufferMut + Debug,

Receive a frame. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<CC, BC, Meta> SendFrameContext<BC, Meta> for CC
where Meta: SendableFrameMeta<CC, BC>,

source§

fn send_frame<S>( &mut self, bindings_ctx: &mut BC, metadata: Meta, frame: S, ) -> Result<(), ErrorAndSerializer<SendFrameErrorReason, S>>
where S: Serializer, <S as Serializer>::Buffer: BufferMut,

Send a frame. Read more
source§

impl<Id, CC, BC> TimerHandler<BC, Id> for CC
where BC: TimerBindingsTypes, Id: HandleableTimer<CC, BC>,

source§

fn handle_timer( &mut self, bindings_ctx: &mut BC, dispatch: Id, timer: <BC as TimerBindingsTypes>::UniqueTimerId, )

Handle a timer firing. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<L, T> UnlockedAccess<L> for T
where L: UnlockedAccessMarkerFor<T>,

§

type Data = <L as UnlockedAccessMarkerFor<T>>::Data

The type of state being accessed.
§

type Guard<'l> = &'l <L as UnlockedAccessMarkerFor<T>>::Data where T: 'l

A guard providing read access to the data.
§

fn access(&self) -> <T as UnlockedAccess<L>>::Guard<'_>

How to access the state.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<B, A> LockBefore<B> for A
where B: LockAfter<A>,