lsquic_packet_ietf.h revision a4f5dac3
1/* Copyright (c) 2017 - 2020 LiteSpeed Technologies Inc.  See LICENSE. */
2#ifndef LSQUIC_PACKET_IETF_H
3#define LSQUIC_PACKET_IETF_H 1
4
5#define IQUIC_MAX_IPv4_PACKET_SZ 1252
6#define IQUIC_MAX_IPv6_PACKET_SZ 1232
7
8#define iquic_packno_bits2len(b) ((b) + 1)
9
10/* [draft-ietf-quic-transport-22] Section 7.2:
11 "
12   When an Initial packet is sent by a client that has not previously
13   received an Initial or Retry packet from the server, it populates the
14   Destination Connection ID field with an unpredictable value.  This
15   MUST be at least 8 bytes in length.
16 "
17 * Because the server always generates 8-byte CIDs, the DCID length cannot be
18 * smaller than 8 even if the client received an Initial or Retry packet from
19 * us.
20 */
21#define MIN_INITIAL_DCID_LEN 8
22
23/* [draft-ietf-quic-transport-24] Section 8.1 */
24#define IQUIC_MIN_INIT_PACKET_SZ 1200
25
26/* Our stream code makes an assumption that packet size is smaller than the
27 * maximum HTTP/3 DATA frame size we can generate.
28 */
29#define IQUIC_MAX_OUT_PACKET_SZ ((1u << 14) - 1)
30
31#endif
32