Browse Source

vtysh, zebra: Fix link-params to use exit-link-params

Fix the link-params submode to use the 'exit-link-params'
to indicate we are exiting a submode.

Fixup all the relevant bits.
Donald Sharp 4 years ago
parent
commit
2c0adbf9bc
4 changed files with 29 additions and 2 deletions
  1. 4 0
      vtysh/extract.pl.in
  2. 12 0
      vtysh/vtysh.c
  3. 1 1
      vtysh/vtysh_config.c
  4. 12 1
      zebra/interface.c

+ 4 - 0
vtysh/extract.pl.in

@@ -54,6 +54,10 @@ $ignore{'"address-family encap"'} = "ignore";
 $ignore{'"address-family encapv4"'} = "ignore";
 $ignore{'"address-family encapv6"'} = "ignore";
 $ignore{'"exit-address-family"'} = "ignore";
+$ignore{'"exit-link-params"'} = "ignore";
+$ignore{'"vnc defaults"'} = "ignore";
+$ignore{'"vnc nve-group NAME"'} = "ignore";
+$ignore{'"exit-vnc"'} = "ignore";
 $ignore{'"key chain WORD"'} = "ignore";
 $ignore{'"key <0-2147483647>"'} = "ignore";
 $ignore{'"route-map WORD (deny|permit) <1-65535>"'} = "ignore";

+ 12 - 0
vtysh/vtysh.c

@@ -1465,6 +1465,17 @@ DEFUNSH (VTYSH_ZEBRA,
   return CMD_SUCCESS;
 }
 
+DEFUNSH (VTYSH_ZEBRA,
+	 exit_link_params,
+	 exit_link_params_cmd,
+	 "exit-link-params",
+	 "Exit from Link Params configuration node\n")
+{
+  if (vty->node == LINK_PARAMS_NODE)
+    vty->node = INTERFACE_NODE;
+  return CMD_SUCCESS;
+}
+
 /* Memory */
 DEFUN (vtysh_show_memory,
        vtysh_show_memory_cmd,
@@ -2544,6 +2555,7 @@ vtysh_init_vty (void)
   install_element (INTERFACE_NODE, &no_interface_desc_cmd);
   install_element (INTERFACE_NODE, &vtysh_end_all_cmd);
   install_element (INTERFACE_NODE, &vtysh_exit_interface_cmd);
+  install_element (LINK_PARAMS_NODE, &exit_link_params_cmd);
   install_element (LINK_PARAMS_NODE, &vtysh_end_all_cmd);
   install_element (LINK_PARAMS_NODE, &vtysh_exit_interface_cmd);
   install_element (INTERFACE_NODE, &vtysh_quit_interface_cmd);

+ 1 - 1
vtysh/vtysh_config.c

@@ -190,7 +190,7 @@ vtysh_config_parse_line (const char *line)
 	      config->index = LINK_PARAMS_NODE;
 	    }
 	  else if (config->index == LINK_PARAMS_NODE &&
-	           strncmp (line, "  exit", strlen ("  exit")) == 0)
+	           strncmp (line, "  exit-link-params", strlen ("  exit")) == 0)
 	    {
 	      config_add_line (config->line, line);
 	      config->index = INTERFACE_NODE;

+ 12 - 1
zebra/interface.c

@@ -1625,6 +1625,16 @@ DEFUN (link_params,
   return CMD_SUCCESS;
 }
 
+DEFUN (exit_link_params,
+       exit_link_params_cmd,
+       "exit-link-params",
+       "Exit from Link Params configuration mode\n")
+{
+  if (vty->node == LINK_PARAMS_NODE)
+    vty->node = INTERFACE_NODE;
+  return CMD_SUCCESS;
+}
+
 /* Specific Traffic Engineering parameters commands */
 DEFUN (link_params_enable,
        link_params_enable_cmd,
@@ -2636,7 +2646,7 @@ link_params_config_write (struct vty *vty, struct interface *ifp)
   if (IS_PARAM_SET(iflp, LP_RMT_AS))
     vty_out(vty, "  neighbor %s as %u%s", inet_ntoa(iflp->rmt_ip),
         iflp->rmt_as, VTY_NEWLINE);
-  vty_out(vty, "  exit%s", VTY_NEWLINE);
+  vty_out(vty, "  exit-link-params%s", VTY_NEWLINE);
   return 0;
 }
 
@@ -2803,4 +2813,5 @@ zebra_if_init (void)
   install_element(LINK_PARAMS_NODE, &no_link_params_res_bw_cmd);
   install_element(LINK_PARAMS_NODE, &link_params_use_bw_cmd);
   install_element(LINK_PARAMS_NODE, &no_link_params_use_bw_cmd);
+  install_element(LINK_PARAMS_NODE, &exit_link_params_cmd);
 }