Struct pcap_parser::pcap::PcapHeader
source · [−]pub struct PcapHeader {
pub magic_number: u32,
pub version_major: u16,
pub version_minor: u16,
pub thiszone: i32,
pub sigfigs: u32,
pub snaplen: u32,
pub network: Linktype,
}
Expand description
PCAP global header
Fields
magic_number: u32
File format and byte ordering. If equal to 0xa1b2c3d4
or 0xa1b23c4d
then the rest of
the file uses native byte ordering. If 0xd4c3b2a1
or 0x4d3cb2a1
(swapped), then all
following fields will have to be swapped too.
version_major: u16
Version major number (currently 2)
version_minor: u16
Version minor number (currently 4)
thiszone: i32
The correction time in seconds between GMT (UTC) and the local timezone of the following packet header timestamps
sigfigs: u32
In theory, the accuracy of time stamps in the capture; in practice, all tools set it to 0
snaplen: u32
max len of captured packets, in octets
network: Linktype
Data link type
Implementations
sourceimpl PcapHeader
impl PcapHeader
pub fn new() -> PcapHeader
pub const fn size(&self) -> usize
pub fn is_bigendian(&self) -> bool
pub fn is_nanosecond_precision(&self) -> bool
Trait Implementations
sourceimpl Clone for PcapHeader
impl Clone for PcapHeader
sourcefn clone(&self) -> PcapHeader
fn clone(&self) -> PcapHeader
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for PcapHeader
impl Debug for PcapHeader
sourceimpl Default for PcapHeader
impl Default for PcapHeader
sourceimpl<'a> From<&'a PcapHeader> for PcapBlock<'a>
impl<'a> From<&'a PcapHeader> for PcapBlock<'a>
sourcefn from(b: &'a PcapHeader) -> PcapBlock<'a>
fn from(b: &'a PcapHeader) -> PcapBlock<'a>
Converts to this type from the input type.
sourceimpl<'a> From<PcapHeader> for PcapBlockOwned<'a>
impl<'a> From<PcapHeader> for PcapBlockOwned<'a>
sourcefn from(b: PcapHeader) -> PcapBlockOwned<'a>
fn from(b: PcapHeader) -> PcapBlockOwned<'a>
Converts to this type from the input type.
sourceimpl ToVec for PcapHeader
Available on crate feature serialize
only.
impl ToVec for PcapHeader
serialize
only.Auto Trait Implementations
impl RefUnwindSafe for PcapHeader
impl Send for PcapHeader
impl Sync for PcapHeader
impl Unpin for PcapHeader
impl UnwindSafe for PcapHeader
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more