|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface PcapFile
PCAP file format from tcpdump.org folks.
| Field Summary | |
|---|---|
static HeaderReader |
headerReader
|
static org.apache.commons.logging.Log |
logger
|
static byte[] |
MAGIC_PATTERN_BE
Default MAGIC byte pattern for Pcap file in big-endian byte encoding |
static byte[] |
MAGIC_PATTERN_LE
Default MAGIC byte pattern for Pcap file in little-endian byte encoding |
static long |
MAJOR_VERSION
Default major version of the file format |
static int |
MINOR_VERSION
Default minor version of the file format |
| Fields inherited from interface org.jnetstream.capture.file.pcap.PcapFormat |
|---|
DEFAULT_ACCURACY, DEFAULT_SNAPLEN, HEADER_LENGTH |
| Method Summary | |
|---|---|
com.slytechs.utils.collection.IOSkippableIterator<PcapBlockRecord> |
getBlockIterator()
Each capture file is organized so that there exists atleast 1 block record, usually at the beginning of the capture file. |
PcapBlockRecord |
getBlockRecord()
|
Protocol |
getDlt()
|
PacketIndexer<PcapPacket> |
getPacketIndexer()
Indexer which accesses packets by index. |
PacketIterator<PcapPacket> |
getPacketIterator()
Retrieves an iterator Iterator which can iterate over all
the packets of this capture session. |
RawIndexer |
getRawIndexer()
Raw ByteBuffer based record indexer. |
RawIterator |
getRawIterator()
Gets an iterator that will return raw contents of the records contained in the underlying capture file. |
RecordIndexer<PcapRecord> |
getRecordIndexer()
Indexer which accesses records by index. |
RecordIterator<PcapRecord> |
getRecordIterator()
Iterator which iterates over every record within the file capture. |
PcapBlockRecord |
setBlockRecord(byte[] m,
int major,
int minor,
PcapDLT dlt,
int a,
int tz,
int i)
Adds a new block record at the beginning of the Pcap file. |
PcapBlockRecord |
setBlockRecord(PcapDLT dlt,
int i)
Adds a new block record at the beginning of the Pcap file. |
| Methods inherited from interface org.jnetstream.capture.FileCapture |
|---|
abortChanges, flush, getFastIterator, getFile, getFormatType, getLength, getPacketCount, getPacketCount, getRawIterator, getRecordIterator, getVersion, isEmpty, isOpen, order |
| Methods inherited from interface org.jnetstream.capture.Capture |
|---|
getFilter, getType, isMutable, iterator |
| Field Detail |
|---|
static final HeaderReader headerReader
static final org.apache.commons.logging.Log logger
static final byte[] MAGIC_PATTERN_BE
A1 B2 C3 D4
static final byte[] MAGIC_PATTERN_LE
D4 C3 B2 A1
static final long MAJOR_VERSION
static final int MINOR_VERSION
| Method Detail |
|---|
com.slytechs.utils.collection.IOSkippableIterator<PcapBlockRecord> getBlockIterator()
throws java.io.IOException
FileCapture
getBlockIterator in interface FileCapture<PcapPacket>java.io.IOException
PcapBlockRecord getBlockRecord()
throws java.io.IOException
java.io.IOException
Protocol getDlt()
throws java.io.IOException
java.io.IOException
PacketIndexer<PcapPacket> getPacketIndexer()
throws java.io.IOException
FileCapture
getPacketIndexer in interface FileCapture<PcapPacket>java.io.IOException - any IO errors
PacketIterator<PcapPacket> getPacketIterator()
throws java.io.IOException
CaptureIterator which can iterate over all
the packets of this capture session. The IO based iterator mimics the
methods and behaviour of its counter part Iterator that it
can throw IO exceptions in any of the methods.
getPacketIterator in interface Capture<PcapPacket>getPacketIterator in interface FileCapture<PcapPacket>java.io.IOException - Any IO errors while retrieving a packet
RawIndexer getRawIndexer()
throws java.io.IOException
FileCapture
getRawIndexer in interface FileCapture<PcapPacket>java.io.IOException - any IO errors
RawIterator getRawIterator()
throws java.io.IOException
FileCapture
getRawIterator in interface FileCapture<PcapPacket>java.io.IOException - any IO errors
RecordIndexer<PcapRecord> getRecordIndexer()
throws java.io.IOException
FileCapture
getRecordIndexer in interface FileCapture<PcapPacket>java.io.IOException - any IO errors
RecordIterator<PcapRecord> getRecordIterator()
throws java.io.IOException
FileCapture
getRecordIterator in interface FileCapture<PcapPacket>java.io.IOException
PcapBlockRecord setBlockRecord(byte[] m,
int major,
int minor,
PcapDLT dlt,
int a,
int tz,
int i)
throws java.io.IOException,
java.lang.IllegalStateException
m - magic number to include in the block header, the magic number must
exactly 4 octets in length and its position and limit properties
point to the beginning of patternmajor - major version numberminor - minor version numberdlt - PCAP data link typea - accuracy of the timestamptz - timezone of the timestampi - included length or sometimes refered to as snaplen value
java.io.IOException - any IO errors
java.lang.IllegalStateException - if the file is not completely empty and its size not equal to
length of 0 bytes
PcapBlockRecord setBlockRecord(PcapDLT dlt,
int i)
throws java.io.IOException,
java.lang.IllegalStateException
dlt - PCAP data link typei - included length or sometimes refered to as snaplen value
java.io.IOException - any IO errors
java.lang.IllegalStateException - if the file is not completely empty and its size not equal to
length of 0 bytes
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||