2 * Copyright (C) 2001,2002 Sampo Saaristo
3 * Tampere University of Technology
4 * Institute of Communications Engineering
5 * Copyright (C) 2018 Volta Networks
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the Free
10 * Software Foundation; either version 2 of the License, or (at your option)
13 * This program is distributed in the hope that it will be useful, but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
18 * You should have received a copy of the GNU General Public License along
19 * with this program; see the file COPYING; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
30 #include "northbound_cli.h"
33 #include "lib/linklist.h"
34 #include "isisd/isisd.h"
35 #include "isisd/isis_cli.h"
36 #include "isisd/isis_misc.h"
37 #include "isisd/isis_circuit.h"
38 #include "isisd/isis_csm.h"
40 #ifndef VTYSH_EXTRACT_PL
41 #include "isisd/isis_cli_clippy.c"
47 * XPath: /frr-isisd:isis/instance
49 DEFPY_NOSH(router_isis
, router_isis_cmd
, "router isis WORD$tag",
52 "ISO Routing area tag\n")
55 char base_xpath
[XPATH_MAXLEN
];
57 snprintf(base_xpath
, XPATH_MAXLEN
,
58 "/frr-isisd:isis/instance[area-tag='%s']", tag
);
59 nb_cli_enqueue_change(vty
, ".", NB_OP_CREATE
, NULL
);
60 /* default value in yang for is-type is level-1, but in FRR
61 * the first instance is assigned is-type level-1-2. We
62 * need to make sure to set it in the yang model so that it
63 * is consistent with what FRR sees.
65 if (listcount(isis
->area_list
) == 0)
66 nb_cli_enqueue_change(vty
, "./is-type", NB_OP_MODIFY
,
68 ret
= nb_cli_apply_changes(vty
, base_xpath
);
69 if (ret
== CMD_SUCCESS
)
70 VTY_PUSH_XPATH(ISIS_NODE
, base_xpath
);
75 DEFPY(no_router_isis
, no_router_isis_cmd
, "no router isis WORD$tag",
78 "ISO Routing area tag\n")
80 char temp_xpath
[XPATH_MAXLEN
];
81 struct listnode
*node
, *nnode
;
82 struct isis_circuit
*circuit
= NULL
;
83 struct isis_area
*area
= NULL
;
85 if (!yang_dnode_exists(vty
->candidate_config
->dnode
,
86 "/frr-isisd:isis/instance[area-tag='%s']",
88 vty_out(vty
, "ISIS area %s not found.\n", tag
);
89 return CMD_ERR_NOTHING_TODO
;
92 nb_cli_enqueue_change(vty
, ".", NB_OP_DESTROY
, NULL
);
93 area
= isis_area_lookup(tag
);
94 if (area
&& area
->circuit_list
&& listcount(area
->circuit_list
)) {
95 for (ALL_LIST_ELEMENTS(area
->circuit_list
, node
, nnode
,
97 /* add callbacks to delete each of the circuits listed
99 const char *vrf_name
=
100 vrf_lookup_by_id(circuit
->interface
->vrf_id
)
103 temp_xpath
, XPATH_MAXLEN
,
104 "/frr-interface:lib/interface[name='%s'][vrf='%s']/frr-isisd:isis",
105 circuit
->interface
->name
, vrf_name
);
106 nb_cli_enqueue_change(vty
, temp_xpath
, NB_OP_DESTROY
,
111 return nb_cli_apply_changes(
112 vty
, "/frr-isisd:isis/instance[area-tag='%s']", tag
);
115 void cli_show_router_isis(struct vty
*vty
, struct lyd_node
*dnode
,
119 vty_out(vty
, "router isis %s\n",
120 yang_dnode_get_string(dnode
, "./area-tag"));
124 * XPath: /frr-interface:lib/interface/frr-isisd:isis/
125 * XPath: /frr-interface:lib/interface/frr-isisd:isis/ipv4-routing
126 * XPath: /frr-interface:lib/interface/frr-isisd:isis/ipv6-routing
127 * XPath: /frr-isisd:isis/instance
129 DEFPY(ip_router_isis
, ip_router_isis_cmd
, "ip router isis WORD$tag",
130 "Interface Internet Protocol config commands\n"
131 "IP router interface commands\n"
132 "IS-IS routing protocol\n"
133 "Routing process tag\n")
135 char temp_xpath
[XPATH_MAXLEN
];
136 const char *circ_type
;
137 struct isis_area
*area
;
138 struct interface
*ifp
;
140 /* area will be created if it is not present. make sure the yang model
141 * is synced with FRR and call the appropriate NB cb.
143 area
= isis_area_lookup(tag
);
145 snprintf(temp_xpath
, XPATH_MAXLEN
,
146 "/frr-isisd:isis/instance[area-tag='%s']", tag
);
147 nb_cli_enqueue_change(vty
, temp_xpath
, NB_OP_CREATE
, tag
);
148 snprintf(temp_xpath
, XPATH_MAXLEN
,
149 "/frr-isisd:isis/instance[area-tag='%s']/is-type",
151 nb_cli_enqueue_change(
152 vty
, temp_xpath
, NB_OP_MODIFY
,
153 listcount(isis
->area_list
) == 0 ? "level-1-2" : NULL
);
154 nb_cli_enqueue_change(vty
, "./frr-isisd:isis", NB_OP_CREATE
,
156 nb_cli_enqueue_change(vty
, "./frr-isisd:isis/area-tag",
158 nb_cli_enqueue_change(vty
, "./frr-isisd:isis/ipv4-routing",
159 NB_OP_MODIFY
, "true");
160 nb_cli_enqueue_change(
161 vty
, "./frr-isisd:isis/circuit-type", NB_OP_MODIFY
,
162 listcount(isis
->area_list
) == 0 ? "level-1-2"
165 /* area exists, circuit type defaults to its area's is_type */
166 switch (area
->is_type
) {
168 circ_type
= "level-1";
171 circ_type
= "level-2";
173 case IS_LEVEL_1_AND_2
:
174 circ_type
= "level-1-2";
177 /* just to silence compiler warnings */
178 return CMD_WARNING_CONFIG_FAILED
;
180 nb_cli_enqueue_change(vty
, "./frr-isisd:isis", NB_OP_CREATE
,
182 nb_cli_enqueue_change(vty
, "./frr-isisd:isis/area-tag",
184 nb_cli_enqueue_change(vty
, "./frr-isisd:isis/ipv4-routing",
185 NB_OP_MODIFY
, "true");
186 nb_cli_enqueue_change(vty
, "./frr-isisd:isis/circuit-type",
187 NB_OP_MODIFY
, circ_type
);
190 /* check if the interface is a loopback and if so set it as passive */
191 pthread_rwlock_rdlock(&running_config
->lock
);
193 ifp
= nb_running_get_entry(NULL
, VTY_CURR_XPATH
, false);
194 if (ifp
&& if_is_loopback(ifp
))
195 nb_cli_enqueue_change(vty
, "./frr-isisd:isis/passive",
196 NB_OP_MODIFY
, "true");
198 pthread_rwlock_unlock(&running_config
->lock
);
200 return nb_cli_apply_changes(vty
, NULL
);
203 DEFPY(ip6_router_isis
, ip6_router_isis_cmd
, "ipv6 router isis WORD$tag",
204 "Interface Internet Protocol config commands\n"
205 "IP router interface commands\n"
206 "IS-IS routing protocol\n"
207 "Routing process tag\n")
209 char temp_xpath
[XPATH_MAXLEN
];
210 const char *circ_type
;
211 struct isis_area
*area
;
212 struct interface
*ifp
;
214 /* area will be created if it is not present. make sure the yang model
215 * is synced with FRR and call the appropriate NB cb.
217 area
= isis_area_lookup(tag
);
219 snprintf(temp_xpath
, XPATH_MAXLEN
,
220 "/frr-isisd:isis/instance[area-tag='%s']", tag
);
221 nb_cli_enqueue_change(vty
, temp_xpath
, NB_OP_CREATE
, tag
);
222 snprintf(temp_xpath
, XPATH_MAXLEN
,
223 "/frr-isisd:isis/instance[area-tag='%s']/is-type",
225 nb_cli_enqueue_change(
226 vty
, temp_xpath
, NB_OP_MODIFY
,
227 listcount(isis
->area_list
) == 0 ? "level-1-2" : NULL
);
228 nb_cli_enqueue_change(vty
, "./frr-isisd:isis", NB_OP_CREATE
,
230 nb_cli_enqueue_change(vty
, "./frr-isisd:isis/area-tag",
232 nb_cli_enqueue_change(vty
, "./frr-isisd:isis/ipv6-routing",
233 NB_OP_MODIFY
, "true");
234 nb_cli_enqueue_change(
235 vty
, "./frr-isisd:isis/circuit-type", NB_OP_MODIFY
,
236 listcount(isis
->area_list
) == 0 ? "level-1-2"
239 /* area exists, circuit type defaults to its area's is_type */
240 switch (area
->is_type
) {
242 circ_type
= "level-1";
245 circ_type
= "level-2";
247 case IS_LEVEL_1_AND_2
:
248 circ_type
= "level-1-2";
251 /* just to silence compiler warnings */
252 return CMD_WARNING_CONFIG_FAILED
;
254 nb_cli_enqueue_change(vty
, "./frr-isisd:isis", NB_OP_CREATE
,
256 nb_cli_enqueue_change(vty
, "./frr-isisd:isis/area-tag",
258 nb_cli_enqueue_change(vty
, "./frr-isisd:isis/ipv6-routing",
259 NB_OP_MODIFY
, "true");
260 nb_cli_enqueue_change(vty
, "./frr-isisd:isis/circuit-type",
261 NB_OP_MODIFY
, circ_type
);
264 /* check if the interface is a loopback and if so set it as passive */
265 pthread_rwlock_rdlock(&running_config
->lock
);
267 ifp
= nb_running_get_entry(NULL
, VTY_CURR_XPATH
, false);
268 if (ifp
&& if_is_loopback(ifp
))
269 nb_cli_enqueue_change(vty
, "./frr-isisd:isis/passive",
270 NB_OP_MODIFY
, "true");
272 pthread_rwlock_unlock(&running_config
->lock
);
274 return nb_cli_apply_changes(vty
, NULL
);
277 DEFPY(no_ip_router_isis
, no_ip_router_isis_cmd
,
278 "no <ip|ipv6>$ip router isis [WORD]$tag",
280 "Interface Internet Protocol config commands\n"
281 "IP router interface commands\n"
282 "IP router interface commands\n"
283 "IS-IS routing protocol\n"
284 "Routing process tag\n")
286 const struct lyd_node
*dnode
;
288 dnode
= yang_dnode_get(vty
->candidate_config
->dnode
,
289 "%s/frr-isisd:isis", VTY_CURR_XPATH
);
294 * If both ipv4 and ipv6 are off delete the interface isis container.
296 if (strmatch(ip
, "ipv6")) {
297 if (!yang_dnode_get_bool(dnode
, "./ipv4-routing"))
298 nb_cli_enqueue_change(vty
, "./frr-isisd:isis",
299 NB_OP_DESTROY
, NULL
);
301 nb_cli_enqueue_change(vty
,
302 "./frr-isisd:isis/ipv6-routing",
303 NB_OP_MODIFY
, "false");
305 if (!yang_dnode_get_bool(dnode
, "./ipv6-routing"))
306 nb_cli_enqueue_change(vty
, "./frr-isisd:isis",
307 NB_OP_DESTROY
, NULL
);
309 nb_cli_enqueue_change(vty
,
310 "./frr-isisd:isis/ipv4-routing",
311 NB_OP_MODIFY
, "false");
314 return nb_cli_apply_changes(vty
, NULL
);
317 void cli_show_ip_isis_ipv4(struct vty
*vty
, struct lyd_node
*dnode
,
320 if (!yang_dnode_get_bool(dnode
, NULL
))
322 vty_out(vty
, " ip router isis %s\n",
323 yang_dnode_get_string(dnode
, "../area-tag"));
326 void cli_show_ip_isis_ipv6(struct vty
*vty
, struct lyd_node
*dnode
,
329 if (!yang_dnode_get_bool(dnode
, NULL
))
331 vty_out(vty
, " ipv6 router isis %s\n",
332 yang_dnode_get_string(dnode
, "../area-tag"));
336 * XPath: /frr-interface:lib/interface/frr-isisd:isis/bfd-monitoring
343 "Enable BFD support\n")
345 const struct lyd_node
*dnode
;
347 dnode
= yang_dnode_get(vty
->candidate_config
->dnode
,
348 "%s/frr-isisd:isis", VTY_CURR_XPATH
);
350 vty_out(vty
, "ISIS is not enabled on this circuit\n");
354 nb_cli_enqueue_change(vty
, "./frr-isisd:isis/bfd-monitoring",
355 NB_OP_MODIFY
, no
? "false" : "true");
357 return nb_cli_apply_changes(vty
, NULL
);
360 void cli_show_ip_isis_bfd_monitoring(struct vty
*vty
, struct lyd_node
*dnode
,
363 if (!yang_dnode_get_bool(dnode
, NULL
))
366 vty_out(vty
, "isis bfd\n");
370 * XPath: /frr-isisd:isis/instance/area-address
372 DEFPY(net
, net_cmd
, "[no] net WORD",
373 "Remove an existing Network Entity Title for this process\n"
374 "A Network Entity Title for this process (OSI only)\n"
375 "XX.XXXX. ... .XXX.XX Network entity title (NET)\n")
377 nb_cli_enqueue_change(vty
, "./area-address",
378 no
? NB_OP_DESTROY
: NB_OP_CREATE
, net
);
380 return nb_cli_apply_changes(vty
, NULL
);
383 void cli_show_isis_area_address(struct vty
*vty
, struct lyd_node
*dnode
,
386 vty_out(vty
, " net %s\n", yang_dnode_get_string(dnode
, NULL
));
390 * XPath: /frr-isisd:isis/instance/is-type
392 DEFPY(is_type
, is_type_cmd
, "is-type <level-1|level-1-2|level-2-only>$level",
393 "IS Level for this routing process (OSI only)\n"
394 "Act as a station router only\n"
395 "Act as both a station router and an area router\n"
396 "Act as an area router only\n")
398 nb_cli_enqueue_change(vty
, "./is-type", NB_OP_MODIFY
,
399 strmatch(level
, "level-2-only") ? "level-2"
402 return nb_cli_apply_changes(vty
, NULL
);
405 DEFPY(no_is_type
, no_is_type_cmd
,
406 "no is-type [<level-1|level-1-2|level-2-only>]",
408 "IS Level for this routing process (OSI only)\n"
409 "Act as a station router only\n"
410 "Act as both a station router and an area router\n"
411 "Act as an area router only\n")
415 pthread_rwlock_rdlock(&running_config
->lock
);
417 struct isis_area
*area
;
419 area
= nb_running_get_entry(NULL
, VTY_CURR_XPATH
, false);
422 * Put the is-type back to defaults:
423 * - level-1-2 on first area
424 * - level-1 for the rest
426 if (area
&& listgetdata(listhead(isis
->area_list
)) == area
)
431 pthread_rwlock_unlock(&running_config
->lock
);
433 nb_cli_enqueue_change(vty
, "./is-type", NB_OP_MODIFY
, value
);
435 return nb_cli_apply_changes(vty
, NULL
);
438 void cli_show_isis_is_type(struct vty
*vty
, struct lyd_node
*dnode
,
441 int is_type
= yang_dnode_get_enum(dnode
, NULL
);
445 vty_out(vty
, " is-type level-1\n");
448 vty_out(vty
, " is-type level-2-only\n");
450 case IS_LEVEL_1_AND_2
:
451 vty_out(vty
, " is-type level-1-2\n");
457 * XPath: /frr-isisd:isis/instance/dynamic-hostname
459 DEFPY(dynamic_hostname
, dynamic_hostname_cmd
, "[no] hostname dynamic",
461 "Dynamic hostname for IS-IS\n"
462 "Dynamic hostname\n")
464 nb_cli_enqueue_change(vty
, "./dynamic-hostname", NB_OP_MODIFY
,
465 no
? "false" : "true");
467 return nb_cli_apply_changes(vty
, NULL
);
470 void cli_show_isis_dynamic_hostname(struct vty
*vty
, struct lyd_node
*dnode
,
473 if (!yang_dnode_get_bool(dnode
, NULL
))
476 vty_out(vty
, " hostname dynamic\n");
480 * XPath: /frr-isisd:isis/instance/overload
482 DEFPY(set_overload_bit
, set_overload_bit_cmd
, "[no] set-overload-bit",
483 "Reset overload bit to accept transit traffic\n"
484 "Set overload bit to avoid any transit traffic\n")
486 nb_cli_enqueue_change(vty
, "./overload", NB_OP_MODIFY
,
487 no
? "false" : "true");
489 return nb_cli_apply_changes(vty
, NULL
);
492 void cli_show_isis_overload(struct vty
*vty
, struct lyd_node
*dnode
,
495 if (!yang_dnode_get_bool(dnode
, NULL
))
497 vty_out(vty
, " set-overload-bit\n");
501 * XPath: /frr-isisd:isis/instance/attached
503 DEFPY(set_attached_bit
, set_attached_bit_cmd
, "[no] set-attached-bit",
504 "Reset attached bit\n"
505 "Set attached bit to identify as L1/L2 router for inter-area traffic\n")
507 nb_cli_enqueue_change(vty
, "./attached", NB_OP_MODIFY
,
508 no
? "false" : "true");
510 return nb_cli_apply_changes(vty
, NULL
);
513 void cli_show_isis_attached(struct vty
*vty
, struct lyd_node
*dnode
,
516 if (!yang_dnode_get_bool(dnode
, NULL
))
518 vty_out(vty
, " set-attached-bit\n");
522 * XPath: /frr-isisd:isis/instance/metric-style
524 DEFPY(metric_style
, metric_style_cmd
,
525 "metric-style <narrow|transition|wide>$style",
526 "Use old-style (ISO 10589) or new-style packet formats\n"
527 "Use old style of TLVs with narrow metric\n"
528 "Send and accept both styles of TLVs during transition\n"
529 "Use new style of TLVs to carry wider metric\n")
531 nb_cli_enqueue_change(vty
, "./metric-style", NB_OP_MODIFY
, style
);
533 return nb_cli_apply_changes(vty
, NULL
);
536 DEFPY(no_metric_style
, no_metric_style_cmd
,
537 "no metric-style [narrow|transition|wide]",
539 "Use old-style (ISO 10589) or new-style packet formats\n"
540 "Use old style of TLVs with narrow metric\n"
541 "Send and accept both styles of TLVs during transition\n"
542 "Use new style of TLVs to carry wider metric\n")
544 nb_cli_enqueue_change(vty
, "./metric-style", NB_OP_MODIFY
, "narrow");
546 return nb_cli_apply_changes(vty
, NULL
);
549 void cli_show_isis_metric_style(struct vty
*vty
, struct lyd_node
*dnode
,
552 int metric
= yang_dnode_get_enum(dnode
, NULL
);
555 case ISIS_NARROW_METRIC
:
556 vty_out(vty
, " metric-style narrow\n");
558 case ISIS_WIDE_METRIC
:
559 vty_out(vty
, " metric-style wide\n");
561 case ISIS_TRANSITION_METRIC
:
562 vty_out(vty
, " metric-style transition\n");
568 * XPath: /frr-isisd:isis/instance/area-password
570 DEFPY(area_passwd
, area_passwd_cmd
,
571 "area-password <clear|md5>$pwd_type WORD$pwd [authenticate snp <send-only|validate>$snp]",
572 "Configure the authentication password for an area\n"
573 "Clear-text authentication type\n"
574 "MD5 authentication type\n"
575 "Level-wide password\n"
578 "Send but do not check PDUs on receiving\n"
579 "Send and check PDUs on receiving\n")
581 nb_cli_enqueue_change(vty
, "./area-password", NB_OP_CREATE
, NULL
);
582 nb_cli_enqueue_change(vty
, "./area-password/password", NB_OP_MODIFY
,
584 nb_cli_enqueue_change(vty
, "./area-password/password-type",
585 NB_OP_MODIFY
, pwd_type
);
586 nb_cli_enqueue_change(vty
, "./area-password/authenticate-snp",
587 NB_OP_MODIFY
, snp
? snp
: "none");
589 return nb_cli_apply_changes(vty
, NULL
);
592 void cli_show_isis_area_pwd(struct vty
*vty
, struct lyd_node
*dnode
,
597 vty_out(vty
, " area-password %s %s",
598 yang_dnode_get_string(dnode
, "./password-type"),
599 yang_dnode_get_string(dnode
, "./password"));
600 snp
= yang_dnode_get_string(dnode
, "./authenticate-snp");
601 if (!strmatch("none", snp
))
602 vty_out(vty
, " authenticate snp %s", snp
);
607 * XPath: /frr-isisd:isis/instance/domain-password
609 DEFPY(domain_passwd
, domain_passwd_cmd
,
610 "domain-password <clear|md5>$pwd_type WORD$pwd [authenticate snp <send-only|validate>$snp]",
611 "Set the authentication password for a routing domain\n"
612 "Clear-text authentication type\n"
613 "MD5 authentication type\n"
614 "Level-wide password\n"
617 "Send but do not check PDUs on receiving\n"
618 "Send and check PDUs on receiving\n")
620 nb_cli_enqueue_change(vty
, "./domain-password", NB_OP_CREATE
, NULL
);
621 nb_cli_enqueue_change(vty
, "./domain-password/password", NB_OP_MODIFY
,
623 nb_cli_enqueue_change(vty
, "./domain-password/password-type",
624 NB_OP_MODIFY
, pwd_type
);
625 nb_cli_enqueue_change(vty
, "./domain-password/authenticate-snp",
626 NB_OP_MODIFY
, snp
? snp
: "none");
628 return nb_cli_apply_changes(vty
, NULL
);
631 DEFPY(no_area_passwd
, no_area_passwd_cmd
,
632 "no <area-password|domain-password>$cmd",
634 "Configure the authentication password for an area\n"
635 "Set the authentication password for a routing domain\n")
637 nb_cli_enqueue_change(vty
, ".", NB_OP_DESTROY
, NULL
);
639 return nb_cli_apply_changes(vty
, "./%s", cmd
);
642 void cli_show_isis_domain_pwd(struct vty
*vty
, struct lyd_node
*dnode
,
647 vty_out(vty
, " domain-password %s %s",
648 yang_dnode_get_string(dnode
, "./password-type"),
649 yang_dnode_get_string(dnode
, "./password"));
650 snp
= yang_dnode_get_string(dnode
, "./authenticate-snp");
651 if (!strmatch("none", snp
))
652 vty_out(vty
, " authenticate snp %s", snp
);
657 * XPath: /frr-isisd:isis/instance/lsp/generation-interval
659 DEFPY(lsp_gen_interval
, lsp_gen_interval_cmd
,
660 "lsp-gen-interval [level-1|level-2]$level (1-120)$val",
661 "Minimum interval between regenerating same LSP\n"
662 "Set interval for level 1 only\n"
663 "Set interval for level 2 only\n"
664 "Minimum interval in seconds\n")
666 if (!level
|| strmatch(level
, "level-1"))
667 nb_cli_enqueue_change(vty
, "./lsp/generation-interval/level-1",
668 NB_OP_MODIFY
, val_str
);
669 if (!level
|| strmatch(level
, "level-2"))
670 nb_cli_enqueue_change(vty
, "./lsp/generation-interval/level-2",
671 NB_OP_MODIFY
, val_str
);
673 return nb_cli_apply_changes(vty
, NULL
);
676 DEFPY(no_lsp_gen_interval
, no_lsp_gen_interval_cmd
,
677 "no lsp-gen-interval [level-1|level-2]$level [(1-120)]",
679 "Minimum interval between regenerating same LSP\n"
680 "Set interval for level 1 only\n"
681 "Set interval for level 2 only\n"
682 "Minimum interval in seconds\n")
684 if (!level
|| strmatch(level
, "level-1"))
685 nb_cli_enqueue_change(vty
, "./lsp/generation-interval/level-1",
687 if (!level
|| strmatch(level
, "level-2"))
688 nb_cli_enqueue_change(vty
, "./lsp/generation-interval/level-2",
691 return nb_cli_apply_changes(vty
, NULL
);
694 void cli_show_isis_lsp_gen_interval(struct vty
*vty
, struct lyd_node
*dnode
,
697 const char *l1
= yang_dnode_get_string(dnode
, "./level-1");
698 const char *l2
= yang_dnode_get_string(dnode
, "./level-2");
700 if (strmatch(l1
, l2
))
701 vty_out(vty
, " lsp-gen-interval %s\n", l1
);
703 vty_out(vty
, " lsp-gen-interval level-1 %s\n", l1
);
704 vty_out(vty
, " lsp-gen-interval level-2 %s\n", l2
);
709 * XPath: /frr-isisd:isis/instance/lsp/refresh-interval
711 DEFPY(lsp_refresh_interval
, lsp_refresh_interval_cmd
,
712 "lsp-refresh-interval [level-1|level-2]$level (1-65235)$val",
713 "LSP refresh interval\n"
714 "LSP refresh interval for Level 1 only\n"
715 "LSP refresh interval for Level 2 only\n"
716 "LSP refresh interval in seconds\n")
718 if (!level
|| strmatch(level
, "level-1"))
719 nb_cli_enqueue_change(vty
, "./lsp/refresh-interval/level-1",
720 NB_OP_MODIFY
, val_str
);
721 if (!level
|| strmatch(level
, "level-2"))
722 nb_cli_enqueue_change(vty
, "./lsp/refresh-interval/level-2",
723 NB_OP_MODIFY
, val_str
);
725 return nb_cli_apply_changes(vty
, NULL
);
728 DEFPY(no_lsp_refresh_interval
, no_lsp_refresh_interval_cmd
,
729 "no lsp-refresh-interval [level-1|level-2]$level [(1-65235)]",
731 "LSP refresh interval\n"
732 "LSP refresh interval for Level 1 only\n"
733 "LSP refresh interval for Level 2 only\n"
734 "LSP refresh interval in seconds\n")
736 if (!level
|| strmatch(level
, "level-1"))
737 nb_cli_enqueue_change(vty
, "./lsp/refresh-interval/level-1",
739 if (!level
|| strmatch(level
, "level-2"))
740 nb_cli_enqueue_change(vty
, "./lsp/refresh-interval/level-2",
743 return nb_cli_apply_changes(vty
, NULL
);
746 void cli_show_isis_lsp_ref_interval(struct vty
*vty
, struct lyd_node
*dnode
,
749 const char *l1
= yang_dnode_get_string(dnode
, "./level-1");
750 const char *l2
= yang_dnode_get_string(dnode
, "./level-2");
752 if (strmatch(l1
, l2
))
753 vty_out(vty
, " lsp-refresh-interval %s\n", l1
);
755 vty_out(vty
, " lsp-refresh-interval level-1 %s\n", l1
);
756 vty_out(vty
, " lsp-refresh-interval level-2 %s\n", l2
);
761 * XPath: /frr-isisd:isis/instance/lsp/maximum-lifetime
763 DEFPY(max_lsp_lifetime
, max_lsp_lifetime_cmd
,
764 "max-lsp-lifetime [level-1|level-2]$level (350-65535)$val",
765 "Maximum LSP lifetime\n"
766 "Maximum LSP lifetime for Level 1 only\n"
767 "Maximum LSP lifetime for Level 2 only\n"
768 "LSP lifetime in seconds\n")
770 if (!level
|| strmatch(level
, "level-1"))
771 nb_cli_enqueue_change(vty
, "./lsp/maximum-lifetime/level-1",
772 NB_OP_MODIFY
, val_str
);
773 if (!level
|| strmatch(level
, "level-2"))
774 nb_cli_enqueue_change(vty
, "./lsp/maximum-lifetime/level-2",
775 NB_OP_MODIFY
, val_str
);
777 return nb_cli_apply_changes(vty
, NULL
);
780 DEFPY(no_max_lsp_lifetime
, no_max_lsp_lifetime_cmd
,
781 "no max-lsp-lifetime [level-1|level-2]$level [(350-65535)]",
783 "Maximum LSP lifetime\n"
784 "Maximum LSP lifetime for Level 1 only\n"
785 "Maximum LSP lifetime for Level 2 only\n"
786 "LSP lifetime in seconds\n")
788 if (!level
|| strmatch(level
, "level-1"))
789 nb_cli_enqueue_change(vty
, "./lsp/maximum-lifetime/level-1",
791 if (!level
|| strmatch(level
, "level-2"))
792 nb_cli_enqueue_change(vty
, "./lsp/maximum-lifetime/level-2",
795 return nb_cli_apply_changes(vty
, NULL
);
798 void cli_show_isis_lsp_max_lifetime(struct vty
*vty
, struct lyd_node
*dnode
,
801 const char *l1
= yang_dnode_get_string(dnode
, "./level-1");
802 const char *l2
= yang_dnode_get_string(dnode
, "./level-2");
804 if (strmatch(l1
, l2
))
805 vty_out(vty
, " max-lsp-lifetime %s\n", l1
);
807 vty_out(vty
, " max-lsp-lifetime level-1 %s\n", l1
);
808 vty_out(vty
, " max-lsp-lifetime level-2 %s\n", l2
);
813 * XPath: /frr-isisd:isis/instance/lsp/mtu
815 DEFPY(area_lsp_mtu
, area_lsp_mtu_cmd
, "lsp-mtu (128-4352)$val",
816 "Configure the maximum size of generated LSPs\n"
817 "Maximum size of generated LSPs\n")
819 nb_cli_enqueue_change(vty
, "./lsp/mtu", NB_OP_MODIFY
, val_str
);
821 return nb_cli_apply_changes(vty
, NULL
);
824 DEFPY(no_area_lsp_mtu
, no_area_lsp_mtu_cmd
, "no lsp-mtu [(128-4352)]",
826 "Configure the maximum size of generated LSPs\n"
827 "Maximum size of generated LSPs\n")
829 nb_cli_enqueue_change(vty
, "./lsp/mtu", NB_OP_MODIFY
, NULL
);
831 return nb_cli_apply_changes(vty
, NULL
);
834 void cli_show_isis_lsp_mtu(struct vty
*vty
, struct lyd_node
*dnode
,
837 vty_out(vty
, " lsp-mtu %s\n", yang_dnode_get_string(dnode
, NULL
));
841 * XPath: /frr-isisd:isis/instance/spf/minimum-interval
843 DEFPY(spf_interval
, spf_interval_cmd
,
844 "spf-interval [level-1|level-2]$level (1-120)$val",
845 "Minimum interval between SPF calculations\n"
846 "Set interval for level 1 only\n"
847 "Set interval for level 2 only\n"
848 "Minimum interval between consecutive SPFs in seconds\n")
850 if (!level
|| strmatch(level
, "level-1"))
851 nb_cli_enqueue_change(vty
, "./spf/minimum-interval/level-1",
852 NB_OP_MODIFY
, val_str
);
853 if (!level
|| strmatch(level
, "level-2"))
854 nb_cli_enqueue_change(vty
, "./spf/minimum-interval/level-2",
855 NB_OP_MODIFY
, val_str
);
857 return nb_cli_apply_changes(vty
, NULL
);
860 DEFPY(no_spf_interval
, no_spf_interval_cmd
,
861 "no spf-interval [level-1|level-2]$level [(1-120)]",
863 "Minimum interval between SPF calculations\n"
864 "Set interval for level 1 only\n"
865 "Set interval for level 2 only\n"
866 "Minimum interval between consecutive SPFs in seconds\n")
868 if (!level
|| strmatch(level
, "level-1"))
869 nb_cli_enqueue_change(vty
, "./spf/minimum-interval/level-1",
871 if (!level
|| strmatch(level
, "level-2"))
872 nb_cli_enqueue_change(vty
, "./spf/minimum-interval/level-2",
875 return nb_cli_apply_changes(vty
, NULL
);
878 void cli_show_isis_spf_min_interval(struct vty
*vty
, struct lyd_node
*dnode
,
881 const char *l1
= yang_dnode_get_string(dnode
, "./level-1");
882 const char *l2
= yang_dnode_get_string(dnode
, "./level-2");
884 if (strmatch(l1
, l2
))
885 vty_out(vty
, " spf-interval %s\n", l1
);
887 vty_out(vty
, " spf-interval level-1 %s\n", l1
);
888 vty_out(vty
, " spf-interval level-2 %s\n", l2
);
893 * XPath: /frr-isisd:isis/instance/spf/ietf-backoff-delay
895 DEFPY(spf_delay_ietf
, spf_delay_ietf_cmd
,
896 "spf-delay-ietf init-delay (0-60000) short-delay (0-60000) long-delay (0-60000) holddown (0-60000) time-to-learn (0-60000)",
897 "IETF SPF delay algorithm\n"
898 "Delay used while in QUIET state\n"
899 "Delay used while in QUIET state in milliseconds\n"
900 "Delay used while in SHORT_WAIT state\n"
901 "Delay used while in SHORT_WAIT state in milliseconds\n"
902 "Delay used while in LONG_WAIT\n"
903 "Delay used while in LONG_WAIT state in milliseconds\n"
904 "Time with no received IGP events before considering IGP stable\n"
905 "Time with no received IGP events before considering IGP stable (in milliseconds)\n"
906 "Maximum duration needed to learn all the events related to a single failure\n"
907 "Maximum duration needed to learn all the events related to a single failure (in milliseconds)\n")
909 nb_cli_enqueue_change(vty
, "./spf/ietf-backoff-delay", NB_OP_CREATE
,
911 nb_cli_enqueue_change(vty
, "./spf/ietf-backoff-delay/init-delay",
912 NB_OP_MODIFY
, init_delay_str
);
913 nb_cli_enqueue_change(vty
, "./spf/ietf-backoff-delay/short-delay",
914 NB_OP_MODIFY
, short_delay_str
);
915 nb_cli_enqueue_change(vty
, "./spf/ietf-backoff-delay/long-delay",
916 NB_OP_MODIFY
, long_delay_str
);
917 nb_cli_enqueue_change(vty
, "./spf/ietf-backoff-delay/hold-down",
918 NB_OP_MODIFY
, holddown_str
);
919 nb_cli_enqueue_change(vty
, "./spf/ietf-backoff-delay/time-to-learn",
920 NB_OP_MODIFY
, time_to_learn_str
);
922 return nb_cli_apply_changes(vty
, NULL
);
925 DEFPY(no_spf_delay_ietf
, no_spf_delay_ietf_cmd
,
926 "no spf-delay-ietf [init-delay (0-60000) short-delay (0-60000) long-delay (0-60000) holddown (0-60000) time-to-learn (0-60000)]",
928 "IETF SPF delay algorithm\n"
929 "Delay used while in QUIET state\n"
930 "Delay used while in QUIET state in milliseconds\n"
931 "Delay used while in SHORT_WAIT state\n"
932 "Delay used while in SHORT_WAIT state in milliseconds\n"
933 "Delay used while in LONG_WAIT\n"
934 "Delay used while in LONG_WAIT state in milliseconds\n"
935 "Time with no received IGP events before considering IGP stable\n"
936 "Time with no received IGP events before considering IGP stable (in milliseconds)\n"
937 "Maximum duration needed to learn all the events related to a single failure\n"
938 "Maximum duration needed to learn all the events related to a single failure (in milliseconds)\n")
940 nb_cli_enqueue_change(vty
, "./spf/ietf-backoff-delay", NB_OP_DESTROY
,
943 return nb_cli_apply_changes(vty
, NULL
);
946 void cli_show_isis_spf_ietf_backoff(struct vty
*vty
, struct lyd_node
*dnode
,
950 " spf-delay-ietf init-delay %s short-delay %s long-delay %s holddown %s time-to-learn %s\n",
951 yang_dnode_get_string(dnode
, "./init-delay"),
952 yang_dnode_get_string(dnode
, "./short-delay"),
953 yang_dnode_get_string(dnode
, "./long-delay"),
954 yang_dnode_get_string(dnode
, "./hold-down"),
955 yang_dnode_get_string(dnode
, "./time-to-learn"));
959 * XPath: /frr-isisd:isis/instance/purge-originator
961 DEFPY(area_purge_originator
, area_purge_originator_cmd
, "[no] purge-originator",
962 NO_STR
"Use the RFC 6232 purge-originator\n")
964 nb_cli_enqueue_change(vty
, "./purge-originator", NB_OP_MODIFY
,
965 no
? "false" : "true");
967 return nb_cli_apply_changes(vty
, NULL
);
970 void cli_show_isis_purge_origin(struct vty
*vty
, struct lyd_node
*dnode
,
973 if (!yang_dnode_get_bool(dnode
, NULL
))
975 vty_out(vty
, " purge-originator\n");
979 * XPath: /frr-isisd:isis/instance/mpls-te
981 DEFPY(isis_mpls_te_on
, isis_mpls_te_on_cmd
, "mpls-te on",
982 MPLS_TE_STR
"Enable the MPLS-TE functionality\n")
984 nb_cli_enqueue_change(vty
, "./mpls-te", NB_OP_CREATE
,
987 return nb_cli_apply_changes(vty
, NULL
);
990 DEFPY(no_isis_mpls_te_on
, no_isis_mpls_te_on_cmd
, "no mpls-te [on]",
992 "Disable the MPLS-TE functionality\n"
993 "Disable the MPLS-TE functionality\n")
995 nb_cli_enqueue_change(vty
, "./mpls-te", NB_OP_DESTROY
,
998 return nb_cli_apply_changes(vty
, NULL
);
1001 void cli_show_isis_mpls_te(struct vty
*vty
, struct lyd_node
*dnode
,
1004 vty_out(vty
, " mpls-te on\n");
1008 * XPath: /frr-isisd:isis/instance/mpls-te/router-address
1010 DEFPY(isis_mpls_te_router_addr
, isis_mpls_te_router_addr_cmd
,
1011 "mpls-te router-address A.B.C.D",
1013 "Stable IP address of the advertising router\n"
1014 "MPLS-TE router address in IPv4 address format\n")
1016 nb_cli_enqueue_change(vty
, "./mpls-te/router-address",
1017 NB_OP_MODIFY
, router_address_str
);
1019 return nb_cli_apply_changes(vty
, NULL
);
1022 DEFPY(no_isis_mpls_te_router_addr
, no_isis_mpls_te_router_addr_cmd
,
1023 "no mpls-te router-address [A.B.C.D]",
1025 "Delete IP address of the advertising router\n"
1026 "MPLS-TE router address in IPv4 address format\n")
1028 nb_cli_enqueue_change(vty
, "./mpls-te/router-address",
1029 NB_OP_DESTROY
, NULL
);
1031 return nb_cli_apply_changes(vty
, NULL
);
1034 void cli_show_isis_mpls_te_router_addr(struct vty
*vty
, struct lyd_node
*dnode
,
1037 vty_out(vty
, " mpls-te router-address %s\n",
1038 yang_dnode_get_string(dnode
, NULL
));
1041 DEFPY(isis_mpls_te_inter_as
, isis_mpls_te_inter_as_cmd
,
1042 "[no] mpls-te inter-as [level-1|level-1-2|level-2-only]",
1044 "Configure MPLS-TE Inter-AS support\n"
1045 "AREA native mode self originate INTER-AS LSP with L1 only flooding scope\n"
1046 "AREA native mode self originate INTER-AS LSP with L1 and L2 flooding scope\n"
1047 "AS native mode self originate INTER-AS LSP with L2 only flooding scope\n")
1049 vty_out(vty
, "MPLS-TE Inter-AS is not yet supported\n");
1054 * XPath: /frr-isisd:isis/instance/default-information-originate
1056 DEFPY(isis_default_originate
, isis_default_originate_cmd
,
1057 "[no] default-information originate <ipv4|ipv6>$ip"
1058 " <level-1|level-2>$level [always]$always"
1059 " [{metric (0-16777215)$metric|route-map WORD$rmap}]",
1061 "Control distribution of default information\n"
1062 "Distribute a default route\n"
1063 "Distribute default route for IPv4\n"
1064 "Distribute default route for IPv6\n"
1065 "Distribute default route into level-1\n"
1066 "Distribute default route into level-2\n"
1067 "Always advertise default route\n"
1068 "Metric for default route\n"
1069 "ISIS default metric\n"
1070 "Route map reference\n"
1071 "Pointer to route-map entries\n")
1074 nb_cli_enqueue_change(vty
, ".", NB_OP_DESTROY
, NULL
);
1076 nb_cli_enqueue_change(vty
, ".", NB_OP_CREATE
, NULL
);
1077 nb_cli_enqueue_change(vty
, "./always", NB_OP_MODIFY
,
1078 always
? "true" : "false");
1079 nb_cli_enqueue_change(vty
, "./route-map",
1080 rmap
? NB_OP_MODIFY
: NB_OP_DESTROY
,
1081 rmap
? rmap
: NULL
);
1082 nb_cli_enqueue_change(vty
, "./metric", NB_OP_MODIFY
,
1083 metric_str
? metric_str
: NULL
);
1084 if (strmatch(ip
, "ipv6") && !always
) {
1086 "Zebra doesn't implement default-originate for IPv6 yet\n");
1088 "so use with care or use default-originate always.\n");
1092 return nb_cli_apply_changes(
1093 vty
, "./default-information-originate/%s[level='%s']", ip
,
1097 static void vty_print_def_origin(struct vty
*vty
, struct lyd_node
*dnode
,
1098 const char *family
, const char *level
,
1101 vty_out(vty
, " default-information originate %s %s", family
, level
);
1102 if (yang_dnode_get_bool(dnode
, "./always"))
1103 vty_out(vty
, " always");
1105 if (yang_dnode_exists(dnode
, "./route-map"))
1106 vty_out(vty
, " route-map %s",
1107 yang_dnode_get_string(dnode
, "./route-map"));
1108 if (show_defaults
|| !yang_dnode_is_default(dnode
, "./metric"))
1109 vty_out(vty
, " metric %s",
1110 yang_dnode_get_string(dnode
, "./metric"));
1115 void cli_show_isis_def_origin_ipv4(struct vty
*vty
, struct lyd_node
*dnode
,
1118 const char *level
= yang_dnode_get_string(dnode
, "./level");
1120 vty_print_def_origin(vty
, dnode
, "ipv4", level
, show_defaults
);
1123 void cli_show_isis_def_origin_ipv6(struct vty
*vty
, struct lyd_node
*dnode
,
1126 const char *level
= yang_dnode_get_string(dnode
, "./level");
1128 vty_print_def_origin(vty
, dnode
, "ipv6", level
, show_defaults
);
1132 * XPath: /frr-isisd:isis/instance/redistribute
1134 DEFPY(isis_redistribute
, isis_redistribute_cmd
,
1135 "[no] redistribute <ipv4|ipv6>$ip " PROTO_REDIST_STR
1137 " <level-1|level-2>$level"
1138 " [{metric (0-16777215)|route-map WORD}]",
1140 "Redistribute IPv4 routes\n"
1141 "Redistribute IPv6 routes\n" PROTO_REDIST_HELP
1142 "Redistribute into level-1\n"
1143 "Redistribute into level-2\n"
1144 "Metric for redistributed routes\n"
1145 "ISIS default metric\n"
1146 "Route map reference\n"
1147 "Pointer to route-map entries\n")
1150 nb_cli_enqueue_change(vty
, ".", NB_OP_DESTROY
, NULL
);
1152 nb_cli_enqueue_change(vty
, ".", NB_OP_CREATE
, NULL
);
1153 nb_cli_enqueue_change(vty
, "./route-map",
1154 route_map
? NB_OP_MODIFY
: NB_OP_DESTROY
,
1155 route_map
? route_map
: NULL
);
1156 nb_cli_enqueue_change(vty
, "./metric", NB_OP_MODIFY
,
1157 metric_str
? metric_str
: NULL
);
1160 return nb_cli_apply_changes(
1161 vty
, "./redistribute/%s[protocol='%s'][level='%s']", ip
, proto
,
1165 static void vty_print_redistribute(struct vty
*vty
, struct lyd_node
*dnode
,
1166 bool show_defaults
, const char *family
)
1168 const char *level
= yang_dnode_get_string(dnode
, "./level");
1169 const char *protocol
= yang_dnode_get_string(dnode
, "./protocol");
1171 vty_out(vty
, " redistribute %s %s %s", family
, protocol
, level
);
1172 if (show_defaults
|| !yang_dnode_is_default(dnode
, "./metric"))
1173 vty_out(vty
, " metric %s",
1174 yang_dnode_get_string(dnode
, "./metric"));
1175 if (yang_dnode_exists(dnode
, "./route-map"))
1176 vty_out(vty
, " route-map %s",
1177 yang_dnode_get_string(dnode
, "./route-map"));
1181 void cli_show_isis_redistribute_ipv4(struct vty
*vty
, struct lyd_node
*dnode
,
1184 vty_print_redistribute(vty
, dnode
, show_defaults
, "ipv4");
1186 void cli_show_isis_redistribute_ipv6(struct vty
*vty
, struct lyd_node
*dnode
,
1189 vty_print_redistribute(vty
, dnode
, show_defaults
, "ipv6");
1193 * XPath: /frr-isisd:isis/instance/multi-topology
1195 DEFPY(isis_topology
, isis_topology_cmd
,
1203 "|ipv6-dstsrc>$topology "
1204 "[overload]$overload",
1206 "Configure IS-IS topologies\n"
1207 "IPv4 unicast topology\n"
1208 "IPv4 management topology\n"
1209 "IPv6 unicast topology\n"
1210 "IPv4 multicast topology\n"
1211 "IPv6 multicast topology\n"
1212 "IPv6 management topology\n"
1213 "IPv6 dst-src topology\n"
1214 "Set overload bit for topology\n")
1216 char base_xpath
[XPATH_MAXLEN
];
1218 /* Since IPv4-unicast is not configurable it is not present in the
1219 * YANG model, so we need to validate it here
1221 if (strmatch(topology
, "ipv4-unicast")) {
1222 vty_out(vty
, "Cannot configure IPv4 unicast topology\n");
1223 return CMD_WARNING_CONFIG_FAILED
;
1226 if (strmatch(topology
, "ipv4-mgmt"))
1227 snprintf(base_xpath
, XPATH_MAXLEN
,
1228 "./multi-topology/ipv4-management");
1229 else if (strmatch(topology
, "ipv6-mgmt"))
1230 snprintf(base_xpath
, XPATH_MAXLEN
,
1231 "./multi-topology/ipv6-management");
1233 snprintf(base_xpath
, XPATH_MAXLEN
, "./multi-topology/%s",
1237 nb_cli_enqueue_change(vty
, ".", NB_OP_DESTROY
, NULL
);
1239 nb_cli_enqueue_change(vty
, ".", NB_OP_CREATE
, NULL
);
1240 nb_cli_enqueue_change(vty
, "./overload", NB_OP_MODIFY
,
1241 overload
? "true" : "false");
1244 return nb_cli_apply_changes(vty
, base_xpath
);
1247 void cli_show_isis_mt_ipv4_multicast(struct vty
*vty
, struct lyd_node
*dnode
,
1250 vty_out(vty
, " topology ipv4-multicast");
1251 if (yang_dnode_get_bool(dnode
, "./overload"))
1252 vty_out(vty
, " overload");
1256 void cli_show_isis_mt_ipv4_mgmt(struct vty
*vty
, struct lyd_node
*dnode
,
1259 vty_out(vty
, " topology ipv4-mgmt");
1260 if (yang_dnode_get_bool(dnode
, "./overload"))
1261 vty_out(vty
, " overload");
1265 void cli_show_isis_mt_ipv6_unicast(struct vty
*vty
, struct lyd_node
*dnode
,
1268 vty_out(vty
, " topology ipv6-unicast");
1269 if (yang_dnode_get_bool(dnode
, "./overload"))
1270 vty_out(vty
, " overload");
1274 void cli_show_isis_mt_ipv6_multicast(struct vty
*vty
, struct lyd_node
*dnode
,
1277 vty_out(vty
, " topology ipv6-multicast");
1278 if (yang_dnode_get_bool(dnode
, "./overload"))
1279 vty_out(vty
, " overload");
1283 void cli_show_isis_mt_ipv6_mgmt(struct vty
*vty
, struct lyd_node
*dnode
,
1286 vty_out(vty
, " topology ipv6-mgmt");
1287 if (yang_dnode_get_bool(dnode
, "./overload"))
1288 vty_out(vty
, " overload");
1292 void cli_show_isis_mt_ipv6_dstsrc(struct vty
*vty
, struct lyd_node
*dnode
,
1295 vty_out(vty
, " topology ipv6-dstsrc");
1296 if (yang_dnode_get_bool(dnode
, "./overload"))
1297 vty_out(vty
, " overload");
1302 * XPath: /frr-interface:lib/interface/frr-isisd:isis/passive
1304 DEFPY(isis_passive
, isis_passive_cmd
, "[no] isis passive",
1306 "IS-IS routing protocol\n"
1307 "Configure the passive mode for interface\n")
1309 nb_cli_enqueue_change(vty
, "./frr-isisd:isis/passive", NB_OP_MODIFY
,
1310 no
? "false" : "true");
1312 return nb_cli_apply_changes(vty
, NULL
);
1315 void cli_show_ip_isis_passive(struct vty
*vty
, struct lyd_node
*dnode
,
1318 if (!yang_dnode_get_bool(dnode
, NULL
))
1319 vty_out(vty
, " no");
1320 vty_out(vty
, " isis passive\n");
1324 * XPath: /frr-interface:lib/interface/frr-isisd:isis/password
1327 DEFPY(isis_passwd
, isis_passwd_cmd
, "isis password <md5|clear>$type WORD$pwd",
1328 "IS-IS routing protocol\n"
1329 "Configure the authentication password for a circuit\n"
1330 "HMAC-MD5 authentication\n"
1331 "Cleartext password\n"
1332 "Circuit password\n")
1334 nb_cli_enqueue_change(vty
, "./frr-isisd:isis/password", NB_OP_CREATE
,
1336 nb_cli_enqueue_change(vty
, "./frr-isisd:isis/password/password",
1338 nb_cli_enqueue_change(vty
, "./frr-isisd:isis/password/password-type",
1339 NB_OP_MODIFY
, type
);
1341 return nb_cli_apply_changes(vty
, NULL
);
1344 DEFPY(no_isis_passwd
, no_isis_passwd_cmd
, "no isis password [<md5|clear> WORD]",
1346 "IS-IS routing protocol\n"
1347 "Configure the authentication password for a circuit\n"
1348 "HMAC-MD5 authentication\n"
1349 "Cleartext password\n"
1350 "Circuit password\n")
1352 nb_cli_enqueue_change(vty
, "./frr-isisd:isis/password", NB_OP_DESTROY
,
1355 return nb_cli_apply_changes(vty
, NULL
);
1358 void cli_show_ip_isis_password(struct vty
*vty
, struct lyd_node
*dnode
,
1361 vty_out(vty
, " isis password %s %s\n",
1362 yang_dnode_get_string(dnode
, "./password-type"),
1363 yang_dnode_get_string(dnode
, "./password"));
1367 * XPath: /frr-interface:lib/interface/frr-isisd:isis/metric
1369 DEFPY(isis_metric
, isis_metric_cmd
,
1370 "isis metric [level-1|level-2]$level (0-16777215)$met",
1371 "IS-IS routing protocol\n"
1372 "Set default metric for circuit\n"
1373 "Specify metric for level-1 routing\n"
1374 "Specify metric for level-2 routing\n"
1375 "Default metric value\n")
1377 if (!level
|| strmatch(level
, "level-1"))
1378 nb_cli_enqueue_change(vty
, "./frr-isisd:isis/metric/level-1",
1379 NB_OP_MODIFY
, met_str
);
1380 if (!level
|| strmatch(level
, "level-2"))
1381 nb_cli_enqueue_change(vty
, "./frr-isisd:isis/metric/level-2",
1382 NB_OP_MODIFY
, met_str
);
1384 return nb_cli_apply_changes(vty
, NULL
);
1387 DEFPY(no_isis_metric
, no_isis_metric_cmd
,
1388 "no isis metric [level-1|level-2]$level [(0-16777215)]",
1390 "IS-IS routing protocol\n"
1391 "Set default metric for circuit\n"
1392 "Specify metric for level-1 routing\n"
1393 "Specify metric for level-2 routing\n"
1394 "Default metric value\n")
1396 if (!level
|| strmatch(level
, "level-1"))
1397 nb_cli_enqueue_change(vty
, "./frr-isisd:isis/metric/level-1",
1398 NB_OP_MODIFY
, NULL
);
1399 if (!level
|| strmatch(level
, "level-2"))
1400 nb_cli_enqueue_change(vty
, "./frr-isisd:isis/metric/level-2",
1401 NB_OP_MODIFY
, NULL
);
1403 return nb_cli_apply_changes(vty
, NULL
);
1406 void cli_show_ip_isis_metric(struct vty
*vty
, struct lyd_node
*dnode
,
1409 const char *l1
= yang_dnode_get_string(dnode
, "./level-1");
1410 const char *l2
= yang_dnode_get_string(dnode
, "./level-2");
1412 if (strmatch(l1
, l2
))
1413 vty_out(vty
, " isis metric %s\n", l1
);
1415 vty_out(vty
, " isis metric %s level-1\n", l1
);
1416 vty_out(vty
, " isis metric %s level-2\n", l2
);
1421 * XPath: /frr-interface:lib/interface/frr-isisd:isis/hello/interval
1423 DEFPY(isis_hello_interval
, isis_hello_interval_cmd
,
1424 "isis hello-interval [level-1|level-2]$level (1-600)$intv",
1425 "IS-IS routing protocol\n"
1426 "Set Hello interval\n"
1427 "Specify hello-interval for level-1 IIHs\n"
1428 "Specify hello-interval for level-2 IIHs\n"
1429 "Holdtime 1 seconds, interval depends on multiplier\n")
1431 if (!level
|| strmatch(level
, "level-1"))
1432 nb_cli_enqueue_change(vty
,
1433 "./frr-isisd:isis/hello/interval/level-1",
1434 NB_OP_MODIFY
, intv_str
);
1435 if (!level
|| strmatch(level
, "level-2"))
1436 nb_cli_enqueue_change(vty
,
1437 "./frr-isisd:isis/hello/interval/level-2",
1438 NB_OP_MODIFY
, intv_str
);
1440 return nb_cli_apply_changes(vty
, NULL
);
1443 DEFPY(no_isis_hello_interval
, no_isis_hello_interval_cmd
,
1444 "no isis hello-interval [level-1|level-2]$level [(1-600)]",
1446 "IS-IS routing protocol\n"
1447 "Set Hello interval\n"
1448 "Specify hello-interval for level-1 IIHs\n"
1449 "Specify hello-interval for level-2 IIHs\n"
1450 "Holdtime 1 second, interval depends on multiplier\n")
1452 if (!level
|| strmatch(level
, "level-1"))
1453 nb_cli_enqueue_change(vty
,
1454 "./frr-isisd:isis/hello/interval/level-1",
1455 NB_OP_MODIFY
, NULL
);
1456 if (!level
|| strmatch(level
, "level-2"))
1457 nb_cli_enqueue_change(vty
,
1458 "./frr-isisd:isis/hello/interval/level-2",
1459 NB_OP_MODIFY
, NULL
);
1461 return nb_cli_apply_changes(vty
, NULL
);
1464 void cli_show_ip_isis_hello_interval(struct vty
*vty
, struct lyd_node
*dnode
,
1467 const char *l1
= yang_dnode_get_string(dnode
, "./level-1");
1468 const char *l2
= yang_dnode_get_string(dnode
, "./level-2");
1470 if (strmatch(l1
, l2
))
1471 vty_out(vty
, " isis hello-interval %s\n", l1
);
1473 vty_out(vty
, " isis hello-interval %s level-1\n", l1
);
1474 vty_out(vty
, " isis hello-interval %s level-2\n", l2
);
1479 * XPath: /frr-interface:lib/interface/frr-isisd:isis/hello/multiplier
1481 DEFPY(isis_hello_multiplier
, isis_hello_multiplier_cmd
,
1482 "isis hello-multiplier [level-1|level-2]$level (2-100)$mult",
1483 "IS-IS routing protocol\n"
1484 "Set multiplier for Hello holding time\n"
1485 "Specify hello multiplier for level-1 IIHs\n"
1486 "Specify hello multiplier for level-2 IIHs\n"
1487 "Hello multiplier value\n")
1489 if (!level
|| strmatch(level
, "level-1"))
1490 nb_cli_enqueue_change(
1491 vty
, "./frr-isisd:isis/hello/multiplier/level-1",
1492 NB_OP_MODIFY
, mult_str
);
1493 if (!level
|| strmatch(level
, "level-2"))
1494 nb_cli_enqueue_change(
1495 vty
, "./frr-isisd:isis/hello/multiplier/level-2",
1496 NB_OP_MODIFY
, mult_str
);
1498 return nb_cli_apply_changes(vty
, NULL
);
1501 DEFPY(no_isis_hello_multiplier
, no_isis_hello_multiplier_cmd
,
1502 "no isis hello-multiplier [level-1|level-2]$level [(2-100)]",
1504 "IS-IS routing protocol\n"
1505 "Set multiplier for Hello holding time\n"
1506 "Specify hello multiplier for level-1 IIHs\n"
1507 "Specify hello multiplier for level-2 IIHs\n"
1508 "Hello multiplier value\n")
1510 if (!level
|| strmatch(level
, "level-1"))
1511 nb_cli_enqueue_change(
1512 vty
, "./frr-isisd:isis/hello/multiplier/level-1",
1513 NB_OP_MODIFY
, NULL
);
1514 if (!level
|| strmatch(level
, "level-2"))
1515 nb_cli_enqueue_change(
1516 vty
, "./frr-isisd:isis/hello/multiplier/level-2",
1517 NB_OP_MODIFY
, NULL
);
1519 return nb_cli_apply_changes(vty
, NULL
);
1522 void cli_show_ip_isis_hello_multi(struct vty
*vty
, struct lyd_node
*dnode
,
1525 const char *l1
= yang_dnode_get_string(dnode
, "./level-1");
1526 const char *l2
= yang_dnode_get_string(dnode
, "./level-2");
1528 if (strmatch(l1
, l2
))
1529 vty_out(vty
, " isis hello-multiplier %s\n", l1
);
1531 vty_out(vty
, " isis hello-multiplier %s level-1\n", l1
);
1532 vty_out(vty
, " isis hello-multiplier %s level-2\n", l2
);
1538 * /frr-interface:lib/interface/frr-isisd:isis/disable-three-way-handshake
1540 DEFPY(isis_threeway_adj
, isis_threeway_adj_cmd
, "[no] isis three-way-handshake",
1543 "Enable/Disable three-way handshake\n")
1545 nb_cli_enqueue_change(vty
,
1546 "./frr-isisd:isis/disable-three-way-handshake",
1547 NB_OP_MODIFY
, no
? "true" : "false");
1549 return nb_cli_apply_changes(vty
, NULL
);
1552 void cli_show_ip_isis_threeway_shake(struct vty
*vty
, struct lyd_node
*dnode
,
1555 if (yang_dnode_get_bool(dnode
, NULL
))
1556 vty_out(vty
, " no");
1557 vty_out(vty
, " isis three-way-handshake\n");
1561 * XPath: /frr-interface:lib/interface/frr-isisd:isis/hello/padding
1563 DEFPY(isis_hello_padding
, isis_hello_padding_cmd
, "[no] isis hello padding",
1565 "IS-IS routing protocol\n"
1566 "Add padding to IS-IS hello packets\n"
1567 "Pad hello packets\n")
1569 nb_cli_enqueue_change(vty
, "./frr-isisd:isis/hello/padding",
1570 NB_OP_MODIFY
, no
? "false" : "true");
1572 return nb_cli_apply_changes(vty
, NULL
);
1575 void cli_show_ip_isis_hello_padding(struct vty
*vty
, struct lyd_node
*dnode
,
1578 if (!yang_dnode_get_bool(dnode
, NULL
))
1579 vty_out(vty
, " no");
1581 vty_out(vty
, " isis hello padding\n");
1585 * XPath: /frr-interface:lib/interface/frr-isisd:isis/csnp-interval
1587 DEFPY(csnp_interval
, csnp_interval_cmd
,
1588 "isis csnp-interval (1-600)$intv [level-1|level-2]$level",
1589 "IS-IS routing protocol\n"
1590 "Set CSNP interval in seconds\n"
1591 "CSNP interval value\n"
1592 "Specify interval for level-1 CSNPs\n"
1593 "Specify interval for level-2 CSNPs\n")
1595 if (!level
|| strmatch(level
, "level-1"))
1596 nb_cli_enqueue_change(vty
,
1597 "./frr-isisd:isis/csnp-interval/level-1",
1598 NB_OP_MODIFY
, intv_str
);
1599 if (!level
|| strmatch(level
, "level-2"))
1600 nb_cli_enqueue_change(vty
,
1601 "./frr-isisd:isis/csnp-interval/level-2",
1602 NB_OP_MODIFY
, intv_str
);
1604 return nb_cli_apply_changes(vty
, NULL
);
1607 DEFPY(no_csnp_interval
, no_csnp_interval_cmd
,
1608 "no isis csnp-interval [(1-600)] [level-1|level-2]$level",
1610 "IS-IS routing protocol\n"
1611 "Set CSNP interval in seconds\n"
1612 "CSNP interval value\n"
1613 "Specify interval for level-1 CSNPs\n"
1614 "Specify interval for level-2 CSNPs\n")
1616 if (!level
|| strmatch(level
, "level-1"))
1617 nb_cli_enqueue_change(vty
,
1618 "./frr-isisd:isis/csnp-interval/level-1",
1619 NB_OP_MODIFY
, NULL
);
1620 if (!level
|| strmatch(level
, "level-2"))
1621 nb_cli_enqueue_change(vty
,
1622 "./frr-isisd:isis/csnp-interval/level-2",
1623 NB_OP_MODIFY
, NULL
);
1625 return nb_cli_apply_changes(vty
, NULL
);
1628 void cli_show_ip_isis_csnp_interval(struct vty
*vty
, struct lyd_node
*dnode
,
1631 const char *l1
= yang_dnode_get_string(dnode
, "./level-1");
1632 const char *l2
= yang_dnode_get_string(dnode
, "./level-2");
1634 if (strmatch(l1
, l2
))
1635 vty_out(vty
, " isis csnp-interval %s\n", l1
);
1637 vty_out(vty
, " isis csnp-interval %s level-1\n", l1
);
1638 vty_out(vty
, " isis csnp-interval %s level-2\n", l2
);
1643 * XPath: /frr-interface:lib/interface/frr-isisd:isis/psnp-interval
1645 DEFPY(psnp_interval
, psnp_interval_cmd
,
1646 "isis psnp-interval (1-120)$intv [level-1|level-2]$level",
1647 "IS-IS routing protocol\n"
1648 "Set PSNP interval in seconds\n"
1649 "PSNP interval value\n"
1650 "Specify interval for level-1 PSNPs\n"
1651 "Specify interval for level-2 PSNPs\n")
1653 if (!level
|| strmatch(level
, "level-1"))
1654 nb_cli_enqueue_change(vty
,
1655 "./frr-isisd:isis/psnp-interval/level-1",
1656 NB_OP_MODIFY
, intv_str
);
1657 if (!level
|| strmatch(level
, "level-2"))
1658 nb_cli_enqueue_change(vty
,
1659 "./frr-isisd:isis/psnp-interval/level-2",
1660 NB_OP_MODIFY
, intv_str
);
1662 return nb_cli_apply_changes(vty
, NULL
);
1665 DEFPY(no_psnp_interval
, no_psnp_interval_cmd
,
1666 "no isis psnp-interval [(1-120)] [level-1|level-2]$level",
1668 "IS-IS routing protocol\n"
1669 "Set PSNP interval in seconds\n"
1670 "PSNP interval value\n"
1671 "Specify interval for level-1 PSNPs\n"
1672 "Specify interval for level-2 PSNPs\n")
1674 if (!level
|| strmatch(level
, "level-1"))
1675 nb_cli_enqueue_change(vty
,
1676 "./frr-isisd:isis/psnp-interval/level-1",
1677 NB_OP_MODIFY
, NULL
);
1678 if (!level
|| strmatch(level
, "level-2"))
1679 nb_cli_enqueue_change(vty
,
1680 "./frr-isisd:isis/psnp-interval/level-2",
1681 NB_OP_MODIFY
, NULL
);
1683 return nb_cli_apply_changes(vty
, NULL
);
1686 void cli_show_ip_isis_psnp_interval(struct vty
*vty
, struct lyd_node
*dnode
,
1689 const char *l1
= yang_dnode_get_string(dnode
, "./level-1");
1690 const char *l2
= yang_dnode_get_string(dnode
, "./level-2");
1692 if (strmatch(l1
, l2
))
1693 vty_out(vty
, " isis psnp-interval %s\n", l1
);
1695 vty_out(vty
, " isis psnp-interval %s level-1\n", l1
);
1696 vty_out(vty
, " isis psnp-interval %s level-2\n", l2
);
1701 * XPath: /frr-interface:lib/interface/frr-isisd:isis/multi-topology
1703 DEFPY(circuit_topology
, circuit_topology_cmd
,
1704 "[no] isis topology"
1714 "IS-IS routing protocol\n"
1715 "Configure interface IS-IS topologies\n"
1716 "IPv4 unicast topology\n"
1717 "IPv4 management topology\n"
1718 "IPv6 unicast topology\n"
1719 "IPv4 multicast topology\n"
1720 "IPv6 multicast topology\n"
1721 "IPv6 management topology\n"
1722 "IPv6 dst-src topology\n")
1724 nb_cli_enqueue_change(vty
, ".", NB_OP_MODIFY
, no
? "false" : "true");
1726 if (strmatch(topology
, "ipv4-mgmt"))
1727 return nb_cli_apply_changes(
1728 vty
, "./frr-isisd:isis/multi-topology/ipv4-management");
1729 else if (strmatch(topology
, "ipv6-mgmt"))
1730 return nb_cli_apply_changes(
1731 vty
, "./frr-isisd:isis/multi-topology/ipv6-management");
1733 return nb_cli_apply_changes(
1734 vty
, "./frr-isisd:isis/multi-topology/%s", topology
);
1737 void cli_show_ip_isis_mt_ipv4_unicast(struct vty
*vty
, struct lyd_node
*dnode
,
1740 if (!yang_dnode_get_bool(dnode
, NULL
))
1741 vty_out(vty
, " no");
1742 vty_out(vty
, " isis topology ipv4-unicast\n");
1745 void cli_show_ip_isis_mt_ipv4_multicast(struct vty
*vty
, struct lyd_node
*dnode
,
1748 if (!yang_dnode_get_bool(dnode
, NULL
))
1749 vty_out(vty
, " no");
1750 vty_out(vty
, " isis topology ipv4-multicast\n");
1753 void cli_show_ip_isis_mt_ipv4_mgmt(struct vty
*vty
, struct lyd_node
*dnode
,
1756 if (!yang_dnode_get_bool(dnode
, NULL
))
1757 vty_out(vty
, " no");
1758 vty_out(vty
, " isis topology ipv4-mgmt\n");
1761 void cli_show_ip_isis_mt_ipv6_unicast(struct vty
*vty
, struct lyd_node
*dnode
,
1764 if (!yang_dnode_get_bool(dnode
, NULL
))
1765 vty_out(vty
, " no");
1766 vty_out(vty
, " isis topology ipv6-unicast\n");
1769 void cli_show_ip_isis_mt_ipv6_multicast(struct vty
*vty
, struct lyd_node
*dnode
,
1772 if (!yang_dnode_get_bool(dnode
, NULL
))
1773 vty_out(vty
, " no");
1774 vty_out(vty
, " isis topology ipv6-multicast\n");
1777 void cli_show_ip_isis_mt_ipv6_mgmt(struct vty
*vty
, struct lyd_node
*dnode
,
1780 if (!yang_dnode_get_bool(dnode
, NULL
))
1781 vty_out(vty
, " no");
1782 vty_out(vty
, " isis topology ipv6-mgmt\n");
1785 void cli_show_ip_isis_mt_ipv6_dstsrc(struct vty
*vty
, struct lyd_node
*dnode
,
1788 if (!yang_dnode_get_bool(dnode
, NULL
))
1789 vty_out(vty
, " no");
1790 vty_out(vty
, " isis topology ipv6-dstsrc\n");
1794 * XPath: /frr-interface:lib/interface/frr-isisd:isis/circuit-type
1796 DEFPY(isis_circuit_type
, isis_circuit_type_cmd
,
1797 "isis circuit-type <level-1|level-1-2|level-2-only>$type",
1798 "IS-IS routing protocol\n"
1799 "Configure circuit type for interface\n"
1800 "Level-1 only adjacencies are formed\n"
1801 "Level-1-2 adjacencies are formed\n"
1802 "Level-2 only adjacencies are formed\n")
1804 nb_cli_enqueue_change(
1805 vty
, "./frr-isisd:isis/circuit-type", NB_OP_MODIFY
,
1806 strmatch(type
, "level-2-only") ? "level-2" : type
);
1808 return nb_cli_apply_changes(vty
, NULL
);
1811 DEFPY(no_isis_circuit_type
, no_isis_circuit_type_cmd
,
1812 "no isis circuit-type [level-1|level-1-2|level-2-only]",
1814 "IS-IS routing protocol\n"
1815 "Configure circuit type for interface\n"
1816 "Level-1 only adjacencies are formed\n"
1817 "Level-1-2 adjacencies are formed\n"
1818 "Level-2 only adjacencies are formed\n")
1820 const char *circ_type
= NULL
;
1823 * Default value depends on whether the circuit is part of an area,
1824 * and the is-type of the area if there is one. So we need to do this
1827 pthread_rwlock_rdlock(&running_config
->lock
);
1829 struct interface
*ifp
;
1830 struct isis_circuit
*circuit
;
1832 ifp
= nb_running_get_entry(NULL
, VTY_CURR_XPATH
, false);
1836 circuit
= circuit_scan_by_ifp(ifp
);
1837 if (!circuit
|| circuit
->state
!= C_STATE_UP
)
1840 switch (circuit
->area
->is_type
) {
1842 circ_type
= "level-1";
1845 circ_type
= "level-2";
1847 case IS_LEVEL_1_AND_2
:
1848 circ_type
= "level-1-2";
1853 pthread_rwlock_unlock(&running_config
->lock
);
1855 nb_cli_enqueue_change(vty
, "./frr-isisd:isis/circuit-type",
1856 NB_OP_MODIFY
, circ_type
);
1858 return nb_cli_apply_changes(vty
, NULL
);
1861 void cli_show_ip_isis_circ_type(struct vty
*vty
, struct lyd_node
*dnode
,
1864 int level
= yang_dnode_get_enum(dnode
, NULL
);
1868 vty_out(vty
, " isis circuit-type level-1\n");
1871 vty_out(vty
, " isis circuit-type level-2-only\n");
1873 case IS_LEVEL_1_AND_2
:
1874 vty_out(vty
, " isis circuit-type level-1-2\n");
1880 * XPath: /frr-interface:lib/interface/frr-isisd:isis/network-type
1882 DEFPY(isis_network
, isis_network_cmd
, "[no] isis network point-to-point",
1884 "IS-IS routing protocol\n"
1885 "Set network type\n"
1886 "point-to-point network type\n")
1888 nb_cli_enqueue_change(vty
, "./frr-isisd:isis/network-type",
1890 no
? "broadcast" : "point-to-point");
1892 return nb_cli_apply_changes(vty
, NULL
);
1895 void cli_show_ip_isis_network_type(struct vty
*vty
, struct lyd_node
*dnode
,
1898 if (yang_dnode_get_enum(dnode
, NULL
) != CIRCUIT_T_P2P
)
1899 vty_out(vty
, " no");
1901 vty_out(vty
, " isis network point-to-point\n");
1905 * XPath: /frr-interface:lib/interface/frr-isisd:isis/priority
1907 DEFPY(isis_priority
, isis_priority_cmd
,
1908 "isis priority (0-127)$prio [level-1|level-2]$level",
1909 "IS-IS routing protocol\n"
1910 "Set priority for Designated Router election\n"
1912 "Specify priority for level-1 routing\n"
1913 "Specify priority for level-2 routing\n")
1915 if (!level
|| strmatch(level
, "level-1"))
1916 nb_cli_enqueue_change(vty
, "./frr-isisd:isis/priority/level-1",
1917 NB_OP_MODIFY
, prio_str
);
1918 if (!level
|| strmatch(level
, "level-2"))
1919 nb_cli_enqueue_change(vty
, "./frr-isisd:isis/priority/level-2",
1920 NB_OP_MODIFY
, prio_str
);
1922 return nb_cli_apply_changes(vty
, NULL
);
1925 DEFPY(no_isis_priority
, no_isis_priority_cmd
,
1926 "no isis priority [(0-127)] [level-1|level-2]$level",
1928 "IS-IS routing protocol\n"
1929 "Set priority for Designated Router election\n"
1931 "Specify priority for level-1 routing\n"
1932 "Specify priority for level-2 routing\n")
1934 if (!level
|| strmatch(level
, "level-1"))
1935 nb_cli_enqueue_change(vty
, "./frr-isisd:isis/priority/level-1",
1936 NB_OP_MODIFY
, NULL
);
1937 if (!level
|| strmatch(level
, "level-2"))
1938 nb_cli_enqueue_change(vty
, "./frr-isisd:isis/priority/level-2",
1939 NB_OP_MODIFY
, NULL
);
1941 return nb_cli_apply_changes(vty
, NULL
);
1944 void cli_show_ip_isis_priority(struct vty
*vty
, struct lyd_node
*dnode
,
1947 const char *l1
= yang_dnode_get_string(dnode
, "./level-1");
1948 const char *l2
= yang_dnode_get_string(dnode
, "./level-2");
1950 if (strmatch(l1
, l2
))
1951 vty_out(vty
, " isis priority %s\n", l1
);
1953 vty_out(vty
, " isis priority %s level-1\n", l1
);
1954 vty_out(vty
, " isis priority %s level-2\n", l2
);
1959 * XPath: /frr-isisd:isis/instance/log-adjacency-changes
1961 DEFPY(log_adj_changes
, log_adj_changes_cmd
, "[no] log-adjacency-changes",
1962 NO_STR
"Log changes in adjacency state\n")
1964 nb_cli_enqueue_change(vty
, "./log-adjacency-changes", NB_OP_MODIFY
,
1965 no
? "false" : "true");
1967 return nb_cli_apply_changes(vty
, NULL
);
1970 void cli_show_isis_log_adjacency(struct vty
*vty
, struct lyd_node
*dnode
,
1973 if (!yang_dnode_get_bool(dnode
, NULL
))
1974 vty_out(vty
, " no");
1975 vty_out(vty
, " log-adjacency-changes\n");
1978 void isis_cli_init(void)
1980 install_element(CONFIG_NODE
, &router_isis_cmd
);
1981 install_element(CONFIG_NODE
, &no_router_isis_cmd
);
1983 install_element(INTERFACE_NODE
, &ip_router_isis_cmd
);
1984 install_element(INTERFACE_NODE
, &ip6_router_isis_cmd
);
1985 install_element(INTERFACE_NODE
, &no_ip_router_isis_cmd
);
1986 install_element(INTERFACE_NODE
, &isis_bfd_cmd
);
1988 install_element(ISIS_NODE
, &net_cmd
);
1990 install_element(ISIS_NODE
, &is_type_cmd
);
1991 install_element(ISIS_NODE
, &no_is_type_cmd
);
1993 install_element(ISIS_NODE
, &dynamic_hostname_cmd
);
1995 install_element(ISIS_NODE
, &set_overload_bit_cmd
);
1996 install_element(ISIS_NODE
, &set_attached_bit_cmd
);
1998 install_element(ISIS_NODE
, &metric_style_cmd
);
1999 install_element(ISIS_NODE
, &no_metric_style_cmd
);
2001 install_element(ISIS_NODE
, &area_passwd_cmd
);
2002 install_element(ISIS_NODE
, &domain_passwd_cmd
);
2003 install_element(ISIS_NODE
, &no_area_passwd_cmd
);
2005 install_element(ISIS_NODE
, &lsp_gen_interval_cmd
);
2006 install_element(ISIS_NODE
, &no_lsp_gen_interval_cmd
);
2007 install_element(ISIS_NODE
, &lsp_refresh_interval_cmd
);
2008 install_element(ISIS_NODE
, &no_lsp_refresh_interval_cmd
);
2009 install_element(ISIS_NODE
, &max_lsp_lifetime_cmd
);
2010 install_element(ISIS_NODE
, &no_max_lsp_lifetime_cmd
);
2011 install_element(ISIS_NODE
, &area_lsp_mtu_cmd
);
2012 install_element(ISIS_NODE
, &no_area_lsp_mtu_cmd
);
2014 install_element(ISIS_NODE
, &spf_interval_cmd
);
2015 install_element(ISIS_NODE
, &no_spf_interval_cmd
);
2016 install_element(ISIS_NODE
, &spf_delay_ietf_cmd
);
2017 install_element(ISIS_NODE
, &no_spf_delay_ietf_cmd
);
2019 install_element(ISIS_NODE
, &area_purge_originator_cmd
);
2021 install_element(ISIS_NODE
, &isis_mpls_te_on_cmd
);
2022 install_element(ISIS_NODE
, &no_isis_mpls_te_on_cmd
);
2023 install_element(ISIS_NODE
, &isis_mpls_te_router_addr_cmd
);
2024 install_element(ISIS_NODE
, &no_isis_mpls_te_router_addr_cmd
);
2025 install_element(ISIS_NODE
, &isis_mpls_te_inter_as_cmd
);
2027 install_element(ISIS_NODE
, &isis_default_originate_cmd
);
2028 install_element(ISIS_NODE
, &isis_redistribute_cmd
);
2030 install_element(ISIS_NODE
, &isis_topology_cmd
);
2032 install_element(INTERFACE_NODE
, &isis_passive_cmd
);
2034 install_element(INTERFACE_NODE
, &isis_passwd_cmd
);
2035 install_element(INTERFACE_NODE
, &no_isis_passwd_cmd
);
2037 install_element(INTERFACE_NODE
, &isis_metric_cmd
);
2038 install_element(INTERFACE_NODE
, &no_isis_metric_cmd
);
2040 install_element(INTERFACE_NODE
, &isis_hello_interval_cmd
);
2041 install_element(INTERFACE_NODE
, &no_isis_hello_interval_cmd
);
2043 install_element(INTERFACE_NODE
, &isis_hello_multiplier_cmd
);
2044 install_element(INTERFACE_NODE
, &no_isis_hello_multiplier_cmd
);
2046 install_element(INTERFACE_NODE
, &isis_threeway_adj_cmd
);
2048 install_element(INTERFACE_NODE
, &isis_hello_padding_cmd
);
2050 install_element(INTERFACE_NODE
, &csnp_interval_cmd
);
2051 install_element(INTERFACE_NODE
, &no_csnp_interval_cmd
);
2053 install_element(INTERFACE_NODE
, &psnp_interval_cmd
);
2054 install_element(INTERFACE_NODE
, &no_psnp_interval_cmd
);
2056 install_element(INTERFACE_NODE
, &circuit_topology_cmd
);
2058 install_element(INTERFACE_NODE
, &isis_circuit_type_cmd
);
2059 install_element(INTERFACE_NODE
, &no_isis_circuit_type_cmd
);
2061 install_element(INTERFACE_NODE
, &isis_network_cmd
);
2063 install_element(INTERFACE_NODE
, &isis_priority_cmd
);
2064 install_element(INTERFACE_NODE
, &no_isis_priority_cmd
);
2066 install_element(ISIS_NODE
, &log_adj_changes_cmd
);
2069 #endif /* ifndef FABRICD */