mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2026-05-04 20:46:11 +02:00
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
This commit is contained in:
parent
823bda0eb7
commit
e5733234f6
27
Makefile
27
Makefile
@ -464,27 +464,10 @@ BUILD_FEATURES := $(foreach opt,$(patsubst USE_%,%,$(use_opts)),$(if $(USE_$(opt
|
||||
# possibly be unused though)
|
||||
OPTIONS_CFLAGS += $(foreach opt,$(use_opts),$(if $($(opt)),-D$(opt),))
|
||||
|
||||
ifneq ($(USE_LINUX_SPLICE),)
|
||||
OPTIONS_CFLAGS += -DCONFIG_HAP_LINUX_SPLICE
|
||||
endif
|
||||
|
||||
ifneq ($(USE_TPROXY),)
|
||||
OPTIONS_CFLAGS += -DTPROXY
|
||||
endif
|
||||
|
||||
ifneq ($(USE_LINUX_TPROXY),)
|
||||
OPTIONS_CFLAGS += -DCONFIG_HAP_LINUX_TPROXY
|
||||
endif
|
||||
|
||||
ifneq ($(USE_LIBCRYPT),)
|
||||
OPTIONS_CFLAGS += -DCONFIG_HAP_CRYPT
|
||||
OPTIONS_LDFLAGS += -lcrypt
|
||||
endif
|
||||
|
||||
ifneq ($(USE_CRYPT_H),)
|
||||
OPTIONS_CFLAGS += -DNEED_CRYPT_H
|
||||
endif
|
||||
|
||||
ifneq ($(USE_SLZ),)
|
||||
# Use SLZ_INC and SLZ_LIB to force path to zlib.h and libz.{a,so} if needed.
|
||||
SLZ_INC =
|
||||
@ -502,38 +485,29 @@ OPTIONS_LDFLAGS += $(if $(ZLIB_LIB),-L$(ZLIB_LIB)) -lz
|
||||
endif
|
||||
|
||||
ifneq ($(USE_POLL),)
|
||||
OPTIONS_CFLAGS += -DENABLE_POLL
|
||||
OPTIONS_OBJS += src/ev_poll.o
|
||||
endif
|
||||
|
||||
ifneq ($(USE_EPOLL),)
|
||||
OPTIONS_CFLAGS += -DENABLE_EPOLL
|
||||
OPTIONS_OBJS += src/ev_epoll.o
|
||||
endif
|
||||
|
||||
ifneq ($(USE_KQUEUE),)
|
||||
OPTIONS_CFLAGS += -DENABLE_KQUEUE
|
||||
OPTIONS_OBJS += src/ev_kqueue.o
|
||||
endif
|
||||
|
||||
ifneq ($(USE_EVPORTS),)
|
||||
OPTIONS_CFLAGS += -DENABLE_EVPORTS
|
||||
OPTIONS_OBJS += src/ev_evports.o
|
||||
endif
|
||||
|
||||
ifneq ($(USE_VSYSCALL),)
|
||||
OPTIONS_OBJS += src/i386-linux-vsys.o
|
||||
OPTIONS_CFLAGS += -DCONFIG_HAP_LINUX_VSYSCALL
|
||||
endif
|
||||
|
||||
ifneq ($(ASSUME_SPLICE_WORKS),)
|
||||
OPTIONS_CFLAGS += -DASSUME_SPLICE_WORKS
|
||||
endif
|
||||
|
||||
ifneq ($(USE_NETFILTER),)
|
||||
OPTIONS_CFLAGS += -DNETFILTER
|
||||
endif
|
||||
|
||||
ifneq ($(USE_REGPARM),)
|
||||
OPTIONS_CFLAGS += -DCONFIG_REGPARM=3
|
||||
endif
|
||||
@ -755,7 +729,6 @@ COPTS += -finstrument-functions
|
||||
endif
|
||||
|
||||
ifneq ($(USE_NS),)
|
||||
OPTIONS_CFLAGS += -DCONFIG_HAP_NS
|
||||
OPTIONS_OBJS += src/namespace.o
|
||||
endif
|
||||
|
||||
|
||||
@ -42,7 +42,7 @@
|
||||
#endif
|
||||
|
||||
#if defined(USE_MY_ACCEPT4) || (!defined(SYS_ACCEPT4) && !defined(__NR_accept4))
|
||||
#if defined(CONFIG_HAP_LINUX_VSYSCALL) && defined(__linux__) && defined(__i386__)
|
||||
#if defined(USE_LINUX_VSYSCALL) && defined(__linux__) && defined(__i386__)
|
||||
/* The syscall is redefined somewhere else */
|
||||
extern int accept4(int sockfd, struct sockaddr *addr, socklen_t *addrlen, int flags);
|
||||
#elif ACCEPT4_USE_SOCKETCALL
|
||||
|
||||
@ -90,7 +90,7 @@ typedef struct { } empty_t;
|
||||
/* On Linux 2.4 and above, MSG_TRUNC can be used on TCP sockets to drop any
|
||||
* pending data. Let's rely on NETFILTER to detect if this is supported.
|
||||
*/
|
||||
#ifdef NETFILTER
|
||||
#ifdef USE_NETFILTER
|
||||
#define MSG_TRUNC_CLEARS_INPUT
|
||||
#endif
|
||||
|
||||
@ -117,14 +117,14 @@ typedef struct { } empty_t;
|
||||
#define TIMER_INVALID ((timer_t)(unsigned long)(0xfffffffful))
|
||||
#endif
|
||||
|
||||
#if defined(TPROXY) && defined(NETFILTER)
|
||||
#if defined(USE_TPROXY) && defined(USE_NETFILTER)
|
||||
#include <linux/types.h>
|
||||
#include <linux/netfilter_ipv6.h>
|
||||
#include <linux/netfilter_ipv4.h>
|
||||
#endif
|
||||
|
||||
/* On Linux, IP_TRANSPARENT and/or IP_FREEBIND generally require a kernel patch */
|
||||
#if defined(CONFIG_HAP_LINUX_TPROXY)
|
||||
#if defined(USE_LINUX_TPROXY)
|
||||
#if !defined(IP_FREEBIND)
|
||||
#define IP_FREEBIND 15
|
||||
#endif /* !IP_FREEBIND */
|
||||
@ -134,7 +134,7 @@ typedef struct { } empty_t;
|
||||
#if !defined(IPV6_TRANSPARENT)
|
||||
#define IPV6_TRANSPARENT 75
|
||||
#endif /* !IPV6_TRANSPARENT */
|
||||
#endif /* CONFIG_HAP_LINUX_TPROXY */
|
||||
#endif /* USE_LINUX_TPROXY */
|
||||
|
||||
#if defined(IP_FREEBIND) \
|
||||
|| defined(IP_BINDANY) \
|
||||
@ -148,9 +148,9 @@ typedef struct { } empty_t;
|
||||
/* We'll try to enable SO_REUSEPORT on Linux 2.4 and 2.6 if not defined.
|
||||
* There are two families of values depending on the architecture. Those
|
||||
* are at least valid on Linux 2.4 and 2.6, reason why we'll rely on the
|
||||
* NETFILTER define.
|
||||
* USE_NETFILTER define.
|
||||
*/
|
||||
#if !defined(SO_REUSEPORT) && defined(NETFILTER)
|
||||
#if !defined(SO_REUSEPORT) && defined(USE_NETFILTER)
|
||||
#if (SO_REUSEADDR == 2)
|
||||
#define SO_REUSEPORT 15
|
||||
#elif (SO_REUSEADDR == 0x0004)
|
||||
|
||||
@ -29,7 +29,7 @@
|
||||
#ifndef _COMMON_EPOLL_H
|
||||
#define _COMMON_EPOLL_H
|
||||
|
||||
#if defined (__linux__) && defined(ENABLE_EPOLL)
|
||||
#if defined (__linux__) && defined(USE_EPOLL)
|
||||
|
||||
#ifndef USE_MY_EPOLL
|
||||
#include <sys/epoll.h>
|
||||
@ -70,7 +70,7 @@ struct epoll_event {
|
||||
} data;
|
||||
};
|
||||
|
||||
#if defined(CONFIG_HAP_LINUX_VSYSCALL) && defined(__linux__) && defined(__i386__)
|
||||
#if defined(USE_LINUX_VSYSCALL) && defined(__linux__) && defined(__i386__)
|
||||
/* Those are our self-defined functions */
|
||||
extern int epoll_create(int size);
|
||||
extern int epoll_ctl(int epfd, int op, int fd, struct epoll_event * event);
|
||||
@ -94,7 +94,7 @@ static inline _syscall4 (int, epoll_wait, int, epfd, struct epoll_event *, event
|
||||
|
||||
#endif /* USE_MY_EPOLL */
|
||||
|
||||
#endif /* __linux__ && ENABLE_EPOLL */
|
||||
#endif /* __linux__ && USE_EPOLL */
|
||||
|
||||
#endif /* _COMMON_EPOLL_H */
|
||||
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <ebistree.h>
|
||||
|
||||
#ifdef CONFIG_HAP_NS
|
||||
#ifdef USE_NS
|
||||
|
||||
struct netns_entry
|
||||
{
|
||||
@ -28,6 +28,6 @@ static inline int my_socketat(const struct netns_entry *ns, int domain, int type
|
||||
return socket(domain, type, protocol);
|
||||
}
|
||||
|
||||
#endif /* CONFIG_HAP_NS */
|
||||
#endif /* USE_NS */
|
||||
|
||||
#endif /* _NAMESPACE_H */
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
#ifndef _COMMON_SPLICE_H
|
||||
#define _COMMON_SPLICE_H
|
||||
|
||||
#if defined (__linux__) && defined(CONFIG_HAP_LINUX_SPLICE)
|
||||
#if defined (__linux__) && defined(USE_LINUX_SPLICE)
|
||||
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
@ -49,7 +49,7 @@
|
||||
|
||||
#if defined(USE_MY_SPLICE)
|
||||
|
||||
#if defined(CONFIG_HAP_LINUX_VSYSCALL) && defined(__linux__) && defined(__i386__)
|
||||
#if defined(USE_LINUX_VSYSCALL) && defined(__linux__) && defined(__i386__)
|
||||
/* The syscall is redefined somewhere else */
|
||||
extern int splice(int fdin, loff_t *off_in, int fdout, loff_t *off_out, size_t len, unsigned long flags);
|
||||
#else
|
||||
@ -71,7 +71,7 @@ static inline _syscall6(int, splice, int, fdin, loff_t *, off_in, int, fdout, lo
|
||||
|
||||
#endif /* USE_MY_SPLICE */
|
||||
|
||||
#endif /* __linux__ && CONFIG_HAP_LINUX_SPLICE */
|
||||
#endif /* __linux__ && USE_LINUX_SPLICE */
|
||||
|
||||
#endif /* _COMMON_SPLICE_H */
|
||||
|
||||
|
||||
10
src/auth.c
10
src/auth.c
@ -10,15 +10,15 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_HAP_CRYPT
|
||||
#ifdef USE_LIBCRYPT
|
||||
/* This is to have crypt() defined on Linux */
|
||||
#define _GNU_SOURCE
|
||||
|
||||
#ifdef NEED_CRYPT_H
|
||||
#ifdef USE_CRYPT_H
|
||||
/* some platforms such as Solaris need this */
|
||||
#include <crypt.h>
|
||||
#endif
|
||||
#endif /* CONFIG_HAP_CRYPT */
|
||||
#endif /* USE_LIBCRYPT */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@ -39,7 +39,7 @@
|
||||
|
||||
struct userlist *userlist = NULL; /* list of all existing userlists */
|
||||
|
||||
#ifdef CONFIG_HAP_CRYPT
|
||||
#ifdef USE_LIBCRYPT
|
||||
#ifdef HA_HAVE_CRYPT_R
|
||||
/* context for crypt_r() */
|
||||
static THREAD_LOCAL struct crypt_data crypt_data = { .initialized = 0 };
|
||||
@ -256,7 +256,7 @@ check_user(struct userlist *ul, const char *user, const char *pass)
|
||||
#endif
|
||||
|
||||
if (!(u->flags & AU_O_INSECURE)) {
|
||||
#ifdef CONFIG_HAP_CRYPT
|
||||
#ifdef USE_LIBCRYPT
|
||||
#ifdef HA_HAVE_CRYPT_R
|
||||
ep = crypt_r(pass, u->pass, &crypt_data);
|
||||
#else
|
||||
|
||||
@ -3320,7 +3320,7 @@ stats_error_parsing:
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
#ifdef TPROXY
|
||||
#ifdef USE_TPROXY
|
||||
else if (!strcmp(args[0], "transparent")) {
|
||||
/* enable transparent proxy connections */
|
||||
curproxy->options |= PR_O_TRANSP;
|
||||
|
||||
@ -10,15 +10,15 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_HAP_CRYPT
|
||||
#ifdef USE_LIBCRYPT
|
||||
/* This is to have crypt() defined on Linux */
|
||||
#define _GNU_SOURCE
|
||||
|
||||
#ifdef NEED_CRYPT_H
|
||||
#ifdef USE_CRYPT_H
|
||||
/* some platforms such as Solaris need this */
|
||||
#include <crypt.h>
|
||||
#endif
|
||||
#endif /* CONFIG_HAP_CRYPT */
|
||||
#endif /* USE_LIBCRYPT */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@ -1505,7 +1505,7 @@ void free_email_alert(struct proxy *p)
|
||||
int
|
||||
cfg_parse_netns(const char *file, int linenum, char **args, int kwm)
|
||||
{
|
||||
#ifdef CONFIG_HAP_NS
|
||||
#ifdef USE_NS
|
||||
const char *err;
|
||||
const char *item = args[0];
|
||||
|
||||
@ -1701,7 +1701,7 @@ cfg_parse_users(const char *file, int linenum, char **args, int kwm)
|
||||
|
||||
while (*args[cur_arg]) {
|
||||
if (!strcmp(args[cur_arg], "password")) {
|
||||
#ifdef CONFIG_HAP_CRYPT
|
||||
#ifdef USE_LIBCRYPT
|
||||
if (!crypt("", args[cur_arg + 1])) {
|
||||
ha_alert("parsing [%s:%d]: the encrypted password used for user '%s' is not supported by crypt(3).\n",
|
||||
file, linenum, newuser->user);
|
||||
|
||||
@ -1654,7 +1654,7 @@ static int _getsocks(char **args, char *payload, struct appctx *appctx, void *pr
|
||||
memcpy(&tmpfd[i % MAX_SEND_FD], &l->fd, sizeof(l->fd));
|
||||
if (!l->netns)
|
||||
tmpbuf[curoff++] = 0;
|
||||
#ifdef CONFIG_HAP_NS
|
||||
#ifdef USE_NS
|
||||
else {
|
||||
char *name = l->netns->node.key;
|
||||
unsigned char len = l->netns->name_len;
|
||||
|
||||
@ -694,7 +694,7 @@ int conn_recv_proxy(struct connection *conn, int flag)
|
||||
goto bad_header;
|
||||
break;
|
||||
}
|
||||
#ifdef CONFIG_HAP_NS
|
||||
#ifdef USE_NS
|
||||
case PP2_TYPE_NETNS: {
|
||||
const struct netns_entry *ns;
|
||||
ns = netns_store_lookup((char*)tlv_packet->value, tlv_len);
|
||||
@ -1228,7 +1228,7 @@ int make_proxy_line_v2(char *buf, int buf_len, struct server *srv, struct connec
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_HAP_NS
|
||||
#ifdef USE_NS
|
||||
if (remote && (remote->proxy_netns)) {
|
||||
if ((buf_len - ret) < sizeof(struct tlv))
|
||||
return 0;
|
||||
|
||||
8
src/fd.c
8
src/fd.c
@ -151,7 +151,7 @@
|
||||
#include <sys/types.h>
|
||||
#include <sys/resource.h>
|
||||
|
||||
#if defined(ENABLE_POLL)
|
||||
#if defined(USE_POLL)
|
||||
#include <poll.h>
|
||||
#include <errno.h>
|
||||
#endif
|
||||
@ -477,7 +477,7 @@ void my_closefrom(int start)
|
||||
closefrom(start);
|
||||
}
|
||||
|
||||
#elif defined(ENABLE_POLL)
|
||||
#elif defined(USE_POLL)
|
||||
/* This is a portable implementation of closefrom(). It closes all open file
|
||||
* descriptors starting at <start> and above. It relies on the fact that poll()
|
||||
* will return POLLNVAL for each invalid (hence close) file descriptor passed
|
||||
@ -534,7 +534,7 @@ void my_closefrom(int start)
|
||||
}
|
||||
}
|
||||
|
||||
#else // defined(ENABLE_POLL)
|
||||
#else // defined(USE_POLL)
|
||||
|
||||
/* This is a portable implementation of closefrom(). It closes all open file
|
||||
* descriptors starting at <start> and above. This is a naive version for use
|
||||
@ -556,7 +556,7 @@ void my_closefrom(int start)
|
||||
while (start < nbfds)
|
||||
close(start++);
|
||||
}
|
||||
#endif // defined(ENABLE_POLL)
|
||||
#endif // defined(USE_POLL)
|
||||
|
||||
/* disable the specified poller */
|
||||
void disable_poller(const char *poller_name)
|
||||
|
||||
@ -502,19 +502,19 @@ static void usage(char *name)
|
||||
" -N sets the default, per-proxy maximum # of connections (%d)\n"
|
||||
" -L set local peer name (default to hostname)\n"
|
||||
" -p writes pids of all children to this file\n"
|
||||
#if defined(ENABLE_EPOLL)
|
||||
#if defined(USE_EPOLL)
|
||||
" -de disables epoll() usage even when available\n"
|
||||
#endif
|
||||
#if defined(ENABLE_KQUEUE)
|
||||
#if defined(USE_KQUEUE)
|
||||
" -dk disables kqueue() usage even when available\n"
|
||||
#endif
|
||||
#if defined(ENABLE_EVPORTS)
|
||||
#if defined(USE_EVPORTS)
|
||||
" -dv disables event ports usage even when available\n"
|
||||
#endif
|
||||
#if defined(ENABLE_POLL)
|
||||
#if defined(USE_POLL)
|
||||
" -dp disables poll() usage even when available\n"
|
||||
#endif
|
||||
#if defined(CONFIG_HAP_LINUX_SPLICE)
|
||||
#if defined(USE_LINUX_SPLICE)
|
||||
" -dS disables splice usage (broken on old kernels)\n"
|
||||
#endif
|
||||
#if defined(USE_GETADDRINFO)
|
||||
@ -1394,19 +1394,19 @@ static void init(int argc, char **argv)
|
||||
vars_init(&global.vars, SCOPE_PROC);
|
||||
|
||||
global.tune.options |= GTUNE_USE_SELECT; /* select() is always available */
|
||||
#if defined(ENABLE_POLL)
|
||||
#if defined(USE_POLL)
|
||||
global.tune.options |= GTUNE_USE_POLL;
|
||||
#endif
|
||||
#if defined(ENABLE_EPOLL)
|
||||
#if defined(USE_EPOLL)
|
||||
global.tune.options |= GTUNE_USE_EPOLL;
|
||||
#endif
|
||||
#if defined(ENABLE_KQUEUE)
|
||||
#if defined(USE_KQUEUE)
|
||||
global.tune.options |= GTUNE_USE_KQUEUE;
|
||||
#endif
|
||||
#if defined(ENABLE_EVPORTS)
|
||||
#if defined(USE_EVPORTS)
|
||||
global.tune.options |= GTUNE_USE_EVPORTS;
|
||||
#endif
|
||||
#if defined(CONFIG_HAP_LINUX_SPLICE)
|
||||
#if defined(USE_LINUX_SPLICE)
|
||||
global.tune.options |= GTUNE_USE_SPLICE;
|
||||
#endif
|
||||
#if defined(USE_GETADDRINFO)
|
||||
@ -1438,23 +1438,23 @@ static void init(int argc, char **argv)
|
||||
display_build_opts();
|
||||
exit(0);
|
||||
}
|
||||
#if defined(ENABLE_EPOLL)
|
||||
#if defined(USE_EPOLL)
|
||||
else if (*flag == 'd' && flag[1] == 'e')
|
||||
global.tune.options &= ~GTUNE_USE_EPOLL;
|
||||
#endif
|
||||
#if defined(ENABLE_POLL)
|
||||
#if defined(USE_POLL)
|
||||
else if (*flag == 'd' && flag[1] == 'p')
|
||||
global.tune.options &= ~GTUNE_USE_POLL;
|
||||
#endif
|
||||
#if defined(ENABLE_KQUEUE)
|
||||
#if defined(USE_KQUEUE)
|
||||
else if (*flag == 'd' && flag[1] == 'k')
|
||||
global.tune.options &= ~GTUNE_USE_KQUEUE;
|
||||
#endif
|
||||
#if defined(ENABLE_EVPORTS)
|
||||
#if defined(USE_EVPORTS)
|
||||
else if (*flag == 'd' && flag[1] == 'v')
|
||||
global.tune.options &= ~GTUNE_USE_EVPORTS;
|
||||
#endif
|
||||
#if defined(CONFIG_HAP_LINUX_SPLICE)
|
||||
#if defined(USE_LINUX_SPLICE)
|
||||
else if (*flag == 'd' && flag[1] == 'S')
|
||||
global.tune.options &= ~GTUNE_USE_SPLICE;
|
||||
#endif
|
||||
@ -1770,7 +1770,7 @@ static void init(int argc, char **argv)
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef CONFIG_HAP_NS
|
||||
#ifdef USE_NS
|
||||
err_code |= netns_init();
|
||||
if (err_code & (ERR_ABORT|ERR_FATAL)) {
|
||||
ha_alert("Failed to initialize namespace support.\n");
|
||||
|
||||
@ -2273,7 +2273,7 @@ static size_t h1_snd_buf(struct conn_stream *cs, struct buffer *buf, size_t coun
|
||||
return total;
|
||||
}
|
||||
|
||||
#if defined(CONFIG_HAP_LINUX_SPLICE)
|
||||
#if defined(USE_LINUX_SPLICE)
|
||||
/* Send and get, using splicing */
|
||||
static int h1_rcv_pipe(struct conn_stream *cs, struct pipe *pipe, unsigned int count)
|
||||
{
|
||||
@ -2379,7 +2379,7 @@ static const struct mux_ops mux_h1_ops = {
|
||||
.used_streams = h1_used_streams,
|
||||
.rcv_buf = h1_rcv_buf,
|
||||
.snd_buf = h1_snd_buf,
|
||||
#if defined(CONFIG_HAP_LINUX_SPLICE)
|
||||
#if defined(USE_LINUX_SPLICE)
|
||||
.rcv_pipe = h1_rcv_pipe,
|
||||
.snd_pipe = h1_snd_pipe,
|
||||
#endif
|
||||
|
||||
@ -297,7 +297,7 @@ static int mux_pt_unsubscribe(struct conn_stream *cs, int event_type, void *para
|
||||
return (cs->conn->xprt->unsubscribe(cs->conn, cs->conn->xprt_ctx, event_type, param));
|
||||
}
|
||||
|
||||
#if defined(CONFIG_HAP_LINUX_SPLICE)
|
||||
#if defined(USE_LINUX_SPLICE)
|
||||
/* Send and get, using splicing */
|
||||
static int mux_pt_rcv_pipe(struct conn_stream *cs, struct pipe *pipe, unsigned int count)
|
||||
{
|
||||
@ -325,7 +325,7 @@ const struct mux_ops mux_pt_ops = {
|
||||
.snd_buf = mux_pt_snd_buf,
|
||||
.subscribe = mux_pt_subscribe,
|
||||
.unsubscribe = mux_pt_unsubscribe,
|
||||
#if defined(CONFIG_HAP_LINUX_SPLICE)
|
||||
#if defined(USE_LINUX_SPLICE)
|
||||
.rcv_pipe = mux_pt_rcv_pipe,
|
||||
.snd_pipe = mux_pt_snd_pipe,
|
||||
#endif
|
||||
|
||||
@ -246,7 +246,7 @@ static int create_server_socket(struct connection *conn)
|
||||
{
|
||||
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 @@ int tcp_get_dst(int fd, struct sockaddr *sa, socklen_t salen, int dir)
|
||||
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 @@ static int tcp_find_compatible_fd(struct listener *l)
|
||||
(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 @@ static int bind_parse_interface(char **args, int cur_arg, struct proxy *px, stru
|
||||
}
|
||||
#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 @@ static struct bind_kw_list bind_kws = { "TCP", { }, {
|
||||
{ "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*/
|
||||
|
||||
@ -77,7 +77,7 @@ const struct cfg_opt cfg_opts[] =
|
||||
{ "nolinger", PR_O_TCP_NOLING, PR_CAP_FE | PR_CAP_BE, 0, 0 },
|
||||
{ "persist", PR_O_PERSIST, PR_CAP_BE, 0, 0 },
|
||||
{ "srvtcpka", PR_O_TCP_SRV_KA, PR_CAP_BE, 0, 0 },
|
||||
#ifdef TPROXY
|
||||
#ifdef USE_TPROXY
|
||||
{ "transparent", PR_O_TRANSP, PR_CAP_BE, 0, 0 },
|
||||
#else
|
||||
{ "transparent", 0, 0, 0, 0 },
|
||||
@ -89,7 +89,7 @@ const struct cfg_opt cfg_opts[] =
|
||||
/* proxy->options2 */
|
||||
const struct cfg_opt cfg_opts2[] =
|
||||
{
|
||||
#ifdef CONFIG_HAP_LINUX_SPLICE
|
||||
#ifdef USE_LINUX_SPLICE
|
||||
{ "splice-request", PR_O2_SPLIC_REQ, PR_CAP_FE|PR_CAP_BE, 0, 0 },
|
||||
{ "splice-response", PR_O2_SPLIC_RTR, PR_CAP_FE|PR_CAP_BE, 0, 0 },
|
||||
{ "splice-auto", PR_O2_SPLIC_AUT, PR_CAP_FE|PR_CAP_BE, 0, 0 },
|
||||
|
||||
@ -42,7 +42,7 @@
|
||||
#include <types/global.h>
|
||||
|
||||
|
||||
#if defined(CONFIG_HAP_LINUX_SPLICE)
|
||||
#if defined(USE_LINUX_SPLICE)
|
||||
#include <common/splice.h>
|
||||
|
||||
/* A pipe contains 16 segments max, and it's common to see segments of 1448 bytes
|
||||
@ -237,7 +237,7 @@ int raw_sock_from_pipe(struct connection *conn, void *xprt_ctx, struct pipe *pip
|
||||
return done;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_HAP_LINUX_SPLICE */
|
||||
#endif /* USE_LINUX_SPLICE */
|
||||
|
||||
|
||||
/* Receive up to <count> bytes from connection <conn>'s socket and store them
|
||||
@ -435,7 +435,7 @@ static struct xprt_ops raw_sock = {
|
||||
.rcv_buf = raw_sock_to_buf,
|
||||
.subscribe = raw_sock_subscribe,
|
||||
.unsubscribe = raw_sock_unsubscribe,
|
||||
#if defined(CONFIG_HAP_LINUX_SPLICE)
|
||||
#if defined(USE_LINUX_SPLICE)
|
||||
.rcv_pipe = raw_sock_to_pipe,
|
||||
.snd_pipe = raw_sock_from_pipe,
|
||||
#endif
|
||||
|
||||
@ -454,7 +454,7 @@ static int srv_parse_id(char **args, int *cur_arg, struct proxy *curproxy, struc
|
||||
static int srv_parse_namespace(char **args, int *cur_arg,
|
||||
struct proxy *curproxy, struct server *newsrv, char **err)
|
||||
{
|
||||
#ifdef CONFIG_HAP_NS
|
||||
#ifdef USE_NS
|
||||
char *arg;
|
||||
|
||||
arg = args[*cur_arg + 1];
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user