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.

Nested Class Summary
static class PcapBlockRecord.PcapBlockHeader
          Defines the static header of a block pcap record.
 
Nested classes/interfaces inherited from interface org.jnetstream.capture.file.Record
Record.RecordHeaderField
 
Nested classes/interfaces inherited from interface org.jnetstream.capture.file.Record
Record.RecordHeaderField
 
Field Summary
static Filter<RecordFilterTarget> FILTER
          Predefined filter that accepts only Block record types.
static int HEADER_LENGTH
           
 
Method Summary
 long getAccuracy()
           
 long getLinktype()
           
 byte[] getMagicPattern()
          Returns the Magic number or pattern that is used to uniquely identify the file type of the capture file.
 long getMajorVersion()
           
 int getMinorVersion()
           
 long getSnaplen()
           
 long getTimeZone()
           
 void setAccuracy(long accuracy)
           
 void setLinktype(long linktype)
           
 void setMagicPattern(byte[] magicNumber)
           
 void setMajorVersion(long majorVersion)
          Sets the version numbers for the file format.
 void setMinorVersion(int minorVersion)
           
 void setSnaplen(long snpalen)
           
 void setTimezone(long timezone)
           
 
Methods inherited from interface org.jnetstream.capture.file.BlockRecord
getVersion, order
 
Methods inherited from interface org.jnetstream.capture.file.Record
asType, edit, getFileCapture, getPositionGlobal, getRecordBuffer, getRecordHeaderBuffer, getRecordHeaderLength, getRecordLength, getRecordType
 
Methods inherited from interface com.slytechs.utils.collection.Validatable
isValid
 
Methods inherited from interface org.jnetstream.capture.file.pcap.PcapRecord
getPcapRecordType
 
Methods inherited from interface org.jnetstream.capture.file.Record
asType, edit, getFileCapture, getPositionGlobal, getRecordBuffer, getRecordHeaderBuffer, getRecordHeaderLength, getRecordLength, getRecordType
 
Methods inherited from interface com.slytechs.utils.collection.Validatable
isValid
 

Field Detail

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
Method Detail

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