diff options
author | Renato Westphal <renato@opensourcerouting.org> | 2018-11-29 04:20:28 +0100 |
---|---|---|
committer | Renato Westphal <renato@opensourcerouting.org> | 2018-12-03 16:47:58 +0100 |
commit | ad8778c05e7f26790488bdaf583a92ea9de54afa (patch) | |
tree | 3eb7c196e9c9d3572a0ad04ff9d30743d2db3710 /ripngd/ripng_cli.c | |
parent | ripngd: retrofit the 'default-information' command to the new northbound model (diff) | |
download | frr-ad8778c05e7f26790488bdaf583a92ea9de54afa.tar.xz frr-ad8778c05e7f26790488bdaf583a92ea9de54afa.zip |
ripngd: retrofit the 'default-metric' command to the new northbound model
Trivial conversion. ripng->default_metric was converted to an
uint8_t to match the way it's defined in the YANG module.
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'ripngd/ripng_cli.c')
-rw-r--r-- | ripngd/ripng_cli.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/ripngd/ripng_cli.c b/ripngd/ripng_cli.c index 04cde899d..5a1c9bdca 100644 --- a/ripngd/ripng_cli.c +++ b/ripngd/ripng_cli.c @@ -125,6 +125,40 @@ void cli_show_ripng_default_information_originate(struct vty *vty, vty_out(vty, " default-information originate\n"); } +/* + * XPath: /frr-ripngd:ripngd/instance/default-metric + */ +DEFPY (ripng_default_metric, + ripng_default_metric_cmd, + "default-metric (1-16)", + "Set a metric of redistribute routes\n" + "Default metric\n") +{ + nb_cli_enqueue_change(vty, "./default-metric", NB_OP_MODIFY, + default_metric_str); + + return nb_cli_apply_changes(vty, NULL); +} + +DEFPY (no_ripng_default_metric, + no_ripng_default_metric_cmd, + "no default-metric [(1-16)]", + NO_STR + "Set a metric of redistribute routes\n" + "Default metric\n") +{ + nb_cli_enqueue_change(vty, "./default-metric", NB_OP_MODIFY, NULL); + + return nb_cli_apply_changes(vty, NULL); +} + +void cli_show_ripng_default_metric(struct vty *vty, struct lyd_node *dnode, + bool show_defaults) +{ + vty_out(vty, " default-metric %s\n", + yang_dnode_get_string(dnode, NULL)); +} + void ripng_cli_init(void) { install_element(CONFIG_NODE, &router_ripng_cmd); @@ -132,4 +166,6 @@ void ripng_cli_init(void) install_element(RIPNG_NODE, &ripng_allow_ecmp_cmd); install_element(RIPNG_NODE, &ripng_default_information_originate_cmd); + install_element(RIPNG_NODE, &ripng_default_metric_cmd); + install_element(RIPNG_NODE, &no_ripng_default_metric_cmd); } |