summaryrefslogtreecommitdiffstats
path: root/pimd/pim_cmd.c
diff options
context:
space:
mode:
authorEverton Marques <everton.marques@gmail.com>2009-10-07 18:41:45 -0300
committerEverton Marques <everton.marques@gmail.com>2009-10-07 18:41:45 -0300
commit7885c79d9691ed32182e07f0d4f10f68a294024a (patch)
treef5849499636e55774e268dc8bcd4d1fbed7a9186 /pimd/pim_cmd.c
parent1fe785d84255727222ef5142c32be742918aac39 (diff)
downloadquagga-7885c79d9691ed32182e07f0d4f10f68a294024a.tar.bz2
quagga-7885c79d9691ed32182e07f0d4f10f68a294024a.tar.xz
[pim] Skeleton for ssmpingd support
Diffstat (limited to 'pimd/pim_cmd.c')
-rw-r--r--pimd/pim_cmd.c60
1 files changed, 60 insertions, 0 deletions
diff --git a/pimd/pim_cmd.c b/pimd/pim_cmd.c
index 5b47f3bb..692c2fcc 100644
--- a/pimd/pim_cmd.c
+++ b/pimd/pim_cmd.c
@@ -47,6 +47,7 @@
#include "pim_upstream.h"
#include "pim_rpf.h"
#include "pim_macro.h"
+#include "pim_ssmpingd.h"
static struct cmd_node pim_global_node = {
PIM_NODE,
@@ -2200,6 +2201,63 @@ DEFUN (no_ip_multicast_routing,
return CMD_SUCCESS;
}
+DEFUN (ip_ssmpingd,
+ ip_ssmpingd_cmd,
+ "ip ssmpingd [A.B.C.D]",
+ IP_STR
+ SSMPINGD_STR
+ "Source address\n")
+{
+ int result;
+ struct in_addr source_addr;
+ const char *source_str = (argc > 0) ? argv[0] : "0.0.0.0";
+
+ result = inet_pton(AF_INET, source_str, &source_addr);
+ if (result <= 0) {
+ vty_out(vty, "%% Bad source address %s: errno=%d: %s%s",
+ source_str, errno, safe_strerror(errno), VTY_NEWLINE);
+ return CMD_WARNING;
+ }
+
+ result = pim_ssmpingd_start(source_addr);
+ if (result) {
+ vty_out(vty, "%% Failure starting ssmpingd for source %s: %d%s",
+ source_str, result, VTY_NEWLINE);
+ return CMD_WARNING;
+ }
+
+ return CMD_SUCCESS;
+}
+
+DEFUN (no_ip_ssmpingd,
+ no_ip_ssmpingd_cmd,
+ "no ip ssmpingd [A.B.C.D]",
+ NO_STR
+ IP_STR
+ SSMPINGD_STR
+ "Source address\n")
+{
+ int result;
+ struct in_addr source_addr;
+ const char *source_str = (argc > 0) ? argv[0] : "0.0.0.0";
+
+ result = inet_pton(AF_INET, source_str, &source_addr);
+ if (result <= 0) {
+ vty_out(vty, "%% Bad source address %s: errno=%d: %s%s",
+ source_str, errno, safe_strerror(errno), VTY_NEWLINE);
+ return CMD_WARNING;
+ }
+
+ result = pim_ssmpingd_stop(source_addr);
+ if (result) {
+ vty_out(vty, "%% Failure stopping ssmpingd for source %s: %d%s",
+ source_str, result, VTY_NEWLINE);
+ return CMD_WARNING;
+ }
+
+ return CMD_SUCCESS;
+}
+
DEFUN (interface_ip_igmp,
interface_ip_igmp_cmd,
"ip igmp",
@@ -3788,6 +3846,8 @@ void pim_cmd_init()
install_element (CONFIG_NODE, &ip_multicast_routing_cmd);
install_element (CONFIG_NODE, &no_ip_multicast_routing_cmd);
+ install_element (CONFIG_NODE, &ip_ssmpingd_cmd);
+ install_element (CONFIG_NODE, &no_ip_ssmpingd_cmd);
#if 0
install_element (CONFIG_NODE, &interface_cmd); /* from if.h */
#else