From b9a7df6f5d94c570e0ed14bfa351a80d936e00fa Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Wed, 2 Sep 2020 13:48:45 +0200 Subject: MINOR: protocol: add a new ->bind() entry to bind the receiver This will be the function that must be used to bind the receiver. It solely depends on the address family but for now it's simpler to have it per protocol. --- include/haproxy/protocol-t.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/haproxy/protocol-t.h b/include/haproxy/protocol-t.h index 07532e126..fb7ff8bc0 100644 --- a/include/haproxy/protocol-t.h +++ b/include/haproxy/protocol-t.h @@ -30,8 +30,8 @@ /* some pointer types referenced below */ struct listener; +struct receiver; struct connection; - /* * Custom network family for str2sa parsing. Should be ok to do this since * sa_family_t is standardized as an unsigned integer @@ -71,6 +71,7 @@ struct protocol { socklen_t sock_addrlen; /* socket address length, used by bind() */ int l3_addrlen; /* layer3 address length, used by hashes */ void (*accept)(int fd); /* generic accept function */ + int (*bind)(struct receiver *rx, void (*handler)(int fd), void *owner, long tm, char **errmsg); /* bind a receiver */ int (*listen)(struct listener *l, char *errmsg, int errlen); /* start a listener */ int (*enable_all)(struct protocol *proto); /* enable all bound listeners */ int (*disable_all)(struct protocol *proto); /* disable all bound listeners */ -- cgit v1.2.1