]> git.puffer.fish Git - matthieu/frr.git/commitdiff
2004-12-17 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
authorajs <ajs>
Fri, 17 Dec 2004 23:16:33 +0000 (23:16 +0000)
committerajs <ajs>
Fri, 17 Dec 2004 23:16:33 +0000 (23:16 +0000)
* command.c: (do_echo) Added new "echo" command, useful for
  watchdog pinging to make sure the daemon is responsive.

lib/ChangeLog
lib/command.c

index a91901cdff0fc204a0a3b15e796fc1c69231ded0..6eb70a228bfefa64b2aaf21ab65326c80de43973 100644 (file)
@@ -1,3 +1,8 @@
+2004-12-17 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
+
+       * command.c: (do_echo) Added new "echo" command, useful for
+         watchdog pinging to make sure the daemon is responsive.
+
 2004-12-17 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
        
        * pid_output.c: (pid_output_lock) Eliminate static function, and just
index cabdb2374dd2a495495b214c0a0b47ded174bc96..2766c4141e8baf48573cb3cb8e0846bf04030607 100644 (file)
@@ -1,5 +1,5 @@
 /*
-   $Id: command.c,v 1.29 2004/12/07 17:15:56 ajs Exp $
+   $Id: command.c,v 1.30 2004/12/17 23:16:33 ajs Exp $
 
    Command interpreter routine for virtual terminal [aka TeletYpe]
    Copyright (C) 1997, 98, 99 Kunihiro Ishiguro
@@ -2995,6 +2995,19 @@ DEFUN (no_service_terminal_length, no_service_terminal_length_cmd,
   return CMD_SUCCESS;
 }
 
+DEFUN_HIDDEN (do_echo,
+             echo_cmd,
+             "echo .MESSAGE",
+             "Echo a message back to the vty\n"
+             "The message to echo\n")
+{
+  char *message;
+
+  vty_out (vty, "%s%s",(message = argv_concat(argv, argc, 0)), VTY_NEWLINE);
+  XFREE(MTYPE_TMP, message);
+  return CMD_SUCCESS;
+}
+
 DEFUN (config_logmsg,
        config_logmsg_cmd,
        "logmsg "LOG_LEVELS" .MESSAGE",
@@ -3465,6 +3478,7 @@ cmd_init (int terminal)
       install_element (VIEW_NODE, &config_terminal_length_cmd);
       install_element (VIEW_NODE, &config_terminal_no_length_cmd);
       install_element (VIEW_NODE, &show_logging_cmd);
+      install_element (VIEW_NODE, &echo_cmd);
     }
 
   if (terminal)
@@ -3482,6 +3496,7 @@ cmd_init (int terminal)
       install_element (ENABLE_NODE, &config_terminal_length_cmd);
       install_element (ENABLE_NODE, &config_terminal_no_length_cmd);
       install_element (ENABLE_NODE, &show_logging_cmd);
+      install_element (ENABLE_NODE, &echo_cmd);
       install_element (ENABLE_NODE, &config_logmsg_cmd);
 
       install_default (CONFIG_NODE);