pub enum Icmpv4Packet<B: SplitByteSlice> {
EchoReply(IcmpPacket<Ipv4, B, IcmpEchoReply>),
DestUnreachable(IcmpPacket<Ipv4, B, IcmpDestUnreachable>),
Redirect(IcmpPacket<Ipv4, B, Icmpv4Redirect>),
EchoRequest(IcmpPacket<Ipv4, B, IcmpEchoRequest>),
TimeExceeded(IcmpPacket<Ipv4, B, IcmpTimeExceeded>),
ParameterProblem(IcmpPacket<Ipv4, B, Icmpv4ParameterProblem>),
TimestampRequest(IcmpPacket<Ipv4, B, Icmpv4TimestampRequest>),
TimestampReply(IcmpPacket<Ipv4, B, Icmpv4TimestampReply>),
}
Expand description
An ICMPv4 packet with a dynamic message type.
Unlike IcmpPacket
, Packet
only supports ICMPv4, and does not
require a static message type. Each enum variant contains an IcmpPacket
of
the appropriate static type, making it easier to call parse
without
knowing the message type ahead of time while still getting the benefits of a
statically-typed packet struct after parsing is complete.
Variants§
EchoReply(IcmpPacket<Ipv4, B, IcmpEchoReply>)
DestUnreachable(IcmpPacket<Ipv4, B, IcmpDestUnreachable>)
Redirect(IcmpPacket<Ipv4, B, Icmpv4Redirect>)
EchoRequest(IcmpPacket<Ipv4, B, IcmpEchoRequest>)
TimeExceeded(IcmpPacket<Ipv4, B, IcmpTimeExceeded>)
ParameterProblem(IcmpPacket<Ipv4, B, Icmpv4ParameterProblem>)
TimestampRequest(IcmpPacket<Ipv4, B, Icmpv4TimestampRequest>)
TimestampReply(IcmpPacket<Ipv4, B, Icmpv4TimestampReply>)
Trait Implementations§
Source§impl<B: SplitByteSlice + Debug> Debug for Icmpv4Packet<B>
impl<B: SplitByteSlice + Debug> Debug for Icmpv4Packet<B>
Source§impl<B: SplitByteSlice> ParsablePacket<B, IcmpParseArgs<Ipv4Addr>> for Icmpv4Packet<B>
impl<B: SplitByteSlice> ParsablePacket<B, IcmpParseArgs<Ipv4Addr>> for Icmpv4Packet<B>
Source§fn parse_metadata(&self) -> ParseMetadata
fn parse_metadata(&self) -> ParseMetadata
Gets metadata about this packet required by [
GrowBuffer::undo_parse
]. Read moreSource§fn parse<BV: BufferView<B>>(
buffer: BV,
args: IcmpParseArgs<Ipv4Addr>,
) -> ParseResult<Self>
fn parse<BV: BufferView<B>>( buffer: BV, args: IcmpParseArgs<Ipv4Addr>, ) -> ParseResult<Self>
Parses a packet from a buffer. Read more
Auto Trait Implementations§
impl<B> Freeze for Icmpv4Packet<B>where
B: Freeze,
impl<B> RefUnwindSafe for Icmpv4Packet<B>where
B: RefUnwindSafe,
impl<B> Send for Icmpv4Packet<B>where
B: Send,
impl<B> Sync for Icmpv4Packet<B>where
B: Sync,
impl<B> Unpin for Icmpv4Packet<B>where
B: Unpin,
impl<B> UnwindSafe for Icmpv4Packet<B>where
B: 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