From a9f9acc91df4c895a8051a745b9f4ef74b47b9f4 Mon Sep 17 00:00:00 2001 From: Florent Bruneau Date: Sat, 4 Oct 2008 22:19:53 +0200 Subject: [PATCH] Fix compilation of tst-rbl. Signed-off-by: Florent Bruneau --- postlicyd/Makefile | 4 ++-- postlicyd/tst-rbl.c | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/postlicyd/Makefile b/postlicyd/Makefile index ac0e95a..628907d 100644 --- a/postlicyd/Makefile +++ b/postlicyd/Makefile @@ -36,14 +36,14 @@ GENERATED = policy_tokens.h policy_tokens.c \ filter_tokens.h filter_tokens.c \ hook_tokens.h hook_tokens.c \ param_tokens.h param_tokens.c -TESTS = test-rbl tst-filters +TESTS = tst-rbl tst-filters FILTERS = rbl.c greylist.c strlist.c match.c postlicyd_SOURCES = main-postlicyd.c ../common/lib.a filter.c config.c query.c $(FILTERS) $(GENERATED) postlicyd_LIBADD = $(TC_LIBS) -tst-rbl_SOURCES = tst-rbl.c +tst-rbl_SOURCES = tst-rbl.c ../common/lib.a filter.c config.c query.c rbl.c $(GENERATED) tst-filters_SOURCES = tst-filters.c ../common/lib.a config.c filter.c query.c $(FILTERS) $(GENERATED) tst-filters_LIBADD = $(TC_LIBS) diff --git a/postlicyd/tst-rbl.c b/postlicyd/tst-rbl.c index 3087560..8ba5e12 100644 --- a/postlicyd/tst-rbl.c +++ b/postlicyd/tst-rbl.c @@ -38,7 +38,7 @@ __FILE__, __LINE__, __func__, ##__VA_ARGS__) #include "common.h" -#include "rbl.c" +#include "rbl.h" int main(int argc, char *argv[]) { @@ -46,6 +46,12 @@ int main(int argc, char *argv[]) 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); + + time_t now = time(NULL); + for (uint32_t i = 0 ; i < 100000000 ; ++i) { + rbldb_ipv4_lookup(db, (88 << 24) | (170 << 16) | (239 << 8) | (132)); + } + printf("%ld request per second\n", 100000000 / (time(NULL) - now)); rbldb_delete(&db); } return 0; -- 2.20.1