]> git.proxmox.com Git - mirror_frr.git/blame - pimd/pim6_cmd.c
pimd: Modifying member of pim_instance to accomodate IPv6 changes
[mirror_frr.git] / pimd / pim6_cmd.c
CommitLineData
5d613d13
SG
1/*
2 * PIM for IPv6 FRR
3 * Copyright (C) 2022 Vmware, Inc.
4 * Mobashshera Rasool <mrasool@vmware.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; see the file COPYING; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21#include <zebra.h>
22
23#include "lib/json.h"
24#include "command.h"
25#include "if.h"
26#include "prefix.h"
27#include "zclient.h"
28#include "plist.h"
29#include "hash.h"
30#include "nexthop.h"
31#include "vrf.h"
32#include "ferr.h"
33
34#include "pimd.h"
35#include "pim6_cmd.h"
9d6d0270 36#include "pim_cmd_common.h"
5d613d13
SG
37#include "pim_vty.h"
38#include "lib/northbound_cli.h"
39#include "pim_errors.h"
40#include "pim_nb.h"
24de75a2 41#include "pim_addr.h"
9d6d0270 42#include "pim_nht.h"
993e3d8e 43#include "pim_bsm.h"
51491fdc 44#include "pim_iface.h"
09a754ea 45#include "pim_zebra.h"
dcfd5abe 46#include "pim_instance.h"
5d613d13
SG
47
48#ifndef VTYSH_EXTRACT_PL
49#include "pimd/pim6_cmd_clippy.c"
50#endif
51
89f86fe2
SG
52static struct cmd_node debug_node = {
53 .name = "debug",
54 .node = DEBUG_NODE,
55 .prompt = "",
56 .config_write = pim_debug_config_write,
57};
58
c73113ea
MR
59DEFPY (ipv6_pim_joinprune_time,
60 ipv6_pim_joinprune_time_cmd,
61 "ipv6 pim join-prune-interval (1-65535)$jpi",
62 IPV6_STR
63 PIM_STR
64 "Join Prune Send Interval\n"
65 "Seconds\n")
66{
67 return pim_process_join_prune_cmd(vty, jpi_str);
68}
69
70DEFPY (no_ipv6_pim_joinprune_time,
71 no_ipv6_pim_joinprune_time_cmd,
72 "no ipv6 pim join-prune-interval [(1-65535)]",
73 NO_STR
74 IPV6_STR
75 PIM_STR
76 "Join Prune Send Interval\n"
77 IGNORED_IN_NO_STR)
78{
79 return pim_process_no_join_prune_cmd(vty);
80}
81
fb991ce9
MR
82DEFPY (ipv6_pim_spt_switchover_infinity,
83 ipv6_pim_spt_switchover_infinity_cmd,
84 "ipv6 pim spt-switchover infinity-and-beyond",
85 IPV6_STR
86 PIM_STR
87 "SPT-Switchover\n"
88 "Never switch to SPT Tree\n")
89{
90 return pim_process_spt_switchover_infinity_cmd(vty);
91}
92
93DEFPY (ipv6_pim_spt_switchover_infinity_plist,
94 ipv6_pim_spt_switchover_infinity_plist_cmd,
95 "ipv6 pim spt-switchover infinity-and-beyond prefix-list WORD$plist",
96 IPV6_STR
97 PIM_STR
98 "SPT-Switchover\n"
99 "Never switch to SPT Tree\n"
100 "Prefix-List to control which groups to switch\n"
101 "Prefix-List name\n")
102{
103 return pim_process_spt_switchover_prefixlist_cmd(vty, plist);
104}
105
106DEFPY (no_ipv6_pim_spt_switchover_infinity,
107 no_ipv6_pim_spt_switchover_infinity_cmd,
108 "no ipv6 pim spt-switchover infinity-and-beyond",
109 NO_STR
110 IPV6_STR
111 PIM_STR
112 "SPT_Switchover\n"
113 "Never switch to SPT Tree\n")
114{
115 return pim_process_no_spt_switchover_cmd(vty);
116}
117
118DEFPY (no_ipv6_pim_spt_switchover_infinity_plist,
119 no_ipv6_pim_spt_switchover_infinity_plist_cmd,
120 "no ipv6 pim spt-switchover infinity-and-beyond prefix-list WORD",
121 NO_STR
122 IPV6_STR
123 PIM_STR
124 "SPT_Switchover\n"
125 "Never switch to SPT Tree\n"
126 "Prefix-List to control which groups to switch\n"
127 "Prefix-List name\n")
128{
129 return pim_process_no_spt_switchover_cmd(vty);
130}
131
0da72f1f
MR
132DEFPY (ipv6_pim_packets,
133 ipv6_pim_packets_cmd,
134 "ipv6 pim packets (1-255)",
135 IPV6_STR
136 PIM_STR
137 "packets to process at one time per fd\n"
138 "Number of packets\n")
139{
140 return pim_process_pim_packet_cmd(vty, packets_str);
141}
142
143DEFPY (no_ipv6_pim_packets,
144 no_ipv6_pim_packets_cmd,
145 "no ipv6 pim packets [(1-255)]",
146 NO_STR
147 IPV6_STR
148 PIM_STR
149 "packets to process at one time per fd\n"
150 IGNORED_IN_NO_STR)
151{
152 return pim_process_no_pim_packet_cmd(vty);
153}
154
28e32366
MR
155DEFPY (ipv6_pim_keep_alive,
156 ipv6_pim_keep_alive_cmd,
157 "ipv6 pim keep-alive-timer (1-65535)$kat",
158 IPV6_STR
159 PIM_STR
160 "Keep alive Timer\n"
161 "Seconds\n")
162{
163 return pim_process_keepalivetimer_cmd(vty, kat_str);
164}
165
166DEFPY (no_ipv6_pim_keep_alive,
167 no_ipv6_pim_keep_alive_cmd,
168 "no ipv6 pim keep-alive-timer [(1-65535)]",
169 NO_STR
170 IPV6_STR
171 PIM_STR
172 "Keep alive Timer\n"
173 IGNORED_IN_NO_STR)
174{
175 return pim_process_no_keepalivetimer_cmd(vty);
176}
177
2322b991
MR
178DEFPY (ipv6_pim_rp_keep_alive,
179 ipv6_pim_rp_keep_alive_cmd,
180 "ipv6 pim rp keep-alive-timer (1-65535)$kat",
181 IPV6_STR
182 PIM_STR
3d4c3355 183 "Rendezvous Point\n"
2322b991
MR
184 "Keep alive Timer\n"
185 "Seconds\n")
186{
187 return pim_process_rp_kat_cmd(vty, kat_str);
188}
189
190DEFPY (no_ipv6_pim_rp_keep_alive,
191 no_ipv6_pim_rp_keep_alive_cmd,
192 "no ipv6 pim rp keep-alive-timer [(1-65535)]",
193 NO_STR
194 IPV6_STR
195 PIM_STR
3d4c3355 196 "Rendezvous Point\n"
2322b991
MR
197 "Keep alive Timer\n"
198 IGNORED_IN_NO_STR)
199{
200 return pim_process_no_rp_kat_cmd(vty);
201}
202
18ca7de5
MR
203DEFPY (ipv6_pim_register_suppress,
204 ipv6_pim_register_suppress_cmd,
205 "ipv6 pim register-suppress-time (1-65535)$rst",
206 IPV6_STR
207 PIM_STR
208 "Register Suppress Timer\n"
209 "Seconds\n")
210{
211 return pim_process_register_suppress_cmd(vty, rst_str);
212}
213
214DEFPY (no_ipv6_pim_register_suppress,
215 no_ipv6_pim_register_suppress_cmd,
216 "no ipv6 pim register-suppress-time [(1-65535)]",
217 NO_STR
218 IPV6_STR
219 PIM_STR
220 "Register Suppress Timer\n"
221 IGNORED_IN_NO_STR)
222{
223 return pim_process_no_register_suppress_cmd(vty);
224}
225
a1caf7a8 226DEFPY (interface_ipv6_pim,
227 interface_ipv6_pim_cmd,
51491fdc 228 "ipv6 pim [passive$passive]",
a1caf7a8 229 IPV6_STR
51491fdc 230 PIM_STR
231 "Disable exchange of protocol packets\n")
a1caf7a8 232{
51491fdc 233 int ret;
51491fdc 234
235 ret = pim_process_ip_pim_cmd(vty);
236
237 if (ret != NB_OK)
238 return ret;
239
51491fdc 240 if (passive)
9726536d 241 return pim_process_ip_pim_passive_cmd(vty, true);
51491fdc 242
243 return CMD_SUCCESS;
a1caf7a8 244}
245
246DEFPY (interface_no_ipv6_pim,
247 interface_no_ipv6_pim_cmd,
51491fdc 248 "no ipv6 pim [passive$passive]",
a1caf7a8 249 NO_STR
250 IPV6_STR
51491fdc 251 PIM_STR
252 "Disable exchange of protocol packets\n")
a1caf7a8 253{
51491fdc 254 if (passive)
9726536d 255 return pim_process_ip_pim_passive_cmd(vty, false);
51491fdc 256
9726536d 257 return pim_process_no_ip_pim_cmd(vty);
a1caf7a8 258}
259
bb387611 260DEFPY (interface_ipv6_pim_drprio,
261 interface_ipv6_pim_drprio_cmd,
262 "ipv6 pim drpriority (1-4294967295)",
263 IPV6_STR
264 PIM_STR
265 "Set the Designated Router Election Priority\n"
266 "Value of the new DR Priority\n")
267{
268 return pim_process_ip_pim_drprio_cmd(vty, drpriority_str);
269}
270
271DEFPY (interface_no_ipv6_pim_drprio,
272 interface_no_ipv6_pim_drprio_cmd,
273 "no ip pim drpriority [(1-4294967295)]",
274 NO_STR
275 IPV6_STR
276 PIM_STR
277 "Revert the Designated Router Priority to default\n"
278 "Old Value of the Priority\n")
279{
280 return pim_process_no_ip_pim_drprio_cmd(vty);
281}
282
e6aab613 283DEFPY (interface_ipv6_pim_hello,
284 interface_ipv6_pim_hello_cmd,
285 "ipv6 pim hello (1-65535) [(1-65535)]$hold",
286 IPV6_STR
287 PIM_STR
288 IFACE_PIM_HELLO_STR
289 IFACE_PIM_HELLO_TIME_STR
290 IFACE_PIM_HELLO_HOLD_STR)
291{
292 return pim_process_ip_pim_hello_cmd(vty, hello_str, hold_str);
293}
294
295DEFPY (interface_no_ipv6_pim_hello,
296 interface_no_ipv6_pim_hello_cmd,
297 "no ipv6 pim hello [(1-65535) [(1-65535)]]",
298 NO_STR
299 IPV6_STR
300 PIM_STR
301 IFACE_PIM_HELLO_STR
302 IGNORED_IN_NO_STR
303 IGNORED_IN_NO_STR)
304{
305 return pim_process_no_ip_pim_hello_cmd(vty);
306}
307
7e01b641 308DEFPY (interface_ipv6_pim_activeactive,
309 interface_ipv6_pim_activeactive_cmd,
310 "[no] ipv6 pim active-active",
311 NO_STR
312 IPV6_STR
313 PIM_STR
314 "Mark interface as Active-Active for MLAG operations\n")
315{
316 return pim_process_ip_pim_activeactive_cmd(vty, no);
317}
318
dab0ac29 319DEFPY_HIDDEN (interface_ipv6_pim_ssm,
320 interface_ipv6_pim_ssm_cmd,
321 "ipv6 pim ssm",
322 IPV6_STR
323 PIM_STR
324 IFACE_PIM_STR)
325{
326 int ret;
327
328 ret = pim_process_ip_pim_cmd(vty);
329
330 if (ret != NB_OK)
331 return ret;
332
333 vty_out(vty,
334 "Enabled PIM SM on interface; configure PIM SSM range if needed\n");
335
336 return NB_OK;
337}
338
339DEFPY_HIDDEN (interface_no_ipv6_pim_ssm,
340 interface_no_ipv6_pim_ssm_cmd,
341 "no ipv6 pim ssm",
342 NO_STR
343 IPV6_STR
344 PIM_STR
345 IFACE_PIM_STR)
346{
347 return pim_process_no_ip_pim_cmd(vty);
348}
349
2b16b40f 350DEFPY_HIDDEN (interface_ipv6_pim_sm,
351 interface_ipv6_pim_sm_cmd,
352 "ipv6 pim sm",
353 IPV6_STR
354 PIM_STR
355 IFACE_PIM_SM_STR)
356{
357 return pim_process_ip_pim_cmd(vty);
358}
359
360DEFPY_HIDDEN (interface_no_ipv6_pim_sm,
361 interface_no_ipv6_pim_sm_cmd,
362 "no ipv6 pim sm",
363 NO_STR
364 IPV6_STR
365 PIM_STR
366 IFACE_PIM_SM_STR)
367{
368 return pim_process_no_ip_pim_cmd(vty);
369}
370
52c52d78 371/* boundaries */
372DEFPY (interface_ipv6_pim_boundary_oil,
373 interface_ipv6_pim_boundary_oil_cmd,
374 "ipv6 multicast boundary oil WORD",
375 IPV6_STR
376 "Generic multicast configuration options\n"
377 "Define multicast boundary\n"
378 "Filter OIL by group using prefix list\n"
379 "Prefix list to filter OIL with\n")
380{
381 return pim_process_ip_pim_boundary_oil_cmd(vty, oil);
382}
383
384DEFPY (interface_no_ipv6_pim_boundary_oil,
385 interface_no_ipv6_pim_boundary_oil_cmd,
386 "no ipv6 multicast boundary oil [WORD]",
387 NO_STR
388 IPV6_STR
389 "Generic multicast configuration options\n"
390 "Define multicast boundary\n"
391 "Filter OIL by group using prefix list\n"
392 "Prefix list to filter OIL with\n")
393{
394 return pim_process_no_ip_pim_boundary_oil_cmd(vty);
395}
396
63ee25c0 397DEFPY (interface_ipv6_mroute,
398 interface_ipv6_mroute_cmd,
399 "ipv6 mroute INTERFACE X:X::X:X$group [X:X::X:X]$source",
400 IPV6_STR
401 "Add multicast route\n"
402 "Outgoing interface name\n"
403 "Group address\n"
404 "Source address\n")
405{
406 return pim_process_ip_mroute_cmd(vty, interface, group_str, source_str);
407}
408
409DEFPY (interface_no_ipv6_mroute,
410 interface_no_ipv6_mroute_cmd,
411 "no ipv6 mroute INTERFACE X:X::X:X$group [X:X::X:X]$source",
412 NO_STR
413 IPV6_STR
414 "Add multicast route\n"
415 "Outgoing interface name\n"
416 "Group Address\n"
417 "Source Address\n")
418{
419 return pim_process_no_ip_mroute_cmd(vty, interface, group_str,
420 source_str);
421}
422
34b403cf
MR
423DEFPY (ipv6_pim_rp,
424 ipv6_pim_rp_cmd,
425 "ipv6 pim rp X:X::X:X$rp [X:X::X:X/M]$gp",
426 IPV6_STR
427 PIM_STR
428 "Rendezvous Point\n"
429 "ipv6 address of RP\n"
430 "Group Address range to cover\n")
431{
432 const char *group_str = (gp_str) ? gp_str : "FF00::0/8";
433
434 return pim_process_rp_cmd(vty, rp_str, group_str);
435}
436
437DEFPY (no_ipv6_pim_rp,
438 no_ipv6_pim_rp_cmd,
439 "no ipv6 pim rp X:X::X:X$rp [X:X::X:X/M]$gp",
440 NO_STR
441 IPV6_STR
442 PIM_STR
443 "Rendezvous Point\n"
444 "ipv6 address of RP\n"
445 "Group Address range to cover\n")
446{
447 const char *group_str = (gp_str) ? gp_str : "FF00::0/8";
448
449 return pim_process_no_rp_cmd(vty, rp_str, group_str);
450}
451
8663adc4
MR
452DEFPY (ipv6_pim_rp_prefix_list,
453 ipv6_pim_rp_prefix_list_cmd,
454 "ipv6 pim rp X:X::X:X$rp prefix-list WORD$plist",
455 IPV6_STR
456 PIM_STR
457 "Rendezvous Point\n"
458 "ipv6 address of RP\n"
459 "group prefix-list filter\n"
460 "Name of a prefix-list\n")
461{
462 return pim_process_rp_plist_cmd(vty, rp_str, plist);
463}
464
465DEFPY (no_ipv6_pim_rp_prefix_list,
466 no_ipv6_pim_rp_prefix_list_cmd,
467 "no ipv6 pim rp X:X::X:X$rp prefix-list WORD$plist",
468 NO_STR
469 IPV6_STR
470 PIM_STR
471 "Rendezvous Point\n"
472 "ipv6 address of RP\n"
473 "group prefix-list filter\n"
474 "Name of a prefix-list\n")
475{
476 return pim_process_no_rp_plist_cmd(vty, rp_str, plist);
477}
478
a8caf78d
BG
479
480DEFPY (ipv6_ssmpingd,
481 ipv6_ssmpingd_cmd,
482 "ipv6 ssmpingd [X:X::X:X]$source",
483 IPV6_STR
484 CONF_SSMPINGD_STR
485 "Source address\n")
486{
487 const char *src_str = (source_str) ? source_str : "::";
488
489 return pim_process_ssmpingd_cmd(vty, NB_OP_CREATE, src_str);
490}
491
492
493DEFPY (no_ipv6_ssmpingd,
494 no_ipv6_ssmpingd_cmd,
495 "no ipv6 ssmpingd [X:X::X:X]$source",
496 NO_STR
497 IPV6_STR
498 CONF_SSMPINGD_STR
499 "Source address\n")
500{
501 const char *src_str = (source_str) ? source_str : "::";
502
503 return pim_process_ssmpingd_cmd(vty, NB_OP_DESTROY, src_str);
504}
505
fe2df4f7
A
506DEFPY (interface_ipv6_mld_join,
507 interface_ipv6_mld_join_cmd,
508 "ipv6 mld join X:X::X:X$group [X:X::X:X$source]",
509 IPV6_STR
510 IFACE_MLD_STR
511 "MLD join multicast group\n"
512 "Multicast group address\n"
513 "Source address\n")
514{
515 char xpath[XPATH_MAXLEN];
516
517 if (source_str) {
518 if (IPV6_ADDR_SAME(&source, &in6addr_any)) {
519 vty_out(vty, "Bad source address %s\n", source_str);
520 return CMD_WARNING_CONFIG_FAILED;
521 }
522 } else
523 source_str = "::";
524
525 snprintf(xpath, sizeof(xpath), FRR_GMP_JOIN_XPATH, "frr-routing:ipv6",
526 group_str, source_str);
527
528 nb_cli_enqueue_change(vty, xpath, NB_OP_CREATE, NULL);
529
530 return nb_cli_apply_changes(vty, NULL);
531}
532
533DEFPY (interface_no_ipv6_mld_join,
534 interface_no_ipv6_mld_join_cmd,
535 "no ipv6 mld join X:X::X:X$group [X:X::X:X$source]",
536 NO_STR
537 IPV6_STR
538 IFACE_MLD_STR
539 "MLD join multicast group\n"
540 "Multicast group address\n"
541 "Source address\n")
542{
543 char xpath[XPATH_MAXLEN];
544
545 if (source_str) {
546 if (IPV6_ADDR_SAME(&source, &in6addr_any)) {
547 vty_out(vty, "Bad source address %s\n", source_str);
548 return CMD_WARNING_CONFIG_FAILED;
549 }
550 } else
551 source_str = "::";
552
553 snprintf(xpath, sizeof(xpath), FRR_GMP_JOIN_XPATH, "frr-routing:ipv6",
554 group_str, source_str);
555
556 nb_cli_enqueue_change(vty, xpath, NB_OP_DESTROY, NULL);
557
558 return nb_cli_apply_changes(vty, NULL);
559}
560
eaa7d656
A
561DEFPY (interface_ipv6_mld,
562 interface_ipv6_mld_cmd,
563 "ipv6 mld",
564 IPV6_STR
565 IFACE_MLD_STR)
566{
567 nb_cli_enqueue_change(vty, "./enable", NB_OP_MODIFY, "true");
568
569 return nb_cli_apply_changes(vty, FRR_GMP_INTERFACE_XPATH,
570 "frr-routing:ipv6");
571}
572
573DEFPY (interface_no_ipv6_mld,
574 interface_no_ipv6_mld_cmd,
575 "no ipv6 mld",
576 NO_STR
577 IPV6_STR
578 IFACE_MLD_STR)
579{
580 const struct lyd_node *pim_enable_dnode;
12a0d83c 581 char pim_if_xpath[XPATH_MAXLEN + 64];
eaa7d656
A
582
583 snprintf(pim_if_xpath, sizeof(pim_if_xpath),
584 "%s/frr-pim:pim/address-family[address-family='%s']",
585 VTY_CURR_XPATH, "frr-routing:ipv6");
586
587 pim_enable_dnode = yang_dnode_getf(vty->candidate_config->dnode,
588 FRR_PIM_ENABLE_XPATH, VTY_CURR_XPATH,
589 "frr-routing:ipv6");
590 if (!pim_enable_dnode) {
591 nb_cli_enqueue_change(vty, pim_if_xpath, NB_OP_DESTROY, NULL);
592 nb_cli_enqueue_change(vty, ".", NB_OP_DESTROY, NULL);
593 } else {
594 if (!yang_dnode_get_bool(pim_enable_dnode, ".")) {
595 nb_cli_enqueue_change(vty, pim_if_xpath, NB_OP_DESTROY,
596 NULL);
597 nb_cli_enqueue_change(vty, ".", NB_OP_DESTROY, NULL);
598 } else
599 nb_cli_enqueue_change(vty, "./enable", NB_OP_MODIFY,
600 "false");
601 }
602
603 return nb_cli_apply_changes(vty, FRR_GMP_INTERFACE_XPATH,
604 "frr-routing:ipv6");
605}
606
47d4af36
A
607DEFPY (interface_ipv6_mld_version,
608 interface_ipv6_mld_version_cmd,
609 "ipv6 mld version (1-2)$version",
610 IPV6_STR
611 IFACE_MLD_STR
612 "MLD version\n"
613 "MLD version number\n")
614{
615 nb_cli_enqueue_change(vty, "./enable", NB_OP_MODIFY, "true");
616 nb_cli_enqueue_change(vty, "./mld-version", NB_OP_MODIFY, version_str);
617
618 return nb_cli_apply_changes(vty, FRR_GMP_INTERFACE_XPATH,
619 "frr-routing:ipv6");
620}
621
622DEFPY (interface_no_ipv6_mld_version,
623 interface_no_ipv6_mld_version_cmd,
624 "no ipv6 mld version [(1-2)]",
625 NO_STR
626 IPV6_STR
627 IFACE_MLD_STR
628 "MLD version\n"
629 "MLD version number\n")
630{
631 nb_cli_enqueue_change(vty, "./mld-version", NB_OP_DESTROY, NULL);
632
633 return nb_cli_apply_changes(vty, FRR_GMP_INTERFACE_XPATH,
634 "frr-routing:ipv6");
635}
636
5795b17c
A
637DEFPY (interface_ipv6_mld_query_interval,
638 interface_ipv6_mld_query_interval_cmd,
639 "ipv6 mld query-interval (1-65535)$q_interval",
640 IPV6_STR
641 IFACE_MLD_STR
642 IFACE_MLD_QUERY_INTERVAL_STR
643 "Query interval in seconds\n")
644{
645 const struct lyd_node *pim_enable_dnode;
646
647 pim_enable_dnode = yang_dnode_getf(vty->candidate_config->dnode,
648 FRR_PIM_ENABLE_XPATH, VTY_CURR_XPATH,
649 "frr-routing:ipv6");
650 if (!pim_enable_dnode) {
651 nb_cli_enqueue_change(vty, "./enable", NB_OP_MODIFY, "true");
652 } else {
653 if (!yang_dnode_get_bool(pim_enable_dnode, "."))
654 nb_cli_enqueue_change(vty, "./enable", NB_OP_MODIFY,
655 "true");
656 }
657
658 nb_cli_enqueue_change(vty, "./query-interval", NB_OP_MODIFY,
659 q_interval_str);
660
661 return nb_cli_apply_changes(vty, FRR_GMP_INTERFACE_XPATH,
662 "frr-routing:ipv6");
663}
664
665DEFPY (interface_no_ipv6_mld_query_interval,
666 interface_no_ipv6_mld_query_interval_cmd,
667 "no ipv6 mld query-interval [(1-65535)]",
668 NO_STR
669 IPV6_STR
670 IFACE_MLD_STR
671 IFACE_MLD_QUERY_INTERVAL_STR
672 IGNORED_IN_NO_STR)
673{
674 nb_cli_enqueue_change(vty, "./query-interval", NB_OP_DESTROY, NULL);
675
676 return nb_cli_apply_changes(vty, FRR_GMP_INTERFACE_XPATH,
677 "frr-routing:ipv6");
678}
679
fb005412
SG
680DEFPY (ipv6_mld_group_watermark,
681 ipv6_mld_group_watermark_cmd,
1881b5c0
SG
682 "ipv6 mld watermark-warn (1-65535)$limit",
683 IPV6_STR
684 MLD_STR
685 "Configure group limit for watermark warning\n"
686 "Group count to generate watermark warning\n")
687{
0cbed951
DL
688 PIM_DECLVAR_CONTEXT_VRF(vrf, pim);
689
229a20e2 690 /* TBD Depends on MLD data structure changes */
0cbed951
DL
691 (void)pim;
692
1881b5c0
SG
693 return CMD_SUCCESS;
694}
695
fb005412
SG
696DEFPY (no_ipv6_mld_group_watermark,
697 no_ipv6_mld_group_watermark_cmd,
1881b5c0
SG
698 "no ipv6 mld watermark-warn [(1-65535)$limit]",
699 NO_STR
700 IPV6_STR
701 MLD_STR
702 "Unconfigure group limit for watermark warning\n"
703 IGNORED_IN_NO_STR)
704{
0cbed951
DL
705 PIM_DECLVAR_CONTEXT_VRF(vrf, pim);
706
1881b5c0 707 /* TBD Depends on MLD data structure changes */
0cbed951
DL
708 (void)pim;
709
1881b5c0
SG
710 return CMD_SUCCESS;
711}
712
c8b3d45d
SG
713DEFPY (interface_ipv6_mld_query_max_response_time,
714 interface_ipv6_mld_query_max_response_time_cmd,
715 "ipv6 mld query-max-response-time (1-65535)$qmrt",
716 IPV6_STR
717 IFACE_MLD_STR
718 IFACE_MLD_QUERY_MAX_RESPONSE_TIME_STR
5e5034b0 719 "Query response value in milliseconds\n")
c8b3d45d
SG
720{
721 return gm_process_query_max_response_time_cmd(vty, qmrt_str);
722}
723
724DEFPY (interface_no_ipv6_mld_query_max_response_time,
725 interface_no_ipv6_mld_query_max_response_time_cmd,
726 "no ipv6 mld query-max-response-time [(1-65535)]",
727 NO_STR
728 IPV6_STR
729 IFACE_MLD_STR
730 IFACE_MLD_QUERY_MAX_RESPONSE_TIME_STR
731 IGNORED_IN_NO_STR)
732{
733 return gm_process_no_query_max_response_time_cmd(vty);
734}
735
c889adcb
SG
736DEFPY (interface_ipv6_mld_last_member_query_count,
737 interface_ipv6_mld_last_member_query_count_cmd,
738 "ipv6 mld last-member-query-count (1-255)$lmqc",
739 IPV6_STR
740 IFACE_MLD_STR
741 IFACE_MLD_LAST_MEMBER_QUERY_COUNT_STR
742 "Last member query count\n")
743{
744 return gm_process_last_member_query_count_cmd(vty, lmqc_str);
745}
746
747DEFPY (interface_no_ipv6_mld_last_member_query_count,
748 interface_no_ipv6_mld_last_member_query_count_cmd,
749 "no ipv6 mld last-member-query-count [(1-255)]",
750 NO_STR
751 IPV6_STR
752 IFACE_MLD_STR
753 IFACE_MLD_LAST_MEMBER_QUERY_COUNT_STR
754 IGNORED_IN_NO_STR)
755{
756 return gm_process_no_last_member_query_count_cmd(vty);
757}
758
e7ec758d
SG
759DEFPY (interface_ipv6_mld_last_member_query_interval,
760 interface_ipv6_mld_last_member_query_interval_cmd,
761 "ipv6 mld last-member-query-interval (1-65535)$lmqi",
762 IPV6_STR
763 IFACE_MLD_STR
764 IFACE_MLD_LAST_MEMBER_QUERY_INTERVAL_STR
765 "Last member query interval in deciseconds\n")
766{
767 return gm_process_last_member_query_interval_cmd(vty, lmqi_str);
768}
769
770DEFPY (interface_no_ipv6_mld_last_member_query_interval,
771 interface_no_ipv6_mld_last_member_query_interval_cmd,
772 "no ipv6 mld last-member-query-interval [(1-65535)]",
773 NO_STR
774 IPV6_STR
775 IFACE_MLD_STR
776 IFACE_MLD_LAST_MEMBER_QUERY_INTERVAL_STR
777 IGNORED_IN_NO_STR)
778{
779 return gm_process_no_last_member_query_interval_cmd(vty);
780}
781
0095f482
A
782DEFPY (show_ipv6_pim_rp,
783 show_ipv6_pim_rp_cmd,
784 "show ipv6 pim [vrf NAME] rp-info [X:X::X:X/M$group] [json$json]",
785 SHOW_STR
786 IPV6_STR
787 PIM_STR
788 VRF_CMD_HELP_STR
789 "PIM RP information\n"
790 "Multicast Group range\n"
791 JSON_STR)
792{
e21c4e90
A
793 return pim_show_rp_helper(vrf, vty, group_str, (struct prefix *)group,
794 !!json);
0095f482
A
795}
796
797DEFPY (show_ipv6_pim_rp_vrf_all,
798 show_ipv6_pim_rp_vrf_all_cmd,
799 "show ipv6 pim vrf all rp-info [X:X::X:X/M$group] [json$json]",
800 SHOW_STR
801 IPV6_STR
802 PIM_STR
803 VRF_CMD_HELP_STR
804 "PIM RP information\n"
805 "Multicast Group range\n"
806 JSON_STR)
807{
e21c4e90
A
808 return pim_show_rp_vrf_all_helper(vty, group_str,
809 (struct prefix *)group, !!json);
0095f482
A
810}
811
1aa8de46
A
812DEFPY (show_ipv6_pim_rpf,
813 show_ipv6_pim_rpf_cmd,
814 "show ipv6 pim [vrf NAME] rpf [json$json]",
815 SHOW_STR
816 IPV6_STR
817 PIM_STR
818 VRF_CMD_HELP_STR
819 "PIM cached source rpf information\n"
820 JSON_STR)
821{
6d1bd8c2 822 return pim_show_rpf_helper(vrf, vty, !!json);
1aa8de46
A
823}
824
825DEFPY (show_ipv6_pim_rpf_vrf_all,
826 show_ipv6_pim_rpf_vrf_all_cmd,
827 "show ipv6 pim vrf all rpf [json$json]",
828 SHOW_STR
829 IPV6_STR
830 PIM_STR
831 VRF_CMD_HELP_STR
832 "PIM cached source rpf information\n"
833 JSON_STR)
834{
6d1bd8c2 835 return pim_show_rpf_vrf_all_helper(vty, !!json);
1aa8de46
A
836}
837
626dab7f
A
838DEFPY (show_ipv6_pim_secondary,
839 show_ipv6_pim_secondary_cmd,
840 "show ipv6 pim [vrf NAME] secondary",
841 SHOW_STR
842 IPV6_STR
843 PIM_STR
844 VRF_CMD_HELP_STR
845 "PIM neighbor addresses\n")
846{
5e52c8d5 847 return pim_show_secondary_helper(vrf, vty);
626dab7f
A
848}
849
4f58b6aa
A
850DEFPY (show_ipv6_pim_statistics,
851 show_ipv6_pim_statistics_cmd,
852 "show ipv6 pim [vrf NAME] statistics [interface WORD$word] [json$json]",
853 SHOW_STR
854 IPV6_STR
855 PIM_STR
856 VRF_CMD_HELP_STR
857 "PIM statistics\n"
858 INTERFACE_STR
859 "PIM interface\n"
860 JSON_STR)
861{
19296b58 862 return pim_show_statistics_helper(vrf, vty, word, !!json);
4f58b6aa
A
863}
864
95023bd7
A
865DEFPY (show_ipv6_pim_upstream,
866 show_ipv6_pim_upstream_cmd,
867 "show ipv6 pim [vrf NAME] upstream [X:X::X:X$s_or_g [X:X::X:X$g]] [json$json]",
868 SHOW_STR
869 IPV6_STR
870 PIM_STR
871 VRF_CMD_HELP_STR
872 "PIM upstream information\n"
873 "The Source or Group\n"
874 "The Group\n"
875 JSON_STR)
876{
9aa0569d 877 return pim_show_upstream_helper(vrf, vty, s_or_g, g, !!json);
95023bd7
A
878}
879
880DEFPY (show_ipv6_pim_upstream_vrf_all,
881 show_ipv6_pim_upstream_vrf_all_cmd,
882 "show ipv6 pim vrf all upstream [json$json]",
883 SHOW_STR
884 IPV6_STR
885 PIM_STR
886 VRF_CMD_HELP_STR
887 "PIM upstream information\n"
888 JSON_STR)
889{
9aa0569d 890 return pim_show_upstream_vrf_all_helper(vty, !!json);
95023bd7
A
891}
892
e577f6e7
A
893DEFPY (show_ipv6_pim_upstream_join_desired,
894 show_ipv6_pim_upstream_join_desired_cmd,
895 "show ipv6 pim [vrf NAME] upstream-join-desired [json$json]",
896 SHOW_STR
897 IPV6_STR
898 PIM_STR
899 VRF_CMD_HELP_STR
900 "PIM upstream join-desired\n"
901 JSON_STR)
902{
622da92f 903 return pim_show_upstream_join_desired_helper(vrf, vty, !!json);
e577f6e7
A
904}
905
b1a419ba
A
906DEFPY (show_ipv6_pim_upstream_rpf,
907 show_ipv6_pim_upstream_rpf_cmd,
908 "show ipv6 pim [vrf NAME] upstream-rpf [json$json]",
909 SHOW_STR
910 IPV6_STR
911 PIM_STR
912 VRF_CMD_HELP_STR
913 "PIM upstream source rpf\n"
914 JSON_STR)
915{
c6309708 916 return pim_show_upstream_rpf_helper(vrf, vty, !!json);
b1a419ba
A
917}
918
2d85c671
A
919DEFPY (show_ipv6_pim_state,
920 show_ipv6_pim_state_cmd,
921 "show ipv6 pim [vrf NAME] state [X:X::X:X$s_or_g [X:X::X:X$g]] [json$json]",
922 SHOW_STR
923 IPV6_STR
924 PIM_STR
925 VRF_CMD_HELP_STR
926 "PIM state information\n"
927 "Unicast or Multicast address\n"
928 "Multicast address\n"
929 JSON_STR)
930{
e7c01c67 931 return pim_show_state_helper(vrf, vty, s_or_g_str, g_str, !!json);
2d85c671
A
932}
933
934DEFPY (show_ipv6_pim_state_vrf_all,
935 show_ipv6_pim_state_vrf_all_cmd,
936 "show ipv6 pim vrf all state [X:X::X:X$s_or_g [X:X::X:X$g]] [json$json]",
937 SHOW_STR
938 IPV6_STR
939 PIM_STR
940 VRF_CMD_HELP_STR
941 "PIM state information\n"
942 "Unicast or Multicast address\n"
943 "Multicast address\n"
944 JSON_STR)
945{
e7c01c67 946 return pim_show_state_vrf_all_helper(vty, s_or_g_str, g_str, !!json);
2d85c671
A
947}
948
bf083b3a
SG
949DEFPY (show_ipv6_pim_channel,
950 show_ipv6_pim_channel_cmd,
951 "show ipv6 pim [vrf NAME] channel [json$json]",
952 SHOW_STR
953 IPV6_STR
954 PIM_STR
955 VRF_CMD_HELP_STR
956 "PIM downstream channel info\n"
957 JSON_STR)
958{
b6bf3377 959 return pim_show_channel_cmd_helper(vrf, vty, !!json);
bf083b3a
SG
960}
961
44f99d22
SG
962DEFPY (show_ipv6_pim_interface,
963 show_ipv6_pim_interface_cmd,
964 "show ipv6 pim [vrf NAME] interface [detail|WORD]$interface [json$json]",
965 SHOW_STR
966 IPV6_STR
967 PIM_STR
968 VRF_CMD_HELP_STR
969 "PIM interface information\n"
970 "Detailed output\n"
971 "interface name\n"
972 JSON_STR)
973{
8282b988
SG
974 return pim_show_interface_cmd_helper(vrf, vty, !!json, false,
975 interface);
44f99d22
SG
976}
977
978DEFPY (show_ipv6_pim_interface_vrf_all,
979 show_ipv6_pim_interface_vrf_all_cmd,
980 "show ipv6 pim vrf all interface [detail|WORD]$interface [json$json]",
981 SHOW_STR
982 IPV6_STR
983 PIM_STR
984 VRF_CMD_HELP_STR
985 "PIM interface information\n"
986 "Detailed output\n"
987 "interface name\n"
988 JSON_STR)
989{
342ba5f3
SG
990 return pim_show_interface_vrf_all_cmd_helper(vty, !!json, false,
991 interface);
44f99d22
SG
992}
993
24de75a2
SG
994DEFPY (show_ipv6_pim_join,
995 show_ipv6_pim_join_cmd,
996 "show ipv6 pim [vrf NAME] join [X:X::X:X$s_or_g [X:X::X:X$g]] [json$json]",
997 SHOW_STR
998 IPV6_STR
999 PIM_STR
1000 VRF_CMD_HELP_STR
1001 "PIM interface join information\n"
1002 "The Source or Group\n"
1003 "The Group\n"
1004 JSON_STR)
1005{
94c691ba 1006 return pim_show_join_cmd_helper(vrf, vty, s_or_g, g, json);
24de75a2
SG
1007}
1008
1009DEFPY (show_ipv6_pim_join_vrf_all,
1010 show_ipv6_pim_join_vrf_all_cmd,
1011 "show ipv6 pim vrf all join [json$json]",
1012 SHOW_STR
1013 IPV6_STR
1014 PIM_STR
1015 VRF_CMD_HELP_STR
1016 "PIM interface join information\n"
1017 JSON_STR)
1018{
94c691ba 1019 return pim_show_join_vrf_all_cmd_helper(vty, json);
24de75a2
SG
1020}
1021
be223239
SG
1022DEFPY (show_ipv6_pim_jp_agg,
1023 show_ipv6_pim_jp_agg_cmd,
1024 "show ipv6 pim [vrf NAME] jp-agg",
1025 SHOW_STR
1026 IPV6_STR
1027 PIM_STR
1028 VRF_CMD_HELP_STR
1029 "join prune aggregation list\n")
1030{
3ca40823 1031 return pim_show_jp_agg_list_cmd_helper(vrf, vty);
be223239
SG
1032}
1033
de11054e
SG
1034DEFPY (show_ipv6_pim_local_membership,
1035 show_ipv6_pim_local_membership_cmd,
1036 "show ipv6 pim [vrf NAME] local-membership [json$json]",
1037 SHOW_STR
1038 IPV6_STR
1039 PIM_STR
1040 VRF_CMD_HELP_STR
1041 "PIM interface local-membership\n"
1042 JSON_STR)
1043{
bec5bdbe 1044 return pim_show_membership_cmd_helper(vrf, vty, !!json);
de11054e
SG
1045}
1046
1295dbeb
SG
1047DEFPY (show_ipv6_pim_neighbor,
1048 show_ipv6_pim_neighbor_cmd,
1049 "show ipv6 pim [vrf NAME] neighbor [detail|WORD]$interface [json$json]",
1050 SHOW_STR
1051 IPV6_STR
1052 PIM_STR
1053 VRF_CMD_HELP_STR
1054 "PIM neighbor information\n"
1055 "Detailed output\n"
1056 "Name of interface or neighbor\n"
1057 JSON_STR)
1058{
154aa4fc 1059 return pim_show_neighbors_cmd_helper(vrf, vty, json, interface);
1295dbeb
SG
1060}
1061
1062DEFPY (show_ipv6_pim_neighbor_vrf_all,
1063 show_ipv6_pim_neighbor_vrf_all_cmd,
1064 "show ipv6 pim vrf all neighbor [detail|WORD]$interface [json$json]",
1065 SHOW_STR
1066 IPV6_STR
1067 PIM_STR
1068 VRF_CMD_HELP_STR
1069 "PIM neighbor information\n"
1070 "Detailed output\n"
1071 "Name of interface or neighbor\n"
1072 JSON_STR)
1073{
78b0e690 1074 return pim_show_neighbors_vrf_all_cmd_helper(vty, json, interface);
1295dbeb
SG
1075}
1076
9d6d0270
SG
1077DEFPY (show_ipv6_pim_nexthop,
1078 show_ipv6_pim_nexthop_cmd,
1079 "show ipv6 pim [vrf NAME] nexthop",
1080 SHOW_STR
1081 IPV6_STR
1082 PIM_STR
1083 VRF_CMD_HELP_STR
1084 "PIM cached nexthop rpf information\n")
1085{
cefa37cf 1086 return pim_show_nexthop_cmd_helper(vrf, vty);
9d6d0270
SG
1087}
1088
1089DEFPY (show_ipv6_pim_nexthop_lookup,
1090 show_ipv6_pim_nexthop_lookup_cmd,
1091 "show ipv6 pim [vrf NAME] nexthop-lookup X:X::X:X$source X:X::X:X$group",
1092 SHOW_STR
1093 IPV6_STR
1094 PIM_STR
1095 VRF_CMD_HELP_STR
1096 "PIM cached nexthop rpf lookup\n"
1097 "Source/RP address\n"
1098 "Multicast Group address\n")
1099{
fe7eaf40 1100 return pim_show_nexthop_lookup_cmd_helper(vrf, vty, source, group);
9d6d0270
SG
1101}
1102
ca3b5906
A
1103DEFPY (show_ipv6_multicast,
1104 show_ipv6_multicast_cmd,
1105 "show ipv6 multicast [vrf NAME]",
1106 SHOW_STR
1107 IPV6_STR
1108 "Multicast global information\n"
1109 VRF_CMD_HELP_STR)
1110{
8e15c9aa 1111 return pim_show_multicast_helper(vrf, vty);
ca3b5906
A
1112}
1113
1114DEFPY (show_ipv6_multicast_vrf_all,
1115 show_ipv6_multicast_vrf_all_cmd,
1116 "show ipv6 multicast vrf all",
1117 SHOW_STR
1118 IPV6_STR
1119 "Multicast global information\n"
1120 VRF_CMD_HELP_STR)
1121{
8e15c9aa 1122 return pim_show_multicast_vrf_all_helper(vty);
ca3b5906
A
1123}
1124
3e55b3b5
A
1125DEFPY (show_ipv6_multicast_count,
1126 show_ipv6_multicast_count_cmd,
1127 "show ipv6 multicast count [vrf NAME] [json$json]",
1128 SHOW_STR
1129 IPV6_STR
1130 "Multicast global information\n"
1131 "Data packet count\n"
1132 VRF_CMD_HELP_STR
1133 JSON_STR)
1134{
334d2f8c 1135 return pim_show_multicast_count_helper(vrf, vty, !!json);
3e55b3b5
A
1136}
1137
1138DEFPY (show_ipv6_multicast_count_vrf_all,
1139 show_ipv6_multicast_count_vrf_all_cmd,
1140 "show ipv6 multicast count vrf all [json$json]",
1141 SHOW_STR
1142 IPV6_STR
1143 "Multicast global information\n"
1144 "Data packet count\n"
1145 VRF_CMD_HELP_STR
1146 JSON_STR)
1147{
334d2f8c 1148 return pim_show_multicast_count_vrf_all_helper(vty, !!json);
3e55b3b5
A
1149}
1150
50ba39bf
A
1151DEFPY (show_ipv6_mroute,
1152 show_ipv6_mroute_cmd,
1153 "show ipv6 mroute [vrf NAME] [X:X::X:X$s_or_g [X:X::X:X$g]] [fill$fill] [json$json]",
1154 SHOW_STR
1155 IPV6_STR
1156 MROUTE_STR
1157 VRF_CMD_HELP_STR
1158 "The Source or Group\n"
1159 "The Group\n"
1160 "Fill in Assumed data\n"
1161 JSON_STR)
1162{
4f1f8ff9 1163 return pim_show_mroute_helper(vrf, vty, s_or_g, g, !!fill, !!json);
50ba39bf
A
1164}
1165
1166DEFPY (show_ipv6_mroute_vrf_all,
1167 show_ipv6_mroute_vrf_all_cmd,
1168 "show ipv6 mroute vrf all [fill$fill] [json$json]",
1169 SHOW_STR
1170 IPV6_STR
1171 MROUTE_STR
1172 VRF_CMD_HELP_STR
1173 "Fill in Assumed data\n"
1174 JSON_STR)
1175{
4f1f8ff9 1176 return pim_show_mroute_vrf_all_helper(vty, !!fill, !!json);
50ba39bf
A
1177}
1178
c41a9dcf
A
1179DEFPY (show_ipv6_mroute_count,
1180 show_ipv6_mroute_count_cmd,
1181 "show ipv6 mroute [vrf NAME] count [json$json]",
1182 SHOW_STR
1183 IPV6_STR
1184 MROUTE_STR
1185 VRF_CMD_HELP_STR
1186 "Route and packet count data\n"
1187 JSON_STR)
1188{
1c1077c2 1189 return pim_show_mroute_count_helper(vrf, vty, !!json);
c41a9dcf
A
1190}
1191
1192DEFPY (show_ipv6_mroute_count_vrf_all,
1193 show_ipv6_mroute_count_vrf_all_cmd,
1194 "show ipv6 mroute vrf all count [json$json]",
1195 SHOW_STR
1196 IPV6_STR
1197 MROUTE_STR
1198 VRF_CMD_HELP_STR
1199 "Route and packet count data\n"
1200 JSON_STR)
1201{
1c1077c2 1202 return pim_show_mroute_count_vrf_all_helper(vty, !!json);
c41a9dcf
A
1203}
1204
74e8197b
A
1205DEFPY (show_ipv6_mroute_summary,
1206 show_ipv6_mroute_summary_cmd,
1207 "show ipv6 mroute [vrf NAME] summary [json$json]",
1208 SHOW_STR
1209 IPV6_STR
1210 MROUTE_STR
1211 VRF_CMD_HELP_STR
1212 "Summary of all mroutes\n"
1213 JSON_STR)
1214{
789d0ec4 1215 return pim_show_mroute_summary_helper(vrf, vty, !!json);
74e8197b
A
1216}
1217
1218DEFPY (show_ipv6_mroute_summary_vrf_all,
1219 show_ipv6_mroute_summary_vrf_all_cmd,
1220 "show ipv6 mroute vrf all summary [json$json]",
1221 SHOW_STR
1222 IPV6_STR
1223 MROUTE_STR
1224 VRF_CMD_HELP_STR
1225 "Summary of all mroutes\n"
1226 JSON_STR)
1227{
789d0ec4 1228 return pim_show_mroute_summary_vrf_all_helper(vty, !!json);
74e8197b
A
1229}
1230
858c3dee
MR
1231DEFPY (show_ipv6_pim_interface_traffic,
1232 show_ipv6_pim_interface_traffic_cmd,
1233 "show ipv6 pim [vrf NAME] interface traffic [WORD$if_name] [json$json]",
1234 SHOW_STR
1235 IPV6_STR
1236 PIM_STR
1237 VRF_CMD_HELP_STR
1238 "PIM interface information\n"
1239 "Protocol Packet counters\n"
1240 "Interface name\n"
1241 JSON_STR)
1242{
1243 return pim_show_interface_traffic_helper(vrf, if_name, vty, !!json);
1244}
1245
1246
ef1b0a2d
SG
1247DEFPY (clear_ipv6_pim_statistics,
1248 clear_ipv6_pim_statistics_cmd,
1249 "clear ipv6 pim statistics [vrf NAME]$name",
1250 CLEAR_STR
1251 IPV6_STR
1252 CLEAR_IP_PIM_STR
1253 VRF_CMD_HELP_STR
1254 "Reset PIM statistics\n")
1255{
1256 struct vrf *v = pim_cmd_lookup(vty, name);
1257
1258 if (!v)
1259 return CMD_WARNING;
1260
1261 clear_pim_statistics(v->info);
1262
1263 return CMD_SUCCESS;
1264}
1265
a14ae314
SG
1266DEFPY (clear_ipv6_mroute,
1267 clear_ipv6_mroute_cmd,
1268 "clear ipv6 mroute [vrf NAME]$name",
1269 CLEAR_STR
1270 IPV6_STR
1271 "Reset multicast routes\n"
1272 VRF_CMD_HELP_STR)
1273{
1274 struct vrf *v = pim_cmd_lookup(vty, name);
1275
1276 if (!v)
1277 return CMD_WARNING;
1278
1279 clear_mroute(v->info);
1280
1281 return CMD_SUCCESS;
1282}
1283
09a754ea
SG
1284DEFPY (clear_ipv6_pim_oil,
1285 clear_ipv6_pim_oil_cmd,
1286 "clear ipv6 pim [vrf NAME]$name oil",
1287 CLEAR_STR
1288 IPV6_STR
1289 CLEAR_IP_PIM_STR
1290 VRF_CMD_HELP_STR
1291 "Rescan PIMv6 OIL (output interface list)\n")
1292{
1293 struct vrf *v = pim_cmd_lookup(vty, name);
1294
1295 if (!v)
1296 return CMD_WARNING;
1297
1298 pim_scan_oil(v->info);
1299
1300 return CMD_SUCCESS;
1301}
1302
4e65109c
SG
1303DEFPY (clear_ipv6_mroute_count,
1304 clear_ipv6_mroute_count_cmd,
1305 "clear ipv6 mroute [vrf NAME]$name count",
1306 CLEAR_STR
1307 IPV6_STR
1308 MROUTE_STR
1309 VRF_CMD_HELP_STR
1310 "Route and packet count data\n")
1311{
1312 return clear_ip_mroute_count_command(vty, name);
1313}
1314
bf385e26
SG
1315DEFPY (debug_pimv6,
1316 debug_pimv6_cmd,
1317 "[no] debug pimv6",
1318 NO_STR
1319 DEBUG_STR
1320 DEBUG_PIMV6_STR)
1321{
1322 if (!no)
1323 return pim_debug_pim_cmd();
1324 else
1325 return pim_no_debug_pim_cmd();
1326}
1327
dcfd5abe
SG
1328DEFPY (debug_pimv6_nht,
1329 debug_pimv6_nht_cmd,
1330 "[no] debug pimv6 nht",
1331 NO_STR
1332 DEBUG_STR
1333 DEBUG_PIMV6_STR
1334 "Nexthop Tracking\n")
1335{
1336 if (!no)
1337 PIM_DO_DEBUG_PIM_NHT;
1338 else
1339 PIM_DONT_DEBUG_PIM_NHT;
1340 return CMD_SUCCESS;
1341}
1342
1343DEFPY (debug_pimv6_nht_det,
1344 debug_pimv6_nht_det_cmd,
1345 "[no] debug pimv6 nht detail",
1346 NO_STR
1347 DEBUG_STR
1348 DEBUG_PIMV6_STR
1349 "Nexthop Tracking\n"
1350 "Detailed Information\n")
1351{
1352 if (!no)
1353 PIM_DO_DEBUG_PIM_NHT_DETAIL;
1354 else
1355 PIM_DONT_DEBUG_PIM_NHT_DETAIL;
1356 return CMD_SUCCESS;
1357}
1358
c51c7de2
SG
1359DEFPY (debug_pimv6_events,
1360 debug_pimv6_events_cmd,
1361 "[no] debug pimv6 events",
1362 NO_STR
1363 DEBUG_STR
1364 DEBUG_PIMV6_STR
1365 DEBUG_PIMV6_EVENTS_STR)
1366{
1367 if (!no)
1368 PIM_DO_DEBUG_PIM_EVENTS;
1369 else
1370 PIM_DONT_DEBUG_PIM_EVENTS;
1371 return CMD_SUCCESS;
1372}
1373
60940ee2
SG
1374DEFPY (debug_pimv6_packets,
1375 debug_pimv6_packets_cmd,
1376 "[no] debug pimv6 packets [<hello$hello|joins$joins|register$registers>]",
1377 NO_STR
1378 DEBUG_STR
1379 DEBUG_PIMV6_STR
1380 DEBUG_PIMV6_PACKETS_STR
1381 DEBUG_PIMV6_HELLO_PACKETS_STR
1382 DEBUG_PIMV6_J_P_PACKETS_STR
1383 DEBUG_PIMV6_PIM_REG_PACKETS_STR)
1384{
1385 if (!no)
1386 return pim_debug_pim_packets_cmd(hello, joins, registers, vty);
1387 else
1388 return pim_no_debug_pim_packets_cmd(hello, joins, registers,
1389 vty);
1390}
1391
d05746d4
SG
1392DEFPY (debug_pimv6_packetdump_send,
1393 debug_pimv6_packetdump_send_cmd,
1394 "[no] debug pimv6 packet-dump send",
1395 NO_STR
1396 DEBUG_STR
1397 DEBUG_PIMV6_STR
1398 DEBUG_PIMV6_PACKETDUMP_STR
1399 DEBUG_PIMV6_PACKETDUMP_SEND_STR)
1400{
1401 if (!no)
1402 PIM_DO_DEBUG_PIM_PACKETDUMP_SEND;
1403 else
1404 PIM_DONT_DEBUG_PIM_PACKETDUMP_SEND;
1405 return CMD_SUCCESS;
1406}
1407
1408DEFPY (debug_pimv6_packetdump_recv,
1409 debug_pimv6_packetdump_recv_cmd,
1410 "[no] debug pimv6 packet-dump receive",
1411 NO_STR
1412 DEBUG_STR
1413 DEBUG_PIMV6_STR
1414 DEBUG_PIMV6_PACKETDUMP_STR
1415 DEBUG_PIMV6_PACKETDUMP_RECV_STR)
1416{
1417 if (!no)
1418 PIM_DO_DEBUG_PIM_PACKETDUMP_RECV;
1419 else
1420 PIM_DONT_DEBUG_PIM_PACKETDUMP_RECV;
1421 return CMD_SUCCESS;
1422}
1423
904dbf53
SG
1424DEFPY (debug_pimv6_trace,
1425 debug_pimv6_trace_cmd,
1426 "[no] debug pimv6 trace",
1427 NO_STR
1428 DEBUG_STR
1429 DEBUG_PIMV6_STR
1430 DEBUG_PIMV6_TRACE_STR)
1431{
1432 if (!no)
1433 PIM_DO_DEBUG_PIM_TRACE;
1434 else
1435 PIM_DONT_DEBUG_PIM_TRACE;
1436 return CMD_SUCCESS;
1437}
1438
1439DEFPY (debug_pimv6_trace_detail,
1440 debug_pimv6_trace_detail_cmd,
1441 "[no] debug pimv6 trace detail",
1442 NO_STR
1443 DEBUG_STR
1444 DEBUG_PIMV6_STR
1445 DEBUG_PIMV6_TRACE_STR
1446 "Detailed Information\n")
1447{
1448 if (!no)
1449 PIM_DO_DEBUG_PIM_TRACE_DETAIL;
1450 else
1451 PIM_DONT_DEBUG_PIM_TRACE_DETAIL;
1452 return CMD_SUCCESS;
1453}
1454
fa5138d6
SG
1455DEFPY (debug_pimv6_zebra,
1456 debug_pimv6_zebra_cmd,
1457 "[no] debug pimv6 zebra",
1458 NO_STR
1459 DEBUG_STR
1460 DEBUG_PIMV6_STR
1461 DEBUG_PIMV6_ZEBRA_STR)
1462{
1463 if (!no)
1464 PIM_DO_DEBUG_ZEBRA;
1465 else
1466 PIM_DONT_DEBUG_ZEBRA;
1467 return CMD_SUCCESS;
1468}
1469
5d613d13
SG
1470void pim_cmd_init(void)
1471{
1472 if_cmd_init(pim_interface_config_write);
c73113ea 1473
89f86fe2
SG
1474 install_node(&debug_node);
1475
c73113ea
MR
1476 install_element(CONFIG_NODE, &ipv6_pim_joinprune_time_cmd);
1477 install_element(CONFIG_NODE, &no_ipv6_pim_joinprune_time_cmd);
fb991ce9
MR
1478 install_element(CONFIG_NODE, &ipv6_pim_spt_switchover_infinity_cmd);
1479 install_element(CONFIG_NODE, &ipv6_pim_spt_switchover_infinity_plist_cmd);
1480 install_element(CONFIG_NODE, &no_ipv6_pim_spt_switchover_infinity_cmd);
1481 install_element(CONFIG_NODE, &no_ipv6_pim_spt_switchover_infinity_plist_cmd);
0da72f1f
MR
1482 install_element(CONFIG_NODE, &ipv6_pim_packets_cmd);
1483 install_element(CONFIG_NODE, &no_ipv6_pim_packets_cmd);
28e32366
MR
1484 install_element(CONFIG_NODE, &ipv6_pim_keep_alive_cmd);
1485 install_element(CONFIG_NODE, &no_ipv6_pim_keep_alive_cmd);
2322b991
MR
1486 install_element(CONFIG_NODE, &ipv6_pim_rp_keep_alive_cmd);
1487 install_element(CONFIG_NODE, &no_ipv6_pim_rp_keep_alive_cmd);
18ca7de5
MR
1488 install_element(CONFIG_NODE, &ipv6_pim_register_suppress_cmd);
1489 install_element(CONFIG_NODE, &no_ipv6_pim_register_suppress_cmd);
a1caf7a8 1490 install_element(INTERFACE_NODE, &interface_ipv6_pim_cmd);
1491 install_element(INTERFACE_NODE, &interface_no_ipv6_pim_cmd);
bb387611 1492 install_element(INTERFACE_NODE, &interface_ipv6_pim_drprio_cmd);
1493 install_element(INTERFACE_NODE, &interface_no_ipv6_pim_drprio_cmd);
e6aab613 1494 install_element(INTERFACE_NODE, &interface_ipv6_pim_hello_cmd);
1495 install_element(INTERFACE_NODE, &interface_no_ipv6_pim_hello_cmd);
7e01b641 1496 install_element(INTERFACE_NODE, &interface_ipv6_pim_activeactive_cmd);
dab0ac29 1497 install_element(INTERFACE_NODE, &interface_ipv6_pim_ssm_cmd);
1498 install_element(INTERFACE_NODE, &interface_no_ipv6_pim_ssm_cmd);
2b16b40f 1499 install_element(INTERFACE_NODE, &interface_ipv6_pim_sm_cmd);
1500 install_element(INTERFACE_NODE, &interface_no_ipv6_pim_sm_cmd);
52c52d78 1501 install_element(INTERFACE_NODE,
1502 &interface_ipv6_pim_boundary_oil_cmd);
1503 install_element(INTERFACE_NODE,
1504 &interface_no_ipv6_pim_boundary_oil_cmd);
63ee25c0 1505 install_element(INTERFACE_NODE, &interface_ipv6_mroute_cmd);
1506 install_element(INTERFACE_NODE, &interface_no_ipv6_mroute_cmd);
34b403cf
MR
1507 install_element(CONFIG_NODE, &ipv6_pim_rp_cmd);
1508 install_element(VRF_NODE, &ipv6_pim_rp_cmd);
1509 install_element(CONFIG_NODE, &no_ipv6_pim_rp_cmd);
1510 install_element(VRF_NODE, &no_ipv6_pim_rp_cmd);
8663adc4
MR
1511 install_element(CONFIG_NODE, &ipv6_pim_rp_prefix_list_cmd);
1512 install_element(VRF_NODE, &ipv6_pim_rp_prefix_list_cmd);
1513 install_element(CONFIG_NODE, &no_ipv6_pim_rp_prefix_list_cmd);
1514 install_element(VRF_NODE, &no_ipv6_pim_rp_prefix_list_cmd);
a8caf78d
BG
1515 install_element(CONFIG_NODE, &ipv6_ssmpingd_cmd);
1516 install_element(VRF_NODE, &ipv6_ssmpingd_cmd);
1517 install_element(CONFIG_NODE, &no_ipv6_ssmpingd_cmd);
1518 install_element(VRF_NODE, &no_ipv6_ssmpingd_cmd);
eaa7d656
A
1519 install_element(INTERFACE_NODE, &interface_ipv6_mld_cmd);
1520 install_element(INTERFACE_NODE, &interface_no_ipv6_mld_cmd);
fe2df4f7
A
1521 install_element(INTERFACE_NODE, &interface_ipv6_mld_join_cmd);
1522 install_element(INTERFACE_NODE, &interface_no_ipv6_mld_join_cmd);
47d4af36
A
1523 install_element(INTERFACE_NODE, &interface_ipv6_mld_version_cmd);
1524 install_element(INTERFACE_NODE, &interface_no_ipv6_mld_version_cmd);
5795b17c
A
1525 install_element(INTERFACE_NODE, &interface_ipv6_mld_query_interval_cmd);
1526 install_element(INTERFACE_NODE,
1527 &interface_no_ipv6_mld_query_interval_cmd);
fb005412
SG
1528 install_element(CONFIG_NODE, &ipv6_mld_group_watermark_cmd);
1529 install_element(VRF_NODE, &ipv6_mld_group_watermark_cmd);
1530 install_element(CONFIG_NODE, &no_ipv6_mld_group_watermark_cmd);
1531 install_element(VRF_NODE, &no_ipv6_mld_group_watermark_cmd);
c8b3d45d
SG
1532 install_element(INTERFACE_NODE,
1533 &interface_ipv6_mld_query_max_response_time_cmd);
1534 install_element(INTERFACE_NODE,
1535 &interface_no_ipv6_mld_query_max_response_time_cmd);
c889adcb
SG
1536 install_element(INTERFACE_NODE,
1537 &interface_ipv6_mld_last_member_query_count_cmd);
1538 install_element(INTERFACE_NODE,
1539 &interface_no_ipv6_mld_last_member_query_count_cmd);
e7ec758d
SG
1540 install_element(INTERFACE_NODE,
1541 &interface_ipv6_mld_last_member_query_interval_cmd);
1542 install_element(INTERFACE_NODE,
1543 &interface_no_ipv6_mld_last_member_query_interval_cmd);
c8b3d45d 1544
0095f482
A
1545 install_element(VIEW_NODE, &show_ipv6_pim_rp_cmd);
1546 install_element(VIEW_NODE, &show_ipv6_pim_rp_vrf_all_cmd);
1aa8de46
A
1547 install_element(VIEW_NODE, &show_ipv6_pim_rpf_cmd);
1548 install_element(VIEW_NODE, &show_ipv6_pim_rpf_vrf_all_cmd);
626dab7f 1549 install_element(VIEW_NODE, &show_ipv6_pim_secondary_cmd);
4f58b6aa 1550 install_element(VIEW_NODE, &show_ipv6_pim_statistics_cmd);
95023bd7
A
1551 install_element(VIEW_NODE, &show_ipv6_pim_upstream_cmd);
1552 install_element(VIEW_NODE, &show_ipv6_pim_upstream_vrf_all_cmd);
e577f6e7 1553 install_element(VIEW_NODE, &show_ipv6_pim_upstream_join_desired_cmd);
b1a419ba 1554 install_element(VIEW_NODE, &show_ipv6_pim_upstream_rpf_cmd);
2d85c671
A
1555 install_element(VIEW_NODE, &show_ipv6_pim_state_cmd);
1556 install_element(VIEW_NODE, &show_ipv6_pim_state_vrf_all_cmd);
bf083b3a 1557 install_element(VIEW_NODE, &show_ipv6_pim_channel_cmd);
44f99d22
SG
1558 install_element(VIEW_NODE, &show_ipv6_pim_interface_cmd);
1559 install_element(VIEW_NODE, &show_ipv6_pim_interface_vrf_all_cmd);
24de75a2
SG
1560 install_element(VIEW_NODE, &show_ipv6_pim_join_cmd);
1561 install_element(VIEW_NODE, &show_ipv6_pim_join_vrf_all_cmd);
be223239 1562 install_element(VIEW_NODE, &show_ipv6_pim_jp_agg_cmd);
de11054e 1563 install_element(VIEW_NODE, &show_ipv6_pim_local_membership_cmd);
1295dbeb
SG
1564 install_element(VIEW_NODE, &show_ipv6_pim_neighbor_cmd);
1565 install_element(VIEW_NODE, &show_ipv6_pim_neighbor_vrf_all_cmd);
9d6d0270
SG
1566 install_element(VIEW_NODE, &show_ipv6_pim_nexthop_cmd);
1567 install_element(VIEW_NODE, &show_ipv6_pim_nexthop_lookup_cmd);
ca3b5906
A
1568 install_element(VIEW_NODE, &show_ipv6_multicast_cmd);
1569 install_element(VIEW_NODE, &show_ipv6_multicast_vrf_all_cmd);
3e55b3b5
A
1570 install_element(VIEW_NODE, &show_ipv6_multicast_count_cmd);
1571 install_element(VIEW_NODE, &show_ipv6_multicast_count_vrf_all_cmd);
50ba39bf
A
1572 install_element(VIEW_NODE, &show_ipv6_mroute_cmd);
1573 install_element(VIEW_NODE, &show_ipv6_mroute_vrf_all_cmd);
c41a9dcf
A
1574 install_element(VIEW_NODE, &show_ipv6_mroute_count_cmd);
1575 install_element(VIEW_NODE, &show_ipv6_mroute_count_vrf_all_cmd);
74e8197b
A
1576 install_element(VIEW_NODE, &show_ipv6_mroute_summary_cmd);
1577 install_element(VIEW_NODE, &show_ipv6_mroute_summary_vrf_all_cmd);
858c3dee 1578 install_element(VIEW_NODE, &show_ipv6_pim_interface_traffic_cmd);
ef1b0a2d
SG
1579
1580 install_element(ENABLE_NODE, &clear_ipv6_pim_statistics_cmd);
a14ae314 1581 install_element(ENABLE_NODE, &clear_ipv6_mroute_cmd);
09a754ea 1582 install_element(ENABLE_NODE, &clear_ipv6_pim_oil_cmd);
4e65109c 1583 install_element(ENABLE_NODE, &clear_ipv6_mroute_count_cmd);
bf385e26 1584 install_element(ENABLE_NODE, &debug_pimv6_cmd);
dcfd5abe
SG
1585 install_element(ENABLE_NODE, &debug_pimv6_nht_cmd);
1586 install_element(ENABLE_NODE, &debug_pimv6_nht_det_cmd);
c51c7de2 1587 install_element(ENABLE_NODE, &debug_pimv6_events_cmd);
60940ee2 1588 install_element(ENABLE_NODE, &debug_pimv6_packets_cmd);
d05746d4
SG
1589 install_element(ENABLE_NODE, &debug_pimv6_packetdump_send_cmd);
1590 install_element(ENABLE_NODE, &debug_pimv6_packetdump_recv_cmd);
904dbf53
SG
1591 install_element(ENABLE_NODE, &debug_pimv6_trace_cmd);
1592 install_element(ENABLE_NODE, &debug_pimv6_trace_detail_cmd);
fa5138d6 1593 install_element(ENABLE_NODE, &debug_pimv6_zebra_cmd);
bf385e26
SG
1594
1595 install_element(CONFIG_NODE, &debug_pimv6_cmd);
dcfd5abe
SG
1596 install_element(CONFIG_NODE, &debug_pimv6_nht_cmd);
1597 install_element(CONFIG_NODE, &debug_pimv6_nht_det_cmd);
c51c7de2 1598 install_element(CONFIG_NODE, &debug_pimv6_events_cmd);
60940ee2 1599 install_element(CONFIG_NODE, &debug_pimv6_packets_cmd);
d05746d4
SG
1600 install_element(CONFIG_NODE, &debug_pimv6_packetdump_send_cmd);
1601 install_element(CONFIG_NODE, &debug_pimv6_packetdump_recv_cmd);
904dbf53
SG
1602 install_element(CONFIG_NODE, &debug_pimv6_trace_cmd);
1603 install_element(CONFIG_NODE, &debug_pimv6_trace_detail_cmd);
fa5138d6 1604 install_element(CONFIG_NODE, &debug_pimv6_zebra_cmd);
5d613d13 1605}