APIdia Launch Partner
Top Description Inners Methods
jdk.internal.net.http.quic.packets

public Interface QuicPacket

Known Direct Subinterfaces
jdk.internal.net.http.quic.packets.ShortHeaderPacket, jdk.internal.net.http.quic.packets.LongHeaderPacket
Known Direct Implementers
jdk.internal.net.http.quic.packets.QuicPacketDecoder.IncomingQuicPacket, jdk.internal.net.http.quic.packets.QuicPacketEncoder.OutgoingQuicPacket
Imports
java.util.List, .Optional, jdk.internal.net.http.quic.QuicConnectionId, jdk.internal.net.http.quic.frames.QuicFrame, jdk.internal.net.quic.QuicTLSEngine.KeySpace

A super-interface for all specific Quic packet implementation classes.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
QuicPacket.HeadersType

The Headers Type of the packet.

public static enum
QuicPacket.PacketNumberSpace

The packet number space.

public static enum
QuicPacket.PacketType

The packet type for Quic packets.

Method Summary

Modifier and TypeMethod and Description
public QuicConnectionId

Returns:

the packet's Destination Connection ID
destinationId
()

Returns the packet's Destination Connection ID.

public default List<QuicFrame>

Returns:

this packet's frames
frames
()

Returns this packet's frames.

public default boolean

Returns:

whether this packet has a length.
hasLength
()

Whether this packet has a length field whose value can be read from the packet bytes.

public QuicPacket.HeadersType

Returns:

this packet's header's type.
headersType
()

This packet header's type.

public default boolean

Returns:

true if this packet is ACK-eliciting
isAckEliciting
()

Returns true if this packet is ACK-eliciting.

public default int

Returns:

the length of the payload and packet number.
length
()

Returns the length of the payload and packet number.

public QuicPacket.PacketNumberSpace

Returns:

this packet's number space
numberSpace
()

Returns this packet's number space.

public default long

Returns:

this packet's packet number, if applicable, -1L otherwise
packetNumber
()

Returns this packet's packet number, if applicable, -1L otherwise.

public QuicPacket.PacketType

Returns:

this packet's type
packetType
()

Returns this packet's type.

public default int

Returns:

the packet's payload size
payloadSize
()

Returns the packet's payload size.

public default String
public int

Returns:

the number of bytes needed to encode the packet.
size
()

This packet size.

Method Detail

destinationIdback to summary
public QuicConnectionId destinationId()

Returns the packet's Destination Connection ID.

Returns:QuicConnectionId

the packet's Destination Connection ID

See Also
RFC 9000, Section 7.2
framesback to summary
public default List<QuicFrame> frames()

Returns this packet's frames.

Returns:List<QuicFrame>

this packet's frames

hasLengthback to summary
public default boolean hasLength()

Whether this packet has a length field whose value can be read from the packet bytes.

Returns:boolean

whether this packet has a length.

headersTypeback to summary
public QuicPacket.HeadersType headersType()

This packet header's type. Either SHORT or LONG.

Returns:QuicPacket.HeadersType

this packet's header's type.

isAckElicitingback to summary
public default boolean isAckEliciting()

Returns true if this packet is ACK-eliciting. A packet is ACK-eliciting if it contains any ACK-eliciting frame.

Returns:boolean

true if this packet is ACK-eliciting

lengthback to summary
public default int length()

Returns the length of the payload and packet number. Includes encryption tag. This is the value stored in the Length field in Initial, Handshake and 0-RTT packets.

Returns:int

the length of the payload and packet number.

Exceptions
UnsupportedOperationException:
if this packet type does not have the Length field.
See Also
hasLength(), size(), payloadSize()
numberSpaceback to summary
public QuicPacket.PacketNumberSpace numberSpace()

Returns this packet's number space.

Returns:QuicPacket.PacketNumberSpace

this packet's number space

packetNumberback to summary
public default long packetNumber()

Returns this packet's packet number, if applicable, -1L otherwise.

Returns:long

this packet's packet number, if applicable, -1L otherwise

packetTypeback to summary
public QuicPacket.PacketType packetType()

Returns this packet's type.

Returns:QuicPacket.PacketType

this packet's type

payloadSizeback to summary
public default int payloadSize()

Returns the packet's payload size. This is the number of bytes needed to encode the packet's frames.

Returns:int

the packet's payload size

See Also
size(), length()
prettyPrintback to summary
public default String prettyPrint()
sizeback to summary
public int size()

This packet size.

Returns:int

the number of bytes needed to encode the packet.

See Also
payloadSize(), length()
jdk.internal.net.http.quic.packets back to summary

public final Enum QuicPacket.HeadersType

extends Enum<QuicPacket.HeadersType>
Class Inheritance

The Headers Type of the packet. This is either SHORT or LONG, or NONE when it can't be determined, or when we know that the packet is a stateless reset packet. A stateless reset packet is indistinguishable from a short header packet, so we only know that a packet is a stateless reset if we built it. In that case, the packet may advertise its header's type as NONE.

Field Summary

Modifier and TypeField and Description
public static final QuicPacket.HeadersType
public static final QuicPacket.HeadersType
public static final QuicPacket.HeadersType

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static QuicPacket.HeadersType
public static QuicPacket.HeadersType[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

LONGback to summary
public static final QuicPacket.HeadersType LONG
NONEback to summary
public static final QuicPacket.HeadersType NONE
SHORTback to summary
public static final QuicPacket.HeadersType SHORT

Constructor Detail

HeadersTypeback to summary
private HeadersType()

Method Detail

valueOfback to summary
public static QuicPacket.HeadersType valueOf(String name)
valuesback to summary
public static QuicPacket.HeadersType[] values()
jdk.internal.net.http.quic.packets back to summary

public final Enum QuicPacket.PacketNumberSpace

extends Enum<QuicPacket.PacketNumberSpace>
Class Inheritance

The packet number space. NONE is for packets that don't have a packet number, such as Stateless Reset.

Field Summary

Modifier and TypeField and Description
public static final QuicPacket.PacketNumberSpace
public static final QuicPacket.PacketNumberSpace
public static final QuicPacket.PacketNumberSpace
public static final QuicPacket.PacketNumberSpace

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static QuicPacket.PacketNumberSpace

Returns:

the packet number space that corresponds to the given packet type
of
(QuicPacket.PacketType
a packet type
packetType
)

Maps a PacketType to the corresponding packet number space.

public static QuicPacket.PacketNumberSpace

Returns:

the packet number space that corresponds to the given key space.
of
(QuicTLSEngine.KeySpace
a key space
keySpace
)

Maps a KeySpace to the corresponding packet number space.

public static QuicPacket.PacketNumberSpace
public static QuicPacket.PacketNumberSpace[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

APPLICATIONback to summary
public static final QuicPacket.PacketNumberSpace APPLICATION
HANDSHAKEback to summary
public static final QuicPacket.PacketNumberSpace HANDSHAKE
INITIALback to summary
public static final QuicPacket.PacketNumberSpace INITIAL
NONEback to summary
public static final QuicPacket.PacketNumberSpace NONE

Constructor Detail

PacketNumberSpaceback to summary
private PacketNumberSpace()

Method Detail

ofback to summary
public static QuicPacket.PacketNumberSpace of(QuicPacket.PacketType packetType)

Maps a PacketType to the corresponding packet number space.

For PacketType#RETRY, PacketType#VERSIONS, and PacketType#NONE, PacketNumberSpace#NONE is returned.

Parameters
packetType:QuicPacket.PacketType

a packet type

Returns:QuicPacket.PacketNumberSpace

the packet number space that corresponds to the given packet type

ofback to summary
public static QuicPacket.PacketNumberSpace of(QuicTLSEngine.KeySpace keySpace)

Maps a KeySpace to the corresponding packet number space.

For KeySpace#RETRY, PacketNumberSpace#NONE is returned.

Parameters
keySpace:QuicTLSEngine.KeySpace

a key space

Returns:QuicPacket.PacketNumberSpace

the packet number space that corresponds to the given key space.

valueOfback to summary
public static QuicPacket.PacketNumberSpace valueOf(String name)
valuesback to summary
public static QuicPacket.PacketNumberSpace[] values()
jdk.internal.net.http.quic.packets back to summary

public final Enum QuicPacket.PacketType

extends Enum<QuicPacket.PacketType>
Class Inheritance

The packet type for Quic packets.

Field Summary

Modifier and TypeField and Description
public static final QuicPacket.PacketType
public static final QuicPacket.PacketType
public static final QuicPacket.PacketType
public static final QuicPacket.PacketType
public static final QuicPacket.PacketType
public static final QuicPacket.PacketType
public static final QuicPacket.PacketType

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public boolean
public boolean

Returns:

true if packets of this type are short-header packets
isShortHeaderType
()

Returns true if packets of this type are short-header packets.

public Optional<QuicTLSEngine.KeySpace>

Returns:

the QUIC-TLS key space corresponding to this packet type
keySpace
()

Returns the QUIC-TLS key space corresponding to this packet type.

public static QuicPacket.PacketType
public static QuicPacket.PacketType[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

HANDSHAKEback to summary
public static final QuicPacket.PacketType HANDSHAKE
INITIALback to summary
public static final QuicPacket.PacketType INITIAL
NONEback to summary
public static final QuicPacket.PacketType NONE
ONERTTback to summary
public static final QuicPacket.PacketType ONERTT
RETRYback to summary
public static final QuicPacket.PacketType RETRY
VERSIONSback to summary
public static final QuicPacket.PacketType VERSIONS
ZERORTTback to summary
public static final QuicPacket.PacketType ZERORTT

Constructor Detail

PacketTypeback to summary
private PacketType()

Method Detail

isLongHeaderTypeback to summary
public boolean isLongHeaderType()
isShortHeaderTypeback to summary
public boolean isShortHeaderType()

Returns true if packets of this type are short-header packets.

Returns:boolean

true if packets of this type are short-header packets

keySpaceback to summary
public Optional<QuicTLSEngine.KeySpace> keySpace()

Returns the QUIC-TLS key space corresponding to this packet type. Some packet types, such as VERSIONS, do not have an associated key space.

Returns:Optional<QuicTLSEngine.KeySpace>

the QUIC-TLS key space corresponding to this packet type

valueOfback to summary
public static QuicPacket.PacketType valueOf(String name)
valuesback to summary
public static QuicPacket.PacketType[] values()