summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilly Tarreau <w@1wt.eu>2020-09-02 13:48:45 +0200
committerWilly Tarreau <w@1wt.eu>2020-09-02 16:37:47 +0200
commitb9a7df6f5d94c570e0ed14bfa351a80d936e00fa (patch)
tree412132be7e2c641f9ed49d5597750a28376a7d96
parent189cb1395c5de28a55154d48ac7a340839537c4d (diff)
downloadhaproxy-b9a7df6f5d94c570e0ed14bfa351a80d936e00fa.tar.gz
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.
-rw-r--r--include/haproxy/protocol-t.h3
1 files changed, 2 insertions, 1 deletions
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 */