1 |
/* |
2 |
* ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd). |
3 |
* s_conf.h: A header for the configuration functions. |
4 |
* |
5 |
* Copyright (C) 2005 by the past and present ircd coders, and others. |
6 |
* |
7 |
* This program is free software; you can redistribute it and/or modify |
8 |
* it under the terms of the GNU General Public License as published by |
9 |
* the Free Software Foundation; either version 2 of the License, or |
10 |
* (at your option) any later version. |
11 |
* |
12 |
* This program is distributed in the hope that it will be useful, |
13 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 |
* GNU General Public License for more details. |
16 |
* |
17 |
* You should have received a copy of the GNU General Public License |
18 |
* along with this program; if not, write to the Free Software |
19 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 |
20 |
* USA |
21 |
* |
22 |
* $Id$ |
23 |
*/ |
24 |
|
25 |
#ifndef INCLUDED_s_conf_h |
26 |
#define INCLUDED_s_conf_h |
27 |
#include "setup.h" |
28 |
#ifdef HAVE_LIBCRYPTO |
29 |
#include <openssl/rsa.h> |
30 |
#endif |
31 |
#include "fileio.h" /* FBFILE */ |
32 |
#include "ircd_defs.h" |
33 |
#include "motd.h" /* MessageFile */ |
34 |
#include "client.h" |
35 |
#include "hook.h" |
36 |
#include "pcre.h" |
37 |
|
38 |
struct Client; |
39 |
struct DNSReply; |
40 |
struct hostent; |
41 |
|
42 |
extern FBFILE *conf_fbfile_in; |
43 |
extern struct Callback *client_check_cb; |
44 |
|
45 |
typedef enum |
46 |
{ |
47 |
CONF_TYPE, |
48 |
CLASS_TYPE, |
49 |
OPER_TYPE, |
50 |
CLIENT_TYPE, |
51 |
SERVER_TYPE, |
52 |
HUB_TYPE, |
53 |
LEAF_TYPE, |
54 |
KLINE_TYPE, |
55 |
DLINE_TYPE, |
56 |
EXEMPTDLINE_TYPE, |
57 |
CLUSTER_TYPE, |
58 |
RKLINE_TYPE, |
59 |
RXLINE_TYPE, |
60 |
XLINE_TYPE, |
61 |
ULINE_TYPE, |
62 |
GLINE_TYPE, |
63 |
CRESV_TYPE, |
64 |
NRESV_TYPE, |
65 |
GDENY_TYPE |
66 |
} ConfType; |
67 |
|
68 |
struct ConfItem |
69 |
{ |
70 |
char *name; /* Primary key */ |
71 |
pcre *regexpname; |
72 |
dlink_node node; /* link into known ConfItems of this type */ |
73 |
unsigned int flags; |
74 |
ConfType type; |
75 |
}; |
76 |
|
77 |
/* |
78 |
* MatchItem - used for XLINE and ULINE types |
79 |
*/ |
80 |
struct MatchItem |
81 |
{ |
82 |
char *user; /* Used for ULINE only */ |
83 |
char *host; /* Used for ULINE only */ |
84 |
char *reason; |
85 |
char *oper_reason; |
86 |
int action; /* used for uline */ |
87 |
int count; /* How many times this matchitem has been matched */ |
88 |
int ref_count; /* How many times is this matchitem in use */ |
89 |
int illegal; /* Should it be deleted when possible? */ |
90 |
time_t hold; /* Hold action until this time (calendar time) */ |
91 |
}; |
92 |
|
93 |
struct AccessItem |
94 |
{ |
95 |
dlink_node node; |
96 |
unsigned int status; /* If CONF_ILLEGAL, delete when no clients */ |
97 |
unsigned int flags; |
98 |
unsigned int modes; |
99 |
int clients; /* Number of *LOCAL* clients using this */ |
100 |
struct irc_ssaddr my_ipnum; /* ip to bind to for outgoing connect */ |
101 |
struct irc_ssaddr ipnum; /* ip to connect to */ |
102 |
char * host; /* host part of user@host */ |
103 |
char * passwd; |
104 |
char * spasswd; /* Password to send. */ |
105 |
char * reason; |
106 |
char * oper_reason; |
107 |
char * user; /* user part of user@host */ |
108 |
int port; |
109 |
char * fakename; /* Mask name */ |
110 |
time_t hold; /* Hold action until this time (calendar time) */ |
111 |
struct ConfItem *class_ptr; /* Class of connection */ |
112 |
struct DNSQuery* dns_query; |
113 |
int aftype; |
114 |
#ifdef HAVE_LIBCRYPTO |
115 |
char * rsa_public_key_file; |
116 |
RSA * rsa_public_key; |
117 |
struct EncCapability *cipher_preference; |
118 |
#endif |
119 |
pcre *regexuser; |
120 |
pcre *regexhost; |
121 |
}; |
122 |
|
123 |
struct ClassItem |
124 |
{ |
125 |
long max_sendq; |
126 |
int con_freq; |
127 |
int ping_freq; |
128 |
int ping_warning; |
129 |
int max_total; |
130 |
int max_local; |
131 |
int max_global; |
132 |
int max_ident; |
133 |
int max_perip; |
134 |
int curr_user_count; |
135 |
int cidr_bitlen_ipv4; |
136 |
int cidr_bitlen_ipv6; |
137 |
int number_per_cidr; |
138 |
dlink_list list_ipv4; /* base of per cidr ipv4 client link list */ |
139 |
dlink_list list_ipv6; /* base of per cidr ipv6 client link list */ |
140 |
}; |
141 |
|
142 |
struct CidrItem |
143 |
{ |
144 |
struct irc_ssaddr mask; |
145 |
int number_on_this_cidr; |
146 |
dlink_node node; |
147 |
}; |
148 |
|
149 |
#define ConFreq(x) ((x)->con_freq) |
150 |
#define PingFreq(x) ((x)->ping_freq) |
151 |
#define PingWarning(x) ((x)->ping_warning) |
152 |
#define MaxTotal(x) ((x)->max_total) |
153 |
#define MaxGlobal(x) ((x)->max_global) |
154 |
#define MaxLocal(x) ((x)->max_local) |
155 |
#define MaxIdent(x) ((x)->max_ident) |
156 |
#define MaxPerIp(x) ((x)->max_perip) |
157 |
#define MaxSendq(x) ((x)->max_sendq) |
158 |
#define CurrUserCount(x) ((x)->curr_user_count) |
159 |
#define CidrBitlenIPV4(x) ((x)->cidr_bitlen_ipv4) |
160 |
#define CidrBitlenIPV6(x) ((x)->cidr_bitlen_ipv6) |
161 |
#define NumberPerCidr(x) ((x)->number_per_cidr) |
162 |
|
163 |
#define ClassPtr(x) ((x)->class_ptr) |
164 |
|
165 |
|
166 |
#define CONF_ILLEGAL 0x80000000 |
167 |
#define CONF_RESERVED 0x00000001 |
168 |
#define CONF_CLIENT 0x00000002 |
169 |
#define CONF_SERVER 0x00000004 |
170 |
#define CONF_OPERATOR 0x00000008 |
171 |
#define CONF_KILL 0x00000010 |
172 |
#define CONF_KLINE CONF_KILL |
173 |
#define CONF_CLASS 0x00000020 |
174 |
#define CONF_LEAF 0x00000040 |
175 |
#define CONF_LISTEN_PORT 0x00000080 |
176 |
#define CONF_HUB 0x00000100 |
177 |
#define CONF_EXEMPTKLINE 0x00000200 |
178 |
#define CONF_NOLIMIT 0x00000400 |
179 |
#define CONF_DLINE 0x00000800 |
180 |
#define CONF_XLINE 0x00001000 |
181 |
#define CONF_ULINE 0x00002000 |
182 |
#define CONF_EXEMPTDLINE 0x00004000 |
183 |
#define CONF_GLINE 0x00008000 |
184 |
|
185 |
#define CONF_SERVER_MASK CONF_SERVER |
186 |
#define CONF_CLIENT_MASK (CONF_CLIENT | CONF_OPERATOR | CONF_SERVER_MASK) |
187 |
|
188 |
/* XXX temporary hack */ |
189 |
#define CONF_CRESV 0x80000001 |
190 |
#define CONF_NRESV 0x80000002 |
191 |
|
192 |
#define IsConfIllegal(x) ((x)->status & CONF_ILLEGAL) |
193 |
#define SetConfIllegal(x) ((x)->status |= CONF_ILLEGAL) |
194 |
#define IsConfServer(x) ((x)->status == CONF_SERVER) |
195 |
#define SetConfServer(x) ((x)->status = CONF_SERVER) |
196 |
#define IsConfOperator(x) ((x)->status & CONF_OPERATOR) |
197 |
#define IsConfHub(x) ((x)->status == CONF_HUB) |
198 |
#define SetConfHub(x) ((x)->status = CONF_HUB) |
199 |
#define IsConfLeaf(x) ((x)->status == CONF_LEAF) |
200 |
#define SetConfLeaf(x) ((x)->status = CONF_LEAF) |
201 |
#define IsConfHubOrLeaf(x) ((x)->status & (CONF_HUB|CONF_LEAF)) |
202 |
#define IsConfKill(x) ((x)->status == CONF_KILL) |
203 |
#define IsConfClient(x) ((x)->status & CONF_CLIENT) |
204 |
#define IsConfTypeOfClient(x) ((x)->status & CONF_CLIENT_MASK) |
205 |
#define IsConfUline(x) ((x)->status & CONF_ULINE) |
206 |
#define IsConfXline(x) ((x)->status & CONF_XLINE) |
207 |
#define IsConfGline(x) ((x)->status == CONF_GLINE) |
208 |
|
209 |
/* AccessItem->flags */ |
210 |
|
211 |
/* Generic flags... */ |
212 |
/* access flags... */ |
213 |
#define CONF_FLAGS_DO_IDENTD 0x00000001 |
214 |
#define CONF_FLAGS_LIMIT_IP 0x00000002 |
215 |
#define CONF_FLAGS_NO_TILDE 0x00000004 |
216 |
#define CONF_FLAGS_NEED_IDENTD 0x00000008 |
217 |
/* 0x00000010 */ |
218 |
#define CONF_FLAGS_NOMATCH_IP 0x00000020 |
219 |
#define CONF_FLAGS_EXEMPTKLINE 0x00000040 |
220 |
#define CONF_FLAGS_NOLIMIT 0x00000080 |
221 |
#define CONF_FLAGS_IDLE_LINED 0x00000100 |
222 |
#define CONF_FLAGS_SPOOF_IP 0x00000200 |
223 |
#define CONF_FLAGS_SPOOF_NOTICE 0x00000400 |
224 |
#define CONF_FLAGS_REDIR 0x00000800 |
225 |
#define CONF_FLAGS_EXEMPTGLINE 0x00001000 |
226 |
#define CONF_FLAGS_RESTRICTED 0x00002000 |
227 |
#define CONF_FLAGS_CAN_FLOOD 0x00100000 |
228 |
#define CONF_FLAGS_NEED_PASSWORD 0x00200000 |
229 |
/* server flags */ |
230 |
#define CONF_FLAGS_ALLOW_AUTO_CONN 0x00004000 |
231 |
#define CONF_FLAGS_LAZY_LINK 0x00008000 |
232 |
#define CONF_FLAGS_ENCRYPTED 0x00010000 |
233 |
#define CONF_FLAGS_COMPRESSED 0x00020000 |
234 |
#define CONF_FLAGS_TEMPORARY 0x00040000 |
235 |
#define CONF_FLAGS_CRYPTLINK 0x00080000 |
236 |
#define CONF_FLAGS_BURST_AWAY 0x00400000 |
237 |
#define CONF_FLAGS_EXEMPTRESV 0x00800000 |
238 |
#define CONF_FLAGS_TOPICBURST 0x01000000 |
239 |
|
240 |
/* Macros for struct AccessItem */ |
241 |
#define IsLimitIp(x) ((x)->flags & CONF_FLAGS_LIMIT_IP) |
242 |
#define IsNoTilde(x) ((x)->flags & CONF_FLAGS_NO_TILDE) |
243 |
#define IsConfCanFlood(x) ((x)->flags & CONF_FLAGS_CAN_FLOOD) |
244 |
#define IsNeedPassword(x) ((x)->flags & CONF_FLAGS_NEED_PASSWORD) |
245 |
#define IsNeedIdentd(x) ((x)->flags & CONF_FLAGS_NEED_IDENTD) |
246 |
#define IsNoMatchIp(x) ((x)->flags & CONF_FLAGS_NOMATCH_IP) |
247 |
#define IsConfExemptKline(x) ((x)->flags & CONF_FLAGS_EXEMPTKLINE) |
248 |
#define IsConfExemptLimits(x) ((x)->flags & CONF_FLAGS_NOLIMIT) |
249 |
#define IsConfExemptGline(x) ((x)->flags & CONF_FLAGS_EXEMPTGLINE) |
250 |
#define IsConfExemptResv(x) ((x)->flags & CONF_FLAGS_EXEMPTRESV) |
251 |
#define IsConfIdlelined(x) ((x)->flags & CONF_FLAGS_IDLE_LINED) |
252 |
#define IsConfDoIdentd(x) ((x)->flags & CONF_FLAGS_DO_IDENTD) |
253 |
#define IsConfDoSpoofIp(x) ((x)->flags & CONF_FLAGS_SPOOF_IP) |
254 |
#define IsConfSpoofNotice(x) ((x)->flags & CONF_FLAGS_SPOOF_NOTICE) |
255 |
#define IsConfRestricted(x) ((x)->flags & CONF_FLAGS_RESTRICTED) |
256 |
#define IsConfEncrypted(x) ((x)->flags & CONF_FLAGS_ENCRYPTED) |
257 |
#define SetConfEncrypted(x) ((x)->flags |= CONF_FLAGS_ENCRYPTED) |
258 |
#define ClearConfEncrypted(x) ((x)->flags &= ~CONF_FLAGS_ENCRYPTED) |
259 |
#define IsConfCompressed(x) ((x)->flags & CONF_FLAGS_COMPRESSED) |
260 |
#define SetConfCompressed(x) ((x)->flags |= CONF_FLAGS_COMPRESSED) |
261 |
#define ClearConfCompressed(x) ((x)->flags &= ~CONF_FLAGS_COMPRESSED) |
262 |
#define IsConfCryptLink(x) ((x)->flags & CONF_FLAGS_CRYPTLINK) |
263 |
#define SetConfCryptLink(x) ((x)->flags |= CONF_FLAGS_CRYPTLINK) |
264 |
#define ClearConfCryptLink(x) ((x)->flags &= ~CONF_FLAGS_CRYPTLINK) |
265 |
#define IsConfLazyLink(x) ((x)->flags & CONF_FLAGS_LAZY_LINK) |
266 |
#define SetConfLazyLink(x) ((x)->flags = CONF_FLAGS_LAZY_LINK) |
267 |
#define ClearConfLazyLink(x) ((x)->flags &= ~CONF_FLAGS_LAZY_LINK) |
268 |
#define IsConfAllowAutoConn(x) ((x)->flags & CONF_FLAGS_ALLOW_AUTO_CONN) |
269 |
#define SetConfAllowAutoConn(x) ((x)->flags |= CONF_FLAGS_ALLOW_AUTO_CONN) |
270 |
#define ClearConfAllowAutoConn(x) ((x)->flags &= ~CONF_FLAGS_ALLOW_AUTO_CONN) |
271 |
#define IsConfTemporary(x) ((x)->flags & CONF_FLAGS_TEMPORARY) |
272 |
#define SetConfTemporary(x) ((x)->flags |= CONF_FLAGS_TEMPORARY) |
273 |
#define IsConfRedir(x) ((x)->flags & CONF_FLAGS_REDIR) |
274 |
#define IsConfAwayBurst(x) ((x)->flags & CONF_FLAGS_BURST_AWAY) |
275 |
#define SetConfAwayBurst(x) ((x)->flags |= CONF_FLAGS_BURST_AWAY) |
276 |
#define ClearConfAwayBurst(x) ((x)->flags &= ~CONF_FLAGS_BURST_AWAY) |
277 |
#define IsConfTopicBurst(x) ((x)->flags & CONF_FLAGS_TOPICBURST) |
278 |
#define SetConfTopicBurst(x) ((x)->flags |= CONF_FLAGS_TOPICBURST) |
279 |
#define ClearConfTopicBurst(x) ((x)->flags &= ~CONF_FLAGS_TOPICBURST) |
280 |
|
281 |
/* shared/cluster server entry types |
282 |
* These defines are used for both shared and cluster. |
283 |
*/ |
284 |
#define SHARED_KLINE 0x0001 |
285 |
#define SHARED_TKLINE 0x0002 |
286 |
#define SHARED_UNKLINE 0x0004 |
287 |
#define SHARED_XLINE 0x0008 |
288 |
#define SHARED_TXLINE 0x0010 |
289 |
#define SHARED_UNXLINE 0x0020 |
290 |
#define SHARED_RESV 0x0040 |
291 |
#define SHARED_TRESV 0x0080 |
292 |
#define SHARED_UNRESV 0x0100 |
293 |
#define SHARED_LOCOPS 0x0200 |
294 |
#define SHARED_ALL (SHARED_KLINE | SHARED_TKLINE | SHARED_UNKLINE | \ |
295 |
SHARED_XLINE | SHARED_TXLINE | SHARED_UNXLINE | \ |
296 |
SHARED_RESV | SHARED_TRESV | SHARED_UNRESV |\ |
297 |
SHARED_LOCOPS) |
298 |
|
299 |
/* gline acl entry actions */ |
300 |
#define GDENY_BLOCK 0x1 |
301 |
#define GDENY_REJECT 0x2 |
302 |
|
303 |
struct config_file_entry |
304 |
{ |
305 |
const char *dpath; /* DPATH if set from command line */ |
306 |
const char *configfile; |
307 |
const char *klinefile; |
308 |
const char *xlinefile; |
309 |
const char *rxlinefile; |
310 |
const char *rklinefile; |
311 |
const char *dlinefile; |
312 |
const char *glinefile; |
313 |
const char *cresvfile; |
314 |
const char *nresvfile; |
315 |
|
316 |
char *logpath; |
317 |
char *operlog; |
318 |
|
319 |
char *servlink_path; |
320 |
char *egdpool_path; |
321 |
|
322 |
MessageFile motd; |
323 |
MessageFile opermotd; |
324 |
MessageFile linksfile; |
325 |
|
326 |
unsigned char compression_level; |
327 |
int gline_min_cidr; |
328 |
int gline_min_cidr6; |
329 |
int dot_in_ip6_addr; |
330 |
int dots_in_ident; |
331 |
int failed_oper_notice; |
332 |
int anti_spam_exit_message_time; |
333 |
int max_accept; |
334 |
int max_nick_time; |
335 |
int max_nick_changes; |
336 |
int ts_max_delta; |
337 |
int ts_warn_delta; |
338 |
int anti_nick_flood; |
339 |
int kline_with_reason; |
340 |
int warn_no_nline; |
341 |
int invisible_on_connect; |
342 |
int stats_o_oper_only; |
343 |
int stats_k_oper_only; |
344 |
int stats_i_oper_only; |
345 |
int stats_P_oper_only; |
346 |
int short_motd; |
347 |
int no_oper_flood; |
348 |
int true_no_oper_flood; |
349 |
int oper_pass_resv; |
350 |
int glines; |
351 |
int hide_spoof_ips; |
352 |
int burst_away; |
353 |
int use_whois_actually; |
354 |
int tkline_expire_notices; |
355 |
int opers_bypass_callerid; |
356 |
int ignore_bogus_ts; |
357 |
char *kline_reason; |
358 |
int pace_wait; |
359 |
int pace_wait_simple; |
360 |
int gline_time; |
361 |
int gline_logging; |
362 |
int idletime; |
363 |
int oper_only_umodes; |
364 |
int oper_umodes; |
365 |
int max_targets; |
366 |
int caller_id_wait; |
367 |
int min_nonwildcard; |
368 |
int min_nonwildcard_simple; |
369 |
int kill_chase_time_limit; |
370 |
int default_floodcount; |
371 |
int client_flood; |
372 |
/* 0 == don't use throttle... */ |
373 |
int throttle_time; |
374 |
int use_egd; |
375 |
int ping_cookie; |
376 |
int disable_auth; |
377 |
int disable_remote; |
378 |
#ifdef HAVE_LIBCRYPTO |
379 |
struct EncCapability *default_cipher_preference; |
380 |
#endif |
381 |
}; |
382 |
|
383 |
struct config_channel_entry |
384 |
{ |
385 |
int restrict_channels; |
386 |
int disable_local_channels; |
387 |
int use_except; |
388 |
int use_invex; |
389 |
int use_knock; |
390 |
int knock_delay; |
391 |
int knock_delay_channel; |
392 |
unsigned int max_bans; |
393 |
unsigned int max_chans_per_user; |
394 |
int no_create_on_split; |
395 |
int no_join_on_split; |
396 |
int quiet_on_ban; |
397 |
int burst_topicwho; |
398 |
int default_split_server_count; |
399 |
int default_split_user_count; |
400 |
}; |
401 |
|
402 |
struct config_server_hide |
403 |
{ |
404 |
int flatten_links; |
405 |
int hide_servers; |
406 |
char *hidden_name; |
407 |
int links_delay; |
408 |
int links_disabled; |
409 |
int hidden; |
410 |
int disable_hidden; |
411 |
int hide_server_ips; |
412 |
}; |
413 |
|
414 |
struct server_info |
415 |
{ |
416 |
char *name; |
417 |
char *description; |
418 |
char *network_name; |
419 |
char *network_desc; |
420 |
#ifdef HAVE_LIBCRYPTO |
421 |
char *rsa_private_key_file; |
422 |
RSA *rsa_private_key; |
423 |
SSL_CTX *ctx; |
424 |
#endif |
425 |
char *sid; |
426 |
int hub; |
427 |
struct irc_ssaddr ip; |
428 |
struct irc_ssaddr ip6; |
429 |
int max_clients; |
430 |
int specific_ipv4_vhost; |
431 |
int specific_ipv6_vhost; |
432 |
struct sockaddr_in dns_host; |
433 |
int can_use_v6; |
434 |
}; |
435 |
|
436 |
struct admin_info |
437 |
{ |
438 |
char *name; |
439 |
char *description; |
440 |
char *email; |
441 |
}; |
442 |
|
443 |
struct logging_entry |
444 |
{ |
445 |
unsigned int use_logging; |
446 |
char operlog[PATH_MAX + 1]; |
447 |
char userlog[PATH_MAX + 1]; |
448 |
char glinelog[PATH_MAX + 1]; |
449 |
char ioerrlog[PATH_MAX + 1]; |
450 |
char klinelog[PATH_MAX + 1]; |
451 |
char killlog[PATH_MAX + 1]; |
452 |
char operspylog[PATH_MAX + 1]; |
453 |
char failed_operlog[PATH_MAX + 1]; |
454 |
}; |
455 |
|
456 |
extern unsigned int scount; |
457 |
extern int ypass; |
458 |
extern dlink_list class_items; |
459 |
extern dlink_list server_items; |
460 |
extern dlink_list cluster_items; |
461 |
extern dlink_list hub_items; |
462 |
extern dlink_list rxconf_items; |
463 |
extern dlink_list rkconf_items; |
464 |
extern dlink_list leaf_items; |
465 |
extern dlink_list temporary_klines; |
466 |
extern dlink_list temporary_dlines; |
467 |
extern dlink_list temporary_glines; |
468 |
extern dlink_list temporary_xlines; |
469 |
extern dlink_list temporary_rxlines; |
470 |
extern dlink_list temporary_rklines; |
471 |
extern struct logging_entry ConfigLoggingEntry; |
472 |
extern struct config_file_entry ConfigFileEntry;/* defined in ircd.c*/ |
473 |
extern struct config_channel_entry ConfigChannel;/* defined in channel.c*/ |
474 |
extern struct config_server_hide ConfigServerHide; /* defined in s_conf.c */ |
475 |
extern struct server_info ServerInfo; /* defined in ircd.c */ |
476 |
extern struct admin_info AdminInfo; /* defined in ircd.c */ |
477 |
extern int valid_wild_card(struct Client *, int, int, ...); |
478 |
/* End GLOBAL section */ |
479 |
|
480 |
extern unsigned long get_sendq(struct Client *); |
481 |
extern const char *get_client_class(struct Client *); |
482 |
extern int get_client_ping(struct Client *, int *); |
483 |
extern void check_class(void); |
484 |
extern void init_class(void); |
485 |
extern struct ConfItem *find_class(const char *); |
486 |
extern void init_ip_hash_table(void); |
487 |
extern void count_ip_hash(int *, unsigned long *); |
488 |
extern void remove_one_ip(struct irc_ssaddr *); |
489 |
extern struct ConfItem *make_conf_item(ConfType type); |
490 |
extern void free_access_item(struct AccessItem *); |
491 |
extern void read_conf_files(int); |
492 |
extern int attach_conf(struct Client *, struct ConfItem *); |
493 |
extern int attach_connect_block(struct Client *, const char *, const char *); |
494 |
|
495 |
extern int detach_conf(struct Client *, ConfType); |
496 |
|
497 |
extern struct ConfItem *find_conf_name(dlink_list *, const char *, ConfType); |
498 |
extern struct ConfItem *find_conf_exact(ConfType, const char *, const char *, const char *); |
499 |
extern struct AccessItem *find_kill(struct Client *); |
500 |
extern struct AccessItem *find_gline(struct Client *); |
501 |
extern int conf_connect_allowed(struct irc_ssaddr *, int); |
502 |
extern char *oper_privs_as_string(const unsigned int); |
503 |
extern void split_nuh(char *mask, char **nick, char **user, char **host); |
504 |
extern struct ConfItem *find_matching_name_conf(ConfType, const char *, |
505 |
const char *, const char *, int); |
506 |
extern struct ConfItem *find_exact_name_conf(ConfType, const char *, |
507 |
const char *, const char *); |
508 |
extern void delete_conf_item(struct ConfItem *); |
509 |
extern void report_confitem_types(struct Client *, ConfType, int); |
510 |
extern void yyerror(const char *); |
511 |
extern int conf_yy_fatal_error(const char *); |
512 |
extern int conf_fbgets(char *, unsigned int, FBFILE *); |
513 |
extern void write_conf_line(struct Client *, struct ConfItem *, |
514 |
const char *, time_t); |
515 |
extern int remove_conf_line(ConfType, struct Client *, const char *, |
516 |
const char *); |
517 |
extern void add_temp_line(struct ConfItem *); |
518 |
extern void cleanup_tklines(void *); |
519 |
extern const char *get_conf_name(ConfType); |
520 |
extern int rehash(int); |
521 |
extern int conf_add_server(struct ConfItem *, unsigned int, const char *); |
522 |
extern void conf_add_class_to_conf(struct ConfItem *, const char *); |
523 |
extern void conf_add_d_conf(struct AccessItem *); |
524 |
|
525 |
/* XXX consider moving these into csvlib.h */ |
526 |
extern void parse_csv_file(FBFILE *, ConfType); |
527 |
|
528 |
extern char *get_oper_name(const struct Client *); |
529 |
|
530 |
extern void *map_to_conf(struct ConfItem *); |
531 |
extern struct ConfItem *unmap_conf_item(void *); |
532 |
/* XXX should the parse_aline stuff go into another file ?? */ |
533 |
#define AWILD 0x1 /* check wild cards */ |
534 |
#define NOUSERLOOKUP 0x2 /* Don't lookup the user@host on /rkline nick */ |
535 |
extern int parse_aline(const char *, struct Client *, int, char **, |
536 |
int, char **, char **, time_t *, char **, char **); |
537 |
extern int valid_comment(struct Client *, char *, int); |
538 |
|
539 |
/* XXX */ |
540 |
extern int yylex(void); |
541 |
|
542 |
#define TK_SECONDS 0 |
543 |
#define TK_MINUTES 1 |
544 |
extern time_t valid_tkline(char *, int); |
545 |
extern int match_conf_password(const char *, const struct AccessItem *); |
546 |
|
547 |
#define NOT_AUTHORIZED (-1) |
548 |
#define IRCD_SOCKET_ERROR (-2) |
549 |
#define I_LINE_FULL (-3) |
550 |
#define TOO_MANY (-4) |
551 |
#define BANNED_CLIENT (-5) |
552 |
#define TOO_FAST (-6) |
553 |
|
554 |
#define CLEANUP_TKLINES_TIME 60 |
555 |
|
556 |
extern void cluster_a_line(struct Client *, |
557 |
const char *, int, int, const char *,...); |
558 |
extern void rebuild_cidr_class(struct ConfItem *, struct ClassItem *); |
559 |
|
560 |
#endif /* INCLUDED_s_conf_h */ |