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

ModuleDNSBL Class Reference

Inheritance diagram for ModuleDNSBL:

Inheritance graph
[legend]
Collaboration diagram for ModuleDNSBL:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ModuleDNSBL (InspIRCd *Me)
virtual ~ModuleDNSBL ()
virtual Version GetVersion ()
 Returns the version number of a Module.
void ClearEntries ()
 Clear entries and free the mem it was using.
virtual void ReadConf ()
 Fill our conf vector with data.
virtual void OnRehash (User *user, const std::string &parameter)
 Called on rehash.
virtual int OnUserRegister (User *user)
 Called whenever a user is about to register their connection (e.g.
virtual int OnStats (char symbol, User *user, string_list &results)
 Called on all /STATS commands This method is triggered for all /STATS use, including stats symbols handled by the core.

Private Member Functions

DNSBLConfEntry::EnumBanaction str2banaction (const std::string &action)

Private Attributes

std::vector< DNSBLConfEntry * > DNSBLConfEntries

Detailed Description

Definition at line 179 of file m_dnsbl.cpp.


Constructor & Destructor Documentation

ModuleDNSBL::ModuleDNSBL InspIRCd Me  )  [inline]
 

Definition at line 201 of file m_dnsbl.cpp.

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

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

Definition at line 208 of file m_dnsbl.cpp.

References ClearEntries().


Member Function Documentation

void ModuleDNSBL::ClearEntries  )  [inline]
 

Clear entries and free the mem it was using.

Definition at line 221 of file m_dnsbl.cpp.

References DNSBLConfEntries.

Referenced by ReadConf(), and ~ModuleDNSBL().

virtual Version ModuleDNSBL::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 213 of file m_dnsbl.cpp.

References API_VERSION, and VF_VENDOR.

virtual void ModuleDNSBL::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 300 of file m_dnsbl.cpp.

References ReadConf().

virtual int ModuleDNSBL::OnStats char  symbol,
User user,
string_list results
[inline, virtual]
 

Called on all /STATS commands This method is triggered for all /STATS use, including stats symbols handled by the core.

Parameters:
symbol the symbol provided to /STATS
user the user issuing the /STATS command
results A string_list to append results into. You should put all your results into this string_list, rather than displaying them directly, so that your handler will work when remote STATS queries are received.
Returns:
1 to block the /STATS from being processed by the core, 0 to allow it

Reimplemented from Module.

Definition at line 347 of file m_dnsbl.cpp.

References InspIRCd::Config, ConvToStr(), DNSBLConfEntries, User::nick, Module::ServerInstance, and ServerConfig::ServerName.

virtual int ModuleDNSBL::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 305 of file m_dnsbl.cpp.

References InspIRCd::AddResolver(), DNSBLConfEntries, EventHandler::GetFd(), User::GetIPString(), IS_LOCAL, and Module::ServerInstance.

virtual void ModuleDNSBL::ReadConf  )  [inline, virtual]
 

Fill our conf vector with data.

Definition at line 230 of file m_dnsbl.cpp.

References DNSBLConfEntry::A_BITMASK, DNSBLConfEntry::A_RECORD, DNSBLConfEntry::banaction, DNSBLConfEntry::bitmask, ClearEntries(), DNSBLConfEntries, DNSBLConfEntry::domain, InspIRCd::Duration(), DNSBLConfEntry::duration, irc::portparser::GetToken(), DNSBLConfEntry::I_UNKNOWN, DNSBLConfEntry::name, ConfigReader::ReadInteger(), ConfigReader::ReadValue(), DNSBLConfEntry::reason, DNSBLConfEntry::records, Module::ServerInstance, InspIRCd::SNO, str2banaction(), DNSBLConfEntry::type, and SnomaskManager::WriteToSnoMask().

Referenced by ModuleDNSBL(), and OnRehash().

DNSBLConfEntry::EnumBanaction ModuleDNSBL::str2banaction const std::string action  )  [inline, private]
 

Definition at line 187 of file m_dnsbl.cpp.

References DNSBLConfEntry::I_GLINE, DNSBLConfEntry::I_KILL, DNSBLConfEntry::I_KLINE, DNSBLConfEntry::I_UNKNOWN, and DNSBLConfEntry::I_ZLINE.

Referenced by ReadConf().


Member Data Documentation

std::vector<DNSBLConfEntry *> ModuleDNSBL::DNSBLConfEntries [private]
 

Definition at line 182 of file m_dnsbl.cpp.

Referenced by ClearEntries(), OnStats(), OnUserRegister(), and ReadConf().


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