]> git.puffer.fish Git - matthieu/frr.git/commitdiff
pim6d: Adding the base changes
authorSai Gomathi N <nsaigomathi@vmware.com>
Tue, 18 Jan 2022 14:36:17 +0000 (06:36 -0800)
committerMobashshera Rasool <mrasool@vmware.com>
Mon, 28 Feb 2022 09:38:24 +0000 (01:38 -0800)
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>
pimd/pim6_cmd.c [new file with mode: 0644]
pimd/pim6_cmd.h [new file with mode: 0644]
pimd/pim6_main.c
pimd/pim6_stubs.c
pimd/pimd.c
pimd/subdir.am

diff --git a/pimd/pim6_cmd.c b/pimd/pim6_cmd.c
new file mode 100644 (file)
index 0000000..1326a1e
--- /dev/null
@@ -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);
+}
diff --git a/pimd/pim6_cmd.h b/pimd/pim6_cmd.h
new file mode 100644 (file)
index 0000000..e49045a
--- /dev/null
@@ -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 */
index 71d0a472a59d0a9ffc12ab5f5712ef0fd592c239..c9e3463969741055d70a18310364ed265208a2ce 100644 (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
         */
index 038baa06926edd1804256488db7893e86ab418e6..9f68b7be3d78785101890e8415cd441e4deb318e 100644 (file)
@@ -133,9 +133,3 @@ void pim_reg_del_on_couldreg_fail(struct interface *ifp)
 {
 }
 
-/*
- * CLI
- */
-void pim_cmd_init(void)
-{
-}
index 9621f9794d3b206292920f55f7131def61f56a4f..58e874fd11905e8e7e11e89a9a27bc5942189d09 100644 (file)
 #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"
index 52f2ed75b48315cfd93e33e510747eeb939ff0f8..552fb171ace8afe0281fb5a1a0b4b64251240dd0 100644 (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