]> git.puffer.fish Git - mirror/frr.git/commitdiff
pimd: Add hidden 'ip pim active-active` command
authorDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 14 Jan 2019 15:43:53 +0000 (10:43 -0500)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 31 Jan 2019 14:28:39 +0000 (09:28 -0500)
Add a command to track if an interface should be in active-active
mode or not.  This command is hidden at this time because it
is not finished fully.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
pimd/pim_cmd.c
pimd/pim_iface.c
pimd/pim_iface.h
pimd/pim_vty.c
pimd/subdir.am

index 7089e21513c7d41c111ccc7ed74c098c73eedfe8..2c19d061a84b891e776b788a564ebf71341ef5c3 100644 (file)
 #include "pim_bfd.h"
 #include "bfd.h"
 
+#ifndef VTYSH_EXTRACT_PL
+#include "pimd/pim_cmd_clippy.c"
+#endif
+
 static struct cmd_node interface_node = {
        INTERFACE_NODE, "%s(config-if)# ", 1 /* vtysh ? yes */
 };
@@ -6394,6 +6398,31 @@ static int pim_cmd_interface_add(struct interface *ifp)
        return 1;
 }
 
+DEFPY_HIDDEN (interface_ip_pim_activeactive,
+             interface_ip_pim_activeactive_cmd,
+             "[no$no] ip pim active-active",
+             NO_STR
+             IP_STR
+             PIM_STR
+             "Mark interface as Active-Active for MLAG operations, Hidden because not finished yet\n")
+{
+       VTY_DECLVAR_CONTEXT(interface, ifp);
+       struct pim_interface *pim_ifp;
+
+       if (!no && !pim_cmd_interface_add(ifp)) {
+               vty_out(vty, "Could not enable PIM SM active-active on interface\n");
+               return CMD_WARNING_CONFIG_FAILED;
+       }
+
+       pim_ifp = ifp->info;
+       if (no)
+               pim_ifp->activeactive = false;
+       else
+               pim_ifp->activeactive = true;
+
+       return CMD_SUCCESS;
+}
+
 DEFUN_HIDDEN (interface_ip_pim_ssm,
        interface_ip_pim_ssm_cmd,
        "ip pim ssm",
@@ -8722,6 +8751,7 @@ void pim_cmd_init(void)
                        &interface_ip_igmp_query_max_response_time_dsec_cmd);
        install_element(INTERFACE_NODE,
                        &interface_no_ip_igmp_query_max_response_time_dsec_cmd);
+       install_element(INTERFACE_NODE, &interface_ip_pim_activeactive_cmd);
        install_element(INTERFACE_NODE, &interface_ip_pim_ssm_cmd);
        install_element(INTERFACE_NODE, &interface_no_ip_pim_ssm_cmd);
        install_element(INTERFACE_NODE, &interface_ip_pim_sm_cmd);
index 0451ab1e71695e103561fe7c72c91dfceaeeae28..6933f4d5bd0af0457e1134bee61e79db40f0ecb4 100644 (file)
@@ -170,6 +170,8 @@ struct pim_interface *pim_if_new(struct interface *ifp, bool igmp, bool pim,
        pim_ifp->sec_addr_list->cmp =
                (int (*)(void *, void *))pim_sec_addr_comp;
 
+       pim_ifp->activeactive = false;
+
        RB_INIT(pim_ifchannel_rb, &pim_ifp->ifchannel_rb);
 
        ifp->info = pim_ifp;
index a7dc097f882cbda1a7237e2391313ef2c744c063..5066998cb53bcb75a157ffda9f3e0cd6dcf45adf 100644 (file)
@@ -124,6 +124,9 @@ struct pim_interface {
        /* boundary prefix-list */
        char *boundary_oil_plist;
 
+       /* Turn on Active-Active for this interface */
+       bool activeactive;
+
        int64_t pim_ifstat_start; /* start timestamp for stats */
        uint32_t pim_ifstat_hello_sent;
        uint32_t pim_ifstat_hello_sendfail;
index f6385a0ac9ef7ca214d1fffe14f4ff03eb4c58a2..649578874842e9855b61906a35b36b38326167d3 100644 (file)
@@ -362,6 +362,9 @@ int pim_interface_config_write(struct vty *vty)
                                        }
                                }
 
+                               if (pim_ifp->activeactive)
+                                       vty_out(vty, " ip pim active-active\n");
+
                                /* boundary */
                                if (pim_ifp->boundary_oil_plist) {
                                        vty_out(vty,
index 99701430c59588be5d92c7b20ebe0e799ffbc779..7d8df7d1053b3c84e5d48804e354648e9fc5524f 100644 (file)
@@ -115,6 +115,9 @@ noinst_HEADERS += \
        pimd/mtracebis_routeget.h \
        # end
 
+pimd/pim_cmd_clippy.c: $(CLIPPY_DEPS)
+pimd/pim_cmd.$(OBJEXT): pimd/pim_cmd_clippy.c
+
 pimd_pimd_LDADD = pimd/libpim.a lib/libfrr.la $(LIBCAP)
 pimd_pimd_SOURCES = pimd/pim_main.c