Define ordering on Rule instances and use on sets in RuleMatcher

Establishing reliable ordering fixes a test failure we're seeing on Alpine for
the signatures/tcp-end-of-match btest, since discrepancies in rule match
traversal could lead to discrepancies in corresponding event ordering.
This commit is contained in:
Christian Kreibich 2024-11-14 16:30:11 -08:00
parent 42cf86b503
commit 2e03fbb8b0
3 changed files with 13 additions and 4 deletions

View file

@ -59,6 +59,9 @@ public:
void PrintDebug();
bool operator==(const Rule& other) { return strcmp(ID(), other.ID()) == 0; }
bool operator<(const Rule& other) { return strcmp(ID(), other.ID()) < 0; }
static const char* TypeToString(Rule::PatternType type);
private: