Record Class PacketHeader.Retry

java.lang.Object
java.lang.Record
io.github.mahmoudimus.quic.packet.PacketHeader.Retry
Record Components:
version - the QUIC version
destinationId - the Destination Connection ID (the client's Source Connection ID)
sourceId - the Source Connection ID the server chose
token - the Retry token
integrityTag - the 16-byte Retry Integrity Tag
All Implemented Interfaces:
PacketHeader
Enclosing interface:
PacketHeader

public static record PacketHeader.Retry(QuicVersion version, ConnectionId destinationId, ConnectionId sourceId, byte[] token, byte[] integrityTag) extends Record implements PacketHeader
A Retry packet (RFC 9000 section 17.2.5): the whole packet, since it has no payload beyond the token and the integrity tag. The four unused bits of the first byte are encoded as ones, as in the RFC 9001 and RFC 9369 samples.
  • Constructor Details

    • Retry

      public Retry(QuicVersion version, ConnectionId destinationId, ConnectionId sourceId, byte[] token, byte[] integrityTag)
      A Retry packet.
      Parameters:
      version - the QUIC version
      destinationId - the Destination Connection ID
      sourceId - the Source Connection ID
      token - the Retry token
      integrityTag - the 16-byte Retry Integrity Tag
  • Method Details

    • create

      public static PacketHeader.Retry create(QuicVersion version, ConnectionId destinationId, ConnectionId sourceId, byte[] token, ConnectionId originalDestinationId)
      A Retry packet with its integrity tag computed for the client's original Destination Connection ID.
      Parameters:
      version - the QUIC version
      destinationId - the Destination Connection ID (the client's Source Connection ID)
      sourceId - the Source Connection ID the server chose
      token - the Retry token
      originalDestinationId - the Destination Connection ID of the client's Initial
      Returns:
      the Retry packet
    • type

      public PacketType type()
      Description copied from interface: PacketHeader
      The packet type.
      Specified by:
      type in interface PacketHeader
      Returns:
      the type
    • token

      public byte[] token()
      The Retry token.
      Returns:
      a copy of the token
    • integrityTag

      public byte[] integrityTag()
      The Retry Integrity Tag.
      Returns:
      a copy of the 16-byte tag
    • encode

      public HeaderLayout encode(ByteBuffer out)
      Description copied from interface: PacketHeader
      Writes the header at the buffer's position.
      Specified by:
      encode in interface PacketHeader
      Parameters:
      out - the buffer
      Returns:
      where the fields landed
    • equals

      public boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • hashCode

      public int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • toString

      public String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • version

      public QuicVersion version()
      Returns the value of the version record component.
      Returns:
      the value of the version record component
    • destinationId

      public ConnectionId destinationId()
      Returns the value of the destinationId record component.
      Specified by:
      destinationId in interface PacketHeader
      Returns:
      the value of the destinationId record component
    • sourceId

      public ConnectionId sourceId()
      Returns the value of the sourceId record component.
      Returns:
      the value of the sourceId record component