]> git.puffer.fish Git - matthieu/frr.git/commitdiff
Merge branch 'cmaster-next' into vtysh-grammar
authorQuentin Young <qlyoung@cumulusnetworks.com>
Sat, 12 Nov 2016 05:17:37 +0000 (05:17 +0000)
committerQuentin Young <qlyoung@cumulusnetworks.com>
Sat, 12 Nov 2016 05:17:37 +0000 (05:17 +0000)
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Conflicts:
lib/command.c
lib/vty.c

1  2 
configure.ac
lib/command.c
lib/command.h
lib/log.h
lib/vty.c
vtysh/vtysh.c

diff --cc configure.ac
Simple merge
diff --cc lib/command.c
index 593822a66e9e57737229470e00c3ef3b97a1b211,e8ba63762300d677e58ac594b64c6252e24b696c..bf7e269acc87026d82237ed6eb10744d655ae96a
@@@ -1319,37 -3146,9 +1319,40 @@@ DEFUN (config_write
    struct vty *file_vty;
    struct stat conf_stat;
  
 +  // if command was 'write terminal', 'write memory' or 'show running-config'
 +  if (argc == 2 && (!strcmp(argv[idx_type]->text, "terminal") ||
 +                    !strcmp(argv[idx_type]->text, "memory") ||
 +                    !strcmp(argv[0]->text, "show")))
 +  {
 +    if (vty->type == VTY_SHELL_SERV)
 +      {
 +        for (i = 0; i < vector_active (cmdvec); i++)
 +          if ((node = vector_slot (cmdvec, i)) && node->func && node->vtysh)
 +            {
 +              if ((*node->func) (vty))
 +                vty_out (vty, "!%s", VTY_NEWLINE);
 +            }
 +      }
 +    else
 +      {
 +        vty_out (vty, "%sCurrent configuration:%s", VTY_NEWLINE,
 +                 VTY_NEWLINE);
 +        vty_out (vty, "!%s", VTY_NEWLINE);
 +
 +        for (i = 0; i < vector_active (cmdvec); i++)
 +          if ((node = vector_slot (cmdvec, i)) && node->func)
 +            {
 +              if ((*node->func) (vty))
 +                vty_out (vty, "!%s", VTY_NEWLINE);
 +            }
 +        vty_out (vty, "end%s",VTY_NEWLINE);
 +      }
 +    return CMD_SUCCESS;
 +  }
 +
+   if (host.noconfig)
+     return CMD_SUCCESS;
    /* Check and see if we are operating under vtysh configuration */
    if (host.config == NULL)
      {
@@@ -2338,15 -4285,22 +2351,20 @@@ cmd_init (int terminal
      {
        install_element (ENABLE_NODE, &config_logmsg_cmd);
        install_default (CONFIG_NODE);
+       install_element (VIEW_NODE, &show_thread_cpu_cmd);
+       install_element (ENABLE_NODE, &clear_thread_cpu_cmd);
+       install_element (VIEW_NODE, &show_work_queues_cmd);
      }
 -  
 +
    install_element (CONFIG_NODE, &hostname_cmd);
    install_element (CONFIG_NODE, &no_hostname_cmd);
  
-   if (terminal)
+   if (terminal > 0)
      {
        install_element (CONFIG_NODE, &password_cmd);
 -      install_element (CONFIG_NODE, &password_text_cmd);
        install_element (CONFIG_NODE, &enable_password_cmd);
 -      install_element (CONFIG_NODE, &enable_password_text_cmd);
        install_element (CONFIG_NODE, &no_enable_password_cmd);
  
        install_element (CONFIG_NODE, &config_log_stdout_cmd);
diff --cc lib/command.h
Simple merge
diff --cc lib/log.h
Simple merge
diff --cc lib/vty.c
index 53a04851d57a67205c5e2042c4855974249beb42,26d0b67ecf7d5492df6afd665194814f4b951449..c1cc332d89825d6927e66491b72e9b126ab10473
+++ b/lib/vty.c
@@@ -2215,25 -2223,32 +2221,32 @@@ vtysh_read (struct thread *thread
        vty_ensure(vty, vty->length+1);
        vty->buf[vty->length++] = *p;
        if (*p == '\0')
 -      {
 -        /* Pass this line to parser. */
 -        ret = vty_execute (vty);
 -        /* Note that vty_execute clears the command buffer and resets
 -           vty->length to 0. */
 +        {
 +          /* Pass this line to parser. */
 +          ret = vty_execute (vty);
 +          /* Note that vty_execute clears the command buffer and resets
 +             vty->length to 0. */
  
 -        /* Return result. */
 +          /* Return result. */
  #ifdef VTYSH_DEBUG
 -        printf ("result: %d\n", ret);
 -        printf ("vtysh node: %d\n", vty->node);
 +          printf ("result: %d\n", ret);
 +          printf ("vtysh node: %d\n", vty->node);
  #endif /* VTYSH_DEBUG */
  
-           header[3] = ret;
-           buffer_put(vty->obuf, header, 4);
+           /* hack for asynchronous "write integrated"
+            * - other commands in "buf" will be ditched
+            * - input during pending config-write is "unsupported" */
+           if (ret == CMD_SUSPEND)
+             break;
+           /* warning: watchquagga hardcodes this result write */
+         header[3] = ret;
+         buffer_put(vty->obuf, header, 4);
  
 -        if (!vty->t_write && (vtysh_flush(vty) < 0))
 -          /* Try to flush results; exit if a write error occurs. */
 -          return 0;
 -      }
 +          if (!vty->t_write && (vtysh_flush(vty) < 0))
 +            /* Try to flush results; exit if a write error occurs. */
 +            return 0;
 +        }
      }
  
    vty_event (VTYSH_READ, sock, vty);
diff --cc vtysh/vtysh.c
Simple merge