pub enum IpParseError<I: IcmpIpExt> {
Parse {
error: ParseError,
},
ParameterProblem {
src_ip: I::Addr,
dst_ip: I::Addr,
code: I::ParameterProblemCode,
pointer: I::ParameterProblemPointer,
must_send_icmp: bool,
header_len: I::HeaderLen,
action: IpParseErrorAction,
},
}
Expand description
Error type for IP packet parsing.
Variants§
Parse
Fields
§
error: ParseError
ParameterProblem
For errors where an ICMP Parameter Problem error needs to be sent to the source of a packet.
Fields
§
code: I::ParameterProblemCode
The ICMPv4 or ICMPv6 parameter problem code that provides more granular information about the parameter problem encountered.
§
pointer: I::ParameterProblemPointer
The offset of the erroneous value within the IP packet.
§
action: IpParseErrorAction
The action IP nodes should take upon encountering this error.
If must_send_icmp
is true
, IP nodes MUST send an ICMP response
if action
specifies it. Otherwise, the node MAY choose to discard
the packet and do nothing further.
If the packet was an IPv4 non-initial fragment, action
will be
IpParseErrorAction::DiscardPacket
.
Trait Implementations§
Source§impl<I: Debug + IcmpIpExt> Debug for IpParseError<I>where
I::Addr: Debug,
I::ParameterProblemCode: Debug,
I::ParameterProblemPointer: Debug,
I::HeaderLen: Debug,
impl<I: Debug + IcmpIpExt> Debug for IpParseError<I>where
I::Addr: Debug,
I::ParameterProblemCode: Debug,
I::ParameterProblemPointer: Debug,
I::HeaderLen: Debug,
Source§impl<I: IcmpIpExt> Display for IpParseError<I>
impl<I: IcmpIpExt> Display for IpParseError<I>
Source§impl<I: IcmpIpExt> Error for IpParseError<I>
impl<I: IcmpIpExt> Error for IpParseError<I>
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl<I: IcmpIpExt> From<OptionParseErr> for IpParseError<I>
impl<I: IcmpIpExt> From<OptionParseErr> for IpParseError<I>
Source§impl<I: IcmpIpExt> From<ParseError> for IpParseError<I>
impl<I: IcmpIpExt> From<ParseError> for IpParseError<I>
Source§fn from(source: ParseError) -> Self
fn from(source: ParseError) -> Self
Converts to this type from the input type.
Source§impl<I: PartialEq + IcmpIpExt> PartialEq for IpParseError<I>where
I::Addr: PartialEq,
I::ParameterProblemCode: PartialEq,
I::ParameterProblemPointer: PartialEq,
I::HeaderLen: PartialEq,
impl<I: PartialEq + IcmpIpExt> PartialEq for IpParseError<I>where
I::Addr: PartialEq,
I::ParameterProblemCode: PartialEq,
I::ParameterProblemPointer: PartialEq,
I::HeaderLen: PartialEq,
impl<I: IcmpIpExt> StructuralPartialEq for IpParseError<I>
Auto Trait Implementations§
impl<I> Freeze for IpParseError<I>
impl<I> RefUnwindSafe for IpParseError<I>where
<I as Ip>::Addr: RefUnwindSafe,
<I as IcmpIpExt>::ParameterProblemCode: RefUnwindSafe,
<I as IcmpIpExt>::ParameterProblemPointer: RefUnwindSafe,
<I as IcmpIpExt>::HeaderLen: RefUnwindSafe,
impl<I> Send for IpParseError<I>
impl<I> Sync for IpParseError<I>
impl<I> Unpin for IpParseError<I>
impl<I> UnwindSafe for IpParseError<I>where
<I as Ip>::Addr: UnwindSafe,
<I as IcmpIpExt>::ParameterProblemCode: UnwindSafe,
<I as IcmpIpExt>::ParameterProblemPointer: UnwindSafe,
<I as IcmpIpExt>::HeaderLen: 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
Mutably borrows from an owned value. Read more