projects
/
apps
/
pfixtools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Basic support for async filters.
[apps/pfixtools.git]
/
postlicyd
/
iplist.c
diff --git
a/postlicyd/iplist.c
b/postlicyd/iplist.c
index
5337dca
..
867f88b
100644
(file)
--- a/
postlicyd/iplist.c
+++ b/
postlicyd/iplist.c
@@
-299,7
+299,7
@@
static bool rbl_filter_constructor(filter_t *filter)
lock = false;
} else {
PARSE_CHECK(false, "illegal locking state %.*s",
lock = false;
} else {
PARSE_CHECK(false, "illegal locking state %.*s",
-
p - current
, current);
+
(int)(p - current)
, current);
}
break;
}
break;
@@
-307,7
+307,7
@@
static bool rbl_filter_constructor(filter_t *filter)
weight = strtol(current, &next, 10);
PARSE_CHECK(next == p && weight >= 0 && weight <= 1024,
"illegal weight value %.*s",
weight = strtol(current, &next, 10);
PARSE_CHECK(next == p && weight >= 0 && weight <= 1024,
"illegal weight value %.*s",
- (p - current), current);
+ (
int)(
p - current), current);
break;
case 2:
break;
case 2:
@@
-342,7
+342,7
@@
static bool rbl_filter_constructor(filter_t *filter)
weight = strtol(current, &next, 10);
PARSE_CHECK(next == p && weight >= 0 && weight <= 1024,
"illegal weight value %.*s",
weight = strtol(current, &next, 10);
PARSE_CHECK(next == p && weight >= 0 && weight <= 1024,
"illegal weight value %.*s",
- (p - current), current);
+ (
int)(
p - current), current);
break;
case 1:
break;
case 1:
@@
-391,7
+391,8
@@
static void rbl_filter_destructor(filter_t *filter)
filter->data = data;
}
filter->data = data;
}
-static filter_result_t rbl_filter(const filter_t *filter, const query_t *query)
+static filter_result_t rbl_filter(const filter_t *filter, const query_t *query,
+ filter_context_t *context)
{
uint32_t ip;
int32_t sum = 0;
{
uint32_t ip;
int32_t sum = 0;
@@
-450,7
+451,8
@@
static filter_result_t rbl_filter(const filter_t *filter, const query_t *query)
static int rbl_init(void)
{
filter_type_t type = filter_register("iplist", rbl_filter_constructor,
static int rbl_init(void)
{
filter_type_t type = filter_register("iplist", rbl_filter_constructor,
- rbl_filter_destructor, rbl_filter);
+ rbl_filter_destructor, rbl_filter,
+ NULL, NULL);
/* Hooks.
*/
(void)filter_hook_register(type, "abort");
/* Hooks.
*/
(void)filter_hook_register(type, "abort");
@@
-458,6
+460,7
@@
static int rbl_init(void)
(void)filter_hook_register(type, "fail");
(void)filter_hook_register(type, "hard_match");
(void)filter_hook_register(type, "soft_match");
(void)filter_hook_register(type, "fail");
(void)filter_hook_register(type, "hard_match");
(void)filter_hook_register(type, "soft_match");
+ (void)filter_hook_register(type, "async");
/* Parameters.
*/
/* Parameters.
*/