[][src]Struct pcarp::block::SectionHeader

pub struct SectionHeader<'a> {
    pub endianness: Endianness,
    pub major_version: u16,
    pub minor_version: u16,
    pub section_length: i64,
    pub options: &'a [u8],
}

Defines the most important characteristics of the capture file.

The Section Header Block (SHB) is mandatory. It identifies the beginning of a section of the capture capture file. The Section Header Block does not contain data but it rather identifies a list of blocks (interfaces, packets) that are logically correlated.

This documentation is copyright (c) 2018 IETF Trust and the persons identified as the authors of this document. All rights reserved. Please see the linked document for the full copyright notice.

Fields

endianness: Endianness

Used to distinguish sections that have been saved on little-endian machines from the ones saved on big-endian machines.

major_version: u16

Number of the current mayor version of the format. Current value is 1. This value should change if the format changes in such a way that code that reads the new format could not read the old format (i.e., code to read both formats would have to check the version number and use different code paths for the two formats) and code that reads the old format could not read the new format.

minor_version: u16

Number of the current minor version of the format. Current value is 0. This value should change if the format changes in such a way that code that reads the new format could read the old format without checking the version number but code that reads the old format could not read all files in the new format.

section_length: i64

A signed 64-bit value specifying the length in octets of the following section, excluding the Section Header Block itself. This field can be used to skip the section, for faster navigation inside large files. Section Length equal -1 (0xFFFFFFFFFFFFFFFF) means that the size of the section is not specified, and the only way to skip the section is to parse the blocks that it contains. Please note that if this field is valid (i.e. not negative), its value is always aligned to 32 bits, as all the blocks are aligned to and padded to 32-bit boundaries. Also, special care should be taken in accessing this field: since the alignment of all the blocks in the file is 32-bits, this field is not guaranteed to be aligned to a 64-bit boundary. This could be a problem on 64-bit processors.

options: &'a [u8]

Optionally, a list of options (formatted according to the rules defined in Section 3.5) can be present.

Trait Implementations

impl<'a> From<SectionHeader<'a>> for Block<'a>[src]

impl<'a> Clone for SectionHeader<'a>[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl<'a> PartialEq<SectionHeader<'a>> for SectionHeader<'a>[src]

impl<'a> Debug for SectionHeader<'a>[src]

Auto Trait Implementations

impl<'a> Send for SectionHeader<'a>

impl<'a> Sync for SectionHeader<'a>

Blanket Implementations

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

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

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

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

The type returned in the event of a conversion error.