diff options
author | Philippe Guibert <philippe.guibert@6wind.com> | 2018-03-07 18:54:09 +0100 |
---|---|---|
committer | Philippe Guibert <philippe.guibert@6wind.com> | 2018-03-30 14:01:06 +0200 |
commit | d33fc23bf8d70bea0fabae541e127b4bdbc77a8d (patch) | |
tree | c482a09efcd7903df5d8a7f283dd08cf42d0a707 /bgpd/bgp_route.c | |
parent | vtysh: add flowspec address family cmd support (diff) | |
download | frr-d33fc23bf8d70bea0fabae541e127b4bdbc77a8d.tar.xz frr-d33fc23bf8d70bea0fabae541e127b4bdbc77a8d.zip |
bgpd: support for json in show bgp ipv4 flowspec commands
The json format is returd when requested from the two commands:
- show bgp ipv4 flowspec
- show bgp ipv4 flowspec detail
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Diffstat (limited to 'bgpd/bgp_route.c')
-rw-r--r-- | bgpd/bgp_route.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index db82386e7..ad3d57a9a 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -6319,7 +6319,9 @@ static void route_vty_out_route(struct prefix *p, struct vty *vty, #endif } else if (p->family == AF_FLOWSPEC) { route_vty_out_flowspec(vty, p, NULL, - NLRI_STRING_FORMAT_MIN, json); + json ? + NLRI_STRING_FORMAT_JSON_SIMPLE : + NLRI_STRING_FORMAT_MIN, json); } else { if (!json) len = vty_out( @@ -6511,9 +6513,10 @@ void route_vty_out(struct vty *vty, struct prefix *p, struct bgp_info *binfo, "used"); } else vty_out(vty, "%-16s", inet_ntoa(attr->nexthop)); - } + } else if (safi == SAFI_FLOWSPEC) { + /* already done */ /* IPv4 Next Hop */ - else if (p->family == AF_INET && !BGP_ATTR_NEXTHOP_AFI_IP6(attr)) { + } else if (p->family == AF_INET && !BGP_ATTR_NEXTHOP_AFI_IP6(attr)) { if (json_paths) { json_nexthop_global = json_object_new_object(); |