]> git.proxmox.com Git - mirror_frr.git/blobdiff - bfdd/bfdd_vty.c
lib: adapt to version 2 of libyang
[mirror_frr.git] / bfdd / bfdd_vty.c
index 53e23cf6c2139d2c072c659456ef72c1a002d2cd..a03fb9f216534a32d13f91cadd133fbf15b07127 100644 (file)
@@ -158,8 +158,16 @@ static void _display_peer(struct vty *vty, struct bfd_session *bs)
                bs->timers.required_min_rx / 1000);
        vty_out(vty, "\t\t\tTransmission interval: %ums\n",
                bs->timers.desired_min_tx / 1000);
-       vty_out(vty, "\t\t\tEcho transmission interval: %ums\n",
-               bs->timers.required_min_echo / 1000);
+       if (bs->timers.required_min_echo_rx != 0)
+               vty_out(vty, "\t\t\tEcho receive interval: %ums\n",
+                       bs->timers.required_min_echo_rx / 1000);
+       else
+               vty_out(vty, "\t\t\tEcho receive interval: disabled\n");
+       if (CHECK_FLAG(bs->flags, BFD_SESS_FLAG_ECHO))
+               vty_out(vty, "\t\t\tEcho transmission interval: %ums\n",
+                       bs->timers.desired_min_echo_tx / 1000);
+       else
+               vty_out(vty, "\t\t\tEcho transmission interval: disabled\n");
 
        vty_out(vty, "\t\tRemote timers:\n");
        vty_out(vty, "\t\t\tDetect-multiplier: %u\n",
@@ -168,8 +176,11 @@ static void _display_peer(struct vty *vty, struct bfd_session *bs)
                bs->remote_timers.required_min_rx / 1000);
        vty_out(vty, "\t\t\tTransmission interval: %ums\n",
                bs->remote_timers.desired_min_tx / 1000);
-       vty_out(vty, "\t\t\tEcho transmission interval: %ums\n",
-               bs->remote_timers.required_min_echo / 1000);
+       if (bs->remote_timers.required_min_echo != 0)
+               vty_out(vty, "\t\t\tEcho receive interval: %ums\n",
+                       bs->remote_timers.required_min_echo / 1000);
+       else
+               vty_out(vty, "\t\t\tEcho receive interval: disabled\n");
 
        vty_out(vty, "\n");
 }
@@ -245,11 +256,13 @@ static struct json_object *__display_peer_json(struct bfd_session *bs)
                            bs->timers.required_min_rx / 1000);
        json_object_int_add(jo, "transmit-interval",
                            bs->timers.desired_min_tx / 1000);
+       json_object_int_add(jo, "echo-receive-interval",
+                           bs->timers.required_min_echo_rx / 1000);
        if (CHECK_FLAG(bs->flags, BFD_SESS_FLAG_ECHO))
-               json_object_int_add(jo, "echo-interval",
-                                   bs->timers.required_min_echo / 1000);
+               json_object_int_add(jo, "echo-transmit-interval",
+                                   bs->timers.desired_min_echo_tx / 1000);
        else
-               json_object_int_add(jo, "echo-interval", 0);
+               json_object_int_add(jo, "echo-transmit-interval", 0);
 
        json_object_int_add(jo, "detect-multiplier", bs->detect_mult);
 
@@ -257,7 +270,7 @@ static struct json_object *__display_peer_json(struct bfd_session *bs)
                            bs->remote_timers.required_min_rx / 1000);
        json_object_int_add(jo, "remote-transmit-interval",
                            bs->remote_timers.desired_min_tx / 1000);
-       json_object_int_add(jo, "remote-echo-interval",
+       json_object_int_add(jo, "remote-echo-receive-interval",
                            bs->remote_timers.required_min_echo / 1000);
        json_object_int_add(jo, "remote-detect-multiplier",
                            bs->remote_detect_mult);
@@ -840,11 +853,12 @@ static int bfd_configure_peer(struct bfd_peer_cfg *bpc, bool mhop,
        memset(bpc, 0, sizeof(*bpc));
 
        /* Defaults */
-       bpc->bpc_shutdown = true;
+       bpc->bpc_shutdown = false;
        bpc->bpc_detectmultiplier = BPC_DEF_DETECTMULTIPLIER;
        bpc->bpc_recvinterval = BPC_DEF_RECEIVEINTERVAL;
        bpc->bpc_txinterval = BPC_DEF_TRANSMITINTERVAL;
-       bpc->bpc_echointerval = BPC_DEF_ECHOINTERVAL;
+       bpc->bpc_echorecvinterval = BPC_DEF_ECHORECEIVEINTERVAL;
+       bpc->bpc_echotxinterval = BPC_DEF_ECHOTRANSMITINTERVAL;
        bpc->bpc_lastevent = monotime(NULL);
 
        /* Safety check: when no error buf is provided len must be zero. */