diff options
author | Rafael Zalamena <rzalamena@opensourcerouting.org> | 2019-01-31 21:10:32 +0100 |
---|---|---|
committer | Rafael Zalamena <rzalamena@opensourcerouting.org> | 2019-02-14 17:17:29 +0100 |
commit | f43b93686fafd80ad86630327cb9dcfefbf0ee9a (patch) | |
tree | 2d3610e2a3c112f2f6d878b3350267992d43d80a /bfdd/bfdd_vty.c | |
parent | bfdd: don't poll to make echo/multiplier changes (diff) | |
download | frr-f43b93686fafd80ad86630327cb9dcfefbf0ee9a.tar.xz frr-f43b93686fafd80ad86630327cb9dcfefbf0ee9a.zip |
bfdd: simplify timer data structure
Remove some legacy left overs of the old timer data structure bits and
use a simpler version:
We always keep the current configuration in the timer structure, but
also keep the running timers (before poll transition) in
`cur_timers`.
With this we can remove `new_timers` and avoid timer copy
configuration copy on final handler (this also simplifies peer
show command).
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Diffstat (limited to 'bfdd/bfdd_vty.c')
-rw-r--r-- | bfdd/bfdd_vty.c | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/bfdd/bfdd_vty.c b/bfdd/bfdd_vty.c index eab860f18..8ba8de982 100644 --- a/bfdd/bfdd_vty.c +++ b/bfdd/bfdd_vty.c @@ -200,10 +200,10 @@ DEFPY(bfd_peer_txinterval, bfd_peer_txinterval_cmd, struct bfd_session *bs; bs = VTY_GET_CONTEXT(bfd_session); - if (bs->up_min_tx == (uint32_t)(interval * 1000)) + if (bs->timers.desired_min_tx == (uint32_t)(interval * 1000)) return CMD_SUCCESS; - bs->up_min_tx = interval * 1000; + bs->timers.desired_min_tx = interval * 1000; bfd_set_polling(bs); return CMD_SUCCESS; @@ -430,20 +430,10 @@ static void _display_peer(struct vty *vty, struct bfd_session *bs) vty_out(vty, "\t\tLocal timers:\n"); vty_out(vty, "\t\t\tReceive interval: %" PRIu32 "ms\n", bs->timers.required_min_rx / 1000); - vty_out(vty, "\t\t\tTransmission interval: %" PRIu32 "ms", + vty_out(vty, "\t\t\tTransmission interval: %" PRIu32 "ms\n", bs->timers.desired_min_tx / 1000); - if (bs->up_min_tx != bs->timers.desired_min_tx) - vty_out(vty, " (configured %" PRIu32 "ms)\n", - bs->up_min_tx / 1000); - else - vty_out(vty, "\n"); - - vty_out(vty, "\t\t\tEcho transmission interval: "); - if (BFD_CHECK_FLAG(bs->flags, BFD_SESS_FLAG_ECHO)) - vty_out(vty, "%" PRIu32 "ms\n", - bs->timers.required_min_echo / 1000); - else - vty_out(vty, "disabled\n"); + vty_out(vty, "\t\t\tEcho transmission interval: %" PRIu32 "ms\n", + bs->timers.required_min_echo / 1000); vty_out(vty, "\t\tRemote timers:\n"); vty_out(vty, "\t\t\tReceive interval: %" PRIu32 "ms\n", @@ -948,9 +938,9 @@ static void _bfdd_peer_write_config(struct hash_backet *hb, void *arg) if (bs->timers.required_min_rx != (BPC_DEF_RECEIVEINTERVAL * 1000)) vty_out(vty, " receive-interval %" PRIu32 "\n", bs->timers.required_min_rx / 1000); - if (bs->up_min_tx != (BPC_DEF_TRANSMITINTERVAL * 1000)) + if (bs->timers.desired_min_tx != (BPC_DEF_TRANSMITINTERVAL * 1000)) vty_out(vty, " transmit-interval %" PRIu32 "\n", - bs->up_min_tx / 1000); + bs->timers.desired_min_tx / 1000); if (bs->timers.required_min_echo != (BPC_DEF_ECHOINTERVAL * 1000)) vty_out(vty, " echo-interval %" PRIu32 "\n", bs->timers.required_min_echo / 1000); |