]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: protocols: Add a new proto_is_quic() function
authorOlivier Houchard <ohouchard@haproxy.com>
Thu, 19 Mar 2026 14:36:25 +0000 (15:36 +0100)
committerOlivier Houchard <cognet@ci0.org>
Thu, 26 Mar 2026 14:09:13 +0000 (15:09 +0100)
Add a new function, proto_is_quic(), that returns true if the protocol
is QUIC (using a datagram socket but provides a stream transport).

include/haproxy/protocol.h

index 7b14e1581995f6f8752f397a3539be8feb0520bc..beb0632e37951881121e1c098e029dd5a4ca3427 100644 (file)
@@ -124,6 +124,12 @@ static inline int real_family(int ss_family)
        return fam ? fam->real_family : AF_UNSPEC;
 }
 
+static inline int proto_is_quic(const struct protocol *proto)
+{
+       return (proto->proto_type == PROTO_TYPE_DGRAM &&
+               proto->xprt_type == PROTO_TYPE_STREAM);
+}
+
 #endif /* _HAPROXY_PROTOCOL_H */
 
 /*