InspIRCd  2.0
Public Member Functions | List of all members
BanCacheManager Class Reference

#include <bancache.h>

Public Member Functions

BanCacheHitAddHit (const std::string &ip, const std::string &type, const std::string &reason)
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)
void RehashCache ()

Detailed Description

A manager for ban cache, which allocates and deallocates and checks cached bans.

Member Function Documentation

◆ AddHit()

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

Creates and adds a Ban Cache item.

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

◆ RemoveEntries()

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.

typeThe type of bancache entries to remove (e.g. 'G')
positiveRemove either positive (true) or negative (false) hits.

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