#include "hash.h"
#include "nexthop.h"
#include "vrf.h"
+#include "ferr.h"
#include "pimd.h"
#include "pim_mroute.h"
if (!pim_ifp)
continue;
- RB_FOREACH(ch, pim_ifchannel_rb, &pim_ifp->ifchannel_rb) {
+ RB_FOREACH (ch, pim_ifchannel_rb, &pim_ifp->ifchannel_rb) {
pim_show_assert_helper(vty, pim_ifp, ch, now);
} /* scan interface channels */
}
if (!pim_ifp)
continue;
- RB_FOREACH(ch, pim_ifchannel_rb, &pim_ifp->ifchannel_rb) {
+ RB_FOREACH (ch, pim_ifchannel_rb, &pim_ifp->ifchannel_rb) {
pim_show_assert_internal_helper(vty, pim_ifp, ch);
} /* scan interface channels */
}
if (!pim_ifp)
continue;
- RB_FOREACH(ch, pim_ifchannel_rb, &pim_ifp->ifchannel_rb) {
+ RB_FOREACH (ch, pim_ifchannel_rb, &pim_ifp->ifchannel_rb) {
pim_show_assert_metric_helper(vty, pim_ifp, ch);
} /* scan interface channels */
}
if (!pim_ifp)
continue;
- RB_FOREACH(ch, pim_ifchannel_rb, &pim_ifp->ifchannel_rb) {
+ RB_FOREACH (ch, pim_ifchannel_rb, &pim_ifp->ifchannel_rb) {
pim_show_assert_winner_metric_helper(vty, pim_ifp, ch);
} /* scan interface channels */
}
if (!pim_ifp)
continue;
- RB_FOREACH(ch, pim_ifchannel_rb, &pim_ifp->ifchannel_rb) {
+ RB_FOREACH (ch, pim_ifchannel_rb, &pim_ifp->ifchannel_rb) {
pim_show_membership_helper(vty, pim_ifp, ch, json);
} /* scan interface channels */
}
if (!pim_ifp)
continue;
- RB_FOREACH(ch, pim_ifchannel_rb, &pim_ifp->ifchannel_rb) {
- pim_show_join_helper(vty, pim_ifp,
- ch, json, now, uj);
+ RB_FOREACH (ch, pim_ifchannel_rb, &pim_ifp->ifchannel_rb) {
+ pim_show_join_helper(vty, pim_ifp, ch, json, now, uj);
} /* scan interface channels */
}
continue;
- RB_FOREACH(ch, pim_ifchannel_rb, &pim_ifp->ifchannel_rb) {
+ RB_FOREACH (ch, pim_ifchannel_rb, &pim_ifp->ifchannel_rb) {
/* scan all interfaces */
pim_show_join_desired_helper(pim, vty,
pim_ifp, ch,
clear_pim_interfaces(pim);
}
+#define PIM_GET_PIM_INTERFACE(pim_ifp, ifp) \
+ pim_ifp = ifp->info; \
+ if (!pim_ifp) { \
+ vty_out(vty, \
+ "%% Enable PIM and/or IGMP on this interface first\n"); \
+ return CMD_WARNING_CONFIG_FAILED; \
+ }
+
DEFUN (clear_ip_interfaces,
clear_ip_interfaces_cmd,
"clear ip interfaces [vrf NAME]",
if (uj)
vty_out(vty, "{ ");
- RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name)
- {
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
if (uj) {
if (!first)
vty_out(vty, ", ");
if (uj)
vty_out(vty, "{ ");
- RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name)
- {
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
if (uj) {
if (!first)
vty_out(vty, ", ");
if (uj)
vty_out(vty, "{ ");
- RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name)
- {
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
if (uj) {
if (!first)
vty_out(vty, ", ");
if (uj)
vty_out(vty, "{ ");
- RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name)
- {
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
if (uj) {
if (!first)
vty_out(vty, ", ");
if (uj)
vty_out(vty, "{ ");
- RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name)
- {
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
if (uj) {
if (!first)
vty_out(vty, ", ");
if (uj)
vty_out(vty, "{ ");
- RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name)
- {
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
if (uj) {
if (!first)
vty_out(vty, ", ");
group = argv[idx + 1]->arg;
}
- RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name)
- {
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
if (uj) {
if (!first)
vty_out(vty, ", ");
if (uj)
vty_out(vty, "{ ");
- RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name)
- {
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
if (uj) {
if (!first)
vty_out(vty, ", ");
if (uj)
vty_out(vty, "{ ");
- RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name)
- {
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
if (uj) {
if (!first)
vty_out(vty, ", ");
if (uj)
vty_out(vty, "{ ");
- RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name)
- {
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
if (uj) {
if (!first)
vty_out(vty, ", ");
if (uj)
vty_out(vty, "{ ");
- RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name)
- {
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
if (uj) {
if (!first)
vty_out(vty, ", ");
if (uj)
vty_out(vty, "{ ");
- RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name)
- {
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
if (uj) {
if (!first)
vty_out(vty, ", ");
int idx = 2;
struct vrf *vrf = pim_cmd_lookup_vrf(vty, argv, argc, &idx);
+ if (!vrf)
+ return CMD_WARNING;
+
show_mroute_count(vrf->info, vty);
return CMD_SUCCESS;
}
if (uj)
vty_out(vty, "{ ");
- RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name)
- {
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
if (uj) {
if (!first)
vty_out(vty, ", ");
return CMD_WARNING_CONFIG_FAILED;
}
- result = pim_if_igmp_join_add(ifp, group_addr, source_addr);
- if (result) {
- vty_out(vty,
- "%% Failure joining IGMP group %s source %s on interface %s: %d\n",
- group_str, source_str, ifp->name, result);
- return CMD_WARNING_CONFIG_FAILED;
- }
+ CMD_FERR_RETURN(pim_if_igmp_join_add(ifp, group_addr, source_addr),
+ "Failure joining IGMP group: $ERR");
return CMD_SUCCESS;
}
struct in_addr src_addr;
int result;
- pim_ifp = iif->info;
+ PIM_GET_PIM_INTERFACE(pim_ifp, iif);
pim = pim_ifp->pim;
oifname = argv[idx_interface]->arg;
struct in_addr src_addr;
int result;
- pim_ifp = iif->info;
+ PIM_GET_PIM_INTERFACE(pim_ifp, iif);
pim = pim_ifp->pim;
oifname = argv[idx_interface]->arg;
struct in_addr src_addr;
int result;
- pim_ifp = iif->info;
+ PIM_GET_PIM_INTERFACE(pim_ifp, iif);
pim = pim_ifp->pim;
oifname = argv[idx_interface]->arg;
struct in_addr src_addr;
int result;
- pim_ifp = iif->info;
+ PIM_GET_PIM_INTERFACE(pim_ifp, iif);
pim = pim_ifp->pim;
oifname = argv[idx_interface]->arg;
return CMD_SUCCESS;
}
+DEFUN (debug_pim_nht_rp,
+ debug_pim_nht_rp_cmd,
+ "debug pim nht rp",
+ DEBUG_STR
+ DEBUG_PIM_STR
+ "Nexthop Tracking\n"
+ "RP Nexthop Tracking\n")
+{
+ PIM_DO_DEBUG_PIM_NHT_RP;
+ return CMD_SUCCESS;
+}
+
+DEFUN (no_debug_pim_nht_rp,
+ no_debug_pim_nht_rp_cmd,
+ "no debug pim nht rp",
+ NO_STR
+ DEBUG_STR
+ DEBUG_PIM_STR
+ "Nexthop Tracking\n"
+ "RP Nexthop Tracking\n")
+{
+ PIM_DONT_DEBUG_PIM_NHT_RP;
+ return CMD_SUCCESS;
+}
+
DEFUN (debug_pim_events,
debug_pim_events_cmd,
"debug pim events",
if (uj)
vty_out(vty, "{ ");
- RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name)
- {
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
if (uj) {
if (!first)
vty_out(vty, ", ");
if (uj)
vty_out(vty, "{ ");
- RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name)
- {
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
if (uj) {
if (!first)
vty_out(vty, ", ");
if (uj)
vty_out(vty, "{ ");
- RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name)
- {
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
if (uj) {
if (!first)
vty_out(vty, ", ");
if (uj)
vty_out(vty, "{ ");
- RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name) {
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
if (uj) {
if (!first)
vty_out(vty, ", ");
install_element(ENABLE_NODE, &no_debug_pim_cmd);
install_element(ENABLE_NODE, &debug_pim_nht_cmd);
install_element(ENABLE_NODE, &no_debug_pim_nht_cmd);
+ install_element(ENABLE_NODE, &debug_pim_nht_rp_cmd);
+ install_element(ENABLE_NODE, &no_debug_pim_nht_rp_cmd);
install_element(ENABLE_NODE, &debug_pim_events_cmd);
install_element(ENABLE_NODE, &no_debug_pim_events_cmd);
install_element(ENABLE_NODE, &debug_pim_packets_cmd);
install_element(CONFIG_NODE, &no_debug_pim_cmd);
install_element(CONFIG_NODE, &debug_pim_nht_cmd);
install_element(CONFIG_NODE, &no_debug_pim_nht_cmd);
+ install_element(CONFIG_NODE, &debug_pim_nht_rp_cmd);
+ install_element(CONFIG_NODE, &no_debug_pim_nht_rp_cmd);
install_element(CONFIG_NODE, &debug_pim_events_cmd);
install_element(CONFIG_NODE, &no_debug_pim_events_cmd);
install_element(CONFIG_NODE, &debug_pim_packets_cmd);