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

public Interface InitialPacket

extends LongHeaderPacket
Known Direct Implementers
jdk.internal.net.http.quic.packets.QuicPacketDecoder.IncomingInitialPacket, jdk.internal.net.http.quic.packets.QuicPacketEncoder.OutgoingInitialPacket
Imports
java.util.List, jdk.internal.net.http.quic.frames.QuicFrame

This class models Quic Initial Packets, as defined by RFC 9000, Section 17.2.2:
An Initial packet uses long headers with a type value of 0x00.
   It carries the first CRYPTO frames sent by the client and server to perform
   key exchange, and it carries ACK frames in either direction.

   Initial Packet {
     Header Form (1) = 1,
     Fixed Bit (1) = 1,
     Long Packet Type (2) = 0,
     Reserved Bits (2),         # Protected
     Packet Number Length (2),  # Protected
     Version (32),
     DCID Len (8),
     Destination Connection ID (0..160),
     SCID Len (8),
     Source Connection ID (0..160),
     Token Length (i),
     Token (..),
     Length (i),
     Packet Number (8..32),     # Protected
     # Protected Packet Payload (..)
     Protected Payload (0..24), # Skipped Part
     Protected Payload (128),   # Sampled Part
     Protected Payload (..)     # Remainder
   }

Subclasses of this class may be used to model packets exchanged with either Quic Version 1 or Quic Version 2. Note that Quic Version 2 uses the same Initial Packet structure than Quic Version 1, but uses a different long packet type than that shown above. See RFC 9369, Section 3.2.

External Specification
https://www.rfc-editor.org/info/rfc9000, https://www.rfc-editor.org/info/rfc9369

Method Summary

Modifier and TypeMethod and Description
public List<QuicFrame>
frames()

Redeclares as abstract: jdk.internal.net.http.quic.packets.QuicPacket.frames.

Returns this packet's frames.

public default boolean
hasLength()

Overrides default jdk.internal.net.http.quic.packets.QuicPacket.hasLength.

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

public default QuicPacket.PacketNumberSpace
numberSpace()

Implements jdk.internal.net.http.quic.packets.QuicPacket.numberSpace.

Returns this packet's number space.

public long

Returns:

this packet number.
packetNumber
()

Redeclares as abstract: jdk.internal.net.http.quic.packets.QuicPacket.packetNumber.

This packet number.

public default QuicPacket.PacketType
public default String
public byte[]

Returns:

the token bytes, if present, null if not
token
()

Returns the token bytes, if present, null if not.

public int

Returns:

the length of the token field, if present, 0 if not
tokenLength
()

Returns the length of the token field, if present, 0 if not.

Inherited from jdk.internal.net.http.quic.packets.LongHeaderPacket:
headersTypesourceIdversion

Method Detail

framesback to summary
public List<QuicFrame> frames()

Redeclares as abstract: jdk.internal.net.http.quic.packets.QuicPacket.frames.

Doc from jdk.internal.net.http.quic.packets.QuicPacket.frames.

Returns this packet's frames.

Annotations
@Override
hasLengthback to summary
public default boolean hasLength()

Overrides default jdk.internal.net.http.quic.packets.QuicPacket.hasLength.

Doc from jdk.internal.net.http.quic.packets.QuicPacket.hasLength.

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

Annotations
@Override
numberSpaceback to summary
public default QuicPacket.PacketNumberSpace numberSpace()

Implements jdk.internal.net.http.quic.packets.QuicPacket.numberSpace.

Doc from jdk.internal.net.http.quic.packets.QuicPacket.numberSpace.

Returns this packet's number space.

Annotations
@Override
packetNumberback to summary
public long packetNumber()

Redeclares as abstract: jdk.internal.net.http.quic.packets.QuicPacket.packetNumber.

This packet number.

Returns:long

this packet number.

Annotations
@Override
packetTypeback to summary
public default QuicPacket.PacketType packetType()

Implements jdk.internal.net.http.quic.packets.QuicPacket.packetType.

Doc from jdk.internal.net.http.quic.packets.QuicPacket.packetType.

Returns this packet's type.

Annotations
@Override
prettyPrintback to summary
public default String prettyPrint()

Overrides default jdk.internal.net.http.quic.packets.QuicPacket.prettyPrint.

Annotations
@Override
tokenback to summary
public byte[] token()

Returns the token bytes, if present, null if not. From RFC 9000, Section 17.2.2:

The value of the token that was previously provided
   in a Retry packet or NEW_TOKEN frame; see Section 8.1.
Returns:byte[]

the token bytes, if present, null if not

See Also
RFC 9000, Section 8.1
tokenLengthback to summary
public int tokenLength()

Returns the length of the token field, if present, 0 if not.

Returns:int

the length of the token field, if present, 0 if not