org.jnetstream.capture
Interface FilePacket

All Superinterfaces:
CapturePacket, java.lang.Iterable<Header>, Packet
All Known Subinterfaces:
NAPPacket, PcapPacket, SnoopPacket

public interface FilePacket
extends CapturePacket

A file based packet. The interface adds one important method to allow retrieval of packet record position within the capture file.

Author:
Mark Bednarczyk, Sly Technologies, Inc.

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.jnetstream.packet.Packet
Packet.Property
 
Method Summary
 long getPositionGlobal()
           Gets the global position of this record.
 int getPositionLocal()
           
 long getPositionRegional()
           
 
Methods inherited from interface org.jnetstream.capture.CapturePacket
getCaptureDevice, getIncludedLength, getOriginalLength
 
Methods inherited from interface org.jnetstream.packet.Packet
format, getAllHeaders, getBuffer, getData, getHeader, getHeader, getHeaderCount, getProperty, getTimestampNanos, getTimestampSeconds, hasCompleteHeader, hasCompleteHeader, hasHeader, hasHeader, isTruncated, iterator
 

Method Detail

getPositionGlobal

long getPositionGlobal()
                       throws java.io.IOException

Gets the global position of this record. There are 3 types of position addressing in jNetStream.

The 1st is global position which reflects the address space of the main editor for a file. On an unmodified file, the global position will equal the position of the packet within the physical file. If any edits are in place, the position will differ from the files position and if the packet is based on a buffer completely in memory, such as when a new packet has been added, then the position does not have any mappings to a position related to a file.

The 2nd type is the regional address space which has a 1 to 1 mapping with the physical location within a file. But certain regions of the file may have been mapped out and not all the regions are addressable.

The 3rd type is local address which is the address within the returned buffer. If the buffer is larger then the actual contents of the packet, then the local address specifies offset into the data buffer of the start of packet's data.

Returns:
Throws:
java.io.IOException

getPositionRegional

long getPositionRegional()
                         throws java.io.IOException
Throws:
java.io.IOException

getPositionLocal

int getPositionLocal()
                     throws java.io.IOException
Throws:
java.io.IOException