]> git.puffer.fish Git - mirror/frr.git/commitdiff
vtysh: change logical router node name
authorPhilippe Guibert <philippe.guibert@6wind.com>
Mon, 5 Feb 2018 15:36:13 +0000 (16:36 +0100)
committerPhilippe Guibert <philippe.guibert@6wind.com>
Tue, 27 Feb 2018 10:11:24 +0000 (11:11 +0100)
The logical router node goes from NS_NODE to LOGICALROUTER_NODE.
Vty commands are renamed accordingly.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
vtysh/Makefile.am
vtysh/extract.pl.in
vtysh/vtysh.c
vtysh/vtysh_config.c

index c9b6f501606416c9c1207e6c8ef8ee190e45c9bc..33d34fc0ddf8a34e5fa02efe97f6b8fe051904d7 100644 (file)
@@ -147,7 +147,7 @@ vtysh_cmd_FILES = $(vtysh_scan) \
                  $(top_srcdir)/lib/distribute.c $(top_srcdir)/lib/if_rmap.c \
                  $(top_srcdir)/lib/vrf.c \
                  $(top_srcdir)/lib/vty.c $(top_srcdir)/zebra/debug.c \
-                 $(top_srcdir)/lib/ns.c \
+                 $(top_srcdir)/lib/logicalrouter.c \
                  $(top_srcdir)/zebra/interface.c \
                  $(top_srcdir)/zebra/irdp_interface.c \
                  $(top_srcdir)/zebra/rtadv.c $(top_srcdir)/zebra/zebra_vty.c \
index dedf3d1647329db314ac4ca48c4a1b1b753b57aa..6cfb51b00f02d9f28493e3e7bbcc15cbc6665ce0 100755 (executable)
@@ -87,6 +87,9 @@ foreach (@ARGV) {
         elsif ($file =~ /lib\/vrf\.c$/) {
             $protocol = "VTYSH_ALL";
         }
+        elsif ($file =~ /lib\/logicalrouter\.c$/) {
+            $protocol = "VTYSH_ALL";
+        }
         elsif ($file =~ /lib\/filter\.c$/) {
             $protocol = "VTYSH_ALL";
         }
index 65e9c9f8c51f107b398fc4079a22510b0599d4ca..e0a0dd585deee9e47845fab37165c946620f1f25 100644 (file)
@@ -975,8 +975,8 @@ static struct cmd_node pw_node = {
        PW_NODE, "%s(config-pw)# ",
 };
 
-static struct cmd_node ns_node = {
-       NS_NODE, "%s(config-logical-router)# ",
+static struct cmd_node logicalrouter_node = {
+       LOGICALROUTER_NODE, "%s(config-logical-router)# ",
 };
 
 static struct cmd_node vrf_node = {
@@ -1508,7 +1508,7 @@ static int vtysh_exit(struct vty *vty)
                break;
        case INTERFACE_NODE:
        case PW_NODE:
-       case NS_NODE:
+       case LOGICALROUTER_NODE:
        case VRF_NODE:
        case ZEBRA_NODE:
        case BGP_NODE:
@@ -1782,16 +1782,25 @@ DEFSH(VTYSH_ZEBRA, vtysh_no_interface_vrf_cmd, "no interface IFNAME vrf NAME",
       "Delete a pseudo interface's configuration\n"
       "Interface's name\n" VRF_CMD_HELP_STR)
 
-DEFUNSH(VTYSH_NS, vtysh_ns, vtysh_ns_cmd, "logical-router (1-65535) ns NAME",
+DEFUNSH(VTYSH_ZEBRA, vtysh_logicalrouter, vtysh_logicalrouter_cmd,
+       "logical-router (1-65535) ns NAME",
        "Enable a logical-router\n"
        "Specify the logical-router indentifier\n"
        "The Name Space\n"
        "The file name in " NS_RUN_DIR ", or a full pathname\n")
 {
-       vty->node = NS_NODE;
+       vty->node = LOGICALROUTER_NODE;
        return CMD_SUCCESS;
 }
 
+DEFSH(VTYSH_ZEBRA, vtysh_no_logicalrouter_cmd,
+       "no logical-router (1-65535) ns NAME",
+       NO_STR
+       "Enable a Logical-Router\n"
+       "Specify the Logical-Router identifier\n"
+       "The Name Space\n"
+       "The file name in " NS_RUN_DIR ", or a full pathname\n")
+
 DEFUNSH(VTYSH_VRF, vtysh_vrf, vtysh_vrf_cmd, "vrf NAME",
        "Select a VRF to configure\n"
        "VRF's name\n")
@@ -1804,16 +1813,18 @@ DEFSH(VTYSH_ZEBRA, vtysh_no_vrf_cmd, "no vrf NAME", NO_STR
       "Delete a pseudo vrf's configuration\n"
       "VRF's name\n")
 
-DEFUNSH(VTYSH_NS, vtysh_exit_ns, vtysh_exit_ns_cmd, "exit",
+DEFUNSH(VTYSH_NS, vtysh_exit_logicalrouter,
+       vtysh_exit_logicalrouter_cmd, "exit",
        "Exit current mode and down to previous mode\n")
 {
        return vtysh_exit(vty);
 }
 
-DEFUNSH(VTYSH_NS, vtysh_quit_ns, vtysh_quit_ns_cmd, "quit",
+DEFUNSH(VTYSH_NS, vtysh_quit_logicalrouter,
+       vtysh_quit_logicalrouter_cmd, "quit",
        "Exit current mode and down to previous mode\n")
 {
-       return vtysh_exit_ns(self, vty, argc, argv);
+       return vtysh_exit_logicalrouter(self, vty, argc, argv);
 }
 
 DEFUNSH(VTYSH_VRF, vtysh_exit_vrf, vtysh_exit_vrf_cmd, "exit",
@@ -3055,7 +3066,7 @@ void vtysh_init_vty(void)
        install_node(&interface_node, NULL);
        install_node(&pw_node, NULL);
        install_node(&link_params_node, NULL);
-       install_node(&ns_node, NULL);
+       install_node(&logicalrouter_node, NULL);
        install_node(&vrf_node, NULL);
        install_node(&rmap_node, NULL);
        install_node(&zebra_node, NULL);
@@ -3233,11 +3244,14 @@ void vtysh_init_vty(void)
        install_element(PW_NODE, &vtysh_exit_interface_cmd);
        install_element(PW_NODE, &vtysh_quit_interface_cmd);
 
-       install_element(NS_NODE, &vtysh_end_all_cmd);
+       install_element(LOGICALROUTER_NODE, &vtysh_end_all_cmd);
 
-       install_element(CONFIG_NODE, &vtysh_ns_cmd);
-       install_element(NS_NODE, &vtysh_exit_ns_cmd);
-       install_element(NS_NODE, &vtysh_quit_ns_cmd);
+       install_element(CONFIG_NODE, &vtysh_logicalrouter_cmd);
+       install_element(CONFIG_NODE, &vtysh_no_logicalrouter_cmd);
+       install_element(LOGICALROUTER_NODE,
+                       &vtysh_exit_logicalrouter_cmd);
+       install_element(LOGICALROUTER_NODE,
+                       &vtysh_quit_logicalrouter_cmd);
 
        install_element(VRF_NODE, &vtysh_end_all_cmd);
        install_element(VRF_NODE, &vtysh_exit_vrf_cmd);
index 967f855fbc45fff1c96df49aea448196457a721f..aa1dd407eb5c3557253231eeb83459d7743544ce 100644 (file)
@@ -187,7 +187,7 @@ void vtysh_config_parse_line(void *arg, const char *line)
                                config->index = INTERFACE_NODE;
                        } else if (config->index == RMAP_NODE
                                   || config->index == INTERFACE_NODE
-                                  || config->index == NS_NODE
+                                  || config->index == LOGICALROUTER_NODE
                                   || config->index == VTY_NODE
                                   || config->index == VRF_NODE)
                                config_add_line_uniq(config->line, line);
@@ -202,7 +202,7 @@ void vtysh_config_parse_line(void *arg, const char *line)
                else if (strncmp(line, "pseudowire", strlen("pseudowire")) == 0)
                        config = config_get(PW_NODE, line);
                else if (strncmp(line, "logical-router", strlen("ns")) == 0)
-                       config = config_get(NS_NODE, line);
+                       config = config_get(LOGICALROUTER_NODE, line);
                else if (strncmp(line, "vrf", strlen("vrf")) == 0)
                        config = config_get(VRF_NODE, line);
                else if (strncmp(line, "router-id", strlen("router-id")) == 0)