X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=common%2Frbl.h;h=cefa5da42a9319cf21716e2511619c8967935b3d;hb=8b037ff01fb49d7de7776c8be6e69d28739128d5;hp=4a1e763fef633edc0003705c9b48887412c01ff6;hpb=91da9fe6f37e6a82b226622e1a3e90ee85a9a138;p=apps%2Fpfixtools.git diff --git a/common/rbl.h b/common/rbl.h index 4a1e763..cefa5da 100644 --- a/common/rbl.h +++ b/common/rbl.h @@ -39,19 +39,25 @@ #include "common.h" typedef enum { + RBL_ASYNC, RBL_ERROR, RBL_FOUND, RBL_NOTFOUND, } rbl_result_t; +ARRAY(rbl_result_t); + +typedef void (*rbl_result_callback_t)(rbl_result_t *result, void *data); /** Check the presence of the given IP in the given rbl. */ -__attribute__((nonnull(1))) -rbl_result_t rbl_check(const char *rbl, uint32_t ip); +__attribute__((nonnull(1,3))) +bool rbl_check(const char *rbl, uint32_t ip, rbl_result_t *result, + rbl_result_callback_t callback, void *data); /** Check the presence of the given hostname in the given rhbl. */ -__attribute__((nonnull(1,2))) -rbl_result_t rhbl_check(const char *rhbl, const char *hostname); +__attribute__((nonnull(1,2,3))) +bool rhbl_check(const char *rhbl, const char *hostname, rbl_result_t *result, + rbl_result_callback_t callback, void *data); #endif