mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2024-11-09 12:48:43 +00:00
New type variable 'V' defined in filters. This type is checked
only for name, never for value in function filter_same()
This commit is contained in:
parent
43de796b8a
commit
9be1086d29
@ -397,8 +397,9 @@ term:
|
|||||||
case SYM_VARIABLE | T_PATH:
|
case SYM_VARIABLE | T_PATH:
|
||||||
case SYM_VARIABLE | T_PATH_MASK:
|
case SYM_VARIABLE | T_PATH_MASK:
|
||||||
case SYM_VARIABLE | T_CLIST:
|
case SYM_VARIABLE | T_CLIST:
|
||||||
$$->code = 'C';
|
$$->code = 'V';
|
||||||
$$->a1.p = $1->def;
|
$$->a1.p = $1->def;
|
||||||
|
$$->a2.p = $1->name;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
cf_error("%s: variable expected.", $1->name );
|
cf_error("%s: variable expected.", $1->name );
|
||||||
|
@ -489,6 +489,7 @@ interpret(struct f_inst *what)
|
|||||||
else
|
else
|
||||||
res.val.i = what->a2.i;
|
res.val.i = what->a2.i;
|
||||||
break;
|
break;
|
||||||
|
case 'V':
|
||||||
case 'C':
|
case 'C':
|
||||||
res = * ((struct f_val *) what->a1.p);
|
res = * ((struct f_val *) what->a1.p);
|
||||||
break;
|
break;
|
||||||
@ -855,10 +856,12 @@ i_same(struct f_inst *f1, struct f_inst *f2)
|
|||||||
case T_PREFIX_SET:
|
case T_PREFIX_SET:
|
||||||
if (!trie_same(f1->a2.p, f2->a2.p))
|
if (!trie_same(f1->a2.p, f2->a2.p))
|
||||||
return 0;
|
return 0;
|
||||||
|
break;
|
||||||
|
|
||||||
case T_SET:
|
case T_SET:
|
||||||
if (!same_tree(f1->a2.p, f2->a2.p))
|
if (!same_tree(f1->a2.p, f2->a2.p))
|
||||||
return 0;
|
return 0;
|
||||||
|
break;
|
||||||
|
|
||||||
case T_STRING:
|
case T_STRING:
|
||||||
if (strcmp(f1->a2.p, f2->a2.p))
|
if (strcmp(f1->a2.p, f2->a2.p))
|
||||||
@ -873,6 +876,10 @@ i_same(struct f_inst *f1, struct f_inst *f2)
|
|||||||
if (val_compare(* (struct f_val *) f1->a1.p, * (struct f_val *) f2->a1.p))
|
if (val_compare(* (struct f_val *) f1->a1.p, * (struct f_val *) f2->a1.p))
|
||||||
return 0;
|
return 0;
|
||||||
break;
|
break;
|
||||||
|
case 'V':
|
||||||
|
if (strcmp((char *) f1->a2.p, (char *) f2->a2.p))
|
||||||
|
return 0;
|
||||||
|
break;
|
||||||
case 'p': case 'L': ONEARG; break;
|
case 'p': case 'L': ONEARG; break;
|
||||||
case '?': TWOARGS; break;
|
case '?': TWOARGS; break;
|
||||||
case '0': case 'E': break;
|
case '0': case 'E': break;
|
||||||
|
Loading…
Reference in New Issue
Block a user