42 void DefaultApply(
User* u,
const std::string &line,
bool bancache);
53 XLine(time_t s_time,
long d, std::string src, std::string re,
const std::string &t)
54 : set_time(s_time), duration(d), source(src), reason(re), type(t)
56 expiry = set_time + duration;
71 expiry = created + duration;
79 virtual bool Matches(
User *u) = 0;
87 virtual bool Matches(
const std::string &str) = 0;
93 virtual void Apply(
User* u);
144 virtual bool IsBurstable();
161 KLine(time_t s_time,
long d, std::string src, std::string re, std::string ident, std::string host)
162 :
XLine(s_time, d, src, re,
"K"), identmask(ident), hostmask(host)
164 matchtext = this->identmask;
165 matchtext.append(
"@").append(this->hostmask);
176 virtual bool Matches(
const std::string &str);
184 virtual bool IsBurstable();
193 std::string matchtext;
209 GLine(time_t s_time,
long d, std::string src, std::string re, std::string ident, std::string host)
210 :
XLine(s_time, d, src, re,
"G"), identmask(ident), hostmask(host)
212 matchtext = this->identmask;
213 matchtext.append(
"@").append(this->hostmask);
224 virtual bool Matches(
const std::string &str);
239 std::string matchtext;
255 ELine(time_t s_time,
long d, std::string src, std::string re, std::string ident, std::string host)
256 :
XLine(s_time, d, src, re,
"E"), identmask(ident), hostmask(host)
258 matchtext = this->identmask;
259 matchtext.append(
"@").append(this->hostmask);
268 virtual bool Matches(
const std::string &str);
270 virtual void Unset();
274 virtual void OnAdd();
285 std::string matchtext;
300 ZLine(time_t s_time,
long d, std::string src, std::string re, std::string ip)
301 :
XLine(s_time, d, src, re,
"Z"), ipaddr(ip)
313 virtual bool Matches(
const std::string &str);
338 QLine(time_t s_time,
long d, std::string src, std::string re, std::string nickname)
339 :
XLine(s_time, d, src, re,
"Q"), nick(nickname)
350 virtual bool Matches(
const std::string &str);
386 virtual const std::string&
GetType() {
return type; }
396 virtual XLine*
Generate(time_t set_time,
long duration, std::string source, std::string reason, std::string xline_specific_mask) = 0;
398 virtual bool AutoApplyToUserList(
XLine* x) {
return true; }
440 IdentHostPair IdentSplit(
const std::string &ident_and_host);
452 XLineLookup* GetAll(
const std::string &type);
456 void DelAll(
const std::string &type);
461 std::vector<std::string> GetAllTypes();
477 bool DelLine(
const char* hostmask,
const std::string &type,
User* user,
bool simulate =
false);
508 XLine* MatchesLine(
const std::string &type,
User* user);
515 XLine* MatchesLine(
const std::string &type,
const std::string &pattern);
521 void ExpireLine(ContainerIter container, LookupIter item);
537 void InvokeStats(
const std::string &type,
int numeric,
User* user, string_list &results);