[−][src]Trait rawsock::traits::DynamicInterface
Trait for structures representing an opened interface (or network card or network device)
Interfaces are opened using a concrete library - check the Library trait.
Required methods
fn send(&self, packet: &[u8]) -> Result<(), Error>
Sends a raw packet.
fn receive<'b>(&'b mut self) -> Result<BorrowedPacket<'b>, Error>
Receives a raw packet.
fn flush(&self)
Flushes a queue
fn data_link(&self) -> DataLink
Provides information about the underlying technology used for this connection.
fn stats(&self) -> Result<Stats, Error>
Provides transmission statistics
fn break_loop(&self)
Breaks previously started loops.
fn loop_infinite_dyn(
&self,
callback: &dyn FnMut(&BorrowedPacket)
) -> Result<(), Error>
&self,
callback: &dyn FnMut(&BorrowedPacket)
) -> Result<(), Error>
Runs infinite loop and passes received packets via callback.
Exits when the break_loop() function is called or on error.
Implementors
impl<'a> DynamicInterface<'a> for rawsock::pcap::Interface<'a>
[src]
fn send(&self, packet: &[u8]) -> Result<(), Error>
[src]
fn receive(&mut self) -> Result<BorrowedPacket, Error>
[src]
fn flush(&self)
[src]
fn data_link(&self) -> DataLink
[src]
fn stats(&self) -> Result<Stats, Error>
[src]
fn break_loop(&self)
[src]
fn loop_infinite_dyn(
&self,
callback: &dyn FnMut(&BorrowedPacket)
) -> Result<(), Error>
[src]
&self,
callback: &dyn FnMut(&BorrowedPacket)
) -> Result<(), Error>
impl<'a> DynamicInterface<'a> for rawsock::pfring::Interface<'a>
[src]
fn send(&self, packet: &[u8]) -> Result<(), Error>
[src]
fn receive(&mut self) -> Result<BorrowedPacket, Error>
[src]
fn flush(&self)
[src]
fn data_link(&self) -> DataLink
[src]
fn stats(&self) -> Result<Stats, Error>
[src]
fn break_loop(&self)
[src]
fn loop_infinite_dyn(
&self,
callback: &dyn FnMut(&BorrowedPacket)
) -> Result<(), Error>
[src]
&self,
callback: &dyn FnMut(&BorrowedPacket)
) -> Result<(), Error>
impl<'a> DynamicInterface<'a> for rawsock::wpcap::Interface<'a>
[src]
fn send(&self, packet: &[u8]) -> Result<(), Error>
[src]
fn receive<'b>(&mut self) -> Result<BorrowedPacket, Error>
[src]
fn flush(&self)
[src]
fn data_link(&self) -> DataLink
[src]
fn stats(&self) -> Result<Stats, Error>
[src]
fn break_loop(&self)
[src]
fn loop_infinite_dyn(
&self,
callback: &dyn FnMut(&BorrowedPacket)
) -> Result<(), Error>
[src]
&self,
callback: &dyn FnMut(&BorrowedPacket)
) -> Result<(), Error>