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.
68 char hostmask[MAXBUF];
73 class GLine : public XLine
76 /** Hostmask (ident@host) to match against
77 * May contain wildcards.
79 char hostmask[MAXBUF];
84 class ZLine : public XLine
87 /** IP Address (xx.yy.zz.aa) to match against
88 * May contain wildcards.
91 /** Set if this is a global Z:line
92 * (e.g. it came from another server)
99 class QLine : public XLine
102 /** Nickname to match against.
103 * May contain wildcards.
106 /** Set if this is a global Z:line
107 * (e.g. it came from another server)
112 void read_xline_defaults();
114 void add_gline(long duration, char* source, char* reason, char* hostmask);
115 void add_qline(long duration, char* source, char* reason, char* nickname);
116 void add_zline(long duration, char* source, char* reason, char* ipaddr);
117 void add_kline(long duration, char* source, char* reason, char* hostmask);
119 bool del_gline(char* hostmask);
120 bool del_qline(char* nickname);
121 bool del_zline(char* ipaddr);
122 bool del_kline(char* hostmask);
124 char* matches_qline(const char* nick);
125 char* matches_gline(const char* host);
126 char* matches_zline(const char* ipaddr);
127 char* matches_kline(const char* host);
132 void stats_k(userrec* user);
133 void stats_g(userrec* user);
134 void stats_q(userrec* user);
135 void stats_z(userrec* user);
137 void gline_set_creation_time(char* host, time_t create_time);
138 void qline_set_creation_time(char* nick, time_t create_time);
139 void zline_set_creation_time(char* ip, time_t create_time);
141 bool zline_make_global(char* ipaddr);
142 bool qline_make_global(char* nickname);
144 void sync_xlines(serverrec* serv, char* tcp_host);