Class AbstractPppPacket

java.lang.Object
org.pcap4j.packet.AbstractPacket
org.pcap4j.packet.AbstractPppPacket
All Implemented Interfaces:
Serializable, Iterable<Packet>, Packet
Direct Known Subclasses:
HdlcPppPacket, PppPacket

abstract class AbstractPppPacket extends AbstractPacket
https://tools.ietf.org/html/rfc1661
Since:
pcap4j 1.4.0
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • payload

      private final Packet payload
    • pad

      private final byte[] pad
  • Constructor Details

  • Method Details

    • getHeader

      public abstract AbstractPppPacket.AbstractPppHeader getHeader()
      Description copied from class: AbstractPacket
      Returns the Header object representing this packet's header. This subclass have to override this method if the packet represented by the subclass has a header.
      Specified by:
      getHeader in interface Packet
      Overrides:
      getHeader in class AbstractPacket
      Returns:
      the Header object representing this packet's header. May be null if the header doesn't exist
    • getPayload

      public Packet getPayload()
      Description copied from class: AbstractPacket
      Returns the Packet object representing this packet's payload. This subclass have to override this method if the packet represented by the subclass has a payload.
      Specified by:
      getPayload in interface Packet
      Overrides:
      getPayload in class AbstractPacket
      Returns:
      the Packet object representing this packet's payload. May be null if the payload doesn't exist
    • getPad

      public byte[] getPad()
      Returns:
      pad
    • calcLength

      protected int calcLength()
      Description copied from class: AbstractPacket
      This method calculates the value length() will return by adding up the header length and the payload length. If you write this subclass which represents a packet with extra parts (e.g. a trailer), you need to override this method.
      Overrides:
      calcLength in class AbstractPacket
      Returns:
      a calculated length
    • buildRawData

      protected byte[] buildRawData()
      Description copied from class: AbstractPacket
      This method builds the value getRawData() will return by concatenating the header's raw data and the payload's raw data. If you write this subclass which represents a packet with extra parts (e.g. a trailer), you need to override this method.
      Overrides:
      buildRawData in class AbstractPacket
      Returns:
      a raw data built
    • buildString

      protected String buildString()
      Description copied from class: AbstractPacket
      This method builds the value toString() will return by concatenating the header's string representation and the payload's string representation. If you write this subclass which represents a packet with extra parts (e.g. a trailer), you need to override this method.
      Overrides:
      buildString in class AbstractPacket
      Returns:
      a string representation of this object
    • equals

      public boolean equals(Object obj)
      Description copied from class: AbstractPacket
      Indicates whether some other object is "equal to" this one. This method firstly compares this packet's header using the header's equals(Object) method, then compares this packet's payload using the payload's equals(Object) method. If you write this subclass with fields which represent somethings other than header or payload, you need to override this method.
      Overrides:
      equals in class AbstractPacket
    • calcHashCode

      protected int calcHashCode()
      Description copied from class: AbstractPacket
      This method calculates the value hashCode() will return using the header's hash code and the payload's hash code. If you write this subclass which represents a packet with extra parts (e.g. a trailer), you need to override this method.
      Overrides:
      calcHashCode in class AbstractPacket
      Returns:
      a calculated hash code value for the object