#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;
//-----------------------------------------------------------------------------
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)
{}
//-----------------------------------------------------------------------------
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)
{}
TRAFFCOUNTER_IMPL(USERS_IMPL * users, const std::string & rulesFileName);
~TRAFFCOUNTER_IMPL();
- void SetRulesFile(const std::string & rulesFileName);
-
int Reload();
int Start();
int Stop();
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);