CLEANUP: build: rename some build macros to use the USE_* ones
We still have quite a number of build macros which are mapped 1:1 to a
USE_something setting in the makefile but which have a different name.
This patch cleans this up by renaming them to use the USE_something
one, allowing to clean up the makefile and make it more obvious when
reading the code what build option needs to be added.
The following renames were done :
ENABLE_POLL -> USE_POLL
ENABLE_EPOLL -> USE_EPOLL
ENABLE_KQUEUE -> USE_KQUEUE
ENABLE_EVPORTS -> USE_EVPORTS
TPROXY -> USE_TPROXY
NETFILTER -> USE_NETFILTER
NEED_CRYPT_H -> USE_CRYPT_H
CONFIG_HAP_CRYPT -> USE_LIBCRYPT
CONFIG_HAP_NS -> DUSE_NS
CONFIG_HAP_LINUX_SPLICE -> USE_LINUX_SPLICE
CONFIG_HAP_LINUX_TPROXY -> USE_LINUX_TPROXY
CONFIG_HAP_LINUX_VSYSCALL -> USE_LINUX_VSYSCALL
diff --git a/src/proto_tcp.c b/src/proto_tcp.c
index 95068ee..f595029 100644
--- a/src/proto_tcp.c
+++ b/src/proto_tcp.c
@@ -246,7 +246,7 @@
{
const struct netns_entry *ns = NULL;
-#ifdef CONFIG_HAP_NS
+#ifdef USE_NS
if (objt_server(conn->target)) {
if (__objt_server(conn->target)->flags & SRV_F_USE_NS_FROM_PP)
ns = conn->proxy_netns;
@@ -632,7 +632,7 @@
if (ret < 0)
return ret;
-#if defined(TPROXY) && defined(SO_ORIGINAL_DST)
+#if defined(USE_TPROXY) && defined(SO_ORIGINAL_DST)
/* For TPROXY and Netfilter's NAT, we can retrieve the original
* IPv4 address before DNAT/REDIRECT. We must not do that with
* other families because v6-mapped IPv4 addresses are still
@@ -778,7 +778,7 @@
(xfer_sock->options & LI_MANDATORY_FLAGS)) {
if ((xfer_sock->namespace == NULL &&
l->netns == NULL)
-#ifdef CONFIG_HAP_NS
+#ifdef USE_NS
|| (xfer_sock->namespace != NULL &&
l->netns != NULL &&
!strcmp(xfer_sock->namespace,
@@ -1862,7 +1862,7 @@
}
#endif
-#ifdef CONFIG_HAP_NS
+#ifdef USE_NS
/* parse the "namespace" bind keyword */
static int bind_parse_namespace(char **args, int cur_arg, struct proxy *px, struct bind_conf *conf, char **err)
{
@@ -1979,7 +1979,7 @@
{ "v4v6", bind_parse_v4v6, 0 }, /* force socket to bind to IPv4+IPv6 */
{ "v6only", bind_parse_v6only, 0 }, /* force socket to bind to IPv6 only */
#endif
-#ifdef CONFIG_HAP_NS
+#ifdef USE_NS
{ "namespace", bind_parse_namespace, 1 },
#endif
/* the versions with the NULL parse function*/