From 57aa077227d1f2440dc1b2bb6cbbebd418a6b898 Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Thu, 5 Oct 2023 21:29:04 +0200 Subject: 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 --- proto/bgp/attrs.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'proto/bgp/attrs.c') 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++) -- cgit v1.2.3