]> git.proxmox.com Git - mirror_frr.git/commit
bgpd: add as-notation keyword to 'router bgp' vty command
authorPhilippe Guibert <philippe.guibert@6wind.com>
Thu, 3 Nov 2022 20:17:57 +0000 (21:17 +0100)
committerPhilippe Guibert <philippe.guibert@6wind.com>
Fri, 10 Feb 2023 09:27:23 +0000 (10:27 +0100)
commite55b08839914a3b94f361ee909ee63d265d07845
tree258aa3c96dfaefebaca81283ed35a2c2b7456684
parent8079a4138d61500117ebbffb250ceba0a894f9c0
bgpd: add as-notation keyword to 'router bgp' vty command

A new keyword permits changing the BGP as-notation output:
- [no] router bgp <> [vrf BLABLA] [as-notation [<dot|plain|dot+>]]

At the BGP instance creation, the output will inherit the way the
BGP instance is declared. For instance, the 'router bgp 1.1'
command will configure the output in the dot format. However, if
the client wants to choose an alternate output, he will have to
add the extra command: 'router bgp 1.1 as-notation dot+'.

Also, if the user wants to have plain format, even if the BGP
instance is declared in dot format, the keyword can also be used
for that.

The as-notation output is only taken into account at the BGP
instance creation. In the case where VPN instances are used,
a separate instance may be dynamically created. In that case,
the real as-notation format will be taken into acccount at the
first configuration.

Linking the as-notation format with the BGP instance makes sense,
as the operators want to keep consistency of what they configure.

One technical reason why to link the as-notation output with the
BGP instance creation is that the as-path segment lists stored
in the BGP updates use a string representation to handle aspath
operations (by using regexp for instance). Changing on the fly
the output needs to regenerate this string representation to the
correct format. Linking the configuration to the BGP instance
creation avoids refreshing the BGP updates. A similar mechanism
is put in place in junos too.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
12 files changed:
bgpd/bgp_evpn.c
bgpd/bgp_vty.c
bgpd/bgp_vty.h
bgpd/bgpd.c
bgpd/bgpd.h
doc/user/bgp.rst
lib/asn.c
lib/asn.h
tests/bgpd/test_capability.c
tests/bgpd/test_mp_attr.c
tests/bgpd/test_packet.c
vtysh/vtysh.c