]> git.proxmox.com Git - mirror_frr.git/blob - ripngd/ripng_cli.c
ripngd: retrofit the 'router ripng' command to the new northbound model
[mirror_frr.git] / ripngd / ripng_cli.c
1 /*
2 * Copyright (C) 1998 Kunihiro Ishiguro
3 * Copyright (C) 2018 NetDEF, Inc.
4 * Renato Westphal
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the Free
8 * Software Foundation; either version 2 of the License, or (at your option)
9 * any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 * more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; see the file COPYING; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21 #include <zebra.h>
22
23 #include "if.h"
24 #include "vrf.h"
25 #include "log.h"
26 #include "prefix.h"
27 #include "command.h"
28 #include "northbound_cli.h"
29 #include "libfrr.h"
30
31 #include "ripngd/ripngd.h"
32 #include "ripngd/ripng_cli.h"
33 #ifndef VTYSH_EXTRACT_PL
34 #include "ripngd/ripng_cli_clippy.c"
35 #endif
36
37 /*
38 * XPath: /frr-ripngd:ripngd/instance
39 */
40 DEFPY_NOSH (router_ripng,
41 router_ripng_cmd,
42 "router ripng",
43 "Enable a routing process\n"
44 "Make RIPng instance command\n")
45 {
46 int ret;
47
48 nb_cli_enqueue_change(vty, "/frr-ripngd:ripngd/instance", NB_OP_CREATE,
49 NULL);
50
51 ret = nb_cli_apply_changes(vty, NULL);
52 if (ret == CMD_SUCCESS)
53 VTY_PUSH_XPATH(RIPNG_NODE, "/frr-ripngd:ripngd/instance");
54
55 return ret;
56 }
57
58 DEFPY (no_router_ripng,
59 no_router_ripng_cmd,
60 "no router ripng",
61 NO_STR
62 "Enable a routing process\n"
63 "Make RIPng instance command\n")
64 {
65 nb_cli_enqueue_change(vty, "/frr-ripngd:ripngd/instance", NB_OP_DELETE,
66 NULL);
67
68 return nb_cli_apply_changes(vty, NULL);
69 }
70
71 void cli_show_router_ripng(struct vty *vty, struct lyd_node *dnode,
72 bool show_defaults)
73 {
74 vty_out(vty, "!\n");
75 vty_out(vty, "router ripng\n");
76 }
77
78 void ripng_cli_init(void)
79 {
80 install_element(CONFIG_NODE, &router_ripng_cmd);
81 install_element(CONFIG_NODE, &no_router_ripng_cmd);
82 }