X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/641204dfbdb9fc870cdd2e7f9e3169a44693e7bf..358f6f19f4a1a62e7eec6f83c99ad98a2e3e38ee:/include/user_stat.h diff --git a/include/user_stat.h b/include/user_stat.h index eeb73df6..fd0e79a0 100644 --- a/include/user_stat.h +++ b/include/user_stat.h @@ -28,6 +28,7 @@ #define USER_STAT_H #include +#include #include "os_int.h" #include "resetable.h" @@ -73,6 +74,22 @@ struct IP_DIR_PAIR 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 @@ -118,6 +135,8 @@ struct USER_STAT time_t lastActivityTime; }; //----------------------------------------------------------------------------- +typedef std::map TRAFF_STAT; +//----------------------------------------------------------------------------- struct USER_STAT_RES { USER_STAT_RES()