1a74702c6SGeorge Wang/* Copyright (c) 2017 - 2022 LiteSpeed Technologies Inc.  See LICENSE. */
25392f7a3SLiteSpeed Tech#ifndef LSQUIC_PACKET_IETF_H
35392f7a3SLiteSpeed Tech#define LSQUIC_PACKET_IETF_H 1
45392f7a3SLiteSpeed Tech
55392f7a3SLiteSpeed Tech#define IQUIC_MAX_IPv4_PACKET_SZ 1252
65392f7a3SLiteSpeed Tech#define IQUIC_MAX_IPv6_PACKET_SZ 1232
75392f7a3SLiteSpeed Tech
85392f7a3SLiteSpeed Tech#define iquic_packno_bits2len(b) ((b) + 1)
95392f7a3SLiteSpeed Tech
105392f7a3SLiteSpeed Tech/* [draft-ietf-quic-transport-22] Section 7.2:
115392f7a3SLiteSpeed Tech "
125392f7a3SLiteSpeed Tech   When an Initial packet is sent by a client that has not previously
135392f7a3SLiteSpeed Tech   received an Initial or Retry packet from the server, it populates the
145392f7a3SLiteSpeed Tech   Destination Connection ID field with an unpredictable value.  This
155392f7a3SLiteSpeed Tech   MUST be at least 8 bytes in length.
165392f7a3SLiteSpeed Tech "
175392f7a3SLiteSpeed Tech * Because the server always generates 8-byte CIDs, the DCID length cannot be
185392f7a3SLiteSpeed Tech * smaller than 8 even if the client received an Initial or Retry packet from
195392f7a3SLiteSpeed Tech * us.
205392f7a3SLiteSpeed Tech */
215392f7a3SLiteSpeed Tech#define MIN_INITIAL_DCID_LEN 8
225392f7a3SLiteSpeed Tech
23de46bf2fSDmitri Tikhonov/* [draft-ietf-quic-transport-24] Section 8.1 */
24de46bf2fSDmitri Tikhonov#define IQUIC_MIN_INIT_PACKET_SZ 1200
25de46bf2fSDmitri Tikhonov
26a4f5dac3SDmitri Tikhonov/* Our stream code makes an assumption that packet size is smaller than the
27a4f5dac3SDmitri Tikhonov * maximum HTTP/3 DATA frame size we can generate.
28a4f5dac3SDmitri Tikhonov */
29a4f5dac3SDmitri Tikhonov#define IQUIC_MAX_OUT_PACKET_SZ ((1u << 14) - 1)
30a4f5dac3SDmitri Tikhonov
31692a9102SDmitri Tikhonov#define QUIC_BIT 0x40
32692a9102SDmitri Tikhonov
335392f7a3SLiteSpeed Tech#endif
34