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

modules.h File Reference

#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::stringfile_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< Moduleircd_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...


Define Documentation

#define API_VERSION   (NATIVE_API_VERSION * 1)
 

Definition at line 89 of file modules.h.

Referenced by ModuleSpanningTree::GetVersion(), ModuleZLib::GetVersion(), ModuleXLineDB::GetVersion(), Modulewatch::GetVersion(), ModuleVHost::GetVersion(), ModuleUserIP::GetVersion(), ModuleUninvite::GetVersion(), ModuleUHNames::GetVersion(), ModuleTLine::GetVersion(), ModuleTimedBans::GetVersion(), ModuleTestCommand::GetVersion(), ModuleTestClient::GetVersion(), ModuleTaxonomy::GetVersion(), ModuleSWhois::GetVersion(), ModuleSVSHold::GetVersion(), ModuleStripColor::GetVersion(), ModuleSSLModes::GetVersion(), ModuleSSLInfo::GetVersion(), ModuleOperSSLCert::GetVersion(), ModuleSSLOpenSSL::GetVersion(), ModuleSSLGnuTLS::GetVersion(), ModuleSSLDummy::GetVersion(), ModuleSQLutils::GetVersion(), ModuleSQLOper::GetVersion(), ModuleSQLLog::GetVersion(), ModuleSQLite3::GetVersion(), ModuleSQLAuth::GetVersion(), ModuleSpy::GetVersion(), ModuleSilence::GetVersion(), ModuleShun::GetVersion(), ModuleShowwhois::GetVersion(), ModuleSHA256::GetVersion(), ModuleSetName::GetVersion(), ModuleSetIdle::GetVersion(), ModuleSetIdent::GetVersion(), ModuleSetHost::GetVersion(), ModuleServProtectMode::GetVersion(), ModuleServicesAccount::GetVersion(), ModuleServices::GetVersion(), ModuleServerBan::GetVersion(), ModuleSeeNicks::GetVersion(), ModuleSecureList::GetVersion(), ModuleSATopic::GetVersion(), ModuleSASL::GetVersion(), ModuleSaquit::GetVersion(), ModuleSapart::GetVersion(), ModuleSanick::GetVersion(), ModuleSaMode::GetVersion(), ModuleSajoin::GetVersion(), ModuleSafeList::GetVersion(), ModuleRPCTest::GetVersion(), ModuleRpcJson::GetVersion(), ModuleRLine::GetVersion(), ModuleRIPEMD160::GetVersion(), ModuleRestrictMsg::GetVersion(), ModuleRestrictChans::GetVersion(), ModuleRestrictBanned::GetVersion(), ModuleRemove::GetVersion(), ModuleRegOnlyCreate::GetVersion(), ModuleRegexTRE::GetVersion(), ModuleRegexPOSIX::GetVersion(), ModuleRegexPCRE::GetVersion(), ModuleRegexGlob::GetVersion(), ModuleRedirect::GetVersion(), ModuleRandQuote::GetVersion(), ModulePgSQL::GetVersion(), ModulePermanentChannels::GetVersion(), ModuleOperHash::GetVersion(), ModuleOverride::GetVersion(), ModuleOpermotd::GetVersion(), ModuleModesOnOper::GetVersion(), ModuleOperLog::GetVersion(), ModuleOperLevels::GetVersion(), ModuleOperjoin::GetVersion(), ModuleOperFlood::GetVersion(), ModuleOperChans::GetVersion(), ModulePartMsgBan::GetVersion(), ModuleNoNotice::GetVersion(), ModuleNoNickChange::GetVersion(), ModuleNoKicks::GetVersion(), ModuleNoCTCP::GetVersion(), ModuleNickLock::GetVersion(), ModuleNickFlood::GetVersion(), ModuleNamesX::GetVersion(), ModuleSQL::GetVersion(), ModuleQuietBan::GetVersion(), ModuleMsSQL::GetVersion(), ModuleMsgFlood::GetVersion(), ModuleMD5::GetVersion(), ModuleMapHide::GetVersion(), ModuleLockserv::GetVersion(), ModuleLDAPAuth::GetVersion(), ModuleKnock::GetVersion(), ModuleKickNoRejoin::GetVersion(), ModuleJumpServer::GetVersion(), ModuleJoinFlood::GetVersion(), ModuleInviteException::GetVersion(), ModuleInvisible::GetVersion(), ModuleIdent::GetVersion(), ModuleHttpStats::GetVersion(), ModuleHTTPAccessList::GetVersion(), ModuleHttpServer::GetVersion(), ModuleHostChange::GetVersion(), ModuleHideOper::GetVersion(), ModuleHideChans::GetVersion(), ModuleHelpop::GetVersion(), ModuleGlobops::GetVersion(), ModuleGlobalLoad::GetVersion(), ModuleGeoIP::GetVersion(), ModuleGecosBan::GetVersion(), ModuleFoobar::GetVersion(), FilterBase::GetVersion(), ModuleDNSBL::GetVersion(), ModuleDeVoice::GetVersion(), ModuleDenyChannels::GetVersion(), ModuleDelayJoin::GetVersion(), ModuleDeaf::GetVersion(), ModuleDCCAllow::GetVersion(), ModuleCycle::GetVersion(), ModuleCustomTitle::GetVersion(), ModuleConnFlood::GetVersion(), ModuleQuitBan::GetVersion(), ModuleWaitPong::GetVersion(), ModuleModesOnConnect::GetVersion(), ModuleConnJoin::GetVersion(), ModulePrivacyMode::GetVersion(), ModuleClose::GetVersion(), ModuleClones::GetVersion(), ModuleCloaking::GetVersion(), ModuleChgName::GetVersion(), ModuleChgIdent::GetVersion(), ModuleChgHost::GetVersion(), ModuleCheck::GetVersion(), ModuleChanProtect::GetVersion(), ModuleBadChannelExtban::GetVersion(), ModuleChanLog::GetVersion(), ModuleChanFilter::GetVersion(), ModuleChanCreate::GetVersion(), ModuleCgiIRC::GetVersion(), ModuleCensor::GetVersion(), ModuleCBan::GetVersion(), ModuleCAP::GetVersion(), ModuleCallerID::GetVersion(), ModuleBotMode::GetVersion(), ModuleBlockColour::GetVersion(), ModuleBlockCAPS::GetVersion(), ModuleBlockAmsg::GetVersion(), ModuleBanRedirect::GetVersion(), ModuleBanException::GetVersion(), ModuleAuditorium::GetVersion(), ModuleAntiBottler::GetVersion(), ModuleAntiBear::GetVersion(), Modulealltime::GetVersion(), ModuleAllowInvite::GetVersion(), ModuleAlias::GetVersion(), ModuleAbbreviation::GetVersion(), and ModuleManager::Load().

#define CONF_FILE_NOT_FOUND   0x000200
 

Definition at line 1401 of file modules.h.

Referenced by ConfigReader::ConfigReader().

#define CONF_INT_NEGATIVE   0x000080
 

Definition at line 1399 of file modules.h.

Referenced by ConfigReader::ReadInteger().

#define CONF_NO_ERROR   0x000000
 

Definition at line 1397 of file modules.h.

Referenced by ConfigReader::ConfigReader().

#define CONF_NOT_A_NUMBER   0x000010
 

Definition at line 1398 of file modules.h.

#define CONF_VALUE_NOT_FOUND   0x000100
 

Definition at line 1400 of file modules.h.

Referenced by ModuleWaitPong::OnRehash(), ModuleCgiIRC::OnRehash(), ModuleBlockAmsg::OnRehash(), ConfigReader::ReadInteger(), and ConfigReader::ReadValue().

#define FD_MAGIC_NUMBER   -42
 

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().

#define FOREACH_MOD y,
 ) 
 

Value:

do { \
        EventHandlerIter safei; \
        for (EventHandlerIter _i = ServerInstance->Modules->EventHandlers[y].begin(); _i != ServerInstance->Modules->EventHandlers[y].end(); ) \
        { \
                safei = _i; \
                ++safei; \
                try \
                { \
                        (*_i)->x ; \
                } \
                catch (CoreException& modexcept) \
                { \
                        ServerInstance->Logs->Log("MODULE",DEFAULT,"Exception caught: %s",modexcept.GetReason()); \
                } \
                _i = safei; \
        } \
} while (0);
This define allows us to call a method in all loaded modules in a readable simple way, e.g.

: 'FOREACH_MOD(I_OnConnect,OnConnect(user));'

Definition at line 125 of file modules.h.

Referenced by XLineManager::AddLine(), User::ChangeDisplayedHost(), User::ChangeName(), XLineManager::DelLine(), SpanningTreeUtilities::DoOneToAllButSenderRaw(), XLineManager::ExpireLine(), User::FlushWriteBuf(), User::FullConnect(), CommandTaxonomy::Handle(), Channel::KickUser(), User::Oper(), Channel::PartUser(), ModeParser::Process(), CommandParser::ProcessCommand(), User::PurgeEmptyChannels(), Event::Send(), Channel::ServerKickUser(), Channel::SetTopic(), TestSuite::TestSuite(), and Channel::UserList().

#define FOREACH_MOD_I z,
y,
 ) 
 

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);
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.

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().

#define FOREACH_RESULT y,
 ) 
 

Value:

do { \
        EventHandlerIter safei; \
        MOD_RESULT = 0; \
        for (EventHandlerIter _i = ServerInstance->Modules->EventHandlers[y].begin(); _i != ServerInstance->Modules->EventHandlers[y].end(); ) \
        { \
                safei = _i; \
                ++safei; \
                try \
                { \
                        int res = (*_i)->x ; \
                        if (res != 0) { \
                                MOD_RESULT = res; \
                                break; \
                        } \
                } \
                catch (CoreException& modexcept) \
                { \
                        ServerInstance->Logs->Log("MODULE",DEFAULT,"Exception caught: %s",modexcept.GetReason()); \
                } \
                _i = safei; \
        } \
} while(0);
This define is similar to the one above but returns a result in MOD_RESULT.

The first module to return a nonzero result is the value to be accepted, and any modules after are ignored.

Definition at line 172 of file modules.h.

Referenced by ModeChannelBan::AddBan(), ModeChannelHalfOp::AddHalfOp(), ModeChannelOp::AddOp(), ModeChannelVoice::AddVoice(), User::ChangeDisplayedHost(), User::ChangeIdent(), User::ChangeName(), ModeChannelBan::DelBan(), ModeChannelHalfOp::DelHalfOp(), ModeChannelOp::DelOp(), ModeChannelVoice::DelVoice(), Snomask::Flush(), User::ForceNickChange(), User::FullConnect(), Channel::IsBanned(), Channel::IsExtBanned(), Channel::KickUser(), ModeParser::Process(), CommandParser::ProcessCommand(), Channel::SetTopic(), Channel::UserList(), and User::WriteNumeric().

#define FOREACH_RESULT_I z,
y,
 ) 
 

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);
This define is similar to the one above but returns a result in MOD_RESULT.

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().

#define IS_AWAY  )     (!x->awaymsg.empty())
 

Is away.

Definition at line 242 of file modules.h.

Referenced by CommandWatch::add_watch(), CommandWatch::Handle(), CommandUserip::Handle(), CommandCheck::Handle(), and TreeSocket::SendUsers().

#define IS_LOCAL  )     ((x->GetFd() > -1))
 

Is a local user.

Definition at line 234 of file modules.h.

Referenced by ModeChannelBan::AddBan(), ModeChannelHalfOp::AddHalfOp(), ModeChannelOp::AddOp(), ModeChannelVoice::AddVoice(), CullList::Apply(), BanRedirect::BeforeMode(), CommandParser::CallHandler(), User::ChangeDisplayedHost(), User::ChangeName(), ModuleRestrictBanned::CheckRestricted(), ModeChannelHalfOp::DelHalfOp(), ModeChannelOp::DelOp(), ModeChannelVoice::DelVoice(), Snomask::Flush(), Channel::ForceChan(), TreeSocket::ForceNick(), SpanningTreeUtilities::GetListOfServersForChannel(), cmd_rconnect::Handle(), CommandSVSWatch::Handle(), CommandUninvite::Handle(), CommandSVSSilence::Handle(), CommandSaquit::Handle(), CommandSapart::Handle(), CommandSanick::Handle(), CommandSajoin::Handle(), RemoveBase::Handle(), CommandNicklock::Handle(), CommandCycle::Handle(), CommandTitle::Handle(), CommandChgname::Handle(), CommandChghost::Handle(), CommandCheck::Handle(), CommandAccept::Handle(), CommandAlltime::Handle(), ModuleSpanningTree::HandleMap(), ModuleSpanningTree::HandleRemoteWhois(), ModuleSpanningTree::HandleTime(), User::HasModePermission(), User::HasPermission(), SpanningTreeProtocolInterface::Introduce(), CommandParser::IsValidCommand(), Channel::JoinUser(), Channel::KickUser(), cmd_rsquit::NoticeUser(), ModuleSpanningTree::OnAddLine(), ModuleSilence::OnBuildExemptList(), ModuleGecosBan::OnCheckInvite(), ModuleServicesAccount::OnDecodeMetaData(), ModuleSpanningTree::OnDelLine(), ModuleSpanningTree::OnMode(), ListModeBase::OnModeChange(), SSLMode::OnModeChange(), Redirect::OnModeChange(), InvisibleMode::OnModeChange(), DelayJoinMode::OnModeChange(), CloakUser::OnModeChange(), ChanProtect::OnModeChange(), ChanFounder::OnModeChange(), AuditoriumMode::OnModeChange(), ModeChannelKey::OnModeChange(), ModuleSpanningTree::OnOper(), ModuleSSLOpenSSL::OnPostConnect(), ModuleSSLGnuTLS::OnPostConnect(), ModuleSASL::OnPostConnect(), ModuleConnJoin::OnPostConnect(), ModuleOperjoin::OnPostOper(), ModuleOperFlood::OnPostOper(), ModuleOperLog::OnPreCommand(), FilterBase::OnPreCommand(), ModuleBlockAmsg::OnPreCommand(), ModuleServProtectMode::OnRawMode(), ModuleSpanningTree::OnRemoteKill(), ModuleSpanningTree::OnSetAway(), ModuleShun::OnUserConnect(), ModuleModesOnConnect::OnUserConnect(), ModuleSpanningTree::OnUserInvite(), ModuleSpanningTree::OnUserJoin(), ModuleSpanningTree::OnUserKick(), ModuleSpanningTree::OnUserMessage(), ModuleSpanningTree::OnUserNotice(), ModuleSpanningTree::OnUserPart(), ModulePartMsgBan::OnUserPart(), ModuleSpanningTree::OnUserPostNick(), ModuleSeeNicks::OnUserPostNick(), ModuleRLine::OnUserPostNick(), ModuleAllowInvite::OnUserPreInvite(), ModuleServerBan::OnUserPreJoin(), ModuleRestrictChans::OnUserPreJoin(), ModuleOverride::OnUserPreJoin(), ModuleGecosBan::OnUserPreJoin(), ModuleBadChannelExtban::OnUserPreJoin(), ModuleStripColor::OnUserPreMessage(), ModuleServicesAccount::OnUserPreMessage(), ModuleServices::OnUserPreMessage(), ModuleRestrictMsg::OnUserPreMessage(), ModuleQuietBan::OnUserPreMessage(), ModuleCensor::OnUserPreMessage(), ModuleCallerID::OnUserPreMessage(), ModuleBlockColour::OnUserPreMessage(), ModuleBlockCAPS::OnUserPreMessage(), ModuleAlias::OnUserPreMessage(), ModuleRestrictBanned::OnUserPreNick(), ModuleNoNickChange::OnUserPreNick(), ModuleNoNotice::OnUserPreNotice(), ModuleNoCTCP::OnUserPreNotice(), ModuleQuietBan::OnUserPreNotice(), ModuleInvisible::OnUserPreNotice(), FilterBase::OnUserPreNotice(), ModuleDCCAllow::OnUserPreNotice(), ModuleCallerID::OnUserPreNotice(), ModuleSpanningTree::OnUserQuit(), ModuleGeoIP::OnUserRegister(), ModuleDNSBL::OnUserRegister(), ModuleSpanningTree::OnWallops(), ModuleSSLOpenSSL::OnWhois(), ModuleSSLGnuTLS::OnWhois(), ModuleShowwhois::OnWhois(), ModuleSilence::PreText(), ModeParser::Process(), ModuleMsgFlood::ProcessMessages(), ModuleChanFilter::ProcessMessages(), TreeSocket::Push(), TreeServer::QuitUsers(), User::ReadData(), ModuleSpanningTree::RemoteMessage(), Channel::ServerKickUser(), TreeSocket::ServiceJoin(), TreeSocket::ServicePart(), User::SetClass(), Channel::SetTopic(), TreeSocket::Time(), Channel::UserList(), TreeSocket::Whois(), Channel::WriteAllExcept(), Channel::WriteChannel(), Channel::WriteChannelWithServ(), User::WriteCommon(), User::WriteCommonExcept(), ModuleInvisible::WriteCommonFrom(), User::WriteCommonQuit(), and User::WriteWallOps().

#define IS_MODULE_CREATED  )     (x->GetFd() == FD_MAGIC_NUMBER)
 

Is a module created user.

Definition at line 238 of file modules.h.

#define IS_OPER  )     (!x->oper.empty())
 

Is an oper.

Definition at line 240 of file modules.h.

Referenced by FilterBase::AppliesToMe(), User::ChannelList(), ModeParser::DisplayCurrentModes(), ModuleAlias::DoAlias(), CommandUserip::Handle(), CommandJumpserver::Handle(), CommandCheck::Handle(), ModuleSafeList::HandleList(), ModuleSpanningTree::HandleLusers(), User::HasModePermission(), User::HasPermission(), Channel::JoinUser(), TreeSocket::Modules(), ModuleOverride::OnAccessCheck(), ModuleSafeList::OnBufferFlushed(), ModuleGecosBan::OnCheckInvite(), ModuleOperLevels::OnKill(), ModuleOverride::OnLocalTopicChange(), ModeUserServerNoticeMask::OnModeChange(), InvisibleMode::OnModeChange(), ModuleAuditorium::OnNamesListItem(), ModuleSecureList::OnPreCommand(), ModuleOperLog::OnPreCommand(), ModuleMapHide::OnPreCommand(), ModuleSpy::OnUserList(), ModuleRestrictChans::OnUserPreJoin(), ModuleRegOnlyCreate::OnUserPreJoin(), ModuleOverride::OnUserPreJoin(), ModuleGecosBan::OnUserPreJoin(), ModuleOperChans::OnUserPreJoin(), ModuleDenyChannels::OnUserPreJoin(), ModuleOverride::OnUserPreKick(), ModuleRestrictMsg::OnUserPreMessage(), ModulePrivacyMode::OnUserPreMessage(), ModuleInvisible::OnUserPreNotice(), ModuleHideOper::OnWhoisLine(), ModuleHideChans::OnWhoisLine(), ModuleCallerID::PreText(), ModeParser::Process(), CommandParser::ProcessCommand(), TreeSocket::SendUsers(), ModuleSpanningTree::ShowLinks(), ModuleSpanningTree::ShowMap(), User::UnOper(), QuietOper::VisibleTo(), ModuleInvisible::WriteCommonFrom(), and User::WriteCommonQuit().

#define IS_REMOTE  )     (x->GetFd() < 0)
 

Is a remote user.

Definition at line 236 of file modules.h.

#define MODULE_INIT  ) 
 

Value:

extern "C" DllExport Module * init_module(InspIRCd* Me) \
        { \
                return new y(Me); \
        }
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.

Definition at line 1917 of file modules.h.

#define NATIVE_API_VERSION   12000
 

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.

Definition at line 85 of file modules.h.


Typedef Documentation

typedef IntModuleList::iterator EventHandlerIter
 

An event handler iterator.

Definition at line 1616 of file modules.h.

typedef std::map<std::string,Module*> featurelist
 

Holds a list of 'published features' for modules.

Definition at line 110 of file modules.h.

typedef std::deque<std::string> file_cache
 

Low level definition of a FileReader classes file cache area - a text file seperated into lines.

Definition at line 97 of file modules.h.

typedef std::map<std::string, std::pair<int, modulelist> > interfacelist
 

Holds a list of all modules which implement interfaces, by interface name.

Definition at line 118 of file modules.h.

typedef std::vector<Module*> IntModuleList
 

A list of modules.

Definition at line 1612 of file modules.h.

typedef DLLFactory<Module> ircd_module
 

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 (!)

Definition at line 1608 of file modules.h.

typedef std::deque<Module*> modulelist
 

Holds a list of modules which implement an interface.

Definition at line 114 of file modules.h.

typedef file_cache string_list
 

A set of strings.

Definition at line 106 of file modules.h.


Enumeration Type Documentation

enum AccessControlType
 

Used with OnAccessCheck() method of modules.

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

Definition at line 32 of file modules.h.

enum Implementation
 

Implementation-specific flags which may be set in Module::Implements().

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

Definition at line 388 of file modules.h.