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::AddressStatusStatus 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: DropReasonTrait Implementations§
Source§impl<I: Debug + BroadcastIpExt + IpLayerIpExt, DeviceId: Debug + StrongDeviceIdentifier> Debug for ReceivePacketAction<I, DeviceId>
impl<I: Debug + BroadcastIpExt + IpLayerIpExt, DeviceId: Debug + StrongDeviceIdentifier> Debug for ReceivePacketAction<I, DeviceId>
Source§impl<I: PartialEq + BroadcastIpExt + IpLayerIpExt, DeviceId: PartialEq + StrongDeviceIdentifier> PartialEq for ReceivePacketAction<I, DeviceId>
impl<I: PartialEq + BroadcastIpExt + IpLayerIpExt, DeviceId: PartialEq + StrongDeviceIdentifier> PartialEq for ReceivePacketAction<I, DeviceId>
Source§fn eq(&self, other: &ReceivePacketAction<I, DeviceId>) -> bool
fn eq(&self, other: &ReceivePacketAction<I, DeviceId>) -> bool
self and other values to be equal, and is used by ==.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>where
<I as IpLayerIpExt>::AddressStatus: RefUnwindSafe,
DeviceId: RefUnwindSafe,
<I as Ip>::Addr: RefUnwindSafe,
<I as BroadcastIpExt>::BroadcastMarker: RefUnwindSafe,
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>where
<I as IpLayerIpExt>::AddressStatus: UnwindSafe,
DeviceId: UnwindSafe + RefUnwindSafe,
<I as Ip>::Addr: UnwindSafe,
<I as BroadcastIpExt>::BroadcastMarker: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more