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

Extends delete/filter operators to work no bgp_paths.

This commit is contained in:
Ondrej Zajicek
2013-08-15 01:06:47 +02:00
parent 8a112d8ba2
commit bff9ce5130
5 changed files with 112 additions and 3 deletions

View File

@@ -1165,7 +1165,34 @@ interpret(struct f_inst *what)
case P('C','a'): /* (Extended) Community list add or delete */
TWOARGS;
if (v1.type == T_CLIST)
if (v1.type == T_PATH)
{
struct f_tree *set = NULL;
u32 key = 0;
int pos;
if (v2.type == T_INT)
key = v2.val.i;
else if ((v2.type == T_SET) && (v2.val.t->from.type == T_INT))
set = v2.val.t;
else
runtime("Can't delete non-integer (set)");
switch (what->aux)
{
case 'a': runtime("Can't add to path");
case 'd': pos = 0; break;
case 'f': pos = 1; break;
default: bug("unknown Ca operation");
}
if (pos && !set)
runtime("Can't filter integer");
res.type = T_PATH;
res.val.ad = as_path_filter(f_pool, v1.val.ad, set, key, pos);
}
else if (v1.type == T_CLIST)
{
/* Community (or cluster) list */
struct f_val dummy;