2015-02-04 07:01:14 +01:00
|
|
|
/*
|
2017-05-13 10:25:29 +02:00
|
|
|
* 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
|
|
|
|
*/
|
2015-02-04 07:01:14 +01:00
|
|
|
|
|
|
|
#include <zebra.h>
|
|
|
|
|
|
|
|
#include "if.h"
|
|
|
|
#include "linklist.h"
|
2016-09-13 21:41:33 +02:00
|
|
|
#include "prefix.h"
|
|
|
|
#include "vty.h"
|
2016-05-25 07:31:30 +02:00
|
|
|
#include "vrf.h"
|
2016-09-13 21:41:33 +02:00
|
|
|
#include "plist.h"
|
2015-02-04 07:01:14 +01:00
|
|
|
|
|
|
|
#include "pimd.h"
|
|
|
|
#include "pim_vty.h"
|
|
|
|
#include "pim_iface.h"
|
|
|
|
#include "pim_str.h"
|
|
|
|
#include "pim_ssmpingd.h"
|
2015-06-19 03:14:20 +02:00
|
|
|
#include "pim_pim.h"
|
2016-07-12 21:09:25 +02:00
|
|
|
#include "pim_oil.h"
|
2016-06-01 21:31:02 +02:00
|
|
|
#include "pim_static.h"
|
2016-08-05 15:07:46 +02:00
|
|
|
#include "pim_rp.h"
|
2016-10-31 20:29:17 +01:00
|
|
|
#include "pim_msdp.h"
|
2017-03-17 19:51:13 +01:00
|
|
|
#include "pim_ssm.h"
|
2017-04-11 03:01:53 +02:00
|
|
|
#include "pim_bfd.h"
|
2019-05-02 17:04:47 +02:00
|
|
|
#include "pim_bsm.h"
|
2019-03-26 21:47:54 +01:00
|
|
|
#include "pim_vxlan.h"
|
2015-02-04 07:01:14 +01:00
|
|
|
|
2016-07-27 03:00:09 +02:00
|
|
|
int pim_debug_config_write(struct vty *vty)
|
2015-02-04 07:01:14 +01:00
|
|
|
{
|
|
|
|
int writes = 0;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2016-10-25 19:59:48 +02:00
|
|
|
if (PIM_DEBUG_MSDP_EVENTS) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, "debug msdp events\n");
|
2016-10-25 19:59:48 +02:00
|
|
|
++writes;
|
|
|
|
}
|
|
|
|
if (PIM_DEBUG_MSDP_PACKETS) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, "debug msdp packets\n");
|
2016-10-25 19:59:48 +02:00
|
|
|
++writes;
|
|
|
|
}
|
2016-11-12 14:39:44 +01:00
|
|
|
if (PIM_DEBUG_MSDP_INTERNAL) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, "debug msdp internal\n");
|
2016-11-12 14:39:44 +01:00
|
|
|
++writes;
|
|
|
|
}
|
2015-02-04 07:01:14 +01:00
|
|
|
if (PIM_DEBUG_IGMP_EVENTS) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, "debug igmp events\n");
|
2015-02-04 07:01:14 +01:00
|
|
|
++writes;
|
|
|
|
}
|
|
|
|
if (PIM_DEBUG_IGMP_PACKETS) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, "debug igmp packets\n");
|
2015-02-04 07:01:14 +01:00
|
|
|
++writes;
|
|
|
|
}
|
2022-04-25 14:01:42 +02:00
|
|
|
/* PIM_DEBUG_IGMP_TRACE catches _DETAIL too */
|
|
|
|
if (router->debugs & PIM_MASK_IGMP_TRACE) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, "debug igmp trace\n");
|
2015-02-04 07:01:14 +01:00
|
|
|
++writes;
|
2022-04-25 14:01:42 +02:00
|
|
|
}
|
|
|
|
if (PIM_DEBUG_IGMP_TRACE_DETAIL) {
|
|
|
|
vty_out(vty, "debug igmp trace detail\n");
|
|
|
|
++writes;
|
2015-02-04 07:01:14 +01:00
|
|
|
}
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2022-04-25 13:53:17 +02:00
|
|
|
/* PIM_DEBUG_MROUTE catches _DETAIL too */
|
|
|
|
if (router->debugs & PIM_MASK_MROUTE) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, "debug mroute\n");
|
2015-02-04 07:01:14 +01:00
|
|
|
++writes;
|
|
|
|
}
|
2022-04-25 13:53:17 +02:00
|
|
|
if (PIM_DEBUG_MROUTE_DETAIL) {
|
|
|
|
vty_out(vty, "debug mroute detail\n");
|
2018-02-12 23:41:33 +01:00
|
|
|
++writes;
|
|
|
|
}
|
|
|
|
|
2022-04-25 13:53:17 +02:00
|
|
|
if (PIM_DEBUG_MTRACE) {
|
|
|
|
vty_out(vty, "debug mtrace\n");
|
2016-08-17 03:13:22 +02:00
|
|
|
++writes;
|
|
|
|
}
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2015-02-04 07:01:14 +01:00
|
|
|
if (PIM_DEBUG_PIM_EVENTS) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, "debug pim events\n");
|
2015-02-04 07:01:14 +01:00
|
|
|
++writes;
|
|
|
|
}
|
|
|
|
if (PIM_DEBUG_PIM_PACKETS) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, "debug pim packets\n");
|
2015-02-04 07:01:14 +01:00
|
|
|
++writes;
|
|
|
|
}
|
|
|
|
if (PIM_DEBUG_PIM_PACKETDUMP_SEND) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, "debug pim packet-dump send\n");
|
2015-02-04 07:01:14 +01:00
|
|
|
++writes;
|
|
|
|
}
|
|
|
|
if (PIM_DEBUG_PIM_PACKETDUMP_RECV) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, "debug pim packet-dump receive\n");
|
2015-02-04 07:01:14 +01:00
|
|
|
++writes;
|
|
|
|
}
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2022-04-25 13:53:17 +02:00
|
|
|
/* PIM_DEBUG_PIM_TRACE catches _DETAIL too */
|
|
|
|
if (router->debugs & PIM_MASK_PIM_TRACE) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, "debug pim trace\n");
|
2015-02-04 07:01:14 +01:00
|
|
|
++writes;
|
|
|
|
}
|
2022-04-25 13:53:17 +02:00
|
|
|
if (PIM_DEBUG_PIM_TRACE_DETAIL) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, "debug pim trace detail\n");
|
2016-07-27 03:00:09 +02:00
|
|
|
++writes;
|
|
|
|
}
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2015-02-04 07:01:14 +01:00
|
|
|
if (PIM_DEBUG_ZEBRA) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, "debug pim zebra\n");
|
2015-02-04 07:01:14 +01:00
|
|
|
++writes;
|
|
|
|
}
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2020-02-19 15:52:17 +01:00
|
|
|
if (PIM_DEBUG_MLAG) {
|
|
|
|
vty_out(vty, "debug pim mlag\n");
|
|
|
|
++writes;
|
|
|
|
}
|
|
|
|
|
2019-05-02 17:04:47 +02:00
|
|
|
if (PIM_DEBUG_BSM) {
|
|
|
|
vty_out(vty, "debug pim bsm\n");
|
|
|
|
++writes;
|
|
|
|
}
|
|
|
|
|
2019-03-25 01:34:45 +01:00
|
|
|
if (PIM_DEBUG_VXLAN) {
|
|
|
|
vty_out(vty, "debug pim vxlan\n");
|
|
|
|
++writes;
|
|
|
|
}
|
|
|
|
|
2015-02-04 07:01:14 +01:00
|
|
|
if (PIM_DEBUG_SSMPINGD) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, "debug ssmpingd\n");
|
2015-02-04 07:01:14 +01:00
|
|
|
++writes;
|
|
|
|
}
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2016-07-27 03:00:09 +02:00
|
|
|
if (PIM_DEBUG_PIM_HELLO) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, "debug pim packets hello\n");
|
2016-07-27 03:00:09 +02:00
|
|
|
++writes;
|
|
|
|
}
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2016-07-27 03:00:09 +02:00
|
|
|
if (PIM_DEBUG_PIM_J_P) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, "debug pim packets joins\n");
|
2016-07-27 03:00:09 +02:00
|
|
|
++writes;
|
|
|
|
}
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2016-08-03 03:44:29 +02:00
|
|
|
if (PIM_DEBUG_PIM_REG) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, "debug pim packets register\n");
|
2016-08-03 03:44:29 +02:00
|
|
|
++writes;
|
|
|
|
}
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2016-07-27 03:00:09 +02:00
|
|
|
if (PIM_DEBUG_STATIC) {
|
2017-07-13 17:49:13 +02:00
|
|
|
vty_out(vty, "debug pim static\n");
|
2016-07-27 03:00:09 +02:00
|
|
|
++writes;
|
|
|
|
}
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2017-06-30 16:43:21 +02:00
|
|
|
if (PIM_DEBUG_PIM_NHT) {
|
|
|
|
vty_out(vty, "debug pim nht\n");
|
|
|
|
++writes;
|
|
|
|
}
|
|
|
|
|
2022-01-21 12:02:16 +01:00
|
|
|
if (PIM_DEBUG_PIM_NHT_RP) {
|
|
|
|
vty_out(vty, "debug pim nht rp\n");
|
|
|
|
++writes;
|
|
|
|
}
|
|
|
|
|
2021-12-02 06:07:02 +01:00
|
|
|
if (PIM_DEBUG_PIM_NHT_DETAIL) {
|
|
|
|
vty_out(vty, "debug pim nht detail\n");
|
|
|
|
++writes;
|
|
|
|
}
|
|
|
|
|
2015-02-04 07:01:14 +01:00
|
|
|
return writes;
|
|
|
|
}
|
|
|
|
|
2017-05-22 21:13:13 +02:00
|
|
|
int pim_global_config_write_worker(struct pim_instance *pim, struct vty *vty)
|
2015-02-04 07:01:14 +01:00
|
|
|
{
|
2016-08-05 15:07:46 +02:00
|
|
|
int writes = 0;
|
2017-07-14 15:19:13 +02:00
|
|
|
struct pim_ssm *ssm = pim->ssm_info;
|
2017-05-22 21:35:42 +02:00
|
|
|
char spaces[10];
|
|
|
|
|
2021-05-12 20:31:45 +02:00
|
|
|
if (pim->vrf->vrf_id == VRF_DEFAULT)
|
2020-04-20 20:12:38 +02:00
|
|
|
snprintf(spaces, sizeof(spaces), "%s", "");
|
2017-05-22 21:35:42 +02:00
|
|
|
else
|
2020-04-20 20:12:38 +02:00
|
|
|
snprintf(spaces, sizeof(spaces), "%s", " ");
|
2015-02-04 07:01:14 +01:00
|
|
|
|
2021-05-03 17:30:40 +02:00
|
|
|
writes += pim_msdp_peer_config_write(vty, pim, spaces);
|
2018-12-21 15:19:26 +01:00
|
|
|
writes += pim_msdp_config_write(pim, vty, spaces);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2017-07-14 15:19:13 +02:00
|
|
|
if (!pim->send_v6_secondary) {
|
2017-05-22 21:49:01 +02:00
|
|
|
vty_out(vty, "%sno ip pim send-v6-secondary\n", spaces);
|
2016-10-20 15:34:29 +02:00
|
|
|
++writes;
|
2015-09-30 15:10:12 +02:00
|
|
|
}
|
2015-02-04 07:01:14 +01:00
|
|
|
|
2017-05-22 21:35:42 +02:00
|
|
|
writes += pim_rp_config_write(pim, vty, spaces);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2021-05-12 20:31:45 +02:00
|
|
|
if (pim->vrf->vrf_id == VRF_DEFAULT) {
|
2021-05-03 20:59:01 +02:00
|
|
|
if (router->register_suppress_time
|
|
|
|
!= PIM_REGISTER_SUPPRESSION_TIME_DEFAULT) {
|
2022-01-19 09:16:03 +01:00
|
|
|
vty_out(vty, "%s" PIM_AF_NAME " pim register-suppress-time %d\n",
|
|
|
|
spaces, router->register_suppress_time);
|
2021-05-03 20:59:01 +02:00
|
|
|
++writes;
|
|
|
|
}
|
|
|
|
if (router->t_periodic != PIM_DEFAULT_T_PERIODIC) {
|
2022-01-19 09:16:03 +01:00
|
|
|
vty_out(vty, "%s" PIM_AF_NAME " pim join-prune-interval %d\n",
|
2021-05-03 20:59:01 +02:00
|
|
|
spaces, router->t_periodic);
|
|
|
|
++writes;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (router->packet_process != PIM_DEFAULT_PACKET_PROCESS) {
|
2022-01-19 09:16:03 +01:00
|
|
|
vty_out(vty, "%s" PIM_AF_NAME " pim packets %d\n", spaces,
|
2021-05-03 20:59:01 +02:00
|
|
|
router->packet_process);
|
|
|
|
++writes;
|
|
|
|
}
|
2017-07-17 14:03:14 +02:00
|
|
|
}
|
2017-07-13 03:16:00 +02:00
|
|
|
if (pim->keep_alive_time != PIM_KEEPALIVE_PERIOD) {
|
2022-01-19 09:16:03 +01:00
|
|
|
vty_out(vty, "%s" PIM_AF_NAME " pim keep-alive-timer %d\n",
|
|
|
|
spaces, pim->keep_alive_time);
|
2016-12-06 21:48:42 +01:00
|
|
|
++writes;
|
2017-07-17 14:03:14 +02:00
|
|
|
}
|
2017-08-02 14:15:45 +02:00
|
|
|
if (pim->rp_keep_alive_time != (unsigned int)PIM_RP_KEEPALIVE_PERIOD) {
|
2022-01-19 09:16:03 +01:00
|
|
|
vty_out(vty, "%s" PIM_AF_NAME " pim rp keep-alive-timer %d\n",
|
|
|
|
spaces, pim->rp_keep_alive_time);
|
2017-08-02 14:15:45 +02:00
|
|
|
++writes;
|
|
|
|
}
|
2017-03-17 19:51:13 +01:00
|
|
|
if (ssm->plist_name) {
|
2017-05-22 21:49:01 +02:00
|
|
|
vty_out(vty, "%sip pim ssm prefix-list %s\n", spaces,
|
|
|
|
ssm->plist_name);
|
2016-11-18 18:50:46 +01:00
|
|
|
++writes;
|
2020-02-20 18:14:03 +01:00
|
|
|
}
|
|
|
|
if (pim->register_plist) {
|
|
|
|
vty_out(vty, "%sip pim register-accept-list %s\n", spaces,
|
|
|
|
pim->register_plist);
|
|
|
|
++writes;
|
2017-07-17 14:03:14 +02:00
|
|
|
}
|
2017-07-14 15:19:13 +02:00
|
|
|
if (pim->spt.switchover == PIM_SPT_INFINITY) {
|
|
|
|
if (pim->spt.plist)
|
2015-08-22 01:35:27 +02:00
|
|
|
vty_out(vty,
|
2022-01-19 09:16:03 +01:00
|
|
|
"%s" PIM_AF_NAME " pim spt-switchover infinity-and-beyond prefix-list %s\n",
|
2017-05-22 21:49:01 +02:00
|
|
|
spaces, pim->spt.plist);
|
2017-07-17 14:03:14 +02:00
|
|
|
else
|
2015-08-22 01:35:27 +02:00
|
|
|
vty_out(vty,
|
2022-01-19 09:16:03 +01:00
|
|
|
"%s" PIM_AF_NAME " pim spt-switchover infinity-and-beyond\n",
|
2017-05-22 21:49:01 +02:00
|
|
|
spaces);
|
2017-03-17 19:51:13 +01:00
|
|
|
++writes;
|
2017-07-17 14:03:14 +02:00
|
|
|
}
|
2018-06-07 16:23:32 +02:00
|
|
|
if (pim->ecmp_rebalance_enable) {
|
2017-05-22 21:49:01 +02:00
|
|
|
vty_out(vty, "%sip pim ecmp rebalance\n", spaces);
|
2017-04-05 18:08:53 +02:00
|
|
|
++writes;
|
2018-06-07 16:23:32 +02:00
|
|
|
} else if (pim->ecmp_enable) {
|
2017-05-22 21:49:01 +02:00
|
|
|
vty_out(vty, "%sip pim ecmp\n", spaces);
|
2017-04-05 18:08:53 +02:00
|
|
|
++writes;
|
2017-07-17 14:03:14 +02:00
|
|
|
}
|
pimd: Implement watermark warning for igmp group count and add igmp group count
This CLI will allow user to configure a igmp group limit which will generate
a watermark warning when reached.
Though watermark may not make sense without setting a limit, this
implementation shall serve as a base to implementing limit in future and helps
tracking a particular scale currently.
Testing:
=======
ip igmp watermark-warn <10-60000>
on reaching the configured number of group, pim will issue warning
2019/09/18 18:30:55 PIM: SCALE ALERT: igmp group count reached watermak limit: 210(vrf: default)
Also added group count and watermark limit configured on cli - show ip igmp groups [json]
<snip>
Sw3# sh ip igmp groups json
{
"Total Groups":221, <=====
"Watermark limit":210, <=========
"ens224":{
"name":"ens224",
"state":"up",
"address":"40.0.0.1",
"index":6,
"flagMulticast":true,
"flagBroadcast":true,
"lanDelayEnabled":true,
"groups":[
{
"source":"40.0.0.1",
"group":"225.1.1.122",
"timer":"00:03:56",
"sourcesCount":1,
"version":2,
"uptime":"00:00:24"
<\snip>
<snip>
Sw3(config)# do sh ip igmp group
Total IGMP groups: 221
Watermark warn limit(Set) : 210
Interface Address Group Mode Timer Srcs V Uptime
ens224 40.0.0.1 225.1.1.122 ---- 00:04:06 1 2 00:13:22
ens224 40.0.0.1 225.1.1.144 ---- 00:04:02 1 2 00:13:22
ens224 40.0.0.1 225.1.1.57 ---- 00:04:01 1 2 00:13:22
ens224 40.0.0.1 225.1.1.210 ---- 00:04:06 1 2 00:13:22
<\snip>
Signed-off-by: Saravanan K <saravanank@vmware.com>
2020-04-01 04:34:13 +02:00
|
|
|
|
|
|
|
if (pim->igmp_watermark_limit != 0) {
|
|
|
|
vty_out(vty, "%sip igmp watermark-warn %u\n", spaces,
|
|
|
|
pim->igmp_watermark_limit);
|
|
|
|
++writes;
|
|
|
|
}
|
|
|
|
|
2017-05-22 17:09:13 +02:00
|
|
|
if (pim->ssmpingd_list) {
|
2015-02-04 07:01:14 +01:00
|
|
|
struct listnode *node;
|
2017-03-17 19:51:13 +01:00
|
|
|
struct ssmpingd_sock *ss;
|
2017-04-10 22:27:56 +02:00
|
|
|
++writes;
|
2017-05-22 17:09:13 +02:00
|
|
|
for (ALL_LIST_ELEMENTS_RO(pim->ssmpingd_list, node, ss)) {
|
2022-04-04 15:01:50 +02:00
|
|
|
vty_out(vty, "%s" PIM_AF_NAME " ssmpingd %pPA\n",
|
|
|
|
spaces, &ss->source_addr);
|
2017-04-10 22:27:56 +02:00
|
|
|
++writes;
|
2017-07-17 14:03:14 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-20 21:17:48 +02:00
|
|
|
if (pim->msdp.hold_time != PIM_MSDP_PEER_HOLD_TIME
|
|
|
|
|| pim->msdp.keep_alive != PIM_MSDP_PEER_KA_TIME
|
|
|
|
|| pim->msdp.connection_retry != PIM_MSDP_PEER_CONNECT_RETRY_TIME) {
|
|
|
|
vty_out(vty, "%sip msdp timers %u %u", spaces,
|
|
|
|
pim->msdp.hold_time, pim->msdp.keep_alive);
|
|
|
|
if (pim->msdp.connection_retry
|
|
|
|
!= PIM_MSDP_PEER_CONNECT_RETRY_TIME)
|
|
|
|
vty_out(vty, " %u", pim->msdp.connection_retry);
|
|
|
|
vty_out(vty, "\n");
|
|
|
|
}
|
|
|
|
|
2015-02-04 07:01:14 +01:00
|
|
|
return writes;
|
2017-07-17 14:03:14 +02:00
|
|
|
}
|
2015-02-04 07:01:14 +01:00
|
|
|
|
2022-01-19 14:00:56 +01:00
|
|
|
#if PIM_IPV == 4
|
2022-02-25 12:01:57 +01:00
|
|
|
static int pim_igmp_config_write(struct vty *vty, int writes,
|
|
|
|
struct pim_interface *pim_ifp)
|
2022-01-19 14:00:56 +01:00
|
|
|
{
|
|
|
|
/* IF ip igmp */
|
2022-04-04 14:00:59 +02:00
|
|
|
if (pim_ifp->igmp_enable) {
|
2022-01-19 14:00:56 +01:00
|
|
|
vty_out(vty, " ip igmp\n");
|
|
|
|
++writes;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* ip igmp version */
|
|
|
|
if (pim_ifp->igmp_version != IGMP_DEFAULT_VERSION) {
|
|
|
|
vty_out(vty, " ip igmp version %d\n", pim_ifp->igmp_version);
|
|
|
|
++writes;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* IF ip igmp query-max-response-time */
|
|
|
|
if (pim_ifp->gm_query_max_response_time_dsec !=
|
|
|
|
IGMP_QUERY_MAX_RESPONSE_TIME_DSEC) {
|
|
|
|
vty_out(vty, " ip igmp query-max-response-time %d\n",
|
|
|
|
pim_ifp->gm_query_max_response_time_dsec);
|
|
|
|
++writes;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* IF ip igmp query-interval */
|
|
|
|
if (pim_ifp->gm_default_query_interval != IGMP_GENERAL_QUERY_INTERVAL) {
|
|
|
|
vty_out(vty, " ip igmp query-interval %d\n",
|
|
|
|
pim_ifp->gm_default_query_interval);
|
|
|
|
++writes;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* IF ip igmp last-member_query-count */
|
|
|
|
if (pim_ifp->gm_last_member_query_count !=
|
|
|
|
IGMP_DEFAULT_ROBUSTNESS_VARIABLE) {
|
|
|
|
vty_out(vty, " ip igmp last-member-query-count %d\n",
|
|
|
|
pim_ifp->gm_last_member_query_count);
|
|
|
|
++writes;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* IF ip igmp last-member_query-interval */
|
|
|
|
if (pim_ifp->gm_specific_query_max_response_time_dsec !=
|
|
|
|
IGMP_SPECIFIC_QUERY_MAX_RESPONSE_TIME_DSEC) {
|
|
|
|
vty_out(vty, " ip igmp last-member-query-interval %d\n",
|
|
|
|
pim_ifp->gm_specific_query_max_response_time_dsec);
|
|
|
|
++writes;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* IF ip igmp join */
|
|
|
|
if (pim_ifp->gm_join_list) {
|
|
|
|
struct listnode *node;
|
|
|
|
struct gm_join *ij;
|
|
|
|
for (ALL_LIST_ELEMENTS_RO(pim_ifp->gm_join_list, node, ij)) {
|
|
|
|
char group_str[INET_ADDRSTRLEN];
|
|
|
|
char source_str[INET_ADDRSTRLEN];
|
|
|
|
pim_inet4_dump("<grp?>", ij->group_addr, group_str,
|
|
|
|
sizeof(group_str));
|
|
|
|
if (ij->source_addr.s_addr == INADDR_ANY) {
|
|
|
|
vty_out(vty, " ip igmp join %s\n", group_str);
|
|
|
|
} else {
|
|
|
|
inet_ntop(AF_INET, &ij->source_addr, source_str,
|
|
|
|
sizeof(source_str));
|
|
|
|
vty_out(vty, " ip igmp join %s %s\n", group_str,
|
|
|
|
source_str);
|
|
|
|
}
|
|
|
|
++writes;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-02-25 12:01:57 +01:00
|
|
|
return writes;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
int pim_config_write(struct vty *vty, int writes, struct interface *ifp,
|
|
|
|
struct pim_instance *pim)
|
|
|
|
{
|
|
|
|
struct pim_interface *pim_ifp = ifp->info;
|
|
|
|
|
2022-04-04 14:00:59 +02:00
|
|
|
if (pim_ifp->pim_enable) {
|
2022-01-19 14:16:55 +01:00
|
|
|
vty_out(vty, " " PIM_AF_NAME " pim\n");
|
2022-02-25 12:01:57 +01:00
|
|
|
++writes;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* IF ip pim drpriority */
|
|
|
|
if (pim_ifp->pim_dr_priority != PIM_DEFAULT_DR_PRIORITY) {
|
2022-01-19 14:16:55 +01:00
|
|
|
vty_out(vty, " " PIM_AF_NAME " pim drpriority %u\n",
|
2022-02-25 12:01:57 +01:00
|
|
|
pim_ifp->pim_dr_priority);
|
|
|
|
++writes;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* IF ip pim hello */
|
|
|
|
if (pim_ifp->pim_hello_period != PIM_DEFAULT_HELLO_PERIOD) {
|
2022-01-19 14:16:55 +01:00
|
|
|
vty_out(vty, " " PIM_AF_NAME " pim hello %d", pim_ifp->pim_hello_period);
|
2022-02-25 12:01:57 +01:00
|
|
|
if (pim_ifp->pim_default_holdtime != -1)
|
|
|
|
vty_out(vty, " %d", pim_ifp->pim_default_holdtime);
|
|
|
|
vty_out(vty, "\n");
|
|
|
|
++writes;
|
|
|
|
}
|
|
|
|
|
2022-01-19 14:16:55 +01:00
|
|
|
#if PIM_IPV == 4
|
2022-02-25 12:01:57 +01:00
|
|
|
writes += pim_igmp_config_write(vty, writes, pim_ifp);
|
2022-01-19 14:16:55 +01:00
|
|
|
#endif
|
2022-02-25 12:01:57 +01:00
|
|
|
|
|
|
|
/* update source */
|
|
|
|
if (!pim_addr_is_any(pim_ifp->update_source)) {
|
2022-01-19 14:16:55 +01:00
|
|
|
vty_out(vty, " " PIM_AF_NAME " pim use-source %pPA\n",
|
2022-02-25 12:01:57 +01:00
|
|
|
&pim_ifp->update_source);
|
|
|
|
++writes;
|
|
|
|
}
|
|
|
|
|
2022-01-19 14:00:56 +01:00
|
|
|
if (pim_ifp->activeactive)
|
2022-01-19 14:16:55 +01:00
|
|
|
vty_out(vty, " " PIM_AF_NAME " pim active-active\n");
|
2022-01-19 14:00:56 +01:00
|
|
|
|
|
|
|
/* boundary */
|
|
|
|
if (pim_ifp->boundary_oil_plist) {
|
2022-01-19 14:16:55 +01:00
|
|
|
vty_out(vty, " " PIM_AF_NAME " multicast boundary oil %s\n",
|
2022-01-19 14:00:56 +01:00
|
|
|
pim_ifp->boundary_oil_plist);
|
|
|
|
++writes;
|
|
|
|
}
|
|
|
|
|
|
|
|
writes += pim_static_write_mroute(pim, vty, ifp);
|
|
|
|
pim_bsm_write_config(vty, ifp);
|
|
|
|
++writes;
|
|
|
|
pim_bfd_write_config(vty, ifp);
|
|
|
|
++writes;
|
|
|
|
|
|
|
|
return writes;
|
|
|
|
}
|
|
|
|
|
2015-02-04 07:01:14 +01:00
|
|
|
int pim_interface_config_write(struct vty *vty)
|
|
|
|
{
|
2017-05-18 23:25:52 +02:00
|
|
|
struct pim_instance *pim;
|
2015-02-04 07:01:14 +01:00
|
|
|
struct interface *ifp;
|
2017-05-18 23:25:52 +02:00
|
|
|
struct vrf *vrf;
|
|
|
|
int writes = 0;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2017-09-15 17:47:35 +02:00
|
|
|
RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
|
2017-05-18 23:25:52 +02:00
|
|
|
pim = vrf->info;
|
|
|
|
if (!pim)
|
|
|
|
continue;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2017-10-06 20:25:58 +02:00
|
|
|
FOR_ALL_INTERFACES (pim->vrf, ifp) {
|
2020-06-19 00:55:02 +02:00
|
|
|
/* pim is enabled internally/implicitly on the vxlan
|
|
|
|
* termination device ipmr-lo. skip displaying that
|
|
|
|
* config to avoid confusion
|
|
|
|
*/
|
|
|
|
if (pim_vxlan_is_term_dev_cfg(pim, ifp))
|
|
|
|
continue;
|
|
|
|
|
2017-05-18 23:25:52 +02:00
|
|
|
/* IF name */
|
2022-01-23 22:07:20 +01:00
|
|
|
if_vty_config_start(vty, ifp);
|
|
|
|
|
2017-05-18 23:25:52 +02:00
|
|
|
++writes;
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2018-07-09 02:39:37 +02:00
|
|
|
if (ifp->desc) {
|
|
|
|
vty_out(vty, " description %s\n", ifp->desc);
|
|
|
|
++writes;
|
|
|
|
}
|
2022-01-19 14:16:55 +01:00
|
|
|
|
|
|
|
if (ifp->info) {
|
2022-01-19 14:00:56 +01:00
|
|
|
pim_config_write(vty, writes, ifp, pim);
|
2022-01-19 14:16:55 +01:00
|
|
|
}
|
2022-01-23 22:07:20 +01:00
|
|
|
if_vty_config_end(vty);
|
2022-01-19 14:16:55 +01:00
|
|
|
|
2017-05-18 23:25:52 +02:00
|
|
|
++writes;
|
2017-07-17 14:03:14 +02:00
|
|
|
}
|
2015-02-04 07:01:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return writes;
|
|
|
|
}
|