Trait smoltcp::phy::PcapSink[][src]

pub trait PcapSink {
    fn write(&self, data: &[u8]);

    fn write_u16(&self, value: u16) { ... }
fn write_u32(&self, value: u32) { ... }
fn global_header(&self, link_type: PcapLinkType) { ... }
fn packet_header(&self, timestamp: Instant, length: usize) { ... }
fn packet(&self, timestamp: Instant, packet: &[u8]) { ... } }

A packet capture sink.

Required methods

fn write(&self, data: &[u8])[src]

Write data into the sink.

Loading content...

Provided methods

fn write_u16(&self, value: u16)[src]

Write an u16 into the sink, in native byte order.

fn write_u32(&self, value: u32)[src]

Write an u32 into the sink, in native byte order.

fn global_header(&self, link_type: PcapLinkType)[src]

Write the libpcap global header into the sink.

This method may be overridden e.g. if special synchronization is necessary.

fn packet_header(&self, timestamp: Instant, length: usize)[src]

Write the libpcap packet header into the sink.

See also the note for global_header.

Panics

This function panics if length is greater than 65535.

fn packet(&self, timestamp: Instant, packet: &[u8])[src]

Write the libpcap packet header followed by packet data into the sink.

See also the note for global_header.

Loading content...

Implementations on Foreign Types

impl<T: Write> PcapSink for RefCell<T>[src]

Loading content...

Implementors

impl<T: AsRef<dyn PcapSink>> PcapSink for T[src]

Loading content...