Skip to main content

PcapNGBlock

Trait PcapNGBlock 

Source
pub trait PcapNGBlock {
    // Required methods
    fn big_endian(&self) -> bool;
    fn raw_data(&self) -> &[u8] ;
    fn data_len(&self) -> usize;
    fn data(&self) -> &[u8] ;
    fn header_len(&self) -> usize;

    // Provided methods
    fn block_type(&self) -> u32 { ... }
    fn block_length(&self) -> u32 { ... }
    fn block_length2(&self) -> u32 { ... }
    fn raw_header(&self) -> &[u8]  { ... }
    fn offset_options(&self) -> usize { ... }
    fn raw_options(&self) -> &[u8]  { ... }
}
Expand description

Common methods for PcapNG blocks

Required Methods§

Source

fn big_endian(&self) -> bool

Returns true if block is encoded as big-endian

Source

fn raw_data(&self) -> &[u8]

Raw block data (including header)

Source

fn data_len(&self) -> usize

The length of inner data, if any

Source

fn data(&self) -> &[u8]

The inner data, if any

Source

fn header_len(&self) -> usize

The Header length (without options)

Provided Methods§

Source

fn block_type(&self) -> u32

The type of this block

Source

fn block_length(&self) -> u32

The block length from the block header

Source

fn block_length2(&self) -> u32

The block length from the block footer

Source

fn raw_header(&self) -> &[u8]

Raw packet header (without options)

Source

fn offset_options(&self) -> usize

Return the declared offset of options. Warning: the offset can be out of bounds, caller must test value before accessing data

Source

fn raw_options(&self) -> &[u8]

Network packet options. Can be empty if packet does not contain options

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§