]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: tools: Implement net_addr_type_is_quic()
authorOlivier Houchard <ohouchard@haproxy.com>
Wed, 8 Apr 2026 16:22:50 +0000 (18:22 +0200)
committerOlivier Houchard <cognet@ci0.org>
Wed, 8 Apr 2026 16:41:48 +0000 (18:41 +0200)
Implement net_addr_type_is_quic(), that returns 1 if the provided
net_addr_type looks like it is using QUIC, and 0 otherwise.

include/haproxy/tools.h

index e6a0edfc236da203b33878f0211aeec7f538b36a..067d515c9108f5201147356a4343daf9dbf29f6a 100644 (file)
@@ -1545,4 +1545,10 @@ void ha_memset_s(void *s, int c, size_t n);
 
 void chunk_append_thread_ctx(struct buffer *output, const struct thread_exec_ctx *ctx, const char *pfx, const char *sfx);
 
+static inline int net_addr_type_is_quic(struct net_addr_type *type)
+{
+       return type->proto_type == PROTO_TYPE_DGRAM &&
+              type->xprt_type == PROTO_TYPE_STREAM;
+}
+
 #endif /* _HAPROXY_TOOLS_H */