From 6e05022104fe92e54c5f7d7de4e87fa8e5ca2d0d Mon Sep 17 00:00:00 2001 From: Maxim Mamontov Date: Wed, 31 Aug 2011 13:01:02 +0300 Subject: [PATCH 1/1] Add rules count method to the traffcounter iface --- include/stg/traffcounter.h | 1 + projects/stargazer/traffcounter_impl.h | 2 ++ 2 files changed, 3 insertions(+) diff --git a/include/stg/traffcounter.h b/include/stg/traffcounter.h index 1962ee7a..75c8c481 100644 --- a/include/stg/traffcounter.h +++ b/include/stg/traffcounter.h @@ -26,6 +26,7 @@ class TRAFFCOUNTER { public: virtual void Process(const RAW_PACKET & rawPacket) = 0; + virtual size_t RulesCount() const = 0; }; #endif diff --git a/projects/stargazer/traffcounter_impl.h b/projects/stargazer/traffcounter_impl.h index 7d01c2e4..225a636e 100644 --- a/projects/stargazer/traffcounter_impl.h +++ b/projects/stargazer/traffcounter_impl.h @@ -173,6 +173,8 @@ public: void Process(const RAW_PACKET & rawPacket); void SetMonitorDir(const std::string & monitorDir); + size_t RulesCount() const { return rules.size(); } + private: bool ParseAddress(const char * ta, RULE * rule) const; uint32_t CalcMask(uint32_t msk) const; -- 2.44.2