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 nb_cli_enqueue_change(vty
, "/frr-ripd:ripd/instance", NB_OP_CREATE
,
51 ret
= nb_cli_apply_changes(vty
, NULL
);
52 if (ret
== CMD_SUCCESS
)
53 VTY_PUSH_XPATH(RIP_NODE
, "/frr-ripd:ripd/instance");
62 "Enable a routing process\n"
63 "Routing Information Protocol (RIP)\n")
65 nb_cli_enqueue_change(vty
, "/frr-ripd:ripd/instance", NB_OP_DELETE
,
68 return nb_cli_apply_changes(vty
, NULL
);
71 void cli_show_router_rip(struct vty
*vty
, struct lyd_node
*dnode
,
75 vty_out(vty
, "router rip\n");
79 * XPath: /frr-ripd:ripd/instance/allow-ecmp
81 DEFPY (rip_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_rip_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-ripd:ripd/instance/default-information-originate
105 DEFPY (rip_default_information_originate
,
106 rip_default_information_originate_cmd
,
107 "[no] default-information originate",
109 "Control distribution of default route\n"
110 "Distribute a 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_rip_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");
129 * XPath: /frr-ripd:ripd/instance/default-metric
131 DEFPY (rip_default_metric
,
132 rip_default_metric_cmd
,
133 "default-metric (1-16)",
134 "Set a metric of redistribute routes\n"
137 nb_cli_enqueue_change(vty
, "./default-metric", NB_OP_MODIFY
,
140 return nb_cli_apply_changes(vty
, NULL
);
143 DEFPY (no_rip_default_metric
,
144 no_rip_default_metric_cmd
,
145 "no default-metric [(1-16)]",
147 "Set a metric of redistribute routes\n"
150 nb_cli_enqueue_change(vty
, "./default-metric", NB_OP_MODIFY
, NULL
);
152 return nb_cli_apply_changes(vty
, NULL
);
155 void cli_show_rip_default_metric(struct vty
*vty
, struct lyd_node
*dnode
,
158 vty_out(vty
, " default-metric %s\n",
159 yang_dnode_get_string(dnode
, NULL
));
163 * XPath: /frr-ripd:ripd/instance/distance/default
168 "Administrative distance\n"
171 nb_cli_enqueue_change(vty
, "./distance/default", NB_OP_MODIFY
,
174 return nb_cli_apply_changes(vty
, NULL
);
177 DEFPY (no_rip_distance
,
179 "no distance [(1-255)]",
181 "Administrative distance\n"
184 nb_cli_enqueue_change(vty
, "./distance/default", NB_OP_MODIFY
, NULL
);
186 return nb_cli_apply_changes(vty
, NULL
);
189 void cli_show_rip_distance(struct vty
*vty
, struct lyd_node
*dnode
,
192 if (yang_dnode_is_default(dnode
, NULL
))
193 vty_out(vty
, " no distance\n");
195 vty_out(vty
, " distance %s\n",
196 yang_dnode_get_string(dnode
, NULL
));
200 * XPath: /frr-ripd:ripd/instance/distance/source
202 DEFPY (rip_distance_source
,
203 rip_distance_source_cmd
,
204 "[no] distance (1-255) A.B.C.D/M$prefix [WORD$acl]",
206 "Administrative distance\n"
209 "Access list name\n")
212 nb_cli_enqueue_change(vty
, ".", NB_OP_CREATE
, NULL
);
213 nb_cli_enqueue_change(vty
, "./distance", NB_OP_MODIFY
, NULL
);
214 nb_cli_enqueue_change(vty
, "./access-list",
215 acl
? NB_OP_MODIFY
: NB_OP_DELETE
, acl
);
217 nb_cli_enqueue_change(vty
, ".", NB_OP_DELETE
, NULL
);
219 return nb_cli_apply_changes(vty
, "./distance/source[prefix='%s']",
223 void cli_show_rip_distance_source(struct vty
*vty
, struct lyd_node
*dnode
,
226 vty_out(vty
, " distance %s %s",
227 yang_dnode_get_string(dnode
, "./distance"),
228 yang_dnode_get_string(dnode
, "./prefix"));
229 if (yang_dnode_exists(dnode
, "./access-list"))
231 yang_dnode_get_string(dnode
, "./access-list"));
236 * XPath: /frr-ripd:ripd/instance/explicit-neighbor
240 "[no] neighbor A.B.C.D",
242 "Specify a neighbor router\n"
243 "Neighbor address\n")
245 nb_cli_enqueue_change(vty
, "./explicit-neighbor",
246 no
? NB_OP_DELETE
: NB_OP_CREATE
, neighbor_str
);
248 return nb_cli_apply_changes(vty
, NULL
);
251 void cli_show_rip_neighbor(struct vty
*vty
, struct lyd_node
*dnode
,
254 vty_out(vty
, " neighbor %s\n", yang_dnode_get_string(dnode
, NULL
));
258 * XPath: /frr-ripd:ripd/instance/network
260 DEFPY (rip_network_prefix
,
261 rip_network_prefix_cmd
,
262 "[no] network A.B.C.D/M",
264 "Enable routing on an IP network\n"
265 "IP prefix <network>/<length>, e.g., 35.0.0.0/8\n")
267 nb_cli_enqueue_change(vty
, "./network",
268 no
? NB_OP_DELETE
: NB_OP_CREATE
, network_str
);
270 return nb_cli_apply_changes(vty
, NULL
);
273 void cli_show_rip_network_prefix(struct vty
*vty
, struct lyd_node
*dnode
,
276 vty_out(vty
, " network %s\n", yang_dnode_get_string(dnode
, NULL
));
280 * XPath: /frr-ripd:ripd/instance/interface
282 DEFPY (rip_network_if
,
286 "Enable routing on an IP network\n"
289 nb_cli_enqueue_change(vty
, "./interface",
290 no
? NB_OP_DELETE
: NB_OP_CREATE
, network
);
292 return nb_cli_apply_changes(vty
, NULL
);
295 void cli_show_rip_network_interface(struct vty
*vty
, struct lyd_node
*dnode
,
298 vty_out(vty
, " network %s\n", yang_dnode_get_string(dnode
, NULL
));
302 * XPath: /frr-ripd:ripd/instance/offset-list
304 DEFPY (rip_offset_list
,
306 "[no] offset-list WORD$acl <in|out>$direction (0-16)$metric [IFNAME]",
308 "Modify RIP metric\n"
310 "For incoming updates\n"
311 "For outgoing updates\n"
313 "Interface to match\n")
316 nb_cli_enqueue_change(vty
, ".", NB_OP_CREATE
, NULL
);
317 nb_cli_enqueue_change(vty
, "./access-list", NB_OP_MODIFY
, acl
);
318 nb_cli_enqueue_change(vty
, "./metric", NB_OP_MODIFY
,
321 nb_cli_enqueue_change(vty
, ".", NB_OP_DELETE
, NULL
);
323 return nb_cli_apply_changes(
324 vty
, "./offset-list[interface='%s'][direction='%s']",
325 ifname
? ifname
: "*", direction
);
328 void cli_show_rip_offset_list(struct vty
*vty
, struct lyd_node
*dnode
,
331 const char *interface
;
333 interface
= yang_dnode_get_string(dnode
, "./interface");
335 vty_out(vty
, " offset-list %s %s %s",
336 yang_dnode_get_string(dnode
, "./access-list"),
337 yang_dnode_get_string(dnode
, "./direction"),
338 yang_dnode_get_string(dnode
, "./metric"));
339 if (!strmatch(interface
, "*"))
340 vty_out(vty
, " %s", interface
);
345 * XPath: /frr-ripd:ripd/instance/passive-default
347 DEFPY (rip_passive_default
,
348 rip_passive_default_cmd
,
349 "[no] passive-interface default",
351 "Suppress routing updates on an interface\n"
352 "default for all interfaces\n")
354 nb_cli_enqueue_change(vty
, "./passive-default", NB_OP_MODIFY
,
355 no
? "false" : "true");
357 return nb_cli_apply_changes(vty
, NULL
);
360 void cli_show_rip_passive_default(struct vty
*vty
, struct lyd_node
*dnode
,
363 if (!yang_dnode_get_bool(dnode
, NULL
))
366 vty_out(vty
, " passive-interface default\n");
370 * XPath: /frr-ripd:ripd/instance/passive-interface
371 * /frr-ripd:ripd/instance/non-passive-interface
373 DEFPY (rip_passive_interface
,
374 rip_passive_interface_cmd
,
375 "[no] passive-interface IFNAME",
377 "Suppress routing updates on an interface\n"
380 nb_cli_enqueue_change(vty
, "./passive-interface",
381 no
? NB_OP_DELETE
: NB_OP_CREATE
, ifname
);
382 nb_cli_enqueue_change(vty
, "./non-passive-interface",
383 no
? NB_OP_CREATE
: NB_OP_DELETE
, ifname
);
385 return nb_cli_apply_changes(vty
, NULL
);
388 void cli_show_rip_passive_interface(struct vty
*vty
, struct lyd_node
*dnode
,
391 vty_out(vty
, " passive-interface %s\n",
392 yang_dnode_get_string(dnode
, NULL
));
395 void cli_show_rip_non_passive_interface(struct vty
*vty
, struct lyd_node
*dnode
,
398 vty_out(vty
, " no passive-interface %s\n",
399 yang_dnode_get_string(dnode
, NULL
));
403 * XPath: /frr-ripd:ripd/instance/redistribute
405 DEFPY (rip_redistribute
,
406 rip_redistribute_cmd
,
407 "[no] redistribute " FRR_REDIST_STR_RIPD
"$protocol [{metric (0-16)|route-map WORD}]",
410 FRR_REDIST_HELP_STR_RIPD
413 "Route map reference\n"
414 "Pointer to route-map entries\n")
417 nb_cli_enqueue_change(vty
, ".", NB_OP_CREATE
, NULL
);
418 nb_cli_enqueue_change(vty
, "./route-map",
419 route_map
? NB_OP_MODIFY
: NB_OP_DELETE
,
421 nb_cli_enqueue_change(vty
, "./metric",
422 metric_str
? NB_OP_MODIFY
: NB_OP_DELETE
,
425 nb_cli_enqueue_change(vty
, ".", NB_OP_DELETE
, NULL
);
427 return nb_cli_apply_changes(vty
, "./redistribute[protocol='%s']",
431 void cli_show_rip_redistribute(struct vty
*vty
, struct lyd_node
*dnode
,
434 vty_out(vty
, " redistribute %s",
435 yang_dnode_get_string(dnode
, "./protocol"));
436 if (yang_dnode_exists(dnode
, "./metric"))
437 vty_out(vty
, " metric %s",
438 yang_dnode_get_string(dnode
, "./metric"));
439 if (yang_dnode_exists(dnode
, "./route-map"))
440 vty_out(vty
, " route-map %s",
441 yang_dnode_get_string(dnode
, "./route-map"));
446 * XPath: /frr-ripd:ripd/instance/static-route
450 "[no] route A.B.C.D/M",
452 "RIP static route configuration\n"
453 "IP prefix <network>/<length>\n")
455 nb_cli_enqueue_change(vty
, "./static-route",
456 no
? NB_OP_DELETE
: NB_OP_CREATE
, route_str
);
458 return nb_cli_apply_changes(vty
, NULL
);
461 void cli_show_rip_route(struct vty
*vty
, struct lyd_node
*dnode
,
464 vty_out(vty
, " route %s\n", yang_dnode_get_string(dnode
, NULL
));
468 * XPath: /frr-ripd:ripd/instance/timers
472 "timers basic (5-2147483647)$update (5-2147483647)$timeout (5-2147483647)$garbage",
473 "Adjust routing timers\n"
474 "Basic routing protocol update timers\n"
475 "Routing table update timer value in second. Default is 30.\n"
476 "Routing information timeout timer. Default is 180.\n"
477 "Garbage collection timer. Default is 120.\n")
479 nb_cli_enqueue_change(vty
, "./update-interval", NB_OP_MODIFY
,
481 nb_cli_enqueue_change(vty
, "./holddown-interval", NB_OP_MODIFY
,
483 nb_cli_enqueue_change(vty
, "./flush-interval", NB_OP_MODIFY
,
486 return nb_cli_apply_changes(vty
, "./timers");
489 DEFPY (no_rip_timers
,
491 "no timers basic [(5-2147483647) (5-2147483647) (5-2147483647)]",
493 "Adjust routing timers\n"
494 "Basic routing protocol update timers\n"
495 "Routing table update timer value in second. Default is 30.\n"
496 "Routing information timeout timer. Default is 180.\n"
497 "Garbage collection timer. Default is 120.\n")
499 nb_cli_enqueue_change(vty
, "./update-interval", NB_OP_MODIFY
, NULL
);
500 nb_cli_enqueue_change(vty
, "./holddown-interval", NB_OP_MODIFY
, NULL
);
501 nb_cli_enqueue_change(vty
, "./flush-interval", NB_OP_MODIFY
, NULL
);
503 return nb_cli_apply_changes(vty
, "./timers");
506 void cli_show_rip_timers(struct vty
*vty
, struct lyd_node
*dnode
,
509 vty_out(vty
, " timers basic %s %s %s\n",
510 yang_dnode_get_string(dnode
, "./update-interval"),
511 yang_dnode_get_string(dnode
, "./holddown-interval"),
512 yang_dnode_get_string(dnode
, "./flush-interval"));
516 * XPath: /frr-ripd:ripd/instance/version
521 "Set routing protocol version\n"
524 nb_cli_enqueue_change(vty
, "./version/receive", NB_OP_MODIFY
,
526 nb_cli_enqueue_change(vty
, "./version/send", NB_OP_MODIFY
, version_str
);
528 return nb_cli_apply_changes(vty
, NULL
);
531 DEFPY (no_rip_version
,
533 "no version [(1-2)]",
535 "Set routing protocol version\n"
538 nb_cli_enqueue_change(vty
, "./version/receive", NB_OP_MODIFY
, NULL
);
539 nb_cli_enqueue_change(vty
, "./version/send", NB_OP_MODIFY
, NULL
);
541 return nb_cli_apply_changes(vty
, NULL
);
544 void cli_show_rip_version(struct vty
*vty
, struct lyd_node
*dnode
,
548 * We have only one "version" command and three possible combinations of
549 * send/receive values.
551 switch (yang_dnode_get_enum(dnode
, "./receive")) {
552 case RI_RIP_VERSION_1
:
553 vty_out(vty
, " version 1\n");
555 case RI_RIP_VERSION_2
:
556 vty_out(vty
, " version 2\n");
558 case RI_RIP_VERSION_1_AND_2
:
559 vty_out(vty
, " no version\n");
565 * XPath: /frr-interface:lib/interface/frr-ripd:rip/split-horizon
567 DEFPY (ip_rip_split_horizon
,
568 ip_rip_split_horizon_cmd
,
569 "[no] ip rip split-horizon [poisoned-reverse$poisoned_reverse]",
572 "Routing Information Protocol\n"
573 "Perform split horizon\n"
574 "With poisoned-reverse\n")
580 else if (poisoned_reverse
)
581 value
= "poison-reverse";
585 nb_cli_enqueue_change(vty
, "./split-horizon", NB_OP_MODIFY
, value
);
587 return nb_cli_apply_changes(vty
, "./frr-ripd:rip");
590 void cli_show_ip_rip_split_horizon(struct vty
*vty
, struct lyd_node
*dnode
,
595 value
= yang_dnode_get_enum(dnode
, NULL
);
597 case RIP_NO_SPLIT_HORIZON
:
598 vty_out(vty
, " no ip rip split-horizon\n");
600 case RIP_SPLIT_HORIZON
:
601 vty_out(vty
, " ip rip split-horizon\n");
603 case RIP_SPLIT_HORIZON_POISONED_REVERSE
:
604 vty_out(vty
, " ip rip split-horizon poisoned-reverse\n");
610 * XPath: /frr-interface:lib/interface/frr-ripd:rip/v2-broadcast
612 DEFPY (ip_rip_v2_broadcast
,
613 ip_rip_v2_broadcast_cmd
,
614 "[no] ip rip v2-broadcast",
617 "Routing Information Protocol\n"
618 "Send ip broadcast v2 update\n")
620 nb_cli_enqueue_change(vty
, "./v2-broadcast", NB_OP_MODIFY
,
621 no
? "false" : "true");
623 return nb_cli_apply_changes(vty
, "./frr-ripd:rip");
626 void cli_show_ip_rip_v2_broadcast(struct vty
*vty
, struct lyd_node
*dnode
,
629 if (!yang_dnode_get_bool(dnode
, NULL
))
632 vty_out(vty
, " ip rip v2-broadcast\n");
636 * XPath: /frr-interface:lib/interface/frr-ripd:rip/version-receive
638 DEFPY (ip_rip_receive_version
,
639 ip_rip_receive_version_cmd
,
640 "ip rip receive version <{1$v1|2$v2}|none>",
642 "Routing Information Protocol\n"
643 "Advertisement reception\n"
660 nb_cli_enqueue_change(vty
, "./version-receive", NB_OP_MODIFY
, value
);
662 return nb_cli_apply_changes(vty
, "./frr-ripd:rip");
665 DEFPY (no_ip_rip_receive_version
,
666 no_ip_rip_receive_version_cmd
,
667 "no ip rip receive version [<{1|2}|none>]",
670 "Routing Information Protocol\n"
671 "Advertisement reception\n"
677 nb_cli_enqueue_change(vty
, "./version-receive", NB_OP_MODIFY
, NULL
);
679 return nb_cli_apply_changes(vty
, "./frr-ripd:rip");
682 void cli_show_ip_rip_receive_version(struct vty
*vty
, struct lyd_node
*dnode
,
685 switch (yang_dnode_get_enum(dnode
, NULL
)) {
687 vty_out(vty
, " no ip rip receive version\n");
689 case RI_RIP_VERSION_1
:
690 vty_out(vty
, " ip rip receive version 1\n");
692 case RI_RIP_VERSION_2
:
693 vty_out(vty
, " ip rip receive version 2\n");
695 case RI_RIP_VERSION_1_AND_2
:
696 vty_out(vty
, " ip rip receive version 1 2\n");
698 case RI_RIP_VERSION_NONE
:
699 vty_out(vty
, " ip rip receive version none\n");
705 * XPath: /frr-interface:lib/interface/frr-ripd:rip/version-send
707 DEFPY (ip_rip_send_version
,
708 ip_rip_send_version_cmd
,
709 "ip rip send version <{1$v1|2$v2}|none>",
711 "Routing Information Protocol\n"
712 "Advertisement transmission\n"
729 nb_cli_enqueue_change(vty
, "./version-send", NB_OP_MODIFY
, value
);
731 return nb_cli_apply_changes(vty
, "./frr-ripd:rip");
734 DEFPY (no_ip_rip_send_version
,
735 no_ip_rip_send_version_cmd
,
736 "no ip rip send version [<{1|2}|none>]",
739 "Routing Information Protocol\n"
740 "Advertisement transmission\n"
746 nb_cli_enqueue_change(vty
, "./version-send", NB_OP_MODIFY
, NULL
);
748 return nb_cli_apply_changes(vty
, "./frr-ripd:rip");
751 void cli_show_ip_rip_send_version(struct vty
*vty
, struct lyd_node
*dnode
,
754 switch (yang_dnode_get_enum(dnode
, NULL
)) {
756 vty_out(vty
, " no ip rip send version\n");
758 case RI_RIP_VERSION_1
:
759 vty_out(vty
, " ip rip send version 1\n");
761 case RI_RIP_VERSION_2
:
762 vty_out(vty
, " ip rip send version 2\n");
764 case RI_RIP_VERSION_1_AND_2
:
765 vty_out(vty
, " ip rip send version 1 2\n");
767 case RI_RIP_VERSION_NONE
:
768 vty_out(vty
, " ip rip send version none\n");
774 * XPath: /frr-interface:lib/interface/frr-ripd:rip/authentication-scheme
776 DEFPY (ip_rip_authentication_mode
,
777 ip_rip_authentication_mode_cmd
,
778 "ip rip authentication mode <md5$mode [auth-length <rfc|old-ripd>$auth_length]|text$mode>",
780 "Routing Information Protocol\n"
781 "Authentication control\n"
782 "Authentication mode\n"
783 "Keyed message digest\n"
784 "MD5 authentication data length\n"
786 "Old ripd compatible\n"
787 "Clear text authentication\n")
789 const char *value
= NULL
;
792 if (strmatch(auth_length
, "rfc"))
798 nb_cli_enqueue_change(vty
, "./authentication-scheme/mode", NB_OP_MODIFY
,
799 strmatch(mode
, "md5") ? "md5" : "plain-text");
800 nb_cli_enqueue_change(vty
, "./authentication-scheme/md5-auth-length",
801 NB_OP_MODIFY
, value
);
803 return nb_cli_apply_changes(vty
, "./frr-ripd:rip");
806 DEFPY (no_ip_rip_authentication_mode
,
807 no_ip_rip_authentication_mode_cmd
,
808 "no ip rip authentication mode [<md5 [auth-length <rfc|old-ripd>]|text>]",
811 "Routing Information Protocol\n"
812 "Authentication control\n"
813 "Authentication mode\n"
814 "Keyed message digest\n"
815 "MD5 authentication data length\n"
817 "Old ripd compatible\n"
818 "Clear text authentication\n")
820 nb_cli_enqueue_change(vty
, "./authentication-scheme/mode", NB_OP_MODIFY
,
822 nb_cli_enqueue_change(vty
, "./authentication-scheme/md5-auth-length",
825 return nb_cli_apply_changes(vty
, "./frr-ripd:rip");
828 void cli_show_ip_rip_authentication_scheme(struct vty
*vty
,
829 struct lyd_node
*dnode
,
832 switch (yang_dnode_get_enum(dnode
, "./mode")) {
834 vty_out(vty
, " no ip rip authentication mode\n");
836 case RIP_AUTH_SIMPLE_PASSWORD
:
837 vty_out(vty
, " ip rip authentication mode text\n");
840 vty_out(vty
, " ip rip authentication mode md5");
842 || !yang_dnode_is_default(dnode
, "./md5-auth-length")) {
843 if (yang_dnode_get_enum(dnode
, "./md5-auth-length")
844 == RIP_AUTH_MD5_SIZE
)
845 vty_out(vty
, " auth-length rfc");
847 vty_out(vty
, " auth-length old-ripd");
855 * XPath: /frr-interface:lib/interface/frr-ripd:rip/authentication-password
857 DEFPY (ip_rip_authentication_string
,
858 ip_rip_authentication_string_cmd
,
859 "ip rip authentication string LINE$password",
861 "Routing Information Protocol\n"
862 "Authentication control\n"
863 "Authentication string\n"
864 "Authentication string\n")
866 if (strlen(password
) > 16) {
868 "%% RIPv2 authentication string must be shorter than 16\n");
869 return CMD_WARNING_CONFIG_FAILED
;
872 if (yang_dnode_exists(vty
->candidate_config
->dnode
, "%s%s",
874 "/frr-ripd:rip/authentication-key-chain")) {
875 vty_out(vty
, "%% key-chain configuration exists\n");
876 return CMD_WARNING_CONFIG_FAILED
;
879 nb_cli_enqueue_change(vty
, "./authentication-password", NB_OP_MODIFY
,
882 return nb_cli_apply_changes(vty
, "./frr-ripd:rip");
885 DEFPY (no_ip_rip_authentication_string
,
886 no_ip_rip_authentication_string_cmd
,
887 "no ip rip authentication string [LINE]",
890 "Routing Information Protocol\n"
891 "Authentication control\n"
892 "Authentication string\n"
893 "Authentication string\n")
895 nb_cli_enqueue_change(vty
, "./authentication-password", NB_OP_MODIFY
,
898 return nb_cli_apply_changes(vty
, "./frr-ripd:rip");
901 void cli_show_ip_rip_authentication_string(struct vty
*vty
,
902 struct lyd_node
*dnode
,
905 vty_out(vty
, " ip rip authentication string %s\n",
906 yang_dnode_get_string(dnode
, NULL
));
910 * XPath: /frr-interface:lib/interface/frr-ripd:rip/authentication-key-chain
912 DEFPY (ip_rip_authentication_key_chain
,
913 ip_rip_authentication_key_chain_cmd
,
914 "ip rip authentication key-chain LINE$keychain",
916 "Routing Information Protocol\n"
917 "Authentication control\n"
918 "Authentication key-chain\n"
919 "name of key-chain\n")
921 if (yang_dnode_exists(vty
->candidate_config
->dnode
, "%s%s",
923 "/frr-ripd:rip/authentication-password")) {
924 vty_out(vty
, "%% authentication string configuration exists\n");
925 return CMD_WARNING_CONFIG_FAILED
;
928 nb_cli_enqueue_change(vty
, "./authentication-key-chain", NB_OP_MODIFY
,
931 return nb_cli_apply_changes(vty
, "./frr-ripd:rip");
934 DEFPY (no_ip_rip_authentication_key_chain
,
935 no_ip_rip_authentication_key_chain_cmd
,
936 "no ip rip authentication key-chain [LINE]",
939 "Routing Information Protocol\n"
940 "Authentication control\n"
941 "Authentication key-chain\n"
942 "name of key-chain\n")
944 nb_cli_enqueue_change(vty
, "./authentication-key-chain", NB_OP_DELETE
,
947 return nb_cli_apply_changes(vty
, "./frr-ripd:rip");
950 void cli_show_ip_rip_authentication_key_chain(struct vty
*vty
,
951 struct lyd_node
*dnode
,
954 vty_out(vty
, " ip rip authentication key-chain %s\n",
955 yang_dnode_get_string(dnode
, NULL
));
959 * XPath: /frr-ripd:clear-rip-route
966 "Clear IP RIP database\n")
968 return nb_cli_rpc("/frr-ripd:clear-rip-route", NULL
, NULL
);
971 void rip_cli_init(void)
973 install_element(CONFIG_NODE
, &router_rip_cmd
);
974 install_element(CONFIG_NODE
, &no_router_rip_cmd
);
976 install_element(RIP_NODE
, &rip_allow_ecmp_cmd
);
977 install_element(RIP_NODE
, &rip_default_information_originate_cmd
);
978 install_element(RIP_NODE
, &rip_default_metric_cmd
);
979 install_element(RIP_NODE
, &no_rip_default_metric_cmd
);
980 install_element(RIP_NODE
, &rip_distance_cmd
);
981 install_element(RIP_NODE
, &no_rip_distance_cmd
);
982 install_element(RIP_NODE
, &rip_distance_source_cmd
);
983 install_element(RIP_NODE
, &rip_neighbor_cmd
);
984 install_element(RIP_NODE
, &rip_network_prefix_cmd
);
985 install_element(RIP_NODE
, &rip_network_if_cmd
);
986 install_element(RIP_NODE
, &rip_offset_list_cmd
);
987 install_element(RIP_NODE
, &rip_passive_default_cmd
);
988 install_element(RIP_NODE
, &rip_passive_interface_cmd
);
989 install_element(RIP_NODE
, &rip_redistribute_cmd
);
990 install_element(RIP_NODE
, &rip_route_cmd
);
991 install_element(RIP_NODE
, &rip_timers_cmd
);
992 install_element(RIP_NODE
, &no_rip_timers_cmd
);
993 install_element(RIP_NODE
, &rip_version_cmd
);
994 install_element(RIP_NODE
, &no_rip_version_cmd
);
996 install_element(INTERFACE_NODE
, &ip_rip_split_horizon_cmd
);
997 install_element(INTERFACE_NODE
, &ip_rip_v2_broadcast_cmd
);
998 install_element(INTERFACE_NODE
, &ip_rip_receive_version_cmd
);
999 install_element(INTERFACE_NODE
, &no_ip_rip_receive_version_cmd
);
1000 install_element(INTERFACE_NODE
, &ip_rip_send_version_cmd
);
1001 install_element(INTERFACE_NODE
, &no_ip_rip_send_version_cmd
);
1002 install_element(INTERFACE_NODE
, &ip_rip_authentication_mode_cmd
);
1003 install_element(INTERFACE_NODE
, &no_ip_rip_authentication_mode_cmd
);
1004 install_element(INTERFACE_NODE
, &ip_rip_authentication_string_cmd
);
1005 install_element(INTERFACE_NODE
, &no_ip_rip_authentication_string_cmd
);
1006 install_element(INTERFACE_NODE
, &ip_rip_authentication_key_chain_cmd
);
1007 install_element(INTERFACE_NODE
,
1008 &no_ip_rip_authentication_key_chain_cmd
);
1010 install_element(ENABLE_NODE
, &clear_ip_rip_cmd
);