summaryrefslogtreecommitdiff
path: root/ripngd/ripng_cli.c
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2019-01-04 19:08:10 -0200
committerRenato Westphal <renato@opensourcerouting.org>2019-01-18 16:15:41 -0200
commitc5b2b5f65cd76c76f9d1ed1a219b33469f1e8524 (patch)
treec2f64a3b4854f36aab5afd0b389f9e7692780e82 /ripngd/ripng_cli.c
parent80cf4e451db10daf78d277f36a97ece1615f0450 (diff)
ripngd: add vrf input parameter to the "clear-ripng-route" RPC
Description of the new parameter (adapted from the ietf-rip module): "VRF name identifying a specific RIPng instance. This leaf is optional for the rpc. If it is specified, the rpc will clear all routes in the specified RIPng instance; if it is not specified, the rpc will clear all routes in all RIPng instances."; Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'ripngd/ripng_cli.c')
-rw-r--r--ripngd/ripng_cli.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/ripngd/ripng_cli.c b/ripngd/ripng_cli.c
index c89832d51d..804fa8dea6 100644
--- a/ripngd/ripng_cli.c
+++ b/ripngd/ripng_cli.c
@@ -478,12 +478,24 @@ void cli_show_ipv6_ripng_split_horizon(struct vty *vty, struct lyd_node *dnode,
*/
DEFPY (clear_ipv6_rip,
clear_ipv6_rip_cmd,
- "clear ipv6 ripng",
+ "clear ipv6 ripng [vrf WORD]",
CLEAR_STR
IPV6_STR
- "Clear IPv6 RIP database\n")
+ "Clear IPv6 RIP database\n"
+ VRF_CMD_HELP_STR)
{
- return nb_cli_rpc("/frr-ripngd:clear-ripng-route", NULL, NULL);
+ struct list *input;
+
+ input = list_new();
+ if (vrf) {
+ struct yang_data *yang_vrf;
+
+ yang_vrf = yang_data_new(
+ "/frr-ripngd:clear-ripng-route/input/vrf", vrf);
+ listnode_add(input, yang_vrf);
+ }
+
+ return nb_cli_rpc("/frr-ripngd:clear-ripng-route", input, NULL);
}
void ripng_cli_init(void)