From c7babd8570a205dbba12ccc0fd203aaf9f022b6e Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Thu, 4 Jun 2020 21:29:29 +0200 Subject: [PATCH] REORG: include: move filters.h to haproxy/filters{,-t}.h Just a minor change, moved the macro definitions upwards. A few caller files were updated since they didn't need to include it. --- .../{types/filters.h => haproxy/filters-t.h} | 33 ++++++++++--------- include/{proto => haproxy}/filters.h | 11 +++---- include/types/fcgi-app.h | 3 +- include/types/proxy.h | 1 - include/types/spoe.h | 2 +- include/types/stream.h | 2 +- src/cache.c | 3 +- src/cfgparse.c | 3 +- src/fcgi-app.c | 2 +- src/filters.c | 4 +-- src/flt_http_comp.c | 3 +- src/flt_spoe.c | 2 +- src/flt_trace.c | 3 +- src/haproxy.c | 3 +- src/http_ana.c | 2 +- src/proxy.c | 2 +- src/stream.c | 4 +-- 17 files changed, 36 insertions(+), 47 deletions(-) rename include/{types/filters.h => haproxy/filters-t.h} (98%) rename include/{proto => haproxy}/filters.h (97%) diff --git a/include/types/filters.h b/include/haproxy/filters-t.h similarity index 98% rename from include/types/filters.h rename to include/haproxy/filters-t.h index 2e06b8316..a158d22db 100644 --- a/include/types/filters.h +++ b/include/haproxy/filters-t.h @@ -1,5 +1,5 @@ /* - * include/types/filteers.h + * include/haproxy/filteers-t.h * This file defines everything related to stream filters. * * Copyright (C) 2015 Qualys Inc., Christopher Faulet @@ -18,11 +18,23 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef _TYPES_FILTERS_H -#define _TYPES_FILTERS_H +#ifndef _HAPROXY_FILTERS_T_H +#define _HAPROXY_FILTERS_T_H -#include #include +#include + +/* Flags set on a filter config */ +#define FLT_CFG_FL_HTX 0x00000001 /* The filter can filter HTX streams */ + +/* Flags set on a filter instance */ +#define FLT_FL_IS_BACKEND_FILTER 0x0001 /* The filter is a backend filter */ +#define FLT_FL_IS_REQ_DATA_FILTER 0x0002 /* The filter will parse data on the request channel */ +#define FLT_FL_IS_RSP_DATA_FILTER 0x0004 /* The filter will parse data on the response channel */ + +/* Flags set on the stream, common to all filters attached to its stream */ +#define STRM_FLT_FL_HAS_FILTERS 0x0001 /* The stream has at least one filter */ + struct http_msg; struct proxy; @@ -189,17 +201,6 @@ struct flt_ops { unsigned int offset, unsigned int len); }; -/* Flags set on a filter config */ -#define FLT_CFG_FL_HTX 0x00000001 /* The filter can filter HTX streams */ - -/* Flags set on a filter instance */ -#define FLT_FL_IS_BACKEND_FILTER 0x0001 /* The filter is a backend filter */ -#define FLT_FL_IS_REQ_DATA_FILTER 0x0002 /* The filter will parse data on the request channel */ -#define FLT_FL_IS_RSP_DATA_FILTER 0x0004 /* The filter will parse data on the response channel */ - -/* Flags set on the stream, common to all filters attached to its stream */ -#define STRM_FLT_FL_HAS_FILTERS 0x0001 /* The stream has at least one filter */ - /* * Structure representing the filter configuration, attached to a proxy and * accessible from a filter when instantiated in a stream @@ -247,7 +248,7 @@ struct strm_flt { unsigned long long offset[2]; }; -#endif /* _TYPES_FILTERS_H */ +#endif /* _HAPROXY_FILTERS_T_H */ /* * Local variables: diff --git a/include/proto/filters.h b/include/haproxy/filters.h similarity index 97% rename from include/proto/filters.h rename to include/haproxy/filters.h index 4b8876ea8..b9f24bfc7 100644 --- a/include/proto/filters.h +++ b/include/haproxy/filters.h @@ -1,5 +1,5 @@ /* - * include/proto/filters.h + * include/haproxy/filters.h * This file defines function prototypes for stream filters management. * * Copyright (C) 2015 Qualys Inc., Christopher Faulet @@ -18,11 +18,11 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef _PROTO_FILTERS_H -#define _PROTO_FILTERS_H +#ifndef _HAPROXY_FILTERS_H +#define _HAPROXY_FILTERS_H #include -#include +#include #include #include #include @@ -186,5 +186,4 @@ flt_update_offsets(struct filter *filter, struct channel *chn, int len) } } - -#endif /* _PROTO_FILTERS_H */ +#endif /* _HAPROXY_FILTERS_H */ diff --git a/include/types/fcgi-app.h b/include/types/fcgi-app.h index b314d69e0..4d1581b48 100644 --- a/include/types/fcgi-app.h +++ b/include/types/fcgi-app.h @@ -26,13 +26,12 @@ #include #include #include +#include #include #include #include -#include - #define FCGI_APP_FL_KEEP_CONN 0x00000001 /* Keep the connection alive */ #define FCGI_APP_FL_GET_VALUES 0x00000002 /* Retrieve FCGI variables on connection establishment */ #define FCGI_APP_FL_MPXS_CONNS 0x00000004 /* FCGI APP supports connection multiplexing */ diff --git a/include/types/proxy.h b/include/types/proxy.h index 53d9e3c0d..b86df8d92 100644 --- a/include/types/proxy.h +++ b/include/types/proxy.h @@ -42,7 +42,6 @@ #include #include -#include #include #include #include diff --git a/include/types/spoe.h b/include/types/spoe.h index c7ed45d5a..1538a729a 100644 --- a/include/types/spoe.h +++ b/include/types/spoe.h @@ -25,10 +25,10 @@ #include #include +#include #include #include -#include #include #include #include diff --git a/include/types/stream.h b/include/types/stream.h index 99dfd02ec..41b800cf3 100644 --- a/include/types/stream.h +++ b/include/types/stream.h @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -39,7 +40,6 @@ #include #include -#include #include #include #include diff --git a/src/cache.c b/src/cache.c index 36c54a880..17d015afa 100644 --- a/src/cache.c +++ b/src/cache.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -22,11 +23,9 @@ #include #include -#include #include #include -#include #include #include diff --git a/src/cfgparse.c b/src/cfgparse.c index e5cac8b11..8bd60b7cb 100644 --- a/src/cfgparse.c +++ b/src/cfgparse.c @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include @@ -67,11 +68,9 @@ #include #include -#include #include #include -#include #include #include #include diff --git a/src/fcgi-app.c b/src/fcgi-app.c index dda4b3a99..9097dab9d 100644 --- a/src/fcgi-app.c +++ b/src/fcgi-app.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -25,7 +26,6 @@ #include #include -#include #include #include #include diff --git a/src/filters.c b/src/filters.c index 130f5d71a..b65873925 100644 --- a/src/filters.c +++ b/src/filters.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -22,10 +23,7 @@ #include #include -#include - #include -#include #include #include diff --git a/src/flt_http_comp.c b/src/flt_http_comp.c index 0fb213d08..1b8fffb59 100644 --- a/src/flt_http_comp.c +++ b/src/flt_http_comp.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -22,10 +23,8 @@ #include #include -#include #include -#include #include const char *http_comp_flt_id = "compression filter"; diff --git a/src/flt_spoe.c b/src/flt_spoe.c index 9e9eaeb8f..f532d2d85 100644 --- a/src/flt_spoe.c +++ b/src/flt_spoe.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -35,7 +36,6 @@ #include #include -#include #include #include #include diff --git a/src/flt_trace.c b/src/flt_trace.c index 125401a38..2f55b73d1 100644 --- a/src/flt_trace.c +++ b/src/flt_trace.c @@ -14,18 +14,17 @@ #include #include +#include #include #include #include #include #include -#include #include #include #include -#include #include #include diff --git a/src/haproxy.c b/src/haproxy.c index 6370d8e59..6488df9b3 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -91,6 +91,7 @@ #include #include #include +#include #include #include #include @@ -116,14 +117,12 @@ #include #include -#include #include #include #include #include #include -#include #include #include #include diff --git a/src/http_ana.c b/src/http_ana.c index 6e15d6730..8e8dd2fa0 100644 --- a/src/http_ana.c +++ b/src/http_ana.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -30,7 +31,6 @@ #include -#include #include #include #include diff --git a/src/proxy.c b/src/proxy.c index 803f1868a..78d91e6e2 100644 --- a/src/proxy.c +++ b/src/proxy.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -40,7 +41,6 @@ #include #include -#include #include #include #include diff --git a/src/stream.c b/src/stream.c index 010509fb5..fc2798d09 100644 --- a/src/stream.c +++ b/src/stream.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -43,13 +44,10 @@ #include #include -#include - #include #include #include #include -#include #include #include #include