pub struct ParsedPacket {
pub link_info: LinkInfo,
pub net_info: NetInfo,
pub transport_info: TransportInfo,
}Expand description
Parsed network packet with info extracted from its headers.
Fields§
§link_info: LinkInfoInfo extracted from the data link layer header.
net_info: NetInfoInfo extracted from the network layer header.
transport_info: TransportInfoInfo extracted from the transport layer header.
Implementations§
Source§impl ParsedPacket
impl ParsedPacket
Sourcepub fn from_bytes(bytes: &[u8], link_type: LinkType) -> Option<ParsedPacket>
pub fn from_bytes(bytes: &[u8], link_type: LinkType) -> Option<ParsedPacket>
Parse one raw network packet from its link type and wire bytes.
Sourcepub fn bytes_count(&self) -> usize
pub fn bytes_count(&self) -> usize
Returns the total number of bytes in the packet.
Trait Implementations§
Source§impl Clone for ParsedPacket
impl Clone for ParsedPacket
Source§fn clone(&self) -> ParsedPacket
fn clone(&self) -> ParsedPacket
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ParsedPacket
Source§impl Debug for ParsedPacket
impl Debug for ParsedPacket
impl Eq for ParsedPacket
Source§impl Hash for ParsedPacket
impl Hash for ParsedPacket
Source§impl PartialEq for ParsedPacket
impl PartialEq for ParsedPacket
impl StructuralPartialEq for ParsedPacket
Auto Trait Implementations§
impl Freeze for ParsedPacket
impl RefUnwindSafe for ParsedPacket
impl Send for ParsedPacket
impl Sync for ParsedPacket
impl Unpin for ParsedPacket
impl UnsafeUnpin for ParsedPacket
impl UnwindSafe for ParsedPacket
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