]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - include/connection.h
Extra checking that the fd's we pass to SocketEngine::AddFd were added (a lot of...
[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
24 class connection : public Extensible
25 {
26  public:
27         /** File descriptor of the connection
28          */
29         int fd;
30         
31         /** Hostname of connection
32          */
33         char host[65];
34
35         /** Stats counter for bytes inbound
36          */
37         int bytes_in;
38
39         /** Stats counter for bytes outbound
40          */
41         int bytes_out;
42
43         /** Stats counter for commands inbound
44          */
45         int cmds_in;
46
47         /** Stats counter for commands outbound
48          */
49         int cmds_out;
50
51         /** True if user has authenticated, false if otherwise
52          */
53         bool haspassed;
54
55         /** Used by userrec to indicate the registration status of the connection
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
64          */
65         time_t signon;
66         
67         /** Time that the connection last sent data, used to calculate idle time
68          */
69         time_t idle_lastmsg;
70         
71         /** Used by PING checks with clients
72          */
73         time_t nping;
74         
75         /** Default constructor
76          */
77         connection()
78         {
79                 this->fd = -1;
80         }
81 };
82
83
84 #endif