summaryrefslogtreecommitdiffstats
path: root/lib/vty_command.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix bugs in vty error handlingex25bChris Hall2012-06-081-29/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Advance version to 0.99.20ex25b. Bug fixes: * when closing a vty, if close() returned an error, the vtys would fall into a loop trying to recover. This was found on FreeBSD, which will return ECONNRESET on close(), which is not standard POSIX behaviour. * when closing a vty in response to EPIPE or ECONNRESET, managed to leave the vty mutex locked. This stopped the Routing Engine *dead* on the next CLI command that required the Routing Engine. SIGTERM/SIGINT would not stop bgpd -- a SIGKILL would be required. Other changes: * toned down the error reporting of EPIPE in the vty -- so no longer looks like an error... ...closing a vty by "exit" command is logged as "closed" ...closing a vty in response to the client closing their end of the connection is logged as "terminated: terminal closed", and no longer logs an EPIPE error. * changed error reporting on close() and shutdown() for vty, so that nothing is logged if an i/o error has already logged... ...so that redundant error messages are suppressed. * applied slightly finer jittering to bgpd timers. * work in progress on new vtysh.
* Reviewed and improved vty and (particularly) vtysh.Chris Hall2012-02-261-36/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * fix stream_put() to accept NULL src (again). * changed how vty terminal reports time-out and end-of-file, and made --more-- show the same as ordinary cli. * tighten on or two stream functions, to cope if for some reason the getp > endp or endp > size. * update documentation in vio_lines.c * fixed (potential) bug which would have tripped up --more-- if were to be required while outputting notification for a cancel operation. * as a new command loop is set up, make sure all start in vst_cmd_running_executing, so that output will be dispatched. * fix uty_std_out_push() and uty_vtysh_out_push to take notice of vst_cmd_running and vst_cmd_executing and change to vst_cmd_complete as required. * fix handling of hold_mark in VOUT_TERM obuf an line control. * fix various state related issues for vtysh server and the vtysh itself. * when vtysh connects to a daemon, the daemon responds with its name and version number. TBD: the vtysh to check that version is as expected ! * clarified handling of errors in vtysh... distinguishing errors reported by the client daemon, and errors in the mechanics of talking to the client daemon. ~
* Fix reading encrypted password from config and "pthreads on" commandChris Hall2012-02-211-261/+262
| | | | | | | | | | | | | | | | | | Also: * re-organise vty output such that never blocks while executing a command -- but does wait/block between commands, so that all output associated with a command has completed before starts to execute the next. * make raising exception always signal the command loop, and revise code so that (a) signal is clearly secondary, and (b) that actual signal value no longer really matters. * fix timeout handling for pipe returns when only the pipe return and the pipe stderr return are left. * simplify the handling of blocking for pipes.
* vtysh partly restored. bgpd not crashing on over-size messages.Chris Hall2012-02-191-1039/+1868
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NB: this is a partial interim version -- NOT for production. Reinstate vtysh. In bgpd: cope better with generating oversize messages. The "pipework" branch is no more. There is now "euro_ix" and "euro_ix_b", where 'b' stands for 'bleedin'. The "pipework" is currently in 'bleedin'. Version updated to: 0.99.18ex20b Major changes in this commit: * modified bgpd to avoid crashing if an oversize message is created. At present, any oversize messages are simply discarded. This may be a mistake... since it is possible that some routes that should have been withdrawn are not. TBA. The stream lib facilities have been overhauled to may this easier. * restoring vtysh. At present the vtysh is thought to work, except that it does not currently create integrated configuration files. For the time being, *only* the following compile: lib, bgpd, zebra, vtysh, tests All other daemons will fail to compile, and must be disabled.
* Further simplification of CLI state handling.Chris Hall2011-09-081-133/+158
| | | | Covering corner cases and reducing ambiguity.
* Further improvements to "pipework".ex19pChris Hall2011-09-061-15/+87
| | | | | | | | | | | | | Version advanced to 0.99.18ex19p. Fixed occasional failure to immediately display prompt after previous command output was abandonned by ^C, particularly with "--more--". Completely removed the "~" temporary prompt, and simplified some logic. Added indication of pthread running to "show version".
* Update pipework and improve memory reporting.Chris Hall2011-07-211-587/+1037
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Improve error handling for all new pipework inputs and outputs. Change behaviour of ^C from VTY Terminal, so that will interrupt output and terminate all running pipes -- including running shell commands. In pipe commands, recognise "~/..." and "~user/..." home directory forms. Changed "~/" to mean the usual home for the current user. "~~/" now means the configuration file directory. Introduced "shdir DIR" command to show what is (currently) what. Changed "<|" so that if the command has a path, it is expanded using Quagga's rules (including "~~/" and "~./") and the "here" directory is set to that path. Fixed collection of stderr output from all pipes so that is separate from stdout output, and is always sent to the base output (eg VTY Terminal). Increase amount of information about the heap that "show mem" shows -- particularly if the "memory_tracker" is enabled. Tested and applied resulting fixes.
* Better mechanism for handling depth_mark in vty->vio.Chris Hall2011-03-301-9/+0
| | | | | | | | | Previous mechanism required special steps before any new output vty was opened -- which was easy to forget. New mechanism requires extra step when input and output are opened at the same time, which is less common, and more obviously requires the extra step. Fixes problem with "write memory" command.
* Fix compile on older gcc, and other minor fixes.Chris Hall2011-03-291-1/+6
| | | | | | | | | | Slightly older gcc would not tolerate an offsetof() where the type part contained a '->' -- replaced foo->bar by foo[0].bar, which is more readily tolerated. Fixed assert() in "--more--". Improved some shut-down code.
* Bring "ex" version up to date with 0.99.18ex15pChris Hall2011-03-291-4/+4
| | | | | | | | | Release: 0.99.18ex15p -- Pipework Branch Also fixes issue with unknown attributes -- does not release them prematurely. Contains the "bgpd: New show commands for improved view and address family support", which is post 0.99.18. (But not RFC 5082 GTSM.)
* Upgrade of "pipework" -- including piping to/from shell commandsex11pChris Hall2011-03-211-446/+1339
| | | | | | Version 0.99.15ex11p A major overhaul.
* Initial commit to seed the "pipework" branchex10pChris Hall2011-02-131-0/+863
This is a major revision of the command processing, in order to support new lexical level for command lines, plus all the necessary I/O redirection for the pipes. This is version 0.99.15ex10p. This supports: < filename <+ filename .... > filename .... >> filename .... >* Also contains all lexical level handling of '...', "...." and \x in order to allow use of '>' et al if required. Updated command line completion and help is a work in progress.