#define USER_STAT_H
#include <ctime>
+#include <map>
#include "os_int.h"
#include "resetable.h"
return false;
}
//------------------------
+ bool operator!=(const IP_DIR_PAIR & rvalue) const
+ {
+ if (ip != rvalue.ip)
+ return true;
+
+ #ifdef TRAFF_STAT_WITH_PORTS
+ if (port != rvalue.port)
+ return true;
+ #endif
+
+ if (dir != rvalue.dir)
+ return true;
+
+ return false;
+ }
+ //------------------------
uint32_t ip;
int dir;
#ifdef TRAFF_STAT_WITH_PORTS
time_t lastActivityTime;
};
//-----------------------------------------------------------------------------
+typedef std::map<IP_DIR_PAIR, STAT_NODE> TRAFF_STAT;
+//-----------------------------------------------------------------------------
struct USER_STAT_RES
{
USER_STAT_RES()
down = us.down;
return * this;
};
- operator USER_STAT()
+ operator USER_STAT() const
{
USER_STAT us;
us.cash = cash;