Struct pcap_file::PcapHeader
[−]
[src]
pub struct PcapHeader { pub magic_number: u32, pub version_major: u16, pub version_minor: u16, pub ts_correction: i32, pub ts_accuracy: u32, pub snaplen: u32, pub datalink: DataLink, }
Struct that represents the global Pcap header of a Pcap file
Fields
magic_number: u32
Magic number
version_major: u16
Major version number
version_minor: u16
Minor version number
ts_correction: i32
GMT to local timezone correction, should always be 0
ts_accuracy: u32
Timestamp accuracy, should always be 0
snaplen: u32
Max length of captured packet, typically 65535
datalink: DataLink
DataLink type (first layer in the packet (u32))
Methods
impl PcapHeader
[src]
fn with_datalink(datalink: DataLink) -> PcapHeader
[src]
Creates a new PcapHeader
with the following parameters:
⚠Be careful when using this code, it's not being tested!
PcapHeader { magic_number : 0xa1b2c3d4, version_major : 2, version_minor : 4, ts_correction : 0, ts_accuracy : 0, snaplen : 65535, datalink : datalink };
fn from_reader<R: Read>(reader: &mut R) -> ResultChain<PcapHeader>
[src]
Parses a Reader
and creates a new PcapHeader
from it if possible
fn to_array<B: ByteOrder>(&self) -> ResultChain<Vec<u8>>
[src]
Convert a PcapHeader
to a Vec<u8>
.
fn endianness(&self) -> Endianness
[src]
fn ts_resolution(&self) -> TsResolution
[src]
Trait Implementations
impl Copy for PcapHeader
[src]
impl Clone for PcapHeader
[src]
fn clone(&self) -> PcapHeader
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for PcapHeader
[src]
impl Eq for PcapHeader
[src]
impl PartialEq for PcapHeader
[src]
fn eq(&self, __arg_0: &PcapHeader) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &PcapHeader) -> bool
[src]
This method tests for !=
.