From: Maxim Mamontov Date: Wed, 31 Aug 2011 10:01:02 +0000 (+0300) Subject: Add rules count method to the traffcounter iface X-Git-Tag: 2.408-alpha~19 X-Git-Url: https://git.stg.codes/stg.git/commitdiff_plain/6e05022104fe92e54c5f7d7de4e87fa8e5ca2d0d Add rules count method to the traffcounter iface --- 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;