Struct CaptureStep

Source
pub struct CaptureStep<'a> {
    pub interface: &'a str,
    pub fifo: File,
    pub extcap_control_in: &'a Option<PathBuf>,
    pub extcap_control_out: &'a Option<PathBuf>,
    /* private fields */
}
Expand description

When this value is returned in ExtcapArgs::run, the implementation should use these returned values to start capturing packets from the external interface and write them to the fifo in PCAP format.

Fields§

§interface: &'a str

The interface to run this capture on. This is the string previously defined in Interface::value.

§fifo: File

The fifo to write the output packets to. The output packets should be written in PCAP format. Implementations can use the pcap-file crate to help format the packets.

§extcap_control_in: &'a Option<PathBuf>

The extcap control reader if the --extcap-control-in argument is provided on the command line. This is used to receive arguments from the toolbar controls and other control messages from Wireshark.

§extcap_control_out: &'a Option<PathBuf>

The extcap control sender if the --extcap-control-out argument is provided on the command line. This is used to send control messages to Wireshark to modify the toolbar controls and show status messages.

Implementations§

Source§

impl<'a> CaptureStep<'a>

Source

pub fn new_control_sender(&self) -> Option<ExtcapControlSender>

Create a new control sender for this capture, if --extcap-control-out is specified in the command line. The control sender is used to send control messages to Wireshark to modify ToolbarControls and communicate other states.

Source

pub async fn new_control_sender_async(&self) -> Option<ExtcapControlSender>

Create a new control sender for this capture, if --extcap-control-out is specified in the command line. The control sender is used to send control messages to Wireshark to modify ToolbarControls and communicate other states.

Source

pub fn spawn_channel_control_reader(&self) -> Option<ChannelExtcapControlReader>

Spawn a new channel control reader, which also spawns a thread to continuously forward control packets from the input fifo to the reader’s channel.

See the documentations on ChannelExtcapControlReader for more.

Source

pub fn spawn_channel_control_reader_async( &self, ) -> Option<ChannelExtcapControlReader>

Spawn a new channel control reader, which also spawns a thread to continuously forward control packets from the input fifo to the reader’s channel.

See the documentations on ChannelExtcapControlReader for more.

Source

pub fn new_control_reader(&self) -> Option<ExtcapControlReader>

Create a new ExtcapControlReader for this capture context. ExtcapControlReader reads from the control pipe given in this context synchronously, and blocks if there are no incoming control packets waiting to be processed.

For a higher level, easier to use API, see spawn_channel_control_reader.

Source

pub async fn new_control_reader_async(&self) -> Option<ExtcapControlReader>

Create a new ExtcapControlReader for this capture context. ExtcapControlReader reads from the control pipe given in this context synchronously, and blocks if there are no incoming control packets waiting to be processed.

For a higher level, easier to use API, see spawn_channel_control_reader.

Source

pub async fn fifo_async(&self) -> Result<File>

Create an async version of the fifo that is used to write captured packets to in the PCAP format.

Auto Trait Implementations§

§

impl<'a> Freeze for CaptureStep<'a>

§

impl<'a> RefUnwindSafe for CaptureStep<'a>

§

impl<'a> Send for CaptureStep<'a>

§

impl<'a> Sync for CaptureStep<'a>

§

impl<'a> Unpin for CaptureStep<'a>

§

impl<'a> UnwindSafe for CaptureStep<'a>

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.