mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2024-12-22 09:41:54 +00:00
Filter: Add support for string route attribute
This commit is contained in:
parent
574d7eb241
commit
224a152c53
@ -938,7 +938,7 @@ term:
|
|||||||
| '-' '-' EMPTY '-' '-' { $$ = f_new_inst(FI_CONSTANT, val_empty(T_ECLIST)); }
|
| '-' '-' EMPTY '-' '-' { $$ = f_new_inst(FI_CONSTANT, val_empty(T_ECLIST)); }
|
||||||
| '-' '-' '-' EMPTY '-' '-' '-' { $$ = f_new_inst(FI_CONSTANT, val_empty(T_LCLIST)); }
|
| '-' '-' '-' EMPTY '-' '-' '-' { $$ = f_new_inst(FI_CONSTANT, val_empty(T_LCLIST)); }
|
||||||
|
|
||||||
| PREPEND '(' term ',' term ')' { $$ = f_dispatch_method_x("prepend", $3->type, $3, $5); }
|
| PREPEND '(' term ',' term ')' { $$ = f_dispatch_method_x("prepend", $3->type, $3, $5); }
|
||||||
| ADD '(' term ',' term ')' { $$ = f_dispatch_method_x("add", $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); }
|
| DELETE '(' term ',' term ')' { $$ = f_dispatch_method_x("delete", $3->type, $3, $5); }
|
||||||
| FILTER '(' term ',' term ')' { $$ = f_dispatch_method_x("filter", $3->type, $3, $5); }
|
| FILTER '(' term ',' term ')' { $$ = f_dispatch_method_x("filter", $3->type, $3, $5); }
|
||||||
|
@ -861,6 +861,9 @@
|
|||||||
case EAF_TYPE_LC_SET:
|
case EAF_TYPE_LC_SET:
|
||||||
RESULT_(T_LCLIST, ad, e->u.ptr);
|
RESULT_(T_LCLIST, ad, e->u.ptr);
|
||||||
break;
|
break;
|
||||||
|
case EAF_TYPE_STRING:
|
||||||
|
RESULT_(T_STRING, s, (const char *) e->u.ptr->data);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
bug("Unknown dynamic attribute type");
|
bug("Unknown dynamic attribute type");
|
||||||
}
|
}
|
||||||
@ -914,6 +917,12 @@
|
|||||||
l->attrs[0].u.ptr = v1.val.ad;
|
l->attrs[0].u.ptr = v1.val.ad;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case EAF_TYPE_STRING:;
|
||||||
|
struct adata *d = lp_alloc_adata(fs->pool, strlen(v1.val.s) + 1);
|
||||||
|
memcpy(d->data, v1.val.s, d->length);
|
||||||
|
l->attrs[0].u.ptr = d;
|
||||||
|
break;
|
||||||
|
|
||||||
case EAF_TYPE_BITFIELD:
|
case EAF_TYPE_BITFIELD:
|
||||||
{
|
{
|
||||||
/* First, we have to find the old value */
|
/* First, we have to find the old value */
|
||||||
|
@ -294,6 +294,9 @@ ca_lookup(pool *p, const char *name, int f_type)
|
|||||||
case T_LCLIST:
|
case T_LCLIST:
|
||||||
ea_type = EAF_TYPE_LC_SET;
|
ea_type = EAF_TYPE_LC_SET;
|
||||||
break;
|
break;
|
||||||
|
case T_STRING:
|
||||||
|
ea_type = EAF_TYPE_STRING;
|
||||||
|
break;
|
||||||
case T_BYTESTRING:
|
case T_BYTESTRING:
|
||||||
ea_type = EAF_TYPE_OPAQUE;
|
ea_type = EAF_TYPE_OPAQUE;
|
||||||
break;
|
break;
|
||||||
|
@ -554,7 +554,8 @@ const char *ea_custom_name(uint ea);
|
|||||||
#define EAF_TYPE_INT_SET 0x0a /* Set of u32's (e.g., a community list) */
|
#define EAF_TYPE_INT_SET 0x0a /* Set of u32's (e.g., a community list) */
|
||||||
#define EAF_TYPE_EC_SET 0x0e /* Set of pairs of u32's - ext. community list */
|
#define EAF_TYPE_EC_SET 0x0e /* Set of pairs of u32's - ext. community list */
|
||||||
#define EAF_TYPE_LC_SET 0x12 /* Set of triplets of u32's - large community list */
|
#define EAF_TYPE_LC_SET 0x12 /* Set of triplets of u32's - large community list */
|
||||||
#define EAF_TYPE_IFACE 0x16 /* Interface pointer stored in adata */
|
#define EAF_TYPE_IFACE 0x14 /* Interface pointer stored in adata */
|
||||||
|
#define EAF_TYPE_STRING 0x16 /* Text string */
|
||||||
#define EAF_EMBEDDED 0x01 /* Data stored in eattr.u.data (part of type spec) */
|
#define EAF_EMBEDDED 0x01 /* Data stored in eattr.u.data (part of type spec) */
|
||||||
#define EAF_VAR_LENGTH 0x02 /* Attribute length is variable (part of type spec) */
|
#define EAF_VAR_LENGTH 0x02 /* Attribute length is variable (part of type spec) */
|
||||||
|
|
||||||
|
@ -1015,6 +1015,9 @@ ea_show(struct cli *c, const eattr *e)
|
|||||||
case EAF_TYPE_LC_SET:
|
case EAF_TYPE_LC_SET:
|
||||||
ea_show_lc_set(c, ad, pos, buf, end);
|
ea_show_lc_set(c, ad, pos, buf, end);
|
||||||
return;
|
return;
|
||||||
|
case EAF_TYPE_STRING:
|
||||||
|
bsnprintf(pos, end - pos, "%s", (const char *) ad->data);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
bsprintf(pos, "<type %02x>", e->type);
|
bsprintf(pos, "<type %02x>", e->type);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user