]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - docs/man/man3/ircd_connector.3
ba180d2104279ba603eee7e66df548a008d718f1
[user/henk/code/inspircd.git] / docs / man / man3 / ircd_connector.3
1 .TH "ircd_connector" 3 "12 May 2005" "InspIRCd" \" -*- nroff -*-
2 .ad l
3 .nh
4 .SH NAME
5 ircd_connector \- Each connection has one or more of these each represents ONE outbound connection to another ircd so each inbound has multiple outbounds.  
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 .SS "Public Member Functions"
16
17 .in +1c
18 .ti -1c
19 .RI "bool \fBMakeOutboundConnection\fP (char *newhost, int newport)"
20 .br
21 .RI "\fICreate an outbound connection to a listening socket. \fP"
22 .ti -1c
23 .RI "std::string \fBGetServerName\fP ()"
24 .br
25 .RI "\fIReturn the servername on this established connection. \fP"
26 .ti -1c
27 .RI "void \fBSetServerName\fP (std::string serv)"
28 .br
29 .RI "\fISet the server name of this connection. \fP"
30 .ti -1c
31 .RI "int \fBGetDescriptor\fP ()"
32 .br
33 .RI "\fIGet the file descriptor associated with this connection. \fP"
34 .ti -1c
35 .RI "void \fBSetDescriptor\fP (int \fBfd\fP)"
36 .br
37 .RI "\fISet the file descriptor for this connection. \fP"
38 .ti -1c
39 .RI "int \fBGetState\fP ()"
40 .br
41 .RI "\fIGet the state flags for this connection. \fP"
42 .ti -1c
43 .RI "void \fBSetState\fP (int \fBstate\fP)"
44 .br
45 .RI "\fISet the state flags for this connection. \fP"
46 .ti -1c
47 .RI "char * \fBGetServerIP\fP ()"
48 .br
49 .RI "\fIGet the ip address (not servername) associated with this connection. \fP"
50 .ti -1c
51 .RI "std::string \fBGetDescription\fP ()"
52 .br
53 .RI "\fIGet the server description of this connection. \fP"
54 .ti -1c
55 .RI "void \fBSetDescription\fP (std::string desc)"
56 .br
57 .RI "\fISet the server description of this connection. \fP"
58 .ti -1c
59 .RI "int \fBGetServerPort\fP ()"
60 .br
61 .RI "\fIGet the port number being used for this connection If the connection is outbound this will be the remote port otherwise it will be the local port, so it can always be gautanteed as open at the address given in \fBGetServerIP()\fP. \fP"
62 .ti -1c
63 .RI "void \fBSetServerPort\fP (int p)"
64 .br
65 .RI "\fISet the port used by this connection. \fP"
66 .ti -1c
67 .RI "bool \fBSetHostAndPort\fP (char *newhost, int newport)"
68 .br
69 .RI "\fISet both the host and the port in one operation for this connection. \fP"
70 .ti -1c
71 .RI "void \fBCloseConnection\fP ()"
72 .br
73 .RI "\fIClose the connection by calling close() on its file descriptor This function call updates no other data. \fP"
74 .ti -1c
75 .RI "void \fBAddBuffer\fP (std::string a)"
76 .br
77 .RI "\fIThis method adds text to the ircd connection's buffer There is no limitation on how much text of what line width may be added to this buffer. \fP"
78 .ti -1c
79 .RI "bool \fBBufferIsComplete\fP ()"
80 .br
81 .RI "\fIThis method returns true if the buffer contains at least one carriage return character, e.g. \fP"
82 .ti -1c
83 .RI "void \fBClearBuffer\fP ()"
84 .br
85 .RI "\fIThis method clears the server's buffer by setting it to an empty string. \fP"
86 .ti -1c
87 .RI "std::string \fBGetBuffer\fP ()"
88 .br
89 .RI "\fIThis method retrieves the first string from the tail end of the buffer and advances the tail end of the buffer past the returned string, in a similar manner to strtok(). \fP"
90 .ti -1c
91 .RI "void \fBSetVersionString\fP (std::string newversion)"
92 .br
93 .RI "\fIThis method sets the version string of the remote server. \fP"
94 .ti -1c
95 .RI "std::string \fBGetVersionString\fP ()"
96 .br
97 .RI "\fIThis method returns the version string of the remote server. \fP"
98 .in -1c
99 .SS "Public Attributes"
100
101 .in +1c
102 .ti -1c
103 .RI "std::string \fBircdbuffer\fP"
104 .br
105 .RI "\fIIRCD Buffer for input characters, holds as many lines as are pending - Note that the final line may not be complete and should only be read when there is a 
106 .br
107  seperator. \fP"
108 .ti -1c
109 .RI "char \fBhost\fP [MAXBUF]"
110 .br
111 .RI "\fIWhen MakeOutboundConnection is called, these public members are filled with the details passed to the function, for future reference. \fP"
112 .ti -1c
113 .RI "int \fBport\fP"
114 .br
115 .RI "\fIWhen MakeOutboundConnection is called, these public members are filled with the details passed to the function, for future reference. \fP"
116 .ti -1c
117 .RI "std::vector< std::string > \fBroutes\fP"
118 .br
119 .RI "\fI\fBServer\fP names of servers that this server is linked to So for A->B->C, if this was the record for B it would contain A and C whilever both servers are connected to B. \fP"
120 .in -1c
121 .SS "Private Member Functions"
122
123 .in +1c
124 .ti -1c
125 .RI "bool \fBSetHostAddress\fP (char *\fBhost\fP, int \fBport\fP)"
126 .br
127 .RI "\fIPRIVATE function to set the host address and port to connect to. \fP"
128 .in -1c
129 .SS "Private Attributes"
130
131 .in +1c
132 .ti -1c
133 .RI "sockaddr_in \fBaddr\fP"
134 .br
135 .RI "\fISockaddr of the outbound ip and port. \fP"
136 .ti -1c
137 .RI "int \fBfd\fP"
138 .br
139 .RI "\fIFile descriptor of the connection. \fP"
140 .ti -1c
141 .RI "std::string \fBservername\fP"
142 .br
143 .RI "\fI\fBServer\fP name. \fP"
144 .ti -1c
145 .RI "std::string \fBdescription\fP"
146 .br
147 .RI "\fI\fBServer\fP 'GECOS'. \fP"
148 .ti -1c
149 .RI "int \fBstate\fP"
150 .br
151 .RI "\fIState. \fP"
152 .ti -1c
153 .RI "std::string \fBversion\fP"
154 .br
155 .RI "\fIThis string holds the ircd's version response. \fP"
156 .in -1c
157 .SH "Detailed Description"
158 .PP 
159 Each connection has one or more of these each represents ONE outbound connection to another ircd so each inbound has multiple outbounds. 
160
161 A listening socket that accepts server type connections is represented by one class serverrec. Class serverrec will instantiate several objects of type ircd_connector to represent each established connection, inbound or outbound. So, to determine all linked servers you must walk through all the serverrecs that the core defines, and in each one iterate through until you find connection(s) relating to the server you want information on. The core and module API provide functions for this. 
162 .PP
163 Definition at line 54 of file connection.h.
164 .SH "Member Function Documentation"
165 .PP 
166 .SS "void ircd_connector::AddBuffer (std::string a)"
167 .PP
168 This method adds text to the ircd connection's buffer There is no limitation on how much text of what line width may be added to this buffer. It is the sending server's responsibility to ensure sent data is kept within reasonable quanities.
169 .SS "bool ircd_connector::BufferIsComplete ()"
170 .PP
171 This method returns true if the buffer contains at least one carriage return character, e.g. one line can be read from the buffer successfully.
172 .SS "void ircd_connector::ClearBuffer ()"
173 .PP
174 This method clears the server's buffer by setting it to an empty string. 
175 .SS "void ircd_connector::CloseConnection ()"
176 .PP
177 Close the connection by calling close() on its file descriptor This function call updates no other data. 
178 .SS "std::string ircd_connector::GetBuffer ()"
179 .PP
180 This method retrieves the first string from the tail end of the buffer and advances the tail end of the buffer past the returned string, in a similar manner to strtok(). 
181 .SS "std::string ircd_connector::GetDescription ()"
182 .PP
183 Get the server description of this connection. 
184 .SS "int ircd_connector::GetDescriptor ()"
185 .PP
186 Get the file descriptor associated with this connection. 
187 .SS "char* ircd_connector::GetServerIP ()"
188 .PP
189 Get the ip address (not servername) associated with this connection. 
190 .SS "std::string ircd_connector::GetServerName ()"
191 .PP
192 Return the servername on this established connection. 
193 .SS "int ircd_connector::GetServerPort ()"
194 .PP
195 Get the port number being used for this connection If the connection is outbound this will be the remote port otherwise it will be the local port, so it can always be gautanteed as open at the address given in \fBGetServerIP()\fP. 
196 .SS "int ircd_connector::GetState ()"
197 .PP
198 Get the state flags for this connection. 
199 .SS "std::string ircd_connector::GetVersionString ()"
200 .PP
201 This method returns the version string of the remote server. If the server has no version string an empty string is returned.
202 .SS "bool ircd_connector::MakeOutboundConnection (char * newhost, int newport)"
203 .PP
204 Create an outbound connection to a listening socket. 
205 .SS "void ircd_connector::SetDescription (std::string desc)"
206 .PP
207 Set the server description of this connection. 
208 .SS "void ircd_connector::SetDescriptor (int fd)"
209 .PP
210 Set the file descriptor for this connection. 
211 .SS "bool ircd_connector::SetHostAddress (char * host, int port)\fC [private]\fP"
212 .PP
213 PRIVATE function to set the host address and port to connect to. 
214 .SS "bool ircd_connector::SetHostAndPort (char * newhost, int newport)"
215 .PP
216 Set both the host and the port in one operation for this connection. 
217 .SS "void ircd_connector::SetServerName (std::string serv)"
218 .PP
219 Set the server name of this connection. 
220 .SS "void ircd_connector::SetServerPort (int p)"
221 .PP
222 Set the port used by this connection. 
223 .SS "void ircd_connector::SetState (int state)"
224 .PP
225 Set the state flags for this connection. 
226 .SS "void ircd_connector::SetVersionString (std::string newversion)"
227 .PP
228 This method sets the version string of the remote server. 
229 .SH "Member Data Documentation"
230 .PP 
231 .SS "sockaddr_in \fBircd_connector::addr\fP\fC [private]\fP"
232 .PP
233 Sockaddr of the outbound ip and port. Definition at line 59 of file connection.h.
234 .SS "std::string \fBircd_connector::description\fP\fC [private]\fP"
235 .PP
236 \fBServer\fP 'GECOS'. Definition at line 71 of file connection.h.
237 .SS "int \fBircd_connector::fd\fP\fC [private]\fP"
238 .PP
239 File descriptor of the connection. Definition at line 63 of file connection.h.
240 .SS "char \fBircd_connector::host\fP[MAXBUF]"
241 .PP
242 When MakeOutboundConnection is called, these public members are filled with the details passed to the function, for future reference. Definition at line 99 of file connection.h.
243 .SS "std::string \fBircd_connector::ircdbuffer\fP"
244 .PP
245 IRCD Buffer for input characters, holds as many lines as are pending - Note that the final line may not be complete and should only be read when there is a 
246 .br
247  seperator. Definition at line 92 of file connection.h.
248 .SS "int \fBircd_connector::port\fP"
249 .PP
250 When MakeOutboundConnection is called, these public members are filled with the details passed to the function, for future reference. Definition at line 105 of file connection.h.
251 .SS "std::vector<std::string> \fBircd_connector::routes\fP"
252 .PP
253 \fBServer\fP names of servers that this server is linked to So for A->B->C, if this was the record for B it would contain A and C whilever both servers are connected to B. Definition at line 111 of file connection.h.
254 .SS "std::string \fBircd_connector::servername\fP\fC [private]\fP"
255 .PP
256 \fBServer\fP name. Definition at line 67 of file connection.h.
257 .SS "int \fBircd_connector::state\fP\fC [private]\fP"
258 .PP
259 State. STATE_NOAUTH_INBOUND, STATE_NOAUTH_OUTBOUND STATE_SYNC, STATE_DISCONNECTED, STATE_CONNECTEDDefinition at line 76 of file connection.h.
260 .SS "std::string \fBircd_connector::version\fP\fC [private]\fP"
261 .PP
262 This string holds the ircd's version response. Definition at line 84 of file connection.h.
263
264 .SH "Author"
265 .PP 
266 Generated automatically by Doxygen for InspIRCd from the source code.