Struct packet_formats::ipv4::Ipv4PacketRaw
source · pub struct Ipv4PacketRaw<B> { /* private fields */ }
Expand description
A partially parsed and not yet validated IPv4 packet.
Ipv4PacketRaw
provides minimal parsing of an IPv4 packet, namely
it only requires that the fixed header part (HeaderPrefix
) be retrieved,
all the other parts of the packet may be missing when attempting to create
it.
Ipv4Packet
provides a [FromRaw
] implementation that can be used to
validate an Ipv4PacketRaw
.
Implementations§
source§impl<B: ByteSlice> Ipv4PacketRaw<B>
impl<B: ByteSlice> Ipv4PacketRaw<B>
Trait Implementations§
source§impl<B: ByteSlice> FromRaw<Ipv4PacketRaw<B>, ()> for Ipv4Packet<B>
impl<B: ByteSlice> FromRaw<Ipv4PacketRaw<B>, ()> for Ipv4Packet<B>
§type Error = IpParseError<Ipv4>
type Error = IpParseError<Ipv4>
The type of error that may happen during validation.
source§fn try_from_raw_with(
raw: Ipv4PacketRaw<B>,
_args: ()
) -> Result<Self, Self::Error>
fn try_from_raw_with( raw: Ipv4PacketRaw<B>, _args: () ) -> Result<Self, Self::Error>
Attempts to create
Self
from the raw form in raw
with args
.source§impl<B: ByteSlice> Ipv4Header for Ipv4PacketRaw<B>
impl<B: ByteSlice> Ipv4Header for Ipv4PacketRaw<B>
source§fn get_header_prefix(&self) -> &HeaderPrefix
fn get_header_prefix(&self) -> &HeaderPrefix
Gets a reference to the IPv4
HeaderPrefix
.source§fn fragment_offset(&self) -> u16
fn fragment_offset(&self) -> u16
The fragment offset.
source§fn fragment_type(&self) -> Ipv4FragmentType
fn fragment_type(&self) -> Ipv4FragmentType
The fragment type. Read more
source§impl<B: ByteSlice> ParsablePacket<B, ()> for Ipv4PacketRaw<B>
impl<B: ByteSlice> ParsablePacket<B, ()> for Ipv4PacketRaw<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 Ipv4PacketRaw<B>where
B: Freeze,
impl<B> RefUnwindSafe for Ipv4PacketRaw<B>where
B: RefUnwindSafe,
impl<B> Send for Ipv4PacketRaw<B>where
B: Send,
impl<B> Sync for Ipv4PacketRaw<B>where
B: Sync,
impl<B> Unpin for Ipv4PacketRaw<B>where
B: Unpin,
impl<B> UnwindSafe for Ipv4PacketRaw<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