Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

servers.cpp File Reference

#include "inspircd_config.h"
#include "servers.h"
#include "inspircd.h"
#include <unistd.h>
#include <fcntl.h>
#include <poll.h>
#include <sys/errno.h>
#include <sys/ioctl.h>
#include <sys/utsname.h>
#include <vector>
#include <string>
#include <deque>
#include <sstream>
#include <map>
#include "inspstring.h"
#include "helperfuncs.h"
#include "connection.h"

Include dependency graph for servers.cpp:

Include dependency graph

Go to the source code of this file.

Functions

bool IsRoutable (std::string servername)
bool already_have_sum (std::string sum)

Variables

time_t TIME
int MaxConn
serverrecme [32]
bool has_been_netsplit
std::deque< std::string > xsums


Function Documentation

bool already_have_sum std::string  sum  ) 
 

Definition at line 411 of file servers.cpp.

References xsums.

Referenced by serverrec::RecvPacket().

00412 {
00413         for (int i = 0; i < xsums.size(); i++)
00414         {
00415                 if (xsums[i] == sum)
00416                 {
00417                         return true;
00418                 }
00419         }
00420         if (xsums.size() >= 128)
00421         {
00422                 xsums.pop_front();
00423         }
00424         xsums.push_back(sum);
00425         return false;
00426 }

bool IsRoutable std::string  servername  ) 
 

Definition at line 256 of file servers.cpp.

References serverrec::connectors, serverrec::FindHost(), ircd_connector::GetState(), me, and STATE_DISCONNECTED.

Referenced by serverrec::FlushWriteBuffers(), and serverrec::RecvPacket().

00257 {
00258         for (int x = 0; x < 32; x++) if (me[x])
00259         {
00260                 ircd_connector* cn = me[x]->FindHost(servername.c_str());
00261                 if (cn)
00262                 {
00263                         if (cn->GetState() == STATE_DISCONNECTED)
00264                         {
00265                                 for (int k = 0; k < me[x]->connectors.size(); k++)
00266                                 {
00267                                         for (int m = 0; m < me[x]->connectors[k].routes.size(); m++)
00268                                         {
00269                                                 if (!strcasecmp(me[x]->connectors[k].routes[m].c_str(),servername.c_str()))
00270                                                 {
00271                                                         return true;
00272                                                 }
00273                                         }
00274                                 }
00275                                 return false;
00276                         }
00277                         else return true;
00278                 }
00279         }
00280         return false;
00281 }


Variable Documentation

bool has_been_netsplit
 

Definition at line 42 of file servers.cpp.

Referenced by serverrec::FlushWriteBuffers(), and serverrec::RecvPacket().

int MaxConn
 

Definition at line 38 of file servers.cpp.

Referenced by serverrec::CreateListener().

serverrec* me[32]
 

Definition at line 40 of file servers.cpp.

time_t TIME
 

Definition at line 37 of file servers.cpp.

std::deque<std::string> xsums
 

Definition at line 44 of file servers.cpp.

Referenced by already_have_sum().


Generated on Wed May 25 22:02:38 2005 for InspIRCd by doxygen 1.3.3