MINOR: pattern: store configuration reference for each acl or map pattern.
This patch permit to add reference for each pattern reference. This is
useful to identify the acl listed.
diff --git a/include/proto/acl.h b/include/proto/acl.h
index 82782d4..1a7c1f4 100644
--- a/include/proto/acl.h
+++ b/include/proto/acl.h
@@ -59,7 +59,7 @@
* Right now, the only accepted syntax is :
* <subject> [<value>...]
*/
-struct acl_expr *parse_acl_expr(const char **args, char **err, struct arg_list *al);
+struct acl_expr *parse_acl_expr(const char **args, char **err, struct arg_list *al, const char *file, int line);
/* Purge everything in the acl <acl>, then return <acl>. */
struct acl *prune_acl(struct acl *acl);
@@ -70,7 +70,7 @@
*
* args syntax: <aclname> <acl_expr>
*/
-struct acl *parse_acl(const char **args, struct list *known_acl, char **err, struct arg_list *al);
+struct acl *parse_acl(const char **args, struct list *known_acl, char **err, struct arg_list *al, const char *file, int line);
/* Purge everything in the acl_cond <cond>, then return <cond>. */
struct acl_cond *prune_acl_cond(struct acl_cond *cond);
@@ -80,7 +80,8 @@
* case of low memory). Supports multiple conditions separated by "or".
*/
struct acl_cond *parse_acl_cond(const char **args, struct list *known_acl,
- enum acl_cond_pol pol, char **err, struct arg_list *al);
+ enum acl_cond_pol pol, char **err, struct arg_list *al,
+ const char *file, int line);
/* Builds an ACL condition starting at the if/unless keyword. The complete
* condition is returned. NULL is returned in case of error or if the first
diff --git a/include/proto/pattern.h b/include/proto/pattern.h
index bccac65..e6afa51 100644
--- a/include/proto/pattern.h
+++ b/include/proto/pattern.h
@@ -185,8 +185,8 @@
*/
struct pat_ref *pat_ref_lookup(const char *reference);
struct pat_ref *pat_ref_lookupid(int unique_id);
-struct pat_ref *pat_ref_new(const char *reference, unsigned int flags);
-struct pat_ref *pat_ref_newid(int unique_id, unsigned int flags);
+struct pat_ref *pat_ref_new(const char *reference, const char *display, unsigned int flags);
+struct pat_ref *pat_ref_newid(int unique_id, const char *display, unsigned int flags);
int pat_ref_append(struct pat_ref *ref, char *pattern, char *sample, int line);
int pat_ref_add(struct pat_ref *ref, const char *pattern, const char *sample, char **err);
int pat_ref_set(struct pat_ref *ref, const char *pattern, const char *sample);
@@ -199,7 +199,7 @@
*/
void pattern_init_head(struct pattern_head *head);
void pattern_prune(struct pattern_head *head);
-int pattern_read_from_file(struct pattern_head *head, unsigned int refflags, const char *filename, int patflags, char **err);
+int pattern_read_from_file(struct pattern_head *head, unsigned int refflags, const char *filename, int patflags, char **err, const char *display);
/*
* pattern_expr manipulation.
diff --git a/include/types/pattern.h b/include/types/pattern.h
index 156e57b..ac76e37 100644
--- a/include/types/pattern.h
+++ b/include/types/pattern.h
@@ -98,6 +98,7 @@
unsigned int flags; /* flags PAT_REF_*. */
char *reference; /* The reference name. */
int unique_id; /* Each pattern reference have unique id. */
+ char *display; /* String displayed to identify the pattern origin. */
struct list head; /* The head of the list of struct pat_ref_elt. */
struct list pat; /* The head of the list of struct pattern_expr. */
};