Package io.github.mahmoudimus.quic.frame
Enum Class FrameType
- All Implemented Interfaces:
Serializable,Comparable<FrameType>,Constable
The QUIC frame types (RFC 9000 section 19 and Table 3), with the type codes each covers and
the packet types it may appear in. Types that carry flags in their low bits (ACK, STREAM,
MAX_STREAMS, STREAMS_BLOCKED, DATAGRAM) cover a range of codes; the two CONNECTION_CLOSE codes
are separate constants because they are allowed in different packets.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionACK (0x02) and ACK with ECN counts (0x03).ACK_FREQUENCY (0xaf) of the QUIC ACK frequency extension.CONNECTION_CLOSE for application errors (0x1d).CONNECTION_CLOSE for transport errors (0x1c), the only close allowed in Initial and Handshake.CRYPTO (0x06).DATA_BLOCKED (0x14).DATAGRAM (0x30, and 0x31 with a Length field) of RFC 9221.HANDSHAKE_DONE (0x1e), sent by servers only.IMMEDIATE_ACK (0x1f) of the QUIC ACK frequency extension.MAX_DATA (0x10).MAX_STREAM_DATA (0x11).MAX_STREAMS for bidirectional (0x12) and unidirectional (0x13) streams.NEW_CONNECTION_ID (0x18).NEW_TOKEN (0x07), sent by servers only.PADDING (0x00).PATH_CHALLENGE (0x1a).PATH_RESPONSE (0x1b).PING (0x01).RESET_STREAM (0x04).RETIRE_CONNECTION_ID (0x19).STOP_SENDING (0x05).STREAM (0x08 to 0x0f): the low bits flag OFF (0x04), LEN (0x02) and FIN (0x01).STREAM_DATA_BLOCKED (0x15).STREAMS_BLOCKED for bidirectional (0x16) and unidirectional (0x17) streams. -
Method Summary
Modifier and TypeMethodDescriptionintcode()The lowest type code of this frame type.static FrameTypeforCode(long code) The frame type with a type code.booleanWhether a packet containing this frame must be acknowledged (RFC 9000 section 13.2).booleanisAllowedIn(PacketType packetType) Whether this frame may appear in a packet type (RFC 9000 Table 3); receiving it elsewhere is aPROTOCOL_VIOLATION.intlastCode()The highest type code of this frame type.static FrameTypeReturns the enum constant of this class with the specified name.static FrameType[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
PADDING
PADDING (0x00). -
PING
PING (0x01). -
ACK
ACK (0x02) and ACK with ECN counts (0x03). -
RESET_STREAM
RESET_STREAM (0x04). -
STOP_SENDING
STOP_SENDING (0x05). -
CRYPTO
CRYPTO (0x06). -
NEW_TOKEN
NEW_TOKEN (0x07), sent by servers only. -
STREAM
STREAM (0x08 to 0x0f): the low bits flag OFF (0x04), LEN (0x02) and FIN (0x01). -
MAX_DATA
MAX_DATA (0x10). -
MAX_STREAM_DATA
MAX_STREAM_DATA (0x11). -
MAX_STREAMS
MAX_STREAMS for bidirectional (0x12) and unidirectional (0x13) streams. -
DATA_BLOCKED
DATA_BLOCKED (0x14). -
STREAM_DATA_BLOCKED
STREAM_DATA_BLOCKED (0x15). -
STREAMS_BLOCKED
STREAMS_BLOCKED for bidirectional (0x16) and unidirectional (0x17) streams. -
NEW_CONNECTION_ID
NEW_CONNECTION_ID (0x18). -
RETIRE_CONNECTION_ID
RETIRE_CONNECTION_ID (0x19). -
PATH_CHALLENGE
PATH_CHALLENGE (0x1a). -
PATH_RESPONSE
PATH_RESPONSE (0x1b). -
CONNECTION_CLOSE
CONNECTION_CLOSE for transport errors (0x1c), the only close allowed in Initial and Handshake. -
APPLICATION_CLOSE
CONNECTION_CLOSE for application errors (0x1d). -
HANDSHAKE_DONE
HANDSHAKE_DONE (0x1e), sent by servers only. -
IMMEDIATE_ACK
IMMEDIATE_ACK (0x1f) of the QUIC ACK frequency extension. -
DATAGRAM
DATAGRAM (0x30, and 0x31 with a Length field) of RFC 9221. -
ACK_FREQUENCY
ACK_FREQUENCY (0xaf) of the QUIC ACK frequency extension.
-
-
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
-
code
public int code()The lowest type code of this frame type.- Returns:
- the code, such as
0x08for STREAM
-
lastCode
public int lastCode()The highest type code of this frame type.- Returns:
- the code, such as
0x0ffor STREAM
-
isAckEliciting
public boolean isAckEliciting()Whether a packet containing this frame must be acknowledged (RFC 9000 section 13.2).- Returns:
- false for PADDING, ACK and CONNECTION_CLOSE
-
isAllowedIn
Whether this frame may appear in a packet type (RFC 9000 Table 3); receiving it elsewhere is aPROTOCOL_VIOLATION.- Parameters:
packetType- the packet type- Returns:
- true if allowed
-
forCode
The frame type with a type code.- Parameters:
code- the type code read from the wire- Returns:
- the type, or null for an unknown code
-