org.jnetstream.capture.file.pcap
Interface PcapInput
- All Superinterfaces:
- Capture<PcapPacket>, java.io.Closeable, InputCapture<PcapPacket>, java.lang.Iterable<PcapPacket>
public interface PcapInput
- extends InputCapture<PcapPacket>
A stream formatted to comform to Pcap file format.
- Author:
- Mark Bednarczyk, Sly Technologies, Inc.
getPacketIterator
InputIterator<PcapPacket> getPacketIterator()
throws java.io.IOException
- An interator which iterates over PCAP packets within the stream.
- Specified by:
getPacketIterator in interface Capture<PcapPacket>- Specified by:
getPacketIterator in interface InputCapture<PcapPacket>
- Returns:
- Iterator capable of throwing IO exceptions
- Throws:
java.io.IOException - Any IO errors while retrieving a packet
getPacketIterator
InputIterator<PcapPacket> getPacketIterator(Filter<ProtocolFilterTarget> filter)
throws java.io.IOException
- Gets an iterator that will iterate and return PcapPacket objects.
- Specified by:
getPacketIterator in interface InputCapture<PcapPacket>
- Parameters:
filter - a packet filter to apply to the interator
- Throws:
java.io.IOException - any IO errors
getRecordIterator
InputIterator<PcapRecord> getRecordIterator()
throws java.io.IOException
- An iterator which iterates over PCAP records within the stream.
- Specified by:
getRecordIterator in interface InputCapture<PcapPacket>
- Returns:
- iterator of record
- Throws:
java.io.IOException - any IO errors
getRecordIterator
InputIterator<PcapRecord> getRecordIterator(Filter<RecordFilterTarget> filter)
throws java.io.IOException
- Gets an iterator that will iterate and return Record objects, just like a
normal file based capture would produce except these records are read-only.
- Specified by:
getRecordIterator in interface InputCapture<PcapPacket>
- Parameters:
filter - filter to apply to the iterator
- Returns:
- iterator of record
- Throws:
java.io.IOException - any IO errors