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

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Converts to this type from the input type.

Converts to this type from the input type.

Serialize to bytes representation (little-endian). Do not check values

Serialize to bytes representation (little-endian). Check values and fix all fields before serializing. Read more

Check and correct all fields: use magic, fix lengths fields and other values if possible.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.