Enum Class FrameType

java.lang.Object
java.lang.Enum<FrameType>
io.github.mahmoudimus.quic.frame.FrameType
All Implemented Interfaces:
Serializable, Comparable<FrameType>, Constable

public enum FrameType extends Enum<FrameType>
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.
  • Enum Constant Details

    • PADDING

      public static final FrameType PADDING
      PADDING (0x00).
    • PING

      public static final FrameType PING
      PING (0x01).
    • ACK

      public static final FrameType ACK
      ACK (0x02) and ACK with ECN counts (0x03).
    • RESET_STREAM

      public static final FrameType RESET_STREAM
      RESET_STREAM (0x04).
    • STOP_SENDING

      public static final FrameType STOP_SENDING
      STOP_SENDING (0x05).
    • CRYPTO

      public static final FrameType CRYPTO
      CRYPTO (0x06).
    • NEW_TOKEN

      public static final FrameType NEW_TOKEN
      NEW_TOKEN (0x07), sent by servers only.
    • STREAM

      public static final FrameType STREAM
      STREAM (0x08 to 0x0f): the low bits flag OFF (0x04), LEN (0x02) and FIN (0x01).
    • MAX_DATA

      public static final FrameType MAX_DATA
      MAX_DATA (0x10).
    • MAX_STREAM_DATA

      public static final FrameType MAX_STREAM_DATA
      MAX_STREAM_DATA (0x11).
    • MAX_STREAMS

      public static final FrameType MAX_STREAMS
      MAX_STREAMS for bidirectional (0x12) and unidirectional (0x13) streams.
    • DATA_BLOCKED

      public static final FrameType DATA_BLOCKED
      DATA_BLOCKED (0x14).
    • STREAM_DATA_BLOCKED

      public static final FrameType STREAM_DATA_BLOCKED
      STREAM_DATA_BLOCKED (0x15).
    • STREAMS_BLOCKED

      public static final FrameType STREAMS_BLOCKED
      STREAMS_BLOCKED for bidirectional (0x16) and unidirectional (0x17) streams.
    • NEW_CONNECTION_ID

      public static final FrameType NEW_CONNECTION_ID
      NEW_CONNECTION_ID (0x18).
    • RETIRE_CONNECTION_ID

      public static final FrameType RETIRE_CONNECTION_ID
      RETIRE_CONNECTION_ID (0x19).
    • PATH_CHALLENGE

      public static final FrameType PATH_CHALLENGE
      PATH_CHALLENGE (0x1a).
    • PATH_RESPONSE

      public static final FrameType PATH_RESPONSE
      PATH_RESPONSE (0x1b).
    • CONNECTION_CLOSE

      public static final FrameType CONNECTION_CLOSE
      CONNECTION_CLOSE for transport errors (0x1c), the only close allowed in Initial and Handshake.
    • APPLICATION_CLOSE

      public static final FrameType APPLICATION_CLOSE
      CONNECTION_CLOSE for application errors (0x1d).
    • HANDSHAKE_DONE

      public static final FrameType HANDSHAKE_DONE
      HANDSHAKE_DONE (0x1e), sent by servers only.
    • IMMEDIATE_ACK

      public static final FrameType IMMEDIATE_ACK
      IMMEDIATE_ACK (0x1f) of the QUIC ACK frequency extension.
    • DATAGRAM

      public static final FrameType DATAGRAM
      DATAGRAM (0x30, and 0x31 with a Length field) of RFC 9221.
    • ACK_FREQUENCY

      public static final FrameType ACK_FREQUENCY
      ACK_FREQUENCY (0xaf) of the QUIC ACK frequency extension.
  • Method Details

    • values

      public static FrameType[] 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

      public static FrameType valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • code

      public int code()
      The lowest type code of this frame type.
      Returns:
      the code, such as 0x08 for STREAM
    • lastCode

      public int lastCode()
      The highest type code of this frame type.
      Returns:
      the code, such as 0x0f for 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

      public boolean isAllowedIn(PacketType packetType)
      Whether this frame may appear in a packet type (RFC 9000 Table 3); receiving it elsewhere is a PROTOCOL_VIOLATION.
      Parameters:
      packetType - the packet type
      Returns:
      true if allowed
    • forCode

      public static FrameType forCode(long code)
      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