Commit graph

6 commits

Author SHA1 Message Date
Donatas Abraitis 004d770ec4 bgpd: Optimize the way parsing communities if no community alias exists
If at least one community alias is configured, then let's do the work,
otherwise we don't need to spend time on splitting stuff and creating
a new string.

This should improve the performance.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-11-18 23:29:53 +02:00
David Lamparter acddc0ed3c *: auto-convert to SPDX License IDs
Done with a combination of regex'ing and banging my head against a wall.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-02-09 14:09:11 +01:00
Igor Ryzhov 15bc6a40d3 bgpd: fix memory leaks in bgp_alias2community_str
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-08-11 12:09:15 +03:00
Donatas Abraitis f4dd829679 bgpd: BGP extended [l]community-list regexp match must work with aliases
We have to convert BGP alias to numerical format to compare in regexp.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-08-10 09:46:15 +03:00
Donald Sharp b4ad2fae54 bgpd: Allow for auto-completion of community alias's created
Add a bit of code to allow for auto-completion of the community
alias command when attempting to use it for show commands.

example:
eva(config)# bgp community alias 11:22 FOO
eva(config)# end
eva# show bgp ipv4 uni alias
  ALIAS_NAME  BGP community alias
     FOO

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-07-16 09:52:53 -04:00
Donatas Abraitis ed0e57e3f0 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>
2021-05-05 16:37:00 +03:00