diff --git a/include/proto/filters.h b/include/proto/filters.h index f9b0fb0ec..28084f9a0 100644 --- a/include/proto/filters.h +++ b/include/proto/filters.h @@ -126,6 +126,7 @@ int flt_xfer_data(struct stream *s, struct channel *chn, unsigned int an_bit); void flt_register_keywords(struct flt_kw_list *kwl); struct flt_kw *flt_find_kw(const char *kw); void flt_dump_kws(char **out); +void list_filters(FILE *out); /* Helper function that returns the "global" state of filters attached to a * stream. */ diff --git a/include/types/filters.h b/include/types/filters.h index 84469469a..0e4d99ab5 100644 --- a/include/types/filters.h +++ b/include/types/filters.h @@ -33,10 +33,7 @@ struct filter; /* Descriptor for a "filter" keyword. The ->parse() function returns 0 in case * of success, or a combination of ERR_* flags if an error is encountered. The - * function pointer can be NULL if not implemented. The function also has an - * access to the current "server" config line. The ->skip value tells the parser - * how many words have to be skipped after the keyword. If the function needs to - * parse more keywords, it needs to update cur_arg. + * function pointer can be NULL if not implemented. */ struct flt_kw { const char *kw; diff --git a/src/filters.c b/src/filters.c index 420ad8029..a8efaa181 100644 --- a/src/filters.c +++ b/src/filters.c @@ -150,6 +150,21 @@ flt_dump_kws(char **out) } } +/* + * Lists the known filters on + */ +void +list_filters(FILE *out) +{ + char *filters, *p, *f; + + fprintf(out, "Available filters :\n"); + flt_dump_kws(&filters); + for (p = filters; (f = strtok_r(p,"\n",&p));) + fprintf(out, "\t%s\n", f); + free(filters); +} + /* * Parses the "filter" keyword. All keywords must be handled by filters * themselves diff --git a/src/haproxy.c b/src/haproxy.c index 51af55abc..0c223e5b8 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -412,6 +412,8 @@ void display_build_opts() list_pollers(stdout); putchar('\n'); + list_filters(stdout); + putchar('\n'); } /* @@ -1126,8 +1128,11 @@ void init(int argc, char **argv) /* Note: we could disable any poller by name here */ - if (global.mode & (MODE_VERBOSE|MODE_DEBUG)) + if (global.mode & (MODE_VERBOSE|MODE_DEBUG)) { list_pollers(stderr); + fprintf(stderr, "\n"); + list_filters(stderr); + } if (!init_pollers()) { Alert("No polling mechanism available.\n"