summaryrefslogtreecommitdiff
path: root/proto
diff options
context:
space:
mode:
authorMikael Magnusson <mikma@users.sourceforge.net>2023-11-25 23:34:03 +0100
committerMikael Magnusson <mikma@users.sourceforge.net>2023-11-25 23:34:03 +0100
commitd83b1c9e067f707ec51ea14385ebe5ce000d0c73 (patch)
tree4341888d55ebd89bece2a95efe2e55ecc9e9b663 /proto
parentf92ffd893919d6b1e46cded7337bb39c5a3fd84e (diff)
parenta0fb0eaa6780e60b7c5434dfe0e2ed402e5a4ea4 (diff)
Merge commit 'a0fb0eaa' into wireguard-next-tmp7-1
Diffstat (limited to 'proto')
-rw-r--r--proto/bgp/config.Y11
1 files changed, 10 insertions, 1 deletions
diff --git a/proto/bgp/config.Y b/proto/bgp/config.Y
index 7311a160..2252d7fe 100644
--- a/proto/bgp/config.Y
+++ b/proto/bgp/config.Y
@@ -364,7 +364,16 @@ dynamic_attr: BGP_OTC
dynamic_attr: BGP_TUNNEL_ENCAP
{ $$ = f_new_dynamic_attr(EAF_TYPE_TUNNEL_ENCAP, T_TLVLIST, EA_CODE(PROTOCOL_BGP, BA_TUNNEL_ENCAP)); } ;
-
+custom_attr: ATTRIBUTE BGP NUM type symbol ';' {
+ if($3 > 255 || $3 < 1)
+ cf_error("Invalid attribute number. (Given %i, must be 1-255.)", $3);
+ if($4 != T_BYTESTRING)
+ cf_error("Attribute type must be bytestring, not %s.", f_type_name($4));
+ struct f_dynamic_attr* a = (struct f_dynamic_attr*) malloc(sizeof(struct f_dynamic_attr));
+ *a = f_new_dynamic_attr(f_type_attr($4), T_BYTESTRING, EA_CODE(PROTOCOL_BGP, $3));
+ a->flags = BAF_TRANSITIVE | BAF_OPTIONAL;
+ cf_define_symbol(new_config, $5, SYM_ATTRIBUTE, attribute, a);
+};
CF_ENUM(T_ENUM_BGP_ORIGIN, ORIGIN_, IGP, EGP, INCOMPLETE)