X-Git-Url: https://jfr.im/git/solanum.git/blobdiff_plain/212380e3f42f585dc1ea927402252eb943f91f7b..9e07c8f70b0d08022c44990267626115cd1d927b:/include/blacklist.h diff --git a/include/blacklist.h b/include/blacklist.h index 2fde255e..79eec92d 100644 --- a/include/blacklist.h +++ b/include/blacklist.h @@ -19,19 +19,27 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * - * $Id: blacklist.h 2023 2006-09-02 23:47:27Z jilles $ */ #ifndef _BLACKLIST_H_ #define _BLACKLIST_H_ +#include "stdinc.h" + +#define BLACKLIST_FILTER_ALL 1 +#define BLACKLIST_FILTER_LAST 2 + /* A configured DNSBL */ struct Blacklist { unsigned int status; /* If CONF_ILLEGAL, delete when no clients */ int refcount; - char host[HOSTLEN]; + int ipv4; /* Does this blacklist support IPv4 lookups? */ + int ipv6; /* Does this blacklist support IPv6 lookups? */ + char host[IRCD_RES_HOSTLEN + 1]; + rb_dlink_list filters; /* Filters for queries */ char reject_reason[IRCD_BUFSIZE]; unsigned int hits; + time_t lastwarning; }; /* A lookup in progress for a particular DNSBL for a particular client */ @@ -39,16 +47,23 @@ struct BlacklistClient { struct Blacklist *blacklist; struct Client *client_p; struct DNSQuery dns_query; - dlink_node node; + rb_dlink_node node; +}; + +/* A blacklist filter */ +struct BlacklistFilter { + int type; /* Type of filter */ + char filterstr[HOSTIPLEN]; /* The filter itself */ + rb_dlink_node node; }; /* public interfaces */ -struct Blacklist *new_blacklist(char *host, char *reject_entry); +struct Blacklist *new_blacklist(char *host, char *reject_reason, int ipv4, int ipv6, rb_dlink_list *filters); void lookup_blacklists(struct Client *client_p); void abort_blacklist_queries(struct Client *client_p); void unref_blacklist(struct Blacklist *blptr); void destroy_blacklists(void); -extern dlink_list blacklist_list; +extern rb_dlink_list blacklist_list; #endif