InspIRCd  2.0
 All Classes Namespaces Functions Variables Typedefs Enumerations
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
ServerConfig Class Reference

#include <configreader.h>

Public Types


Public Member Functions

ConfigTagConfValue (const std::string &tag)
ConfigTagList ConfTags (const std::string &tag)
 ServerConfig ()
const std::string & GetSID ()
void Update005 ()
void Send005 (User *user)
void Read ()
void Apply (ServerConfig *old, const std::string &useruid)
void ApplyModules (User *user)
void Fill ()
bool StartsWithWindowsDriveLetter (const std::string &path)
bool ApplyDisabledCommands (const std::string &data)

Static Public Member Functions

static const char * CleanFilename (const char *name)
static bool FileExists (const char *file)

Public Attributes

std::stringstream errstr
bool valid
bool WildcardIPv6
ConfigDataHash config_data
ConfigFileCache Files
ServerLimits Limits
CommandLineConf cmdline
int c_ipv4_range
int c_ipv6_range
int WhoWasGroupSize
int WhoWasMaxGroups
int WhoWasMaxKeep
std::string ServerName
std::string MoronBanner
std::string Network
std::string ServerDesc
std::string AdminName
std::string AdminEmail
std::string AdminNick
std::string diepass
std::string restartpass
std::string powerhash
std::string motd
std::string rules
std::string PrefixQuit
std::string SuffixQuit
std::string FixedQuit
std::string PrefixPart
std::string SuffixPart
std::string FixedPart
std::string DNSServer
bool DisabledDontExist
std::string DisabledCommands
char DisabledUModes [64]
char DisabledCModes [64]
std::string ModPath
bool GenericOper
bool RestrictBannedUsers
bool HideModeLists [256]
int dns_timeout
int NetBufferSize
int MaxConn
unsigned int SoftLimit
unsigned int MaxTargets
bool HideSplits
bool HideBans
InviteAnnounceState AnnounceInvites
OperSpyWhoisState OperSpyWhois
bool RawLog
std::string HideWhoisServer
std::string HideKillsServer
std::string PID
ClassVector Classes
std::string data005
std::vector< std::string > isupport
std::string UserStats
std::string DefaultModes
std::string CustomVersion
std::map< irc::string, bool > ulines
std::map< std::string, int > maxbans
bool NoUserDns
bool SyntaxHints
bool CycleHosts
bool CycleHostsFromUser
bool UndernetMsgPrefix
bool FullHostInTopic
OperIndex oper_blocks
unsigned int MaxChans
unsigned int OperMaxChans
std::string sid
bool InvBypassModes
bool NoSnoticeStack
bool WelcomeNotice

Detailed Description

This class holds the bulk of the runtime configuration for the ircd. It allows for reading new config values, accessing configuration files, and storage of the configuration data needed to run the ircd, such as the servername, connect classes, /ADMIN data, MOTDs and filenames etc.

Member Enumeration Documentation

Used to indicate who we announce invites to on a channel

Constructor & Destructor Documentation

ServerConfig::ServerConfig ( )

Construct a new ServerConfig

Member Function Documentation

void ServerConfig::Apply ( ServerConfig old,
const std::string &  useruid 

Apply configuration changes from the old configuration.

const char * ServerConfig::CleanFilename ( const char *  name)

Clean a filename, stripping the directories (and drives) from string.

nameDirectory to tidy
The cleaned filename
ConfigTag * ServerConfig::ConfValue ( const std::string &  tag)

Get a configuration tag

tagThe name of the tag to get
bool ServerConfig::FileExists ( const char *  file)

Check if a file exists.

fileThe full path to a file
True if the file exists and is readable.
const std::string & ServerConfig::GetSID ( )

Get server ID as string with required leading zeroes

void ServerConfig::Read ( )

Read the entire configuration into memory and initialize this class. All other methods should be used only by the core.

void ServerConfig::Send005 ( User user)

Send the 005 numerics (ISUPPORT) to a user

bool ServerConfig::StartsWithWindowsDriveLetter ( const std::string &  path)

Returns true if the given string starts with a windows drive letter

void ServerConfig::Update005 ( )

Update the 005 vector

Member Data Documentation

std::string ServerConfig::AdminEmail

Holds the email address of the admin, for output in the /ADMIN command.

std::string ServerConfig::AdminName

Holds the admin's name, for output in the /ADMIN command.

std::string ServerConfig::AdminNick

Holds the admin's nickname, for output in the /ADMIN command

InviteAnnounceState ServerConfig::AnnounceInvites

Announce invites to the channel with a server notice

int ServerConfig::c_ipv4_range

Clones CIDR range for ipv4 (0-32) Defaults to 32 (checks clones on all IPs seperately)

int ServerConfig::c_ipv6_range

Clones CIDR range for ipv6 (0-128) Defaults to 128 (checks on all IPs seperately)

ClassVector ServerConfig::Classes

The connect classes in use by the IRC server.

CommandLineConf ServerConfig::cmdline

Configuration parsed from the command line.

ConfigDataHash ServerConfig::config_data

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

std::string ServerConfig::CustomVersion

Custom version string, which if defined can replace the system info in VERSION.

bool ServerConfig::CycleHosts

If set to true, users appear to quit then rejoin when their hosts change. This keeps clients synchronized properly.

bool ServerConfig::CycleHostsFromUser

If set to true, the CycleHosts mode change will be sourced from the user, rather than the server

std::string ServerConfig::data005

The 005 tokens of this server (ISUPPORT) populated/repopulated upon loading or unloading modules.

std::string ServerConfig::DefaultModes

Default channel modes

std::string ServerConfig::diepass

The admin-configured /DIE password

char ServerConfig::DisabledCModes[64]

This variable identifies which chanmodes have been disabled.

std::string ServerConfig::DisabledCommands

This variable contains a space-seperated list of commands which are disabled by the administrator of the server for non-opers.

bool ServerConfig::DisabledDontExist

Pretend disabled commands don't exist.

char ServerConfig::DisabledUModes[64]

This variable identifies which usermodes have been diabled.

int ServerConfig::dns_timeout

The number of seconds the DNS subsystem will wait before timing out any request.

std::string ServerConfig::DNSServer

The DNS server to use for DNS queries

std::stringstream ServerConfig::errstr

Error stream, contains error output from any failed configuration parsing.

ConfigFileCache ServerConfig::Files

This holds all extra files that have been read in the configuration (for example, MOTD and RULES files are stored here)

std::string ServerConfig::FixedPart

The fixed part message in use, or an empty string

std::string ServerConfig::FixedQuit

The fixed quit message in use, or an empty string

bool ServerConfig::FullHostInTopic

If set to true, the full [email protected] will be shown in the TOPIC command for who set the topic last. If false, only the nick is shown.

bool ServerConfig::GenericOper

If set to true, then all opers on this server are shown with a generic 'is an IRC operator' line rather than the oper type. Oper types are still used internally.

bool ServerConfig::HideBans

True if we're going to hide ban reasons for non-opers (e.g. G-Lines, K-Lines, Z-Lines)

std::string ServerConfig::HideKillsServer

Set to a non empty string to obfuscate nicknames prepended to a KILL.

bool ServerConfig::HideModeLists[256]

If this is set to true, then mode lists (e.g MODE #chan b) are hidden from unprivileged users.

bool ServerConfig::HideSplits

True if we're going to hide netsplits as *.net *.split for non-opers

std::string ServerConfig::HideWhoisServer

Set to a non-empty string to obfuscate the server name of users in WHOIS

bool ServerConfig::InvBypassModes

If this value is true, invites will bypass more than just +i

std::vector<std::string> ServerConfig::isupport

isupport strings

ServerLimits ServerConfig::Limits

Length limits, see definition of ServerLimits class

std::map<std::string, int> ServerConfig::maxbans

Max banlist sizes for channels (the std::string is a glob)

unsigned int ServerConfig::MaxChans

Max channels per user

int ServerConfig::MaxConn

The value to be used for listen() backlogs as default.

unsigned int ServerConfig::MaxTargets

Maximum number of targets for a multi target command such as PRIVMSG or KICK

std::string ServerConfig::ModPath

The full path to the modules directory. This is either set at compile time, or overridden in the configuration file via the <path> tag.

std::string ServerConfig::MoronBanner

Notice to give to users when they are Xlined

std::string ServerConfig::motd

The pathname and filename of the message of the day file, as defined by the administrator.

int ServerConfig::NetBufferSize

The size of the read() buffer in the user handling code, used to read data into a user's recvQ.

bool ServerConfig::NoSnoticeStack

If this value is true, snotices will not stack when repeats are sent

bool ServerConfig::NoUserDns

If set to true, no user DNS lookups are to be performed

OperIndex ServerConfig::oper_blocks

Oper block and type index. For anonymous oper blocks (type only), prefix with a space.

unsigned int ServerConfig::OperMaxChans

Oper max channels per user

OperSpyWhoisState ServerConfig::OperSpyWhois

If this is enabled then operators will see invisible (+i) channels in /whois.

std::string ServerConfig::PID

The full pathname and filename of the PID file as defined in the configuration.

std::string ServerConfig::powerhash

The hash method for BOTH the die and restart passwords.

std::string ServerConfig::PrefixPart

The part prefix in use, or an empty string

std::string ServerConfig::PrefixQuit

The quit prefix in use, or an empty string

bool ServerConfig::RawLog

True if raw I/O is being logged

std::string ServerConfig::restartpass

The admin-configured /RESTART password

bool ServerConfig::RestrictBannedUsers

If this value is true, banned users (+b, not extbans) will not be able to change nick if banned on any channel, nor to message them.

std::string ServerConfig::rules

The pathname and filename of the rules file, as defined by the administrator.

std::string ServerConfig::ServerDesc

Holds the description of the local server as defined by the administrator.

std::string ServerConfig::ServerName

Holds the server name of the local server as defined by the administrator.

std::string ServerConfig::sid

TS6-like server ID. NOTE: 000...999 are usable for InspIRCd servers. This makes code simpler. 0AA, 1BB etc with letters are reserved for services use.

unsigned int ServerConfig::SoftLimit

The soft limit value assigned to the irc server. The IRC server will not allow more than this number of local users.

std::string ServerConfig::SuffixPart

The part suffix in use, or an empty string

std::string ServerConfig::SuffixQuit

The quit suffix in use, or an empty string

bool ServerConfig::SyntaxHints

If set to true, provide syntax hints for unknown commands

std::map<irc::string, bool> ServerConfig::ulines

List of u-lined servers

bool ServerConfig::UndernetMsgPrefix

If set to true, prefixed channel NOTICEs and PRIVMSGs will have the prefix added to the outgoing text for undernet style msg prefixing.

std::string ServerConfig::UserStats

STATS characters in this list are available only to operators.

bool ServerConfig::valid

True if this configuration is valid enough to run with

bool ServerConfig::WelcomeNotice

If true, a "Welcome to <networkname>!" NOTICE will be sent to connecting users

int ServerConfig::WhoWasGroupSize

Max number of WhoWas entries per user.

int ServerConfig::WhoWasMaxGroups

Max number of cumulative user-entries in WhoWas. When max reached and added to, push out oldest entry FIFO style.

int ServerConfig::WhoWasMaxKeep

Max seconds a user is kept in WhoWas before being pruned.

bool ServerConfig::WildcardIPv6

Bind to IPv6 by default

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