2023-02-08 13:17:09 +01:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
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
|
|
|
|
*/
|
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"
|
2022-04-04 13:44:20 +02:00
|
|
|
#include "pim6_mld.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;
|
|
|
|
}
|
2022-09-02 13:00:10 +02:00
|
|
|
if (PIM_DEBUG_GM_EVENTS) {
|
2022-09-26 09:09:45 +02:00
|
|
|
vty_out(vty, "debug " GM_AF_DBG " events\n");
|
2015-02-04 07:01:14 +01:00
|
|
|
++writes;
|
|
|
|
}
|
2022-09-05 07:45:33 +02:00
|
|
|
if (PIM_DEBUG_GM_PACKETS) {
|
2022-09-26 09:09:45 +02:00
|
|
|
vty_out(vty, "debug " GM_AF_DBG " packets\n");
|
2015-02-04 07:01:14 +01:00
|
|
|
++writes;
|
|
|
|
}
|
2022-09-14 08:29:33 +02:00
|
|
|
/* PIM_DEBUG_GM_TRACE catches _DETAIL too */
|
2022-09-01 07:20:00 +02:00
|
|
|
if (router->debugs & PIM_MASK_GM_TRACE) {
|
2022-09-26 09:09:45 +02:00
|
|
|
vty_out(vty, "debug " GM_AF_DBG " trace\n");
|
2015-02-04 07:01:14 +01:00
|
|
|
++writes;
|
2022-04-25 14:01:42 +02:00
|
|
|
}
|
2022-09-14 08:29:33 +02:00
|
|
|
if (PIM_DEBUG_GM_TRACE_DETAIL) {
|
2022-09-26 09:09:45 +02:00
|
|
|
vty_out(vty, "debug " GM_AF_DBG " trace detail\n");
|
2022-04-25 14:01:42 +02:00
|
|
|
++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) {
|
2022-08-16 09:42:26 +02:00
|
|
|
vty_out(vty, "debug " PIM_MROUTE_DBG "\n");
|
2015-02-04 07:01:14 +01:00
|
|
|
++writes;
|
|
|
|
}
|
2022-04-25 13:53:17 +02:00
|
|
|
if (PIM_DEBUG_MROUTE_DETAIL) {
|
2022-08-16 09:42:26 +02:00
|
|
|
vty_out(vty, "debug " PIM_MROUTE_DBG " 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) {
|
2022-06-17 13:39:59 +02:00
|
|
|
vty_out(vty, "debug " PIM_AF_DBG " events\n");
|
2015-02-04 07:01:14 +01:00
|
|
|
++writes;
|
|
|
|
}
|
|
|
|
if (PIM_DEBUG_PIM_PACKETS) {
|
2022-06-17 13:39:59 +02:00
|
|
|
vty_out(vty, "debug " PIM_AF_DBG " packets\n");
|
2015-02-04 07:01:14 +01:00
|
|
|
++writes;
|
|
|
|
}
|
|
|
|
if (PIM_DEBUG_PIM_PACKETDUMP_SEND) {
|
2022-06-17 13:39:59 +02:00
|
|
|
vty_out(vty, "debug " PIM_AF_DBG " packet-dump send\n");
|
2015-02-04 07:01:14 +01:00
|
|
|
++writes;
|
|
|
|
}
|
|
|
|
if (PIM_DEBUG_PIM_PACKETDUMP_RECV) {
|
2022-06-17 13:39:59 +02:00
|
|
|
vty_out(vty, "debug " PIM_AF_DBG " 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) {
|
2022-06-17 13:39:59 +02:00
|
|
|
vty_out(vty, "debug " PIM_AF_DBG " 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) {
|
2022-06-17 13:39:59 +02:00
|
|
|
vty_out(vty, "debug " PIM_AF_DBG " 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) {
|
2022-06-17 13:39:59 +02:00
|
|
|
vty_out(vty, "debug " PIM_AF_DBG " 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) {
|
2022-08-02 15:34:30 +02:00
|
|
|
vty_out(vty, "debug " PIM_AF_DBG " bsm\n");
|
2019-05-02 17:04:47 +02:00
|
|
|
++writes;
|
|
|
|
}
|
|
|
|
|
2019-03-25 01:34:45 +01:00
|
|
|
if (PIM_DEBUG_VXLAN) {
|
2022-08-02 15:34:30 +02:00
|
|
|
vty_out(vty, "debug " PIM_AF_DBG " vxlan\n");
|
2019-03-25 01:34:45 +01:00
|
|
|
++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) {
|
2022-06-17 13:39:59 +02:00
|
|
|
vty_out(vty, "debug " PIM_AF_DBG " 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) {
|
2022-06-17 13:39:59 +02:00
|
|
|
vty_out(vty, "debug " PIM_AF_DBG " 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) {
|
2022-06-17 13:39:59 +02:00
|
|
|
vty_out(vty, "debug " PIM_AF_DBG " 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) {
|
2022-06-17 13:39:59 +02:00
|
|
|
vty_out(vty, "debug " PIM_AF_DBG " nht\n");
|
2017-06-30 16:43:21 +02:00
|
|
|
++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) {
|
2022-06-17 13:39:59 +02:00
|
|
|
vty_out(vty, "debug " PIM_AF_DBG " nht detail\n");
|
2021-12-02 06:07:02 +01:00
|
|
|
++writes;
|
|
|
|
}
|
|
|
|
|
2024-09-17 04:10:03 +02:00
|
|
|
if (PIM_DEBUG_AUTORP) {
|
|
|
|
vty_out(vty, "debug pim autorp\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
|
|
|
|
2024-06-12 18:26:48 +02:00
|
|
|
writes += pim_msdp_peer_config_write(vty, pim);
|
|
|
|
writes += pim_msdp_config_write(pim, vty);
|
2017-07-17 14:03:14 +02:00
|
|
|
|
2017-07-14 15:19:13 +02:00
|
|
|
if (!pim->send_v6_secondary) {
|
2024-06-12 18:26:48 +02:00
|
|
|
vty_out(vty, " no send-v6-secondary\n");
|
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
|
|
|
|
2024-10-02 14:22:48 +02:00
|
|
|
#if PIM_IPV == 6
|
|
|
|
if (pim->embedded_rp.enable) {
|
|
|
|
vty_out(vty, " embedded-rp\n");
|
|
|
|
writes++;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (pim->embedded_rp.maximum_rps != PIM_EMBEDDED_RP_MAXIMUM) {
|
|
|
|
vty_out(vty, " embedded-rp limit %u\n", pim->embedded_rp.maximum_rps);
|
|
|
|
writes++;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (pim->embedded_rp.group_list) {
|
|
|
|
vty_out(vty, " embedded-rp group-list %s\n", pim->embedded_rp.group_list);
|
|
|
|
writes++;
|
|
|
|
}
|
|
|
|
#endif /* PIM_IPV == 6 */
|
|
|
|
|
2024-06-12 18:26:48 +02:00
|
|
|
writes += pim_rp_config_write(pim, vty);
|
2024-09-17 04:10:03 +02:00
|
|
|
#if PIM_IPV == 4
|
|
|
|
writes += pim_autorp_config_write(pim, vty);
|
|
|
|
#endif
|
2024-07-23 07:45:02 +02:00
|
|
|
writes += pim_cand_config_write(pim, vty);
|
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) {
|
2024-06-12 18:26:48 +02:00
|
|
|
vty_out(vty, " register-suppress-time %d\n",
|
|
|
|
router->register_suppress_time);
|
2021-05-03 20:59:01 +02:00
|
|
|
++writes;
|
|
|
|
}
|
|
|
|
if (router->t_periodic != PIM_DEFAULT_T_PERIODIC) {
|
2024-06-12 18:26:48 +02:00
|
|
|
vty_out(vty, " join-prune-interval %d\n",
|
|
|
|
router->t_periodic);
|
2021-05-03 20:59:01 +02:00
|
|
|
++writes;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (router->packet_process != PIM_DEFAULT_PACKET_PROCESS) {
|
2024-06-12 18:26:48 +02:00
|
|
|
vty_out(vty, " packets %d\n", router->packet_process);
|
2021-05-03 20:59:01 +02:00
|
|
|
++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) {
|
2024-06-12 18:26:48 +02:00
|
|
|
vty_out(vty, " keep-alive-timer %d\n", 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) {
|
2024-06-12 18:26:48 +02:00
|
|
|
vty_out(vty, " rp keep-alive-timer %d\n",
|
|
|
|
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) {
|
2024-06-12 18:26:48 +02:00
|
|
|
vty_out(vty, " ssm prefix-list %s\n", ssm->plist_name);
|
2016-11-18 18:50:46 +01:00
|
|
|
++writes;
|
2020-02-20 18:14:03 +01:00
|
|
|
}
|
|
|
|
if (pim->register_plist) {
|
2024-06-12 18:26:48 +02:00
|
|
|
vty_out(vty, " register-accept-list %s\n", pim->register_plist);
|
2020-02-20 18:14:03 +01:00
|
|
|
++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,
|
2024-06-12 18:26:48 +02:00
|
|
|
" spt-switchover infinity-and-beyond prefix-list %s\n",
|
|
|
|
pim->spt.plist);
|
2017-07-17 14:03:14 +02:00
|
|
|
else
|
2024-06-12 18:26:48 +02:00
|
|
|
vty_out(vty, " spt-switchover infinity-and-beyond\n");
|
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) {
|
2024-06-12 18:26:48 +02:00
|
|
|
vty_out(vty, " ecmp rebalance\n");
|
2017-04-05 18:08:53 +02:00
|
|
|
++writes;
|
2018-06-07 16:23:32 +02:00
|
|
|
} else if (pim->ecmp_enable) {
|
2024-06-12 18:26:48 +02:00
|
|
|
vty_out(vty, " ecmp\n");
|
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
|
|
|
++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)) {
|
2024-06-12 18:26:48 +02:00
|
|
|
vty_out(vty, " ssmpingd %pPA\n", &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) {
|
2024-06-12 18:26:48 +02:00
|
|
|
vty_out(vty, " msdp timers %u %u", pim->msdp.hold_time,
|
|
|
|
pim->msdp.keep_alive);
|
2021-04-20 21:17:48 +02:00
|
|
|
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-04-04 13:44:20 +02:00
|
|
|
static int gm_config_write(struct vty *vty, int writes,
|
|
|
|
struct pim_interface *pim_ifp)
|
2022-01-19 14:00:56 +01:00
|
|
|
{
|
|
|
|
/* IF ip igmp */
|
2022-06-27 14:52:02 +02:00
|
|
|
if (pim_ifp->gm_enable) {
|
2022-01-19 14:00:56 +01:00
|
|
|
vty_out(vty, " ip igmp\n");
|
|
|
|
++writes;
|
|
|
|
}
|
|
|
|
|
2024-08-10 00:37:01 +02:00
|
|
|
if (pim_ifp->gm_proxy) {
|
|
|
|
vty_out(vty, " ip igmp proxy\n");
|
|
|
|
++writes;
|
|
|
|
}
|
|
|
|
|
2022-01-19 14:00:56 +01:00
|
|
|
/* 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 !=
|
2022-08-29 14:17:08 +02:00
|
|
|
GM_QUERY_MAX_RESPONSE_TIME_DSEC) {
|
2022-01-19 14:00:56 +01:00
|
|
|
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 */
|
2022-08-29 14:17:08 +02:00
|
|
|
if (pim_ifp->gm_default_query_interval != GM_GENERAL_QUERY_INTERVAL) {
|
2022-01-19 14:00:56 +01:00
|
|
|
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 !=
|
2022-08-29 14:17:08 +02:00
|
|
|
GM_DEFAULT_ROBUSTNESS_VARIABLE) {
|
2022-01-19 14:00:56 +01:00
|
|
|
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 !=
|
2022-08-29 14:17:08 +02:00
|
|
|
GM_SPECIFIC_QUERY_MAX_RESPONSE_TIME_DSEC) {
|
2022-01-19 14:00:56 +01:00
|
|
|
vty_out(vty, " ip igmp last-member-query-interval %d\n",
|
|
|
|
pim_ifp->gm_specific_query_max_response_time_dsec);
|
|
|
|
++writes;
|
|
|
|
}
|
|
|
|
|
2024-06-26 19:41:45 +02:00
|
|
|
/* IF ip igmp join-group */
|
2022-01-19 14:00:56 +01:00
|
|
|
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)) {
|
2022-12-14 07:34:25 +01:00
|
|
|
if (pim_addr_is_any(ij->source_addr))
|
2024-06-26 19:41:45 +02:00
|
|
|
vty_out(vty, " ip igmp join-group %pPAs\n",
|
2022-12-14 07:34:25 +01:00
|
|
|
&ij->group_addr);
|
|
|
|
else
|
2024-06-26 19:41:45 +02:00
|
|
|
vty_out(vty, " ip igmp join-group %pPAs %pPAs\n",
|
2022-12-14 07:34:25 +01:00
|
|
|
&ij->group_addr, &ij->source_addr);
|
2022-01-19 14:00:56 +01:00
|
|
|
++writes;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-06-26 19:41:45 +02:00
|
|
|
/* IF ip igmp static-group */
|
|
|
|
if (pim_ifp->static_group_list) {
|
|
|
|
struct listnode *node;
|
|
|
|
struct static_group *stgrp;
|
|
|
|
for (ALL_LIST_ELEMENTS_RO(pim_ifp->static_group_list, node,
|
|
|
|
stgrp)) {
|
|
|
|
if (pim_addr_is_any(stgrp->source_addr))
|
|
|
|
vty_out(vty, " ip igmp static-group %pPAs\n",
|
|
|
|
&stgrp->group_addr);
|
|
|
|
else
|
|
|
|
vty_out(vty,
|
|
|
|
" ip igmp static-group %pPAs %pPAs\n",
|
|
|
|
&stgrp->group_addr, &stgrp->source_addr);
|
|
|
|
++writes;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-02-25 12:01:57 +01:00
|
|
|
return writes;
|
|
|
|
}
|
2022-04-04 13:44:20 +02:00
|
|
|
#else
|
|
|
|
static int gm_config_write(struct vty *vty, int writes,
|
|
|
|
struct pim_interface *pim_ifp)
|
|
|
|
{
|
2022-06-28 12:53:04 +02:00
|
|
|
/* IF ipv6 mld */
|
|
|
|
if (pim_ifp->gm_enable) {
|
|
|
|
vty_out(vty, " ipv6 mld\n");
|
|
|
|
++writes;
|
|
|
|
}
|
|
|
|
|
2022-04-04 13:44:20 +02:00
|
|
|
if (pim_ifp->mld_version != MLD_DEFAULT_VERSION)
|
|
|
|
vty_out(vty, " ipv6 mld version %d\n", pim_ifp->mld_version);
|
2022-07-11 10:33:07 +02:00
|
|
|
|
|
|
|
/* IF ipv6 mld query-max-response-time */
|
|
|
|
if (pim_ifp->gm_query_max_response_time_dsec !=
|
2022-08-29 14:17:08 +02:00
|
|
|
GM_QUERY_MAX_RESPONSE_TIME_DSEC)
|
2022-07-11 10:33:07 +02:00
|
|
|
vty_out(vty, " ipv6 mld query-max-response-time %d\n",
|
|
|
|
pim_ifp->gm_query_max_response_time_dsec);
|
|
|
|
|
2022-08-29 14:17:08 +02:00
|
|
|
if (pim_ifp->gm_default_query_interval != GM_GENERAL_QUERY_INTERVAL)
|
2022-04-04 13:44:20 +02:00
|
|
|
vty_out(vty, " ipv6 mld query-interval %d\n",
|
|
|
|
pim_ifp->gm_default_query_interval);
|
2022-07-11 17:51:52 +02:00
|
|
|
|
|
|
|
/* IF ipv6 mld last-member_query-count */
|
|
|
|
if (pim_ifp->gm_last_member_query_count !=
|
2022-08-29 14:17:08 +02:00
|
|
|
GM_DEFAULT_ROBUSTNESS_VARIABLE)
|
2022-07-11 17:51:52 +02:00
|
|
|
vty_out(vty, " ipv6 mld last-member-query-count %d\n",
|
|
|
|
pim_ifp->gm_last_member_query_count);
|
|
|
|
|
2022-07-11 19:09:39 +02:00
|
|
|
/* IF ipv6 mld last-member_query-interval */
|
|
|
|
if (pim_ifp->gm_specific_query_max_response_time_dsec !=
|
2022-08-29 14:17:08 +02:00
|
|
|
GM_SPECIFIC_QUERY_MAX_RESPONSE_TIME_DSEC)
|
2022-07-11 19:09:39 +02:00
|
|
|
vty_out(vty, " ipv6 mld last-member-query-interval %d\n",
|
|
|
|
pim_ifp->gm_specific_query_max_response_time_dsec);
|
|
|
|
|
2024-06-26 19:41:45 +02:00
|
|
|
/* IF ipv6 mld join-group */
|
2022-12-14 07:34:25 +01:00
|
|
|
if (pim_ifp->gm_join_list) {
|
|
|
|
struct listnode *node;
|
|
|
|
struct gm_join *ij;
|
2024-06-26 19:41:45 +02:00
|
|
|
|
2022-12-14 07:34:25 +01:00
|
|
|
for (ALL_LIST_ELEMENTS_RO(pim_ifp->gm_join_list, node, ij)) {
|
|
|
|
if (pim_addr_is_any(ij->source_addr))
|
2024-06-26 19:41:45 +02:00
|
|
|
vty_out(vty, " ipv6 mld join-group %pPAs\n",
|
2022-12-14 07:34:25 +01:00
|
|
|
&ij->group_addr);
|
|
|
|
else
|
2024-06-26 19:41:45 +02:00
|
|
|
vty_out(vty,
|
|
|
|
" ipv6 mld join-group %pPAs %pPAs\n",
|
2022-12-14 07:34:25 +01:00
|
|
|
&ij->group_addr, &ij->source_addr);
|
|
|
|
++writes;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-06-26 19:41:45 +02:00
|
|
|
/* IF ipv6 mld static-group */
|
|
|
|
if (pim_ifp->static_group_list) {
|
|
|
|
struct listnode *node;
|
|
|
|
struct static_group *stgrp;
|
|
|
|
|
|
|
|
for (ALL_LIST_ELEMENTS_RO(pim_ifp->static_group_list, node,
|
|
|
|
stgrp)) {
|
|
|
|
if (pim_addr_is_any(stgrp->source_addr))
|
|
|
|
vty_out(vty, " ipv6 mld static-group %pPAs\n",
|
|
|
|
&stgrp->group_addr);
|
|
|
|
else
|
|
|
|
vty_out(vty,
|
|
|
|
" ipv6 mld static-group %pPAs %pPAs\n",
|
|
|
|
&stgrp->group_addr, &stgrp->source_addr);
|
|
|
|
++writes;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-26 13:39:47 +02:00
|
|
|
return writes;
|
2022-04-04 13:44:20 +02:00
|
|
|
}
|
2022-02-25 12:01:57 +01:00
|
|
|
#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-04-04 13:44:20 +02:00
|
|
|
writes += gm_config_write(vty, writes, pim_ifp);
|
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;
|
|
|
|
}
|
|
|
|
|
2022-04-04 13:37:18 +02:00
|
|
|
if (pim_ifp->pim_passive_enable) {
|
|
|
|
vty_out(vty, " " PIM_AF_NAME " pim passive\n");
|
|
|
|
++writes;
|
|
|
|
}
|
|
|
|
|
2022-01-19 14:00:56 +01:00
|
|
|
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;
|
|
|
|
}
|