MINOR: protocols: add a new protocol type selector

The protocol selection is currently performed based on the family,
control type and socket type. But this is often not enough, as both
only provide DGRAM or STREAM, leaving few variants. Protocols like
SCTP for example might be indistinguishable from TCP here. Same goes
for TCP extensions like MPTCP.

This commit introduces a new enum proto_type that is placed in each
and every protocol definition, that will usually more or less match
the sock_type, but being an enum, will support additional values.
diff --git a/include/haproxy/protocol-t.h b/include/haproxy/protocol-t.h
index 7ce73db..895ad3b 100644
--- a/include/haproxy/protocol-t.h
+++ b/include/haproxy/protocol-t.h
@@ -48,6 +48,13 @@
 # error "Can't build on the target system, AF_CUST_MAX overflow"
 #endif
 
+/* socket-level protocol types, used for protocol selection */
+enum proto_type {
+	PROTO_TYPE_STREAM,      /* streaming protocol (like TCP) */
+	PROTO_TYPE_DGRAM,       /* datagram protocol (like UDP) */
+	PROTO_NUM_TYPES         /* must be the last one */
+};
+
 /* max length of a protocol name, including trailing zero */
 #define PROTO_NAME_LEN 16
 
@@ -83,6 +90,7 @@
 	char name[PROTO_NAME_LEN];			/* protocol name, zero-terminated */
 	struct proto_fam *fam;                          /* protocol family */
 	int ctrl_type;                                  /* control layer type (SOCK_STREAM/SOCK_DGRAM) */
+	enum proto_type proto_type;                     /* protocol type (PROTO_TYPE_*) */
 	int sock_type;					/* socket type, as passed to socket()     */
 	int sock_prot;					/* socket protocol, as passed to socket() */
 
diff --git a/src/proto_quic.c b/src/proto_quic.c
index 58679eb..1aa3e69 100644
--- a/src/proto_quic.c
+++ b/src/proto_quic.c
@@ -78,6 +78,7 @@
 	.fam            = &proto_fam_inet4,
 
 	/* socket layer */
+	.proto_type     = PROTO_TYPE_DGRAM,
 	.sock_type      = SOCK_DGRAM,
 	.sock_prot      = IPPROTO_UDP,
 	.rx_enable      = sock_enable,
@@ -115,6 +116,7 @@
 	.fam            = &proto_fam_inet6,
 
 	/* socket layer */
+	.proto_type     = PROTO_TYPE_DGRAM,
 	.sock_type      = SOCK_DGRAM,
 	.sock_prot      = IPPROTO_UDP,
 	.rx_enable      = sock_enable,
diff --git a/src/proto_sockpair.c b/src/proto_sockpair.c
index 7d4f7ee..c63f02a 100644
--- a/src/proto_sockpair.c
+++ b/src/proto_sockpair.c
@@ -87,6 +87,7 @@
 	.fam            = &proto_fam_sockpair,
 
 	/* socket layer */
+	.proto_type     = PROTO_TYPE_STREAM,
 	.sock_type      = SOCK_STREAM,
 	.sock_prot      = 0,
 	.rx_enable      = sock_enable,
diff --git a/src/proto_tcp.c b/src/proto_tcp.c
index a8b15b2..83d93fd 100644
--- a/src/proto_tcp.c
+++ b/src/proto_tcp.c
@@ -79,6 +79,7 @@
 	.fam            = &proto_fam_inet4,
 
 	/* socket layer */
+	.proto_type     = PROTO_TYPE_STREAM,
 	.sock_type      = SOCK_STREAM,
 	.sock_prot      = IPPROTO_TCP,
 	.rx_enable      = sock_enable,
@@ -121,6 +122,7 @@
 	.fam            = &proto_fam_inet6,
 
 	/* socket layer */
+	.proto_type     = PROTO_TYPE_STREAM,
 	.sock_type      = SOCK_STREAM,
 	.sock_prot      = IPPROTO_TCP,
 	.rx_enable      = sock_enable,
diff --git a/src/proto_udp.c b/src/proto_udp.c
index c5ecfac..d2849c0 100644
--- a/src/proto_udp.c
+++ b/src/proto_udp.c
@@ -67,6 +67,7 @@
 	.fam            = &proto_fam_inet4,
 
 	/* socket layer */
+	.proto_type     = PROTO_TYPE_DGRAM,
 	.sock_type      = SOCK_DGRAM,
 	.sock_prot      = IPPROTO_UDP,
 	.rx_enable      = sock_enable,
@@ -100,6 +101,7 @@
 	.fam            = &proto_fam_inet6,
 
 	/* socket layer */
+	.proto_type     = PROTO_TYPE_DGRAM,
 	.sock_type      = SOCK_DGRAM,
 	.sock_prot      = IPPROTO_UDP,
 	.rx_enable      = sock_enable,
diff --git a/src/proto_uxdg.c b/src/proto_uxdg.c
index b0efe86..6f070b4 100644
--- a/src/proto_uxdg.c
+++ b/src/proto_uxdg.c
@@ -57,6 +57,7 @@
 	.fam            = &proto_fam_unix,
 
 	/* socket layer */
+	.proto_type     = PROTO_TYPE_DGRAM,
 	.sock_type      = SOCK_DGRAM,
 	.sock_prot      = 0,
 	.rx_enable      = sock_enable,
diff --git a/src/proto_uxst.c b/src/proto_uxst.c
index 45cb56f..b615a8e 100644
--- a/src/proto_uxst.c
+++ b/src/proto_uxst.c
@@ -73,6 +73,7 @@
 	.fam            = &proto_fam_unix,
 
 	/* socket layer */
+	.proto_type     = PROTO_TYPE_STREAM,
 	.sock_type      = SOCK_STREAM,
 	.sock_prot      = 0,
 	.rx_enable      = sock_enable,