|
|||
|
|||
|
#include "dynamic.h"#include "base.h"#include "ctables.h"#include "inspsocket.h"#include <string>#include <deque>#include <sstream>#include "timer.h"#include "mode.h"#include "dns.h"Include dependency graph for modules.h:

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

Go to the source code of this file.
Classes | |
| class | Version |
| Holds a module's Version information. More... | |
| class | ModuleMessage |
| The ModuleMessage class is the base class of Request and Event This class is used to represent a basic data structure which is passed between modules for safe inter-module communications. More... | |
| class | Request |
| The Request class is a unicast message directed at a given module. More... | |
| class | Event |
| The Event class is a unicast message directed at all modules. More... | |
| class | Module |
| Base class for all InspIRCd modules This class is the base class for InspIRCd modules. More... | |
| class | ConfigReader |
| Allows reading of values from configuration files This class allows a module to read from either the main configuration file (inspircd.conf) or from a module-specified configuration file. More... | |
| class | FileReader |
| Caches a text file into memory and can be used to retrieve lines from it. More... | |
| class | ModuleManager |
| ModuleManager takes care of all things module-related in the core. More... | |
Defines | |
| #define | NATIVE_API_VERSION 12000 |
| If you change the module API, change this value. | |
| #define | API_VERSION (NATIVE_API_VERSION * 1) |
| #define | FOREACH_MOD(y, x) |
| This define allows us to call a method in all loaded modules in a readable simple way, e.g. | |
| #define | FOREACH_MOD_I(z, y, x) |
| This define allows us to call a method in all loaded modules in a readable simple way and pass an instance pointer to the macro. | |
| #define | FOREACH_RESULT(y, x) |
| This define is similar to the one above but returns a result in MOD_RESULT. | |
| #define | FOREACH_RESULT_I(z, y, x) |
| This define is similar to the one above but returns a result in MOD_RESULT. | |
| #define | FD_MAGIC_NUMBER -42 |
| Represents a non-local user. | |
| #define | IS_LOCAL(x) ((x->GetFd() > -1)) |
| Is a local user. | |
| #define | IS_REMOTE(x) (x->GetFd() < 0) |
| Is a remote user. | |
| #define | IS_MODULE_CREATED(x) (x->GetFd() == FD_MAGIC_NUMBER) |
| Is a module created user. | |
| #define | IS_OPER(x) (!x->oper.empty()) |
| Is an oper. | |
| #define | IS_AWAY(x) (!x->awaymsg.empty()) |
| Is away. | |
| #define | CONF_NO_ERROR 0x000000 |
| #define | CONF_NOT_A_NUMBER 0x000010 |
| #define | CONF_INT_NEGATIVE 0x000080 |
| #define | CONF_VALUE_NOT_FOUND 0x000100 |
| #define | CONF_FILE_NOT_FOUND 0x000200 |
| #define | MODULE_INIT(y) |
| This definition is used as shorthand for the various classes and functions needed to make a module loadable by the OS. | |
Typedefs | |
| typedef std::deque< std::string > | file_cache |
| Low level definition of a FileReader classes file cache area - a text file seperated into lines. | |
| typedef file_cache | string_list |
| A set of strings. | |
| typedef std::map< std::string, Module * > | featurelist |
| Holds a list of 'published features' for modules. | |
| typedef std::deque< Module * > | modulelist |
| Holds a list of modules which implement an interface. | |
| typedef std::map< std::string, std::pair< int, modulelist > > | interfacelist |
| Holds a list of all modules which implement interfaces, by interface name. | |
| typedef DLLFactory< Module > | ircd_module |
| A DLLFactory (designed to load shared objects) containing a handle to a module's init_module() function. | |
| typedef std::vector< Module * > | IntModuleList |
| A list of modules. | |
| typedef IntModuleList::iterator | EventHandlerIter |
| An event handler iterator. | |
Enumerations | |
| enum | AccessControlType { ACR_DEFAULT, ACR_DENY, ACR_ALLOW, AC_KICK, AC_DEOP, AC_OP, AC_VOICE, AC_DEVOICE, AC_HALFOP, AC_DEHALFOP, AC_INVITE, AC_GENERAL_MODE } |
| Used with OnAccessCheck() method of modules. More... | |
| enum | ModuleFlags { VF_STATIC = 1, VF_VENDOR = 2, VF_SERVICEPROVIDER = 4, VF_COMMON = 8 } |
| Used to define a set of behavior bits for a module. More... | |
| enum | WriteModeFlags { WM_AND = 1, WM_OR = 2 } |
| Used with SendToMode(). More... | |
| enum | TargetTypeFlags { TYPE_USER = 1, TYPE_CHANNEL, TYPE_SERVER, TYPE_OTHER } |
| Used to represent an event type, for user, channel or server. More... | |
| enum | MessageType { MSG_PRIVMSG = 0, MSG_NOTICE = 1 } |
| Used to represent wether a message was PRIVMSG or NOTICE. More... | |
| enum | Priority { PRIORITY_FIRST, PRIORITY_DONTCARE, PRIORITY_LAST, PRIORITY_BEFORE, PRIORITY_AFTER } |
| Priority types which can be returned from Module::Prioritize(). More... | |
| enum | Implementation { I_BEGIN, I_OnUserConnect, I_OnUserQuit, I_OnUserDisconnect, I_OnUserJoin, I_OnUserPart, I_OnRehash, I_OnServerRaw, I_OnSendSnotice, I_OnUserPreJoin, I_OnUserPreKick, I_OnUserKick, I_OnOper, I_OnInfo, I_OnWhois, I_OnUserPreInvite, I_OnUserInvite, I_OnUserPreMessage, I_OnUserPreNotice, I_OnUserPreNick, I_OnUserMessage, I_OnUserNotice, I_OnMode, I_OnGetServerDescription, I_OnSyncUser, I_OnSyncChannel, I_OnSyncChannelMetaData, I_OnSyncUserMetaData, I_OnDecodeMetaData, I_ProtoSendMode, I_ProtoSendMetaData, I_OnWallops, I_OnChangeHost, I_OnChangeName, I_OnAddLine, I_OnDelLine, I_OnExpireLine, I_OnCleanup, I_OnUserPostNick, I_OnAccessCheck, I_On005Numeric, I_OnKill, I_OnRemoteKill, I_OnLoadModule, I_OnUnloadModule, I_OnBackgroundTimer, I_OnPreCommand, I_OnCheckReady, I_OnCheckInvite, I_OnRawMode, I_OnCheckKey, I_OnCheckLimit, I_OnCheckBan, I_OnCheckExtBan, I_OnCheckStringExtBan, I_OnStats, I_OnChangeLocalUserHost, I_OnChangeLocalUserGecos, I_OnLocalTopicChange, I_OnPostLocalTopicChange, I_OnEvent, I_OnRequest, I_OnGlobalOper, I_OnPostConnect, I_OnAddBan, I_OnDelBan, I_OnRawSocketAccept, I_OnRawSocketClose, I_OnRawSocketWrite, I_OnRawSocketRead, I_OnChangeLocalUserGECOS, I_OnUserRegister, I_OnChannelPreDelete, I_OnChannelDelete, I_OnPostOper, I_OnSyncOtherMetaData, I_OnSetAway, I_OnUserList, I_OnPostCommand, I_OnPostJoin, I_OnWhoisLine, I_OnBuildExemptList, I_OnRawSocketConnect, I_OnGarbageCollect, I_OnBufferFlushed, I_OnText, I_OnPassCompare, I_OnRunTestSuite, I_OnNamesListItem, I_OnNumeric, I_OnHookUserIO, I_OnHostCycle, I_END } |
| Implementation-specific flags which may be set in Module::Implements(). More... | |
| enum | PriorityState { PRIO_DONTCARE, PRIO_FIRST, PRIO_LAST, PRIO_AFTER, PRIO_BEFORE } |
| Module priority states. More... | |
|
|
|
Definition at line 1401 of file modules.h. Referenced by ConfigReader::ConfigReader(). |
|
|
Definition at line 1399 of file modules.h. Referenced by ConfigReader::ReadInteger(). |
|
|
Definition at line 1397 of file modules.h. Referenced by ConfigReader::ConfigReader(). |
|
|
|
|
|
Definition at line 1400 of file modules.h. Referenced by ModuleWaitPong::OnRehash(), ModuleCgiIRC::OnRehash(), ModuleBlockAmsg::OnRehash(), ConfigReader::ReadInteger(), and ConfigReader::ReadValue(). |
|
|
Represents a non-local user. (in fact, any FD less than -1 does) Definition at line 229 of file modules.h. Referenced by User::FlushWriteBuf(), InspIRCd::InspIRCd(), and TreeSocket::ParseUID(). |
|
|
|
Value: do { \ EventHandlerIter safei; \ for (EventHandlerIter _i = z->Modules->EventHandlers[y].begin(); _i != z->Modules->EventHandlers[y].end(); ) \ { \ safei = _i; \ ++safei; \ try \ { \ (*_i)->x ; \ } \ catch (CoreException& modexcept) \ { \ z->Logs->Log("MODULE",DEFAULT,"Exception caught: %s",modexcept.GetReason()); \ } \ _i = safei; \ } \ } while (0); e.g.: 'FOREACH_MOD_I(Instance, OnConnect, OnConnect(user));' Definition at line 149 of file modules.h. Referenced by UserManager::AddUser(), CullList::Apply(), InspIRCd::BuildISupport(), TreeSocket::DoBurst(), Channel::ForceChan(), InspIRCd::GetServerDescription(), ModuleManager::Load(), TreeSocket::MetaData(), TreeSocket::ParseUID(), InspIRCd::Run(), TreeSocket::SendChannelModes(), TreeSocket::SendUsers(), TreeSocket::ServerMessage(), and ModuleManager::Unload(). |
|
|
|
Value: do { \ EventHandlerIter safei; \ MOD_RESULT = 0; \ for (EventHandlerIter _i = z->Modules->EventHandlers[y].begin(); _i != z->Modules->EventHandlers[y].end(); ) \ { \ safei = _i; \ ++safei; \ try \ { \ int res = (*_i)->x ; \ if (res != 0) { \ MOD_RESULT = res; \ break; \ } \ } \ catch (CoreException& modexcept) \ { \ z->Logs->Log("MODULE",DEBUG,"Exception caught: %s",modexcept.GetReason()); \ } \ _i = safei; \ } \ } while (0); The first module to return a nonzero result is the value to be accepted, and any modules after are ignored. Definition at line 202 of file modules.h. Referenced by Channel::JoinUser(), Channel::KickUser(), Channel::PartUser(), InspIRCd::PassCompare(), InspIRCd::SendWhoisLine(), and Channel::ServerKickUser(). |
|
|
Is away.
Definition at line 242 of file modules.h. Referenced by CommandWatch::add_watch(), CommandWatch::Handle(), CommandUserip::Handle(), CommandCheck::Handle(), and TreeSocket::SendUsers(). |
|
|
|
Is a module created user.
|
|
|
|
Is a remote user.
|
|
|
Value: This definition is used as shorthand for the various classes and functions needed to make a module loadable by the OS.It defines the class factory and external init_module function. |
|
|
If you change the module API, change this value. If you have enabled ipv6, the sizes of structs is different, and modules will be incompatible with ipv4 servers, so this value will be ten times as high on ipv6 servers. |
|
|
An event handler iterator.
|
|
|
Holds a list of 'published features' for modules.
|
|
|
Low level definition of a FileReader classes file cache area - a text file seperated into lines.
|
|
|
Holds a list of all modules which implement interfaces, by interface name.
|
|
|
A list of modules.
|
|
|
A DLLFactory (designed to load shared objects) containing a handle to a module's init_module() function. Unfortunately, due to the design of shared object systems we must keep this hanging around, as if we remove this handle, we remove the shared object file from memory (!) |
|
|
Holds a list of modules which implement an interface.
|
|
|
A set of strings.
|
|
|
Used with OnAccessCheck() method of modules.
|
|