2 * Copyright (C) 1997, 1998, 1999 Kunihiro Ishiguro <kunihiro@zebra.org>
3 * Copyright (C) 2018 NetDEF, Inc.
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)
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
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
28 #include "northbound_cli.h"
31 #include "ripd/ripd.h"
32 #include "ripd/rip_cli.h"
33 #ifndef VTYSH_EXTRACT_PL
34 #include "ripd/rip_cli_clippy.c"
38 * XPath: /frr-ripd:ripd/instance
40 DEFPY_NOSH (router_rip
,
43 "Enable a routing process\n"
44 "Routing Information Protocol (RIP)\n")
48 struct cli_config_change changes
[] = {
50 .xpath
= "/frr-ripd:ripd/instance",
51 .operation
= NB_OP_CREATE
,
56 ret
= nb_cli_cfg_change(vty
, NULL
, changes
, array_size(changes
));
57 if (ret
== CMD_SUCCESS
)
58 VTY_PUSH_XPATH(RIP_NODE
, changes
[0].xpath
);
67 "Enable a routing process\n"
68 "Routing Information Protocol (RIP)\n")
70 struct cli_config_change changes
[] = {
72 .xpath
= "/frr-ripd:ripd/instance",
73 .operation
= NB_OP_DELETE
,
78 return nb_cli_cfg_change(vty
, NULL
, changes
, array_size(changes
));
81 void cli_show_router_rip(struct vty
*vty
, struct lyd_node
*dnode
,
85 vty_out(vty
, "router rip\n");
89 * XPath: /frr-ripd:ripd/instance/allow-ecmp
91 DEFPY (rip_allow_ecmp
,
95 "Allow Equal Cost MultiPath\n")
97 struct cli_config_change changes
[] = {
99 .xpath
= "./allow-ecmp",
100 .operation
= NB_OP_MODIFY
,
101 .value
= no
? "false" : "true",
105 return nb_cli_cfg_change(vty
, NULL
, changes
, array_size(changes
));
108 void cli_show_rip_allow_ecmp(struct vty
*vty
, struct lyd_node
*dnode
,
111 if (!yang_dnode_get_bool(dnode
, NULL
))
114 vty_out(vty
, " allow-ecmp\n");
117 void rip_cli_init(void)
119 install_element(CONFIG_NODE
, &router_rip_cmd
);
120 install_element(CONFIG_NODE
, &no_router_rip_cmd
);
122 install_element(RIP_NODE
, &rip_allow_ecmp_cmd
);