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.

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.jnetstream.capture.InputCapture
InputCapture.FormatTypeOtherFactory
 
Field Summary
 
Fields inherited from interface org.jnetstream.capture.InputCapture
DEFAULT_INPUTCAPTURE_OTHER_FACTORY, PROPERTY_INPUTCAPTURE_OTHER_FACTORY
 
Method Summary
 InputIterator<PcapPacket> getPacketIterator()
          An interator which iterates over PCAP packets within the stream.
 InputIterator<PcapPacket> getPacketIterator(Filter<ProtocolFilterTarget> filter)
          Gets an iterator that will iterate and return PcapPacket objects.
 InputIterator<PcapRecord> getRecordIterator()
          An iterator which iterates over PCAP records within the stream.
 InputIterator<PcapRecord> getRecordIterator(Filter<RecordFilterTarget> filter)
          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.
 
Methods inherited from interface org.jnetstream.capture.InputCapture
close, countPackets, getFormatName, getRawIterator, getRawIterator
 
Methods inherited from interface org.jnetstream.capture.Capture
getFilter, getType, isMutable, iterator
 

Method Detail

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