From 1d5ee209d3198b7683d8c9ceab9838e02df62b68 Mon Sep 17 00:00:00 2001 From: Alex 'AdUser' Z Date: Fri, 26 Aug 2016 00:07:33 +1000 Subject: [PATCH] * bind stats() on filter library load --- src/filter.c | 2 ++ src/filter.h | 1 + 2 files changed, 3 insertions(+) diff --git a/src/filter.c b/src/filter.c index 91efa43..ca837e6 100644 --- a/src/filter.c +++ b/src/filter.c @@ -96,6 +96,8 @@ f2b_filter_create(f2b_config_section_t *config, const char *file) { goto cleanup; if ((*(void **) (&filter->ready) = dlsym(filter->h, "ready")) == NULL) goto cleanup; + if ((*(void **) (&filter->stats) = dlsym(filter->h, "stats")) == NULL) + goto cleanup; if ((*(void **) (&filter->match) = dlsym(filter->h, "match")) == NULL) goto cleanup; if ((*(void **) (&filter->destroy) = dlsym(filter->h, "destroy")) == NULL) diff --git a/src/filter.h b/src/filter.h index fa4ddb4..c40c955 100644 --- a/src/filter.h +++ b/src/filter.h @@ -18,6 +18,7 @@ typedef struct f2b_filter_t { bool (*append) (void *cfg, const char *pattern); char *(*error) (void *cfg); bool (*ready) (void *cfg); + bool (*stats) (void *cfg, int **matches, char **pattern, bool reset); bool (*match) (void *cfg, const char *line, char *buf, size_t buf_size); void (*destroy) (void *cfg); } f2b_filter_t;