diff --git a/pimd/pim6_cmd.c b/pimd/pim6_cmd.c new file mode 100644 index 0000000000..1326a1ebf1 --- /dev/null +++ b/pimd/pim6_cmd.c @@ -0,0 +1,48 @@ +/* + * PIM for IPv6 FRR + * Copyright (C) 2022 Vmware, Inc. + * Mobashshera Rasool + * + * 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 + +#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" + +#ifndef VTYSH_EXTRACT_PL +#include "pimd/pim6_cmd_clippy.c" +#endif + +void pim_cmd_init(void) +{ + if_cmd_init(pim_interface_config_write); +} diff --git a/pimd/pim6_cmd.h b/pimd/pim6_cmd.h new file mode 100644 index 0000000000..e49045a1b5 --- /dev/null +++ b/pimd/pim6_cmd.h @@ -0,0 +1,44 @@ +/* + * PIM for IPv6 FRR + * Copyright (C) 2022 Vmware, Inc. + * Mobashshera Rasool + * + * 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 + */ +#ifndef PIM6_CMD_H +#define PIM6_CMD_H + +#define PIM_STR "PIM information\n" +#define MLD_STR "MLD information\n" +#define MLD_GROUP_STR "MLD groups information\n" +#define MLD_SOURCE_STR "MLD sources information\n" +#define IFACE_MLD_STR "Enable MLD operation\n" +#define IFACE_MLD_QUERY_INTERVAL_STR "MLD host query interval\n" +#define IFACE_MLD_QUERY_MAX_RESPONSE_TIME_STR \ + "MLD max query response value (seconds)\n" +#define IFACE_MLD_QUERY_MAX_RESPONSE_TIME_DSEC_STR \ + "MLD max query response value (deciseconds)\n" +#define IFACE_MLD_LAST_MEMBER_QUERY_INTERVAL_STR \ + "MLD last member query interval\n" +#define IFACE_MLD_LAST_MEMBER_QUERY_COUNT_STR "MLD last member query count\n" +#define MROUTE_STR "IP multicast routing table\n" +#define DEBUG_MLD_STR "MLD protocol activity\n" +#define DEBUG_MLD_EVENTS_STR "MLD protocol events\n" +#define DEBUG_MLD_PACKETS_STR "MLD protocol packets\n" +#define DEBUG_MLD_TRACE_STR "MLD internal daemon activity\n" + +void pim_cmd_init(void); + +#endif /* PIM6_CMD_H */ diff --git a/pimd/pim6_main.c b/pimd/pim6_main.c index 71d0a472a5..c9e3463969 100644 --- a/pimd/pim6_main.c +++ b/pimd/pim6_main.c @@ -37,6 +37,7 @@ #include "pim_iface.h" #include "pim_zebra.h" #include "pim_nb.h" +#include "pim6_cmd.h" zebra_capabilities_t _caps_p[] = { ZCAP_SYS_ADMIN, @@ -176,9 +177,9 @@ int main(int argc, char **argv, char **envp) prefix_list_delete_hook(pim_prefix_list_update); pim_route_map_init(); - pim_init(); #endif - + /* pim_init(); */ + pim_cmd_init(); /* * Initialize zclient "update" and "lookup" sockets */ diff --git a/pimd/pim6_stubs.c b/pimd/pim6_stubs.c index 038baa0692..9f68b7be3d 100644 --- a/pimd/pim6_stubs.c +++ b/pimd/pim6_stubs.c @@ -133,9 +133,3 @@ void pim_reg_del_on_couldreg_fail(struct interface *ifp) { } -/* - * CLI - */ -void pim_cmd_init(void) -{ -} diff --git a/pimd/pimd.c b/pimd/pimd.c index 9621f9794d..58e874fd11 100644 --- a/pimd/pimd.c +++ b/pimd/pimd.c @@ -32,7 +32,11 @@ #include "bfd.h" #include "pimd.h" +#if PIM_IPV == 4 #include "pim_cmd.h" +#else +#include "pim6_cmd.h" +#endif #include "pim_str.h" #include "pim_oil.h" #include "pim_pim.h" diff --git a/pimd/subdir.am b/pimd/subdir.am index 52f2ed75b4..552fb171ac 100644 --- a/pimd/subdir.am +++ b/pimd/subdir.am @@ -6,10 +6,10 @@ if PIMD sbin_PROGRAMS += pimd/pimd bin_PROGRAMS += pimd/mtracebis noinst_PROGRAMS += pimd/test_igmpv3_join -vtysh_scan += pimd/pim_cmd.c - -# Add pim6_cmd.c under vtysh_scan, once the file is merged - +vtysh_scan += \ + pimd/pim_cmd.c \ + pimd/pim6_cmd.c \ + #end vtysh_daemons += pimd vtysh_daemons += pim6d man8 += $(MANBUILD)/frr-pimd.8 @@ -87,6 +87,7 @@ pimd_pim6d_SOURCES = \ $(pim_common) \ pimd/pim6_main.c \ pimd/pim6_stubs.c \ + pimd/pim6_cmd.c \ # end nodist_pimd_pim6d_SOURCES = \ @@ -150,10 +151,12 @@ noinst_HEADERS += \ pimd/pimd.h \ pimd/mtracebis_netlink.h \ pimd/mtracebis_routeget.h \ + pimd/pim6_cmd.h \ # end clippy_scan += \ pimd/pim_cmd.c \ + pimd/pim6_cmd.c \ # end pimd_pimd_CFLAGS = $(AM_CFLAGS) -DPIM_IPV=4