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