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);
104 virtual void DisplayExpiry() = 0;
113 virtual const char* Displayable() = 0;
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);
virtual void DisplayExpiry()=0
std::vector< XLine * > pending_lines
Definition: xline.h:414
std::string hostmask
Definition: xline.h:237
XLineFactory(const std::string &t)
Definition: xline.h:381
virtual ~XLine()
Definition: xline.h:61
virtual ~XLineFactory()
Definition: xline.h:402
ZLine(time_t s_time, long d, std::string src, std::string re, std::string ip)
Definition: xline.h:300
virtual void OnAdd()
Definition: xline.h:117
GLine(time_t s_time, long d, std::string src, std::string re, std::string ident, std::string host)
Definition: xline.h:209
~GLine()
Definition: xline.h:218
ELine(time_t s_time, long d, std::string src, std::string re, std::string ident, std::string host)
Definition: xline.h:255
std::string hostmask
Definition: xline.h:283
KLine(time_t s_time, long d, std::string src, std::string re, std::string ident, std::string host)
Definition: xline.h:161
std::string source
Definition: xline.h:129
std::string nick
Definition: xline.h:360
std::string hostmask
Definition: xline.h:191
std::string identmask
Definition: xline.h:188
virtual bool Matches(User *u)=0
Definition: xline.cpp:139
virtual void Unset()
Definition: xline.h:98
time_t expiry
Definition: xline.h:137
long duration
Definition: xline.h:125
QLine(time_t s_time, long d, std::string src, std::string re, std::string nickname)
Definition: xline.h:338
~ZLine()
Definition: xline.h:307
virtual const std::string & GetType()
Definition: xline.h:386
virtual const char * Displayable()=0
std::string reason
Definition: xline.h:133
XLine(time_t s_time, long d, std::string src, std::string re, const std::string &t)
Definition: xline.h:53
XLineContainer lookup_lines
Definition: xline.h:425
std::string identmask
Definition: xline.h:234
virtual void Apply(User *u)
Definition: xline.cpp:518
const std::string type
Definition: xline.h:142
~QLine()
Definition: xline.h:345
time_t set_time
Definition: xline.h:121
XLineFactMap line_factory
Definition: xline.h:418
~KLine()
Definition: xline.h:170
std::string ipaddr
Definition: xline.h:323
std::string identmask
Definition: xline.h:280
virtual void SetCreateTime(time_t created)
Definition: xline.h:68