MINOR: protocols: register the ->add function and stop calling them directly
cfgparse has no business directly calling each individual protocol's 'add'
function to create a listener. Now that they're all registered, better
perform a protocol lookup on the family and have a standard ->add method
for all of them.
diff --git a/include/proto/proto_tcp.h b/include/proto/proto_tcp.h
index 94a8415..5241e7c 100644
--- a/include/proto/proto_tcp.h
+++ b/include/proto/proto_tcp.h
@@ -28,8 +28,6 @@
#include <proto/stick_table.h>
int tcp_bind_socket(int fd, int flags, struct sockaddr_storage *local, struct sockaddr_storage *remote);
-void tcpv4_add_listener(struct listener *listener, int port);
-void tcpv6_add_listener(struct listener *listener, int port);
int tcp_pause_listener(struct listener *l);
int tcp_connect_server(struct connection *conn, int data, int delack);
int tcp_connect_probe(struct connection *conn);
diff --git a/include/proto/proto_uxst.h b/include/proto/proto_uxst.h
index 63de24f..11aed98 100644
--- a/include/proto/proto_uxst.h
+++ b/include/proto/proto_uxst.h
@@ -26,7 +26,6 @@
#include <types/stream.h>
#include <types/task.h>
-void uxst_add_listener(struct listener *listener, int port);
int uxst_pause_listener(struct listener *l);
int uxst_get_src(int fd, struct sockaddr *sa, socklen_t salen, int dir);
int uxst_get_dst(int fd, struct sockaddr *sa, socklen_t salen, int dir);
diff --git a/include/types/protocol.h b/include/types/protocol.h
index 6a4986f..9480c18 100644
--- a/include/types/protocol.h
+++ b/include/types/protocol.h
@@ -61,6 +61,7 @@
int (*get_dst)(int fd, struct sockaddr *, socklen_t, int dir); /* syscall used to retrieve dst addr */
int (*drain)(int fd); /* indicates whether we can safely close the fd */
int (*pause)(struct listener *l); /* temporarily pause this listener for a soft restart */
+ void (*add)(struct listener *l, int port); /* add a listener for this protocol and port */
struct list listeners; /* list of listeners using this protocol */
int nb_listeners; /* number of listeners */