summaryrefslogtreecommitdiffstats
path: root/lib/vty.c
diff options
context:
space:
mode:
authorChris Hall <chris.hall@highwayman.com>2011-05-24 11:04:43 +0100
committerChris Hall <chris.hall@highwayman.com>2011-05-24 11:04:43 +0100
commite535bc959729262480a9702e71334002edee3f8c (patch)
tree43528fadad4c9b429cdda3524844a36a0ba283a3 /lib/vty.c
parent9a9466f1fdad6fb6c94c5ef8ddb1a687a7bcd874 (diff)
parent5f5809b14e76311d6fab751fe114b2ef495af10c (diff)
downloadquagga-e535bc959729262480a9702e71334002edee3f8c.tar.bz2
quagga-e535bc959729262480a9702e71334002edee3f8c.tar.xz
Merge branch 'master' of /git/quagga.euro-ix into pipework
Diffstat (limited to 'lib/vty.c')
-rw-r--r--lib/vty.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/vty.c b/lib/vty.c
index 2a936170..e6dcd6a8 100644
--- a/lib/vty.c
+++ b/lib/vty.c
@@ -984,6 +984,30 @@ vty_read_config_file (int fd, const char* name, cmd_command first_cmd,
vty vty ;
qtime_t taking ;
+ /* Set up configuration file reader VTY -- which buffers all output */
+ vty = vty_open(VTY_CONFIG_READ);
+ vty->node = CONFIG_NODE;
+
+ /* Make sure we have a suitable buffer, and set vty->buf to point at
+ * it -- same like other command execution.
+ */
+ qs_need(&vty->vio->clx, VTY_BUFSIZ) ;
+ vty->buf = qs_chars(&vty->vio->clx) ;
+
+ taking = qt_get_monotonic() ;
+
+ /* Execute configuration file */
+ ret = config_from_file (vty, confp, first_cmd, &vty->vio->clx,
+ ignore_warnings) ;
+
+ taking = (qt_get_monotonic() - taking) / (QTIME_SECOND / 1000) ;
+
+ zlog_info("Finished reading configuration in %d.%dsecs%s",
+ (int)(taking / 1000), (int)(taking % 1000),
+ (ret == CMD_SUCCESS) ? "." : " -- FAILED") ;
+
+ VTY_LOCK() ;
+
vty = vty_config_read_open(fd, name, full_lex) ;
vty_cmd_loop_prepare(vty) ;