|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.io.InputStream
com.voytechs.jnetstream.io.ProtocolDataInputStream
com.voytechs.jnetstream.io.PacketInputStream
com.voytechs.jnetstream.io.PcapInputStream
public class PcapInputStream
A custom reader for PCAP fiel formats.
This class has been depracated. Please do not use it.
Structure of TCPDump file.
struct pcap_file_header {
bpf_u_int32 magic;
u_short version_major;
u_short version_minor;
bpf_int32 thiszone; // gmt to local correction //
bpf_u_int32 sigfigs; // accuracy of timestamps //
bpf_u_int32 snaplen; // max length saved portion of each pkt //
bpf_u_int32 linktype; // data link type (LINKTYPE_*) //
};
Now per each packet:
struct pcap_pkthdr {
struct timeval ts; // time stamp //
bpf_u_int32 caplen; // length of portion present //
bpf_u_int32 len; // length this packet (off wire) //
};
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.voytechs.jnetstream.io.PacketInputStream |
|---|
PacketInputStream.BufferedHeader |
| Field Summary | |
|---|---|
java.lang.String |
META_CAPTURE_NANOS
Deprecated. |
java.lang.String |
META_CAPTURE_SECS
Deprecated. |
java.lang.String |
META_LINK_TYPE
Deprecated. |
java.lang.String |
META_MAGIC_NUMBER
Deprecated. |
java.lang.String |
META_MAJOR_VER
Deprecated. |
java.lang.String |
META_MINOR_VER
Deprecated. |
java.lang.String |
META_PACKET_LENGTH
Deprecated. |
java.lang.String |
META_SNAPLEN
Deprecated. |
java.lang.String |
META_TIMESTAMP_ACCURACY
Deprecated. |
java.lang.String |
META_TIMEZONE
Deprecated. |
| Fields inherited from class com.voytechs.jnetstream.io.PacketInputStream |
|---|
captureDeviceArch, captureDeviceFilename, captureDeviceIp, captureDeviceOS, captureLive, debugHeaders, fileHeader, linkType, packetCaptureTimestamp, packetEnd, packetLength, packetSnaplen, packetStart, recordEnd, recordHeader, recordLength, recordStart, stackIn |
| Fields inherited from class com.voytechs.jnetstream.io.ProtocolDataInputStream |
|---|
bitsLeft, in |
| Constructor Summary | |
|---|---|
PcapInputStream(java.io.InputStream pcapFileFormatInputStream)
Deprecated. |
|
PcapInputStream(java.lang.String filename)
Deprecated. Opens up the given file and starts processing the data. |
|
| Method Summary | |
|---|---|
int |
getPcapMagicNumber()
Deprecated. Returns the magic number found at the beginning of the PCAP file. |
int |
getPcapMajorVer()
Deprecated. Returns the major version number of the PCAP file. |
int |
getPcapMinorVer()
Deprecated. Returns the minor version number of the PCAP file. |
protected void |
initPacketStream()
Deprecated. Since we know we are dealing with a Pcap-file formatted stream (i.e. |
protected void |
initRecordHeader()
Deprecated. Read pre-packet header from stream. |
java.lang.Object |
metaVariable(java.lang.String variable)
Deprecated. Returns META information about the current header. |
int |
pcapLinktype()
Deprecated. The link type of the first header in the packet. |
int |
pcapPacketCaptureNanos()
Deprecated. Number of naono seconds found in the raw data file. |
long |
pcapPacketMicros()
Deprecated. Number of raw number of the capture file. |
long |
pcapSnaplen()
Deprecated. Retuns the SNAP len of the capture file. |
int |
pcapTimestampAccuracy()
Deprecated. Returns the timestamp accuracy found in the PCAP file. |
int |
pcapTimezone()
Deprecated. Returns the timezone found in the PCAP file. |
java.lang.String |
toString()
Deprecated. |
| Methods inherited from class com.voytechs.jnetstream.io.ProtocolDataInputStream |
|---|
readBits, readBitsLong, readBoolean, readByte, readerUnsignedLongLittleEndian, readFromPacket, readFromPacket, readInt, readIntLittleEndian, readLong, readLongLittleEndian, readShort, readShortLittleEndian, readUnsignedByte, readUnsignedInt, readUnsignedIntLittleEndian, readUnsignedLong, readUnsignedShort, readUnsignedShortLittleEndian, reThrow |
| Methods inherited from class java.io.InputStream |
|---|
available, close, mark, markSupported, read, read, reset |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public java.lang.String META_MAGIC_NUMBER
public java.lang.String META_MAJOR_VER
public java.lang.String META_MINOR_VER
public java.lang.String META_TIMEZONE
public java.lang.String META_TIMESTAMP_ACCURACY
public java.lang.String META_PACKET_LENGTH
public java.lang.String META_SNAPLEN
public java.lang.String META_LINK_TYPE
public java.lang.String META_CAPTURE_SECS
public java.lang.String META_CAPTURE_NANOS
| Constructor Detail |
|---|
public PcapInputStream(java.io.InputStream pcapFileFormatInputStream)
throws java.io.IOException,
EOPacketStream,
StreamFormatException
-
java.io.IOException
EOPacketStream
StreamFormatException
public PcapInputStream(java.lang.String filename)
throws java.io.FileNotFoundException,
java.io.IOException,
EOPacketStream,
StreamFormatException
filename - Filename of the file in PCAP fileformat to open.
java.io.FileNotFoundException
java.io.IOException
EOPacketStream
StreamFormatException| Method Detail |
|---|
public java.lang.Object metaVariable(java.lang.String variable)
throws java.io.IOException
java.io.IOException
protected void initPacketStream()
throws java.io.IOException,
EOPacketStream,
StreamFormatException
initPacketStream in class PacketInputStreamjava.io.IOException
EOPacketStream
StreamFormatException
protected void initRecordHeader()
throws java.io.IOException,
EOPacketStream,
StreamFormatException
initRecordHeader in class PacketInputStreamjava.io.IOException
EOPacketStream
StreamFormatExceptionpublic java.lang.String toString()
toString in class java.lang.Objectpublic int getPcapMagicNumber()
public int getPcapMajorVer()
public int getPcapMinorVer()
public int pcapTimezone()
public int pcapTimestampAccuracy()
public long pcapSnaplen()
public int pcapLinktype()
public long pcapPacketMicros()
public int pcapPacketCaptureNanos()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||