Struct Interface

Source
pub struct Interface {
    pub value: Cow<'static, str>,
    pub display: Cow<'static, str>,
    pub dlt: Dlt,
}
Expand description

Definition of an interface for this extcap program. An interface is an entry in the Wireshark homepage, similar to Wi-Fi: en0. Instances of this should be passed to InterfacesStep::list_interfaces.

Fields§

§value: Cow<'static, str>

A unique identifier for this interface. This value will be passed back from Wireshark in the --extcap-interface argument in subsequent calls to indicate which interface the user is working with.

§display: Cow<'static, str>

A user-readable string describing this interface, which is shown in the Wireshark UI.

§dlt: Dlt

The DLT associated with this interface. The DLT is used by Wireshark to determine how to dissect the packet data given by this extcap program.

Note: While the extcap-example and documentation chapter 8.2 says this is a list of DLTs, in reality only one DLT per interface is supported, per this thread.

Implementations§

Source§

impl Interface

Source

pub fn builder() -> InterfaceBuilder<((), (), ())>

Create a builder for building Interface. On the builder, call .value(...), .display(...), .dlt(...) to set the values of the fields. Finally, call .build() to create the instance of Interface.

Trait Implementations§

Source§

impl Debug for Interface

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PrintSentence for Interface

use r_extcap::config::ExtcapFormatter;
use r_extcap::interface::{DataLink, Dlt, Interface};
assert_eq!(
    ExtcapFormatter(&Interface{ value: "MyInterface".into(), display: "My interface".into(), dlt }).to_string(),
    "interface {value=MyInterface}{display=My interface}\n",
);
Source§

fn format_sentence(&self, f: &mut Formatter<'_>) -> Result

The extcap interface expects certain output “sentences” to stdout to communicate with Wireshark, like Read more
Source§

fn print_sentence(&self)

Prints the extcap sentence to stdout.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.