jpcap.packet
Class Packet

java.lang.Object
  extended by jpcap.packet.Packet
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
ARPPacket, IPPacket

public class Packet
extends java.lang.Object
implements java.io.Serializable

This is a root class of the all the packets captured by Jpcap.

See Also:
Serialized Form

Field Summary
 int caplen
          Captured length
 byte[] data
          Packet data (excluding the header)
 DatalinkPacket datalink
          Datalink layer header
static Packet EOF
          Returned by JpcapCaptor.getPacket() when EOF was reached while reading from an offline file.
 byte[] header
          Header data
 int len
          Length of this packet
 long sec
          Captured timestamp (sec)
 long usec
          Captured timestamp (micro sec)
 
Constructor Summary
Packet()
           
 
Method Summary
 java.lang.String toString()
          Returns a string representation of this packet
Format: sec:usec
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

sec

public long sec
Captured timestamp (sec)


usec

public long usec
Captured timestamp (micro sec)


caplen

public int caplen
Captured length


len

public int len
Length of this packet


datalink

public DatalinkPacket datalink
Datalink layer header


header

public byte[] header
Header data


data

public byte[] data
Packet data (excluding the header)


EOF

public static final Packet EOF
Returned by JpcapCaptor.getPacket() when EOF was reached while reading from an offline file.

Constructor Detail

Packet

public Packet()
Method Detail

toString

public java.lang.String toString()
Returns a string representation of this packet
Format: sec:usec

Overrides:
toString in class java.lang.Object
Returns:
a string representation of this packet