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

ModuleConnFlood Class Reference

Inheritance diagram for ModuleConnFlood:

Inheritance graph
[legend]
Collaboration diagram for ModuleConnFlood:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ModuleConnFlood (InspIRCd *Me)
virtual ~ModuleConnFlood ()
virtual Version GetVersion ()
 Returns the version number of a Module.
void InitConf ()
virtual int OnUserRegister (User *user)
 Called whenever a user is about to register their connection (e.g.
virtual void OnRehash (User *user, const std::string &parameter)
 Called on rehash.

Private Attributes

int seconds
int maxconns
int timeout
int boot_wait
time_t first
std::string quitmsg
ConfigReaderconf

Detailed Description

Definition at line 20 of file m_connflood.cpp.


Constructor & Destructor Documentation

ModuleConnFlood::ModuleConnFlood InspIRCd Me  )  [inline]
 

Definition at line 31 of file m_connflood.cpp.

References ModuleManager::Attach(), I_OnRehash, I_OnUserRegister, InitConf(), InspIRCd::Modules, and Module::ServerInstance.

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

Definition at line 39 of file m_connflood.cpp.


Member Function Documentation

virtual Version ModuleConnFlood::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 43 of file m_connflood.cpp.

References API_VERSION, and VF_VENDOR.

void ModuleConnFlood::InitConf  )  [inline]
 

Definition at line 48 of file m_connflood.cpp.

References boot_wait, conf, first, maxconns, quitmsg, ConfigReader::ReadInteger(), ConfigReader::ReadValue(), seconds, Module::ServerInstance, InspIRCd::Time(), and timeout.

Referenced by ModuleConnFlood(), and OnRehash().

virtual void ModuleConnFlood::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 109 of file m_connflood.cpp.

References InitConf().

virtual int ModuleConnFlood::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 64 of file m_connflood.cpp.

References boot_wait, conns, first, maxconns, quitmsg, UserManager::QuitUser(), seconds, Module::ServerInstance, InspIRCd::SNO, InspIRCd::startup_time, throttled, InspIRCd::Time(), timeout, InspIRCd::Users, and SnomaskManager::WriteToSnoMask().


Member Data Documentation

int ModuleConnFlood::boot_wait [private]
 

Definition at line 23 of file m_connflood.cpp.

Referenced by InitConf(), and OnUserRegister().

ConfigReader* ModuleConnFlood::conf [private]
 

Definition at line 27 of file m_connflood.cpp.

Referenced by InitConf().

time_t ModuleConnFlood::first [private]
 

Definition at line 24 of file m_connflood.cpp.

Referenced by InitConf(), and OnUserRegister().

int ModuleConnFlood::maxconns [private]
 

Definition at line 23 of file m_connflood.cpp.

Referenced by InitConf(), and OnUserRegister().

std::string ModuleConnFlood::quitmsg [private]
 

Definition at line 25 of file m_connflood.cpp.

Referenced by InitConf(), and OnUserRegister().

int ModuleConnFlood::seconds [private]
 

Definition at line 23 of file m_connflood.cpp.

Referenced by InitConf(), and OnUserRegister().

int ModuleConnFlood::timeout [private]
 

Definition at line 23 of file m_connflood.cpp.

Referenced by InitConf(), and OnUserRegister().


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