]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - docs/man/man3/ircd_connector.3
New documentation!
[user/henk/code/inspircd.git] / docs / man / man3 / ircd_connector.3
1 .TH "ircd_connector" 3 "26 Apr 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 .ti -1c
78 .RI "bool \fBBufferIsComplete\fP ()"
79 .br
80 .ti -1c
81 .RI "void \fBClearBuffer\fP ()"
82 .br
83 .ti -1c
84 .RI "std::string \fBGetBuffer\fP ()"
85 .br
86 .in -1c
87 .SS "Public Attributes"
88
89 .in +1c
90 .ti -1c
91 .RI "std::string \fBircdbuffer\fP"
92 .br
93 .RI "\fIIRCD Buffer for input characters, holds one line. \fP"
94 .ti -1c
95 .RI "char \fBhost\fP [MAXBUF]"
96 .br
97 .RI "\fIWhen MakeOutboundConnection is called, these public members are filled with the details passed to the function, for future reference. \fP"
98 .ti -1c
99 .RI "int \fBport\fP"
100 .br
101 .RI "\fIWhen MakeOutboundConnection is called, these public members are filled with the details passed to the function, for future reference. \fP"
102 .ti -1c
103 .RI "std::vector< std::string > \fBroutes\fP"
104 .br
105 .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"
106 .in -1c
107 .SS "Private Member Functions"
108
109 .in +1c
110 .ti -1c
111 .RI "bool \fBSetHostAddress\fP (char *\fBhost\fP, int \fBport\fP)"
112 .br
113 .RI "\fIPRIVATE function to set the host address and port to connect to. \fP"
114 .in -1c
115 .SS "Private Attributes"
116
117 .in +1c
118 .ti -1c
119 .RI "sockaddr_in \fBaddr\fP"
120 .br
121 .RI "\fISockaddr of the outbound ip and port. \fP"
122 .ti -1c
123 .RI "int \fBfd\fP"
124 .br
125 .RI "\fIFile descriptor of the connection. \fP"
126 .ti -1c
127 .RI "std::string \fBservername\fP"
128 .br
129 .RI "\fI\fBServer\fP name. \fP"
130 .ti -1c
131 .RI "std::string \fBdescription\fP"
132 .br
133 .RI "\fI\fBServer\fP 'GECOS'. \fP"
134 .ti -1c
135 .RI "int \fBstate\fP"
136 .br
137 .RI "\fIState. \fP"
138 .in -1c
139 .SH "Detailed Description"
140 .PP 
141 Each connection has one or more of these each represents ONE outbound connection to another ircd so each inbound has multiple outbounds. 
142
143 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. 
144 .PP
145 Definition at line 54 of file connection.h.
146 .SH "Member Function Documentation"
147 .PP 
148 .SS "void ircd_connector::AddBuffer (std::string a)"
149 .PP
150 .SS "bool ircd_connector::BufferIsComplete ()"
151 .PP
152 .SS "void ircd_connector::ClearBuffer ()"
153 .PP
154 .SS "void ircd_connector::CloseConnection ()"
155 .PP
156 Close the connection by calling close() on its file descriptor This function call updates no other data. 
157 .SS "std::string ircd_connector::GetBuffer ()"
158 .PP
159 .SS "std::string ircd_connector::GetDescription ()"
160 .PP
161 Get the server description of this connection. 
162 .SS "int ircd_connector::GetDescriptor ()"
163 .PP
164 Get the file descriptor associated with this connection. 
165 .SS "char* ircd_connector::GetServerIP ()"
166 .PP
167 Get the ip address (not servername) associated with this connection. 
168 .SS "std::string ircd_connector::GetServerName ()"
169 .PP
170 Return the servername on this established connection. 
171 .SS "int ircd_connector::GetServerPort ()"
172 .PP
173 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. 
174 .SS "int ircd_connector::GetState ()"
175 .PP
176 Get the state flags for this connection. 
177 .SS "bool ircd_connector::MakeOutboundConnection (char * newhost, int newport)"
178 .PP
179 Create an outbound connection to a listening socket. 
180 .SS "void ircd_connector::SetDescription (std::string desc)"
181 .PP
182 Set the server description of this connection. 
183 .SS "void ircd_connector::SetDescriptor (int fd)"
184 .PP
185 Set the file descriptor for this connection. 
186 .SS "bool ircd_connector::SetHostAddress (char * host, int port)\fC [private]\fP"
187 .PP
188 PRIVATE function to set the host address and port to connect to. 
189 .SS "bool ircd_connector::SetHostAndPort (char * newhost, int newport)"
190 .PP
191 Set both the host and the port in one operation for this connection. 
192 .SS "void ircd_connector::SetServerName (std::string serv)"
193 .PP
194 Set the server name of this connection. 
195 .SS "void ircd_connector::SetServerPort (int p)"
196 .PP
197 Set the port used by this connection. 
198 .SS "void ircd_connector::SetState (int state)"
199 .PP
200 Set the state flags for this connection. 
201 .SH "Member Data Documentation"
202 .PP 
203 .SS "sockaddr_in \fBircd_connector::addr\fP\fC [private]\fP"
204 .PP
205 Sockaddr of the outbound ip and port. Definition at line 59 of file connection.h.
206 .SS "std::string \fBircd_connector::description\fP\fC [private]\fP"
207 .PP
208 \fBServer\fP 'GECOS'. Definition at line 71 of file connection.h.
209 .SS "int \fBircd_connector::fd\fP\fC [private]\fP"
210 .PP
211 File descriptor of the connection. Definition at line 63 of file connection.h.
212 .SS "char \fBircd_connector::host\fP[MAXBUF]"
213 .PP
214 When MakeOutboundConnection is called, these public members are filled with the details passed to the function, for future reference. Definition at line 94 of file connection.h.
215 .SS "std::string \fBircd_connector::ircdbuffer\fP"
216 .PP
217 IRCD Buffer for input characters, holds one line. Definition at line 87 of file connection.h.
218 .SS "int \fBircd_connector::port\fP"
219 .PP
220 When MakeOutboundConnection is called, these public members are filled with the details passed to the function, for future reference. Definition at line 100 of file connection.h.
221 .SS "std::vector<std::string> \fBircd_connector::routes\fP"
222 .PP
223 \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 106 of file connection.h.
224 .SS "std::string \fBircd_connector::servername\fP\fC [private]\fP"
225 .PP
226 \fBServer\fP name. Definition at line 67 of file connection.h.
227 .SS "int \fBircd_connector::state\fP\fC [private]\fP"
228 .PP
229 State. STATE_NOAUTH_INBOUND, STATE_NOAUTH_OUTBOUND STATE_SYNC, STATE_DISCONNECTED, STATE_CONNECTEDDefinition at line 76 of file connection.h.
230
231 .SH "Author"
232 .PP 
233 Generated automatically by Doxygen for InspIRCd from the source code.