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

#include <configreader.h>


class  ServerPaths

Public Types

typedef std::vector< reference< ConnectClass > > ClassVector
typedef insp::flat_map< std::string, reference< OperInfo > > OperIndex

Public Member Functions

ConfigTagConfValue (const std::string &tag)
ConfigTagList ConfTags (const std::string &tag)
 ServerConfig ()
const std::string & GetSID () const
const std::string & GetServerName () const
const std::string & GetServerDesc () const
void Read ()
void Apply (ServerConfig *old, const std::string &useruid)
void ApplyModules (User *user)
void Fill ()

Static Public Member Functions

static std::string Escape (const std::string &str, bool xml=true)

Public Attributes

std::stringstream errstr
bool valid
bool WildcardIPv6
ConfigDataHash config_data
ConfigFileCache Files
ServerLimits Limits
ServerPaths Paths
CommandLineConf cmdline
unsigned char c_ipv4_range
unsigned char c_ipv6_range
std::string ServerName
std::string XLineMessage
std::string Network
std::string ServerDesc
BannedUserTreatment RestrictBannedUsers
int NetBufferSize
int MaxConn
bool CCOnConnect
unsigned int SoftLimit
unsigned int MaxTargets
time_t TimeSkipWarn
bool HideBans
bool RawLog
std::string HideServer
std::string PID
ClassVector Classes
std::string DefaultModes
std::string CustomVersion
bool SyntaxHints
std::string CaseMapping
bool FullHostInTopic
OperIndex oper_blocks
OperIndex OperTypes
unsigned int MaxChans
unsigned int OperMaxChans
std::string sid
bool NoSnoticeStack

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 Typedef Documentation

◆ ClassVector

Holds a complete list of all connect blocks

◆ OperIndex

Index of valid oper blocks and types

Member Enumeration Documentation

◆ BannedUserTreatment

How to treat a user in a channel who is banned.


Don't treat a banned user any different to normal.


Restrict the actions of a banned user.


Restrict the actions of a banned user and notify them of their treatment.

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.

◆ ConfTags()

ConfigTagList ServerConfig::ConfTags ( const std::string &  tag)

Get a list of configuration tags by name.

tagThe name of the tags to get.
Either a list of tags from the config or an empty ConfigTagList.

◆ ConfValue()

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

Get a configuration tag by name. If one or more tags are present then the first is returned.

tagThe name of the tag to get.
Either a tag from the config or EmptyTag.

◆ Escape()

std::string ServerConfig::Escape ( const std::string &  str,
bool  xml = true 

Escapes a value for storage in a configuration key.

strThe string to escape.
xmlAre we using the XML config format?

◆ GetServerDesc()

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

Retrieves the server description which should be shown to users.

◆ GetServerName()

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

Retrieves the server name which should be shown to users.

◆ GetSID()

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

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.

Member Data Documentation

◆ c_ipv4_range

unsigned char ServerConfig::c_ipv4_range

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

◆ c_ipv6_range

unsigned char ServerConfig::c_ipv6_range

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

◆ CaseMapping

std::string ServerConfig::CaseMapping

The name of the casemapping method used by this server.

◆ CCOnConnect

bool ServerConfig::CCOnConnect

If we should check for clones during CheckClass() in AddUser() Setting this to false allows to not trigger on maxclones for users that may belong to another class after DNS-lookup is complete. It does, however, make the server spend more time on users we may potentially not want.

◆ 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.

◆ DefaultModes

std::string ServerConfig::DefaultModes

Default channel modes

◆ 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)

◆ 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.

◆ HideBans

bool ServerConfig::HideBans

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

◆ HideServer

std::string ServerConfig::HideServer

Set to a non-empty string to obfuscate server names.

◆ Limits

ServerLimits ServerConfig::Limits

Length limits, see definition of ServerLimits class

◆ MaxChans

unsigned int ServerConfig::MaxChans

Default value for <connect:maxchans>, deprecated in 3.0

◆ 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

◆ 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

◆ oper_blocks

OperIndex ServerConfig::oper_blocks

Oper blocks keyed by their name

◆ OperMaxChans

unsigned int ServerConfig::OperMaxChans

Default value for <oper:maxchans>, deprecated in 3.0

◆ OperTypes

OperIndex ServerConfig::OperTypes

Oper types keyed by their name

◆ Paths

ServerPaths ServerConfig::Paths

Locations of various types of file (config, module, etc).


std::string ServerConfig::PID

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

◆ RawLog

bool ServerConfig::RawLog

True if raw I/O is being logged

◆ RestrictBannedUsers

BannedUserTreatment ServerConfig::RestrictBannedUsers

How to treat a user in a channel who is banned.

◆ 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

Unique 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.

◆ SyntaxHints

bool ServerConfig::SyntaxHints

If set to true, provide syntax hints for unknown commands

◆ TimeSkipWarn

time_t ServerConfig::TimeSkipWarn

The number of seconds that the server clock can skip by before server operators are warned.

◆ valid

bool ServerConfig::valid

True if this configuration is valid enough to run with

◆ WildcardIPv6

bool ServerConfig::WildcardIPv6

Bind to IPv6 by default

◆ XLineMessage

std::string ServerConfig::XLineMessage

Notice to give to users when they are banned by an XLine

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