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

public Interface CodingContext

Known Direct Implementers
jdk.internal.net.http.quic.QuicConnectionImpl.QuicCodingContext
Imports
jdk.internal.net.http.quic.packets.QuicPacket, jdk.internal.net.quic.QuicKeyUnavailableException, .QuicTLSEngine, .QuicTransportException, java.io.IOException, java.nio.ByteBuffer

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

the length of the local connection ids expected to be found in incoming short header packets
connectionIdLength
()

Returns the length of the local connection ids expected to be found in incoming short header packets.

public QuicTLSEngine

Returns:

the TLS engine associated with this context
getTLSEngine
()

Returns the TLS engine associated with this context

public long

Returns:

the largest outgoing packet number acknowledged by the peer in the given packet number space
largestAckedPN
(QuicPacket.PacketNumberSpace
the packet number space
packetSpace
)

Returns the largest outgoing packet number acknowledged by the peer in the given packet number space.

public default long

Returns:

the largest outgoing packet number acknowledged by the peer in the packet number space corresponding to the given packet type
largestAckedPN
(QuicPacket.PacketType
the packet type
packetType
)

Returns the largest outgoing packet number acknowledged by the peer in the packet number space corresponding to the given packet type.

public long

Returns:

the largest incoming packet number successfully processed in the given packet number space
largestProcessedPN
(QuicPacket.PacketNumberSpace
the packet number space
packetSpace
)

Returns the largest incoming packet number successfully processed in the given packet number space.

public default long

Returns:

the largest incoming packet number successfully processed in the packet number space corresponding to the given packet type
largestProcessedPN
(QuicPacket.PacketType
the packet type
packetType
)

Returns the largest incoming packet number successfully processed in the packet number space corresponding to the given packet type.

public default int

Returns:

The minimum payload size for short packet payloads
minShortPacketPayloadSize
(int
the length of the destination connectionId included in the packet
destConnectionIdLength
)

Returns The minimum payload size for short packet payloads.

public QuicConnectionId

Returns:

the original destination connection id, required for calculating the retry integrity tag
originalServerConnId
()

Returns the original destination connection id, required for calculating the retry integrity tag.

public QuicPacket

Returns:

the packet read
parsePacket
(ByteBuffer
a byte buffer containing a non encrypted packet
src
)

Reads an encrypted packet from the given byte buffer.

public boolean

Returns:

true if token is valid, false otherwise
verifyToken
(QuicConnectionId
destination connection ID found in the packet
destinationID
,
byte[]
token to verify
token
)

Checks if the provided token is valid for the given context and connection ID.

public int

Returns:

the number of bytes written
writePacket
(QuicPacket
the outgoing packet to write
packet
,
ByteBuffer
the byte buffer to write the packet into
buffer
)

Writes the given outgoing packet in the given byte buffer.

Method Detail

connectionIdLengthback to summary
public int connectionIdLength()

Returns the length of the local connection ids expected to be found in incoming short header packets.

Returns:int

the length of the local connection ids expected to be found in incoming short header packets

getTLSEngineback to summary
public QuicTLSEngine getTLSEngine()

Returns the TLS engine associated with this context

Returns:QuicTLSEngine

the TLS engine associated with this context

largestAckedPNback to summary
public long largestAckedPN(QuicPacket.PacketNumberSpace packetSpace)

Returns the largest outgoing packet number acknowledged by the peer in the given packet number space.

API Note

This method is used when encoding the packet number of an outgoing packet.

Parameters
packetSpace:QuicPacket.PacketNumberSpace

the packet number space

Returns:long

the largest outgoing packet number acknowledged by the peer in the given packet number space

largestAckedPNback to summary
public default long largestAckedPN(QuicPacket.PacketType packetType)

Returns the largest outgoing packet number acknowledged by the peer in the packet number space corresponding to the given packet type.

This is equivalent to calling:

    largestAckedPN(QuicPacket.PacketNumberSpace.of(packetType));

API Note

This method is used when encoding the packet number of an outgoing packet.

Parameters
packetType:QuicPacket.PacketType

the packet type

Returns:long

the largest outgoing packet number acknowledged by the peer in the packet number space corresponding to the given packet type

largestProcessedPNback to summary
public long largestProcessedPN(QuicPacket.PacketNumberSpace packetSpace)

Returns the largest incoming packet number successfully processed in the given packet number space.

API Note

This method is used when decoding the packet number of an incoming packet.

Parameters
packetSpace:QuicPacket.PacketNumberSpace

the packet number space

Returns:long

the largest incoming packet number successfully processed in the given packet number space

largestProcessedPNback to summary
public default long largestProcessedPN(QuicPacket.PacketType packetType)

Returns the largest incoming packet number successfully processed in the packet number space corresponding to the given packet type.

This is equivalent to calling:

    largestProcessedPN(QuicPacket.PacketNumberSpace.of(packetType));

API Note

This method is used when decoding the packet number of an incoming packet.

Parameters
packetType:QuicPacket.PacketType

the packet type

Returns:long

the largest incoming packet number successfully processed in the packet number space corresponding to the given packet type

minShortPacketPayloadSizeback to summary
public default int minShortPacketPayloadSize(int destConnectionIdLength)

Returns The minimum payload size for short packet payloads. . Padding will be added to match that size if needed.

Parameters
destConnectionIdLength:int

the length of the destination connectionId included in the packet

Returns:int

The minimum payload size for short packet payloads

originalServerConnIdback to summary
public QuicConnectionId originalServerConnId()

Returns the original destination connection id, required for calculating the retry integrity tag.

This is only of interest when protecting/unprotecting a Retry Packet.

Returns:QuicConnectionId

the original destination connection id, required for calculating the retry integrity tag

parsePacketback to summary
public QuicPacket parsePacket(ByteBuffer src) throws IOException, QuicKeyUnavailableException, QuicTransportException

Reads an encrypted packet from the given byte buffer. This method moves the position of the byte buffer.

Parameters
src:ByteBuffer

a byte buffer containing a non encrypted packet

Returns:QuicPacket

the packet read

Exceptions
IOException:
if the packet couldn't be read
QuicTransportException:
if packet is correctly signed but malformed
verifyTokenback to summary
public boolean verifyToken(QuicConnectionId destinationID, byte[] token)

Checks if the provided token is valid for the given context and connection ID.

Parameters
destinationID:QuicConnectionId

destination connection ID found in the packet

token:byte[]

token to verify

Returns:boolean

true if token is valid, false otherwise

writePacketback to summary
public int writePacket(QuicPacket packet, ByteBuffer buffer) throws QuicKeyUnavailableException, QuicTransportException

Writes the given outgoing packet in the given byte buffer. This method moves the position of the byte buffer.

Parameters
packet:QuicPacket

the outgoing packet to write

buffer:ByteBuffer

the byte buffer to write the packet into

Returns:int

the number of bytes written

Exceptions
BufferOverflowException:
if the buffer doesn't have enough space to write the packet