]>
Commit | Line | Data |
---|---|---|
20bd27e2 EDP |
1 | /* |
2 | * Copyright (C) 2001,2002 Sampo Saaristo | |
3 | * Tampere University of Technology | |
4 | * Institute of Communications Engineering | |
5 | * Copyright (C) 2018 Volta Networks | |
6 | * Emanuele Di Pascale | |
7 | * | |
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) | |
11 | * any later version. | |
12 | * | |
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 | |
16 | * more details. | |
17 | * | |
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 | |
21 | */ | |
22 | ||
23 | #include <zebra.h> | |
24 | ||
25 | #include "if.h" | |
26 | #include "vrf.h" | |
27 | #include "log.h" | |
28 | #include "prefix.h" | |
29 | #include "command.h" | |
30 | #include "northbound_cli.h" | |
31 | #include "libfrr.h" | |
32 | #include "yang.h" | |
33 | #include "lib/linklist.h" | |
34 | #include "isisd/isisd.h" | |
2a1c520e | 35 | #include "isisd/isis_nb.h" |
20bd27e2 EDP |
36 | #include "isisd/isis_misc.h" |
37 | #include "isisd/isis_circuit.h" | |
38 | #include "isisd/isis_csm.h" | |
39 | ||
40 | #ifndef VTYSH_EXTRACT_PL | |
41 | #include "isisd/isis_cli_clippy.c" | |
42 | #endif | |
43 | ||
44 | #ifndef FABRICD | |
45 | ||
aaf2fd21 EDP |
46 | /* |
47 | * XPath: /frr-isisd:isis/instance | |
48 | */ | |
65251ce8 | 49 | DEFPY_YANG_NOSH(router_isis, router_isis_cmd, |
50 | "router isis WORD$tag [vrf NAME$vrf_name]", | |
51 | ROUTER_STR | |
52 | "ISO IS-IS\n" | |
53 | "ISO Routing area tag\n" VRF_CMD_HELP_STR) | |
aaf2fd21 EDP |
54 | { |
55 | int ret; | |
56 | char base_xpath[XPATH_MAXLEN]; | |
57 | ||
65251ce8 | 58 | if (!vrf_name) |
59 | vrf_name = VRF_DEFAULT_NAME; | |
60 | ||
aaf2fd21 | 61 | snprintf(base_xpath, XPATH_MAXLEN, |
65251ce8 | 62 | "/frr-isisd:isis/instance[area-tag='%s'][vrf='%s']", tag, |
63 | vrf_name); | |
aaf2fd21 | 64 | nb_cli_enqueue_change(vty, ".", NB_OP_CREATE, NULL); |
eab88f36 | 65 | |
aaf2fd21 EDP |
66 | ret = nb_cli_apply_changes(vty, base_xpath); |
67 | if (ret == CMD_SUCCESS) | |
68 | VTY_PUSH_XPATH(ISIS_NODE, base_xpath); | |
69 | ||
70 | return ret; | |
71 | } | |
72 | ||
65251ce8 | 73 | DEFPY_YANG(no_router_isis, no_router_isis_cmd, |
74 | "no router isis WORD$tag [vrf NAME$vrf_name]", | |
75 | NO_STR ROUTER_STR | |
76 | "ISO IS-IS\n" | |
77 | "ISO Routing area tag\n" VRF_CMD_HELP_STR) | |
aaf2fd21 | 78 | { |
65251ce8 | 79 | if (!vrf_name) |
80 | vrf_name = VRF_DEFAULT_NAME; | |
81 | ||
3bb513c3 | 82 | if (!yang_dnode_existsf( |
65251ce8 | 83 | vty->candidate_config->dnode, |
84 | "/frr-isisd:isis/instance[area-tag='%s'][vrf='%s']", tag, | |
85 | vrf_name)) { | |
aaf2fd21 EDP |
86 | vty_out(vty, "ISIS area %s not found.\n", tag); |
87 | return CMD_ERR_NOTHING_TODO; | |
88 | } | |
89 | ||
95ce849b | 90 | nb_cli_enqueue_change(vty, ".", NB_OP_DESTROY, NULL); |
aaf2fd21 | 91 | |
fd396924 | 92 | return nb_cli_apply_changes_clear_pending( |
65251ce8 | 93 | vty, "/frr-isisd:isis/instance[area-tag='%s'][vrf='%s']", tag, |
94 | vrf_name); | |
aaf2fd21 EDP |
95 | } |
96 | ||
25605051 | 97 | void cli_show_router_isis(struct vty *vty, const struct lyd_node *dnode, |
aaf2fd21 EDP |
98 | bool show_defaults) |
99 | { | |
65251ce8 | 100 | const char *vrf = NULL; |
101 | ||
102 | vrf = yang_dnode_get_string(dnode, "./vrf"); | |
103 | ||
aaf2fd21 | 104 | vty_out(vty, "!\n"); |
31200a29 | 105 | vty_out(vty, "router isis %s", |
aaf2fd21 | 106 | yang_dnode_get_string(dnode, "./area-tag")); |
65251ce8 | 107 | if (!strmatch(vrf, VRF_DEFAULT_NAME)) |
31200a29 | 108 | vty_out(vty, " vrf %s", yang_dnode_get_string(dnode, "./vrf")); |
65251ce8 | 109 | vty_out(vty, "\n"); |
aaf2fd21 EDP |
110 | } |
111 | ||
25605051 | 112 | void cli_show_router_isis_end(struct vty *vty, const struct lyd_node *dnode) |
07679ad9 IR |
113 | { |
114 | vty_out(vty, "exit\n"); | |
115 | } | |
116 | ||
aaf2fd21 EDP |
117 | /* |
118 | * XPath: /frr-interface:lib/interface/frr-isisd:isis/ | |
119 | * XPath: /frr-interface:lib/interface/frr-isisd:isis/ipv4-routing | |
120 | * XPath: /frr-interface:lib/interface/frr-isisd:isis/ipv6-routing | |
121 | * XPath: /frr-isisd:isis/instance | |
122 | */ | |
65251ce8 | 123 | DEFPY_YANG(ip_router_isis, ip_router_isis_cmd, |
1457b1d5 | 124 | "ip router isis WORD$tag", |
65251ce8 | 125 | "Interface Internet Protocol config commands\n" |
126 | "IP router interface commands\n" | |
127 | "IS-IS routing protocol\n" | |
1457b1d5 | 128 | "Routing process tag\n") |
aaf2fd21 | 129 | { |
aaf8e809 IR |
130 | nb_cli_enqueue_change(vty, "./frr-isisd:isis", NB_OP_CREATE, NULL); |
131 | nb_cli_enqueue_change(vty, "./frr-isisd:isis/area-tag", NB_OP_MODIFY, | |
132 | tag); | |
aaf8e809 IR |
133 | nb_cli_enqueue_change(vty, "./frr-isisd:isis/ipv4-routing", |
134 | NB_OP_MODIFY, "true"); | |
aaf2fd21 EDP |
135 | |
136 | return nb_cli_apply_changes(vty, NULL); | |
137 | } | |
138 | ||
1457b1d5 IR |
139 | ALIAS_HIDDEN(ip_router_isis, ip_router_isis_vrf_cmd, |
140 | "ip router isis WORD$tag vrf NAME$vrf_name", | |
141 | "Interface Internet Protocol config commands\n" | |
142 | "IP router interface commands\n" | |
143 | "IS-IS routing protocol\n" | |
144 | "Routing process tag\n" VRF_CMD_HELP_STR) | |
145 | ||
65251ce8 | 146 | DEFPY_YANG(ip6_router_isis, ip6_router_isis_cmd, |
1457b1d5 | 147 | "ipv6 router isis WORD$tag", |
65251ce8 | 148 | "Interface Internet Protocol config commands\n" |
149 | "IP router interface commands\n" | |
150 | "IS-IS routing protocol\n" | |
1457b1d5 | 151 | "Routing process tag\n") |
aaf2fd21 | 152 | { |
aaf8e809 IR |
153 | nb_cli_enqueue_change(vty, "./frr-isisd:isis", NB_OP_CREATE, NULL); |
154 | nb_cli_enqueue_change(vty, "./frr-isisd:isis/area-tag", NB_OP_MODIFY, | |
155 | tag); | |
aaf8e809 IR |
156 | nb_cli_enqueue_change(vty, "./frr-isisd:isis/ipv6-routing", |
157 | NB_OP_MODIFY, "true"); | |
aaf2fd21 EDP |
158 | |
159 | return nb_cli_apply_changes(vty, NULL); | |
160 | } | |
161 | ||
1457b1d5 IR |
162 | ALIAS_HIDDEN(ip6_router_isis, ip6_router_isis_vrf_cmd, |
163 | "ipv6 router isis WORD$tag vrf NAME$vrf_name", | |
164 | "Interface Internet Protocol config commands\n" | |
165 | "IP router interface commands\n" | |
166 | "IS-IS routing protocol\n" | |
167 | "Routing process tag\n" VRF_CMD_HELP_STR) | |
168 | ||
ca77b518 | 169 | DEFPY_YANG(no_ip_router_isis, no_ip_router_isis_cmd, |
1457b1d5 | 170 | "no <ip|ipv6>$ip router isis [WORD]$tag", |
65251ce8 | 171 | NO_STR |
172 | "Interface Internet Protocol config commands\n" | |
173 | "IP router interface commands\n" | |
174 | "IP router interface commands\n" | |
175 | "IS-IS routing protocol\n" | |
1457b1d5 | 176 | "Routing process tag\n") |
aaf2fd21 | 177 | { |
472c3dae | 178 | const struct lyd_node *dnode; |
aaf2fd21 | 179 | |
3bb513c3 CH |
180 | dnode = yang_dnode_getf(vty->candidate_config->dnode, |
181 | "%s/frr-isisd:isis", VTY_CURR_XPATH); | |
472c3dae RW |
182 | if (!dnode) |
183 | return CMD_SUCCESS; | |
184 | ||
185 | /* | |
186 | * If both ipv4 and ipv6 are off delete the interface isis container. | |
aaf2fd21 | 187 | */ |
472c3dae RW |
188 | if (strmatch(ip, "ipv6")) { |
189 | if (!yang_dnode_get_bool(dnode, "./ipv4-routing")) | |
aaf2fd21 | 190 | nb_cli_enqueue_change(vty, "./frr-isisd:isis", |
95ce849b | 191 | NB_OP_DESTROY, NULL); |
aaf2fd21 EDP |
192 | else |
193 | nb_cli_enqueue_change(vty, | |
194 | "./frr-isisd:isis/ipv6-routing", | |
5f1e5e3f | 195 | NB_OP_MODIFY, "false"); |
472c3dae RW |
196 | } else { |
197 | if (!yang_dnode_get_bool(dnode, "./ipv6-routing")) | |
aaf2fd21 | 198 | nb_cli_enqueue_change(vty, "./frr-isisd:isis", |
95ce849b | 199 | NB_OP_DESTROY, NULL); |
aaf2fd21 EDP |
200 | else |
201 | nb_cli_enqueue_change(vty, | |
202 | "./frr-isisd:isis/ipv4-routing", | |
5f1e5e3f | 203 | NB_OP_MODIFY, "false"); |
aaf2fd21 EDP |
204 | } |
205 | ||
206 | return nb_cli_apply_changes(vty, NULL); | |
207 | } | |
208 | ||
1457b1d5 IR |
209 | ALIAS_HIDDEN(no_ip_router_isis, no_ip_router_isis_vrf_cmd, |
210 | "no <ip|ipv6>$ip router isis WORD$tag vrf NAME$vrf_name", | |
211 | NO_STR | |
212 | "Interface Internet Protocol config commands\n" | |
213 | "IP router interface commands\n" | |
214 | "IP router interface commands\n" | |
215 | "IS-IS routing protocol\n" | |
216 | "Routing process tag\n" | |
217 | VRF_CMD_HELP_STR) | |
218 | ||
25605051 | 219 | void cli_show_ip_isis_ipv4(struct vty *vty, const struct lyd_node *dnode, |
aaf2fd21 EDP |
220 | bool show_defaults) |
221 | { | |
5f1e5e3f EDP |
222 | if (!yang_dnode_get_bool(dnode, NULL)) |
223 | vty_out(vty, " no"); | |
1457b1d5 | 224 | vty_out(vty, " ip router isis %s\n", |
aaf2fd21 EDP |
225 | yang_dnode_get_string(dnode, "../area-tag")); |
226 | } | |
227 | ||
25605051 | 228 | void cli_show_ip_isis_ipv6(struct vty *vty, const struct lyd_node *dnode, |
aaf2fd21 EDP |
229 | bool show_defaults) |
230 | { | |
5f1e5e3f EDP |
231 | if (!yang_dnode_get_bool(dnode, NULL)) |
232 | vty_out(vty, " no"); | |
1457b1d5 | 233 | vty_out(vty, " ipv6 router isis %s\n", |
aaf2fd21 EDP |
234 | yang_dnode_get_string(dnode, "../area-tag")); |
235 | } | |
236 | ||
c3e6ac0b RZ |
237 | /* |
238 | * XPath: /frr-interface:lib/interface/frr-isisd:isis/bfd-monitoring | |
239 | */ | |
ca77b518 | 240 | DEFPY_YANG(isis_bfd, |
c3e6ac0b RZ |
241 | isis_bfd_cmd, |
242 | "[no] isis bfd", | |
4affdba7 | 243 | NO_STR PROTO_HELP |
c3e6ac0b RZ |
244 | "Enable BFD support\n") |
245 | { | |
246 | const struct lyd_node *dnode; | |
247 | ||
3bb513c3 CH |
248 | dnode = yang_dnode_getf(vty->candidate_config->dnode, |
249 | "%s/frr-isisd:isis", VTY_CURR_XPATH); | |
8222b997 RZ |
250 | if (dnode == NULL) { |
251 | vty_out(vty, "ISIS is not enabled on this circuit\n"); | |
c3e6ac0b | 252 | return CMD_SUCCESS; |
8222b997 | 253 | } |
c3e6ac0b | 254 | |
4affdba7 | 255 | nb_cli_enqueue_change(vty, "./frr-isisd:isis/bfd-monitoring/enabled", |
c3e6ac0b RZ |
256 | NB_OP_MODIFY, no ? "false" : "true"); |
257 | ||
258 | return nb_cli_apply_changes(vty, NULL); | |
259 | } | |
260 | ||
4affdba7 G |
261 | /* |
262 | * XPath: /frr-interface:lib/interface/frr-isisd:isis/bfd-monitoring/profile | |
263 | */ | |
ca77b518 | 264 | DEFPY_YANG(isis_bfd_profile, |
4affdba7 | 265 | isis_bfd_profile_cmd, |
c022a581 | 266 | "[no] isis bfd profile BFDPROF$profile", |
4affdba7 G |
267 | NO_STR PROTO_HELP |
268 | "Enable BFD support\n" | |
269 | "Use a pre-configured profile\n" | |
270 | "Profile name\n") | |
271 | { | |
272 | const struct lyd_node *dnode; | |
273 | ||
3bb513c3 CH |
274 | dnode = yang_dnode_getf(vty->candidate_config->dnode, |
275 | "%s/frr-isisd:isis", VTY_CURR_XPATH); | |
4affdba7 G |
276 | if (dnode == NULL) { |
277 | vty_out(vty, "ISIS is not enabled on this circuit\n"); | |
278 | return CMD_SUCCESS; | |
279 | } | |
280 | ||
bb28b985 IR |
281 | if (no) |
282 | nb_cli_enqueue_change(vty, | |
283 | "./frr-isisd:isis/bfd-monitoring/profile", | |
284 | NB_OP_DESTROY, NULL); | |
285 | else | |
286 | nb_cli_enqueue_change(vty, | |
287 | "./frr-isisd:isis/bfd-monitoring/profile", | |
288 | NB_OP_MODIFY, profile); | |
4affdba7 G |
289 | |
290 | return nb_cli_apply_changes(vty, NULL); | |
291 | } | |
292 | ||
25605051 IR |
293 | void cli_show_ip_isis_bfd_monitoring(struct vty *vty, |
294 | const struct lyd_node *dnode, | |
c3e6ac0b RZ |
295 | bool show_defaults) |
296 | { | |
081f9b29 IR |
297 | if (!yang_dnode_get_bool(dnode, "./enabled")) { |
298 | if (show_defaults) | |
299 | vty_out(vty, " no isis bfd\n"); | |
300 | } else { | |
301 | vty_out(vty, " isis bfd\n"); | |
302 | } | |
4affdba7 | 303 | |
bb28b985 IR |
304 | if (yang_dnode_exists(dnode, "./profile")) |
305 | vty_out(vty, " isis bfd profile %s\n", | |
306 | yang_dnode_get_string(dnode, "./profile")); | |
c3e6ac0b RZ |
307 | } |
308 | ||
f084ea55 EDP |
309 | /* |
310 | * XPath: /frr-isisd:isis/instance/area-address | |
311 | */ | |
ca77b518 | 312 | DEFPY_YANG(net, net_cmd, "[no] net WORD", |
f084ea55 EDP |
313 | "Remove an existing Network Entity Title for this process\n" |
314 | "A Network Entity Title for this process (OSI only)\n" | |
315 | "XX.XXXX. ... .XXX.XX Network entity title (NET)\n") | |
316 | { | |
317 | nb_cli_enqueue_change(vty, "./area-address", | |
95ce849b | 318 | no ? NB_OP_DESTROY : NB_OP_CREATE, net); |
f084ea55 EDP |
319 | |
320 | return nb_cli_apply_changes(vty, NULL); | |
321 | } | |
322 | ||
25605051 | 323 | void cli_show_isis_area_address(struct vty *vty, const struct lyd_node *dnode, |
f084ea55 EDP |
324 | bool show_defaults) |
325 | { | |
326 | vty_out(vty, " net %s\n", yang_dnode_get_string(dnode, NULL)); | |
327 | } | |
328 | ||
e6bdae69 EDP |
329 | /* |
330 | * XPath: /frr-isisd:isis/instance/is-type | |
331 | */ | |
ca77b518 | 332 | DEFPY_YANG(is_type, is_type_cmd, "is-type <level-1|level-1-2|level-2-only>$level", |
e6bdae69 EDP |
333 | "IS Level for this routing process (OSI only)\n" |
334 | "Act as a station router only\n" | |
335 | "Act as both a station router and an area router\n" | |
336 | "Act as an area router only\n") | |
337 | { | |
338 | nb_cli_enqueue_change(vty, "./is-type", NB_OP_MODIFY, | |
339 | strmatch(level, "level-2-only") ? "level-2" | |
340 | : level); | |
341 | ||
342 | return nb_cli_apply_changes(vty, NULL); | |
343 | } | |
344 | ||
ca77b518 | 345 | DEFPY_YANG(no_is_type, no_is_type_cmd, |
e6bdae69 EDP |
346 | "no is-type [<level-1|level-1-2|level-2-only>]", |
347 | NO_STR | |
348 | "IS Level for this routing process (OSI only)\n" | |
349 | "Act as a station router only\n" | |
350 | "Act as both a station router and an area router\n" | |
351 | "Act as an area router only\n") | |
352 | { | |
fd506bbb | 353 | nb_cli_enqueue_change(vty, "./is-type", NB_OP_MODIFY, NULL); |
e6bdae69 EDP |
354 | |
355 | return nb_cli_apply_changes(vty, NULL); | |
356 | } | |
357 | ||
25605051 | 358 | void cli_show_isis_is_type(struct vty *vty, const struct lyd_node *dnode, |
e6bdae69 EDP |
359 | bool show_defaults) |
360 | { | |
361 | int is_type = yang_dnode_get_enum(dnode, NULL); | |
362 | ||
363 | switch (is_type) { | |
364 | case IS_LEVEL_1: | |
365 | vty_out(vty, " is-type level-1\n"); | |
366 | break; | |
367 | case IS_LEVEL_2: | |
368 | vty_out(vty, " is-type level-2-only\n"); | |
369 | break; | |
370 | case IS_LEVEL_1_AND_2: | |
371 | vty_out(vty, " is-type level-1-2\n"); | |
372 | break; | |
373 | } | |
374 | } | |
375 | ||
6bb043cd EDP |
376 | /* |
377 | * XPath: /frr-isisd:isis/instance/dynamic-hostname | |
378 | */ | |
ca77b518 | 379 | DEFPY_YANG(dynamic_hostname, dynamic_hostname_cmd, "[no] hostname dynamic", |
6bb043cd EDP |
380 | NO_STR |
381 | "Dynamic hostname for IS-IS\n" | |
382 | "Dynamic hostname\n") | |
383 | { | |
384 | nb_cli_enqueue_change(vty, "./dynamic-hostname", NB_OP_MODIFY, | |
385 | no ? "false" : "true"); | |
386 | ||
387 | return nb_cli_apply_changes(vty, NULL); | |
388 | } | |
389 | ||
25605051 IR |
390 | void cli_show_isis_dynamic_hostname(struct vty *vty, |
391 | const struct lyd_node *dnode, | |
6bb043cd EDP |
392 | bool show_defaults) |
393 | { | |
394 | if (!yang_dnode_get_bool(dnode, NULL)) | |
395 | vty_out(vty, " no"); | |
396 | ||
397 | vty_out(vty, " hostname dynamic\n"); | |
398 | } | |
399 | ||
05a3f9f0 EDP |
400 | /* |
401 | * XPath: /frr-isisd:isis/instance/overload | |
402 | */ | |
ca77b518 | 403 | DEFPY_YANG(set_overload_bit, set_overload_bit_cmd, "[no] set-overload-bit", |
05a3f9f0 EDP |
404 | "Reset overload bit to accept transit traffic\n" |
405 | "Set overload bit to avoid any transit traffic\n") | |
406 | { | |
5f1e5e3f EDP |
407 | nb_cli_enqueue_change(vty, "./overload", NB_OP_MODIFY, |
408 | no ? "false" : "true"); | |
05a3f9f0 EDP |
409 | |
410 | return nb_cli_apply_changes(vty, NULL); | |
411 | } | |
412 | ||
25605051 | 413 | void cli_show_isis_overload(struct vty *vty, const struct lyd_node *dnode, |
05a3f9f0 EDP |
414 | bool show_defaults) |
415 | { | |
5f1e5e3f EDP |
416 | if (!yang_dnode_get_bool(dnode, NULL)) |
417 | vty_out(vty, " no"); | |
05a3f9f0 EDP |
418 | vty_out(vty, " set-overload-bit\n"); |
419 | } | |
420 | ||
f3abc412 | 421 | /* |
422 | * XPath: /frr-isisd:isis/instance/attach-send | |
423 | */ | |
424 | DEFPY_YANG(attached_bit_send, attached_bit_send_cmd, "[no] attached-bit send", | |
425 | "Reset attached bit\n" | |
426 | "Set attached bit for inter-area traffic\n" | |
427 | "Set attached bit in LSP sent to L1 router\n") | |
428 | { | |
429 | nb_cli_enqueue_change(vty, "./attach-send", NB_OP_MODIFY, | |
5f1e5e3f | 430 | no ? "false" : "true"); |
05a3f9f0 EDP |
431 | |
432 | return nb_cli_apply_changes(vty, NULL); | |
433 | } | |
434 | ||
25605051 | 435 | void cli_show_isis_attached_send(struct vty *vty, const struct lyd_node *dnode, |
f3abc412 | 436 | bool show_defaults) |
437 | { | |
438 | if (!yang_dnode_get_bool(dnode, NULL)) | |
439 | vty_out(vty, " no"); | |
440 | vty_out(vty, " attached-bit send\n"); | |
441 | } | |
442 | ||
443 | /* | |
444 | * XPath: /frr-isisd:isis/instance/attach-receive-ignore | |
445 | */ | |
446 | DEFPY_YANG( | |
447 | attached_bit_receive_ignore, attached_bit_receive_ignore_cmd, | |
448 | "[no] attached-bit receive ignore", | |
449 | "Reset attached bit\n" | |
450 | "Set attach bit for inter-area traffic\n" | |
451 | "If LSP received with attached bit set, create default route to neighbor\n" | |
452 | "Do not process attached bit\n") | |
453 | { | |
454 | nb_cli_enqueue_change(vty, "./attach-receive-ignore", NB_OP_MODIFY, | |
455 | no ? "false" : "true"); | |
456 | ||
457 | return nb_cli_apply_changes(vty, NULL); | |
458 | } | |
459 | ||
25605051 IR |
460 | void cli_show_isis_attached_receive(struct vty *vty, |
461 | const struct lyd_node *dnode, | |
f3abc412 | 462 | bool show_defaults) |
05a3f9f0 | 463 | { |
5f1e5e3f EDP |
464 | if (!yang_dnode_get_bool(dnode, NULL)) |
465 | vty_out(vty, " no"); | |
f3abc412 | 466 | vty_out(vty, " attached-bit receive ignore\n"); |
05a3f9f0 EDP |
467 | } |
468 | ||
e0df3206 EDP |
469 | /* |
470 | * XPath: /frr-isisd:isis/instance/metric-style | |
471 | */ | |
ca77b518 | 472 | DEFPY_YANG(metric_style, metric_style_cmd, |
f34ab52d | 473 | "metric-style <narrow|transition|wide>$style", |
e0df3206 EDP |
474 | "Use old-style (ISO 10589) or new-style packet formats\n" |
475 | "Use old style of TLVs with narrow metric\n" | |
476 | "Send and accept both styles of TLVs during transition\n" | |
477 | "Use new style of TLVs to carry wider metric\n") | |
478 | { | |
479 | nb_cli_enqueue_change(vty, "./metric-style", NB_OP_MODIFY, style); | |
480 | ||
481 | return nb_cli_apply_changes(vty, NULL); | |
482 | } | |
483 | ||
ca77b518 | 484 | DEFPY_YANG(no_metric_style, no_metric_style_cmd, |
f34ab52d EDP |
485 | "no metric-style [narrow|transition|wide]", |
486 | NO_STR | |
487 | "Use old-style (ISO 10589) or new-style packet formats\n" | |
e0df3206 EDP |
488 | "Use old style of TLVs with narrow metric\n" |
489 | "Send and accept both styles of TLVs during transition\n" | |
490 | "Use new style of TLVs to carry wider metric\n") | |
491 | { | |
fd506bbb | 492 | nb_cli_enqueue_change(vty, "./metric-style", NB_OP_MODIFY, NULL); |
e0df3206 EDP |
493 | |
494 | return nb_cli_apply_changes(vty, NULL); | |
495 | } | |
496 | ||
25605051 | 497 | void cli_show_isis_metric_style(struct vty *vty, const struct lyd_node *dnode, |
e0df3206 EDP |
498 | bool show_defaults) |
499 | { | |
500 | int metric = yang_dnode_get_enum(dnode, NULL); | |
501 | ||
502 | switch (metric) { | |
503 | case ISIS_NARROW_METRIC: | |
504 | vty_out(vty, " metric-style narrow\n"); | |
505 | break; | |
506 | case ISIS_WIDE_METRIC: | |
507 | vty_out(vty, " metric-style wide\n"); | |
508 | break; | |
509 | case ISIS_TRANSITION_METRIC: | |
510 | vty_out(vty, " metric-style transition\n"); | |
511 | break; | |
512 | } | |
513 | } | |
514 | ||
933536e3 EDP |
515 | /* |
516 | * XPath: /frr-isisd:isis/instance/area-password | |
517 | */ | |
ca77b518 | 518 | DEFPY_YANG(area_passwd, area_passwd_cmd, |
933536e3 EDP |
519 | "area-password <clear|md5>$pwd_type WORD$pwd [authenticate snp <send-only|validate>$snp]", |
520 | "Configure the authentication password for an area\n" | |
521 | "Clear-text authentication type\n" | |
522 | "MD5 authentication type\n" | |
523 | "Level-wide password\n" | |
524 | "Authentication\n" | |
525 | "SNP PDUs\n" | |
526 | "Send but do not check PDUs on receiving\n" | |
527 | "Send and check PDUs on receiving\n") | |
528 | { | |
529 | nb_cli_enqueue_change(vty, "./area-password", NB_OP_CREATE, NULL); | |
530 | nb_cli_enqueue_change(vty, "./area-password/password", NB_OP_MODIFY, | |
531 | pwd); | |
532 | nb_cli_enqueue_change(vty, "./area-password/password-type", | |
533 | NB_OP_MODIFY, pwd_type); | |
534 | nb_cli_enqueue_change(vty, "./area-password/authenticate-snp", | |
535 | NB_OP_MODIFY, snp ? snp : "none"); | |
536 | ||
537 | return nb_cli_apply_changes(vty, NULL); | |
538 | } | |
539 | ||
25605051 | 540 | void cli_show_isis_area_pwd(struct vty *vty, const struct lyd_node *dnode, |
933536e3 EDP |
541 | bool show_defaults) |
542 | { | |
543 | const char *snp; | |
544 | ||
545 | vty_out(vty, " area-password %s %s", | |
546 | yang_dnode_get_string(dnode, "./password-type"), | |
547 | yang_dnode_get_string(dnode, "./password")); | |
548 | snp = yang_dnode_get_string(dnode, "./authenticate-snp"); | |
549 | if (!strmatch("none", snp)) | |
550 | vty_out(vty, " authenticate snp %s", snp); | |
551 | vty_out(vty, "\n"); | |
552 | } | |
553 | ||
554 | /* | |
555 | * XPath: /frr-isisd:isis/instance/domain-password | |
556 | */ | |
ca77b518 | 557 | DEFPY_YANG(domain_passwd, domain_passwd_cmd, |
933536e3 EDP |
558 | "domain-password <clear|md5>$pwd_type WORD$pwd [authenticate snp <send-only|validate>$snp]", |
559 | "Set the authentication password for a routing domain\n" | |
560 | "Clear-text authentication type\n" | |
561 | "MD5 authentication type\n" | |
562 | "Level-wide password\n" | |
563 | "Authentication\n" | |
564 | "SNP PDUs\n" | |
565 | "Send but do not check PDUs on receiving\n" | |
566 | "Send and check PDUs on receiving\n") | |
567 | { | |
568 | nb_cli_enqueue_change(vty, "./domain-password", NB_OP_CREATE, NULL); | |
569 | nb_cli_enqueue_change(vty, "./domain-password/password", NB_OP_MODIFY, | |
570 | pwd); | |
571 | nb_cli_enqueue_change(vty, "./domain-password/password-type", | |
572 | NB_OP_MODIFY, pwd_type); | |
573 | nb_cli_enqueue_change(vty, "./domain-password/authenticate-snp", | |
574 | NB_OP_MODIFY, snp ? snp : "none"); | |
575 | ||
576 | return nb_cli_apply_changes(vty, NULL); | |
577 | } | |
578 | ||
ca77b518 | 579 | DEFPY_YANG(no_area_passwd, no_area_passwd_cmd, |
933536e3 EDP |
580 | "no <area-password|domain-password>$cmd", |
581 | NO_STR | |
582 | "Configure the authentication password for an area\n" | |
583 | "Set the authentication password for a routing domain\n") | |
584 | { | |
95ce849b | 585 | nb_cli_enqueue_change(vty, ".", NB_OP_DESTROY, NULL); |
933536e3 EDP |
586 | |
587 | return nb_cli_apply_changes(vty, "./%s", cmd); | |
588 | } | |
589 | ||
25605051 | 590 | void cli_show_isis_domain_pwd(struct vty *vty, const struct lyd_node *dnode, |
933536e3 EDP |
591 | bool show_defaults) |
592 | { | |
593 | const char *snp; | |
594 | ||
595 | vty_out(vty, " domain-password %s %s", | |
596 | yang_dnode_get_string(dnode, "./password-type"), | |
597 | yang_dnode_get_string(dnode, "./password")); | |
598 | snp = yang_dnode_get_string(dnode, "./authenticate-snp"); | |
599 | if (!strmatch("none", snp)) | |
600 | vty_out(vty, " authenticate snp %s", snp); | |
601 | vty_out(vty, "\n"); | |
602 | } | |
603 | ||
1d6fe72e | 604 | /* |
d2c970ff EDP |
605 | * XPath: /frr-isisd:isis/instance/lsp/timers/level-1/generation-interval |
606 | * XPath: /frr-isisd:isis/instance/lsp/timers/level-2/generation-interval | |
1d6fe72e | 607 | */ |
ca77b518 | 608 | DEFPY_YANG(lsp_gen_interval, lsp_gen_interval_cmd, |
1d6fe72e EDP |
609 | "lsp-gen-interval [level-1|level-2]$level (1-120)$val", |
610 | "Minimum interval between regenerating same LSP\n" | |
611 | "Set interval for level 1 only\n" | |
612 | "Set interval for level 2 only\n" | |
613 | "Minimum interval in seconds\n") | |
614 | { | |
615 | if (!level || strmatch(level, "level-1")) | |
d2c970ff EDP |
616 | nb_cli_enqueue_change( |
617 | vty, "./lsp/timers/level-1/generation-interval", | |
618 | NB_OP_MODIFY, val_str); | |
1d6fe72e | 619 | if (!level || strmatch(level, "level-2")) |
d2c970ff EDP |
620 | nb_cli_enqueue_change( |
621 | vty, "./lsp/timers/level-2/generation-interval", | |
622 | NB_OP_MODIFY, val_str); | |
1d6fe72e EDP |
623 | |
624 | return nb_cli_apply_changes(vty, NULL); | |
625 | } | |
626 | ||
ca77b518 | 627 | DEFPY_YANG(no_lsp_gen_interval, no_lsp_gen_interval_cmd, |
1d6fe72e EDP |
628 | "no lsp-gen-interval [level-1|level-2]$level [(1-120)]", |
629 | NO_STR | |
630 | "Minimum interval between regenerating same LSP\n" | |
631 | "Set interval for level 1 only\n" | |
632 | "Set interval for level 2 only\n" | |
633 | "Minimum interval in seconds\n") | |
634 | { | |
635 | if (!level || strmatch(level, "level-1")) | |
d2c970ff EDP |
636 | nb_cli_enqueue_change( |
637 | vty, "./lsp/timers/level-1/generation-interval", | |
638 | NB_OP_MODIFY, NULL); | |
1d6fe72e | 639 | if (!level || strmatch(level, "level-2")) |
d2c970ff EDP |
640 | nb_cli_enqueue_change( |
641 | vty, "./lsp/timers/level-2/generation-interval", | |
642 | NB_OP_MODIFY, NULL); | |
1d6fe72e EDP |
643 | |
644 | return nb_cli_apply_changes(vty, NULL); | |
645 | } | |
646 | ||
7e869004 | 647 | /* |
d2c970ff EDP |
648 | * XPath: /frr-isisd:isis/instance/lsp/timers/level-1/refresh-interval |
649 | * XPath: /frr-isisd:isis/instance/lsp/timers/level-2/refresh-interval | |
7e869004 | 650 | */ |
ca77b518 | 651 | DEFPY_YANG(lsp_refresh_interval, lsp_refresh_interval_cmd, |
7e869004 EDP |
652 | "lsp-refresh-interval [level-1|level-2]$level (1-65235)$val", |
653 | "LSP refresh interval\n" | |
654 | "LSP refresh interval for Level 1 only\n" | |
655 | "LSP refresh interval for Level 2 only\n" | |
656 | "LSP refresh interval in seconds\n") | |
657 | { | |
658 | if (!level || strmatch(level, "level-1")) | |
d2c970ff EDP |
659 | nb_cli_enqueue_change(vty, |
660 | "./lsp/timers/level-1/refresh-interval", | |
7e869004 EDP |
661 | NB_OP_MODIFY, val_str); |
662 | if (!level || strmatch(level, "level-2")) | |
d2c970ff EDP |
663 | nb_cli_enqueue_change(vty, |
664 | "./lsp/timers/level-2/refresh-interval", | |
7e869004 EDP |
665 | NB_OP_MODIFY, val_str); |
666 | ||
667 | return nb_cli_apply_changes(vty, NULL); | |
668 | } | |
669 | ||
ca77b518 | 670 | DEFPY_YANG(no_lsp_refresh_interval, no_lsp_refresh_interval_cmd, |
7e869004 EDP |
671 | "no lsp-refresh-interval [level-1|level-2]$level [(1-65235)]", |
672 | NO_STR | |
673 | "LSP refresh interval\n" | |
674 | "LSP refresh interval for Level 1 only\n" | |
675 | "LSP refresh interval for Level 2 only\n" | |
676 | "LSP refresh interval in seconds\n") | |
677 | { | |
678 | if (!level || strmatch(level, "level-1")) | |
d2c970ff EDP |
679 | nb_cli_enqueue_change(vty, |
680 | "./lsp/timers/level-1/refresh-interval", | |
7e869004 EDP |
681 | NB_OP_MODIFY, NULL); |
682 | if (!level || strmatch(level, "level-2")) | |
d2c970ff EDP |
683 | nb_cli_enqueue_change(vty, |
684 | "./lsp/timers/level-2/refresh-interval", | |
7e869004 EDP |
685 | NB_OP_MODIFY, NULL); |
686 | ||
687 | return nb_cli_apply_changes(vty, NULL); | |
688 | } | |
689 | ||
ea120aa0 | 690 | /* |
d2c970ff EDP |
691 | * XPath: /frr-isisd:isis/instance/lsp/timers/level-1/maximum-lifetime |
692 | * XPath: /frr-isisd:isis/instance/lsp/timers/level-1/maximum-lifetime | |
ea120aa0 | 693 | */ |
d2c970ff | 694 | |
ca77b518 | 695 | DEFPY_YANG(max_lsp_lifetime, max_lsp_lifetime_cmd, |
ea120aa0 EDP |
696 | "max-lsp-lifetime [level-1|level-2]$level (350-65535)$val", |
697 | "Maximum LSP lifetime\n" | |
698 | "Maximum LSP lifetime for Level 1 only\n" | |
699 | "Maximum LSP lifetime for Level 2 only\n" | |
700 | "LSP lifetime in seconds\n") | |
701 | { | |
702 | if (!level || strmatch(level, "level-1")) | |
d2c970ff EDP |
703 | nb_cli_enqueue_change(vty, |
704 | "./lsp/timers/level-1/maximum-lifetime", | |
ea120aa0 EDP |
705 | NB_OP_MODIFY, val_str); |
706 | if (!level || strmatch(level, "level-2")) | |
d2c970ff EDP |
707 | nb_cli_enqueue_change(vty, |
708 | "./lsp/timers/level-2/maximum-lifetime", | |
ea120aa0 EDP |
709 | NB_OP_MODIFY, val_str); |
710 | ||
711 | return nb_cli_apply_changes(vty, NULL); | |
712 | } | |
713 | ||
ca77b518 | 714 | DEFPY_YANG(no_max_lsp_lifetime, no_max_lsp_lifetime_cmd, |
ea120aa0 EDP |
715 | "no max-lsp-lifetime [level-1|level-2]$level [(350-65535)]", |
716 | NO_STR | |
717 | "Maximum LSP lifetime\n" | |
718 | "Maximum LSP lifetime for Level 1 only\n" | |
719 | "Maximum LSP lifetime for Level 2 only\n" | |
720 | "LSP lifetime in seconds\n") | |
721 | { | |
722 | if (!level || strmatch(level, "level-1")) | |
d2c970ff EDP |
723 | nb_cli_enqueue_change(vty, |
724 | "./lsp/timers/level-1/maximum-lifetime", | |
ea120aa0 EDP |
725 | NB_OP_MODIFY, NULL); |
726 | if (!level || strmatch(level, "level-2")) | |
d2c970ff EDP |
727 | nb_cli_enqueue_change(vty, |
728 | "./lsp/timers/level-2/maximum-lifetime", | |
ea120aa0 EDP |
729 | NB_OP_MODIFY, NULL); |
730 | ||
731 | return nb_cli_apply_changes(vty, NULL); | |
732 | } | |
733 | ||
d2c970ff EDP |
734 | /* unified LSP timers command |
735 | * XPath: /frr-isisd:isis/instance/lsp/timers | |
736 | */ | |
737 | ||
ca77b518 | 738 | DEFPY_YANG(lsp_timers, lsp_timers_cmd, |
d2c970ff EDP |
739 | "lsp-timers [level-1|level-2]$level gen-interval (1-120)$gen refresh-interval (1-65235)$refresh max-lifetime (350-65535)$lifetime", |
740 | "LSP-related timers\n" | |
741 | "LSP-related timers for Level 1 only\n" | |
742 | "LSP-related timers for Level 2 only\n" | |
743 | "Minimum interval between regenerating same LSP\n" | |
744 | "Generation interval in seconds\n" | |
745 | "LSP refresh interval\n" | |
746 | "LSP refresh interval in seconds\n" | |
747 | "Maximum LSP lifetime\n" | |
748 | "Maximum LSP lifetime in seconds\n") | |
ea120aa0 | 749 | { |
d2c970ff EDP |
750 | if (!level || strmatch(level, "level-1")) { |
751 | nb_cli_enqueue_change( | |
752 | vty, "./lsp/timers/level-1/generation-interval", | |
753 | NB_OP_MODIFY, gen_str); | |
754 | nb_cli_enqueue_change(vty, | |
755 | "./lsp/timers/level-1/refresh-interval", | |
756 | NB_OP_MODIFY, refresh_str); | |
757 | nb_cli_enqueue_change(vty, | |
758 | "./lsp/timers/level-1/maximum-lifetime", | |
759 | NB_OP_MODIFY, lifetime_str); | |
760 | } | |
761 | if (!level || strmatch(level, "level-2")) { | |
762 | nb_cli_enqueue_change( | |
763 | vty, "./lsp/timers/level-2/generation-interval", | |
764 | NB_OP_MODIFY, gen_str); | |
765 | nb_cli_enqueue_change(vty, | |
766 | "./lsp/timers/level-2/refresh-interval", | |
767 | NB_OP_MODIFY, refresh_str); | |
768 | nb_cli_enqueue_change(vty, | |
769 | "./lsp/timers/level-2/maximum-lifetime", | |
770 | NB_OP_MODIFY, lifetime_str); | |
771 | } | |
ea120aa0 | 772 | |
d2c970ff EDP |
773 | return nb_cli_apply_changes(vty, NULL); |
774 | } | |
775 | ||
ca77b518 | 776 | DEFPY_YANG(no_lsp_timers, no_lsp_timers_cmd, |
d2c970ff EDP |
777 | "no lsp-timers [level-1|level-2]$level [gen-interval (1-120) refresh-interval (1-65235) max-lifetime (350-65535)]", |
778 | NO_STR | |
779 | "LSP-related timers\n" | |
780 | "LSP-related timers for Level 1 only\n" | |
781 | "LSP-related timers for Level 2 only\n" | |
782 | "Minimum interval between regenerating same LSP\n" | |
783 | "Generation interval in seconds\n" | |
784 | "LSP refresh interval\n" | |
785 | "LSP refresh interval in seconds\n" | |
786 | "Maximum LSP lifetime\n" | |
787 | "Maximum LSP lifetime in seconds\n") | |
788 | { | |
789 | if (!level || strmatch(level, "level-1")) { | |
790 | nb_cli_enqueue_change( | |
791 | vty, "./lsp/timers/level-1/generation-interval", | |
792 | NB_OP_MODIFY, NULL); | |
793 | nb_cli_enqueue_change(vty, | |
794 | "./lsp/timers/level-1/refresh-interval", | |
795 | NB_OP_MODIFY, NULL); | |
796 | nb_cli_enqueue_change(vty, | |
797 | "./lsp/timers/level-1/maximum-lifetime", | |
798 | NB_OP_MODIFY, NULL); | |
799 | } | |
800 | if (!level || strmatch(level, "level-2")) { | |
801 | nb_cli_enqueue_change( | |
802 | vty, "./lsp/timers/level-2/generation-interval", | |
803 | NB_OP_MODIFY, NULL); | |
804 | nb_cli_enqueue_change(vty, | |
805 | "./lsp/timers/level-2/refresh-interval", | |
806 | NB_OP_MODIFY, NULL); | |
807 | nb_cli_enqueue_change(vty, | |
808 | "./lsp/timers/level-2/maximum-lifetime", | |
809 | NB_OP_MODIFY, NULL); | |
810 | } | |
811 | ||
812 | return nb_cli_apply_changes(vty, NULL); | |
813 | } | |
814 | ||
25605051 | 815 | void cli_show_isis_lsp_timers(struct vty *vty, const struct lyd_node *dnode, |
d2c970ff EDP |
816 | bool show_defaults) |
817 | { | |
818 | const char *l1_refresh = | |
819 | yang_dnode_get_string(dnode, "./level-1/refresh-interval"); | |
820 | const char *l2_refresh = | |
821 | yang_dnode_get_string(dnode, "./level-2/refresh-interval"); | |
822 | const char *l1_lifetime = | |
823 | yang_dnode_get_string(dnode, "./level-1/maximum-lifetime"); | |
824 | const char *l2_lifetime = | |
825 | yang_dnode_get_string(dnode, "./level-2/maximum-lifetime"); | |
826 | const char *l1_gen = | |
827 | yang_dnode_get_string(dnode, "./level-1/generation-interval"); | |
828 | const char *l2_gen = | |
829 | yang_dnode_get_string(dnode, "./level-2/generation-interval"); | |
830 | if (strmatch(l1_refresh, l2_refresh) | |
831 | && strmatch(l1_lifetime, l2_lifetime) && strmatch(l1_gen, l2_gen)) | |
832 | vty_out(vty, | |
833 | " lsp-timers gen-interval %s refresh-interval %s max-lifetime %s\n", | |
834 | l1_gen, l1_refresh, l1_lifetime); | |
ea120aa0 | 835 | else { |
d2c970ff EDP |
836 | vty_out(vty, |
837 | " lsp-timers level-1 gen-interval %s refresh-interval %s max-lifetime %s\n", | |
838 | l1_gen, l1_refresh, l1_lifetime); | |
839 | vty_out(vty, | |
840 | " lsp-timers level-2 gen-interval %s refresh-interval %s max-lifetime %s\n", | |
841 | l2_gen, l2_refresh, l2_lifetime); | |
ea120aa0 EDP |
842 | } |
843 | } | |
844 | ||
27a45d16 EDP |
845 | /* |
846 | * XPath: /frr-isisd:isis/instance/lsp/mtu | |
847 | */ | |
ca77b518 | 848 | DEFPY_YANG(area_lsp_mtu, area_lsp_mtu_cmd, "lsp-mtu (128-4352)$val", |
27a45d16 EDP |
849 | "Configure the maximum size of generated LSPs\n" |
850 | "Maximum size of generated LSPs\n") | |
851 | { | |
852 | nb_cli_enqueue_change(vty, "./lsp/mtu", NB_OP_MODIFY, val_str); | |
853 | ||
854 | return nb_cli_apply_changes(vty, NULL); | |
855 | } | |
856 | ||
ca77b518 | 857 | DEFPY_YANG(no_area_lsp_mtu, no_area_lsp_mtu_cmd, "no lsp-mtu [(128-4352)]", |
27a45d16 EDP |
858 | NO_STR |
859 | "Configure the maximum size of generated LSPs\n" | |
860 | "Maximum size of generated LSPs\n") | |
861 | { | |
862 | nb_cli_enqueue_change(vty, "./lsp/mtu", NB_OP_MODIFY, NULL); | |
863 | ||
864 | return nb_cli_apply_changes(vty, NULL); | |
865 | } | |
866 | ||
25605051 | 867 | void cli_show_isis_lsp_mtu(struct vty *vty, const struct lyd_node *dnode, |
27a45d16 EDP |
868 | bool show_defaults) |
869 | { | |
870 | vty_out(vty, " lsp-mtu %s\n", yang_dnode_get_string(dnode, NULL)); | |
871 | } | |
872 | ||
dcb1dcd6 EDP |
873 | /* |
874 | * XPath: /frr-isisd:isis/instance/spf/minimum-interval | |
875 | */ | |
ca77b518 | 876 | DEFPY_YANG(spf_interval, spf_interval_cmd, |
dcb1dcd6 EDP |
877 | "spf-interval [level-1|level-2]$level (1-120)$val", |
878 | "Minimum interval between SPF calculations\n" | |
879 | "Set interval for level 1 only\n" | |
880 | "Set interval for level 2 only\n" | |
881 | "Minimum interval between consecutive SPFs in seconds\n") | |
882 | { | |
883 | if (!level || strmatch(level, "level-1")) | |
884 | nb_cli_enqueue_change(vty, "./spf/minimum-interval/level-1", | |
885 | NB_OP_MODIFY, val_str); | |
886 | if (!level || strmatch(level, "level-2")) | |
887 | nb_cli_enqueue_change(vty, "./spf/minimum-interval/level-2", | |
888 | NB_OP_MODIFY, val_str); | |
889 | ||
890 | return nb_cli_apply_changes(vty, NULL); | |
891 | } | |
892 | ||
ca77b518 | 893 | DEFPY_YANG(no_spf_interval, no_spf_interval_cmd, |
dcb1dcd6 EDP |
894 | "no spf-interval [level-1|level-2]$level [(1-120)]", |
895 | NO_STR | |
896 | "Minimum interval between SPF calculations\n" | |
897 | "Set interval for level 1 only\n" | |
898 | "Set interval for level 2 only\n" | |
899 | "Minimum interval between consecutive SPFs in seconds\n") | |
900 | { | |
901 | if (!level || strmatch(level, "level-1")) | |
902 | nb_cli_enqueue_change(vty, "./spf/minimum-interval/level-1", | |
903 | NB_OP_MODIFY, NULL); | |
904 | if (!level || strmatch(level, "level-2")) | |
905 | nb_cli_enqueue_change(vty, "./spf/minimum-interval/level-2", | |
906 | NB_OP_MODIFY, NULL); | |
907 | ||
908 | return nb_cli_apply_changes(vty, NULL); | |
909 | } | |
910 | ||
25605051 IR |
911 | void cli_show_isis_spf_min_interval(struct vty *vty, |
912 | const struct lyd_node *dnode, | |
dcb1dcd6 EDP |
913 | bool show_defaults) |
914 | { | |
915 | const char *l1 = yang_dnode_get_string(dnode, "./level-1"); | |
916 | const char *l2 = yang_dnode_get_string(dnode, "./level-2"); | |
917 | ||
918 | if (strmatch(l1, l2)) | |
919 | vty_out(vty, " spf-interval %s\n", l1); | |
920 | else { | |
921 | vty_out(vty, " spf-interval level-1 %s\n", l1); | |
922 | vty_out(vty, " spf-interval level-2 %s\n", l2); | |
923 | } | |
924 | } | |
925 | ||
5336ba30 EDP |
926 | /* |
927 | * XPath: /frr-isisd:isis/instance/spf/ietf-backoff-delay | |
928 | */ | |
ca77b518 | 929 | DEFPY_YANG(spf_delay_ietf, spf_delay_ietf_cmd, |
5336ba30 EDP |
930 | "spf-delay-ietf init-delay (0-60000) short-delay (0-60000) long-delay (0-60000) holddown (0-60000) time-to-learn (0-60000)", |
931 | "IETF SPF delay algorithm\n" | |
932 | "Delay used while in QUIET state\n" | |
933 | "Delay used while in QUIET state in milliseconds\n" | |
934 | "Delay used while in SHORT_WAIT state\n" | |
935 | "Delay used while in SHORT_WAIT state in milliseconds\n" | |
936 | "Delay used while in LONG_WAIT\n" | |
937 | "Delay used while in LONG_WAIT state in milliseconds\n" | |
938 | "Time with no received IGP events before considering IGP stable\n" | |
939 | "Time with no received IGP events before considering IGP stable (in milliseconds)\n" | |
940 | "Maximum duration needed to learn all the events related to a single failure\n" | |
941 | "Maximum duration needed to learn all the events related to a single failure (in milliseconds)\n") | |
942 | { | |
943 | nb_cli_enqueue_change(vty, "./spf/ietf-backoff-delay", NB_OP_CREATE, | |
944 | NULL); | |
945 | nb_cli_enqueue_change(vty, "./spf/ietf-backoff-delay/init-delay", | |
946 | NB_OP_MODIFY, init_delay_str); | |
947 | nb_cli_enqueue_change(vty, "./spf/ietf-backoff-delay/short-delay", | |
948 | NB_OP_MODIFY, short_delay_str); | |
949 | nb_cli_enqueue_change(vty, "./spf/ietf-backoff-delay/long-delay", | |
950 | NB_OP_MODIFY, long_delay_str); | |
951 | nb_cli_enqueue_change(vty, "./spf/ietf-backoff-delay/hold-down", | |
952 | NB_OP_MODIFY, holddown_str); | |
953 | nb_cli_enqueue_change(vty, "./spf/ietf-backoff-delay/time-to-learn", | |
954 | NB_OP_MODIFY, time_to_learn_str); | |
955 | ||
956 | return nb_cli_apply_changes(vty, NULL); | |
957 | } | |
958 | ||
ca77b518 | 959 | DEFPY_YANG(no_spf_delay_ietf, no_spf_delay_ietf_cmd, |
5336ba30 EDP |
960 | "no spf-delay-ietf [init-delay (0-60000) short-delay (0-60000) long-delay (0-60000) holddown (0-60000) time-to-learn (0-60000)]", |
961 | NO_STR | |
f34ab52d | 962 | "IETF SPF delay algorithm\n" |
5336ba30 EDP |
963 | "Delay used while in QUIET state\n" |
964 | "Delay used while in QUIET state in milliseconds\n" | |
965 | "Delay used while in SHORT_WAIT state\n" | |
966 | "Delay used while in SHORT_WAIT state in milliseconds\n" | |
967 | "Delay used while in LONG_WAIT\n" | |
968 | "Delay used while in LONG_WAIT state in milliseconds\n" | |
969 | "Time with no received IGP events before considering IGP stable\n" | |
970 | "Time with no received IGP events before considering IGP stable (in milliseconds)\n" | |
971 | "Maximum duration needed to learn all the events related to a single failure\n" | |
972 | "Maximum duration needed to learn all the events related to a single failure (in milliseconds)\n") | |
973 | { | |
95ce849b | 974 | nb_cli_enqueue_change(vty, "./spf/ietf-backoff-delay", NB_OP_DESTROY, |
5336ba30 EDP |
975 | NULL); |
976 | ||
977 | return nb_cli_apply_changes(vty, NULL); | |
978 | } | |
979 | ||
25605051 IR |
980 | void cli_show_isis_spf_ietf_backoff(struct vty *vty, |
981 | const struct lyd_node *dnode, | |
5336ba30 EDP |
982 | bool show_defaults) |
983 | { | |
984 | vty_out(vty, | |
985 | " spf-delay-ietf init-delay %s short-delay %s long-delay %s holddown %s time-to-learn %s\n", | |
986 | yang_dnode_get_string(dnode, "./init-delay"), | |
987 | yang_dnode_get_string(dnode, "./short-delay"), | |
988 | yang_dnode_get_string(dnode, "./long-delay"), | |
989 | yang_dnode_get_string(dnode, "./hold-down"), | |
990 | yang_dnode_get_string(dnode, "./time-to-learn")); | |
991 | } | |
992 | ||
d20b14bc RW |
993 | /* |
994 | * XPath: /frr-isisd:isis/instance/spf/prefix-priorities/medium/access-list-name | |
995 | */ | |
996 | DEFPY_YANG(spf_prefix_priority, spf_prefix_priority_cmd, | |
c60dec36 | 997 | "spf prefix-priority <critical|high|medium>$priority ACCESSLIST_NAME$acl_name", |
d20b14bc RW |
998 | "SPF configuration\n" |
999 | "Configure a prefix priority list\n" | |
1000 | "Specify critical priority prefixes\n" | |
1001 | "Specify high priority prefixes\n" | |
1002 | "Specify medium priority prefixes\n" | |
1003 | "Access-list name\n") | |
1004 | { | |
1005 | char xpath[XPATH_MAXLEN]; | |
1006 | ||
1007 | snprintf(xpath, XPATH_MAXLEN, | |
1008 | "./spf/prefix-priorities/%s/access-list-name", priority); | |
1009 | nb_cli_enqueue_change(vty, xpath, NB_OP_CREATE, acl_name); | |
1010 | ||
1011 | return nb_cli_apply_changes(vty, NULL); | |
1012 | } | |
1013 | ||
1014 | DEFPY_YANG(no_spf_prefix_priority, no_spf_prefix_priority_cmd, | |
c60dec36 | 1015 | "no spf prefix-priority <critical|high|medium>$priority [ACCESSLIST_NAME]", |
d20b14bc RW |
1016 | NO_STR |
1017 | "SPF configuration\n" | |
1018 | "Configure a prefix priority list\n" | |
1019 | "Specify critical priority prefixes\n" | |
1020 | "Specify high priority prefixes\n" | |
1021 | "Specify medium priority prefixes\n" | |
1022 | "Access-list name\n") | |
1023 | { | |
1024 | char xpath[XPATH_MAXLEN]; | |
1025 | ||
1026 | snprintf(xpath, XPATH_MAXLEN, | |
1027 | "./spf/prefix-priorities/%s/access-list-name", priority); | |
1028 | nb_cli_enqueue_change(vty, xpath, NB_OP_DESTROY, NULL); | |
1029 | ||
1030 | return nb_cli_apply_changes(vty, NULL); | |
1031 | } | |
1032 | ||
25605051 IR |
1033 | void cli_show_isis_spf_prefix_priority(struct vty *vty, |
1034 | const struct lyd_node *dnode, | |
d20b14bc RW |
1035 | bool show_defaults) |
1036 | { | |
1037 | vty_out(vty, " spf prefix-priority %s %s\n", | |
1038 | dnode->parent->schema->name, | |
1039 | yang_dnode_get_string(dnode, NULL)); | |
1040 | } | |
1041 | ||
66e45e10 EDP |
1042 | /* |
1043 | * XPath: /frr-isisd:isis/instance/purge-originator | |
1044 | */ | |
ca77b518 | 1045 | DEFPY_YANG(area_purge_originator, area_purge_originator_cmd, "[no] purge-originator", |
66e45e10 EDP |
1046 | NO_STR "Use the RFC 6232 purge-originator\n") |
1047 | { | |
5f1e5e3f EDP |
1048 | nb_cli_enqueue_change(vty, "./purge-originator", NB_OP_MODIFY, |
1049 | no ? "false" : "true"); | |
66e45e10 EDP |
1050 | |
1051 | return nb_cli_apply_changes(vty, NULL); | |
1052 | } | |
1053 | ||
25605051 | 1054 | void cli_show_isis_purge_origin(struct vty *vty, const struct lyd_node *dnode, |
66e45e10 EDP |
1055 | bool show_defaults) |
1056 | { | |
5f1e5e3f EDP |
1057 | if (!yang_dnode_get_bool(dnode, NULL)) |
1058 | vty_out(vty, " no"); | |
66e45e10 EDP |
1059 | vty_out(vty, " purge-originator\n"); |
1060 | } | |
1061 | ||
d1a80ef6 | 1062 | /* |
2e2a8b91 | 1063 | * XPath: /frr-isisd:isis/instance/mpls-te |
d1a80ef6 | 1064 | */ |
ca77b518 | 1065 | DEFPY_YANG(isis_mpls_te_on, isis_mpls_te_on_cmd, "mpls-te on", |
d1a80ef6 EDP |
1066 | MPLS_TE_STR "Enable the MPLS-TE functionality\n") |
1067 | { | |
2e2a8b91 | 1068 | nb_cli_enqueue_change(vty, "./mpls-te", NB_OP_CREATE, |
d1a80ef6 EDP |
1069 | NULL); |
1070 | ||
1071 | return nb_cli_apply_changes(vty, NULL); | |
1072 | } | |
1073 | ||
ca77b518 | 1074 | DEFPY_YANG(no_isis_mpls_te_on, no_isis_mpls_te_on_cmd, "no mpls-te [on]", |
d1a80ef6 EDP |
1075 | NO_STR |
1076 | "Disable the MPLS-TE functionality\n" | |
2e2a8b91 | 1077 | "Disable the MPLS-TE functionality\n") |
d1a80ef6 | 1078 | { |
2e2a8b91 | 1079 | nb_cli_enqueue_change(vty, "./mpls-te", NB_OP_DESTROY, |
d1a80ef6 EDP |
1080 | NULL); |
1081 | ||
1082 | return nb_cli_apply_changes(vty, NULL); | |
1083 | } | |
1084 | ||
25605051 | 1085 | void cli_show_isis_mpls_te(struct vty *vty, const struct lyd_node *dnode, |
d1a80ef6 EDP |
1086 | bool show_defaults) |
1087 | { | |
dab1fb8d | 1088 | vty_out(vty, " mpls-te on\n"); |
d1a80ef6 EDP |
1089 | } |
1090 | ||
1091 | /* | |
2e2a8b91 | 1092 | * XPath: /frr-isisd:isis/instance/mpls-te/router-address |
d1a80ef6 | 1093 | */ |
ca77b518 | 1094 | DEFPY_YANG(isis_mpls_te_router_addr, isis_mpls_te_router_addr_cmd, |
d1a80ef6 EDP |
1095 | "mpls-te router-address A.B.C.D", |
1096 | MPLS_TE_STR | |
1097 | "Stable IP address of the advertising router\n" | |
1098 | "MPLS-TE router address in IPv4 address format\n") | |
1099 | { | |
2e2a8b91 | 1100 | nb_cli_enqueue_change(vty, "./mpls-te/router-address", |
d1a80ef6 EDP |
1101 | NB_OP_MODIFY, router_address_str); |
1102 | ||
1103 | return nb_cli_apply_changes(vty, NULL); | |
1104 | } | |
1105 | ||
ca77b518 | 1106 | DEFPY_YANG(no_isis_mpls_te_router_addr, no_isis_mpls_te_router_addr_cmd, |
2e2a8b91 OD |
1107 | "no mpls-te router-address [A.B.C.D]", |
1108 | NO_STR MPLS_TE_STR | |
1109 | "Delete IP address of the advertising router\n" | |
1110 | "MPLS-TE router address in IPv4 address format\n") | |
1111 | { | |
1112 | nb_cli_enqueue_change(vty, "./mpls-te/router-address", | |
1113 | NB_OP_DESTROY, NULL); | |
1114 | ||
1115 | return nb_cli_apply_changes(vty, NULL); | |
1116 | } | |
1117 | ||
25605051 IR |
1118 | void cli_show_isis_mpls_te_router_addr(struct vty *vty, |
1119 | const struct lyd_node *dnode, | |
d1a80ef6 EDP |
1120 | bool show_defaults) |
1121 | { | |
dab1fb8d | 1122 | vty_out(vty, " mpls-te router-address %s\n", |
d1a80ef6 EDP |
1123 | yang_dnode_get_string(dnode, NULL)); |
1124 | } | |
1125 | ||
173f8887 OD |
1126 | /* |
1127 | * XPath: /frr-isisd:isis/instance/mpls-te/router-address-v6 | |
1128 | */ | |
1129 | DEFPY_YANG(isis_mpls_te_router_addr_v6, isis_mpls_te_router_addr_v6_cmd, | |
1130 | "mpls-te router-address ipv6 X:X::X:X", | |
1131 | MPLS_TE_STR | |
1132 | "Stable IP address of the advertising router\n" | |
1133 | "IPv6 address\n" | |
1134 | "MPLS-TE router address in IPv6 address format\n") | |
1135 | { | |
1136 | nb_cli_enqueue_change(vty, "./mpls-te/router-address-v6", NB_OP_MODIFY, | |
1137 | ipv6_str); | |
1138 | ||
1139 | return nb_cli_apply_changes(vty, NULL); | |
1140 | } | |
1141 | ||
1142 | DEFPY_YANG(no_isis_mpls_te_router_addr_v6, no_isis_mpls_te_router_addr_v6_cmd, | |
1143 | "no mpls-te router-address ipv6 [X:X::X:X]", | |
1144 | NO_STR MPLS_TE_STR | |
1145 | "Delete IP address of the advertising router\n" | |
1146 | "IPv6 address\n" | |
1147 | "MPLS-TE router address in IPv6 address format\n") | |
1148 | { | |
1149 | nb_cli_enqueue_change(vty, "./mpls-te/router-address-v6", NB_OP_DESTROY, | |
1150 | NULL); | |
1151 | ||
1152 | return nb_cli_apply_changes(vty, NULL); | |
1153 | } | |
1154 | ||
1155 | void cli_show_isis_mpls_te_router_addr_ipv6(struct vty *vty, | |
1156 | const struct lyd_node *dnode, | |
1157 | bool show_defaults) | |
1158 | { | |
1159 | vty_out(vty, " mpls-te router-address ipv6 %s\n", | |
1160 | yang_dnode_get_string(dnode, NULL)); | |
1161 | } | |
1162 | ||
ca77b518 | 1163 | DEFPY_YANG(isis_mpls_te_inter_as, isis_mpls_te_inter_as_cmd, |
d1a80ef6 EDP |
1164 | "[no] mpls-te inter-as [level-1|level-1-2|level-2-only]", |
1165 | NO_STR MPLS_TE_STR | |
1166 | "Configure MPLS-TE Inter-AS support\n" | |
1167 | "AREA native mode self originate INTER-AS LSP with L1 only flooding scope\n" | |
1168 | "AREA native mode self originate INTER-AS LSP with L1 and L2 flooding scope\n" | |
1169 | "AS native mode self originate INTER-AS LSP with L2 only flooding scope\n") | |
1170 | { | |
2e2a8b91 | 1171 | vty_out(vty, "MPLS-TE Inter-AS is not yet supported\n"); |
d1a80ef6 EDP |
1172 | return CMD_SUCCESS; |
1173 | } | |
1174 | ||
ed6189a9 OD |
1175 | /* |
1176 | * XPath: /frr-isisd:isis/instance/mpls-te/export | |
1177 | */ | |
1178 | DEFPY_YANG(isis_mpls_te_export, isis_mpls_te_export_cmd, "mpls-te export", | |
1179 | MPLS_TE_STR "Enable export of MPLS-TE Link State information\n") | |
1180 | { | |
1181 | nb_cli_enqueue_change(vty, "./mpls-te/export", NB_OP_MODIFY, "true"); | |
1182 | ||
1183 | return nb_cli_apply_changes(vty, NULL); | |
1184 | } | |
1185 | ||
1186 | DEFPY_YANG(no_isis_mpls_te_export, no_isis_mpls_te_export_cmd, | |
1187 | "no mpls-te export", | |
1188 | NO_STR MPLS_TE_STR | |
1189 | "Disable export of MPLS-TE Link State information\n") | |
1190 | { | |
1191 | nb_cli_enqueue_change(vty, "./mpls-te/export", NB_OP_MODIFY, "false"); | |
1192 | ||
1193 | return nb_cli_apply_changes(vty, NULL); | |
1194 | } | |
1195 | ||
1196 | void cli_show_isis_mpls_te_export(struct vty *vty, const struct lyd_node *dnode, | |
1197 | bool show_defaults) | |
1198 | { | |
1199 | if (!yang_dnode_get_bool(dnode, NULL)) | |
1200 | vty_out(vty, " no"); | |
1201 | ||
1202 | vty_out(vty, " mpls-te export\n"); | |
1203 | } | |
1204 | ||
8b104c10 EDP |
1205 | /* |
1206 | * XPath: /frr-isisd:isis/instance/default-information-originate | |
1207 | */ | |
ca77b518 | 1208 | DEFPY_YANG(isis_default_originate, isis_default_originate_cmd, |
3efd0893 | 1209 | "[no] default-information originate <ipv4|ipv6>$ip <level-1|level-2>$level [always]$always [{metric (0-16777215)$metric|route-map WORD$rmap}]", |
8b104c10 EDP |
1210 | NO_STR |
1211 | "Control distribution of default information\n" | |
1212 | "Distribute a default route\n" | |
1213 | "Distribute default route for IPv4\n" | |
1214 | "Distribute default route for IPv6\n" | |
1215 | "Distribute default route into level-1\n" | |
1216 | "Distribute default route into level-2\n" | |
1217 | "Always advertise default route\n" | |
1218 | "Metric for default route\n" | |
6aa15aeb | 1219 | "IS-IS default metric\n" |
8b104c10 EDP |
1220 | "Route map reference\n" |
1221 | "Pointer to route-map entries\n") | |
1222 | { | |
1223 | if (no) | |
95ce849b | 1224 | nb_cli_enqueue_change(vty, ".", NB_OP_DESTROY, NULL); |
8b104c10 EDP |
1225 | else { |
1226 | nb_cli_enqueue_change(vty, ".", NB_OP_CREATE, NULL); | |
5f1e5e3f EDP |
1227 | nb_cli_enqueue_change(vty, "./always", NB_OP_MODIFY, |
1228 | always ? "true" : "false"); | |
8b104c10 | 1229 | nb_cli_enqueue_change(vty, "./route-map", |
95ce849b | 1230 | rmap ? NB_OP_MODIFY : NB_OP_DESTROY, |
8b104c10 | 1231 | rmap ? rmap : NULL); |
82c25998 DT |
1232 | nb_cli_enqueue_change(vty, "./metric", NB_OP_MODIFY, |
1233 | metric_str ? metric_str : NULL); | |
8b104c10 EDP |
1234 | if (strmatch(ip, "ipv6") && !always) { |
1235 | vty_out(vty, | |
1236 | "Zebra doesn't implement default-originate for IPv6 yet\n"); | |
1237 | vty_out(vty, | |
1238 | "so use with care or use default-originate always.\n"); | |
1239 | } | |
1240 | } | |
1241 | ||
1242 | return nb_cli_apply_changes( | |
1243 | vty, "./default-information-originate/%s[level='%s']", ip, | |
1244 | level); | |
1245 | } | |
1246 | ||
25605051 | 1247 | static void vty_print_def_origin(struct vty *vty, const struct lyd_node *dnode, |
f34ab52d EDP |
1248 | const char *family, const char *level, |
1249 | bool show_defaults) | |
8b104c10 | 1250 | { |
8b104c10 | 1251 | vty_out(vty, " default-information originate %s %s", family, level); |
5f1e5e3f | 1252 | if (yang_dnode_get_bool(dnode, "./always")) |
8b104c10 EDP |
1253 | vty_out(vty, " always"); |
1254 | ||
1255 | if (yang_dnode_exists(dnode, "./route-map")) | |
1256 | vty_out(vty, " route-map %s", | |
1257 | yang_dnode_get_string(dnode, "./route-map")); | |
82c25998 DT |
1258 | if (show_defaults || !yang_dnode_is_default(dnode, "./metric")) |
1259 | vty_out(vty, " metric %s", | |
1260 | yang_dnode_get_string(dnode, "./metric")); | |
1261 | ||
8b104c10 EDP |
1262 | vty_out(vty, "\n"); |
1263 | } | |
1264 | ||
25605051 IR |
1265 | void cli_show_isis_def_origin_ipv4(struct vty *vty, |
1266 | const struct lyd_node *dnode, | |
8b104c10 EDP |
1267 | bool show_defaults) |
1268 | { | |
1269 | const char *level = yang_dnode_get_string(dnode, "./level"); | |
1270 | ||
1271 | vty_print_def_origin(vty, dnode, "ipv4", level, show_defaults); | |
1272 | } | |
1273 | ||
25605051 IR |
1274 | void cli_show_isis_def_origin_ipv6(struct vty *vty, |
1275 | const struct lyd_node *dnode, | |
8b104c10 EDP |
1276 | bool show_defaults) |
1277 | { | |
1278 | const char *level = yang_dnode_get_string(dnode, "./level"); | |
1279 | ||
1280 | vty_print_def_origin(vty, dnode, "ipv6", level, show_defaults); | |
1281 | } | |
1282 | ||
a041ac8e EDP |
1283 | /* |
1284 | * XPath: /frr-isisd:isis/instance/redistribute | |
1285 | */ | |
ca77b518 | 1286 | DEFPY_YANG(isis_redistribute, isis_redistribute_cmd, |
1bfee936 IR |
1287 | "[no] redistribute <ipv4$ip " PROTO_IP_REDIST_STR "$proto|ipv6$ip " |
1288 | PROTO_IP6_REDIST_STR "$proto> <level-1|level-2>$level" | |
1289 | "[{metric (0-16777215)|route-map WORD}]", | |
a041ac8e EDP |
1290 | NO_STR REDIST_STR |
1291 | "Redistribute IPv4 routes\n" | |
1bfee936 IR |
1292 | PROTO_IP_REDIST_HELP |
1293 | "Redistribute IPv6 routes\n" | |
1294 | PROTO_IP6_REDIST_HELP | |
a041ac8e EDP |
1295 | "Redistribute into level-1\n" |
1296 | "Redistribute into level-2\n" | |
1297 | "Metric for redistributed routes\n" | |
6aa15aeb | 1298 | "IS-IS default metric\n" |
a041ac8e EDP |
1299 | "Route map reference\n" |
1300 | "Pointer to route-map entries\n") | |
1301 | { | |
1302 | if (no) | |
95ce849b | 1303 | nb_cli_enqueue_change(vty, ".", NB_OP_DESTROY, NULL); |
a041ac8e EDP |
1304 | else { |
1305 | nb_cli_enqueue_change(vty, ".", NB_OP_CREATE, NULL); | |
1306 | nb_cli_enqueue_change(vty, "./route-map", | |
95ce849b | 1307 | route_map ? NB_OP_MODIFY : NB_OP_DESTROY, |
a041ac8e | 1308 | route_map ? route_map : NULL); |
82c25998 DT |
1309 | nb_cli_enqueue_change(vty, "./metric", NB_OP_MODIFY, |
1310 | metric_str ? metric_str : NULL); | |
a041ac8e EDP |
1311 | } |
1312 | ||
1313 | return nb_cli_apply_changes( | |
1314 | vty, "./redistribute/%s[protocol='%s'][level='%s']", ip, proto, | |
1315 | level); | |
1316 | } | |
1317 | ||
25605051 IR |
1318 | static void vty_print_redistribute(struct vty *vty, |
1319 | const struct lyd_node *dnode, | |
82c25998 | 1320 | bool show_defaults, const char *family) |
a041ac8e EDP |
1321 | { |
1322 | const char *level = yang_dnode_get_string(dnode, "./level"); | |
1323 | const char *protocol = yang_dnode_get_string(dnode, "./protocol"); | |
1324 | ||
1325 | vty_out(vty, " redistribute %s %s %s", family, protocol, level); | |
82c25998 | 1326 | if (show_defaults || !yang_dnode_is_default(dnode, "./metric")) |
a041ac8e EDP |
1327 | vty_out(vty, " metric %s", |
1328 | yang_dnode_get_string(dnode, "./metric")); | |
82c25998 | 1329 | if (yang_dnode_exists(dnode, "./route-map")) |
a041ac8e EDP |
1330 | vty_out(vty, " route-map %s", |
1331 | yang_dnode_get_string(dnode, "./route-map")); | |
1332 | vty_out(vty, "\n"); | |
1333 | } | |
1334 | ||
25605051 IR |
1335 | void cli_show_isis_redistribute_ipv4(struct vty *vty, |
1336 | const struct lyd_node *dnode, | |
a041ac8e EDP |
1337 | bool show_defaults) |
1338 | { | |
82c25998 | 1339 | vty_print_redistribute(vty, dnode, show_defaults, "ipv4"); |
a041ac8e | 1340 | } |
25605051 IR |
1341 | void cli_show_isis_redistribute_ipv6(struct vty *vty, |
1342 | const struct lyd_node *dnode, | |
a041ac8e EDP |
1343 | bool show_defaults) |
1344 | { | |
82c25998 | 1345 | vty_print_redistribute(vty, dnode, show_defaults, "ipv6"); |
a041ac8e EDP |
1346 | } |
1347 | ||
22af6a80 EDP |
1348 | /* |
1349 | * XPath: /frr-isisd:isis/instance/multi-topology | |
1350 | */ | |
ca77b518 | 1351 | DEFPY_YANG(isis_topology, isis_topology_cmd, |
3efd0893 | 1352 | "[no] topology <ipv4-unicast|ipv4-mgmt|ipv6-unicast|ipv4-multicast|ipv6-multicast|ipv6-mgmt|ipv6-dstsrc>$topology [overload]$overload", |
22af6a80 EDP |
1353 | NO_STR |
1354 | "Configure IS-IS topologies\n" | |
1355 | "IPv4 unicast topology\n" | |
1356 | "IPv4 management topology\n" | |
1357 | "IPv6 unicast topology\n" | |
1358 | "IPv4 multicast topology\n" | |
1359 | "IPv6 multicast topology\n" | |
1360 | "IPv6 management topology\n" | |
1361 | "IPv6 dst-src topology\n" | |
1362 | "Set overload bit for topology\n") | |
1363 | { | |
1364 | char base_xpath[XPATH_MAXLEN]; | |
1365 | ||
1366 | /* Since IPv4-unicast is not configurable it is not present in the | |
1367 | * YANG model, so we need to validate it here | |
1368 | */ | |
1369 | if (strmatch(topology, "ipv4-unicast")) { | |
1370 | vty_out(vty, "Cannot configure IPv4 unicast topology\n"); | |
1371 | return CMD_WARNING_CONFIG_FAILED; | |
1372 | } | |
1373 | ||
1374 | if (strmatch(topology, "ipv4-mgmt")) | |
1375 | snprintf(base_xpath, XPATH_MAXLEN, | |
1376 | "./multi-topology/ipv4-management"); | |
1377 | else if (strmatch(topology, "ipv6-mgmt")) | |
1378 | snprintf(base_xpath, XPATH_MAXLEN, | |
1379 | "./multi-topology/ipv6-management"); | |
1380 | else | |
1381 | snprintf(base_xpath, XPATH_MAXLEN, "./multi-topology/%s", | |
1382 | topology); | |
1383 | ||
1384 | if (no) | |
95ce849b | 1385 | nb_cli_enqueue_change(vty, ".", NB_OP_DESTROY, NULL); |
22af6a80 EDP |
1386 | else { |
1387 | nb_cli_enqueue_change(vty, ".", NB_OP_CREATE, NULL); | |
5f1e5e3f EDP |
1388 | nb_cli_enqueue_change(vty, "./overload", NB_OP_MODIFY, |
1389 | overload ? "true" : "false"); | |
22af6a80 EDP |
1390 | } |
1391 | ||
1392 | return nb_cli_apply_changes(vty, base_xpath); | |
1393 | } | |
1394 | ||
25605051 IR |
1395 | void cli_show_isis_mt_ipv4_multicast(struct vty *vty, |
1396 | const struct lyd_node *dnode, | |
22af6a80 EDP |
1397 | bool show_defaults) |
1398 | { | |
1399 | vty_out(vty, " topology ipv4-multicast"); | |
5f1e5e3f | 1400 | if (yang_dnode_get_bool(dnode, "./overload")) |
22af6a80 EDP |
1401 | vty_out(vty, " overload"); |
1402 | vty_out(vty, "\n"); | |
1403 | } | |
1404 | ||
25605051 | 1405 | void cli_show_isis_mt_ipv4_mgmt(struct vty *vty, const struct lyd_node *dnode, |
22af6a80 EDP |
1406 | bool show_defaults) |
1407 | { | |
1408 | vty_out(vty, " topology ipv4-mgmt"); | |
5f1e5e3f | 1409 | if (yang_dnode_get_bool(dnode, "./overload")) |
22af6a80 EDP |
1410 | vty_out(vty, " overload"); |
1411 | vty_out(vty, "\n"); | |
1412 | } | |
1413 | ||
25605051 IR |
1414 | void cli_show_isis_mt_ipv6_unicast(struct vty *vty, |
1415 | const struct lyd_node *dnode, | |
22af6a80 EDP |
1416 | bool show_defaults) |
1417 | { | |
1418 | vty_out(vty, " topology ipv6-unicast"); | |
5f1e5e3f | 1419 | if (yang_dnode_get_bool(dnode, "./overload")) |
22af6a80 EDP |
1420 | vty_out(vty, " overload"); |
1421 | vty_out(vty, "\n"); | |
1422 | } | |
1423 | ||
25605051 IR |
1424 | void cli_show_isis_mt_ipv6_multicast(struct vty *vty, |
1425 | const struct lyd_node *dnode, | |
22af6a80 EDP |
1426 | bool show_defaults) |
1427 | { | |
1428 | vty_out(vty, " topology ipv6-multicast"); | |
5f1e5e3f | 1429 | if (yang_dnode_get_bool(dnode, "./overload")) |
22af6a80 EDP |
1430 | vty_out(vty, " overload"); |
1431 | vty_out(vty, "\n"); | |
1432 | } | |
1433 | ||
25605051 | 1434 | void cli_show_isis_mt_ipv6_mgmt(struct vty *vty, const struct lyd_node *dnode, |
22af6a80 EDP |
1435 | bool show_defaults) |
1436 | { | |
1437 | vty_out(vty, " topology ipv6-mgmt"); | |
5f1e5e3f | 1438 | if (yang_dnode_get_bool(dnode, "./overload")) |
22af6a80 EDP |
1439 | vty_out(vty, " overload"); |
1440 | vty_out(vty, "\n"); | |
1441 | } | |
1442 | ||
25605051 | 1443 | void cli_show_isis_mt_ipv6_dstsrc(struct vty *vty, const struct lyd_node *dnode, |
22af6a80 EDP |
1444 | bool show_defaults) |
1445 | { | |
1446 | vty_out(vty, " topology ipv6-dstsrc"); | |
5f1e5e3f | 1447 | if (yang_dnode_get_bool(dnode, "./overload")) |
22af6a80 EDP |
1448 | vty_out(vty, " overload"); |
1449 | vty_out(vty, "\n"); | |
1450 | } | |
1451 | ||
8f6c8936 RW |
1452 | /* |
1453 | * XPath: /frr-isisd:isis/instance/segment-routing/enabled | |
1454 | */ | |
ca77b518 | 1455 | DEFPY_YANG (isis_sr_enable, |
8f6c8936 RW |
1456 | isis_sr_enable_cmd, |
1457 | "segment-routing on", | |
1458 | SR_STR | |
1459 | "Enable Segment Routing\n") | |
1460 | { | |
1461 | nb_cli_enqueue_change(vty, "./segment-routing/enabled", NB_OP_MODIFY, | |
1462 | "true"); | |
1463 | ||
1464 | return nb_cli_apply_changes(vty, NULL); | |
1465 | } | |
1466 | ||
ca77b518 | 1467 | DEFPY_YANG (no_isis_sr_enable, |
8f6c8936 RW |
1468 | no_isis_sr_enable_cmd, |
1469 | "no segment-routing [on]", | |
1470 | NO_STR | |
1471 | SR_STR | |
1472 | "Disable Segment Routing\n") | |
1473 | { | |
1474 | nb_cli_enqueue_change(vty, "./segment-routing/enabled", NB_OP_MODIFY, | |
1475 | "false"); | |
1476 | ||
1477 | return nb_cli_apply_changes(vty, NULL); | |
1478 | } | |
1479 | ||
25605051 | 1480 | void cli_show_isis_sr_enabled(struct vty *vty, const struct lyd_node *dnode, |
8f6c8936 RW |
1481 | bool show_defaults) |
1482 | { | |
1483 | if (!yang_dnode_get_bool(dnode, NULL)) | |
1484 | vty_out(vty, " no"); | |
1485 | ||
1486 | vty_out(vty, " segment-routing on\n"); | |
1487 | } | |
1488 | ||
1489 | /* | |
01d43141 | 1490 | * XPath: /frr-isisd:isis/instance/segment-routing/label-block |
8f6c8936 | 1491 | */ |
01d43141 EDP |
1492 | |
1493 | DEFPY_YANG( | |
1494 | isis_sr_global_block_label_range, isis_sr_global_block_label_range_cmd, | |
1495 | "segment-routing global-block (16-1048575)$gb_lower_bound (16-1048575)$gb_upper_bound [local-block (16-1048575)$lb_lower_bound (16-1048575)$lb_upper_bound]", | |
1496 | SR_STR | |
1497 | "Segment Routing Global Block label range\n" | |
1498 | "The lower bound of the global block\n" | |
1499 | "The upper bound of the global block (block size may not exceed 65535)\n" | |
1500 | "Segment Routing Local Block label range\n" | |
1501 | "The lower bound of the local block\n" | |
1502 | "The upper bound of the local block (block size may not exceed 65535)\n") | |
1503 | { | |
1504 | nb_cli_enqueue_change(vty, | |
1505 | "./segment-routing/label-blocks/srgb/lower-bound", | |
1506 | NB_OP_MODIFY, gb_lower_bound_str); | |
1507 | nb_cli_enqueue_change(vty, | |
1508 | "./segment-routing/label-blocks/srgb/upper-bound", | |
1509 | NB_OP_MODIFY, gb_upper_bound_str); | |
1510 | ||
1511 | nb_cli_enqueue_change( | |
1512 | vty, "./segment-routing/label-blocks/srlb/lower-bound", | |
1513 | NB_OP_MODIFY, lb_lower_bound ? lb_lower_bound_str : NULL); | |
1514 | nb_cli_enqueue_change( | |
1515 | vty, "./segment-routing/label-blocks/srlb/upper-bound", | |
1516 | NB_OP_MODIFY, lb_upper_bound ? lb_upper_bound_str : NULL); | |
8f6c8936 RW |
1517 | |
1518 | return nb_cli_apply_changes(vty, NULL); | |
1519 | } | |
1520 | ||
01d43141 EDP |
1521 | DEFPY_YANG(no_isis_sr_global_block_label_range, |
1522 | no_isis_sr_global_block_label_range_cmd, | |
1523 | "no segment-routing global-block [(16-1048575) (16-1048575) local-block (16-1048575) (16-1048575)]", | |
1524 | NO_STR SR_STR | |
1525 | "Segment Routing Global Block label range\n" | |
1526 | "The lower bound of the global block\n" | |
1527 | "The upper bound of the global block (block size may not exceed 65535)\n" | |
1528 | "Segment Routing Local Block label range\n" | |
1529 | "The lower bound of the local block\n" | |
1530 | "The upper bound of the local block (block size may not exceed 65535)\n") | |
8f6c8936 | 1531 | { |
01d43141 EDP |
1532 | nb_cli_enqueue_change(vty, |
1533 | "./segment-routing/label-blocks/srgb/lower-bound", | |
1534 | NB_OP_MODIFY, NULL); | |
1535 | nb_cli_enqueue_change(vty, | |
1536 | "./segment-routing/label-blocks/srgb/upper-bound", | |
1537 | NB_OP_MODIFY, NULL); | |
1538 | nb_cli_enqueue_change(vty, | |
1539 | "./segment-routing/label-blocks/srlb/lower-bound", | |
8f6c8936 | 1540 | NB_OP_MODIFY, NULL); |
01d43141 EDP |
1541 | nb_cli_enqueue_change(vty, |
1542 | "./segment-routing/label-blocks/srlb/upper-bound", | |
8f6c8936 RW |
1543 | NB_OP_MODIFY, NULL); |
1544 | ||
1545 | return nb_cli_apply_changes(vty, NULL); | |
1546 | } | |
1547 | ||
25605051 | 1548 | void cli_show_isis_label_blocks(struct vty *vty, const struct lyd_node *dnode, |
01d43141 | 1549 | bool show_defaults) |
8f6c8936 | 1550 | { |
01d43141 EDP |
1551 | vty_out(vty, " segment-routing global-block %s %s", |
1552 | yang_dnode_get_string(dnode, "./srgb/lower-bound"), | |
1553 | yang_dnode_get_string(dnode, "./srgb/upper-bound")); | |
1554 | if (!yang_dnode_is_default(dnode, "./srlb/lower-bound") | |
1555 | || !yang_dnode_is_default(dnode, "./srlb/upper-bound")) | |
1556 | vty_out(vty, " local-block %s %s", | |
1557 | yang_dnode_get_string(dnode, "./srlb/lower-bound"), | |
1558 | yang_dnode_get_string(dnode, "./srlb/upper-bound")); | |
1559 | vty_out(vty, "\n"); | |
8f6c8936 RW |
1560 | } |
1561 | ||
1562 | /* | |
1563 | * XPath: /frr-isisd:isis/instance/segment-routing/msd/node-msd | |
1564 | */ | |
ca77b518 | 1565 | DEFPY_YANG (isis_sr_node_msd, |
8f6c8936 RW |
1566 | isis_sr_node_msd_cmd, |
1567 | "segment-routing node-msd (1-16)$msd", | |
1568 | SR_STR | |
1569 | "Maximum Stack Depth for this router\n" | |
1570 | "Maximum number of label that can be stack (1-16)\n") | |
1571 | { | |
1572 | nb_cli_enqueue_change(vty, "./segment-routing/msd/node-msd", | |
1573 | NB_OP_MODIFY, msd_str); | |
1574 | ||
1575 | return nb_cli_apply_changes(vty, NULL); | |
1576 | } | |
1577 | ||
ca77b518 | 1578 | DEFPY_YANG (no_isis_sr_node_msd, |
8f6c8936 RW |
1579 | no_isis_sr_node_msd_cmd, |
1580 | "no segment-routing node-msd [(1-16)]", | |
1581 | NO_STR | |
1582 | SR_STR | |
1583 | "Maximum Stack Depth for this router\n" | |
1584 | "Maximum number of label that can be stack (1-16)\n") | |
1585 | { | |
1586 | nb_cli_enqueue_change(vty, "./segment-routing/msd/node-msd", | |
1587 | NB_OP_DESTROY, NULL); | |
1588 | ||
1589 | return nb_cli_apply_changes(vty, NULL); | |
1590 | } | |
1591 | ||
25605051 | 1592 | void cli_show_isis_node_msd(struct vty *vty, const struct lyd_node *dnode, |
8f6c8936 RW |
1593 | bool show_defaults) |
1594 | { | |
1595 | vty_out(vty, " segment-routing node-msd %s\n", | |
1596 | yang_dnode_get_string(dnode, NULL)); | |
1597 | } | |
1598 | ||
1599 | /* | |
1600 | * XPath: /frr-isisd:isis/instance/segment-routing/prefix-sid-map/prefix-sid | |
1601 | */ | |
ca77b518 | 1602 | DEFPY_YANG (isis_sr_prefix_sid, |
8f6c8936 RW |
1603 | isis_sr_prefix_sid_cmd, |
1604 | "segment-routing prefix\ | |
1605 | <A.B.C.D/M|X:X::X:X/M>$prefix\ | |
26f6acaf | 1606 | <absolute$sid_type (16-1048575)$sid_value|index$sid_type (0-65535)$sid_value>\ |
01983712 | 1607 | [<no-php-flag|explicit-null>$lh_behavior] [n-flag-clear$n_flag_clear]", |
8f6c8936 RW |
1608 | SR_STR |
1609 | "Prefix SID\n" | |
1610 | "IPv4 Prefix\n" | |
1611 | "IPv6 Prefix\n" | |
02c671af | 1612 | "Specify the absolute value of Prefix Segment ID\n" |
8f6c8936 | 1613 | "The Prefix Segment ID value\n" |
02c671af | 1614 | "Specify the index of Prefix Segment ID\n" |
8f6c8936 RW |
1615 | "The Prefix Segment ID index\n" |
1616 | "Don't request Penultimate Hop Popping (PHP)\n" | |
01983712 RW |
1617 | "Upstream neighbor must replace prefix-sid with explicit null label\n" |
1618 | "Not a node SID\n") | |
8f6c8936 RW |
1619 | { |
1620 | nb_cli_enqueue_change(vty, ".", NB_OP_CREATE, NULL); | |
1621 | nb_cli_enqueue_change(vty, "./sid-value-type", NB_OP_MODIFY, sid_type); | |
1622 | nb_cli_enqueue_change(vty, "./sid-value", NB_OP_MODIFY, sid_value_str); | |
1623 | if (lh_behavior) { | |
1624 | const char *value; | |
1625 | ||
1626 | if (strmatch(lh_behavior, "no-php-flag")) | |
1627 | value = "no-php"; | |
1628 | else | |
1629 | value = "explicit-null"; | |
1630 | ||
1631 | nb_cli_enqueue_change(vty, "./last-hop-behavior", NB_OP_MODIFY, | |
1632 | value); | |
1633 | } else | |
1634 | nb_cli_enqueue_change(vty, "./last-hop-behavior", NB_OP_MODIFY, | |
1635 | NULL); | |
01983712 RW |
1636 | nb_cli_enqueue_change(vty, "./n-flag-clear", NB_OP_MODIFY, |
1637 | n_flag_clear ? "true" : "false"); | |
8f6c8936 RW |
1638 | |
1639 | return nb_cli_apply_changes( | |
1640 | vty, "./segment-routing/prefix-sid-map/prefix-sid[prefix='%s']", | |
1641 | prefix_str); | |
1642 | } | |
1643 | ||
ca77b518 | 1644 | DEFPY_YANG (no_isis_sr_prefix_sid, |
8f6c8936 RW |
1645 | no_isis_sr_prefix_sid_cmd, |
1646 | "no segment-routing prefix <A.B.C.D/M|X:X::X:X/M>$prefix\ | |
01983712 RW |
1647 | [<absolute$sid_type (16-1048575)|index (0-65535)> [<no-php-flag|explicit-null>]]\ |
1648 | [n-flag-clear]", | |
8f6c8936 RW |
1649 | NO_STR |
1650 | SR_STR | |
1651 | "Prefix SID\n" | |
1652 | "IPv4 Prefix\n" | |
1653 | "IPv6 Prefix\n" | |
02c671af | 1654 | "Specify the absolute value of Prefix Segment ID\n" |
8f6c8936 | 1655 | "The Prefix Segment ID value\n" |
02c671af | 1656 | "Specify the index of Prefix Segment ID\n" |
8f6c8936 RW |
1657 | "The Prefix Segment ID index\n" |
1658 | "Don't request Penultimate Hop Popping (PHP)\n" | |
01983712 RW |
1659 | "Upstream neighbor must replace prefix-sid with explicit null label\n" |
1660 | "Not a node SID\n") | |
8f6c8936 RW |
1661 | { |
1662 | nb_cli_enqueue_change(vty, ".", NB_OP_DESTROY, NULL); | |
1663 | ||
1664 | return nb_cli_apply_changes( | |
1665 | vty, "./segment-routing/prefix-sid-map/prefix-sid[prefix='%s']", | |
1666 | prefix_str); | |
1667 | } | |
1668 | ||
25605051 | 1669 | void cli_show_isis_prefix_sid(struct vty *vty, const struct lyd_node *dnode, |
8f6c8936 RW |
1670 | bool show_defaults) |
1671 | { | |
1672 | const char *prefix; | |
1673 | const char *lh_behavior; | |
1674 | const char *sid_value_type; | |
1675 | const char *sid_value; | |
01983712 | 1676 | bool n_flag_clear; |
8f6c8936 RW |
1677 | |
1678 | prefix = yang_dnode_get_string(dnode, "./prefix"); | |
1679 | lh_behavior = yang_dnode_get_string(dnode, "./last-hop-behavior"); | |
1680 | sid_value_type = yang_dnode_get_string(dnode, "./sid-value-type"); | |
1681 | sid_value = yang_dnode_get_string(dnode, "./sid-value"); | |
01983712 | 1682 | n_flag_clear = yang_dnode_get_bool(dnode, "./n-flag-clear"); |
8f6c8936 RW |
1683 | |
1684 | vty_out(vty, " segment-routing prefix %s", prefix); | |
1685 | if (strmatch(sid_value_type, "absolute")) | |
1686 | vty_out(vty, " absolute"); | |
1687 | else | |
1688 | vty_out(vty, " index"); | |
1689 | vty_out(vty, " %s", sid_value); | |
1690 | if (strmatch(lh_behavior, "no-php")) | |
1691 | vty_out(vty, " no-php-flag"); | |
1692 | else if (strmatch(lh_behavior, "explicit-null")) | |
1693 | vty_out(vty, " explicit-null"); | |
01983712 RW |
1694 | if (n_flag_clear) |
1695 | vty_out(vty, " n-flag-clear"); | |
8f6c8936 RW |
1696 | vty_out(vty, "\n"); |
1697 | } | |
1698 | ||
d20b14bc RW |
1699 | |
1700 | /* | |
1701 | * XPath: /frr-isisd:isis/instance/fast-reroute/level-{1,2}/lfa/priority-limit | |
1702 | */ | |
1703 | DEFPY_YANG (isis_frr_lfa_priority_limit, | |
1704 | isis_frr_lfa_priority_limit_cmd, | |
1705 | "[no] fast-reroute priority-limit <critical|high|medium>$priority [<level-1|level-2>$level]", | |
1706 | NO_STR | |
1707 | "Configure Fast ReRoute\n" | |
1708 | "Limit backup computation up to the prefix priority\n" | |
1709 | "Compute for critical priority prefixes only\n" | |
1710 | "Compute for critical & high priority prefixes\n" | |
1711 | "Compute for critical, high & medium priority prefixes\n" | |
1712 | "Set priority-limit for level-1 only\n" | |
1713 | "Set priority-limit for level-2 only\n") | |
1714 | { | |
1715 | if (!level || strmatch(level, "level-1")) { | |
1716 | if (no) { | |
1717 | nb_cli_enqueue_change( | |
1718 | vty, | |
1719 | "./fast-reroute/level-1/lfa/priority-limit", | |
1720 | NB_OP_DESTROY, NULL); | |
1721 | } else { | |
1722 | nb_cli_enqueue_change( | |
1723 | vty, | |
1724 | "./fast-reroute/level-1/lfa/priority-limit", | |
1725 | NB_OP_CREATE, priority); | |
1726 | } | |
1727 | } | |
1728 | if (!level || strmatch(level, "level-2")) { | |
1729 | if (no) { | |
1730 | nb_cli_enqueue_change( | |
1731 | vty, | |
1732 | "./fast-reroute/level-2/lfa/priority-limit", | |
1733 | NB_OP_DESTROY, NULL); | |
1734 | } else { | |
1735 | nb_cli_enqueue_change( | |
1736 | vty, | |
1737 | "./fast-reroute/level-2/lfa/priority-limit", | |
1738 | NB_OP_CREATE, priority); | |
1739 | } | |
1740 | } | |
1741 | ||
1742 | return nb_cli_apply_changes(vty, NULL); | |
1743 | } | |
1744 | ||
1745 | void cli_show_isis_frr_lfa_priority_limit(struct vty *vty, | |
25605051 | 1746 | const struct lyd_node *dnode, |
d20b14bc RW |
1747 | bool show_defaults) |
1748 | { | |
1749 | vty_out(vty, " fast-reroute priority-limit %s %s\n", | |
1750 | yang_dnode_get_string(dnode, NULL), | |
1751 | dnode->parent->parent->schema->name); | |
1752 | } | |
1753 | ||
1754 | /* | |
1755 | * XPath: /frr-isisd:isis/instance/fast-reroute/level-{1,2}/lfa/tiebreaker | |
1756 | */ | |
1757 | DEFPY_YANG (isis_frr_lfa_tiebreaker, | |
1758 | isis_frr_lfa_tiebreaker_cmd, | |
1759 | "[no] fast-reroute lfa\ | |
1760 | tiebreaker <downstream|lowest-backup-metric|node-protecting>$type\ | |
1761 | index (1-255)$index\ | |
1762 | [<level-1|level-2>$level]", | |
1763 | NO_STR | |
1764 | "Configure Fast ReRoute\n" | |
1765 | "LFA configuration\n" | |
1766 | "Configure tiebreaker for multiple backups\n" | |
1767 | "Prefer backup path via downstream node\n" | |
1768 | "Prefer backup path with lowest total metric\n" | |
1769 | "Prefer node protecting backup path\n" | |
1770 | "Set preference order among tiebreakers\n" | |
1771 | "Index\n" | |
1772 | "Configure tiebreaker for level-1 only\n" | |
1773 | "Configure tiebreaker for level-2 only\n") | |
1774 | { | |
1775 | char xpath[XPATH_MAXLEN]; | |
1776 | ||
1777 | if (!level || strmatch(level, "level-1")) { | |
1778 | if (no) { | |
1779 | snprintf( | |
1780 | xpath, XPATH_MAXLEN, | |
1781 | "./fast-reroute/level-1/lfa/tiebreaker[index='%s']", | |
1782 | index_str); | |
1783 | nb_cli_enqueue_change(vty, xpath, NB_OP_DESTROY, NULL); | |
1784 | } else { | |
1785 | snprintf( | |
1786 | xpath, XPATH_MAXLEN, | |
1787 | "./fast-reroute/level-1/lfa/tiebreaker[index='%s']/type", | |
1788 | index_str); | |
1789 | nb_cli_enqueue_change(vty, xpath, NB_OP_CREATE, type); | |
1790 | } | |
1791 | } | |
1792 | if (!level || strmatch(level, "level-2")) { | |
1793 | if (no) { | |
1794 | snprintf( | |
1795 | xpath, XPATH_MAXLEN, | |
1796 | "./fast-reroute/level-2/lfa/tiebreaker[index='%s']", | |
1797 | index_str); | |
1798 | nb_cli_enqueue_change(vty, xpath, NB_OP_DESTROY, NULL); | |
1799 | } else { | |
1800 | snprintf( | |
1801 | xpath, XPATH_MAXLEN, | |
1802 | "./fast-reroute/level-2/lfa/tiebreaker[index='%s']/type", | |
1803 | index_str); | |
1804 | nb_cli_enqueue_change(vty, xpath, NB_OP_CREATE, type); | |
1805 | } | |
1806 | } | |
1807 | ||
1808 | return nb_cli_apply_changes(vty, NULL); | |
1809 | } | |
1810 | ||
25605051 IR |
1811 | void cli_show_isis_frr_lfa_tiebreaker(struct vty *vty, |
1812 | const struct lyd_node *dnode, | |
d20b14bc RW |
1813 | bool show_defaults) |
1814 | { | |
1815 | vty_out(vty, " fast-reroute lfa tiebreaker %s index %s %s\n", | |
1816 | yang_dnode_get_string(dnode, "./type"), | |
1817 | yang_dnode_get_string(dnode, "./index"), | |
1818 | dnode->parent->parent->schema->name); | |
1819 | } | |
1820 | ||
1821 | /* | |
1822 | * XPath: /frr-isisd:isis/instance/fast-reroute/level-{1,2}/lfa/load-sharing | |
1823 | */ | |
1824 | DEFPY_YANG (isis_frr_lfa_load_sharing, | |
1825 | isis_frr_lfa_load_sharing_cmd, | |
1826 | "[no] fast-reroute load-sharing disable [<level-1|level-2>$level]", | |
1827 | NO_STR | |
1828 | "Configure Fast ReRoute\n" | |
1829 | "Load share prefixes across multiple backups\n" | |
1830 | "Disable load sharing\n" | |
1831 | "Disable load sharing for level-1 only\n" | |
1832 | "Disable load sharing for level-2 only\n") | |
1833 | { | |
1834 | if (!level || strmatch(level, "level-1")) { | |
1835 | if (no) { | |
1836 | nb_cli_enqueue_change( | |
1837 | vty, "./fast-reroute/level-1/lfa/load-sharing", | |
7ab5ca10 | 1838 | NB_OP_MODIFY, "true"); |
d20b14bc RW |
1839 | } else { |
1840 | nb_cli_enqueue_change( | |
1841 | vty, "./fast-reroute/level-1/lfa/load-sharing", | |
7ab5ca10 | 1842 | NB_OP_MODIFY, "false"); |
d20b14bc RW |
1843 | } |
1844 | } | |
1845 | if (!level || strmatch(level, "level-2")) { | |
1846 | if (no) { | |
1847 | nb_cli_enqueue_change( | |
1848 | vty, "./fast-reroute/level-2/lfa/load-sharing", | |
7ab5ca10 | 1849 | NB_OP_MODIFY, "true"); |
d20b14bc RW |
1850 | } else { |
1851 | nb_cli_enqueue_change( | |
1852 | vty, "./fast-reroute/level-2/lfa/load-sharing", | |
7ab5ca10 | 1853 | NB_OP_MODIFY, "false"); |
d20b14bc RW |
1854 | } |
1855 | } | |
1856 | ||
1857 | return nb_cli_apply_changes(vty, NULL); | |
1858 | } | |
1859 | ||
25605051 IR |
1860 | void cli_show_isis_frr_lfa_load_sharing(struct vty *vty, |
1861 | const struct lyd_node *dnode, | |
d20b14bc RW |
1862 | bool show_defaults) |
1863 | { | |
32931e1a | 1864 | if (yang_dnode_get_bool(dnode, NULL)) |
d20b14bc RW |
1865 | vty_out(vty, " no"); |
1866 | ||
1867 | vty_out(vty, " fast-reroute load-sharing disable %s\n", | |
1868 | dnode->parent->parent->schema->name); | |
1869 | } | |
1870 | ||
381200be RW |
1871 | /* |
1872 | * XPath: /frr-isisd:isis/instance/fast-reroute/level-{1,2}/remote-lfa/prefix-list | |
1873 | */ | |
1874 | DEFPY_YANG (isis_frr_remote_lfa_plist, | |
1875 | isis_frr_remote_lfa_plist_cmd, | |
1876 | "fast-reroute remote-lfa prefix-list WORD$plist [<level-1|level-2>$level]", | |
1877 | "Configure Fast ReRoute\n" | |
1878 | "Enable remote LFA related configuration\n" | |
1879 | "Filter PQ node router ID based on prefix list\n" | |
1880 | "Prefix-list name\n" | |
1881 | "Enable router ID filtering for level-1 only\n" | |
1882 | "Enable router ID filtering for level-2 only\n") | |
1883 | { | |
1884 | if (!level || strmatch(level, "level-1")) | |
1885 | nb_cli_enqueue_change( | |
1886 | vty, "./fast-reroute/level-1/remote-lfa/prefix-list", | |
1887 | NB_OP_MODIFY, plist); | |
1888 | if (!level || strmatch(level, "level-2")) | |
1889 | nb_cli_enqueue_change( | |
1890 | vty, "./fast-reroute/level-2/remote-lfa/prefix-list", | |
1891 | NB_OP_MODIFY, plist); | |
1892 | ||
1893 | return nb_cli_apply_changes(vty, NULL); | |
1894 | } | |
1895 | ||
1896 | DEFPY_YANG (no_isis_frr_remote_lfa_plist, | |
1897 | no_isis_frr_remote_lfa_plist_cmd, | |
1898 | "no fast-reroute remote-lfa prefix-list [WORD] [<level-1|level-2>$level]", | |
1899 | NO_STR | |
1900 | "Configure Fast ReRoute\n" | |
1901 | "Enable remote LFA related configuration\n" | |
1902 | "Filter PQ node router ID based on prefix list\n" | |
1903 | "Prefix-list name\n" | |
1904 | "Enable router ID filtering for level-1 only\n" | |
1905 | "Enable router ID filtering for level-2 only\n") | |
1906 | { | |
1907 | if (!level || strmatch(level, "level-1")) | |
1908 | nb_cli_enqueue_change( | |
1909 | vty, "./fast-reroute/level-1/remote-lfa/prefix-list", | |
1910 | NB_OP_DESTROY, NULL); | |
1911 | if (!level || strmatch(level, "level-2")) | |
1912 | nb_cli_enqueue_change( | |
1913 | vty, "./fast-reroute/level-2/remote-lfa/prefix-list", | |
1914 | NB_OP_DESTROY, NULL); | |
1915 | ||
1916 | return nb_cli_apply_changes(vty, NULL); | |
1917 | } | |
1918 | ||
25605051 IR |
1919 | void cli_show_isis_frr_remote_lfa_plist(struct vty *vty, |
1920 | const struct lyd_node *dnode, | |
381200be RW |
1921 | bool show_defaults) |
1922 | { | |
1923 | vty_out(vty, " fast-reroute remote-lfa prefix-list %s %s\n", | |
1924 | yang_dnode_get_string(dnode, NULL), | |
1925 | dnode->parent->parent->schema->name); | |
1926 | } | |
1927 | ||
a6a36c41 EDP |
1928 | /* |
1929 | * XPath: /frr-interface:lib/interface/frr-isisd:isis/passive | |
1930 | */ | |
ca77b518 | 1931 | DEFPY_YANG(isis_passive, isis_passive_cmd, "[no] isis passive", |
a6a36c41 EDP |
1932 | NO_STR |
1933 | "IS-IS routing protocol\n" | |
1934 | "Configure the passive mode for interface\n") | |
1935 | { | |
5f1e5e3f EDP |
1936 | nb_cli_enqueue_change(vty, "./frr-isisd:isis/passive", NB_OP_MODIFY, |
1937 | no ? "false" : "true"); | |
a6a36c41 EDP |
1938 | |
1939 | return nb_cli_apply_changes(vty, NULL); | |
1940 | } | |
1941 | ||
25605051 | 1942 | void cli_show_ip_isis_passive(struct vty *vty, const struct lyd_node *dnode, |
a6a36c41 EDP |
1943 | bool show_defaults) |
1944 | { | |
5f1e5e3f EDP |
1945 | if (!yang_dnode_get_bool(dnode, NULL)) |
1946 | vty_out(vty, " no"); | |
a6a36c41 EDP |
1947 | vty_out(vty, " isis passive\n"); |
1948 | } | |
1949 | ||
3e20c83a EDP |
1950 | /* |
1951 | * XPath: /frr-interface:lib/interface/frr-isisd:isis/password | |
1952 | */ | |
1953 | ||
ca77b518 | 1954 | DEFPY_YANG(isis_passwd, isis_passwd_cmd, "isis password <md5|clear>$type WORD$pwd", |
3e20c83a EDP |
1955 | "IS-IS routing protocol\n" |
1956 | "Configure the authentication password for a circuit\n" | |
1957 | "HMAC-MD5 authentication\n" | |
1958 | "Cleartext password\n" | |
1959 | "Circuit password\n") | |
1960 | { | |
1961 | nb_cli_enqueue_change(vty, "./frr-isisd:isis/password", NB_OP_CREATE, | |
1962 | NULL); | |
1963 | nb_cli_enqueue_change(vty, "./frr-isisd:isis/password/password", | |
1964 | NB_OP_MODIFY, pwd); | |
1965 | nb_cli_enqueue_change(vty, "./frr-isisd:isis/password/password-type", | |
1966 | NB_OP_MODIFY, type); | |
1967 | ||
1968 | return nb_cli_apply_changes(vty, NULL); | |
1969 | } | |
1970 | ||
ca77b518 | 1971 | DEFPY_YANG(no_isis_passwd, no_isis_passwd_cmd, "no isis password [<md5|clear> WORD]", |
3e20c83a EDP |
1972 | NO_STR |
1973 | "IS-IS routing protocol\n" | |
1974 | "Configure the authentication password for a circuit\n" | |
1975 | "HMAC-MD5 authentication\n" | |
1976 | "Cleartext password\n" | |
1977 | "Circuit password\n") | |
1978 | { | |
95ce849b | 1979 | nb_cli_enqueue_change(vty, "./frr-isisd:isis/password", NB_OP_DESTROY, |
3e20c83a EDP |
1980 | NULL); |
1981 | ||
1982 | return nb_cli_apply_changes(vty, NULL); | |
1983 | } | |
1984 | ||
25605051 | 1985 | void cli_show_ip_isis_password(struct vty *vty, const struct lyd_node *dnode, |
3e20c83a EDP |
1986 | bool show_defaults) |
1987 | { | |
1988 | vty_out(vty, " isis password %s %s\n", | |
1989 | yang_dnode_get_string(dnode, "./password-type"), | |
1990 | yang_dnode_get_string(dnode, "./password")); | |
1991 | } | |
1992 | ||
be49219c EDP |
1993 | /* |
1994 | * XPath: /frr-interface:lib/interface/frr-isisd:isis/metric | |
1995 | */ | |
ca77b518 | 1996 | DEFPY_YANG(isis_metric, isis_metric_cmd, |
be49219c EDP |
1997 | "isis metric [level-1|level-2]$level (0-16777215)$met", |
1998 | "IS-IS routing protocol\n" | |
1999 | "Set default metric for circuit\n" | |
2000 | "Specify metric for level-1 routing\n" | |
2001 | "Specify metric for level-2 routing\n" | |
2002 | "Default metric value\n") | |
2003 | { | |
2004 | if (!level || strmatch(level, "level-1")) | |
2005 | nb_cli_enqueue_change(vty, "./frr-isisd:isis/metric/level-1", | |
2006 | NB_OP_MODIFY, met_str); | |
2007 | if (!level || strmatch(level, "level-2")) | |
2008 | nb_cli_enqueue_change(vty, "./frr-isisd:isis/metric/level-2", | |
2009 | NB_OP_MODIFY, met_str); | |
2010 | ||
2011 | return nb_cli_apply_changes(vty, NULL); | |
2012 | } | |
2013 | ||
ca77b518 | 2014 | DEFPY_YANG(no_isis_metric, no_isis_metric_cmd, |
be49219c EDP |
2015 | "no isis metric [level-1|level-2]$level [(0-16777215)]", |
2016 | NO_STR | |
2017 | "IS-IS routing protocol\n" | |
2018 | "Set default metric for circuit\n" | |
2019 | "Specify metric for level-1 routing\n" | |
2020 | "Specify metric for level-2 routing\n" | |
2021 | "Default metric value\n") | |
2022 | { | |
2023 | if (!level || strmatch(level, "level-1")) | |
2024 | nb_cli_enqueue_change(vty, "./frr-isisd:isis/metric/level-1", | |
2025 | NB_OP_MODIFY, NULL); | |
2026 | if (!level || strmatch(level, "level-2")) | |
2027 | nb_cli_enqueue_change(vty, "./frr-isisd:isis/metric/level-2", | |
2028 | NB_OP_MODIFY, NULL); | |
2029 | ||
2030 | return nb_cli_apply_changes(vty, NULL); | |
2031 | } | |
2032 | ||
25605051 | 2033 | void cli_show_ip_isis_metric(struct vty *vty, const struct lyd_node *dnode, |
be49219c EDP |
2034 | bool show_defaults) |
2035 | { | |
2036 | const char *l1 = yang_dnode_get_string(dnode, "./level-1"); | |
2037 | const char *l2 = yang_dnode_get_string(dnode, "./level-2"); | |
2038 | ||
2039 | if (strmatch(l1, l2)) | |
2040 | vty_out(vty, " isis metric %s\n", l1); | |
2041 | else { | |
d32a4cac EDP |
2042 | vty_out(vty, " isis metric level-1 %s\n", l1); |
2043 | vty_out(vty, " isis metric level-2 %s\n", l2); | |
be49219c EDP |
2044 | } |
2045 | } | |
2046 | ||
356a2e3c EDP |
2047 | /* |
2048 | * XPath: /frr-interface:lib/interface/frr-isisd:isis/hello/interval | |
2049 | */ | |
ca77b518 | 2050 | DEFPY_YANG(isis_hello_interval, isis_hello_interval_cmd, |
356a2e3c EDP |
2051 | "isis hello-interval [level-1|level-2]$level (1-600)$intv", |
2052 | "IS-IS routing protocol\n" | |
2053 | "Set Hello interval\n" | |
2054 | "Specify hello-interval for level-1 IIHs\n" | |
2055 | "Specify hello-interval for level-2 IIHs\n" | |
2056 | "Holdtime 1 seconds, interval depends on multiplier\n") | |
2057 | { | |
2058 | if (!level || strmatch(level, "level-1")) | |
2059 | nb_cli_enqueue_change(vty, | |
2060 | "./frr-isisd:isis/hello/interval/level-1", | |
2061 | NB_OP_MODIFY, intv_str); | |
2062 | if (!level || strmatch(level, "level-2")) | |
2063 | nb_cli_enqueue_change(vty, | |
2064 | "./frr-isisd:isis/hello/interval/level-2", | |
2065 | NB_OP_MODIFY, intv_str); | |
2066 | ||
2067 | return nb_cli_apply_changes(vty, NULL); | |
2068 | } | |
2069 | ||
ca77b518 | 2070 | DEFPY_YANG(no_isis_hello_interval, no_isis_hello_interval_cmd, |
356a2e3c EDP |
2071 | "no isis hello-interval [level-1|level-2]$level [(1-600)]", |
2072 | NO_STR | |
2073 | "IS-IS routing protocol\n" | |
2074 | "Set Hello interval\n" | |
2075 | "Specify hello-interval for level-1 IIHs\n" | |
2076 | "Specify hello-interval for level-2 IIHs\n" | |
2077 | "Holdtime 1 second, interval depends on multiplier\n") | |
2078 | { | |
2079 | if (!level || strmatch(level, "level-1")) | |
2080 | nb_cli_enqueue_change(vty, | |
2081 | "./frr-isisd:isis/hello/interval/level-1", | |
2082 | NB_OP_MODIFY, NULL); | |
2083 | if (!level || strmatch(level, "level-2")) | |
2084 | nb_cli_enqueue_change(vty, | |
2085 | "./frr-isisd:isis/hello/interval/level-2", | |
2086 | NB_OP_MODIFY, NULL); | |
2087 | ||
2088 | return nb_cli_apply_changes(vty, NULL); | |
2089 | } | |
2090 | ||
25605051 IR |
2091 | void cli_show_ip_isis_hello_interval(struct vty *vty, |
2092 | const struct lyd_node *dnode, | |
356a2e3c EDP |
2093 | bool show_defaults) |
2094 | { | |
2095 | const char *l1 = yang_dnode_get_string(dnode, "./level-1"); | |
2096 | const char *l2 = yang_dnode_get_string(dnode, "./level-2"); | |
2097 | ||
2098 | if (strmatch(l1, l2)) | |
2099 | vty_out(vty, " isis hello-interval %s\n", l1); | |
2100 | else { | |
249312ab EDP |
2101 | vty_out(vty, " isis hello-interval level-1 %s\n", l1); |
2102 | vty_out(vty, " isis hello-interval level-2 %s\n", l2); | |
356a2e3c EDP |
2103 | } |
2104 | } | |
2105 | ||
4e75a67d EDP |
2106 | /* |
2107 | * XPath: /frr-interface:lib/interface/frr-isisd:isis/hello/multiplier | |
2108 | */ | |
ca77b518 | 2109 | DEFPY_YANG(isis_hello_multiplier, isis_hello_multiplier_cmd, |
4e75a67d EDP |
2110 | "isis hello-multiplier [level-1|level-2]$level (2-100)$mult", |
2111 | "IS-IS routing protocol\n" | |
2112 | "Set multiplier for Hello holding time\n" | |
2113 | "Specify hello multiplier for level-1 IIHs\n" | |
2114 | "Specify hello multiplier for level-2 IIHs\n" | |
2115 | "Hello multiplier value\n") | |
2116 | { | |
2117 | if (!level || strmatch(level, "level-1")) | |
2118 | nb_cli_enqueue_change( | |
2119 | vty, "./frr-isisd:isis/hello/multiplier/level-1", | |
2120 | NB_OP_MODIFY, mult_str); | |
2121 | if (!level || strmatch(level, "level-2")) | |
2122 | nb_cli_enqueue_change( | |
2123 | vty, "./frr-isisd:isis/hello/multiplier/level-2", | |
2124 | NB_OP_MODIFY, mult_str); | |
2125 | ||
2126 | return nb_cli_apply_changes(vty, NULL); | |
2127 | } | |
2128 | ||
ca77b518 | 2129 | DEFPY_YANG(no_isis_hello_multiplier, no_isis_hello_multiplier_cmd, |
4e75a67d EDP |
2130 | "no isis hello-multiplier [level-1|level-2]$level [(2-100)]", |
2131 | NO_STR | |
2132 | "IS-IS routing protocol\n" | |
2133 | "Set multiplier for Hello holding time\n" | |
2134 | "Specify hello multiplier for level-1 IIHs\n" | |
2135 | "Specify hello multiplier for level-2 IIHs\n" | |
2136 | "Hello multiplier value\n") | |
2137 | { | |
2138 | if (!level || strmatch(level, "level-1")) | |
2139 | nb_cli_enqueue_change( | |
2140 | vty, "./frr-isisd:isis/hello/multiplier/level-1", | |
2141 | NB_OP_MODIFY, NULL); | |
2142 | if (!level || strmatch(level, "level-2")) | |
2143 | nb_cli_enqueue_change( | |
2144 | vty, "./frr-isisd:isis/hello/multiplier/level-2", | |
2145 | NB_OP_MODIFY, NULL); | |
2146 | ||
2147 | return nb_cli_apply_changes(vty, NULL); | |
2148 | } | |
2149 | ||
25605051 | 2150 | void cli_show_ip_isis_hello_multi(struct vty *vty, const struct lyd_node *dnode, |
4e75a67d EDP |
2151 | bool show_defaults) |
2152 | { | |
2153 | const char *l1 = yang_dnode_get_string(dnode, "./level-1"); | |
2154 | const char *l2 = yang_dnode_get_string(dnode, "./level-2"); | |
2155 | ||
2156 | if (strmatch(l1, l2)) | |
2157 | vty_out(vty, " isis hello-multiplier %s\n", l1); | |
2158 | else { | |
249312ab EDP |
2159 | vty_out(vty, " isis hello-multiplier level-1 %s\n", l1); |
2160 | vty_out(vty, " isis hello-multiplier level-2 %s\n", l2); | |
4e75a67d EDP |
2161 | } |
2162 | } | |
2163 | ||
5f2ce446 EDP |
2164 | /* |
2165 | * XPath: | |
2166 | * /frr-interface:lib/interface/frr-isisd:isis/disable-three-way-handshake | |
2167 | */ | |
ca77b518 | 2168 | DEFPY_YANG(isis_threeway_adj, isis_threeway_adj_cmd, "[no] isis three-way-handshake", |
5f2ce446 EDP |
2169 | NO_STR |
2170 | "IS-IS commands\n" | |
2171 | "Enable/Disable three-way handshake\n") | |
2172 | { | |
2173 | nb_cli_enqueue_change(vty, | |
2174 | "./frr-isisd:isis/disable-three-way-handshake", | |
5f1e5e3f | 2175 | NB_OP_MODIFY, no ? "true" : "false"); |
5f2ce446 EDP |
2176 | |
2177 | return nb_cli_apply_changes(vty, NULL); | |
2178 | } | |
2179 | ||
25605051 IR |
2180 | void cli_show_ip_isis_threeway_shake(struct vty *vty, |
2181 | const struct lyd_node *dnode, | |
5f2ce446 EDP |
2182 | bool show_defaults) |
2183 | { | |
5f1e5e3f EDP |
2184 | if (yang_dnode_get_bool(dnode, NULL)) |
2185 | vty_out(vty, " no"); | |
2186 | vty_out(vty, " isis three-way-handshake\n"); | |
5f2ce446 EDP |
2187 | } |
2188 | ||
7b6b75e5 EDP |
2189 | /* |
2190 | * XPath: /frr-interface:lib/interface/frr-isisd:isis/hello/padding | |
2191 | */ | |
ca77b518 | 2192 | DEFPY_YANG(isis_hello_padding, isis_hello_padding_cmd, "[no] isis hello padding", |
7b6b75e5 EDP |
2193 | NO_STR |
2194 | "IS-IS routing protocol\n" | |
2195 | "Add padding to IS-IS hello packets\n" | |
2196 | "Pad hello packets\n") | |
2197 | { | |
2198 | nb_cli_enqueue_change(vty, "./frr-isisd:isis/hello/padding", | |
2199 | NB_OP_MODIFY, no ? "false" : "true"); | |
2200 | ||
2201 | return nb_cli_apply_changes(vty, NULL); | |
2202 | } | |
2203 | ||
25605051 IR |
2204 | void cli_show_ip_isis_hello_padding(struct vty *vty, |
2205 | const struct lyd_node *dnode, | |
7b6b75e5 EDP |
2206 | bool show_defaults) |
2207 | { | |
2208 | if (!yang_dnode_get_bool(dnode, NULL)) | |
2209 | vty_out(vty, " no"); | |
2210 | ||
2211 | vty_out(vty, " isis hello padding\n"); | |
2212 | } | |
2213 | ||
9ce808b9 EDP |
2214 | /* |
2215 | * XPath: /frr-interface:lib/interface/frr-isisd:isis/csnp-interval | |
2216 | */ | |
ca77b518 | 2217 | DEFPY_YANG(csnp_interval, csnp_interval_cmd, |
9ce808b9 EDP |
2218 | "isis csnp-interval (1-600)$intv [level-1|level-2]$level", |
2219 | "IS-IS routing protocol\n" | |
2220 | "Set CSNP interval in seconds\n" | |
2221 | "CSNP interval value\n" | |
2222 | "Specify interval for level-1 CSNPs\n" | |
2223 | "Specify interval for level-2 CSNPs\n") | |
2224 | { | |
2225 | if (!level || strmatch(level, "level-1")) | |
2226 | nb_cli_enqueue_change(vty, | |
2227 | "./frr-isisd:isis/csnp-interval/level-1", | |
2228 | NB_OP_MODIFY, intv_str); | |
2229 | if (!level || strmatch(level, "level-2")) | |
2230 | nb_cli_enqueue_change(vty, | |
2231 | "./frr-isisd:isis/csnp-interval/level-2", | |
2232 | NB_OP_MODIFY, intv_str); | |
2233 | ||
2234 | return nb_cli_apply_changes(vty, NULL); | |
2235 | } | |
2236 | ||
ca77b518 | 2237 | DEFPY_YANG(no_csnp_interval, no_csnp_interval_cmd, |
9ce808b9 EDP |
2238 | "no isis csnp-interval [(1-600)] [level-1|level-2]$level", |
2239 | NO_STR | |
2240 | "IS-IS routing protocol\n" | |
2241 | "Set CSNP interval in seconds\n" | |
2242 | "CSNP interval value\n" | |
2243 | "Specify interval for level-1 CSNPs\n" | |
2244 | "Specify interval for level-2 CSNPs\n") | |
2245 | { | |
2246 | if (!level || strmatch(level, "level-1")) | |
2247 | nb_cli_enqueue_change(vty, | |
2248 | "./frr-isisd:isis/csnp-interval/level-1", | |
2249 | NB_OP_MODIFY, NULL); | |
2250 | if (!level || strmatch(level, "level-2")) | |
2251 | nb_cli_enqueue_change(vty, | |
2252 | "./frr-isisd:isis/csnp-interval/level-2", | |
2253 | NB_OP_MODIFY, NULL); | |
2254 | ||
2255 | return nb_cli_apply_changes(vty, NULL); | |
2256 | } | |
2257 | ||
25605051 IR |
2258 | void cli_show_ip_isis_csnp_interval(struct vty *vty, |
2259 | const struct lyd_node *dnode, | |
9ce808b9 EDP |
2260 | bool show_defaults) |
2261 | { | |
2262 | const char *l1 = yang_dnode_get_string(dnode, "./level-1"); | |
2263 | const char *l2 = yang_dnode_get_string(dnode, "./level-2"); | |
2264 | ||
2265 | if (strmatch(l1, l2)) | |
2266 | vty_out(vty, " isis csnp-interval %s\n", l1); | |
2267 | else { | |
2268 | vty_out(vty, " isis csnp-interval %s level-1\n", l1); | |
2269 | vty_out(vty, " isis csnp-interval %s level-2\n", l2); | |
2270 | } | |
2271 | } | |
2272 | ||
2273 | /* | |
2274 | * XPath: /frr-interface:lib/interface/frr-isisd:isis/psnp-interval | |
2275 | */ | |
ca77b518 | 2276 | DEFPY_YANG(psnp_interval, psnp_interval_cmd, |
9ce808b9 EDP |
2277 | "isis psnp-interval (1-120)$intv [level-1|level-2]$level", |
2278 | "IS-IS routing protocol\n" | |
2279 | "Set PSNP interval in seconds\n" | |
2280 | "PSNP interval value\n" | |
2281 | "Specify interval for level-1 PSNPs\n" | |
2282 | "Specify interval for level-2 PSNPs\n") | |
2283 | { | |
2284 | if (!level || strmatch(level, "level-1")) | |
2285 | nb_cli_enqueue_change(vty, | |
2286 | "./frr-isisd:isis/psnp-interval/level-1", | |
2287 | NB_OP_MODIFY, intv_str); | |
2288 | if (!level || strmatch(level, "level-2")) | |
2289 | nb_cli_enqueue_change(vty, | |
2290 | "./frr-isisd:isis/psnp-interval/level-2", | |
2291 | NB_OP_MODIFY, intv_str); | |
2292 | ||
2293 | return nb_cli_apply_changes(vty, NULL); | |
2294 | } | |
2295 | ||
ca77b518 | 2296 | DEFPY_YANG(no_psnp_interval, no_psnp_interval_cmd, |
9ce808b9 EDP |
2297 | "no isis psnp-interval [(1-120)] [level-1|level-2]$level", |
2298 | NO_STR | |
2299 | "IS-IS routing protocol\n" | |
2300 | "Set PSNP interval in seconds\n" | |
2301 | "PSNP interval value\n" | |
2302 | "Specify interval for level-1 PSNPs\n" | |
2303 | "Specify interval for level-2 PSNPs\n") | |
2304 | { | |
2305 | if (!level || strmatch(level, "level-1")) | |
2306 | nb_cli_enqueue_change(vty, | |
2307 | "./frr-isisd:isis/psnp-interval/level-1", | |
2308 | NB_OP_MODIFY, NULL); | |
2309 | if (!level || strmatch(level, "level-2")) | |
2310 | nb_cli_enqueue_change(vty, | |
2311 | "./frr-isisd:isis/psnp-interval/level-2", | |
2312 | NB_OP_MODIFY, NULL); | |
2313 | ||
2314 | return nb_cli_apply_changes(vty, NULL); | |
2315 | } | |
2316 | ||
25605051 IR |
2317 | void cli_show_ip_isis_psnp_interval(struct vty *vty, |
2318 | const struct lyd_node *dnode, | |
9ce808b9 EDP |
2319 | bool show_defaults) |
2320 | { | |
2321 | const char *l1 = yang_dnode_get_string(dnode, "./level-1"); | |
2322 | const char *l2 = yang_dnode_get_string(dnode, "./level-2"); | |
2323 | ||
2324 | if (strmatch(l1, l2)) | |
2325 | vty_out(vty, " isis psnp-interval %s\n", l1); | |
2326 | else { | |
2327 | vty_out(vty, " isis psnp-interval %s level-1\n", l1); | |
2328 | vty_out(vty, " isis psnp-interval %s level-2\n", l2); | |
2329 | } | |
2330 | } | |
2331 | ||
83d043f6 EDP |
2332 | /* |
2333 | * XPath: /frr-interface:lib/interface/frr-isisd:isis/multi-topology | |
2334 | */ | |
ca77b518 | 2335 | DEFPY_YANG(circuit_topology, circuit_topology_cmd, |
3efd0893 | 2336 | "[no] isis topology<ipv4-unicast|ipv4-mgmt|ipv6-unicast|ipv4-multicast|ipv6-multicast|ipv6-mgmt|ipv6-dstsrc>$topology", |
83d043f6 EDP |
2337 | NO_STR |
2338 | "IS-IS routing protocol\n" | |
2339 | "Configure interface IS-IS topologies\n" | |
2340 | "IPv4 unicast topology\n" | |
2341 | "IPv4 management topology\n" | |
2342 | "IPv6 unicast topology\n" | |
2343 | "IPv4 multicast topology\n" | |
2344 | "IPv6 multicast topology\n" | |
2345 | "IPv6 management topology\n" | |
2346 | "IPv6 dst-src topology\n") | |
2347 | { | |
2348 | nb_cli_enqueue_change(vty, ".", NB_OP_MODIFY, no ? "false" : "true"); | |
2349 | ||
2350 | if (strmatch(topology, "ipv4-mgmt")) | |
2351 | return nb_cli_apply_changes( | |
2352 | vty, "./frr-isisd:isis/multi-topology/ipv4-management"); | |
2353 | else if (strmatch(topology, "ipv6-mgmt")) | |
2354 | return nb_cli_apply_changes( | |
2355 | vty, "./frr-isisd:isis/multi-topology/ipv6-management"); | |
2356 | else | |
2357 | return nb_cli_apply_changes( | |
2358 | vty, "./frr-isisd:isis/multi-topology/%s", topology); | |
2359 | } | |
2360 | ||
25605051 IR |
2361 | void cli_show_ip_isis_mt_ipv4_unicast(struct vty *vty, |
2362 | const struct lyd_node *dnode, | |
83d043f6 EDP |
2363 | bool show_defaults) |
2364 | { | |
2365 | if (!yang_dnode_get_bool(dnode, NULL)) | |
2366 | vty_out(vty, " no"); | |
2367 | vty_out(vty, " isis topology ipv4-unicast\n"); | |
2368 | } | |
2369 | ||
25605051 IR |
2370 | void cli_show_ip_isis_mt_ipv4_multicast(struct vty *vty, |
2371 | const struct lyd_node *dnode, | |
83d043f6 EDP |
2372 | bool show_defaults) |
2373 | { | |
2374 | if (!yang_dnode_get_bool(dnode, NULL)) | |
2375 | vty_out(vty, " no"); | |
2376 | vty_out(vty, " isis topology ipv4-multicast\n"); | |
2377 | } | |
2378 | ||
25605051 IR |
2379 | void cli_show_ip_isis_mt_ipv4_mgmt(struct vty *vty, |
2380 | const struct lyd_node *dnode, | |
83d043f6 EDP |
2381 | bool show_defaults) |
2382 | { | |
2383 | if (!yang_dnode_get_bool(dnode, NULL)) | |
2384 | vty_out(vty, " no"); | |
2385 | vty_out(vty, " isis topology ipv4-mgmt\n"); | |
2386 | } | |
2387 | ||
25605051 IR |
2388 | void cli_show_ip_isis_mt_ipv6_unicast(struct vty *vty, |
2389 | const struct lyd_node *dnode, | |
83d043f6 EDP |
2390 | bool show_defaults) |
2391 | { | |
2392 | if (!yang_dnode_get_bool(dnode, NULL)) | |
2393 | vty_out(vty, " no"); | |
2394 | vty_out(vty, " isis topology ipv6-unicast\n"); | |
2395 | } | |
2396 | ||
25605051 IR |
2397 | void cli_show_ip_isis_mt_ipv6_multicast(struct vty *vty, |
2398 | const struct lyd_node *dnode, | |
83d043f6 EDP |
2399 | bool show_defaults) |
2400 | { | |
2401 | if (!yang_dnode_get_bool(dnode, NULL)) | |
2402 | vty_out(vty, " no"); | |
2403 | vty_out(vty, " isis topology ipv6-multicast\n"); | |
2404 | } | |
2405 | ||
25605051 IR |
2406 | void cli_show_ip_isis_mt_ipv6_mgmt(struct vty *vty, |
2407 | const struct lyd_node *dnode, | |
83d043f6 EDP |
2408 | bool show_defaults) |
2409 | { | |
2410 | if (!yang_dnode_get_bool(dnode, NULL)) | |
2411 | vty_out(vty, " no"); | |
2412 | vty_out(vty, " isis topology ipv6-mgmt\n"); | |
2413 | } | |
2414 | ||
25605051 IR |
2415 | void cli_show_ip_isis_mt_ipv6_dstsrc(struct vty *vty, |
2416 | const struct lyd_node *dnode, | |
83d043f6 EDP |
2417 | bool show_defaults) |
2418 | { | |
2419 | if (!yang_dnode_get_bool(dnode, NULL)) | |
2420 | vty_out(vty, " no"); | |
2421 | vty_out(vty, " isis topology ipv6-dstsrc\n"); | |
2422 | } | |
2423 | ||
9302fbb6 EDP |
2424 | /* |
2425 | * XPath: /frr-interface:lib/interface/frr-isisd:isis/circuit-type | |
2426 | */ | |
ca77b518 | 2427 | DEFPY_YANG(isis_circuit_type, isis_circuit_type_cmd, |
9302fbb6 EDP |
2428 | "isis circuit-type <level-1|level-1-2|level-2-only>$type", |
2429 | "IS-IS routing protocol\n" | |
2430 | "Configure circuit type for interface\n" | |
2431 | "Level-1 only adjacencies are formed\n" | |
2432 | "Level-1-2 adjacencies are formed\n" | |
2433 | "Level-2 only adjacencies are formed\n") | |
2434 | { | |
2435 | nb_cli_enqueue_change( | |
2436 | vty, "./frr-isisd:isis/circuit-type", NB_OP_MODIFY, | |
2437 | strmatch(type, "level-2-only") ? "level-2" : type); | |
2438 | ||
2439 | return nb_cli_apply_changes(vty, NULL); | |
2440 | } | |
2441 | ||
ca77b518 | 2442 | DEFPY_YANG(no_isis_circuit_type, no_isis_circuit_type_cmd, |
9302fbb6 EDP |
2443 | "no isis circuit-type [level-1|level-1-2|level-2-only]", |
2444 | NO_STR | |
2445 | "IS-IS routing protocol\n" | |
2446 | "Configure circuit type for interface\n" | |
2447 | "Level-1 only adjacencies are formed\n" | |
2448 | "Level-1-2 adjacencies are formed\n" | |
2449 | "Level-2 only adjacencies are formed\n") | |
2450 | { | |
8685be73 | 2451 | nb_cli_enqueue_change(vty, "./frr-isisd:isis/circuit-type", |
2f9a06f0 | 2452 | NB_OP_MODIFY, NULL); |
8685be73 RW |
2453 | |
2454 | return nb_cli_apply_changes(vty, NULL); | |
9302fbb6 EDP |
2455 | } |
2456 | ||
25605051 | 2457 | void cli_show_ip_isis_circ_type(struct vty *vty, const struct lyd_node *dnode, |
9302fbb6 EDP |
2458 | bool show_defaults) |
2459 | { | |
2460 | int level = yang_dnode_get_enum(dnode, NULL); | |
2461 | ||
2462 | switch (level) { | |
2463 | case IS_LEVEL_1: | |
2464 | vty_out(vty, " isis circuit-type level-1\n"); | |
2465 | break; | |
2466 | case IS_LEVEL_2: | |
2467 | vty_out(vty, " isis circuit-type level-2-only\n"); | |
2468 | break; | |
2469 | case IS_LEVEL_1_AND_2: | |
2470 | vty_out(vty, " isis circuit-type level-1-2\n"); | |
2471 | break; | |
2472 | } | |
2473 | } | |
2474 | ||
d0820765 EDP |
2475 | /* |
2476 | * XPath: /frr-interface:lib/interface/frr-isisd:isis/network-type | |
2477 | */ | |
ca77b518 | 2478 | DEFPY_YANG(isis_network, isis_network_cmd, "[no] isis network point-to-point", |
d0820765 EDP |
2479 | NO_STR |
2480 | "IS-IS routing protocol\n" | |
2481 | "Set network type\n" | |
2482 | "point-to-point network type\n") | |
2483 | { | |
2484 | nb_cli_enqueue_change(vty, "./frr-isisd:isis/network-type", | |
2485 | NB_OP_MODIFY, | |
2486 | no ? "broadcast" : "point-to-point"); | |
2487 | ||
2488 | return nb_cli_apply_changes(vty, NULL); | |
2489 | } | |
2490 | ||
25605051 IR |
2491 | void cli_show_ip_isis_network_type(struct vty *vty, |
2492 | const struct lyd_node *dnode, | |
d0820765 EDP |
2493 | bool show_defaults) |
2494 | { | |
2495 | if (yang_dnode_get_enum(dnode, NULL) != CIRCUIT_T_P2P) | |
2496 | vty_out(vty, " no"); | |
2497 | ||
2498 | vty_out(vty, " isis network point-to-point\n"); | |
2499 | } | |
2500 | ||
d59c2d6b EDP |
2501 | /* |
2502 | * XPath: /frr-interface:lib/interface/frr-isisd:isis/priority | |
2503 | */ | |
ca77b518 | 2504 | DEFPY_YANG(isis_priority, isis_priority_cmd, |
d59c2d6b EDP |
2505 | "isis priority (0-127)$prio [level-1|level-2]$level", |
2506 | "IS-IS routing protocol\n" | |
2507 | "Set priority for Designated Router election\n" | |
2508 | "Priority value\n" | |
2509 | "Specify priority for level-1 routing\n" | |
2510 | "Specify priority for level-2 routing\n") | |
2511 | { | |
2512 | if (!level || strmatch(level, "level-1")) | |
2513 | nb_cli_enqueue_change(vty, "./frr-isisd:isis/priority/level-1", | |
2514 | NB_OP_MODIFY, prio_str); | |
2515 | if (!level || strmatch(level, "level-2")) | |
2516 | nb_cli_enqueue_change(vty, "./frr-isisd:isis/priority/level-2", | |
2517 | NB_OP_MODIFY, prio_str); | |
2518 | ||
2519 | return nb_cli_apply_changes(vty, NULL); | |
2520 | } | |
2521 | ||
ca77b518 | 2522 | DEFPY_YANG(no_isis_priority, no_isis_priority_cmd, |
d59c2d6b EDP |
2523 | "no isis priority [(0-127)] [level-1|level-2]$level", |
2524 | NO_STR | |
2525 | "IS-IS routing protocol\n" | |
2526 | "Set priority for Designated Router election\n" | |
2527 | "Priority value\n" | |
2528 | "Specify priority for level-1 routing\n" | |
2529 | "Specify priority for level-2 routing\n") | |
2530 | { | |
2531 | if (!level || strmatch(level, "level-1")) | |
2532 | nb_cli_enqueue_change(vty, "./frr-isisd:isis/priority/level-1", | |
2533 | NB_OP_MODIFY, NULL); | |
2534 | if (!level || strmatch(level, "level-2")) | |
2535 | nb_cli_enqueue_change(vty, "./frr-isisd:isis/priority/level-2", | |
2536 | NB_OP_MODIFY, NULL); | |
2537 | ||
2538 | return nb_cli_apply_changes(vty, NULL); | |
2539 | } | |
2540 | ||
25605051 | 2541 | void cli_show_ip_isis_priority(struct vty *vty, const struct lyd_node *dnode, |
d59c2d6b EDP |
2542 | bool show_defaults) |
2543 | { | |
2544 | const char *l1 = yang_dnode_get_string(dnode, "./level-1"); | |
2545 | const char *l2 = yang_dnode_get_string(dnode, "./level-2"); | |
2546 | ||
2547 | if (strmatch(l1, l2)) | |
2548 | vty_out(vty, " isis priority %s\n", l1); | |
2549 | else { | |
2550 | vty_out(vty, " isis priority %s level-1\n", l1); | |
2551 | vty_out(vty, " isis priority %s level-2\n", l2); | |
2552 | } | |
2553 | } | |
2554 | ||
ed5d7032 | 2555 | /* |
d20b14bc RW |
2556 | * XPath: /frr-interface:lib/interface/frr-isisd:isis/fast-reroute |
2557 | */ | |
25605051 | 2558 | void cli_show_ip_isis_frr(struct vty *vty, const struct lyd_node *dnode, |
d20b14bc RW |
2559 | bool show_defaults) |
2560 | { | |
2561 | bool l1_enabled, l2_enabled; | |
2562 | bool l1_node_protection, l2_node_protection; | |
ce4eccfa | 2563 | bool l1_link_fallback, l2_link_fallback; |
d20b14bc RW |
2564 | |
2565 | /* Classic LFA */ | |
2566 | l1_enabled = yang_dnode_get_bool(dnode, "./level-1/lfa/enable"); | |
2567 | l2_enabled = yang_dnode_get_bool(dnode, "./level-2/lfa/enable"); | |
2568 | ||
2569 | if (l1_enabled || l2_enabled) { | |
2570 | if (l1_enabled == l2_enabled) { | |
2571 | vty_out(vty, " isis fast-reroute lfa\n"); | |
2572 | vty_out(vty, "\n"); | |
2573 | } else { | |
2574 | if (l1_enabled) | |
2575 | vty_out(vty, | |
2576 | " isis fast-reroute lfa level-1\n"); | |
2577 | if (l2_enabled) | |
2578 | vty_out(vty, | |
2579 | " isis fast-reroute lfa level-2\n"); | |
2580 | } | |
2581 | } | |
2582 | ||
381200be RW |
2583 | /* Remote LFA */ |
2584 | l1_enabled = yang_dnode_get_bool(dnode, "./level-1/remote-lfa/enable"); | |
2585 | l2_enabled = yang_dnode_get_bool(dnode, "./level-2/remote-lfa/enable"); | |
2586 | ||
2587 | if (l1_enabled || l2_enabled) { | |
2588 | if (l1_enabled == l2_enabled) { | |
2589 | vty_out(vty, | |
2590 | " isis fast-reroute remote-lfa tunnel mpls-ldp\n"); | |
2591 | vty_out(vty, "\n"); | |
2592 | } else { | |
2593 | if (l1_enabled) | |
2594 | vty_out(vty, | |
2595 | " isis fast-reroute remote-lfa tunnel mpls-ldp level-1\n"); | |
2596 | if (l2_enabled) | |
2597 | vty_out(vty, | |
2598 | " isis fast-reroute remote-lfa tunnel mpls-ldp level-2\n"); | |
2599 | } | |
2600 | } | |
2601 | ||
d20b14bc RW |
2602 | /* TI-LFA */ |
2603 | l1_enabled = yang_dnode_get_bool(dnode, "./level-1/ti-lfa/enable"); | |
2604 | l2_enabled = yang_dnode_get_bool(dnode, "./level-2/ti-lfa/enable"); | |
2605 | l1_node_protection = | |
2606 | yang_dnode_get_bool(dnode, "./level-1/ti-lfa/node-protection"); | |
2607 | l2_node_protection = | |
2608 | yang_dnode_get_bool(dnode, "./level-2/ti-lfa/node-protection"); | |
ce4eccfa FR |
2609 | l1_link_fallback = |
2610 | yang_dnode_get_bool(dnode, "./level-1/ti-lfa/link-fallback"); | |
2611 | l2_link_fallback = | |
2612 | yang_dnode_get_bool(dnode, "./level-2/ti-lfa/link-fallback"); | |
2613 | ||
d20b14bc RW |
2614 | |
2615 | if (l1_enabled || l2_enabled) { | |
2616 | if (l1_enabled == l2_enabled | |
ce4eccfa FR |
2617 | && l1_node_protection == l2_node_protection |
2618 | && l1_link_fallback == l2_link_fallback) { | |
d20b14bc RW |
2619 | vty_out(vty, " isis fast-reroute ti-lfa"); |
2620 | if (l1_node_protection) | |
2621 | vty_out(vty, " node-protection"); | |
ce4eccfa FR |
2622 | if (l1_link_fallback) |
2623 | vty_out(vty, " link-fallback"); | |
d20b14bc RW |
2624 | vty_out(vty, "\n"); |
2625 | } else { | |
2626 | if (l1_enabled) { | |
2627 | vty_out(vty, | |
2628 | " isis fast-reroute ti-lfa level-1"); | |
2629 | if (l1_node_protection) | |
2630 | vty_out(vty, " node-protection"); | |
ce4eccfa FR |
2631 | if (l1_link_fallback) |
2632 | vty_out(vty, " link-fallback"); | |
d20b14bc RW |
2633 | vty_out(vty, "\n"); |
2634 | } | |
2635 | if (l2_enabled) { | |
2636 | vty_out(vty, | |
2637 | " isis fast-reroute ti-lfa level-2"); | |
2638 | if (l2_node_protection) | |
2639 | vty_out(vty, " node-protection"); | |
ce4eccfa FR |
2640 | if (l2_link_fallback) |
2641 | vty_out(vty, " link-fallback"); | |
d20b14bc RW |
2642 | vty_out(vty, "\n"); |
2643 | } | |
2644 | } | |
2645 | } | |
2646 | } | |
2647 | ||
2648 | /* | |
2649 | * XPath: /frr-interface:lib/interface/frr-isisd:isis/fast-reroute/level-{1,2}/lfa/enable | |
2650 | */ | |
2651 | DEFPY(isis_lfa, isis_lfa_cmd, | |
2652 | "[no] isis fast-reroute lfa [level-1|level-2]$level", | |
2653 | NO_STR | |
2654 | "IS-IS routing protocol\n" | |
2655 | "Interface IP Fast-reroute configuration\n" | |
2656 | "Enable LFA computation\n" | |
2657 | "Enable LFA computation for Level 1 only\n" | |
2658 | "Enable LFA computation for Level 2 only\n") | |
2659 | { | |
2660 | if (!level || strmatch(level, "level-1")) { | |
2661 | if (no) { | |
2662 | nb_cli_enqueue_change( | |
2663 | vty, | |
2664 | "./frr-isisd:isis/fast-reroute/level-1/lfa/enable", | |
2665 | NB_OP_MODIFY, "false"); | |
2666 | } else { | |
2667 | nb_cli_enqueue_change( | |
2668 | vty, | |
2669 | "./frr-isisd:isis/fast-reroute/level-1/lfa/enable", | |
2670 | NB_OP_MODIFY, "true"); | |
2671 | } | |
2672 | } | |
2673 | if (!level || strmatch(level, "level-2")) { | |
2674 | if (no) { | |
2675 | nb_cli_enqueue_change( | |
2676 | vty, | |
2677 | "./frr-isisd:isis/fast-reroute/level-2/lfa/enable", | |
2678 | NB_OP_MODIFY, "false"); | |
2679 | } else { | |
2680 | nb_cli_enqueue_change( | |
2681 | vty, | |
2682 | "./frr-isisd:isis/fast-reroute/level-2/lfa/enable", | |
2683 | NB_OP_MODIFY, "true"); | |
2684 | } | |
2685 | } | |
2686 | ||
2687 | return nb_cli_apply_changes(vty, NULL); | |
2688 | } | |
2689 | ||
2690 | /* | |
2691 | * XPath: | |
2692 | * /frr-interface:lib/interface/frr-isisd:isis/fast-reroute/level-{1,2}/lfa/exclude-interface | |
2693 | */ | |
2694 | DEFPY(isis_lfa_exclude_interface, isis_lfa_exclude_interface_cmd, | |
2695 | "[no] isis fast-reroute lfa [level-1|level-2]$level exclude interface IFNAME$ifname", | |
2696 | NO_STR | |
2697 | "IS-IS routing protocol\n" | |
2698 | "Interface IP Fast-reroute configuration\n" | |
2699 | "Enable LFA computation\n" | |
2700 | "Enable LFA computation for Level 1 only\n" | |
2701 | "Enable LFA computation for Level 2 only\n" | |
2702 | "FRR exclusion information\n" | |
2703 | "Exclude an interface from computation\n" | |
2704 | "Interface name\n") | |
2705 | { | |
2706 | if (!level || strmatch(level, "level-1")) { | |
2707 | if (no) { | |
2708 | nb_cli_enqueue_change( | |
2709 | vty, | |
2710 | "./frr-isisd:isis/fast-reroute/level-1/lfa/exclude-interface", | |
2711 | NB_OP_DESTROY, ifname); | |
2712 | } else { | |
2713 | nb_cli_enqueue_change( | |
2714 | vty, | |
2715 | "./frr-isisd:isis/fast-reroute/level-1/lfa/exclude-interface", | |
2716 | NB_OP_CREATE, ifname); | |
2717 | } | |
2718 | } | |
2719 | if (!level || strmatch(level, "level-2")) { | |
2720 | if (no) { | |
2721 | nb_cli_enqueue_change( | |
2722 | vty, | |
2723 | "./frr-isisd:isis/fast-reroute/level-2/lfa/exclude-interface", | |
2724 | NB_OP_DESTROY, ifname); | |
2725 | } else { | |
2726 | nb_cli_enqueue_change( | |
2727 | vty, | |
2728 | "./frr-isisd:isis/fast-reroute/level-2/lfa/exclude-interface", | |
2729 | NB_OP_CREATE, ifname); | |
2730 | } | |
2731 | } | |
2732 | ||
2733 | return nb_cli_apply_changes(vty, NULL); | |
2734 | } | |
2735 | ||
25605051 IR |
2736 | void cli_show_frr_lfa_exclude_interface(struct vty *vty, |
2737 | const struct lyd_node *dnode, | |
d20b14bc RW |
2738 | bool show_defaults) |
2739 | { | |
2740 | vty_out(vty, " isis fast-reroute lfa %s exclude interface %s\n", | |
2741 | dnode->parent->parent->schema->name, | |
2742 | yang_dnode_get_string(dnode, NULL)); | |
2743 | } | |
2744 | ||
381200be RW |
2745 | /* |
2746 | * XPath: | |
2747 | * /frr-interface:lib/interface/frr-isisd:isis/fast-reroute/level-{1,2}/remote-lfa/enable | |
2748 | */ | |
2749 | DEFPY(isis_remote_lfa, isis_remote_lfa_cmd, | |
2750 | "[no] isis fast-reroute remote-lfa tunnel mpls-ldp [level-1|level-2]$level", | |
2751 | NO_STR | |
2752 | "IS-IS routing protocol\n" | |
2753 | "Interface IP Fast-reroute configuration\n" | |
2754 | "Enable remote LFA computation\n" | |
2755 | "Enable remote LFA computation using tunnels\n" | |
2756 | "Use MPLS LDP tunnel to reach the remote LFA node\n" | |
2757 | "Enable LFA computation for Level 1 only\n" | |
2758 | "Enable LFA computation for Level 2 only\n") | |
2759 | { | |
2760 | if (!level || strmatch(level, "level-1")) { | |
2761 | if (no) { | |
2762 | nb_cli_enqueue_change( | |
2763 | vty, | |
2764 | "./frr-isisd:isis/fast-reroute/level-1/remote-lfa/enable", | |
2765 | NB_OP_MODIFY, "false"); | |
2766 | } else { | |
2767 | nb_cli_enqueue_change( | |
2768 | vty, | |
2769 | "./frr-isisd:isis/fast-reroute/level-1/remote-lfa/enable", | |
2770 | NB_OP_MODIFY, "true"); | |
2771 | } | |
2772 | } | |
2773 | if (!level || strmatch(level, "level-2")) { | |
2774 | if (no) { | |
2775 | nb_cli_enqueue_change( | |
2776 | vty, | |
2777 | "./frr-isisd:isis/fast-reroute/level-2/remote-lfa/enable", | |
2778 | NB_OP_MODIFY, "false"); | |
2779 | } else { | |
2780 | nb_cli_enqueue_change( | |
2781 | vty, | |
2782 | "./frr-isisd:isis/fast-reroute/level-2/remote-lfa/enable", | |
2783 | NB_OP_MODIFY, "true"); | |
2784 | } | |
2785 | } | |
2786 | ||
2787 | return nb_cli_apply_changes(vty, NULL); | |
2788 | } | |
2789 | ||
2790 | /* | |
2791 | * XPath: | |
2792 | * /frr-interface:lib/interface/frr-isisd:isis/fast-reroute/level-{1,2}/remote-lfa/maximum-metric | |
2793 | */ | |
2794 | DEFPY(isis_remote_lfa_max_metric, isis_remote_lfa_max_metric_cmd, | |
2795 | "[no] isis fast-reroute remote-lfa maximum-metric (1-16777215)$metric [level-1|level-2]$level", | |
2796 | NO_STR | |
2797 | "IS-IS routing protocol\n" | |
2798 | "Interface IP Fast-reroute configuration\n" | |
2799 | "Enable remote LFA computation\n" | |
2800 | "Limit remote LFA node selection within the metric\n" | |
2801 | "Value of the metric\n" | |
2802 | "Enable LFA computation for Level 1 only\n" | |
2803 | "Enable LFA computation for Level 2 only\n") | |
2804 | { | |
2805 | if (!level || strmatch(level, "level-1")) { | |
2806 | if (no) { | |
2807 | nb_cli_enqueue_change( | |
2808 | vty, | |
2809 | "./frr-isisd:isis/fast-reroute/level-1/remote-lfa/maximum-metric", | |
2810 | NB_OP_DESTROY, NULL); | |
2811 | } else { | |
2812 | nb_cli_enqueue_change( | |
2813 | vty, | |
2814 | "./frr-isisd:isis/fast-reroute/level-1/remote-lfa/maximum-metric", | |
2815 | NB_OP_MODIFY, metric_str); | |
2816 | } | |
2817 | } | |
2818 | if (!level || strmatch(level, "level-2")) { | |
2819 | if (no) { | |
2820 | nb_cli_enqueue_change( | |
2821 | vty, | |
2822 | "./frr-isisd:isis/fast-reroute/level-2/remote-lfa/maximum-metric", | |
2823 | NB_OP_DESTROY, NULL); | |
2824 | } else { | |
2825 | nb_cli_enqueue_change( | |
2826 | vty, | |
2827 | "./frr-isisd:isis/fast-reroute/level-2/remote-lfa/maximum-metric", | |
2828 | NB_OP_MODIFY, metric_str); | |
2829 | } | |
2830 | } | |
2831 | ||
2832 | return nb_cli_apply_changes(vty, NULL); | |
2833 | } | |
2834 | ||
25605051 IR |
2835 | void cli_show_frr_remote_lfa_max_metric(struct vty *vty, |
2836 | const struct lyd_node *dnode, | |
381200be RW |
2837 | bool show_defaults) |
2838 | { | |
2839 | vty_out(vty, " isis fast-reroute remote-lfa maximum-metric %s %s\n", | |
2840 | yang_dnode_get_string(dnode, NULL), | |
2841 | dnode->parent->parent->schema->name); | |
2842 | } | |
2843 | ||
d20b14bc RW |
2844 | /* |
2845 | * XPath: /frr-interface:lib/interface/frr-isisd:isis/fast-reroute/level-{1,2}/ti-lfa/enable | |
ed5d7032 RW |
2846 | */ |
2847 | DEFPY(isis_ti_lfa, isis_ti_lfa_cmd, | |
ce4eccfa | 2848 | "[no] isis fast-reroute ti-lfa [level-1|level-2]$level [node-protection$node_protection [link-fallback$link_fallback]]", |
ed5d7032 RW |
2849 | NO_STR |
2850 | "IS-IS routing protocol\n" | |
2851 | "Interface IP Fast-reroute configuration\n" | |
2852 | "Enable TI-LFA computation\n" | |
2853 | "Enable TI-LFA computation for Level 1 only\n" | |
2854 | "Enable TI-LFA computation for Level 2 only\n" | |
ce4eccfa FR |
2855 | "Protect against node failures\n" |
2856 | "Enable link-protection fallback\n") | |
ed5d7032 RW |
2857 | { |
2858 | if (!level || strmatch(level, "level-1")) { | |
2859 | if (no) { | |
2860 | nb_cli_enqueue_change( | |
2861 | vty, | |
2862 | "./frr-isisd:isis/fast-reroute/level-1/ti-lfa/enable", | |
2863 | NB_OP_MODIFY, "false"); | |
2864 | nb_cli_enqueue_change( | |
2865 | vty, | |
2866 | "./frr-isisd:isis/fast-reroute/level-1/ti-lfa/node-protection", | |
2867 | NB_OP_MODIFY, "false"); | |
ce4eccfa FR |
2868 | nb_cli_enqueue_change( |
2869 | vty, | |
2870 | "./frr-isisd:isis/fast-reroute/level-1/ti-lfa/link-fallback", | |
2871 | NB_OP_MODIFY, "false"); | |
ed5d7032 RW |
2872 | } else { |
2873 | nb_cli_enqueue_change( | |
2874 | vty, | |
2875 | "./frr-isisd:isis/fast-reroute/level-1/ti-lfa/enable", | |
2876 | NB_OP_MODIFY, "true"); | |
2877 | nb_cli_enqueue_change( | |
2878 | vty, | |
2879 | "./frr-isisd:isis/fast-reroute/level-1/ti-lfa/node-protection", | |
2880 | NB_OP_MODIFY, | |
2881 | node_protection ? "true" : "false"); | |
ce4eccfa FR |
2882 | nb_cli_enqueue_change( |
2883 | vty, | |
2884 | "./frr-isisd:isis/fast-reroute/level-1/ti-lfa/link-fallback", | |
2885 | NB_OP_MODIFY, link_fallback ? "true" : "false"); | |
ed5d7032 RW |
2886 | } |
2887 | } | |
2888 | if (!level || strmatch(level, "level-2")) { | |
2889 | if (no) { | |
2890 | nb_cli_enqueue_change( | |
2891 | vty, | |
2892 | "./frr-isisd:isis/fast-reroute/level-2/ti-lfa/enable", | |
2893 | NB_OP_MODIFY, "false"); | |
2894 | nb_cli_enqueue_change( | |
2895 | vty, | |
2896 | "./frr-isisd:isis/fast-reroute/level-2/ti-lfa/node-protection", | |
2897 | NB_OP_MODIFY, "false"); | |
ce4eccfa FR |
2898 | nb_cli_enqueue_change( |
2899 | vty, | |
2900 | "./frr-isisd:isis/fast-reroute/level-2/ti-lfa/link-fallback", | |
2901 | NB_OP_MODIFY, "false"); | |
ed5d7032 RW |
2902 | } else { |
2903 | nb_cli_enqueue_change( | |
2904 | vty, | |
2905 | "./frr-isisd:isis/fast-reroute/level-2/ti-lfa/enable", | |
2906 | NB_OP_MODIFY, "true"); | |
2907 | nb_cli_enqueue_change( | |
2908 | vty, | |
2909 | "./frr-isisd:isis/fast-reroute/level-2/ti-lfa/node-protection", | |
2910 | NB_OP_MODIFY, | |
2911 | node_protection ? "true" : "false"); | |
ce4eccfa FR |
2912 | nb_cli_enqueue_change( |
2913 | vty, | |
2914 | "./frr-isisd:isis/fast-reroute/level-2/ti-lfa/link-fallback", | |
2915 | NB_OP_MODIFY, link_fallback ? "true" : "false"); | |
ed5d7032 RW |
2916 | } |
2917 | } | |
2918 | ||
2919 | return nb_cli_apply_changes(vty, NULL); | |
2920 | } | |
2921 | ||
2adf66ff EDP |
2922 | /* |
2923 | * XPath: /frr-isisd:isis/instance/log-adjacency-changes | |
2924 | */ | |
ca77b518 | 2925 | DEFPY_YANG(log_adj_changes, log_adj_changes_cmd, "[no] log-adjacency-changes", |
2adf66ff EDP |
2926 | NO_STR "Log changes in adjacency state\n") |
2927 | { | |
5f1e5e3f EDP |
2928 | nb_cli_enqueue_change(vty, "./log-adjacency-changes", NB_OP_MODIFY, |
2929 | no ? "false" : "true"); | |
2adf66ff EDP |
2930 | |
2931 | return nb_cli_apply_changes(vty, NULL); | |
2932 | } | |
2933 | ||
25605051 | 2934 | void cli_show_isis_log_adjacency(struct vty *vty, const struct lyd_node *dnode, |
2adf66ff EDP |
2935 | bool show_defaults) |
2936 | { | |
5f1e5e3f EDP |
2937 | if (!yang_dnode_get_bool(dnode, NULL)) |
2938 | vty_out(vty, " no"); | |
2adf66ff EDP |
2939 | vty_out(vty, " log-adjacency-changes\n"); |
2940 | } | |
2941 | ||
1cbf96a8 | 2942 | /* |
2943 | * XPath: /frr-isisd:isis/instance/mpls/ldp-sync | |
2944 | */ | |
2945 | DEFPY(isis_mpls_ldp_sync, isis_mpls_ldp_sync_cmd, "mpls ldp-sync", | |
2946 | MPLS_STR MPLS_LDP_SYNC_STR) | |
2947 | { | |
2948 | nb_cli_enqueue_change(vty, "./mpls/ldp-sync", NB_OP_CREATE, NULL); | |
2949 | ||
2950 | return nb_cli_apply_changes(vty, NULL); | |
2951 | } | |
2952 | ||
2953 | DEFPY(no_isis_mpls_ldp_sync, no_isis_mpls_ldp_sync_cmd, "no mpls ldp-sync", | |
2954 | NO_STR MPLS_STR NO_MPLS_LDP_SYNC_STR) | |
2955 | { | |
2956 | nb_cli_enqueue_change(vty, "./mpls/ldp-sync", NB_OP_DESTROY, NULL); | |
2957 | ||
2958 | return nb_cli_apply_changes(vty, NULL); | |
2959 | } | |
2960 | ||
25605051 | 2961 | void cli_show_isis_mpls_ldp_sync(struct vty *vty, const struct lyd_node *dnode, |
1cbf96a8 | 2962 | bool show_defaults) |
2963 | { | |
2964 | vty_out(vty, " mpls ldp-sync\n"); | |
2965 | } | |
2966 | ||
2967 | DEFPY(isis_mpls_ldp_sync_holddown, isis_mpls_ldp_sync_holddown_cmd, | |
2968 | "mpls ldp-sync holddown (0-10000)", | |
2969 | MPLS_STR MPLS_LDP_SYNC_STR | |
2970 | "Time to wait for LDP-SYNC to occur before restoring interface metric\n" | |
2971 | "Time in seconds\n") | |
2972 | { | |
2973 | nb_cli_enqueue_change(vty, "./mpls/ldp-sync/holddown", NB_OP_MODIFY, | |
2974 | holddown_str); | |
2975 | ||
2976 | return nb_cli_apply_changes(vty, NULL); | |
2977 | } | |
2978 | ||
2979 | DEFPY(no_isis_mpls_ldp_sync_holddown, no_isis_mpls_ldp_sync_holddown_cmd, | |
2980 | "no mpls ldp-sync holddown [<(1-10000)>]", | |
31011d9c | 2981 | NO_STR MPLS_STR MPLS_LDP_SYNC_STR NO_MPLS_LDP_SYNC_HOLDDOWN_STR "Time in seconds\n") |
1cbf96a8 | 2982 | { |
2983 | nb_cli_enqueue_change(vty, "./mpls/ldp-sync/holddown", NB_OP_DESTROY, | |
2984 | NULL); | |
2985 | ||
2986 | return nb_cli_apply_changes(vty, NULL); | |
2987 | } | |
2988 | ||
2989 | void cli_show_isis_mpls_ldp_sync_holddown(struct vty *vty, | |
25605051 | 2990 | const struct lyd_node *dnode, |
1cbf96a8 | 2991 | bool show_defaults) |
2992 | { | |
2993 | vty_out(vty, " mpls ldp-sync holddown %s\n", | |
2994 | yang_dnode_get_string(dnode, NULL)); | |
2995 | } | |
2996 | ||
2997 | /* | |
2998 | * XPath: /frr-interface:lib/interface/frr-isisd:isis/mpls/ldp-sync | |
2999 | */ | |
3000 | DEFPY(isis_mpls_if_ldp_sync, isis_mpls_if_ldp_sync_cmd, | |
3001 | "[no] isis mpls ldp-sync", | |
3002 | NO_STR "IS-IS routing protocol\n" MPLS_STR MPLS_LDP_SYNC_STR) | |
3003 | { | |
3004 | const struct lyd_node *dnode; | |
1cbf96a8 | 3005 | |
3bb513c3 CH |
3006 | dnode = yang_dnode_getf(vty->candidate_config->dnode, |
3007 | "%s/frr-isisd:isis", VTY_CURR_XPATH); | |
1cbf96a8 | 3008 | if (dnode == NULL) { |
3009 | vty_out(vty, "ISIS is not enabled on this circuit\n"); | |
3010 | return CMD_SUCCESS; | |
3011 | } | |
3012 | ||
1cbf96a8 | 3013 | nb_cli_enqueue_change(vty, "./frr-isisd:isis/mpls/ldp-sync", |
3014 | NB_OP_MODIFY, no ? "false" : "true"); | |
3015 | ||
3016 | return nb_cli_apply_changes(vty, NULL); | |
3017 | } | |
3018 | ||
3019 | ||
25605051 IR |
3020 | void cli_show_isis_mpls_if_ldp_sync(struct vty *vty, |
3021 | const struct lyd_node *dnode, | |
1cbf96a8 | 3022 | bool show_defaults) |
3023 | { | |
3024 | if (!yang_dnode_get_bool(dnode, NULL)) | |
3025 | vty_out(vty, " no"); | |
3026 | ||
3027 | vty_out(vty, " isis mpls ldp-sync\n"); | |
3028 | } | |
3029 | ||
3030 | DEFPY(isis_mpls_if_ldp_sync_holddown, isis_mpls_if_ldp_sync_holddown_cmd, | |
3031 | "isis mpls ldp-sync holddown (0-10000)", | |
3032 | "IS-IS routing protocol\n" MPLS_STR MPLS_LDP_SYNC_STR | |
3033 | "Time to wait for LDP-SYNC to occur before restoring interface metric\n" | |
3034 | "Time in seconds\n") | |
3035 | { | |
3036 | const struct lyd_node *dnode; | |
1cbf96a8 | 3037 | |
3bb513c3 CH |
3038 | dnode = yang_dnode_getf(vty->candidate_config->dnode, |
3039 | "%s/frr-isisd:isis", VTY_CURR_XPATH); | |
1cbf96a8 | 3040 | if (dnode == NULL) { |
3041 | vty_out(vty, "ISIS is not enabled on this circuit\n"); | |
3042 | return CMD_SUCCESS; | |
3043 | } | |
3044 | ||
1cbf96a8 | 3045 | nb_cli_enqueue_change(vty, "./frr-isisd:isis/mpls/holddown", |
3046 | NB_OP_MODIFY, holddown_str); | |
3047 | ||
3048 | return nb_cli_apply_changes(vty, NULL); | |
3049 | } | |
3050 | ||
3051 | DEFPY(no_isis_mpls_if_ldp_sync_holddown, no_isis_mpls_if_ldp_sync_holddown_cmd, | |
3052 | "no isis mpls ldp-sync holddown [<(1-10000)>]", | |
3053 | NO_STR "IS-IS routing protocol\n" MPLS_STR NO_MPLS_LDP_SYNC_STR | |
31011d9c | 3054 | NO_MPLS_LDP_SYNC_HOLDDOWN_STR "Time in seconds\n") |
1cbf96a8 | 3055 | { |
3056 | const struct lyd_node *dnode; | |
1cbf96a8 | 3057 | |
3bb513c3 CH |
3058 | dnode = yang_dnode_getf(vty->candidate_config->dnode, |
3059 | "%s/frr-isisd:isis", VTY_CURR_XPATH); | |
1cbf96a8 | 3060 | if (dnode == NULL) { |
3061 | vty_out(vty, "ISIS is not enabled on this circuit\n"); | |
3062 | return CMD_SUCCESS; | |
3063 | } | |
3064 | ||
1cbf96a8 | 3065 | nb_cli_enqueue_change(vty, "./frr-isisd:isis/mpls/holddown", |
3066 | NB_OP_DESTROY, NULL); | |
3067 | ||
3068 | return nb_cli_apply_changes(vty, NULL); | |
3069 | } | |
3070 | ||
3071 | void cli_show_isis_mpls_if_ldp_sync_holddown(struct vty *vty, | |
25605051 | 3072 | const struct lyd_node *dnode, |
1cbf96a8 | 3073 | bool show_defaults) |
3074 | { | |
3075 | vty_out(vty, " isis mpls ldp-sync holddown %s\n", | |
3076 | yang_dnode_get_string(dnode, NULL)); | |
3077 | } | |
3078 | ||
20bd27e2 EDP |
3079 | void isis_cli_init(void) |
3080 | { | |
aaf2fd21 EDP |
3081 | install_element(CONFIG_NODE, &router_isis_cmd); |
3082 | install_element(CONFIG_NODE, &no_router_isis_cmd); | |
3083 | ||
3084 | install_element(INTERFACE_NODE, &ip_router_isis_cmd); | |
1457b1d5 | 3085 | install_element(INTERFACE_NODE, &ip_router_isis_vrf_cmd); |
aaf2fd21 | 3086 | install_element(INTERFACE_NODE, &ip6_router_isis_cmd); |
1457b1d5 | 3087 | install_element(INTERFACE_NODE, &ip6_router_isis_vrf_cmd); |
aaf2fd21 | 3088 | install_element(INTERFACE_NODE, &no_ip_router_isis_cmd); |
1457b1d5 | 3089 | install_element(INTERFACE_NODE, &no_ip_router_isis_vrf_cmd); |
c3e6ac0b | 3090 | install_element(INTERFACE_NODE, &isis_bfd_cmd); |
4affdba7 | 3091 | install_element(INTERFACE_NODE, &isis_bfd_profile_cmd); |
f084ea55 EDP |
3092 | |
3093 | install_element(ISIS_NODE, &net_cmd); | |
e6bdae69 EDP |
3094 | |
3095 | install_element(ISIS_NODE, &is_type_cmd); | |
3096 | install_element(ISIS_NODE, &no_is_type_cmd); | |
6bb043cd EDP |
3097 | |
3098 | install_element(ISIS_NODE, &dynamic_hostname_cmd); | |
05a3f9f0 EDP |
3099 | |
3100 | install_element(ISIS_NODE, &set_overload_bit_cmd); | |
f3abc412 | 3101 | install_element(ISIS_NODE, &attached_bit_send_cmd); |
3102 | install_element(ISIS_NODE, &attached_bit_receive_ignore_cmd); | |
e0df3206 EDP |
3103 | |
3104 | install_element(ISIS_NODE, &metric_style_cmd); | |
3105 | install_element(ISIS_NODE, &no_metric_style_cmd); | |
933536e3 EDP |
3106 | |
3107 | install_element(ISIS_NODE, &area_passwd_cmd); | |
3108 | install_element(ISIS_NODE, &domain_passwd_cmd); | |
3109 | install_element(ISIS_NODE, &no_area_passwd_cmd); | |
1d6fe72e EDP |
3110 | |
3111 | install_element(ISIS_NODE, &lsp_gen_interval_cmd); | |
3112 | install_element(ISIS_NODE, &no_lsp_gen_interval_cmd); | |
7e869004 EDP |
3113 | install_element(ISIS_NODE, &lsp_refresh_interval_cmd); |
3114 | install_element(ISIS_NODE, &no_lsp_refresh_interval_cmd); | |
ea120aa0 EDP |
3115 | install_element(ISIS_NODE, &max_lsp_lifetime_cmd); |
3116 | install_element(ISIS_NODE, &no_max_lsp_lifetime_cmd); | |
d2c970ff EDP |
3117 | install_element(ISIS_NODE, &lsp_timers_cmd); |
3118 | install_element(ISIS_NODE, &no_lsp_timers_cmd); | |
27a45d16 EDP |
3119 | install_element(ISIS_NODE, &area_lsp_mtu_cmd); |
3120 | install_element(ISIS_NODE, &no_area_lsp_mtu_cmd); | |
dcb1dcd6 EDP |
3121 | |
3122 | install_element(ISIS_NODE, &spf_interval_cmd); | |
3123 | install_element(ISIS_NODE, &no_spf_interval_cmd); | |
d20b14bc RW |
3124 | install_element(ISIS_NODE, &spf_prefix_priority_cmd); |
3125 | install_element(ISIS_NODE, &no_spf_prefix_priority_cmd); | |
5336ba30 EDP |
3126 | install_element(ISIS_NODE, &spf_delay_ietf_cmd); |
3127 | install_element(ISIS_NODE, &no_spf_delay_ietf_cmd); | |
66e45e10 EDP |
3128 | |
3129 | install_element(ISIS_NODE, &area_purge_originator_cmd); | |
d1a80ef6 EDP |
3130 | |
3131 | install_element(ISIS_NODE, &isis_mpls_te_on_cmd); | |
3132 | install_element(ISIS_NODE, &no_isis_mpls_te_on_cmd); | |
3133 | install_element(ISIS_NODE, &isis_mpls_te_router_addr_cmd); | |
2e2a8b91 | 3134 | install_element(ISIS_NODE, &no_isis_mpls_te_router_addr_cmd); |
173f8887 OD |
3135 | install_element(ISIS_NODE, &isis_mpls_te_router_addr_v6_cmd); |
3136 | install_element(ISIS_NODE, &no_isis_mpls_te_router_addr_v6_cmd); | |
d1a80ef6 | 3137 | install_element(ISIS_NODE, &isis_mpls_te_inter_as_cmd); |
ed6189a9 OD |
3138 | install_element(ISIS_NODE, &isis_mpls_te_export_cmd); |
3139 | install_element(ISIS_NODE, &no_isis_mpls_te_export_cmd); | |
8b104c10 EDP |
3140 | |
3141 | install_element(ISIS_NODE, &isis_default_originate_cmd); | |
a041ac8e | 3142 | install_element(ISIS_NODE, &isis_redistribute_cmd); |
22af6a80 EDP |
3143 | |
3144 | install_element(ISIS_NODE, &isis_topology_cmd); | |
a6a36c41 | 3145 | |
8f6c8936 RW |
3146 | install_element(ISIS_NODE, &isis_sr_enable_cmd); |
3147 | install_element(ISIS_NODE, &no_isis_sr_enable_cmd); | |
3148 | install_element(ISIS_NODE, &isis_sr_global_block_label_range_cmd); | |
3149 | install_element(ISIS_NODE, &no_isis_sr_global_block_label_range_cmd); | |
3150 | install_element(ISIS_NODE, &isis_sr_node_msd_cmd); | |
3151 | install_element(ISIS_NODE, &no_isis_sr_node_msd_cmd); | |
3152 | install_element(ISIS_NODE, &isis_sr_prefix_sid_cmd); | |
3153 | install_element(ISIS_NODE, &no_isis_sr_prefix_sid_cmd); | |
d20b14bc RW |
3154 | install_element(ISIS_NODE, &isis_frr_lfa_priority_limit_cmd); |
3155 | install_element(ISIS_NODE, &isis_frr_lfa_tiebreaker_cmd); | |
3156 | install_element(ISIS_NODE, &isis_frr_lfa_load_sharing_cmd); | |
381200be RW |
3157 | install_element(ISIS_NODE, &isis_frr_remote_lfa_plist_cmd); |
3158 | install_element(ISIS_NODE, &no_isis_frr_remote_lfa_plist_cmd); | |
8f6c8936 | 3159 | |
a6a36c41 | 3160 | install_element(INTERFACE_NODE, &isis_passive_cmd); |
3e20c83a EDP |
3161 | |
3162 | install_element(INTERFACE_NODE, &isis_passwd_cmd); | |
3163 | install_element(INTERFACE_NODE, &no_isis_passwd_cmd); | |
be49219c EDP |
3164 | |
3165 | install_element(INTERFACE_NODE, &isis_metric_cmd); | |
3166 | install_element(INTERFACE_NODE, &no_isis_metric_cmd); | |
356a2e3c EDP |
3167 | |
3168 | install_element(INTERFACE_NODE, &isis_hello_interval_cmd); | |
3169 | install_element(INTERFACE_NODE, &no_isis_hello_interval_cmd); | |
4e75a67d EDP |
3170 | |
3171 | install_element(INTERFACE_NODE, &isis_hello_multiplier_cmd); | |
3172 | install_element(INTERFACE_NODE, &no_isis_hello_multiplier_cmd); | |
5f2ce446 EDP |
3173 | |
3174 | install_element(INTERFACE_NODE, &isis_threeway_adj_cmd); | |
7b6b75e5 EDP |
3175 | |
3176 | install_element(INTERFACE_NODE, &isis_hello_padding_cmd); | |
9ce808b9 EDP |
3177 | |
3178 | install_element(INTERFACE_NODE, &csnp_interval_cmd); | |
3179 | install_element(INTERFACE_NODE, &no_csnp_interval_cmd); | |
3180 | ||
3181 | install_element(INTERFACE_NODE, &psnp_interval_cmd); | |
3182 | install_element(INTERFACE_NODE, &no_psnp_interval_cmd); | |
83d043f6 EDP |
3183 | |
3184 | install_element(INTERFACE_NODE, &circuit_topology_cmd); | |
9302fbb6 EDP |
3185 | |
3186 | install_element(INTERFACE_NODE, &isis_circuit_type_cmd); | |
3187 | install_element(INTERFACE_NODE, &no_isis_circuit_type_cmd); | |
d0820765 EDP |
3188 | |
3189 | install_element(INTERFACE_NODE, &isis_network_cmd); | |
d59c2d6b EDP |
3190 | |
3191 | install_element(INTERFACE_NODE, &isis_priority_cmd); | |
3192 | install_element(INTERFACE_NODE, &no_isis_priority_cmd); | |
2adf66ff | 3193 | |
d20b14bc RW |
3194 | install_element(INTERFACE_NODE, &isis_lfa_cmd); |
3195 | install_element(INTERFACE_NODE, &isis_lfa_exclude_interface_cmd); | |
381200be RW |
3196 | install_element(INTERFACE_NODE, &isis_remote_lfa_cmd); |
3197 | install_element(INTERFACE_NODE, &isis_remote_lfa_max_metric_cmd); | |
ed5d7032 RW |
3198 | install_element(INTERFACE_NODE, &isis_ti_lfa_cmd); |
3199 | ||
2adf66ff | 3200 | install_element(ISIS_NODE, &log_adj_changes_cmd); |
1cbf96a8 | 3201 | |
3202 | install_element(ISIS_NODE, &isis_mpls_ldp_sync_cmd); | |
3203 | install_element(ISIS_NODE, &no_isis_mpls_ldp_sync_cmd); | |
3204 | install_element(ISIS_NODE, &isis_mpls_ldp_sync_holddown_cmd); | |
3205 | install_element(ISIS_NODE, &no_isis_mpls_ldp_sync_holddown_cmd); | |
3206 | install_element(INTERFACE_NODE, &isis_mpls_if_ldp_sync_cmd); | |
3207 | install_element(INTERFACE_NODE, &isis_mpls_if_ldp_sync_holddown_cmd); | |
3208 | install_element(INTERFACE_NODE, &no_isis_mpls_if_ldp_sync_holddown_cmd); | |
20bd27e2 EDP |
3209 | } |
3210 | ||
3211 | #endif /* ifndef FABRICD */ |