diff options
author | Philippe Guibert <philippe.guibert@6wind.com> | 2018-04-20 11:41:54 +0200 |
---|---|---|
committer | Philippe Guibert <philippe.guibert@6wind.com> | 2018-05-25 15:49:38 +0200 |
commit | b588b642ce3d933394240f77879eb41f36959311 (patch) | |
tree | 829f7601c937becec3b4eb8ff3c0433b8b885d9f /bgpd/bgp_flowspec_vty.c | |
parent | bgpd: pbr support for port redirecting (diff) | |
download | frr-b588b642ce3d933394240f77879eb41f36959311.tar.xz frr-b588b642ce3d933394240f77879eb41f36959311.zip |
bgpd: display if FS entry is installed in PBR or not
Once PBR rules installed, an information is printed in the main
show bgp ipv4 flowspec detail information.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Diffstat (limited to 'bgpd/bgp_flowspec_vty.c')
-rw-r--r-- | bgpd/bgp_flowspec_vty.c | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/bgpd/bgp_flowspec_vty.c b/bgpd/bgp_flowspec_vty.c index 7bf11f12a..3ff452889 100644 --- a/bgpd/bgp_flowspec_vty.c +++ b/bgpd/bgp_flowspec_vty.c @@ -30,6 +30,7 @@ #include "bgpd/bgp_flowspec_util.h" #include "bgpd/bgp_flowspec_private.h" #include "bgpd/bgp_debug.h" +#include "bgpd/bgp_pbr.h" /* Local Structures and variables declarations * This code block hosts the struct declared that host the flowspec rules @@ -318,16 +319,32 @@ void route_vty_out_flowspec(struct vty *vty, struct prefix *p, XFREE(MTYPE_ECOMMUNITY_STR, s); } peer_uptime(binfo->uptime, timebuf, BGP_UPTIME_LEN, 0, NULL); - if (display == NLRI_STRING_FORMAT_LARGE) - vty_out(vty, "\tup for %8s\n", timebuf); - else if (json_paths) { + if (display == NLRI_STRING_FORMAT_LARGE) { + vty_out(vty, "\treceived for %8s\n", timebuf); + } else if (json_paths) { json_time_path = json_object_new_object(); json_object_string_add(json_time_path, "time", timebuf); if (display == NLRI_STRING_FORMAT_JSON) json_object_array_add(json_paths, json_time_path); } + if (display == NLRI_STRING_FORMAT_LARGE) { + struct bgp_info_extra *extra = bgp_info_extra_get(binfo); + if (extra->bgp_fs_pbr) { + struct bgp_pbr_match_entry *bpme; + struct bgp_pbr_match *bpm; + + bpme = (struct bgp_pbr_match_entry *)extra->bgp_fs_pbr; + bpm = bpme->backpointer; + vty_out(vty, "\tinstalled in PBR"); + if (bpm) + vty_out(vty, " (%s)\n", bpm->ipset_name); + else + vty_out(vty, "\n"); + } else + vty_out(vty, "\tnot installed in PBR\n"); + } } int bgp_show_table_flowspec(struct vty *vty, struct bgp *bgp, afi_t afi, |