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

BanCacheManager Class Reference

#include <bancache.h>

Inheritance diagram for BanCacheManager:

Inheritance graph
[legend]
Collaboration diagram for BanCacheManager:

Collaboration graph
[legend]
List of all members.

Public Member Functions

BanCacheHitAddHit (const std::string &ip, const std::string &type, const std::string &reason)
 Creates and adds a Ban Cache item.
BanCacheHitAddHit (const std::string &ip, const std::string &type, const std::string &reason, time_t seconds)
BanCacheHitGetHit (const std::string &ip)
bool RemoveHit (BanCacheHit *b)
unsigned int RemoveEntries (const std::string &type, bool positive)
 Removes all entries of a given type, either positive or negative.
 BanCacheManager (InspIRCd *Instance)
void RehashCache ()

Private Attributes

BanCacheHashBanHash
InspIRCdServerInstance

Detailed Description

Definition at line 54 of file bancache.h.


Constructor & Destructor Documentation

BanCacheManager::BanCacheManager InspIRCd Instance  )  [inline]
 

Definition at line 79 of file bancache.h.

References ServerInstance.


Member Function Documentation

BanCacheHit * BanCacheManager::AddHit const std::string ip,
const std::string type,
const std::string reason,
time_t  seconds
 

Definition at line 32 of file bancache.cpp.

References BanHash, and ServerInstance.

BanCacheHit * BanCacheManager::AddHit const std::string ip,
const std::string type,
const std::string reason
 

Creates and adds a Ban Cache item.

Parameters:
ip The IP the item is for.
type The type of ban cache item. std::string. .empty() means it's a negative match (user is allowed freely).
reason The reason for the ban. Left .empty() if it's a negative match.

Definition at line 19 of file bancache.cpp.

References BanHash, and ServerInstance.

Referenced by XLine::DefaultApply(), and User::FullConnect().

BanCacheHit * BanCacheManager::GetHit const std::string ip  ) 
 

Definition at line 45 of file bancache.cpp.

References BanHash, DEBUG, LogManager::Log(), InspIRCd::Logs, RemoveHit(), and ServerInstance.

Referenced by UserManager::AddUser().

void BanCacheManager::RehashCache  ) 
 

Definition at line 127 of file bancache.cpp.

References BanHash, and BanCacheHit::Expiry.

unsigned int BanCacheManager::RemoveEntries const std::string type,
bool  positive
 

Removes all entries of a given type, either positive or negative.

Returns the number of hits removed.

Parameters:
type The type of bancache entries to remove (e.g. 'G')
positive Remove either positive (true) or negative (false) hits.

Definition at line 87 of file bancache.cpp.

References BanHash, DEBUG, BanCacheHit::IP, LogManager::Log(), InspIRCd::Logs, BanCacheHit::Reason, ServerInstance, and BanCacheHit::Type.

Referenced by XLineManager::AddLine(), and XLineManager::DelLine().

bool BanCacheManager::RemoveHit BanCacheHit b  ) 
 

Definition at line 64 of file bancache.cpp.

References BanHash, DEBUG, BanCacheHit::IP, LogManager::Log(), InspIRCd::Logs, and ServerInstance.

Referenced by GetHit().


Member Data Documentation

BanCacheHash* BanCacheManager::BanHash [private]
 

Definition at line 57 of file bancache.h.

Referenced by AddHit(), GetHit(), RehashCache(), RemoveEntries(), and RemoveHit().

InspIRCd* BanCacheManager::ServerInstance [private]
 

Definition at line 58 of file bancache.h.

Referenced by AddHit(), GetHit(), RemoveEntries(), and RemoveHit().


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