|
|||||||||
| 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.RawformatInputStream
public class RawformatInputStream
This input stream, reads in a capture file and applies capture file
definitions found in a NPL file to try to find the right definition for the
capture file. Once found, that definition produces a set of extracted headers
which contain properties. This object look up the values for those properties
which define attributes such as capture timestamp, record lengths, packet
information, link types, etc...
So if you have a new capture file format you can define your own definition
in NPL and pass that definition to this capture file decoder which using
those definitions extracts packet data which can be further parsed using
another the NPL decoder.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.voytechs.jnetstream.io.PacketInputStream |
|---|
PacketInputStream.BufferedHeader |
| Field Summary | |
|---|---|
protected Packet |
captureFileHeader
|
protected Packet |
captureRecordHeader
|
protected Decoder |
decoder
The decoder used to decode capture file headers. |
static java.lang.String |
FILE_HEADER
|
static java.lang.String |
FILE_RECORDLEN
|
static java.lang.String |
FILE_TYPENAME
|
static java.lang.String |
INTERFACE_DROPS
|
static java.lang.String |
INTERFACE_ERROR
|
static java.lang.String |
INTERFACE_IN
|
static java.lang.String |
INTERFACE_OUT
|
static int |
MAX_PACKET_LENGTH
|
protected CaptureMetaEnumerator |
meta
|
static java.lang.String |
PACKET_HEADER_POSTFIX
|
static java.lang.String |
PACKET_LENGTH
|
static java.lang.String |
PACKET_LINKTYPE
|
static java.lang.String |
PACKET_NANOS
|
static java.lang.String |
PACKET_SECONDS
|
static java.lang.String |
PACKET_SNAPLEN
|
protected java.lang.String |
recordHeaderName
|
| 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 | |
|---|---|
RawformatInputStream(java.io.InputStream rawFileFormatInputStream)
First decodes the raw input stream, which can be a file, use NPL format file definitions. |
|
RawformatInputStream(java.io.InputStream rawFileFormatInputStream,
java.util.List nplFormatFiles)
First decodes the raw input stream, which can be a file, use NPL format file definitions. |
|
RawformatInputStream(java.io.InputStream rawFileFormatInputStream,
java.lang.String nplFormatFile)
First decodes the raw input stream, which can be a file, use NPL format file definitions. |
|
RawformatInputStream(java.lang.String captureFile)
|
|
RawformatInputStream(java.lang.String captureFile,
java.util.List nplFormatFiles)
First decodes capture file using NPL format file definitions. |
|
RawformatInputStream(java.lang.String captureFile,
java.lang.String nplFormatFile)
First decodes capture file using NPL format file definitions. |
|
| Method Summary | |
|---|---|
protected void |
extractValues(Packet captureHeader)
Extract values from NPL variables found packetHeader in the capture file. |
Packet |
getCaptureFileHeader()
|
java.lang.String |
getCaptureFormatName()
Returns the name of the capture source. |
Packet |
getCaptureRecordHeader()
|
java.util.Enumeration |
getMetaEnumeration()
Returns META information about the capture source. |
protected void |
initPacketStream()
Read stream ID data. |
protected void |
initRecordHeader()
Read pre-packet header from stream. |
boolean |
isMetaDataSupported()
Returns if META data is supported. |
protected void |
readFileHeader()
Read any file headers from the capture file. |
protected void |
readRecordHeader()
Read pre-packet header from stream. |
java.lang.String |
toString()
Convert to string. |
| 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 static final java.lang.String FILE_HEADER
public static final java.lang.String PACKET_HEADER_POSTFIX
public static final int MAX_PACKET_LENGTH
public static final java.lang.String FILE_TYPENAME
public static final java.lang.String FILE_RECORDLEN
public static final java.lang.String PACKET_LINKTYPE
public static final java.lang.String PACKET_LENGTH
public static final java.lang.String PACKET_SNAPLEN
public static final java.lang.String PACKET_SECONDS
public static final java.lang.String PACKET_NANOS
public static final java.lang.String INTERFACE_DROPS
public static final java.lang.String INTERFACE_IN
public static final java.lang.String INTERFACE_OUT
public static final java.lang.String INTERFACE_ERROR
protected Decoder decoder
protected java.lang.String recordHeaderName
protected Packet captureFileHeader
protected Packet captureRecordHeader
protected CaptureMetaEnumerator meta
| Constructor Detail |
|---|
public RawformatInputStream(java.io.InputStream rawFileFormatInputStream)
throws java.io.IOException,
EOPacketStream,
StreamFormatException,
SyntaxError
rawFileFormatInputStream - Stream containing the capture file.nplFormatFile - Filename containing capture file format definitions.
java.io.IOException - Any I/O errors.
EOPacketStream - If unexpected end of stream occures.
StreamFormatException - If capture files' format is not understood and an error
occures.
SyntaxError - Any NPL syntax errors found in the capture format definitions
file.
public RawformatInputStream(java.io.InputStream rawFileFormatInputStream,
java.lang.String nplFormatFile)
throws java.io.IOException,
EOPacketStream,
StreamFormatException,
SyntaxError
rawFileFormatInputStream - Stream containing the capture file.nplFormatFile - Filename containing capture file format definitions.
java.io.IOException - Any I/O errors.
EOPacketStream - If unexpected end of stream occures.
StreamFormatException - If capture files' format is not understood and an error
occures.
SyntaxError - Any NPL syntax errors found in the capture format definitions
file.
public RawformatInputStream(java.io.InputStream rawFileFormatInputStream,
java.util.List nplFormatFiles)
throws java.io.IOException,
EOPacketStream,
StreamFormatException,
SyntaxError
rawFileFormatInputStream - Stream containing the capture file.nplFormatFiles - A list of filenames containing capture file format
definitions.
java.io.IOException - Any I/O errors.
EOPacketStream - If unexpected end of stream occures.
StreamFormatException - If capture files' format is not understood and an error
occures.
SyntaxError - Any NPL syntax errors found in the capture format definitions
file.
public RawformatInputStream(java.lang.String captureFile)
throws java.io.FileNotFoundException,
java.io.IOException,
EOPacketStream,
StreamFormatException,
SyntaxError
java.io.FileNotFoundException
java.io.IOException
EOPacketStream
StreamFormatException
SyntaxError
public RawformatInputStream(java.lang.String captureFile,
java.util.List nplFormatFiles)
throws java.io.FileNotFoundException,
java.io.IOException,
EOPacketStream,
StreamFormatException,
SyntaxError
rawFileFormatInputStream - Stream containing the capture file.nplFormatFile - Filename containing capture file format definitions.
java.io.IOException - Any I/O errors.
EOPacketStream - If unexpected end of stream occures.
StreamFormatException - If capture files' format is not understood and an error
occures.
SyntaxError - Any NPL syntax errors found in the capture format definitions
file.
java.io.FileNotFoundException
public RawformatInputStream(java.lang.String captureFile,
java.lang.String nplFormatFile)
throws java.io.FileNotFoundException,
java.io.IOException,
EOPacketStream,
StreamFormatException,
SyntaxError
rawFileFormatInputStream - Stream containing the capture file.nplFormatFile - Filename containing capture file format definitions.
java.io.IOException - Any I/O errors.
EOPacketStream - If unexpected end of stream occures.
StreamFormatException - If capture files' format is not understood and an error
occures.
SyntaxError - Any NPL syntax errors found in the capture format definitions
file.
java.io.FileNotFoundException| Method Detail |
|---|
protected void initPacketStream()
throws java.io.IOException,
EOPacketStream,
StreamFormatException
PacketInputStream
initPacketStream in class PacketInputStreamjava.io.IOException
EOPacketStream
StreamFormatException
protected void readFileHeader()
throws java.io.IOException,
EOPacketStream,
StreamFormatException
java.io.IOException - Any I/O errors.
EOPacketStream - If unexpected end of stream occures.
StreamFormatException - If capture files' format is not understood and an error
occures.
protected void initRecordHeader()
throws java.io.IOException,
EOPacketStream,
StreamFormatException
PacketInputStream
initRecordHeader in class PacketInputStreamjava.io.IOException
EOPacketStream
StreamFormatException
protected void readRecordHeader()
throws java.io.IOException,
EOPacketStream,
StreamFormatException
java.io.IOException - Any I/O errors.
EOPacketStream - If unexpected end of stream occures.
StreamFormatException - If capture files' format is not understood and an error
occures.
protected void extractValues(Packet captureHeader)
throws StreamFormatException
captureHeader - Packet contains values of the capture header. The values are
stored as regular fields. The field names are named such that
this method can extract meaningfull values to parse the rest
of the capture file.
StreamFormatException - any problems with the capture file's headers.public java.lang.String toString()
toString in class java.lang.Objectpublic java.util.Enumeration getMetaEnumeration()
getMetaEnumeration in interface CaptureMetaFormatpublic boolean isMetaDataSupported()
isMetaDataSupported in interface CaptureMetaFormatpublic java.lang.String getCaptureFormatName()
getCaptureFormatName in interface CaptureMetaFormatpublic Packet getCaptureFileHeader()
public Packet getCaptureRecordHeader()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||