Class TcpTimestampsOption

java.lang.Object
org.pcap4j.packet.TcpTimestampsOption
All Implemented Interfaces:
Serializable, TcpPacket.TcpOption

public final class TcpTimestampsOption extends Object implements TcpPacket.TcpOption
Since:
pcap4j 1.2.0
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • kind

      private final TcpOptionKind kind
    • length

      private final byte length
    • tsValue

      private final int tsValue
    • tsEchoReply

      private final int tsEchoReply
  • Constructor Details

  • Method Details

    • newInstance

      public static TcpTimestampsOption newInstance(byte[] rawData, int offset, int length) throws IllegalRawDataException
      A static factory method. This method validates the arguments by ByteArrays.validateBounds(byte[], int, int), which may throw exceptions undocumented here.
      Parameters:
      rawData - rawData
      offset - offset
      length - length
      Returns:
      a new TcpTimestampsOption object.
      Throws:
      IllegalRawDataException - if parsing the raw data fails.
    • getKind

      public TcpOptionKind getKind()
      Specified by:
      getKind in interface TcpPacket.TcpOption
      Returns:
      kind
    • getLength

      public byte getLength()
      Returns:
      length
    • getLengthAsInt

      public int getLengthAsInt()
      Returns:
      length
    • getTsValue

      public int getTsValue()
      Returns:
      tsValue
    • getTsValueAsLong

      public long getTsValueAsLong()
      Returns:
      tsValue
    • getTsEchoReply

      public int getTsEchoReply()
      Returns:
      tsEchoReply
    • getTsEchoReplyAsLong

      public long getTsEchoReplyAsLong()
      Returns:
      tsEchoReply
    • length

      public int length()
      Specified by:
      length in interface TcpPacket.TcpOption
      Returns:
      length
    • getRawData

      public byte[] getRawData()
      Specified by:
      getRawData in interface TcpPacket.TcpOption
      Returns:
      raw data
    • getBuilder

      public TcpTimestampsOption.Builder getBuilder()
      Returns:
      a new Builder object populated with this object's fields.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object