]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - docs/man/man3/connection.3
ce72610f8cce75c433d3cfcf84a27bcf5eef42fd
[user/henk/code/inspircd.git] / docs / man / man3 / connection.3
1 .TH "connection" 3 "12 May 2005" "InspIRCd" \" -*- nroff -*-
2 .ad l
3 .nh
4 .SH NAME
5 connection \- Please note: classes serverrec and userrec both inherit from class connection.  
6
7 .PP
8 .SH SYNOPSIS
9 .br
10 .PP
11 \fC#include <connection.h>\fP
12 .PP
13 Inherits \fBExtensible\fP.
14 .PP
15 Inherited by \fBserverrec\fP, and \fBuserrec\fP.
16 .PP
17 .SS "Public Member Functions"
18
19 .in +1c
20 .ti -1c
21 .RI "\fBconnection\fP ()"
22 .br
23 .RI "\fIDefault constructor. \fP"
24 .ti -1c
25 .RI "bool \fBCreateListener\fP (char *\fBhost\fP, int p)"
26 .br
27 .RI "\fICreate a listening socket on 'host' using port number 'p'. \fP"
28 .ti -1c
29 .RI "bool \fBBeginLink\fP (char *targethost, int \fBport\fP, char *password, char *servername, int myport)"
30 .br
31 .RI "\fIBegin an outbound link to another ircd at targethost. \fP"
32 .ti -1c
33 .RI "bool \fBMeshCookie\fP (char *targethost, int \fBport\fP, unsigned long cookie, char *servername)"
34 .br
35 .RI "\fIBegin an outbound mesh link to another ircd on a network you are already an authenticated member of. \fP"
36 .ti -1c
37 .RI "void \fBTerminateLink\fP (char *targethost)"
38 .br
39 .RI "\fITerminate a link to 'targethost' by calling the \fBircd_connector::CloseConnection\fP method. \fP"
40 .ti -1c
41 .RI "bool \fBSendPacket\fP (char *message, const char *\fBhost\fP)"
42 .br
43 .RI "\fISend a message to a server by name, if the server is unavailable directly route the packet via another server If the server still cannot be reached after attempting to route the message remotely, returns false. \fP"
44 .ti -1c
45 .RI "bool \fBRecvPacket\fP (std::deque< std::string > &messages, char *\fBhost\fP)"
46 .br
47 .RI "\fIReturns the next available packet and returns true if data is available. \fP"
48 .ti -1c
49 .RI "\fBircd_connector\fP * \fBFindHost\fP (std::string \fBhost\fP)"
50 .br
51 .RI "\fIFind the \fBircd_connector\fP oject related to a certain servername given in 'host'. \fP"
52 .ti -1c
53 .RI "bool \fBAddIncoming\fP (int \fBfd\fP, char *targethost, int sourceport)"
54 .br
55 .RI "\fIAdd an incoming connection to the connection pool. \fP"
56 .in -1c
57 .SS "Public Attributes"
58
59 .in +1c
60 .ti -1c
61 .RI "int \fBfd\fP"
62 .br
63 .RI "\fIFile descriptor of the connection. \fP"
64 .ti -1c
65 .RI "char \fBhost\fP [256]"
66 .br
67 .RI "\fIHostname of connection. \fP"
68 .ti -1c
69 .RI "char \fBip\fP [32]"
70 .br
71 .RI "\fIIP of connection. \fP"
72 .ti -1c
73 .RI "char \fBinbuf\fP [MAXBUF]"
74 .br
75 .RI "\fIInbuf of connection. \fP"
76 .ti -1c
77 .RI "long \fBbytes_in\fP"
78 .br
79 .RI "\fIStats counter for bytes inbound. \fP"
80 .ti -1c
81 .RI "long \fBbytes_out\fP"
82 .br
83 .RI "\fIStats counter for bytes outbound. \fP"
84 .ti -1c
85 .RI "long \fBcmds_in\fP"
86 .br
87 .RI "\fIStats counter for commands inbound. \fP"
88 .ti -1c
89 .RI "long \fBcmds_out\fP"
90 .br
91 .RI "\fIStats counter for commands outbound. \fP"
92 .ti -1c
93 .RI "bool \fBhaspassed\fP"
94 .br
95 .RI "\fITrue if server/user has authenticated, false if otherwise. \fP"
96 .ti -1c
97 .RI "int \fBport\fP"
98 .br
99 .RI "\fIPort number For a userrec, this is the port they connected to the network on. \fP"
100 .ti -1c
101 .RI "int \fBregistered\fP"
102 .br
103 .RI "\fIUsed by userrec to indicate the registration status of the connection. \fP"
104 .ti -1c
105 .RI "short int \fBstate\fP"
106 .br
107 .RI "\fIReserved for future use. \fP"
108 .ti -1c
109 .RI "time_t \fBlastping\fP"
110 .br
111 .RI "\fITime the connection was last pinged. \fP"
112 .ti -1c
113 .RI "time_t \fBsignon\fP"
114 .br
115 .RI "\fITime the connection was created, set in the constructor. \fP"
116 .ti -1c
117 .RI "time_t \fBidle_lastmsg\fP"
118 .br
119 .RI "\fITime that the connection last sent data, used to calculate idle time. \fP"
120 .ti -1c
121 .RI "time_t \fBnping\fP"
122 .br
123 .RI "\fIUsed by PING checks with clients. \fP"
124 .ti -1c
125 .RI "char \fBinternal_addr\fP [MAXBUF]"
126 .br
127 .RI "\fIUnused, will be removed in a future alpha/beta. \fP"
128 .ti -1c
129 .RI "int \fBinternal_port\fP"
130 .br
131 .RI "\fIUnused, will be removed in a future alpha/beta. \fP"
132 .ti -1c
133 .RI "std::vector< \fBircd_connector\fP > \fBconnectors\fP"
134 .br
135 .RI "\fIWith a serverrec, this is a list of all established server connections. \fP"
136 .in -1c
137 .SH "Detailed Description"
138 .PP 
139 Please note: classes serverrec and userrec both inherit from class connection. Definition at line 210 of file connection.h.
140 .SH "Constructor & Destructor Documentation"
141 .PP 
142 .SS "connection::connection ()"
143 .PP
144 Default constructor. 
145 .SH "Member Function Documentation"
146 .PP 
147 .SS "bool connection::AddIncoming (int fd, char * targethost, int sourceport)"
148 .PP
149 Add an incoming connection to the connection pool. (reserved for core use)
150 .SS "bool connection::BeginLink (char * targethost, int port, char * password, char * servername, int myport)"
151 .PP
152 Begin an outbound link to another ircd at targethost. 
153 .SS "bool connection::CreateListener (char * host, int p)"
154 .PP
155 Create a listening socket on 'host' using port number 'p'. 
156 .SS "\fBircd_connector\fP* connection::FindHost (std::string host)"
157 .PP
158 Find the \fBircd_connector\fP oject related to a certain servername given in 'host'. 
159 .SS "bool connection::MeshCookie (char * targethost, int port, unsigned long cookie, char * servername)"
160 .PP
161 Begin an outbound mesh link to another ircd on a network you are already an authenticated member of. 
162 .SS "bool connection::RecvPacket (std::deque< std::string > & messages, char * host)"
163 .PP
164 Returns the next available packet and returns true if data is available. Writes the servername the data came from to 'host'. If no data is available this function returns false. This function will automatically close broken links and reroute pathways, generating split messages on the network.
165 .SS "bool connection::SendPacket (char * message, const char * host)"
166 .PP
167 Send a message to a server by name, if the server is unavailable directly route the packet via another server If the server still cannot be reached after attempting to route the message remotely, returns false. 
168 .SS "void connection::TerminateLink (char * targethost)"
169 .PP
170 Terminate a link to 'targethost' by calling the \fBircd_connector::CloseConnection\fP method. 
171 .SH "Member Data Documentation"
172 .PP 
173 .SS "long \fBconnection::bytes_in\fP"
174 .PP
175 Stats counter for bytes inbound. Definition at line 231 of file connection.h.
176 .PP
177 Referenced by userrec::userrec().
178 .SS "long \fBconnection::bytes_out\fP"
179 .PP
180 Stats counter for bytes outbound. Definition at line 235 of file connection.h.
181 .PP
182 Referenced by userrec::FlushWriteBuf(), and userrec::userrec().
183 .SS "long \fBconnection::cmds_in\fP"
184 .PP
185 Stats counter for commands inbound. Definition at line 239 of file connection.h.
186 .PP
187 Referenced by userrec::userrec().
188 .SS "long \fBconnection::cmds_out\fP"
189 .PP
190 Stats counter for commands outbound. Definition at line 243 of file connection.h.
191 .PP
192 Referenced by userrec::FlushWriteBuf(), and userrec::userrec().
193 .SS "std::vector<\fBircd_connector\fP> \fBconnection::connectors\fP"
194 .PP
195 With a serverrec, this is a list of all established server connections. With a userrec this is unused.Definition at line 290 of file connection.h.
196 .SS "int \fBconnection::fd\fP"
197 .PP
198 File descriptor of the connection. Definition at line 215 of file connection.h.
199 .PP
200 Referenced by ConfigReader::DumpErrors(), Server::PseudoToUser(), Server::SendTo(), serverrec::serverrec(), userrec::userrec(), and Server::UserToPseudo().
201 .SS "bool \fBconnection::haspassed\fP"
202 .PP
203 True if server/user has authenticated, false if otherwise. Definition at line 247 of file connection.h.
204 .PP
205 Referenced by userrec::userrec().
206 .SS "char \fBconnection::host\fP[256]"
207 .PP
208 Hostname of connection. Not used if this is a serverrecDefinition at line 219 of file connection.h.
209 .PP
210 Referenced by userrec::GetFullRealHost(), Server::PseudoToUser(), userrec::userrec(), and Server::UserToPseudo().
211 .SS "time_t \fBconnection::idle_lastmsg\fP"
212 .PP
213 Time that the connection last sent data, used to calculate idle time. Definition at line 273 of file connection.h.
214 .PP
215 Referenced by userrec::userrec().
216 .SS "char \fBconnection::inbuf\fP[MAXBUF]"
217 .PP
218 Inbuf of connection. Only used for userrecDefinition at line 227 of file connection.h.
219 .PP
220 Referenced by userrec::userrec().
221 .SS "char \fBconnection::internal_addr\fP[MAXBUF]"
222 .PP
223 Unused, will be removed in a future alpha/beta. Definition at line 281 of file connection.h.
224 .SS "int \fBconnection::internal_port\fP"
225 .PP
226 Unused, will be removed in a future alpha/beta. Definition at line 285 of file connection.h.
227 .SS "char \fBconnection::ip\fP[32]"
228 .PP
229 IP of connection. Reserved for future use.Definition at line 223 of file connection.h.
230 .PP
231 Referenced by userrec::userrec().
232 .SS "time_t \fBconnection::lastping\fP"
233 .PP
234 Time the connection was last pinged. Definition at line 265 of file connection.h.
235 .PP
236 Referenced by serverrec::serverrec(), and userrec::userrec().
237 .SS "time_t \fBconnection::nping\fP"
238 .PP
239 Used by PING checks with clients. Definition at line 277 of file connection.h.
240 .PP
241 Referenced by userrec::userrec().
242 .SS "int \fBconnection::port\fP"
243 .PP
244 Port number For a userrec, this is the port they connected to the network on. For a serverrec this is the current listening port of the serverrec object.Definition at line 253 of file connection.h.
245 .PP
246 Referenced by userrec::userrec().
247 .SS "int \fBconnection::registered\fP"
248 .PP
249 Used by userrec to indicate the registration status of the connection. Definition at line 257 of file connection.h.
250 .PP
251 Referenced by userrec::userrec().
252 .SS "time_t \fBconnection::signon\fP"
253 .PP
254 Time the connection was created, set in the constructor. Definition at line 269 of file connection.h.
255 .PP
256 Referenced by serverrec::serverrec(), and userrec::userrec().
257 .SS "short int \fBconnection::state\fP"
258 .PP
259 Reserved for future use. Definition at line 261 of file connection.h.
260
261 .SH "Author"
262 .PP 
263 Generated automatically by Doxygen for InspIRCd from the source code.