Enum Class PacketType
- All Implemented Interfaces:
Serializable,Comparable<PacketType>,Constable
The QUIC packet types (RFC 9000 section 17). Long header types carry two type bits whose values
differ between version 1 and version 2.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionHandshake (long header).Initial (long header), carrying the first CRYPTO data and an optional token.1-RTT (short header).Retry (long header), unprotected except for its integrity tag.Version Negotiation (long header with version 0), unprotected.0-RTT (long header), early application data. -
Method Summary
Modifier and TypeMethodDescriptionstatic PacketTypefromLongTypeBits(QuicVersion version, int bits) The long header type for two type bits in a version.booleanWhether the packet uses a long header.booleanWhether the packet has header and payload protection and a packet number.level()The encryption level whose keys protect this packet type.intlongTypeBits(QuicVersion version) The two Long Packet Type bits of this type in a version.static PacketTypeReturns the enum constant of this class with the specified name.static PacketType[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
INITIAL
Initial (long header), carrying the first CRYPTO data and an optional token. -
ZERO_RTT
0-RTT (long header), early application data. -
HANDSHAKE
Handshake (long header). -
RETRY
Retry (long header), unprotected except for its integrity tag. -
VERSION_NEGOTIATION
Version Negotiation (long header with version 0), unprotected. -
ONE_RTT
1-RTT (short header).
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
level
The encryption level whose keys protect this packet type.- Returns:
- the level, or null for Retry and Version Negotiation packets
-
isProtected
public boolean isProtected()Whether the packet has header and payload protection and a packet number.- Returns:
- false for Retry and Version Negotiation packets
-
isLongHeader
public boolean isLongHeader()Whether the packet uses a long header.- Returns:
- true for every type but
ONE_RTT
-
longTypeBits
The two Long Packet Type bits of this type in a version.- Parameters:
version- the QUIC version- Returns:
- 0 to 3
- Throws:
IllegalStateException- forONE_RTTandVERSION_NEGOTIATION
-
fromLongTypeBits
The long header type for two type bits in a version.
-