From: Willy Tarreau Date: Thu, 4 Jun 2020 16:38:21 +0000 (+0200) Subject: REORG: include: move peers.h to haproxy/peers{,-t}.h X-Git-Tag: v2.2-dev9~41 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3c2a7c2788bc72fd30663a76096eb5a165734281;p=thirdparty%2Fhaproxy.git REORG: include: move peers.h to haproxy/peers{,-t}.h The cfg_peers external declaration was moved to the main file instead of the type one. A few types were still missing from the proto, causing warnings in the functions prototypes (proxy, stick_table). --- diff --git a/include/types/peers.h b/include/haproxy/peers-t.h similarity index 96% rename from include/types/peers.h rename to include/haproxy/peers-t.h index 33d40ec28b..ea96751840 100644 --- a/include/types/peers.h +++ b/include/haproxy/peers-t.h @@ -1,5 +1,5 @@ /* - * include/types/peers.h + * include/haproxy/peers-t.h * This file defines everything related to peers. * * Copyright 2010 EXCELIANCE, Emeric Brun @@ -19,18 +19,20 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef _TYPES_PEERS_H -#define _TYPES_PEERS_H +#ifndef _HAPROXY_PEERS_T_H +#define _HAPROXY_PEERS_T_H #include #include #include #include +#include + #include +#include #include #include -#include struct shared_table { @@ -131,7 +133,5 @@ struct dcache { size_t max_entries; }; -extern struct peers *cfg_peers; - -#endif /* _TYPES_PEERS_H */ +#endif /* _HAPROXY_PEERS_T_H */ diff --git a/include/proto/peers.h b/include/haproxy/peers.h similarity index 86% rename from include/proto/peers.h rename to include/haproxy/peers.h index 93bb3224c1..10fd8d8951 100644 --- a/include/proto/peers.h +++ b/include/haproxy/peers.h @@ -1,5 +1,5 @@ /* - * include/proto/peers.h + * include/haproxy/peers.h * This file defines function prototypes for peers management. * * Copyright 2010 EXCELIANCE, Emeric Brun @@ -19,15 +19,25 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef _PROTO_PEERS_H -#define _PROTO_PEERS_H +#ifndef _HAPROXY_PEERS_H +#define _HAPROXY_PEERS_H #include #include -#include +#include +#include #include + +#include +#include #include -#include + +extern struct peers *cfg_peers; + +int peers_init_sync(struct peers *peers); +int peers_alloc_dcache(struct peers *peers); +void peers_register_table(struct peers *, struct stktable *table); +void peers_setup_frontend(struct proxy *fe); #if defined(USE_OPENSSL) static inline enum obj_type *peer_session_target(struct peer *p, struct stream *s) @@ -54,10 +64,5 @@ static inline struct xprt_ops *peer_xprt(struct peer *p) } #endif -int peers_init_sync(struct peers *peers); -int peers_alloc_dcache(struct peers *peers); -void peers_register_table(struct peers *, struct stktable *table); -void peers_setup_frontend(struct proxy *fe); - -#endif /* _PROTO_PEERS_H */ +#endif /* _HAPROXY_PEERS_H */ diff --git a/include/types/stick_table.h b/include/types/stick_table.h index 0ee7b95f74..2918381db5 100644 --- a/include/types/stick_table.h +++ b/include/types/stick_table.h @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include /* The types of extra data we can store in a stick table */ diff --git a/src/cfgparse.c b/src/cfgparse.c index 6051b155ee..0a0c315e59 100644 --- a/src/cfgparse.c +++ b/src/cfgparse.c @@ -52,6 +52,7 @@ #include #include #include +#include #include #include #include @@ -62,7 +63,6 @@ #include #include -#include #include #include @@ -75,7 +75,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/cli.c b/src/cli.c index 63d2b58f7d..48539fd4aa 100644 --- a/src/cli.c +++ b/src/cli.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include diff --git a/src/haproxy.c b/src/haproxy.c index 9b0d767de1..bfbfa0580f 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -99,6 +99,7 @@ #include #include #include +#include #include #include #include @@ -115,7 +116,6 @@ #include #include #include -#include #include #include diff --git a/src/mworker.c b/src/mworker.c index eeedb4c705..091a6dfb04 100644 --- a/src/mworker.c +++ b/src/mworker.c @@ -22,12 +22,12 @@ #include #include #include +#include #include #include #include #include -#include #include #include diff --git a/src/peers.c b/src/peers.c index c1c9588a9f..8ffe42167f 100644 --- a/src/peers.c +++ b/src/peers.c @@ -25,13 +25,13 @@ #include #include #include +#include #include #include #include #include #include -#include #include #include @@ -40,7 +40,6 @@ #include #include #include -#include #include #include #include diff --git a/src/proxy.c b/src/proxy.c index bb686e77ce..c66927d074 100644 --- a/src/proxy.c +++ b/src/proxy.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -32,7 +33,6 @@ #include #include -#include #include #include diff --git a/src/stick_table.c b/src/stick_table.c index aad4071a60..835b0a6ffc 100644 --- a/src/stick_table.c +++ b/src/stick_table.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -42,7 +43,6 @@ #include #include #include -#include /* structure used to return a table key built from a sample */ static THREAD_LOCAL struct stktable_key static_table_key;