]> git.puffer.fish Git - mirror/frr.git/commitdiff
bfdd: add additional parameters to json command
authorlynnemorrison <lynne.morrison@ibm.com>
Thu, 27 Jul 2023 15:10:49 +0000 (11:10 -0400)
committerlynnemorrison <lynne.morrison@ibm.com>
Fri, 28 Jul 2023 15:45:23 +0000 (11:45 -0400)
Add parameters to the "show bfd peers json" command to
display interface and type of BFD session.

Signed-off-by: Lynne Morrison <lynne.morrison@ibm.com>
bfdd/bfdd_vty.c

index 15444e4e9d3007e69e8df856594145c6b8e05d7c..496d5019b5e967beefd73c8794ea6a87b2106c36 100644 (file)
@@ -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);