From d2772e7b65a9967f7698a86c6e70e79bbdae944d Mon Sep 17 00:00:00 2001 From: anuradhak Date: Tue, 21 Mar 2017 10:12:30 -0700 Subject: [PATCH] pimd: Remove interface type SSM. Interface type has been replaced with the SSM range config. And SSM groups can now co-exists with ASM groups. I have left the pim ssm per-interface cli control hidden. It now enables pim-sm with a warning. Signed-off-by: Anuradha Karuppiah Reviewed-by: Donald Sharp Ticket: CM-15344 Testing Done: pim-smoke --- pimd/pim_cmd.c | 15 +++++++-------- pimd/pim_iface.h | 6 ------ pimd/pim_mroute.c | 6 ++---- pimd/pim_vty.c | 6 +----- 4 files changed, 10 insertions(+), 23 deletions(-) diff --git a/pimd/pim_cmd.c b/pimd/pim_cmd.c index fc836aee3c..3c5a16ec68 100644 --- a/pimd/pim_cmd.c +++ b/pimd/pim_cmd.c @@ -4440,7 +4440,7 @@ DEFUN (interface_no_ip_pim_drprio, } static int -pim_cmd_interface_add (struct interface *ifp, enum pim_interface_type itype) +pim_cmd_interface_add (struct interface *ifp) { struct pim_interface *pim_ifp = ifp->info; @@ -4454,14 +4454,12 @@ pim_cmd_interface_add (struct interface *ifp, enum pim_interface_type itype) PIM_IF_DO_PIM(pim_ifp->options); } - pim_ifp->itype = itype; pim_if_addr_add_all(ifp); pim_if_membership_refresh(ifp); return 1; } - -DEFUN (interface_ip_pim_ssm, +DEFUN_HIDDEN (interface_ip_pim_ssm, interface_ip_pim_ssm_cmd, "ip pim ssm", IP_STR @@ -4470,11 +4468,12 @@ DEFUN (interface_ip_pim_ssm, { VTY_DECLVAR_CONTEXT(interface, ifp); - if (!pim_cmd_interface_add(ifp, PIM_INTERFACE_SSM)) { - vty_out(vty, "Could not enable PIM SSM on interface%s", VTY_NEWLINE); + if (!pim_cmd_interface_add(ifp)) { + vty_out(vty, "Could not enable PIM SM on interface%s", VTY_NEWLINE); return CMD_WARNING; } + vty_out(vty, "WARN: Enabled PIM SM on interface; configure PIM SSM range if needed%s", VTY_NEWLINE); return CMD_SUCCESS; } @@ -4486,7 +4485,7 @@ DEFUN (interface_ip_pim_sm, IFACE_PIM_SM_STR) { VTY_DECLVAR_CONTEXT(interface, ifp); - if (!pim_cmd_interface_add(ifp, PIM_INTERFACE_SM)) { + if (!pim_cmd_interface_add(ifp)) { vty_out(vty, "Could not enable PIM SM on interface%s", VTY_NEWLINE); return CMD_WARNING; } @@ -4522,7 +4521,7 @@ pim_cmd_interface_delete (struct interface *ifp) return 1; } -DEFUN (interface_no_ip_pim_ssm, +DEFUN_HIDDEN (interface_no_ip_pim_ssm, interface_no_ip_pim_ssm_cmd, "no ip pim ssm", NO_STR diff --git a/pimd/pim_iface.h b/pimd/pim_iface.h index 8d332c70b0..e98c17fed2 100644 --- a/pimd/pim_iface.h +++ b/pimd/pim_iface.h @@ -58,11 +58,6 @@ struct pim_iface_upstream_switch { struct list *us; }; -enum pim_interface_type { - PIM_INTERFACE_SSM, - PIM_INTERFACE_SM -}; - enum pim_secondary_addr_flags { PIM_SEC_ADDRF_NONE = 0, PIM_SEC_ADDRF_STALE = (1 << 0) @@ -74,7 +69,6 @@ struct pim_secondary_addr { }; struct pim_interface { - enum pim_interface_type itype; uint32_t options; /* bit vector */ ifindex_t mroute_vif_index; struct in_addr primary_address; /* remember addr to detect change */ diff --git a/pimd/pim_mroute.c b/pimd/pim_mroute.c index 56f9f62ef9..90e30ea3d6 100644 --- a/pimd/pim_mroute.c +++ b/pimd/pim_mroute.c @@ -128,8 +128,7 @@ pim_mroute_msg_nocache (int fd, struct interface *ifp, const struct igmpmsg *msg */ if ((pim_rpf_addr_is_inaddr_none (rpg)) || (!pim_ifp) || - (!(PIM_I_am_DR(pim_ifp))) || - (pim_ifp->itype == PIM_INTERFACE_SSM)) + (!(PIM_I_am_DR(pim_ifp)))) { if (PIM_DEBUG_MROUTE_DETAIL) zlog_debug ("%s: Interface is not configured correctly to handle incoming packet: Could be !DR, !pim_ifp, !SM, !RP", @@ -214,8 +213,7 @@ pim_mroute_msg_wholepkt (int fd, struct interface *ifp, const char *buf) if ((pim_rpf_addr_is_inaddr_none (rpg)) || (!pim_ifp) || - (!(PIM_I_am_DR(pim_ifp))) || - (pim_ifp->itype == PIM_INTERFACE_SSM)) { + (!(PIM_I_am_DR(pim_ifp)))) { if (PIM_DEBUG_MROUTE) { zlog_debug("%s: Failed Check send packet", __PRETTY_FUNCTION__); } diff --git a/pimd/pim_vty.c b/pimd/pim_vty.c index e6a9d1b9e3..f4bfcc5ce0 100644 --- a/pimd/pim_vty.c +++ b/pimd/pim_vty.c @@ -214,12 +214,8 @@ int pim_interface_config_write(struct vty *vty) if (ifp->info) { struct pim_interface *pim_ifp = ifp->info; - /* IF ip pim ssm */ if (PIM_IF_TEST_PIM(pim_ifp->options)) { - if (pim_ifp->itype == PIM_INTERFACE_SSM) - vty_out(vty, " ip pim ssm%s", VTY_NEWLINE); - else - vty_out(vty, " ip pim sm%s", VTY_NEWLINE); + vty_out(vty, " ip pim sm%s", VTY_NEWLINE); ++writes; } -- 2.39.5