MINOR: quic: Add new defintion about DCIDs offsets

Define the offsets of the DCIDs from the beginning of a QUIC packets.
Note that they must always be present. As QUIC servers, QUIC haproxy listeners
always use a CID, source CID on the haproxy side, which is a destination ID on the
peer side.
This commit is contained in:
Frédéric Lécaille 2022-01-26 15:47:33 +01:00 committed by Amaury Denoyelle
parent 9cc64e2dba
commit ce521e4f15

View File

@ -67,11 +67,16 @@ typedef unsigned long long ull;
* flags(1), version(4), DCID length(1), DCID(0..20), SCID length(1), SCID(0..20)
*/
#define QUIC_LONG_PACKET_MINLEN 7
/* DCID offset from beginning of a long packet */
#define QUIC_LONG_PACKET_DCID_OFF (1 + sizeof(uint32_t))
/*
* All QUIC packets with short headers are made of at least (in bytes):
* flags(1), DCID(0..20)
*/
#define QUIC_SHORT_PACKET_MINLEN 1
/* DCID offset from beginning of a short packet */
#define QUIC_SHORT_PACKET_DCID_OFF 1
/* Byte 0 of QUIC packets. */
#define QUIC_PACKET_LONG_HEADER_BIT 0x80 /* Long header format if set, short if not. */
#define QUIC_PACKET_FIXED_BIT 0x40 /* Must always be set for all the headers. */