MAJOR: acl: remove the arg_mask from the ACL definition and use the sample fetch's
Now that ACLs solely rely on sample fetch functions, make them use the
same arg mask. All inconsistencies have been fixed separately prior to
this patch, so this patch almost only adds a new pointer indirection
and removes all references to ARG*() in the definitions.
The parsing is still performed by the ACL code though.
diff --git a/src/proto_http.c b/src/proto_http.c
index d49b37c..a835fdc 100644
--- a/src/proto_http.c
+++ b/src/proto_http.c
@@ -9522,104 +9522,104 @@
* Please take care of keeping this list alphabetically sorted.
*/
static struct acl_kw_list acl_kws = {{ },{
- { "base", "base", acl_parse_str, acl_match_str, ACL_USE_L7REQ_VOLATILE, 0 },
- { "base_beg", "base", acl_parse_str, acl_match_beg, ACL_USE_L7REQ_VOLATILE, 0 },
- { "base_dir", "base", acl_parse_str, acl_match_dir, ACL_USE_L7REQ_VOLATILE, 0 },
- { "base_dom", "base", acl_parse_str, acl_match_dom, ACL_USE_L7REQ_VOLATILE, 0 },
- { "base_end", "base", acl_parse_str, acl_match_end, ACL_USE_L7REQ_VOLATILE, 0 },
- { "base_len", "base", acl_parse_int, acl_match_len, ACL_USE_L7REQ_VOLATILE, 0 },
- { "base_reg", "base", acl_parse_reg, acl_match_reg, ACL_USE_L7REQ_VOLATILE, 0 },
- { "base_sub", "base", acl_parse_str, acl_match_sub, ACL_USE_L7REQ_VOLATILE, 0 },
+ { "base", "base", acl_parse_str, acl_match_str, ACL_USE_L7REQ_VOLATILE },
+ { "base_beg", "base", acl_parse_str, acl_match_beg, ACL_USE_L7REQ_VOLATILE },
+ { "base_dir", "base", acl_parse_str, acl_match_dir, ACL_USE_L7REQ_VOLATILE },
+ { "base_dom", "base", acl_parse_str, acl_match_dom, ACL_USE_L7REQ_VOLATILE },
+ { "base_end", "base", acl_parse_str, acl_match_end, ACL_USE_L7REQ_VOLATILE },
+ { "base_len", "base", acl_parse_int, acl_match_len, ACL_USE_L7REQ_VOLATILE },
+ { "base_reg", "base", acl_parse_reg, acl_match_reg, ACL_USE_L7REQ_VOLATILE },
+ { "base_sub", "base", acl_parse_str, acl_match_sub, ACL_USE_L7REQ_VOLATILE },
- { "cook", "cook", acl_parse_str, acl_match_str, ACL_USE_L7REQ_VOLATILE, ARG1(0,STR) },
- { "cook_beg", "cook", acl_parse_str, acl_match_beg, ACL_USE_L7REQ_VOLATILE, ARG1(0,STR) },
- { "cook_cnt", "cook_cnt", acl_parse_int, acl_match_int, ACL_USE_L7REQ_VOLATILE, ARG1(0,STR) },
- { "cook_dir", "cook", acl_parse_str, acl_match_dir, ACL_USE_L7REQ_VOLATILE, ARG1(0,STR) },
- { "cook_dom", "cook", acl_parse_str, acl_match_dom, ACL_USE_L7REQ_VOLATILE, ARG1(0,STR) },
- { "cook_end", "cook", acl_parse_str, acl_match_end, ACL_USE_L7REQ_VOLATILE, ARG1(0,STR) },
- { "cook_len", "cook", acl_parse_int, acl_match_len, ACL_USE_L7REQ_VOLATILE, ARG1(0,STR) },
- { "cook_reg", "cook", acl_parse_reg, acl_match_reg, ACL_USE_L7REQ_VOLATILE, ARG1(0,STR) },
- { "cook_sub", "cook", acl_parse_str, acl_match_sub, ACL_USE_L7REQ_VOLATILE, ARG1(0,STR) },
- { "cook_val", "cook_val", acl_parse_int, acl_match_int, ACL_USE_L7REQ_VOLATILE, ARG1(0,STR) },
+ { "cook", "cook", acl_parse_str, acl_match_str, ACL_USE_L7REQ_VOLATILE },
+ { "cook_beg", "cook", acl_parse_str, acl_match_beg, ACL_USE_L7REQ_VOLATILE },
+ { "cook_cnt", "cook_cnt", acl_parse_int, acl_match_int, ACL_USE_L7REQ_VOLATILE },
+ { "cook_dir", "cook", acl_parse_str, acl_match_dir, ACL_USE_L7REQ_VOLATILE },
+ { "cook_dom", "cook", acl_parse_str, acl_match_dom, ACL_USE_L7REQ_VOLATILE },
+ { "cook_end", "cook", acl_parse_str, acl_match_end, ACL_USE_L7REQ_VOLATILE },
+ { "cook_len", "cook", acl_parse_int, acl_match_len, ACL_USE_L7REQ_VOLATILE },
+ { "cook_reg", "cook", acl_parse_reg, acl_match_reg, ACL_USE_L7REQ_VOLATILE },
+ { "cook_sub", "cook", acl_parse_str, acl_match_sub, ACL_USE_L7REQ_VOLATILE },
+ { "cook_val", "cook_val", acl_parse_int, acl_match_int, ACL_USE_L7REQ_VOLATILE },
- { "hdr", "hdr", acl_parse_str, acl_match_str, ACL_USE_L7REQ_VOLATILE, ARG2(0,STR,SINT), val_hdr },
- { "hdr_beg", "hdr", acl_parse_str, acl_match_beg, ACL_USE_L7REQ_VOLATILE, ARG2(0,STR,SINT), val_hdr },
- { "hdr_cnt", "hdr_cnt", acl_parse_int, acl_match_int, ACL_USE_L7REQ_VOLATILE, ARG1(0,STR) },
- { "hdr_dir", "hdr", acl_parse_str, acl_match_dir, ACL_USE_L7REQ_VOLATILE, ARG2(0,STR,SINT), val_hdr },
- { "hdr_dom", "hdr", acl_parse_str, acl_match_dom, ACL_USE_L7REQ_VOLATILE, ARG2(0,STR,SINT), val_hdr },
- { "hdr_end", "hdr", acl_parse_str, acl_match_end, ACL_USE_L7REQ_VOLATILE, ARG2(0,STR,SINT), val_hdr },
- { "hdr_ip", "hdr_ip", acl_parse_ip, acl_match_ip, ACL_USE_L7REQ_VOLATILE, ARG2(0,STR,SINT), val_hdr },
- { "hdr_len", "hdr", acl_parse_int, acl_match_len, ACL_USE_L7REQ_VOLATILE, ARG2(0,STR,SINT), val_hdr },
- { "hdr_reg", "hdr", acl_parse_reg, acl_match_reg, ACL_USE_L7REQ_VOLATILE, ARG2(0,STR,SINT), val_hdr },
- { "hdr_sub", "hdr", acl_parse_str, acl_match_sub, ACL_USE_L7REQ_VOLATILE, ARG2(0,STR,SINT), val_hdr },
- { "hdr_val", "hdr_val", acl_parse_int, acl_match_int, ACL_USE_L7REQ_VOLATILE, ARG2(0,STR,SINT), val_hdr },
+ { "hdr", "hdr", acl_parse_str, acl_match_str, ACL_USE_L7REQ_VOLATILE, val_hdr },
+ { "hdr_beg", "hdr", acl_parse_str, acl_match_beg, ACL_USE_L7REQ_VOLATILE, val_hdr },
+ { "hdr_cnt", "hdr_cnt", acl_parse_int, acl_match_int, ACL_USE_L7REQ_VOLATILE },
+ { "hdr_dir", "hdr", acl_parse_str, acl_match_dir, ACL_USE_L7REQ_VOLATILE, val_hdr },
+ { "hdr_dom", "hdr", acl_parse_str, acl_match_dom, ACL_USE_L7REQ_VOLATILE, val_hdr },
+ { "hdr_end", "hdr", acl_parse_str, acl_match_end, ACL_USE_L7REQ_VOLATILE, val_hdr },
+ { "hdr_ip", "hdr_ip", acl_parse_ip, acl_match_ip, ACL_USE_L7REQ_VOLATILE, val_hdr },
+ { "hdr_len", "hdr", acl_parse_int, acl_match_len, ACL_USE_L7REQ_VOLATILE, val_hdr },
+ { "hdr_reg", "hdr", acl_parse_reg, acl_match_reg, ACL_USE_L7REQ_VOLATILE, val_hdr },
+ { "hdr_sub", "hdr", acl_parse_str, acl_match_sub, ACL_USE_L7REQ_VOLATILE, val_hdr },
+ { "hdr_val", "hdr_val", acl_parse_int, acl_match_int, ACL_USE_L7REQ_VOLATILE, val_hdr },
- { "http_auth", NULL, acl_parse_nothing, acl_match_nothing, ACL_USE_L7REQ_VOLATILE, ARG1(1,USR) },
- { "http_auth_group", NULL, acl_parse_strcat, acl_match_auth, ACL_USE_L7REQ_VOLATILE, ARG1(1,USR) },
+ { "http_auth", NULL, acl_parse_nothing, acl_match_nothing, ACL_USE_L7REQ_VOLATILE },
+ { "http_auth_group", NULL, acl_parse_strcat, acl_match_auth, ACL_USE_L7REQ_VOLATILE },
- { "http_first_req", NULL, acl_parse_nothing, acl_match_nothing, ACL_USE_L7REQ_PERMANENT, 0 },
+ { "http_first_req", NULL, acl_parse_nothing, acl_match_nothing, ACL_USE_L7REQ_PERMANENT },
- { "method", NULL, acl_parse_meth, acl_match_meth, ACL_USE_L7REQ_PERMANENT, 0 },
+ { "method", NULL, acl_parse_meth, acl_match_meth, ACL_USE_L7REQ_PERMANENT },
- { "path", "path", acl_parse_str, acl_match_str, ACL_USE_L7REQ_VOLATILE, 0 },
- { "path_beg", "path", acl_parse_str, acl_match_beg, ACL_USE_L7REQ_VOLATILE, 0 },
- { "path_dir", "path", acl_parse_str, acl_match_dir, ACL_USE_L7REQ_VOLATILE, 0 },
- { "path_dom", "path", acl_parse_str, acl_match_dom, ACL_USE_L7REQ_VOLATILE, 0 },
- { "path_end", "path", acl_parse_str, acl_match_end, ACL_USE_L7REQ_VOLATILE, 0 },
- { "path_len", "path", acl_parse_int, acl_match_len, ACL_USE_L7REQ_VOLATILE, 0 },
- { "path_reg", "path", acl_parse_reg, acl_match_reg, ACL_USE_L7REQ_VOLATILE, 0 },
- { "path_sub", "path", acl_parse_str, acl_match_sub, ACL_USE_L7REQ_VOLATILE, 0 },
+ { "path", "path", acl_parse_str, acl_match_str, ACL_USE_L7REQ_VOLATILE },
+ { "path_beg", "path", acl_parse_str, acl_match_beg, ACL_USE_L7REQ_VOLATILE },
+ { "path_dir", "path", acl_parse_str, acl_match_dir, ACL_USE_L7REQ_VOLATILE },
+ { "path_dom", "path", acl_parse_str, acl_match_dom, ACL_USE_L7REQ_VOLATILE },
+ { "path_end", "path", acl_parse_str, acl_match_end, ACL_USE_L7REQ_VOLATILE },
+ { "path_len", "path", acl_parse_int, acl_match_len, ACL_USE_L7REQ_VOLATILE },
+ { "path_reg", "path", acl_parse_reg, acl_match_reg, ACL_USE_L7REQ_VOLATILE },
+ { "path_sub", "path", acl_parse_str, acl_match_sub, ACL_USE_L7REQ_VOLATILE },
- { "req_proto_http", NULL, acl_parse_nothing, acl_match_nothing, ACL_USE_L7REQ_PERMANENT, 0 },
- { "req_ver", NULL, acl_parse_ver, acl_match_str, ACL_USE_L7REQ_VOLATILE, 0 },
- { "resp_ver", NULL, acl_parse_ver, acl_match_str, ACL_USE_L7RTR_VOLATILE, 0 },
+ { "req_proto_http", NULL, acl_parse_nothing, acl_match_nothing, ACL_USE_L7REQ_PERMANENT },
+ { "req_ver", NULL, acl_parse_ver, acl_match_str, ACL_USE_L7REQ_VOLATILE },
+ { "resp_ver", NULL, acl_parse_ver, acl_match_str, ACL_USE_L7RTR_VOLATILE },
- { "scook", "scook", acl_parse_str, acl_match_str, ACL_USE_L7RTR_VOLATILE, ARG1(0,STR) },
- { "scook_beg", "scook", acl_parse_str, acl_match_beg, ACL_USE_L7RTR_VOLATILE, ARG1(0,STR) },
- { "scook_cnt", "scook_cnt", acl_parse_int, acl_match_int, ACL_USE_L7RTR_VOLATILE, ARG1(0,STR) },
- { "scook_dir", "scook", acl_parse_str, acl_match_dir, ACL_USE_L7RTR_VOLATILE, ARG1(0,STR) },
- { "scook_dom", "scook", acl_parse_str, acl_match_dom, ACL_USE_L7RTR_VOLATILE, ARG1(0,STR) },
- { "scook_end", "scook", acl_parse_str, acl_match_end, ACL_USE_L7RTR_VOLATILE, ARG1(0,STR) },
- { "scook_len", "scook", acl_parse_int, acl_match_len, ACL_USE_L7RTR_VOLATILE, ARG1(0,STR) },
- { "scook_reg", "scook", acl_parse_reg, acl_match_reg, ACL_USE_L7RTR_VOLATILE, ARG1(0,STR) },
- { "scook_sub", "scook", acl_parse_str, acl_match_sub, ACL_USE_L7RTR_VOLATILE, ARG1(0,STR) },
- { "scook_val", "scook_val", acl_parse_int, acl_match_int, ACL_USE_L7RTR_VOLATILE, ARG1(0,STR) },
+ { "scook", "scook", acl_parse_str, acl_match_str, ACL_USE_L7RTR_VOLATILE },
+ { "scook_beg", "scook", acl_parse_str, acl_match_beg, ACL_USE_L7RTR_VOLATILE },
+ { "scook_cnt", "scook_cnt", acl_parse_int, acl_match_int, ACL_USE_L7RTR_VOLATILE },
+ { "scook_dir", "scook", acl_parse_str, acl_match_dir, ACL_USE_L7RTR_VOLATILE },
+ { "scook_dom", "scook", acl_parse_str, acl_match_dom, ACL_USE_L7RTR_VOLATILE },
+ { "scook_end", "scook", acl_parse_str, acl_match_end, ACL_USE_L7RTR_VOLATILE },
+ { "scook_len", "scook", acl_parse_int, acl_match_len, ACL_USE_L7RTR_VOLATILE },
+ { "scook_reg", "scook", acl_parse_reg, acl_match_reg, ACL_USE_L7RTR_VOLATILE },
+ { "scook_sub", "scook", acl_parse_str, acl_match_sub, ACL_USE_L7RTR_VOLATILE },
+ { "scook_val", "scook_val", acl_parse_int, acl_match_int, ACL_USE_L7RTR_VOLATILE },
- { "shdr", "shdr", acl_parse_str, acl_match_str, ACL_USE_L7RTR_VOLATILE, ARG2(0,STR,SINT), val_hdr },
- { "shdr_beg", "shdr", acl_parse_str, acl_match_beg, ACL_USE_L7RTR_VOLATILE, ARG2(0,STR,SINT), val_hdr },
- { "shdr_cnt", "shdr_cnt", acl_parse_int, acl_match_int, ACL_USE_L7RTR_VOLATILE, ARG1(0,STR) },
- { "shdr_dir", "shdr", acl_parse_str, acl_match_dir, ACL_USE_L7RTR_VOLATILE, ARG2(0,STR,SINT), val_hdr },
- { "shdr_dom", "shdr", acl_parse_str, acl_match_dom, ACL_USE_L7RTR_VOLATILE, ARG2(0,STR,SINT), val_hdr },
- { "shdr_end", "shdr", acl_parse_str, acl_match_end, ACL_USE_L7RTR_VOLATILE, ARG2(0,STR,SINT), val_hdr },
- { "shdr_ip", "shdr_ip", acl_parse_ip, acl_match_ip, ACL_USE_L7RTR_VOLATILE, ARG2(0,STR,SINT), val_hdr },
- { "shdr_len", "shdr", acl_parse_int, acl_match_len, ACL_USE_L7RTR_VOLATILE, ARG2(0,STR,SINT), val_hdr },
- { "shdr_reg", "shdr", acl_parse_reg, acl_match_reg, ACL_USE_L7RTR_VOLATILE, ARG2(0,STR,SINT), val_hdr },
- { "shdr_sub", "shdr", acl_parse_str, acl_match_sub, ACL_USE_L7RTR_VOLATILE, ARG2(0,STR,SINT), val_hdr },
- { "shdr_val", "shdr_val", acl_parse_int, acl_match_int, ACL_USE_L7RTR_VOLATILE, ARG2(0,STR,SINT), val_hdr },
+ { "shdr", "shdr", acl_parse_str, acl_match_str, ACL_USE_L7RTR_VOLATILE, val_hdr },
+ { "shdr_beg", "shdr", acl_parse_str, acl_match_beg, ACL_USE_L7RTR_VOLATILE, val_hdr },
+ { "shdr_cnt", "shdr_cnt", acl_parse_int, acl_match_int, ACL_USE_L7RTR_VOLATILE },
+ { "shdr_dir", "shdr", acl_parse_str, acl_match_dir, ACL_USE_L7RTR_VOLATILE, val_hdr },
+ { "shdr_dom", "shdr", acl_parse_str, acl_match_dom, ACL_USE_L7RTR_VOLATILE, val_hdr },
+ { "shdr_end", "shdr", acl_parse_str, acl_match_end, ACL_USE_L7RTR_VOLATILE, val_hdr },
+ { "shdr_ip", "shdr_ip", acl_parse_ip, acl_match_ip, ACL_USE_L7RTR_VOLATILE, val_hdr },
+ { "shdr_len", "shdr", acl_parse_int, acl_match_len, ACL_USE_L7RTR_VOLATILE, val_hdr },
+ { "shdr_reg", "shdr", acl_parse_reg, acl_match_reg, ACL_USE_L7RTR_VOLATILE, val_hdr },
+ { "shdr_sub", "shdr", acl_parse_str, acl_match_sub, ACL_USE_L7RTR_VOLATILE, val_hdr },
+ { "shdr_val", "shdr_val", acl_parse_int, acl_match_int, ACL_USE_L7RTR_VOLATILE, val_hdr },
- { "status", NULL, acl_parse_int, acl_match_int, ACL_USE_L7RTR_PERMANENT, 0 },
+ { "status", NULL, acl_parse_int, acl_match_int, ACL_USE_L7RTR_PERMANENT },
- { "url", "url", acl_parse_str, acl_match_str, ACL_USE_L7REQ_VOLATILE, 0 },
- { "url_beg", "url", acl_parse_str, acl_match_beg, ACL_USE_L7REQ_VOLATILE, 0 },
- { "url_dir", "url", acl_parse_str, acl_match_dir, ACL_USE_L7REQ_VOLATILE, 0 },
- { "url_dom", "url", acl_parse_str, acl_match_dom, ACL_USE_L7REQ_VOLATILE, 0 },
- { "url_end", "url", acl_parse_str, acl_match_end, ACL_USE_L7REQ_VOLATILE, 0 },
- { "url_ip", "url_ip", acl_parse_ip, acl_match_ip, ACL_USE_L7REQ_VOLATILE, 0 },
- { "url_len", "url", acl_parse_int, acl_match_len, ACL_USE_L7REQ_VOLATILE, 0 },
- { "url_port", "url_port", acl_parse_int, acl_match_int, ACL_USE_L7REQ_VOLATILE, 0 },
- { "url_reg", "url", acl_parse_reg, acl_match_reg, ACL_USE_L7REQ_VOLATILE, 0 },
- { "url_sub", "url", acl_parse_str, acl_match_sub, ACL_USE_L7REQ_VOLATILE, 0 },
+ { "url", "url", acl_parse_str, acl_match_str, ACL_USE_L7REQ_VOLATILE },
+ { "url_beg", "url", acl_parse_str, acl_match_beg, ACL_USE_L7REQ_VOLATILE },
+ { "url_dir", "url", acl_parse_str, acl_match_dir, ACL_USE_L7REQ_VOLATILE },
+ { "url_dom", "url", acl_parse_str, acl_match_dom, ACL_USE_L7REQ_VOLATILE },
+ { "url_end", "url", acl_parse_str, acl_match_end, ACL_USE_L7REQ_VOLATILE },
+ { "url_ip", "url_ip", acl_parse_ip, acl_match_ip, ACL_USE_L7REQ_VOLATILE },
+ { "url_len", "url", acl_parse_int, acl_match_len, ACL_USE_L7REQ_VOLATILE },
+ { "url_port", "url_port", acl_parse_int, acl_match_int, ACL_USE_L7REQ_VOLATILE },
+ { "url_reg", "url", acl_parse_reg, acl_match_reg, ACL_USE_L7REQ_VOLATILE },
+ { "url_sub", "url", acl_parse_str, acl_match_sub, ACL_USE_L7REQ_VOLATILE },
- { "urlp", "urlp", acl_parse_str, acl_match_str, ACL_USE_L7REQ_VOLATILE, ARG2(1,STR,STR) },
- { "urlp_beg", "urlp", acl_parse_str, acl_match_beg, ACL_USE_L7REQ_VOLATILE, ARG2(1,STR,STR) },
- { "urlp_dir", "urlp", acl_parse_str, acl_match_dir, ACL_USE_L7REQ_VOLATILE, ARG2(1,STR,STR) },
- { "urlp_dom", "urlp", acl_parse_str, acl_match_dom, ACL_USE_L7REQ_VOLATILE, ARG2(1,STR,STR) },
- { "urlp_end", "urlp", acl_parse_str, acl_match_end, ACL_USE_L7REQ_VOLATILE, ARG2(1,STR,STR) },
- { "urlp_ip", "urlp", acl_parse_ip, acl_match_ip, ACL_USE_L7REQ_VOLATILE, ARG2(1,STR,STR) },
- { "urlp_len", "urlp", acl_parse_int, acl_match_len, ACL_USE_L7REQ_VOLATILE, ARG2(1,STR,STR) },
- { "urlp_reg", "urlp", acl_parse_reg, acl_match_reg, ACL_USE_L7REQ_VOLATILE, ARG2(1,STR,STR) },
- { "urlp_sub", "urlp", acl_parse_str, acl_match_sub, ACL_USE_L7REQ_VOLATILE, ARG2(1,STR,STR) },
- { "urlp_val", "urlp_val", acl_parse_int, acl_match_int, ACL_USE_L7REQ_VOLATILE, ARG2(1,STR,STR) },
+ { "urlp", "urlp", acl_parse_str, acl_match_str, ACL_USE_L7REQ_VOLATILE },
+ { "urlp_beg", "urlp", acl_parse_str, acl_match_beg, ACL_USE_L7REQ_VOLATILE },
+ { "urlp_dir", "urlp", acl_parse_str, acl_match_dir, ACL_USE_L7REQ_VOLATILE },
+ { "urlp_dom", "urlp", acl_parse_str, acl_match_dom, ACL_USE_L7REQ_VOLATILE },
+ { "urlp_end", "urlp", acl_parse_str, acl_match_end, ACL_USE_L7REQ_VOLATILE },
+ { "urlp_ip", "urlp", acl_parse_ip, acl_match_ip, ACL_USE_L7REQ_VOLATILE },
+ { "urlp_len", "urlp", acl_parse_int, acl_match_len, ACL_USE_L7REQ_VOLATILE },
+ { "urlp_reg", "urlp", acl_parse_reg, acl_match_reg, ACL_USE_L7REQ_VOLATILE },
+ { "urlp_sub", "urlp", acl_parse_str, acl_match_sub, ACL_USE_L7REQ_VOLATILE },
+ { "urlp_val", "urlp_val", acl_parse_int, acl_match_int, ACL_USE_L7REQ_VOLATILE },
{ /* END */ },
}};