aboutsummaryrefslogtreecommitdiffstats
path: root/src/vty
AgeCommit message (Collapse)AuthorFilesLines
2017-02-23logging.h: fixup: shorter names for LOGGING_FILTER_* and LOGGING_CTX_*Neels Hofmeyr1-2/+2
My recent logging patch was merged to master a bit too soon. Accomodate the request for naming that matches the general "LOG" prefix instead of "LOGGING". libosmocore will not be backwards-compatible with the few commits from change-id I5c343630020f4b108099696fd96c2111614c8067 up to this one. This and following commits are backwards compatible with those before that short window. See also: * openbsc change-id Ib2ec5e4884aa90f48051ee2f832af557aa525991 * osmo-pcu change-id I4db4a668f2be07f3d55f848d38d1b490d8a7a685 Change-Id: I424fe3f12ea620338902b2bb8230544bde3f1a93
2017-02-22logging: centrally define ctx and filter indexesNeels Hofmeyr1-2/+2
It is too easy for calling code to use the same filter and context indexes for different filters and structs. For example, openbsc's IMSI filter and libgb's GPRS_BVC filter both fall on index 1 even though there are plenty more indexes to choose from. To alleviate this, have one central definition here, sort of like ports.h does for VTY and CTRL port numbers. Add static asserts to make sure the indexes fit in the available array and bit mask space. Calling code like openbsc.git and osmo-pcu need adjustments and/or should move to using these enum values instead of their local definitions. Taking this opportunity to also prepare for a split of struct gsm_subscriber in openbsc into bsc_subsciber and vlr_subscriber with appropriate separate filter index constants for both subscriber types. Include previous LOG_FILTER_ALL in the LOGGING_FILTER_* enum, and replace its use by (1 << LOGGING_FILTER_ALL). Change-Id: I5c343630020f4b108099696fd96c2111614c8067
2017-01-07fsm: Add VTY introspection of osmo_fsm and their instancesHarald Welte2-1/+178
Change-Id: I89212e4f149f019099115a85bab353c04170df90
2017-01-07vty: OSMO_ASSERT() if two identical commands are installedHarald Welte1-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
2016-12-21Catch-up with git version tagsMax1-1/+2
* update debian/changelog * update TODO-RELEASE * add comments to Makefile.am and TODO-RELEASE to simplify the process in future * add link to libtool docs to Makefile.am to simplify LIBVERSION maintenance Related: OS#1861 Change-Id: I22c257e357f597519120232d742d6a61289db021
2016-12-11Fix VTY: add missing doc for 'log gsmtap [HOSTNAME]'Neels Hofmeyr1-1/+2
Add missing doc string for the HOSTNAME arg. Added in commit aa00f99be2e4cc64ede20d8c9548b83054696581, this breaks the VTY tests for openbsc and hence breaks our jenkins build jobs. Change-Id: I734b22c950242541322e902887bf779c14ba10fd
2016-12-09Implement GSMTAP log targetHarald Welte1-0/+32
This target wraps the to-be-logged string (With metadata) into a GSMTAP packet and sends it to the configured destination address. Change-Id: I9a7e72b8c9c6f6f2d76d1ea2332dcdee12394625
2016-11-26telnet_interface: Handle osmo_fd_register() eror return codeHarald Welte1-1/+6
Change-Id: I5bc1c2cbb04e363d868355b5ed866b4840f16c61 Fixes: Coverity 57637
2016-11-15vty: Skip printing non-initialized log categoriesDaniel Willmann1-0/+3
Without this patch the vty command show logging vty will cause a segfault if not all elements of the log_categories array are defined. Ticket: OW#3053 Sponsored-by: On-Waves ehf Change-Id: Ieeba649c3bde6c9376d8e32b00b92beb37c08ef2
2016-10-18vty/show asciidoc: counters: improve table headersAlexander Couzens1-5/+8
add [options=header] to every table header vty/show asciidoc: rename reference field into "Reference" vty/show asciidoc: capilize table header field names Change-Id: Ie991f4db77a60afb86a2a0b35c137586527f6228
2016-10-18vty/show asciidoc: add user readable description of the versionAlexander Couzens1-0/+10
Change-Id: Ie0f1b3894361c58386da9defb225979fa0ee6a18
2016-10-13vty/osmo_counter: use name if description is NULLAlexander Couzens1-1/+5
`show stats` shows (null) for osmocom_counters when description is null. OpenBSC> show stats Ungrouped counters: (null): 4 Change-Id: I553b88a6fca688924b1f2b49e8cb17e90f057bb1
2016-09-23log telnet bind address and portNeels Hofmeyr1-1/+8
Log 'telnet at 1.2.3.4 5678' from telnet_init*. All callers can now drop any extra 'VTY at 1.2.3.4 5678' logging. Change-Id: I1da7b9076311d9458caea732fc0daace6533a3fd
2016-09-22add osmo_gettimeofday as a shim around gettimeofdayNeels Hofmeyr1-1/+1
This allows feeding a custom time for unit tests by overriding osmo_gettimeofday. Change-Id: Ic7a81a6eb51f27fe452962b91f2eae2070d87089
2016-08-20vty: use VTY_BIND_ADDR_DEFAULT instead of "127.0.0.1"Neels Hofmeyr1-1/+1
Change-Id: Ice0688ac9847524cb546f6d41547090b6a3cb3d8
2016-06-15vty: Fix documentation of 'show asciidoc counters' VTY commandHarald Welte1-1/+1
VTY documentations strings follow a certain structure, and we need to follow that to make the interactive help work. Change-Id: I0bb0bda68dbbf9995338ec555ff99d73a223162c Reviewed-on: https://gerrit.osmocom.org/276 Reviewed-by: Harald Welte <laforge@gnumonks.org> Tested-by: Harald Welte <laforge@gnumonks.org>
2016-06-14add vty call show asciidoc: generate a documentation for countersAlexander Couzens2-0/+195
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>
2016-02-25vty: add bind command for telnet vty lineNeels Hofmeyr1-0/+28
Add VTY command line vty bind A.B.C.D The command merely stores the configured IP-address, which can then be used by the calling main program to set the telnet port of the VTY line. (Commits in openbsc and osmo-iuh will follow up on this.) Add function vty_get_bind_addr() to publish the address in the vty.h API. Add static vty_bind_addr to store. For allocation/freeing reasons, a NULL address defaults to 127.0.0.1. BTW, I decided against allowing keywords 'any' and 'localhost' in place of an actual IP address to make sure a written config is always identical to the parsed config.
2015-11-09vty: Use NULL to have a null pointer instead of '\0'Holger Hans Peter Freyther1-3/+3
'\0' gets translated to zero but the argument to vector_set is a pointer and it gets converted to a pointer. vty.c:985:21: warning: expression which evaluates to zero treated as a null pointer constant of type 'void *' [-Wnon-literal-null-conversion] vector_set(vline, '\0'); ^~~~ vty.c:1095:21: warning: expression which evaluates to zero treated as a null pointer constant of type 'void *' [-Wnon-literal-null-conversion] vector_set(vline, '\0'); ^~~~ vty.c:1097:21: warning: expression which evaluates to zero treated as a null pointer constant of type 'void *' [-Wnon-literal-null-conversion] vector_set(vline, '\0'); ^~~~
2015-12-08stat: Explicitly support stat_items without unitJacob Erlbeck1-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
2015-12-05remove our internal copy of talloc, use system libtallocHarald Welte1-2/+2
Shipping our own private copy of talloc was a good idea in 2008, when it was not readily available on most target platforms. Today, the situation is quite different, as it is a standard library on major Linux distributions.
2015-11-12vty: Don't call exit() but rather use OSMO_ASSERT()Harald Welte1-15/+4
This was pointed out by Jaroslav Skarvada during fedora packaging, and he has a valid point...
2015-11-12fix FSF address in sources/headersJaroslav Škarvada3-6/+6
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2015-11-07stats: Document the level in show stats level optionsHolger Hans Peter Freyther1-0/+1
Potentially Fixes: <command id='show stats level (global|peer|subscriber)'> <param name='subscriber' doc='(null)' />
2015-08-22stats/vty: Add selective show stats commandJacob Erlbeck2-2/+31
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
2015-11-03misc: Prepare the release of libosmocore 0.9.00.9.0Holger Hans Peter Freyther1-1/+1
Bump the ABI version of libosmovty and we need to do this recursively to force rebuilds of our software.
2015-11-02stats: Fix handling of the no mtu commandHolger Hans Peter Freyther1-1/+1
For the atoi we need to pass the val as a string. This means we need to write "0" which then gets parsed to 0. [src/vty/stats_vty.c:90]: (error) Possible null pointer dereference: val
2015-11-02stats: Limit reporting by class idJacob Erlbeck1-0/+37
This commit adds class_id fields to the rate_ctr and stat_item group descriptions. The stats reporter code is extended to only process groups whose class_id does not exceed a per reporter max_class level. If the class_id is not set, the code assumes 'global' for groups with idx == 0 and 'subscriber' otherwise. The following vty command is added to config-stats: level (global|peer|subscriber) Set the maximum group level Sponsored-by: On-Waves ehf
2015-11-02stats: Add osmo_ name prefix to identifiersJacob Erlbeck2-48/+48
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]
2015-10-29stats: Add log reporterJacob Erlbeck1-0/+49
This reporter passes the measurement values to the logging subsystem as DSTATS (which is currently DLGLOBAL) level INFO messages. Sponsored-by: On-Waves ehf
2015-10-29stats: Make net config optionalJacob Erlbeck1-12/+15
To support reporters without network configuration, this commit introduces the have_net_config flag to provide corresponding error messages. Sponsored-by: On-Waves ehf
2015-10-29stats: Add missing mtu command to 'write' outputJacob Erlbeck1-0/+3
Currently the config_write_stats_reporter function does not output the mtu value, which is fixed by this commit. Sponsored-by: On-Waves ehf
2015-10-29stats: Support statsd Multi-Metric PacketsJacob Erlbeck1-0/+19
If the MTU is given, combine several messages into a single UDP packet until the limit is reached. Flush all reporters after the values have been scanned. New vty commands (node config-stats): mtu <100-65535> Enable multi-metric packets and set the maximum packet size (in byte) no mtu Disable multi-metric packets Note that single messages that are longer than the given MTU (minus 28 octets protocol overhead) will be dropped. Sponsored-by: On-Waves ehf
2015-10-29stats: Implement timer based reportingJacob Erlbeck1-13/+21
This calls stats_flush in regular intervals which polls the statistical values and calls the active reporters when values have changed. Sponsored-by: On-Waves ehf
2015-10-29stats/vty: Add stats configurationJacob Erlbeck1-1/+260
This commit provides stats configuration similar to the log configuration. The following vty commands are added to the config node: stats reporter statsd Create/Modify a statsd reporter no stats reporter statsd Remove a statsd reporter To actually configure a reporter, the config-stats node is entered when the "stats reporter" command has succeeded. The following new vty commands are available there: local-ip ADDR Set the IP address to which we bind locally no local-ip Do not bind to a certain IP address remote-ip ADDR Set the remote IP address to which we connect remote-port <1-65535> Set the remote port to which we connect prefix PREFIX Set the item/counter name prefix no prefix Do not use a prefix enable Enable the reporter disable Disable the reporter Sponsored-by: On-Waves ehf
2015-10-29stats/vty: Add stats_vty.cJacob Erlbeck2-1/+53
This file will contain the VTY code related to statistics. This commit adds a minimal file with just as single VTY command: - show stats This command shows all statistical values To enable this and future commands, the main program needs to call stats_vty_add_cmds(). Sponsored-by: On-Waves ehf
2015-10-28stat/vty: Add vty_out_statistics_full to show all statisticsJacob Erlbeck1-0/+58
This functions shows the state of all osmo_counters, stat_item groups, and counter groups. Sponsored-by: On-Waves ehf
2015-10-28stat/vty: Use the iterator algorithms to show ctrg and statgJacob Erlbeck1-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
2015-10-28stats: Add vty_out_stat_item_groupJacob Erlbeck1-0/+22
This functions dumps a whole stat item group to the VTY. Sponsored-by: On-Waves ehf
2015-08-23Prepare new upstream release0.8.3Holger Hans Peter Freyther1-1/+1
2015-08-05vty: Change API to have node installation be done by intHolger Hans Peter Freyther1-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, ^~~~~~~~~
2015-03-20vty: Fix writing the logging of categoryMichael McTernan1-1/+1
Fix copy and paste issue introduced by Holger in 2d6ad13d8daf860595e6d4025861e122ce574871.
2015-01-27vty: Fix typo in the state creationHolger Hans Peter Freyther1-1/+1
This got introduced in 2d6ad13d8daf860595e6d4025861e122ce574871 and I thought that our vty tests would have caught such mistakes.
2015-01-18Prepare a new libosmocore release0.8.0Holger Hans Peter Freyther1-1/+1
2014-12-05logging: Make it possible to print category/subsys and timestampsHolger Hans Peter Freyther1-3/+46
We want to see from which category/subsystem a certain log message is coming from and use a different timestamp format as well. Add two new bitfields. This doesn't change the size of the structure and on 32bit we still have 27bits left. The extended timestamp will take preference over the current and default timestamp format. Fixes: SYS#602
2014-12-04vty: Check with the application before writing the configHolger Hans Peter Freyther1-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
2014-11-14vty/vector.c: Use string.h, not memory.hHarald Welte1-1/+1
2014-11-14remove references to u_long type, use 'unsigned long' insteadHarald Welte2-3/+3
.. Nuttx doesn't know u_long
2014-11-14remove references to u_char type, use 'unsigned char' insteadHarald Welte2-2/+2
... u_char not being defined on Nuttx.
2014-10-03build: remove unused all_includes and use AM_CPPFLAGSJan Engelhardt1-1/+2
Preprocessor flags are best placed in AM_CPPFLAGS. Remove use of the unused all_includes variable, which is never set.