1
0
mirror of https://gitlab.labs.nic.cz/labs/bird.git synced 2024-05-11 16:54:54 +00:00

Filter refactoring: Passing the resulting struct f_val as a pointer.

This also drops the multiplexing of errors with the f_val itself
together with the T_RETURN f_val type flag.
This commit is contained in:
Jan Maria Matejka
2018-12-17 13:51:11 +01:00
committed by Maria Matejka
parent f62a369fb4
commit 7afa143886
7 changed files with 60 additions and 61 deletions

View File

@@ -175,9 +175,19 @@ void trie_format(struct f_trie *t, buffer *buf);
struct ea_list;
struct rte;
int f_run(struct filter *filter, struct rte **rte, struct linpool *tmp_pool, int flags);
struct f_val f_eval_rte(struct f_inst *expr, struct rte **rte, struct linpool *tmp_pool);
struct f_val f_eval(struct f_inst *expr, struct linpool *tmp_pool);
enum filter_return {
F_NOP = 0,
F_NONL,
F_RETURN,
F_ACCEPT, /* Need to preserve ordering: accepts < rejects! */
F_REJECT,
F_ERROR,
F_QUITBIRD,
};
enum filter_return f_run(struct filter *filter, struct rte **rte, struct linpool *tmp_pool, int flags);
enum filter_return f_eval_rte(struct f_inst *expr, struct rte **rte, struct linpool *tmp_pool);
enum filter_return f_eval(struct f_inst *expr, struct linpool *tmp_pool, struct f_val *pres);
uint f_eval_int(struct f_inst *expr);
char *filter_name(struct filter *filter);
@@ -190,14 +200,6 @@ int val_same(struct f_val v1, struct f_val v2);
void val_format(struct f_val v, buffer *buf);
#define F_NOP 0
#define F_NONL 1
#define F_ACCEPT 2 /* Need to preserve ordering: accepts < rejects! */
#define F_REJECT 3
#define F_ERROR 4
#define F_QUITBIRD 5
#define FILTER_ACCEPT NULL
#define FILTER_REJECT ((void *) 1)
#define FILTER_UNDEF ((void *) 2) /* Used in BGP */
@@ -246,7 +248,6 @@ void val_format(struct f_val v, buffer *buf);
#define T_LCLIST 0x29 /* Large community list */
#define T_RD 0x2a /* Route distinguisher for VPN addresses */
#define T_RETURN 0x40
#define T_SET 0x80
#define T_PREFIX_SET 0x81