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>

Classes

class  ServerPaths
 

Public Types

enum  InviteAnnounceState { INVITE_ANNOUNCE_NONE, INVITE_ANNOUNCE_ALL, INVITE_ANNOUNCE_OPS, INVITE_ANNOUNCE_DYNAMIC }
 
enum  OperSpyWhoisState { SPYWHOIS_NONE, SPYWHOIS_SINGLEMSG, SPYWHOIS_SPLITMSG }
 
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
 
void Read ()
 
void Apply (ServerConfig *old, const std::string &useruid)
 
void ApplyModules (User *user)
 
void Fill ()
 
bool ApplyDisabledCommands (const std::string &data)
 

Static Public Member Functions

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

Public Attributes

ConfigTagEmptyTag
 
std::stringstream errstr
 
bool valid
 
bool WildcardIPv6
 
ConfigDataHash config_data
 
ConfigFileCache Files
 
ServerLimits Limits
 
ServerPaths Paths
 
CommandLineConf cmdline
 
int c_ipv4_range
 
int c_ipv6_range
 
std::string ServerName
 
std::string XLineMessage
 
std::string Network
 
std::string ServerDesc
 
bool DisabledDontExist
 
std::string DisabledCommands
 
std::bitset< 64 > DisabledUModes
 
std::bitset< 64 > DisabledCModes
 
bool GenericOper
 
bool RestrictBannedUsers
 
int NetBufferSize
 
int MaxConn
 
bool CCOnConnect
 
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 UserStats
 
std::string DefaultModes
 
std::string CustomVersion
 
bool SyntaxHints
 
std::string CaseMapping
 
bool CycleHostsFromUser
 
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

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

◆ ConfValue()

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

Get a configuration tag

Parameters
tagThe name of the tag to get

◆ Escape()

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

Escapes a value for storage in a configuration key.

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

◆ GetSID()

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

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

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

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

◆ CycleHostsFromUser

bool ServerConfig::CycleHostsFromUser

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

◆ DefaultModes

std::string ServerConfig::DefaultModes

Default channel modes

◆ DisabledCModes

std::bitset<64> ServerConfig::DisabledCModes

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

std::bitset<64> ServerConfig::DisabledUModes

This variable identifies which usermodes have been diabled.

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

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

◆ 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

◆ 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

◆ OperSpyWhois

OperSpyWhoisState ServerConfig::OperSpyWhois

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

◆ OperTypes

OperIndex ServerConfig::OperTypes

Oper types keyed by their name

◆ Paths

ServerPaths ServerConfig::Paths

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

◆ PID

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

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.

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

◆ SyntaxHints

bool ServerConfig::SyntaxHints

If set to true, provide syntax hints for unknown commands

◆ 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

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