]> git.puffer.fish Git - mirror/frr.git/commitdiff
lib, vtysh: Start cli for nexthop-group
authorDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 26 Jan 2018 15:59:15 +0000 (10:59 -0500)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 9 Mar 2018 16:07:41 +0000 (11:07 -0500)
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
lib/command.c
lib/command.h
lib/nexthop_group.c
lib/nexthop_group.h
lib/subdir.am
vtysh/vtysh.c

index 6d04ad83c03f7fa65cea14ae25281469511c969b..5697c1d812b01d6baff6b181c8cafab7c9d4489a 100644 (file)
@@ -65,6 +65,7 @@ const char *node_names[] = {
        "logical-router",          // LOGICALROUTER_NODE,
        "vrf",                      // VRF_NODE,
        "interface",                // INTERFACE_NODE,
+       "nexthop-group",            // NH_GROUP_NODE,
        "zebra",                    // ZEBRA_NODE,
        "table",                    // TABLE_NODE,
        "rip",                      // RIP_NODE,
@@ -1294,6 +1295,7 @@ void cmd_exit(struct vty *vty)
        case PW_NODE:
        case LOGICALROUTER_NODE:
        case VRF_NODE:
+       case NH_GROUP_NODE:
        case ZEBRA_NODE:
        case BGP_NODE:
        case RIP_NODE:
@@ -1379,6 +1381,7 @@ DEFUN (config_end,
        case PW_NODE:
        case LOGICALROUTER_NODE:
        case VRF_NODE:
+       case NH_GROUP_NODE:
        case ZEBRA_NODE:
        case RIP_NODE:
        case RIPNG_NODE:
index 56e70abf6f256845eb75cb916f7772361f351381..0febf903a3007ec946f34a5969766a0438f6075b 100644 (file)
@@ -88,6 +88,7 @@ enum node_type {
        LOGICALROUTER_NODE,     /* Logical-Router node. */
        VRF_NODE,               /* VRF mode node. */
        INTERFACE_NODE,         /* Interface mode node. */
+       NH_GROUP_NODE,          /* Nexthop-Group mode node. */
        ZEBRA_NODE,             /* zebra connection node. */
        TABLE_NODE,             /* rtm_table selection node. */
        RIP_NODE,               /* RIP protocol mode node. */
index 8bdc585405eab9c7cf32ff4766b6d9a1f53c92c8..e7f10487d10339e6e310b5546e9854153d52a90e 100644 (file)
 
 #include <nexthop.h>
 #include <nexthop_group.h>
+#include <vty.h>
+#include <command.h>
+
+#ifndef VTYSH_EXTRACT_PL
+#include "lib/nexthop_group_clippy.c"
+#endif
 
 /* Add nexthop to the end of a nexthop list.  */
 void nexthop_add(struct nexthop **target, struct nexthop *nexthop)
@@ -64,3 +70,31 @@ void copy_nexthops(struct nexthop **tnh, struct nexthop *nh,
                                      nexthop);
        }
 }
+
+DEFPY (nexthop_group,
+       nexthop_group_cmd,
+       "nexthop-group NAME",
+       "Enter into the nexthop-group submode\n"
+       "Specify the NAME of the nexthop-group\n")
+{
+       return CMD_SUCCESS;
+}
+
+struct cmd_node nexthop_group_node = {
+       NH_GROUP_NODE,
+       "%s(config-nh-group)# ",
+       1
+};
+
+static int nexthop_group_write(struct vty *vty)
+{
+       vty_out(vty, "!\n");
+
+       return 1;
+}
+
+void nexthop_group_init(void)
+{
+       install_node(&nexthop_group_node, nexthop_group_write);
+       install_element(CONFIG_NODE, &nexthop_group_cmd);
+}
index 26900959cca3dcda56ab41a0683ebe583fec143d..561fe9642592e7964fa40ce1dc74b886f992b9fd 100644 (file)
@@ -33,6 +33,8 @@ struct nexthop_group {
        struct nexthop *nexthop;
 };
 
+void nexthop_group_init(void);
+
 void nexthop_add(struct nexthop **target, struct nexthop *nexthop);
 void copy_nexthops(struct nexthop **tnh, struct nexthop *nh,
                   struct nexthop *rparent);
index 5001b3cecf07919ad79c18eda6ea4c13f2b0fc54..7d85b7a24dae3f7592b385f97598c0cf29cc15e7 100644 (file)
@@ -82,6 +82,8 @@ lib_libfrr_la_SOURCES = \
 
 lib/plist_clippy.c: $(CLIPPY_DEPS)
 lib/plist.lo: lib/plist_clippy.c
+lib/nexthop_group_clippy.c: $(CLIPPY_DEPS)
+lib/nexthop_group.lo: lib/nexthop_group_clippy.c
 
 pkginclude_HEADERS += \
        lib/bfd.h \
index 5f87d4c7f5755d844f54d04f4bc61fce6b262a40..7dfe7753cf912fedba774730a44b9e33ee1995ff 100644 (file)
@@ -1499,6 +1499,7 @@ static int vtysh_exit(struct vty *vty)
        case PW_NODE:
        case LOGICALROUTER_NODE:
        case VRF_NODE:
+       case NH_GROUP_NODE:
        case ZEBRA_NODE:
        case BGP_NODE:
        case RIP_NODE: