diff options
author | Everton Marques <everton.marques@gmail.com> | 2009-10-07 18:41:45 -0300 |
---|---|---|
committer | David Lamparter <equinox@opensourcerouting.org> | 2015-02-04 06:07:51 +0100 |
commit | 96f91aefc06477e73d0e93008b51fc6e87fa2bc4 (patch) | |
tree | 265cbea8c87ceea986c2764969361c49556d8f77 /pimd/pim_cmd.c | |
parent | ccc5d2bb9b7a395375a34cb6a6b703d78e885b1d (diff) | |
download | quagga-96f91aefc06477e73d0e93008b51fc6e87fa2bc4.tar.bz2 quagga-96f91aefc06477e73d0e93008b51fc6e87fa2bc4.tar.xz |
[pim] Skeleton for ssmpingd support
Diffstat (limited to 'pimd/pim_cmd.c')
-rw-r--r-- | pimd/pim_cmd.c | 60 |
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 |