]> jfr.im git - solanum.git/blobdiff - include/blacklist.h
chmode: Move add_id() to a boolean
[solanum.git] / include / blacklist.h
index c277da909710910f03354c56e3f2cff99bc62ead..7c8fc23ee517d2eb8f546fe6a10b75e91c9498c3 100644 (file)
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
  *  USA
- *
  */
 
 #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 */
@@ -31,7 +35,8 @@ struct Blacklist {
        int ipv4;       /* Does this blacklist support IPv4 lookups? */
        int ipv6;       /* Does this blacklist support IPv6 lookups? */
        char host[IRCD_RES_HOSTLEN + 1];
-       char reject_reason[IRCD_BUFSIZE];
+       rb_dlink_list filters;  /* Filters for queries */
+       char reject_reason[BUFSIZE];
        unsigned int hits;
        time_t lastwarning;
 };
@@ -40,12 +45,19 @@ struct Blacklist {
 struct BlacklistClient {
        struct Blacklist *blacklist;
        struct Client *client_p;
-       struct DNSQuery dns_query;
+       uint16_t dns_id;
+       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_reason, int ipv4, int ipv6);
+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);