diff --git a/filter/config.Y b/filter/config.Y index 45444eb2..353e27ae 100644 --- a/filter/config.Y +++ b/filter/config.Y @@ -946,22 +946,10 @@ term: | '-' '-' EMPTY '-' '-' { $$ = f_new_inst(FI_CONSTANT, f_get_empty(T_ECLIST)); } | '-' '-' '-' EMPTY '-' '-' '-' { $$ = f_new_inst(FI_CONSTANT, f_get_empty(T_LCLIST)); } - | PREPEND '(' term ',' term ')' { - $$ = f_dispatch_method_x("prepend", $3->type, $3, $5); - cf_warn("prepend(x,y) function is deprecated, please use x.prepend(y)"); - } - | ADD '(' term ',' term ')' { - $$ = f_dispatch_method_x("add", $3->type, $3, $5); - cf_warn("add(x,y) function is deprecated, please use x.add(y)"); - } - | DELETE '(' term ',' term ')' { - $$ = f_dispatch_method_x("delete", $3->type, $3, $5); - cf_warn("delete(x,y) function is deprecated, please use x.delete(y)"); - } - | FILTER '(' term ',' term ')' { - $$ = f_dispatch_method_x("filter", $3->type, $3, $5); - cf_warn("filter(x,y) function is deprecated, please use x.filter(y)"); - } + | PREPEND '(' term ',' term ')' { $$ = f_dispatch_method_x("prepend", $3->type, $3, $5); } + | ADD '(' term ',' term ')' { $$ = f_dispatch_method_x("add", $3->type, $3, $5); } + | DELETE '(' term ',' term ')' { $$ = f_dispatch_method_x("delete", $3->type, $3, $5); } + | FILTER '(' term ',' term ')' { $$ = f_dispatch_method_x("filter", $3->type, $3, $5); } | ROA_CHECK '(' rtable ')' { $$ = f_implicit_roa_check($3); } | ROA_CHECK '(' rtable ',' term ',' term ')' { $$ = f_new_inst(FI_ROA_CHECK, $5, $7, $3); } diff --git a/filter/f-inst.c b/filter/f-inst.c index dab6cdfb..2a6ef6cf 100644 --- a/filter/f-inst.c +++ b/filter/f-inst.c @@ -874,6 +874,11 @@ case T_IP: RESULT_(T_IP, ip, *((const ip_addr *) e->u.ptr->data)); break; + + case T_STRING: + RESULT_(T_STRING, s, (const char *) e->u.ptr->data); + break; + default: RESULT_VAL([[(struct f_val) { .type = e->type, @@ -916,6 +921,11 @@ EA_LITERAL_STORE_ADATA(da, 0, &v1.val.ip, sizeof(ip_addr))); break; + case T_STRING: + a = ea_set_attr(&fs->rte->attrs, + EA_LITERAL_STORE_ADATA(da, 0, &v1.val.s, strlen(v1.val.s) + 1)); + break; + default: a = ea_set_attr(&fs->rte->attrs, EA_LITERAL_GENERIC(da->id, da->type, 0, .u = v1.val.bval)); diff --git a/nest/rt-attr.c b/nest/rt-attr.c index e29ded29..468b279d 100644 --- a/nest/rt-attr.c +++ b/nest/rt-attr.c @@ -1446,6 +1446,9 @@ ea_show(struct cli *c, const eattr *e) case T_LCLIST: ea_show_lc_set(c, cls->name, ad, buf); return; + case T_STRING: + bsnprintf(pos, end - pos, "%s", (const char *) ad->data); + break; case T_NEXTHOP_LIST: ea_show_nexthop_list(c, (struct nexthop_adata *) e->u.ptr); return;