MEDIUM: pattern: Index IPv6 addresses in a tree.
This commit adds second tree node in the pattern struct and use it to
index IPv6 addresses. This commit report feature used in the list. If
IPv4 not match the tree, try to convert the IPv4 address in IPv6 with
prefixing the IPv4 address by "::ffff", after this operation, the match
function try lookup in the IPv6 tree. If the IPv6 sample dont match the
IPv6 tree, try to convert the IPv6 addresses prefixed by "2002:IPv4",
"::ffff:IPv4" and "::0000:IPv4" in IPv4 address. after this operation,
the match function try lookup in the IPv4 tree.
diff --git a/include/types/pattern.h b/include/types/pattern.h
index 7a28171..9622888 100644
--- a/include/types/pattern.h
+++ b/include/types/pattern.h
@@ -160,6 +160,7 @@
struct pattern *(*match)(struct sample *, struct pattern_expr *, int);
struct list patterns; /* list of acl_patterns */
struct eb_root pattern_tree; /* may be used for lookup in large datasets */
+ struct eb_root pattern_tree_2; /* may be used for different types */
};
extern char *pat_match_names[PAT_MATCH_NUM];