summaryrefslogtreecommitdiff
path: root/proto/bgp/attrs.c
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2023-10-05 21:29:04 +0200
committerOndrej Zajicek <santiago@crfreenet.org>2023-10-05 21:54:25 +0200
commit57aa077227d1f2440dc1b2bb6cbbebd418a6b898 (patch)
tree6fa256de15ca415262cfaeb7c4e0cc61cca3cdd1 /proto/bgp/attrs.c
parentba01a6f2e66d03eb5d9426fdf4973f30e09c5710 (diff)
BGP: Improve custom BGP attributes
- Implement EA_GET for custom BGP attributes - Forbid EA_SET on existing opaque attributes - Forbid redefining existing attributes - Document possible compatibility problems
Diffstat (limited to 'proto/bgp/attrs.c')
-rw-r--r--proto/bgp/attrs.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/proto/bgp/attrs.c b/proto/bgp/attrs.c
index 9387ddba..4346cd5d 100644
--- a/proto/bgp/attrs.c
+++ b/proto/bgp/attrs.c
@@ -1152,6 +1152,12 @@ bgp_attr_known(uint code)
return (code < ARRAY_SIZE(bgp_attr_table)) && bgp_attr_table[code].name;
}
+const char *
+bgp_attr_name(uint code)
+{
+ return (code < ARRAY_SIZE(bgp_attr_table)) ? bgp_attr_table[code].name : NULL;
+}
+
void bgp_fix_attr_flags(ea_list *attrs)
{
for (u8 i = 0; i < attrs->count; i++)