2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation; either version 2 of the License, or
5 * (at your option) any later version.
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 * Author : Boris Mikhailenko <stg34@stargazer.dp.ua>
23 $Date: 2010/03/11 14:42:05 $
34 #include "resetable.h"
35 #include "user_traff.h"
36 //-----------------------------------------------------------------------------
39 #ifdef TRAFF_STAT_WITH_PORTS
40 IP_DIR_PAIR(uint32_t _ip,
48 IP_DIR_PAIR(uint32_t _ip,
54 //------------------------
55 bool operator<(const IP_DIR_PAIR & idp) const
63 #ifdef TRAFF_STAT_WITH_PORTS
76 //------------------------
77 bool operator!=(const IP_DIR_PAIR & rvalue) const
82 #ifdef TRAFF_STAT_WITH_PORTS
83 if (port != rvalue.port)
87 if (dir != rvalue.dir)
92 //------------------------
95 #ifdef TRAFF_STAT_WITH_PORTS
99 //-----------------------------------------------------------------------------
102 STAT_NODE(uint64_t _up,
113 //-----------------------------------------------------------------------------
116 //USER_STAT & operator= (const USER_STAT_RES & usr);
133 time_t lastCashAddTime;
135 time_t lastActivityTime;
137 //-----------------------------------------------------------------------------
138 typedef std::map<IP_DIR_PAIR, STAT_NODE> TRAFF_STAT;
139 //-----------------------------------------------------------------------------
153 USER_STAT_RES & operator= (const USER_STAT & us)
157 lastCashAdd = us.lastCashAdd;
158 lastCashAddTime = us.lastCashAddTime;
159 passiveTime = us.passiveTime;
160 lastActivityTime = us.lastActivityTime;
170 us.lastCashAdd = lastCashAdd;
171 us.lastCashAddTime = lastCashAddTime;
172 us.passiveTime = passiveTime;
173 us.lastActivityTime = lastActivityTime;
179 RESETABLE<double> cash;
180 RESETABLE<double> freeMb;
181 RESETABLE<double> lastCashAdd;
182 RESETABLE<time_t> lastCashAddTime;
183 RESETABLE<time_t> passiveTime;
184 RESETABLE<time_t> lastActivityTime;
185 RESETABLE<DIR_TRAFF> up;
186 RESETABLE<DIR_TRAFF> down;
188 //-----------------------------------------------------------------------------