mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-02-10 07:27:56 +00:00
[MINOR] acl trees: add flags and union members to store values in trees
If we want to be able to match ACLs against a lot of possible values, we need to put those values in trees. That will only work for exact matches, which is normally just what is needed. Right now, only IPv4 and string matching are planned, but others might come later.
This commit is contained in:
parent
3a93244ed8
commit
438b0f3f0f
@ -30,6 +30,7 @@
|
||||
#include <types/proxy.h>
|
||||
#include <types/session.h>
|
||||
|
||||
#include <ebmbtree.h>
|
||||
|
||||
/* Pattern matching function result.
|
||||
*
|
||||
@ -100,6 +101,8 @@ enum {
|
||||
enum {
|
||||
ACL_PAT_F_IGNORE_CASE = 1 << 0, /* ignore case */
|
||||
ACL_PAT_F_FROM_FILE = 1 << 1, /* pattern comes from a file */
|
||||
ACL_PAT_F_TREE_OK = 1 << 2, /* the pattern parser is allowed to build a tree */
|
||||
ACL_PAT_F_TREE = 1 << 3, /* some patterns are arranged in a tree */
|
||||
};
|
||||
|
||||
/* what capabilities an ACL uses. These flags are set during parsing, which
|
||||
@ -165,6 +168,12 @@ enum {
|
||||
|
||||
/* any type of response information */
|
||||
ACL_USE_RTR_ANY = (ACL_USE_L4RTR_ANY | ACL_USE_L7RTR_ANY),
|
||||
|
||||
/* some flags indicating if a keyword supports exact pattern matching,
|
||||
* so that patterns may be arranged in lookup trees. Let's put those
|
||||
* flags at the end to leave some space for the other ones above.
|
||||
*/
|
||||
ACL_MAY_LOOKUP = 1 << 31, /* exact pattern lookup */
|
||||
};
|
||||
|
||||
/* filtering hooks */
|
||||
@ -297,6 +306,7 @@ struct acl_expr {
|
||||
} arg;
|
||||
int arg_len; /* optional argument length */
|
||||
struct list patterns; /* list of acl_patterns */
|
||||
struct eb_root pattern_tree; /* may be used for lookup in large datasets */
|
||||
};
|
||||
|
||||
struct acl {
|
||||
|
Loading…
Reference in New Issue
Block a user