summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorHugo Landau <hlandau@openssl.org>2023-06-06 16:25:10 +0100
committerPauli <pauli@openssl.org>2023-07-17 08:17:57 +1000
commit0911cb4a072f55b5f982635faeaa7a992a14181f (patch)
tree6dbf8a1cf2dcdb66c6c042bbd49e30df28f62c4a /include
parent7e3fa44f2445b5cbf6a6bf5ebf3cf96a40775951 (diff)
QUIC CONFORMANCE: Packet handling fixes
Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21135)
Diffstat (limited to 'include')
-rw-r--r--include/internal/quic_wire_pkt.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/include/internal/quic_wire_pkt.h b/include/internal/quic_wire_pkt.h
index 5979a5ceb5..966c012274 100644
--- a/include/internal/quic_wire_pkt.h
+++ b/include/internal/quic_wire_pkt.h
@@ -119,6 +119,24 @@ ossl_quic_pkt_type_must_be_last(uint32_t pkt_type)
}
/*
+ * Determine if the packet type has a version field.
+ */
+static ossl_inline ossl_unused int
+ossl_quic_pkt_type_has_version(uint32_t pkt_type)
+{
+ return pkt_type != QUIC_PKT_TYPE_1RTT && pkt_type != QUIC_PKT_TYPE_VERSION_NEG;
+}
+
+/*
+ * Determine if the packet type has a SCID field.
+ */
+static ossl_inline ossl_unused int
+ossl_quic_pkt_type_has_scid(uint32_t pkt_type)
+{
+ return pkt_type != QUIC_PKT_TYPE_1RTT;
+}
+
+/*
* Smallest possible QUIC packet size as per RFC (aside from version negotiation
* packets).
*/