MINOR: protocol: export protocol definitions

The various protocols were made static since there was no point in
exporting them in the past. Nowadays with QUIC relying on UDP we'll
significantly benefit from UDP being exported and more generally from
being able to declare some functions as being the same as other
protocols'.

In an ideal world it should not be these protocols which should be
exported, but the intermediary levels:
  - socket layer (sock.c only right now), already exported as functions
    but nothing structured at the moment ;
  - family layer (sock_inet, sock_unix, sockpair etc): already structured
    and exported
  - binding layer (the part that relies on the receiver): currently fused
    within the protocol
  - connectiong layer (the part that manipulates connections): currently
    fused within the protocol
  - protocol (connection's control): shouldn't need to be exposed
    ultimately once the elements above are in an easily sharable way.
diff --git a/include/haproxy/proto_sockpair.h b/include/haproxy/proto_sockpair.h
index e012407..bb0256e 100644
--- a/include/haproxy/proto_sockpair.h
+++ b/include/haproxy/proto_sockpair.h
@@ -22,6 +22,7 @@
 #define _HAPROXY_PROTO_SOCKPAIR_H
 
 extern struct proto_fam proto_fam_sockpair;
+extern struct protocol proto_sockpair;
 
 int recv_fd_uxst(int sock);
 int send_fd_uxst(int fd, int send_fd);
diff --git a/include/haproxy/proto_tcp.h b/include/haproxy/proto_tcp.h
index 63bbb57..52566db 100644
--- a/include/haproxy/proto_tcp.h
+++ b/include/haproxy/proto_tcp.h
@@ -28,6 +28,9 @@
 #include <haproxy/listener-t.h>
 #include <haproxy/sample-t.h>
 
+extern struct protocol proto_tcp4;
+extern struct protocol proto_tcp6;
+
 int tcp_bind_socket(int fd, int flags, struct sockaddr_storage *local, struct sockaddr_storage *remote);
 int tcp_connect_server(struct connection *conn, int flags);
 int tcp_is_foreign(int fd, sa_family_t family);
diff --git a/include/haproxy/proto_udp.h b/include/haproxy/proto_udp.h
index 25c1423..7de8413 100644
--- a/include/haproxy/proto_udp.h
+++ b/include/haproxy/proto_udp.h
@@ -1,5 +1,5 @@
 /*
- * include/proto/proto_udp.h
+ * include/haproxy/proto_udp.h
  * This file contains UDP socket protocol definitions.
  *
  * Copyright 2019 HAProxy Technologies, Frédéric Lécaille <flecaille@haproxy.com>
@@ -24,6 +24,9 @@
 #ifndef _PROTO_PROTO_UDP_H
 #define _PROTO_PROTO_UDP_H
 
+extern struct protocol proto_udp4;
+extern struct protocol proto_udp6;
+
 int udp_bind_socket(int fd, int flags, struct sockaddr_storage *local, struct sockaddr_storage *remote);
 
 #endif /* _PROTO_PROTO_UDP_H */
diff --git a/include/haproxy/proto_uxst.h b/include/haproxy/proto_uxst.h
new file mode 100644
index 0000000..77caf3d
--- /dev/null
+++ b/include/haproxy/proto_uxst.h
@@ -0,0 +1,34 @@
+/*
+ * include/haproxy/proto_uxst.h
+ * This file contains UNIX stream socket protocol definitions.
+ *
+ * Copyright (C) 2000-2013 Willy Tarreau - w@1wt.eu
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation, version 2.1
+ * exclusively.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#ifndef _PROTO_PROTO_UXST_H
+#define _PROTO_PROTO_UXST_H
+
+extern struct protocol proto_uxst;
+
+#endif /* _PROTO_PROTO_UXST_H */
+
+/*
+ * Local variables:
+ *  c-indent-level: 8
+ *  c-basic-offset: 8
+ * End:
+ */
diff --git a/src/proto_sockpair.c b/src/proto_sockpair.c
index 2f691f7..9d2fb11 100644
--- a/src/proto_sockpair.c
+++ b/src/proto_sockpair.c
@@ -63,7 +63,7 @@
 };
 
 /* Note: must not be declared <const> as its list will be overwritten */
-static struct protocol proto_sockpair = {
+struct protocol proto_sockpair = {
 	.name = "sockpair",
 	.fam = &proto_fam_sockpair,
 	.ctrl_type = SOCK_STREAM,
diff --git a/src/proto_tcp.c b/src/proto_tcp.c
index eecb299..b3f648e 100644
--- a/src/proto_tcp.c
+++ b/src/proto_tcp.c
@@ -51,7 +51,7 @@
 static void tcp_disable_listener(struct listener *listener);
 
 /* Note: must not be declared <const> as its list will be overwritten */
-static struct protocol proto_tcpv4 = {
+struct protocol proto_tcpv4 = {
 	.name = "tcpv4",
 	.fam = &proto_fam_inet4,
 	.ctrl_type = SOCK_STREAM,
@@ -80,7 +80,7 @@
 INITCALL1(STG_REGISTER, protocol_register, &proto_tcpv4);
 
 /* Note: must not be declared <const> as its list will be overwritten */
-static struct protocol proto_tcpv6 = {
+struct protocol proto_tcpv6 = {
 	.name = "tcpv6",
 	.fam = &proto_fam_inet6,
 	.ctrl_type = SOCK_STREAM,
diff --git a/src/proto_udp.c b/src/proto_udp.c
index 12e25af..a883967 100644
--- a/src/proto_udp.c
+++ b/src/proto_udp.c
@@ -47,7 +47,7 @@
 static void udp_disable_listener(struct listener *listener);
 
 /* Note: must not be declared <const> as its list will be overwritten */
-static struct protocol proto_udp4 = {
+struct protocol proto_udp4 = {
 	.name = "udp4",
 	.fam = &proto_fam_inet4,
 	.ctrl_type = SOCK_DGRAM,
@@ -72,7 +72,7 @@
 INITCALL1(STG_REGISTER, protocol_register, &proto_udp4);
 
 /* Note: must not be declared <const> as its list will be overwritten */
-static struct protocol proto_udp6 = {
+struct protocol proto_udp6 = {
 	.name = "udp6",
 	.fam = &proto_fam_inet6,
 	.ctrl_type = SOCK_DGRAM,
diff --git a/src/proto_uxst.c b/src/proto_uxst.c
index 52e90ae..8cf541d 100644
--- a/src/proto_uxst.c
+++ b/src/proto_uxst.c
@@ -33,6 +33,7 @@
 #include <haproxy/listener.h>
 #include <haproxy/log.h>
 #include <haproxy/protocol.h>
+#include <haproxy/proto_uxst.h>
 #include <haproxy/sock.h>
 #include <haproxy/sock_unix.h>
 #include <haproxy/time.h>
@@ -47,7 +48,7 @@
 static int uxst_suspend_receiver(struct receiver *rx);
 
 /* Note: must not be declared <const> as its list will be overwritten */
-static struct protocol proto_unix = {
+struct protocol proto_uxst = {
 	.name = "unix_stream",
 	.fam = &proto_fam_unix,
 	.ctrl_type = SOCK_STREAM,
@@ -67,11 +68,11 @@
 	.rx_listening = sock_accepting_conn,
 	.default_iocb = &sock_accept_iocb,
 	.connect = &uxst_connect_server,
-	.receivers = LIST_HEAD_INIT(proto_unix.receivers),
+	.receivers = LIST_HEAD_INIT(proto_uxst.receivers),
 	.nb_receivers = 0,
 };
 
-INITCALL1(STG_REGISTER, protocol_register, &proto_unix);
+INITCALL1(STG_REGISTER, protocol_register, &proto_uxst);
 
 /********************************
  * 1) low-level socket functions