Struct pcap_file::pcap_header::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 represent 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
Creates a new PcapHeader
with the following parameters:
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>
Parse a Reader
and create a new PcapHeader from it if possible
fn to_array<B: ByteOrder>(&self) -> ResultChain<Vec<u8>>
Convert the PcapHeader
to a slice of bytes.
fn endianness(&self) -> Endianness
fn ts_resolution(&self) -> TsResolution
Trait Implementations
impl Copy for PcapHeader
[src]
impl Clone for PcapHeader
[src]
fn clone(&self) -> PcapHeader
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more