diff options
author | Renato Westphal <renato@opensourcerouting.org> | 2018-11-29 14:21:13 +0100 |
---|---|---|
committer | Renato Westphal <renato@opensourcerouting.org> | 2018-12-03 16:47:58 +0100 |
commit | f8981ec5963576270e6a6c25149c84aac6b4f457 (patch) | |
tree | 86e825eecce28e71c5660e6199609f27c1176cbe /ripngd/ripng_cli.c | |
parent | ripngd: retrofit the 'aggregate-address' command to the new northbound model (diff) | |
download | frr-f8981ec5963576270e6a6c25149c84aac6b4f457.tar.xz frr-f8981ec5963576270e6a6c25149c84aac6b4f457.zip |
ripngd: retrofit the 'timer basic' command to the new northbound model
Trivial conversion. Use the northbound 'apply_finish()' callback
so we'll call ripng_event() only once even if we change the three
RIPng timers at the same time.
Convert the timers to uint16_t to match their representation in
the YANG model.
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'ripngd/ripng_cli.c')
-rw-r--r-- | ripngd/ripng_cli.c | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/ripngd/ripng_cli.c b/ripngd/ripng_cli.c index e6daa6298..2d5c98504 100644 --- a/ripngd/ripng_cli.c +++ b/ripngd/ripng_cli.c @@ -358,6 +358,54 @@ void cli_show_ripng_aggregate_address(struct vty *vty, struct lyd_node *dnode, yang_dnode_get_string(dnode, NULL)); } +/* + * XPath: /frr-ripngd:ripngd/instance/timers + */ +DEFPY (ripng_timers, + ripng_timers_cmd, + "timers basic (1-65535)$update (1-65535)$timeout (1-65535)$garbage", + "RIPng timers setup\n" + "Basic timer\n" + "Routing table update timer value in second. Default is 30.\n" + "Routing information timeout timer. Default is 180.\n" + "Garbage collection timer. Default is 120.\n") +{ + nb_cli_enqueue_change(vty, "./update-interval", NB_OP_MODIFY, + update_str); + nb_cli_enqueue_change(vty, "./holddown-interval", NB_OP_MODIFY, + timeout_str); + nb_cli_enqueue_change(vty, "./flush-interval", NB_OP_MODIFY, + garbage_str); + + return nb_cli_apply_changes(vty, "./timers"); +} + +DEFPY (no_ripng_timers, + no_ripng_timers_cmd, + "no timers basic [(1-65535) (1-65535) (1-65535)]", + NO_STR + "RIPng timers setup\n" + "Basic timer\n" + "Routing table update timer value in second. Default is 30.\n" + "Routing information timeout timer. Default is 180.\n" + "Garbage collection timer. Default is 120.\n") +{ + nb_cli_enqueue_change(vty, "./update-interval", NB_OP_MODIFY, NULL); + nb_cli_enqueue_change(vty, "./holddown-interval", NB_OP_MODIFY, NULL); + nb_cli_enqueue_change(vty, "./flush-interval", NB_OP_MODIFY, NULL); + + return nb_cli_apply_changes(vty, "./timers"); +} + +void cli_show_ripng_timers(struct vty *vty, struct lyd_node *dnode, + bool show_defaults) +{ + vty_out(vty, " timers basic %s %s %s\n", + yang_dnode_get_string(dnode, "./update-interval"), + yang_dnode_get_string(dnode, "./holddown-interval"), + yang_dnode_get_string(dnode, "./flush-interval")); +} + void ripng_cli_init(void) { install_element(CONFIG_NODE, &router_ripng_cmd); @@ -374,4 +422,6 @@ void ripng_cli_init(void) install_element(RIPNG_NODE, &ripng_redistribute_cmd); install_element(RIPNG_NODE, &ripng_route_cmd); install_element(RIPNG_NODE, &ripng_aggregate_address_cmd); + install_element(RIPNG_NODE, &ripng_timers_cmd); + install_element(RIPNG_NODE, &no_ripng_timers_cmd); } |