<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> <title>InspIRCd: servers.cpp File Reference</title> <link href="inspircd.doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.3.3 --> <div class="qindex"><a class="qindex" href="main.html">Main Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical List</a> | <a class="qindex" href="annotated.html">Compound List</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="namespacemembers.html">Namespace Members</a> | <a class="qindex" href="functions.html">Compound Members</a> | <a class="qindex" href="globals.html">File Members</a></div> <h1>servers.cpp File Reference</h1><code>#include "inspircd_config.h"</code><br> <code>#include "<a class="el" href="servers_8h-source.html">servers.h</a>"</code><br> <code>#include "inspircd.h"</code><br> <code>#include <unistd.h></code><br> <code>#include <fcntl.h></code><br> <code>#include <poll.h></code><br> <code>#include <sys/errno.h></code><br> <code>#include <sys/ioctl.h></code><br> <code>#include <sys/utsname.h></code><br> <code>#include <vector></code><br> <code>#include <string></code><br> <code>#include <deque></code><br> <code>#include <sstream></code><br> <code>#include <map></code><br> <code>#include "inspstring.h"</code><br> <code>#include "helperfuncs.h"</code><br> <code>#include "<a class="el" href="connection_8h-source.html">connection.h</a>"</code><br> <p> Include dependency graph for servers.cpp:<p><center><img src="servers_8cpp__incl.gif" border="0" usemap="#servers.cpp_map" alt="Include dependency graph"></center> <map name="servers.cpp_map"> <area href="servers_8h.html" shape="rect" coords="341,210,418,237" alt=""> <area href="connection_8h.html" shape="rect" coords="178,312,277,338" alt=""> </map> <p> <a href="servers_8cpp-source.html">Go to the source code of this file.</a><table border=0 cellpadding=0 cellspacing=0> <tr><td></td></tr> <tr><td colspan=2><br><h2>Functions</h2></td></tr> <tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="servers_8cpp.html#a5">IsRoutable</a> (std::string servername)</td></tr> <tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="servers_8cpp.html#a6">already_have_sum</a> (std::string sum)</td></tr> <tr><td colspan=2><br><h2>Variables</h2></td></tr> <tr><td class="memItemLeft" nowrap align=right valign=top>time_t </td><td class="memItemRight" valign=bottom><a class="el" href="servers_8cpp.html#a0">TIME</a></td></tr> <tr><td class="memItemLeft" nowrap align=right valign=top>int </td><td class="memItemRight" valign=bottom><a class="el" href="servers_8cpp.html#a1">MaxConn</a></td></tr> <tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="classserverrec.html">serverrec</a> * </td><td class="memItemRight" valign=bottom><a class="el" href="servers_8cpp.html#a2">me</a> [32]</td></tr> <tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="servers_8cpp.html#a3">has_been_netsplit</a></td></tr> <tr><td class="memItemLeft" nowrap align=right valign=top>std::deque< std::string > </td><td class="memItemRight" valign=bottom><a class="el" href="servers_8cpp.html#a4">xsums</a></td></tr> </table> <hr><h2>Function Documentation</h2> <a name="a6" doxytag="servers.cpp::already_have_sum"></a><p> <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> bool already_have_sum </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">std::string </td> <td class="mdname1" valign="top" nowrap> <em>sum</em> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> <p> Definition at line <a class="el" href="servers_8cpp-source.html#l00411">411</a> of file <a class="el" href="servers_8cpp-source.html">servers.cpp</a>. <p> References <a class="el" href="servers_8cpp-source.html#l00044">xsums</a>. <p> Referenced by <a class="el" href="servers_8cpp-source.html#l00431">serverrec::RecvPacket()</a>. <p> <div class="fragment"><pre>00412 { 00413 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < <a class="code" href="servers_8cpp.html#a4">xsums</a>.size(); i++) 00414 { 00415 <span class="keywordflow">if</span> (<a class="code" href="servers_8cpp.html#a4">xsums</a>[i] == sum) 00416 { 00417 <span class="keywordflow">return</span> <span class="keyword">true</span>; 00418 } 00419 } 00420 <span class="keywordflow">if</span> (<a class="code" href="servers_8cpp.html#a4">xsums</a>.size() >= 128) 00421 { 00422 <a class="code" href="servers_8cpp.html#a4">xsums</a>.pop_front(); 00423 } 00424 <a class="code" href="servers_8cpp.html#a4">xsums</a>.push_back(sum); 00425 <span class="keywordflow">return</span> <span class="keyword">false</span>; 00426 } </pre></div> </td> </tr> </table> <a name="a5" doxytag="servers.cpp::IsRoutable"></a><p> <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> bool IsRoutable </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">std::string </td> <td class="mdname1" valign="top" nowrap> <em>servername</em> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> <p> Definition at line <a class="el" href="servers_8cpp-source.html#l00256">256</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">serverrec::connectors</a>, <a class="el" href="servers_8cpp-source.html#l00242">serverrec::FindHost()</a>, <a class="el" href="classircd__connector.html#a6">ircd_connector::GetState()</a>, <a class="el" href="channels_8cpp-source.html#l00097">me</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#l00284">serverrec::FlushWriteBuffers()</a>, and <a class="el" href="servers_8cpp-source.html#l00431">serverrec::RecvPacket()</a>. <p> <div class="fragment"><pre>00257 { 00258 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> x = 0; x < 32; x++) <span class="keywordflow">if</span> (<a class="code" href="channels_8cpp.html#a34">me</a>[x]) 00259 { 00260 <a class="code" href="classircd__connector.html">ircd_connector</a>* cn = <a class="code" href="channels_8cpp.html#a34">me</a>[x]-><a class="code" href="classserverrec.html#a9">FindHost</a>(servername.c_str()); 00261 <span class="keywordflow">if</span> (cn) 00262 { 00263 <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>) 00264 { 00265 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> k = 0; k < <a class="code" href="channels_8cpp.html#a34">me</a>[x]-><a class="code" href="classserverrec.html#o11">connectors</a>.size(); k++) 00266 { 00267 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> m = 0; m < <a class="code" href="channels_8cpp.html#a34">me</a>[x]-><a class="code" href="classserverrec.html#o11">connectors</a>[k].routes.size(); m++) 00268 { 00269 <span class="keywordflow">if</span> (!strcasecmp(me[x]->connectors[k].routes[m].c_str(),servername.c_str())) 00270 { 00271 <span class="keywordflow">return</span> <span class="keyword">true</span>; 00272 } 00273 } 00274 } 00275 <span class="keywordflow">return</span> <span class="keyword">false</span>; 00276 } 00277 <span class="keywordflow">else</span> <span class="keywordflow">return</span> <span class="keyword">true</span>; 00278 } 00279 } 00280 <span class="keywordflow">return</span> <span class="keyword">false</span>; 00281 } </pre></div> </td> </tr> </table> <hr><h2>Variable Documentation</h2> <a name="a3" doxytag="servers.cpp::has_been_netsplit"></a><p> <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> bool <a class="el" href="servers_8cpp.html#a3">has_been_netsplit</a> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <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>. <p> Referenced by <a class="el" href="servers_8cpp-source.html#l00284">serverrec::FlushWriteBuffers()</a>, and <a class="el" href="servers_8cpp-source.html#l00431">serverrec::RecvPacket()</a>. </td> </tr> </table> <a name="a1" doxytag="servers.cpp::MaxConn"></a><p> <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> int <a class="el" href="servers_8cpp.html#a1">MaxConn</a> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> <p> Definition at line <a class="el" href="servers_8cpp-source.html#l00038">38</a> of file <a class="el" href="servers_8cpp-source.html">servers.cpp</a>. <p> Referenced by <a class="el" href="servers_8cpp-source.html#l00081">serverrec::CreateListener()</a>. </td> </tr> </table> <a name="a2" doxytag="servers.cpp::me"></a><p> <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> <a class="el" href="classserverrec.html">serverrec</a>* <a class="el" href="servers_8cpp.html#a2">me</a>[32] </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> <p> Definition at line <a class="el" href="servers_8cpp-source.html#l00040">40</a> of file <a class="el" href="servers_8cpp-source.html">servers.cpp</a>. </td> </tr> </table> <a name="a0" doxytag="servers.cpp::TIME"></a><p> <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> time_t <a class="el" href="users_8cpp.html#a1">TIME</a> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> <p> Definition at line <a class="el" href="servers_8cpp-source.html#l00037">37</a> of file <a class="el" href="servers_8cpp-source.html">servers.cpp</a>. </td> </tr> </table> <a name="a4" doxytag="servers.cpp::xsums"></a><p> <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> std::deque<std::string> <a class="el" href="servers_8cpp.html#a4">xsums</a> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> <p> Definition at line <a class="el" href="servers_8cpp-source.html#l00044">44</a> of file <a class="el" href="servers_8cpp-source.html">servers.cpp</a>. <p> Referenced by <a class="el" href="servers_8cpp-source.html#l00411">already_have_sum()</a>. </td> </tr> </table> <hr size="1"><address style="align: right;"><small>Generated on Wed May 25 22:02:38 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> </body> </html>