2 * Copyright (C) 1998 Kunihiro Ishiguro
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 "ripngd/ripngd.h"
32 #include "ripngd/ripng_cli.h"
33 #ifndef VTYSH_EXTRACT_PL
34 #include "ripngd/ripng_cli_clippy.c"
38 * XPath: /frr-ripngd:ripngd/instance
40 DEFPY_NOSH (router_ripng
,
43 "Enable a routing process\n"
44 "Make RIPng instance command\n")
48 nb_cli_enqueue_change(vty
, "/frr-ripngd:ripngd/instance", NB_OP_CREATE
,
51 ret
= nb_cli_apply_changes(vty
, NULL
);
52 if (ret
== CMD_SUCCESS
)
53 VTY_PUSH_XPATH(RIPNG_NODE
, "/frr-ripngd:ripngd/instance");
58 DEFPY (no_router_ripng
,
62 "Enable a routing process\n"
63 "Make RIPng instance command\n")
65 nb_cli_enqueue_change(vty
, "/frr-ripngd:ripngd/instance", NB_OP_DELETE
,
68 return nb_cli_apply_changes(vty
, NULL
);
71 void cli_show_router_ripng(struct vty
*vty
, struct lyd_node
*dnode
,
75 vty_out(vty
, "router ripng\n");
79 * XPath: /frr-ripngd:ripngd/instance/allow-ecmp
81 DEFPY (ripng_allow_ecmp
,
85 "Allow Equal Cost MultiPath\n")
87 nb_cli_enqueue_change(vty
, "./allow-ecmp", NB_OP_MODIFY
,
88 no
? "false" : "true");
90 return nb_cli_apply_changes(vty
, NULL
);
93 void cli_show_ripng_allow_ecmp(struct vty
*vty
, struct lyd_node
*dnode
,
96 if (!yang_dnode_get_bool(dnode
, NULL
))
99 vty_out(vty
, " allow-ecmp\n");
103 * XPath: /frr-ripngd:ripngd/instance/default-information-originate
105 DEFPY (ripng_default_information_originate
,
106 ripng_default_information_originate_cmd
,
107 "[no] default-information originate",
109 "Default route information\n"
110 "Distribute default route\n")
112 nb_cli_enqueue_change(vty
, "./default-information-originate",
113 NB_OP_MODIFY
, no
? "false" : "true");
115 return nb_cli_apply_changes(vty
, NULL
);
118 void cli_show_ripng_default_information_originate(struct vty
*vty
,
119 struct lyd_node
*dnode
,
122 if (!yang_dnode_get_bool(dnode
, NULL
))
125 vty_out(vty
, " default-information originate\n");
128 void ripng_cli_init(void)
130 install_element(CONFIG_NODE
, &router_ripng_cmd
);
131 install_element(CONFIG_NODE
, &no_router_ripng_cmd
);
133 install_element(RIPNG_NODE
, &ripng_allow_ecmp_cmd
);
134 install_element(RIPNG_NODE
, &ripng_default_information_originate_cmd
);