X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=postlicyd%2Ftst-rbl.c;h=b48a90d7968792008b3f45bd59913acaedf85cf5;hb=e327d3786ba0371eaaff8e6ba0fe3fc39f095ae2;hp=8ba5e1232bd47d2ec11ad0f6099e73f87263616a;hpb=a9f9acc91df4c895a8051a745b9f4ef74b47b9f4;p=apps%2Fpfixtools.git diff --git a/postlicyd/tst-rbl.c b/postlicyd/tst-rbl.c index 8ba5e12..b48a90d 100644 --- a/postlicyd/tst-rbl.c +++ b/postlicyd/tst-rbl.c @@ -38,20 +38,21 @@ __FILE__, __LINE__, __func__, ##__VA_ARGS__) #include "common.h" -#include "rbl.h" +#include "iplist.h" +#include "array.h" int main(int argc, char *argv[]) { if (argc > 1) { rbldb_t *db = rbldb_create(argv[1], false); printf("loaded: %s, %d ips, %d o\n", argv[1], rbldb_stats(db), - rbldb_stats(db) * 4); + rbldb_stats(db) * 2 + 65536 * sizeof(A(uint16_t))); time_t now = time(NULL); - for (uint32_t i = 0 ; i < 100000000 ; ++i) { + for (uint32_t i = 0 ; i < 1000000000 ; ++i) { rbldb_ipv4_lookup(db, (88 << 24) | (170 << 16) | (239 << 8) | (132)); } - printf("%ld request per second\n", 100000000 / (time(NULL) - now)); + printf("%ld request per second\n", 1000000000 / (time(NULL) - now)); rbldb_delete(&db); } return 0;