]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - include/connection.h
In the grand tradition of huge fucking commits:
[user/henk/code/inspircd.git] / include / connection.h
1 /*       +------------------------------------+
2  *       | Inspire Internet Relay Chat Daemon |
3  *       +------------------------------------+
4  *
5  *  InspIRCd: (C) 2002-2007 InspIRCd Development Team
6  * See: http://www.inspircd.org/wiki/index.php/Credits
7  *
8  * This program is free but copyrighted software; see
9  *            the file COPYING for details.
10  *
11  * ---------------------------------------------------
12  */
13
14 #ifndef __CONNECTION_H__
15 #define __CONNECTION_H__
16
17 #include <time.h>
18 #include "inspircd_config.h"
19 #include "base.h"
20 #include "socketengine.h"
21
22 /** connection is the base class of User, and holds basic user properties.
23  * This can be extended for holding other user-like objects in the future.
24  */
25 class CoreExport connection : public EventHandler
26 {
27  public:
28         /** Hostname of connection.
29          * This should be valid as per RFC1035.
30          */
31         char host[65];
32
33         /** Stats counter for bytes inbound
34          */
35         int bytes_in;
36
37         /** Stats counter for bytes outbound
38          */
39         int bytes_out;
40
41         /** Stats counter for commands inbound
42          */
43         int cmds_in;
44
45         /** Stats counter for commands outbound
46          */
47         int cmds_out;
48
49         /** True if user has authenticated, false if otherwise
50          */
51         bool haspassed;
52
53         /** Used by User to indicate the registration status of the connection
54          * It is a bitfield of the REG_NICK, REG_USER and REG_ALL bits to indicate
55          * the connection state.
56          */
57         char registered;
58         
59         /** Time the connection was last pinged
60          */
61         time_t lastping;
62         
63         /** Time the connection was created, set in the constructor. This
64          * may be different from the time the user's classbase object was
65          * created.
66          */
67         time_t signon;
68         
69         /** Time that the connection last sent a message, used to calculate idle time
70          */
71         time_t idle_lastmsg;
72         
73         /** Used by PING checking code
74          */
75         time_t nping;
76 };
77
78
79 #endif