InspIRCd  2.0
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
ServerConfig Class Reference

#include <configreader.h>

Public Types

enum  InviteAnnounceState { INVITE_ANNOUNCE_NONE, INVITE_ANNOUNCE_ALL, INVITE_ANNOUNCE_OPS, INVITE_ANNOUNCE_DYNAMIC }
 
enum  OperSpyWhoisState { SPYWHOIS_NONE, SPYWHOIS_SINGLEMSG, SPYWHOIS_SPLITMSG }
 

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

ConfigTagEmptyTag
 
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
 
bool HideULineKills
 
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

◆ InviteAnnounceState

Used to indicate who we announce invites to on a channel

Constructor & Destructor Documentation

◆ ServerConfig()

ServerConfig::ServerConfig ( )

Construct a new ServerConfig

Member Function Documentation

◆ Apply()

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

Apply configuration changes from the old configuration.

◆ CleanFilename()

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

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

Parameters
nameDirectory to tidy
Returns
The cleaned filename

◆ ConfValue()

ConfigTag * ServerConfig::ConfValue ( const std::string &  tag)

Get a configuration tag

Parameters
tagThe name of the tag to get

◆ FileExists()

bool ServerConfig::FileExists ( const char *  file)
static

Check if a file exists.

Parameters
fileThe full path to a file
Returns
True if the file exists and is readable.

◆ GetSID()

const std::string & ServerConfig::GetSID ( )

Get server ID as string with required leading zeroes

◆ Read()

void ServerConfig::Read ( )

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

◆ Send005()

void ServerConfig::Send005 ( User user)

Send the 005 numerics (ISUPPORT) to a user

◆ StartsWithWindowsDriveLetter()

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

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

◆ Update005()

void ServerConfig::Update005 ( )

Update the 005 vector

Member Data Documentation

◆ AdminEmail

std::string ServerConfig::AdminEmail

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

◆ AdminName

std::string ServerConfig::AdminName

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

◆ AdminNick

std::string ServerConfig::AdminNick

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

◆ AnnounceInvites

InviteAnnounceState ServerConfig::AnnounceInvites

Announce invites to the channel with a server notice

◆ c_ipv4_range

int ServerConfig::c_ipv4_range

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

◆ c_ipv6_range

int ServerConfig::c_ipv6_range

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

◆ Classes

ClassVector ServerConfig::Classes

The connect classes in use by the IRC server.

◆ cmdline

CommandLineConf ServerConfig::cmdline

Configuration parsed from the command line.

◆ config_data

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.

◆ CustomVersion

std::string ServerConfig::CustomVersion

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

◆ CycleHosts

bool ServerConfig::CycleHosts

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

◆ CycleHostsFromUser

bool ServerConfig::CycleHostsFromUser

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

◆ data005

std::string ServerConfig::data005

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

◆ DefaultModes

std::string ServerConfig::DefaultModes

Default channel modes

◆ diepass

std::string ServerConfig::diepass

The admin-configured /DIE password

◆ DisabledCModes

char ServerConfig::DisabledCModes[64]

This variable identifies which chanmodes have been disabled.

◆ DisabledCommands

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.

◆ DisabledDontExist

bool ServerConfig::DisabledDontExist

Pretend disabled commands don't exist.

◆ DisabledUModes

char ServerConfig::DisabledUModes[64]

This variable identifies which usermodes have been diabled.

◆ dns_timeout

int ServerConfig::dns_timeout

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

◆ DNSServer

std::string ServerConfig::DNSServer

The DNS server to use for DNS queries

◆ EmptyTag

ConfigTag* ServerConfig::EmptyTag

An empty configuration tag.

◆ errstr

std::stringstream ServerConfig::errstr

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

◆ Files

ConfigFileCache ServerConfig::Files

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

◆ FixedPart

std::string ServerConfig::FixedPart

The fixed part message in use, or an empty string

◆ FixedQuit

std::string ServerConfig::FixedQuit

The fixed quit message in use, or an empty string

◆ FullHostInTopic

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.

◆ GenericOper

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.

◆ HideBans

bool ServerConfig::HideBans

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

◆ HideKillsServer

std::string ServerConfig::HideKillsServer

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

◆ HideModeLists

bool ServerConfig::HideModeLists[256]

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

◆ HideSplits

bool ServerConfig::HideSplits

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

◆ HideULineKills

bool ServerConfig::HideULineKills

Set to hide kills from clients of ulined servers in snotices.

◆ HideWhoisServer

std::string ServerConfig::HideWhoisServer

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

◆ InvBypassModes

bool ServerConfig::InvBypassModes

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

◆ isupport

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

isupport strings

◆ Limits

ServerLimits ServerConfig::Limits

Length limits, see definition of ServerLimits class

◆ maxbans

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

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

◆ MaxChans

unsigned int ServerConfig::MaxChans

Max channels per user

◆ MaxConn

int ServerConfig::MaxConn

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

◆ MaxTargets

unsigned int ServerConfig::MaxTargets

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

◆ ModPath

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.

◆ MoronBanner

std::string ServerConfig::MoronBanner

Notice to give to users when they are Xlined

◆ motd

std::string ServerConfig::motd

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

◆ NetBufferSize

int ServerConfig::NetBufferSize

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

◆ NoSnoticeStack

bool ServerConfig::NoSnoticeStack

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

◆ NoUserDns

bool ServerConfig::NoUserDns

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

◆ oper_blocks

OperIndex ServerConfig::oper_blocks

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

◆ OperMaxChans

unsigned int ServerConfig::OperMaxChans

Oper max channels per user

◆ OperSpyWhois

OperSpyWhoisState ServerConfig::OperSpyWhois

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

◆ PID

std::string ServerConfig::PID

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

◆ powerhash

std::string ServerConfig::powerhash

The hash method for BOTH the die and restart passwords.

◆ PrefixPart

std::string ServerConfig::PrefixPart

The part prefix in use, or an empty string

◆ PrefixQuit

std::string ServerConfig::PrefixQuit

The quit prefix in use, or an empty string

◆ RawLog

bool ServerConfig::RawLog

True if raw I/O is being logged

◆ restartpass

std::string ServerConfig::restartpass

The admin-configured /RESTART password

◆ RestrictBannedUsers

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.

◆ rules

std::string ServerConfig::rules

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

◆ ServerDesc

std::string ServerConfig::ServerDesc

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

◆ ServerName

std::string ServerConfig::ServerName

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

◆ sid

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.

◆ SoftLimit

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.

◆ SuffixPart

std::string ServerConfig::SuffixPart

The part suffix in use, or an empty string

◆ SuffixQuit

std::string ServerConfig::SuffixQuit

The quit suffix in use, or an empty string

◆ SyntaxHints

bool ServerConfig::SyntaxHints

If set to true, provide syntax hints for unknown commands

◆ ulines

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

List of u-lined servers

◆ UndernetMsgPrefix

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.

◆ UserStats

std::string ServerConfig::UserStats

STATS characters in this list are available only to operators.

◆ valid

bool ServerConfig::valid

True if this configuration is valid enough to run with

◆ WelcomeNotice

bool ServerConfig::WelcomeNotice

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

◆ WhoWasGroupSize

int ServerConfig::WhoWasGroupSize

Max number of WhoWas entries per user.

◆ WhoWasMaxGroups

int ServerConfig::WhoWasMaxGroups

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

◆ WhoWasMaxKeep

int ServerConfig::WhoWasMaxKeep

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

◆ WildcardIPv6

bool ServerConfig::WildcardIPv6

Bind to IPv6 by default


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