]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: quic: Add new defintion about DCIDs offsets
authorFrédéric Lécaille <flecaille@haproxy.com>
Wed, 26 Jan 2022 14:47:33 +0000 (15:47 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 27 Jan 2022 15:37:55 +0000 (16:37 +0100)
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.

include/haproxy/xprt_quic-t.h

index 2ae067f11688c09e920b5f5e095026a017175cb7..0ed818a9a3f7daff11cd1547eb2d58911bf94222 100644 (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. */