]> git.stg.codes - stg.git/blobdiff - projects/stargazer/traffcounter_impl.h
Various fixes of issues reported by static analyzers.
[stg.git] / projects / stargazer / traffcounter_impl.h
index 7e552f82c186e2eab2c179c72ecb2d0d972a43ca..a1dfa74303aa8a4844fcf443550a53b712b4b359 100644 (file)
 #ifndef TRAFFCOUNTER_IMPL_H
 #define TRAFFCOUNTER_IMPL_H
 
-#include <pthread.h>
-
-#include <ctime>
-#include <list>
-#include <map>
-#include <string>
-
 #include "stg/traffcounter.h"
 #include "stg/os_int.h"
 #include "stg/logger.h"
 #include "eventloop.h"
 #include "user_impl.h"
 
+#include <ctime>
+#include <list>
+#include <map>
+#include <string>
+
+#include <pthread.h>
+
 #define PROTOMAX    (5)
 
 class USERS_IMPL;
@@ -147,7 +147,7 @@ private:
 //-----------------------------------------------------------------------------
 class ADD_USER_NONIFIER: public NOTIFIER_BASE<USER_IMPL_PTR> {
 public:
-            ADD_USER_NONIFIER(TRAFFCOUNTER_IMPL & t) :
+            explicit ADD_USER_NONIFIER(TRAFFCOUNTER_IMPL & t) :
                 NOTIFIER_BASE<USER_IMPL_PTR>(),
                 traffCnt(t)
             {}
@@ -163,7 +163,7 @@ private:
 //-----------------------------------------------------------------------------
 class DEL_USER_NONIFIER: public NOTIFIER_BASE<USER_IMPL_PTR> {
 public:
-            DEL_USER_NONIFIER(TRAFFCOUNTER_IMPL & t) :
+            explicit DEL_USER_NONIFIER(TRAFFCOUNTER_IMPL & t) :
                 NOTIFIER_BASE<USER_IMPL_PTR>(),
                 traffCnt(t)
             {}
@@ -186,8 +186,6 @@ public:
     TRAFFCOUNTER_IMPL(USERS_IMPL * users, const std::string & rulesFileName);
     ~TRAFFCOUNTER_IMPL();
 
-    void        SetRulesFile(const std::string & rulesFileName);
-
     int         Reload();
     int         Start();
     int         Stop();
@@ -204,7 +202,6 @@ private:
     bool        ParseAddress(const char * ta, RULE * rule) const;
     uint32_t    CalcMask(uint32_t msk) const;
     void        FreeRules();
-    void        PrintRule(RULE rule) const;
     bool        ReadRules(bool test = false);
 
     static void * Run(void * data);