MINOR: filters: Export the name of known filters

It could be useful to know if some filter is declared on a proxy or if it is
enabled on a stream.
This commit is contained in:
Christopher Faulet 2018-12-07 17:39:53 +01:00 committed by Willy Tarreau
parent 95220e2ed8
commit f4a4ef7d7c
4 changed files with 10 additions and 2 deletions

View File

@ -29,6 +29,11 @@
#include <proto/channel.h> #include <proto/channel.h>
extern const char *trace_flt_id;
extern const char *http_comp_flt_id;
extern const char *cache_store_flt_id;
extern const char *spoe_filter_id;
#define FLT_ID(flt) (flt)->config->id #define FLT_ID(flt) (flt)->config->id
#define FLT_CONF(flt) (flt)->config->conf #define FLT_CONF(flt) (flt)->config->conf
#define FLT_OPS(flt) (flt)->config->ops #define FLT_OPS(flt) (flt)->config->ops

View File

@ -43,7 +43,7 @@
* messages (legacy implementation) */ * messages (legacy implementation) */
#define CACHE_F_HTX 0x00000002 /* The cache is used to store HTX messages */ #define CACHE_F_HTX 0x00000002 /* The cache is used to store HTX messages */
static const char *cache_store_flt_id = "cache store filter"; const char *cache_store_flt_id = "cache store filter";
struct applet http_cache_applet; struct applet http_cache_applet;

View File

@ -31,7 +31,7 @@
#include <proto/sample.h> #include <proto/sample.h>
#include <proto/stream.h> #include <proto/stream.h>
static const char *http_comp_flt_id = "compression filter"; const char *http_comp_flt_id = "compression filter";
struct flt_ops comp_ops; struct flt_ops comp_ops;

View File

@ -33,6 +33,8 @@
#include <proto/proto_http.h> #include <proto/proto_http.h>
#include <proto/stream.h> #include <proto/stream.h>
const char *trace_flt_id = "trace filter";
struct flt_ops trace_ops; struct flt_ops trace_ops;
struct trace_config { struct trace_config {
@ -709,6 +711,7 @@ parse_trace_flt(char **args, int *cur_arg, struct proxy *px,
pos++; pos++;
} }
*cur_arg = pos; *cur_arg = pos;
fconf->id = trace_flt_id;
fconf->ops = &trace_ops; fconf->ops = &trace_ops;
} }