Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bgpd: add rpki json attributes to bgp path #17670

Merged
merged 1 commit into from
Dec 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions bgpd/bgp_route.c
Original file line number Diff line number Diff line change
Expand Up @@ -9361,9 +9361,18 @@ static void route_vty_short_status_out(struct vty *vty,
const struct prefix *p,
json_object *json_path)
{
enum rpki_states rpki_state = RPKI_NOT_BEING_USED;
enum rpki_states rpki_state;

/* RPKI validation state */
rpki_state = hook_call(bgp_rpki_prefix_status, path->peer, path->attr, p);

if (json_path) {
if (rpki_state == RPKI_VALID)
json_object_boolean_true_add(json_path, "rpkiValid");
else if (rpki_state == RPKI_INVALID)
json_object_boolean_true_add(json_path, "rpkiInvalid");
else if (rpki_state == RPKI_NOTFOUND)
json_object_boolean_true_add(json_path, "rpkiNotFound");

/* Route status display. */
if (CHECK_FLAG(path->flags, BGP_PATH_REMOVED))
Expand Down Expand Up @@ -9411,10 +9420,6 @@ static void route_vty_short_status_out(struct vty *vty,
return;
}

/* RPKI validation state */
rpki_state =
hook_call(bgp_rpki_prefix_status, path->peer, path->attr, p);

if (rpki_state == RPKI_VALID)
vty_out(vty, "V");
else if (rpki_state == RPKI_INVALID)
Expand Down
Loading