diff options
-rw-r--r-- | filter/config.Y | 13 | ||||
-rw-r--r-- | filter/filter.c | 22 | ||||
-rw-r--r-- | filter/filter.h | 1 |
3 files changed, 15 insertions, 21 deletions
diff --git a/filter/config.Y b/filter/config.Y index b81bd6c..95ce5ea 100644 --- a/filter/config.Y +++ b/filter/config.Y @@ -5,13 +5,6 @@ * * Can be freely distributed and used under the terms of the GNU GPL. * - FIXME (nonurgent): define keyword - FIXME (for BGP): whole system of paths, path ~ string, path.prepend(), path.originate - FIXME: create community lists - FIXME: IP addresses in ipv6 - - - FIXME: check messages for \n at the end */ CF_HDR @@ -77,7 +70,7 @@ type: | type SET { switch ($1) { default: - cf_error( "You can not create sets of this type\n" ); + cf_error( "You can not create sets of this type" ); case T_INT: case T_IP: case T_PREFIX: case T_PAIR: } $$ = $1 | T_SET; @@ -184,7 +177,7 @@ cmds: /* EMPTY */ { $$ = NULL; } | cmd cmds { if ($1) { if ($1->next) - bug("Command has next already set\n"); + bug("Command has next already set"); $1->next = $2; $$ = $1; } else $$ = $2; @@ -496,7 +489,7 @@ cmd: $$ = f_new_inst(); DBG( "Ook, we'll set value\n" ); if (($1->class & ~T_MASK) != SYM_VARIABLE) - cf_error( "You may only set variables, and this is %x.\n", $1->class ); + cf_error( "You may only set variables, and this is %x.", $1->class ); $$->code = 's'; $$->a1.p = $1; $$->a2.p = $3; diff --git a/filter/filter.c b/filter/filter.c index f6d1b3f..e300794 100644 --- a/filter/filter.c +++ b/filter/filter.c @@ -45,6 +45,14 @@ #define CMP_ERROR 999 +struct adata * +adata_empty(struct linpool *pool) +{ + struct adata *res = lp_alloc(pool, sizeof(struct adata)); + res->length = 0; + return res; +} + static int pm_path_compare(struct f_path_mask *m1, struct f_path_mask *m2) { @@ -173,7 +181,7 @@ val_print(struct f_val v) case T_ENUM: PRINTF( "(enum %x)%d", v.type, v.val.i ); break; case T_PATH: as_path_format(v.val.ad, buf2, 1020); PRINTF( "(path %s)", buf2 ); break; case T_CLIST: int_set_format(v.val.ad, buf2, 1020); PRINTF( "(clist %s)", buf2 ); break; - case T_PATH_MASK: debug( "(pathmask " ); { struct f_path_mask *p = v.val.s; while (p) { debug("%d ", p->val); p=p->next; } debug(")" ); } break; + case T_PATH_MASK: debug( "(pathmask " ); { struct f_path_mask *p = v.val.path_mask; while (p) { debug("%d ", p->val); p=p->next; } debug(")" ); } break; default: PRINTF( "[unknown type %x]", v.type ); #undef PRINTF } @@ -423,7 +431,7 @@ interpret(struct f_inst *what) res.val.ad = e->u.ptr; break; default: - bug("Unknown type in e,a\n"); + bug("Unknown type in e,a"); } } break; @@ -519,7 +527,7 @@ interpret(struct f_inst *what) v1.type = T_VOID; t = find_tree(what->a2.p, v1); if (!t) { - debug( "No else statement?\n "); + debug( "No else statement?\n"); break; } } @@ -727,11 +735,3 @@ filter_same(struct filter *new, struct filter *old) return 0; return i_same(new->root, old->root); } - -struct adata * -adata_empty(struct linpool *pool) -{ - struct adata *res = lp_alloc(pool, sizeof(struct adata)); - res->length = 0; - return res; -} diff --git a/filter/filter.h b/filter/filter.h index 02b22ff..1039c6f 100644 --- a/filter/filter.h +++ b/filter/filter.h @@ -62,6 +62,7 @@ struct filter { 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_tree *f_new_tree(void); +struct f_inst *f_generate_complex(int operation, int operation_aux, struct f_inst *dyn, struct f_inst *argument); struct f_tree *build_tree(struct f_tree *); struct f_tree *find_tree(struct f_tree *t, struct f_val val); |