X-Git-Url: http://git.madism.org/?p=apps%2Fpfixtools.git;a=blobdiff_plain;f=common%2Frbl.h;h=cefa5da42a9319cf21716e2511619c8967935b3d;hp=4a1e763fef633edc0003705c9b48887412c01ff6;hb=6deab7a7086ccb592daa0c41e12759ec0b9c7aa0;hpb=ae0c2eb5d2ea501fd9e458fc138696c268a14569 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