summaryrefslogtreecommitdiffstats
path: root/src/vty
Commit message (Collapse)AuthorAgeFilesLines
* fix spelling in API docu, command reply, logging, descriptionsThorsten Alteholz2017-04-231-1/+1
| | | | | | sections: ctrl, gb, gsm, vty Change-Id: Iac211b5cd8504da36b699777b95a2448dd7c3e70
* logging.h: fixup: shorter names for LOGGING_FILTER_* and LOGGING_CTX_*Neels Hofmeyr2017-02-231-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
* logging: centrally define ctx and filter indexesNeels Hofmeyr2017-02-221-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
* fsm: Add VTY introspection of osmo_fsm and their instancesHarald Welte2017-01-072-1/+178
| | | | Change-Id: I89212e4f149f019099115a85bab353c04170df90
* 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
* Catch-up with git version tagsMax2016-12-211-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
* Fix VTY: add missing doc for 'log gsmtap [HOSTNAME]'Neels Hofmeyr2016-12-111-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
* Implement GSMTAP log targetHarald Welte2016-12-091-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
* telnet_interface: Handle osmo_fd_register() eror return codeHarald Welte2016-11-261-1/+6
| | | | | Change-Id: I5bc1c2cbb04e363d868355b5ed866b4840f16c61 Fixes: Coverity 57637
* vty: Skip printing non-initialized log categoriesDaniel Willmann2016-11-151-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
* vty/show asciidoc: counters: improve table headersAlexander Couzens2016-10-181-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
* vty/show asciidoc: add user readable description of the versionAlexander Couzens2016-10-181-0/+10
| | | | Change-Id: Ie0f1b3894361c58386da9defb225979fa0ee6a18
* 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
* log telnet bind address and portNeels Hofmeyr2016-09-231-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
* 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
* vty: use VTY_BIND_ADDR_DEFAULT instead of "127.0.0.1"Neels Hofmeyr2016-08-201-1/+1
| | | | Change-Id: Ice0688ac9847524cb546f6d41547090b6a3cb3d8
* vty: Fix documentation of 'show asciidoc counters' VTY commandHarald Welte2016-06-151-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>
* add vty call show asciidoc: generate a documentation for countersAlexander Couzens2016-06-142-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>
* vty: add bind command for telnet vty lineNeels Hofmeyr2016-02-251-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.
* vty: Use NULL to have a null pointer instead of '\0'Holger Hans Peter Freyther2015-11-091-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'); ^~~~
* 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
* remove our internal copy of talloc, use system libtallocHarald Welte2015-12-051-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.
* 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-123-6/+6
| | | | Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
* stats: Document the level in show stats level optionsHolger Hans Peter Freyther2015-11-071-0/+1
| | | | | | | Potentially Fixes: <command id='show stats level (global|peer|subscriber)'> <param name='subscriber' doc='(null)' />
* stats/vty: Add selective show stats commandJacob Erlbeck2015-08-222-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
* misc: Prepare the release of libosmocore 0.9.0Holger Hans Peter Freyther2015-11-031-1/+1
| | | | | Bump the ABI version of libosmovty and we need to do this recursively to force rebuilds of our software.
* stats: Fix handling of the no mtu commandHolger Hans Peter Freyther2015-11-021-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
* stats: Limit reporting by class idJacob Erlbeck2015-11-021-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
* stats: Add osmo_ name prefix to identifiersJacob Erlbeck2015-11-022-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]
* stats: Add log reporterJacob Erlbeck2015-10-291-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
* stats: Make net config optionalJacob Erlbeck2015-10-291-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
* stats: Add missing mtu command to 'write' outputJacob Erlbeck2015-10-291-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
* stats: Support statsd Multi-Metric PacketsJacob Erlbeck2015-10-291-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
* stats: Implement timer based reportingJacob Erlbeck2015-10-291-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
* stats/vty: Add stats configurationJacob Erlbeck2015-10-291-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
* stats/vty: Add stats_vty.cJacob Erlbeck2015-10-292-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
* 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
* Prepare new upstream releaseHolger Hans Peter Freyther2015-08-231-1/+1
|
* 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: Fix writing the logging of categoryMichael McTernan2015-03-201-1/+1
| | | | | Fix copy and paste issue introduced by Holger in 2d6ad13d8daf860595e6d4025861e122ce574871.
* vty: Fix typo in the state creationHolger Hans Peter Freyther2015-01-271-1/+1
| | | | | This got introduced in 2d6ad13d8daf860595e6d4025861e122ce574871 and I thought that our vty tests would have caught such mistakes.
* Prepare a new libosmocore releaseHolger Hans Peter Freyther2015-01-181-1/+1
|
* logging: Make it possible to print category/subsys and timestampsHolger Hans Peter Freyther2014-12-051-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
* 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/vector.c: Use string.h, not memory.hHarald Welte2014-11-141-1/+1
|
* remove references to u_long type, use 'unsigned long' insteadHarald Welte2014-11-142-3/+3
| | | | .. Nuttx doesn't know u_long
* remove references to u_char type, use 'unsigned char' insteadHarald Welte2014-11-142-2/+2
| | | | ... u_char not being defined on Nuttx.