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

modules.h File Reference

#include "globals.h"
#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  CoreException
 This class can be used on its own to represent an exception, or derived to represent a module-specific exception. More...
class  ModuleException
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  ModuleFactory
 Instantiates classes inherited from Module. More...

Defines

#define NATIVE_API_VERSION   11025
 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) && (x->GetFd() <= MAX_DESCRIPTORS))
 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)
 Is an oper.
#define IS_AWAY(x)   (*x->awaymsg)
 Is away.
#define CONF_NOT_A_NUMBER   0x000010
#define CONF_NOT_UNSIGNED   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< ModuleFactoryircd_module
 A DLLFactory (designed to load shared objects) containing a ModuleFactory.
typedef std::vector< Module * > ModuleList
 A list of loaded Modules.
typedef std::vector< ircd_module * > FactoryList
 A list of loaded ModuleFactories.

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_OnUserConnect, I_OnUserQuit, I_OnUserDisconnect, I_OnUserJoin,
  I_OnUserPart, I_OnRehash, I_OnServerRaw, 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_OnAddGLine, I_OnAddZLine, I_OnAddQLine, I_OnAddKLine,
  I_OnAddELine, I_OnDelGLine, I_OnDelZLine, I_OnDelKLine,
  I_OnDelELine, I_OnDelQLine, I_OnCleanup, I_OnUserPostNick,
  I_OnAccessCheck, I_On005Numeric, I_OnKill, I_OnRemoteKill,
  I_OnLoadModule, I_OnUnloadModule, I_OnBackgroundTimer, I_OnPreCommand,
  I_OnCheckReady, I_OnUserRrgister, I_OnCheckInvite, I_OnCheckKey,
  I_OnCheckLimit, I_OnCheckBan, I_OnStats, I_OnChangeLocalUserHost,
  I_OnChangeLocalUserGecos, I_OnLocalTopicChange, I_OnPostLocalTopicChange, I_OnEvent,
  I_OnRequest, I_OnOperCompre, I_OnGlobalOper, I_OnPostConnect,
  I_OnAddBan, I_OnDelBan, I_OnRawSocketAccept, I_OnRawSocketClose,
  I_OnRawSocketWrite, I_OnRawSocketRead, I_OnChangeLocalUserGECOS, I_OnUserRegister,
  I_OnOperCompare, I_OnChannelDelete, I_OnPostOper, I_OnSyncOtherMetaData,
  I_OnSetAway, I_OnCancelAway, I_OnUserList, I_OnPostCommand,
  I_OnPostJoin, I_OnWhoisLine, I_OnBuildExemptList, I_OnRawSocketConnect,
  I_OnGarbageCollect, I_OnBufferFlushed
}
 Implementation-specific flags which may be set in Module::Implements(). More...


Define Documentation

#define API_VERSION   (NATIVE_API_VERSION * 1)
 

Definition at line 88 of file modules.h.

Referenced by ModuleSpanningTree::GetVersion(), ModuleZLib::GetVersion(), ModuleXMLSocket::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(), ModuleShowwhois::GetVersion(), ModuleSHA256::GetVersion(), ModuleSetName::GetVersion(), ModuleSetIdle::GetVersion(), ModuleSetIdent::GetVersion(), ModuleSetHost::GetVersion(), ModuleServicesAccount::GetVersion(), ModuleServices::GetVersion(), ModuleSeeNicks::GetVersion(), ModuleSecureList::GetVersion(), ModuleSaquit::GetVersion(), ModuleSapart::GetVersion(), ModuleSanick::GetVersion(), ModuleSaMode::GetVersion(), ModuleSajoin::GetVersion(), ModuleSafeList::GetVersion(), ModuleRestrictMsg::GetVersion(), ModuleRestrictChans::GetVersion(), ModuleRestrictBanned::GetVersion(), ModuleRemove::GetVersion(), ModuleRegOnlyCreate::GetVersion(), ModuleRedirect::GetVersion(), ModuleRandQuote::GetVersion(), ModulePgSQL::GetVersion(), ModuleOverride::GetVersion(), ModuleOpermotd::GetVersion(), ModuleModesOnOper::GetVersion(), ModuleOperLog::GetVersion(), ModuleOperLevels::GetVersion(), ModuleOperjoin::GetVersion(), ModuleOperChans::GetVersion(), ModuleOperHash::GetVersion(), ModuleNoNotice::GetVersion(), ModuleNoNickChange::GetVersion(), ModuleNoKicks::GetVersion(), ModuleNoInvite::GetVersion(), ModuleNoCTCP::GetVersion(), ModuleNickLock::GetVersion(), ModuleNickFlood::GetVersion(), ModuleNamesX::GetVersion(), ModuleSQL::GetVersion(), ModuleMsgFlood::GetVersion(), ModuleMD5::GetVersion(), ModuleLockserv::GetVersion(), ModuleLDAPAuth::GetVersion(), ModuleKnock::GetVersion(), ModuleKickNoRejoin::GetVersion(), ModuleJumpServer::GetVersion(), ModuleJoinFlood::GetVersion(), ModuleInviteException::GetVersion(), ModuleInvisible::GetVersion(), ModuleIdent::GetVersion(), ModuleHttpStats::GetVersion(), ModuleHttpServer::GetVersion(), ModuleHostChange::GetVersion(), ModuleHideOper::GetVersion(), ModuleHideChans::GetVersion(), ModuleHelpop::GetVersion(), ModuleGlobops::GetVersion(), ModuleGlobalLoad::GetVersion(), ModuleFoobar::GetVersion(), FilterBase::GetVersion(), ModuleDNSBL::GetVersion(), ModuleDeVoice::GetVersion(), ModuleDenyChannels::GetVersion(), ModuleDeaf::GetVersion(), ModuleDCCAllow::GetVersion(), ModuleCycle::GetVersion(), ModuleCustomTitle::GetVersion(), ModuleConnFlood::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(), ModuleChanFilter::GetVersion(), ModuleChanCreate::GetVersion(), ModuleCgiIRC::GetVersion(), ModuleCensor::GetVersion(), ModuleCBan::GetVersion(), ModuleBotMode::GetVersion(), ModuleBlockColour::GetVersion(), ModuleBlockCAPS::GetVersion(), ModuleBlockAmsg::GetVersion(), ModuleBanRedirect::GetVersion(), ModuleBanException::GetVersion(), ModuleAuditorium::GetVersion(), ModuleAntiBottler::GetVersion(), ModuleAntiBear::GetVersion(), Modulealltime::GetVersion(), ModuleAlias::GetVersion(), and InspIRCd::LoadModule().

#define CONF_FILE_NOT_FOUND   0x000200
 

Definition at line 1442 of file modules.h.

Referenced by ConfigReader::ConfigReader().

#define CONF_NOT_A_NUMBER   0x000010
 

Definition at line 1439 of file modules.h.

#define CONF_NOT_UNSIGNED   0x000080
 

Definition at line 1440 of file modules.h.

Referenced by ConfigReader::ReadInteger().

#define CONF_VALUE_NOT_FOUND   0x000100
 

Definition at line 1441 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 211 of file modules.h.

Referenced by userrec::FlushWriteBuf(), chanrec::ForceChan(), TreeSocket::ForceJoin(), TreeSocket::ForceMode(), cmd_samode::Handle(), cmd_devoice::Handle(), TreeSocket::IntroduceClient(), ModuleTimedBans::OnBackgroundTimer(), ModuleBanRedirect::OnCleanup(), TreeSocket::ProcessLine(), InspIRCd::ProcessUser(), ListModeBase::RemoveMode(), ModeHandler::RemoveMode(), FounderProtectBase::RemoveMode(), and chanrec::SetDefaultModes().

#define FOREACH_MOD y,
 ) 
 

Value:

if (ServerInstance->Config->global_implementation[y] > 0) { \
        for (int _i = 0; _i <= ServerInstance->GetModuleCount(); _i++) { \
        if (ServerInstance->Config->implement_lists[_i][y]) \
                try \
                { \
                        ServerInstance->modules[_i]->x ; \
                } \
                catch (CoreException& modexcept) \
                { \
                        ServerInstance->Log(DEFAULT,"Exception cought: %s",modexcept.GetReason()); \
                } \
        } \
  }
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 123 of file modules.h.

Referenced by userrec::ChangeDisplayedHost(), userrec::ChangeName(), do_whois(), SpanningTreeUtilities::DoOneToAllButSenderRaw(), userrec::FlushWriteBuf(), userrec::FullConnect(), cmd_taxonomy::Handle(), cmd_zline::Handle(), cmd_wallops::Handle(), cmd_topic::Handle(), cmd_rehash::Handle(), cmd_qline::Handle(), cmd_privmsg::Handle(), cmd_notice::Handle(), cmd_nick::Handle(), cmd_kline::Handle(), cmd_kill::Handle(), cmd_invite::Handle(), cmd_info::Handle(), cmd_gline::Handle(), cmd_eline::Handle(), cmd_away::Handle(), chanrec::KickUser(), DNSBLResolver::OnLookupComplete(), FilterBase::OnPreCommand(), ModuleAntiBear::OnPreCommand(), FilterBase::OnUserPreNotice(), userrec::Oper(), chanrec::PartUser(), ModeParser::Process(), CommandParser::ProcessCommand(), userrec::PurgeEmptyChannels(), Event::Send(), and chanrec::ServerKickUser().

#define FOREACH_MOD_I z,
y,
 ) 
 

Value:

if (z->Config->global_implementation[y] > 0) { \
        for (int _i = 0; _i <= z->GetModuleCount(); _i++) { \
                if (z->Config->implement_lists[_i][y]) \
                try \
                { \
                        z->modules[_i]->x ; \
                } \
                catch (CoreException& modexcept) \
                { \
                        z->Log(DEFAULT,"Exception cought: %s",modexcept.GetReason()); \
                } \
        } \
}
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 143 of file modules.h.

Referenced by CullList::Apply(), InspIRCd::BuildISupport(), TreeSocket::DoBurst(), InspIRCd::DoOneIteration(), chanrec::ForceChan(), InspIRCd::GetServerDescription(), TreeSocket::IntroduceClient(), InspIRCd::LoadModule(), TreeSocket::MetaData(), InspIRCd::Rehash(), TreeSocket::RemoteRehash(), TreeSocket::SendChannelModes(), TreeSocket::SendUsers(), and InspIRCd::UnloadModule().

#define FOREACH_RESULT y,
 ) 
 

Value:

{ if (ServerInstance->Config->global_implementation[y] > 0) { \
                        MOD_RESULT = 0; \
                        for (int _i = 0; _i <= ServerInstance->GetModuleCount(); _i++) { \
                        if (ServerInstance->Config->implement_lists[_i][y]) { \
                                try \
                                { \
                                        int res = ServerInstance->modules[_i]->x ; \
                                        if (res != 0) { \
                                                MOD_RESULT = res; \
                                                break; \
                                        } \
                                } \
                                catch (CoreException& modexcept) \
                                { \
                                        ServerInstance->Log(DEFAULT,"Exception cought: %s",modexcept.GetReason()); \
                                } \
                        } \
                } \
        } \
 }
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 161 of file modules.h.

Referenced by userrec::ChangeDisplayedHost(), userrec::ChangeName(), DoStats(), userrec::ForceNickChange(), userrec::FullConnect(), cmd_user::Handle(), cmd_topic::Handle(), cmd_privmsg::Handle(), cmd_notice::Handle(), cmd_nick::Handle(), cmd_kill::Handle(), cmd_invite::Handle(), chanrec::IsBanned(), chanrec::KickUser(), ModeParser::Process(), CommandParser::ProcessCommand(), and chanrec::UserList().

#define FOREACH_RESULT_I z,
y,
 ) 
 

Value:

{ if (z->Config->global_implementation[y] > 0) { \
                        MOD_RESULT = 0; \
                        for (int _i = 0; _i <= z->GetModuleCount(); _i++) { \
                        if (z->Config->implement_lists[_i][y]) { \
                                try \
                                { \
                                        int res = z->modules[_i]->x ; \
                                        if (res != 0) { \
                                                MOD_RESULT = res; \
                                                break; \
                                        } \
                                } \
                                catch (CoreException& modexcept) \
                                { \
                                        z->Log(DEBUG,"Exception cought: %s",modexcept.GetReason()); \
                                } \
                        } \
                } \
        } \
}
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 187 of file modules.h.

Referenced by chanrec::JoinUser(), InspIRCd::OperPassCompare(), and InspIRCd::SendWhoisLine().

#define IS_AWAY  )     (*x->awaymsg)
 

Is away.

Definition at line 228 of file modules.h.

Referenced by do_whois(), cmd_userip::Handle(), cmd_check::Handle(), cmd_userhost::Handle(), cmd_privmsg::Handle(), and cmd_who::SendWhoLine().

#define IS_LOCAL  )     ((x->GetFd() > -1) && (x->GetFd() <= MAX_DESCRIPTORS))
 

Is a local user.

Definition at line 219 of file modules.h.

Referenced by CullList::Apply(), CommandParser::CallHandler(), userrec::ChangeDisplayedHost(), userrec::ChangeName(), ModuleRestrictBanned::CheckRestricted(), DoStats(), chanrec::ForceChan(), TreeSocket::ForceNick(), cmd_rsquit::Handle(), cmd_rconnect::Handle(), cmd_sapart::Handle(), cmd_sajoin::Handle(), RemoveBase::Handle(), cmd_cycle::Handle(), cmd_title::Handle(), cmd_chgname::Handle(), cmd_check::Handle(), cmd_alltime::Handle(), cmd_whois::Handle(), cmd_topic::Handle(), cmd_stats::Handle(), cmd_quit::Handle(), cmd_privmsg::Handle(), cmd_notice::Handle(), cmd_nick::Handle(), cmd_kill::Handle(), cmd_kick::Handle(), cmd_invite::Handle(), ModuleSpanningTree::HandleRemoteWhois(), ModuleSpanningTree::HandleSquit(), ModuleSpanningTree::HandleTime(), userrec::HasPermission(), chanrec::JoinUser(), chanrec::KickUser(), cmd_rsquit::NoticeUser(), ModuleSilence::OnBuildExemptList(), ModuleDeaf::OnBuildExemptList(), ModuleSpanningTree::OnCancelAway(), ModuleSSLOpenSSL::OnCleanup(), ModuleSpanningTree::OnLine(), ModuleSpanningTree::OnMode(), SSLMode::OnModeChange(), Redirect::OnModeChange(), InvisibleMode::OnModeChange(), CloakUser::OnModeChange(), ChanProtect::OnModeChange(), ChanFounder::OnModeChange(), AuditoriumMode::OnModeChange(), ModuleSpanningTree::OnOper(), ModuleSSLOpenSSL::OnPostConnect(), ModuleSSLGnuTLS::OnPostConnect(), ModuleConnJoin::OnPostConnect(), ModuleOperjoin::OnPostOper(), ModuleOperLog::OnPreCommand(), FilterBase::OnPreCommand(), ModuleBlockAmsg::OnPreCommand(), ModuleSpanningTree::OnRemoteKill(), ModuleSpanningTree::OnSetAway(), ModuleSpanningTree::OnUserConnect(), ModuleModesOnConnect::OnUserConnect(), ModuleSpanningTree::OnUserInvite(), ModuleSpanningTree::OnUserJoin(), ModuleSpanningTree::OnUserKick(), ModuleSpanningTree::OnUserMessage(), ModuleSpanningTree::OnUserNotice(), ModuleSpanningTree::OnUserPart(), ModuleSpanningTree::OnUserPostNick(), ModuleSeeNicks::OnUserPostNick(), ModuleNoInvite::OnUserPreInvite(), ModuleServicesAccount::OnUserPreJoin(), ModuleServices::OnUserPreJoin(), ModuleRestrictChans::OnUserPreJoin(), ModuleStripColor::OnUserPreMessage(), ModuleServicesAccount::OnUserPreMessage(), ModuleServices::OnUserPreMessage(), ModuleRestrictMsg::OnUserPreMessage(), ModuleCensor::OnUserPreMessage(), ModuleBlockColour::OnUserPreMessage(), ModuleBlockCAPS::OnUserPreMessage(), ModuleRestrictBanned::OnUserPreNick(), ModuleNoNickChange::OnUserPreNick(), ModuleSilence::OnUserPreNotice(), ModuleNoNotice::OnUserPreNotice(), ModuleNoCTCP::OnUserPreNotice(), ModuleInvisible::OnUserPreNotice(), FilterBase::OnUserPreNotice(), ModuleDCCAllow::OnUserPreNotice(), ModuleSpanningTree::OnUserQuit(), ModuleDNSBL::OnUserRegister(), ModuleSpanningTree::OnWallops(), ModuleSSLOpenSSL::OnWhois(), ModuleSSLGnuTLS::OnWhois(), ModuleShowwhois::OnWhois(), ModuleSilence::PreText(), ModeParser::Process(), ModuleMsgFlood::ProcessMessages(), ModuleChanFilter::ProcessMessages(), TreeSocket::Push(), TreeServer::QuitUsers(), userrec::ReadData(), ModuleSpanningTree::RemoteMessage(), chanrec::ServerKickUser(), TreeSocket::ServiceJoin(), TreeSocket::ServicePart(), TreeSocket::Time(), chanrec::UserList(), TreeSocket::Whois(), cmd_who::whomatch(), chanrec::WriteAllExcept(), chanrec::WriteChannel(), chanrec::WriteChannelWithServ(), userrec::WriteCommon(), userrec::WriteCommonExcept(), ModuleInvisible::WriteCommonFrom(), userrec::WriteCommonQuit(), InspIRCd::WriteOpers(), and SnomaskManager::WriteToSnoMask().

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

Is a module created user.

Definition at line 224 of file modules.h.

#define IS_OPER  )     (*x->oper)
 

Is an oper.

Definition at line 226 of file modules.h.

Referenced by FilterBase::AppliesToMe(), cmd_who::CanView(), userrec::ChannelList(), ModeParser::DisplayCurrentModes(), do_whois(), DoStats(), cmd_userip::Handle(), cmd_jumpserver::Handle(), cmd_check::Handle(), cmd_whowas::Handle(), cmd_who::Handle(), cmd_userhost::Handle(), cmd_trace::Handle(), cmd_privmsg::Handle(), cmd_notice::Handle(), cmd_modules::Handle(), userrec::HasPermission(), chanrec::JoinUser(), ModuleOverride::OnAccessCheck(), ModuleOperLevels::OnKill(), InvisibleMode::OnModeChange(), ModuleSecureList::OnPreCommand(), ModuleOperLog::OnPreCommand(), ModuleAlias::OnPreCommand(), ModuleRestrictChans::OnUserPreJoin(), ModuleRegOnlyCreate::OnUserPreJoin(), ModuleOverride::OnUserPreJoin(), ModuleOperChans::OnUserPreJoin(), ModuleDenyChannels::OnUserPreJoin(), ModuleOverride::OnUserPreKick(), ModuleRestrictMsg::OnUserPreMessage(), ModulePrivacyMode::OnUserPreMessage(), ModuleHideOper::OnWhoisLine(), ModuleHideChans::OnWhoisLine(), TreeSocket::OperType(), ModeParser::Process(), CommandParser::ProcessCommand(), cmd_who::SendWhoLine(), ModuleSpanningTree::ShowLinks(), ModuleSpanningTree::ShowMap(), userrec::UnOper(), QuietOper::VisibleTo(), ModuleInvisible::WriteCommonFrom(), and userrec::WriteCommonQuit().

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

Is a remote user.

Definition at line 222 of file modules.h.

#define MODULE_INIT  ) 
 

Value:

class Factory : public ModuleFactory \
        { \
         public: \
                virtual Module * CreateModule(InspIRCd* Me) \
                { \
                        return new y(Me); \
                } \
        }; \
        extern "C" DllExport void * init_module(void) \
        { \
                return new Factory; \
        }
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 1681 of file modules.h.

#define NATIVE_API_VERSION   11025
 

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 84 of file modules.h.


Typedef Documentation

typedef std::vector<ircd_module*> FactoryList
 

A list of loaded ModuleFactories.

Definition at line 1675 of file modules.h.

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

Holds a list of 'published features' for modules.

Definition at line 108 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 95 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 116 of file modules.h.

typedef DLLFactory<ModuleFactory> ircd_module
 

A DLLFactory (designed to load shared objects) containing a ModuleFactory.

Definition at line 1667 of file modules.h.

typedef std::vector<Module*> ModuleList
 

A list of loaded Modules.

Definition at line 1671 of file modules.h.

typedef std::deque<Module*> modulelist
 

Holds a list of modules which implement an interface.

Definition at line 112 of file modules.h.

typedef file_cache string_list
 

A set of strings.

Definition at line 104 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 19 of file modules.h.

00019                        {
00020         ACR_DEFAULT,            // Do default action (act as if the module isnt even loaded)
00021         ACR_DENY,               // deny the action
00022         ACR_ALLOW,              // allow the action
00023         AC_KICK,                // a user is being kicked
00024         AC_DEOP,                // a user is being deopped
00025         AC_OP,                  // a user is being opped
00026         AC_VOICE,               // a user is being voiced
00027         AC_DEVOICE,             // a user is being devoiced
00028         AC_HALFOP,              // a user is being halfopped
00029         AC_DEHALFOP,            // a user is being dehalfopped
00030         AC_INVITE,              // a user is being invited
00031         AC_GENERAL_MODE         // a channel mode is being changed
00032 };

enum Implementation
 

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

Enumerator:
I_OnUserConnect 
I_OnUserQuit 
I_OnUserDisconnect 
I_OnUserJoin 
I_OnUserPart 
I_OnRehash 
I_OnServerRaw 
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_OnAddGLine 
I_OnAddZLine 
I_OnAddQLine 
I_OnAddKLine 
I_OnAddELine 
I_OnDelGLine 
I_OnDelZLine 
I_OnDelKLine 
I_OnDelELine 
I_OnDelQLine 
I_OnCleanup 
I_OnUserPostNick 
I_OnAccessCheck 
I_On005Numeric 
I_OnKill 
I_OnRemoteKill 
I_OnLoadModule 
I_OnUnloadModule 
I_OnBackgroundTimer 
I_OnPreCommand 
I_OnCheckReady 
I_OnUserRrgister 
I_OnCheckInvite 
I_OnCheckKey 
I_OnCheckLimit 
I_OnCheckBan 
I_OnStats 
I_OnChangeLocalUserHost 
I_OnChangeLocalUserGecos 
I_OnLocalTopicChange 
I_OnPostLocalTopicChange 
I_OnEvent 
I_OnRequest 
I_OnOperCompre 
I_OnGlobalOper 
I_OnPostConnect 
I_OnAddBan 
I_OnDelBan 
I_OnRawSocketAccept 
I_OnRawSocketClose 
I_OnRawSocketWrite 
I_OnRawSocketRead 
I_OnChangeLocalUserGECOS 
I_OnUserRegister 
I_OnOperCompare 
I_OnChannelDelete 
I_OnPostOper 
I_OnSyncOtherMetaData 
I_OnSetAway 
I_OnCancelAway 
I_OnUserList 
I_OnPostCommand 
I_OnPostJoin 
I_OnWhoisLine 
I_OnBuildExemptList 
I_OnRawSocketConnect 
I_OnGarbageCollect 
I_OnBufferFlushed 

Definition at line 432 of file modules.h.

00432                     {   I_OnUserConnect, I_OnUserQuit, I_OnUserDisconnect, I_OnUserJoin, I_OnUserPart, I_OnRehash, I_OnServerRaw, 
00433                         I_OnUserPreJoin, I_OnUserPreKick, I_OnUserKick, I_OnOper, I_OnInfo, I_OnWhois, I_OnUserPreInvite,
00434                         I_OnUserInvite, I_OnUserPreMessage, I_OnUserPreNotice, I_OnUserPreNick, I_OnUserMessage, I_OnUserNotice, I_OnMode,
00435                         I_OnGetServerDescription, I_OnSyncUser, I_OnSyncChannel, I_OnSyncChannelMetaData, I_OnSyncUserMetaData,
00436                         I_OnDecodeMetaData, I_ProtoSendMode, I_ProtoSendMetaData, I_OnWallops, I_OnChangeHost, I_OnChangeName, I_OnAddGLine,
00437                         I_OnAddZLine, I_OnAddQLine, I_OnAddKLine, I_OnAddELine, I_OnDelGLine, I_OnDelZLine, I_OnDelKLine, I_OnDelELine, I_OnDelQLine,
00438                         I_OnCleanup, I_OnUserPostNick, I_OnAccessCheck, I_On005Numeric, I_OnKill, I_OnRemoteKill, I_OnLoadModule, I_OnUnloadModule,
00439                         I_OnBackgroundTimer, I_OnPreCommand, I_OnCheckReady, I_OnUserRrgister, I_OnCheckInvite,
00440                         I_OnCheckKey, I_OnCheckLimit, I_OnCheckBan, I_OnStats, I_OnChangeLocalUserHost, I_OnChangeLocalUserGecos, I_OnLocalTopicChange,
00441                         I_OnPostLocalTopicChange, I_OnEvent, I_OnRequest, I_OnOperCompre, I_OnGlobalOper, I_OnPostConnect, I_OnAddBan, I_OnDelBan,
00442                         I_OnRawSocketAccept, I_OnRawSocketClose, I_OnRawSocketWrite, I_OnRawSocketRead, I_OnChangeLocalUserGECOS, I_OnUserRegister,
00443                         I_OnOperCompare, I_OnChannelDelete, I_OnPostOper, I_OnSyncOtherMetaData, I_OnSetAway, I_OnCancelAway, I_OnUserList,
00444                         I_OnPostCommand, I_OnPostJoin, I_OnWhoisLine, I_OnBuildExemptList, I_OnRawSocketConnect, I_OnGarbageCollect, I_OnBufferFlushed };

enum MessageType
 

Used to represent wether a message was PRIVMSG or NOTICE.

Enumerator:
MSG_PRIVMSG 
MSG_NOTICE 

Definition at line 61 of file modules.h.

00061                  {
00062         MSG_PRIVMSG = 0,
00063         MSG_NOTICE = 1
00064 };

enum ModuleFlags
 

Used to define a set of behavior bits for a module.

Enumerator:
VF_STATIC 
VF_VENDOR 
VF_SERVICEPROVIDER 
VF_COMMON 

Definition at line 36 of file modules.h.

00036                  {
00037         VF_STATIC = 1,          // module is static, cannot be /unloadmodule'd
00038         VF_VENDOR = 2,          // module is a vendor module (came in the original tarball, not 3rd party)
00039         VF_SERVICEPROVIDER = 4, // module provides a service to other modules (can be a dependency)
00040         VF_COMMON = 8           // module needs to be common on all servers in a network to link
00041 };

enum Priority
 

Priority types which can be returned from Module::Prioritize().

Enumerator:
PRIORITY_FIRST 
PRIORITY_DONTCARE 
PRIORITY_LAST 
PRIORITY_BEFORE 
PRIORITY_AFTER 

Definition at line 428 of file modules.h.

enum TargetTypeFlags
 

Used to represent an event type, for user, channel or server.

Enumerator:
TYPE_USER 
TYPE_CHANNEL 
TYPE_SERVER 
TYPE_OTHER 

Definition at line 52 of file modules.h.

00052                      {
00053         TYPE_USER = 1,
00054         TYPE_CHANNEL,
00055         TYPE_SERVER,
00056         TYPE_OTHER
00057 };

enum WriteModeFlags
 

Used with SendToMode().

Enumerator:
WM_AND 
WM_OR 

Definition at line 45 of file modules.h.

00045                     {
00046         WM_AND = 1,
00047         WM_OR = 2
00048 };