MEDIUM: acl: use the fetch syntax 'fetch(args),conv(),conv()' into the ACL keyword
If the acl keyword is a "fetch", the dedicated parsing function
"sample_parse_expr()" is used. Otherwise, the acl parsing function
"parse_acl_expr()" is extended to understand the syntax of a series
of converters placed after the "fetch" keyword.
Before this patch, each acl uses a "struct sample_fetch" and executes
it with the "<fetch>->process()" function. Now, the dedicated function
"sample_process()" is called.
These syntax are now avalaible:
acl bad req.hdr(host),lower -m str www
http-request redirect prefix /go-away if bad
acl bad hdr_beg(host),lower www
http-request redirect prefix /go-away if bad
diff --git a/include/proto/sample.h b/include/proto/sample.h
index db10537..20c2954 100644
--- a/include/proto/sample.h
+++ b/include/proto/sample.h
@@ -39,5 +39,6 @@
const char *sample_ckp_names(unsigned int use);
struct sample_fetch *find_sample_fetch(const char *kw, int len);
int smp_resolve_args(struct proxy *p);
+int smp_expr_output_type(struct sample_expr *expr);
#endif /* _PROTO_SAMPLE_H */
diff --git a/include/types/acl.h b/include/types/acl.h
index 42e2e9c..006899e 100644
--- a/include/types/acl.h
+++ b/include/types/acl.h
@@ -192,8 +192,7 @@
struct acl_expr {
int (*parse)(const char **text, struct acl_pattern *pattern, int *opaque, char **err);
int (*match)(struct sample *smp, struct acl_pattern *pattern);
- struct arg *args; /* optional fetch argument list (eg: header or cookie name) */
- struct sample_fetch *smp; /* the sample fetch we depend on */
+ struct sample_expr *smp; /* the sample expression we depend on */
struct list patterns; /* list of acl_patterns */
struct eb_root pattern_tree; /* may be used for lookup in large datasets */
struct list list; /* chaining */