pub enum IpParseErrorAction {
DiscardPacket,
DiscardPacketSendIcmp,
DiscardPacketSendIcmpNoMulticast,
}
Expand description
Action to take when an IP node fails to parse a received IP packet.
These actions are taken from RFC 8200 section 4.2. Although these actions are defined by an IPv6 RFC, IPv4 nodes that fail to parse a received packet will take similar actions.
Variants§
DiscardPacket
Discard the packet and do nothing further.
DiscardPacketSendIcmp
Discard the packet and send an ICMP response.
DiscardPacketSendIcmpNoMulticast
Discard the packet and send an ICMP response if the packet’s destination address was not a multicast address.
Implementations§
Source§impl IpParseErrorAction
impl IpParseErrorAction
Sourcepub fn should_send_icmp<A: IpAddress>(&self, dst_addr: &A) -> bool
pub fn should_send_icmp<A: IpAddress>(&self, dst_addr: &A) -> bool
Determines whether or not an ICMP message should be sent.
Returns true
if the caller should send an ICMP response. The caller should
send an ICMP response if an action is set to DiscardPacketSendIcmp
, or
if an action is set to DiscardPacketSendIcmpNoMulticast
and dst_addr
(the destination address of the original packet that lead to a parsing
error) is not a multicast address.
Sourcepub fn should_send_icmp_to_multicast(&self) -> bool
pub fn should_send_icmp_to_multicast(&self) -> bool
Determines whether or not an ICMP message should be sent even if the original packet’s destination address is a multicast.
Per RFC 1122 section 3.2.2 and RFC 4443 section 2.4, ICMP messages MUST NOT
be sent in response to packets destined to a multicast or broadcast address.
However, RFC 4443 section 2.4 includes an exception to this rule if certain
criteria are met when parsing IPv6 extension header options.
should_send_icmp_to_multicast
returns true
if the criteria are met.
See RFC 4443 section 2.4 for more details about the exception.
Trait Implementations§
Source§impl Clone for IpParseErrorAction
impl Clone for IpParseErrorAction
Source§fn clone(&self) -> IpParseErrorAction
fn clone(&self) -> IpParseErrorAction
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for IpParseErrorAction
impl Debug for IpParseErrorAction
Source§impl PartialEq for IpParseErrorAction
impl PartialEq for IpParseErrorAction
impl Copy for IpParseErrorAction
impl StructuralPartialEq for IpParseErrorAction
Auto Trait Implementations§
impl Freeze for IpParseErrorAction
impl RefUnwindSafe for IpParseErrorAction
impl Send for IpParseErrorAction
impl Sync for IpParseErrorAction
impl Unpin for IpParseErrorAction
impl UnwindSafe for IpParseErrorAction
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)