summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pimd/pim6_cmd.c16
-rw-r--r--pimd/pim6_cmd.h1
-rw-r--r--pimd/pim_cmd.c38
-rw-r--r--pimd/pim_cmd_common.c25
-rw-r--r--pimd/pim_cmd_common.h2
5 files changed, 50 insertions, 32 deletions
diff --git a/pimd/pim6_cmd.c b/pimd/pim6_cmd.c
index 151ecdb17..7c7445c2a 100644
--- a/pimd/pim6_cmd.c
+++ b/pimd/pim6_cmd.c
@@ -2004,6 +2004,19 @@ DEFPY (clear_ipv6_mroute_count,
return clear_ip_mroute_count_command(vty, name);
}
+DEFPY (debug_pimv6,
+ debug_pimv6_cmd,
+ "[no] debug pimv6",
+ NO_STR
+ DEBUG_STR
+ DEBUG_PIMV6_STR)
+{
+ if (!no)
+ return pim_debug_pim_cmd();
+ else
+ return pim_no_debug_pim_cmd();
+}
+
void pim_cmd_init(void)
{
if_cmd_init(pim_interface_config_write);
@@ -2115,4 +2128,7 @@ void pim_cmd_init(void)
install_element(ENABLE_NODE, &clear_ipv6_mroute_cmd);
install_element(ENABLE_NODE, &clear_ipv6_pim_oil_cmd);
install_element(ENABLE_NODE, &clear_ipv6_mroute_count_cmd);
+ install_element(ENABLE_NODE, &debug_pimv6_cmd);
+
+ install_element(CONFIG_NODE, &debug_pimv6_cmd);
}
diff --git a/pimd/pim6_cmd.h b/pimd/pim6_cmd.h
index b7804c0db..73c1112f2 100644
--- a/pimd/pim6_cmd.h
+++ b/pimd/pim6_cmd.h
@@ -45,6 +45,7 @@
#define DEBUG_MLD_PACKETS_STR "MLD protocol packets\n"
#define DEBUG_MLD_TRACE_STR "MLD internal daemon activity\n"
#define CONF_SSMPINGD_STR "Enable ssmpingd operation\n"
+#define DEBUG_PIMV6_STR "PIMv6 protocol activity\n"
void pim_cmd_init(void);
diff --git a/pimd/pim_cmd.c b/pimd/pim_cmd.c
index 34d646ec6..43463ce74 100644
--- a/pimd/pim_cmd.c
+++ b/pimd/pim_cmd.c
@@ -5522,41 +5522,17 @@ DEFUN (no_debug_pim_static,
}
-DEFUN (debug_pim,
+DEFPY (debug_pim,
debug_pim_cmd,
- "debug pim",
- DEBUG_STR
- DEBUG_PIM_STR)
-{
- PIM_DO_DEBUG_PIM_EVENTS;
- PIM_DO_DEBUG_PIM_PACKETS;
- PIM_DO_DEBUG_PIM_TRACE;
- PIM_DO_DEBUG_MSDP_EVENTS;
- PIM_DO_DEBUG_MSDP_PACKETS;
- PIM_DO_DEBUG_BSM;
- PIM_DO_DEBUG_VXLAN;
- return CMD_SUCCESS;
-}
-
-DEFUN (no_debug_pim,
- no_debug_pim_cmd,
- "no debug pim",
+ "[no] debug pim",
NO_STR
DEBUG_STR
DEBUG_PIM_STR)
{
- PIM_DONT_DEBUG_PIM_EVENTS;
- PIM_DONT_DEBUG_PIM_PACKETS;
- PIM_DONT_DEBUG_PIM_TRACE;
- PIM_DONT_DEBUG_MSDP_EVENTS;
- PIM_DONT_DEBUG_MSDP_PACKETS;
-
- PIM_DONT_DEBUG_PIM_PACKETDUMP_SEND;
- PIM_DONT_DEBUG_PIM_PACKETDUMP_RECV;
- PIM_DONT_DEBUG_BSM;
- PIM_DONT_DEBUG_VXLAN;
-
- return CMD_SUCCESS;
+ if (!no)
+ return pim_debug_pim_cmd();
+ else
+ return pim_no_debug_pim_cmd();
}
DEFUN (debug_pim_nht,
@@ -7872,7 +7848,6 @@ void pim_cmd_init(void)
install_element(ENABLE_NODE, &debug_pim_static_cmd);
install_element(ENABLE_NODE, &no_debug_pim_static_cmd);
install_element(ENABLE_NODE, &debug_pim_cmd);
- 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_det_cmd);
@@ -7927,7 +7902,6 @@ void pim_cmd_init(void)
install_element(CONFIG_NODE, &debug_pim_static_cmd);
install_element(CONFIG_NODE, &no_debug_pim_static_cmd);
install_element(CONFIG_NODE, &debug_pim_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_det_cmd);
diff --git a/pimd/pim_cmd_common.c b/pimd/pim_cmd_common.c
index b6cb3113e..eda9f100b 100644
--- a/pimd/pim_cmd_common.c
+++ b/pimd/pim_cmd_common.c
@@ -3673,3 +3673,28 @@ void clear_pim_statistics(struct pim_instance *pim)
pim_ifp->pim_ifstat_bsm_invalid_sz = 0;
}
}
+
+int pim_debug_pim_cmd(void)
+{
+ PIM_DO_DEBUG_PIM_EVENTS;
+ PIM_DO_DEBUG_PIM_PACKETS;
+ PIM_DO_DEBUG_PIM_TRACE;
+ PIM_DO_DEBUG_MSDP_EVENTS;
+ PIM_DO_DEBUG_MSDP_PACKETS;
+ PIM_DO_DEBUG_BSM;
+ PIM_DO_DEBUG_VXLAN;
+ return CMD_SUCCESS;
+}
+
+int pim_no_debug_pim_cmd(void)
+{
+ PIM_DONT_DEBUG_PIM_EVENTS;
+ PIM_DONT_DEBUG_PIM_PACKETS;
+ PIM_DONT_DEBUG_PIM_TRACE;
+ PIM_DONT_DEBUG_MSDP_EVENTS;
+ PIM_DONT_DEBUG_MSDP_PACKETS;
+
+ PIM_DONT_DEBUG_PIM_PACKETDUMP_SEND;
+ PIM_DONT_DEBUG_PIM_PACKETDUMP_RECV;
+ return CMD_SUCCESS;
+}
diff --git a/pimd/pim_cmd_common.h b/pimd/pim_cmd_common.h
index 283998592..3f30ac5b4 100644
--- a/pimd/pim_cmd_common.h
+++ b/pimd/pim_cmd_common.h
@@ -125,6 +125,8 @@ int clear_ip_mroute_count_command(struct vty *vty, const char *name);
struct vrf *pim_cmd_lookup(struct vty *vty, const char *name);
void clear_mroute(struct pim_instance *pim);
void clear_pim_statistics(struct pim_instance *pim);
+int pim_debug_pim_cmd(void);
+int pim_no_debug_pim_cmd(void);
/*
* Special Macro to allow us to get the correct pim_instance;