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