2 * EIGRP daemon CLI implementation.
4 * Copyright (C) 2019 Network Device Education Foundation, Inc. ("NetDEF")
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
25 #include "lib/command.h"
27 #include "lib/northbound_cli.h"
29 #include "eigrp_structs.h"
31 #include "eigrp_zebra.h"
32 #include "eigrp_cli.h"
34 #ifndef VTYSH_EXTRACT_PL
35 #include "eigrpd/eigrp_cli_clippy.c"
36 #endif /* VTYSH_EXTRACT_PL */
39 * XPath: /frr-eigrpd:eigrpd/instance
44 "router eigrp (1-65535)$as [vrf NAME]",
50 char xpath
[XPATH_MAXLEN
];
53 snprintf(xpath
, sizeof(xpath
),
54 "/frr-eigrpd:eigrpd/instance[asn='%s'][vrf='%s']",
55 as_str
, vrf
? vrf
: VRF_DEFAULT_NAME
);
57 nb_cli_enqueue_change(vty
, xpath
, NB_OP_CREATE
, NULL
);
58 rv
= nb_cli_apply_changes(vty
, NULL
);
59 if (rv
== CMD_SUCCESS
)
60 VTY_PUSH_XPATH(EIGRP_NODE
, xpath
);
68 "no router eigrp (1-65535)$as [vrf NAME]",
75 char xpath
[XPATH_MAXLEN
];
77 snprintf(xpath
, sizeof(xpath
),
78 "/frr-eigrpd:eigrpd/instance[asn='%s'][vrf='%s']",
79 as_str
, vrf
? vrf
: VRF_DEFAULT_NAME
);
81 nb_cli_enqueue_change(vty
, xpath
, NB_OP_DESTROY
, NULL
);
82 return nb_cli_apply_changes_clear_pending(vty
, NULL
);
85 void eigrp_cli_show_header(struct vty
*vty
, const struct lyd_node
*dnode
,
88 const char *asn
= yang_dnode_get_string(dnode
, "./asn");
89 const char *vrf
= yang_dnode_get_string(dnode
, "./vrf");
91 vty_out(vty
, "router eigrp %s", asn
);
92 if (strcmp(vrf
, VRF_DEFAULT_NAME
))
93 vty_out(vty
, " vrf %s", vrf
);
97 void eigrp_cli_show_end_header(struct vty
*vty
, const struct lyd_node
*dnode
)
99 vty_out(vty
, "exit\n");
104 * XPath: /frr-eigrpd:eigrpd/instance/router-id
109 "eigrp router-id A.B.C.D$addr",
111 "Router ID for this EIGRP process\n"
112 "EIGRP Router-ID in IP address format\n")
114 nb_cli_enqueue_change(vty
, "./router-id", NB_OP_MODIFY
, addr_str
);
115 return nb_cli_apply_changes(vty
, NULL
);
120 no_eigrp_router_id_cmd
,
121 "no eigrp router-id [A.B.C.D]",
124 "Router ID for this EIGRP process\n"
125 "EIGRP Router-ID in IP address format\n")
127 nb_cli_enqueue_change(vty
, "./router-id", NB_OP_DESTROY
, NULL
);
128 return nb_cli_apply_changes(vty
, NULL
);
131 void eigrp_cli_show_router_id(struct vty
*vty
, const struct lyd_node
*dnode
,
134 const char *router_id
= yang_dnode_get_string(dnode
, NULL
);
136 vty_out(vty
, " eigrp router-id %s\n", router_id
);
140 * XPath: /frr-eigrpd:eigrpd/instance/passive-interface
143 eigrp_passive_interface
,
144 eigrp_passive_interface_cmd
,
145 "[no] passive-interface IFNAME",
147 "Suppress routing updates on an interface\n"
148 "Interface to suppress on\n")
151 nb_cli_enqueue_change(vty
, "./passive-interface",
152 NB_OP_DESTROY
, ifname
);
154 nb_cli_enqueue_change(vty
, "./passive-interface",
155 NB_OP_CREATE
, ifname
);
157 return nb_cli_apply_changes(vty
, NULL
);
160 void eigrp_cli_show_passive_interface(struct vty
*vty
,
161 const struct lyd_node
*dnode
,
164 const char *ifname
= yang_dnode_get_string(dnode
, NULL
);
166 vty_out(vty
, " passive-interface %s\n", ifname
);
170 * XPath: /frr-eigrpd:eigrpd/instance/active-time
174 eigrp_timers_active_cmd
,
175 "timers active-time <(1-65535)$timer|disabled$disabled>",
176 "Adjust routing timers\n"
177 "Time limit for active state\n"
178 "Active state time limit in seconds\n"
179 "Disable time limit for active state\n")
182 nb_cli_enqueue_change(vty
, "./active-time", NB_OP_MODIFY
, "0");
184 nb_cli_enqueue_change(vty
, "./active-time",
185 NB_OP_MODIFY
, timer_str
);
187 return nb_cli_apply_changes(vty
, NULL
);
191 no_eigrp_timers_active
,
192 no_eigrp_timers_active_cmd
,
193 "no timers active-time [<(1-65535)|disabled>]",
195 "Adjust routing timers\n"
196 "Time limit for active state\n"
197 "Active state time limit in seconds\n"
198 "Disable time limit for active state\n")
200 nb_cli_enqueue_change(vty
, "./active-time", NB_OP_DESTROY
, NULL
);
201 return nb_cli_apply_changes(vty
, NULL
);
204 void eigrp_cli_show_active_time(struct vty
*vty
, const struct lyd_node
*dnode
,
207 const char *timer
= yang_dnode_get_string(dnode
, NULL
);
209 vty_out(vty
, " timers active-time %s\n", timer
);
213 * XPath: /frr-eigrpd:eigrpd/instance/variance
218 "variance (1-128)$variance",
219 "Control load balancing variance\n"
220 "Metric variance multiplier\n")
222 nb_cli_enqueue_change(vty
, "./variance", NB_OP_MODIFY
, variance_str
);
223 return nb_cli_apply_changes(vty
, NULL
);
228 no_eigrp_variance_cmd
,
229 "no variance [(1-128)]",
231 "Control load balancing variance\n"
232 "Metric variance multiplier\n")
234 nb_cli_enqueue_change(vty
, "./variance", NB_OP_DESTROY
, NULL
);
235 return nb_cli_apply_changes(vty
, NULL
);
238 void eigrp_cli_show_variance(struct vty
*vty
, const struct lyd_node
*dnode
,
241 const char *variance
= yang_dnode_get_string(dnode
, NULL
);
243 vty_out(vty
, " variance %s\n", variance
);
247 * XPath: /frr-eigrpd:eigrpd/instance/maximum-paths
251 eigrp_maximum_paths_cmd
,
252 "maximum-paths (1-32)$maximum_paths",
253 "Forward packets over multiple paths\n"
256 nb_cli_enqueue_change(vty
, "./maximum-paths", NB_OP_MODIFY
,
258 return nb_cli_apply_changes(vty
, NULL
);
262 no_eigrp_maximum_paths
,
263 no_eigrp_maximum_paths_cmd
,
264 "no maximum-paths [(1-32)]",
266 "Forward packets over multiple paths\n"
269 nb_cli_enqueue_change(vty
, "./maximum-paths", NB_OP_DESTROY
, NULL
);
270 return nb_cli_apply_changes(vty
, NULL
);
273 void eigrp_cli_show_maximum_paths(struct vty
*vty
, const struct lyd_node
*dnode
,
276 const char *maximum_paths
= yang_dnode_get_string(dnode
, NULL
);
278 vty_out(vty
, " maximum-paths %s\n", maximum_paths
);
282 * XPath: /frr-eigrpd:eigrpd/instance/metric-weights/K1
283 * XPath: /frr-eigrpd:eigrpd/instance/metric-weights/K2
284 * XPath: /frr-eigrpd:eigrpd/instance/metric-weights/K3
285 * XPath: /frr-eigrpd:eigrpd/instance/metric-weights/K4
286 * XPath: /frr-eigrpd:eigrpd/instance/metric-weights/K5
287 * XPath: /frr-eigrpd:eigrpd/instance/metric-weights/K6
290 eigrp_metric_weights
,
291 eigrp_metric_weights_cmd
,
292 "metric weights (0-255)$k1 (0-255)$k2 (0-255)$k3 (0-255)$k4 (0-255)$k5 [(0-255)$k6]",
293 "Modify metrics and parameters for advertisement\n"
294 "Modify metric coefficients\n"
302 nb_cli_enqueue_change(vty
, "./metric-weights/K1", NB_OP_MODIFY
, k1_str
);
303 nb_cli_enqueue_change(vty
, "./metric-weights/K2", NB_OP_MODIFY
, k2_str
);
304 nb_cli_enqueue_change(vty
, "./metric-weights/K3", NB_OP_MODIFY
, k3_str
);
305 nb_cli_enqueue_change(vty
, "./metric-weights/K4", NB_OP_MODIFY
, k4_str
);
306 nb_cli_enqueue_change(vty
, "./metric-weights/K5", NB_OP_MODIFY
, k5_str
);
308 nb_cli_enqueue_change(vty
, "./metric-weights/K6",
309 NB_OP_MODIFY
, k6_str
);
311 return nb_cli_apply_changes(vty
, NULL
);
315 no_eigrp_metric_weights
,
316 no_eigrp_metric_weights_cmd
,
317 "no metric weights [(0-255) (0-255) (0-255) (0-255) (0-255) (0-255)]",
319 "Modify metrics and parameters for advertisement\n"
320 "Modify metric coefficients\n"
328 nb_cli_enqueue_change(vty
, "./metric-weights/K1", NB_OP_DESTROY
, NULL
);
329 nb_cli_enqueue_change(vty
, "./metric-weights/K2", NB_OP_DESTROY
, NULL
);
330 nb_cli_enqueue_change(vty
, "./metric-weights/K3", NB_OP_DESTROY
, NULL
);
331 nb_cli_enqueue_change(vty
, "./metric-weights/K4", NB_OP_DESTROY
, NULL
);
332 nb_cli_enqueue_change(vty
, "./metric-weights/K5", NB_OP_DESTROY
, NULL
);
333 nb_cli_enqueue_change(vty
, "./metric-weights/K6", NB_OP_DESTROY
, NULL
);
334 return nb_cli_apply_changes(vty
, NULL
);
337 void eigrp_cli_show_metrics(struct vty
*vty
, const struct lyd_node
*dnode
,
340 const char *k1
, *k2
, *k3
, *k4
, *k5
, *k6
;
342 k1
= yang_dnode_exists(dnode
, "./K1") ?
343 yang_dnode_get_string(dnode
, "./K1") : "0";
344 k2
= yang_dnode_exists(dnode
, "./K2") ?
345 yang_dnode_get_string(dnode
, "./K2") : "0";
346 k3
= yang_dnode_exists(dnode
, "./K3") ?
347 yang_dnode_get_string(dnode
, "./K3") : "0";
348 k4
= yang_dnode_exists(dnode
, "./K4") ?
349 yang_dnode_get_string(dnode
, "./K4") : "0";
350 k5
= yang_dnode_exists(dnode
, "./K5") ?
351 yang_dnode_get_string(dnode
, "./K5") : "0";
352 k6
= yang_dnode_exists(dnode
, "./K6") ?
353 yang_dnode_get_string(dnode
, "./K6") : "0";
355 vty_out(vty
, " metric weights %s %s %s %s %s",
358 vty_out(vty
, " %s", k6
);
363 * XPath: /frr-eigrpd:eigrpd/instance/network
368 "[no] network A.B.C.D/M$prefix",
370 "Enable routing on an IP network\n"
371 "EIGRP network prefix\n")
374 nb_cli_enqueue_change(vty
, "./network", NB_OP_DESTROY
,
377 nb_cli_enqueue_change(vty
, "./network", NB_OP_CREATE
,
380 return nb_cli_apply_changes(vty
, NULL
);
383 void eigrp_cli_show_network(struct vty
*vty
, const struct lyd_node
*dnode
,
386 const char *prefix
= yang_dnode_get_string(dnode
, NULL
);
388 vty_out(vty
, " network %s\n", prefix
);
392 * XPath: /frr-eigrpd:eigrpd/instance/neighbor
397 "[no] neighbor A.B.C.D$addr",
399 "Specify a neighbor router\n"
400 "Neighbor address\n")
403 nb_cli_enqueue_change(vty
, "./neighbor", NB_OP_DESTROY
,
406 nb_cli_enqueue_change(vty
, "./neighbor", NB_OP_CREATE
,
409 return nb_cli_apply_changes(vty
, NULL
);
412 void eigrp_cli_show_neighbor(struct vty
*vty
, const struct lyd_node
*dnode
,
415 const char *prefix
= yang_dnode_get_string(dnode
, NULL
);
417 vty_out(vty
, " neighbor %s\n", prefix
);
421 * XPath: /frr-eigrpd:eigrpd/instance/redistribute
422 * XPath: /frr-eigrpd:eigrpd/instance/redistribute/route-map
423 * XPath: /frr-eigrpd:eigrpd/instance/redistribute/metrics/bandwidth
424 * XPath: /frr-eigrpd:eigrpd/instance/redistribute/metrics/delay
425 * XPath: /frr-eigrpd:eigrpd/instance/redistribute/metrics/reliability
426 * XPath: /frr-eigrpd:eigrpd/instance/redistribute/metrics/load
427 * XPath: /frr-eigrpd:eigrpd/instance/redistribute/metrics/mtu
430 eigrp_redistribute_source_metric
,
431 eigrp_redistribute_source_metric_cmd
,
432 "[no] redistribute " FRR_REDIST_STR_EIGRPD
433 "$proto [metric (1-4294967295)$bw (0-4294967295)$delay (0-255)$rlbt (1-255)$load (1-65535)$mtu]",
436 FRR_REDIST_HELP_STR_EIGRPD
437 "Metric for redistributed routes\n"
438 "Bandwidth metric in Kbits per second\n"
439 "EIGRP delay metric, in 10 microsecond units\n"
440 "EIGRP reliability metric where 255 is 100% reliable2 ?\n"
441 "EIGRP Effective bandwidth metric (Loading) where 255 is 100% loaded\n"
442 "EIGRP MTU of the path\n")
444 char xpath
[XPATH_MAXLEN
], xpath_metric
[XPATH_MAXLEN
+ 64];
446 snprintf(xpath
, sizeof(xpath
), "./redistribute[protocol='%s']", proto
);
449 nb_cli_enqueue_change(vty
, xpath
, NB_OP_DESTROY
, NULL
);
450 return nb_cli_apply_changes(vty
, NULL
);
453 nb_cli_enqueue_change(vty
, xpath
, NB_OP_CREATE
, NULL
);
454 if (bw
== 0 || delay
== 0 || rlbt
== 0 || load
== 0 || mtu
== 0)
455 return nb_cli_apply_changes(vty
, NULL
);
457 snprintf(xpath_metric
, sizeof(xpath_metric
), "%s/metrics/bandwidth",
459 nb_cli_enqueue_change(vty
, xpath_metric
, NB_OP_MODIFY
, bw_str
);
460 snprintf(xpath_metric
, sizeof(xpath_metric
), "%s/metrics/delay", xpath
);
461 nb_cli_enqueue_change(vty
, xpath_metric
, NB_OP_MODIFY
, delay_str
);
462 snprintf(xpath_metric
, sizeof(xpath_metric
), "%s/metrics/reliability",
464 nb_cli_enqueue_change(vty
, xpath_metric
, NB_OP_MODIFY
, rlbt_str
);
465 snprintf(xpath_metric
, sizeof(xpath_metric
), "%s/metrics/load", xpath
);
466 nb_cli_enqueue_change(vty
, xpath_metric
, NB_OP_MODIFY
, load_str
);
467 snprintf(xpath_metric
, sizeof(xpath_metric
), "%s/metrics/mtu", xpath
);
468 nb_cli_enqueue_change(vty
, xpath_metric
, NB_OP_MODIFY
, mtu_str
);
469 return nb_cli_apply_changes(vty
, NULL
);
472 void eigrp_cli_show_redistribute(struct vty
*vty
, const struct lyd_node
*dnode
,
475 const char *proto
= yang_dnode_get_string(dnode
, "./protocol");
476 const char *bw
, *delay
, *load
, *mtu
, *rlbt
;
478 bw
= yang_dnode_exists(dnode
, "./metrics/bandwidth") ?
479 yang_dnode_get_string(dnode
, "./metrics/bandwidth") : NULL
;
480 delay
= yang_dnode_exists(dnode
, "./metrics/delay") ?
481 yang_dnode_get_string(dnode
, "./metrics/delay") : NULL
;
482 rlbt
= yang_dnode_exists(dnode
, "./metrics/reliability") ?
483 yang_dnode_get_string(dnode
, "./metrics/reliability") : NULL
;
484 load
= yang_dnode_exists(dnode
, "./metrics/load") ?
485 yang_dnode_get_string(dnode
, "./metrics/load") : NULL
;
486 mtu
= yang_dnode_exists(dnode
, "./metrics/mtu") ?
487 yang_dnode_get_string(dnode
, "./metrics/mtu") : NULL
;
489 vty_out(vty
, " redistribute %s", proto
);
490 if (bw
|| rlbt
|| delay
|| load
|| mtu
)
491 vty_out(vty
, " metric %s %s %s %s %s", bw
, delay
, rlbt
, load
,
497 * XPath: /frr-interface:lib/interface/frr-eigrpd:eigrp/delay
502 "delay (1-16777215)$delay",
503 "Specify interface throughput delay\n"
504 "Throughput delay (tens of microseconds)\n")
506 nb_cli_enqueue_change(vty
, "./frr-eigrpd:eigrp/delay",
507 NB_OP_MODIFY
, delay_str
);
508 return nb_cli_apply_changes(vty
, NULL
);
513 no_eigrp_if_delay_cmd
,
514 "no delay [(1-16777215)]",
516 "Specify interface throughput delay\n"
517 "Throughput delay (tens of microseconds)\n")
519 nb_cli_enqueue_change(vty
, "./frr-eigrpd:eigrp/delay",
520 NB_OP_DESTROY
, NULL
);
521 return nb_cli_apply_changes(vty
, NULL
);
524 void eigrp_cli_show_delay(struct vty
*vty
, const struct lyd_node
*dnode
,
527 const char *delay
= yang_dnode_get_string(dnode
, NULL
);
529 vty_out(vty
, " delay %s\n", delay
);
533 * XPath: /frr-interface:lib/interface/frr-eigrpd:eigrp/bandwidth
537 eigrp_if_bandwidth_cmd
,
538 "eigrp bandwidth (1-10000000)$bw",
540 "Set bandwidth informational parameter\n"
541 "Bandwidth in kilobits\n")
543 nb_cli_enqueue_change(vty
, "./frr-eigrpd:eigrp/bandwidth",
544 NB_OP_MODIFY
, bw_str
);
545 return nb_cli_apply_changes(vty
, NULL
);
549 no_eigrp_if_bandwidth
,
550 no_eigrp_if_bandwidth_cmd
,
551 "no eigrp bandwidth [(1-10000000)]",
554 "Set bandwidth informational parameter\n"
555 "Bandwidth in kilobits\n")
557 nb_cli_enqueue_change(vty
, "./frr-eigrpd:eigrp/bandwidth",
558 NB_OP_DESTROY
, NULL
);
559 return nb_cli_apply_changes(vty
, NULL
);
562 void eigrp_cli_show_bandwidth(struct vty
*vty
, const struct lyd_node
*dnode
,
565 const char *bandwidth
= yang_dnode_get_string(dnode
, NULL
);
567 vty_out(vty
, " eigrp bandwidth %s\n", bandwidth
);
571 * XPath: /frr-interface:lib/interface/frr-eigrpd:eigrp/hello-interval
574 eigrp_if_ip_hellointerval
,
575 eigrp_if_ip_hellointerval_cmd
,
576 "ip hello-interval eigrp (1-65535)$hello",
577 "Interface Internet Protocol config commands\n"
578 "Configures EIGRP hello interval\n"
580 "Seconds between hello transmissions\n")
582 nb_cli_enqueue_change(vty
, "./frr-eigrpd:eigrp/hello-interval",
583 NB_OP_MODIFY
, hello_str
);
584 return nb_cli_apply_changes(vty
, NULL
);
588 no_eigrp_if_ip_hellointerval
,
589 no_eigrp_if_ip_hellointerval_cmd
,
590 "no ip hello-interval eigrp [(1-65535)]",
592 "Interface Internet Protocol config commands\n"
593 "Configures EIGRP hello interval\n"
595 "Seconds between hello transmissions\n")
597 nb_cli_enqueue_change(vty
, "./frr-eigrpd:eigrp/hello-interval",
598 NB_OP_DESTROY
, NULL
);
599 return nb_cli_apply_changes(vty
, NULL
);
603 void eigrp_cli_show_hello_interval(struct vty
*vty
,
604 const struct lyd_node
*dnode
,
607 const char *hello
= yang_dnode_get_string(dnode
, NULL
);
609 vty_out(vty
, " ip hello-interval eigrp %s\n", hello
);
613 * XPath: /frr-interface:lib/interface/frr-eigrpd:eigrp/hold-time
616 eigrp_if_ip_holdinterval
,
617 eigrp_if_ip_holdinterval_cmd
,
618 "ip hold-time eigrp (1-65535)$hold",
619 "Interface Internet Protocol config commands\n"
620 "Configures EIGRP IPv4 hold time\n"
622 "Seconds before neighbor is considered down\n")
624 nb_cli_enqueue_change(vty
, "./frr-eigrpd:eigrp/hold-time",
625 NB_OP_MODIFY
, hold_str
);
626 return nb_cli_apply_changes(vty
, NULL
);
630 no_eigrp_if_ip_holdinterval
,
631 no_eigrp_if_ip_holdinterval_cmd
,
632 "no ip hold-time eigrp [(1-65535)]",
634 "Interface Internet Protocol config commands\n"
635 "Configures EIGRP IPv4 hold time\n"
637 "Seconds before neighbor is considered down\n")
639 nb_cli_enqueue_change(vty
, "./frr-eigrpd:eigrp/hold-time",
640 NB_OP_DESTROY
, NULL
);
641 return nb_cli_apply_changes(vty
, NULL
);
644 void eigrp_cli_show_hold_time(struct vty
*vty
, const struct lyd_node
*dnode
,
647 const char *holdtime
= yang_dnode_get_string(dnode
, NULL
);
649 vty_out(vty
, " ip hold-time eigrp %s\n", holdtime
);
653 * XPath: /frr-interface:lib/interface/frr-eigrpd:eigrp/split-horizon
655 /* NOT implemented. */
658 * XPath: /frr-interface:lib/interface/frr-eigrpd:eigrp/instance
659 * XPath: /frr-interface:lib/interface/frr-eigrpd:eigrp/instance/summarize-addresses
662 eigrp_ip_summary_address
,
663 eigrp_ip_summary_address_cmd
,
664 "ip summary-address eigrp (1-65535)$as A.B.C.D/M$prefix",
665 "Interface Internet Protocol config commands\n"
666 "Perform address summarization\n"
669 "Summary <network>/<length>, e.g. 192.168.0.0/16\n")
671 char xpath
[XPATH_MAXLEN
], xpath_auth
[XPATH_MAXLEN
+ 64];
673 snprintf(xpath
, sizeof(xpath
), "./frr-eigrpd:eigrp/instance[asn='%s']",
675 nb_cli_enqueue_change(vty
, xpath
, NB_OP_CREATE
, NULL
);
677 snprintf(xpath_auth
, sizeof(xpath_auth
), "%s/summarize-addresses", xpath
);
678 nb_cli_enqueue_change(vty
, xpath_auth
, NB_OP_CREATE
, prefix_str
);
680 return nb_cli_apply_changes(vty
, NULL
);
684 no_eigrp_ip_summary_address
,
685 no_eigrp_ip_summary_address_cmd
,
686 "no ip summary-address eigrp (1-65535)$as A.B.C.D/M$prefix",
688 "Interface Internet Protocol config commands\n"
689 "Perform address summarization\n"
692 "Summary <network>/<length>, e.g. 192.168.0.0/16\n")
694 char xpath
[XPATH_MAXLEN
], xpath_auth
[XPATH_MAXLEN
+ 64];
696 snprintf(xpath
, sizeof(xpath
), "./frr-eigrpd:eigrp/instance[asn='%s']",
698 nb_cli_enqueue_change(vty
, xpath
, NB_OP_CREATE
, NULL
);
700 snprintf(xpath_auth
, sizeof(xpath_auth
), "%s/summarize-addresses", xpath
);
701 nb_cli_enqueue_change(vty
, xpath_auth
, NB_OP_DESTROY
, prefix_str
);
703 return nb_cli_apply_changes(vty
, NULL
);
706 void eigrp_cli_show_summarize_address(struct vty
*vty
,
707 const struct lyd_node
*dnode
,
710 const struct lyd_node
*instance
=
711 yang_dnode_get_parent(dnode
, "instance");
712 uint16_t asn
= yang_dnode_get_uint16(instance
, "./asn");
713 const char *summarize_address
= yang_dnode_get_string(dnode
, NULL
);
715 vty_out(vty
, " ip summary-address eigrp %d %s\n", asn
,
720 * XPath: /frr-interface:lib/interface/frr-eigrpd:eigrp/instance
721 * XPath: /frr-interface:lib/interface/frr-eigrpd:eigrp/instance/authentication
724 eigrp_authentication_mode
,
725 eigrp_authentication_mode_cmd
,
726 "ip authentication mode eigrp (1-65535)$as <md5|hmac-sha-256>$crypt",
727 "Interface Internet Protocol config commands\n"
728 "Authentication subcommands\n"
732 "Keyed message digest\n"
733 "HMAC SHA256 algorithm \n")
735 char xpath
[XPATH_MAXLEN
], xpath_auth
[XPATH_MAXLEN
+ 64];
737 snprintf(xpath
, sizeof(xpath
), "./frr-eigrpd:eigrp/instance[asn='%s']",
739 nb_cli_enqueue_change(vty
, xpath
, NB_OP_CREATE
, NULL
);
741 snprintf(xpath_auth
, sizeof(xpath_auth
), "%s/authentication", xpath
);
742 nb_cli_enqueue_change(vty
, xpath_auth
, NB_OP_MODIFY
, crypt
);
744 return nb_cli_apply_changes(vty
, NULL
);
748 no_eigrp_authentication_mode
,
749 no_eigrp_authentication_mode_cmd
,
750 "no ip authentication mode eigrp (1-65535)$as [<md5|hmac-sha-256>]",
752 "Interface Internet Protocol config commands\n"
753 "Authentication subcommands\n"
757 "Keyed message digest\n"
758 "HMAC SHA256 algorithm \n")
760 char xpath
[XPATH_MAXLEN
], xpath_auth
[XPATH_MAXLEN
+ 64];
762 snprintf(xpath
, sizeof(xpath
), "./frr-eigrpd:eigrp/instance[asn='%s']",
764 nb_cli_enqueue_change(vty
, xpath
, NB_OP_CREATE
, NULL
);
766 snprintf(xpath_auth
, sizeof(xpath_auth
), "%s/authentication", xpath
);
767 nb_cli_enqueue_change(vty
, xpath_auth
, NB_OP_MODIFY
, "none");
769 return nb_cli_apply_changes(vty
, NULL
);
772 void eigrp_cli_show_authentication(struct vty
*vty
,
773 const struct lyd_node
*dnode
,
776 const struct lyd_node
*instance
=
777 yang_dnode_get_parent(dnode
, "instance");
778 uint16_t asn
= yang_dnode_get_uint16(instance
, "./asn");
779 const char *crypt
= yang_dnode_get_string(dnode
, NULL
);
781 vty_out(vty
, " ip authentication mode eigrp %d %s\n", asn
, crypt
);
785 * XPath: /frr-interface:lib/interface/frr-eigrpd:eigrp/instance
786 * XPath: /frr-interface:lib/interface/frr-eigrpd:eigrp/instance/keychain
789 eigrp_authentication_keychain
,
790 eigrp_authentication_keychain_cmd
,
791 "ip authentication key-chain eigrp (1-65535)$as WORD$name",
792 "Interface Internet Protocol config commands\n"
793 "Authentication subcommands\n"
797 "Name of key-chain\n")
799 char xpath
[XPATH_MAXLEN
], xpath_auth
[XPATH_MAXLEN
+ 64];
801 snprintf(xpath
, sizeof(xpath
), "./frr-eigrpd:eigrp/instance[asn='%s']",
803 nb_cli_enqueue_change(vty
, xpath
, NB_OP_CREATE
, NULL
);
805 snprintf(xpath_auth
, sizeof(xpath_auth
), "%s/keychain", xpath
);
806 nb_cli_enqueue_change(vty
, xpath_auth
, NB_OP_MODIFY
, name
);
808 return nb_cli_apply_changes(vty
, NULL
);
812 no_eigrp_authentication_keychain
,
813 no_eigrp_authentication_keychain_cmd
,
814 "no ip authentication key-chain eigrp (1-65535)$as [WORD]",
816 "Interface Internet Protocol config commands\n"
817 "Authentication subcommands\n"
821 "Name of key-chain\n")
823 char xpath
[XPATH_MAXLEN
], xpath_auth
[XPATH_MAXLEN
+ 64];
825 snprintf(xpath
, sizeof(xpath
), "./frr-eigrpd:eigrp/instance[asn='%s']",
827 snprintf(xpath_auth
, sizeof(xpath_auth
), "%s/keychain", xpath
);
828 nb_cli_enqueue_change(vty
, xpath_auth
, NB_OP_DESTROY
, NULL
);
830 return nb_cli_apply_changes(vty
, NULL
);
833 void eigrp_cli_show_keychain(struct vty
*vty
, const struct lyd_node
*dnode
,
836 const struct lyd_node
*instance
=
837 yang_dnode_get_parent(dnode
, "instance");
838 uint16_t asn
= yang_dnode_get_uint16(instance
, "./asn");
839 const char *keychain
= yang_dnode_get_string(dnode
, NULL
);
841 vty_out(vty
, " ip authentication key-chain eigrp %d %s\n", asn
,
847 * CLI installation procedures.
849 static int eigrp_config_write(struct vty
*vty
);
850 static struct cmd_node eigrp_node
= {
853 .parent_node
= CONFIG_NODE
,
854 .prompt
= "%s(config-router)# ",
855 .config_write
= eigrp_config_write
,
858 static int eigrp_config_write(struct vty
*vty
)
860 const struct lyd_node
*dnode
;
863 dnode
= yang_dnode_get(running_config
->dnode
, "/frr-eigrpd:eigrpd");
865 nb_cli_show_dnode_cmds(vty
, dnode
, false);
875 install_element(CONFIG_NODE
, &router_eigrp_cmd
);
876 install_element(CONFIG_NODE
, &no_router_eigrp_cmd
);
878 install_node(&eigrp_node
);
879 install_default(EIGRP_NODE
);
881 install_element(EIGRP_NODE
, &eigrp_router_id_cmd
);
882 install_element(EIGRP_NODE
, &no_eigrp_router_id_cmd
);
883 install_element(EIGRP_NODE
, &eigrp_passive_interface_cmd
);
884 install_element(EIGRP_NODE
, &eigrp_timers_active_cmd
);
885 install_element(EIGRP_NODE
, &no_eigrp_timers_active_cmd
);
886 install_element(EIGRP_NODE
, &eigrp_variance_cmd
);
887 install_element(EIGRP_NODE
, &no_eigrp_variance_cmd
);
888 install_element(EIGRP_NODE
, &eigrp_maximum_paths_cmd
);
889 install_element(EIGRP_NODE
, &no_eigrp_maximum_paths_cmd
);
890 install_element(EIGRP_NODE
, &eigrp_metric_weights_cmd
);
891 install_element(EIGRP_NODE
, &no_eigrp_metric_weights_cmd
);
892 install_element(EIGRP_NODE
, &eigrp_network_cmd
);
893 install_element(EIGRP_NODE
, &eigrp_neighbor_cmd
);
894 install_element(EIGRP_NODE
, &eigrp_redistribute_source_metric_cmd
);
898 if_cmd_init_default();
900 install_element(INTERFACE_NODE
, &eigrp_if_delay_cmd
);
901 install_element(INTERFACE_NODE
, &no_eigrp_if_delay_cmd
);
902 install_element(INTERFACE_NODE
, &eigrp_if_bandwidth_cmd
);
903 install_element(INTERFACE_NODE
, &no_eigrp_if_bandwidth_cmd
);
904 install_element(INTERFACE_NODE
, &eigrp_if_ip_hellointerval_cmd
);
905 install_element(INTERFACE_NODE
, &no_eigrp_if_ip_hellointerval_cmd
);
906 install_element(INTERFACE_NODE
, &eigrp_if_ip_holdinterval_cmd
);
907 install_element(INTERFACE_NODE
, &no_eigrp_if_ip_holdinterval_cmd
);
908 install_element(INTERFACE_NODE
, &eigrp_ip_summary_address_cmd
);
909 install_element(INTERFACE_NODE
, &no_eigrp_ip_summary_address_cmd
);
910 install_element(INTERFACE_NODE
, &eigrp_authentication_mode_cmd
);
911 install_element(INTERFACE_NODE
, &no_eigrp_authentication_mode_cmd
);
912 install_element(INTERFACE_NODE
, &eigrp_authentication_keychain_cmd
);
913 install_element(INTERFACE_NODE
, &no_eigrp_authentication_keychain_cmd
);