pub enum Icmpv6PacketRaw<B: SplitByteSlice> {
DestUnreachable(IcmpPacketRaw<Ipv6, B, IcmpDestUnreachable>),
PacketTooBig(IcmpPacketRaw<Ipv6, B, Icmpv6PacketTooBig>),
TimeExceeded(IcmpPacketRaw<Ipv6, B, IcmpTimeExceeded>),
ParameterProblem(IcmpPacketRaw<Ipv6, B, Icmpv6ParameterProblem>),
EchoRequest(IcmpPacketRaw<Ipv6, B, IcmpEchoRequest>),
EchoReply(IcmpPacketRaw<Ipv6, B, IcmpEchoReply>),
Ndp(NdpPacketRaw<B>),
Mld(MldPacketRaw<B>),
}
Expand description
A raw ICMPv6 packet with a dynamic message type.
Unlike IcmpPacketRaw
, Packet
only supports ICMPv6, and does not
require a static message type. Each enum variant contains an IcmpPacketRaw
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§
DestUnreachable(IcmpPacketRaw<Ipv6, B, IcmpDestUnreachable>)
PacketTooBig(IcmpPacketRaw<Ipv6, B, Icmpv6PacketTooBig>)
TimeExceeded(IcmpPacketRaw<Ipv6, B, IcmpTimeExceeded>)
ParameterProblem(IcmpPacketRaw<Ipv6, B, Icmpv6ParameterProblem>)
EchoRequest(IcmpPacketRaw<Ipv6, B, IcmpEchoRequest>)
EchoReply(IcmpPacketRaw<Ipv6, B, IcmpEchoReply>)
Ndp(NdpPacketRaw<B>)
Mld(MldPacketRaw<B>)
Implementations§
Source§impl<B: SplitByteSliceMut> Icmpv6PacketRaw<B>
impl<B: SplitByteSliceMut> Icmpv6PacketRaw<B>
Sourcepub fn try_write_checksum(&mut self, src_ip: Ipv6Addr, dst_ip: Ipv6Addr) -> bool
pub fn try_write_checksum(&mut self, src_ip: Ipv6Addr, dst_ip: Ipv6Addr) -> bool
Attempts to calculate and write a Checksum for this Icmpv6PacketRaw
.
Returns whether the checksum was successfully calculated & written. In the false case, self is left unmodified.
Trait Implementations§
Source§impl<I: IcmpIpExt, B: SplitByteSliceMut> GenericOverIp<I> for Icmpv6PacketRaw<B>
impl<I: IcmpIpExt, B: SplitByteSliceMut> GenericOverIp<I> for Icmpv6PacketRaw<B>
Source§type Type = <I as IcmpIpExt>::IcmpPacketTypeRaw<B>
type Type = <I as IcmpIpExt>::IcmpPacketTypeRaw<B>
The type of
Self
when its IP-generic parameter is replaced with the
type NewIp
.Source§impl<B: SplitByteSliceMut> IcmpPacketTypeRaw<B, Ipv6> for Icmpv6PacketRaw<B>
impl<B: SplitByteSliceMut> IcmpPacketTypeRaw<B, Ipv6> for Icmpv6PacketRaw<B>
Source§fn update_checksum_pseudo_header_address(
&mut self,
old: Ipv6Addr,
new: Ipv6Addr,
)
fn update_checksum_pseudo_header_address( &mut self, old: Ipv6Addr, new: Ipv6Addr, )
Update the checksum to reflect an updated address in the pseudo header.
Source§impl<B: SplitByteSlice> ParsablePacket<B, ()> for Icmpv6PacketRaw<B>
impl<B: SplitByteSlice> ParsablePacket<B, ()> for Icmpv6PacketRaw<B>
Source§fn parse_metadata(&self) -> ParseMetadata
fn parse_metadata(&self) -> ParseMetadata
Gets metadata about this packet required by [
GrowBuffer::undo_parse
]. Read moreAuto Trait Implementations§
impl<B> Freeze for Icmpv6PacketRaw<B>where
B: Freeze,
impl<B> RefUnwindSafe for Icmpv6PacketRaw<B>where
B: RefUnwindSafe,
impl<B> Send for Icmpv6PacketRaw<B>where
B: Send,
impl<B> Sync for Icmpv6PacketRaw<B>where
B: Sync,
impl<B> Unpin for Icmpv6PacketRaw<B>where
B: Unpin,
impl<B> UnwindSafe for Icmpv6PacketRaw<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