From f1bad8260c8c9942057c569b2a1a687a92b54862 Mon Sep 17 00:00:00 2001 From: Everton Marques Date: Tue, 11 Aug 2009 15:43:05 -0300 Subject: [pim] Initial pim 0.155 --- pimd/pim_vty.c | 145 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 145 insertions(+) create mode 100644 pimd/pim_vty.c (limited to 'pimd/pim_vty.c') diff --git a/pimd/pim_vty.c b/pimd/pim_vty.c new file mode 100644 index 00000000..7d69b5b1 --- /dev/null +++ b/pimd/pim_vty.c @@ -0,0 +1,145 @@ +/* + PIM for Quagga + Copyright (C) 2008 Everton da Silva Marques + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; see the file COPYING; if not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA + + $QuaggaId: $Format:%an, %ai, %h$ $ +*/ + +#include + +#include "if.h" +#include "linklist.h" + +#include "pimd.h" +#include "pim_vty.h" +#include "pim_iface.h" +#include "pim_cmd.h" +#include "pim_str.h" + +int pim_debug_config_write(struct vty *vty) +{ + int writes = 0; + + if (PIM_DEBUG_IGMP_EVENTS) { + vty_out(vty, "debug igmp events%s", VTY_NEWLINE); + ++writes; + } + if (PIM_DEBUG_IGMP_PACKETS) { + vty_out(vty, "debug igmp packets%s", VTY_NEWLINE); + ++writes; + } + if (PIM_DEBUG_IGMP_TRACE) { + vty_out(vty, "debug igmp trace%s", VTY_NEWLINE); + ++writes; + } + + if (PIM_DEBUG_PIM_EVENTS) { + vty_out(vty, "debug pim events%s", VTY_NEWLINE); + ++writes; + } + if (PIM_DEBUG_PIM_PACKETS) { + vty_out(vty, "debug pim packets%s", VTY_NEWLINE); + ++writes; + } + if (PIM_DEBUG_PIM_TRACE) { + vty_out(vty, "debug pim trace%s", VTY_NEWLINE); + ++writes; + } + + if (PIM_DEBUG_ZEBRA) { + vty_out(vty, "debug pim zebra%s", VTY_NEWLINE); + ++writes; + } + + return writes; +} + +int pim_global_config_write(struct vty *vty) +{ + int writes = 0; + + if (PIM_MROUTE_IS_ENABLED) { + vty_out(vty, "%s%s", PIM_CMD_IP_MULTICAST_ROUTING, VTY_NEWLINE); + ++writes; + } + + return writes; +} + +int pim_interface_config_write(struct vty *vty) +{ + int writes = 0; + struct listnode *node; + struct interface *ifp; + + for (ALL_LIST_ELEMENTS_RO(iflist, node, ifp)) { + + /* IF name */ + vty_out(vty, "interface %s%s", ifp->name, VTY_NEWLINE); + writes++; + + if (ifp->info) { + struct pim_interface *pim_ifp = ifp->info; + + /* IF ip pim ssm */ + if (PIM_IF_TEST_PIM(pim_ifp->options)) { + vty_out(vty, " ip pim ssm%s", VTY_NEWLINE); + writes++; + } + + /* IF ip igmp */ + if (PIM_IF_TEST_IGMP(pim_ifp->options)) { + vty_out(vty, " ip igmp%s", VTY_NEWLINE); + writes++; + } + + /* IF ip igmp query-interval */ + vty_out(vty, " %s %d%s", + PIM_CMD_IP_IGMP_QUERY_INTERVAL, + pim_ifp->igmp_default_query_interval, + VTY_NEWLINE); + writes++; + + /* IF ip igmp query-max-response-time */ + vty_out(vty, " %s %d%s", + PIM_CMD_IP_IGMP_QUERY_MAX_RESPONSE_TIME_DSEC, + pim_ifp->igmp_query_max_response_time_dsec, + VTY_NEWLINE); + writes++; + + /* IF ip igmp join */ + if (pim_ifp->igmp_join_list) { + struct listnode *node; + struct igmp_join *ij; + for (ALL_LIST_ELEMENTS_RO(pim_ifp->igmp_join_list, node, ij)) { + char group_str[100]; + char source_str[100]; + pim_inet4_dump("", ij->group_addr, group_str, sizeof(group_str)); + pim_inet4_dump("", ij->source_addr, source_str, sizeof(source_str)); + vty_out(vty, " ip igmp join %s %s%s", + group_str, source_str, + VTY_NEWLINE); + writes++; + } + } + } + vty_out(vty, "!%s", VTY_NEWLINE); + } + + return writes; +} -- cgit v1.2.3 From a073e08921a9e2ebcf06717699b713650fb3b48d Mon Sep 17 00:00:00 2001 From: Everton Marques Date: Thu, 8 Oct 2009 09:16:27 -0300 Subject: [pim] Hooks for ssmpingd support --- pimd/pim_vty.c | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) (limited to 'pimd/pim_vty.c') diff --git a/pimd/pim_vty.c b/pimd/pim_vty.c index 7d69b5b1..0b06d0ec 100644 --- a/pimd/pim_vty.c +++ b/pimd/pim_vty.c @@ -30,6 +30,7 @@ #include "pim_iface.h" #include "pim_cmd.h" #include "pim_str.h" +#include "pim_ssmpingd.h" int pim_debug_config_write(struct vty *vty) { @@ -66,6 +67,11 @@ int pim_debug_config_write(struct vty *vty) ++writes; } + if (PIM_DEBUG_SSMPINGD) { + vty_out(vty, "debug ssmpingd%s", VTY_NEWLINE); + ++writes; + } + return writes; } @@ -78,6 +84,19 @@ int pim_global_config_write(struct vty *vty) ++writes; } + if (qpim_ssmpingd_list) { + struct listnode *node; + struct ssmpingd_sock *ss; + vty_out(vty, "!%s", VTY_NEWLINE); + ++writes; + for (ALL_LIST_ELEMENTS_RO(qpim_ssmpingd_list, node, ss)) { + char source_str[100]; + pim_inet4_dump("", ss->source_addr, source_str, sizeof(source_str)); + vty_out(vty, "ip ssmpingd %s%s", source_str, VTY_NEWLINE); + ++writes; + } + } + return writes; } @@ -91,7 +110,7 @@ int pim_interface_config_write(struct vty *vty) /* IF name */ vty_out(vty, "interface %s%s", ifp->name, VTY_NEWLINE); - writes++; + ++writes; if (ifp->info) { struct pim_interface *pim_ifp = ifp->info; @@ -99,13 +118,13 @@ int pim_interface_config_write(struct vty *vty) /* IF ip pim ssm */ if (PIM_IF_TEST_PIM(pim_ifp->options)) { vty_out(vty, " ip pim ssm%s", VTY_NEWLINE); - writes++; + ++writes; } /* IF ip igmp */ if (PIM_IF_TEST_IGMP(pim_ifp->options)) { vty_out(vty, " ip igmp%s", VTY_NEWLINE); - writes++; + ++writes; } /* IF ip igmp query-interval */ @@ -113,14 +132,14 @@ int pim_interface_config_write(struct vty *vty) PIM_CMD_IP_IGMP_QUERY_INTERVAL, pim_ifp->igmp_default_query_interval, VTY_NEWLINE); - writes++; + ++writes; /* IF ip igmp query-max-response-time */ vty_out(vty, " %s %d%s", PIM_CMD_IP_IGMP_QUERY_MAX_RESPONSE_TIME_DSEC, pim_ifp->igmp_query_max_response_time_dsec, VTY_NEWLINE); - writes++; + ++writes; /* IF ip igmp join */ if (pim_ifp->igmp_join_list) { @@ -134,11 +153,12 @@ int pim_interface_config_write(struct vty *vty) vty_out(vty, " ip igmp join %s %s%s", group_str, source_str, VTY_NEWLINE); - writes++; + ++writes; } } } vty_out(vty, "!%s", VTY_NEWLINE); + ++writes; } return writes; -- cgit v1.2.3 From b5dfd4a6cc23896633cf8c9d7eb5ae2a811addb1 Mon Sep 17 00:00:00 2001 From: Everton Marques Date: Wed, 18 Nov 2009 10:44:13 -0200 Subject: [pim] Packet dump debugging --- pimd/pim_vty.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'pimd/pim_vty.c') diff --git a/pimd/pim_vty.c b/pimd/pim_vty.c index 0b06d0ec..3a1abf13 100644 --- a/pimd/pim_vty.c +++ b/pimd/pim_vty.c @@ -57,6 +57,14 @@ int pim_debug_config_write(struct vty *vty) vty_out(vty, "debug pim packets%s", VTY_NEWLINE); ++writes; } + if (PIM_DEBUG_PIM_PACKETDUMP_SEND) { + vty_out(vty, "debug pim packet-dump send%s", VTY_NEWLINE); + ++writes; + } + if (PIM_DEBUG_PIM_PACKETDUMP_RECV) { + vty_out(vty, "debug pim packet-dump receive%s", VTY_NEWLINE); + ++writes; + } if (PIM_DEBUG_PIM_TRACE) { vty_out(vty, "debug pim trace%s", VTY_NEWLINE); ++writes; -- cgit v1.2.3