diff options
author | paulo <paul@bayleaf.org.uk> | 2009-12-18 16:48:20 +0000 |
---|---|---|
committer | paulo <paul@bayleaf.org.uk> | 2009-12-18 16:48:20 +0000 |
commit | 1a88dd5744496aaf1fe5c2d4a859cae0612fdff3 (patch) | |
tree | 3dda7a4c2d4eddbd2b3a2c3f873d8015aded6362 /lib/vty.c | |
parent | bb48a82760858f94e7d2ce767ee61d98be2ee071 (diff) | |
download | quagga-1a88dd5744496aaf1fe5c2d4a859cae0612fdff3.tar.bz2 quagga-1a88dd5744496aaf1fe5c2d4a859cae0612fdff3.tar.xz |
QDEBUG handling. Debug banner on stderr, vty and log file. Annouce
before and after reading config file. Announce on all vty when shutting
down.
Diffstat (limited to 'lib/vty.c')
-rw-r--r-- | lib/vty.c | 39 |
1 files changed, 38 insertions, 1 deletions
@@ -338,6 +338,9 @@ static void uty_hello (struct vty *vty) { ASSERTLOCKED +#ifdef QDEBUG + uty_out (vty, "%s%s", debug_banner, VTY_NEWLINE); +#endif if (host.motdfile) { FILE *f; @@ -358,7 +361,7 @@ uty_hello (struct vty *vty) fclose (f); } else - uty_out (vty, "MOTD file not found%s", VTY_NEWLINE); + uty_out (vty, "MOTD file %s not found%s", host.motdfile, VTY_NEWLINE); } else if (host.motd) uty_out (vty, "%s", host.motd); @@ -2821,7 +2824,13 @@ vty_read_config (char *config_file, fclose (confp); +#ifdef QDEBUG + fprintf(stderr, "Reading config file: %s\n", fullpath); +#endif host_config_set (fullpath); +#ifdef QDEBUG + fprintf(stderr, "Finished reading config file\n"); +#endif if (tmp) XFREE (MTYPE_TMP, fullpath); @@ -2850,6 +2859,34 @@ vty_log (const char *level, const char *proto_str, } } +#ifdef QDEBUG +/* Tell all terminals that we are shutting down */ +void +vty_goodbye (void) +{ + unsigned int i; + struct vty *vty; + + LOCK + + if (vtyvec) + { + for (i = 0; i < vector_active (vtyvec); i++) + if (((vty = vector_slot (vtyvec, i)) != NULL) && vty->type == VTY_TERM) + uty_out(vty, QUAGGA_PROGNAME " is shutting down%s", VTY_NEWLINE); + + /* Wake up */ + if (cli_nexus) + { + vty_event (VTY_WRITE, vty->fd, vty); + qpt_thread_signal(cli_nexus->thread_id, SIGMQUEUE); + } + } + + UNLOCK +} +#endif + /* Async-signal-safe version of vty_log for fixed strings. */ void vty_log_fixed (const char *buf, size_t len) |