Data Structures | Public Member Functions | Data Fields | Private Member Functions

ServerConfig Class Reference

#include <config.h>

Collaboration diagram for ServerConfig:
Collaboration graph
[legend]

Data Structures

struct  Uplink

Public Member Functions

 ServerConfig ()
void Read ()
void LoadConf (ConfigurationFile &file)
bool ConfValue (ConfigDataHash &, const Anope::string &, const Anope::string &, int, Anope::string &, bool=false)
bool ConfValue (ConfigDataHash &, const Anope::string &, const Anope::string &, const Anope::string &, int, Anope::string &, bool=false)
bool ConfValueInteger (ConfigDataHash &, const Anope::string &, const Anope::string &, int, int &)
bool ConfValueInteger (ConfigDataHash &, const Anope::string &, const Anope::string &, const Anope::string &, int, int &)
bool ConfValueBool (ConfigDataHash &, const Anope::string &, const Anope::string &, int)
bool ConfValueBool (ConfigDataHash &, const Anope::string &, const Anope::string &, const Anope::string &, int)
int ConfValueEnum (const ConfigDataHash &, const Anope::string &)
int ConfVarEnum (ConfigDataHash &, const Anope::string &, int)
void ValidateHostname (const Anope::string &, const Anope::string &, const Anope::string &) const
void ValidateIP (const Anope::string &p, const Anope::string &, const Anope::string &, bool) const
void ValidateNoSpaces (const Anope::string &, const Anope::string &, const Anope::string &) const

Data Fields

ConfigDataHash config_data
Anope::string LocalHost
std::vector< Uplink * > Uplinks
Anope::string ServerName
Anope::string ServerDesc
Anope::string NetworkName
unsigned NickLen
unsigned UserLen
unsigned HostLen
unsigned ChanLen
Anope::string User
Anope::string Group
Anope::string CaseMap
unsigned PassLen
Anope::string PIDFilename
Anope::string MOTDFilename
Anope::string BotServ
Anope::string ChanServ
Anope::string Global
Anope::string HostServ
Anope::string NickServ
Anope::string OperServ
Anope::string MemoServ
bool NoBackupOkay
bool StrictPasswords
unsigned BadPassLimit
time_t BadPassTimeout
time_t UpdateTimeout
time_t ExpireTimeout
time_t ReadTimeout
time_t WarningTimeout
time_t TimeoutCheck
int KeepBackups
bool ForceForbidReason
bool UsePrivmsg
bool UseStrictPrivMsg
Anope::string UseStrictPrivMsgString
unsigned NickRegDelay
unsigned NewsCount
Anope::string MLock
Anope::string NoMLock
Anope::string CSRequire
bool UseServerSideMLock
bool UseServerSideTopicLock
unsigned CSReasonMax
Anope::string BotModes
int RetryWait
bool HidePrivilegedCommands
bool NoNicknameOwnership
Anope::string RegexEngine
std::vector< LogInfo * > LogInfos
bool UseMail
Anope::string SendMailPath
Anope::string SendFrom
bool RestrictMail
time_t MailDelay
bool DontQuoteAddresses
Anope::string MailRegistrationSubject
Anope::string MailRegistrationMessage
Anope::string MailResetSubject
Anope::string MailResetMessage
Anope::string MailEmailchangeSubject
Anope::string MailEmailchangeMessage
Anope::string MailMemoSubject
Anope::string MailMemoMessage
Anope::string NSGuestNickPrefix
bool NSAllowKillImmed
bool NSNoGroupChange
std::set< Anope::stringNSDefFlags
Anope::string Languages
Anope::string NSDefLanguage
time_t NSRegDelay
time_t NSResendDelay
time_t NSExpire
time_t NSSuspendExpire
time_t NSUnconfirmedExpire
bool NSForceEmail
bool NSConfirmEmailChanges
unsigned NSMaxAliases
unsigned NSAccessMax
Anope::string NSEnforcerUser
Anope::string NSEnforcerHost
time_t NSReleaseTimeout
unsigned NSListMax
bool NSSecureAdmins
bool NSStrictPrivileges
Anope::string NSRegistration
Anope::string NSUnregisteredNotice
Anope::string NickCoreModules
bool NSModeOnID
bool NSAddAccessOnReg
unsigned AJoinMax
time_t NSKillQuick
time_t NSKill
Anope::string NSModesOnID
bool NSRestoreOnRecover
bool NSSASL
bool NSHideNetSplitQuit
Anope::string ChanCoreModules
std::set< Anope::stringCSDefFlags
unsigned CSMaxReg
time_t CSExpire
time_t CSSuspendExpire
time_t CSForbidExpire
int CSDefBantype
unsigned CSAccessMax
unsigned CSAutokickMax
Anope::string CSAutokickReason
time_t CSInhabit
unsigned CSListMax
bool CSOpersOnly
unsigned MSMaxMemos
time_t MSSendDelay
bool MSNotifyAll
unsigned MSMemoReceipt
Anope::string VhostChars
bool VhostUndotted
Anope::string VhostDisallowBE
Anope::string BotCoreModules
std::set< Anope::stringBSDefFlags
time_t BSKeepData
unsigned BSMinUsers
unsigned BSBadWordsMax
bool BSSmartJoin
bool BSGentleBWReason
bool BSCaseSensitive
Anope::string BSFantasyCharacter
bool HideStatsO
bool GlobalOnCycle
bool AnonymousGlobal
bool RestrictOperNicks
Anope::string GlobalOnCycleMessage
Anope::string GlobalOnCycleUP
bool SuperAdmin
time_t AutokillExpiry
time_t ChankillExpiry
time_t SNLineExpiry
time_t SQLineExpiry
bool AkillOnAdd
bool KillonSNline
bool KillonSQline
bool AddAkiller
bool AkillIds
bool LimitSessions
unsigned DefSessionLimit
time_t ExceptionExpiry
unsigned MaxSessionKill
unsigned MaxSessionLimit
time_t SessionAutoKillExpiry
unsigned SessionIPv4CIDR
unsigned SessionIPv6CIDR
Anope::string SessionLimitExceeded
Anope::string SessionLimitDetailsLoc
bool OSOpersOnly
std::list< Anope::stringModulesAutoLoad
unsigned long Seed
Anope::string Numeric
std::list< Anope::stringUlines
std::list< OperType * > MyOperTypes
std::vector< Oper * > Opers
CommandInfo::map Fantasy
std::vector< CommandGroupCommandGroups

Private Member Functions

bool CheckOnce (const Anope::string &)

Detailed Description

This class holds the bulk of the runtime configuration for Anope. It allows for reading new config values, accessing configuration files, and storage of the configuration data needed to run Anope.

Definition at line 280 of file config.h.


Constructor & Destructor Documentation

ServerConfig::ServerConfig (  ) 

Member Function Documentation

bool ServerConfig::CheckOnce ( const Anope::string tag  )  [private]

Check that there is only one of each configuration item

Definition at line 170 of file config.cpp.

References config_data, and ConfValueEnum().

Referenced by Read().

bool ServerConfig::ConfValue ( ConfigDataHash target,
const Anope::string tag,
const Anope::string var,
int  index,
Anope::string result,
bool  allow_linefeeds = false 
)

Writes 'length' chars into 'result' as a string

Definition at line 1771 of file config.cpp.

Referenced by ConfValueBool(), ConfValueInteger(), Read(), and ConfigReader::ReadValue().

bool ServerConfig::ConfValue ( ConfigDataHash target,
const Anope::string tag,
const Anope::string var,
const Anope::string default_value,
int  index,
Anope::string result,
bool  allow_linefeeds = false 
)

Writes 'length' chars into 'result' as a string

Definition at line 1776 of file config.cpp.

References Anope::string::empty(), LOG_DEBUG, Anope::string::npos, and Anope::string::replace_all_cs().

bool ServerConfig::ConfValueBool ( ConfigDataHash target,
const Anope::string tag,
const Anope::string var,
int  index 
)

Returns true if the value exists and has a true value, false otherwise

Definition at line 1871 of file config.cpp.

Referenced by Read(), and ConfigReader::ReadFlag().

bool ServerConfig::ConfValueBool ( ConfigDataHash target,
const Anope::string tag,
const Anope::string var,
const Anope::string default_value,
int  index 
)

Returns true if the value exists and has a true value, false otherwise

Definition at line 1876 of file config.cpp.

References ConfValue(), and Anope::string::equals_ci().

int ServerConfig::ConfValueEnum ( const ConfigDataHash target,
const Anope::string tag 
)

Returns the number of occurences of tag in the config file

Definition at line 1885 of file config.cpp.

Referenced by CheckOnce(), ConfigReader::Enumerate(), and Read().

bool ServerConfig::ConfValueInteger ( ConfigDataHash target,
const Anope::string tag,
const Anope::string var,
int  index,
int &  result 
)

Tries to convert the value to an integer and write it to 'result'

Definition at line 1820 of file config.cpp.

Referenced by Read(), and ConfigReader::ReadInteger().

bool ServerConfig::ConfValueInteger ( ConfigDataHash target,
const Anope::string tag,
const Anope::string var,
const Anope::string default_value,
int  index,
int &  result 
)

Tries to convert the value to an integer and write it to 'result'

Definition at line 1825 of file config.cpp.

References Anope::string::c_str(), ConfValue(), Anope::string::empty(), Anope::string::end(), Anope::string::erase(), Anope::string::str(), and Anope::string::substr().

int ServerConfig::ConfVarEnum ( ConfigDataHash target,
const Anope::string tag,
int  index 
)

Returns the numbers of vars inside the index'th 'tag in the config file

Definition at line 1890 of file config.cpp.

Referenced by ConfigReader::EnumerateValues().

void ServerConfig::LoadConf ( ConfigurationFile file  ) 

Load the configuration file into 'this'. With the new config parser everything is parsed into tag/key/value at load-time rather than at read-value time.

Definition at line 1585 of file config.cpp.

References Anope::string::clear(), ConfigurationFile::Close(), config_data, Anope::string::empty(), ConfigurationFile::End(), ConfigurationFile::GetName(), Anope::string::length(), LOG_DEBUG, ConfigurationFile::Open(), Anope::string::push_back(), ConfigurationFile::Read(), and stringify().

Referenced by DoInclude(), and Read().

void ServerConfig::Read (  ) 
void ServerConfig::ValidateHostname ( const Anope::string p,
const Anope::string tag,
const Anope::string val 
) const
void ServerConfig::ValidateIP ( const Anope::string p,
const Anope::string tag,
const Anope::string val,
bool  wild 
) const

Definition at line 196 of file config.cpp.

References Anope::string::begin(), Anope::string::empty(), and Anope::string::end().

Referenced by CommandOSConfig::Execute(), and Read().

void ServerConfig::ValidateNoSpaces ( const Anope::string p,
const Anope::string tag,
const Anope::string val 
) const

Definition at line 185 of file config.cpp.

References Anope::string::begin(), and Anope::string::end().

Referenced by CommandOSConfig::Execute(), and Read().


Field Documentation

Definition at line 534 of file config.h.

Referenced by ConfigItems::ConfigItems(), and CommandNSAJoin::DoAdd().

Definition at line 632 of file config.h.

Referenced by ConfigItems::ConfigItems(), and CommandOSAKill::DoAdd().

Definition at line 614 of file config.h.

Referenced by ConfigItems::ConfigItems().

Definition at line 407 of file config.h.

Referenced by User::BadPassword(), and ConfigItems::ConfigItems().

Definition at line 409 of file config.h.

Referenced by User::BadPassword(), and ConfigItems::ConfigItems().

Definition at line 591 of file config.h.

Definition at line 449 of file config.h.

Referenced by ConfigItems::ConfigItems(), and ModeManager::UpdateDefaultMLock().

Definition at line 599 of file config.h.

Referenced by ConfigItems::ConfigItems(), and CommandBSBadwords::DoAdd().

Definition at line 605 of file config.h.

Referenced by ConfigItems::ConfigItems(), CommandBSBadwords::DoAdd(), and BSKick::OnPrivmsg().

Definition at line 593 of file config.h.

Referenced by ChannelInfo::ChannelInfo(), and ServerConfig().

Definition at line 603 of file config.h.

Referenced by ConfigItems::ConfigItems(), and BSKick::OnPrivmsg().

Definition at line 595 of file config.h.

Referenced by ConfigItems::ConfigItems(), CommandBSKick::Execute(), and BanData::purge().

Definition at line 384 of file config.h.

Referenced by ConfigItems::ConfigItems(), and ServerConfig().

Definition at line 548 of file config.h.

Definition at line 626 of file config.h.

Referenced by ConfigItems::ConfigItems(), and CommandOSChanKill::Execute().

Definition at line 377 of file config.h.

Referenced by ConfigItems::ConfigItems(), and IRCDProto::IsChannelValid().

Definition at line 683 of file config.h.

Referenced by DoCommandGroups(), CommandHelp::FindGroup(), and InitCommandGroups().

This holds all the information in the config file, it's indexed by tag name to a vector of key/values.

Definition at line 290 of file config.h.

Referenced by CheckOnce(), ConfigReader::Enumerate(), ConfigReader::EnumerateValues(), CommandOSConfig::Execute(), LoadConf(), Read(), ConfigReader::ReadFlag(), ConfigReader::ReadInteger(), and ConfigReader::ReadValue().

Definition at line 564 of file config.h.

Referenced by ConfigItems::ConfigItems(), and CommandCSAKick::DoAdd().

Definition at line 566 of file config.h.

Referenced by ConfigItems::ConfigItems(), and CSAKick::OnCheckKick().

Definition at line 550 of file config.h.

Referenced by ChannelInfo::ChannelInfo(), and ServerConfig().

Definition at line 558 of file config.h.

Referenced by ConfigItems::ConfigItems().

Definition at line 568 of file config.h.

Referenced by ConfigItems::ConfigItems(), Channel::Hold(), and OSForbid::OnJoinChannel().

Definition at line 570 of file config.h.

Referenced by ConfigItems::ConfigItems(), and CommandCSList::Execute().

Definition at line 572 of file config.h.

Referenced by ConfigItems::ConfigItems(), and ChanServCore::OnBotPrivmsg().

Definition at line 556 of file config.h.

Referenced by ConfigItems::ConfigItems(), and CommandCSSuspend::Execute().

Definition at line 473 of file config.h.

Referenced by ConfigItems::ConfigItems().

Definition at line 647 of file config.h.

Referenced by ConfigItems::ConfigItems(), and CommandOSException::DoAdd().

Definition at line 413 of file config.h.

Referenced by ConfigItems::ConfigItems().

Definition at line 681 of file config.h.

Referenced by DoFantasy(), CommandHelp::Execute(), InitFantasy(), and BotServCore::OnPrivmsg().

Definition at line 620 of file config.h.

Referenced by ConfigItems::ConfigItems(), and GlobalCore::OnNewServer().

Definition at line 381 of file config.h.

Referenced by ConfigItems::ConfigItems(), and ServerConfig().

Definition at line 453 of file config.h.

Referenced by ConfigItems::ConfigItems(), and CommandHelp::Execute().

Definition at line 610 of file config.h.

Referenced by ConfigItems::ConfigItems(), and Message::Stats::Run().

Definition at line 634 of file config.h.

Referenced by ConfigItems::ConfigItems(), and CommandOSSNLine::OnAdd().

Definition at line 636 of file config.h.

Referenced by ConfigItems::ConfigItems(), and CommandOSSQLine::OnAdd().

Definition at line 489 of file config.h.

Referenced by ConfigItems::ConfigItems(), and Language::InitLanguages().

Below here is a list of variables which contain the config files values

Definition at line 359 of file config.h.

Referenced by ConfigItems::ConfigItems(), and Uplink::Connect().

Definition at line 460 of file config.h.

Referenced by DoLogs(), DoneLogs(), InitLogs(), and Log::~Log().

Definition at line 471 of file config.h.

Referenced by ConfigItems::ConfigItems(), and Mail::Send().

Definition at line 477 of file config.h.

Referenced by ConfigItems::ConfigItems(), and CommandNSSetEmail::SendConfirmMail().

Definition at line 477 of file config.h.

Referenced by ConfigItems::ConfigItems(), and CommandNSSetEmail::SendConfirmMail().

Definition at line 478 of file config.h.

Referenced by ConfigItems::ConfigItems(), and SendMemoMail().

Definition at line 478 of file config.h.

Referenced by ConfigItems::ConfigItems(), and SendMemoMail().

Definition at line 475 of file config.h.

Referenced by ConfigItems::ConfigItems(), and SendRegmail().

Definition at line 475 of file config.h.

Referenced by ConfigItems::ConfigItems(), and SendRegmail().

Definition at line 476 of file config.h.

Referenced by ConfigItems::ConfigItems(), and SendResetEmail().

Definition at line 476 of file config.h.

Referenced by ConfigItems::ConfigItems(), and SendResetEmail().

Definition at line 651 of file config.h.

Referenced by ConfigItems::ConfigItems(), and CommandOSException::DoAdd().

Definition at line 437 of file config.h.

Referenced by ConfigItems::ConfigItems(), and ModeManager::UpdateDefaultMLock().

Definition at line 665 of file config.h.

Referenced by DoModule(), DoneModules(), and Anope::Init().

Definition at line 392 of file config.h.

Referenced by ConfigItems::ConfigItems(), and Message::MOTD::Run().

Definition at line 581 of file config.h.

Referenced by ConfigItems::ConfigItems(), CommandMSRSend::Execute(), and MSRSend::MSRSend().

Definition at line 579 of file config.h.

Referenced by ConfigItems::ConfigItems().

Definition at line 528 of file config.h.

Definition at line 433 of file config.h.

Referenced by ConfigItems::ConfigItems(), and CommandNSRegister::Execute().

Definition at line 439 of file config.h.

Referenced by ChannelMode::CanSet(), and ConfigItems::ConfigItems().

Definition at line 483 of file config.h.

Referenced by ConfigItems::ConfigItems(), and CommandNSSetKill::Run().

Definition at line 506 of file config.h.

Referenced by ConfigItems::ConfigItems(), and CommandNSSetEmail::Run().

Definition at line 491 of file config.h.

Referenced by ConfigItems::ConfigItems(), NickCore::NickCore(), and Language::Translate().

Definition at line 514 of file config.h.

Referenced by ConfigItems::ConfigItems().

Definition at line 512 of file config.h.

Referenced by ConfigItems::ConfigItems().

Definition at line 545 of file config.h.

Referenced by ConfigItems::ConfigItems(), and Server::~Server().

Definition at line 537 of file config.h.

Referenced by ConfigItems::ConfigItems(), and MyNickServService::Validate().

Definition at line 536 of file config.h.

Referenced by ConfigItems::ConfigItems(), and MyNickServService::Validate().

Definition at line 508 of file config.h.

Referenced by ConfigItems::ConfigItems(), and CommandNSGroup::Execute().

Definition at line 530 of file config.h.

Referenced by ConfigItems::ConfigItems(), and NickServCore::OnNickIdentify().

Definition at line 539 of file config.h.

Referenced by ConfigItems::ConfigItems(), and NickServCore::OnNickIdentify().

Definition at line 485 of file config.h.

Referenced by ConfigItems::ConfigItems(), and CommandNSGroup::Execute().

Definition at line 496 of file config.h.

Referenced by ConfigItems::ConfigItems(), and CommandNSResend::Execute().

Definition at line 543 of file config.h.

Referenced by ConfigItems::ConfigItems(), IRCDMessageSASL::Run(), and IRCDMessageEncap::Run().

Definition at line 522 of file config.h.

Referenced by ConfigItems::ConfigItems().

Definition at line 500 of file config.h.

Referenced by ConfigItems::ConfigItems(), and CommandNSSuspend::Execute().

Definition at line 526 of file config.h.

Referenced by ConfigItems::ConfigItems(), and NickServCore::OnUserConnect().

std::vector<Oper *> ServerConfig::Opers

Definition at line 662 of file config.h.

Referenced by ConfigItems::ConfigItems(), and OperServCore::OnBotPrivmsg().

Definition at line 390 of file config.h.

Referenced by ConfigItems::ConfigItems(), remove_pidfile(), and write_pidfile().

Definition at line 415 of file config.h.

Referenced by ConfigItems::ConfigItems(), and SocketEngine::Process().

Definition at line 469 of file config.h.

Referenced by ConfigItems::ConfigItems(), and CommandNSResetPass::Execute().

Definition at line 451 of file config.h.

Referenced by ConfigItems::ConfigItems(), and UplinkSocket::~UplinkSocket().

unsigned long ServerConfig::Seed

Definition at line 668 of file config.h.

Referenced by ConfigItems::ConfigItems(), Anope::Init(), and ServerConfig().

Definition at line 467 of file config.h.

Referenced by ConfigItems::ConfigItems(), and Mail::Send().

Definition at line 465 of file config.h.

Referenced by ConfigItems::ConfigItems().

Definition at line 366 of file config.h.

Referenced by ConfigItems::ConfigItems(), Anope::Init(), and Message::Whois::Run().

Definition at line 622 of file config.h.

Referenced by ConfigItems::ConfigItems(), and CommandOSSet::DoSetSuperAdmin().

Definition at line 419 of file config.h.

Referenced by ConfigItems::ConfigItems(), and main().

Definition at line 673 of file config.h.

Referenced by Server::IsULined(), and ServerConfig().

Definition at line 411 of file config.h.

Referenced by DBMySQL::CheckSQL(), ConfigItems::ConfigItems(), and main().

std::vector<Uplink *> ServerConfig::Uplinks

Definition at line 380 of file config.h.

Referenced by ConfigItems::ConfigItems().

Definition at line 427 of file config.h.

Referenced by ConfigItems::ConfigItems(), Message::Privmsg::Run(), and ServerConfig().

Definition at line 584 of file config.h.

Referenced by ConfigItems::ConfigItems(), and IRCDProto::IsHostValid().

Definition at line 588 of file config.h.

Referenced by ConfigItems::ConfigItems(), and IRCDProto::IsHostValid().

Definition at line 586 of file config.h.

Referenced by ConfigItems::ConfigItems(), and IRCDProto::IsHostValid().

Definition at line 417 of file config.h.

Referenced by ConfigItems::ConfigItems().


The documentation for this class was generated from the following files: