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)
          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)
          Inits the from.
 long nanos()
          Gets the timestamp fraction in nanos.
 void nanos(long nanos)
          Nanos.
 long seconds()
          Gets the timestamp in seconds.
 void seconds(long seconds)
          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()
          Timestamp in nanos.
 int wirelen()
          Gets the wire length.
 void wirelen(int wirelen)
          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)
Caplen.

Specified by:
caplen in interface JCaptureHeader
Parameters:
caplen - the caplen
See Also:
JCaptureHeader.caplen(int)

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)
Inits the from.

Specified by:
initFrom in interface JCaptureHeader
Parameters:
header - the header
See Also:
JCaptureHeader.initFrom(org.jnetpcap.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)
Nanos.

Specified by:
nanos in interface JCaptureHeader
Parameters:
nanos - the nanos
See Also:
JCaptureHeader.nanos(long)

seconds

public long seconds()
Gets the timestamp in seconds.

Specified by:
seconds in interface JCaptureHeader
Returns:
timestamp

seconds

public void seconds(long seconds)
Seconds.

Specified by:
seconds in interface JCaptureHeader
Parameters:
seconds - the seconds
See Also:
JCaptureHeader.seconds(long)

setWirelen

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

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

timestampInMicros

public long timestampInMicros()
Gets the timestamp in micro seconds.

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

timestampInMillis

public long timestampInMillis()
Gets the timestamp in millis.

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

timestampInNanos

public long timestampInNanos()
Timestamp in nanos.

Specified by:
timestampInNanos in interface JCaptureHeader
Returns:
the long
See Also:
JCaptureHeader.timestampInNanos()

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)
Wirelen.

Specified by:
wirelen in interface JCaptureHeader
Parameters:
wirelen - the wirelen
See Also:
JCaptureHeader.wirelen(int)