summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--filter/f-util.c13
-rw-r--r--filter/filter.h12
2 files changed, 20 insertions, 5 deletions
diff --git a/filter/f-util.c b/filter/f-util.c
index 12902df..6605091 100644
--- a/filter/f-util.c
+++ b/filter/f-util.c
@@ -146,7 +146,7 @@ f_new_inst(void)
}
int
-f_run(struct filter *filter, struct rte *rtein, struct rte **rteout)
+f_run(struct filter *filter, struct rte **rte, struct ea_list **tmp_attrs, struct linpool *tmp_pool)
{
struct f_inst *inst;
struct f_val res;
@@ -160,6 +160,17 @@ f_run(struct filter *filter, struct rte *rtein, struct rte **rteout)
return res.val.i;
}
+char *
+filter_name(struct filter *filter)
+{
+ if (!filter)
+ return "ACCEPT";
+ else if (filter == FILTER_REJECT)
+ return "REJECT";
+ else
+ return filter->name;
+}
+
void
filters_postconfig(void)
{
diff --git a/filter/filter.h b/filter/filter.h
index ba8dc85..d8ee7ef 100644
--- a/filter/filter.h
+++ b/filter/filter.h
@@ -32,14 +32,18 @@ struct filter {
void filters_postconfig(void);
struct f_inst *f_new_inst(void);
-int f_run(struct filter *filter, struct rte *rtein, struct rte **rteout);
+int f_run(struct filter *filter, struct rte **rte, struct ea_list **tmp_attrs, struct linpool *tmp_pool);
+char *filter_name(struct filter *filter);
-#define F_ACCEPT 1
-#define F_REJECT 2
-#define F_MODIFY 3
+#define F_ACCEPT 1 /* Need to preserve ordering: accepts < rejects! */
+#define F_MODIFY 2 /* FIXME: Introduce modification flags instead? */
+#define F_REJECT 3
#define F_ERROR 4
#define F_QUITBIRD 5
+#define FILTER_ACCEPT NULL
+#define FILTER_REJECT ((void *) 1)
+
/* Type numbers must be in 0..0xff range */
#define T_MASK 0xff