Struct smoltcp::phy::PcapWriter
[−]
[src]
pub struct PcapWriter<D: Device, S: PcapSink + Clone> { /* fields omitted */ }
A packet capture writer device.
Every packet transmitted or received through this device is timestamped and written (in the libpcap format) using the provided sink. Note that writes are fine-grained, and buffering is recommended.
The packet sink should be cheaply cloneable, as it is cloned on every
transmitted packet. For example, &'a mut Vec<u8>
is cheaply cloneable
but &std::io::File
Methods
impl<D: Device, S: PcapSink + Clone> PcapWriter<D, S>
[src]
fn new(
lower: D,
sink: S,
mode: PcapMode,
link_type: PcapLinkType
) -> PcapWriter<D, S>
[src]
lower: D,
sink: S,
mode: PcapMode,
link_type: PcapLinkType
) -> PcapWriter<D, S>
Creates a packet capture writer.
Trait Implementations
impl<D: Debug + Device, S: Debug + PcapSink + Clone> Debug for PcapWriter<D, S>
[src]
impl<D: Device, S: PcapSink + Clone> Device for PcapWriter<D, S>
[src]
type RxBuffer = D::RxBuffer
type TxBuffer = TxBuffer<D::TxBuffer, S>
fn limits(&self) -> DeviceLimits
[src]
Get a description of device limitations.
fn receive(&mut self, timestamp: u64) -> Result<Self::RxBuffer>
[src]
Receive a frame. Read more
fn transmit(&mut self, timestamp: u64, length: usize) -> Result<Self::TxBuffer>
[src]
Transmit a frame. Read more