QuicPacketEncoder encapsulates the logic to encode a
quic packet. A QuicPacketEncoder is typically tied to
a particular version of the QUIC protocol.
| Modifier and Type | Class and Description |
|---|---|
| private static class | |
| private static class | |
| private static class | |
| private abstract static class | |
| private static class | |
| public abstract static class | |
| private static class | |
| private abstract static class | |
| private static class | |
| private static class | |
| pack-priv static class | QuicPacketEncoder.
A |
| Modifier and Type | Field and Description |
|---|---|
| private static final Logger | |
| private final QuicVersion |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static int | Returns: the maximum size of the payload that can be fit into this initial packetthe coding context, used to compute the
encoded packet number codingContext, long the full packet number packetNumber, int the length of the source connection id scidLength, int the length of the destination connection id dstidLength, int the desired total maximum size
of the packet after encryption maxDatagramSize)Compute the max size of the usable payload of a handshake packet, given the max size of the datagram. |
| public static int | Returns: the maximum size of the payload that can be fit into this initial packetthe coding context, used to compute the
encoded packet number codingContext, int packet number length pnsize, int the length of the token (or tokenLength, int 0)the length of the source connection id scidLength, int the length of the destination connection id dstidLength, int the desired total maximum size
of the packet after encryption maxDatagramSize)Compute the max size of the usable payload of an initial packet, given the max size of the datagram. |
| public static int | Returns: the maximum payload that can be carried on in aOneRttPacket given the max datagram size before
encryptionthe coding context codingContext, final long the packet number packetNumber, final int the peer connection id length dstidLength, final int the maximum size of the datagram maxDatagramSizeBeforeEncryption, final long largestPeerAckedPN)Computes the maximum usable payload that can be carried on in a
|
| public void | encode(QuicPacket
the packet to encode packet, ByteBuffer the byte buffer to write the packet into buffer, CodingContext context for encoding context)Encodes the given QuicPacket. |
| private void | encodePacket(QuicPacketEncoder.
A buffer to encode the packet into buffer, CodingContext context)Encode the OneRttPacket into the provided buffer. |
| private void | encodePacket(QuicPacketEncoder.
A buffer to encode the packet into. buffer, CodingContext context)Encode the ZeroRttPacket into the provided buffer. |
| private static void | encodePacket(QuicPacketEncoder.
A buffer to encode the packet into. buffer)Encode the VersionNegotiationPacket into the provided buffer. |
| private void | encodePacket(QuicPacketEncoder.
A buffer to encode the packet into. buffer, CodingContext context)Encode the HandshakePacket into the provided buffer. |
| private void | encodePacket(QuicPacketEncoder.
A buffer to encode the packet into. buffer, CodingContext coding context context)Encode the InitialPacket into the provided buffer. |
| private void | encodePacket(QuicPacketEncoder.
A buffer to encode the packet into. buffer, CodingContext context)Encode the RetryPacket into the provided buffer. |
| private static byte | Returns: the packet's header bytequic-dependent packet type encoding packetTypeTag, int the number of bytes needed to encode the packet number pnsize)Computes the packet's header byte, which also encodes the packetNumber length. |
| public QuicPacketEncoder. | Returns: the new handshake packetThe source connection ID source, QuicConnectionId The destination connection ID destination, long The packet number packetNumber, long largestAckedPN, List<QuicFrame> The handshake packet payload frames, CodingContext codingContext)Create a new unencrypted HandshakePacket to be transmitted over the wire after encryption. |
| public QuicPacketEncoder. | Returns: the new initial packetThe source connection ID source, QuicConnectionId The destination connection ID destination, byte[] The token field (may be null if no token) token, long The packet number packetNumber, long The largest acknowledged packet number ackedPacketNumber, List<QuicFrame> The initial packet payload frames, CodingContext codingContext)Create a new unencrypted InitialPacket to be transmitted over the wire after encryption. |
| public OneRttPacket | Returns: the new one RTT packetThe destination connection ID destination, long The packet number packetNumber, long The largest acknowledged packet number ackedPacketNumber, List<? extends QuicFrame> The one RTT packet payload frames, CodingContext codingContext)Create a new unencrypted OneRttPacket to be transmitted over the wire after encryption. |
| public QuicPacketEncoder. | Returns: a packet in the given key spacethe sending key space keySpace,the packet space packetSpace, QuicConnectionId the source connection id sourceId, QuicConnectionId the destination connection id destinationId, byte[] the initial token for INITIAL packets initialToken, List<QuicFrame> the list of frames frames, CodingContext the coding context codingContext)Creates a packet in the given keyspace for the purpose of sending a CONNECTION_CLOSE, or a generic list of frames. |
| public QuicPacketEncoder. | Returns: the new retry packetThe source connection ID source, QuicConnectionId The destination connection ID destination, byte[] The retry token retryToken)Create a new unencrypted RetryPacket to be transmitted over the wire after encryption. |
| public static QuicPacketEncoder. | Returns: the new initial packetThe source connection ID source, QuicConnectionId The destination connection ID destination, int[] The supported quic versions versions)Create a new unencrypted VersionNegotiationPacket to be transmitted over the wire after encryption. |
| public QuicPacketEncoder. | Returns: the new zero RTT packetThe source connection ID source, QuicConnectionId The destination connection ID destination, long The packet number packetNumber, long The largest acknowledged packet number ackedPacketNumber, List<? extends QuicFrame> The zero RTT packet payload frames, CodingContext codingContext)Create a new unencrypted ZeroRttPacket to be transmitted over the wire after encryption. |
| public static QuicPacketEncoder | Returns: an encoder for the given Quic version ornullthe Quic protocol version number quicVersion)Returns an encoder for the given Quic version. |
| private byte | Returns: the headers tag for the given packet type.the packet type packetTypeReturns the headers tag for the given packet type. |
| private static List | |
| private static ByteBuffer |