|
|||
|
|||
|
#include <utils.h>
Inheritance diagram for SpanningTreeUtilities:


Public Member Functions | |
| SpanningTreeUtilities (InspIRCd *Instance, ModuleSpanningTree *Creator) | |
| Initialise utility class. | |
| ~SpanningTreeUtilities () | |
| Destroy class and free listeners etc. | |
| bool | DoOneToOne (const std::string &prefix, const std::string &command, std::deque< std::string > ¶ms, std::string target) |
| Send a message from this server to one other local or remote. | |
| bool | DoOneToAllButSender (const std::string &prefix, const std::string &command, std::deque< std::string > ¶ms, std::string omit) |
| Send a message from this server to all but one other, local or remote. | |
| bool | DoOneToAllButSender (const char *prefix, const char *command, std::deque< std::string > ¶ms, std::string omit) |
| Send a message from this server to all but one other, local or remote. | |
| bool | DoOneToMany (const std::string &prefix, const std::string &command, std::deque< std::string > ¶ms) |
| Send a message from this server to all others. | |
| bool | DoOneToMany (const char *prefix, const char *command, std::deque< std::string > ¶ms) |
| Send a message from this server to all others. | |
| bool | DoOneToAllButSenderRaw (const std::string &data, const std::string &omit, const std::string &prefix, const irc::string &command, std::deque< std::string > ¶ms) |
| Send a message from this server to all others, without doing any processing on the command (e.g. | |
| void | ReadConfiguration (bool rebind) |
| Read the spanningtree module's tags from the config file. | |
| void | AddThisServer (TreeServer *server, TreeServerList &list) |
| Add a server to the server list for GetListOfServersForChannel. | |
| void | GetListOfServersForChannel (Channel *c, TreeServerList &list, char status, const CUList &exempt_list) |
| Compile a list of servers which contain members of channel c. | |
| TreeServer * | FindServer (const std::string &ServerName) |
| Find a server by name. | |
| TreeServer * | FindServerID (const std::string &id) |
| Find server by SID. | |
| TreeServer * | BestRouteTo (const std::string &ServerName) |
| Find a route to a server by name. | |
| TreeServer * | FindServerMask (const std::string &ServerName) |
| Find a server by glob mask. | |
| bool | IsServer (const std::string &ServerName) |
| Returns true if this is a server name we recognise. | |
| void | DoFailOver (Link *x) |
| Attempt to connect to the failover link of link x. | |
| Link * | FindLink (const std::string &name) |
| Find a link tag from a server name. | |
| void | RefreshIPCache () |
| Refresh the IP cache used for allowing inbound connections. | |
Public Attributes | |
| ModuleSpanningTree * | Creator |
| Creator module. | |
| bool | FlatLinks |
| Flatten links and /MAP for non-opers. | |
| bool | HideULines |
| Hide U-Lined servers in /MAP and /LINKS. | |
| bool | AnnounceTSChange |
| Announce TS changes to channels on merge. | |
| bool | quiet_bursts |
| Make snomasks +CQ quiet during bursts and splits. | |
| std::vector< TreeSocket * > | Bindings |
| Socket bindings for listening sockets. | |
| int | PingWarnTime |
| TreeServer * | TreeRoot |
| This variable represents the root of the server tree. | |
| std::vector< std::string > | ValidIPs |
| IPs allowed to link to us. | |
| server_hash | serverlist |
| Hash of currently connected servers by name. | |
| server_hash | sidlist |
| Hash of currently known server ids. | |
| std::map< irc::string, TreeSocket * > | burstingserverlist |
| Hash of servers currently bursting but not initialized as connected. | |
| std::vector< Link > | LinkBlocks |
| Holds the data from the <link> tags in the conf. | |
| hookmodules | hooks |
| List of module pointers which can provide I/O abstraction. | |
| std::vector< std::string > | hooknames |
| List of module names which can provide I/O abstraction. | |
| bool | ChallengeResponse |
| True (default) if we are to use challenge-response HMAC to authenticate passwords. | |
| int | PingFreq |
| Ping frequency of server to server links. | |
Private Attributes | |
| InspIRCd * | ServerInstance |
| Creator server. | |
Definition at line 48 of file utils.h.
|
||||||||||||
|
Initialise utility class.
Definition at line 114 of file utils.cpp. References Bindings, InspIRCd::Config, Creator, DEBUG, ModuleManager::FindInterface(), ServerConfig::GetSID(), hooknames, hooks, LogManager::Log(), InspIRCd::Logs, InspIRCd::Modules, ReadConfiguration(), ServerConfig::ServerDesc, ServerInstance, ServerConfig::ServerName, and TreeRoot. |
|
|
Destroy class and free listeners etc.
Definition at line 143 of file utils.cpp. References Bindings, InspIRCd::BufferedSocketCull(), TreeServer::ChildCount(), BufferedSocket::Close(), SocketEngine::DelFd(), TreeServer::GetChild(), TreeServer::GetSocket(), InspIRCd::SE, ServerInstance, and TreeRoot. |
|
||||||||||||
|
Add a server to the server list for GetListOfServersForChannel.
Definition at line 164 of file utils.cpp. Referenced by GetListOfServersForChannel(). |
|
|
Find a route to a server by name. This only applies to one-to-one and not one-to-many routing. See the comments for the constructor of TreeServer for more details. Definition at line 59 of file utils.cpp. References InspIRCd::Config, InspIRCd::FindNick(), FindServer(), TreeServer::GetName(), TreeServer::GetRoute(), ServerConfig::GetSID(), User::server, ServerInstance, and TreeRoot. Referenced by DoOneToAllButSender(), DoOneToAllButSenderRaw(), DoOneToOne(), ModuleSpanningTree::DoPingChecks(), TreeSocket::ForceJoin(), GetListOfServersForChannel(), and TreeSocket::ProcessLine(). |
|
|
Attempt to connect to the failover link of link x.
Definition at line 590 of file utils.cpp. References ModuleSpanningTree::ConnectServer(), Creator, DEBUG, Link::FailOver, FindLink(), FindServer(), LogManager::Log(), InspIRCd::Logs, Link::Name, ModuleSpanningTree::RemoteMessage(), and ServerInstance. Referenced by ModuleSpanningTree::ConnectServer(), TreeSocket::OnError(), ServernameResolver::OnError(), ServernameResolver::OnLookupComplete(), and TreeSocket::OnTimeout(). |
|
||||||||||||||||||||
|
Send a message from this server to all but one other, local or remote.
Definition at line 322 of file utils.cpp. References DoOneToAllButSender(). |
|
||||||||||||||||||||
|
Send a message from this server to all but one other, local or remote.
Definition at line 266 of file utils.cpp. References BestRouteTo(), TreeServer::ChildCount(), TreeServer::GetChild(), TreeServer::GetName(), TreeServer::GetSocket(), TreeRoot, and TreeSocket::WriteLine(). Referenced by TreeSocket::AddLine(), TreeSocket::ChangeHost(), TreeSocket::ChangeName(), TreeSocket::DelLine(), DoOneToAllButSender(), DoOneToAllButSenderRaw(), TreeSocket::Encap(), TreeSocket::ForceJoin(), TreeSocket::ForceMode(), TreeSocket::ForceNick(), TreeSocket::ForceTopic(), TreeSocket::MetaData(), ModuleSpanningTree::OnRehash(), TreeSocket::OperQuit(), TreeSocket::OperType(), TreeSocket::Outbound_Reply_Server(), TreeSocket::ParseUID(), TreeSocket::ProcessLine(), TreeSocket::RemoteKill(), TreeSocket::RemoteServer(), TreeSocket::ServerVersion(), TreeSocket::ServiceJoin(), TreeSocket::ServicePart(), and TreeSocket::Squit(). |
|
||||||||||||||||||||||||
|
Send a message from this server to all others, without doing any processing on the command (e.g. send it as-is with colons and all) Definition at line 193 of file utils.cpp. References BestRouteTo(), TreeServer::ChildCount(), DoOneToAllButSender(), DoOneToOne(), InspIRCd::FindChan(), InspIRCd::FindNick(), ModeParser::FindPrefix(), FOREACH_MOD, TreeServer::GetChild(), GetListOfServersForChannel(), TreeServer::GetName(), TreeServer::GetSocket(), I_OnBuildExemptList, InspIRCd::Modes, MSG_NOTICE, MSG_PRIVMSG, User::server, ServerInstance, TreeRoot, and TreeSocket::WriteLine(). Referenced by TreeSocket::ProcessLine(), and TreeSocket::ServerMessage(). |
|
||||||||||||||||
|
Send a message from this server to all others.
Definition at line 315 of file utils.cpp. References DoOneToMany(). |
|
||||||||||||||||
|
||||||||||||||||||||
|
Send a message from this server to one other local or remote.
Definition at line 329 of file utils.cpp. References BestRouteTo(), TreeServer::GetSocket(), and TreeSocket::WriteLine(). Referenced by TreeSocket::Admin(), DoOneToAllButSenderRaw(), TreeSocket::Encap(), ModuleSpanningTree::HandleAdmin(), ModuleSpanningTree::HandleMap(), ModuleSpanningTree::HandleModules(), ModuleSpanningTree::HandleMotd(), ModuleSpanningTree::HandleRemoteWhois(), ModuleSpanningTree::HandleStats(), ModuleSpanningTree::HandleTime(), TreeSocket::LocalPing(), TreeSocket::LocalPong(), TreeSocket::Modules(), TreeSocket::Motd(), cmd_rsquit::NoticeUser(), ModuleSpanningTree::OnUserMessage(), ModuleSpanningTree::OnUserNotice(), TreeSocket::Push(), SpanningTreeProtocolInterface::PushToClient(), TreeSocket::Stats(), TreeSocket::Time(), and TreeSocket::Whois(). |
|
|
Find a link tag from a server name.
Definition at line 620 of file utils.cpp. References LinkBlocks, and InspIRCd::Match(). Referenced by DoFailOver(), TreeSocket::OnError(), TreeSocket::OnTimeout(), TreeSocket::ProcessLine(), and TreeSocket::RemoteServer(). |
|
|
|
Find server by SID.
Definition at line 99 of file utils.cpp. References sidlist. Referenced by FindServer(), and TreeSocket::Inbound_Server(). |
|
|
Find a server by glob mask. Theres no find-using-glob method of hash_map [awwww :-(] so instead, we iterate over the list using an iterator and match each one until we get a hit. Yes its slow, deal with it. Definition at line 89 of file utils.cpp. References InspIRCd::Match(), and serverlist. Referenced by cmd_rsquit::Handle(), cmd_rconnect::Handle(), ModuleSpanningTree::HandleAdmin(), ModuleSpanningTree::HandleMap(), ModuleSpanningTree::HandleModules(), ModuleSpanningTree::HandleMotd(), ModuleSpanningTree::HandleSquit(), ModuleSpanningTree::HandleStats(), ModuleSpanningTree::HandleTime(), and ModuleSpanningTree::HandleVersion(). |
|
||||||||||||||||||||
|
Compile a list of servers which contain members of channel c.
Definition at line 171 of file utils.cpp. References AddThisServer(), BestRouteTo(), Channel::GetAllPrefixChars(), Channel::GetUsers(), and IS_LOCAL. Referenced by DoOneToAllButSenderRaw(), ModuleSpanningTree::OnUserMessage(), ModuleSpanningTree::OnUserNotice(), and SpanningTreeProtocolInterface::SendChannel(). |
|
|
Returns true if this is a server name we recognise.
Definition at line 109 of file utils.cpp. References FindServer(). Referenced by TreeSocket::ProcessLine(). |
|
|
Read the spanningtree module's tags from the config file.
Definition at line 413 of file utils.cpp. References InspIRCd::AddResolver(), Link::AllowMask, AnnounceTSChange, assign(), Link::AutoConnect, Link::Bind, Bindings, InspIRCd::BufferedSocketCull(), ChallengeResponse, BufferedSocket::Close(), Conf, DEFAULT, SocketEngine::DelFd(), DNS_QUERY_A, DNS_QUERY_AAAA, Link::FailOver, FlatLinks, BufferedSocket::GetState(), irc::portparser::GetToken(), Link::Hidden, Link::HiddenFromStats, HideULines, Link::Hook, hooks, I_LISTENING, Link::IPAddr, LinkBlocks, LogManager::Log(), InspIRCd::Logs, Link::Name, Link::NextConnectTime, PingFreq, PingWarnTime, Link::Port, quiet_bursts, ConfigReader::ReadFlag(), ConfigReader::ReadInteger(), ConfigReader::ReadValue(), Link::RecvPass, InspIRCd::SE, Link::SendPass, ServerInstance, Link::Timeout, and ValidIPs. Referenced by ModuleSpanningTree::OnRehash(), and SpanningTreeUtilities(). |
|
|
Refresh the IP cache used for allowing inbound connections.
Definition at line 354 of file utils.cpp. References InspIRCd::AddResolver(), DEFAULT, DNS_QUERY_A, DNS_QUERY_AAAA, LinkBlocks, LogManager::Log(), InspIRCd::Logs, ServerInstance, and ValidIPs. Referenced by CacheRefreshTimer::Tick(). |
|
|
Announce TS changes to channels on merge.
Definition at line 67 of file utils.h. Referenced by TreeSocket::ForceJoin(), and ReadConfiguration(). |
|
|
Socket bindings for listening sockets.
Definition at line 74 of file utils.h. Referenced by ModuleSpanningTree::OnStats(), ReadConfiguration(), SpanningTreeUtilities(), and ~SpanningTreeUtilities(). |
|
|
Hash of servers currently bursting but not initialized as connected.
|
|
|
True (default) if we are to use challenge-response HMAC to authenticate passwords. NOTE: This defaults to on, but should be turned off if you are linking to an older version of inspircd. Definition at line 112 of file utils.h. Referenced by TreeSocket::Capab(), TreeSocket::ComparePass(), TreeSocket::MakePass(), ReadConfiguration(), and TreeSocket::SendCapabilities(). |
|
|
|
Flatten links and /MAP for non-opers.
Definition at line 61 of file utils.h. Referenced by ReadConfiguration(), ModuleSpanningTree::ShowLinks(), and ModuleSpanningTree::ShowMap(). |
|
|
Hide U-Lined servers in /MAP and /LINKS.
Definition at line 64 of file utils.h. Referenced by ModuleSpanningTree::HandleLusers(), ReadConfiguration(), ModuleSpanningTree::ShowLinks(), and ModuleSpanningTree::ShowMap(). |
|
|
List of module names which can provide I/O abstraction.
Definition at line 104 of file utils.h. Referenced by SpanningTreeUtilities(). |
|
|
List of module pointers which can provide I/O abstraction.
Definition at line 100 of file utils.h. Referenced by ModuleSpanningTree::ConnectServer(), ServernameResolver::OnLookupComplete(), ReadConfiguration(), and SpanningTreeUtilities(). |
|
|
Holds the data from the <link> tags in the conf.
Definition at line 96 of file utils.h. Referenced by ModuleSpanningTree::AutoConnectServers(), FindLink(), ModuleSpanningTree::HandleConnect(), TreeSocket::Inbound_Server(), TreeSocket::OnConnected(), ModuleSpanningTree::OnStats(), TreeSocket::Outbound_Reply_Server(), ReadConfiguration(), RefreshIPCache(), and TreeSocket::TreeSocket(). |
|
|
Ping frequency of server to server links.
Definition at line 116 of file utils.h. Referenced by ModuleSpanningTree::DoPingChecks(), TreeSocket::ProcessLine(), ReadConfiguration(), and TreeServer::TreeServer(). |
|
|
Definition at line 78 of file utils.h. Referenced by ModuleSpanningTree::DoPingChecks(), and ReadConfiguration(). |
|
|
Make snomasks +CQ quiet during bursts and splits.
Definition at line 71 of file utils.h. Referenced by ReadConfiguration(). |
|
|
Creator server.
Definition at line 53 of file utils.h. Referenced by BestRouteTo(), DoFailOver(), DoOneToAllButSenderRaw(), ReadConfiguration(), RefreshIPCache(), SpanningTreeUtilities(), and ~SpanningTreeUtilities(). |
|
|
Hash of currently connected servers by name.
Definition at line 87 of file utils.h. Referenced by TreeServer::AddHashEntry(), ModuleSpanningTree::CountServs(), TreeServer::DelHashEntry(), ModuleSpanningTree::DoPingChecks(), FindServer(), FindServerMask(), SpanningTreeProtocolInterface::GetServerList(), and ModuleSpanningTree::HandleLusers(). |
|
|
Hash of currently known server ids.
Definition at line 90 of file utils.h. Referenced by FindServerID(), TreeServer::SetID(), and TreeServer::~TreeServer(). |
|
|
This variable represents the root of the server tree.
Definition at line 81 of file utils.h. Referenced by BestRouteTo(), ModuleSpanningTree::CountLocalServs(), TreeSocket::DoBurst(), DoOneToAllButSender(), DoOneToAllButSenderRaw(), DoOneToMany(), cmd_rsquit::Handle(), ModuleSpanningTree::HandleLinks(), ModuleSpanningTree::HandleLusers(), ModuleSpanningTree::HandleMap(), ModuleSpanningTree::HandleSquit(), ModuleSpanningTree::HandleTime(), ModuleSpanningTree::HandleVersion(), TreeSocket::Outbound_Reply_Server(), TreeSocket::ProcessLine(), ModuleSpanningTree::ShowLinks(), SpanningTreeUtilities(), TreeSocket::Squit(), TreeServer::TreeServer(), and ~SpanningTreeUtilities(). |
|
|
IPs allowed to link to us.
Definition at line 84 of file utils.h. Referenced by TreeSocket::OnIncomingConnection(), SecurityIPResolver::OnLookupComplete(), ReadConfiguration(), and RefreshIPCache(). |