summaryrefslogtreecommitdiffstats
path: root/vtysh/vtysh_config.c
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas.abraitis@gmail.com>2021-04-21 21:34:12 +0200
committerDonatas Abraitis <donatas.abraitis@gmail.com>2021-05-05 15:37:00 +0200
commited0e57e3f079352714c3a3a8a5b0dddf4aadfe1d (patch)
tree8c9cc817cb849107898633eb5d1d3201135fba10 /vtysh/vtysh_config.c
parentMerge pull request #8619 from donaldsharp/sharp_redistribute (diff)
downloadfrr-ed0e57e3f079352714c3a3a8a5b0dddf4aadfe1d.tar.xz
frr-ed0e57e3f079352714c3a3a8a5b0dddf4aadfe1d.zip
bgpd: Create BGP alias names for community/large-community
Show alias name instead of numerical value in `show bgp <prefix>. E.g.: ``` root@exit1-debian-9:~/frr# vtysh -c 'sh run' | grep 'bgp community alias' bgp community alias 65001:123 community-1 bgp community alias 65001:123:1 lcommunity-1 root@exit1-debian-9:~/frr# ``` ``` exit1-debian-9# sh ip bgp 172.16.16.1/32 BGP routing table entry for 172.16.16.1/32, version 21 Paths: (2 available, best #2, table default) Advertised to non peer-group peers: 65030 192.168.0.2 from home-spine1.donatas.net(192.168.0.2) (172.16.16.1) Origin incomplete, metric 0, valid, external, best (Neighbor IP) Community: 65001:12 65001:13 community-1 65001:65534 Large Community: lcommunity-1 65001:123:2 Last update: Fri Apr 16 12:51:27 2021 exit1-debian-9# ``` Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
Diffstat (limited to 'vtysh/vtysh_config.c')
-rw-r--r--vtysh/vtysh_config.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/vtysh/vtysh_config.c b/vtysh/vtysh_config.c
index 3414c764c..f92b0e920 100644
--- a/vtysh/vtysh_config.c
+++ b/vtysh/vtysh_config.c
@@ -380,6 +380,9 @@ void vtysh_config_parse_line(void *arg, const char *line)
strlen("bgp large-community-list"))
== 0)
config = config_get(COMMUNITY_LIST_NODE, line);
+ else if (strncmp(line, "bgp community alias",
+ strlen("bgp community alias")) == 0)
+ config = config_get(COMMUNITY_ALIAS_NODE, line);
else if (strncmp(line, "ip route", strlen("ip route")) == 0)
config = config_get(IP_NODE, line);
else if (strncmp(line, "ipv6 route", strlen("ipv6 route")) == 0)
@@ -452,11 +455,12 @@ void vtysh_config_parse_line(void *arg, const char *line)
#define NO_DELIMITER(I) \
((I) == ACCESS_NODE || (I) == PREFIX_NODE || (I) == IP_NODE \
|| (I) == AS_LIST_NODE || (I) == COMMUNITY_LIST_NODE \
- || (I) == ACCESS_IPV6_NODE || (I) == ACCESS_MAC_NODE \
- || (I) == PREFIX_IPV6_NODE || (I) == FORWARDING_NODE \
- || (I) == DEBUG_NODE || (I) == AAA_NODE || (I) == VRF_DEBUG_NODE \
- || (I) == NORTHBOUND_DEBUG_NODE || (I) == RMAP_DEBUG_NODE \
- || (I) == RESOLVER_DEBUG_NODE || (I) == MPLS_NODE)
+ || (I) == COMMUNITY_ALIAS_NODE || (I) == ACCESS_IPV6_NODE \
+ || (I) == ACCESS_MAC_NODE || (I) == PREFIX_IPV6_NODE \
+ || (I) == FORWARDING_NODE || (I) == DEBUG_NODE || (I) == AAA_NODE \
+ || (I) == VRF_DEBUG_NODE || (I) == NORTHBOUND_DEBUG_NODE \
+ || (I) == RMAP_DEBUG_NODE || (I) == RESOLVER_DEBUG_NODE \
+ || (I) == MPLS_NODE)
/* Display configuration to file pointer. */
void vtysh_config_dump(void)