pub struct ParsedFrame<'a> { /* private fields */ }Expand description
A parsed ethernet frame with convenient accessors for policy matching.
Wraps etherparse::SlicedPacket for zero-copy header inspection.
Supports Ethernet II, ARP, IPv4, IPv6, TCP, UDP, ICMPv4, and
ICMPv6 (including NDP) via etherparse.
Implementations§
Source§impl<'a> ParsedFrame<'a>
impl<'a> ParsedFrame<'a>
Sourcepub fn parse(raw: &'a [u8]) -> Option<Self>
pub fn parse(raw: &'a [u8]) -> Option<Self>
Parse an ethernet frame. Returns None if the frame is malformed.
Sourcepub fn sliced(&self) -> &SlicedPacket<'a>
pub fn sliced(&self) -> &SlicedPacket<'a>
Get the inner SlicedPacket for direct access to etherparse types.
Sourcepub fn is_ndp(&self) -> bool
pub fn is_ndp(&self) -> bool
Returns true if the frame is an IPv6 NDP (Neighbor Discovery) message.
NDP uses ICMPv6 types 133–137: Router Solicitation, Router Advertisement, Neighbor Solicitation, Neighbor Advertisement, and Redirect.
Sourcepub fn protocol(&self) -> Option<IpProtocol>
pub fn protocol(&self) -> Option<IpProtocol>
Get the IP protocol.
Auto Trait Implementations§
impl<'a> Freeze for ParsedFrame<'a>
impl<'a> RefUnwindSafe for ParsedFrame<'a>
impl<'a> Send for ParsedFrame<'a>
impl<'a> Sync for ParsedFrame<'a>
impl<'a> Unpin for ParsedFrame<'a>
impl<'a> UnsafeUnpin for ParsedFrame<'a>
impl<'a> UnwindSafe for ParsedFrame<'a>
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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