]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: protocol: add a new ->bind() entry to bind the receiver
authorWilly Tarreau <w@1wt.eu>
Wed, 2 Sep 2020 11:48:45 +0000 (13:48 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 16 Sep 2020 20:08:07 +0000 (22:08 +0200)
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

index 07532e126156532d507d551e532bcc2050846d19..f29c9443569c3dc2d0100f99a6850a36a2191e9c 100644 (file)
@@ -30,6 +30,7 @@
 
 /* some pointer types referenced below */
 struct listener;
+struct receiver;
 struct connection;
 
 /*
@@ -71,6 +72,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), 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 */