pub struct InterfaceDescriptionBlock<'a> {
pub block_type: u32,
pub block_len1: u32,
pub linktype: Linktype,
pub reserved: u16,
pub snaplen: u32,
pub options: Vec<PcapNGOption<'a>>,
pub block_len2: u32,
pub if_tsresol: u8,
pub if_tsoffset: i64,
}Expand description
An Interface Description Block (IDB) is the container for information describing an interface on which packet data is captured.
Fields§
§block_type: u32§block_len1: u32§linktype: Linktype§reserved: u16§snaplen: u32§options: Vec<PcapNGOption<'a>>§block_len2: u32§if_tsresol: u8§if_tsoffset: i64Implementations§
Source§impl InterfaceDescriptionBlock<'_>
impl InterfaceDescriptionBlock<'_>
Sourcepub fn ts_resolution(&self) -> Option<u64>
pub fn ts_resolution(&self) -> Option<u64>
Decode the interface time resolution, in units per second
Return the resolution, or None if the resolution is invalid (for ex. greater than 2^64)
Sourcepub fn if_name(&self) -> Option<Result<&str, PcapNGOptionError>>
pub fn if_name(&self) -> Option<Result<&str, PcapNGOptionError>>
Return the if_name option value, if present
If the option is present multiple times, the first value is returned.
Returns None if option is not present, Some(Ok(value)) if the value is present and valid,
or Some(Err(_)) if value is present but invalid
Sourcepub fn if_description(&self) -> Option<Result<&str, PcapNGOptionError>>
pub fn if_description(&self) -> Option<Result<&str, PcapNGOptionError>>
Return the if_description option value, if present
If the option is present multiple times, the first value is returned.
Returns None if option is not present, Some(Ok(value)) if the value is present and valid,
or Some(Err(_)) if value is present but invalid
Sourcepub fn if_os(&self) -> Option<Result<&str, PcapNGOptionError>>
pub fn if_os(&self) -> Option<Result<&str, PcapNGOptionError>>
Return the if_os option value, if present
If the option is present multiple times, the first value is returned.
Returns None if option is not present, Some(Ok(value)) if the value is present and valid,
or Some(Err(_)) if value is present but invalid
Sourcepub fn if_ipv4addr(
&self,
) -> Option<Result<Vec<(Ipv4Addr, Ipv4Addr)>, PcapNGOptionError>>
pub fn if_ipv4addr( &self, ) -> Option<Result<Vec<(Ipv4Addr, Ipv4Addr)>, PcapNGOptionError>>
Return the if_ipv4addr option values, if present
This option can be multi-valued.
Returns None if option is not present, Some(Ok(Vec)) if the value is present and valid,
or Some(Err(_)) if value is present but invalid
Each item of the Vec is a pair (IPv4Addr, IPv4Mask)
Sourcepub fn if_ipv6addr(
&self,
) -> Option<Result<Vec<(Ipv6Addr, u8)>, PcapNGOptionError>>
pub fn if_ipv6addr( &self, ) -> Option<Result<Vec<(Ipv6Addr, u8)>, PcapNGOptionError>>
Return the if_ipv6addr option values, if present
This option can be multi-valued.
Returns None if option is not present, Some(Ok(Vec)) if the value is present and valid,
or Some(Err(_)) if value is present but invalid
Each item of the Vec is a pair (IPv6Addr, PrefixLen)
Sourcepub fn if_macaddr(&self) -> Option<Result<&[u8], PcapNGOptionError>>
pub fn if_macaddr(&self) -> Option<Result<&[u8], PcapNGOptionError>>
Return the if_macaddr option value, if present
If the option is present multiple times, the first value is returned.
Returns None if option is not present, Some(Ok(value)) if the value is present and valid,
or Some(Err(_)) if value is present but invalid
Sourcepub fn if_euiaddr(&self) -> Option<Result<&[u8], PcapNGOptionError>>
pub fn if_euiaddr(&self) -> Option<Result<&[u8], PcapNGOptionError>>
Return the if_euiaddr option value, if present
If the option is present multiple times, the first value is returned.
Returns None if option is not present, Some(Ok(value)) if the value is present and valid,
or Some(Err(_)) if value is present but invalid
Sourcepub fn if_speed(&self) -> Option<Result<u64, PcapNGOptionError>>
pub fn if_speed(&self) -> Option<Result<u64, PcapNGOptionError>>
Return the if_speed option value, if present
If the option is present multiple times, the first value is returned.
Returns None if option is not present, Some(Ok(value)) if the value is present and valid,
or Some(Err(_)) if value is present but invalid
Sourcepub fn if_tsresol(&self) -> Option<Result<u8, PcapNGOptionError>>
pub fn if_tsresol(&self) -> Option<Result<u8, PcapNGOptionError>>
Return the if_tsresol option value, if present
If the option is present multiple times, the first value is returned.
Returns None if option is not present, Some(Ok(value)) if the value is present and valid,
or Some(Err(_)) if value is present but invalid
Sourcepub fn if_filter(&self) -> Option<Result<&str, PcapNGOptionError>>
pub fn if_filter(&self) -> Option<Result<&str, PcapNGOptionError>>
Return the if_filter option value, if present
If the option is present multiple times, the first value is returned.
Returns None if option is not present, Some(Ok(value)) if the value is present and valid,
or Some(Err(_)) if value is present but invalid
Sourcepub fn if_tsoffset(&self) -> Option<Result<i64, PcapNGOptionError>>
pub fn if_tsoffset(&self) -> Option<Result<i64, PcapNGOptionError>>
Return the if_tsoffset option value, if present
If the option is present multiple times, the first value is returned.
Returns None if option is not present, Some(Ok(value)) if the value is present and valid,
or Some(Err(_)) if value is present but invalid
Trait Implementations§
Source§impl<'a> Debug for InterfaceDescriptionBlock<'a>
impl<'a> Debug for InterfaceDescriptionBlock<'a>
Source§impl ToVec for InterfaceDescriptionBlock<'_>
Available on crate feature serialize only.
impl ToVec for InterfaceDescriptionBlock<'_>
serialize only.