org.jnetstream.capture.file.pcap
Interface PcapBlockRecord
- All Superinterfaces:
- BlockRecord, PcapRecord, Record, com.slytechs.utils.collection.Validatable
public interface PcapBlockRecord
- extends BlockRecord, PcapRecord
Pcap Block Record (file header). Each Pcap file contains a single block
record at the beginning of the file which identifies the file as Pcap type by
means of a magic number or pattern made up of 4 octets, and also defines some
global properties such as timezone, accuracy of the timestamp field within
each packet record, snap len and dlt.
- Author:
- Mark Bednarczyk, Sly Technologies, Inc.
| Methods inherited from interface com.slytechs.utils.collection.Validatable |
isValid |
| Methods inherited from interface com.slytechs.utils.collection.Validatable |
isValid |
FILTER
static final Filter<RecordFilterTarget> FILTER
- Predefined filter that accepts only Block record types. All other
types of records are filtered out.
HEADER_LENGTH
static final int HEADER_LENGTH
- See Also:
- Constant Field Values
getAccuracy
long getAccuracy()
throws java.io.IOException
- Throws:
java.io.IOException
getLinktype
long getLinktype()
throws java.io.IOException
- Throws:
java.io.IOException
getMagicPattern
byte[] getMagicPattern()
throws java.io.IOException
- Description copied from interface:
BlockRecord
- Returns the Magic number or pattern that is used to uniquely identify the
file type of the capture file. The magic number is not normalized so the
pattern may be returned differently on big and small endian machines.
- Specified by:
getMagicPattern in interface BlockRecord
- Returns:
- pattern that is used to identify the file type
- Throws:
java.io.IOException
getMajorVersion
long getMajorVersion()
throws java.io.IOException
- Throws:
java.io.IOException
getMinorVersion
int getMinorVersion()
throws java.io.IOException
- Throws:
java.io.IOException
getSnaplen
long getSnaplen()
throws java.io.IOException
- Throws:
java.io.IOException
getTimeZone
long getTimeZone()
throws java.io.IOException
- Throws:
java.io.IOException
setAccuracy
void setAccuracy(long accuracy)
throws java.io.IOException
- Throws:
java.io.IOException
setLinktype
void setLinktype(long linktype)
throws java.io.IOException
- Throws:
java.io.IOException
setMagicPattern
void setMagicPattern(byte[] magicNumber)
throws java.io.IOException
- Throws:
java.io.IOException
setMajorVersion
void setMajorVersion(long majorVersion)
throws java.io.IOException
- Description copied from interface:
BlockRecord
- Sets the version numbers for the file format.
- Specified by:
setMajorVersion in interface BlockRecord
- Parameters:
majorVersion - major version of the file format
- Throws:
java.io.IOException
setMinorVersion
void setMinorVersion(int minorVersion)
throws java.io.IOException
- Throws:
java.io.IOException
setSnaplen
void setSnaplen(long snpalen)
throws java.io.IOException
- Throws:
java.io.IOException
setTimezone
void setTimezone(long timezone)
throws java.io.IOException
- Throws:
java.io.IOException