summaryrefslogtreecommitdiffstats
path: root/src/vty/command.c
Commit message (Collapse)AuthorAgeFilesLines
* doxygen: unify use of \file across the boardNeels Hofmeyr2017-06-231-2/+2
| | | | | | | | | | | | | | | | | Considering the various styles and implications found in the sources, edit scores of files to follow the same API doc guidelines around the doxygen grouping and the \file tag. Many files now show a short description in the generated API doc that was so far only available as C comment. The guidelines and reasoning behind it is documented at https://osmocom.org/projects/cellular-infrastructure/wiki/Guidelines_for_API_documentation In some instances, remove file comments and add to the corresponding group instead, to be shared among several files (e.g. bitvec). Change-Id: Ifa70e77e90462b5eb2b0457c70fd25275910c72b
* doxygen: enable AUTOBRIEF, drop \briefNeels Hofmeyr2017-06-231-13/+13
| | | | | | | | | | Especially for short descriptions, it is annoying to have to type \brief for every single API doc. Drop all \brief and enable the AUTOBRIEF feature of doxygen, which always takes the first sentence of an API doc as the brief description. Change-Id: I11a8a821b065a128108641a2a63fb5a2b1916e87
* vty/command.c: drop useless assignmentVadim Yanitskiy2017-06-131-1/+1
| | | | Change-Id: Ia30b6481ee570c6cf3e3b38e7a78028c66c036b7
* update/extend doxygen documentationHarald Welte2017-06-121-1/+2
| | | | | | | | | It's a pity that even with this patch we still are fare away from having the whole API documented. However, at least we have a more solid foundation. Updates not only extend the documentation, but also make sure it is rendered properly in the doxygen HTML. Change-Id: I1344bd1a6869fb00de7c1899a8db93bba9bafce3
* vty: OSMO_ASSERT() if two identical commands are installedHarald Welte2017-01-071-0/+19
| | | | | | | | | When the caller installs two identical commands at a given VTY node, the result is that neither of the two commands can ever be executed: The VTY would always complain about "Ambiguous command.". Let's fail fast at program start when two identical commands are intalled. Change-Id: I85ff4640ebb3d8b75a6a9ab5d2f668edb5b7189e
* add osmo_gettimeofday as a shim around gettimeofdayNeels Hofmeyr2016-09-221-1/+1
| | | | | | | This allows feeding a custom time for unit tests by overriding osmo_gettimeofday. Change-Id: Ic7a81a6eb51f27fe452962b91f2eae2070d87089
* add vty call show asciidoc: generate a documentation for countersAlexander Couzens2016-06-141-0/+53
| | | | | | | | | | | For each counter group a ascii doc table is generated containing all single counter with a reference to a section to add additional information to the counter Change-Id: Ia8af883167e5ee631059299b107ea83c8bbffdfb Reviewed-on: https://gerrit.osmocom.org/70 Reviewed-by: Harald Welte <laforge@gnumonks.org> Tested-by: Harald Welte <laforge@gnumonks.org>
* vty: Don't call exit() but rather use OSMO_ASSERT()Harald Welte2015-11-121-15/+4
| | | | | This was pointed out by Jaroslav Skarvada during fedora packaging, and he has a valid point...
* fix FSF address in sources/headersJaroslav Škarvada2015-11-121-2/+2
| | | | Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
* vty: Change API to have node installation be done by intHolger Hans Peter Freyther2015-08-051-4/+4
| | | | | | | | | | | | | | | | We are mixing enums and hope that no short-enums are used. This is leading to a lot compiler warnings generated by clang. Change the API to work with integers. Porting: The go_parent_cb implementations in the applications need to be fixed. The API change leads to a compile time warning. Fixes: abis_om2000_vty.c:46:2: warning: implicit conversion from enumeration type 'enum bsc_vty_node' to different enumeration type 'enum node_type' [-Wenum-conversion] OM2K_NODE, ^~~~~~~~~
* vty: Check with the application before writing the configHolger Hans Peter Freyther2014-12-041-0/+9
| | | | | | | | | For the BSC/NITB application we see that people modify the band without modifying the ARFCN. This creates an unbootable config. Using the new hook the BSC/NITB can check if the config is consistent and prevent the config file being written. Related: SYS#739
* vty: Allow vty_go_parent() in all nodes.Jacob Erlbeck2013-09-111-5/+25
| | | | | | | This patch removes an assertion of node > CONFIG_NODE and changes the function to handle all nodes properly. For the sake of completeness, the generic 'exit' command implementation is extended to work properly with all nodes, too.
* vty: Replace 'enum node_type' by 'int' for last_nodeJacob Erlbeck2013-09-101-1/+1
| | | | | In this case the last_node variable may hold values that are not in enum node_type, so int is used instead.
* vty: Add vty_install_default() and use for the vty nodesJacob Erlbeck2013-09-081-4/+14
| | | | | | | | | | | This adds the vty_install_default() function that is basically the install_default() function plus the registration of the commands 'exit' and 'end'. The latter is only provided in subnodes of ENABLED_NODE and CONFIG_NONE. The VTY test program is extended to check these commands. Ticket: OW#952
* vty: Refactored vty_go_parent(), 'end' and 'exit'Jacob Erlbeck2013-09-081-22/+35
| | | | | | Put all 'exit' logic into vty_go_parent() and replace the implementations of 'exit' and 'end' by generic ones that use vty_go_parent().
* vty: Rename is_config() to is_config_child()Jacob Erlbeck2013-09-081-3/+3
| | | | | The function is_config() returns 0 for CONFIG_NODE. Since that node is a config node, the function is renamed to resolve this.
* vty: Attempt to fix various meam leaks in the VTY lookup codeHolger Hans Peter Freyther2013-07-031-0/+3
| | | | | | | | | | These routines were not freeing vectors used for the lookup. On review it is fixing another path not detected by coverity. The danger is a double free in tab completion now. It is difficult to test this. Fixes: Coverity CID 23037, CID 23038
* VTY: don't show HIDDEN or DEPRECATED vty commands in ? completionHarald Welte2013-02-121-0/+3
| | | | | | | This hides HIDDEN or DEPRECATED commands from showing up when the full list of commands is inquired with '?' at any given point in the command tree. Only if the hidden/deprecated command is already typed in partially, then it will still tab-complete.
* vty/command.c: Cosmetic cleanupHarald Welte2013-02-121-82/+81
| | | | | this is just changing some of the code to reduce the way too high level of indentation and thus improve readability.
* vty: Do better filtering of arguments, optional args particularlySylvain Munaut2013-01-031-208/+143
| | | | | | | | This is essentially http://patchwork.diac24.net/patch/271/ forward ported to libosmovty Original-by: Paul Jakma <paul@quagga.net> Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
* vty: Add xsd and a command that can generate the documentation.Holger Hans Peter Freyther2012-07-251-0/+148
| | | | | | | | When building the doxygen documentation do not remove the other VTY documentation files in the doc/vty folder. Create a command that can be installed to dump all nodes and commands as XML on the given VTY. Create a schema for the XML file and a XSL-T script that can merge the generated file with additional information.
* doc: Fix the Doxygen section endingsSylvain Munaut2012-04-181-1/+1
| | | | Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
* vty: Add a function to write the current config to a file.Holger Hans Peter Freyther2012-03-281-46/+130
|
* doxygen: split VTY configuration in multiple filesHarald Welte2011-08-171-1/+1
|
* doxygen: Add (partial) VTY API documentationHarald Welte2011-08-171-9/+21
|
* get rid of non-ANSI function declarations missing (void)Harald Welte2011-07-161-1/+1
| | | | Detected by Smatch
* include: reorganize headers file to include/osmocom/[gsm|core]Pablo Neira Ayuso2011-03-231-1/+1
| | | | | | | | | | | | This patch moves all GSM-specific definitions to include/osmocom/gsm. Moreover, the headers in include/osmocore/ have been moved to include/osmocom/core. This has been proposed by Harald Welte and Sylvain Munaunt. Tested with `make distcheck'. Signed-off-by: Pablo Neira Ayuso <pablo@gnumonks.org>
* LOGGING: configure logging from the vtyHarald Welte2011-02-181-0/+4
| | | | | We can now configure logging to (multiple) files, stderr and syslog from the vty command line in a persistent way (config file)
* vty: Everything <= CONFIG_NODE is not a child of configHolger Hans Peter Freyther2010-09-041-2/+2
| | | | | | | The method should be renamed to is child of config node as it was comparing if vty->node > CONFIG_NODE. This is fixing an assert in go_to_parent as we tried to find a parent for the CONFIG_NODE.
* vty: Handle nodes part of the lib in the lib, for the rest call the callbackHolger Hans Peter Freyther2010-08-261-5/+7
|
* vty: Add a new callback to let code decide if it is a config node or notHolger Hans Peter Freyther2010-08-261-0/+4
|
* vty: Move the assumption of the config nodes into a functionHolger Hans Peter Freyther2010-08-261-3/+9
| | | | | | Move the assumption that something is a child of the CONFIG_NODE into a new function. The next step will be to use something else for that.
* [VTY] add support for numeric ranges with negative numbersAndreas Eversberg2010-07-131-31/+67
| | | | This enables us to do something like <-128-127> as a numeric range.
* [VTY] Introduce "struct vty_app_info" for vty_init() functionHarald Welte2010-05-251-8/+9
|
* Create libosmovty as library from OpenBSC VTY functionsHarald Welte2010-05-251-0/+3176