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