Package jpcap.packet

Class 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

      Fields 
      Modifier and Type Field Description
      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

      Constructors 
      Constructor Description
      Packet()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      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
      • 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