0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-11-17 08:38:42 +00:00

Fixed the horrible mess Pavel has created with his last commit.

This commit is contained in:
Martin Mares 2000-05-16 22:37:53 +00:00
parent 508c36ab79
commit b1c9d87161
2 changed files with 16 additions and 20 deletions

View File

@ -43,8 +43,6 @@
#define P(a,b) ((a<<8) | b) #define P(a,b) ((a<<8) | b)
struct f_inst *startup_func = NULL, *test1_func, *test2_func;
#define CMP_ERROR 999 #define CMP_ERROR 999
static int static int
@ -665,24 +663,22 @@ f_run(struct filter *filter, struct rte **rte, struct ea_list **tmp_attrs, struc
return res.val.i; return res.val.i;
} }
void int
filters_postconfig(void) f_eval_int(struct f_inst *expr)
{ {
struct f_val res; struct f_val res;
#if 1 f_flags = 0;
if (!i_same(test1_func, test2_func)) f_tmp_attrs = NULL;
bug("i_same does not work"); f_rte = NULL;
#endif f_rte_old = NULL;
if (startup_func) { f_rta_copy = NULL;
debug( "Launching startup function...\n" ); f_pool = cfg_mem;
f_pool = lp_new(&root_pool, 1024); res = interpret(expr);
res = interpret(startup_func); if (res.type != T_INT)
if (res.type == F_ERROR) cf_error("Integer expression expected");
die( "Startup function resulted in error." ); return res.val.i;
debug( "done\n" ); }
}
}
/** /**
* filter_same - compare two filters * filter_same - compare two filters

View File

@ -31,7 +31,7 @@ struct f_inst { /* Instruction */
#define arg1 a1.p #define arg1 a1.p
#define arg2 a2.p #define arg2 a2.p
struct prefix { struct f_prefix {
ip_addr ip; ip_addr ip;
int len; int len;
#define LEN_MASK 0xff #define LEN_MASK 0xff
@ -46,7 +46,7 @@ struct f_val {
union { union {
int i; int i;
/* ip_addr ip; Folded into prefix */ /* ip_addr ip; Folded into prefix */
struct prefix px; struct f_prefix px;
char *s; char *s;
struct f_tree *t; struct f_tree *t;
struct adata *ad; struct adata *ad;
@ -59,7 +59,6 @@ struct filter {
struct f_inst *root; struct f_inst *root;
}; };
void filters_postconfig(void);
struct f_inst *f_new_inst(void); struct f_inst *f_new_inst(void);
struct f_inst *f_new_dynamic_attr(int type, int f_type, int code); /* Type as core knows it, type as filters know it, and code of dynamic attribute */ struct f_inst *f_new_dynamic_attr(int type, int f_type, int code); /* Type as core knows it, type as filters know it, and code of dynamic attribute */
struct f_tree *f_new_tree(void); struct f_tree *f_new_tree(void);
@ -72,6 +71,7 @@ struct ea_list;
struct rte; struct rte;
int f_run(struct filter *filter, struct rte **rte, struct ea_list **tmp_attrs, struct linpool *tmp_pool, int flags); int f_run(struct filter *filter, struct rte **rte, struct ea_list **tmp_attrs, struct linpool *tmp_pool, int flags);
int f_eval_int(struct f_inst *expr);
char *filter_name(struct filter *filter); char *filter_name(struct filter *filter);
int filter_same(struct filter *new, struct filter *old); int filter_same(struct filter *new, struct filter *old);