diff options
| author | lynnemorrison <lynne.morrison@ibm.com> | 2023-07-27 11:10:49 -0400 |
|---|---|---|
| committer | lynnemorrison <lynne.morrison@ibm.com> | 2023-07-28 11:45:23 -0400 |
| commit | d63ccc9248892921dd79cb2dddd423926b4a356f (patch) | |
| tree | d855e6a8fdebd307abf350c8f6bb7d06fb999104 /bfdd | |
| parent | 49e9bb281985c0df4ecadf8b61f8ed37862eed52 (diff) | |
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 <lynne.morrison@ibm.com>
Diffstat (limited to 'bfdd')
| -rw-r--r-- | bfdd/bfdd_vty.c | 6 |
1 files changed, 6 insertions, 0 deletions
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); |
