3 Copyright (C) 2008 Everton da Silva Marques
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; see the file COPYING; if not, write to the
17 Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
20 $QuaggaId: $Format:%an, %ai, %h$ $
30 #include "pim_iface.h"
33 #include "pim_ssmpingd.h"
35 #include "pim_static.h"
37 int pim_debug_config_write(struct vty *vty)
41 if (PIM_DEBUG_IGMP_EVENTS) {
42 vty_out(vty, "debug igmp events%s", VTY_NEWLINE);
45 if (PIM_DEBUG_IGMP_PACKETS) {
46 vty_out(vty, "debug igmp packets%s", VTY_NEWLINE);
49 if (PIM_DEBUG_IGMP_TRACE) {
50 vty_out(vty, "debug igmp trace%s", VTY_NEWLINE);
54 if (PIM_DEBUG_MROUTE) {
55 vty_out(vty, "debug mroute%s", VTY_NEWLINE);
59 if (PIM_DEBUG_PIM_EVENTS) {
60 vty_out(vty, "debug pim events%s", VTY_NEWLINE);
63 if (PIM_DEBUG_PIM_PACKETS) {
64 vty_out(vty, "debug pim packets%s", VTY_NEWLINE);
67 if (PIM_DEBUG_PIM_PACKETDUMP_SEND) {
68 vty_out(vty, "debug pim packet-dump send%s", VTY_NEWLINE);
71 if (PIM_DEBUG_PIM_PACKETDUMP_RECV) {
72 vty_out(vty, "debug pim packet-dump receive%s", VTY_NEWLINE);
75 if (PIM_DEBUG_PIM_TRACE) {
76 vty_out(vty, "debug pim trace%s", VTY_NEWLINE);
80 if (PIM_DEBUG_ZEBRA) {
81 vty_out(vty, "debug pim zebra%s", VTY_NEWLINE);
85 if (PIM_DEBUG_SSMPINGD) {
86 vty_out(vty, "debug ssmpingd%s", VTY_NEWLINE);
93 int pim_global_config_write(struct vty *vty)
97 if (PIM_MROUTE_IS_ENABLED) {
98 vty_out(vty, "%s%s", PIM_CMD_IP_MULTICAST_ROUTING, VTY_NEWLINE);
102 if (qpim_ssmpingd_list) {
103 struct listnode *node;
104 struct ssmpingd_sock *ss;
105 vty_out(vty, "!%s", VTY_NEWLINE);
107 for (ALL_LIST_ELEMENTS_RO(qpim_ssmpingd_list, node, ss)) {
108 char source_str[100];
109 pim_inet4_dump("<src?>", ss->source_addr, source_str, sizeof(source_str));
110 vty_out(vty, "ip ssmpingd %s%s", source_str, VTY_NEWLINE);
118 int pim_interface_config_write(struct vty *vty)
121 struct listnode *node;
122 struct interface *ifp;
124 for (ALL_LIST_ELEMENTS_RO(iflist, node, ifp)) {
127 vty_out(vty, "interface %s%s", ifp->name, VTY_NEWLINE);
131 struct pim_interface *pim_ifp = ifp->info;
134 if (PIM_IF_TEST_PIM(pim_ifp->options)) {
135 vty_out(vty, " ip pim ssm%s", VTY_NEWLINE);
139 /* IF ip pim drpriority */
140 if (pim_ifp->pim_dr_priority != PIM_DEFAULT_DR_PRIORITY) {
141 vty_out(vty, " ip pim drpriority %d%s", pim_ifp->pim_dr_priority,
146 /* IF ip pim hello */
147 if (pim_ifp->pim_hello_period != PIM_DEFAULT_HELLO_PERIOD) {
148 vty_out(vty, " ip pim hello %d", pim_ifp->pim_hello_period);
149 if (pim_ifp->pim_default_holdtime != -1)
150 vty_out(vty, " %d", pim_ifp->pim_default_holdtime);
151 vty_out(vty, "%s", VTY_NEWLINE);
155 if (PIM_IF_TEST_IGMP(pim_ifp->options)) {
156 vty_out(vty, " ip igmp%s", VTY_NEWLINE);
160 /* IF ip igmp query-interval */
161 if (pim_ifp->igmp_default_query_interval != IGMP_GENERAL_QUERY_INTERVAL)
163 vty_out(vty, " %s %d%s",
164 PIM_CMD_IP_IGMP_QUERY_INTERVAL,
165 pim_ifp->igmp_default_query_interval,
170 /* IF ip igmp query-max-response-time */
171 if (pim_ifp->igmp_query_max_response_time_dsec != IGMP_QUERY_MAX_RESPONSE_TIME_DSEC)
173 vty_out(vty, " %s %d%s",
174 PIM_CMD_IP_IGMP_QUERY_MAX_RESPONSE_TIME_DSEC,
175 pim_ifp->igmp_query_max_response_time_dsec,
180 /* IF ip igmp join */
181 if (pim_ifp->igmp_join_list) {
182 struct listnode *node;
183 struct igmp_join *ij;
184 for (ALL_LIST_ELEMENTS_RO(pim_ifp->igmp_join_list, node, ij)) {
186 char source_str[100];
187 pim_inet4_dump("<grp?>", ij->group_addr, group_str, sizeof(group_str));
188 pim_inet4_dump("<src?>", ij->source_addr, source_str, sizeof(source_str));
189 vty_out(vty, " ip igmp join %s %s%s",
190 group_str, source_str,
196 writes += pim_static_write_mroute (vty, ifp);
198 vty_out(vty, "!%s", VTY_NEWLINE);