InspIRCd  3.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, time_t seconds=0)
 
BanCacheHitGetHit (const std::string &ip)
 
void RemoveEntries (const std::string &type, bool positive)
 

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,
time_t  seconds = 0 
)

Creates and adds a Ban Cache item.

Parameters
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.
secondsNumber of seconds before nuking the bancache entry, the default is a day. This might seem long, but entries will be removed as glines/etc expire.

◆ RemoveEntries()

void 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
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: