Trait smoltcp::phy::PcapSink

source ·
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]) { ... }
}
Expand description

A packet capture sink.

Required Methods§

Write data into the sink.

Provided Methods§

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

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

Write the libpcap global header into the sink.

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

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.

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

See also the note for global_header.

Implementations on Foreign Types§

Implementors§