static int bgp_show_route_in_table(struct vty *vty, struct bgp *bgp,
struct bgp_table *rib, const char *ip_str,
afi_t afi, safi_t safi,
+ enum rpki_states target_state,
struct prefix_rd *prd, int prefix_check,
enum bgp_path_type pathtype, bool use_json)
{
bgp_show_path_info((struct prefix_rd *)dest_p, rm, vty,
bgp, afi, safi, json, pathtype,
- &display, RPKI_NOT_BEING_USED);
+ &display, target_state);
bgp_dest_unlock_node(rm);
}
bgp_show_path_info((struct prefix_rd *)dest_p, rm, vty,
bgp, afi, safi, json, pathtype,
- &display, RPKI_NOT_BEING_USED);
+ &display, target_state);
bgp_dest_unlock_node(rm);
}
|| dest_p->prefixlen == match.prefixlen) {
bgp_show_path_info(NULL, dest, vty, bgp, afi,
safi, json, pathtype,
- &display,
- RPKI_NOT_BEING_USED);
+ &display, target_state);
}
bgp_dest_unlock_node(dest);
static int bgp_show_route(struct vty *vty, struct bgp *bgp, const char *ip_str,
afi_t afi, safi_t safi, struct prefix_rd *prd,
int prefix_check, enum bgp_path_type pathtype,
- bool use_json)
+ enum rpki_states target_state, bool use_json)
{
if (!bgp) {
bgp = bgp_get_default();
safi = SAFI_UNICAST;
return bgp_show_route_in_table(vty, bgp, bgp->rib[afi][safi], ip_str,
- afi, safi, prd, prefix_check, pathtype,
- use_json);
+ afi, safi, target_state, prd,
+ prefix_check, pathtype, use_json);
}
static int bgp_show_lcommunity(struct vty *vty, struct bgp *bgp, int argc,
DEFUN (show_ip_bgp_route,
show_ip_bgp_route_cmd,
- "show [ip] bgp [<view|vrf> VIEWVRFNAME] ["BGP_AFI_CMD_STR" ["BGP_SAFI_WITH_LABEL_CMD_STR"]]<A.B.C.D|A.B.C.D/M|X:X::X:X|X:X::X:X/M> [<bestpath|multipath>] [json]",
+ "show [ip] bgp [<view|vrf> VIEWVRFNAME] ["BGP_AFI_CMD_STR" ["BGP_SAFI_WITH_LABEL_CMD_STR"]]<A.B.C.D|A.B.C.D/M|X:X::X:X|X:X::X:X/M> [<bestpath|multipath>] [rpki <valid|invalid|notfound>] [json]",
SHOW_STR
IP_STR
BGP_STR
"IPv6 prefix\n"
"Display only the bestpath\n"
"Display only multipaths\n"
+ "Display only paths that match the specified rpki state\n"
+ "A valid path as determined by rpki\n"
+ "A invalid path as determined by rpki\n"
+ "A path that has no rpki data\n"
JSON_STR)
{
int prefix_check = 0;
path_type = BGP_PATH_SHOW_ALL;
return bgp_show_route(vty, bgp, prefix, afi, safi, NULL, prefix_check,
- path_type, uj);
+ path_type, RPKI_NOT_BEING_USED, uj);
}
DEFUN (show_ip_bgp_regexp,
}
return bgp_show_route(vty, NULL, network, AFI_L2VPN, SAFI_EVPN, NULL,
prefix_check, BGP_PATH_SHOW_ALL,
- use_json(argc, argv));
+ RPKI_NOT_BEING_USED, use_json(argc, argv));
}
static void show_adj_route_header(struct vty *vty, struct bgp *bgp,
}
return bgp_show_route(vty, NULL, argv[6]->arg, afi, SAFI_MPLS_VPN, &prd,
- 0, BGP_PATH_SHOW_ALL, use_json(argc, argv));
+ 0, BGP_PATH_SHOW_ALL, RPKI_NOT_BEING_USED,
+ use_json(argc, argv));
}
static struct bgp_distance *bgp_distance_new(void)