org.jnetpcap
Interface JCaptureHeader

All Known Implementing Classes:
JMemoryPacket.JMemoryHeader, PcapHeader

public interface JCaptureHeader

Interface to to capture header provided by the capturing library. For example PcapHeader, the capture header provided by libpcap, implements this interface which provides access to minimum set of information about the capture packet.

Author:
Mark Bednarczyk, Sly Technologies, Inc.

Method Summary
 int caplen()
          Retrieves the length of the packet that was actually captured.
 void caplen(int caplen)
           
 void initFrom(JCaptureHeader captureHeader)
           
 long nanos()
          Fractional part of the second when the packet was captured.
 void nanos(long nanos)
           
 long seconds()
          Capture timestamp in UNIX seconds
 void seconds(long seconds)
           
 long timestampInMicros()
           
 long timestampInMillis()
           
 long timestampInNanos()
           
 int wirelen()
          Retrieves the length of the packet before any of it was truncated by the capture mechanism.
 void wirelen(int wirelen)
           
 

Method Detail

caplen

int caplen()
Retrieves the length of the packet that was actually captured. This could be only a portion of the original packet if snaplen filter was set during Pcap.openXXX call. If the packet was not trucated, this length should equal the length returned by wirelen().

Returns:
length in bytes

wirelen

int wirelen()
Retrieves the length of the packet before any of it was truncated by the capture mechanism. This is the size of the orignal packet as it was send accross the network.

Returns:
length in bytes

seconds

long seconds()
Capture timestamp in UNIX seconds

Returns:
timestamp in seconds since 1970

nanos

long nanos()
Fractional part of the second when the packet was captured. If the resolution of the original capture timestamp is lower than nano seconds, they are converted to nano seconds. For example of the capture timestamp is in micro seconds, then the micro seconds fraction is multiplied by a 1000 before being returned to conform to nano second return timestamp.

Returns:
Number of nano seconds at the time of the packet capture. The valid value returned by this method is from 0 to 999,999,999.

timestampInMillis

long timestampInMillis()

timestampInNanos

long timestampInNanos()

timestampInMicros

long timestampInMicros()

seconds

void seconds(long seconds)
Parameters:
seconds -

nanos

void nanos(long nanos)
Parameters:
nanos -

caplen

void caplen(int caplen)
Parameters:
caplen -

wirelen

void wirelen(int wirelen)
Parameters:
wirelen -

initFrom

void initFrom(JCaptureHeader captureHeader)
Parameters:
captureHeader -