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>
impl<'a> CaptureStep<'a>
Sourcepub fn new_control_sender(&self) -> Option<ExtcapControlSender>
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.
Sourcepub async fn new_control_sender_async(&self) -> Option<ExtcapControlSender>
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.
Sourcepub fn spawn_channel_control_reader(&self) -> Option<ChannelExtcapControlReader>
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.
Sourcepub fn spawn_channel_control_reader_async(
&self,
) -> Option<ChannelExtcapControlReader>
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.
Sourcepub fn new_control_reader(&self) -> Option<ExtcapControlReader>
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
.
Sourcepub async fn new_control_reader_async(&self) -> Option<ExtcapControlReader>
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
.
Sourcepub async fn fifo_async(&self) -> Result<File>
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.