The InspIRCd Project
Home | Developers | Wiki | Forums | Bug Tracker | SVN | Download
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

configreader.h File Reference

#include <sstream>
#include <string>
#include <vector>
#include <map>
#include "inspircd.h"
#include "modules.h"
#include "socketengine.h"
#include "socket.h"

Include dependency graph for configreader.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  ValueItem
 Holds a config value, either string, integer or boolean. More...
class  ValueContainerBase
 The base class of the container 'ValueContainer' used internally by the core to hold core values. More...
class  ValueContainer< T >
 ValueContainer is used to contain pointers to different core values such as the server name, maximum number of clients etc. More...
struct  InitialConfig
 Holds a core configuration item and its callbacks. More...
struct  Deprecated
 Represents a deprecated configuration tag. More...
struct  MultiConfig
 Holds a core configuration item and its callbacks where there may be more than one item. More...
struct  operclass_data
 Holds an oper class. More...
class  ServerLimits
 Defines the server's length limits on various length-limited items such as topics, nicknames, channel names etc. More...
class  ServerConfig
 This class holds the bulk of the runtime configuration for the ircd. More...

Defines

#define CHANOPS_EXEMPT(s, m)   (s->Config->ExemptChanOps[(unsigned char)m])
 Determines if a channel op is exempt from given mode m, in config of server instance s.
#define MAX_VALUES_PER_TAG   18
 The maximum number of values in a core configuration tag.

Typedefs

typedef ValueContainer< bool * > ValueContainerBool
 A specialization of ValueContainer to hold a pointer to a bool.
typedef ValueContainer< unsigned
int * > 
ValueContainerUInt
 A specialization of ValueContainer to hold a pointer to an unsigned int.
typedef ValueContainer< char * > ValueContainerChar
 A specialization of ValueContainer to hold a pointer to a char array.
typedef ValueContainer< int * > ValueContainerInt
 A specialization of ValueContainer to hold a pointer to an int.
typedef ValueContainer< size_t * > ValueContainerST
 A specialization of ValueContainer to hold a pointer to a size_t.
typedef std::deque< ValueItemValueList
 A set of ValueItems used by multi-value validator functions.
typedef bool(* Validator )(ServerConfig *conf, const char *, const char *, ValueItem &)
 A callback for validating a single value.
typedef bool(* MultiValidator )(ServerConfig *conf, const char *, char **, ValueList &, int *)
 A callback for validating multiple value entries.
typedef bool(* MultiNotify )(ServerConfig *conf, const char *)
 A callback indicating the end of a group of entries.
typedef std::map< irc::string,
char * > 
opertype_t
 A set of oper types.
typedef std::map< irc::string,
operclass_data
operclass_t
 A Set of oper classes.

Enumerations

enum  ConfigDataType {
  DT_NOTHING = 0, DT_INTEGER = 1, DT_CHARPTR = 2, DT_BOOLEAN = 3,
  DT_HOSTNAME = 4, DT_NOSPACES = 5, DT_IPADDRESS = 6, DT_CHANNEL = 7,
  DT_ALLOW_WILD = 64, DT_ALLOW_NEWLINE = 128, DT_BOOTONLY = 256
}
 Types of data in the core config. More...

Functions

CoreExport bool InitializeDisabledCommands (const char *data, InspIRCd *ServerInstance)
 Initialize the disabled commands list.
bool InitTypes (ServerConfig *conf, const char *tag)
 Initialize the oper types.
bool InitClasses (ServerConfig *conf, const char *tag)
 Initialize the oper classes.
bool DoType (ServerConfig *conf, const char *tag, char **entries, ValueList &values, int *types)
 Initialize an oper type.
bool DoClass (ServerConfig *conf, const char *tag, char **entries, ValueList &values, int *types)
 Initialize an oper class.
bool DoneClassesAndTypes (ServerConfig *conf, const char *tag)
 Finish initializing the oper types and classes.
bool InitXLine (ServerConfig *conf, const char *tag)
 Initialize x line.
bool DoZLine (ServerConfig *conf, const char *tag, char **entries, ValueList &values, int *types)
 Add a config-defined zline.
bool DoQLine (ServerConfig *conf, const char *tag, char **entries, ValueList &values, int *types)
 Add a config-defined qline.
bool DoKLine (ServerConfig *conf, const char *tag, char **entries, ValueList &values, int *types)
 Add a config-defined kline.
bool DoELine (ServerConfig *conf, const char *tag, char **entries, ValueList &values, int *types)
 Add a config-defined eline.


Define Documentation

#define CHANOPS_EXEMPT s,
 )     (s->Config->ExemptChanOps[(unsigned char)m])
 

Determines if a channel op is exempt from given mode m, in config of server instance s.

Definition at line 22 of file configreader.h.

Referenced by ModuleStripColor::OnUserPreMessage(), ModuleCensor::OnUserPreMessage(), ModuleBlockColour::OnUserPreMessage(), ModuleBlockCAPS::OnUserPreMessage(), ModuleNoNickChange::OnUserPreNick(), ModuleNickFlood::OnUserPreNick(), ModuleNoNotice::OnUserPreNotice(), ModuleNoCTCP::OnUserPreNotice(), ModuleMsgFlood::ProcessMessages(), and ModuleChanFilter::ProcessMessages().

#define MAX_VALUES_PER_TAG   18
 

The maximum number of values in a core configuration tag.

Can be increased if needed.

Definition at line 57 of file configreader.h.

Referenced by ServerConfig::Read().


Typedef Documentation

typedef bool(* MultiNotify)(ServerConfig *conf, const char *)
 

A callback indicating the end of a group of entries.

Definition at line 169 of file configreader.h.

typedef bool(* MultiValidator)(ServerConfig *conf, const char *, char **, ValueList &, int *)
 

A callback for validating multiple value entries.

Definition at line 166 of file configreader.h.

typedef std::map<irc::string, operclass_data> operclass_t
 

A Set of oper classes.

Definition at line 246 of file configreader.h.

typedef std::map<irc::string,char*> opertype_t
 

A set of oper types.

Definition at line 227 of file configreader.h.

typedef bool(* Validator)(ServerConfig *conf, const char *, const char *, ValueItem &)
 

A callback for validating a single value.

Definition at line 163 of file configreader.h.

typedef ValueContainer<bool*> ValueContainerBool
 

A specialization of ValueContainer to hold a pointer to a bool.

Definition at line 135 of file configreader.h.

typedef ValueContainer<char*> ValueContainerChar
 

A specialization of ValueContainer to hold a pointer to a char array.

Definition at line 145 of file configreader.h.

typedef ValueContainer<int*> ValueContainerInt
 

A specialization of ValueContainer to hold a pointer to an int.

Definition at line 150 of file configreader.h.

typedef ValueContainer<size_t*> ValueContainerST
 

A specialization of ValueContainer to hold a pointer to a size_t.

Definition at line 155 of file configreader.h.

typedef ValueContainer<unsigned int*> ValueContainerUInt
 

A specialization of ValueContainer to hold a pointer to an unsigned int.

Definition at line 140 of file configreader.h.

typedef std::deque<ValueItem> ValueList
 

A set of ValueItems used by multi-value validator functions.

Definition at line 159 of file configreader.h.


Enumeration Type Documentation

enum ConfigDataType
 

Types of data in the core config.

Enumerator:
DT_NOTHING 
DT_INTEGER 
DT_CHARPTR 
DT_BOOLEAN 
DT_HOSTNAME 
DT_NOSPACES 
DT_IPADDRESS 
DT_CHANNEL 
DT_ALLOW_WILD 
DT_ALLOW_NEWLINE 
DT_BOOTONLY 

Definition at line 40 of file configreader.h.


Function Documentation

bool DoClass ServerConfig conf,
const char *  tag,
char **  entries,
ValueList values,
int *  types
 

Initialize an oper class.

Definition at line 2263 of file configreader.cpp.

References ServerConfig::operclass, and strnewdup().

Referenced by ServerConfig::Read().

bool DoELine ServerConfig conf,
const char *  tag,
char **  entries,
ValueList values,
int *  types
 

Add a config-defined eline.

Definition at line 2345 of file configreader.cpp.

References XLineManager::AddLine(), ServerConfig::GetInstance(), XLineManager::IdentSplit(), InspIRCd::Time(), and InspIRCd::XLines.

Referenced by ServerConfig::Read().

bool DoKLine ServerConfig conf,
const char *  tag,
char **  entries,
ValueList values,
int *  types
 

Add a config-defined kline.

Definition at line 2330 of file configreader.cpp.

References XLineManager::AddLine(), ServerConfig::GetInstance(), XLineManager::IdentSplit(), InspIRCd::Time(), and InspIRCd::XLines.

Referenced by ServerConfig::Read().

bool DoneClassesAndTypes ServerConfig conf,
const char *  tag
 

Finish initializing the oper types and classes.

Definition at line 2294 of file configreader.cpp.

Referenced by ServerConfig::Read().

bool DoQLine ServerConfig conf,
const char *  tag,
char **  entries,
ValueList values,
int *  types
 

Add a config-defined qline.

Definition at line 2318 of file configreader.cpp.

References XLineManager::AddLine(), ServerConfig::GetInstance(), InspIRCd::Time(), and InspIRCd::XLines.

Referenced by ServerConfig::Read().

bool DoType ServerConfig conf,
const char *  tag,
char **  entries,
ValueList values,
int *  types
 

Initialize an oper type.

Definition at line 2251 of file configreader.cpp.

References ServerConfig::opertypes, and strnewdup().

Referenced by ServerConfig::Read().

bool DoZLine ServerConfig conf,
const char *  tag,
char **  entries,
ValueList values,
int *  types
 

Add a config-defined zline.

Definition at line 2306 of file configreader.cpp.

References XLineManager::AddLine(), ServerConfig::GetInstance(), InspIRCd::Time(), and InspIRCd::XLines.

Referenced by ServerConfig::Read().

bool InitClasses ServerConfig conf,
const char *  tag
 

Initialize the oper classes.

Definition at line 2229 of file configreader.cpp.

References ServerConfig::operclass.

Referenced by ServerConfig::Read().

CoreExport bool InitializeDisabledCommands const char *  data,
InspIRCd ServerInstance
 

Initialize the disabled commands list.

Definition at line 243 of file configreader.cpp.

References CommandParser::cmdlist, and InspIRCd::Parser.

Referenced by InspIRCd::InspIRCd(), and InspIRCd::Run().

bool InitTypes ServerConfig conf,
const char *  tag
 

Initialize the oper types.

Definition at line 2211 of file configreader.cpp.

References ServerConfig::opertypes.

Referenced by ServerConfig::Read().

bool InitXLine ServerConfig conf,
const char *  tag
 

Initialize x line.

Definition at line 2301 of file configreader.cpp.

Referenced by ServerConfig::Read().