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

ModuleIdent Class Reference

Inheritance diagram for ModuleIdent:

Inheritance graph
[legend]
Collaboration diagram for ModuleIdent:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ModuleIdent (InspIRCd *Me)
 ~ModuleIdent ()
virtual Version GetVersion ()
 Returns the version number of a Module.
virtual void OnRehash (User *user, const std::string &param)
 Called on rehash.
virtual int OnUserRegister (User *user)
 Called whenever a user is about to register their connection (e.g.
virtual bool OnCheckReady (User *user)
 Called to check if a user who is connecting can now be allowed to register If any modules return false for this function, the user is held in the waiting state until all modules return true.
virtual void OnCleanup (int target_type, void *item)
 Called before your module is unloaded to clean up Extensibles.
virtual void OnUserDisconnect (User *user)
 Called whenever a user's socket is closed.

Private Attributes

int RequestTimeout
ConfigReaderConf

Detailed Description

Definition at line 333 of file m_ident.cpp.


Constructor & Destructor Documentation

ModuleIdent::ModuleIdent InspIRCd Me  )  [inline]
 

Definition at line 339 of file m_ident.cpp.

References ModuleManager::Attach(), Conf, I_OnCheckReady, I_OnCleanup, I_OnRehash, I_OnUserDisconnect, I_OnUserRegister, InspIRCd::Modules, OnRehash(), and Module::ServerInstance.

ModuleIdent::~ModuleIdent  )  [inline]
 

Definition at line 347 of file m_ident.cpp.

References Conf.


Member Function Documentation

virtual Version ModuleIdent::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 352 of file m_ident.cpp.

References API_VERSION, and VF_VENDOR.

virtual bool ModuleIdent::OnCheckReady User user  )  [inline, virtual]
 

Called to check if a user who is connecting can now be allowed to register If any modules return false for this function, the user is held in the waiting state until all modules return true.

For example a module which implements ident lookups will continue to return false for a user until their ident lookup is completed. Note that the registration timeout for a user overrides these checks, if the registration timeout is reached, the user is disconnected even if modules report that the user is not ready to connect.

Parameters:
user The user to check
Returns:
true to indicate readiness, false if otherwise

Reimplemented from Module.

Definition at line 430 of file m_ident.cpp.

References classbase::age, InspIRCd::Config, DEBUG, Extensible::GetExt(), IdentRequestSocket::GetResult(), IdentRequestSocket::HasResult(), User::ident, ServerLimits::IdentMax, ServerConfig::Limits, LogManager::Log(), InspIRCd::Logs, OnUserDisconnect(), Module::ServerInstance, InspIRCd::Time(), and User::WriteServ().

virtual void ModuleIdent::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 481 of file m_ident.cpp.

References OnUserDisconnect(), and TYPE_USER.

virtual void ModuleIdent::OnRehash User user,
const std::string param
[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 357 of file m_ident.cpp.

References Conf, ConfigReader::ReadInteger(), and Module::ServerInstance.

Referenced by ModuleIdent().

virtual void ModuleIdent::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 488 of file m_ident.cpp.

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

Referenced by OnCheckReady(), and OnCleanup().

virtual int ModuleIdent::OnUserRegister User user  )  [inline, virtual]
 

Called whenever a user is about to register their connection (e.g.

before the user is sent the MOTD etc). Modules can use this method if they are performing a function which must be done before the actual connection is completed (e.g. ident lookups, dnsbl lookups, etc). Note that you should NOT delete the user record here by causing a disconnection! Use OnUserConnect for that instead.

Parameters:
user The user registering
Returns:
1 to indicate user quit, 0 to continue

Reimplemented from Module.

Definition at line 367 of file m_ident.cpp.

References Conf, InspIRCd::Config, DEBUG, Extensible::Extend(), EventHandler::GetFd(), User::GetIPString(), CoreException::GetReason(), User::host, User::ident, ServerLimits::IdentMax, ServerConfig::Limits, LogManager::Log(), InspIRCd::Logs, InspIRCd::Match(), InspIRCd::MatchCIDR(), ConfigReader::ReadFlag(), ConfigReader::ReadValue(), Module::ServerInstance, and User::WriteServ().


Member Data Documentation

ConfigReader* ModuleIdent::Conf [private]
 

Definition at line 337 of file m_ident.cpp.

Referenced by ModuleIdent(), OnRehash(), OnUserRegister(), and ~ModuleIdent().

int ModuleIdent::RequestTimeout [private]
 

Definition at line 336 of file m_ident.cpp.


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