pim6d: Adding the base changes

Adding the file pim6_cmd.h and pim6d_cmd.c as the base changes
for implementing the CLI changes

Removed the pim_cmd_init from the stub file.

Co-authored-by: Sarita Patra <saritap@vmware.com>
Co-authored-by: Abhishek N R <abnr@vmware.com>
Co-authored-by: Sai Gomathi N <nsaigomathi@vmware.com>
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
This commit is contained in:
Sai Gomathi N 2022-01-18 06:36:17 -08:00 committed by Mobashshera Rasool
parent d7da6520e9
commit 5d613d13b2
6 changed files with 106 additions and 12 deletions

48
pimd/pim6_cmd.c Normal file
View file

@ -0,0 +1,48 @@
/*
* 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"
#ifndef VTYSH_EXTRACT_PL
#include "pimd/pim6_cmd_clippy.c"
#endif
void pim_cmd_init(void)
{
if_cmd_init(pim_interface_config_write);
}

44
pimd/pim6_cmd.h Normal file
View file

@ -0,0 +1,44 @@
/*
* 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
*/
#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 */

View file

@ -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
*/

View file

@ -133,9 +133,3 @@ void pim_reg_del_on_couldreg_fail(struct interface *ifp)
{
}
/*
* CLI
*/
void pim_cmd_init(void)
{
}

View file

@ -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"

View file

@ -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