45 void DefaultApply(
User* u,
const std::string &line,
bool bancache);
56 XLine(time_t s_time,
unsigned long d,
const std::string& src,
const std::string& re,
const std::string& t)
64 expiry = set_time + duration;
79 expiry = created + duration;
87 virtual bool Matches(
User *u) = 0;
95 virtual bool Matches(
const std::string &str) = 0;
101 virtual void Apply(
User* u);
112 virtual void DisplayExpiry();
121 virtual const std::string& Displayable() = 0;
155 virtual bool IsBurstable();
172 KLine(time_t s_time,
unsigned long d,
const std::string& src,
const std::string& re,
const std::string& ident,
const std::string& host)
173 :
XLine(s_time, d, src, re,
"K"), identmask(ident), hostmask(host)
175 matchtext = this->identmask;
176 matchtext.append(
"@").append(this->hostmask);
187 bool Matches(
const std::string& str) CXX11_OVERRIDE;
193 bool IsBurstable() CXX11_OVERRIDE;
197 std::
string identmask;
200 std::
string hostmask;
202 std::
string matchtext;
218 GLine(time_t s_time,
unsigned long d,
const std::string& src,
const std::string& re,
const std::string& ident,
const std::string& host)
219 :
XLine(s_time, d, src, re,
"G"), identmask(ident), hostmask(host)
221 matchtext = this->identmask;
222 matchtext.append(
"@").append(this->hostmask);
233 bool Matches(
const std::string& str) CXX11_OVERRIDE;
241 std::
string identmask;
244 std::
string hostmask;
246 std::
string matchtext;
262 ELine(time_t s_time,
unsigned long d,
const std::string& src,
const std::string& re,
const std::string& ident,
const std::string& host)
263 :
XLine(s_time, d, src, re,
"E"), identmask(ident), hostmask(host)
265 matchtext = this->identmask;
266 matchtext.append(
"@").append(this->hostmask);
275 bool Matches(
const std::string& str) CXX11_OVERRIDE;
277 void Unset() CXX11_OVERRIDE;
279 void OnAdd() CXX11_OVERRIDE;
281 const std::
string& Displayable() CXX11_OVERRIDE;
285 std::
string identmask;
288 std::
string hostmask;
290 std::
string matchtext;
305 ZLine(time_t s_time,
unsigned long d,
const std::string& src,
const std::string& re,
const std::string& ip)
306 :
XLine(s_time, d, src, re,
"Z"), ipaddr(ip)
318 bool Matches(
const std::string& str) CXX11_OVERRIDE;
341 QLine(time_t s_time,
unsigned long d,
const std::string& src,
const std::string& re,
const std::string& nickname)
342 :
XLine(s_time, d, src, re,
"Q"), nick(nickname)
353 bool Matches(
const std::string& str) CXX11_OVERRIDE;
397 virtual XLine* Generate(time_t set_time,
unsigned long duration,
const std::string& source,
const std::string& reason,
const std::string& xline_specific_mask) = 0;
399 virtual bool AutoApplyToUserList(
XLine* x) {
return true; }
441 IdentHostPair IdentSplit(
const std::string &ident_and_host);
453 XLineLookup* GetAll(
const std::string &type);
457 void DelAll(
const std::string &type);
462 std::vector<std::string> GetAllTypes();
479 bool DelLine(
const char* hostmask,
const std::string& type, std::string& reason,
User* user,
bool simulate =
false);
510 XLine* MatchesLine(
const std::string &type,
User* user);
517 XLine* MatchesLine(
const std::string &type,
const std::string &pattern);
524 void ExpireLine(ContainerIter container, LookupIter item,
bool silent =
false);
533 DEPRECATED_METHOD(
void InvokeStats(
const std::string& type,
unsigned int numeric, Stats::Context& stats));
540 bool InvokeStats(
const std::string& type, Stats::Context& context);