aboutsummaryrefslogtreecommitdiffstats
path: root/src/vty
AgeCommit message (Collapse)AuthorFilesLines
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.
2014-09-25misc: Look into the build directory for generated filesHolger Hans Peter Freyther1-1/+1
the bits/crc files are not inside the sourcedirectory but will end in the build directory. Go and look there as well. This somehow doesn't fail with make distcheck but when building for Yocto Dizzy.
2014-08-25logging: Add ability to save/print current log filtersHarald Welte1-2/+6
This enables the persistent configuration of let's say 'log filter imsi 012345678' for a given log file in the config file.
2014-08-21prepare for 0.7.0 release0.7.0Harald Welte1-1/+1
2014-07-01write_queue: Use EBADF instead of EBABDFD for portabilityHolger Hans Peter Freyther2-2/+2
EBADFD is linux specific while EBADF is POSIX. Fix the build on FreeBSD and use EBADF throughout the file.
2014-06-22vty: Avoid use-after-free in VTY telnet interfaceDaniel Willmann2-4/+4
If the read callback closes the connection conn is already freed so we can't derefernce it. Instead return -EBADFD in the read function if it closed the connection and check for that.
2013-10-10vty: Make vty_event dispatch signals and use it in the testcaseHolger Hans Peter Freyther1-1/+13
The testcase didn't work on Ubuntu 12.04 because vty_create will directly call vty_event (e.g. not through the plt). This means that the approach to override vty_event in the testcase failed. Use the signal interface of libosmocore and make the testcase use it. The signals can be generally useful as well.
2013-09-11vty: Allow vty_go_parent() in all nodes.Jacob Erlbeck1-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.
2013-09-10vty: Replace 'enum node_type' by 'int' for last_nodeJacob Erlbeck1-1/+1
In this case the last_node variable may hold values that are not in enum node_type, so int is used instead.
2013-09-08vty: Add vty_install_default() and use for the vty nodesJacob Erlbeck3-7/+16
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
2013-09-08vty: Refactored vty_go_parent(), 'end' and 'exit'Jacob Erlbeck1-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().
2013-09-08vty: Rename is_config() to is_config_child()Jacob Erlbeck1-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.
2013-08-06vty: Support multi-char separators and end stringsJacob Erlbeck1-4/+5
In vty_cmd_string_from_valstr() include the real string lengths of the sep and end arguments into the buffer size calculation.
2013-08-06vty: Fix misusage of snprintf in vty/utils.cJacob Erlbeck1-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]
2013-07-14vty: Fix logically dead code in the description handlingHolger Hans Peter Freyther1-1/+1
The code most likely wanted to check the result of argv_concat. To do this we need to dereference the dptr. Logically dead code (DEADCODE) dead_error_line: Execution cannot reach this statement "return 1; Fixes: Coverity CID 1040675
2013-07-03vty: Attempt to fix various meam leaks in the VTY lookup codeHolger Hans Peter Freyther1-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
2013-03-19logging_vty: Fix segfault un unused entries in log_info_cat array of appHarald Welte1-0/+4
2013-03-13logging_vty: Print 'log filter all' info in 'show logging vty'Harald Welte1-0/+6
When we print information about the current logging configuration, it makes sense to also print information about the log filters.
2013-03-03cygwin: Link many libraries with -no-undefined to create a dllHolger Hans Peter Freyther1-1/+1
Only the Gb library relies on having undefined references to a symbol that needs to be provided by the host application. For all other libraries we can link with -no-undefined.
2013-02-27Added a ring buffer log target to store the last N log messages.Katerina Barone-Adesi1-4/+81
The log target can be used via log alarms and show alarms. Why? This feature was proposed/requested at http://openbsc.osmocom.org/trac/wiki/Tasks/ErrorLogTarget All messages use the same amount of space, prioritizing simplicity.
2013-02-27Revert "Added a ring buffer log target to store the last N log messages."Holger Hans Peter Freyther1-81/+4
I noticed some more issues and it is the easiest to revert and include the fixed version. This reverts commit 73377229bb33ab79682ce4b126a63602d13304ad.
2013-02-27Added a ring buffer log target to store the last N log messages.Katerina Barone-Adesi1-4/+81
The log target can be used via log alarms and show alarms. Why? This feature was proposed/requested at http://openbsc.osmocom.org/trac/wiki/Tasks/ErrorLogTarget All messages use the same amount of space, prioritizing simplicity.
2013-02-12VTY: don't show HIDDEN or DEPRECATED vty commands in ? completionHarald Welte1-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.
2013-02-12vty/command.c: Cosmetic cleanupHarald Welte1-82/+81
this is just changing some of the code to reduce the way too high level of indentation and thus improve readability.
2013-01-03vty: Do better filtering of arguments, optional args particularlySylvain Munaut1-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>
2012-12-11build: Don't use the deprecated INCLUDES in the various Makefile.amSylvain Munaut1-2/+1
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2012-10-22logging: Make sure to install standard "end" command in VTY nodeHarald Welte1-0/+2
When you are in the config-log VTY node, you expect "end" to work like in any other sub-node of config.
2012-10-22logging: Don't forget to save "logging filter all 1"Harald Welte1-0/+4
Prior to this fix, a persistent file or syslog log configuration didn't work across an application re-start, as the "logging filter all 1" was never saved and thus no messages were logged.
2012-09-11vty: Address compiler warning about the const qualifierHolger Hans Peter Freyther1-1/+1
vty.c: In function 'vty_out_newline': vty.c:294:12: warning: initialization discards 'const' qualifier from pointer target type [enabled by default]
2012-09-11vty: Address compiler warning about tolowerHolger Hans Peter Freyther1-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]
2012-08-20import vty_cmd_string_from_valstr() from osmo-btsHarald Welte1-0/+54
This function is able to generate a VTY help string based on an array of 'struct value_string'.
2012-08-02vty: Print the string using "%s", string to avoid security issuesHolger Hans Peter Freyther1-1/+1
The Mandriva GCC is more strict about handling format strings, the copyright string might contain escape sequences and then any memory could be read.
2012-07-25vty: Document the .TEXT of the descriptionHolger Hans Peter Freyther1-1/+2
2012-07-25vty: Add xsd and a command that can generate the documentation.Holger Hans Peter Freyther1-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.
2012-07-11correct inverted logic from commit f3ba8aAlexander Huemer1-1/+1
2012-06-30build: use LT_INIT(pic-only) instead of forcing -fPIC.0.5.2Diego Elio Pettenò1-1/+1
This actually allows for the user to override the decision and at the same time supports compilers that might not be able to use -fPIC at all. Signed-off-by: Diego Elio Pettenò <flameeyes@flameeyes.eu>
2012-06-30vty: avoid using a .data variable.Diego Elio Pettenò1-7/+7
no_password_check was the only initialized, non-relocated data in the set of libraries, inverting its logic let us keep it in .bss (non-initialized data, which is mapped to the zero page). Signed-off-by: Diego Elio Pettenò <flameeyes@flameeyes.eu>
2012-06-16add additional newline in vty welcome message0.4.3Harald Welte1-2/+2
2012-06-03VTY: safe version of printing VTY welcome messageHarald Welte2-19/+11
The old method used raw writes to the telnet FD, which is bad for several reasons: a) we don't know if we can actually write that many bytes to the socket at the given time b) the socket is still in blocking mode, so we could stall the entire process c) there may be weird interaction with the buffered writes of the vty_out Now, the print_welcome() functionality has moved to vty_hello() instead, where we can use normal vty_out() in buffered mode. This commit is expected to fix the garbled welcome message on arm-eglibc targets. It might still be a good idea to migrate the entire telnet interface to libtelnet - but at some later time ;)
2012-04-18doc: Fix the Doxygen section endingsSylvain Munaut4-4/+4
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2012-03-28vty: Add a function to write the current config to a file.Holger Hans Peter Freyther1-46/+130
2012-03-01vty/telnet: Add function to allow binding telnet interface to custom ↵Sylvain Munaut1-35/+22
IP/Interface Signed-off-by: Sylvain Munaut <tnt@246tNt.com>