]> git.ipfire.org Git - thirdparty/suricata.git/commit
interval-tree: add augmentation fns to the tree
authorShivani Bhardwaj <shivani@oisf.net>
Mon, 29 Jan 2024 06:08:51 +0000 (11:38 +0530)
committerVictor Julien <victor@inliniac.net>
Mon, 4 Mar 2024 10:50:30 +0000 (11:50 +0100)
commitd36d03a4289e03b61cdd3617607bf0df1ce4d706
treec595b3191d9fb99942ea39b1899c941dcad9dba0
parent30b6e4d368b4b4ad58322ee7781d10c009133374
interval-tree: add augmentation fns to the tree

An interval tree uses red-black tree as its base data structure and
follows all the properties of a usual red-black tree. The additional
params are:
1. An interval such as [low, high] per node.
2. A max attribute per node. This attribute stores the maximum high
   value of any subtree rooted at this node.

At any point in time, an inorder traversal of an interval tree should
give the port ranges sorted by the low key in ascending order.

This commit modifies the IRB_AUGMENT macro and it's call sites to make
sure that on every insertion, the max attribute of the tree is properly
updated.

Ticket 6792
Bug 6414
src/Makefile.am
src/interval-tree.h