3 * Copyright (C) 2008 Everton da Silva Marques
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; see the file COPYING; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
34 #include "pim_mroute.h"
36 #include "pim_iface.h"
38 #include "pim_mroute.h"
41 #include "pim_igmpv3.h"
46 #include "pim_neighbor.h"
48 #include "pim_ifchannel.h"
49 #include "pim_hello.h"
51 #include "pim_upstream.h"
53 #include "pim_macro.h"
54 #include "pim_ssmpingd.h"
55 #include "pim_zebra.h"
56 #include "pim_static.h"
58 #include "pim_zlookup.h"
63 #include "pim_vxlan.h"
67 #include "lib/northbound_cli.h"
68 #include "pim_errors.h"
71 #include "pim_cmd_common.h"
73 #ifndef VTYSH_EXTRACT_PL
74 #include "pimd/pim_cmd_clippy.c"
77 static struct cmd_node debug_node
= {
81 .config_write
= pim_debug_config_write
,
84 static struct vrf
*pim_cmd_lookup_vrf(struct vty
*vty
, struct cmd_token
*argv
[],
85 const int argc
, int *idx
)
89 if (argv_find(argv
, argc
, "NAME", idx
))
90 vrf
= vrf_lookup_by_name(argv
[*idx
]->arg
);
92 vrf
= vrf_lookup_by_id(VRF_DEFAULT
);
95 vty_out(vty
, "Specified VRF: %s does not exist\n",
101 static void pim_show_assert_helper(struct vty
*vty
,
102 struct pim_interface
*pim_ifp
,
103 struct pim_ifchannel
*ch
, time_t now
)
105 char winner_str
[INET_ADDRSTRLEN
];
106 struct in_addr ifaddr
;
109 char buf
[PREFIX_STRLEN
];
111 ifaddr
= pim_ifp
->primary_address
;
113 pim_inet4_dump("<assrt_win?>", ch
->ifassert_winner
, winner_str
,
116 pim_time_uptime(uptime
, sizeof(uptime
), now
- ch
->ifassert_creation
);
117 pim_time_timer_to_mmss(timer
, sizeof(timer
), ch
->t_ifassert_timer
);
119 vty_out(vty
, "%-16s %-15s %-15pPAs %-15pPAs %-6s %-15s %-8s %-5s\n",
121 inet_ntop(AF_INET
, &ifaddr
, buf
, sizeof(buf
)), &ch
->sg
.src
,
122 &ch
->sg
.grp
, pim_ifchannel_ifassert_name(ch
->ifassert_state
),
123 winner_str
, uptime
, timer
);
126 static void pim_show_assert(struct pim_instance
*pim
, struct vty
*vty
)
128 struct pim_interface
*pim_ifp
;
129 struct pim_ifchannel
*ch
;
130 struct interface
*ifp
;
133 now
= pim_time_monotonic_sec();
136 "Interface Address Source Group State Winner Uptime Timer\n");
138 FOR_ALL_INTERFACES (pim
->vrf
, ifp
) {
143 RB_FOREACH (ch
, pim_ifchannel_rb
, &pim_ifp
->ifchannel_rb
) {
144 if (ch
->ifassert_state
== PIM_IFASSERT_NOINFO
)
147 pim_show_assert_helper(vty
, pim_ifp
, ch
, now
);
148 } /* scan interface channels */
152 static void pim_show_assert_internal_helper(struct vty
*vty
,
153 struct pim_interface
*pim_ifp
,
154 struct pim_ifchannel
*ch
)
156 struct in_addr ifaddr
;
157 char buf
[PREFIX_STRLEN
];
159 ifaddr
= pim_ifp
->primary_address
;
161 vty_out(vty
, "%-16s %-15s %-15pPAs %-15pPAs %-3s %-3s %-3s %-4s\n",
163 inet_ntop(AF_INET
, &ifaddr
, buf
, sizeof(buf
)), &ch
->sg
.src
,
165 PIM_IF_FLAG_TEST_COULD_ASSERT(ch
->flags
) ? "yes" : "no",
166 pim_macro_ch_could_assert_eval(ch
) ? "yes" : "no",
167 PIM_IF_FLAG_TEST_ASSERT_TRACKING_DESIRED(ch
->flags
) ? "yes"
169 pim_macro_assert_tracking_desired_eval(ch
) ? "yes" : "no");
172 static void pim_show_assert_internal(struct pim_instance
*pim
, struct vty
*vty
)
174 struct pim_interface
*pim_ifp
;
175 struct pim_ifchannel
*ch
;
176 struct interface
*ifp
;
180 "ECA: Evaluate CouldAssert\n"
181 "ATD: AssertTrackingDesired\n"
182 "eATD: Evaluate AssertTrackingDesired\n\n");
185 "Interface Address Source Group CA eCA ATD eATD\n");
186 FOR_ALL_INTERFACES (pim
->vrf
, ifp
) {
191 RB_FOREACH (ch
, pim_ifchannel_rb
, &pim_ifp
->ifchannel_rb
) {
192 pim_show_assert_internal_helper(vty
, pim_ifp
, ch
);
193 } /* scan interface channels */
197 static void pim_show_assert_metric_helper(struct vty
*vty
,
198 struct pim_interface
*pim_ifp
,
199 struct pim_ifchannel
*ch
)
201 char addr_str
[INET_ADDRSTRLEN
];
202 struct pim_assert_metric am
;
203 struct in_addr ifaddr
;
204 char buf
[PREFIX_STRLEN
];
206 ifaddr
= pim_ifp
->primary_address
;
208 am
= pim_macro_spt_assert_metric(&ch
->upstream
->rpf
,
209 pim_ifp
->primary_address
);
211 pim_inet4_dump("<addr?>", am
.ip_address
, addr_str
, sizeof(addr_str
));
213 vty_out(vty
, "%-16s %-15s %-15pPAs %-15pPAs %-3s %4u %6u %-15s\n",
215 inet_ntop(AF_INET
, &ifaddr
, buf
, sizeof(buf
)), &ch
->sg
.src
,
216 &ch
->sg
.grp
, am
.rpt_bit_flag
? "yes" : "no",
217 am
.metric_preference
, am
.route_metric
, addr_str
);
220 static void pim_show_assert_metric(struct pim_instance
*pim
, struct vty
*vty
)
222 struct pim_interface
*pim_ifp
;
223 struct pim_ifchannel
*ch
;
224 struct interface
*ifp
;
227 "Interface Address Source Group RPT Pref Metric Address \n");
229 FOR_ALL_INTERFACES (pim
->vrf
, ifp
) {
234 RB_FOREACH (ch
, pim_ifchannel_rb
, &pim_ifp
->ifchannel_rb
) {
235 pim_show_assert_metric_helper(vty
, pim_ifp
, ch
);
236 } /* scan interface channels */
240 static void pim_show_assert_winner_metric_helper(struct vty
*vty
,
241 struct pim_interface
*pim_ifp
,
242 struct pim_ifchannel
*ch
)
244 char addr_str
[INET_ADDRSTRLEN
];
245 struct pim_assert_metric
*am
;
246 struct in_addr ifaddr
;
249 char buf
[PREFIX_STRLEN
];
251 ifaddr
= pim_ifp
->primary_address
;
253 am
= &ch
->ifassert_winner_metric
;
255 pim_inet4_dump("<addr?>", am
->ip_address
, addr_str
, sizeof(addr_str
));
257 if (am
->metric_preference
== PIM_ASSERT_METRIC_PREFERENCE_MAX
)
258 snprintf(pref_str
, sizeof(pref_str
), "INFI");
260 snprintf(pref_str
, sizeof(pref_str
), "%4u",
261 am
->metric_preference
);
263 if (am
->route_metric
== PIM_ASSERT_ROUTE_METRIC_MAX
)
264 snprintf(metr_str
, sizeof(metr_str
), "INFI");
266 snprintf(metr_str
, sizeof(metr_str
), "%6u", am
->route_metric
);
268 vty_out(vty
, "%-16s %-15s %-15pPAs %-15pPAs %-3s %-4s %-6s %-15s\n",
270 inet_ntop(AF_INET
, &ifaddr
, buf
, sizeof(buf
)), &ch
->sg
.src
,
271 &ch
->sg
.grp
, am
->rpt_bit_flag
? "yes" : "no", pref_str
,
275 static void pim_show_assert_winner_metric(struct pim_instance
*pim
,
278 struct pim_interface
*pim_ifp
;
279 struct pim_ifchannel
*ch
;
280 struct interface
*ifp
;
283 "Interface Address Source Group RPT Pref Metric Address \n");
285 FOR_ALL_INTERFACES (pim
->vrf
, ifp
) {
290 RB_FOREACH (ch
, pim_ifchannel_rb
, &pim_ifp
->ifchannel_rb
) {
291 pim_show_assert_winner_metric_helper(vty
, pim_ifp
, ch
);
292 } /* scan interface channels */
296 static void igmp_show_interfaces(struct pim_instance
*pim
, struct vty
*vty
,
299 struct interface
*ifp
;
301 char buf
[PREFIX_STRLEN
];
302 json_object
*json
= NULL
;
303 json_object
*json_row
= NULL
;
305 now
= pim_time_monotonic_sec();
308 json
= json_object_new_object();
311 "Interface State Address V Querier QuerierIp Query Timer Uptime\n");
313 FOR_ALL_INTERFACES (pim
->vrf
, ifp
) {
314 struct pim_interface
*pim_ifp
;
315 struct listnode
*sock_node
;
316 struct gm_sock
*igmp
;
323 for (ALL_LIST_ELEMENTS_RO(pim_ifp
->gm_socket_list
, sock_node
,
326 char query_hhmmss
[10];
328 pim_time_uptime(uptime
, sizeof(uptime
),
329 now
- igmp
->sock_creation
);
330 pim_time_timer_to_hhmmss(query_hhmmss
,
331 sizeof(query_hhmmss
),
332 igmp
->t_igmp_query_timer
);
335 json_row
= json_object_new_object();
336 json_object_pim_ifp_add(json_row
, ifp
);
337 json_object_string_add(json_row
, "upTime",
339 json_object_int_add(json_row
, "version",
340 pim_ifp
->igmp_version
);
342 if (igmp
->t_igmp_query_timer
) {
343 json_object_boolean_true_add(json_row
,
345 json_object_string_add(json_row
,
349 json_object_string_addf(json_row
, "querierIp",
351 &igmp
->querier_addr
);
353 json_object_object_add(json
, ifp
->name
,
356 if (igmp
->mtrace_only
) {
357 json_object_boolean_true_add(
358 json_row
, "mtraceOnly");
362 "%-16s %5s %15s %d %7s %17pI4 %11s %8s\n",
365 ? (igmp
->mtrace_only
? "mtrc"
368 inet_ntop(AF_INET
, &igmp
->ifaddr
, buf
,
370 pim_ifp
->igmp_version
,
371 igmp
->t_igmp_query_timer
? "local"
373 &igmp
->querier_addr
, query_hhmmss
,
383 static void igmp_show_interfaces_single(struct pim_instance
*pim
,
384 struct vty
*vty
, const char *ifname
,
387 struct gm_sock
*igmp
;
388 struct interface
*ifp
;
389 struct listnode
*sock_node
;
390 struct pim_interface
*pim_ifp
;
392 char query_hhmmss
[10];
393 char other_hhmmss
[10];
394 int found_ifname
= 0;
396 long gmi_msec
; /* Group Membership Interval */
399 long oqpi_msec
; /* Other Querier Present Interval */
404 json_object
*json
= NULL
;
405 json_object
*json_row
= NULL
;
408 json
= json_object_new_object();
410 now
= pim_time_monotonic_sec();
412 FOR_ALL_INTERFACES (pim
->vrf
, ifp
) {
418 if (strcmp(ifname
, "detail") && strcmp(ifname
, ifp
->name
))
421 for (ALL_LIST_ELEMENTS_RO(pim_ifp
->gm_socket_list
, sock_node
,
424 pim_time_uptime(uptime
, sizeof(uptime
),
425 now
- igmp
->sock_creation
);
426 pim_time_timer_to_hhmmss(query_hhmmss
,
427 sizeof(query_hhmmss
),
428 igmp
->t_igmp_query_timer
);
429 pim_time_timer_to_hhmmss(other_hhmmss
,
430 sizeof(other_hhmmss
),
431 igmp
->t_other_querier_timer
);
433 gmi_msec
= PIM_IGMP_GMI_MSEC(
434 igmp
->querier_robustness_variable
,
435 igmp
->querier_query_interval
,
436 pim_ifp
->gm_query_max_response_time_dsec
);
438 sqi
= PIM_IGMP_SQI(pim_ifp
->gm_default_query_interval
);
440 oqpi_msec
= PIM_IGMP_OQPI_MSEC(
441 igmp
->querier_robustness_variable
,
442 igmp
->querier_query_interval
,
443 pim_ifp
->gm_query_max_response_time_dsec
);
445 lmqt_msec
= PIM_IGMP_LMQT_MSEC(
446 pim_ifp
->gm_specific_query_max_response_time_dsec
,
447 pim_ifp
->gm_last_member_query_count
);
451 igmp
->querier_robustness_variable
,
452 igmp
->querier_query_interval
,
453 pim_ifp
->gm_query_max_response_time_dsec
) *
457 pim_ifp
->gm_query_max_response_time_dsec
* 100;
458 lmqc
= pim_ifp
->gm_last_member_query_count
;
461 json_row
= json_object_new_object();
462 json_object_pim_ifp_add(json_row
, ifp
);
463 json_object_string_add(json_row
, "upTime",
465 json_object_string_add(json_row
, "querier",
466 igmp
->t_igmp_query_timer
469 json_object_string_addf(json_row
, "querierIp",
471 &igmp
->querier_addr
);
472 json_object_int_add(json_row
, "queryStartCount",
473 igmp
->startup_query_count
);
474 json_object_string_add(json_row
,
477 json_object_string_add(json_row
,
480 json_object_int_add(json_row
, "version",
481 pim_ifp
->igmp_version
);
484 "timerGroupMembershipIntervalMsec",
486 json_object_int_add(json_row
,
487 "lastMemberQueryCount",
489 json_object_int_add(json_row
,
490 "timerLastMemberQueryMsec",
494 "timerOlderHostPresentIntervalMsec",
498 "timerOtherQuerierPresentIntervalMsec",
501 json_row
, "timerQueryInterval",
502 igmp
->querier_query_interval
);
505 "timerQueryResponseIntervalMsec",
508 json_row
, "timerRobustnessVariable",
509 igmp
->querier_robustness_variable
);
510 json_object_int_add(json_row
,
511 "timerStartupQueryInterval",
514 json_object_object_add(json
, ifp
->name
,
517 if (igmp
->mtrace_only
) {
518 json_object_boolean_true_add(
519 json_row
, "mtraceOnly");
522 vty_out(vty
, "Interface : %s\n", ifp
->name
);
523 vty_out(vty
, "State : %s\n",
524 if_is_up(ifp
) ? (igmp
->mtrace_only
?
528 vty_out(vty
, "Address : %pI4\n",
529 &pim_ifp
->primary_address
);
530 vty_out(vty
, "Uptime : %s\n", uptime
);
531 vty_out(vty
, "Version : %d\n",
532 pim_ifp
->igmp_version
);
536 vty_out(vty
, "Querier\n");
537 vty_out(vty
, "-------\n");
538 vty_out(vty
, "Querier : %s\n",
539 igmp
->t_igmp_query_timer
? "local"
541 vty_out(vty
, "QuerierIp : %pI4",
542 &igmp
->querier_addr
);
543 if (pim_ifp
->primary_address
.s_addr
544 == igmp
->querier_addr
.s_addr
)
545 vty_out(vty
, " (this router)\n");
549 vty_out(vty
, "Start Count : %d\n",
550 igmp
->startup_query_count
);
551 vty_out(vty
, "Query Timer : %s\n",
553 vty_out(vty
, "Other Timer : %s\n",
558 vty_out(vty
, "Timers\n");
559 vty_out(vty
, "------\n");
561 "Group Membership Interval : %lis\n",
564 "Last Member Query Count : %d\n",
567 "Last Member Query Time : %lis\n",
570 "Older Host Present Interval : %lis\n",
573 "Other Querier Present Interval : %lis\n",
576 "Query Interval : %ds\n",
577 igmp
->querier_query_interval
);
579 "Query Response Interval : %lis\n",
582 "Robustness Variable : %d\n",
583 igmp
->querier_robustness_variable
);
585 "Startup Query Interval : %ds\n",
590 pim_print_ifp_flags(vty
, ifp
);
597 else if (!found_ifname
)
598 vty_out(vty
, "%% No such interface\n");
601 static void igmp_show_interface_join(struct pim_instance
*pim
, struct vty
*vty
,
604 struct interface
*ifp
;
606 json_object
*json
= NULL
;
607 json_object
*json_iface
= NULL
;
608 json_object
*json_grp
= NULL
;
609 json_object
*json_grp_arr
= NULL
;
611 now
= pim_time_monotonic_sec();
614 json
= json_object_new_object();
615 json_object_string_add(json
, "vrf",
616 vrf_id_to_name(pim
->vrf
->vrf_id
));
619 "Interface Address Source Group Socket Uptime \n");
622 FOR_ALL_INTERFACES (pim
->vrf
, ifp
) {
623 struct pim_interface
*pim_ifp
;
624 struct listnode
*join_node
;
626 struct in_addr pri_addr
;
627 char pri_addr_str
[INET_ADDRSTRLEN
];
634 if (!pim_ifp
->gm_join_list
)
637 pri_addr
= pim_find_primary_addr(ifp
);
638 pim_inet4_dump("<pri?>", pri_addr
, pri_addr_str
,
639 sizeof(pri_addr_str
));
641 for (ALL_LIST_ELEMENTS_RO(pim_ifp
->gm_join_list
, join_node
,
643 char group_str
[INET_ADDRSTRLEN
];
644 char source_str
[INET_ADDRSTRLEN
];
647 pim_time_uptime(uptime
, sizeof(uptime
),
648 now
- ij
->sock_creation
);
649 pim_inet4_dump("<grp?>", ij
->group_addr
, group_str
,
651 pim_inet4_dump("<src?>", ij
->source_addr
, source_str
,
655 json_object_object_get_ex(json
, ifp
->name
,
659 json_iface
= json_object_new_object();
660 json_object_string_add(
661 json_iface
, "name", ifp
->name
);
662 json_object_object_add(json
, ifp
->name
,
664 json_grp_arr
= json_object_new_array();
665 json_object_object_add(json_iface
,
670 json_grp
= json_object_new_object();
671 json_object_string_add(json_grp
, "source",
673 json_object_string_add(json_grp
, "group",
675 json_object_string_add(json_grp
, "primaryAddr",
677 json_object_int_add(json_grp
, "sockFd",
679 json_object_string_add(json_grp
, "upTime",
681 json_object_array_add(json_grp_arr
, json_grp
);
684 "%-16s %-15s %-15s %-15s %6d %8s\n",
685 ifp
->name
, pri_addr_str
, source_str
,
686 group_str
, ij
->sock_fd
, uptime
);
688 } /* for (pim_ifp->gm_join_list) */
696 static void igmp_show_statistics(struct pim_instance
*pim
, struct vty
*vty
,
697 const char *ifname
, bool uj
)
699 struct interface
*ifp
;
700 struct igmp_stats igmp_stats
;
701 bool found_ifname
= false;
702 json_object
*json
= NULL
;
704 igmp_stats_init(&igmp_stats
);
707 json
= json_object_new_object();
709 FOR_ALL_INTERFACES (pim
->vrf
, ifp
) {
710 struct pim_interface
*pim_ifp
;
711 struct listnode
*sock_node
, *source_node
, *group_node
;
712 struct gm_sock
*igmp
;
713 struct gm_group
*group
;
714 struct gm_source
*src
;
721 if (ifname
&& strcmp(ifname
, ifp
->name
))
726 igmp_stats
.joins_failed
+= pim_ifp
->igmp_ifstat_joins_failed
;
727 igmp_stats
.joins_sent
+= pim_ifp
->igmp_ifstat_joins_sent
;
728 igmp_stats
.total_groups
+=
729 pim_ifp
->gm_group_list
730 ? listcount(pim_ifp
->gm_group_list
)
732 igmp_stats
.peak_groups
+= pim_ifp
->igmp_peak_group_count
;
735 for (ALL_LIST_ELEMENTS_RO(pim_ifp
->gm_group_list
, group_node
,
737 for (ALL_LIST_ELEMENTS_RO(group
->group_source_list
,
739 if (pim_addr_is_any(src
->source_addr
))
742 igmp_stats
.total_source_groups
++;
746 for (ALL_LIST_ELEMENTS_RO(pim_ifp
->gm_socket_list
, sock_node
,
748 igmp_stats_add(&igmp_stats
, &igmp
->igmp_stats
);
756 vty_out(vty
, "%% No such interface\n");
761 json_object
*json_row
= json_object_new_object();
763 json_object_string_add(json_row
, "name",
764 ifname
? ifname
: "global");
765 json_object_int_add(json_row
, "queryV1", igmp_stats
.query_v1
);
766 json_object_int_add(json_row
, "queryV2", igmp_stats
.query_v2
);
767 json_object_int_add(json_row
, "queryV3", igmp_stats
.query_v3
);
768 json_object_int_add(json_row
, "leaveV2", igmp_stats
.leave_v2
);
769 json_object_int_add(json_row
, "reportV1", igmp_stats
.report_v1
);
770 json_object_int_add(json_row
, "reportV2", igmp_stats
.report_v2
);
771 json_object_int_add(json_row
, "reportV3", igmp_stats
.report_v3
);
772 json_object_int_add(json_row
, "mtraceResponse",
773 igmp_stats
.mtrace_rsp
);
774 json_object_int_add(json_row
, "mtraceRequest",
775 igmp_stats
.mtrace_req
);
776 json_object_int_add(json_row
, "unsupported",
777 igmp_stats
.unsupported
);
778 json_object_int_add(json_row
, "totalReceivedMessages",
779 igmp_stats
.total_recv_messages
);
780 json_object_int_add(json_row
, "peakGroups",
781 igmp_stats
.peak_groups
);
782 json_object_int_add(json_row
, "totalGroups",
783 igmp_stats
.total_groups
);
784 json_object_int_add(json_row
, "totalSourceGroups",
785 igmp_stats
.total_source_groups
);
786 json_object_int_add(json_row
, "joinsFailed",
787 igmp_stats
.joins_failed
);
788 json_object_int_add(json_row
, "joinsSent",
789 igmp_stats
.joins_sent
);
790 json_object_int_add(json_row
, "generalQueriesSent",
791 igmp_stats
.general_queries_sent
);
792 json_object_int_add(json_row
, "groupQueriesSent",
793 igmp_stats
.group_queries_sent
);
794 json_object_object_add(json
, ifname
? ifname
: "global",
798 vty_out(vty
, "IGMP statistics\n");
799 vty_out(vty
, "Interface : %s\n",
800 ifname
? ifname
: "global");
801 vty_out(vty
, "V1 query : %u\n",
802 igmp_stats
.query_v1
);
803 vty_out(vty
, "V2 query : %u\n",
804 igmp_stats
.query_v2
);
805 vty_out(vty
, "V3 query : %u\n",
806 igmp_stats
.query_v3
);
807 vty_out(vty
, "V2 leave : %u\n",
808 igmp_stats
.leave_v2
);
809 vty_out(vty
, "V1 report : %u\n",
810 igmp_stats
.report_v1
);
811 vty_out(vty
, "V2 report : %u\n",
812 igmp_stats
.report_v2
);
813 vty_out(vty
, "V3 report : %u\n",
814 igmp_stats
.report_v3
);
815 vty_out(vty
, "mtrace response : %u\n",
816 igmp_stats
.mtrace_rsp
);
817 vty_out(vty
, "mtrace request : %u\n",
818 igmp_stats
.mtrace_req
);
819 vty_out(vty
, "unsupported : %u\n",
820 igmp_stats
.unsupported
);
821 vty_out(vty
, "total received messages : %u\n",
822 igmp_stats
.total_recv_messages
);
823 vty_out(vty
, "joins failed : %u\n",
824 igmp_stats
.joins_failed
);
825 vty_out(vty
, "joins sent : %u\n",
826 igmp_stats
.joins_sent
);
827 vty_out(vty
, "general queries sent : %u\n",
828 igmp_stats
.general_queries_sent
);
829 vty_out(vty
, "group queries sent : %u\n",
830 igmp_stats
.group_queries_sent
);
831 vty_out(vty
, "peak groups : %u\n",
832 igmp_stats
.peak_groups
);
833 vty_out(vty
, "total groups : %u\n",
834 igmp_stats
.total_groups
);
835 vty_out(vty
, "total source groups : %u\n",
836 igmp_stats
.total_source_groups
);
840 /* Display the bsm database details */
841 static void pim_show_bsm_db(struct pim_instance
*pim
, struct vty
*vty
, bool uj
)
845 struct bsm_frag
*bsfrag
;
846 json_object
*json
= NULL
;
847 json_object
*json_group
= NULL
;
848 json_object
*json_row
= NULL
;
850 count
= bsm_frags_count(pim
->global_scope
.bsm_frags
);
853 json
= json_object_new_object();
854 json_object_int_add(json
, "Number of the fragments", count
);
856 vty_out(vty
, "Scope Zone: Global\n");
857 vty_out(vty
, "Number of the fragments: %d\n", count
);
861 frr_each (bsm_frags
, pim
->global_scope
.bsm_frags
, bsfrag
) {
862 char grp_str
[PREFIX_STRLEN
];
863 struct bsmmsg_grpinfo
*group
;
864 struct bsmmsg_rpinfo
*bsm_rpinfo
;
871 uint32_t frag_rp_cnt
= 0;
876 /* skip pim header */
877 buf
+= PIM_MSG_HEADER_LEN
;
878 len
-= PIM_MSG_HEADER_LEN
;
880 hdr
= (struct bsm_hdr
*)buf
;
881 /* NB: bshdr->bsr_addr.addr is packed/unaligned => memcpy */
882 memcpy(&bsr_addr
, &hdr
->bsr_addr
.addr
, sizeof(bsr_addr
));
884 /* BSM starts with bsr header */
885 buf
+= sizeof(struct bsm_hdr
);
886 len
-= sizeof(struct bsm_hdr
);
889 json_object_string_addf(json
, "BSR address", "%pPA",
891 json_object_int_add(json
, "BSR priority",
893 json_object_int_add(json
, "Hashmask Length",
895 json_object_int_add(json
, "Fragment Tag",
896 ntohs(hdr
->frag_tag
));
898 vty_out(vty
, "BSM Fragment : %d\n", fragment
);
899 vty_out(vty
, "------------------\n");
900 vty_out(vty
, "%-15s %-15s %-15s %-15s\n", "BSR-Address",
901 "BSR-Priority", "Hashmask-len", "Fragment-Tag");
902 vty_out(vty
, "%-15pPA %-15d %-15d %-15d\n", &bsr_addr
,
903 hdr
->bsr_prio
, hdr
->hm_len
,
904 ntohs(hdr
->frag_tag
));
909 while (offset
< len
) {
910 group
= (struct bsmmsg_grpinfo
*)buf
;
912 if (group
->group
.family
== PIM_MSG_ADDRESS_FAMILY_IPV4
)
913 grp
.family
= AF_INET
;
914 else if (group
->group
.family
==
915 PIM_MSG_ADDRESS_FAMILY_IPV6
)
916 grp
.family
= AF_INET6
;
918 grp
.prefixlen
= group
->group
.mask
;
920 grp
.u
.prefix4
= group
->group
.addr
;
922 grp
.u
.prefix6
= group
->group
.addr
;
925 prefix2str(&grp
, grp_str
, sizeof(grp_str
));
927 buf
+= sizeof(struct bsmmsg_grpinfo
);
928 offset
+= sizeof(struct bsmmsg_grpinfo
);
931 json_object_object_get_ex(json
, grp_str
,
934 json_group
= json_object_new_object();
935 json_object_int_add(json_group
,
939 json_group
, "Fragment Rp count",
940 group
->frag_rp_count
);
941 json_object_object_add(json
, grp_str
,
945 vty_out(vty
, "Group : %s\n", grp_str
);
946 vty_out(vty
, "-------------------\n");
947 vty_out(vty
, "Rp Count:%d\n", group
->rp_count
);
948 vty_out(vty
, "Fragment Rp Count : %d\n",
949 group
->frag_rp_count
);
952 frag_rp_cnt
= group
->frag_rp_count
;
959 "RpAddress HoldTime Priority\n");
961 while (frag_rp_cnt
--) {
964 bsm_rpinfo
= (struct bsmmsg_rpinfo
*)buf
;
965 /* unaligned, again */
966 memcpy(&rp_addr
, &bsm_rpinfo
->rpaddr
,
969 buf
+= sizeof(struct bsmmsg_rpinfo
);
970 offset
+= sizeof(struct bsmmsg_rpinfo
);
973 json_row
= json_object_new_object();
974 json_object_string_addf(
975 json_row
, "Rp Address", "%pPA",
978 json_row
, "Rp HoldTime",
979 ntohs(bsm_rpinfo
->rp_holdtime
));
980 json_object_int_add(json_row
,
983 json_object_object_addf(
984 json_group
, json_row
, "%pPA",
987 vty_out(vty
, "%-15pPA %-12d %d\n",
989 ntohs(bsm_rpinfo
->rp_holdtime
),
1000 vty_json(vty
, json
);
1003 /*Display the group-rp mappings */
1004 static void pim_show_group_rp_mappings_info(struct pim_instance
*pim
,
1005 struct vty
*vty
, bool uj
)
1007 struct bsgrp_node
*bsgrp
;
1008 struct bsm_rpinfo
*bsm_rp
;
1009 struct route_node
*rn
;
1010 json_object
*json
= NULL
;
1011 json_object
*json_group
= NULL
;
1012 json_object
*json_row
= NULL
;
1015 json
= json_object_new_object();
1016 json_object_string_addf(json
, "BSR Address", "%pPA",
1017 &pim
->global_scope
.current_bsr
);
1019 vty_out(vty
, "BSR Address %pPA\n",
1020 &pim
->global_scope
.current_bsr
);
1022 for (rn
= route_top(pim
->global_scope
.bsrp_table
); rn
;
1023 rn
= route_next(rn
)) {
1024 bsgrp
= (struct bsgrp_node
*)rn
->info
;
1029 char grp_str
[PREFIX_STRLEN
];
1031 prefix2str(&bsgrp
->group
, grp_str
, sizeof(grp_str
));
1034 json_object_object_get_ex(json
, grp_str
, &json_group
);
1036 json_group
= json_object_new_object();
1037 json_object_object_add(json
, grp_str
,
1041 vty_out(vty
, "Group Address %pFX\n", &bsgrp
->group
);
1042 vty_out(vty
, "--------------------------\n");
1043 vty_out(vty
, "%-15s %-15s %-15s %-15s\n", "Rp Address",
1044 "priority", "Holdtime", "Hash");
1046 vty_out(vty
, "(ACTIVE)\n");
1049 frr_each (bsm_rpinfos
, bsgrp
->bsrp_list
, bsm_rp
) {
1051 json_row
= json_object_new_object();
1052 json_object_string_addf(json_row
, "Rp Address",
1054 &bsm_rp
->rp_address
);
1055 json_object_int_add(json_row
, "Rp HoldTime",
1056 bsm_rp
->rp_holdtime
);
1057 json_object_int_add(json_row
, "Rp Priority",
1059 json_object_int_add(json_row
, "Hash Val",
1061 json_object_object_addf(json_group
, json_row
,
1063 &bsm_rp
->rp_address
);
1066 vty_out(vty
, "%-15pPA %-15u %-15u %-15u\n",
1067 &bsm_rp
->rp_address
, bsm_rp
->rp_prio
,
1068 bsm_rp
->rp_holdtime
, bsm_rp
->hash
);
1071 if (!bsm_rpinfos_count(bsgrp
->bsrp_list
) && !uj
)
1072 vty_out(vty
, "Active List is empty.\n");
1075 json_object_int_add(json_group
, "Pending RP count",
1076 bsgrp
->pend_rp_cnt
);
1078 vty_out(vty
, "(PENDING)\n");
1079 vty_out(vty
, "Pending RP count :%d\n",
1080 bsgrp
->pend_rp_cnt
);
1081 if (bsgrp
->pend_rp_cnt
)
1082 vty_out(vty
, "%-15s %-15s %-15s %-15s\n",
1083 "Rp Address", "priority", "Holdtime",
1087 frr_each (bsm_rpinfos
, bsgrp
->partial_bsrp_list
, bsm_rp
) {
1089 json_row
= json_object_new_object();
1090 json_object_string_addf(json_row
, "Rp Address",
1092 &bsm_rp
->rp_address
);
1093 json_object_int_add(json_row
, "Rp HoldTime",
1094 bsm_rp
->rp_holdtime
);
1095 json_object_int_add(json_row
, "Rp Priority",
1097 json_object_int_add(json_row
, "Hash Val",
1099 json_object_object_addf(json_group
, json_row
,
1101 &bsm_rp
->rp_address
);
1103 vty_out(vty
, "%-15pPA %-15u %-15u %-15u\n",
1104 &bsm_rp
->rp_address
, bsm_rp
->rp_prio
,
1105 bsm_rp
->rp_holdtime
, bsm_rp
->hash
);
1108 if (!bsm_rpinfos_count(bsgrp
->partial_bsrp_list
) && !uj
)
1109 vty_out(vty
, "Partial List is empty\n");
1116 vty_json(vty
, json
);
1119 static void igmp_show_groups(struct pim_instance
*pim
, struct vty
*vty
, bool uj
)
1121 struct interface
*ifp
;
1123 json_object
*json
= NULL
;
1124 json_object
*json_iface
= NULL
;
1125 json_object
*json_group
= NULL
;
1126 json_object
*json_groups
= NULL
;
1128 now
= pim_time_monotonic_sec();
1131 json
= json_object_new_object();
1132 json_object_int_add(json
, "totalGroups", pim
->gm_group_count
);
1133 json_object_int_add(json
, "watermarkLimit",
1134 pim
->gm_watermark_limit
);
1136 vty_out(vty
, "Total IGMP groups: %u\n", pim
->gm_group_count
);
1137 vty_out(vty
, "Watermark warn limit(%s): %u\n",
1138 pim
->gm_watermark_limit
? "Set" : "Not Set",
1139 pim
->gm_watermark_limit
);
1141 "Interface Group Mode Timer Srcs V Uptime \n");
1144 /* scan interfaces */
1145 FOR_ALL_INTERFACES (pim
->vrf
, ifp
) {
1146 struct pim_interface
*pim_ifp
= ifp
->info
;
1147 struct listnode
*grpnode
;
1148 struct gm_group
*grp
;
1153 /* scan igmp groups */
1154 for (ALL_LIST_ELEMENTS_RO(pim_ifp
->gm_group_list
, grpnode
,
1156 char group_str
[INET_ADDRSTRLEN
];
1160 pim_inet4_dump("<group?>", grp
->group_addr
, group_str
,
1162 pim_time_timer_to_hhmmss(hhmmss
, sizeof(hhmmss
),
1163 grp
->t_group_timer
);
1164 pim_time_uptime(uptime
, sizeof(uptime
),
1165 now
- grp
->group_creation
);
1168 json_object_object_get_ex(json
, ifp
->name
,
1172 json_iface
= json_object_new_object();
1173 json_object_pim_ifp_add(json_iface
,
1175 json_object_object_add(json
, ifp
->name
,
1177 json_groups
= json_object_new_array();
1178 json_object_object_add(json_iface
,
1183 json_group
= json_object_new_object();
1184 json_object_string_add(json_group
, "group",
1187 if (grp
->igmp_version
== 3)
1188 json_object_string_add(
1190 grp
->group_filtermode_isexcl
1194 json_object_string_add(json_group
, "timer",
1196 json_object_int_add(
1197 json_group
, "sourcesCount",
1198 grp
->group_source_list
? listcount(
1199 grp
->group_source_list
)
1201 json_object_int_add(json_group
, "version",
1203 json_object_string_add(json_group
, "uptime",
1205 json_object_array_add(json_groups
, json_group
);
1207 vty_out(vty
, "%-16s %-15s %4s %8s %4d %d %8s\n",
1208 ifp
->name
, group_str
,
1209 grp
->igmp_version
== 3
1210 ? (grp
->group_filtermode_isexcl
1215 grp
->group_source_list
? listcount(
1216 grp
->group_source_list
)
1218 grp
->igmp_version
, uptime
);
1220 } /* scan igmp groups */
1221 } /* scan interfaces */
1224 vty_json(vty
, json
);
1227 static void igmp_show_group_retransmission(struct pim_instance
*pim
,
1230 struct interface
*ifp
;
1233 "Interface Group RetTimer Counter RetSrcs\n");
1235 /* scan interfaces */
1236 FOR_ALL_INTERFACES (pim
->vrf
, ifp
) {
1237 struct pim_interface
*pim_ifp
= ifp
->info
;
1238 struct listnode
*grpnode
;
1239 struct gm_group
*grp
;
1244 /* scan igmp groups */
1245 for (ALL_LIST_ELEMENTS_RO(pim_ifp
->gm_group_list
, grpnode
,
1247 char group_str
[INET_ADDRSTRLEN
];
1248 char grp_retr_mmss
[10];
1249 struct listnode
*src_node
;
1250 struct gm_source
*src
;
1251 int grp_retr_sources
= 0;
1253 pim_inet4_dump("<group?>", grp
->group_addr
, group_str
,
1255 pim_time_timer_to_mmss(
1256 grp_retr_mmss
, sizeof(grp_retr_mmss
),
1257 grp
->t_group_query_retransmit_timer
);
1260 /* count group sources with retransmission state
1262 for (ALL_LIST_ELEMENTS_RO(grp
->group_source_list
,
1264 if (src
->source_query_retransmit_count
> 0) {
1269 vty_out(vty
, "%-16s %-15s %-8s %7d %7d\n", ifp
->name
,
1270 group_str
, grp_retr_mmss
,
1271 grp
->group_specific_query_retransmit_count
,
1274 } /* scan igmp groups */
1275 } /* scan interfaces */
1278 static void igmp_show_sources(struct pim_instance
*pim
, struct vty
*vty
,
1281 struct interface
*ifp
;
1283 json_object
*json
= NULL
;
1284 json_object
*json_iface
= NULL
;
1285 json_object
*json_group
= NULL
;
1286 json_object
*json_source
= NULL
;
1287 json_object
*json_sources
= NULL
;
1289 now
= pim_time_monotonic_sec();
1292 json
= json_object_new_object();
1295 "Interface Group Source Timer Fwd Uptime \n");
1297 /* scan interfaces */
1298 FOR_ALL_INTERFACES (pim
->vrf
, ifp
) {
1299 struct pim_interface
*pim_ifp
= ifp
->info
;
1300 struct listnode
*grpnode
;
1301 struct gm_group
*grp
;
1306 /* scan igmp groups */
1307 for (ALL_LIST_ELEMENTS_RO(pim_ifp
->gm_group_list
, grpnode
,
1309 char group_str
[INET_ADDRSTRLEN
];
1310 struct listnode
*srcnode
;
1311 struct gm_source
*src
;
1313 pim_inet4_dump("<group?>", grp
->group_addr
, group_str
,
1316 /* scan group sources */
1317 for (ALL_LIST_ELEMENTS_RO(grp
->group_source_list
,
1319 char source_str
[INET_ADDRSTRLEN
];
1323 pim_inet4_dump("<source?>", src
->source_addr
,
1324 source_str
, sizeof(source_str
));
1326 pim_time_timer_to_mmss(mmss
, sizeof(mmss
),
1327 src
->t_source_timer
);
1329 pim_time_uptime(uptime
, sizeof(uptime
),
1330 now
- src
->source_creation
);
1333 json_object_object_get_ex(
1334 json
, ifp
->name
, &json_iface
);
1337 json_object_new_object();
1338 json_object_string_add(
1341 json_object_object_add(
1345 json_object_object_get_ex(json_iface
,
1351 json_object_new_object();
1352 json_object_string_add(
1353 json_group
, "group",
1355 json_object_object_add(
1356 json_iface
, group_str
,
1359 json_object_new_array();
1360 json_object_object_add(
1361 json_group
, "sources",
1364 json_source
= json_object_new_object();
1365 json_object_string_add(json_source
,
1368 json_object_string_add(json_source
,
1370 json_object_boolean_add(
1371 json_source
, "forwarded",
1372 IGMP_SOURCE_TEST_FORWARDING(
1373 src
->source_flags
));
1374 json_object_string_add(
1375 json_source
, "uptime", uptime
);
1376 json_object_array_add(json_sources
,
1381 "%-16s %-15s %-15s %5s %3s %8s\n",
1382 ifp
->name
, group_str
,
1384 IGMP_SOURCE_TEST_FORWARDING(
1391 } /* scan group sources */
1392 } /* scan igmp groups */
1393 } /* scan interfaces */
1395 vty_json(vty
, json
);
1398 static void igmp_show_source_retransmission(struct pim_instance
*pim
,
1401 struct interface
*ifp
;
1404 "Interface Group Source Counter\n");
1406 /* scan interfaces */
1407 FOR_ALL_INTERFACES (pim
->vrf
, ifp
) {
1408 struct pim_interface
*pim_ifp
= ifp
->info
;
1409 struct listnode
*grpnode
;
1410 struct gm_group
*grp
;
1415 /* scan igmp groups */
1416 for (ALL_LIST_ELEMENTS_RO(pim_ifp
->gm_group_list
, grpnode
,
1418 char group_str
[INET_ADDRSTRLEN
];
1419 struct listnode
*srcnode
;
1420 struct gm_source
*src
;
1422 pim_inet4_dump("<group?>", grp
->group_addr
, group_str
,
1425 /* scan group sources */
1426 for (ALL_LIST_ELEMENTS_RO(grp
->group_source_list
,
1428 char source_str
[INET_ADDRSTRLEN
];
1430 pim_inet4_dump("<source?>", src
->source_addr
,
1431 source_str
, sizeof(source_str
));
1433 vty_out(vty
, "%-16s %-15s %-15s %7d\n",
1434 ifp
->name
, group_str
, source_str
,
1435 src
->source_query_retransmit_count
);
1437 } /* scan group sources */
1438 } /* scan igmp groups */
1439 } /* scan interfaces */
1442 static void pim_show_bsr(struct pim_instance
*pim
,
1447 char last_bsm_seen
[10];
1450 json_object
*json
= NULL
;
1452 if (pim_addr_is_any(pim
->global_scope
.current_bsr
)) {
1453 pim_time_uptime(uptime
, sizeof(uptime
),
1454 pim
->global_scope
.current_bsr_first_ts
);
1455 pim_time_uptime(last_bsm_seen
, sizeof(last_bsm_seen
),
1456 pim
->global_scope
.current_bsr_last_ts
);
1460 now
= pim_time_monotonic_sec();
1461 pim_time_uptime(uptime
, sizeof(uptime
),
1462 (now
- pim
->global_scope
.current_bsr_first_ts
));
1463 pim_time_uptime(last_bsm_seen
, sizeof(last_bsm_seen
),
1464 now
- pim
->global_scope
.current_bsr_last_ts
);
1467 switch (pim
->global_scope
.state
) {
1469 strlcpy(bsr_state
, "NO_INFO", sizeof(bsr_state
));
1472 strlcpy(bsr_state
, "ACCEPT_ANY", sizeof(bsr_state
));
1474 case ACCEPT_PREFERRED
:
1475 strlcpy(bsr_state
, "ACCEPT_PREFERRED", sizeof(bsr_state
));
1478 strlcpy(bsr_state
, "", sizeof(bsr_state
));
1483 json
= json_object_new_object();
1484 json_object_string_addf(json
, "bsr", "%pPA",
1485 &pim
->global_scope
.current_bsr
);
1486 json_object_int_add(json
, "priority",
1487 pim
->global_scope
.current_bsr_prio
);
1488 json_object_int_add(json
, "fragmentTag",
1489 pim
->global_scope
.bsm_frag_tag
);
1490 json_object_string_add(json
, "state", bsr_state
);
1491 json_object_string_add(json
, "upTime", uptime
);
1492 json_object_string_add(json
, "lastBsmSeen", last_bsm_seen
);
1496 vty_out(vty
, "PIMv2 Bootstrap information\n");
1497 vty_out(vty
, "Current preferred BSR address: %pPA\n",
1498 &pim
->global_scope
.current_bsr
);
1500 "Priority Fragment-Tag State UpTime\n");
1501 vty_out(vty
, " %-12d %-12d %-13s %7s\n",
1502 pim
->global_scope
.current_bsr_prio
,
1503 pim
->global_scope
.bsm_frag_tag
,
1506 vty_out(vty
, "Last BSM seen: %s\n", last_bsm_seen
);
1510 vty_json(vty
, json
);
1513 static void clear_igmp_interfaces(struct pim_instance
*pim
)
1515 struct interface
*ifp
;
1517 FOR_ALL_INTERFACES (pim
->vrf
, ifp
)
1518 pim_if_addr_del_all_igmp(ifp
);
1520 FOR_ALL_INTERFACES (pim
->vrf
, ifp
)
1521 pim_if_addr_add_all(ifp
);
1524 static void clear_interfaces(struct pim_instance
*pim
)
1526 clear_igmp_interfaces(pim
);
1527 clear_pim_interfaces(pim
);
1530 #define PIM_GET_PIM_INTERFACE(pim_ifp, ifp) \
1531 pim_ifp = ifp->info; \
1534 "%% Enable PIM and/or IGMP on this interface first\n"); \
1535 return CMD_WARNING_CONFIG_FAILED; \
1539 * Compatibility function to keep the legacy mesh group CLI behavior:
1540 * Delete group when there are no more configurations in it.
1543 * Don't forget to call `nb_cli_apply_changes` after this.
1545 static void pim_cli_legacy_mesh_group_behavior(struct vty
*vty
,
1548 const char *vrfname
;
1549 char xpath_value
[XPATH_MAXLEN
];
1550 char xpath_member_value
[XPATH_MAXLEN
];
1551 const struct lyd_node
*member_dnode
;
1553 vrfname
= pim_cli_get_vrf_name(vty
);
1554 if (vrfname
== NULL
)
1557 /* Get mesh group base XPath. */
1558 snprintf(xpath_value
, sizeof(xpath_value
),
1559 FRR_PIM_VRF_XPATH
"/msdp-mesh-groups[name='%s']",
1560 "frr-pim:pimd", "pim", vrfname
, "frr-routing:ipv4", gname
);
1561 /* Group must exists, otherwise just quit. */
1562 if (!yang_dnode_exists(vty
->candidate_config
->dnode
, xpath_value
))
1565 /* Group members check: */
1566 strlcpy(xpath_member_value
, xpath_value
, sizeof(xpath_member_value
));
1567 strlcat(xpath_member_value
, "/members", sizeof(xpath_member_value
));
1568 if (yang_dnode_exists(vty
->candidate_config
->dnode
,
1569 xpath_member_value
)) {
1570 member_dnode
= yang_dnode_get(vty
->candidate_config
->dnode
,
1571 xpath_member_value
);
1572 if (!member_dnode
|| !yang_is_last_list_dnode(member_dnode
))
1576 /* Source address check: */
1577 strlcpy(xpath_member_value
, xpath_value
, sizeof(xpath_member_value
));
1578 strlcat(xpath_member_value
, "/source", sizeof(xpath_member_value
));
1579 if (yang_dnode_exists(vty
->candidate_config
->dnode
, xpath_member_value
))
1582 /* No configurations found: delete it. */
1583 nb_cli_enqueue_change(vty
, xpath_value
, NB_OP_DESTROY
, NULL
);
1586 DEFUN (clear_ip_interfaces
,
1587 clear_ip_interfaces_cmd
,
1588 "clear ip interfaces [vrf NAME]",
1591 "Reset interfaces\n"
1595 struct vrf
*vrf
= pim_cmd_lookup_vrf(vty
, argv
, argc
, &idx
);
1600 clear_interfaces(vrf
->info
);
1605 DEFUN (clear_ip_igmp_interfaces
,
1606 clear_ip_igmp_interfaces_cmd
,
1607 "clear ip igmp [vrf NAME] interfaces",
1612 "Reset IGMP interfaces\n")
1615 struct vrf
*vrf
= pim_cmd_lookup_vrf(vty
, argv
, argc
, &idx
);
1620 clear_igmp_interfaces(vrf
->info
);
1625 DEFPY (clear_ip_pim_statistics
,
1626 clear_ip_pim_statistics_cmd
,
1627 "clear ip pim statistics [vrf NAME]$name",
1632 "Reset PIM statistics\n")
1634 struct vrf
*v
= pim_cmd_lookup(vty
, name
);
1639 clear_pim_statistics(v
->info
);
1644 DEFPY (clear_ip_mroute
,
1645 clear_ip_mroute_cmd
,
1646 "clear ip mroute [vrf NAME]$name",
1652 struct vrf
*v
= pim_cmd_lookup(vty
, name
);
1657 clear_mroute(v
->info
);
1662 DEFPY (clear_ip_pim_interfaces
,
1663 clear_ip_pim_interfaces_cmd
,
1664 "clear ip pim [vrf NAME] interfaces",
1669 "Reset PIM interfaces\n")
1671 struct vrf
*v
= pim_cmd_lookup(vty
, vrf
);
1676 clear_pim_interfaces(v
->info
);
1681 DEFPY (clear_ip_pim_interface_traffic
,
1682 clear_ip_pim_interface_traffic_cmd
,
1683 "clear ip pim [vrf NAME] interface traffic",
1688 "Reset PIM interfaces\n"
1689 "Reset Protocol Packet counters\n")
1691 return clear_pim_interface_traffic(vrf
, vty
);
1694 DEFPY (clear_ip_pim_oil
,
1695 clear_ip_pim_oil_cmd
,
1696 "clear ip pim [vrf NAME]$name oil",
1701 "Rescan PIM OIL (output interface list)\n")
1703 struct vrf
*v
= pim_cmd_lookup(vty
, name
);
1708 pim_scan_oil(v
->info
);
1713 DEFUN (clear_ip_pim_bsr_db
,
1714 clear_ip_pim_bsr_db_cmd
,
1715 "clear ip pim [vrf NAME] bsr-data",
1720 "Reset pim bsr data\n")
1723 struct vrf
*vrf
= pim_cmd_lookup_vrf(vty
, argv
, argc
, &idx
);
1728 pim_bsm_clear(vrf
->info
);
1733 DEFUN (show_ip_igmp_interface
,
1734 show_ip_igmp_interface_cmd
,
1735 "show ip igmp [vrf NAME] interface [detail|WORD] [json]",
1740 "IGMP interface information\n"
1746 struct vrf
*vrf
= pim_cmd_lookup_vrf(vty
, argv
, argc
, &idx
);
1747 bool uj
= use_json(argc
, argv
);
1752 if (argv_find(argv
, argc
, "detail", &idx
)
1753 || argv_find(argv
, argc
, "WORD", &idx
))
1754 igmp_show_interfaces_single(vrf
->info
, vty
, argv
[idx
]->arg
, uj
);
1756 igmp_show_interfaces(vrf
->info
, vty
, uj
);
1761 DEFUN (show_ip_igmp_interface_vrf_all
,
1762 show_ip_igmp_interface_vrf_all_cmd
,
1763 "show ip igmp vrf all interface [detail|WORD] [json]",
1768 "IGMP interface information\n"
1774 bool uj
= use_json(argc
, argv
);
1780 RB_FOREACH (vrf
, vrf_name_head
, &vrfs_by_name
) {
1784 vty_out(vty
, " \"%s\": ", vrf
->name
);
1787 vty_out(vty
, "VRF: %s\n", vrf
->name
);
1788 if (argv_find(argv
, argc
, "detail", &idx
)
1789 || argv_find(argv
, argc
, "WORD", &idx
))
1790 igmp_show_interfaces_single(vrf
->info
, vty
,
1791 argv
[idx
]->arg
, uj
);
1793 igmp_show_interfaces(vrf
->info
, vty
, uj
);
1796 vty_out(vty
, "}\n");
1801 DEFUN (show_ip_igmp_join
,
1802 show_ip_igmp_join_cmd
,
1803 "show ip igmp [vrf NAME] join [json]",
1808 "IGMP static join information\n"
1812 struct vrf
*vrf
= pim_cmd_lookup_vrf(vty
, argv
, argc
, &idx
);
1813 bool uj
= use_json(argc
, argv
);
1818 igmp_show_interface_join(vrf
->info
, vty
, uj
);
1823 DEFUN (show_ip_igmp_join_vrf_all
,
1824 show_ip_igmp_join_vrf_all_cmd
,
1825 "show ip igmp vrf all join [json]",
1830 "IGMP static join information\n"
1833 bool uj
= use_json(argc
, argv
);
1839 RB_FOREACH (vrf
, vrf_name_head
, &vrfs_by_name
) {
1843 vty_out(vty
, " \"%s\": ", vrf
->name
);
1846 vty_out(vty
, "VRF: %s\n", vrf
->name
);
1847 igmp_show_interface_join(vrf
->info
, vty
, uj
);
1850 vty_out(vty
, "}\n");
1855 DEFUN (show_ip_igmp_groups
,
1856 show_ip_igmp_groups_cmd
,
1857 "show ip igmp [vrf NAME] groups [json]",
1866 struct vrf
*vrf
= pim_cmd_lookup_vrf(vty
, argv
, argc
, &idx
);
1867 bool uj
= use_json(argc
, argv
);
1872 igmp_show_groups(vrf
->info
, vty
, uj
);
1877 DEFUN (show_ip_igmp_groups_vrf_all
,
1878 show_ip_igmp_groups_vrf_all_cmd
,
1879 "show ip igmp vrf all groups [json]",
1887 bool uj
= use_json(argc
, argv
);
1893 RB_FOREACH (vrf
, vrf_name_head
, &vrfs_by_name
) {
1897 vty_out(vty
, " \"%s\": ", vrf
->name
);
1900 vty_out(vty
, "VRF: %s\n", vrf
->name
);
1901 igmp_show_groups(vrf
->info
, vty
, uj
);
1904 vty_out(vty
, "}\n");
1909 DEFUN (show_ip_igmp_groups_retransmissions
,
1910 show_ip_igmp_groups_retransmissions_cmd
,
1911 "show ip igmp [vrf NAME] groups retransmissions",
1917 "IGMP group retransmissions\n")
1920 struct vrf
*vrf
= pim_cmd_lookup_vrf(vty
, argv
, argc
, &idx
);
1925 igmp_show_group_retransmission(vrf
->info
, vty
);
1930 DEFUN (show_ip_igmp_sources
,
1931 show_ip_igmp_sources_cmd
,
1932 "show ip igmp [vrf NAME] sources [json]",
1941 struct vrf
*vrf
= pim_cmd_lookup_vrf(vty
, argv
, argc
, &idx
);
1946 igmp_show_sources(vrf
->info
, vty
, use_json(argc
, argv
));
1951 DEFUN (show_ip_igmp_sources_retransmissions
,
1952 show_ip_igmp_sources_retransmissions_cmd
,
1953 "show ip igmp [vrf NAME] sources retransmissions",
1959 "IGMP source retransmissions\n")
1962 struct vrf
*vrf
= pim_cmd_lookup_vrf(vty
, argv
, argc
, &idx
);
1967 igmp_show_source_retransmission(vrf
->info
, vty
);
1972 DEFUN (show_ip_igmp_statistics
,
1973 show_ip_igmp_statistics_cmd
,
1974 "show ip igmp [vrf NAME] statistics [interface WORD] [json]",
1985 struct vrf
*vrf
= pim_cmd_lookup_vrf(vty
, argv
, argc
, &idx
);
1986 bool uj
= use_json(argc
, argv
);
1991 if (argv_find(argv
, argc
, "WORD", &idx
))
1992 igmp_show_statistics(vrf
->info
, vty
, argv
[idx
]->arg
, uj
);
1994 igmp_show_statistics(vrf
->info
, vty
, NULL
, uj
);
1999 DEFUN (show_ip_pim_mlag_summary
,
2000 show_ip_pim_mlag_summary_cmd
,
2001 "show ip pim mlag summary [json]",
2006 "status and stats\n"
2009 bool uj
= use_json(argc
, argv
);
2010 char role_buf
[MLAG_ROLE_STRSIZE
];
2011 char addr_buf
[INET_ADDRSTRLEN
];
2014 json_object
*json
= NULL
;
2015 json_object
*json_stat
= NULL
;
2017 json
= json_object_new_object();
2018 if (router
->mlag_flags
& PIM_MLAGF_LOCAL_CONN_UP
)
2019 json_object_boolean_true_add(json
, "mlagConnUp");
2020 if (router
->mlag_flags
& PIM_MLAGF_PEER_CONN_UP
)
2021 json_object_boolean_true_add(json
, "mlagPeerConnUp");
2022 if (router
->mlag_flags
& PIM_MLAGF_PEER_ZEBRA_UP
)
2023 json_object_boolean_true_add(json
, "mlagPeerZebraUp");
2024 json_object_string_add(json
, "mlagRole",
2025 mlag_role2str(router
->mlag_role
,
2026 role_buf
, sizeof(role_buf
)));
2027 inet_ntop(AF_INET
, &router
->local_vtep_ip
,
2028 addr_buf
, INET_ADDRSTRLEN
);
2029 json_object_string_add(json
, "localVtepIp", addr_buf
);
2030 inet_ntop(AF_INET
, &router
->anycast_vtep_ip
,
2031 addr_buf
, INET_ADDRSTRLEN
);
2032 json_object_string_add(json
, "anycastVtepIp", addr_buf
);
2033 json_object_string_add(json
, "peerlinkRif",
2034 router
->peerlink_rif
);
2036 json_stat
= json_object_new_object();
2037 json_object_int_add(json_stat
, "mlagConnFlaps",
2038 router
->mlag_stats
.mlagd_session_downs
);
2039 json_object_int_add(json_stat
, "mlagPeerConnFlaps",
2040 router
->mlag_stats
.peer_session_downs
);
2041 json_object_int_add(json_stat
, "mlagPeerZebraFlaps",
2042 router
->mlag_stats
.peer_zebra_downs
);
2043 json_object_int_add(json_stat
, "mrouteAddRx",
2044 router
->mlag_stats
.msg
.mroute_add_rx
);
2045 json_object_int_add(json_stat
, "mrouteAddTx",
2046 router
->mlag_stats
.msg
.mroute_add_tx
);
2047 json_object_int_add(json_stat
, "mrouteDelRx",
2048 router
->mlag_stats
.msg
.mroute_del_rx
);
2049 json_object_int_add(json_stat
, "mrouteDelTx",
2050 router
->mlag_stats
.msg
.mroute_del_tx
);
2051 json_object_int_add(json_stat
, "mlagStatusUpdates",
2052 router
->mlag_stats
.msg
.mlag_status_updates
);
2053 json_object_int_add(json_stat
, "peerZebraStatusUpdates",
2054 router
->mlag_stats
.msg
.peer_zebra_status_updates
);
2055 json_object_int_add(json_stat
, "pimStatusUpdates",
2056 router
->mlag_stats
.msg
.pim_status_updates
);
2057 json_object_int_add(json_stat
, "vxlanUpdates",
2058 router
->mlag_stats
.msg
.vxlan_updates
);
2059 json_object_object_add(json
, "connStats", json_stat
);
2061 vty_json(vty
, json
);
2065 vty_out(vty
, "MLAG daemon connection: %s\n",
2066 (router
->mlag_flags
& PIM_MLAGF_LOCAL_CONN_UP
)
2068 vty_out(vty
, "MLAG peer state: %s\n",
2069 (router
->mlag_flags
& PIM_MLAGF_PEER_CONN_UP
)
2071 vty_out(vty
, "Zebra peer state: %s\n",
2072 (router
->mlag_flags
& PIM_MLAGF_PEER_ZEBRA_UP
)
2074 vty_out(vty
, "MLAG role: %s\n",
2075 mlag_role2str(router
->mlag_role
, role_buf
, sizeof(role_buf
)));
2076 inet_ntop(AF_INET
, &router
->local_vtep_ip
,
2077 addr_buf
, INET_ADDRSTRLEN
);
2078 vty_out(vty
, "Local VTEP IP: %s\n", addr_buf
);
2079 inet_ntop(AF_INET
, &router
->anycast_vtep_ip
,
2080 addr_buf
, INET_ADDRSTRLEN
);
2081 vty_out(vty
, "Anycast VTEP IP: %s\n", addr_buf
);
2082 vty_out(vty
, "Peerlink: %s\n", router
->peerlink_rif
);
2083 vty_out(vty
, "Session flaps: mlagd: %d mlag-peer: %d zebra-peer: %d\n",
2084 router
->mlag_stats
.mlagd_session_downs
,
2085 router
->mlag_stats
.peer_session_downs
,
2086 router
->mlag_stats
.peer_zebra_downs
);
2087 vty_out(vty
, "Message Statistics:\n");
2088 vty_out(vty
, " mroute adds: rx: %d, tx: %d\n",
2089 router
->mlag_stats
.msg
.mroute_add_rx
,
2090 router
->mlag_stats
.msg
.mroute_add_tx
);
2091 vty_out(vty
, " mroute dels: rx: %d, tx: %d\n",
2092 router
->mlag_stats
.msg
.mroute_del_rx
,
2093 router
->mlag_stats
.msg
.mroute_del_tx
);
2094 vty_out(vty
, " peer zebra status updates: %d\n",
2095 router
->mlag_stats
.msg
.peer_zebra_status_updates
);
2096 vty_out(vty
, " PIM status updates: %d\n",
2097 router
->mlag_stats
.msg
.pim_status_updates
);
2098 vty_out(vty
, " VxLAN updates: %d\n",
2099 router
->mlag_stats
.msg
.vxlan_updates
);
2104 DEFUN (show_ip_pim_assert
,
2105 show_ip_pim_assert_cmd
,
2106 "show ip pim [vrf NAME] assert",
2111 "PIM interface assert\n")
2114 struct vrf
*vrf
= pim_cmd_lookup_vrf(vty
, argv
, argc
, &idx
);
2119 pim_show_assert(vrf
->info
, vty
);
2124 DEFUN (show_ip_pim_assert_internal
,
2125 show_ip_pim_assert_internal_cmd
,
2126 "show ip pim [vrf NAME] assert-internal",
2131 "PIM interface internal assert state\n")
2134 struct vrf
*vrf
= pim_cmd_lookup_vrf(vty
, argv
, argc
, &idx
);
2139 pim_show_assert_internal(vrf
->info
, vty
);
2144 DEFUN (show_ip_pim_assert_metric
,
2145 show_ip_pim_assert_metric_cmd
,
2146 "show ip pim [vrf NAME] assert-metric",
2151 "PIM interface assert metric\n")
2154 struct vrf
*vrf
= pim_cmd_lookup_vrf(vty
, argv
, argc
, &idx
);
2159 pim_show_assert_metric(vrf
->info
, vty
);
2164 DEFUN (show_ip_pim_assert_winner_metric
,
2165 show_ip_pim_assert_winner_metric_cmd
,
2166 "show ip pim [vrf NAME] assert-winner-metric",
2171 "PIM interface assert winner metric\n")
2174 struct vrf
*vrf
= pim_cmd_lookup_vrf(vty
, argv
, argc
, &idx
);
2179 pim_show_assert_winner_metric(vrf
->info
, vty
);
2184 DEFPY (show_ip_pim_interface
,
2185 show_ip_pim_interface_cmd
,
2186 "show ip pim [mlag$mlag] [vrf NAME] interface [detail|WORD]$interface [json$json]",
2192 "PIM interface information\n"
2197 return pim_show_interface_cmd_helper(vrf
, vty
, !!json
, !!mlag
,
2201 DEFPY (show_ip_pim_interface_vrf_all
,
2202 show_ip_pim_interface_vrf_all_cmd
,
2203 "show ip pim [mlag$mlag] vrf all interface [detail|WORD]$interface [json$json]",
2209 "PIM interface information\n"
2214 return pim_show_interface_vrf_all_cmd_helper(vty
, !!json
, !!mlag
,
2218 DEFPY (show_ip_pim_join
,
2219 show_ip_pim_join_cmd
,
2220 "show ip pim [vrf NAME] join [A.B.C.D$s_or_g [A.B.C.D$g]] [json$json]",
2225 "PIM interface join information\n"
2226 "The Source or Group\n"
2230 return pim_show_join_cmd_helper(vrf
, vty
, s_or_g
, g
, json
);
2233 DEFPY (show_ip_pim_join_vrf_all
,
2234 show_ip_pim_join_vrf_all_cmd
,
2235 "show ip pim vrf all join [json$json]",
2240 "PIM interface join information\n"
2243 return pim_show_join_vrf_all_cmd_helper(vty
, json
);
2246 DEFPY (show_ip_pim_jp_agg
,
2247 show_ip_pim_jp_agg_cmd
,
2248 "show ip pim [vrf NAME] jp-agg",
2253 "join prune aggregation list\n")
2255 return pim_show_jp_agg_list_cmd_helper(vrf
, vty
);
2258 DEFPY (show_ip_pim_local_membership
,
2259 show_ip_pim_local_membership_cmd
,
2260 "show ip pim [vrf NAME] local-membership [json$json]",
2265 "PIM interface local-membership\n"
2268 return pim_show_membership_cmd_helper(vrf
, vty
, !!json
);
2271 static void pim_show_mlag_up_entry_detail(struct vrf
*vrf
,
2273 struct pim_upstream
*up
,
2274 char *src_str
, char *grp_str
,
2278 json_object
*json_row
= NULL
;
2279 json_object
*own_list
= NULL
;
2280 json_object
*json_group
= NULL
;
2283 json_object_object_get_ex(json
, grp_str
, &json_group
);
2285 json_group
= json_object_new_object();
2286 json_object_object_add(json
, grp_str
,
2290 json_row
= json_object_new_object();
2291 json_object_string_add(json_row
, "source", src_str
);
2292 json_object_string_add(json_row
, "group", grp_str
);
2294 own_list
= json_object_new_array();
2295 if (pim_up_mlag_is_local(up
))
2296 json_object_array_add(own_list
,
2297 json_object_new_string("local"));
2298 if (up
->flags
& (PIM_UPSTREAM_FLAG_MASK_MLAG_PEER
))
2299 json_object_array_add(own_list
,
2300 json_object_new_string("peer"));
2301 if (up
->flags
& (PIM_UPSTREAM_FLAG_MASK_MLAG_INTERFACE
))
2302 json_object_array_add(
2303 own_list
, json_object_new_string("Interface"));
2304 json_object_object_add(json_row
, "owners", own_list
);
2306 json_object_int_add(json_row
, "localCost",
2307 pim_up_mlag_local_cost(up
));
2308 json_object_int_add(json_row
, "peerCost",
2309 pim_up_mlag_peer_cost(up
));
2310 if (PIM_UPSTREAM_FLAG_TEST_MLAG_NON_DF(up
->flags
))
2311 json_object_boolean_false_add(json_row
, "df");
2313 json_object_boolean_true_add(json_row
, "df");
2314 json_object_object_add(json_group
, src_str
, json_row
);
2319 if (pim_up_mlag_is_local(up
))
2320 strlcat(own_str
, "L", sizeof(own_str
));
2321 if (up
->flags
& (PIM_UPSTREAM_FLAG_MASK_MLAG_PEER
))
2322 strlcat(own_str
, "P", sizeof(own_str
));
2323 if (up
->flags
& (PIM_UPSTREAM_FLAG_MASK_MLAG_INTERFACE
))
2324 strlcat(own_str
, "I", sizeof(own_str
));
2325 /* XXX - fixup, print paragraph output */
2327 "%-15s %-15s %-6s %-11u %-10d %2s\n",
2328 src_str
, grp_str
, own_str
,
2329 pim_up_mlag_local_cost(up
),
2330 pim_up_mlag_peer_cost(up
),
2331 PIM_UPSTREAM_FLAG_TEST_MLAG_NON_DF(up
->flags
)
2336 static void pim_show_mlag_up_detail(struct vrf
*vrf
,
2337 struct vty
*vty
, const char *src_or_group
,
2338 const char *group
, bool uj
)
2340 char src_str
[PIM_ADDRSTRLEN
];
2341 char grp_str
[PIM_ADDRSTRLEN
];
2342 struct pim_upstream
*up
;
2343 struct pim_instance
*pim
= vrf
->info
;
2344 json_object
*json
= NULL
;
2347 json
= json_object_new_object();
2350 "Source Group Owner Local-cost Peer-cost DF\n");
2352 frr_each (rb_pim_upstream
, &pim
->upstream_head
, up
) {
2353 if (!(up
->flags
& PIM_UPSTREAM_FLAG_MASK_MLAG_PEER
)
2354 && !(up
->flags
& PIM_UPSTREAM_FLAG_MASK_MLAG_INTERFACE
)
2355 && !pim_up_mlag_is_local(up
))
2358 snprintfrr(grp_str
, sizeof(grp_str
), "%pPAs", &up
->sg
.grp
);
2359 snprintfrr(src_str
, sizeof(src_str
), "%pPAs", &up
->sg
.src
);
2361 /* XXX: strcmps are clearly inefficient. we should do uint comps
2365 if (strcmp(src_str
, src_or_group
) ||
2366 strcmp(grp_str
, group
))
2369 if (strcmp(src_str
, src_or_group
) &&
2370 strcmp(grp_str
, src_or_group
))
2373 pim_show_mlag_up_entry_detail(vrf
, vty
, up
,
2374 src_str
, grp_str
, json
);
2378 vty_json(vty
, json
);
2381 static void pim_show_mlag_up_vrf(struct vrf
*vrf
, struct vty
*vty
, bool uj
)
2383 json_object
*json
= NULL
;
2384 json_object
*json_row
;
2385 struct pim_upstream
*up
;
2386 struct pim_instance
*pim
= vrf
->info
;
2387 json_object
*json_group
= NULL
;
2390 json
= json_object_new_object();
2393 "Source Group Owner Local-cost Peer-cost DF\n");
2396 frr_each (rb_pim_upstream
, &pim
->upstream_head
, up
) {
2397 if (!(up
->flags
& PIM_UPSTREAM_FLAG_MASK_MLAG_PEER
)
2398 && !(up
->flags
& PIM_UPSTREAM_FLAG_MASK_MLAG_INTERFACE
)
2399 && !pim_up_mlag_is_local(up
))
2402 char src_str
[PIM_ADDRSTRLEN
];
2403 char grp_str
[PIM_ADDRSTRLEN
];
2404 json_object
*own_list
= NULL
;
2406 snprintfrr(grp_str
, sizeof(grp_str
), "%pPAs",
2408 snprintfrr(src_str
, sizeof(src_str
), "%pPAs",
2411 json_object_object_get_ex(json
, grp_str
, &json_group
);
2413 json_group
= json_object_new_object();
2414 json_object_object_add(json
, grp_str
,
2418 json_row
= json_object_new_object();
2419 json_object_string_add(json_row
, "vrf", vrf
->name
);
2420 json_object_string_add(json_row
, "source", src_str
);
2421 json_object_string_add(json_row
, "group", grp_str
);
2423 own_list
= json_object_new_array();
2424 if (pim_up_mlag_is_local(up
)) {
2426 json_object_array_add(own_list
,
2427 json_object_new_string(
2430 if (up
->flags
& (PIM_UPSTREAM_FLAG_MASK_MLAG_PEER
)) {
2431 json_object_array_add(own_list
,
2432 json_object_new_string(
2435 json_object_object_add(json_row
, "owners", own_list
);
2437 json_object_int_add(json_row
, "localCost",
2438 pim_up_mlag_local_cost(up
));
2439 json_object_int_add(json_row
, "peerCost",
2440 pim_up_mlag_peer_cost(up
));
2441 if (PIM_UPSTREAM_FLAG_TEST_MLAG_NON_DF(up
->flags
))
2442 json_object_boolean_false_add(json_row
, "df");
2444 json_object_boolean_true_add(json_row
, "df");
2445 json_object_object_add(json_group
, src_str
, json_row
);
2450 if (pim_up_mlag_is_local(up
))
2451 strlcat(own_str
, "L", sizeof(own_str
));
2452 if (up
->flags
& (PIM_UPSTREAM_FLAG_MASK_MLAG_PEER
))
2453 strlcat(own_str
, "P", sizeof(own_str
));
2454 if (up
->flags
& (PIM_UPSTREAM_FLAG_MASK_MLAG_INTERFACE
))
2455 strlcat(own_str
, "I", sizeof(own_str
));
2457 "%-15pPAs %-15pPAs %-6s %-11u %-10u %2s\n",
2458 &up
->sg
.src
, &up
->sg
.grp
, own_str
,
2459 pim_up_mlag_local_cost(up
),
2460 pim_up_mlag_peer_cost(up
),
2461 PIM_UPSTREAM_FLAG_TEST_MLAG_NON_DF(up
->flags
)
2466 vty_json(vty
, json
);
2469 static void pim_show_mlag_help_string(struct vty
*vty
, bool uj
)
2472 vty_out(vty
, "Owner codes:\n");
2474 "L: EVPN-MLAG Entry, I:PIM-MLAG Entry, P: Peer Entry\n");
2479 DEFUN(show_ip_pim_mlag_up
, show_ip_pim_mlag_up_cmd
,
2480 "show ip pim [vrf NAME] mlag upstream [A.B.C.D [A.B.C.D]] [json]",
2487 "Unicast or Multicast address\n"
2488 "Multicast address\n" JSON_STR
)
2490 const char *src_or_group
= NULL
;
2491 const char *group
= NULL
;
2493 struct vrf
*vrf
= pim_cmd_lookup_vrf(vty
, argv
, argc
, &idx
);
2494 bool uj
= use_json(argc
, argv
);
2496 if (!vrf
|| !vrf
->info
) {
2497 vty_out(vty
, "%s: VRF or Info missing\n", __func__
);
2504 if (argv_find(argv
, argc
, "A.B.C.D", &idx
)) {
2505 src_or_group
= argv
[idx
]->arg
;
2507 group
= argv
[idx
+ 1]->arg
;
2510 pim_show_mlag_help_string(vty
, uj
);
2513 pim_show_mlag_up_detail(vrf
, vty
, src_or_group
, group
, uj
);
2515 pim_show_mlag_up_vrf(vrf
, vty
, uj
);
2521 DEFUN(show_ip_pim_mlag_up_vrf_all
, show_ip_pim_mlag_up_vrf_all_cmd
,
2522 "show ip pim vrf all mlag upstream [json]",
2523 SHOW_STR IP_STR PIM_STR VRF_CMD_HELP_STR
2525 "upstream\n" JSON_STR
)
2528 bool uj
= use_json(argc
, argv
);
2530 pim_show_mlag_help_string(vty
, uj
);
2531 RB_FOREACH (vrf
, vrf_name_head
, &vrfs_by_name
) {
2532 pim_show_mlag_up_vrf(vrf
, vty
, uj
);
2538 DEFPY (show_ip_pim_neighbor
,
2539 show_ip_pim_neighbor_cmd
,
2540 "show ip pim [vrf NAME] neighbor [detail|WORD]$interface [json$json]",
2545 "PIM neighbor information\n"
2547 "Name of interface or neighbor\n"
2550 return pim_show_neighbors_cmd_helper(vrf
, vty
, json
, interface
);
2553 DEFPY (show_ip_pim_neighbor_vrf_all
,
2554 show_ip_pim_neighbor_vrf_all_cmd
,
2555 "show ip pim vrf all neighbor [detail|WORD]$interface [json$json]",
2560 "PIM neighbor information\n"
2562 "Name of interface or neighbor\n"
2565 return pim_show_neighbors_vrf_all_cmd_helper(vty
, json
, interface
);
2568 DEFPY (show_ip_pim_secondary
,
2569 show_ip_pim_secondary_cmd
,
2570 "show ip pim [vrf NAME] secondary",
2575 "PIM neighbor addresses\n")
2577 return pim_show_secondary_helper(vrf
, vty
);
2580 DEFPY (show_ip_pim_state
,
2581 show_ip_pim_state_cmd
,
2582 "show ip pim [vrf NAME] state [A.B.C.D$s_or_g [A.B.C.D$g]] [json$json]",
2587 "PIM state information\n"
2588 "Unicast or Multicast address\n"
2589 "Multicast address\n"
2592 return pim_show_state_helper(vrf
, vty
, s_or_g_str
, g_str
, !!json
);
2595 DEFPY (show_ip_pim_state_vrf_all
,
2596 show_ip_pim_state_vrf_all_cmd
,
2597 "show ip pim vrf all state [A.B.C.D$s_or_g [A.B.C.D$g]] [json$json]",
2602 "PIM state information\n"
2603 "Unicast or Multicast address\n"
2604 "Multicast address\n"
2607 return pim_show_state_vrf_all_helper(vty
, s_or_g_str
, g_str
, !!json
);
2610 DEFPY (show_ip_pim_upstream
,
2611 show_ip_pim_upstream_cmd
,
2612 "show ip pim [vrf NAME] upstream [A.B.C.D$s_or_g [A.B.C.D$g]] [json$json]",
2617 "PIM upstream information\n"
2618 "The Source or Group\n"
2622 return pim_show_upstream_helper(vrf
, vty
, s_or_g
, g
, !!json
);
2625 DEFPY (show_ip_pim_upstream_vrf_all
,
2626 show_ip_pim_upstream_vrf_all_cmd
,
2627 "show ip pim vrf all upstream [json$json]",
2632 "PIM upstream information\n"
2635 return pim_show_upstream_vrf_all_helper(vty
, !!json
);
2638 DEFPY (show_ip_pim_channel
,
2639 show_ip_pim_channel_cmd
,
2640 "show ip pim [vrf NAME] channel [json$json]",
2645 "PIM downstream channel info\n"
2648 return pim_show_channel_cmd_helper(vrf
, vty
, !!json
);
2651 DEFPY (show_ip_pim_upstream_join_desired
,
2652 show_ip_pim_upstream_join_desired_cmd
,
2653 "show ip pim [vrf NAME] upstream-join-desired [json$json]",
2658 "PIM upstream join-desired\n"
2661 return pim_show_upstream_join_desired_helper(vrf
, vty
, !!json
);
2664 DEFPY (show_ip_pim_upstream_rpf
,
2665 show_ip_pim_upstream_rpf_cmd
,
2666 "show ip pim [vrf NAME] upstream-rpf [json$json]",
2671 "PIM upstream source rpf\n"
2674 return pim_show_upstream_rpf_helper(vrf
, vty
, !!json
);
2677 DEFPY (show_ip_pim_rp
,
2679 "show ip pim [vrf NAME] rp-info [A.B.C.D/M$group] [json$json]",
2684 "PIM RP information\n"
2685 "Multicast Group range\n"
2688 return pim_show_rp_helper(vrf
, vty
, group_str
, (struct prefix
*)group
,
2692 DEFPY (show_ip_pim_rp_vrf_all
,
2693 show_ip_pim_rp_vrf_all_cmd
,
2694 "show ip pim vrf all rp-info [A.B.C.D/M$group] [json$json]",
2699 "PIM RP information\n"
2700 "Multicast Group range\n"
2703 return pim_show_rp_vrf_all_helper(vty
, group_str
,
2704 (struct prefix
*)group
, !!json
);
2707 DEFPY (show_ip_pim_rpf
,
2708 show_ip_pim_rpf_cmd
,
2709 "show ip pim [vrf NAME] rpf [json$json]",
2714 "PIM cached source rpf information\n"
2717 return pim_show_rpf_helper(vrf
, vty
, !!json
);
2720 DEFPY (show_ip_pim_rpf_vrf_all
,
2721 show_ip_pim_rpf_vrf_all_cmd
,
2722 "show ip pim vrf all rpf [json$json]",
2727 "PIM cached source rpf information\n"
2730 return pim_show_rpf_vrf_all_helper(vty
, !!json
);
2733 DEFPY (show_ip_pim_nexthop
,
2734 show_ip_pim_nexthop_cmd
,
2735 "show ip pim [vrf NAME] nexthop [json$json]",
2740 "PIM cached nexthop rpf information\n"
2743 return pim_show_nexthop_cmd_helper(vrf
, vty
, !!json
);
2746 DEFPY (show_ip_pim_nexthop_lookup
,
2747 show_ip_pim_nexthop_lookup_cmd
,
2748 "show ip pim [vrf NAME] nexthop-lookup A.B.C.D$source A.B.C.D$group",
2753 "PIM cached nexthop rpf lookup\n"
2754 "Source/RP address\n"
2755 "Multicast Group address\n")
2757 return pim_show_nexthop_lookup_cmd_helper(vrf
, vty
, source
, group
);
2760 DEFPY (show_ip_pim_interface_traffic
,
2761 show_ip_pim_interface_traffic_cmd
,
2762 "show ip pim [vrf NAME] interface traffic [WORD$if_name] [json$json]",
2767 "PIM interface information\n"
2768 "Protocol Packet counters\n"
2772 return pim_show_interface_traffic_helper(vrf
, if_name
, vty
, !!json
);
2775 DEFUN (show_ip_pim_bsm_db
,
2776 show_ip_pim_bsm_db_cmd
,
2777 "show ip pim bsm-database [vrf NAME] [json]",
2781 "PIM cached bsm packets information\n"
2786 struct vrf
*vrf
= pim_cmd_lookup_vrf(vty
, argv
, argc
, &idx
);
2787 bool uj
= use_json(argc
, argv
);
2792 pim_show_bsm_db(vrf
->info
, vty
, uj
);
2796 DEFUN (show_ip_pim_bsrp
,
2797 show_ip_pim_bsrp_cmd
,
2798 "show ip pim bsrp-info [vrf NAME] [json]",
2802 "PIM cached group-rp mappings information\n"
2807 struct vrf
*vrf
= pim_cmd_lookup_vrf(vty
, argv
, argc
, &idx
);
2808 bool uj
= use_json(argc
, argv
);
2813 pim_show_group_rp_mappings_info(vrf
->info
, vty
, uj
);
2818 DEFPY (show_ip_pim_statistics
,
2819 show_ip_pim_statistics_cmd
,
2820 "show ip pim [vrf NAME] statistics [interface WORD$word] [json$json]",
2830 return pim_show_statistics_helper(vrf
, vty
, word
, !!json
);
2833 DEFPY (show_ip_multicast
,
2834 show_ip_multicast_cmd
,
2835 "show ip multicast [vrf NAME]",
2838 "Multicast global information\n"
2841 return pim_show_multicast_helper(vrf
, vty
);
2844 DEFPY (show_ip_multicast_vrf_all
,
2845 show_ip_multicast_vrf_all_cmd
,
2846 "show ip multicast vrf all",
2849 "Multicast global information\n"
2852 return pim_show_multicast_vrf_all_helper(vty
);
2855 DEFPY (show_ip_multicast_count
,
2856 show_ip_multicast_count_cmd
,
2857 "show ip multicast count [vrf NAME] [json$json]",
2860 "Multicast global information\n"
2861 "Data packet count\n"
2865 return pim_show_multicast_count_helper(vrf
, vty
, !!json
);
2868 DEFPY (show_ip_multicast_count_vrf_all
,
2869 show_ip_multicast_count_vrf_all_cmd
,
2870 "show ip multicast count vrf all [json$json]",
2873 "Multicast global information\n"
2874 "Data packet count\n"
2878 return pim_show_multicast_count_vrf_all_helper(vty
, !!json
);
2881 DEFPY (show_ip_mroute
,
2883 "show ip mroute [vrf NAME] [A.B.C.D$s_or_g [A.B.C.D$g]] [fill$fill] [json$json]",
2888 "The Source or Group\n"
2890 "Fill in Assumed data\n"
2893 return pim_show_mroute_helper(vrf
, vty
, s_or_g
, g
, !!fill
, !!json
);
2896 DEFPY (show_ip_mroute_vrf_all
,
2897 show_ip_mroute_vrf_all_cmd
,
2898 "show ip mroute vrf all [fill$fill] [json$json]",
2903 "Fill in Assumed data\n"
2906 return pim_show_mroute_vrf_all_helper(vty
, !!fill
, !!json
);
2909 DEFPY (clear_ip_mroute_count
,
2910 clear_ip_mroute_count_cmd
,
2911 "clear ip mroute [vrf NAME]$name count",
2916 "Route and packet count data\n")
2918 return clear_ip_mroute_count_command(vty
, name
);
2921 DEFPY (show_ip_mroute_count
,
2922 show_ip_mroute_count_cmd
,
2923 "show ip mroute [vrf NAME] count [json$json]",
2928 "Route and packet count data\n"
2931 return pim_show_mroute_count_helper(vrf
, vty
, !!json
);
2934 DEFPY (show_ip_mroute_count_vrf_all
,
2935 show_ip_mroute_count_vrf_all_cmd
,
2936 "show ip mroute vrf all count [json$json]",
2941 "Route and packet count data\n"
2944 return pim_show_mroute_count_vrf_all_helper(vty
, !!json
);
2947 DEFPY (show_ip_mroute_summary
,
2948 show_ip_mroute_summary_cmd
,
2949 "show ip mroute [vrf NAME] summary [json$json]",
2954 "Summary of all mroutes\n"
2957 return pim_show_mroute_summary_helper(vrf
, vty
, !!json
);
2960 DEFPY (show_ip_mroute_summary_vrf_all
,
2961 show_ip_mroute_summary_vrf_all_cmd
,
2962 "show ip mroute vrf all summary [json$json]",
2967 "Summary of all mroutes\n"
2970 return pim_show_mroute_summary_vrf_all_helper(vty
, !!json
);
2975 "show ip rib [vrf NAME] A.B.C.D",
2980 "Unicast address\n")
2983 struct vrf
*vrf
= pim_cmd_lookup_vrf(vty
, argv
, argc
, &idx
);
2984 struct in_addr addr
;
2985 const char *addr_str
;
2986 struct pim_nexthop nexthop
;
2992 memset(&nexthop
, 0, sizeof(nexthop
));
2993 argv_find(argv
, argc
, "A.B.C.D", &idx
);
2994 addr_str
= argv
[idx
]->arg
;
2995 result
= inet_pton(AF_INET
, addr_str
, &addr
);
2997 vty_out(vty
, "Bad unicast address %s: errno=%d: %s\n", addr_str
,
2998 errno
, safe_strerror(errno
));
3002 if (!pim_nexthop_lookup(vrf
->info
, &nexthop
, addr
, 0)) {
3004 "Failure querying RIB nexthop for unicast address %s\n",
3010 "Address NextHop Interface Metric Preference\n");
3012 vty_out(vty
, "%-15s %-15pPAs %-9s %6d %10d\n", addr_str
,
3013 &nexthop
.mrib_nexthop_addr
,
3014 nexthop
.interface
? nexthop
.interface
->name
: "<ifname?>",
3015 nexthop
.mrib_route_metric
, nexthop
.mrib_metric_preference
);
3020 static void show_ssmpingd(struct pim_instance
*pim
, struct vty
*vty
)
3022 struct listnode
*node
;
3023 struct ssmpingd_sock
*ss
;
3027 "Source Socket Address Port Uptime Requests\n");
3029 if (!pim
->ssmpingd_list
)
3032 now
= pim_time_monotonic_sec();
3034 for (ALL_LIST_ELEMENTS_RO(pim
->ssmpingd_list
, node
, ss
)) {
3035 char source_str
[INET_ADDRSTRLEN
];
3037 struct sockaddr_in bind_addr
;
3038 socklen_t len
= sizeof(bind_addr
);
3039 char bind_addr_str
[INET_ADDRSTRLEN
];
3041 pim_inet4_dump("<src?>", ss
->source_addr
, source_str
,
3042 sizeof(source_str
));
3044 if (pim_socket_getsockname(
3045 ss
->sock_fd
, (struct sockaddr
*)&bind_addr
, &len
)) {
3047 "%% Failure reading socket name for ssmpingd source %s on fd=%d\n",
3048 source_str
, ss
->sock_fd
);
3051 pim_inet4_dump("<addr?>", bind_addr
.sin_addr
, bind_addr_str
,
3052 sizeof(bind_addr_str
));
3053 pim_time_uptime(ss_uptime
, sizeof(ss_uptime
),
3054 now
- ss
->creation
);
3056 vty_out(vty
, "%-15s %6d %-15s %5d %8s %8lld\n", source_str
,
3057 ss
->sock_fd
, bind_addr_str
, ntohs(bind_addr
.sin_port
),
3058 ss_uptime
, (long long)ss
->requests
);
3062 DEFUN (show_ip_ssmpingd
,
3063 show_ip_ssmpingd_cmd
,
3064 "show ip ssmpingd [vrf NAME]",
3071 struct vrf
*vrf
= pim_cmd_lookup_vrf(vty
, argv
, argc
, &idx
);
3076 show_ssmpingd(vrf
->info
, vty
);
3080 DEFUN (ip_pim_spt_switchover_infinity
,
3081 ip_pim_spt_switchover_infinity_cmd
,
3082 "ip pim spt-switchover infinity-and-beyond",
3086 "Never switch to SPT Tree\n")
3088 return pim_process_spt_switchover_infinity_cmd(vty
);
3091 DEFPY (ip_pim_spt_switchover_infinity_plist
,
3092 ip_pim_spt_switchover_infinity_plist_cmd
,
3093 "ip pim spt-switchover infinity-and-beyond prefix-list WORD$plist",
3097 "Never switch to SPT Tree\n"
3098 "Prefix-List to control which groups to switch\n"
3099 "Prefix-List name\n")
3101 return pim_process_spt_switchover_prefixlist_cmd(vty
, plist
);
3104 DEFUN (no_ip_pim_spt_switchover_infinity
,
3105 no_ip_pim_spt_switchover_infinity_cmd
,
3106 "no ip pim spt-switchover infinity-and-beyond",
3111 "Never switch to SPT Tree\n")
3113 return pim_process_no_spt_switchover_cmd(vty
);
3116 DEFUN (no_ip_pim_spt_switchover_infinity_plist
,
3117 no_ip_pim_spt_switchover_infinity_plist_cmd
,
3118 "no ip pim spt-switchover infinity-and-beyond prefix-list WORD",
3123 "Never switch to SPT Tree\n"
3124 "Prefix-List to control which groups to switch\n"
3125 "Prefix-List name\n")
3127 return pim_process_no_spt_switchover_cmd(vty
);
3130 DEFPY (pim_register_accept_list
,
3131 pim_register_accept_list_cmd
,
3132 "[no] ip pim register-accept-list WORD$word",
3136 "Only accept registers from a specific source prefix list\n"
3137 "Prefix-List name\n")
3139 const char *vrfname
;
3140 char reg_alist_xpath
[XPATH_MAXLEN
];
3142 vrfname
= pim_cli_get_vrf_name(vty
);
3143 if (vrfname
== NULL
)
3144 return CMD_WARNING_CONFIG_FAILED
;
3146 snprintf(reg_alist_xpath
, sizeof(reg_alist_xpath
),
3147 FRR_PIM_VRF_XPATH
, "frr-pim:pimd", "pim", vrfname
,
3148 "frr-routing:ipv4");
3149 strlcat(reg_alist_xpath
, "/register-accept-list",
3150 sizeof(reg_alist_xpath
));
3153 nb_cli_enqueue_change(vty
, reg_alist_xpath
,
3154 NB_OP_DESTROY
, NULL
);
3156 nb_cli_enqueue_change(vty
, reg_alist_xpath
,
3157 NB_OP_MODIFY
, word
);
3159 return nb_cli_apply_changes(vty
, NULL
);
3162 DEFPY (ip_pim_joinprune_time
,
3163 ip_pim_joinprune_time_cmd
,
3164 "ip pim join-prune-interval (1-65535)$jpi",
3166 "pim multicast routing\n"
3167 "Join Prune Send Interval\n"
3170 return pim_process_join_prune_cmd(vty
, jpi_str
);
3173 DEFUN (no_ip_pim_joinprune_time
,
3174 no_ip_pim_joinprune_time_cmd
,
3175 "no ip pim join-prune-interval [(1-65535)]",
3178 "pim multicast routing\n"
3179 "Join Prune Send Interval\n"
3182 return pim_process_no_join_prune_cmd(vty
);
3185 DEFPY (ip_pim_register_suppress
,
3186 ip_pim_register_suppress_cmd
,
3187 "ip pim register-suppress-time (1-65535)$rst",
3189 "pim multicast routing\n"
3190 "Register Suppress Timer\n"
3193 return pim_process_register_suppress_cmd(vty
, rst_str
);
3196 DEFUN (no_ip_pim_register_suppress
,
3197 no_ip_pim_register_suppress_cmd
,
3198 "no ip pim register-suppress-time [(1-65535)]",
3201 "pim multicast routing\n"
3202 "Register Suppress Timer\n"
3205 return pim_process_no_register_suppress_cmd(vty
);
3208 DEFPY (ip_pim_rp_keep_alive
,
3209 ip_pim_rp_keep_alive_cmd
,
3210 "ip pim rp keep-alive-timer (1-65535)$kat",
3212 "pim multicast routing\n"
3213 "Rendezvous Point\n"
3214 "Keep alive Timer\n"
3217 return pim_process_rp_kat_cmd(vty
, kat_str
);
3220 DEFUN (no_ip_pim_rp_keep_alive
,
3221 no_ip_pim_rp_keep_alive_cmd
,
3222 "no ip pim rp keep-alive-timer [(1-65535)]",
3225 "pim multicast routing\n"
3226 "Rendezvous Point\n"
3227 "Keep alive Timer\n"
3230 return pim_process_no_rp_kat_cmd(vty
);
3233 DEFPY (ip_pim_keep_alive
,
3234 ip_pim_keep_alive_cmd
,
3235 "ip pim keep-alive-timer (1-65535)$kat",
3237 "pim multicast routing\n"
3238 "Keep alive Timer\n"
3241 return pim_process_keepalivetimer_cmd(vty
, kat_str
);
3244 DEFUN (no_ip_pim_keep_alive
,
3245 no_ip_pim_keep_alive_cmd
,
3246 "no ip pim keep-alive-timer [(1-65535)]",
3249 "pim multicast routing\n"
3250 "Keep alive Timer\n"
3253 return pim_process_no_keepalivetimer_cmd(vty
);
3256 DEFPY (ip_pim_packets
,
3258 "ip pim packets (1-255)",
3260 "pim multicast routing\n"
3261 "packets to process at one time per fd\n"
3262 "Number of packets\n")
3264 return pim_process_pim_packet_cmd(vty
, packets_str
);
3267 DEFUN (no_ip_pim_packets
,
3268 no_ip_pim_packets_cmd
,
3269 "no ip pim packets [(1-255)]",
3272 "pim multicast routing\n"
3273 "packets to process at one time per fd\n"
3276 return pim_process_no_pim_packet_cmd(vty
);
3279 DEFPY (ip_igmp_group_watermark
,
3280 ip_igmp_group_watermark_cmd
,
3281 "ip igmp watermark-warn (1-65535)$limit",
3284 "Configure group limit for watermark warning\n"
3285 "Group count to generate watermark warning\n")
3287 PIM_DECLVAR_CONTEXT_VRF(vrf
, pim
);
3288 pim
->gm_watermark_limit
= limit
;
3293 DEFPY (no_ip_igmp_group_watermark
,
3294 no_ip_igmp_group_watermark_cmd
,
3295 "no ip igmp watermark-warn [(1-65535)$limit]",
3299 "Unconfigure group limit for watermark warning\n"
3302 PIM_DECLVAR_CONTEXT_VRF(vrf
, pim
);
3303 pim
->gm_watermark_limit
= 0;
3308 DEFUN (ip_pim_v6_secondary
,
3309 ip_pim_v6_secondary_cmd
,
3310 "ip pim send-v6-secondary",
3312 "pim multicast routing\n"
3313 "Send v6 secondary addresses\n")
3315 const char *vrfname
;
3316 char send_v6_secondary_xpath
[XPATH_MAXLEN
];
3318 vrfname
= pim_cli_get_vrf_name(vty
);
3319 if (vrfname
== NULL
)
3320 return CMD_WARNING_CONFIG_FAILED
;
3322 snprintf(send_v6_secondary_xpath
, sizeof(send_v6_secondary_xpath
),
3324 "frr-pim:pimd", "pim", vrfname
, "frr-routing:ipv4");
3325 strlcat(send_v6_secondary_xpath
, "/send-v6-secondary",
3326 sizeof(send_v6_secondary_xpath
));
3328 nb_cli_enqueue_change(vty
, send_v6_secondary_xpath
, NB_OP_MODIFY
,
3331 return nb_cli_apply_changes(vty
, NULL
);
3334 DEFUN (no_ip_pim_v6_secondary
,
3335 no_ip_pim_v6_secondary_cmd
,
3336 "no ip pim send-v6-secondary",
3339 "pim multicast routing\n"
3340 "Send v6 secondary addresses\n")
3342 const char *vrfname
;
3343 char send_v6_secondary_xpath
[XPATH_MAXLEN
];
3345 vrfname
= pim_cli_get_vrf_name(vty
);
3346 if (vrfname
== NULL
)
3347 return CMD_WARNING_CONFIG_FAILED
;
3349 snprintf(send_v6_secondary_xpath
, sizeof(send_v6_secondary_xpath
),
3351 "frr-pim:pimd", "pim", vrfname
, "frr-routing:ipv4");
3352 strlcat(send_v6_secondary_xpath
, "/send-v6-secondary",
3353 sizeof(send_v6_secondary_xpath
));
3355 nb_cli_enqueue_change(vty
, send_v6_secondary_xpath
, NB_OP_MODIFY
,
3358 return nb_cli_apply_changes(vty
, NULL
);
3363 "ip pim rp A.B.C.D$rp [A.B.C.D/M]$gp",
3365 "pim multicast routing\n"
3366 "Rendezvous Point\n"
3367 "ip address of RP\n"
3368 "Group Address range to cover\n")
3370 const char *group_str
= (gp_str
) ? gp_str
: "224.0.0.0/4";
3372 return pim_process_rp_cmd(vty
, rp_str
, group_str
);
3375 DEFPY (ip_pim_rp_prefix_list
,
3376 ip_pim_rp_prefix_list_cmd
,
3377 "ip pim rp A.B.C.D$rp prefix-list WORD$plist",
3379 "pim multicast routing\n"
3380 "Rendezvous Point\n"
3381 "ip address of RP\n"
3382 "group prefix-list filter\n"
3383 "Name of a prefix-list\n")
3385 return pim_process_rp_plist_cmd(vty
, rp_str
, plist
);
3388 DEFPY (no_ip_pim_rp
,
3390 "no ip pim rp A.B.C.D$rp [A.B.C.D/M]$gp",
3393 "pim multicast routing\n"
3394 "Rendezvous Point\n"
3395 "ip address of RP\n"
3396 "Group Address range to cover\n")
3398 const char *group_str
= (gp_str
) ? gp_str
: "224.0.0.0/4";
3400 return pim_process_no_rp_cmd(vty
, rp_str
, group_str
);
3403 DEFPY (no_ip_pim_rp_prefix_list
,
3404 no_ip_pim_rp_prefix_list_cmd
,
3405 "no ip pim rp A.B.C.D$rp prefix-list WORD$plist",
3408 "pim multicast routing\n"
3409 "Rendezvous Point\n"
3410 "ip address of RP\n"
3411 "group prefix-list filter\n"
3412 "Name of a prefix-list\n")
3414 return pim_process_no_rp_plist_cmd(vty
, rp_str
, plist
);
3417 DEFUN (ip_pim_ssm_prefix_list
,
3418 ip_pim_ssm_prefix_list_cmd
,
3419 "ip pim ssm prefix-list WORD",
3421 "pim multicast routing\n"
3422 "Source Specific Multicast\n"
3423 "group range prefix-list filter\n"
3424 "Name of a prefix-list\n")
3426 const char *vrfname
;
3427 char ssm_plist_xpath
[XPATH_MAXLEN
];
3429 vrfname
= pim_cli_get_vrf_name(vty
);
3430 if (vrfname
== NULL
)
3431 return CMD_WARNING_CONFIG_FAILED
;
3433 snprintf(ssm_plist_xpath
, sizeof(ssm_plist_xpath
), FRR_PIM_VRF_XPATH
,
3434 "frr-pim:pimd", "pim", vrfname
, "frr-routing:ipv4");
3435 strlcat(ssm_plist_xpath
, "/ssm-prefix-list", sizeof(ssm_plist_xpath
));
3437 nb_cli_enqueue_change(vty
, ssm_plist_xpath
, NB_OP_MODIFY
, argv
[4]->arg
);
3439 return nb_cli_apply_changes(vty
, NULL
);
3442 DEFUN (no_ip_pim_ssm_prefix_list
,
3443 no_ip_pim_ssm_prefix_list_cmd
,
3444 "no ip pim ssm prefix-list",
3447 "pim multicast routing\n"
3448 "Source Specific Multicast\n"
3449 "group range prefix-list filter\n")
3451 const char *vrfname
;
3452 char ssm_plist_xpath
[XPATH_MAXLEN
];
3454 vrfname
= pim_cli_get_vrf_name(vty
);
3455 if (vrfname
== NULL
)
3456 return CMD_WARNING_CONFIG_FAILED
;
3458 snprintf(ssm_plist_xpath
, sizeof(ssm_plist_xpath
),
3460 "frr-pim:pimd", "pim", vrfname
, "frr-routing:ipv4");
3461 strlcat(ssm_plist_xpath
, "/ssm-prefix-list", sizeof(ssm_plist_xpath
));
3463 nb_cli_enqueue_change(vty
, ssm_plist_xpath
, NB_OP_DESTROY
, NULL
);
3465 return nb_cli_apply_changes(vty
, NULL
);
3468 DEFUN (no_ip_pim_ssm_prefix_list_name
,
3469 no_ip_pim_ssm_prefix_list_name_cmd
,
3470 "no ip pim ssm prefix-list WORD",
3473 "pim multicast routing\n"
3474 "Source Specific Multicast\n"
3475 "group range prefix-list filter\n"
3476 "Name of a prefix-list\n")
3478 const char *vrfname
;
3479 const struct lyd_node
*ssm_plist_dnode
;
3480 char ssm_plist_xpath
[XPATH_MAXLEN
];
3481 const char *ssm_plist_name
;
3483 vrfname
= pim_cli_get_vrf_name(vty
);
3484 if (vrfname
== NULL
)
3485 return CMD_WARNING_CONFIG_FAILED
;
3487 snprintf(ssm_plist_xpath
, sizeof(ssm_plist_xpath
),
3489 "frr-pim:pimd", "pim", vrfname
, "frr-routing:ipv4");
3490 strlcat(ssm_plist_xpath
, "/ssm-prefix-list", sizeof(ssm_plist_xpath
));
3491 ssm_plist_dnode
= yang_dnode_get(vty
->candidate_config
->dnode
,
3494 if (!ssm_plist_dnode
) {
3496 "%% pim ssm prefix-list %s doesn't exist\n",
3498 return CMD_WARNING_CONFIG_FAILED
;
3501 ssm_plist_name
= yang_dnode_get_string(ssm_plist_dnode
, ".");
3503 if (ssm_plist_name
&& !strcmp(ssm_plist_name
, argv
[5]->arg
)) {
3504 nb_cli_enqueue_change(vty
, ssm_plist_xpath
, NB_OP_DESTROY
,
3507 return nb_cli_apply_changes(vty
, NULL
);
3510 vty_out(vty
, "%% pim ssm prefix-list %s doesn't exist\n", argv
[5]->arg
);
3512 return CMD_WARNING_CONFIG_FAILED
;
3515 DEFUN (show_ip_pim_ssm_range
,
3516 show_ip_pim_ssm_range_cmd
,
3517 "show ip pim [vrf NAME] group-type [json]",
3526 struct vrf
*vrf
= pim_cmd_lookup_vrf(vty
, argv
, argc
, &idx
);
3527 bool uj
= use_json(argc
, argv
);
3532 ip_pim_ssm_show_group_range(vrf
->info
, vty
, uj
);
3537 static void ip_pim_ssm_show_group_type(struct pim_instance
*pim
,
3538 struct vty
*vty
, bool uj
,
3541 struct in_addr group_addr
;
3542 const char *type_str
;
3545 result
= inet_pton(AF_INET
, group
, &group_addr
);
3547 type_str
= "invalid";
3549 if (pim_is_group_224_4(group_addr
))
3551 pim_is_grp_ssm(pim
, group_addr
) ? "SSM" : "ASM";
3553 type_str
= "not-multicast";
3558 json
= json_object_new_object();
3559 json_object_string_add(json
, "groupType", type_str
);
3560 vty_json(vty
, json
);
3562 vty_out(vty
, "Group type : %s\n", type_str
);
3565 DEFUN (show_ip_pim_group_type
,
3566 show_ip_pim_group_type_cmd
,
3567 "show ip pim [vrf NAME] group-type A.B.C.D [json]",
3572 "multicast group type\n"
3577 struct vrf
*vrf
= pim_cmd_lookup_vrf(vty
, argv
, argc
, &idx
);
3578 bool uj
= use_json(argc
, argv
);
3583 argv_find(argv
, argc
, "A.B.C.D", &idx
);
3584 ip_pim_ssm_show_group_type(vrf
->info
, vty
, uj
, argv
[idx
]->arg
);
3589 DEFUN (show_ip_pim_bsr
,
3590 show_ip_pim_bsr_cmd
,
3591 "show ip pim bsr [json]",
3595 "boot-strap router information\n"
3599 struct vrf
*vrf
= pim_cmd_lookup_vrf(vty
, argv
, argc
, &idx
);
3600 bool uj
= use_json(argc
, argv
);
3605 pim_show_bsr(vrf
->info
, vty
, uj
);
3612 "ip ssmpingd [A.B.C.D]",
3618 const char *src_str
= (argc
== 3) ? argv
[idx_ipv4
]->arg
: "0.0.0.0";
3620 return pim_process_ssmpingd_cmd(vty
, NB_OP_CREATE
, src_str
);
3623 DEFUN (no_ip_ssmpingd
,
3625 "no ip ssmpingd [A.B.C.D]",
3632 const char *src_str
= (argc
== 4) ? argv
[idx_ipv4
]->arg
: "0.0.0.0";
3634 return pim_process_ssmpingd_cmd(vty
, NB_OP_DESTROY
, src_str
);
3641 "pim multicast routing\n"
3642 "Enable PIM ECMP \n")
3644 const char *vrfname
;
3645 char ecmp_xpath
[XPATH_MAXLEN
];
3647 vrfname
= pim_cli_get_vrf_name(vty
);
3648 if (vrfname
== NULL
)
3649 return CMD_WARNING_CONFIG_FAILED
;
3651 snprintf(ecmp_xpath
, sizeof(ecmp_xpath
), FRR_PIM_VRF_XPATH
,
3652 "frr-pim:pimd", "pim", vrfname
, "frr-routing:ipv4");
3653 strlcat(ecmp_xpath
, "/ecmp", sizeof(ecmp_xpath
));
3655 nb_cli_enqueue_change(vty
, ecmp_xpath
, NB_OP_MODIFY
, "true");
3656 return nb_cli_apply_changes(vty
, NULL
);
3659 DEFUN (no_ip_pim_ecmp
,
3664 "pim multicast routing\n"
3665 "Disable PIM ECMP \n")
3667 const char *vrfname
;
3668 char ecmp_xpath
[XPATH_MAXLEN
];
3670 vrfname
= pim_cli_get_vrf_name(vty
);
3671 if (vrfname
== NULL
)
3672 return CMD_WARNING_CONFIG_FAILED
;
3674 snprintf(ecmp_xpath
, sizeof(ecmp_xpath
), FRR_PIM_VRF_XPATH
,
3675 "frr-pim:pimd", "pim", vrfname
, "frr-routing:ipv4");
3676 strlcat(ecmp_xpath
, "/ecmp", sizeof(ecmp_xpath
));
3678 nb_cli_enqueue_change(vty
, ecmp_xpath
, NB_OP_MODIFY
, "false");
3680 return nb_cli_apply_changes(vty
, NULL
);
3683 DEFUN (ip_pim_ecmp_rebalance
,
3684 ip_pim_ecmp_rebalance_cmd
,
3685 "ip pim ecmp rebalance",
3687 "pim multicast routing\n"
3688 "Enable PIM ECMP \n"
3689 "Enable PIM ECMP Rebalance\n")
3691 const char *vrfname
;
3692 char ecmp_xpath
[XPATH_MAXLEN
];
3693 char ecmp_rebalance_xpath
[XPATH_MAXLEN
];
3695 vrfname
= pim_cli_get_vrf_name(vty
);
3696 if (vrfname
== NULL
)
3697 return CMD_WARNING_CONFIG_FAILED
;
3699 snprintf(ecmp_xpath
, sizeof(ecmp_xpath
), FRR_PIM_VRF_XPATH
,
3700 "frr-pim:pimd", "pim", vrfname
, "frr-routing:ipv4");
3701 strlcat(ecmp_xpath
, "/ecmp", sizeof(ecmp_xpath
));
3702 snprintf(ecmp_rebalance_xpath
, sizeof(ecmp_rebalance_xpath
),
3704 "frr-pim:pimd", "pim", vrfname
, "frr-routing:ipv4");
3705 strlcat(ecmp_rebalance_xpath
, "/ecmp-rebalance",
3706 sizeof(ecmp_rebalance_xpath
));
3708 nb_cli_enqueue_change(vty
, ecmp_xpath
, NB_OP_MODIFY
, "true");
3709 nb_cli_enqueue_change(vty
, ecmp_rebalance_xpath
, NB_OP_MODIFY
, "true");
3711 return nb_cli_apply_changes(vty
, NULL
);
3714 DEFUN (no_ip_pim_ecmp_rebalance
,
3715 no_ip_pim_ecmp_rebalance_cmd
,
3716 "no ip pim ecmp rebalance",
3719 "pim multicast routing\n"
3720 "Disable PIM ECMP \n"
3721 "Disable PIM ECMP Rebalance\n")
3723 const char *vrfname
;
3724 char ecmp_rebalance_xpath
[XPATH_MAXLEN
];
3726 vrfname
= pim_cli_get_vrf_name(vty
);
3727 if (vrfname
== NULL
)
3728 return CMD_WARNING_CONFIG_FAILED
;
3730 snprintf(ecmp_rebalance_xpath
, sizeof(ecmp_rebalance_xpath
),
3732 "frr-pim:pimd", "pim", vrfname
, "frr-routing:ipv4");
3733 strlcat(ecmp_rebalance_xpath
, "/ecmp-rebalance",
3734 sizeof(ecmp_rebalance_xpath
));
3736 nb_cli_enqueue_change(vty
, ecmp_rebalance_xpath
, NB_OP_MODIFY
, "false");
3738 return nb_cli_apply_changes(vty
, NULL
);
3741 DEFUN (interface_ip_igmp
,
3742 interface_ip_igmp_cmd
,
3747 nb_cli_enqueue_change(vty
, "./enable", NB_OP_MODIFY
, "true");
3749 return nb_cli_apply_changes(vty
, FRR_GMP_INTERFACE_XPATH
,
3750 "frr-routing:ipv4");
3753 DEFUN (interface_no_ip_igmp
,
3754 interface_no_ip_igmp_cmd
,
3760 const struct lyd_node
*pim_enable_dnode
;
3761 char pim_if_xpath
[XPATH_MAXLEN
];
3764 snprintf(pim_if_xpath
, sizeof(pim_if_xpath
),
3765 "%s/frr-pim:pim/address-family[address-family='%s']",
3766 VTY_CURR_XPATH
, "frr-routing:ipv4");
3768 if (printed
>= (int)(sizeof(pim_if_xpath
))) {
3769 vty_out(vty
, "Xpath too long (%d > %u)", printed
+ 1,
3771 return CMD_WARNING_CONFIG_FAILED
;
3774 pim_enable_dnode
= yang_dnode_getf(vty
->candidate_config
->dnode
,
3775 FRR_PIM_ENABLE_XPATH
, VTY_CURR_XPATH
,
3776 "frr-routing:ipv4");
3777 if (!pim_enable_dnode
) {
3778 nb_cli_enqueue_change(vty
, pim_if_xpath
, NB_OP_DESTROY
, NULL
);
3779 nb_cli_enqueue_change(vty
, ".", NB_OP_DESTROY
, NULL
);
3781 if (!yang_dnode_get_bool(pim_enable_dnode
, ".")) {
3782 nb_cli_enqueue_change(vty
, pim_if_xpath
, NB_OP_DESTROY
,
3784 nb_cli_enqueue_change(vty
, ".", NB_OP_DESTROY
, NULL
);
3786 nb_cli_enqueue_change(vty
, "./enable",
3787 NB_OP_MODIFY
, "false");
3790 return nb_cli_apply_changes(vty
, FRR_GMP_INTERFACE_XPATH
,
3791 "frr-routing:ipv4");
3794 DEFUN (interface_ip_igmp_join
,
3795 interface_ip_igmp_join_cmd
,
3796 "ip igmp join A.B.C.D [A.B.C.D]",
3799 "IGMP join multicast group\n"
3800 "Multicast group address\n"
3805 const char *source_str
;
3806 char xpath
[XPATH_MAXLEN
];
3809 source_str
= argv
[idx_source
]->arg
;
3811 if (strcmp(source_str
, "0.0.0.0") == 0) {
3812 vty_out(vty
, "Bad source address %s\n",
3813 argv
[idx_source
]->arg
);
3814 return CMD_WARNING_CONFIG_FAILED
;
3817 source_str
= "0.0.0.0";
3819 snprintf(xpath
, sizeof(xpath
), FRR_GMP_JOIN_XPATH
,
3820 "frr-routing:ipv4", argv
[idx_group
]->arg
, source_str
);
3822 nb_cli_enqueue_change(vty
, xpath
, NB_OP_CREATE
, NULL
);
3824 return nb_cli_apply_changes(vty
, NULL
);
3827 DEFUN (interface_no_ip_igmp_join
,
3828 interface_no_ip_igmp_join_cmd
,
3829 "no ip igmp join A.B.C.D [A.B.C.D]",
3833 "IGMP join multicast group\n"
3834 "Multicast group address\n"
3839 const char *source_str
;
3840 char xpath
[XPATH_MAXLEN
];
3843 source_str
= argv
[idx_source
]->arg
;
3845 if (strcmp(source_str
, "0.0.0.0") == 0) {
3846 vty_out(vty
, "Bad source address %s\n",
3847 argv
[idx_source
]->arg
);
3848 return CMD_WARNING_CONFIG_FAILED
;
3851 source_str
= "0.0.0.0";
3853 snprintf(xpath
, sizeof(xpath
), FRR_GMP_JOIN_XPATH
,
3854 "frr-routing:ipv4", argv
[idx_group
]->arg
, source_str
);
3856 nb_cli_enqueue_change(vty
, xpath
, NB_OP_DESTROY
, NULL
);
3858 return nb_cli_apply_changes(vty
, NULL
);
3861 DEFUN (interface_ip_igmp_query_interval
,
3862 interface_ip_igmp_query_interval_cmd
,
3863 "ip igmp query-interval (1-65535)",
3866 IFACE_IGMP_QUERY_INTERVAL_STR
3867 "Query interval in seconds\n")
3869 const struct lyd_node
*pim_enable_dnode
;
3872 yang_dnode_getf(vty
->candidate_config
->dnode
,
3873 FRR_PIM_ENABLE_XPATH
, VTY_CURR_XPATH
,
3874 "frr-routing:ipv4");
3875 if (!pim_enable_dnode
) {
3876 nb_cli_enqueue_change(vty
, "./enable", NB_OP_MODIFY
,
3879 if (!yang_dnode_get_bool(pim_enable_dnode
, "."))
3880 nb_cli_enqueue_change(vty
, "./enable",
3881 NB_OP_MODIFY
, "true");
3884 nb_cli_enqueue_change(vty
, "./query-interval", NB_OP_MODIFY
,
3887 return nb_cli_apply_changes(vty
, FRR_GMP_INTERFACE_XPATH
,
3888 "frr-routing:ipv4");
3891 DEFUN (interface_no_ip_igmp_query_interval
,
3892 interface_no_ip_igmp_query_interval_cmd
,
3893 "no ip igmp query-interval [(1-65535)]",
3897 IFACE_IGMP_QUERY_INTERVAL_STR
3900 nb_cli_enqueue_change(vty
, "./query-interval", NB_OP_DESTROY
, NULL
);
3902 return nb_cli_apply_changes(vty
, FRR_GMP_INTERFACE_XPATH
,
3903 "frr-routing:ipv4");
3906 DEFUN (interface_ip_igmp_version
,
3907 interface_ip_igmp_version_cmd
,
3908 "ip igmp version (2-3)",
3912 "IGMP version number\n")
3914 nb_cli_enqueue_change(vty
, "./enable", NB_OP_MODIFY
,
3916 nb_cli_enqueue_change(vty
, "./igmp-version", NB_OP_MODIFY
,
3919 return nb_cli_apply_changes(vty
, FRR_GMP_INTERFACE_XPATH
,
3920 "frr-routing:ipv4");
3923 DEFUN (interface_no_ip_igmp_version
,
3924 interface_no_ip_igmp_version_cmd
,
3925 "no ip igmp version (2-3)",
3930 "IGMP version number\n")
3932 nb_cli_enqueue_change(vty
, "./igmp-version", NB_OP_DESTROY
, NULL
);
3934 return nb_cli_apply_changes(vty
, FRR_GMP_INTERFACE_XPATH
,
3935 "frr-routing:ipv4");
3938 DEFPY (interface_ip_igmp_query_max_response_time
,
3939 interface_ip_igmp_query_max_response_time_cmd
,
3940 "ip igmp query-max-response-time (1-65535)$qmrt",
3943 IFACE_IGMP_QUERY_MAX_RESPONSE_TIME_STR
3944 "Query response value in deci-seconds\n")
3946 return gm_process_query_max_response_time_cmd(vty
, qmrt_str
);
3949 DEFUN (interface_no_ip_igmp_query_max_response_time
,
3950 interface_no_ip_igmp_query_max_response_time_cmd
,
3951 "no ip igmp query-max-response-time [(1-65535)]",
3955 IFACE_IGMP_QUERY_MAX_RESPONSE_TIME_STR
3958 return gm_process_no_query_max_response_time_cmd(vty
);
3961 DEFUN_HIDDEN (interface_ip_igmp_query_max_response_time_dsec
,
3962 interface_ip_igmp_query_max_response_time_dsec_cmd
,
3963 "ip igmp query-max-response-time-dsec (1-65535)",
3966 IFACE_IGMP_QUERY_MAX_RESPONSE_TIME_DSEC_STR
3967 "Query response value in deciseconds\n")
3969 const struct lyd_node
*pim_enable_dnode
;
3972 yang_dnode_getf(vty
->candidate_config
->dnode
,
3973 FRR_PIM_ENABLE_XPATH
, VTY_CURR_XPATH
,
3974 "frr-routing:ipv4");
3975 if (!pim_enable_dnode
) {
3976 nb_cli_enqueue_change(vty
, "./enable", NB_OP_MODIFY
,
3979 if (!yang_dnode_get_bool(pim_enable_dnode
, "."))
3980 nb_cli_enqueue_change(vty
, "./enable",
3981 NB_OP_MODIFY
, "true");
3984 nb_cli_enqueue_change(vty
, "./query-max-response-time", NB_OP_MODIFY
,
3987 return nb_cli_apply_changes(vty
, FRR_GMP_INTERFACE_XPATH
,
3988 "frr-routing:ipv4");
3991 DEFUN_HIDDEN (interface_no_ip_igmp_query_max_response_time_dsec
,
3992 interface_no_ip_igmp_query_max_response_time_dsec_cmd
,
3993 "no ip igmp query-max-response-time-dsec [(1-65535)]",
3997 IFACE_IGMP_QUERY_MAX_RESPONSE_TIME_DSEC_STR
4000 nb_cli_enqueue_change(vty
, "./query-max-response-time", NB_OP_DESTROY
,
4003 return nb_cli_apply_changes(vty
, FRR_GMP_INTERFACE_XPATH
,
4004 "frr-routing:ipv4");
4007 DEFPY (interface_ip_igmp_last_member_query_count
,
4008 interface_ip_igmp_last_member_query_count_cmd
,
4009 "ip igmp last-member-query-count (1-255)$lmqc",
4012 IFACE_IGMP_LAST_MEMBER_QUERY_COUNT_STR
4013 "Last member query count\n")
4015 return gm_process_last_member_query_count_cmd(vty
, lmqc_str
);
4018 DEFUN (interface_no_ip_igmp_last_member_query_count
,
4019 interface_no_ip_igmp_last_member_query_count_cmd
,
4020 "no ip igmp last-member-query-count [(1-255)]",
4024 IFACE_IGMP_LAST_MEMBER_QUERY_COUNT_STR
4027 return gm_process_no_last_member_query_count_cmd(vty
);
4030 DEFPY (interface_ip_igmp_last_member_query_interval
,
4031 interface_ip_igmp_last_member_query_interval_cmd
,
4032 "ip igmp last-member-query-interval (1-65535)$lmqi",
4035 IFACE_IGMP_LAST_MEMBER_QUERY_INTERVAL_STR
4036 "Last member query interval in deciseconds\n")
4038 return gm_process_last_member_query_interval_cmd(vty
, lmqi_str
);
4041 DEFUN (interface_no_ip_igmp_last_member_query_interval
,
4042 interface_no_ip_igmp_last_member_query_interval_cmd
,
4043 "no ip igmp last-member-query-interval [(1-65535)]",
4047 IFACE_IGMP_LAST_MEMBER_QUERY_INTERVAL_STR
4050 return gm_process_no_last_member_query_interval_cmd(vty
);
4053 DEFUN (interface_ip_pim_drprio
,
4054 interface_ip_pim_drprio_cmd
,
4055 "ip pim drpriority (1-4294967295)",
4058 "Set the Designated Router Election Priority\n"
4059 "Value of the new DR Priority\n")
4063 return pim_process_ip_pim_drprio_cmd(vty
, argv
[idx_number
]->arg
);
4066 DEFUN (interface_no_ip_pim_drprio
,
4067 interface_no_ip_pim_drprio_cmd
,
4068 "no ip pim drpriority [(1-4294967295)]",
4072 "Revert the Designated Router Priority to default\n"
4073 "Old Value of the Priority\n")
4075 return pim_process_no_ip_pim_drprio_cmd(vty
);
4078 DEFPY_HIDDEN (interface_ip_igmp_query_generate
,
4079 interface_ip_igmp_query_generate_cmd
,
4080 "ip igmp generate-query-once [version (2-3)]",
4083 "Generate igmp general query once\n"
4085 "IGMP version number\n")
4088 VTY_DECLVAR_CONTEXT(interface
, ifp
);
4090 struct pim_interface
*pim_ifp
= ifp
->info
;
4093 vty_out(vty
, "IGMP/PIM is not enabled on the interface %s\n",
4095 return CMD_WARNING_CONFIG_FAILED
;
4098 /* It takes the igmp version configured on the interface as default */
4099 igmp_version
= pim_ifp
->igmp_version
;
4102 igmp_version
= atoi(argv
[4]->arg
);
4104 igmp_send_query_on_intf(ifp
, igmp_version
);
4109 DEFPY_HIDDEN (pim_test_sg_keepalive
,
4110 pim_test_sg_keepalive_cmd
,
4111 "test pim [vrf NAME$name] keepalive-reset A.B.C.D$source A.B.C.D$group",
4115 "Reset the Keepalive Timer\n"
4116 "The Source we are resetting\n"
4117 "The Group we are resetting\n")
4119 struct pim_upstream
*up
;
4121 struct pim_instance
*pim
;
4127 vrf
= vrf_lookup_by_name(name
? name
: VRF_DEFAULT_NAME
);
4129 vty_out(vty
, "%% Vrf specified: %s does not exist\n", name
);
4136 vty_out(vty
, "%% Unable to find pim instance\n");
4140 up
= pim_upstream_find(pim
, &sg
);
4142 vty_out(vty
, "%% Unable to find %pSG specified\n", &sg
);
4146 vty_out(vty
, "Setting %pSG to current keep alive time: %d\n", &sg
,
4147 pim
->keep_alive_time
);
4148 pim_upstream_keep_alive_timer_start(up
, pim
->keep_alive_time
);
4153 DEFPY (interface_ip_pim_activeactive
,
4154 interface_ip_pim_activeactive_cmd
,
4155 "[no$no] ip pim active-active",
4159 "Mark interface as Active-Active for MLAG operations, Hidden because not finished yet\n")
4161 return pim_process_ip_pim_activeactive_cmd(vty
, no
);
4164 DEFUN_HIDDEN (interface_ip_pim_ssm
,
4165 interface_ip_pim_ssm_cmd
,
4173 ret
= pim_process_ip_pim_cmd(vty
);
4179 "WARN: Enabled PIM SM on interface; configure PIM SSM range if needed\n");
4184 DEFUN_HIDDEN (interface_ip_pim_sm
,
4185 interface_ip_pim_sm_cmd
,
4191 return pim_process_ip_pim_cmd(vty
);
4194 DEFPY (interface_ip_pim
,
4195 interface_ip_pim_cmd
,
4196 "ip pim [passive$passive]",
4199 "Disable exchange of protocol packets\n")
4203 ret
= pim_process_ip_pim_cmd(vty
);
4209 return pim_process_ip_pim_passive_cmd(vty
, true);
4214 DEFUN_HIDDEN (interface_no_ip_pim_ssm
,
4215 interface_no_ip_pim_ssm_cmd
,
4222 return pim_process_no_ip_pim_cmd(vty
);
4225 DEFUN_HIDDEN (interface_no_ip_pim_sm
,
4226 interface_no_ip_pim_sm_cmd
,
4233 return pim_process_no_ip_pim_cmd(vty
);
4236 DEFPY (interface_no_ip_pim
,
4237 interface_no_ip_pim_cmd
,
4238 "no ip pim [passive$passive]",
4242 "Disable exchange of protocol packets\n")
4245 return pim_process_ip_pim_passive_cmd(vty
, false);
4247 return pim_process_no_ip_pim_cmd(vty
);
4251 DEFUN(interface_ip_pim_boundary_oil
,
4252 interface_ip_pim_boundary_oil_cmd
,
4253 "ip multicast boundary oil WORD",
4255 "Generic multicast configuration options\n"
4256 "Define multicast boundary\n"
4257 "Filter OIL by group using prefix list\n"
4258 "Prefix list to filter OIL with\n")
4260 return pim_process_ip_pim_boundary_oil_cmd(vty
, argv
[4]->arg
);
4263 DEFUN(interface_no_ip_pim_boundary_oil
,
4264 interface_no_ip_pim_boundary_oil_cmd
,
4265 "no ip multicast boundary oil [WORD]",
4268 "Generic multicast configuration options\n"
4269 "Define multicast boundary\n"
4270 "Filter OIL by group using prefix list\n"
4271 "Prefix list to filter OIL with\n")
4273 return pim_process_no_ip_pim_boundary_oil_cmd(vty
);
4276 DEFUN (interface_ip_mroute
,
4277 interface_ip_mroute_cmd
,
4278 "ip mroute INTERFACE A.B.C.D [A.B.C.D]",
4280 "Add multicast route\n"
4281 "Outgoing interface name\n"
4285 int idx_interface
= 2;
4287 const char *source_str
;
4289 if (argc
== (idx_ipv4
+ 1))
4290 source_str
= "0.0.0.0";
4292 source_str
= argv
[idx_ipv4
+ 1]->arg
;
4294 return pim_process_ip_mroute_cmd(vty
, argv
[idx_interface
]->arg
,
4295 argv
[idx_ipv4
]->arg
, source_str
);
4298 DEFUN (interface_no_ip_mroute
,
4299 interface_no_ip_mroute_cmd
,
4300 "no ip mroute INTERFACE A.B.C.D [A.B.C.D]",
4303 "Add multicast route\n"
4304 "Outgoing interface name\n"
4308 int idx_interface
= 3;
4310 const char *source_str
;
4312 if (argc
== (idx_ipv4
+ 1))
4313 source_str
= "0.0.0.0";
4315 source_str
= argv
[idx_ipv4
+ 1]->arg
;
4317 return pim_process_no_ip_mroute_cmd(vty
, argv
[idx_interface
]->arg
,
4318 argv
[idx_ipv4
]->arg
, source_str
);
4321 DEFUN (interface_ip_pim_hello
,
4322 interface_ip_pim_hello_cmd
,
4323 "ip pim hello (1-65535) [(1-65535)]",
4327 IFACE_PIM_HELLO_TIME_STR
4328 IFACE_PIM_HELLO_HOLD_STR
)
4333 if (argc
== idx_hold
+ 1)
4334 return pim_process_ip_pim_hello_cmd(vty
, argv
[idx_time
]->arg
,
4335 argv
[idx_hold
]->arg
);
4338 return pim_process_ip_pim_hello_cmd(vty
, argv
[idx_time
]->arg
,
4342 DEFUN (interface_no_ip_pim_hello
,
4343 interface_no_ip_pim_hello_cmd
,
4344 "no ip pim hello [(1-65535) [(1-65535)]]",
4352 return pim_process_no_ip_pim_hello_cmd(vty
);
4361 PIM_DO_DEBUG_GM_EVENTS
;
4362 PIM_DO_DEBUG_GM_PACKETS
;
4363 PIM_DO_DEBUG_GM_TRACE
;
4367 DEFUN (no_debug_igmp
,
4374 PIM_DONT_DEBUG_GM_EVENTS
;
4375 PIM_DONT_DEBUG_GM_PACKETS
;
4376 PIM_DONT_DEBUG_GM_TRACE
;
4381 DEFUN (debug_igmp_events
,
4382 debug_igmp_events_cmd
,
4383 "debug igmp events",
4386 DEBUG_IGMP_EVENTS_STR
)
4388 PIM_DO_DEBUG_GM_EVENTS
;
4392 DEFUN (no_debug_igmp_events
,
4393 no_debug_igmp_events_cmd
,
4394 "no debug igmp events",
4398 DEBUG_IGMP_EVENTS_STR
)
4400 PIM_DONT_DEBUG_GM_EVENTS
;
4405 DEFUN (debug_igmp_packets
,
4406 debug_igmp_packets_cmd
,
4407 "debug igmp packets",
4410 DEBUG_IGMP_PACKETS_STR
)
4412 PIM_DO_DEBUG_GM_PACKETS
;
4416 DEFUN (no_debug_igmp_packets
,
4417 no_debug_igmp_packets_cmd
,
4418 "no debug igmp packets",
4422 DEBUG_IGMP_PACKETS_STR
)
4424 PIM_DONT_DEBUG_GM_PACKETS
;
4429 DEFUN (debug_igmp_trace
,
4430 debug_igmp_trace_cmd
,
4434 DEBUG_IGMP_TRACE_STR
)
4436 PIM_DO_DEBUG_GM_TRACE
;
4440 DEFUN (no_debug_igmp_trace
,
4441 no_debug_igmp_trace_cmd
,
4442 "no debug igmp trace",
4446 DEBUG_IGMP_TRACE_STR
)
4448 PIM_DONT_DEBUG_GM_TRACE
;
4453 DEFUN (debug_igmp_trace_detail
,
4454 debug_igmp_trace_detail_cmd
,
4455 "debug igmp trace detail",
4458 DEBUG_IGMP_TRACE_STR
4461 PIM_DO_DEBUG_GM_TRACE_DETAIL
;
4465 DEFUN (no_debug_igmp_trace_detail
,
4466 no_debug_igmp_trace_detail_cmd
,
4467 "no debug igmp trace detail",
4471 DEBUG_IGMP_TRACE_STR
4474 PIM_DONT_DEBUG_GM_TRACE_DETAIL
;
4479 DEFUN (debug_mroute
,
4485 PIM_DO_DEBUG_MROUTE
;
4489 DEFUN (debug_mroute_detail
,
4490 debug_mroute_detail_cmd
,
4491 "debug mroute detail",
4496 PIM_DO_DEBUG_MROUTE_DETAIL
;
4500 DEFUN (no_debug_mroute
,
4501 no_debug_mroute_cmd
,
4507 PIM_DONT_DEBUG_MROUTE
;
4511 DEFUN (no_debug_mroute_detail
,
4512 no_debug_mroute_detail_cmd
,
4513 "no debug mroute detail",
4519 PIM_DONT_DEBUG_MROUTE_DETAIL
;
4523 DEFUN (debug_pim_static
,
4524 debug_pim_static_cmd
,
4530 PIM_DO_DEBUG_STATIC
;
4534 DEFUN (no_debug_pim_static
,
4535 no_debug_pim_static_cmd
,
4536 "no debug pim static",
4542 PIM_DONT_DEBUG_STATIC
;
4555 return pim_debug_pim_cmd();
4557 return pim_no_debug_pim_cmd();
4560 DEFPY (debug_pim_nht
,
4562 "[no] debug pim nht",
4566 "Nexthop Tracking\n")
4569 PIM_DO_DEBUG_PIM_NHT
;
4571 PIM_DONT_DEBUG_PIM_NHT
;
4575 DEFPY (debug_pim_nht_det
,
4576 debug_pim_nht_det_cmd
,
4577 "[no] debug pim nht detail",
4581 "Nexthop Tracking\n"
4582 "Detailed Information\n")
4585 PIM_DO_DEBUG_PIM_NHT_DETAIL
;
4587 PIM_DONT_DEBUG_PIM_NHT_DETAIL
;
4591 DEFUN (debug_pim_nht_rp
,
4592 debug_pim_nht_rp_cmd
,
4596 "Nexthop Tracking\n"
4597 "RP Nexthop Tracking\n")
4599 PIM_DO_DEBUG_PIM_NHT_RP
;
4603 DEFUN (no_debug_pim_nht_rp
,
4604 no_debug_pim_nht_rp_cmd
,
4605 "no debug pim nht rp",
4609 "Nexthop Tracking\n"
4610 "RP Nexthop Tracking\n")
4612 PIM_DONT_DEBUG_PIM_NHT_RP
;
4616 DEFPY (debug_pim_events
,
4617 debug_pim_events_cmd
,
4618 "[no] debug pim events",
4622 DEBUG_PIM_EVENTS_STR
)
4625 PIM_DO_DEBUG_PIM_EVENTS
;
4627 PIM_DONT_DEBUG_PIM_EVENTS
;
4631 DEFPY (debug_pim_packets
,
4632 debug_pim_packets_cmd
,
4633 "[no] debug pim packets [<hello$hello|joins$joins|register$registers>]",
4636 DEBUG_PIM_PACKETS_STR
4637 DEBUG_PIM_HELLO_PACKETS_STR
4638 DEBUG_PIM_J_P_PACKETS_STR
4639 DEBUG_PIM_PIM_REG_PACKETS_STR
)
4642 return pim_debug_pim_packets_cmd(hello
, joins
, registers
, vty
);
4644 return pim_no_debug_pim_packets_cmd(hello
, joins
, registers
,
4648 DEFPY (debug_pim_packetdump_send
,
4649 debug_pim_packetdump_send_cmd
,
4650 "[no] debug pim packet-dump send",
4654 DEBUG_PIM_PACKETDUMP_STR
4655 DEBUG_PIM_PACKETDUMP_SEND_STR
)
4658 PIM_DO_DEBUG_PIM_PACKETDUMP_SEND
;
4660 PIM_DONT_DEBUG_PIM_PACKETDUMP_SEND
;
4664 DEFPY (debug_pim_packetdump_recv
,
4665 debug_pim_packetdump_recv_cmd
,
4666 "[no] debug pim packet-dump receive",
4670 DEBUG_PIM_PACKETDUMP_STR
4671 DEBUG_PIM_PACKETDUMP_RECV_STR
)
4674 PIM_DO_DEBUG_PIM_PACKETDUMP_RECV
;
4676 PIM_DONT_DEBUG_PIM_PACKETDUMP_RECV
;
4680 DEFPY (debug_pim_trace
,
4681 debug_pim_trace_cmd
,
4682 "[no] debug pim trace",
4686 DEBUG_PIM_TRACE_STR
)
4689 PIM_DO_DEBUG_PIM_TRACE
;
4691 PIM_DONT_DEBUG_PIM_TRACE
;
4695 DEFPY (debug_pim_trace_detail
,
4696 debug_pim_trace_detail_cmd
,
4697 "[no] debug pim trace detail",
4702 "Detailed Information\n")
4705 PIM_DO_DEBUG_PIM_TRACE_DETAIL
;
4707 PIM_DONT_DEBUG_PIM_TRACE_DETAIL
;
4711 DEFUN (debug_ssmpingd
,
4717 PIM_DO_DEBUG_SSMPINGD
;
4721 DEFUN (no_debug_ssmpingd
,
4722 no_debug_ssmpingd_cmd
,
4723 "no debug ssmpingd",
4728 PIM_DONT_DEBUG_SSMPINGD
;
4732 DEFPY (debug_pim_zebra
,
4733 debug_pim_zebra_cmd
,
4734 "[no] debug pim zebra",
4738 DEBUG_PIM_ZEBRA_STR
)
4743 PIM_DONT_DEBUG_ZEBRA
;
4747 DEFUN(debug_pim_mlag
, debug_pim_mlag_cmd
, "debug pim mlag",
4748 DEBUG_STR DEBUG_PIM_STR DEBUG_PIM_MLAG_STR
)
4754 DEFUN(no_debug_pim_mlag
, no_debug_pim_mlag_cmd
, "no debug pim mlag",
4755 NO_STR DEBUG_STR DEBUG_PIM_STR DEBUG_PIM_MLAG_STR
)
4757 PIM_DONT_DEBUG_MLAG
;
4761 DEFUN (debug_pim_vxlan
,
4762 debug_pim_vxlan_cmd
,
4766 DEBUG_PIM_VXLAN_STR
)
4772 DEFUN (no_debug_pim_vxlan
,
4773 no_debug_pim_vxlan_cmd
,
4774 "no debug pim vxlan",
4778 DEBUG_PIM_VXLAN_STR
)
4780 PIM_DONT_DEBUG_VXLAN
;
4790 PIM_DO_DEBUG_MSDP_EVENTS
;
4791 PIM_DO_DEBUG_MSDP_PACKETS
;
4795 DEFUN (no_debug_msdp
,
4802 PIM_DONT_DEBUG_MSDP_EVENTS
;
4803 PIM_DONT_DEBUG_MSDP_PACKETS
;
4807 DEFUN (debug_msdp_events
,
4808 debug_msdp_events_cmd
,
4809 "debug msdp events",
4812 DEBUG_MSDP_EVENTS_STR
)
4814 PIM_DO_DEBUG_MSDP_EVENTS
;
4818 DEFUN (no_debug_msdp_events
,
4819 no_debug_msdp_events_cmd
,
4820 "no debug msdp events",
4824 DEBUG_MSDP_EVENTS_STR
)
4826 PIM_DONT_DEBUG_MSDP_EVENTS
;
4830 DEFUN (debug_msdp_packets
,
4831 debug_msdp_packets_cmd
,
4832 "debug msdp packets",
4835 DEBUG_MSDP_PACKETS_STR
)
4837 PIM_DO_DEBUG_MSDP_PACKETS
;
4841 DEFUN (no_debug_msdp_packets
,
4842 no_debug_msdp_packets_cmd
,
4843 "no debug msdp packets",
4847 DEBUG_MSDP_PACKETS_STR
)
4849 PIM_DONT_DEBUG_MSDP_PACKETS
;
4853 DEFUN (debug_mtrace
,
4859 PIM_DO_DEBUG_MTRACE
;
4863 DEFUN (no_debug_mtrace
,
4864 no_debug_mtrace_cmd
,
4870 PIM_DONT_DEBUG_MTRACE
;
4885 DEFUN (no_debug_bsm
,
4898 DEFUN_NOSH (show_debugging_pim
,
4899 show_debugging_pim_cmd
,
4900 "show debugging [pim]",
4905 vty_out(vty
, "PIM debugging status\n");
4907 pim_debug_config_write(vty
);
4912 DEFUN (interface_pim_use_source
,
4913 interface_pim_use_source_cmd
,
4914 "ip pim use-source A.B.C.D",
4917 "Configure primary IP address\n"
4918 "source ip address\n")
4920 nb_cli_enqueue_change(vty
, "./use-source", NB_OP_MODIFY
, argv
[3]->arg
);
4922 return nb_cli_apply_changes(vty
,
4923 FRR_PIM_INTERFACE_XPATH
,
4924 "frr-routing:ipv4");
4927 DEFUN (interface_no_pim_use_source
,
4928 interface_no_pim_use_source_cmd
,
4929 "no ip pim use-source [A.B.C.D]",
4933 "Delete source IP address\n"
4934 "source ip address\n")
4936 nb_cli_enqueue_change(vty
, "./use-source", NB_OP_MODIFY
, "0.0.0.0");
4938 return nb_cli_apply_changes(vty
,
4939 FRR_PIM_INTERFACE_XPATH
,
4940 "frr-routing:ipv4");
4945 "ip pim bfd [profile BFDPROF$prof]",
4948 "Enables BFD support\n"
4950 "Use BFD profile name\n")
4952 const struct lyd_node
*igmp_enable_dnode
;
4955 yang_dnode_getf(vty
->candidate_config
->dnode
,
4956 FRR_GMP_ENABLE_XPATH
, VTY_CURR_XPATH
,
4957 "frr-routing:ipv4");
4958 if (!igmp_enable_dnode
)
4959 nb_cli_enqueue_change(vty
, "./pim-enable", NB_OP_MODIFY
,
4962 if (!yang_dnode_get_bool(igmp_enable_dnode
, "."))
4963 nb_cli_enqueue_change(vty
, "./pim-enable", NB_OP_MODIFY
,
4967 nb_cli_enqueue_change(vty
, "./bfd", NB_OP_CREATE
, NULL
);
4969 nb_cli_enqueue_change(vty
, "./bfd/profile", NB_OP_MODIFY
, prof
);
4971 return nb_cli_apply_changes(vty
,
4972 FRR_PIM_INTERFACE_XPATH
,
4973 "frr-routing:ipv4");
4976 DEFPY(no_ip_pim_bfd_profile
, no_ip_pim_bfd_profile_cmd
,
4977 "no ip pim bfd profile [BFDPROF]",
4981 "Enables BFD support\n"
4982 "Disable BFD profile\n"
4983 "BFD Profile name\n")
4985 nb_cli_enqueue_change(vty
, "./bfd/profile", NB_OP_DESTROY
, NULL
);
4987 return nb_cli_apply_changes(vty
,
4988 FRR_PIM_INTERFACE_XPATH
,
4989 "frr-routing:ipv4");
4992 DEFUN (no_ip_pim_bfd
,
4998 "Disables BFD support\n")
5000 nb_cli_enqueue_change(vty
, "./bfd", NB_OP_DESTROY
, NULL
);
5002 return nb_cli_apply_changes(vty
,
5003 FRR_PIM_INTERFACE_XPATH
,
5004 "frr-routing:ipv4");
5012 "Enables BSM support on the interface\n")
5014 const struct lyd_node
*igmp_enable_dnode
;
5017 yang_dnode_getf(vty
->candidate_config
->dnode
,
5018 FRR_GMP_ENABLE_XPATH
, VTY_CURR_XPATH
,
5019 "frr-routing:ipv4");
5020 if (!igmp_enable_dnode
)
5021 nb_cli_enqueue_change(vty
, "./pim-enable", NB_OP_MODIFY
,
5024 if (!yang_dnode_get_bool(igmp_enable_dnode
, "."))
5025 nb_cli_enqueue_change(vty
, "./pim-enable", NB_OP_MODIFY
,
5029 nb_cli_enqueue_change(vty
, "./bsm", NB_OP_MODIFY
, "true");
5031 return nb_cli_apply_changes(vty
,
5032 FRR_PIM_INTERFACE_XPATH
, "frr-routing:ipv4");
5035 DEFUN (no_ip_pim_bsm
,
5041 "Disables BSM support\n")
5043 nb_cli_enqueue_change(vty
, "./bsm", NB_OP_MODIFY
, "false");
5045 return nb_cli_apply_changes(vty
,
5046 FRR_PIM_INTERFACE_XPATH
, "frr-routing:ipv4");
5049 DEFUN (ip_pim_ucast_bsm
,
5050 ip_pim_ucast_bsm_cmd
,
5051 "ip pim unicast-bsm",
5054 "Accept/Send unicast BSM on the interface\n")
5056 const struct lyd_node
*igmp_enable_dnode
;
5059 yang_dnode_getf(vty
->candidate_config
->dnode
,
5060 FRR_GMP_ENABLE_XPATH
, VTY_CURR_XPATH
,
5061 "frr-routing:ipv4");
5062 if (!igmp_enable_dnode
)
5063 nb_cli_enqueue_change(vty
, "./pim-enable", NB_OP_MODIFY
,
5066 if (!yang_dnode_get_bool(igmp_enable_dnode
, "."))
5067 nb_cli_enqueue_change(vty
, "./pim-enable", NB_OP_MODIFY
,
5071 nb_cli_enqueue_change(vty
, "./unicast-bsm", NB_OP_MODIFY
, "true");
5073 return nb_cli_apply_changes(vty
,
5074 FRR_PIM_INTERFACE_XPATH
, "frr-routing:ipv4");
5078 DEFUN (no_ip_pim_ucast_bsm
,
5079 no_ip_pim_ucast_bsm_cmd
,
5080 "no ip pim unicast-bsm",
5084 "Block send/receive unicast BSM on this interface\n")
5086 nb_cli_enqueue_change(vty
, "./unicast-bsm", NB_OP_MODIFY
, "false");
5088 return nb_cli_apply_changes(vty
,
5089 FRR_PIM_INTERFACE_XPATH
, "frr-routing:ipv4");
5095 ip_pim_bfd_param_cmd
,
5096 "ip pim bfd (2-255) (1-65535) (1-65535)",
5099 "Enables BFD support\n"
5100 "Detect Multiplier\n"
5101 "Required min receive interval\n"
5102 "Desired min transmit interval\n")
5106 ip_pim_bfd_param_cmd
,
5107 "ip pim bfd (2-255) (1-65535) (1-65535)",
5110 "Enables BFD support\n"
5111 "Detect Multiplier\n"
5112 "Required min receive interval\n"
5113 "Desired min transmit interval\n")
5114 #endif /* HAVE_BFDD */
5117 int idx_number_2
= 4;
5118 int idx_number_3
= 5;
5119 const struct lyd_node
*igmp_enable_dnode
;
5122 yang_dnode_getf(vty
->candidate_config
->dnode
,
5123 FRR_GMP_ENABLE_XPATH
, VTY_CURR_XPATH
,
5124 "frr-routing:ipv4");
5125 if (!igmp_enable_dnode
)
5126 nb_cli_enqueue_change(vty
, "./pim-enable", NB_OP_MODIFY
,
5129 if (!yang_dnode_get_bool(igmp_enable_dnode
, "."))
5130 nb_cli_enqueue_change(vty
, "./pim-enable", NB_OP_MODIFY
,
5134 nb_cli_enqueue_change(vty
, "./bfd", NB_OP_CREATE
, NULL
);
5135 nb_cli_enqueue_change(vty
, "./bfd/min-rx-interval", NB_OP_MODIFY
,
5136 argv
[idx_number_2
]->arg
);
5137 nb_cli_enqueue_change(vty
, "./bfd/min-tx-interval", NB_OP_MODIFY
,
5138 argv
[idx_number_3
]->arg
);
5139 nb_cli_enqueue_change(vty
, "./bfd/detect_mult", NB_OP_MODIFY
,
5140 argv
[idx_number
]->arg
);
5142 return nb_cli_apply_changes(vty
,
5143 FRR_PIM_INTERFACE_XPATH
, "frr-routing:ipv4");
5147 ALIAS(no_ip_pim_bfd
, no_ip_pim_bfd_param_cmd
,
5148 "no ip pim bfd (2-255) (1-65535) (1-65535)",
5152 "Enables BFD support\n"
5153 "Detect Multiplier\n"
5154 "Required min receive interval\n"
5155 "Desired min transmit interval\n")
5156 #endif /* !HAVE_BFDD */
5158 DEFPY(ip_msdp_peer
, ip_msdp_peer_cmd
,
5159 "ip msdp peer A.B.C.D$peer source A.B.C.D$source",
5162 "Configure MSDP peer\n"
5164 "Source address for TCP connection\n"
5165 "Local IP address\n")
5167 const char *vrfname
;
5168 char temp_xpath
[XPATH_MAXLEN
];
5169 char msdp_peer_source_xpath
[XPATH_MAXLEN
];
5171 vrfname
= pim_cli_get_vrf_name(vty
);
5172 if (vrfname
== NULL
)
5173 return CMD_WARNING_CONFIG_FAILED
;
5175 snprintf(msdp_peer_source_xpath
, sizeof(msdp_peer_source_xpath
),
5176 FRR_PIM_VRF_XPATH
, "frr-pim:pimd", "pim", vrfname
,
5177 "frr-routing:ipv4");
5178 snprintf(temp_xpath
, sizeof(temp_xpath
),
5179 "/msdp-peer[peer-ip='%s']/source-ip", peer_str
);
5180 strlcat(msdp_peer_source_xpath
, temp_xpath
,
5181 sizeof(msdp_peer_source_xpath
));
5183 nb_cli_enqueue_change(vty
, msdp_peer_source_xpath
, NB_OP_MODIFY
,
5186 return nb_cli_apply_changes(vty
,
5187 FRR_PIM_INTERFACE_XPATH
, "frr-routing:ipv4");
5190 DEFPY(ip_msdp_timers
, ip_msdp_timers_cmd
,
5191 "ip msdp timers (1-65535)$keepalive (1-65535)$holdtime [(1-65535)$connretry]",
5194 "MSDP timers configuration\n"
5195 "Keep alive period (in seconds)\n"
5196 "Hold time period (in seconds)\n"
5197 "Connection retry period (in seconds)\n")
5199 const char *vrfname
;
5200 char xpath
[XPATH_MAXLEN
];
5202 vrfname
= pim_cli_get_vrf_name(vty
);
5203 if (vrfname
== NULL
)
5204 return CMD_WARNING_CONFIG_FAILED
;
5206 snprintf(xpath
, sizeof(xpath
), FRR_PIM_MSDP_XPATH
, "frr-pim:pimd",
5207 "pim", vrfname
, "frr-routing:ipv4");
5208 nb_cli_enqueue_change(vty
, "./hold-time", NB_OP_MODIFY
, holdtime_str
);
5209 nb_cli_enqueue_change(vty
, "./keep-alive", NB_OP_MODIFY
, keepalive_str
);
5211 nb_cli_enqueue_change(vty
, "./connection-retry", NB_OP_MODIFY
,
5214 nb_cli_enqueue_change(vty
, "./connection-retry", NB_OP_DESTROY
,
5217 nb_cli_apply_changes(vty
, xpath
);
5222 DEFPY(no_ip_msdp_timers
, no_ip_msdp_timers_cmd
,
5223 "no ip msdp timers [(1-65535) (1-65535) [(1-65535)]]",
5227 "MSDP timers configuration\n"
5232 const char *vrfname
;
5233 char xpath
[XPATH_MAXLEN
];
5235 vrfname
= pim_cli_get_vrf_name(vty
);
5236 if (vrfname
== NULL
)
5237 return CMD_WARNING_CONFIG_FAILED
;
5239 snprintf(xpath
, sizeof(xpath
), FRR_PIM_MSDP_XPATH
, "frr-pim:pimd",
5240 "pim", vrfname
, "frr-routing:ipv4");
5242 nb_cli_enqueue_change(vty
, "./hold-time", NB_OP_DESTROY
, NULL
);
5243 nb_cli_enqueue_change(vty
, "./keep-alive", NB_OP_DESTROY
, NULL
);
5244 nb_cli_enqueue_change(vty
, "./connection-retry", NB_OP_DESTROY
, NULL
);
5246 nb_cli_apply_changes(vty
, xpath
);
5251 DEFUN (no_ip_msdp_peer
,
5252 no_ip_msdp_peer_cmd
,
5253 "no ip msdp peer A.B.C.D",
5257 "Delete MSDP peer\n"
5258 "peer ip address\n")
5260 const char *vrfname
;
5261 char msdp_peer_xpath
[XPATH_MAXLEN
];
5262 char temp_xpath
[XPATH_MAXLEN
];
5264 vrfname
= pim_cli_get_vrf_name(vty
);
5265 if (vrfname
== NULL
)
5266 return CMD_WARNING_CONFIG_FAILED
;
5268 snprintf(msdp_peer_xpath
, sizeof(msdp_peer_xpath
),
5270 "frr-pim:pimd", "pim", vrfname
, "frr-routing:ipv4");
5271 snprintf(temp_xpath
, sizeof(temp_xpath
),
5272 "/msdp-peer[peer-ip='%s']",
5275 strlcat(msdp_peer_xpath
, temp_xpath
, sizeof(msdp_peer_xpath
));
5277 nb_cli_enqueue_change(vty
, msdp_peer_xpath
, NB_OP_DESTROY
, NULL
);
5279 return nb_cli_apply_changes(vty
, NULL
);
5282 DEFPY(ip_msdp_mesh_group_member
,
5283 ip_msdp_mesh_group_member_cmd
,
5284 "ip msdp mesh-group WORD$gname member A.B.C.D$maddr",
5287 "Configure MSDP mesh-group\n"
5289 "Mesh group member\n"
5290 "Peer IP address\n")
5292 const char *vrfname
;
5293 char xpath_value
[XPATH_MAXLEN
];
5295 vrfname
= pim_cli_get_vrf_name(vty
);
5296 if (vrfname
== NULL
)
5297 return CMD_WARNING_CONFIG_FAILED
;
5299 /* Create mesh group. */
5300 snprintf(xpath_value
, sizeof(xpath_value
),
5301 FRR_PIM_VRF_XPATH
"/msdp-mesh-groups[name='%s']",
5302 "frr-pim:pimd", "pim", vrfname
, "frr-routing:ipv4", gname
);
5303 nb_cli_enqueue_change(vty
, xpath_value
, NB_OP_CREATE
, NULL
);
5305 /* Create mesh group member. */
5306 strlcat(xpath_value
, "/members[address='", sizeof(xpath_value
));
5307 strlcat(xpath_value
, maddr_str
, sizeof(xpath_value
));
5308 strlcat(xpath_value
, "']", sizeof(xpath_value
));
5309 nb_cli_enqueue_change(vty
, xpath_value
, NB_OP_CREATE
, NULL
);
5311 return nb_cli_apply_changes(vty
, NULL
);
5314 DEFPY(no_ip_msdp_mesh_group_member
,
5315 no_ip_msdp_mesh_group_member_cmd
,
5316 "no ip msdp mesh-group WORD$gname member A.B.C.D$maddr",
5320 "Delete MSDP mesh-group member\n"
5322 "Mesh group member\n"
5323 "Peer IP address\n")
5325 const char *vrfname
;
5326 char xpath_value
[XPATH_MAXLEN
];
5327 char xpath_member_value
[XPATH_MAXLEN
];
5329 vrfname
= pim_cli_get_vrf_name(vty
);
5330 if (vrfname
== NULL
)
5331 return CMD_WARNING_CONFIG_FAILED
;
5333 /* Get mesh group base XPath. */
5334 snprintf(xpath_value
, sizeof(xpath_value
),
5335 FRR_PIM_VRF_XPATH
"/msdp-mesh-groups[name='%s']",
5336 "frr-pim:pimd", "pim", vrfname
, "frr-routing:ipv4", gname
);
5338 if (!yang_dnode_exists(vty
->candidate_config
->dnode
, xpath_value
)) {
5339 vty_out(vty
, "%% mesh-group does not exist\n");
5340 return CMD_WARNING_CONFIG_FAILED
;
5343 /* Remove mesh group member. */
5344 strlcpy(xpath_member_value
, xpath_value
, sizeof(xpath_member_value
));
5345 strlcat(xpath_member_value
, "/members[address='",
5346 sizeof(xpath_member_value
));
5347 strlcat(xpath_member_value
, maddr_str
, sizeof(xpath_member_value
));
5348 strlcat(xpath_member_value
, "']", sizeof(xpath_member_value
));
5349 if (!yang_dnode_exists(vty
->candidate_config
->dnode
,
5350 xpath_member_value
)) {
5351 vty_out(vty
, "%% mesh-group member does not exist\n");
5352 return CMD_WARNING_CONFIG_FAILED
;
5355 nb_cli_enqueue_change(vty
, xpath_member_value
, NB_OP_DESTROY
, NULL
);
5358 * If this is the last member, then we must remove the group altogether
5359 * to not break legacy CLI behaviour.
5361 pim_cli_legacy_mesh_group_behavior(vty
, gname
);
5363 return nb_cli_apply_changes(vty
, NULL
);
5366 DEFPY(ip_msdp_mesh_group_source
,
5367 ip_msdp_mesh_group_source_cmd
,
5368 "ip msdp mesh-group WORD$gname source A.B.C.D$saddr",
5371 "Configure MSDP mesh-group\n"
5373 "Mesh group local address\n"
5374 "Source IP address for the TCP connection\n")
5376 const char *vrfname
;
5377 char xpath_value
[XPATH_MAXLEN
];
5379 vrfname
= pim_cli_get_vrf_name(vty
);
5380 if (vrfname
== NULL
)
5381 return CMD_WARNING_CONFIG_FAILED
;
5383 /* Create mesh group. */
5384 snprintf(xpath_value
, sizeof(xpath_value
),
5385 FRR_PIM_VRF_XPATH
"/msdp-mesh-groups[name='%s']",
5386 "frr-pim:pimd", "pim", vrfname
, "frr-routing:ipv4", gname
);
5387 nb_cli_enqueue_change(vty
, xpath_value
, NB_OP_CREATE
, NULL
);
5389 /* Create mesh group source. */
5390 strlcat(xpath_value
, "/source", sizeof(xpath_value
));
5391 nb_cli_enqueue_change(vty
, xpath_value
, NB_OP_MODIFY
, saddr_str
);
5393 return nb_cli_apply_changes(vty
, NULL
);
5396 DEFPY(no_ip_msdp_mesh_group_source
,
5397 no_ip_msdp_mesh_group_source_cmd
,
5398 "no ip msdp mesh-group WORD$gname source [A.B.C.D]",
5402 "Delete MSDP mesh-group source\n"
5404 "Mesh group source\n"
5405 "Mesh group local address\n")
5407 const char *vrfname
;
5408 char xpath_value
[XPATH_MAXLEN
];
5410 vrfname
= pim_cli_get_vrf_name(vty
);
5411 if (vrfname
== NULL
)
5412 return CMD_WARNING_CONFIG_FAILED
;
5414 /* Get mesh group base XPath. */
5415 snprintf(xpath_value
, sizeof(xpath_value
),
5416 FRR_PIM_VRF_XPATH
"/msdp-mesh-groups[name='%s']",
5417 "frr-pim:pimd", "pim", vrfname
, "frr-routing:ipv4", gname
);
5418 nb_cli_enqueue_change(vty
, xpath_value
, NB_OP_CREATE
, NULL
);
5420 /* Create mesh group source. */
5421 strlcat(xpath_value
, "/source", sizeof(xpath_value
));
5422 nb_cli_enqueue_change(vty
, xpath_value
, NB_OP_DESTROY
, NULL
);
5425 * If this is the last member, then we must remove the group altogether
5426 * to not break legacy CLI behaviour.
5428 pim_cli_legacy_mesh_group_behavior(vty
, gname
);
5430 return nb_cli_apply_changes(vty
, NULL
);
5433 DEFPY(no_ip_msdp_mesh_group
,
5434 no_ip_msdp_mesh_group_cmd
,
5435 "no ip msdp mesh-group WORD$gname",
5439 "Delete MSDP mesh-group\n"
5442 const char *vrfname
;
5443 char xpath_value
[XPATH_MAXLEN
];
5445 vrfname
= pim_cli_get_vrf_name(vty
);
5446 if (vrfname
== NULL
)
5447 return CMD_WARNING_CONFIG_FAILED
;
5449 /* Get mesh group base XPath. */
5450 snprintf(xpath_value
, sizeof(xpath_value
),
5451 FRR_PIM_VRF_XPATH
"/msdp-mesh-groups[name='%s']",
5452 "frr-pim:pimd", "pim", vrfname
, "frr-routing:ipv4", gname
);
5453 if (!yang_dnode_exists(vty
->candidate_config
->dnode
, xpath_value
))
5456 nb_cli_enqueue_change(vty
, xpath_value
, NB_OP_DESTROY
, NULL
);
5457 return nb_cli_apply_changes(vty
, NULL
);
5460 static void ip_msdp_show_mesh_group(struct vty
*vty
, struct pim_msdp_mg
*mg
,
5461 struct json_object
*json
)
5463 struct listnode
*mbrnode
;
5464 struct pim_msdp_mg_mbr
*mbr
;
5465 char mbr_str
[INET_ADDRSTRLEN
];
5466 char src_str
[INET_ADDRSTRLEN
];
5467 char state_str
[PIM_MSDP_STATE_STRLEN
];
5468 enum pim_msdp_peer_state state
;
5469 json_object
*json_mg_row
= NULL
;
5470 json_object
*json_members
= NULL
;
5471 json_object
*json_row
= NULL
;
5473 pim_inet4_dump("<source?>", mg
->src_ip
, src_str
, sizeof(src_str
));
5475 /* currently there is only one mesh group but we should still
5477 * it a dict with mg-name as key */
5478 json_mg_row
= json_object_new_object();
5479 json_object_string_add(json_mg_row
, "name",
5480 mg
->mesh_group_name
);
5481 json_object_string_add(json_mg_row
, "source", src_str
);
5483 vty_out(vty
, "Mesh group : %s\n", mg
->mesh_group_name
);
5484 vty_out(vty
, " Source : %s\n", src_str
);
5485 vty_out(vty
, " Member State\n");
5488 for (ALL_LIST_ELEMENTS_RO(mg
->mbr_list
, mbrnode
, mbr
)) {
5489 pim_inet4_dump("<mbr?>", mbr
->mbr_ip
, mbr_str
, sizeof(mbr_str
));
5491 state
= mbr
->mp
->state
;
5493 state
= PIM_MSDP_DISABLED
;
5495 pim_msdp_state_dump(state
, state_str
, sizeof(state_str
));
5497 json_row
= json_object_new_object();
5498 json_object_string_add(json_row
, "member", mbr_str
);
5499 json_object_string_add(json_row
, "state", state_str
);
5500 if (!json_members
) {
5501 json_members
= json_object_new_object();
5502 json_object_object_add(json_mg_row
, "members",
5505 json_object_object_add(json_members
, mbr_str
, json_row
);
5507 vty_out(vty
, " %-15s %11s\n", mbr_str
, state_str
);
5512 json_object_object_add(json
, mg
->mesh_group_name
, json_mg_row
);
5515 DEFUN (show_ip_msdp_mesh_group
,
5516 show_ip_msdp_mesh_group_cmd
,
5517 "show ip msdp [vrf NAME] mesh-group [json]",
5522 "MSDP mesh-group information\n"
5525 bool uj
= use_json(argc
, argv
);
5527 struct pim_msdp_mg
*mg
;
5528 struct vrf
*vrf
= pim_cmd_lookup_vrf(vty
, argv
, argc
, &idx
);
5529 struct pim_instance
*pim
;
5530 struct json_object
*json
= NULL
;
5536 /* Quick case: list is empty. */
5537 if (SLIST_EMPTY(&pim
->msdp
.mglist
)) {
5539 vty_out(vty
, "{}\n");
5545 json
= json_object_new_object();
5547 SLIST_FOREACH (mg
, &pim
->msdp
.mglist
, mg_entry
)
5548 ip_msdp_show_mesh_group(vty
, mg
, json
);
5551 vty_json(vty
, json
);
5556 DEFUN (show_ip_msdp_mesh_group_vrf_all
,
5557 show_ip_msdp_mesh_group_vrf_all_cmd
,
5558 "show ip msdp vrf all mesh-group [json]",
5563 "MSDP mesh-group information\n"
5566 bool uj
= use_json(argc
, argv
);
5567 struct json_object
*json
= NULL
, *vrf_json
= NULL
;
5568 struct pim_instance
*pim
;
5569 struct pim_msdp_mg
*mg
;
5573 json
= json_object_new_object();
5575 RB_FOREACH (vrf
, vrf_name_head
, &vrfs_by_name
) {
5577 vrf_json
= json_object_new_object();
5578 json_object_object_add(json
, vrf
->name
, vrf_json
);
5580 vty_out(vty
, "VRF: %s\n", vrf
->name
);
5583 SLIST_FOREACH (mg
, &pim
->msdp
.mglist
, mg_entry
)
5584 ip_msdp_show_mesh_group(vty
, mg
, vrf_json
);
5588 vty_json(vty
, json
);
5594 static void ip_msdp_show_peers(struct pim_instance
*pim
, struct vty
*vty
,
5597 struct listnode
*mpnode
;
5598 struct pim_msdp_peer
*mp
;
5599 char peer_str
[INET_ADDRSTRLEN
];
5600 char local_str
[INET_ADDRSTRLEN
];
5601 char state_str
[PIM_MSDP_STATE_STRLEN
];
5602 char timebuf
[PIM_MSDP_UPTIME_STRLEN
];
5604 json_object
*json
= NULL
;
5605 json_object
*json_row
= NULL
;
5609 json
= json_object_new_object();
5612 "Peer Local State Uptime SaCnt\n");
5615 for (ALL_LIST_ELEMENTS_RO(pim
->msdp
.peer_list
, mpnode
, mp
)) {
5616 if (mp
->state
== PIM_MSDP_ESTABLISHED
) {
5617 now
= pim_time_monotonic_sec();
5618 pim_time_uptime(timebuf
, sizeof(timebuf
),
5621 strlcpy(timebuf
, "-", sizeof(timebuf
));
5623 pim_inet4_dump("<peer?>", mp
->peer
, peer_str
, sizeof(peer_str
));
5624 pim_inet4_dump("<local?>", mp
->local
, local_str
,
5626 pim_msdp_state_dump(mp
->state
, state_str
, sizeof(state_str
));
5628 json_row
= json_object_new_object();
5629 json_object_string_add(json_row
, "peer", peer_str
);
5630 json_object_string_add(json_row
, "local", local_str
);
5631 json_object_string_add(json_row
, "state", state_str
);
5632 json_object_string_add(json_row
, "upTime", timebuf
);
5633 json_object_int_add(json_row
, "saCount", mp
->sa_cnt
);
5634 json_object_object_add(json
, peer_str
, json_row
);
5636 vty_out(vty
, "%-15s %15s %11s %8s %6d\n", peer_str
,
5637 local_str
, state_str
, timebuf
, mp
->sa_cnt
);
5642 vty_json(vty
, json
);
5645 static void ip_msdp_show_peers_detail(struct pim_instance
*pim
, struct vty
*vty
,
5646 const char *peer
, bool uj
)
5648 struct listnode
*mpnode
;
5649 struct pim_msdp_peer
*mp
;
5650 char peer_str
[INET_ADDRSTRLEN
];
5651 char local_str
[INET_ADDRSTRLEN
];
5652 char state_str
[PIM_MSDP_STATE_STRLEN
];
5653 char timebuf
[PIM_MSDP_UPTIME_STRLEN
];
5654 char katimer
[PIM_MSDP_TIMER_STRLEN
];
5655 char crtimer
[PIM_MSDP_TIMER_STRLEN
];
5656 char holdtimer
[PIM_MSDP_TIMER_STRLEN
];
5658 json_object
*json
= NULL
;
5659 json_object
*json_row
= NULL
;
5662 json
= json_object_new_object();
5665 for (ALL_LIST_ELEMENTS_RO(pim
->msdp
.peer_list
, mpnode
, mp
)) {
5666 pim_inet4_dump("<peer?>", mp
->peer
, peer_str
, sizeof(peer_str
));
5667 if (strcmp(peer
, "detail") && strcmp(peer
, peer_str
))
5670 if (mp
->state
== PIM_MSDP_ESTABLISHED
) {
5671 now
= pim_time_monotonic_sec();
5672 pim_time_uptime(timebuf
, sizeof(timebuf
),
5675 strlcpy(timebuf
, "-", sizeof(timebuf
));
5677 pim_inet4_dump("<local?>", mp
->local
, local_str
,
5679 pim_msdp_state_dump(mp
->state
, state_str
, sizeof(state_str
));
5680 pim_time_timer_to_hhmmss(katimer
, sizeof(katimer
),
5682 pim_time_timer_to_hhmmss(crtimer
, sizeof(crtimer
),
5684 pim_time_timer_to_hhmmss(holdtimer
, sizeof(holdtimer
),
5688 json_row
= json_object_new_object();
5689 json_object_string_add(json_row
, "peer", peer_str
);
5690 json_object_string_add(json_row
, "local", local_str
);
5691 if (mp
->flags
& PIM_MSDP_PEERF_IN_GROUP
)
5692 json_object_string_add(json_row
,
5694 mp
->mesh_group_name
);
5695 json_object_string_add(json_row
, "state", state_str
);
5696 json_object_string_add(json_row
, "upTime", timebuf
);
5697 json_object_string_add(json_row
, "keepAliveTimer",
5699 json_object_string_add(json_row
, "connRetryTimer",
5701 json_object_string_add(json_row
, "holdTimer",
5703 json_object_string_add(json_row
, "lastReset",
5705 json_object_int_add(json_row
, "connAttempts",
5707 json_object_int_add(json_row
, "establishedChanges",
5709 json_object_int_add(json_row
, "saCount", mp
->sa_cnt
);
5710 json_object_int_add(json_row
, "kaSent", mp
->ka_tx_cnt
);
5711 json_object_int_add(json_row
, "kaRcvd", mp
->ka_rx_cnt
);
5712 json_object_int_add(json_row
, "saSent", mp
->sa_tx_cnt
);
5713 json_object_int_add(json_row
, "saRcvd", mp
->sa_rx_cnt
);
5714 json_object_object_add(json
, peer_str
, json_row
);
5716 vty_out(vty
, "Peer : %s\n", peer_str
);
5717 vty_out(vty
, " Local : %s\n", local_str
);
5718 if (mp
->flags
& PIM_MSDP_PEERF_IN_GROUP
)
5719 vty_out(vty
, " Mesh Group : %s\n",
5720 mp
->mesh_group_name
);
5721 vty_out(vty
, " State : %s\n", state_str
);
5722 vty_out(vty
, " Uptime : %s\n", timebuf
);
5724 vty_out(vty
, " Keepalive Timer : %s\n", katimer
);
5725 vty_out(vty
, " Conn Retry Timer : %s\n", crtimer
);
5726 vty_out(vty
, " Hold Timer : %s\n", holdtimer
);
5727 vty_out(vty
, " Last Reset : %s\n",
5729 vty_out(vty
, " Conn Attempts : %d\n",
5731 vty_out(vty
, " Established Changes : %d\n",
5733 vty_out(vty
, " SA Count : %d\n",
5735 vty_out(vty
, " Statistics :\n");
5738 vty_out(vty
, " Keepalives : %10d %10d\n",
5739 mp
->ka_tx_cnt
, mp
->ka_rx_cnt
);
5740 vty_out(vty
, " SAs : %10d %10d\n",
5741 mp
->sa_tx_cnt
, mp
->sa_rx_cnt
);
5747 vty_json(vty
, json
);
5750 DEFUN (show_ip_msdp_peer_detail
,
5751 show_ip_msdp_peer_detail_cmd
,
5752 "show ip msdp [vrf NAME] peer [detail|A.B.C.D] [json]",
5757 "MSDP peer information\n"
5762 bool uj
= use_json(argc
, argv
);
5764 struct vrf
*vrf
= pim_cmd_lookup_vrf(vty
, argv
, argc
, &idx
);
5771 if (argv_find(argv
, argc
, "detail", &idx
))
5772 arg
= argv
[idx
]->text
;
5773 else if (argv_find(argv
, argc
, "A.B.C.D", &idx
))
5774 arg
= argv
[idx
]->arg
;
5777 ip_msdp_show_peers_detail(vrf
->info
, vty
, argv
[idx
]->arg
, uj
);
5779 ip_msdp_show_peers(vrf
->info
, vty
, uj
);
5784 DEFUN (show_ip_msdp_peer_detail_vrf_all
,
5785 show_ip_msdp_peer_detail_vrf_all_cmd
,
5786 "show ip msdp vrf all peer [detail|A.B.C.D] [json]",
5791 "MSDP peer information\n"
5797 bool uj
= use_json(argc
, argv
);
5803 RB_FOREACH (vrf
, vrf_name_head
, &vrfs_by_name
) {
5807 vty_out(vty
, " \"%s\": ", vrf
->name
);
5810 vty_out(vty
, "VRF: %s\n", vrf
->name
);
5811 if (argv_find(argv
, argc
, "detail", &idx
)
5812 || argv_find(argv
, argc
, "A.B.C.D", &idx
))
5813 ip_msdp_show_peers_detail(vrf
->info
, vty
,
5814 argv
[idx
]->arg
, uj
);
5816 ip_msdp_show_peers(vrf
->info
, vty
, uj
);
5819 vty_out(vty
, "}\n");
5824 static void ip_msdp_show_sa(struct pim_instance
*pim
, struct vty
*vty
, bool uj
)
5826 struct listnode
*sanode
;
5827 struct pim_msdp_sa
*sa
;
5828 char rp_str
[INET_ADDRSTRLEN
];
5829 char timebuf
[PIM_MSDP_UPTIME_STRLEN
];
5833 json_object
*json
= NULL
;
5834 json_object
*json_group
= NULL
;
5835 json_object
*json_row
= NULL
;
5838 json
= json_object_new_object();
5841 "Source Group RP Local SPT Uptime\n");
5844 for (ALL_LIST_ELEMENTS_RO(pim
->msdp
.sa_list
, sanode
, sa
)) {
5845 now
= pim_time_monotonic_sec();
5846 pim_time_uptime(timebuf
, sizeof(timebuf
), now
- sa
->uptime
);
5847 if (sa
->flags
& PIM_MSDP_SAF_PEER
) {
5848 pim_inet4_dump("<rp?>", sa
->rp
, rp_str
, sizeof(rp_str
));
5850 strlcpy(spt_str
, "yes", sizeof(spt_str
));
5852 strlcpy(spt_str
, "no", sizeof(spt_str
));
5855 strlcpy(rp_str
, "-", sizeof(rp_str
));
5856 strlcpy(spt_str
, "-", sizeof(spt_str
));
5858 if (sa
->flags
& PIM_MSDP_SAF_LOCAL
) {
5859 strlcpy(local_str
, "yes", sizeof(local_str
));
5861 strlcpy(local_str
, "no", sizeof(local_str
));
5864 char src_str
[PIM_ADDRSTRLEN
];
5865 char grp_str
[PIM_ADDRSTRLEN
];
5867 snprintfrr(grp_str
, sizeof(grp_str
), "%pPAs",
5869 snprintfrr(src_str
, sizeof(src_str
), "%pPAs",
5872 json_object_object_get_ex(json
, grp_str
, &json_group
);
5875 json_group
= json_object_new_object();
5876 json_object_object_add(json
, grp_str
,
5880 json_row
= json_object_new_object();
5881 json_object_string_add(json_row
, "source", src_str
);
5882 json_object_string_add(json_row
, "group", grp_str
);
5883 json_object_string_add(json_row
, "rp", rp_str
);
5884 json_object_string_add(json_row
, "local", local_str
);
5885 json_object_string_add(json_row
, "sptSetup", spt_str
);
5886 json_object_string_add(json_row
, "upTime", timebuf
);
5887 json_object_object_add(json_group
, src_str
, json_row
);
5889 vty_out(vty
, "%-15pPAs %15pPAs %15s %5c %3c %8s\n",
5890 &sa
->sg
.src
, &sa
->sg
.grp
, rp_str
, local_str
[0],
5891 spt_str
[0], timebuf
);
5896 vty_json(vty
, json
);
5899 static void ip_msdp_show_sa_entry_detail(struct pim_msdp_sa
*sa
,
5900 const char *src_str
,
5901 const char *grp_str
, struct vty
*vty
,
5902 bool uj
, json_object
*json
)
5904 char rp_str
[INET_ADDRSTRLEN
];
5905 char peer_str
[INET_ADDRSTRLEN
];
5906 char timebuf
[PIM_MSDP_UPTIME_STRLEN
];
5909 char statetimer
[PIM_MSDP_TIMER_STRLEN
];
5911 json_object
*json_group
= NULL
;
5912 json_object
*json_row
= NULL
;
5914 now
= pim_time_monotonic_sec();
5915 pim_time_uptime(timebuf
, sizeof(timebuf
), now
- sa
->uptime
);
5916 if (sa
->flags
& PIM_MSDP_SAF_PEER
) {
5917 pim_inet4_dump("<rp?>", sa
->rp
, rp_str
, sizeof(rp_str
));
5918 pim_inet4_dump("<peer?>", sa
->peer
, peer_str
, sizeof(peer_str
));
5920 strlcpy(spt_str
, "yes", sizeof(spt_str
));
5922 strlcpy(spt_str
, "no", sizeof(spt_str
));
5925 strlcpy(rp_str
, "-", sizeof(rp_str
));
5926 strlcpy(peer_str
, "-", sizeof(peer_str
));
5927 strlcpy(spt_str
, "-", sizeof(spt_str
));
5929 if (sa
->flags
& PIM_MSDP_SAF_LOCAL
) {
5930 strlcpy(local_str
, "yes", sizeof(local_str
));
5932 strlcpy(local_str
, "no", sizeof(local_str
));
5934 pim_time_timer_to_hhmmss(statetimer
, sizeof(statetimer
),
5935 sa
->sa_state_timer
);
5937 json_object_object_get_ex(json
, grp_str
, &json_group
);
5940 json_group
= json_object_new_object();
5941 json_object_object_add(json
, grp_str
, json_group
);
5944 json_row
= json_object_new_object();
5945 json_object_string_add(json_row
, "source", src_str
);
5946 json_object_string_add(json_row
, "group", grp_str
);
5947 json_object_string_add(json_row
, "rp", rp_str
);
5948 json_object_string_add(json_row
, "local", local_str
);
5949 json_object_string_add(json_row
, "sptSetup", spt_str
);
5950 json_object_string_add(json_row
, "upTime", timebuf
);
5951 json_object_string_add(json_row
, "stateTimer", statetimer
);
5952 json_object_object_add(json_group
, src_str
, json_row
);
5954 vty_out(vty
, "SA : %s\n", sa
->sg_str
);
5955 vty_out(vty
, " RP : %s\n", rp_str
);
5956 vty_out(vty
, " Peer : %s\n", peer_str
);
5957 vty_out(vty
, " Local : %s\n", local_str
);
5958 vty_out(vty
, " SPT Setup : %s\n", spt_str
);
5959 vty_out(vty
, " Uptime : %s\n", timebuf
);
5960 vty_out(vty
, " State Timer : %s\n", statetimer
);
5965 static void ip_msdp_show_sa_detail(struct pim_instance
*pim
, struct vty
*vty
,
5968 struct listnode
*sanode
;
5969 struct pim_msdp_sa
*sa
;
5970 json_object
*json
= NULL
;
5973 json
= json_object_new_object();
5976 for (ALL_LIST_ELEMENTS_RO(pim
->msdp
.sa_list
, sanode
, sa
)) {
5977 char src_str
[PIM_ADDRSTRLEN
];
5978 char grp_str
[PIM_ADDRSTRLEN
];
5980 snprintfrr(grp_str
, sizeof(grp_str
), "%pPAs", &sa
->sg
.grp
);
5981 snprintfrr(src_str
, sizeof(src_str
), "%pPAs", &sa
->sg
.src
);
5983 ip_msdp_show_sa_entry_detail(sa
, src_str
, grp_str
, vty
, uj
,
5988 vty_json(vty
, json
);
5991 DEFUN (show_ip_msdp_sa_detail
,
5992 show_ip_msdp_sa_detail_cmd
,
5993 "show ip msdp [vrf NAME] sa detail [json]",
5998 "MSDP active-source information\n"
6002 bool uj
= use_json(argc
, argv
);
6004 struct vrf
*vrf
= pim_cmd_lookup_vrf(vty
, argv
, argc
, &idx
);
6009 ip_msdp_show_sa_detail(vrf
->info
, vty
, uj
);
6014 DEFUN (show_ip_msdp_sa_detail_vrf_all
,
6015 show_ip_msdp_sa_detail_vrf_all_cmd
,
6016 "show ip msdp vrf all sa detail [json]",
6021 "MSDP active-source information\n"
6025 bool uj
= use_json(argc
, argv
);
6031 RB_FOREACH (vrf
, vrf_name_head
, &vrfs_by_name
) {
6035 vty_out(vty
, " \"%s\": ", vrf
->name
);
6038 vty_out(vty
, "VRF: %s\n", vrf
->name
);
6039 ip_msdp_show_sa_detail(vrf
->info
, vty
, uj
);
6042 vty_out(vty
, "}\n");
6047 static void ip_msdp_show_sa_addr(struct pim_instance
*pim
, struct vty
*vty
,
6048 const char *addr
, bool uj
)
6050 struct listnode
*sanode
;
6051 struct pim_msdp_sa
*sa
;
6052 json_object
*json
= NULL
;
6055 json
= json_object_new_object();
6058 for (ALL_LIST_ELEMENTS_RO(pim
->msdp
.sa_list
, sanode
, sa
)) {
6059 char src_str
[PIM_ADDRSTRLEN
];
6060 char grp_str
[PIM_ADDRSTRLEN
];
6062 snprintfrr(grp_str
, sizeof(grp_str
), "%pPAs", &sa
->sg
.grp
);
6063 snprintfrr(src_str
, sizeof(src_str
), "%pPAs", &sa
->sg
.src
);
6065 if (!strcmp(addr
, src_str
) || !strcmp(addr
, grp_str
)) {
6066 ip_msdp_show_sa_entry_detail(sa
, src_str
, grp_str
, vty
,
6072 vty_json(vty
, json
);
6075 static void ip_msdp_show_sa_sg(struct pim_instance
*pim
, struct vty
*vty
,
6076 const char *src
, const char *grp
, bool uj
)
6078 struct listnode
*sanode
;
6079 struct pim_msdp_sa
*sa
;
6080 json_object
*json
= NULL
;
6083 json
= json_object_new_object();
6086 for (ALL_LIST_ELEMENTS_RO(pim
->msdp
.sa_list
, sanode
, sa
)) {
6087 char src_str
[PIM_ADDRSTRLEN
];
6088 char grp_str
[PIM_ADDRSTRLEN
];
6090 snprintfrr(grp_str
, sizeof(grp_str
), "%pPAs", &sa
->sg
.grp
);
6091 snprintfrr(src_str
, sizeof(src_str
), "%pPAs", &sa
->sg
.src
);
6093 if (!strcmp(src
, src_str
) && !strcmp(grp
, grp_str
)) {
6094 ip_msdp_show_sa_entry_detail(sa
, src_str
, grp_str
, vty
,
6100 vty_json(vty
, json
);
6103 DEFUN (show_ip_msdp_sa_sg
,
6104 show_ip_msdp_sa_sg_cmd
,
6105 "show ip msdp [vrf NAME] sa [A.B.C.D [A.B.C.D]] [json]",
6110 "MSDP active-source information\n"
6111 "source or group ip\n"
6115 bool uj
= use_json(argc
, argv
);
6119 vrf
= pim_cmd_lookup_vrf(vty
, argv
, argc
, &idx
);
6124 char *src_ip
= argv_find(argv
, argc
, "A.B.C.D", &idx
) ? argv
[idx
++]->arg
6126 char *grp_ip
= idx
< argc
&& argv_find(argv
, argc
, "A.B.C.D", &idx
)
6130 if (src_ip
&& grp_ip
)
6131 ip_msdp_show_sa_sg(vrf
->info
, vty
, src_ip
, grp_ip
, uj
);
6133 ip_msdp_show_sa_addr(vrf
->info
, vty
, src_ip
, uj
);
6135 ip_msdp_show_sa(vrf
->info
, vty
, uj
);
6140 DEFUN (show_ip_msdp_sa_sg_vrf_all
,
6141 show_ip_msdp_sa_sg_vrf_all_cmd
,
6142 "show ip msdp vrf all sa [A.B.C.D [A.B.C.D]] [json]",
6147 "MSDP active-source information\n"
6148 "source or group ip\n"
6152 bool uj
= use_json(argc
, argv
);
6157 char *src_ip
= argv_find(argv
, argc
, "A.B.C.D", &idx
) ? argv
[idx
++]->arg
6159 char *grp_ip
= idx
< argc
&& argv_find(argv
, argc
, "A.B.C.D", &idx
)
6165 RB_FOREACH (vrf
, vrf_name_head
, &vrfs_by_name
) {
6169 vty_out(vty
, " \"%s\": ", vrf
->name
);
6172 vty_out(vty
, "VRF: %s\n", vrf
->name
);
6174 if (src_ip
&& grp_ip
)
6175 ip_msdp_show_sa_sg(vrf
->info
, vty
, src_ip
, grp_ip
, uj
);
6177 ip_msdp_show_sa_addr(vrf
->info
, vty
, src_ip
, uj
);
6179 ip_msdp_show_sa(vrf
->info
, vty
, uj
);
6182 vty_out(vty
, "}\n");
6187 struct pim_sg_cache_walk_data
{
6190 json_object
*json_group
;
6191 struct in_addr addr
;
6195 static void pim_show_vxlan_sg_entry(struct pim_vxlan_sg
*vxlan_sg
,
6196 struct pim_sg_cache_walk_data
*cwd
)
6198 struct vty
*vty
= cwd
->vty
;
6199 json_object
*json
= cwd
->json
;
6200 json_object
*json_row
;
6201 bool installed
= (vxlan_sg
->up
) ? true : false;
6202 const char *iif_name
= vxlan_sg
->iif
?vxlan_sg
->iif
->name
:"-";
6203 const char *oif_name
;
6205 if (pim_vxlan_is_orig_mroute(vxlan_sg
))
6206 oif_name
= vxlan_sg
->orig_oif
?vxlan_sg
->orig_oif
->name
:"";
6208 oif_name
= vxlan_sg
->term_oif
?vxlan_sg
->term_oif
->name
:"";
6210 if (cwd
->addr_match
&& pim_addr_cmp(vxlan_sg
->sg
.src
, cwd
->addr
) &&
6211 pim_addr_cmp(vxlan_sg
->sg
.grp
, cwd
->addr
)) {
6215 char src_str
[PIM_ADDRSTRLEN
];
6216 char grp_str
[PIM_ADDRSTRLEN
];
6218 snprintfrr(grp_str
, sizeof(grp_str
), "%pPAs",
6220 snprintfrr(src_str
, sizeof(src_str
), "%pPAs",
6223 json_object_object_get_ex(json
, grp_str
, &cwd
->json_group
);
6225 if (!cwd
->json_group
) {
6226 cwd
->json_group
= json_object_new_object();
6227 json_object_object_add(json
, grp_str
,
6231 json_row
= json_object_new_object();
6232 json_object_string_add(json_row
, "source", src_str
);
6233 json_object_string_add(json_row
, "group", grp_str
);
6234 json_object_string_add(json_row
, "input", iif_name
);
6235 json_object_string_add(json_row
, "output", oif_name
);
6237 json_object_boolean_true_add(json_row
, "installed");
6239 json_object_boolean_false_add(json_row
, "installed");
6240 json_object_object_add(cwd
->json_group
, src_str
, json_row
);
6242 vty_out(vty
, "%-15pPAs %-15pPAs %-15s %-15s %-5s\n",
6243 &vxlan_sg
->sg
.src
, &vxlan_sg
->sg
.grp
, iif_name
,
6244 oif_name
, installed
? "I" : "");
6248 static void pim_show_vxlan_sg_hash_entry(struct hash_bucket
*bucket
, void *arg
)
6250 pim_show_vxlan_sg_entry((struct pim_vxlan_sg
*)bucket
->data
,
6251 (struct pim_sg_cache_walk_data
*)arg
);
6254 static void pim_show_vxlan_sg(struct pim_instance
*pim
,
6255 struct vty
*vty
, bool uj
)
6257 json_object
*json
= NULL
;
6258 struct pim_sg_cache_walk_data cwd
;
6261 json
= json_object_new_object();
6263 vty_out(vty
, "Codes: I -> installed\n");
6265 "Source Group Input Output Flags\n");
6268 memset(&cwd
, 0, sizeof(cwd
));
6271 hash_iterate(pim
->vxlan
.sg_hash
, pim_show_vxlan_sg_hash_entry
, &cwd
);
6274 vty_json(vty
, json
);
6277 static void pim_show_vxlan_sg_match_addr(struct pim_instance
*pim
,
6278 struct vty
*vty
, char *addr_str
,
6281 json_object
*json
= NULL
;
6282 struct pim_sg_cache_walk_data cwd
;
6285 memset(&cwd
, 0, sizeof(cwd
));
6286 result
= inet_pton(AF_INET
, addr_str
, &cwd
.addr
);
6288 vty_out(vty
, "Bad address %s: errno=%d: %s\n", addr_str
,
6289 errno
, safe_strerror(errno
));
6294 json
= json_object_new_object();
6296 vty_out(vty
, "Codes: I -> installed\n");
6298 "Source Group Input Output Flags\n");
6303 cwd
.addr_match
= true;
6304 hash_iterate(pim
->vxlan
.sg_hash
, pim_show_vxlan_sg_hash_entry
, &cwd
);
6307 vty_json(vty
, json
);
6310 static void pim_show_vxlan_sg_one(struct pim_instance
*pim
,
6311 struct vty
*vty
, char *src_str
, char *grp_str
,
6314 json_object
*json
= NULL
;
6317 struct pim_vxlan_sg
*vxlan_sg
;
6318 const char *iif_name
;
6320 const char *oif_name
;
6322 result
= inet_pton(AF_INET
, src_str
, &sg
.src
);
6324 vty_out(vty
, "Bad src address %s: errno=%d: %s\n", src_str
,
6325 errno
, safe_strerror(errno
));
6328 result
= inet_pton(AF_INET
, grp_str
, &sg
.grp
);
6330 vty_out(vty
, "Bad grp address %s: errno=%d: %s\n", grp_str
,
6331 errno
, safe_strerror(errno
));
6336 json
= json_object_new_object();
6338 vxlan_sg
= pim_vxlan_sg_find(pim
, &sg
);
6340 installed
= (vxlan_sg
->up
) ? true : false;
6341 iif_name
= vxlan_sg
->iif
?vxlan_sg
->iif
->name
:"-";
6343 if (pim_vxlan_is_orig_mroute(vxlan_sg
))
6345 vxlan_sg
->orig_oif
?vxlan_sg
->orig_oif
->name
:"";
6348 vxlan_sg
->term_oif
?vxlan_sg
->term_oif
->name
:"";
6351 json_object_string_add(json
, "source", src_str
);
6352 json_object_string_add(json
, "group", grp_str
);
6353 json_object_string_add(json
, "input", iif_name
);
6354 json_object_string_add(json
, "output", oif_name
);
6356 json_object_boolean_true_add(json
, "installed");
6358 json_object_boolean_false_add(json
,
6361 vty_out(vty
, "SG : %s\n", vxlan_sg
->sg_str
);
6362 vty_out(vty
, " Input : %s\n", iif_name
);
6363 vty_out(vty
, " Output : %s\n", oif_name
);
6364 vty_out(vty
, " installed : %s\n",
6365 installed
?"yes":"no");
6370 vty_json(vty
, json
);
6373 DEFUN (show_ip_pim_vxlan_sg
,
6374 show_ip_pim_vxlan_sg_cmd
,
6375 "show ip pim [vrf NAME] vxlan-groups [A.B.C.D [A.B.C.D]] [json]",
6380 "VxLAN BUM groups\n"
6381 "source or group ip\n"
6385 bool uj
= use_json(argc
, argv
);
6389 vrf
= pim_cmd_lookup_vrf(vty
, argv
, argc
, &idx
);
6394 char *src_ip
= argv_find(argv
, argc
, "A.B.C.D", &idx
) ?
6395 argv
[idx
++]->arg
:NULL
;
6396 char *grp_ip
= idx
< argc
&& argv_find(argv
, argc
, "A.B.C.D", &idx
) ?
6397 argv
[idx
]->arg
:NULL
;
6399 if (src_ip
&& grp_ip
)
6400 pim_show_vxlan_sg_one(vrf
->info
, vty
, src_ip
, grp_ip
, uj
);
6402 pim_show_vxlan_sg_match_addr(vrf
->info
, vty
, src_ip
, uj
);
6404 pim_show_vxlan_sg(vrf
->info
, vty
, uj
);
6409 static void pim_show_vxlan_sg_work(struct pim_instance
*pim
,
6410 struct vty
*vty
, bool uj
)
6412 json_object
*json
= NULL
;
6413 struct pim_sg_cache_walk_data cwd
;
6414 struct listnode
*node
;
6415 struct pim_vxlan_sg
*vxlan_sg
;
6418 json
= json_object_new_object();
6420 vty_out(vty
, "Codes: I -> installed\n");
6422 "Source Group Input Flags\n");
6425 memset(&cwd
, 0, sizeof(cwd
));
6428 for (ALL_LIST_ELEMENTS_RO(pim_vxlan_p
->work_list
, node
, vxlan_sg
))
6429 pim_show_vxlan_sg_entry(vxlan_sg
, &cwd
);
6432 vty_json(vty
, json
);
6435 DEFUN_HIDDEN (show_ip_pim_vxlan_sg_work
,
6436 show_ip_pim_vxlan_sg_work_cmd
,
6437 "show ip pim [vrf NAME] vxlan-work [json]",
6445 bool uj
= use_json(argc
, argv
);
6449 vrf
= pim_cmd_lookup_vrf(vty
, argv
, argc
, &idx
);
6454 pim_show_vxlan_sg_work(vrf
->info
, vty
, uj
);
6459 DEFUN_HIDDEN (no_ip_pim_mlag
,
6467 char mlag_xpath
[XPATH_MAXLEN
];
6469 snprintf(mlag_xpath
, sizeof(mlag_xpath
), FRR_PIM_VRF_XPATH
,
6470 "frr-pim:pimd", "pim", "default", "frr-routing:ipv4");
6471 strlcat(mlag_xpath
, "/mlag", sizeof(mlag_xpath
));
6473 nb_cli_enqueue_change(vty
, mlag_xpath
, NB_OP_DESTROY
, NULL
);
6476 return nb_cli_apply_changes(vty
, NULL
);
6479 DEFUN_HIDDEN (ip_pim_mlag
,
6481 "ip pim mlag INTERFACE role [primary|secondary] state [up|down] addr A.B.C.D",
6485 "peerlink sub interface\n"
6487 "MLAG role primary\n"
6488 "MLAG role secondary\n"
6489 "peer session state\n"
6490 "peer session state up\n"
6491 "peer session state down\n"
6493 "unique ip address\n")
6496 char mlag_peerlink_rif_xpath
[XPATH_MAXLEN
];
6497 char mlag_my_role_xpath
[XPATH_MAXLEN
];
6498 char mlag_peer_state_xpath
[XPATH_MAXLEN
];
6499 char mlag_reg_address_xpath
[XPATH_MAXLEN
];
6501 snprintf(mlag_peerlink_rif_xpath
, sizeof(mlag_peerlink_rif_xpath
),
6503 "frr-pim:pimd", "pim", "default", "frr-routing:ipv4");
6504 strlcat(mlag_peerlink_rif_xpath
, "/mlag/peerlink-rif",
6505 sizeof(mlag_peerlink_rif_xpath
));
6508 nb_cli_enqueue_change(vty
, mlag_peerlink_rif_xpath
, NB_OP_MODIFY
,
6511 snprintf(mlag_my_role_xpath
, sizeof(mlag_my_role_xpath
),
6513 "frr-pim:pimd", "pim", "default", "frr-routing:ipv4");
6514 strlcat(mlag_my_role_xpath
, "/mlag/my-role",
6515 sizeof(mlag_my_role_xpath
));
6518 if (!strcmp(argv
[idx
]->arg
, "primary")) {
6519 nb_cli_enqueue_change(vty
, mlag_my_role_xpath
, NB_OP_MODIFY
,
6520 "MLAG_ROLE_PRIMARY");
6522 } else if (!strcmp(argv
[idx
]->arg
, "secondary")) {
6523 nb_cli_enqueue_change(vty
, mlag_my_role_xpath
, NB_OP_MODIFY
,
6524 "MLAG_ROLE_SECONDARY");
6527 vty_out(vty
, "unknown MLAG role %s\n", argv
[idx
]->arg
);
6531 snprintf(mlag_peer_state_xpath
, sizeof(mlag_peer_state_xpath
),
6533 "frr-pim:pimd", "pim", "default", "frr-routing:ipv4");
6534 strlcat(mlag_peer_state_xpath
, "/mlag/peer-state",
6535 sizeof(mlag_peer_state_xpath
));
6538 if (!strcmp(argv
[idx
]->arg
, "up")) {
6539 nb_cli_enqueue_change(vty
, mlag_peer_state_xpath
, NB_OP_MODIFY
,
6542 } else if (strcmp(argv
[idx
]->arg
, "down")) {
6543 nb_cli_enqueue_change(vty
, mlag_peer_state_xpath
, NB_OP_MODIFY
,
6547 vty_out(vty
, "unknown MLAG state %s\n", argv
[idx
]->arg
);
6551 snprintf(mlag_reg_address_xpath
, sizeof(mlag_reg_address_xpath
),
6553 "frr-pim:pimd", "pim", "default", "frr-routing:ipv4");
6554 strlcat(mlag_reg_address_xpath
, "/mlag/reg-address",
6555 sizeof(mlag_reg_address_xpath
));
6558 nb_cli_enqueue_change(vty
, mlag_reg_address_xpath
, NB_OP_MODIFY
,
6561 return nb_cli_apply_changes(vty
, NULL
);
6564 void pim_cmd_init(void)
6566 if_cmd_init(pim_interface_config_write
);
6568 install_node(&debug_node
);
6570 install_element(ENABLE_NODE
, &pim_test_sg_keepalive_cmd
);
6572 install_element(CONFIG_NODE
, &ip_pim_rp_cmd
);
6573 install_element(VRF_NODE
, &ip_pim_rp_cmd
);
6574 install_element(CONFIG_NODE
, &no_ip_pim_rp_cmd
);
6575 install_element(VRF_NODE
, &no_ip_pim_rp_cmd
);
6576 install_element(CONFIG_NODE
, &ip_pim_rp_prefix_list_cmd
);
6577 install_element(VRF_NODE
, &ip_pim_rp_prefix_list_cmd
);
6578 install_element(CONFIG_NODE
, &no_ip_pim_rp_prefix_list_cmd
);
6579 install_element(VRF_NODE
, &no_ip_pim_rp_prefix_list_cmd
);
6580 install_element(CONFIG_NODE
, &no_ip_pim_ssm_prefix_list_cmd
);
6581 install_element(VRF_NODE
, &no_ip_pim_ssm_prefix_list_cmd
);
6582 install_element(CONFIG_NODE
, &no_ip_pim_ssm_prefix_list_name_cmd
);
6583 install_element(VRF_NODE
, &no_ip_pim_ssm_prefix_list_name_cmd
);
6584 install_element(CONFIG_NODE
, &ip_pim_ssm_prefix_list_cmd
);
6585 install_element(VRF_NODE
, &ip_pim_ssm_prefix_list_cmd
);
6586 install_element(CONFIG_NODE
, &ip_pim_register_suppress_cmd
);
6587 install_element(CONFIG_NODE
, &no_ip_pim_register_suppress_cmd
);
6588 install_element(CONFIG_NODE
, &ip_pim_spt_switchover_infinity_cmd
);
6589 install_element(VRF_NODE
, &ip_pim_spt_switchover_infinity_cmd
);
6590 install_element(CONFIG_NODE
, &ip_pim_spt_switchover_infinity_plist_cmd
);
6591 install_element(VRF_NODE
, &ip_pim_spt_switchover_infinity_plist_cmd
);
6592 install_element(CONFIG_NODE
, &no_ip_pim_spt_switchover_infinity_cmd
);
6593 install_element(VRF_NODE
, &no_ip_pim_spt_switchover_infinity_cmd
);
6594 install_element(CONFIG_NODE
,
6595 &no_ip_pim_spt_switchover_infinity_plist_cmd
);
6596 install_element(VRF_NODE
, &no_ip_pim_spt_switchover_infinity_plist_cmd
);
6597 install_element(CONFIG_NODE
, &pim_register_accept_list_cmd
);
6598 install_element(VRF_NODE
, &pim_register_accept_list_cmd
);
6599 install_element(CONFIG_NODE
, &ip_pim_joinprune_time_cmd
);
6600 install_element(CONFIG_NODE
, &no_ip_pim_joinprune_time_cmd
);
6601 install_element(CONFIG_NODE
, &ip_pim_keep_alive_cmd
);
6602 install_element(VRF_NODE
, &ip_pim_keep_alive_cmd
);
6603 install_element(CONFIG_NODE
, &ip_pim_rp_keep_alive_cmd
);
6604 install_element(VRF_NODE
, &ip_pim_rp_keep_alive_cmd
);
6605 install_element(CONFIG_NODE
, &no_ip_pim_keep_alive_cmd
);
6606 install_element(VRF_NODE
, &no_ip_pim_keep_alive_cmd
);
6607 install_element(CONFIG_NODE
, &no_ip_pim_rp_keep_alive_cmd
);
6608 install_element(VRF_NODE
, &no_ip_pim_rp_keep_alive_cmd
);
6609 install_element(CONFIG_NODE
, &ip_pim_packets_cmd
);
6610 install_element(CONFIG_NODE
, &no_ip_pim_packets_cmd
);
6611 install_element(CONFIG_NODE
, &ip_pim_v6_secondary_cmd
);
6612 install_element(VRF_NODE
, &ip_pim_v6_secondary_cmd
);
6613 install_element(CONFIG_NODE
, &no_ip_pim_v6_secondary_cmd
);
6614 install_element(VRF_NODE
, &no_ip_pim_v6_secondary_cmd
);
6615 install_element(CONFIG_NODE
, &ip_ssmpingd_cmd
);
6616 install_element(VRF_NODE
, &ip_ssmpingd_cmd
);
6617 install_element(CONFIG_NODE
, &no_ip_ssmpingd_cmd
);
6618 install_element(VRF_NODE
, &no_ip_ssmpingd_cmd
);
6619 install_element(CONFIG_NODE
, &ip_msdp_peer_cmd
);
6620 install_element(VRF_NODE
, &ip_msdp_peer_cmd
);
6621 install_element(CONFIG_NODE
, &no_ip_msdp_peer_cmd
);
6622 install_element(VRF_NODE
, &no_ip_msdp_peer_cmd
);
6623 install_element(CONFIG_NODE
, &ip_pim_ecmp_cmd
);
6624 install_element(VRF_NODE
, &ip_pim_ecmp_cmd
);
6625 install_element(CONFIG_NODE
, &no_ip_pim_ecmp_cmd
);
6626 install_element(VRF_NODE
, &no_ip_pim_ecmp_cmd
);
6627 install_element(CONFIG_NODE
, &ip_pim_ecmp_rebalance_cmd
);
6628 install_element(VRF_NODE
, &ip_pim_ecmp_rebalance_cmd
);
6629 install_element(CONFIG_NODE
, &no_ip_pim_ecmp_rebalance_cmd
);
6630 install_element(VRF_NODE
, &no_ip_pim_ecmp_rebalance_cmd
);
6631 install_element(CONFIG_NODE
, &ip_pim_mlag_cmd
);
6632 install_element(CONFIG_NODE
, &no_ip_pim_mlag_cmd
);
6633 install_element(CONFIG_NODE
, &ip_igmp_group_watermark_cmd
);
6634 install_element(VRF_NODE
, &ip_igmp_group_watermark_cmd
);
6635 install_element(CONFIG_NODE
, &no_ip_igmp_group_watermark_cmd
);
6636 install_element(VRF_NODE
, &no_ip_igmp_group_watermark_cmd
);
6638 install_element(INTERFACE_NODE
, &interface_ip_igmp_cmd
);
6639 install_element(INTERFACE_NODE
, &interface_no_ip_igmp_cmd
);
6640 install_element(INTERFACE_NODE
, &interface_ip_igmp_join_cmd
);
6641 install_element(INTERFACE_NODE
, &interface_no_ip_igmp_join_cmd
);
6642 install_element(INTERFACE_NODE
, &interface_ip_igmp_version_cmd
);
6643 install_element(INTERFACE_NODE
, &interface_no_ip_igmp_version_cmd
);
6644 install_element(INTERFACE_NODE
, &interface_ip_igmp_query_interval_cmd
);
6645 install_element(INTERFACE_NODE
,
6646 &interface_no_ip_igmp_query_interval_cmd
);
6647 install_element(INTERFACE_NODE
,
6648 &interface_ip_igmp_query_max_response_time_cmd
);
6649 install_element(INTERFACE_NODE
,
6650 &interface_no_ip_igmp_query_max_response_time_cmd
);
6651 install_element(INTERFACE_NODE
,
6652 &interface_ip_igmp_query_max_response_time_dsec_cmd
);
6653 install_element(INTERFACE_NODE
,
6654 &interface_no_ip_igmp_query_max_response_time_dsec_cmd
);
6655 install_element(INTERFACE_NODE
,
6656 &interface_ip_igmp_last_member_query_count_cmd
);
6657 install_element(INTERFACE_NODE
,
6658 &interface_no_ip_igmp_last_member_query_count_cmd
);
6659 install_element(INTERFACE_NODE
,
6660 &interface_ip_igmp_last_member_query_interval_cmd
);
6661 install_element(INTERFACE_NODE
,
6662 &interface_no_ip_igmp_last_member_query_interval_cmd
);
6663 install_element(INTERFACE_NODE
, &interface_ip_pim_activeactive_cmd
);
6664 install_element(INTERFACE_NODE
, &interface_ip_pim_ssm_cmd
);
6665 install_element(INTERFACE_NODE
, &interface_no_ip_pim_ssm_cmd
);
6666 install_element(INTERFACE_NODE
, &interface_ip_pim_sm_cmd
);
6667 install_element(INTERFACE_NODE
, &interface_no_ip_pim_sm_cmd
);
6668 install_element(INTERFACE_NODE
, &interface_ip_pim_cmd
);
6669 install_element(INTERFACE_NODE
, &interface_no_ip_pim_cmd
);
6670 install_element(INTERFACE_NODE
, &interface_ip_pim_drprio_cmd
);
6671 install_element(INTERFACE_NODE
, &interface_no_ip_pim_drprio_cmd
);
6672 install_element(INTERFACE_NODE
, &interface_ip_pim_hello_cmd
);
6673 install_element(INTERFACE_NODE
, &interface_no_ip_pim_hello_cmd
);
6674 install_element(INTERFACE_NODE
, &interface_ip_pim_boundary_oil_cmd
);
6675 install_element(INTERFACE_NODE
, &interface_no_ip_pim_boundary_oil_cmd
);
6676 install_element(INTERFACE_NODE
, &interface_ip_igmp_query_generate_cmd
);
6678 // Static mroutes NEB
6679 install_element(INTERFACE_NODE
, &interface_ip_mroute_cmd
);
6680 install_element(INTERFACE_NODE
, &interface_no_ip_mroute_cmd
);
6682 install_element(VIEW_NODE
, &show_ip_igmp_interface_cmd
);
6683 install_element(VIEW_NODE
, &show_ip_igmp_interface_vrf_all_cmd
);
6684 install_element(VIEW_NODE
, &show_ip_igmp_join_cmd
);
6685 install_element(VIEW_NODE
, &show_ip_igmp_join_vrf_all_cmd
);
6686 install_element(VIEW_NODE
, &show_ip_igmp_groups_cmd
);
6687 install_element(VIEW_NODE
, &show_ip_igmp_groups_vrf_all_cmd
);
6688 install_element(VIEW_NODE
, &show_ip_igmp_groups_retransmissions_cmd
);
6689 install_element(VIEW_NODE
, &show_ip_igmp_sources_cmd
);
6690 install_element(VIEW_NODE
, &show_ip_igmp_sources_retransmissions_cmd
);
6691 install_element(VIEW_NODE
, &show_ip_igmp_statistics_cmd
);
6692 install_element(VIEW_NODE
, &show_ip_pim_assert_cmd
);
6693 install_element(VIEW_NODE
, &show_ip_pim_assert_internal_cmd
);
6694 install_element(VIEW_NODE
, &show_ip_pim_assert_metric_cmd
);
6695 install_element(VIEW_NODE
, &show_ip_pim_assert_winner_metric_cmd
);
6696 install_element(VIEW_NODE
, &show_ip_pim_interface_traffic_cmd
);
6697 install_element(VIEW_NODE
, &show_ip_pim_interface_cmd
);
6698 install_element(VIEW_NODE
, &show_ip_pim_interface_vrf_all_cmd
);
6699 install_element(VIEW_NODE
, &show_ip_pim_join_cmd
);
6700 install_element(VIEW_NODE
, &show_ip_pim_join_vrf_all_cmd
);
6701 install_element(VIEW_NODE
, &show_ip_pim_jp_agg_cmd
);
6702 install_element(VIEW_NODE
, &show_ip_pim_local_membership_cmd
);
6703 install_element(VIEW_NODE
, &show_ip_pim_mlag_summary_cmd
);
6704 install_element(VIEW_NODE
, &show_ip_pim_mlag_up_cmd
);
6705 install_element(VIEW_NODE
, &show_ip_pim_mlag_up_vrf_all_cmd
);
6706 install_element(VIEW_NODE
, &show_ip_pim_neighbor_cmd
);
6707 install_element(VIEW_NODE
, &show_ip_pim_neighbor_vrf_all_cmd
);
6708 install_element(VIEW_NODE
, &show_ip_pim_rpf_cmd
);
6709 install_element(VIEW_NODE
, &show_ip_pim_rpf_vrf_all_cmd
);
6710 install_element(VIEW_NODE
, &show_ip_pim_secondary_cmd
);
6711 install_element(VIEW_NODE
, &show_ip_pim_state_cmd
);
6712 install_element(VIEW_NODE
, &show_ip_pim_state_vrf_all_cmd
);
6713 install_element(VIEW_NODE
, &show_ip_pim_upstream_cmd
);
6714 install_element(VIEW_NODE
, &show_ip_pim_upstream_vrf_all_cmd
);
6715 install_element(VIEW_NODE
, &show_ip_pim_channel_cmd
);
6716 install_element(VIEW_NODE
, &show_ip_pim_upstream_join_desired_cmd
);
6717 install_element(VIEW_NODE
, &show_ip_pim_upstream_rpf_cmd
);
6718 install_element(VIEW_NODE
, &show_ip_pim_rp_cmd
);
6719 install_element(VIEW_NODE
, &show_ip_pim_rp_vrf_all_cmd
);
6720 install_element(VIEW_NODE
, &show_ip_pim_bsr_cmd
);
6721 install_element(VIEW_NODE
, &show_ip_multicast_cmd
);
6722 install_element(VIEW_NODE
, &show_ip_multicast_vrf_all_cmd
);
6723 install_element(VIEW_NODE
, &show_ip_multicast_count_cmd
);
6724 install_element(VIEW_NODE
, &show_ip_multicast_count_vrf_all_cmd
);
6725 install_element(VIEW_NODE
, &show_ip_mroute_cmd
);
6726 install_element(VIEW_NODE
, &show_ip_mroute_vrf_all_cmd
);
6727 install_element(VIEW_NODE
, &show_ip_mroute_count_cmd
);
6728 install_element(VIEW_NODE
, &show_ip_mroute_count_vrf_all_cmd
);
6729 install_element(VIEW_NODE
, &show_ip_mroute_summary_cmd
);
6730 install_element(VIEW_NODE
, &show_ip_mroute_summary_vrf_all_cmd
);
6731 install_element(VIEW_NODE
, &show_ip_rib_cmd
);
6732 install_element(VIEW_NODE
, &show_ip_ssmpingd_cmd
);
6733 install_element(VIEW_NODE
, &show_ip_pim_nexthop_cmd
);
6734 install_element(VIEW_NODE
, &show_ip_pim_nexthop_lookup_cmd
);
6735 install_element(VIEW_NODE
, &show_ip_pim_bsrp_cmd
);
6736 install_element(VIEW_NODE
, &show_ip_pim_bsm_db_cmd
);
6737 install_element(VIEW_NODE
, &show_ip_pim_statistics_cmd
);
6739 install_element(ENABLE_NODE
, &clear_ip_mroute_count_cmd
);
6740 install_element(ENABLE_NODE
, &clear_ip_interfaces_cmd
);
6741 install_element(ENABLE_NODE
, &clear_ip_igmp_interfaces_cmd
);
6742 install_element(ENABLE_NODE
, &clear_ip_mroute_cmd
);
6743 install_element(ENABLE_NODE
, &clear_ip_pim_interfaces_cmd
);
6744 install_element(ENABLE_NODE
, &clear_ip_pim_interface_traffic_cmd
);
6745 install_element(ENABLE_NODE
, &clear_ip_pim_oil_cmd
);
6746 install_element(ENABLE_NODE
, &clear_ip_pim_statistics_cmd
);
6747 install_element(ENABLE_NODE
, &clear_ip_pim_bsr_db_cmd
);
6749 install_element(ENABLE_NODE
, &show_debugging_pim_cmd
);
6751 install_element(ENABLE_NODE
, &debug_igmp_cmd
);
6752 install_element(ENABLE_NODE
, &no_debug_igmp_cmd
);
6753 install_element(ENABLE_NODE
, &debug_igmp_events_cmd
);
6754 install_element(ENABLE_NODE
, &no_debug_igmp_events_cmd
);
6755 install_element(ENABLE_NODE
, &debug_igmp_packets_cmd
);
6756 install_element(ENABLE_NODE
, &no_debug_igmp_packets_cmd
);
6757 install_element(ENABLE_NODE
, &debug_igmp_trace_cmd
);
6758 install_element(ENABLE_NODE
, &no_debug_igmp_trace_cmd
);
6759 install_element(ENABLE_NODE
, &debug_igmp_trace_detail_cmd
);
6760 install_element(ENABLE_NODE
, &no_debug_igmp_trace_detail_cmd
);
6761 install_element(ENABLE_NODE
, &debug_mroute_cmd
);
6762 install_element(ENABLE_NODE
, &debug_mroute_detail_cmd
);
6763 install_element(ENABLE_NODE
, &no_debug_mroute_cmd
);
6764 install_element(ENABLE_NODE
, &no_debug_mroute_detail_cmd
);
6765 install_element(ENABLE_NODE
, &debug_pim_static_cmd
);
6766 install_element(ENABLE_NODE
, &no_debug_pim_static_cmd
);
6767 install_element(ENABLE_NODE
, &debug_pim_cmd
);
6768 install_element(ENABLE_NODE
, &debug_pim_nht_cmd
);
6769 install_element(ENABLE_NODE
, &debug_pim_nht_det_cmd
);
6770 install_element(ENABLE_NODE
, &debug_pim_nht_rp_cmd
);
6771 install_element(ENABLE_NODE
, &no_debug_pim_nht_rp_cmd
);
6772 install_element(ENABLE_NODE
, &debug_pim_events_cmd
);
6773 install_element(ENABLE_NODE
, &debug_pim_packets_cmd
);
6774 install_element(ENABLE_NODE
, &debug_pim_packetdump_send_cmd
);
6775 install_element(ENABLE_NODE
, &debug_pim_packetdump_recv_cmd
);
6776 install_element(ENABLE_NODE
, &debug_pim_trace_cmd
);
6777 install_element(ENABLE_NODE
, &debug_pim_trace_detail_cmd
);
6778 install_element(ENABLE_NODE
, &debug_ssmpingd_cmd
);
6779 install_element(ENABLE_NODE
, &no_debug_ssmpingd_cmd
);
6780 install_element(ENABLE_NODE
, &debug_pim_zebra_cmd
);
6781 install_element(ENABLE_NODE
, &debug_pim_mlag_cmd
);
6782 install_element(ENABLE_NODE
, &no_debug_pim_mlag_cmd
);
6783 install_element(ENABLE_NODE
, &debug_pim_vxlan_cmd
);
6784 install_element(ENABLE_NODE
, &no_debug_pim_vxlan_cmd
);
6785 install_element(ENABLE_NODE
, &debug_msdp_cmd
);
6786 install_element(ENABLE_NODE
, &no_debug_msdp_cmd
);
6787 install_element(ENABLE_NODE
, &debug_msdp_events_cmd
);
6788 install_element(ENABLE_NODE
, &no_debug_msdp_events_cmd
);
6789 install_element(ENABLE_NODE
, &debug_msdp_packets_cmd
);
6790 install_element(ENABLE_NODE
, &no_debug_msdp_packets_cmd
);
6791 install_element(ENABLE_NODE
, &debug_mtrace_cmd
);
6792 install_element(ENABLE_NODE
, &no_debug_mtrace_cmd
);
6793 install_element(ENABLE_NODE
, &debug_bsm_cmd
);
6794 install_element(ENABLE_NODE
, &no_debug_bsm_cmd
);
6796 install_element(CONFIG_NODE
, &debug_igmp_cmd
);
6797 install_element(CONFIG_NODE
, &no_debug_igmp_cmd
);
6798 install_element(CONFIG_NODE
, &debug_igmp_events_cmd
);
6799 install_element(CONFIG_NODE
, &no_debug_igmp_events_cmd
);
6800 install_element(CONFIG_NODE
, &debug_igmp_packets_cmd
);
6801 install_element(CONFIG_NODE
, &no_debug_igmp_packets_cmd
);
6802 install_element(CONFIG_NODE
, &debug_igmp_trace_cmd
);
6803 install_element(CONFIG_NODE
, &no_debug_igmp_trace_cmd
);
6804 install_element(CONFIG_NODE
, &debug_igmp_trace_detail_cmd
);
6805 install_element(CONFIG_NODE
, &no_debug_igmp_trace_detail_cmd
);
6806 install_element(CONFIG_NODE
, &debug_mroute_cmd
);
6807 install_element(CONFIG_NODE
, &debug_mroute_detail_cmd
);
6808 install_element(CONFIG_NODE
, &no_debug_mroute_cmd
);
6809 install_element(CONFIG_NODE
, &no_debug_mroute_detail_cmd
);
6810 install_element(CONFIG_NODE
, &debug_pim_static_cmd
);
6811 install_element(CONFIG_NODE
, &no_debug_pim_static_cmd
);
6812 install_element(CONFIG_NODE
, &debug_pim_cmd
);
6813 install_element(CONFIG_NODE
, &debug_pim_nht_cmd
);
6814 install_element(CONFIG_NODE
, &debug_pim_nht_det_cmd
);
6815 install_element(CONFIG_NODE
, &debug_pim_nht_rp_cmd
);
6816 install_element(CONFIG_NODE
, &no_debug_pim_nht_rp_cmd
);
6817 install_element(CONFIG_NODE
, &debug_pim_events_cmd
);
6818 install_element(CONFIG_NODE
, &debug_pim_packets_cmd
);
6819 install_element(CONFIG_NODE
, &debug_pim_packetdump_send_cmd
);
6820 install_element(CONFIG_NODE
, &debug_pim_packetdump_recv_cmd
);
6821 install_element(CONFIG_NODE
, &debug_pim_trace_cmd
);
6822 install_element(CONFIG_NODE
, &debug_pim_trace_detail_cmd
);
6823 install_element(CONFIG_NODE
, &debug_ssmpingd_cmd
);
6824 install_element(CONFIG_NODE
, &no_debug_ssmpingd_cmd
);
6825 install_element(CONFIG_NODE
, &debug_pim_zebra_cmd
);
6826 install_element(CONFIG_NODE
, &debug_pim_mlag_cmd
);
6827 install_element(CONFIG_NODE
, &no_debug_pim_mlag_cmd
);
6828 install_element(CONFIG_NODE
, &debug_pim_vxlan_cmd
);
6829 install_element(CONFIG_NODE
, &no_debug_pim_vxlan_cmd
);
6830 install_element(CONFIG_NODE
, &debug_msdp_cmd
);
6831 install_element(CONFIG_NODE
, &no_debug_msdp_cmd
);
6832 install_element(CONFIG_NODE
, &debug_msdp_events_cmd
);
6833 install_element(CONFIG_NODE
, &no_debug_msdp_events_cmd
);
6834 install_element(CONFIG_NODE
, &debug_msdp_packets_cmd
);
6835 install_element(CONFIG_NODE
, &no_debug_msdp_packets_cmd
);
6836 install_element(CONFIG_NODE
, &debug_mtrace_cmd
);
6837 install_element(CONFIG_NODE
, &no_debug_mtrace_cmd
);
6838 install_element(CONFIG_NODE
, &debug_bsm_cmd
);
6839 install_element(CONFIG_NODE
, &no_debug_bsm_cmd
);
6841 install_element(CONFIG_NODE
, &ip_msdp_timers_cmd
);
6842 install_element(VRF_NODE
, &ip_msdp_timers_cmd
);
6843 install_element(CONFIG_NODE
, &no_ip_msdp_timers_cmd
);
6844 install_element(VRF_NODE
, &no_ip_msdp_timers_cmd
);
6845 install_element(CONFIG_NODE
, &ip_msdp_mesh_group_member_cmd
);
6846 install_element(VRF_NODE
, &ip_msdp_mesh_group_member_cmd
);
6847 install_element(CONFIG_NODE
, &no_ip_msdp_mesh_group_member_cmd
);
6848 install_element(VRF_NODE
, &no_ip_msdp_mesh_group_member_cmd
);
6849 install_element(CONFIG_NODE
, &ip_msdp_mesh_group_source_cmd
);
6850 install_element(VRF_NODE
, &ip_msdp_mesh_group_source_cmd
);
6851 install_element(CONFIG_NODE
, &no_ip_msdp_mesh_group_source_cmd
);
6852 install_element(VRF_NODE
, &no_ip_msdp_mesh_group_source_cmd
);
6853 install_element(CONFIG_NODE
, &no_ip_msdp_mesh_group_cmd
);
6854 install_element(VRF_NODE
, &no_ip_msdp_mesh_group_cmd
);
6855 install_element(VIEW_NODE
, &show_ip_msdp_peer_detail_cmd
);
6856 install_element(VIEW_NODE
, &show_ip_msdp_peer_detail_vrf_all_cmd
);
6857 install_element(VIEW_NODE
, &show_ip_msdp_sa_detail_cmd
);
6858 install_element(VIEW_NODE
, &show_ip_msdp_sa_detail_vrf_all_cmd
);
6859 install_element(VIEW_NODE
, &show_ip_msdp_sa_sg_cmd
);
6860 install_element(VIEW_NODE
, &show_ip_msdp_sa_sg_vrf_all_cmd
);
6861 install_element(VIEW_NODE
, &show_ip_msdp_mesh_group_cmd
);
6862 install_element(VIEW_NODE
, &show_ip_msdp_mesh_group_vrf_all_cmd
);
6863 install_element(VIEW_NODE
, &show_ip_pim_ssm_range_cmd
);
6864 install_element(VIEW_NODE
, &show_ip_pim_group_type_cmd
);
6865 install_element(VIEW_NODE
, &show_ip_pim_vxlan_sg_cmd
);
6866 install_element(VIEW_NODE
, &show_ip_pim_vxlan_sg_work_cmd
);
6867 install_element(INTERFACE_NODE
, &interface_pim_use_source_cmd
);
6868 install_element(INTERFACE_NODE
, &interface_no_pim_use_source_cmd
);
6869 /* Install BSM command */
6870 install_element(INTERFACE_NODE
, &ip_pim_bsm_cmd
);
6871 install_element(INTERFACE_NODE
, &no_ip_pim_bsm_cmd
);
6872 install_element(INTERFACE_NODE
, &ip_pim_ucast_bsm_cmd
);
6873 install_element(INTERFACE_NODE
, &no_ip_pim_ucast_bsm_cmd
);
6874 /* Install BFD command */
6875 install_element(INTERFACE_NODE
, &ip_pim_bfd_cmd
);
6876 install_element(INTERFACE_NODE
, &ip_pim_bfd_param_cmd
);
6877 install_element(INTERFACE_NODE
, &no_ip_pim_bfd_profile_cmd
);
6878 install_element(INTERFACE_NODE
, &no_ip_pim_bfd_cmd
);
6880 install_element(INTERFACE_NODE
, &no_ip_pim_bfd_param_cmd
);
6881 #endif /* !HAVE_BFDD */