| prefix_s {NEW_F_VAL; $$ = f_new_inst(); $$->code = 'C'; $$->a1.p = val; *val = $1; }
| '[' set_items ']' { DBG( "We've got a set here..." ); $$ = f_new_inst(); $$->code = 'c'; $$->aux = T_SET; $$->a2.p = build_tree($2); DBG( "ook\n" ); }
| ENUM { $$ = f_new_inst(); $$->code = 'c'; $$->aux = $1 >> 16; $$->a2.i = $1 & 0xffff; }
- | '/' bgp_path '/' { $$ = f_new_inst(); $$->code = 'c'; $$->aux = T_PATH_MASK; $$->a2.p = $2; }
+ | '/' bgp_path '/' { NEW_F_VAL; $$ = f_new_inst(); $$->code = 'C'; val->type = T_PATH_MASK; val->val.path_mask = $2; $$->a1.p = val; }
;
/*
if (v2.type == T_VOID)
return 1;
- if (v1.type != v2.type)
+ if (v1.type != v2.type) {
+ debug( "Types do not match in val_compare\n" );
return CMP_ERROR;
+ }
switch (v1.type) {
case T_ENUM:
case T_INT:
case T_PREFIX:
return ipa_compare(v1.val.px.ip, v2.val.px.ip);
default:
+ debug( "Compare of unkown entities: %x\n", v1.type );
return CMP_ERROR;
}
}
-int
+int
val_simple_in_range(struct f_val v1, struct f_val v2)
{
if ((v1.type == T_PATH) && (v2.type == T_PATH_MASK))
case 'c': A2_SAME; break;
case 'C':
- if (val_compare(* (struct f_val *) f1->a1.p, * (struct f_val *) f2->a2.p))
+ if (val_compare(* (struct f_val *) f1->a1.p, * (struct f_val *) f2->a1.p))
return 0;
break;
case 'p': case 'L': ONEARG; break;
{
struct f_val res;
+#if 1
if (!i_same(test1_func, test2_func))
bug("i_same does not work");
+#endif
if (startup_func) {
debug( "Launching startup function...\n" );
f_pool = lp_new(&root_pool, 1024);
function __test1()
{
- if source = RTS_STATIC then {
- bgp_community = -empty-;
- bgp_community.add((65000,5678));
- if bgp_path ~ / 65000 / then
- bgp_path.prepend(65000);
- accept;
- }
- reject;
+ print bgp_path ~ / 65000 /;
}
function __test2()
{
- if source = RTS_STATIC then {
- bgp_community = -empty-;
- bgp_community.add((65000,5678));
- if bgp_path ~ / 65000 / then
- bgp_path.prepend(65000);
- accept;
- }
- reject;
+ print bgp_path ~ / 65000 /;
}
filter testf