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

ModuleGeoIP Class Reference

Inheritance diagram for ModuleGeoIP:

Inheritance graph
[legend]
Collaboration diagram for ModuleGeoIP:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ModuleGeoIP (InspIRCd *Me)
virtual ~ModuleGeoIP ()
virtual Version GetVersion ()
 Returns the version number of a Module.
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.

Private Attributes

GeoIP * gi
bool banunknown
std::map< std::string, std::stringGeoBans

Detailed Description

Definition at line 22 of file m_geoip.cpp.


Constructor & Destructor Documentation

ModuleGeoIP::ModuleGeoIP InspIRCd Me  )  [inline]
 

Definition at line 32 of file m_geoip.cpp.

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

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

Definition at line 41 of file m_geoip.cpp.


Member Function Documentation

virtual Version ModuleGeoIP::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 45 of file m_geoip.cpp.

References API_VERSION, and VF_VENDOR.

virtual void ModuleGeoIP::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 50 of file m_geoip.cpp.

References banunknown, conf, ConfigReader::Enumerate(), GeoBans, ConfigReader::ReadFlag(), ConfigReader::ReadValue(), and Module::ServerInstance.

Referenced by ModuleGeoIP().

virtual int ModuleGeoIP::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 66 of file m_geoip.cpp.

References banunknown, GeoBans, User::GetIPString(), gi, IS_LOCAL, UserManager::QuitUser(), Module::ServerInstance, and InspIRCd::Users.


Member Data Documentation

bool ModuleGeoIP::banunknown [private]
 

Definition at line 26 of file m_geoip.cpp.

Referenced by OnRehash(), and OnUserRegister().

std::map<std::string, std::string> ModuleGeoIP::GeoBans [private]
 

Definition at line 28 of file m_geoip.cpp.

Referenced by OnRehash(), and OnUserRegister().

GeoIP* ModuleGeoIP::gi [private]
 

Definition at line 24 of file m_geoip.cpp.

Referenced by ModuleGeoIP(), and OnUserRegister().


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