1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
7 * <brain@chatspike.net>
8 * <Craig@chatspike.net>
10 * Written by Craig Edwards, Craig McLure, and others.
11 * This program is free but copyrighted software; see
12 * the file COPYING for details.
14 * ---------------------------------------------------
20 // include the common header files
32 /** XLine is the base class for ban lines such as G lines and K lines.
34 class XLine : public classbase
38 /** The time the line was added.
42 /** The duration of the ban, or 0 if permenant
46 /** Source of the ban. This can be a servername or an oper nickname
50 /** Reason for the ban
54 /** Number of times the core matches the ban, for statistics
62 class KLine : public XLine
65 /** Hostmask (ident@host) to match against
66 * May contain wildcards.
73 class GLine : public XLine
76 /** Hostmask (ident@host) to match against
77 * May contain wildcards.
82 class ELine : public XLine
85 /** Hostmask (ident@host) to match against
86 * May contain wildcards.
93 class ZLine : public XLine
96 /** IP Address (xx.yy.zz.aa) to match against
97 * May contain wildcards.
100 /** Set if this is a global Z:line
101 * (e.g. it came from another server)
108 class QLine : public XLine
111 /** Nickname to match against.
112 * May contain wildcards.
115 /** Set if this is a global Z:line
116 * (e.g. it came from another server)
121 void read_xline_defaults();
123 void add_gline(long duration, const char* source, const char* reason, const char* hostmask);
124 void add_qline(long duration, const char* source, const char* reason, const char* nickname);
125 void add_zline(long duration, const char* source, const char* reason, const char* ipaddr);
126 void add_kline(long duration, const char* source, const char* reason, const char* hostmask);
127 void add_eline(long duration, const char* source, const char* reason, const char* hostmask);
129 bool del_gline(const char* hostmask);
130 bool del_qline(const char* nickname);
131 bool del_zline(const char* ipaddr);
132 bool del_kline(const char* hostmask);
133 bool del_eline(const char* hostmask);
135 char* matches_qline(const char* nick);
136 char* matches_gline(const char* host);
137 char* matches_zline(const char* ipaddr);
138 char* matches_kline(const char* host);
139 char* matches_exception(const char* host);
144 void stats_k(userrec* user);
145 void stats_g(userrec* user);
146 void stats_q(userrec* user);
147 void stats_z(userrec* user);
148 void stats_e(userrec* user);
150 void gline_set_creation_time(char* host, time_t create_time);
151 void qline_set_creation_time(char* nick, time_t create_time);
152 void zline_set_creation_time(char* ip, time_t create_time);
154 bool zline_make_global(const char* ipaddr);
155 bool qline_make_global(const char* nickname);
157 void sync_xlines(serverrec* serv, char* tcp_host);