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

ModuleCloaking Class Reference

Inheritance diagram for ModuleCloaking:

Inheritance graph
[legend]
Collaboration diagram for ModuleCloaking:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ModuleCloaking (InspIRCd *Me)
void OnSyncUserMetaData (User *user, Module *proto, void *opaque, const std::string &extname, bool displayable)
void CloakExistingUsers ()
virtual int OnCheckBan (User *user, Channel *chan)
 Called whenever a user joins a channel, to determine if banlist checks should go ahead or not.
void Prioritize ()
virtual void OnUserDisconnect (User *user)
 Called whenever a user's socket is closed.
virtual void OnCleanup (int target_type, void *item)
 Called before your module is unloaded to clean up Extensibles.
virtual ~ModuleCloaking ()
virtual Version GetVersion ()
 Returns the version number of a Module.
virtual void OnRehash (User *user, const std::string &parameter)
 Called on rehash.
virtual void OnUserConnect (User *dest)

Private Attributes

CloakUsercu
ModuleHashModule

Detailed Description

Definition at line 250 of file m_cloaking.cpp.


Constructor & Destructor Documentation

ModuleCloaking::ModuleCloaking InspIRCd Me  )  [inline]
 

Definition at line 258 of file m_cloaking.cpp.

References ModeParser::AddMode(), ModuleManager::Attach(), CloakExistingUsers(), cu, ModuleManager::Find(), HashModule, I_OnCheckBan, I_OnCleanup, I_OnRehash, I_OnSyncUserMetaData, I_OnUserConnect, I_OnUserDisconnect, InspIRCd::Modes, InspIRCd::Modules, OnRehash(), Module::ServerInstance, and ModuleManager::UseInterface().

virtual ModuleCloaking::~ModuleCloaking  )  [inline, virtual]
 

Definition at line 358 of file m_cloaking.cpp.

References cu, ModeParser::DelMode(), ModuleManager::DoneWithInterface(), InspIRCd::Modes, InspIRCd::Modules, and Module::ServerInstance.


Member Function Documentation

void ModuleCloaking::CloakExistingUsers  )  [inline]
 

Definition at line 303 of file m_cloaking.cpp.

References UserManager::local_users, OnUserConnect(), Module::ServerInstance, and InspIRCd::Users.

Referenced by ModuleCloaking().

virtual Version ModuleCloaking::GetVersion  )  [inline, virtual]
 

Returns the version number of a Module.

The method should return a Version object with its version information assigned via Version::Version

Reimplemented from Module.

Definition at line 365 of file m_cloaking.cpp.

References API_VERSION, VF_COMMON, and VF_VENDOR.

virtual int ModuleCloaking::OnCheckBan User user,
Channel chan
[inline, virtual]
 

Called whenever a user joins a channel, to determine if banlist checks should go ahead or not.

This method will always be called for each join, wether or not the user actually matches a channel ban, and determines the outcome of an if statement around the whole section of ban checking code. return 1 to explicitly allow the join to go ahead or 0 to ignore the event.

Parameters:
user The user joining the channel
chan The channel being joined
Returns:
1 to explicitly allow the join, 0 to proceed as normal. Return -1 to explicitly deny the join to the channel.

Reimplemented from Module.

Definition at line 315 of file m_cloaking.cpp.

References Channel::bans, User::dhost, Extensible::GetExt(), User::ident, InspIRCd::Match(), MAXBUF, and User::nick.

virtual void ModuleCloaking::OnCleanup int  target_type,
void *  item
[inline, virtual]
 

Called before your module is unloaded to clean up Extensibles.

This method is called once for every user and channel on the network, so that when your module unloads it may clear up any remaining data in the form of Extensibles added using Extensible::Extend(). If the target_type variable is TYPE_USER, then void* item refers to a User*, otherwise it refers to a Channel*.

Parameters:
target_type The type of item being cleaned
item A pointer to the item's class

Reimplemented from Module.

Definition at line 352 of file m_cloaking.cpp.

References OnUserDisconnect(), and TYPE_USER.

virtual void ModuleCloaking::OnRehash User user,
const std::string parameter
[inline, virtual]
 

Called on rehash.

This method is called prior to a /REHASH or when a SIGHUP is received from the operating system. You should use it to reload any files so that your module keeps in step with the rest of the application. If a parameter is given, the core has done nothing. The module receiving the event can decide if this parameter has any relevence to it.

Parameters:
user The user performing the rehash, if any -- if this is server initiated, the value of this variable will be NULL.
parameter The (optional) parameter given to REHASH from the user.

Reimplemented from Module.

Definition at line 372 of file m_cloaking.cpp.

References cu, and CloakUser::DoRehash().

Referenced by ModuleCloaking().

void ModuleCloaking::OnSyncUserMetaData User user,
Module proto,
void *  opaque,
const std::string extname,
bool  displayable
[inline, virtual]
 

Reimplemented from Module.

Definition at line 293 of file m_cloaking.cpp.

References Extensible::GetExt(), Module::ProtoSendMetaData(), and TYPE_USER.

virtual void ModuleCloaking::OnUserConnect User dest  )  [inline, virtual]
 

Reset the Hash module, and send it our IV and hex table

Reimplemented from Module.

Definition at line 377 of file m_cloaking.cpp.

References CloakUser::Cloak4(), CloakUser::Cloak6(), cu, Extensible::Extend(), Extensible::GetExt(), User::GetIPString(), User::GetProtocolFamily(), CloakUser::HashProvider, User::host, CloakUser::ipalways, CloakUser::key1, CloakUser::key2, CloakUser::key3, CloakUser::key4, CloakUser::LastTwoDomainParts(), CloakUser::prefix, and CloakUser::xtab.

Referenced by CloakExistingUsers().

virtual void ModuleCloaking::OnUserDisconnect User user  )  [inline, virtual]
 

Called whenever a user's socket is closed.

The details of the exiting user are available to you in the parameter User *user This event is called for all users, registered or not, as a cleanup method for modules which might assign resources to user, such as dns lookups, objects and sockets.

Parameters:
user The user who is disconnecting

Reimplemented from Module.

Definition at line 342 of file m_cloaking.cpp.

References Extensible::GetExt(), and Extensible::Shrink().

Referenced by OnCleanup().

void ModuleCloaking::Prioritize  )  [inline, virtual]
 

Reimplemented from Module.

Definition at line 332 of file m_cloaking.cpp.

References ModuleManager::Find(), I_OnCheckBan, I_OnUserConnect, InspIRCd::Modules, PRIO_AFTER, PRIO_LAST, Module::ServerInstance, and ModuleManager::SetPriority().


Member Data Documentation

CloakUser* ModuleCloaking::cu [private]
 

Definition at line 254 of file m_cloaking.cpp.

Referenced by ModuleCloaking(), OnRehash(), OnUserConnect(), and ~ModuleCloaking().

Module* ModuleCloaking::HashModule [private]
 

Definition at line 255 of file m_cloaking.cpp.

Referenced by ModuleCloaking().


The documentation for this class was generated from the following file: