41 void DefaultApply(
User* u,
const std::string &line,
bool bancache);
52 XLine(time_t s_time,
unsigned long d,
const std::string& src,
const std::string& re,
const std::string& t)
60 expiry = set_time + duration;
75 expiry = created + duration;
83 virtual bool Matches(
User *u) = 0;
91 virtual bool Matches(
const std::string &str) = 0;
97 virtual void Apply(
User* u);
108 virtual void DisplayExpiry();
117 virtual const std::string& Displayable() = 0;
151 virtual bool IsBurstable();
168 KLine(time_t s_time,
unsigned long d,
const std::string& src,
const std::string& re,
const std::string& ident,
const std::string& host)
169 :
XLine(s_time, d, src, re,
"K"), identmask(ident), hostmask(host)
171 matchtext = this->identmask;
172 matchtext.append(
"@").append(this->hostmask);
183 bool Matches(
const std::string& str) CXX11_OVERRIDE;
189 bool IsBurstable() CXX11_OVERRIDE;
193 std::
string identmask;
196 std::
string hostmask;
198 std::
string matchtext;
214 GLine(time_t s_time,
unsigned long d,
const std::string& src,
const std::string& re,
const std::string& ident,
const std::string& host)
215 :
XLine(s_time, d, src, re,
"G"), identmask(ident), hostmask(host)
217 matchtext = this->identmask;
218 matchtext.append(
"@").append(this->hostmask);
229 bool Matches(
const std::string& str) CXX11_OVERRIDE;
237 std::
string identmask;
240 std::
string hostmask;
242 std::
string matchtext;
258 ELine(time_t s_time,
unsigned long d,
const std::string& src,
const std::string& re,
const std::string& ident,
const std::string& host)
259 :
XLine(s_time, d, src, re,
"E"), identmask(ident), hostmask(host)
261 matchtext = this->identmask;
262 matchtext.append(
"@").append(this->hostmask);
271 bool Matches(
const std::string& str) CXX11_OVERRIDE;
273 void Unset() CXX11_OVERRIDE;
275 void OnAdd() CXX11_OVERRIDE;
277 const std::
string& Displayable() CXX11_OVERRIDE;
281 std::
string identmask;
284 std::
string hostmask;
286 std::
string matchtext;
301 ZLine(time_t s_time,
unsigned long d,
const std::string& src,
const std::string& re,
const std::string& ip)
302 :
XLine(s_time, d, src, re,
"Z"), ipaddr(ip)
314 bool Matches(
const std::string& str) CXX11_OVERRIDE;
337 QLine(time_t s_time,
unsigned long d,
const std::string& src,
const std::string& re,
const std::string& nickname)
338 :
XLine(s_time, d, src, re,
"Q"), nick(nickname)
349 bool Matches(
const std::string& str) CXX11_OVERRIDE;
393 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;
395 virtual bool AutoApplyToUserList(
XLine* x) {
return true; }
437 IdentHostPair IdentSplit(
const std::string &ident_and_host);
449 XLineLookup* GetAll(
const std::string &type);
453 void DelAll(
const std::string &type);
458 std::vector<std::string> GetAllTypes();
475 bool DelLine(
const char* hostmask,
const std::string& type, std::string& reason,
User* user,
bool simulate =
false);
506 XLine* MatchesLine(
const std::string &type,
User* user);
513 XLine* MatchesLine(
const std::string &type,
const std::string &pattern);
520 void ExpireLine(ContainerIter container, LookupIter item,
bool silent =
false);
535 void InvokeStats(
const std::string& type,
unsigned int numeric, Stats::Context& stats);