summaryrefslogtreecommitdiffstats
path: root/pimd
diff options
context:
space:
mode:
authorroot <root@dev.vmware.com>2018-09-07 13:46:57 +0200
committerroot <root@dev.vmware.com>2018-09-11 07:22:14 +0200
commit2f5e937c49dec6b422e8f2ebede4bded44f70efd (patch)
tree329535ee94261ff4e0adb59390501dcec22ef121 /pimd
parentMerge pull request #2873 from vivek-cumulus/evpn-extended-mobility (diff)
downloadfrr-2f5e937c49dec6b422e8f2ebede4bded44f70efd.tar.xz
frr-2f5e937c49dec6b422e8f2ebede4bded44f70efd.zip
pimd: create a new command "ip pim" configuring pim sm
A new command "ip pim" is created to configure pim sm on an interface, which replaces the existing commands "ip pim sm" and "ip pim ssm" and make "ip pim sm" and "ip pim ssm" as hidden commands. The command "ip multicast-routing" is removed since it is already enabled on FRR by default. Signed-off-by: Sarita Patra saritap@vmware.com
Diffstat (limited to 'pimd')
-rw-r--r--pimd/pim_cmd.c93
-rw-r--r--pimd/pim_vty.c2
2 files changed, 49 insertions, 46 deletions
diff --git a/pimd/pim_cmd.c b/pimd/pim_cmd.c
index 5dc86417c..8ef8f87d1 100644
--- a/pimd/pim_cmd.c
+++ b/pimd/pim_cmd.c
@@ -5640,27 +5640,6 @@ DEFUN (show_ip_pim_group_type,
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]",
@@ -6431,16 +6410,12 @@ DEFUN_HIDDEN (interface_ip_pim_ssm,
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;
@@ -6453,6 +6428,25 @@ DEFUN (interface_ip_pim_sm,
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;
@@ -6478,6 +6472,17 @@ static int pim_cmd_interface_delete(struct interface *ifp)
return 1;
}
+static int interface_no_ip_pim_helper(struct vty *vty)
+{
+ 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 CMD_SUCCESS;
+}
+
DEFUN_HIDDEN (interface_no_ip_pim_ssm,
interface_no_ip_pim_ssm_cmd,
"no ip pim ssm",
@@ -6486,16 +6491,10 @@ DEFUN_HIDDEN (interface_no_ip_pim_ssm,
PIM_STR
IFACE_PIM_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 CMD_SUCCESS;
+ return interface_no_ip_pim_helper(vty);
}
-DEFUN (interface_no_ip_pim_sm,
+DEFUN_HIDDEN (interface_no_ip_pim_sm,
interface_no_ip_pim_sm_cmd,
"no ip pim sm",
NO_STR
@@ -6503,13 +6502,17 @@ DEFUN (interface_no_ip_pim_sm,
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 */
@@ -7466,7 +7469,7 @@ DEFUN (interface_pim_use_source,
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")
{
@@ -7478,7 +7481,7 @@ DEFUN (interface_no_pim_use_source,
"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")
{
@@ -8634,8 +8637,6 @@ void pim_cmd_init(void)
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);
@@ -8721,6 +8722,8 @@ void pim_cmd_init(void)
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);
diff --git a/pimd/pim_vty.c b/pimd/pim_vty.c
index 88be195be..a4aec710e 100644
--- a/pimd/pim_vty.c
+++ b/pimd/pim_vty.c
@@ -267,7 +267,7 @@ int pim_interface_config_write(struct vty *vty)
struct pim_interface *pim_ifp = ifp->info;
if (PIM_IF_TEST_PIM(pim_ifp->options)) {
- vty_out(vty, " ip pim sm\n");
+ vty_out(vty, " ip pim\n");
++writes;
}