summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_evpn_vty.c
diff options
context:
space:
mode:
authorPhilippe Guibert <philippe.guibert@6wind.com>2022-11-18 13:49:53 +0100
committerPhilippe Guibert <philippe.guibert@6wind.com>2023-02-10 10:27:23 +0100
commite84c7c12f224f27ae430f2929a9fd121b133c2b3 (patch)
tree4957646b5b93635e3b9cab8281f591cda750a89d /bgpd/bgp_evpn_vty.c
parentbgpd: aspath list format binds on as-notation format (diff)
downloadfrr-e84c7c12f224f27ae430f2929a9fd121b133c2b3.tar.xz
frr-e84c7c12f224f27ae430f2929a9fd121b133c2b3.zip
bgpd: modify bgp as number output
A json AS number API is created in order to output a given AS number. In order to keep backward compatibility, if the as-notation uses a number, then the json is encoded as an integer, otherwise the encoding will be a string. For what is not relevant to running-configuration, the as-notation mode is the one used for the BGP instance. Also, the vty completion gets the configured 'as_pretty' string value, when an user wants to get the available BGP instances. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Diffstat (limited to 'bgpd/bgp_evpn_vty.c')
-rw-r--r--bgpd/bgp_evpn_vty.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/bgpd/bgp_evpn_vty.c b/bgpd/bgp_evpn_vty.c
index 6b63c6e3a..067ad525c 100644
--- a/bgpd/bgp_evpn_vty.c
+++ b/bgpd/bgp_evpn_vty.c
@@ -1345,9 +1345,9 @@ static int bgp_show_ethernet_vpn(struct vty *vty, struct prefix_rd *prd,
json,
"defaultLocPrf",
bgp->default_local_pref);
- json_object_int_add(
- json, "localAS",
- bgp->as);
+ asn_asn2json(json, "localAS",
+ bgp->as,
+ bgp->asnotation);
} else {
if (option == SHOW_DISPLAY_TAGS)
vty_out(vty,