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>
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 ==
.