org.jnetpcap.packet
Class JMemoryPacket.JMemoryHeader

java.lang.Object
  extended by org.jnetpcap.packet.JMemoryPacket.JMemoryHeader
All Implemented Interfaces:
JCaptureHeader
Enclosing class:
JMemoryPacket

public static class JMemoryPacket.JMemoryHeader
extends java.lang.Object
implements JCaptureHeader

A capture header that stores information about the creation of the packet.

Author:
Mark Bednarczyk, Sly Technologies, Inc.

Constructor Summary
JMemoryPacket.JMemoryHeader()
          Creates an empty capture header
JMemoryPacket.JMemoryHeader(int caplen, int wirelen, long seconds, long nanos)
          Creates a capture header with initial values
 
Method Summary
 int caplen()
          Gets the capture length
 void caplen(int caplen)
           
 int getWirelen()
          Gets the wire length
 void init(int caplen, int wirelen, long nanos, long seconds)
          Reinitialized the header to new state
 void initFrom(JCaptureHeader header)
           
 long nanos()
          Gets the timestamp fraction in nanos
 void nanos(long nanos)
           
 long seconds()
          Gets the timestamp in seconds
 void seconds(long seconds)
           
 void setWirelen(int wirelen)
          Sets the states wire length
 long timestampInMicros()
          Gets the timestamp in micro seconds
 long timestampInMillis()
          Gets the timestamp in millis
 long timestampInNanos()
           
 int wirelen()
          Gets the wire length
 void wirelen(int wirelen)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JMemoryPacket.JMemoryHeader

public JMemoryPacket.JMemoryHeader()
Creates an empty capture header


JMemoryPacket.JMemoryHeader

public JMemoryPacket.JMemoryHeader(int caplen,
                                   int wirelen,
                                   long seconds,
                                   long nanos)
Creates a capture header with initial values

Parameters:
caplen - captured length
wirelen - wire length
seconds - timestamp in seconds
nanos - nanos fraction of the timestamp
Method Detail

caplen

public int caplen()
Gets the capture length

Specified by:
caplen in interface JCaptureHeader
Returns:
length in bytes

caplen

public void caplen(int caplen)
Specified by:
caplen in interface JCaptureHeader

getWirelen

public final int getWirelen()
Gets the wire length

Returns:
length in bytes

init

public void init(int caplen,
                 int wirelen,
                 long nanos,
                 long seconds)
Reinitialized the header to new state

Parameters:
caplen - capture length
wirelen - wirelength
nanos - timestamp fraction in nanos
seconds - timestap in seconds

initFrom

public void initFrom(JCaptureHeader header)
Specified by:
initFrom in interface JCaptureHeader

nanos

public long nanos()
Gets the timestamp fraction in nanos

Specified by:
nanos in interface JCaptureHeader
Returns:
timestamp fraction

nanos

public void nanos(long nanos)
Specified by:
nanos in interface JCaptureHeader

seconds

public long seconds()
Gets the timestamp in seconds

Specified by:
seconds in interface JCaptureHeader
Returns:
timestamp

seconds

public void seconds(long seconds)
Specified by:
seconds in interface JCaptureHeader

setWirelen

public final void setWirelen(int wirelen)
Sets the states wire length

Parameters:
wirelen - length on the packet on the network wire

timestampInMillis

public long timestampInMillis()
Gets the timestamp in millis

Specified by:
timestampInMillis in interface JCaptureHeader
Returns:
timestamp in millis

timestampInMicros

public long timestampInMicros()
Gets the timestamp in micro seconds

Specified by:
timestampInMicros in interface JCaptureHeader
Returns:
timestamp in micros

timestampInNanos

public long timestampInNanos()
Specified by:
timestampInNanos in interface JCaptureHeader

wirelen

public int wirelen()
Gets the wire length

Specified by:
wirelen in interface JCaptureHeader
Returns:
length of the packet on the network wire

wirelen

public void wirelen(int wirelen)
Specified by:
wirelen in interface JCaptureHeader