]>
Commit | Line | Data |
---|---|---|
212380e3 AC |
1 | /* |
2 | * charybdis: A slightly useful ircd. | |
3 | * blacklist.h: Manages DNS blacklist entries and lookups | |
4 | * | |
5 | * Copyright (C) 2006 charybdis development team | |
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: blacklist.h 2023 2006-09-02 23:47:27Z jilles $ | |
23 | */ | |
24 | ||
25 | #ifndef _BLACKLIST_H_ | |
26 | #define _BLACKLIST_H_ | |
27 | ||
28 | /* A configured DNSBL */ | |
29 | struct Blacklist { | |
30 | unsigned int status; /* If CONF_ILLEGAL, delete when no clients */ | |
31 | int refcount; | |
db3efb7a | 32 | char host[IRCD_RES_HOSTLEN + 1]; |
212380e3 AC |
33 | char reject_reason[IRCD_BUFSIZE]; |
34 | unsigned int hits; | |
96274734 | 35 | time_t lastwarning; |
212380e3 AC |
36 | }; |
37 | ||
38 | /* A lookup in progress for a particular DNSBL for a particular client */ | |
39 | struct BlacklistClient { | |
40 | struct Blacklist *blacklist; | |
41 | struct Client *client_p; | |
42 | struct DNSQuery dns_query; | |
5b96d9a6 | 43 | rb_dlink_node node; |
212380e3 AC |
44 | }; |
45 | ||
46 | /* public interfaces */ | |
47 | struct Blacklist *new_blacklist(char *host, char *reject_entry); | |
48 | void lookup_blacklists(struct Client *client_p); | |
49 | void abort_blacklist_queries(struct Client *client_p); | |
50 | void unref_blacklist(struct Blacklist *blptr); | |
51 | void destroy_blacklists(void); | |
52 | ||
5b96d9a6 | 53 | extern rb_dlink_list blacklist_list; |
212380e3 AC |
54 | |
55 | #endif |