]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - docs/man/man3/connection.3
New documentation on today's new methods etc
[user/henk/code/inspircd.git] / docs / man / man3 / connection.3
1 .TH "connection" 3 "14 Apr 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, 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 .ti -1c
57 .RI "long \fBGenKey\fP ()"
58 .br
59 .RI "\fIThis function is deprecated and may be removed in a later alpha/beta. \fP"
60 .in -1c
61 .SS "Public Attributes"
62
63 .in +1c
64 .ti -1c
65 .RI "int \fBfd\fP"
66 .br
67 .RI "\fIFile descriptor of the connection. \fP"
68 .ti -1c
69 .RI "char \fBhost\fP [256]"
70 .br
71 .RI "\fIHostname of connection. \fP"
72 .ti -1c
73 .RI "char \fBip\fP [32]"
74 .br
75 .RI "\fIIP of connection. \fP"
76 .ti -1c
77 .RI "char \fBinbuf\fP [MAXBUF]"
78 .br
79 .RI "\fIInbuf of connection. \fP"
80 .ti -1c
81 .RI "long \fBbytes_in\fP"
82 .br
83 .RI "\fIStats counter for bytes inbound. \fP"
84 .ti -1c
85 .RI "long \fBbytes_out\fP"
86 .br
87 .RI "\fIStats counter for bytes outbound. \fP"
88 .ti -1c
89 .RI "long \fBcmds_in\fP"
90 .br
91 .RI "\fIStats counter for commands inbound. \fP"
92 .ti -1c
93 .RI "long \fBcmds_out\fP"
94 .br
95 .RI "\fIStats counter for commands outbound. \fP"
96 .ti -1c
97 .RI "bool \fBhaspassed\fP"
98 .br
99 .RI "\fITrue if server/user has authenticated, false if otherwise. \fP"
100 .ti -1c
101 .RI "int \fBport\fP"
102 .br
103 .RI "\fIPort number For a userrec, this is the port they connected to the network on. \fP"
104 .ti -1c
105 .RI "int \fBregistered\fP"
106 .br
107 .RI "\fIUsed by userrec to indicate the registration status of the connection. \fP"
108 .ti -1c
109 .RI "short int \fBstate\fP"
110 .br
111 .RI "\fIReserved for future use. \fP"
112 .ti -1c
113 .RI "time_t \fBlastping\fP"
114 .br
115 .RI "\fITime the connection was last pinged. \fP"
116 .ti -1c
117 .RI "time_t \fBsignon\fP"
118 .br
119 .RI "\fITime the connection was created, set in the constructor. \fP"
120 .ti -1c
121 .RI "time_t \fBidle_lastmsg\fP"
122 .br
123 .RI "\fITime that the connection last sent data, used to calculate idle time. \fP"
124 .ti -1c
125 .RI "time_t \fBnping\fP"
126 .br
127 .RI "\fIUsed by PING checks with clients. \fP"
128 .ti -1c
129 .RI "char \fBinternal_addr\fP [MAXBUF]"
130 .br
131 .RI "\fIUnused, will be removed in a future alpha/beta. \fP"
132 .ti -1c
133 .RI "int \fBinternal_port\fP"
134 .br
135 .RI "\fIUnused, will be removed in a future alpha/beta. \fP"
136 .ti -1c
137 .RI "std::vector< \fBircd_connector\fP > \fBconnectors\fP"
138 .br
139 .RI "\fIWith a serverrec, this is a list of all established server connections. \fP"
140 .in -1c
141 .SH "Detailed Description"
142 .PP 
143 Please note: classes serverrec and userrec both inherit from class connection. Definition at line 173 of file connection.h.
144 .SH "Constructor & Destructor Documentation"
145 .PP 
146 .SS "connection::connection ()"
147 .PP
148 Default constructor. 
149 .SH "Member Function Documentation"
150 .PP 
151 .SS "bool connection::AddIncoming (int fd, char * targethost, int sourceport)"
152 .PP
153 Add an incoming connection to the connection pool. (reserved for core use)
154 .SS "bool connection::BeginLink (char * targethost, int port, char * password, char * servername, int myport)"
155 .PP
156 Begin an outbound link to another ircd at targethost. 
157 .SS "bool connection::CreateListener (char * host, int p)"
158 .PP
159 Create a listening socket on 'host' using port number 'p'. 
160 .SS "\fBircd_connector\fP* connection::FindHost (std::string host)"
161 .PP
162 Find the \fBircd_connector\fP oject related to a certain servername given in 'host'. 
163 .SS "long connection::GenKey ()"
164 .PP
165 This function is deprecated and may be removed in a later alpha/beta. 
166 .SS "bool connection::MeshCookie (char * targethost, int port, long cookie, char * servername)"
167 .PP
168 Begin an outbound mesh link to another ircd on a network you are already an authenticated member of. 
169 .SS "bool connection::RecvPacket (std::deque< std::string > & messages, char * host)"
170 .PP
171 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.
172 .SS "bool connection::SendPacket (char * message, const char * host)"
173 .PP
174 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. 
175 .SS "void connection::TerminateLink (char * targethost)"
176 .PP
177 Terminate a link to 'targethost' by calling the \fBircd_connector::CloseConnection\fP method. 
178 .SH "Member Data Documentation"
179 .PP 
180 .SS "long \fBconnection::bytes_in\fP"
181 .PP
182 Stats counter for bytes inbound. Definition at line 194 of file connection.h.
183 .PP
184 Referenced by userrec::userrec().
185 .SS "long \fBconnection::bytes_out\fP"
186 .PP
187 Stats counter for bytes outbound. Definition at line 198 of file connection.h.
188 .PP
189 Referenced by userrec::userrec().
190 .SS "long \fBconnection::cmds_in\fP"
191 .PP
192 Stats counter for commands inbound. Definition at line 202 of file connection.h.
193 .PP
194 Referenced by userrec::userrec().
195 .SS "long \fBconnection::cmds_out\fP"
196 .PP
197 Stats counter for commands outbound. Definition at line 206 of file connection.h.
198 .PP
199 Referenced by userrec::userrec().
200 .SS "std::vector<\fBircd_connector\fP> \fBconnection::connectors\fP"
201 .PP
202 With a serverrec, this is a list of all established server connections. With a userrec this is unused.Definition at line 253 of file connection.h.
203 .SS "int \fBconnection::fd\fP"
204 .PP
205 File descriptor of the connection. Definition at line 178 of file connection.h.
206 .PP
207 Referenced by ConfigReader::DumpErrors(), Server::PseudoToUser(), Server::SendTo(), serverrec::serverrec(), userrec::userrec(), and Server::UserToPseudo().
208 .SS "bool \fBconnection::haspassed\fP"
209 .PP
210 True if server/user has authenticated, false if otherwise. Definition at line 210 of file connection.h.
211 .PP
212 Referenced by userrec::userrec().
213 .SS "char \fBconnection::host\fP[256]"
214 .PP
215 Hostname of connection. Not used if this is a serverrecDefinition at line 182 of file connection.h.
216 .PP
217 Referenced by userrec::GetFullRealHost(), Server::PseudoToUser(), userrec::userrec(), and Server::UserToPseudo().
218 .SS "time_t \fBconnection::idle_lastmsg\fP"
219 .PP
220 Time that the connection last sent data, used to calculate idle time. Definition at line 236 of file connection.h.
221 .PP
222 Referenced by userrec::userrec().
223 .SS "char \fBconnection::inbuf\fP[MAXBUF]"
224 .PP
225 Inbuf of connection. Only used for userrecDefinition at line 190 of file connection.h.
226 .PP
227 Referenced by userrec::userrec().
228 .SS "char \fBconnection::internal_addr\fP[MAXBUF]"
229 .PP
230 Unused, will be removed in a future alpha/beta. Definition at line 244 of file connection.h.
231 .SS "int \fBconnection::internal_port\fP"
232 .PP
233 Unused, will be removed in a future alpha/beta. Definition at line 248 of file connection.h.
234 .SS "char \fBconnection::ip\fP[32]"
235 .PP
236 IP of connection. Reserved for future use.Definition at line 186 of file connection.h.
237 .PP
238 Referenced by userrec::userrec().
239 .SS "time_t \fBconnection::lastping\fP"
240 .PP
241 Time the connection was last pinged. Definition at line 228 of file connection.h.
242 .PP
243 Referenced by serverrec::serverrec(), and userrec::userrec().
244 .SS "time_t \fBconnection::nping\fP"
245 .PP
246 Used by PING checks with clients. Definition at line 240 of file connection.h.
247 .PP
248 Referenced by userrec::userrec().
249 .SS "int \fBconnection::port\fP"
250 .PP
251 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 216 of file connection.h.
252 .PP
253 Referenced by userrec::userrec().
254 .SS "int \fBconnection::registered\fP"
255 .PP
256 Used by userrec to indicate the registration status of the connection. Definition at line 220 of file connection.h.
257 .PP
258 Referenced by userrec::userrec().
259 .SS "time_t \fBconnection::signon\fP"
260 .PP
261 Time the connection was created, set in the constructor. Definition at line 232 of file connection.h.
262 .PP
263 Referenced by serverrec::serverrec(), and userrec::userrec().
264 .SS "short int \fBconnection::state\fP"
265 .PP
266 Reserved for future use. Definition at line 224 of file connection.h.
267
268 .SH "Author"
269 .PP 
270 Generated automatically by Doxygen for InspIRCd from the source code.