Struct rpcap::read::PcapReader [] [src]

pub struct PcapReader<R: Read> { /* fields omitted */ }

The PcapReader struct allows reading packets from a packet capture.


impl<R: Read> PcapReader<R>

Create a new PcapReader that reads the packet capture data from the specified Reader.

Returns the link type of this packet capture. See Linktype for the known values.

Returns the maximum packet size. Packets larger than this usually get truncated to this size by the recording application.

This function allows iterating over the packets in the packet capture, in a similar fashion to normal iterators. (The exact interface is unfortunately incompatible.)

Returns Ok(None) on EOF, or a packet as long as one is available.