From d63ccc9248892921dd79cb2dddd423926b4a356f Mon Sep 17 00:00:00 2001 From: lynnemorrison Date: Thu, 27 Jul 2023 11:10:49 -0400 Subject: bfdd: add additional parameters to json command Add parameters to the "show bfd peers json" command to display interface and type of BFD session. Signed-off-by: Lynne Morrison --- bfdd/bfdd_vty.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'bfdd') diff --git a/bfdd/bfdd_vty.c b/bfdd/bfdd_vty.c index 15444e4e9d..496d5019b5 100644 --- a/bfdd/bfdd_vty.c +++ b/bfdd/bfdd_vty.c @@ -213,6 +213,8 @@ static struct json_object *__display_peer_json(struct bfd_session *bs) uint32_t avg = 0; uint32_t max = 0; + if (bs->key.ifname[0]) + json_object_string_add(jo, "interface", bs->key.ifname); json_object_int_add(jo, "id", bs->discrs.my_discr); json_object_int_add(jo, "remote-id", bs->discrs.remote_discr); json_object_boolean_add(jo, "passive-mode", @@ -246,6 +248,10 @@ static struct json_object *__display_peer_json(struct bfd_session *bs) json_object_string_add(jo, "diagnostic", diag2str(bs->local_diag)); json_object_string_add(jo, "remote-diagnostic", diag2str(bs->remote_diag)); + if (CHECK_FLAG(bs->flags, BFD_SESS_FLAG_CONFIG)) + json_object_string_add(jo, "type", "configured"); + else + json_object_string_add(jo, "type", "dynamic"); json_object_int_add(jo, "receive-interval", bs->timers.required_min_rx / 1000); -- cgit v1.2.3