]> jfr.im git - irc/quakenet/newserv.git/blame - rbl/rbl.h
A4STATS: remove E style escapes and switch to createtable for indices
[irc/quakenet/newserv.git] / rbl / rbl.h
CommitLineData
67af3857
GB
1#ifndef __RBL_H
2#define __RBL_H
3
4struct rbl_instance;
5
6typedef struct rbl_ops {
7 int (*lookup)(struct rbl_instance *rbl, struct irc_in_addr *ip, char *message, size_t msglen);
8 int (*refresh)(struct rbl_instance *rbl);
9 void (*dtor)(struct rbl_instance *rbl);
10} rbl_ops;
11
12typedef struct rbl_instance {
13 sstring *name;
14 const rbl_ops *ops;
15 void *udata;
16 struct rbl_instance *next;
17} rbl_instance;
18
19extern rbl_instance *rbl_instances;
20
21int registerrbl(const char *name, const rbl_ops *ops, void *udata);
22void deregisterrblbyops(const rbl_ops *ops);
23
24#define RBL_LOOKUP(rbl, ip, msg, msglen) rbl->ops->lookup(rbl, ip, msg, msglen)
25#define RBL_REFRESH(rbl) rbl->ops->refresh(rbl)
26#define RBL_DTOR(rbl) rbl->ops->dtor(rbl)
27
28#endif /* __RBL_H */