summaryrefslogtreecommitdiffstats
path: root/src/vty/utils.c
Commit message (Collapse)AuthorAgeFilesLines
* stop printing group description in vty_out_rate_ctr_group_fmt()Stefan Sperling2018-10-291-3/+0
| | | | | | | | | | | | | | When vty_out_rate_ctr_group_fmt() prints the description of a counter group, it assumes this description should appear at the beginning of a line. However, the caller might be printing counters in an indented context. So just let the caller worry about printing the group title if necessary (there is currently only one known caller, which is updated in this commit). Note that printing of the group title was an undocumented feature. Change-Id: I2c55cb54e8b7a7c8c6cf72f22287083767ed0201 Related: OS#2660
* remove unused argument from pad_append_ctr() helper functionStefan Sperling2018-05-251-7/+7
| | | | | | Change-Id: Iff5699be1dc306120cc1752b0a892e4fcbc5a8c0 Fixes: 97d3da2c591984b47839fd1d9a5cba24a7f05fa1 Related: OS#3245
* introduce vty_out_rate_ctr_group_fmt() functionStefan Sperling2018-05-241-0/+136
| | | | | | | | | | | | This new function can be used to print a rate counter group according to a format string. The intention is to generalize and replace manual printing of counters as implemented for the 'show statistics' VTY command of osmo-bsc. Related: OS#3245 Related: osmo-bsc commit 71d524c059c5a5c90e7cb77d8a2134c1c68b9cde (g#9217) Change-Id: Idb3ec12494ff6a3a05efcc8818e78d1baa6546bd
* Fix/Update copyright notices; Add SPDX annotationHarald Welte2017-11-131-0/+3
| | | | | | | | Let's fix some erroneous/accidential references to wrong license, update copyright information where applicable and introduce a SPDX-License-Identifier to all files. Change-Id: I39af26c6aaaf5c926966391f6565fc5936be21af
* Rename 'statistics.c' to 'counter.c'Harald Welte2017-10-151-1/+1
| | | | | | | | | With stat_item, stats.c and stats_statsd.c, it is becoming a bit difficult to understand file naming. Also, the 'statistics.c' file actually only contained osmo_counter handling, so let's rename it to counter.c altogether. Change-Id: I2cfb2310543902b7da46cb15a76e2da317eaed7d
* doxygen: unify use of \file across the boardNeels Hofmeyr2017-06-231-5/+4
| | | | | | | | | | | | | | | | | 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-3/+3
| | | | | | | | | | 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
* update/extend doxygen documentationHarald Welte2017-06-121-19/+31
| | | | | | | | | 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_counter: use name if description is NULLAlexander Couzens2016-10-131-1/+5
| | | | | | | | | | | `show stats` shows (null) for osmocom_counters when description is null. OpenBSC> show stats Ungrouped counters: (null): 4 Change-Id: I553b88a6fca688924b1f2b49e8cb17e90f057bb1
* stat: Explicitly support stat_items without unitJacob Erlbeck2015-12-081-1/+4
| | | | | | | Add OSMO_STAT_ITEM_NO_UNIT for stat items without an unit. The statsd reporter uses gauges ("g") to report them. Sponsored-by: On-Waves ehf
* stats/vty: Add selective show stats commandJacob Erlbeck2015-08-221-2/+16
| | | | | | | | | | | | | | | | Currently there is only the 'show stats' command which shows all counter and stat_item values. This can lead to many lines of output if there are per-subscriber rate counters. The new command added by this commit allows it to only show groups of a certain level (class_id), similar to the 'level' configuration command for stats reporter. The new command is show stats level (global|peer|subscriber) Sponsored-by: On-Waves ehf
* stats: Add osmo_ name prefix to identifiersJacob Erlbeck2015-11-021-8/+8
| | | | | | | | | | Since the the stat_item and stats functions and data types are meant to be exported, they get an osmo_ prefix. Sponsored-by: On-Waves ehf [hfreyther: Prepended the enum values too. This was requested by Jacob]
* stat/vty: Add vty_out_statistics_full to show all statisticsJacob Erlbeck2015-10-281-0/+58
| | | | | | | This functions shows the state of all osmo_counters, stat_item groups, and counter groups. Sponsored-by: On-Waves ehf
* stat/vty: Use the iterator algorithms to show ctrg and statgJacob Erlbeck2015-10-281-20/+43
| | | | | | | | | | Currently the groups for stat_items and counter are iterated manually. This commit makes use of the new iterator functions to access the single elements via handlers. Sponsored-by: On-Waves ehf
* stats: Add vty_out_stat_item_groupJacob Erlbeck2015-10-281-0/+22
| | | | | | This functions dumps a whole stat item group to the VTY. Sponsored-by: On-Waves ehf
* vty: Support multi-char separators and end stringsJacob Erlbeck2013-08-061-4/+5
| | | | | In vty_cmd_string_from_valstr() include the real string lengths of the sep and end arguments into the buffer size calculation.
* vty: Fix misusage of snprintf in vty/utils.cJacob Erlbeck2013-08-061-2/+2
| | | | | | | | | | | | | | | Compiled with ubuntu 1204 (precise), where -Wformat-security is enabled by -Wall. Test yields ok, but the current implementation doesn't properly support multi-character separators and end strings. So the test output is truncated. Addresses: utils.c: In function 'vty_cmd_string_from_valstr': utils.c:84:2: warning: format not a string literal and no format arguments [-Wformat-security] utils.c:84:2: warning: format not a string literal and no format arguments [-Wformat-security] utils.c:108:2: warning: format not a string literal and no format arguments [-Wformat-security] utils.c:108:2: warning: format not a string literal and no format arguments [-Wformat-security]
* vty: Address compiler warning about tolowerHolger Hans Peter Freyther2012-09-111-0/+1
| | | | | | | Include ctype.h to have a declaration of tolower. utils.c: In function 'vty_cmd_string_from_valstr': utils.c:95:6: warning: implicit declaration of function 'tolower' [-Wimplicit-function-declaration]
* import vty_cmd_string_from_valstr() from osmo-btsHarald Welte2012-08-201-0/+54
| | | | | This function is able to generate a VTY help string based on an array of 'struct value_string'.
* doc: Fix the Doxygen section endingsSylvain Munaut2012-04-181-1/+1
| | | | Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
* doxygen: Add (partial) VTY API documentationHarald Welte2011-08-171-0/+13
|
* include: reorganize headers file to include/osmocom/[gsm|core]Pablo Neira Ayuso2011-03-231-4/+4
| | | | | | | | | | | | 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>
* Create libosmovty as library from OpenBSC VTY functionsHarald Welte2010-05-251-0/+50