Skip to content
Draft
Show file tree
Hide file tree
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
19 changes: 15 additions & 4 deletions bfdd/bfdd_vty.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ static void _display_peer(struct vty *vty, struct bfd_session *bs)
_display_rtt(&min, &avg, &max, bs);
vty_out(vty, "\t\tRTT min/avg/max: %u/%u/%u usec\n", min, avg, max);
}
if (bs->profile_name)
vty_out(vty, "\t\tProfile: %s\n", bs->profile_name);

vty_out(vty, "\t\tLocal timers:\n");
vty_out(vty, "\t\t\tDetect-multiplier: %u\n",
Expand Down Expand Up @@ -329,6 +331,9 @@ static struct json_object *__display_peer_json(struct bfd_session *bs)
else
json_object_string_add(jo, "type", "dynamic");

if (bs->profile_name)
json_object_string_add(jo, "profile", bs->profile_name);

json_object_int_add(jo, "receive-interval",
bs->timers.required_min_rx / 1000);
json_object_int_add(jo, "transmit-interval",
Expand Down Expand Up @@ -760,20 +765,24 @@ static void _display_peer_brief(struct vty *vty, struct bfd_session *bs)
{
char addr_buf[INET6_ADDRSTRLEN];

if (bs->profile_name)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this change break the table format?

vty_out(vty, " %-20s\n", bs->profile_name);
if (CHECK_FLAG(bs->flags, BFD_SESS_FLAG_MH)) {
vty_out(vty, "%-10u", bs->discrs.my_discr);
inet_ntop(bs->key.family, &bs->key.local, addr_buf, sizeof(addr_buf));
vty_out(vty, " %-40s", addr_buf);
inet_ntop(bs->key.family, &bs->key.peer, addr_buf, sizeof(addr_buf));
vty_out(vty, " %-40s", addr_buf);
vty_out(vty, "%-15s\n", state_list[bs->ses_state].str);
vty_out(vty, "%-15s", state_list[bs->ses_state].str);
vty_out(vty, " %-20s\n", bs->profile_name ? bs->profile_name : "-");
} else {
vty_out(vty, "%-10u", bs->discrs.my_discr);
vty_out(vty, " %-40s", satostr(&bs->local_address));
inet_ntop(bs->key.family, &bs->key.peer, addr_buf, sizeof(addr_buf));
vty_out(vty, " %-40s", addr_buf);

vty_out(vty, "%-15s\n", state_list[bs->ses_state].str);
vty_out(vty, "%-15s", state_list[bs->ses_state].str);
vty_out(vty, " %-20s\n", bs->profile_name ? bs->profile_name : "-");
}
}

Expand Down Expand Up @@ -810,12 +819,14 @@ static void _display_peers_brief(struct vty *vty, const char *vrfname, bool use_
vty_out(vty, "%-10s", "SessionId");
vty_out(vty, " %-40s", "LocalAddress");
vty_out(vty, " %-40s", "PeerAddress");
vty_out(vty, "%-15s\n", "Status");
vty_out(vty, "%-15s", "Status");
vty_out(vty, " %-20s\n", "Profile");

vty_out(vty, "%-10s", "=========");
vty_out(vty, " %-40s", "============");
vty_out(vty, " %-40s", "===========");
vty_out(vty, "%-15s\n", "======");
vty_out(vty, "%-15s", "======");
vty_out(vty, " %-20s\n", "=======");

bfd_id_iterate(_display_peer_brief_iter, &bvt);
return;
Expand Down
10 changes: 10 additions & 0 deletions lib/bfd.c
Original file line number Diff line number Diff line change
Expand Up @@ -824,6 +824,7 @@ void bfd_sess_show(struct vty *vty, struct json_object *json,
{
json_object *json_bfd = NULL;
char time_buf[64];
const char *profile_name;

if (!bsp)
return;
Expand Down Expand Up @@ -854,6 +855,15 @@ void bfd_sess_show(struct vty *vty, struct json_object *json,
bsp->args.min_tx);
}

/* Show profile if configured. */
profile_name = bfd_sess_profile(bsp);
if (profile_name) {
if (json)
json_object_string_add(json_bfd, "profile", profile_name);
else
vty_out(vty, " Profile: %s\n", profile_name);
}

bfd_last_update(bsp->bss.last_event, time_buf, sizeof(time_buf));
if (json) {
json_object_string_add(json_bfd, "status",
Expand Down
14 changes: 7 additions & 7 deletions staticd/static_vty.c
Original file line number Diff line number Diff line change
Expand Up @@ -1637,16 +1637,16 @@ static void nexthop_cli_show(struct vty *vty, const struct lyd_node *route,
const struct lyd_node *bfd_dnode =
yang_dnode_get(nexthop, "bfd-monitoring");

if (yang_dnode_get_bool(bfd_dnode, "multi-hop")) {
if (yang_dnode_get_bool(bfd_dnode, "multi-hop"))
vty_out(vty, " bfd multi-hop");

if (yang_dnode_exists(bfd_dnode, "source"))
vty_out(vty, " source %s",
yang_dnode_get_string(bfd_dnode,
"./source"));
} else
else
vty_out(vty, " bfd");

if (yang_dnode_exists(bfd_dnode, "source"))
vty_out(vty, " source %s",
yang_dnode_get_string(bfd_dnode,
"./source"));

if (yang_dnode_exists(bfd_dnode, "profile"))
vty_out(vty, " profile %s",
yang_dnode_get_string(bfd_dnode, "profile"));
Expand Down
Loading