InspIRCd
3.0
|
#include <bancache.h>
Public Member Functions | |
BanCacheHit * | AddHit (const std::string &ip, const std::string &type, const std::string &reason, time_t seconds=0) |
BanCacheHit * | GetHit (const std::string &ip) |
void | RemoveEntries (const std::string &type, bool positive) |
A manager for ban cache, which allocates and deallocates and checks cached bans.
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.
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. |
seconds | Number of seconds before nuking the bancache entry, the default is a day. This might seem long, but entries will be removed as G-lines/etc expire. |
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.
type | The type of bancache entries to remove (e.g. 'G') |
positive | Remove either positive (true) or negative (false) hits. |