diff options
| author | Philippe Guibert <philippe.guibert@6wind.com> | 2018-11-30 14:56:40 +0100 |
|---|---|---|
| committer | Philippe Guibert <philippe.guibert@6wind.com> | 2019-01-29 14:15:10 +0100 |
| commit | ce3c06147c78f690b95aa80eb91ccf1ba41879f8 (patch) | |
| tree | acd1710d3d688e7ba7199433e767cc758875ba73 /bgpd/bgp_flowspec_vty.c | |
| parent | 8112a7a0723561ea3d959a0c72ba8b3c4134f316 (diff) | |
bgpd: display the list of iprules attached to a fs entry
the list of iprules is displayed in the 'show bgp ipv4 flowspec detail'
The list of iprules is displayed, only if it is installed.
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 | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/bgpd/bgp_flowspec_vty.c b/bgpd/bgp_flowspec_vty.c index 26f0fffb37..72ee8bb4ce 100644 --- a/bgpd/bgp_flowspec_vty.c +++ b/bgpd/bgp_flowspec_vty.c @@ -333,16 +333,17 @@ void route_vty_out_flowspec(struct vty *vty, struct prefix *p, struct bgp_path_info_extra *extra = bgp_path_info_extra_get(path); - if (extra->bgp_fs_pbr) { + if (listcount(extra->bgp_fs_pbr) || + listcount(extra->bgp_fs_iprule)) { struct listnode *node; struct bgp_pbr_match_entry *bpme; + struct bgp_pbr_rule *bpr; struct bgp_pbr_match *bpm; bool list_began = false; struct list *list_bpm; list_bpm = list_new(); - if (listcount(extra->bgp_fs_pbr)) - vty_out(vty, "\tinstalled in PBR"); + vty_out(vty, "\tinstalled in PBR"); for (ALL_LIST_ELEMENTS_RO(extra->bgp_fs_pbr, node, bpme)) { bpm = bpme->backpointer; @@ -356,6 +357,19 @@ void route_vty_out_flowspec(struct vty *vty, struct prefix *p, vty_out(vty, ", "); vty_out(vty, "%s", bpm->ipset_name); } + for (ALL_LIST_ELEMENTS_RO(extra->bgp_fs_iprule, + node, bpr)) { + if (!bpr->action) + continue; + if (!list_began) { + vty_out(vty, " ("); + list_began = true; + } else + vty_out(vty, ", "); + vty_out(vty, "-ipv4-rule %d action lookup %u-", + bpr->priority, + bpr->action->table_id); + } if (list_began) vty_out(vty, ")"); vty_out(vty, "\n"); |
