summaryrefslogtreecommitdiffstats
path: root/lib/vty_cli.c
Commit message (Collapse)AuthorAgeFilesLines
* Reviewed and improved vty and (particularly) vtysh.Chris Hall2012-02-261-183/+308
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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: "--more--" and "no ip prefix-list fred"Chris Hall2012-02-221-4/+5
| | | | | | | | | | Also, fix compilation of privs.c when HAVE_CAPABILITIES. Wiping of "--more--" was issuing twice as many BS as required. (Oddly, some telnet programs tollerated this !) "no ip prefix-list fred" could hit a SEGV if there are no references to the prefix-list.
* Fix reading encrypted password from config and "pthreads on" commandChris Hall2012-02-211-5/+1
| | | | | | | | | | | | | | | | | | 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-812/+964
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-182/+141
| | | | Covering corner cases and reducing ambiguity.
* Further improvements to "pipework".ex19pChris Hall2011-09-061-421/+356
| | | | | | | | | | | | | 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".
* Merging of euro_ix branch into pipework.Chris Hall2011-09-021-7/+1
| | | | | | | | Bring in fixes for bgp dumping with pthreaded BGP Engine. Bring in new "show nexus xxx" command. Fix removal of '~' prompt.
* Disable the "~" VTY Terminal prompt.Chris Hall2011-07-211-2/+10
| | | | | | | | | | Commands sent to the Routing Engine are now sent as priority messages, so should no longer be a need for the "~" prompt which kept the CLI "live" while a command was waiting for the Routing Engine to pay attention. Also: reinstated test-vector.c tests for vector_move_item_here(), which seem somehow to have got lost.
* Update pipework and improve memory reporting.Chris Hall2011-07-211-260/+265
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Small improvements to speed of reading of configuration file.Chris Hall2011-03-311-24/+46
| | | | | Tidy up signalling of "ready" to command loop, and checking of appropriate state to close written configuration file.
* Bring "ex" version up to date with 0.99.18ex15pChris Hall2011-03-291-6/+6
| | | | | | | | | 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-1071/+1121
| | | | | | Version 0.99.15ex11p A major overhaul.
* Second tranche of updates for pipework branch.Chris Hall2011-02-131-1164/+1378
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | modified: bgpd/bgp_connection.c modified: bgpd/bgp_debug.c modified: bgpd/bgp_engine.h modified: bgpd/bgp_main.c modified: bgpd/bgp_packet.c modified: bgpd/bgp_peer.c modified: bgpd/bgp_route.c modified: bgpd/bgp_routemap.c modified: bgpd/bgp_session.c modified: bgpd/bgp_vty.c modified: bgpd/bgpd.c modified: bgpd/bgpd.h modified: configure.ac modified: isisd/dict.h modified: isisd/isis_misc.c modified: isisd/isis_routemap.c modified: isisd/isis_spf.c modified: lib/Makefile.am modified: lib/command.c modified: lib/command.h modified: lib/command_execute.h modified: lib/command_parse.c modified: lib/command_parse.h modified: lib/command_queue.c modified: lib/command_queue.h modified: lib/elstring.h modified: lib/heap.c modified: lib/if.c modified: lib/if.h modified: lib/keychain.c modified: lib/keystroke.c modified: lib/keystroke.h modified: lib/list_util.c modified: lib/list_util.h modified: lib/log.c modified: lib/log.h modified: lib/memory.c modified: lib/memory.h modified: lib/memtypes.c modified: lib/misc.h modified: lib/mqueue.c modified: lib/mqueue.h deleted: lib/node_type.h modified: lib/pthread_safe.c modified: lib/qfstring.c modified: lib/qiovec.c modified: lib/qiovec.h modified: lib/qpath.c modified: lib/qpnexus.c modified: lib/qpnexus.h modified: lib/qpselect.c modified: lib/qpthreads.h modified: lib/qstring.c modified: lib/qstring.h modified: lib/qtime.c modified: lib/qtime.h modified: lib/qtimers.c modified: lib/qtimers.h modified: lib/routemap.c modified: lib/symtab.h modified: lib/thread.h deleted: lib/uty.h modified: lib/vector.c modified: lib/vector.h modified: lib/version.h.in modified: lib/vio_fifo.c modified: lib/vio_fifo.h modified: lib/vio_lines.c modified: lib/vio_lines.h modified: lib/vty.c modified: lib/vty.h modified: lib/vty_cli.c modified: lib/vty_cli.h modified: lib/vty_io.c modified: lib/vty_io.h modified: lib/vty_io_basic.c modified: lib/vty_io_basic.h modified: lib/vty_io_file.c modified: lib/vty_io_file.h modified: lib/vty_io_shell.c modified: lib/vty_io_term.c modified: lib/vty_io_term.h modified: lib/vty_local.h modified: lib/vty_pipe.c modified: lib/workqueue.h modified: lib/zebra.h modified: ospf6d/ospf6_lsa.c modified: ripngd/ripngd.c modified: tests/test-list_util.c modified: tests/test-vector.c modified: vtysh/vtysh.c modified: vtysh/vtysh_config.c
* Creation of pipework branchChris Hall2010-12-211-41/+34
|
* Fixes to vty stuff so that zebra runs.Chris Hall2010-06-161-0/+3
| | | | | | | | | Changes to vty handling require the library to behave one way when running as part of the new (threaded) bgpd and another way when running as part of any of the other Quagga daemons. Code to revoke things from the command queue failed to test whether it was running as part of the new bgpd or not.
* Fix vty being closed while waiting on '--more--' prompt.Chris Hall2010-04-281-8/+38
| | | | | | | | | The vty_half_close() did not properly take care of the CLI state when in "cli_more_wait" state. This fix tests for cli_more_wait state in vty_half_close() and explicitly exits that state. (Instead of letting the state be cleared implicitly, which didn't quite tidy up quickly enough.)
* Further warnings removed for gcc 4.2.1.Chris Hall2010-04-171-2/+3
|
* Compile all daemons, except vtysh, clean but with warnings.Chris Hall2010-04-161-0/+1
| | | | | | | | Now compiles with all daemons enabled. Split command.h to separate out the functions whish are only used durring command execution -- that is, those used in vty.c and family and in vtysh.
* First beta releaseChris Hall2010-04-061-412/+775
| | | | | | | Various bug fixes and improvements. Running with a fair amount of debug/assert code, which must be removed at some date.
* Major updateChris Hall2010-03-161-0/+2308
bgpd/bgp_advertise.c bgpd/bgp_advertise.h The adj_in and adj_out objects are now put on a list based on the peer to whom the route belongs. The adj_in and adj_out objects also now point to the bgp_node which they are routes for. This substantially reduces the work needed to shut down a peer. bgpd/bgp_damp.c Changes to adj_in and adj_out forced small change to macros used in bgp_damp.c to manage its lists. bgpd/bgp_debug.c Replaced direct access to vty->node by the required vty_get_node(). bgpd/bgp_dump.c Changes to the names of fields in bgp_info structures. bgpd/bgp_engine.h Modified the debug and trace functions. bgpd/bgp_fsm.c Make use of sockunion2str() consistent with common usage. Improved some documentation. bgpd/bgp_main.c Use the newly extended qpn_add_hook_function() facility. bgpd/bgp_mplsvpn.c Changes to the names of fields in bgp_info structures. bgpd/bgp_msg_read.c Bug fix: correct handling of capability code length. Improvement: better casting in calculation of message length. bgpd/bgp_msg_write.c Bug fix: correct byte ordering of bgp_id in open message. bgpd/bgp_network.c Bug fix: correct handling of incoming connections. Takes advantage of improvements in sockunion.c. bgpd/bgp_nexthop.c Changes to the names of fields in bgp_info structures. bgpd/bgp_open_state.c Remove mistaken #include of memtypes.h bgpd/bgp_packet.c Improvements to handling of withdrawing routes for peers. bgpd/bgp_peer.c Tidying up the state of peers as they are enabled and disabled. Improvements to handling of withdrawing routes for peers. bgpd/bgp_peer.h Adding list bases for lists of routes originated by the peer. bgpd/bgp_peer_index.c Bug fix: correct freeing of peer indexes. bgpd/bgp_route.c Implement lists of bgp_info based in the owning peer. Adjust for name changes to bgp_info fields. Reimplemented all the clearing functions to use the lists of items that belong to the peer -- rather than searching route tables for stuff to withdraw. Changed work queue handling for added/changed routes, so that queues run through existing items, rather than having queues of auxiliary items -- lower memory overhead. bgpd/bgp_route.h Added fields to bgp_info to allow all bgp_info originated by each peer to live on lists based in the peer. And changed the name of existing fields to avoid confusion. bgpd/bgp_routemap.c Removing redundant code and fixing a memory leak. bgpd/bgp_table.h Based work queue for added/changed routes directly in the table, rather than having auxiliary structures. bgpd/bgp_vty.c Use vty_get_node() and vty_set_node() rather than direct access to the vty field. bgpd/bgpd.c Implement changes to route clearing. bgpd/bgpd.h Changes to work queue handling. lib/buffer.c Changes to allow embedded buffer structures. lib/buffer.h Moved struct buffer here so that could have embedded buffer structurs. lib/command.c Substantial tidy up and document exercise. Restructured the top level command processing and finding of descriptions and command completion. Removal of unpleasant messing around with the insides of vector structures. Movement of some command actions to vty.c. Uses uty.h to pick up the "private" functions from vty.c et al. lib/command.h Moved the "node" values to node_type.h, so that can use an enum node_type in places where cannot include command.h. lib/command_queue.c Updated to cope with the called command changing the node value. Improved handling of revoked commands, so the the command line handler does not get stuck waiting for a command to complete which has been revoked ! lib/command_queue.h Improved message format. lib/if.c Use vty_set_node(). lib/keychain.c Use vty_set_node(). new lib/keystroke.c new lib/keystroke.h New code to implement a keystroke FIFO. This moves some complexity out of the command handler. The handling of mixtures of escapes and Telnet IACs is tightened up. It would be possible to extend this to, say, UTF-8. Regularises the "stealing" of keystrokes for the "--more--" output handling... which was a bit hit and miss. new lib/list_util.c new lib/list_util.h New code to implement various forms of linked list, where the list pointers are embedded in structures. lib/log.c Changed the handling of log messages, so that all types of log output (except syslog) use the same message buffer scheme, and the message is constructed once and once only. Changes to the handling of VTY_LOCK() etc. Uses uty.h to pick up the "private" functions from vty.c et al. lib/log.h Changes to the buffering of log messages. new lib/mem_tracker.c New code to track memory allocation/deallocation, for debug purposes. lib/memory.c lib/memory.h Updated to allow the use of the mem_tracker. lib/memtypes.awk Made the memtypes into a named enum MTYPE. lib/memtypes.c Various new memory types. lib/mqueue.c lib/mqueue.h Add mqueue_finish function for close-down. lib/network.c lib/network.h Added non-blocking read_nb() and write_nb(). new lib/node_type.h As above. lib/plist.c Remove vty_puts() which wasn't a good idea. lib/qlib_init.c Added qps_init() to first stage and mqueue_finish to finish. lib/qpnexus.c lib/qpnexus.h More flexible hooks for in_thread_init and in_thread_final. lib/qpselect.c lib/qpselect.h Added qps_start_up() to build the required maps once and for all. Added qdebug to control the debug checks and validation. Improved validation and test functions. new lib/qstring.c new lib/qstring.h New code for limited flexible string handling. lib/qtimers.c Added qdebug to control the debug checks and validation. lib/routemap.c Use vty_set_node(). lib/sockunion.c lib/sockunion.h Tidied up and regularised the handling of sin_len and sin6_len. Created common function for setting port into socket. Created common function for initialisation/allocation of new sockunion. Reduced various functions by using common sub-functions. Rationalised some code. Added sockunion_listen() and sockunion_new_sockaddr(). Renamed sockunion_new() to sockunion_new_prefix(). Improved some logging messages. Added documentation. new lib/uty.h Functions etc. used only by vty/command/log/vty_io and vty_cli. lib/vector.c lib/vector.h Added vector_t type. Removed VECTOR_INDEX, vector_only_wrapper_free() and vector_only_index_free() -- following improvement of code in command.c. Added vector_set_min_length(), vector_set_new_min_length() and vector_length() functions. new lib/vio_fifo.c new lib/vio_fifo.h New code to manage simple FIFO of indefinite length. lib/vty.c lib/vty.h Reworked. Broken into vty.c, vty_io.c and vty_cli.c. new lib/vty_cli.c new lib/vty_cli.h CLI handling parts of the vty family. new lib/vty_io.c new lib/vty_io.h I/O parts of the vty family. lib/workqueue.h Introduced tyedefs for the various call-back entries. new tests/test-list_util.c Tests for the list-util stuff. vtysh/vtysh.c Small change to interface for cmd_execute_command()