|
|||
|
|||
|
#include <inspircd.h>
Inheritance diagram for InspIRCd:


Public Member Functions | |
| std::string | GetUID () |
| Returns the next available UID for this server. | |
| User * | FindUUID (const std::string &) |
| Find a user in the UUID hash. | |
| User * | FindUUID (const char *) |
| Find a user in the UUID hash. | |
| void | BuildISupport () |
| Build the ISUPPORT string by triggering all modules On005Numeric events. | |
| time_t | Time () |
| Get the current time Because this only calls time() once every time around the mainloop, it is much faster than calling time() directly. | |
| int | BindPorts (bool bail, int &found_ports, FailedPortList &failed_ports) |
| Bind all ports specified in the configuration file. | |
| bool | BindSocket (int sockfd, int port, const char *addr, bool dolisten=true) |
| Binds a socket on an already open file descriptor. | |
| void | AddServerName (const std::string &servername) |
| Adds a server name to the list of servers we've seen. | |
| const char * | FindServerNamePtr (const std::string &servername) |
| Finds a cached char* pointer of a server name, This is used to optimize User by storing only the pointer to the name. | |
| bool | FindServerName (const std::string &servername) |
| Returns true if we've seen the given server name before. | |
| std::string | GetServerDescription (const char *servername) |
| Gets the GECOS (description) field of the given server. | |
| User * | FindNick (const std::string &nick) |
| Find a user in the nick hash. | |
| User * | FindNick (const char *nick) |
| Find a user in the nick hash. | |
| User * | FindNickOnly (const char *nick) |
| Find a user in the nick hash ONLY. | |
| User * | FindNickOnly (const std::string &nick) |
| Find a user in the nick hash ONLY. | |
| Channel * | FindChan (const std::string &chan) |
| Find a channel in the channels hash. | |
| Channel * | FindChan (const char *chan) |
| Find a channel in the channels hash. | |
| void | CheckDie () |
| Check for a 'die' tag in the config file, and abort if found. | |
| void | CheckRoot () |
| Check we aren't running as root, and exit if we are. | |
| bool | OpenLog (char **argv, int argc) |
| Determine the right path for, and open, the logfile. | |
| void | SignalHandler (int signal) |
| Handles incoming signals after being set. | |
| void | Exit (int status) |
| Causes the server to exit after unloading modules and closing all open file descriptors. | |
| long | ChannelCount () |
| Return a count of channels on the network. | |
| void | SendError (const std::string &s) |
| Send an error notice to all local users, opered and unopered. | |
| bool | AddResolver (Resolver *r, bool cached) |
| Add a dns Resolver class to this server's active set. | |
| void | AddCommand (Command *f) |
| Add a command to this server's command parser. | |
| void | SendMode (const std::vector< std::string > ¶meters, User *user) |
| Send a modechange. | |
| CmdResult | CallCommandHandler (const std::string &commandname, const std::vector< std::string > ¶meters, User *user) |
| Call the handler for a given command. | |
| bool | IsValidModuleCommand (const std::string &commandname, int pcnt, User *user) |
| Return true if the command is a module-implemented command and the given parameters are valid for it. | |
| bool | IsValidMask (const std::string &mask) |
| Return true if the given parameter is a valid nick!user@host mask. | |
| void | RehashServer () |
| Rehash the local server. | |
| Channel * | GetChannelIndex (long index) |
| Return the channel whos index number matches that provided. | |
| void | DumpText (User *User, const std::string &LinePrefix, std::stringstream &TextStream) |
| Dump text to a user target, splitting it appropriately to fit. | |
| bool | NickMatchesEveryone (const std::string &nick, User *user) |
| Check if the given nickmask matches too many users, send errors to the given user. | |
| bool | IPMatchesEveryone (const std::string &ip, User *user) |
| Check if the given IP mask matches too many users, send errors to the given user. | |
| bool | HostMatchesEveryone (const std::string &mask, User *user) |
| Check if the given hostmask matches too many users, send errors to the given user. | |
| long | Duration (const std::string &str) |
| Calculate a duration in seconds from a string in the form 1y2w3d4h6m5s. | |
| int | PassCompare (Extensible *ex, const std::string &data, const std::string &input, const std::string &hashtype) |
| Attempt to compare a password to a string from the config file. | |
| bool | ULine (const char *server) |
| Check if a given server is a uline. | |
| bool | SilentULine (const char *server) |
| Returns true if the uline is 'silent' (doesnt generate remote connect notices etc). | |
| std::string | GetRevision () |
| Returns the subversion revision ID of this ircd. | |
| std::string | GetVersionString () |
| Returns the full version string of this ircd. | |
| void | WritePID (const std::string &filename) |
| Attempt to write the process id to a given file. | |
| InspIRCd (int argc, char **argv) | |
| This constructor initialises all the subsystems and reads the config file. | |
| void | SendWhoisLine (User *user, User *dest, int numeric, const std::string &text) |
| Send a line of WHOIS data to a user. | |
| void | SendWhoisLine (User *user, User *dest, int numeric, const char *format,...) CUSTOM_PRINTF(5 |
| Send a line of WHOIS data to a user. | |
| void | Restart (const std::string &reason) |
| Restart the server. | |
| void | Cleanup () |
| Prepare the ircd for restart or shutdown. | |
| void | RehashUsersAndChans () |
| This copies the user and channel hash_maps into new hash maps. | |
| void | ResetMaxBans () |
| Resets the cached max bans value on all channels. | |
| std::string | TimeString (time_t curtime) |
| Return a time_t as a human-readable string. | |
| int | Run () |
| Begin execution of the server. | |
| void | BufferedSocketCull () |
| Force all BufferedSockets to be removed which are due to be culled. | |
| void | AddExtBanChar (char c) |
| Adds an extban char to the 005 token. | |
| char * | GetReadBuffer () |
Static Public Member Functions | |
| static void | SetSignal (int signal) |
| Sets the signal recieved. | |
| static void | QuickExit (int status) |
| Causes the server to exit immediately with exit code 0. | |
| static bool | Match (const std::string &str, const std::string &mask, unsigned const char *map=NULL) |
| Match two strings using pattern matching, optionally, with a map to check case against (may be NULL). | |
| static bool | Match (const char *str, const char *mask, unsigned const char *map=NULL) |
| static bool | MatchCIDR (const std::string &str, const std::string &mask, unsigned const char *map=NULL) |
| Match two strings using pattern matching, optionally, with a map to check case against (may be NULL). | |
| static bool | MatchCIDR (const char *str, const char *mask, unsigned const char *map=NULL) |
Public Attributes | |
| CullList | GlobalCulls |
| Global cull list, will be processed on next iteration. | |
| ProcessUserHandler | HandleProcessUser |
| IsNickHandler | HandleIsNick |
| IsIdentHandler | HandleIsIdent |
| FindDescriptorHandler | HandleFindDescriptor |
| FloodQuitUserHandler | HandleFloodQuitUser |
| IsChannelHandler | HandleIsChannel |
| IsSIDHandler | HandleIsSID |
| RehashHandler | HandleRehash |
| std::map< BufferedSocket *, BufferedSocket * > | SocketCull |
| BufferedSocket classes pending deletion after being closed. | |
| User * | FakeClient |
| Globally accessible fake user record. | |
| servernamelist | servernames |
| List of server names we've seen. | |
| time_t | startup_time |
| Time this ircd was booted. | |
| char | ConfigFileName [MAXBUF] |
| Config file pathname specified on the commandline or via . | |
| ModeParser * | Modes |
| Mode handler, handles mode setting and removal. | |
| CommandParser * | Parser |
| Command parser, handles client to server commands. | |
| SocketEngine * | SE |
| Socket engine, handles socket activity events. | |
| ThreadEngine * | Threads |
| Thread engine, Handles threading where required. | |
| MutexFactory * | Mutexes |
| Mutex engine, handles mutexes for threading where required. | |
| ConfigReaderThread * | ConfigThread |
| The thread/class used to read config files in REHASH and on startup. | |
| LogManager * | Logs |
| LogManager handles logging. | |
| ModuleManager * | Modules |
| ModuleManager contains everything related to loading/unloading modules. | |
| BanCacheManager * | BanCache |
| BanCacheManager is used to speed up checking of restrictions on connection to the IRCd. | |
| serverstats * | stats |
| Stats class, holds miscellaneous stats counters. | |
| ServerConfig * | Config |
| Server Config class, holds configuration file data. | |
| SnomaskManager * | SNO |
| Snomask manager - handles routing of snomask messages to opers. | |
| DNS * | Res |
| DNS class, provides resolver facilities to the core and modules. | |
| TimerManager * | Timers |
| Timer manager class, triggers Timer timer events. | |
| XLineManager * | XLines |
| X-Line manager. | |
| UserManager * | Users |
| User manager. | |
| chan_hash * | chanlist |
| Channel list, a hash_map containing all channels XXX move to channel manager class. | |
| int | s_signal |
| Set to the current signal recieved. | |
| ProtocolInterface * | PI |
| Protocol interface, overridden by server protocol modules. | |
| caller1< void, User * > | ProcessUser |
| Process a user whos socket has been flagged as active. | |
| caller2< bool, const char *, size_t > | IsChannel |
| Return true if a channel name is valid. | |
| caller1< bool, const std::string & > | IsSID |
| Return true if str looks like a server ID. | |
| caller1< void, const std::string & > | Rehash |
| Rehash the local server. | |
| caller2< bool, const char *, size_t > | IsNick |
| Return true if a nickname is valid. | |
| caller1< bool, const char * > | IsIdent |
| Return true if an ident is valid. | |
| caller1< User *, int > | FindDescriptor |
| Find a username by their file descriptor. | |
| void caller1< void, User * > | FloodQuitUser |
| Quit a user for excess flood, and if they are not fully registered yet, temporarily zline their IP. | |
Private Member Functions | |
| void | SetSignals () |
| Set up the signal handlers. | |
| bool | DaemonSeed () |
| Daemonize the ircd and close standard input/output streams. | |
| void | DoSocketTimeouts (time_t TIME) |
| Iterate the list of BufferedSocket objects, removing ones which have timed out. | |
| void | IncrementUID (int pos) |
| Increments the current UID by one. | |
| void | DoBackgroundUserStuff () |
| Perform background user events such as PING checks. | |
| bool | AllModulesReportReady (User *user) |
| Returns true when all modules have done pre-registration checks on a user. | |
Private Attributes | |
| char | current_uid [UUID_LENGTH] |
| Holds the current UID. | |
| char | LogFileName [MAXBUF] |
| Logfile pathname specified on the commandline, or empty string. | |
| time_t | TIME |
| The current time, updated in the mainloop. | |
| time_t | OLDTIME |
| The time that was recorded last time around the mainloop. | |
| char | ReadBuffer [65535] |
| A 64k buffer used to read socket data into NOTE: update ValidateNetBufferSize if you change this. | |
| irc::sockets::insp_sockaddr | client |
| Used when connecting clients. | |
| irc::sockets::insp_sockaddr | server |
| socklen_t | length |
| Used when connecting clients. | |
This class contains instances of all the other classes in this software, with the exception of the base class, classbase. Amongst other things, it contains a ModeParser, a DNS object, a CommandParser object, and a list of active Module objects, and facilities for Module objects to interact with the core system it implements.
Definition at line 307 of file inspircd.h.
|
||||||||||||
|
|
Add a command to this server's command parser.
Definition at line 744 of file modules.cpp. References Command::command. Referenced by FilterBase::FilterBase(), Modulealltime::Modulealltime(), ModuleCallerID::ModuleCallerID(), ModuleCAP::ModuleCAP(), ModuleCBan::ModuleCBan(), ModuleCgiIRC::ModuleCgiIRC(), ModuleCheck::ModuleCheck(), ModuleChgHost::ModuleChgHost(), ModuleChgIdent::ModuleChgIdent(), ModuleChgName::ModuleChgName(), ModuleClones::ModuleClones(), ModuleClose::ModuleClose(), ModuleCustomTitle::ModuleCustomTitle(), ModuleCycle::ModuleCycle(), ModuleDCCAllow::ModuleDCCAllow(), ModuleDeVoice::ModuleDeVoice(), ModuleGlobalLoad::ModuleGlobalLoad(), ModuleGlobops::ModuleGlobops(), ModuleHelpop::ModuleHelpop(), ModuleJumpServer::ModuleJumpServer(), ModuleKnock::ModuleKnock(), ModuleLockserv::ModuleLockserv(), ModuleNickLock::ModuleNickLock(), ModuleOperHash::ModuleOperHash(), ModuleOpermotd::ModuleOpermotd(), ModuleOperSSLCert::ModuleOperSSLCert(), ModuleRandQuote::ModuleRandQuote(), ModuleRemove::ModuleRemove(), ModuleRLine::ModuleRLine(), ModuleSajoin::ModuleSajoin(), ModuleSaMode::ModuleSaMode(), ModuleSanick::ModuleSanick(), ModuleSapart::ModuleSapart(), ModuleSaquit::ModuleSaquit(), ModuleSASL::ModuleSASL(), ModuleSATopic::ModuleSATopic(), ModuleSetHost::ModuleSetHost(), ModuleSetIdent::ModuleSetIdent(), ModuleSetIdle::ModuleSetIdle(), ModuleSetName::ModuleSetName(), ModuleShun::ModuleShun(), ModuleSilence::ModuleSilence(), ModuleSpanningTree::ModuleSpanningTree(), ModuleSSLGnuTLS::ModuleSSLGnuTLS(), ModuleSSLInfo::ModuleSSLInfo(), ModuleSVSHold::ModuleSVSHold(), ModuleSWhois::ModuleSWhois(), ModuleTaxonomy::ModuleTaxonomy(), ModuleTestCommand::ModuleTestCommand(), ModuleTimedBans::ModuleTimedBans(), ModuleTLine::ModuleTLine(), ModuleUninvite::ModuleUninvite(), ModuleUserIP::ModuleUserIP(), ModuleVHost::ModuleVHost(), and Modulewatch::Modulewatch(). |
|
|
Adds an extban char to the 005 token.
Definition at line 472 of file helperfuncs.cpp. References Config, and ServerConfig::data005. Referenced by ModuleStripColor::On005Numeric(), ModuleServicesAccount::On005Numeric(), ModuleServerBan::On005Numeric(), ModuleNoNotice::On005Numeric(), ModuleNoNickChange::On005Numeric(), ModuleNoKicks::On005Numeric(), ModuleNoCTCP::On005Numeric(), ModuleQuietBan::On005Numeric(), ModuleGecosBan::On005Numeric(), ModuleBadChannelExtban::On005Numeric(), ModuleBlockColour::On005Numeric(), ModuleBlockCAPS::On005Numeric(), and ModuleAllowInvite::On005Numeric(). |
|
||||||||||||
|
Add a dns Resolver class to this server's active set.
Definition at line 779 of file modules.cpp. References DNS::AddResolverClass(), and Res. Referenced by ModuleCgiIRC::CheckIdent(), ModuleCgiIRC::CheckPass(), ModuleSpanningTree::ConnectServer(), SecurityIPResolver::OnError(), ServernameResolver::OnError(), UserResolver::OnLookupComplete(), ModuleDNSBL::OnUserRegister(), ModulePgSQL::ReadConf(), SpanningTreeUtilities::ReadConfiguration(), SpanningTreeUtilities::RefreshIPCache(), and User::StartDNSLookup(). |
|
|
Adds a server name to the list of servers we've seen.
Definition at line 100 of file server.cpp. References servernames. Referenced by InspIRCd(). |
|
|
Returns true when all modules have done pre-registration checks on a user.
Definition at line 878 of file inspircd.cpp. References ModuleManager::EventHandlers, I_OnCheckReady, and Modules. Referenced by DoBackgroundUserStuff(). |
|
||||||||||||||||
|
Bind all ports specified in the configuration file.
Definition at line 176 of file socket.cpp. References Config, ServerConfig::config_data, ServerConfig::ConfValue(), ConvToStr(), DEFAULT, EventHandler::GetFd(), irc::portparser::GetToken(), LogManager::Log(), Logs, MAXBUF, and ServerConfig::ports. Referenced by InspIRCd(), and ServerConfig::Read(). |
|
||||||||||||||||||||
|
Binds a socket on an already open file descriptor.
Definition at line 24 of file socket.cpp. References SocketEngine::Bind(), Config, DEBUG, DEFAULT, SocketEngine::Listen(), LogManager::Log(), Logs, ServerConfig::MaxConn, SocketEngine::NonBlocking(), and SE. Referenced by ListenSocketBase::ListenSocketBase(), and DNS::Rehash(). |
|
|
Force all BufferedSockets to be removed which are due to be culled.
Definition at line 856 of file inspircd.cpp. References DEBUG, SocketEngine::DelFd(), LogManager::Log(), Logs, SE, and SocketCull. Referenced by SpanningTreeUtilities::ReadConfiguration(), Run(), ModuleHttpServer::~ModuleHttpServer(), ModuleMsSQL::~ModuleMsSQL(), ModuleSQLite3::~ModuleSQLite3(), and SpanningTreeUtilities::~SpanningTreeUtilities(). |
|
|
Build the ISUPPORT string by triggering all modules On005Numeric events.
Definition at line 83 of file server.cpp. References ServerConfig::AllowHalfop, ModeParser::BuildPrefixes(), ModeParser::ChanModes(), Config, ServerConfig::data005, FOREACH_MOD_I, I_On005Numeric, ServerConfig::Limits, ServerLimits::MaxAway, ServerConfig::MaxChans, ServerLimits::MaxKick, ServerLimits::MaxModes, ServerConfig::MaxTargets, ServerLimits::MaxTopic, Modes, ServerConfig::Network, ServerLimits::NickMax, and ServerConfig::Update005(). Referenced by InspIRCd(), ModuleManager::Load(), Run(), and ModuleManager::Unload(). |
|
||||||||||||||||
|
Call the handler for a given command.
Definition at line 734 of file modules.cpp. References CommandParser::CallHandler(), and Parser. Referenced by TreeSocket::ForceMode(), User::FullConnect(), and CommandTban::Handle(). |
|
|
Return a count of channels on the network.
Definition at line 146 of file helperfuncs.cpp. References chanlist. Referenced by ModuleSpanningTree::HandleLusers(). |
|
|
Check for a 'die' tag in the config file, and abort if found.
Definition at line 373 of file helperfuncs.cpp. References Config, DEFAULT, ServerConfig::DieValue, Exit(), EXIT_STATUS_DIETAG, LogManager::Log(), and Logs. Referenced by InspIRCd(). |
|
|
Check we aren't running as root, and exit if we are.
Definition at line 363 of file helperfuncs.cpp. References DEFAULT, Exit(), EXIT_STATUS_ROOT, LogManager::Log(), and Logs. Referenced by InspIRCd(). |
|
|
Prepare the ircd for restart or shutdown. This function unloads all modules which can be unloaded, closes all open sockets, and closes the logfile. Definition at line 82 of file inspircd.cpp. References BanCache, chanlist, LogManager::CloseLogs(), Config, ModuleManager::GetAllModuleNames(), UserManager::local_users, Logs, Modes, Modules, Parser, PI, ServerConfig::ports, UserManager::QuitUser(), CommandParser::RemoveCommands(), Res, servernames, SNO, stats, Threads, Timers, ModuleManager::Unload(), Users, and XLines. |
|
|
Daemonize the ircd and close standard input/output streams.
Definition at line 306 of file inspircd.cpp. References DEFAULT, LogManager::Log(), Logs, printf_c, QuickExit(), and SetSignal(). |
|
|
Perform background user events such as PING checks. It is intended to do background checking on all the user structs, e.g. stuff like ping checks, registration timeouts, etc. Definition at line 164 of file userprocess.cpp. References classbase::age, AllModulesReportReady(), User::dns_done, CommandParser::DoLines(), User::FullConnect(), ConnectClass::GetPingTime(), ConnectClass::GetRegTimeout(), User::lastping, UserManager::local_users, MAXBUF, User::MyClass, User::nping, User::OverPenalty, Parser, User::Penalty, User::quitting, UserManager::QuitUser(), REG_ALL, REG_NICKUSER, User::registered, User::sendq, Time(), TIME, Users, and User::Write(). Referenced by Run(). |
|
|
Iterate the list of BufferedSocket objects, removing ones which have timed out.
|
|
||||||||||||||||
|
Dump text to a user target, splitting it appropriately to fit.
Definition at line 758 of file modules.cpp. References User::WriteServ(). Referenced by CommandCheck::Handle(). |
|
|
Calculate a duration in seconds from a string in the form 1y2w3d4h6m5s.
Definition at line 408 of file helperfuncs.cpp. References duration_multi. Referenced by CommandTban::Handle(), CommandSvshold::Handle(), cmd_shun::Handle(), CommandSetidle::Handle(), CommandRLine::Handle(), CommandFilter::Handle(), CommandDccallow::Handle(), CommandCBan::Handle(), ModuleQuitBan::OnRehash(), ModuleDNSBL::ReadConf(), ModuleFilter::ReadFilters(), and ValidateWhoWas(). |
|
|
Causes the server to exit after unloading modules and closing all open file descriptors.
Definition at line 34 of file server.cpp. References Cleanup(), ConvToStr(), ExitCodes, and SendError(). Referenced by CheckDie(), CheckRoot(), InspIRCd(), ModuleManager::LoadAll(), ServerConfig::ReportConfigError(), Run(), SignalHandler(), and WritePID(). |
|
|
Find a channel in the channels hash.
Definition at line 101 of file helperfuncs.cpp. References chanlist. |
|
|
Find a channel in the channels hash.
Definition at line 112 of file helperfuncs.cpp. References chanlist. Referenced by SpanningTreeUtilities::DoOneToAllButSenderRaw(), TreeSocket::ForceJoin(), TreeSocket::ForceMode(), TreeSocket::ForceTopic(), CommandUninvite::Handle(), CommandTban::Handle(), CommandSATopic::Handle(), CommandSapart::Handle(), RemoveBase::Handle(), CommandKnock::Handle(), CommandDevoice::Handle(), CommandCycle::Handle(), CommandCheck::Handle(), Channel::JoinUser(), TreeSocket::MetaData(), ModuleTimedBans::OnBackgroundTimer(), Redirect::OnModeChange(), ModulePermanentChannels::OnRehash(), ModuleChanLog::OnSendSnotice(), ModuleRedirect::OnUserPreJoin(), ModuleDenyChannels::OnUserPreJoin(), ModuleBanRedirect::OnUserPreJoin(), ModeParser::Process(), TreeSocket::ProcessLine(), TreeSocket::RemoveStatus(), SpanningTreeProtocolInterface::SendMode(), TreeSocket::ServerMessage(), and TreeSocket::ServicePart(). |
|
|
Find a user in the nick hash. If the user cant be found in the nick hash check the uuid hash
Definition at line 52 of file helperfuncs.cpp. References UserManager::clientlist, FindUUID(), and Users. |
|
|
Find a user in the nick hash. If the user cant be found in the nick hash check the uuid hash
Definition at line 38 of file helperfuncs.cpp. References UserManager::clientlist, FindUUID(), and Users. Referenced by CommandWatch::add_watch(), TreeSocket::AddLine(), TreeSocket::Admin(), SpanningTreeUtilities::BestRouteTo(), callerid_data::callerid_data(), TreeSocket::ChangeHost(), TreeSocket::ChangeName(), TreeSocket::DelLine(), ModuleAlias::DoAlias(), SpanningTreeUtilities::DoOneToAllButSenderRaw(), CommandAccept::EncodeParameter(), FounderProtectBase::FindAndVerify(), TreeSocket::ForceMode(), |