]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - include/connection.h
Re-added required parts of connection.h
[user/henk/code/inspircd.git] / include / connection.h
1 /*       +------------------------------------+
2  *       | Inspire Internet Relay Chat Daemon |
3  *       +------------------------------------+
4  *
5  *  Inspire is copyright (C) 2002-2004 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 #include "inspircd_config.h"
18 #include "base.h"
19 #include <string>
20 #include <map>
21 #include <sys/types.h>
22 #include <sys/socket.h>
23 #include <netdb.h>
24 #include <netinet/in.h>
25 #include <unistd.h>
26 #include <errno.h>
27 #include <time.h>
28 #include <vector>
29 #include <deque>
30 #include <sstream>
31
32 #ifndef __CONNECTION_H__
33 #define __CONNECTION_H__
34
35 /** Please note: classes serverrec and userrec both inherit from class connection.
36  */
37 class connection : public Extensible
38 {
39  public:
40         /** File descriptor of the connection
41          */
42         int fd;
43         
44         /** Hostname of connection. Not used if this is a serverrec
45          */
46         char host[160];
47         
48         /** IP of connection.
49          */
50         char ip[16];
51         
52         /** Stats counter for bytes inbound
53          */
54         int bytes_in;
55
56         /** Stats counter for bytes outbound
57          */
58         int bytes_out;
59
60         /** Stats counter for commands inbound
61          */
62         int cmds_in;
63
64         /** Stats counter for commands outbound
65          */
66         int cmds_out;
67
68         /** True if server/user has authenticated, false if otherwise
69          */
70         bool haspassed;
71
72         /** Port number
73          * For a userrec, this is the port they connected to the network on.
74          * For a serverrec this is the current listening port of the serverrec object.
75          */
76         int port;
77         
78         /** Used by userrec to indicate the registration status of the connection
79          */
80         char registered;
81         
82         /** Time the connection was last pinged
83          */
84         time_t lastping;
85         
86         /** Time the connection was created, set in the constructor
87          */
88         time_t signon;
89         
90         /** Time that the connection last sent data, used to calculate idle time
91          */
92         time_t idle_lastmsg;
93         
94         /** Used by PING checks with clients
95          */
96         time_t nping;
97         
98         /** Default constructor
99          */
100         connection();
101 };
102
103
104 #endif
105
106