Package jpcap.packet

Class Packet

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

public class Packet extends Object implements Serializable
This is a root class of the all the packets captured by Jpcap.
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    int
    Captured length
    byte[]
    Packet data (excluding the header)
    Datalink layer header
    static final Packet
    Returned by JpcapCaptor.getPacket() when EOF was reached while reading from an offline file.
    byte[]
    Header data
    int
    Length of this packet
    long
    Captured timestamp (sec)
    long
    Captured timestamp (micro sec)
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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 Details

    • 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
    • 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 Details

    • Packet

      public Packet()
  • Method Details

    • toString

      public String toString()
      Returns a string representation of this packet
      Format: sec:usec
      Overrides:
      toString in class Object
      Returns:
      a string representation of this packet