File: UserAcct.h

package info (click to toggle)
openvpn-auth-radius 2.1-7
  • links: PTS
  • area: main
  • in suites: buster
  • size: 1,516 kB
  • sloc: cpp: 8,479; perl: 323; makefile: 48
file content (89 lines) | stat: -rw-r--r-- 2,419 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/*
 *  radiusplugin -- An OpenVPN plugin for do radius authentication 
 *					and accounting.
 * 
 *  Copyright (C) 2005 EWE TEL GmbH/Ralf Luebben <ralfluebben@gmx.de>
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */
 
#ifndef _USER_ACCT_H_
#define _USER_ACCT_H_
#include <time.h>
#include <string.h>
#include "RadiusClass/RadiusPacket.h"
//#include "openvpn-plugin.h"
#include "User.h"
#include "UserPlugin.h"
#include "PluginContext.h"



/** The class represents a user in the accounting background process. The class is
 * derived from the User class. This class defined additonal attributes
 * for accouting a user.*/

class UserAcct : public User
{
private:
	uint32_t gigain;		/**< The received bytes.*/
	uint32_t gigaout;		/**< The sent bytes.*/
	uint32_t bytesin;		/**< The received bytes.*/
	uint32_t bytesout;		/**< The sent bytes.*/
	time_t nextupdate;		/**< The next update time.*/
	time_t starttime;		/**< The start time of the connection.*/
	
public:
	
	
	
	UserAcct();
	~UserAcct();
	
	int getServiceType(void);
	void setServiceType(int);
	
	uint32_t getGigaIn(void);
	void setGigaIn(uint32_t);
	
	uint32_t getGigaOut(void);
	void setGigaOut(uint32_t);
	
	uint32_t getBytesIn(void);
	void setBytesIn(uint32_t);
	
	uint32_t getBytesOut(void);
	void setBytesOut(uint32_t);
	
	time_t getStarttime(void);
	void setStarttime(time_t);
	
	time_t getNextUpdate(void);
	void setNextUpdate(time_t);
	
	
	UserAcct & operator=(const UserAcct &);
	
	UserAcct(const UserAcct &);
	
	int sendUpdatePacket(PluginContext *);
	int sendStartPacket(PluginContext *);
	int sendStopPacket(PluginContext *);
	void addSystemRoutes(PluginContext * );
	void delSystemRoutes(PluginContext * context);	
	int deleteCcdFile(PluginContext *);
};

#endif //_USER_ACCT_H_