diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-05-25 22:01:10 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-05-25 22:01:10 +0000 |
commit | 4e9f3d169285127e60dc9e0437925c90600bfe05 (patch) | |
tree | 1c815d53019e5daab20cf7b535cd5c048c6a29cf /docs/module-doc/classserverrec.html | |
parent | 325797e2c1013295538e978f9428c51e2bf0ce98 (diff) |
Added parameters
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1522 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'docs/module-doc/classserverrec.html')
-rw-r--r-- | docs/module-doc/classserverrec.html | 843 |
1 files changed, 441 insertions, 402 deletions
diff --git a/docs/module-doc/classserverrec.html b/docs/module-doc/classserverrec.html index 3d7dc51ec..9ebee0578 100644 --- a/docs/module-doc/classserverrec.html +++ b/docs/module-doc/classserverrec.html @@ -131,23 +131,23 @@ Constructor. <p> <p> -Definition at line <a class="el" href="servers_8cpp-source.html#l00042">42</a> of file <a class="el" href="servers_8cpp-source.html">servers.cpp</a>. +Definition at line <a class="el" href="servers_8cpp-source.html#l00046">46</a> of file <a class="el" href="servers_8cpp-source.html">servers.cpp</a>. <p> References <a class="el" href="servers_8h-source.html#l00081">connectors</a>, <a class="el" href="connection_8h-source.html#l00266">connection::fd</a>, <a class="el" href="servers_8h-source.html#l00051">hops_away</a>, <a class="el" href="servers_8h-source.html#l00057">jupiter</a>, <a class="el" href="connection_8h-source.html#l00308">connection::lastping</a>, <a class="el" href="servers_8h-source.html#l00036">name</a>, <a class="el" href="servers_8h-source.html#l00065">nickserv</a>, <a class="el" href="servers_8h-source.html#l00048">opercount</a>, <a class="el" href="servers_8h-source.html#l00039">pingtime</a>, <a class="el" href="connection_8h-source.html#l00312">connection::signon</a>, <a class="el" href="servers_8h-source.html#l00067">sync_soon</a>, <a class="el" href="channels_8cpp-source.html#l00101">TIME</a>, <a class="el" href="servers_8h-source.html#l00045">usercount</a>, <a class="el" href="servers_8h-source.html#l00042">usercount_i</a>, and <a class="el" href="servers_8h-source.html#l00054">version</a>. <p> -<div class="fragment"><pre>00043 { -00044 strlcpy(name,<span class="stringliteral">""</span>,256); -00045 <a class="code" href="classserverrec.html#o1">pingtime</a> = 0; -00046 <a class="code" href="classconnection.html#o10">lastping</a> = <a class="code" href="channels_8cpp.html#a36">TIME</a>; -00047 <a class="code" href="classserverrec.html#o2">usercount_i</a> = <a class="code" href="classserverrec.html#o3">usercount</a> = <a class="code" href="classserverrec.html#o4">opercount</a> = <a class="code" href="classserverrec.html#o6">version</a> = 0; -00048 <a class="code" href="classserverrec.html#o5">hops_away</a> = 1; -00049 <a class="code" href="classconnection.html#o11">signon</a> = <a class="code" href="channels_8cpp.html#a36">TIME</a>; -00050 <a class="code" href="classserverrec.html#o7">jupiter</a> = <span class="keyword">false</span>; -00051 <a class="code" href="classconnection.html#o0">fd</a> = 0; -00052 <a class="code" href="classserverrec.html#o10">sync_soon</a> = <span class="keyword">false</span>; -00053 strlcpy(nickserv,<span class="stringliteral">""</span>,NICKMAX); -00054 <a class="code" href="classserverrec.html#o11">connectors</a>.clear(); -00055 } +<div class="fragment"><pre>00047 { +00048 strlcpy(name,<span class="stringliteral">""</span>,256); +00049 <a class="code" href="classserverrec.html#o1">pingtime</a> = 0; +00050 <a class="code" href="classconnection.html#o10">lastping</a> = <a class="code" href="channels_8cpp.html#a36">TIME</a>; +00051 <a class="code" href="classserverrec.html#o2">usercount_i</a> = <a class="code" href="classserverrec.html#o3">usercount</a> = <a class="code" href="classserverrec.html#o4">opercount</a> = <a class="code" href="classserverrec.html#o6">version</a> = 0; +00052 <a class="code" href="classserverrec.html#o5">hops_away</a> = 1; +00053 <a class="code" href="classconnection.html#o11">signon</a> = <a class="code" href="channels_8cpp.html#a36">TIME</a>; +00054 <a class="code" href="classserverrec.html#o7">jupiter</a> = <span class="keyword">false</span>; +00055 <a class="code" href="classconnection.html#o0">fd</a> = 0; +00056 <a class="code" href="classserverrec.html#o10">sync_soon</a> = <span class="keyword">false</span>; +00057 strlcpy(nickserv,<span class="stringliteral">""</span>,NICKMAX); +00058 <a class="code" href="classserverrec.html#o11">connectors</a>.clear(); +00059 } </pre></div> </td> </tr> </table> @@ -196,23 +196,23 @@ Constructor which initialises some of the main variables. <p> <p> -Definition at line <a class="el" href="servers_8cpp-source.html#l00062">62</a> of file <a class="el" href="servers_8cpp-source.html">servers.cpp</a>. +Definition at line <a class="el" href="servers_8cpp-source.html#l00066">66</a> of file <a class="el" href="servers_8cpp-source.html">servers.cpp</a>. <p> References <a class="el" href="servers_8h-source.html#l00081">connectors</a>, <a class="el" href="connection_8h-source.html#l00266">connection::fd</a>, <a class="el" href="servers_8h-source.html#l00051">hops_away</a>, <a class="el" href="servers_8h-source.html#l00057">jupiter</a>, <a class="el" href="connection_8h-source.html#l00308">connection::lastping</a>, <a class="el" href="servers_8h-source.html#l00036">name</a>, <a class="el" href="servers_8h-source.html#l00065">nickserv</a>, <a class="el" href="servers_8h-source.html#l00048">opercount</a>, <a class="el" href="connection_8h-source.html#l00312">connection::signon</a>, <a class="el" href="servers_8h-source.html#l00067">sync_soon</a>, <a class="el" href="channels_8cpp-source.html#l00101">TIME</a>, <a class="el" href="servers_8h-source.html#l00045">usercount</a>, <a class="el" href="servers_8h-source.html#l00042">usercount_i</a>, and <a class="el" href="servers_8h-source.html#l00054">version</a>. <p> -<div class="fragment"><pre>00063 { -00064 strlcpy(name,n,256); -00065 <a class="code" href="classconnection.html#o10">lastping</a> = <a class="code" href="channels_8cpp.html#a36">TIME</a>; -00066 <a class="code" href="classserverrec.html#o2">usercount_i</a> = <a class="code" href="classserverrec.html#o3">usercount</a> = <a class="code" href="classserverrec.html#o4">opercount</a> = 0; -00067 <a class="code" href="classserverrec.html#o6">version</a> = ver; -00068 <a class="code" href="classserverrec.html#o5">hops_away</a> = 1; -00069 <a class="code" href="classconnection.html#o11">signon</a> = <a class="code" href="channels_8cpp.html#a36">TIME</a>; -00070 <a class="code" href="classserverrec.html#o7">jupiter</a> = jupe; -00071 <a class="code" href="classconnection.html#o0">fd</a> = 0; -00072 <a class="code" href="classserverrec.html#o10">sync_soon</a> = <span class="keyword">false</span>; -00073 strlcpy(nickserv,<span class="stringliteral">""</span>,NICKMAX); -00074 <a class="code" href="classserverrec.html#o11">connectors</a>.clear(); -00075 } +<div class="fragment"><pre>00067 { +00068 strlcpy(name,n,256); +00069 <a class="code" href="classconnection.html#o10">lastping</a> = <a class="code" href="channels_8cpp.html#a36">TIME</a>; +00070 <a class="code" href="classserverrec.html#o2">usercount_i</a> = <a class="code" href="classserverrec.html#o3">usercount</a> = <a class="code" href="classserverrec.html#o4">opercount</a> = 0; +00071 <a class="code" href="classserverrec.html#o6">version</a> = ver; +00072 <a class="code" href="classserverrec.html#o5">hops_away</a> = 1; +00073 <a class="code" href="classconnection.html#o11">signon</a> = <a class="code" href="channels_8cpp.html#a36">TIME</a>; +00074 <a class="code" href="classserverrec.html#o7">jupiter</a> = jupe; +00075 <a class="code" href="classconnection.html#o0">fd</a> = 0; +00076 <a class="code" href="classserverrec.html#o10">sync_soon</a> = <span class="keyword">false</span>; +00077 strlcpy(nickserv,<span class="stringliteral">""</span>,NICKMAX); +00078 <a class="code" href="classserverrec.html#o11">connectors</a>.clear(); +00079 } </pre></div> </td> </tr> </table> @@ -245,10 +245,10 @@ Destructor. <p> <p> -Definition at line <a class="el" href="servers_8cpp-source.html#l00058">58</a> of file <a class="el" href="servers_8cpp-source.html">servers.cpp</a>. +Definition at line <a class="el" href="servers_8cpp-source.html#l00062">62</a> of file <a class="el" href="servers_8cpp-source.html">servers.cpp</a>. <p> -<div class="fragment"><pre>00059 { -00060 } +<div class="fragment"><pre>00063 { +00064 } </pre></div> </td> </tr> </table> @@ -298,30 +298,30 @@ Add an incoming connection to the connection pool. <p> (reserved for core use) <p> -Definition at line <a class="el" href="servers_8cpp-source.html#l00207">207</a> of file <a class="el" href="servers_8cpp-source.html">servers.cpp</a>. +Definition at line <a class="el" href="servers_8cpp-source.html#l00212">212</a> of file <a class="el" href="servers_8cpp-source.html">servers.cpp</a>. <p> References <a class="el" href="servers_8h-source.html#l00081">connectors</a>, <a class="el" href="modules_8h-source.html#l00023">DEBUG</a>, <a class="el" href="classircd__connector.html#a5">ircd_connector::SetDescriptor()</a>, <a class="el" href="classircd__connector.html#a13">ircd_connector::SetHostAndPort()</a>, <a class="el" href="classircd__connector.html#a3">ircd_connector::SetServerName()</a>, <a class="el" href="classircd__connector.html#a7">ircd_connector::SetState()</a>, and <a class="el" href="connection_8h-source.html#l00038">STATE_NOAUTH_INBOUND</a>. <p> -<div class="fragment"><pre>00208 { -00209 <a class="code" href="classircd__connector.html">ircd_connector</a> connector; -00210 -00211 <span class="comment">// targethost has been turned into an ip...</span> -00212 <span class="comment">// we dont want this as the server name.</span> -00213 connector.<a class="code" href="classircd__connector.html#a3">SetServerName</a>(targethost); -00214 connector.<a class="code" href="classircd__connector.html#a5">SetDescriptor</a>(newfd); -00215 connector.<a class="code" href="classircd__connector.html#a7">SetState</a>(STATE_NOAUTH_INBOUND); -00216 <span class="keywordtype">int</span> flags = fcntl(newfd, F_GETFL, 0); -00217 fcntl(newfd, F_SETFL, flags | O_NONBLOCK); -00218 <span class="keywordtype">int</span> sendbuf = 32768; -00219 <span class="keywordtype">int</span> recvbuf = 32768; -00220 setsockopt(newfd,SOL_SOCKET,SO_SNDBUF,(<span class="keyword">const</span> <span class="keywordtype">void</span> *)&sendbuf,<span class="keyword">sizeof</span>(sendbuf)); -00221 setsockopt(newfd,SOL_SOCKET,SO_RCVBUF,(<span class="keyword">const</span> <span class="keywordtype">void</span> *)&recvbuf,<span class="keyword">sizeof</span>(sendbuf)); -00222 connector.<a class="code" href="classircd__connector.html#a13">SetHostAndPort</a>(targethost, sourceport); -00223 connector.<a class="code" href="classircd__connector.html#a7">SetState</a>(STATE_NOAUTH_INBOUND); -00224 log(DEBUG,<span class="stringliteral">"serverrec::AddIncoming() Added connection: %s:%d"</span>,targethost,sourceport); -00225 this-><a class="code" href="classserverrec.html#o11">connectors</a>.push_back(connector); -00226 <span class="keywordflow">return</span> <span class="keyword">true</span>; -00227 } +<div class="fragment"><pre>00213 { +00214 <a class="code" href="classircd__connector.html">ircd_connector</a> connector; +00215 +00216 <span class="comment">// targethost has been turned into an ip...</span> +00217 <span class="comment">// we dont want this as the server name.</span> +00218 connector.<a class="code" href="classircd__connector.html#a3">SetServerName</a>(targethost); +00219 connector.<a class="code" href="classircd__connector.html#a5">SetDescriptor</a>(newfd); +00220 connector.<a class="code" href="classircd__connector.html#a7">SetState</a>(STATE_NOAUTH_INBOUND); +00221 <span class="keywordtype">int</span> flags = fcntl(newfd, F_GETFL, 0); +00222 fcntl(newfd, F_SETFL, flags | O_NONBLOCK); +00223 <span class="keywordtype">int</span> sendbuf = 32768; +00224 <span class="keywordtype">int</span> recvbuf = 32768; +00225 setsockopt(newfd,SOL_SOCKET,SO_SNDBUF,(<span class="keyword">const</span> <span class="keywordtype">void</span> *)&sendbuf,<span class="keyword">sizeof</span>(sendbuf)); +00226 setsockopt(newfd,SOL_SOCKET,SO_RCVBUF,(<span class="keyword">const</span> <span class="keywordtype">void</span> *)&recvbuf,<span class="keyword">sizeof</span>(sendbuf)); +00227 connector.<a class="code" href="classircd__connector.html#a13">SetHostAndPort</a>(targethost, sourceport); +00228 connector.<a class="code" href="classircd__connector.html#a7">SetState</a>(STATE_NOAUTH_INBOUND); +00229 log(DEBUG,<span class="stringliteral">"serverrec::AddIncoming() Added connection: %s:%d"</span>,targethost,sourceport); +00230 this-><a class="code" href="classserverrec.html#o11">connectors</a>.push_back(connector); +00231 <span class="keywordflow">return</span> <span class="keyword">true</span>; +00232 } </pre></div> </td> </tr> </table> @@ -382,45 +382,47 @@ Begin an outbound link to another ircd at targethost. <p> <p> -Definition at line <a class="el" href="servers_8cpp-source.html#l00138">138</a> of file <a class="el" href="servers_8cpp-source.html">servers.cpp</a>. +Definition at line <a class="el" href="servers_8cpp-source.html#l00142">142</a> of file <a class="el" href="servers_8cpp-source.html">servers.cpp</a>. <p> -References <a class="el" href="servers_8h-source.html#l00081">connectors</a>, <a class="el" href="connection_8h-source.html#l00266">connection::fd</a>, <a class="el" href="servers_8cpp-source.html#l00237">FindHost()</a>, <a class="el" href="classircd__connector.html#a1">ircd_connector::MakeOutboundConnection()</a>, <a class="el" href="servers_8cpp-source.html#l00275">SendPacket()</a>, <a class="el" href="classircd__connector.html#a13">ircd_connector::SetHostAndPort()</a>, <a class="el" href="classircd__connector.html#a3">ircd_connector::SetServerName()</a>, <a class="el" href="classircd__connector.html#a7">ircd_connector::SetState()</a>, <a class="el" href="connection_8h-source.html#l00035">STATE_DISCONNECTED</a>, and <a class="el" href="connection_8h-source.html#l00039">STATE_NOAUTH_OUTBOUND</a>. +References <a class="el" href="servers_8h-source.html#l00081">connectors</a>, <a class="el" href="connection_8h-source.html#l00266">connection::fd</a>, <a class="el" href="servers_8cpp-source.html#l00242">FindHost()</a>, <a class="el" href="classircd__connector.html#a1">ircd_connector::MakeOutboundConnection()</a>, <a class="el" href="servers_8cpp-source.html#l00336">SendPacket()</a>, <a class="el" href="classircd__connector.html#a13">ircd_connector::SetHostAndPort()</a>, <a class="el" href="classircd__connector.html#a3">ircd_connector::SetServerName()</a>, <a class="el" href="classircd__connector.html#a7">ircd_connector::SetState()</a>, <a class="el" href="connection_8h-source.html#l00035">STATE_DISCONNECTED</a>, and <a class="el" href="connection_8h-source.html#l00039">STATE_NOAUTH_OUTBOUND</a>. <p> -<div class="fragment"><pre>00139 { -00140 <span class="keywordtype">char</span> connect[MAXBUF]; -00141 -00142 <a class="code" href="classircd__connector.html">ircd_connector</a> connector; -00143 <a class="code" href="classircd__connector.html">ircd_connector</a> *cn = this-><a class="code" href="classserverrec.html#a9">FindHost</a>(servername); -00144 +<div class="fragment"><pre>00143 { +00144 <span class="keywordtype">char</span> connect[MAXBUF]; 00145 -00146 <span class="keywordflow">if</span> (cn) -00147 { -00148 WriteOpers(<span class="stringliteral">"CONNECT aborted: Server %s already exists"</span>,servername); -00149 <span class="keywordflow">return</span> <span class="keyword">false</span>; -00150 } -00151 -00152 -00153 <span class="keywordflow">if</span> (this-><a class="code" href="classconnection.html#o0">fd</a>) -00154 { -00155 <span class="keywordflow">if</span> (connector.<a class="code" href="classircd__connector.html#a1">MakeOutboundConnection</a>(targethost,newport)) -00156 { -00157 <span class="comment">// targethost has been turned into an ip...</span> -00158 <span class="comment">// we dont want this as the server name.</span> -00159 connector.<a class="code" href="classircd__connector.html#a3">SetServerName</a>(servername); -00160 snprintf(connect,MAXBUF,<span class="stringliteral">"S %s %s %lu %s :%s"</span>,getservername().c_str(),password,(<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>)myport,GetRevision().c_str(),getserverdesc().c_str()); -00161 connector.<a class="code" href="classircd__connector.html#a7">SetState</a>(STATE_NOAUTH_OUTBOUND); -00162 connector.<a class="code" href="classircd__connector.html#a13">SetHostAndPort</a>(targethost, newport); -00163 this-><a class="code" href="classserverrec.html#o11">connectors</a>.push_back(connector); -00164 <span class="keywordflow">return</span> this-><a class="code" href="classserverrec.html#a7">SendPacket</a>(connect, servername); -00165 } -00166 <span class="keywordflow">else</span> -00167 { -00168 connector.<a class="code" href="classircd__connector.html#a7">SetState</a>(STATE_DISCONNECTED); -00169 WriteOpers(<span class="stringliteral">"Could not create outbound connection to %s:%d"</span>,targethost,newport); -00170 } -00171 } -00172 <span class="keywordflow">return</span> <span class="keyword">false</span>; -00173 } +00146 <a class="code" href="classircd__connector.html">ircd_connector</a> connector; +00147 <a class="code" href="classircd__connector.html">ircd_connector</a> *cn = this-><a class="code" href="classserverrec.html#a9">FindHost</a>(servername); +00148 +00149 +00150 <span class="keywordflow">if</span> (cn) +00151 { +00152 WriteOpers(<span class="stringliteral">"CONNECT aborted: Server %s already exists"</span>,servername); +00153 <span class="keywordflow">return</span> <span class="keyword">false</span>; +00154 } +00155 +00156 +00157 <span class="keywordflow">if</span> (this-><a class="code" href="classconnection.html#o0">fd</a>) +00158 { +00159 <span class="keywordflow">if</span> (connector.<a class="code" href="classircd__connector.html#a1">MakeOutboundConnection</a>(targethost,newport)) +00160 { +00161 <span class="comment">// targethost has been turned into an ip...</span> +00162 <span class="comment">// we dont want this as the server name.</span> +00163 connector.<a class="code" href="classircd__connector.html#a3">SetServerName</a>(servername); +00164 snprintf(connect,MAXBUF,<span class="stringliteral">"S %s %s %lu %s :%s"</span>,getservername().c_str(),password,(<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>)myport,GetRevision().c_str(),getserverdesc().c_str()); +00165 connector.<a class="code" href="classircd__connector.html#a7">SetState</a>(STATE_NOAUTH_OUTBOUND); +00166 connector.<a class="code" href="classircd__connector.html#a13">SetHostAndPort</a>(targethost, newport); +00167 this-><a class="code" href="classserverrec.html#o11">connectors</a>.push_back(connector); +00168 <span class="comment">// this packet isn't actually sent until the socket connects -- the STATE_NOAUTH_OUTBOUND state</span> +00169 <span class="comment">// queues outbound data until the socket is polled as writeable (e.g. the connection is established)</span> +00170 <span class="keywordflow">return</span> this-><a class="code" href="classserverrec.html#a7">SendPacket</a>(connect, servername); +00171 } +00172 <span class="keywordflow">else</span> +00173 { +00174 connector.<a class="code" href="classircd__connector.html#a7">SetState</a>(STATE_DISCONNECTED); +00175 WriteOpers(<span class="stringliteral">"Could not create outbound connection to %s:%d"</span>,targethost,newport); +00176 } +00177 } +00178 <span class="keywordflow">return</span> <span class="keyword">false</span>; +00179 } </pre></div> </td> </tr> </table> @@ -463,68 +465,68 @@ Create a listening socket on 'host' using port number 'p'. <p> <p> -Definition at line <a class="el" href="servers_8cpp-source.html#l00077">77</a> of file <a class="el" href="servers_8cpp-source.html">servers.cpp</a>. +Definition at line <a class="el" href="servers_8cpp-source.html#l00081">81</a> of file <a class="el" href="servers_8cpp-source.html">servers.cpp</a>. <p> References <a class="el" href="connection_8h-source.html#l00266">connection::fd</a>, <a class="el" href="servers_8cpp-source.html#l00038">MaxConn</a>, and <a class="el" href="connection_8h-source.html#l00300">connection::port</a>. <p> -<div class="fragment"><pre>00078 { -00079 sockaddr_in host_address; -00080 <span class="keywordtype">int</span> flags; -00081 in_addr addy; -00082 <span class="keywordtype">int</span> on = 0; -00083 <span class="keyword">struct </span>linger linger = { 0 }; -00084 -00085 this-><a class="code" href="classconnection.html#o8">port</a> = p; -00086 -00087 <a class="code" href="classconnection.html#o0">fd</a> = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); -00088 <span class="keywordflow">if</span> (<a class="code" href="classconnection.html#o0">fd</a> <= 0) -00089 { -00090 <span class="keywordflow">return</span> <span class="keyword">false</span>; -00091 } -00092 -00093 setsockopt(fd,SOL_SOCKET,SO_REUSEADDR,(<span class="keyword">const</span> <span class="keywordtype">char</span>*)&on,<span class="keyword">sizeof</span>(on)); -00094 linger.l_onoff = 1; -00095 linger.l_linger = 1; -00096 setsockopt(fd,SOL_SOCKET,SO_LINGER,(<span class="keyword">const</span> <span class="keywordtype">char</span>*)&linger,<span class="keyword">sizeof</span>(linger)); -00097 -00098 <span class="comment">// attempt to increase socket sendq and recvq as high as its possible</span> -00099 <span class="comment">// to get them on linux.</span> -00100 <span class="keywordtype">int</span> sendbuf = 32768; -00101 <span class="keywordtype">int</span> recvbuf = 32768; -00102 setsockopt(fd,SOL_SOCKET,SO_SNDBUF,(<span class="keyword">const</span> <span class="keywordtype">void</span> *)&sendbuf,<span class="keyword">sizeof</span>(sendbuf)); -00103 setsockopt(fd,SOL_SOCKET,SO_RCVBUF,(<span class="keyword">const</span> <span class="keywordtype">void</span> *)&recvbuf,<span class="keyword">sizeof</span>(sendbuf)); -00104 -00105 memset((<span class="keywordtype">void</span>*)&host_address, 0, <span class="keyword">sizeof</span>(host_address)); -00106 -00107 host_address.sin_family = AF_INET; +<div class="fragment"><pre>00082 { +00083 sockaddr_in host_address; +00084 <span class="keywordtype">int</span> flags; +00085 in_addr addy; +00086 <span class="keywordtype">int</span> on = 0; +00087 <span class="keyword">struct </span>linger linger = { 0 }; +00088 +00089 this-><a class="code" href="classconnection.html#o8">port</a> = p; +00090 +00091 <a class="code" href="classconnection.html#o0">fd</a> = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); +00092 <span class="keywordflow">if</span> (<a class="code" href="classconnection.html#o0">fd</a> <= 0) +00093 { +00094 <span class="keywordflow">return</span> <span class="keyword">false</span>; +00095 } +00096 +00097 setsockopt(fd,SOL_SOCKET,SO_REUSEADDR,(<span class="keyword">const</span> <span class="keywordtype">char</span>*)&on,<span class="keyword">sizeof</span>(on)); +00098 linger.l_onoff = 1; +00099 linger.l_linger = 1; +00100 setsockopt(fd,SOL_SOCKET,SO_LINGER,(<span class="keyword">const</span> <span class="keywordtype">char</span>*)&linger,<span class="keyword">sizeof</span>(linger)); +00101 +00102 <span class="comment">// attempt to increase socket sendq and recvq as high as its possible</span> +00103 <span class="comment">// to get them on linux.</span> +00104 <span class="keywordtype">int</span> sendbuf = 32768; +00105 <span class="keywordtype">int</span> recvbuf = 32768; +00106 setsockopt(fd,SOL_SOCKET,SO_SNDBUF,(<span class="keyword">const</span> <span class="keywordtype">void</span> *)&sendbuf,<span class="keyword">sizeof</span>(sendbuf)); +00107 setsockopt(fd,SOL_SOCKET,SO_RCVBUF,(<span class="keyword">const</span> <span class="keywordtype">void</span> *)&recvbuf,<span class="keyword">sizeof</span>(sendbuf)); 00108 -00109 <span class="keywordflow">if</span> (!strcmp(newhost,<span class="stringliteral">""</span>)) -00110 { -00111 host_address.sin_addr.s_addr = htonl(INADDR_ANY); -00112 } -00113 <span class="keywordflow">else</span> +00109 memset((<span class="keywordtype">void</span>*)&host_address, 0, <span class="keyword">sizeof</span>(host_address)); +00110 +00111 host_address.sin_family = AF_INET; +00112 +00113 <span class="keywordflow">if</span> (!strcmp(newhost,<span class="stringliteral">""</span>)) 00114 { -00115 inet_aton(newhost,&addy); -00116 host_address.sin_addr = addy; -00117 } -00118 -00119 host_address.sin_port = htons(p); -00120 -00121 <span class="keywordflow">if</span> (bind(fd,(sockaddr*)&host_address,<span class="keyword">sizeof</span>(host_address))<0) -00122 { -00123 <span class="keywordflow">return</span> <span class="keyword">false</span>; -00124 } -00125 -00126 <span class="comment">// make the socket non-blocking</span> -00127 flags = fcntl(fd, F_GETFL, 0); -00128 fcntl(fd, F_SETFL, flags | O_NONBLOCK); +00115 host_address.sin_addr.s_addr = htonl(INADDR_ANY); +00116 } +00117 <span class="keywordflow">else</span> +00118 { +00119 inet_aton(newhost,&addy); +00120 host_address.sin_addr = addy; +00121 } +00122 +00123 host_address.sin_port = htons(p); +00124 +00125 <span class="keywordflow">if</span> (bind(fd,(sockaddr*)&host_address,<span class="keyword">sizeof</span>(host_address))<0) +00126 { +00127 <span class="keywordflow">return</span> <span class="keyword">false</span>; +00128 } 00129 -00130 this-><a class="code" href="classconnection.html#o8">port</a> = p; -00131 -00132 listen(this->fd, MaxConn); +00130 <span class="comment">// make the socket non-blocking</span> +00131 flags = fcntl(fd, F_GETFL, 0); +00132 fcntl(fd, F_SETFL, flags | O_NONBLOCK); 00133 -00134 <span class="keywordflow">return</span> <span class="keyword">true</span>; -00135 } +00134 this-><a class="code" href="classconnection.html#o8">port</a> = p; +00135 +00136 listen(this->fd, MaxConn); +00137 +00138 <span class="keywordflow">return</span> <span class="keyword">true</span>; +00139 } </pre></div> </td> </tr> </table> @@ -558,22 +560,22 @@ Find the <a class="el" href="classircd__connector.html">ircd_connector</a> oject <p> <p> -Definition at line <a class="el" href="servers_8cpp-source.html#l00237">237</a> of file <a class="el" href="servers_8cpp-source.html">servers.cpp</a>. +Definition at line <a class="el" href="servers_8cpp-source.html#l00242">242</a> of file <a class="el" href="servers_8cpp-source.html">servers.cpp</a>. <p> References <a class="el" href="servers_8h-source.html#l00081">connectors</a>. <p> -Referenced by <a class="el" href="servers_8cpp-source.html#l00138">BeginLink()</a>, and <a class="el" href="servers_8cpp-source.html#l00275">SendPacket()</a>. -<p> -<div class="fragment"><pre>00238 { -00239 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < this-><a class="code" href="classserverrec.html#o11">connectors</a>.size(); i++) -00240 { -00241 <span class="keywordflow">if</span> (this-><a class="code" href="classserverrec.html#o11">connectors</a>[i].GetServerName() == findhost) -00242 { -00243 <span class="keywordflow">return</span> &this-><a class="code" href="classserverrec.html#o11">connectors</a>[i]; -00244 } -00245 } -00246 <span class="keywordflow">return</span> NULL; -00247 } +Referenced by <a class="el" href="servers_8cpp-source.html#l00142">BeginLink()</a>, <a class="el" href="servers_8cpp-source.html#l00256">IsRoutable()</a>, and <a class="el" href="servers_8cpp-source.html#l00336">SendPacket()</a>. +<p> +<div class="fragment"><pre>00243 { +00244 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < this-><a class="code" href="classserverrec.html#o11">connectors</a>.size(); i++) +00245 { +00246 <span class="keywordflow">if</span> (this-><a class="code" href="classserverrec.html#o11">connectors</a>[i].GetServerName() == findhost) +00247 { +00248 <span class="keywordflow">return</span> &this-><a class="code" href="classserverrec.html#o11">connectors</a>[i]; +00249 } +00250 } +00251 <span class="keywordflow">return</span> NULL; +00252 } </pre></div> </td> </tr> </table> @@ -606,34 +608,60 @@ Flushes all data waiting to be written for all of this server's connections. <p> <p> -Definition at line <a class="el" href="servers_8cpp-source.html#l00249">249</a> of file <a class="el" href="servers_8cpp-source.html">servers.cpp</a>. -<p> -References <a class="el" href="servers_8h-source.html#l00081">connectors</a>, and <a class="el" href="connection_8h-source.html#l00035">STATE_DISCONNECTED</a>. -<p> -<div class="fragment"><pre>00250 { -00251 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < this-><a class="code" href="classserverrec.html#o11">connectors</a>.size(); i++) -00252 { -00253 <span class="keywordflow">if</span> (this-><a class="code" href="classserverrec.html#o11">connectors</a>[i].GetState() != <a class="code" href="connection_8h.html#a0">STATE_DISCONNECTED</a>) -00254 { -00255 <span class="keywordflow">if</span> (!this-><a class="code" href="classserverrec.html#o11">connectors</a>[i].CheckPing()) -00256 { -00257 WriteOpers(<span class="stringliteral">"*** Lost single connection to %s: Ping timeout"</span>,this->connectors[i].GetServerName().c_str()); -00258 this-><a class="code" href="classserverrec.html#o11">connectors</a>[i].CloseConnection(); -00259 this-><a class="code" href="classserverrec.html#o11">connectors</a>[i].SetState(STATE_DISCONNECTED); -00260 } -00261 } -00262 <span class="keywordflow">if</span> (this-><a class="code" href="classserverrec.html#o11">connectors</a>[i].HasBufferedOutput()) -00263 { -00264 <span class="keywordflow">if</span> (!this-><a class="code" href="classserverrec.html#o11">connectors</a>[i].FlushWriteBuf()) -00265 { -00266 <span class="comment">// if we're here the write() caused an error, we cannot proceed</span> -00267 WriteOpers(<span class="stringliteral">"*** Lost single connection to %s, link inactive and retrying: %s"</span>,this->connectors[i].GetServerName().c_str(),this-><a class="code" href="classserverrec.html#o11">connectors</a>[i].GetWriteError().c_str()); -00268 this-><a class="code" href="classserverrec.html#o11">connectors</a>[i].CloseConnection(); -00269 this-><a class="code" href="classserverrec.html#o11">connectors</a>[i].SetState(STATE_DISCONNECTED); -00270 } -00271 } -00272 } -00273 } +Definition at line <a class="el" href="servers_8cpp-source.html#l00284">284</a> of file <a class="el" href="servers_8cpp-source.html">servers.cpp</a>. +<p> +References <a class="el" href="servers_8h-source.html#l00081">connectors</a>, <a class="el" href="servers_8cpp-source.html#l00042">has_been_netsplit</a>, <a class="el" href="servers_8cpp-source.html#l00256">IsRoutable()</a>, <a class="el" href="connection_8h-source.html#l00035">STATE_DISCONNECTED</a>, <a class="el" href="connection_8h-source.html#l00038">STATE_NOAUTH_INBOUND</a>, <a class="el" href="connection_8h-source.html#l00039">STATE_NOAUTH_OUTBOUND</a>, and <a class="el" href="channels_8cpp-source.html#l00101">TIME</a>. +<p> +<div class="fragment"><pre>00285 { +00286 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < this-><a class="code" href="classserverrec.html#o11">connectors</a>.size(); i++) +00287 { +00288 <span class="comment">// don't try and ping a NOAUTH_OUTBOUND state, its not authed yet!</span> +00289 <span class="keywordflow">if</span> ((this-><a class="code" href="classserverrec.html#o11">connectors</a>[i].GetState() == <a class="code" href="connection_8h.html#a4">STATE_NOAUTH_OUTBOUND</a>) && (<a class="code" href="channels_8cpp.html#a36">TIME</a> > this-><a class="code" href="classserverrec.html#o11">connectors</a>[i].age+30)) +00290 { +00291 <span class="comment">// however if we reach this timer its connected timed out :)</span> +00292 WriteOpers(<span class="stringliteral">"*** Connection to %s timed out"</span>,this->connectors[i].GetServerName().c_str()); +00293 DoSplit(this->connectors[i].GetServerName().c_str()); +00294 <span class="keywordflow">return</span>; +00295 } +00296 <span class="keywordflow">else</span> <span class="keywordflow">if</span> ((this->connectors[i].GetState() == <a class="code" href="connection_8h.html#a3">STATE_NOAUTH_INBOUND</a>) && (<a class="code" href="channels_8cpp.html#a36">TIME</a> > this->connectors[i].age+30)) +00297 { +00298 WriteOpers(<span class="stringliteral">"*** Connection from %s timed out"</span>,this->connectors[i].GetServerName().c_str()); +00299 DoSplit(this->connectors[i].GetServerName().c_str()); +00300 <span class="keywordflow">return</span>; +00301 } +00302 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (this->connectors[i].GetState() != <a class="code" href="connection_8h.html#a0">STATE_DISCONNECTED</a>) +00303 { +00304 <span class="keywordflow">if</span> (!this->connectors[i].CheckPing()) +00305 { +00306 WriteOpers(<span class="stringliteral">"*** Lost single connection to %s: Ping timeout"</span>,this->connectors[i].GetServerName().c_str()); +00307 this->connectors[i].CloseConnection(); +00308 this->connectors[i].SetState(STATE_DISCONNECTED); +00309 <span class="keywordflow">if</span> (!<a class="code" href="servers_8cpp.html#a5">IsRoutable</a>(this->connectors[i].GetServerName())) +00310 { +00311 WriteOpers(<span class="stringliteral">"*** Server %s is no longer routable, disconnecting."</span>,this->connectors[i].GetServerName().c_str()); +00312 DoSplit(this->connectors[i].GetServerName().c_str()); +00313 } +00314 <a class="code" href="servers_8cpp.html#a3">has_been_netsplit</a> = <span class="keyword">true</span>; +00315 } +00316 } +00317 <span class="keywordflow">if</span> (this->connectors[i].HasBufferedOutput()) +00318 { +00319 <span class="keywordflow">if</span> (!this->connectors[i].FlushWriteBuf()) +00320 { +00321 <span class="comment">// if we're here the write() caused an error, we cannot proceed</span> +00322 WriteOpers(<span class="stringliteral">"*** Lost single connection to %s, link inactive and retrying: %s"</span>,this->connectors[i].GetServerName().c_str(),this->connectors[i].GetWriteError().c_str()); +00323 this->connectors[i].CloseConnection(); +00324 this->connectors[i].SetState(STATE_DISCONNECTED); +00325 <span class="keywordflow">if</span> (!<a class="code" href="servers_8cpp.html#a5">IsRoutable</a>(this->connectors[i].GetServerName())) +00326 { +00327 WriteOpers(<span class="stringliteral">"*** Server %s is no longer routable, disconnecting."</span>,this->connectors[i].GetServerName().c_str()); +00328 DoSplit(this->connectors[i].GetServerName().c_str()); +00329 } +00330 <a class="code" href="servers_8cpp.html#a3">has_been_netsplit</a> = <span class="keyword">true</span>; +00331 } +00332 } +00333 } +00334 } </pre></div> </td> </tr> </table> @@ -688,39 +716,38 @@ Begin an outbound mesh link to another ircd on a network you are already an auth <p> <p> -Definition at line <a class="el" href="servers_8cpp-source.html#l00176">176</a> of file <a class="el" href="servers_8cpp-source.html">servers.cpp</a>. -<p> -References <a class="el" href="servers_8h-source.html#l00081">connectors</a>, <a class="el" href="connection_8h-source.html#l00266">connection::fd</a>, <a class="el" href="classircd__connector.html#a1">ircd_connector::MakeOutboundConnection()</a>, <a class="el" href="servers_8cpp-source.html#l00275">SendPacket()</a>, <a class="el" href="classircd__connector.html#a13">ircd_connector::SetHostAndPort()</a>, <a class="el" href="classircd__connector.html#a3">ircd_connector::SetServerName()</a>, <a class="el" href="classircd__connector.html#a7">ircd_connector::SetState()</a>, <a class="el" href="connection_8h-source.html#l00036">STATE_CONNECTED</a>, <a class="el" href="connection_8h-source.html#l00035">STATE_DISCONNECTED</a>, and <a class="el" href="connection_8h-source.html#l00039">STATE_NOAUTH_OUTBOUND</a>. -<p> -<div class="fragment"><pre>00177 { -00178 <span class="keywordtype">char</span> connect[MAXBUF]; -00179 -00180 <a class="code" href="classircd__connector.html">ircd_connector</a> connector; -00181 -00182 WriteOpers(<span class="stringliteral">"Establishing meshed link to %s:%d"</span>,servername,newport); -00183 -00184 <span class="keywordflow">if</span> (this-><a class="code" href="classconnection.html#o0">fd</a>) -00185 { -00186 <span class="keywordflow">if</span> (connector.<a class="code" href="classircd__connector.html#a1">MakeOutboundConnection</a>(targethost,newport)) -00187 { -00188 <span class="comment">// targethost has been turned into an ip...</span> -00189 <span class="comment">// we dont want this as the server name.</span> -00190 connector.<a class="code" href="classircd__connector.html#a3">SetServerName</a>(servername); -00191 snprintf(connect,MAXBUF,<span class="stringliteral">"- %lu %s :%s"</span>,cookie,getservername().c_str(),getserverdesc().c_str()); -00192 connector.<a class="code" href="classircd__connector.html#a7">SetState</a>(STATE_NOAUTH_OUTBOUND); -00193 connector.<a class="code" href="classircd__connector.html#a13">SetHostAndPort</a>(targethost, newport); -00194 connector.<a class="code" href="classircd__connector.html#a7">SetState</a>(STATE_CONNECTED); -00195 this-><a class="code" href="classserverrec.html#o11">connectors</a>.push_back(connector); -00196 <span class="keywordflow">return</span> this-><a class="code" href="classserverrec.html#a7">SendPacket</a>(connect, servername); -00197 } -00198 <span class="keywordflow">else</span> -00199 { -00200 connector.<a class="code" href="classircd__connector.html#a7">SetState</a>(STATE_DISCONNECTED); -00201 WriteOpers(<span class="stringliteral">"Could not create outbound connection to %s:%d"</span>,targethost,newport); +Definition at line <a class="el" href="servers_8cpp-source.html#l00182">182</a> of file <a class="el" href="servers_8cpp-source.html">servers.cpp</a>. +<p> +References <a class="el" href="servers_8h-source.html#l00081">connectors</a>, <a class="el" href="connection_8h-source.html#l00266">connection::fd</a>, <a class="el" href="classircd__connector.html#a1">ircd_connector::MakeOutboundConnection()</a>, <a class="el" href="servers_8cpp-source.html#l00336">SendPacket()</a>, <a class="el" href="classircd__connector.html#a13">ircd_connector::SetHostAndPort()</a>, <a class="el" href="classircd__connector.html#a3">ircd_connector::SetServerName()</a>, <a class="el" href="classircd__connector.html#a7">ircd_connector::SetState()</a>, <a class="el" href="connection_8h-source.html#l00035">STATE_DISCONNECTED</a>, and <a class="el" href="connection_8h-source.html#l00039">STATE_NOAUTH_OUTBOUND</a>. +<p> +<div class="fragment"><pre>00183 { +00184 <span class="keywordtype">char</span> connect[MAXBUF]; +00185 +00186 <a class="code" href="classircd__connector.html">ircd_connector</a> connector; +00187 +00188 WriteOpers(<span class="stringliteral">"Establishing meshed link to %s:%d"</span>,servername,newport); +00189 +00190 <span class="keywordflow">if</span> (this-><a class="code" href="classconnection.html#o0">fd</a>) +00191 { +00192 <span class="keywordflow">if</span> (connector.<a class="code" href="classircd__connector.html#a1">MakeOutboundConnection</a>(targethost,newport)) +00193 { +00194 <span class="comment">// targethost has been turned into an ip...</span> +00195 <span class="comment">// we dont want this as the server name.</span> +00196 connector.<a class="code" href="classircd__connector.html#a3">SetServerName</a>(servername); +00197 snprintf(connect,MAXBUF,<span class="stringliteral">"- %lu %s :%s"</span>,cookie,getservername().c_str(),getserverdesc().c_str()); +00198 connector.<a class="code" href="classircd__connector.html#a7">SetState</a>(STATE_NOAUTH_OUTBOUND); +00199 connector.<a class="code" href="classircd__connector.html#a13">SetHostAndPort</a>(targethost, newport); +00200 this-><a class="code" href="classserverrec.html#o11">connectors</a>.push_back(connector); +00201 <span class="keywordflow">return</span> this-><a class="code" href="classserverrec.html#a7">SendPacket</a>(connect, servername); 00202 } -00203 } -00204 <span class="keywordflow">return</span> <span class="keyword">false</span>; -00205 } +00203 <span class="keywordflow">else</span> +00204 { +00205 connector.<a class="code" href="classircd__connector.html#a7">SetState</a>(STATE_DISCONNECTED); +00206 WriteOpers(<span class="stringliteral">"Could not create outbound connection to %s:%d"</span>,targethost,newport); +00207 } +00208 } +00209 <span class="keywordflow">return</span> <span class="keyword">false</span>; +00210 } </pre></div> </td> </tr> </table> @@ -769,95 +796,107 @@ Returns the next available packet and returns true if data is available. <p> 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. <p> -Definition at line <a class="el" href="servers_8cpp-source.html#l00370">370</a> of file <a class="el" href="servers_8cpp-source.html">servers.cpp</a>. -<p> -References <a class="el" href="servers_8cpp-source.html#l00350">already_have_sum()</a>, <a class="el" href="servers_8h-source.html#l00081">connectors</a>, <a class="el" href="modules_8h-source.html#l00023">DEBUG</a>, and <a class="el" href="connection_8h-source.html#l00035">STATE_DISCONNECTED</a>. -<p> -<div class="fragment"><pre>00371 { -00372 <span class="keywordtype">char</span> data[65536]; -00373 memset(data, 0, 65536); -00374 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < this-><a class="code" href="classserverrec.html#o11">connectors</a>.size(); i++) -00375 { -00376 <span class="keywordflow">if</span> (this-><a class="code" href="classserverrec.html#o11">connectors</a>[i].GetState() != <a class="code" href="connection_8h.html#a0">STATE_DISCONNECTED</a>) -00377 { -00378 <span class="comment">// returns false if the packet could not be sent (e.g. target host down)</span> -00379 <span class="keywordtype">int</span> rcvsize = 0; -00380 -00381 <span class="comment">// check if theres any data on this socket</span> -00382 <span class="comment">// if not, continue onwards to the next.</span> -00383 pollfd polls; -00384 polls.fd = this-><a class="code" href="classserverrec.html#o11">connectors</a>[i].GetDescriptor(); -00385 polls.events = POLLIN; -00386 <span class="keywordtype">int</span> ret = poll(&polls,1,1); -00387 <span class="keywordflow">if</span> (ret <= 0) <span class="keywordflow">continue</span>; -00388 -00389 rcvsize = recv(this->connectors[i].GetDescriptor(),data,65000,0); -00390 data[rcvsize] = <span class="charliteral">'\0'</span>; -00391 <span class="keywordflow">if</span> (rcvsize == -1) -00392 { -00393 <span class="keywordflow">if</span> (errno != EAGAIN) -00394 { -00395 log(DEBUG,<span class="stringliteral">"recv() failed for serverrec::RecvPacket(): %s"</span>,strerror(errno)); -00396 log(DEBUG,<span class="stringliteral">"Disabling connector: %s"</span>,this->connectors[i].GetServerName().c_str()); -00397 this-><a class="code" href="classserverrec.html#o11">connectors</a>[i].CloseConnection(); -00398 this-><a class="code" href="classserverrec.html#o11">connectors</a>[i].SetState(STATE_DISCONNECTED); -00399 } -00400 } -00401 <span class="keywordtype">int</span> pushed = 0; -00402 <span class="keywordflow">if</span> (rcvsize > 0) -00403 { -00404 <span class="keywordflow">if</span> (!this-><a class="code" href="classserverrec.html#o11">connectors</a>[i].AddBuffer(data)) -00405 { -00406 WriteOpers(<span class="stringliteral">"*** Read buffer for %s exceeds maximum, closing connection!"</span>,this->connectors[i].GetServerName().c_str()); -00407 this-><a class="code" href="classserverrec.html#o11">connectors</a>[i].CloseConnection(); -00408 this-><a class="code" href="classserverrec.html#o11">connectors</a>[i].SetState(STATE_DISCONNECTED); -00409 } -00410 <span class="keywordflow">if</span> (this-><a class="code" href="classserverrec.html#o11">connectors</a>[i].BufferIsComplete()) -00411 { -00412 this-><a class="code" href="classserverrec.html#o11">connectors</a>[i].ResetPing(); -00413 <span class="keywordflow">while</span> (this-><a class="code" href="classserverrec.html#o11">connectors</a>[i].BufferIsComplete()) -00414 { -00415 std::string text = this-><a class="code" href="classserverrec.html#o11">connectors</a>[i].GetBuffer(); -00416 <span class="keywordflow">if</span> (text != <span class="stringliteral">""</span>) -00417 { -00418 <span class="keywordflow">if</span> ((text[0] == <span class="charliteral">':'</span>) && (text.find(<span class="stringliteral">" "</span>) != std::string::npos)) -00419 { -00420 std::string orig = text; -00421 log(DEBUG,<span class="stringliteral">"Original: %s"</span>,text.c_str()); -00422 std::string sum = text.substr(1,text.find(<span class="stringliteral">" "</span>)-1); -00423 text = text.substr(text.find(<span class="stringliteral">" "</span>)+1,text.length()); -00424 std::string possible_token = text.substr(1,text.find(<span class="stringliteral">" "</span>)-1); -00425 <span class="keywordflow">if</span> (possible_token.length() > 1) -00426 { -00427 sums.push_back(<span class="stringliteral">"*"</span>); -00428 text = orig; -00429 log(DEBUG,<span class="stringliteral">"Non-mesh, non-tokenized string passed up the chain"</span>); -00430 } -00431 <span class="keywordflow">else</span> -00432 { -00433 log(DEBUG,<span class="stringliteral">"Packet sum: '%s'"</span>,sum.c_str()); -00434 <span class="keywordflow">if</span> ((<a class="code" href="servers_8cpp.html#a3">already_have_sum</a>(sum)) && (sum != <span class="stringliteral">"*"</span>)) -00435 { -00436 <span class="comment">// we don't accept dupes</span> -00437 <span class="keywordflow">continue</span>; -00438 } -00439 sums.push_back(sum.c_str()); -00440 } -00441 } -00442 <span class="keywordflow">else</span> sums.push_back(<span class="stringliteral">"*"</span>); -00443 messages.push_back(text.c_str()); -00444 strlcpy(recvhost,this->connectors[i].GetServerName().c_str(),160); -00445 log(DEBUG,<span class="stringliteral">"serverrec::RecvPacket() %d:%s->%s"</span>,pushed++,recvhost,text.c_str()); -00446 } -00447 } -00448 <span class="keywordflow">return</span> <span class="keyword">true</span>; -00449 } -00450 } -00451 } -00452 } -00453 <span class="comment">// nothing new yet -- message and host will be undefined</span> -00454 <span class="keywordflow">return</span> <span class="keyword">false</span>; -00455 } +Definition at line <a class="el" href="servers_8cpp-source.html#l00431">431</a> of file <a class="el" href="servers_8cpp-source.html">servers.cpp</a>. +<p> +References <a class="el" href="servers_8cpp-source.html#l00411">already_have_sum()</a>, <a class="el" href="servers_8h-source.html#l00081">connectors</a>, <a class="el" href="modules_8h-source.html#l00023">DEBUG</a>, <a class="el" href="servers_8cpp-source.html#l00042">has_been_netsplit</a>, <a class="el" href="servers_8cpp-source.html#l00256">IsRoutable()</a>, and <a class="el" href="connection_8h-source.html#l00035">STATE_DISCONNECTED</a>. +<p> +<div class="fragment"><pre>00432 { +00433 <span class="keywordtype">char</span> data[65536]; +00434 memset(data, 0, 65536); +00435 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < this-><a class="code" href="classserverrec.html#o11">connectors</a>.size(); i++) +00436 { +00437 <span class="keywordflow">if</span> (this-><a class="code" href="classserverrec.html#o11">connectors</a>[i].GetState() != <a class="code" href="connection_8h.html#a0">STATE_DISCONNECTED</a>) +00438 { +00439 <span class="comment">// returns false if the packet could not be sent (e.g. target host down)</span> +00440 <span class="keywordtype">int</span> rcvsize = 0; +00441 +00442 <span class="comment">// check if theres any data on this socket</span> +00443 <span class="comment">// if not, continue onwards to the next.</span> +00444 pollfd polls; +00445 polls.fd = this-><a class="code" href="classserverrec.html#o11">connectors</a>[i].GetDescriptor(); +00446 polls.events = POLLIN; +00447 <span class="keywordtype">int</span> ret = poll(&polls,1,1); +00448 <span class="keywordflow">if</span> (ret <= 0) <span class="keywordflow">continue</span>; +00449 +00450 rcvsize = recv(this->connectors[i].GetDescriptor(),data,65000,0); +00451 data[rcvsize] = <span class="charliteral">'\0'</span>; +00452 <span class="keywordflow">if</span> (rcvsize == -1) +00453 { +00454 <span class="keywordflow">if</span> (errno != EAGAIN) +00455 { +00456 log(DEBUG,<span class="stringliteral">"recv() failed for serverrec::RecvPacket(): %s"</span>,strerror(errno)); +00457 log(DEBUG,<span class="stringliteral">"Disabling connector: %s"</span>,this->connectors[i].GetServerName().c_str()); +00458 this-><a class="code" href="classserverrec.html#o11">connectors</a>[i].CloseConnection(); +00459 this-><a class="code" href="classserverrec.html#o11">connectors</a>[i].SetState(STATE_DISCONNECTED); +00460 <span class="keywordflow">if</span> (!<a class="code" href="servers_8cpp.html#a5">IsRoutable</a>(this->connectors[i].GetServerName())) +00461 { +00462 WriteOpers(<span class="stringliteral">"*** Server %s is no longer routable, disconnecting."</span>,this->connectors[i].GetServerName().c_str()); +00463 DoSplit(this->connectors[i].GetServerName().c_str()); +00464 } +00465 <a class="code" href="servers_8cpp.html#a3">has_been_netsplit</a> = <span class="keyword">true</span>; +00466 } +00467 } +00468 <span class="keywordtype">int</span> pushed = 0; +00469 <span class="keywordflow">if</span> (rcvsize > 0) +00470 { +00471 <span class="keywordflow">if</span> (!this-><a class="code" href="classserverrec.html#o11">connectors</a>[i].AddBuffer(data)) +00472 { +00473 WriteOpers(<span class="stringliteral">"*** Read buffer for %s exceeds maximum, closing connection!"</span>,this->connectors[i].GetServerName().c_str()); +00474 this-><a class="code" href="classserverrec.html#o11">connectors</a>[i].CloseConnection(); +00475 this-><a class="code" href="classserverrec.html#o11">connectors</a>[i].SetState(STATE_DISCONNECTED); +00476 <span class="keywordflow">if</span> (!<a class="code" href="servers_8cpp.html#a5">IsRoutable</a>(this->connectors[i].GetServerName())) +00477 { +00478 WriteOpers(<span class="stringliteral">"*** Server %s is no longer routable, disconnecting."</span>,this->connectors[i].GetServerName().c_str()); +00479 DoSplit(this->connectors[i].GetServerName().c_str()); +00480 } +00481 <a class="code" href="servers_8cpp.html#a3">has_been_netsplit</a> = <span class="keyword">true</span>; +00482 } +00483 <span class="keywordflow">if</span> (this-><a class="code" href="classserverrec.html#o11">connectors</a>[i].BufferIsComplete()) +00484 { +00485 this-><a class="code" href="classserverrec.html#o11">connectors</a>[i].ResetPing(); +00486 <span class="keywordflow">while</span> (this-><a class="code" href="classserverrec.html#o11">connectors</a>[i].BufferIsComplete()) +00487 { +00488 std::string text = this-><a class="code" href="classserverrec.html#o11">connectors</a>[i].GetBuffer(); +00489 <span class="keywordflow">if</span> (text != <span class="stringliteral">""</span>) +00490 { +00491 <span class="keywordflow">if</span> ((text[0] == <span class="charliteral">':'</span>) && (text.find(<span class="stringliteral">" "</span>) != std::string::npos)) +00492 { +00493 std::string orig = text; +00494 log(DEBUG,<span class="stringliteral">"Original: %s"</span>,text.c_str()); +00495 std::string sum = text.substr(1,text.find(<span class="stringliteral">" "</span>)-1); +00496 text = text.substr(text.find(<span class="stringliteral">" "</span>)+1,text.length()); +00497 std::string possible_token = text.substr(1,text.find(<span class="stringliteral">" "</span>)-1); +00498 <span class="keywordflow">if</span> (possible_token.length() > 1) +00499 { +00500 sums.push_back(<span class="stringliteral">"*"</span>); +00501 text = orig; +00502 log(DEBUG,<span class="stringliteral">"Non-mesh, non-tokenized string passed up the chain"</span>); +00503 } +00504 <span class="keywordflow">else</span> +00505 { +00506 log(DEBUG,<span class="stringliteral">"Packet sum: '%s'"</span>,sum.c_str()); +00507 <span class="keywordflow">if</span> ((<a class="code" href="servers_8cpp.html#a6">already_have_sum</a>(sum)) && (sum != <span class="stringliteral">"*"</span>)) +00508 { +00509 <span class="comment">// we don't accept dupes</span> +00510 <span class="keywordflow">continue</span>; +00511 } +00512 sums.push_back(sum.c_str()); +00513 } +00514 } +00515 <span class="keywordflow">else</span> sums.push_back(<span class="stringliteral">"*"</span>); +00516 messages.push_back(text.c_str()); +00517 strlcpy(recvhost,this->connectors[i].GetServerName().c_str(),160); +00518 log(DEBUG,<span class="stringliteral">"serverrec::RecvPacket() %d:%s->%s"</span>,pushed++,recvhost,text.c_str()); +00519 } +00520 } +00521 <span class="keywordflow">return</span> <span class="keyword">true</span>; +00522 } +00523 } +00524 } +00525 } +00526 <span class="comment">// nothing new yet -- message and host will be undefined</span> +00527 <span class="keywordflow">return</span> <span class="keyword">false</span>; +00528 } </pre></div> </td> </tr> </table> @@ -900,85 +939,85 @@ Send a message to a server by name, if the server is unavailable directly route <p> <p> -Definition at line <a class="el" href="servers_8cpp-source.html#l00275">275</a> of file <a class="el" href="servers_8cpp-source.html">servers.cpp</a>. -<p> -References <a class="el" href="classircd__connector.html#a21">ircd_connector::AddWriteBuf()</a>, <a class="el" href="classircd__connector.html#a14">ircd_connector::CloseConnection()</a>, <a class="el" href="servers_8h-source.html#l00081">connectors</a>, <a class="el" href="modules_8h-source.html#l00023">DEBUG</a>, <a class="el" href="servers_8cpp-source.html#l00237">FindHost()</a>, <a class="el" href="classircd__connector.html#a22">ircd_connector::FlushWriteBuf()</a>, <a class="el" href="classircd__connector.html#a2">ircd_connector::GetServerName()</a>, <a class="el" href="classircd__connector.html#a6">ircd_connector::GetState()</a>, <a class="el" href="classircd__connector.html#a24">ircd_connector::GetWriteError()</a>, <a class="el" href="classircd__connector.html#a7">ircd_connector::SetState()</a>, and <a class="el" href="connection_8h-source.html#l00035">STATE_DISCONNECTED</a>. -<p> -Referenced by <a class="el" href="servers_8cpp-source.html#l00138">BeginLink()</a>, and <a class="el" href="servers_8cpp-source.html#l00176">MeshCookie()</a>. -<p> -<div class="fragment"><pre>00276 { -00277 <span class="keywordflow">if</span> ((!message) || (!sendhost)) -00278 <span class="keywordflow">return</span> <span class="keyword">true</span>; -00279 -00280 <a class="code" href="classircd__connector.html">ircd_connector</a>* cn = this-><a class="code" href="classserverrec.html#a9">FindHost</a>(sendhost); -00281 -00282 <span class="keywordflow">if</span> (!strchr(message,<span class="charliteral">'\n'</span>)) -00283 { -00284 strlcat(message,<span class="stringliteral">"\n"</span>,MAXBUF); -00285 } -00286 -00287 <span class="keywordflow">if</span> (cn) -00288 { -00289 log(DEBUG,<span class="stringliteral">"main: serverrec::SendPacket() sent '%s' to %s"</span>,message,cn-><a class="code" href="classircd__connector.html#a2">GetServerName</a>().c_str()); -00290 -00291 <span class="keywordflow">if</span> (cn-><a class="code" href="classircd__connector.html#a6">GetState</a>() == <a class="code" href="connection_8h.html#a0">STATE_DISCONNECTED</a>) -00292 { -00293 <span class="comment">// fix: can only route one hop to avoid a loop</span> -00294 <span class="keywordflow">if</span> (strncmp(message,<span class="stringliteral">"R "</span>,2)) -00295 { -00296 log(DEBUG,<span class="stringliteral">"Not a double reroute"</span>); -00297 <span class="comment">// this route is down, we must re-route the packet through an available point in the mesh.</span> -00298 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> k = 0; k < this-><a class="code" href="classserverrec.html#o11">connectors</a>.size(); k++) -00299 { -00300 log(DEBUG,<span class="stringliteral">"Check connector %d: %s"</span>,k,this->connectors[k].GetServerName().c_str()); -00301 <span class="comment">// search for another point in the mesh which can 'reach' where we want to go</span> -00302 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> m = 0; m < this-><a class="code" href="classserverrec.html#o11">connectors</a>[k].routes.size(); m++) -00303 { -00304 <span class="keywordflow">if</span> (!strcasecmp(this->connectors[k].routes[m].c_str(),sendhost)) -00305 { -00306 log(DEBUG,<span class="stringliteral">"Found alternative route for packet: %s"</span>,this->connectors[k].GetServerName().c_str()); -00307 <span class="keywordtype">char</span> buffer[MAXBUF]; -00308 snprintf(buffer,MAXBUF,<span class="stringliteral">"R %s %s"</span>,sendhost,message); -00309 this-><a class="code" href="classserverrec.html#a7">SendPacket</a>(buffer,this->connectors[k].GetServerName().c_str()); -00310 <span class="keywordflow">return</span> <span class="keyword">true</span>; -00311 } -00312 } -00313 } -00314 } -00315 <span class="keywordtype">char</span> buffer[MAXBUF]; -00316 snprintf(buffer,MAXBUF,<span class="stringliteral">"& %s"</span>,sendhost); -00317 WriteOpers(<span class="stringliteral">"*** All connections to %s lost."</span>,sendhost); -00318 NetSendToAllExcept(sendhost,buffer); -00319 DoSplit(sendhost); -00320 <span class="keywordflow">return</span> <span class="keyword">false</span>; -00321 } -00322 -00323 <span class="comment">// returns false if the packet could not be sent (e.g. target host down)</span> -00324 <span class="keywordflow">if</span> (!cn-><a class="code" href="classircd__connector.html#a21">AddWriteBuf</a>(message)) -00325 { -00326 <span class="comment">// if we're here, there was an error pending, and the send cannot proceed</span> -00327 log(DEBUG,<span class="stringliteral">"cn->AddWriteBuf() failed for serverrec::SendPacket(): %s"</span>,cn-><a class="code" href="classircd__connector.html#a24">GetWriteError</a>().c_str()); -00328 log(DEBUG,<span class="stringliteral">"Disabling connector: %s"</span>,cn-><a class="code" href="classircd__connector.html#a2">GetServerName</a>().c_str()); -00329 cn-><a class="code" href="classircd__connector.html#a14">CloseConnection</a>(); -00330 cn-><a class="code" href="classircd__connector.html#a7">SetState</a>(STATE_DISCONNECTED); -00331 WriteOpers(<span class="stringliteral">"*** Lost single connection to %s, link inactive and retrying: %s"</span>,cn-><a class="code" href="classircd__connector.html#a2">GetServerName</a>().c_str(),cn-><a class="code" href="classircd__connector.html#a24">GetWriteError</a>().c_str()); -00332 <span class="comment">// retry the packet along a new route so either arrival OR failure are gauranteed (bugfix)</span> -00333 <span class="keywordflow">return</span> this-><a class="code" href="classserverrec.html#a7">SendPacket</a>(message,sendhost); -00334 } -00335 <span class="keywordflow">if</span> (!cn-><a class="code" href="classircd__connector.html#a22">FlushWriteBuf</a>()) -00336 { -00337 <span class="comment">// if we're here the write() caused an error, we cannot proceed</span> -00338 log(DEBUG,<span class="stringliteral">"cn->FlushWriteBuf() failed for serverrec::SendPacket(): %s"</span>,cn-><a class="code" href="classircd__connector.html#a24">GetWriteError</a>().c_str()); -00339 log(DEBUG,<span class="stringliteral">"Disabling connector: %s"</span>,cn-><a class="code" href="classircd__connector.html#a2">GetServerName</a>().c_str()); -00340 cn-><a class="code" href="classircd__connector.html#a14">CloseConnection</a>(); -00341 cn-><a class="code" href="classircd__connector.html#a7">SetState</a>(STATE_DISCONNECTED); -00342 WriteOpers(<span class="stringliteral">"*** Lost single connection to %s, link inactive and retrying: %s"</span>,cn-><a class="code" href="classircd__connector.html#a2">GetServerName</a>().c_str(),cn-><a class="code" href="classircd__connector.html#a24">GetWriteError</a>().c_str()); -00343 <span class="comment">// retry the packet along a new route so either arrival OR failure are gauranteed</span> -00344 <span class="keywordflow">return</span> this-><a class="code" href="classserverrec.html#a7">SendPacket</a>(message,sendhost); -00345 } -00346 <span class="keywordflow">return</span> <span class="keyword">true</span>; -00347 } -00348 } +Definition at line <a class="el" href="servers_8cpp-source.html#l00336">336</a> of file <a class="el" href="servers_8cpp-source.html">servers.cpp</a>. +<p> +References <a class="el" href="classircd__connector.html#a21">ircd_connector::AddWriteBuf()</a>, <a class="el" href="classircd__connector.html#a14">ircd_connector::CloseConnection()</a>, <a class="el" href="servers_8h-source.html#l00081">connectors</a>, <a class="el" href="modules_8h-source.html#l00023">DEBUG</a>, <a class="el" href="servers_8cpp-source.html#l00242">FindHost()</a>, <a class="el" href="classircd__connector.html#a22">ircd_connector::FlushWriteBuf()</a>, <a class="el" href="classircd__connector.html#a2">ircd_connector::GetServerName()</a>, <a class="el" href="classircd__connector.html#a6">ircd_connector::GetState()</a>, <a class="el" href="classircd__connector.html#a24">ircd_connector::GetWriteError()</a>, <a class="el" href="classircd__connector.html#a7">ircd_connector::SetState()</a>, and <a class="el" href="connection_8h-source.html#l00035">STATE_DISCONNECTED</a>. +<p> +Referenced by <a class="el" href="servers_8cpp-source.html#l00142">BeginLink()</a>, and <a class="el" href="servers_8cpp-source.html#l00182">MeshCookie()</a>. +<p> +<div class="fragment"><pre>00337 { +00338 <span class="keywordflow">if</span> ((!message) || (!sendhost)) +00339 <span class="keywordflow">return</span> <span class="keyword">true</span>; +00340 +00341 <a class="code" href="classircd__connector.html">ircd_connector</a>* cn = this-><a class="code" href="classserverrec.html#a9">FindHost</a>(sendhost); +00342 +00343 <span class="keywordflow">if</span> (!strchr(message,<span class="charliteral">'\n'</span>)) +00344 { +00345 strlcat(message,<span class="stringliteral">"\n"</span>,MAXBUF); +00346 } +00347 +00348 <span class="keywordflow">if</span> (cn) +00349 { +00350 log(DEBUG,<span class="stringliteral">"main: serverrec::SendPacket() sent '%s' to %s"</span>,message,cn-><a class="code" href="classircd__connector.html#a2">GetServerName</a>().c_str()); +00351 +00352 <span class="keywordflow">if</span> (cn-><a class="code" href="classircd__connector.html#a6">GetState</a>() == <a class="code" href="connection_8h.html#a0">STATE_DISCONNECTED</a>) +00353 { +00354 <span class="comment">// fix: can only route one hop to avoid a loop</span> +00355 <span class="keywordflow">if</span> (strncmp(message,<span class="stringliteral">"R "</span>,2)) +00356 { +00357 log(DEBUG,<span class="stringliteral">"Not a double reroute"</span>); +00358 <span class="comment">// this route is down, we must re-route the packet through an available point in the mesh.</span> +00359 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> k = 0; k < this-><a class="code" href="classserverrec.html#o11">connectors</a>.size(); k++) +00360 { +00361 log(DEBUG,<span class="stringliteral">"Check connector %d: %s"</span>,k,this->connectors[k].GetServerName().c_str()); +00362 <span class="comment">// search for another point in the mesh which can 'reach' where we want to go</span> +00363 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> m = 0; m < this-><a class="code" href="classserverrec.html#o11">connectors</a>[k].routes.size(); m++) +00364 { +00365 <span class="keywordflow">if</span> (!strcasecmp(this->connectors[k].routes[m].c_str(),sendhost)) +00366 { +00367 log(DEBUG,<span class="stringliteral">"Found alternative route for packet: %s"</span>,this->connectors[k].GetServerName().c_str()); +00368 <span class="keywordtype">char</span> buffer[MAXBUF]; +00369 snprintf(buffer,MAXBUF,<span class="stringliteral">"R %s %s"</span>,sendhost,message); +00370 this-><a class="code" href="classserverrec.html#a7">SendPacket</a>(buffer,this->connectors[k].GetServerName().c_str()); +00371 <span class="keywordflow">return</span> <span class="keyword">true</span>; +00372 } +00373 } +00374 } +00375 } +00376 <span class="keywordtype">char</span> buffer[MAXBUF]; +00377 snprintf(buffer,MAXBUF,<span class="stringliteral">"& %s"</span>,sendhost); +00378 WriteOpers(<span class="stringliteral">"*** All connections to %s lost."</span>,sendhost); +00379 NetSendToAllExcept(sendhost,buffer); +00380 DoSplit(sendhost); +00381 <span class="keywordflow">return</span> <span class="keyword">false</span>; +00382 } +00383 +00384 <span class="comment">// returns false if the packet could not be sent (e.g. target host down)</span> +00385 <span class="keywordflow">if</span> (!cn-><a class="code" href="classircd__connector.html#a21">AddWriteBuf</a>(message)) +00386 { +00387 <span class="comment">// if we're here, there was an error pending, and the send cannot proceed</span> +00388 log(DEBUG,<span class="stringliteral">"cn->AddWriteBuf() failed for serverrec::SendPacket(): %s"</span>,cn-><a class="code" href="classircd__connector.html#a24">GetWriteError</a>().c_str()); +00389 log(DEBUG,<span class="stringliteral">"Disabling connector: %s"</span>,cn-><a class="code" href="classircd__connector.html#a2">GetServerName</a>().c_str()); +00390 cn-><a class="code" href="classircd__connector.html#a14">CloseConnection</a>(); +00391 cn-><a class="code" href="classircd__connector.html#a7">SetState</a>(STATE_DISCONNECTED); +00392 WriteOpers(<span class="stringliteral">"*** Lost single connection to %s, link inactive and retrying: %s"</span>,cn-><a class="code" href="classircd__connector.html#a2">GetServerName</a>().c_str(),cn-><a class="code" href="classircd__connector.html#a24">GetWriteError</a>().c_str()); +00393 <span class="comment">// retry the packet along a new route so either arrival OR failure are gauranteed (bugfix)</span> +00394 <span class="keywordflow">return</span> this-><a class="code" href="classserverrec.html#a7">SendPacket</a>(message,sendhost); +00395 } +00396 <span class="keywordflow">if</span> (!cn-><a class="code" href="classircd__connector.html#a22">FlushWriteBuf</a>()) +00397 { +00398 <span class="comment">// if we're here the write() caused an error, we cannot proceed</span> +00399 log(DEBUG,<span class="stringliteral">"cn->FlushWriteBuf() failed for serverrec::SendPacket(): %s"</span>,cn-><a class="code" href="classircd__connector.html#a24">GetWriteError</a>().c_str()); +00400 log(DEBUG,<span class="stringliteral">"Disabling connector: %s"</span>,cn-><a class="code" href="classircd__connector.html#a2">GetServerName</a>().c_str()); +00401 cn-><a class="code" href="classircd__connector.html#a14">CloseConnection</a>(); +00402 cn-><a class="code" href="classircd__connector.html#a7">SetState</a>(STATE_DISCONNECTED); +00403 WriteOpers(<span class="stringliteral">"*** Lost single connection to %s, link inactive and retrying: %s"</span>,cn-><a class="code" href="classircd__connector.html#a2">GetServerName</a>().c_str(),cn-><a class="code" href="classircd__connector.html#a24">GetWriteError</a>().c_str()); +00404 <span class="comment">// retry the packet along a new route so either arrival OR failure are gauranteed</span> +00405 <span class="keywordflow">return</span> this-><a class="code" href="classserverrec.html#a7">SendPacket</a>(message,sendhost); +00406 } +00407 <span class="keywordflow">return</span> <span class="keyword">true</span>; +00408 } +00409 } </pre></div> </td> </tr> </table> @@ -1012,13 +1051,13 @@ Terminate a link to 'targethost' by calling the <a class="el" href="classircd__c <p> <p> -Definition at line <a class="el" href="servers_8cpp-source.html#l00229">229</a> of file <a class="el" href="servers_8cpp-source.html">servers.cpp</a>. +Definition at line <a class="el" href="servers_8cpp-source.html#l00234">234</a> of file <a class="el" href="servers_8cpp-source.html">servers.cpp</a>. <p> -<div class="fragment"><pre>00230 { -00231 <span class="comment">// this locates the targethost in the serverrec::connectors vector of the class,</span> -00232 <span class="comment">// and terminates it by sending it an SQUIT token and closing its descriptor.</span> -00233 <span class="comment">// TerminateLink with a null string causes a terminate of ALL links</span> -00234 } +<div class="fragment"><pre>00235 { +00236 <span class="comment">// this locates the targethost in the serverrec::connectors vector of the class,</span> +00237 <span class="comment">// and terminates it by sending it an SQUIT token and closing its descriptor.</span> +00238 <span class="comment">// TerminateLink with a null string causes a terminate of ALL links</span> +00239 } </pre></div> </td> </tr> </table> @@ -1048,7 +1087,7 @@ With a serverrec, this is a list of all established server connections. <p> Definition at line <a class="el" href="servers_8h-source.html#l00081">81</a> of file <a class="el" href="servers_8h-source.html">servers.h</a>. <p> -Referenced by <a class="el" href="servers_8cpp-source.html#l00207">AddIncoming()</a>, <a class="el" href="servers_8cpp-source.html#l00138">BeginLink()</a>, <a class="el" href="servers_8cpp-source.html#l00237">FindHost()</a>, <a class="el" href="servers_8cpp-source.html#l00249">FlushWriteBuffers()</a>, <a class="el" href="servers_8cpp-source.html#l00176">MeshCookie()</a>, <a class="el" href="servers_8cpp-source.html#l00370">RecvPacket()</a>, <a class="el" href="servers_8cpp-source.html#l00275">SendPacket()</a>, and <a class="el" href="servers_8cpp-source.html#l00042">serverrec()</a>. </td> +Referenced by <a class="el" href="servers_8cpp-source.html#l00212">AddIncoming()</a>, <a class="el" href="servers_8cpp-source.html#l00142">BeginLink()</a>, <a class="el" href="servers_8cpp-source.html#l00242">FindHost()</a>, <a class="el" href="servers_8cpp-source.html#l00284">FlushWriteBuffers()</a>, <a class="el" href="servers_8cpp-source.html#l00256">IsRoutable()</a>, <a class="el" href="servers_8cpp-source.html#l00182">MeshCookie()</a>, <a class="el" href="servers_8cpp-source.html#l00431">RecvPacket()</a>, <a class="el" href="servers_8cpp-source.html#l00336">SendPacket()</a>, and <a class="el" href="servers_8cpp-source.html#l00046">serverrec()</a>. </td> </tr> </table> <a name="o8" doxytag="serverrec::description"></a><p> @@ -1102,7 +1141,7 @@ number of hops away (for quick access) <p> Definition at line <a class="el" href="servers_8h-source.html#l00051">51</a> of file <a class="el" href="servers_8h-source.html">servers.h</a>. <p> -Referenced by <a class="el" href="servers_8cpp-source.html#l00042">serverrec()</a>. </td> +Referenced by <a class="el" href="servers_8cpp-source.html#l00046">serverrec()</a>. </td> </tr> </table> <a name="o7" doxytag="serverrec::jupiter"></a><p> @@ -1130,7 +1169,7 @@ is a JUPE server (faked to enforce a server ban) <p> Definition at line <a class="el" href="servers_8h-source.html#l00057">57</a> of file <a class="el" href="servers_8h-source.html">servers.h</a>. <p> -Referenced by <a class="el" href="servers_8cpp-source.html#l00042">serverrec()</a>. </td> +Referenced by <a class="el" href="servers_8cpp-source.html#l00046">serverrec()</a>. </td> </tr> </table> <a name="o0" doxytag="serverrec::name"></a><p> @@ -1158,7 +1197,7 @@ server name <p> Definition at line <a class="el" href="servers_8h-source.html#l00036">36</a> of file <a class="el" href="servers_8h-source.html">servers.h</a>. <p> -Referenced by <a class="el" href="servers_8cpp-source.html#l00042">serverrec()</a>. </td> +Referenced by <a class="el" href="servers_8cpp-source.html#l00046">serverrec()</a>. </td> </tr> </table> <a name="o9" doxytag="serverrec::nickserv"></a><p> @@ -1186,7 +1225,7 @@ Holds nickserv's name on U:lined (services) servers (this is a kludge for ircser <p> Definition at line <a class="el" href="servers_8h-source.html#l00065">65</a> of file <a class="el" href="servers_8h-source.html">servers.h</a>. <p> -Referenced by <a class="el" href="servers_8cpp-source.html#l00042">serverrec()</a>. </td> +Referenced by <a class="el" href="servers_8cpp-source.html#l00046">serverrec()</a>. </td> </tr> </table> <a name="o4" doxytag="serverrec::opercount"></a><p> @@ -1214,7 +1253,7 @@ opers on server <p> Definition at line <a class="el" href="servers_8h-source.html#l00048">48</a> of file <a class="el" href="servers_8h-source.html">servers.h</a>. <p> -Referenced by <a class="el" href="servers_8cpp-source.html#l00042">serverrec()</a>. </td> +Referenced by <a class="el" href="servers_8cpp-source.html#l00046">serverrec()</a>. </td> </tr> </table> <a name="o1" doxytag="serverrec::pingtime"></a><p> @@ -1242,7 +1281,7 @@ last ping response (ms) <p> Definition at line <a class="el" href="servers_8h-source.html#l00039">39</a> of file <a class="el" href="servers_8h-source.html">servers.h</a>. <p> -Referenced by <a class="el" href="servers_8cpp-source.html#l00042">serverrec()</a>. </td> +Referenced by <a class="el" href="servers_8cpp-source.html#l00046">serverrec()</a>. </td> </tr> </table> <a name="o10" doxytag="serverrec::sync_soon"></a><p> @@ -1268,7 +1307,7 @@ Referenced by <a class="el" href="servers_8cpp-source.html#l00042">serverrec()</ <p> Definition at line <a class="el" href="servers_8h-source.html#l00067">67</a> of file <a class="el" href="servers_8h-source.html">servers.h</a>. <p> -Referenced by <a class="el" href="servers_8cpp-source.html#l00042">serverrec()</a>. </td> +Referenced by <a class="el" href="servers_8cpp-source.html#l00046">serverrec()</a>. </td> </tr> </table> <a name="o3" doxytag="serverrec::usercount"></a><p> @@ -1296,7 +1335,7 @@ non-invisible users on server <p> Definition at line <a class="el" href="servers_8h-source.html#l00045">45</a> of file <a class="el" href="servers_8h-source.html">servers.h</a>. <p> -Referenced by <a class="el" href="servers_8cpp-source.html#l00042">serverrec()</a>. </td> +Referenced by <a class="el" href="servers_8cpp-source.html#l00046">serverrec()</a>. </td> </tr> </table> <a name="o2" doxytag="serverrec::usercount_i"></a><p> @@ -1324,7 +1363,7 @@ invisible users on server <p> Definition at line <a class="el" href="servers_8h-source.html#l00042">42</a> of file <a class="el" href="servers_8h-source.html">servers.h</a>. <p> -Referenced by <a class="el" href="servers_8cpp-source.html#l00042">serverrec()</a>. </td> +Referenced by <a class="el" href="servers_8cpp-source.html#l00046">serverrec()</a>. </td> </tr> </table> <a name="o6" doxytag="serverrec::version"></a><p> @@ -1352,12 +1391,12 @@ ircd version <p> Definition at line <a class="el" href="servers_8h-source.html#l00054">54</a> of file <a class="el" href="servers_8h-source.html">servers.h</a>. <p> -Referenced by <a class="el" href="servers_8cpp-source.html#l00042">serverrec()</a>. </td> +Referenced by <a class="el" href="servers_8cpp-source.html#l00046">serverrec()</a>. </td> </tr> </table> <hr>The documentation for this class was generated from the following files:<ul> <li><a class="el" href="servers_8h-source.html">servers.h</a><li><a class="el" href="servers_8cpp-source.html">servers.cpp</a></ul> -<hr size="1"><address style="align: right;"><small>Generated on Tue May 24 02:32:39 2005 for InspIRCd by +<hr size="1"><address style="align: right;"><small>Generated on Wed May 25 21:43:33 2005 for InspIRCd by <a href="http://www.doxygen.org/index.html"> <img src="doxygen.png" alt="doxygen" align="middle" border=0 > </a>1.3.3 </small></address> |