Better tracking of rule counts per ruleset (#645)

Add more accurate tracking of the number of falco rules loaded per
ruleset, which are made available via the engine method
::num_rules_for_ruleset().

In the ruleset objects, keep track if a filter wrapper is actually
added/removed and if so increment/decrement the count.
This commit is contained in:
Mark Stemm
2019-06-05 13:44:50 -07:00
committed by GitHub
parent de8b92fa05
commit 43bfaecff5
4 changed files with 66 additions and 7 deletions

View File

@@ -106,6 +106,11 @@ public:
//
uint16_t find_ruleset_id(const std::string &ruleset);
//
// Return the number of falco rules enabled for the provided ruleset
//
uint64_t num_rules_for_ruleset(const std::string &ruleset);
//
// Print details on the given rule. If rule is NULL, print
// details on all rules.