]> git.ipfire.org Git - thirdparty/haproxy.git/commit
[MEDIUM] acl: add ability to insert patterns in trees
authorWilly Tarreau <w@1wt.eu>
Tue, 11 May 2010 21:25:05 +0000 (23:25 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 13 May 2010 19:37:41 +0000 (21:37 +0200)
commite56cda9a6a6f9f5a617b341d9f57b0704fe04179
treea03308d45f91ceb06ef75ac6118890a345bbcb4b
parent438b0f3f0fb5f0e221f72323247d914bdc182aeb
[MEDIUM] acl: add ability to insert patterns in trees

The code is now ready to support loading pattern from filesinto trees. For
that, it will be required that the ACL keyword has a flag ACL_MAY_LOOKUP
and that the expr is case sensitive. When that is true, the pattern will
have a flag ACL_PAT_F_TREE_OK to indicate that it is possible to feed the
tree instead of a usual pattern if the parsing function is able to do this.
The tree's root is pre-initialized in the pattern's value so that the
function can easily find it. At that point, if the parsing function decides
to use the tree, it just sets ACL_PAT_F_TREE in the return flags so that
the caller knows the tree has been used and the pattern can be recycled.

That way it will be possible to load some patterns into the tree when it
is compatible, and other ones as linear linked lists. A good example of
this might be IPv4 network entries : right now we support holes in masks,
but this very rare feature is not compatible with binary lookup in trees.
So the parser will be able to decide itself whether the pattern can go to
the tree or not.
include/types/acl.h
src/acl.c