]> git.stg.codes - stg.git/blobdiff - include/user_stat.h
Теперь PRIV при конструировании ADMIN_CONF передается по ссылке (ранее
[stg.git] / include / user_stat.h
index eeb73df682506720ad44e99cf491d797f9f98863..fd0e79a01d55e05c0f176e6d8f4a440756f3168a 100644 (file)
@@ -28,6 +28,7 @@
 #define USER_STAT_H
 
 #include <ctime>
+#include <map>
 
 #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<IP_DIR_PAIR, STAT_NODE> TRAFF_STAT;
+//-----------------------------------------------------------------------------
 struct USER_STAT_RES
 {
     USER_STAT_RES()