The InspIRCd Project
Home | Developers | Wiki | Forums | Bug Tracker | SVN | Download
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

InspIRCd Class Reference

The main class of the irc server. More...

#include <inspircd.h>

Inheritance diagram for InspIRCd:

Inheritance graph
[legend]
Collaboration diagram for InspIRCd:

Collaboration graph
[legend]
List of all members.

Public Member Functions

std::string GetUID ()
 Returns the next available UID for this server.
UserFindUUID (const std::string &)
 Find a user in the UUID hash.
UserFindUUID (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.
UserFindNick (const std::string &nick)
 Find a user in the nick hash.
UserFindNick (const char *nick)
 Find a user in the nick hash.
UserFindNickOnly (const char *nick)
 Find a user in the nick hash ONLY.
UserFindNickOnly (const std::string &nick)
 Find a user in the nick hash ONLY.
ChannelFindChan (const std::string &chan)
 Find a channel in the channels hash.
ChannelFindChan (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 > &parameters, User *user)
 Send a modechange.
CmdResult CallCommandHandler (const std::string &commandname, const std::vector< std::string > &parameters, 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.
ChannelGetChannelIndex (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.
UserFakeClient
 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 .
ModeParserModes
 Mode handler, handles mode setting and removal.
CommandParserParser
 Command parser, handles client to server commands.
SocketEngineSE
 Socket engine, handles socket activity events.
ThreadEngineThreads
 Thread engine, Handles threading where required.
MutexFactory * Mutexes
 Mutex engine, handles mutexes for threading where required.
ConfigReaderThreadConfigThread
 The thread/class used to read config files in REHASH and on startup.
LogManagerLogs
 LogManager handles logging.
ModuleManagerModules
 ModuleManager contains everything related to loading/unloading modules.
BanCacheManagerBanCache
 BanCacheManager is used to speed up checking of restrictions on connection to the IRCd.
serverstatsstats
 Stats class, holds miscellaneous stats counters.
ServerConfigConfig
 Server Config class, holds configuration file data.
SnomaskManagerSNO
 Snomask manager - handles routing of snomask messages to opers.
DNSRes
 DNS class, provides resolver facilities to the core and modules.
TimerManagerTimers
 Timer manager class, triggers Timer timer events.
XLineManagerXLines
 X-Line manager.
UserManagerUsers
 User manager.
chan_hashchanlist
 Channel list, a hash_map containing all channels XXX move to channel manager class.
int s_signal
 Set to the current signal recieved.
ProtocolInterfacePI
 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.

Detailed Description

The main class of the irc server.

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.


Constructor & Destructor Documentation

InspIRCd::InspIRCd int  argc,
char **  argv
 

This constructor initialises all the subsystems and reads the config file.

Parameters:
argc The argument count passed to main()
argv The argument list passed to main()
Exceptions:
<anything> If anything is thrown from here and makes it to you, you should probably just give up and go home. Yes, really. It's that bad. Higher level classes should catch any non-fatal exceptions.

Definition at line 381 of file inspircd.cpp.

References AddServerName(), XLineManager::ApplyLines(), ServerConfig::argc, ServerConfig::argv, BanCache, BindPorts(), BuildISupport(), chanlist, CheckDie(), XLineManager::CheckELines(), CheckRoot(), ServerConfig::ClearStack(), client, UserManager::clientlist, Config, CONFIG_FILE, ConfigFileName, ConfigThread, ThreadEngine::Create(), DEFAULT, ServerConfig::DisabledCommands, Exit(), EXIT_STATUS_ARGV, EXIT_STATUS_CONFIG, EXIT_STATUS_FORK, EXIT_STATUS_LOG, EXIT_STATUS_NOERROR, FakeClient, FD_MAGIC_NUMBER, ServerConfig::FileExists(), ServerConfig::forcedebug, ServerConfig::GetFullProgDir(), SocketEngine::GetMaxFds(), ServerConfig::GetSID(), InitializeDisabledCommands(), ModuleManager::LoadAll(), LogManager::Log(), LogFileName, ServerConfig::logpath, Logs, MAXBUF, Modes, Modules, Mutexes, ServerConfig::MyExecutable, ServerConfig::nofork, OLDTIME, ServerConfig::operclass, ServerConfig::opertypes, Parser, PI, ServerConfig::PID, ServerConfig::ports, printf_c, SocketEngine::RecoverFromFork(), Res, REVISION, ConfigReaderThread::Run(), s_signal, SE, server, ServerConfig::ServerDesc, ServerConfig::ServerName, EventHandler::SetFd(), SetSignals(), ServerConfig::sid, SNO, startup_time, stats, strlcpy(), ServerConfig::TestSuite, Threads, TIME, Timers, UserManager::unregistered_count, Users, UserManager::uuidlist, VERSION, ServerConfig::writelog, WritePID(), and XLines.


Member Function Documentation

void InspIRCd::AddCommand Command f  ) 
 

Add a command to this server's command parser.

Parameters:
f A Command command handler object to add
Exceptions:
ModuleException Will throw ModuleExcption if the command already exists

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().

void InspIRCd::AddExtBanChar char  c  ) 
 

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().

bool InspIRCd::AddResolver Resolver r,
bool  cached
 

Add a dns Resolver class to this server's active set.

Parameters:
r The resolver to add
cached If this value is true, then the cache will be searched for the DNS result, immediately. If the value is false, then a request will be sent to the nameserver, and the result will not be immediately available. You should usually use the boolean value which you passed to the Resolver constructor, which Resolver will set appropriately depending on if cached results are available and haven't expired. It is however safe to force this value to false, forcing a remote DNS lookup, but not an update of the cache.
Returns:
True if the operation completed successfully. Note that if this method returns true, you should not attempt to access the resolver class you pass it after this call, as depending upon the request given, the object may be deleted!

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().

void InspIRCd::AddServerName const std::string servername  ) 
 

Adds a server name to the list of servers we've seen.

Parameters:
The servername to add

Definition at line 100 of file server.cpp.

References servernames.

Referenced by InspIRCd().

bool InspIRCd::AllModulesReportReady User user  )  [private]
 

Returns true when all modules have done pre-registration checks on a user.

Parameters:
user The user to verify
Returns:
True if all modules have finished checking this user

Definition at line 878 of file inspircd.cpp.

References ModuleManager::EventHandlers, I_OnCheckReady, and Modules.

Referenced by DoBackgroundUserStuff().

int InspIRCd::BindPorts bool  bail,
int &  found_ports,
FailedPortList failed_ports
 

Bind all ports specified in the configuration file.

Parameters:
bail True if the function should bail back to the shell on failure
found_ports The actual number of ports found in the config, as opposed to the number actually bound
Returns:
The number of ports actually bound without error

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().

bool InspIRCd::BindSocket int  sockfd,
int  port,
const char *  addr,
bool  dolisten = true
 

Binds a socket on an already open file descriptor.

Parameters:
sockfd A valid file descriptor of an open socket
port The port number to bind to
addr The address to bind to (IP only)
Returns:
True if the port was bound successfully

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().

void InspIRCd::BufferedSocketCull  ) 
 

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().

void InspIRCd::BuildISupport  ) 
 

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().

CmdResult InspIRCd::CallCommandHandler const std::string commandname,
const std::vector< std::string > &  parameters,
User user
 

Call the handler for a given command.

Parameters:
commandname The command whos handler you wish to call
parameters The mode parameters
pcnt The number of items you have given in the first parameter
user The user to execute the command as
Returns:
True if the command handler was called successfully

Definition at line 734 of file modules.cpp.

References CommandParser::CallHandler(), and Parser.

Referenced by TreeSocket::ForceMode(), User::FullConnect(), and CommandTban::Handle().

long InspIRCd::ChannelCount  ) 
 

Return a count of channels on the network.

Returns:
The number of channels

Definition at line 146 of file helperfuncs.cpp.

References chanlist.

Referenced by ModuleSpanningTree::HandleLusers().

void InspIRCd::CheckDie  ) 
 

Check for a 'die' tag in the config file, and abort if found.

Returns:
Depending on the configuration, this function may never return

Definition at line 373 of file helperfuncs.cpp.

References Config, DEFAULT, ServerConfig::DieValue, Exit(), EXIT_STATUS_DIETAG, LogManager::Log(), and Logs.

Referenced by InspIRCd().

void InspIRCd::CheckRoot  ) 
 

Check we aren't running as root, and exit if we are.

Returns:
Depending on the configuration, this function may never return

Definition at line 363 of file helperfuncs.cpp.

References DEFAULT, Exit(), EXIT_STATUS_ROOT, LogManager::Log(), and Logs.

Referenced by InspIRCd().

void InspIRCd::Cleanup  ) 
 

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.

Referenced by Exit(), and Restart().

bool InspIRCd::DaemonSeed  )  [private]
 

Daemonize the ircd and close standard input/output streams.

Returns:
True if the program daemonized succesfully

Definition at line 306 of file inspircd.cpp.

References DEFAULT, LogManager::Log(), Logs, printf_c, QuickExit(), and SetSignal().

void InspIRCd::DoBackgroundUserStuff  )  [private]
 

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().

void InspIRCd::DoSocketTimeouts time_t  TIME  )  [private]
 

Iterate the list of BufferedSocket objects, removing ones which have timed out.

Parameters:
TIME the current time

void InspIRCd::DumpText User User,
const std::string LinePrefix,
std::stringstream &  TextStream
 

Dump text to a user target, splitting it appropriately to fit.

Parameters:
User the user to dump the text to
LinePrefix text to prefix each complete line with
TextStream the text to send to the user

Definition at line 758 of file modules.cpp.

References User::WriteServ().

Referenced by CommandCheck::Handle().

long InspIRCd::Duration const std::string str  ) 
 

Calculate a duration in seconds from a string in the form 1y2w3d4h6m5s.

Parameters:
str A string containing a time in the form 1y2w3d4h6m5s (one year, two weeks, three days, four hours, six minutes and five seconds)
Returns:
The total number of seconds

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().

void InspIRCd::Exit int  status  ) 
 

Causes the server to exit after unloading modules and closing all open file descriptors.

Parameters:
The exit code to give to the operating system (See the ExitStatus enum for valid values)

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().

Channel * InspIRCd::FindChan const char *  chan  ) 
 

Find a channel in the channels hash.

Parameters:
chan The channel to find
Returns:
A pointer to the channel, or NULL if the channel does not exist

Definition at line 101 of file helperfuncs.cpp.

References chanlist.

Channel * InspIRCd::FindChan const std::string chan  ) 
 

Find a channel in the channels hash.

Parameters:
chan The channel to find
Returns:
A pointer to the channel, or NULL if the channel does not exist

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().

User * InspIRCd::FindNick const char *  nick  ) 
 

Find a user in the nick hash.

If the user cant be found in the nick hash check the uuid hash

Parameters:
nick The nickname to find
Returns:
A pointer to the user, or NULL if the user does not exist

Definition at line 52 of file helperfuncs.cpp.

References UserManager::clientlist, FindUUID(), and Users.

User * InspIRCd::FindNick const std::string nick  ) 
 

Find a user in the nick hash.

If the user cant be found in the nick hash check the uuid hash

Parameters:
nick The nickname to find
Returns:
A pointer to the user, or NULL if the user does not exist

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(),