2022-01-18 15:36:17 +01:00
|
|
|
/*
|
|
|
|
* PIM for IPv6 FRR
|
|
|
|
* Copyright (C) 2022 Vmware, Inc.
|
|
|
|
* Mobashshera Rasool <mrasool@vmware.com>
|
|
|
|
*
|
|
|
|
* 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
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <zebra.h>
|
|
|
|
|
|
|
|
#include "lib/json.h"
|
|
|
|
#include "command.h"
|
|
|
|
#include "if.h"
|
|
|
|
#include "prefix.h"
|
|
|
|
#include "zclient.h"
|
|
|
|
#include "plist.h"
|
|
|
|
#include "hash.h"
|
|
|
|
#include "nexthop.h"
|
|
|
|
#include "vrf.h"
|
|
|
|
#include "ferr.h"
|
|
|
|
|
|
|
|
#include "pimd.h"
|
|
|
|
#include "pim6_cmd.h"
|
|
|
|
#include "pim_vty.h"
|
|
|
|
#include "lib/northbound_cli.h"
|
|
|
|
#include "pim_errors.h"
|
|
|
|
#include "pim_nb.h"
|
2022-02-10 09:14:41 +01:00
|
|
|
#include "pim_cmd_common.h"
|
2022-01-18 15:36:17 +01:00
|
|
|
|
|
|
|
#ifndef VTYSH_EXTRACT_PL
|
|
|
|
#include "pimd/pim6_cmd_clippy.c"
|
|
|
|
#endif
|
|
|
|
|
2022-01-19 09:06:41 +01:00
|
|
|
DEFPY (ipv6_pim_joinprune_time,
|
|
|
|
ipv6_pim_joinprune_time_cmd,
|
|
|
|
"ipv6 pim join-prune-interval (1-65535)$jpi",
|
|
|
|
IPV6_STR
|
|
|
|
PIM_STR
|
|
|
|
"Join Prune Send Interval\n"
|
|
|
|
"Seconds\n")
|
|
|
|
{
|
|
|
|
return pim_process_join_prune_cmd(vty, jpi_str);
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFPY (no_ipv6_pim_joinprune_time,
|
|
|
|
no_ipv6_pim_joinprune_time_cmd,
|
|
|
|
"no ipv6 pim join-prune-interval [(1-65535)]",
|
|
|
|
NO_STR
|
|
|
|
IPV6_STR
|
|
|
|
PIM_STR
|
|
|
|
"Join Prune Send Interval\n"
|
|
|
|
IGNORED_IN_NO_STR)
|
|
|
|
{
|
|
|
|
return pim_process_no_join_prune_cmd(vty);
|
|
|
|
}
|
|
|
|
|
2022-01-19 10:35:35 +01:00
|
|
|
DEFPY (ipv6_pim_spt_switchover_infinity,
|
|
|
|
ipv6_pim_spt_switchover_infinity_cmd,
|
|
|
|
"ipv6 pim spt-switchover infinity-and-beyond",
|
|
|
|
IPV6_STR
|
|
|
|
PIM_STR
|
|
|
|
"SPT-Switchover\n"
|
|
|
|
"Never switch to SPT Tree\n")
|
|
|
|
{
|
|
|
|
return pim_process_spt_switchover_infinity_cmd(vty);
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFPY (ipv6_pim_spt_switchover_infinity_plist,
|
|
|
|
ipv6_pim_spt_switchover_infinity_plist_cmd,
|
|
|
|
"ipv6 pim spt-switchover infinity-and-beyond prefix-list WORD$plist",
|
|
|
|
IPV6_STR
|
|
|
|
PIM_STR
|
|
|
|
"SPT-Switchover\n"
|
|
|
|
"Never switch to SPT Tree\n"
|
|
|
|
"Prefix-List to control which groups to switch\n"
|
|
|
|
"Prefix-List name\n")
|
|
|
|
{
|
|
|
|
return pim_process_spt_switchover_prefixlist_cmd(vty, plist);
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFPY (no_ipv6_pim_spt_switchover_infinity,
|
|
|
|
no_ipv6_pim_spt_switchover_infinity_cmd,
|
|
|
|
"no ipv6 pim spt-switchover infinity-and-beyond",
|
|
|
|
NO_STR
|
|
|
|
IPV6_STR
|
|
|
|
PIM_STR
|
|
|
|
"SPT_Switchover\n"
|
|
|
|
"Never switch to SPT Tree\n")
|
|
|
|
{
|
|
|
|
return pim_process_no_spt_switchover_cmd(vty);
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFPY (no_ipv6_pim_spt_switchover_infinity_plist,
|
|
|
|
no_ipv6_pim_spt_switchover_infinity_plist_cmd,
|
|
|
|
"no ipv6 pim spt-switchover infinity-and-beyond prefix-list WORD",
|
|
|
|
NO_STR
|
|
|
|
IPV6_STR
|
|
|
|
PIM_STR
|
|
|
|
"SPT_Switchover\n"
|
|
|
|
"Never switch to SPT Tree\n"
|
|
|
|
"Prefix-List to control which groups to switch\n"
|
|
|
|
"Prefix-List name\n")
|
|
|
|
{
|
|
|
|
return pim_process_no_spt_switchover_cmd(vty);
|
|
|
|
}
|
|
|
|
|
2022-01-19 14:21:20 +01:00
|
|
|
DEFPY (ipv6_pim_packets,
|
|
|
|
ipv6_pim_packets_cmd,
|
|
|
|
"ipv6 pim packets (1-255)",
|
|
|
|
IPV6_STR
|
|
|
|
PIM_STR
|
|
|
|
"packets to process at one time per fd\n"
|
|
|
|
"Number of packets\n")
|
|
|
|
{
|
|
|
|
return pim_process_pim_packet_cmd(vty, packets_str);
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFPY (no_ipv6_pim_packets,
|
|
|
|
no_ipv6_pim_packets_cmd,
|
|
|
|
"no ipv6 pim packets [(1-255)]",
|
|
|
|
NO_STR
|
|
|
|
IPV6_STR
|
|
|
|
PIM_STR
|
|
|
|
"packets to process at one time per fd\n"
|
|
|
|
IGNORED_IN_NO_STR)
|
|
|
|
{
|
|
|
|
return pim_process_no_pim_packet_cmd(vty);
|
|
|
|
}
|
|
|
|
|
2022-01-19 14:27:24 +01:00
|
|
|
DEFPY (ipv6_pim_keep_alive,
|
|
|
|
ipv6_pim_keep_alive_cmd,
|
|
|
|
"ipv6 pim keep-alive-timer (1-65535)$kat",
|
|
|
|
IPV6_STR
|
|
|
|
PIM_STR
|
|
|
|
"Keep alive Timer\n"
|
|
|
|
"Seconds\n")
|
|
|
|
{
|
|
|
|
return pim_process_keepalivetimer_cmd(vty, kat_str);
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFPY (no_ipv6_pim_keep_alive,
|
|
|
|
no_ipv6_pim_keep_alive_cmd,
|
|
|
|
"no ipv6 pim keep-alive-timer [(1-65535)]",
|
|
|
|
NO_STR
|
|
|
|
IPV6_STR
|
|
|
|
PIM_STR
|
|
|
|
"Keep alive Timer\n"
|
|
|
|
IGNORED_IN_NO_STR)
|
|
|
|
{
|
|
|
|
return pim_process_no_keepalivetimer_cmd(vty);
|
|
|
|
}
|
|
|
|
|
2022-01-19 14:36:05 +01:00
|
|
|
DEFPY (ipv6_pim_rp_keep_alive,
|
|
|
|
ipv6_pim_rp_keep_alive_cmd,
|
|
|
|
"ipv6 pim rp keep-alive-timer (1-65535)$kat",
|
|
|
|
IPV6_STR
|
|
|
|
PIM_STR
|
|
|
|
"Rendevous Point\n"
|
|
|
|
"Keep alive Timer\n"
|
|
|
|
"Seconds\n")
|
|
|
|
{
|
|
|
|
return pim_process_rp_kat_cmd(vty, kat_str);
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFPY (no_ipv6_pim_rp_keep_alive,
|
|
|
|
no_ipv6_pim_rp_keep_alive_cmd,
|
|
|
|
"no ipv6 pim rp keep-alive-timer [(1-65535)]",
|
|
|
|
NO_STR
|
|
|
|
IPV6_STR
|
|
|
|
PIM_STR
|
|
|
|
"Rendevous Point\n"
|
|
|
|
"Keep alive Timer\n"
|
|
|
|
IGNORED_IN_NO_STR)
|
|
|
|
{
|
|
|
|
return pim_process_no_rp_kat_cmd(vty);
|
|
|
|
}
|
|
|
|
|
2022-01-19 14:50:02 +01:00
|
|
|
DEFPY (ipv6_pim_register_suppress,
|
|
|
|
ipv6_pim_register_suppress_cmd,
|
|
|
|
"ipv6 pim register-suppress-time (1-65535)$rst",
|
|
|
|
IPV6_STR
|
|
|
|
PIM_STR
|
|
|
|
"Register Suppress Timer\n"
|
|
|
|
"Seconds\n")
|
|
|
|
{
|
|
|
|
return pim_process_register_suppress_cmd(vty, rst_str);
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFPY (no_ipv6_pim_register_suppress,
|
|
|
|
no_ipv6_pim_register_suppress_cmd,
|
|
|
|
"no ipv6 pim register-suppress-time [(1-65535)]",
|
|
|
|
NO_STR
|
|
|
|
IPV6_STR
|
|
|
|
PIM_STR
|
|
|
|
"Register Suppress Timer\n"
|
|
|
|
IGNORED_IN_NO_STR)
|
|
|
|
{
|
|
|
|
return pim_process_no_register_suppress_cmd(vty);
|
|
|
|
}
|
|
|
|
|
2022-01-18 15:36:17 +01:00
|
|
|
void pim_cmd_init(void)
|
|
|
|
{
|
|
|
|
if_cmd_init(pim_interface_config_write);
|
2022-01-19 09:06:41 +01:00
|
|
|
|
|
|
|
install_element(CONFIG_NODE, &ipv6_pim_joinprune_time_cmd);
|
|
|
|
install_element(CONFIG_NODE, &no_ipv6_pim_joinprune_time_cmd);
|
2022-01-19 10:35:35 +01:00
|
|
|
install_element(CONFIG_NODE, &ipv6_pim_spt_switchover_infinity_cmd);
|
|
|
|
install_element(CONFIG_NODE, &ipv6_pim_spt_switchover_infinity_plist_cmd);
|
|
|
|
install_element(CONFIG_NODE, &no_ipv6_pim_spt_switchover_infinity_cmd);
|
|
|
|
install_element(CONFIG_NODE, &no_ipv6_pim_spt_switchover_infinity_plist_cmd);
|
2022-01-19 14:21:20 +01:00
|
|
|
install_element(CONFIG_NODE, &ipv6_pim_packets_cmd);
|
|
|
|
install_element(CONFIG_NODE, &no_ipv6_pim_packets_cmd);
|
2022-01-19 14:27:24 +01:00
|
|
|
install_element(CONFIG_NODE, &ipv6_pim_keep_alive_cmd);
|
|
|
|
install_element(CONFIG_NODE, &no_ipv6_pim_keep_alive_cmd);
|
2022-01-19 14:36:05 +01:00
|
|
|
install_element(CONFIG_NODE, &ipv6_pim_rp_keep_alive_cmd);
|
|
|
|
install_element(CONFIG_NODE, &no_ipv6_pim_rp_keep_alive_cmd);
|
2022-01-19 14:50:02 +01:00
|
|
|
install_element(CONFIG_NODE, &ipv6_pim_register_suppress_cmd);
|
|
|
|
install_element(CONFIG_NODE, &no_ipv6_pim_register_suppress_cmd);
|
2022-01-18 15:36:17 +01:00
|
|
|
}
|