Record Class PacketHeader.Retry
java.lang.Object
java.lang.Record
io.github.mahmoudimus.quic.packet.PacketHeader.Retry
- Record Components:
version- the QUIC versiondestinationId- the Destination Connection ID (the client's Source Connection ID)sourceId- the Source Connection ID the server chosetoken- the Retry tokenintegrityTag- 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.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.github.mahmoudimus.quic.packet.PacketHeader
PacketHeader.Handshake, PacketHeader.Initial, PacketHeader.Numbered, PacketHeader.Retry, PacketHeader.Short, PacketHeader.VersionNegotiation, PacketHeader.ZeroRtt -
Field Summary
Fields inherited from interface io.github.mahmoudimus.quic.packet.PacketHeader
FIXED_BIT, KEY_PHASE_BIT, LONG_HEADER_FORM, LONG_RESERVED_BITS, SHORT_RESERVED_BITS, SPIN_BIT -
Constructor Summary
ConstructorsConstructorDescriptionRetry(QuicVersion version, ConnectionId destinationId, ConnectionId sourceId, byte[] token, byte[] integrityTag) A Retry packet. -
Method Summary
Modifier and TypeMethodDescriptionstatic PacketHeader.Retrycreate(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.Returns the value of thedestinationIdrecord component.encode(ByteBuffer out) Writes the header at the buffer's position.booleanIndicates whether some other object is "equal to" this one.inthashCode()Returns a hash code value for this object.byte[]The Retry Integrity Tag.sourceId()Returns the value of thesourceIdrecord component.byte[]token()The Retry token.toString()Returns a string representation of this record class.type()The packet type.version()Returns the value of theversionrecord component.
-
Constructor Details
-
Retry
public Retry(QuicVersion version, ConnectionId destinationId, ConnectionId sourceId, byte[] token, byte[] integrityTag) A Retry packet.- Parameters:
version- the QUIC versiondestinationId- the Destination Connection IDsourceId- the Source Connection IDtoken- the Retry tokenintegrityTag- 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 versiondestinationId- the Destination Connection ID (the client's Source Connection ID)sourceId- the Source Connection ID the server chosetoken- the Retry tokenoriginalDestinationId- the Destination Connection ID of the client's Initial- Returns:
- the Retry packet
-
type
Description copied from interface:PacketHeaderThe packet type.- Specified by:
typein interfacePacketHeader- 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
Description copied from interface:PacketHeaderWrites the header at the buffer's position.- Specified by:
encodein interfacePacketHeader- Parameters:
out- the buffer- Returns:
- where the fields landed
-
equals
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 withObjects::equals(Object,Object). -
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. -
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. -
version
Returns the value of theversionrecord component.- Returns:
- the value of the
versionrecord component
-
destinationId
Returns the value of thedestinationIdrecord component.- Specified by:
destinationIdin interfacePacketHeader- Returns:
- the value of the
destinationIdrecord component
-
sourceId
Returns the value of thesourceIdrecord component.- Returns:
- the value of the
sourceIdrecord component
-