summaryrefslogtreecommitdiff
path: root/filter/filter.c
diff options
context:
space:
mode:
authorPavel Machek <pavel@ucw.cz>2000-04-17 11:34:38 +0000
committerPavel Machek <pavel@ucw.cz>2000-04-17 11:34:38 +0000
commit9c400ec9dd0ee74f1f350ead87dcd7366dbab7b1 (patch)
tree8a610e3d07c2004248bd0b247c7a7b2d9af1585d /filter/filter.c
parente3558ab14ee60c8c9792bc3ed54d9f0c3eaa8ea8 (diff)
Int sets moved to core. It is now possible to have variable of type clist.
Diffstat (limited to 'filter/filter.c')
-rw-r--r--filter/filter.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/filter/filter.c b/filter/filter.c
index 267fa166..d9ef65a4 100644
--- a/filter/filter.c
+++ b/filter/filter.c
@@ -483,6 +483,21 @@ interpret(struct f_inst *what)
res.val.ad = as_path_prepend(f_pool, v1.val.ad, v2.val.i);
break;
+ case P('C','a'): /* Community list add or delete */
+ TWOARGS;
+ if (v1.type != T_CLIST)
+ runtime("Can't add/delete to non-clist");
+ if (v2.type != T_PAIR)
+ runtime("Can't add/delete non-pair");
+
+ res.type = T_CLIST;
+ switch (what->aux) {
+ case 'a': res.val.ad = int_set_add(f_pool, v1.val.ad, v2.val.i); break;
+ case 'd': res.val.ad = int_set_del(f_pool, v1.val.ad, v2.val.i); break;
+ default: bug("unknown Ca operation");
+ }
+ break;
+
default:
bug( "Unknown instruction %d (%c)", what->code, what->code & 0xff);
}
@@ -566,6 +581,7 @@ i_same(struct f_inst *f1, struct f_inst *f2)
case P('S','W'): ONEARG; if (!same_tree(f1->a2.p, f2->a2.p)) return 0; break;
case P('i','M'): TWOARGS; break;
case P('A','p'): TWOARGS; break;
+ case P('C','a'): TWOARGS; break;
default:
bug( "Unknown instruction %d in same (%c)", f1->code, f1->code & 0xff);
}