char addr_str[INET_ADDRSTRLEN];
struct pim_assert_metric *am;
struct in_addr ifaddr;
- char pref_str[5];
- char metr_str[7];
+ char pref_str[16];
+ char metr_str[16];
ifaddr = pim_ifp->primary_address;
json_object_object_add(json_iface, ch_grp_str, json_row);
}
static void pim_show_membership(struct pim_instance *pim, struct vty *vty,
- uint8_t uj)
+ bool uj)
{
struct pim_interface *pim_ifp;
struct pim_ifchannel *ch;
}
static void igmp_show_interfaces(struct pim_instance *pim, struct vty *vty,
- uint8_t uj)
+ bool uj)
{
struct interface *ifp;
time_t now;
static void igmp_show_interfaces_single(struct pim_instance *pim,
struct vty *vty, const char *ifname,
- uint8_t uj)
+ bool uj)
{
struct igmp_sock *igmp;
struct interface *ifp;
static void pim_show_interfaces_single(struct pim_instance *pim,
struct vty *vty, const char *ifname,
- uint8_t uj)
+ bool uj)
{
struct in_addr ifaddr;
struct interface *ifp;
vty_out(vty, "Designated Router\n");
vty_out(vty, "-----------------\n");
vty_out(vty, "Address : %s\n", dr_str);
- vty_out(vty, "Priority : %d\n",
- pim_ifp->pim_dr_priority);
+ vty_out(vty, "Priority : %d(%d)\n",
+ pim_ifp->pim_dr_priority,
+ pim_ifp->pim_dr_num_nondrpri_neighbors);
vty_out(vty, "Uptime : %s\n", dr_uptime);
vty_out(vty, "Elections : %d\n",
pim_ifp->pim_dr_election_count);
}
static void igmp_show_statistics(struct pim_instance *pim, struct vty *vty,
- const char *ifname, uint8_t uj)
+ const char *ifname, bool uj)
{
struct interface *ifp;
struct igmp_stats rx_stats;
}
static void pim_show_interfaces(struct pim_instance *pim, struct vty *vty,
- uint8_t uj)
+ bool uj)
{
struct interface *ifp;
struct listnode *upnode;
}
static void pim_show_interface_traffic(struct pim_instance *pim,
- struct vty *vty, uint8_t uj)
+ struct vty *vty, bool uj)
{
struct interface *ifp = NULL;
struct pim_interface *pim_ifp = NULL;
static void pim_show_interface_traffic_single(struct pim_instance *pim,
struct vty *vty,
- const char *ifname, uint8_t uj)
+ const char *ifname, bool uj)
{
struct interface *ifp = NULL;
struct pim_interface *pim_ifp = NULL;
static void pim_show_join_helper(struct vty *vty, struct pim_interface *pim_ifp,
struct pim_ifchannel *ch, json_object *json,
- time_t now, uint8_t uj)
+ time_t now, bool uj)
{
char ch_src_str[INET_ADDRSTRLEN];
char ch_grp_str[INET_ADDRSTRLEN];
}
}
-static void pim_show_join(struct pim_instance *pim, struct vty *vty, uint8_t uj)
+static void pim_show_join(struct pim_instance *pim, struct vty *vty, bool uj)
{
struct pim_interface *pim_ifp;
struct pim_ifchannel *ch;
}
static void pim_show_neighbors_single(struct pim_instance *pim, struct vty *vty,
- const char *neighbor, uint8_t uj)
+ const char *neighbor, bool uj)
{
struct listnode *neighnode;
struct interface *ifp;
}
static void pim_show_state(struct pim_instance *pim, struct vty *vty,
- const char *src_or_group, const char *group,
- uint8_t uj)
+ const char *src_or_group, const char *group, bool uj)
{
struct channel_oil *c_oil;
struct listnode *node;
}
static void pim_show_neighbors(struct pim_instance *pim, struct vty *vty,
- uint8_t uj)
+ bool uj)
{
struct listnode *neighnode;
struct interface *ifp;
}
static void pim_show_upstream(struct pim_instance *pim, struct vty *vty,
- uint8_t uj)
+ bool uj)
{
struct listnode *upnode;
struct pim_upstream *up;
struct vty *vty,
struct pim_interface *pim_ifp,
struct pim_ifchannel *ch,
- json_object *json, uint8_t uj)
+ json_object *json, bool uj)
{
struct pim_upstream *up = ch->upstream;
json_object *json_group = NULL;
}
static void pim_show_join_desired(struct pim_instance *pim, struct vty *vty,
- uint8_t uj)
+ bool uj)
{
struct pim_interface *pim_ifp;
struct pim_ifchannel *ch;
}
static void pim_show_upstream_rpf(struct pim_instance *pim, struct vty *vty,
- uint8_t uj)
+ bool uj)
{
struct listnode *upnode;
struct pim_upstream *up;
uptime_mroute_del, (long long)pim->mroute_del_events);
}
-static void pim_show_rpf(struct pim_instance *pim, struct vty *vty, uint8_t uj)
+static void pim_show_rpf(struct pim_instance *pim, struct vty *vty, bool uj)
{
struct listnode *up_node;
struct pim_upstream *up;
ifindex_t first_ifindex;
struct interface *ifp = NULL;
- if (!pnc)
- return CMD_SUCCESS;
-
for (nh_node = pnc->nexthop; nh_node; nh_node = nh_node->next) {
first_ifindex = nh_node->ifindex;
ifp = if_lookup_by_index(first_ifindex, pim->vrf_id);
hash_walk(pim->rpf_hash, pim_print_pnc_cache_walkcb, &cwd);
}
-static void igmp_show_groups(struct pim_instance *pim, struct vty *vty,
- uint8_t uj)
+static void igmp_show_groups(struct pim_instance *pim, struct vty *vty, bool uj)
{
struct interface *ifp;
time_t now;
{
int idx = 2;
struct vrf *vrf = pim_cmd_lookup_vrf(vty, argv, argc, &idx);
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
if (!vrf)
return CMD_WARNING;
JSON_STR)
{
int idx = 2;
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
struct vrf *vrf;
bool first = true;
VRF_CMD_HELP_STR
"IGMP static join information\n")
{
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
struct vrf *vrf;
bool first = true;
{
int idx = 2;
struct vrf *vrf = pim_cmd_lookup_vrf(vty, argv, argc, &idx);
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
if (!vrf)
return CMD_WARNING;
IGMP_GROUP_STR
JSON_STR)
{
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
struct vrf *vrf;
bool first = true;
{
int idx = 2;
struct vrf *vrf = pim_cmd_lookup_vrf(vty, argv, argc, &idx);
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
if (!vrf)
return CMD_WARNING;
{
int idx = 2;
struct vrf *vrf = pim_cmd_lookup_vrf(vty, argv, argc, &idx);
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
if (!vrf)
return CMD_WARNING;
JSON_STR)
{
int idx = 6;
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
struct vrf *vrf;
bool first = true;
{
int idx = 2;
struct vrf *vrf = pim_cmd_lookup_vrf(vty, argv, argc, &idx);
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
if (!vrf)
return CMD_WARNING;
"PIM interface join information\n"
JSON_STR)
{
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
struct vrf *vrf;
bool first = true;
{
int idx = 2;
struct vrf *vrf = pim_cmd_lookup_vrf(vty, argv, argc, &idx);
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
if (!vrf)
return CMD_WARNING;
{
int idx = 2;
struct vrf *vrf = pim_cmd_lookup_vrf(vty, argv, argc, &idx);
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
if (!vrf)
return CMD_WARNING;
JSON_STR)
{
int idx = 2;
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
struct vrf *vrf;
bool first = true;
const char *group = NULL;
int idx = 2;
struct vrf *vrf = pim_cmd_lookup_vrf(vty, argv, argc, &idx);
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
if (!vrf)
return CMD_WARNING;
const char *src_or_group = NULL;
const char *group = NULL;
int idx = 2;
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
struct vrf *vrf;
bool first = true;
{
int idx = 2;
struct vrf *vrf = pim_cmd_lookup_vrf(vty, argv, argc, &idx);
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
if (!vrf)
return CMD_WARNING;
"PIM upstream information\n"
JSON_STR)
{
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
struct vrf *vrf;
bool first = true;
{
int idx = 2;
struct vrf *vrf = pim_cmd_lookup_vrf(vty, argv, argc, &idx);
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
if (!vrf)
return CMD_WARNING;
{
int idx = 2;
struct vrf *vrf = pim_cmd_lookup_vrf(vty, argv, argc, &idx);
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
if (!vrf)
return CMD_WARNING;
{
int idx = 2;
struct vrf *vrf = pim_cmd_lookup_vrf(vty, argv, argc, &idx);
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
if (!vrf)
return CMD_WARNING;
"PIM RP information\n"
JSON_STR)
{
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
struct vrf *vrf;
bool first = true;
{
int idx = 2;
struct vrf *vrf = pim_cmd_lookup_vrf(vty, argv, argc, &idx);
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
if (!vrf)
return CMD_WARNING;
"PIM cached source rpf information\n"
JSON_STR)
{
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
struct vrf *vrf;
bool first = true;
{
int idx = 2;
struct vrf *vrf = pim_cmd_lookup_vrf(vty, argv, argc, &idx);
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
if (!vrf)
return CMD_WARNING;
VRF_CMD_HELP_STR
"Multicast global information\n")
{
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
struct vrf *vrf;
bool first = true;
}
static void show_mroute(struct pim_instance *pim, struct vty *vty, bool fill,
- uint8_t uj)
+ bool uj)
{
struct listnode *node;
struct channel_oil *c_oil;
"Fill in Assumed data\n"
JSON_STR)
{
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
bool fill = false;
int idx = 2;
struct vrf *vrf = pim_cmd_lookup_vrf(vty, argv, argc, &idx);
"Fill in Assumed data\n"
JSON_STR)
{
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
int idx = 4;
struct vrf *vrf;
bool first = true;
VRF_CMD_HELP_STR
"Route and packet count data\n")
{
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
struct vrf *vrf;
bool first = true;
result = pim_rp_new(pim, rp, group, plist);
- if (result == PIM_MALLOC_FAIL) {
- vty_out(vty, "%% Out of memory\n");
- return CMD_WARNING_CONFIG_FAILED;
- }
-
if (result == PIM_GROUP_BAD_ADDRESS) {
vty_out(vty, "%% Bad group address specified: %s\n", group);
return CMD_WARNING_CONFIG_FAILED;
}
static void ip_pim_ssm_show_group_range(struct pim_instance *pim,
- struct vty *vty, uint8_t uj)
+ struct vty *vty, bool uj)
{
struct pim_ssm *ssm = pim->ssm_info;
const char *range_str =
{
int idx = 2;
struct vrf *vrf = pim_cmd_lookup_vrf(vty, argv, argc, &idx);
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
if (!vrf)
return CMD_WARNING;
}
static void ip_pim_ssm_show_group_type(struct pim_instance *pim,
- struct vty *vty, uint8_t uj,
+ struct vty *vty, bool uj,
const char *group)
{
struct in_addr group_addr;
{
int idx = 2;
struct vrf *vrf = pim_cmd_lookup_vrf(vty, argv, argc, &idx);
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
if (!vrf)
return CMD_WARNING;
return CMD_SUCCESS;
}
-DEFUN_HIDDEN (ip_multicast_routing,
- ip_multicast_routing_cmd,
- "ip multicast-routing",
- IP_STR
- "Enable IP multicast forwarding\n")
-{
- return CMD_SUCCESS;
-}
-
-DEFUN_HIDDEN (no_ip_multicast_routing,
- no_ip_multicast_routing_cmd,
- "no ip multicast-routing",
- NO_STR
- IP_STR
- "Enable IP multicast forwarding\n")
-{
- vty_out(vty,
- "Command is Disabled and will be removed in a future version\n");
- return CMD_SUCCESS;
-}
-
DEFUN (ip_ssmpingd,
ip_ssmpingd_cmd,
"ip ssmpingd [A.B.C.D]",
pim_ifp = ifp->info;
if (!pim_ifp) {
- pim_ifp = pim_if_new(ifp, 1 /* igmp=true */, 0 /* pim=false */);
+ pim_ifp = pim_if_new(ifp, true, false, false);
if (!pim_ifp) {
vty_out(vty, "Could not enable IGMP on interface %s\n",
ifp->name);
struct pim_interface *pim_ifp = ifp->info;
if (!pim_ifp) {
- pim_ifp = pim_if_new(ifp, 0 /* igmp=false */, 1 /* pim=true */);
+ pim_ifp = pim_if_new(ifp, false, true, false);
if (!pim_ifp) {
return 0;
}
return CMD_SUCCESS;
}
-DEFUN (interface_ip_pim_sm,
- interface_ip_pim_sm_cmd,
- "ip pim sm",
- IP_STR
- PIM_STR
- IFACE_PIM_SM_STR)
+static int interface_ip_pim_helper(struct vty *vty)
{
struct pim_interface *pim_ifp;
VTY_DECLVAR_CONTEXT(interface, ifp);
+
if (!pim_cmd_interface_add(ifp)) {
vty_out(vty, "Could not enable PIM SM on interface\n");
return CMD_WARNING_CONFIG_FAILED;
return CMD_SUCCESS;
}
+DEFUN_HIDDEN (interface_ip_pim_sm,
+ interface_ip_pim_sm_cmd,
+ "ip pim sm",
+ IP_STR
+ PIM_STR
+ IFACE_PIM_SM_STR)
+{
+ return interface_ip_pim_helper(vty);
+}
+
+DEFUN (interface_ip_pim,
+ interface_ip_pim_cmd,
+ "ip pim",
+ IP_STR
+ PIM_STR)
+{
+ return interface_ip_pim_helper(vty);
+}
+
static int pim_cmd_interface_delete(struct interface *ifp)
{
struct pim_interface *pim_ifp = ifp->info;
return 1;
}
-DEFUN_HIDDEN (interface_no_ip_pim_ssm,
- interface_no_ip_pim_ssm_cmd,
- "no ip pim ssm",
- NO_STR
- IP_STR
- PIM_STR
- IFACE_PIM_STR)
+static int interface_no_ip_pim_helper(struct vty *vty)
{
VTY_DECLVAR_CONTEXT(interface, ifp);
if (!pim_cmd_interface_delete(ifp)) {
return CMD_SUCCESS;
}
-DEFUN (interface_no_ip_pim_sm,
+DEFUN_HIDDEN (interface_no_ip_pim_ssm,
+ interface_no_ip_pim_ssm_cmd,
+ "no ip pim ssm",
+ NO_STR
+ IP_STR
+ PIM_STR
+ IFACE_PIM_STR)
+{
+ return interface_no_ip_pim_helper(vty);
+}
+
+DEFUN_HIDDEN (interface_no_ip_pim_sm,
interface_no_ip_pim_sm_cmd,
"no ip pim sm",
NO_STR
PIM_STR
IFACE_PIM_SM_STR)
{
- VTY_DECLVAR_CONTEXT(interface, ifp);
- if (!pim_cmd_interface_delete(ifp)) {
- vty_out(vty, "Unable to delete interface information\n");
- return CMD_WARNING_CONFIG_FAILED;
- }
+ return interface_no_ip_pim_helper(vty);
+}
- return CMD_SUCCESS;
+DEFUN (interface_no_ip_pim,
+ interface_no_ip_pim_cmd,
+ "no ip pim",
+ NO_STR
+ IP_STR
+ PIM_STR)
+{
+ return interface_no_ip_pim_helper(vty);
}
/* boundaries */
interface_pim_use_source_cmd,
"ip pim use-source A.B.C.D",
IP_STR
- "pim multicast routing\n"
+ PIM_STR
"Configure primary IP address\n"
"source ip address\n")
{
"no ip pim use-source [A.B.C.D]",
NO_STR
IP_STR
- "pim multicast routing\n"
+ PIM_STR
"Delete source IP address\n"
"source ip address\n")
{
return CMD_SUCCESS;
}
-DEFUN (ip_pim_bfd_param,
+#if HAVE_BFDD > 0
+DEFUN_HIDDEN(
+#else
+DEFUN(
+#endif /* HAVE_BFDD */
+ ip_pim_bfd_param,
ip_pim_bfd_param_cmd,
"ip pim bfd (2-255) (50-60000) (50-60000)",
IP_STR
return CMD_SUCCESS;
}
+#if HAVE_BFDD == 0
ALIAS(no_ip_pim_bfd, no_ip_pim_bfd_param_cmd,
"no ip pim bfd (2-255) (50-60000) (50-60000)", NO_STR IP_STR PIM_STR
"Enables BFD support\n"
"Detect Multiplier\n"
"Required min receive interval\n"
"Desired min transmit interval\n")
+#endif /* !HAVE_BFDD */
static int ip_msdp_peer_cmd_worker(struct pim_instance *pim, struct vty *vty,
const char *peer, const char *local)
}
static void ip_msdp_show_mesh_group(struct pim_instance *pim, struct vty *vty,
- uint8_t uj)
+ bool uj)
{
struct listnode *mbrnode;
struct pim_msdp_mg_mbr *mbr;
"MSDP mesh-group information\n"
JSON_STR)
{
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
int idx = 2;
struct vrf *vrf = pim_cmd_lookup_vrf(vty, argv, argc, &idx);
"MSDP mesh-group information\n"
JSON_STR)
{
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
struct vrf *vrf;
bool first = true;
}
static void ip_msdp_show_peers(struct pim_instance *pim, struct vty *vty,
- uint8_t uj)
+ bool uj)
{
struct listnode *mpnode;
struct pim_msdp_peer *mp;
}
static void ip_msdp_show_peers_detail(struct pim_instance *pim, struct vty *vty,
- const char *peer, uint8_t uj)
+ const char *peer, bool uj)
{
struct listnode *mpnode;
struct pim_msdp_peer *mp;
"peer ip address\n"
JSON_STR)
{
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
int idx = 2;
struct vrf *vrf = pim_cmd_lookup_vrf(vty, argv, argc, &idx);
JSON_STR)
{
int idx = 2;
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
struct vrf *vrf;
bool first = true;
return CMD_SUCCESS;
}
-static void ip_msdp_show_sa(struct pim_instance *pim, struct vty *vty,
- uint8_t uj)
+static void ip_msdp_show_sa(struct pim_instance *pim, struct vty *vty, bool uj)
{
struct listnode *sanode;
struct pim_msdp_sa *sa;
static void ip_msdp_show_sa_entry_detail(struct pim_msdp_sa *sa,
const char *src_str,
const char *grp_str, struct vty *vty,
- uint8_t uj, json_object *json)
+ bool uj, json_object *json)
{
char rp_str[INET_ADDRSTRLEN];
char peer_str[INET_ADDRSTRLEN];
}
static void ip_msdp_show_sa_detail(struct pim_instance *pim, struct vty *vty,
- uint8_t uj)
+ bool uj)
{
struct listnode *sanode;
struct pim_msdp_sa *sa;
"Detailed output\n"
JSON_STR)
{
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
int idx = 2;
struct vrf *vrf = pim_cmd_lookup_vrf(vty, argv, argc, &idx);
"Detailed output\n"
JSON_STR)
{
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
struct vrf *vrf;
bool first = true;
}
static void ip_msdp_show_sa_addr(struct pim_instance *pim, struct vty *vty,
- const char *addr, uint8_t uj)
+ const char *addr, bool uj)
{
struct listnode *sanode;
struct pim_msdp_sa *sa;
}
static void ip_msdp_show_sa_sg(struct pim_instance *pim, struct vty *vty,
- const char *src, const char *grp, uint8_t uj)
+ const char *src, const char *grp, bool uj)
{
struct listnode *sanode;
struct pim_msdp_sa *sa;
"group ip\n"
JSON_STR)
{
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
struct vrf *vrf;
int idx = 2;
"group ip\n"
JSON_STR)
{
- uint8_t uj = use_json(argc, argv);
+ bool uj = use_json(argc, argv);
struct vrf *vrf;
bool first = true;
int idx = 2;
install_node(&debug_node, pim_debug_config_write);
- install_element(CONFIG_NODE, &ip_multicast_routing_cmd);
- install_element(CONFIG_NODE, &no_ip_multicast_routing_cmd);
install_element(CONFIG_NODE, &ip_pim_rp_cmd);
install_element(VRF_NODE, &ip_pim_rp_cmd);
install_element(CONFIG_NODE, &no_ip_pim_rp_cmd);
install_element(INTERFACE_NODE, &interface_no_ip_pim_ssm_cmd);
install_element(INTERFACE_NODE, &interface_ip_pim_sm_cmd);
install_element(INTERFACE_NODE, &interface_no_ip_pim_sm_cmd);
+ install_element(INTERFACE_NODE, &interface_ip_pim_cmd);
+ install_element(INTERFACE_NODE, &interface_no_ip_pim_cmd);
install_element(INTERFACE_NODE, &interface_ip_pim_drprio_cmd);
install_element(INTERFACE_NODE, &interface_no_ip_pim_drprio_cmd);
install_element(INTERFACE_NODE, &interface_ip_pim_hello_cmd);
install_element(INTERFACE_NODE, &ip_pim_bfd_cmd);
install_element(INTERFACE_NODE, &ip_pim_bfd_param_cmd);
install_element(INTERFACE_NODE, &no_ip_pim_bfd_cmd);
+#if HAVE_BFDD == 0
install_element(INTERFACE_NODE, &no_ip_pim_bfd_param_cmd);
+#endif /* !HAVE_BFDD */
}