summaryrefslogtreecommitdiffstats
path: root/src/gb/gprs_ns_vty.c
Commit message (Collapse)AuthorAgeFilesLines
* gprs_ns_vty: return success for disabled FR/GREOliver Smith2019-10-291-4/+0
| | | | | | | | | | | | Do not return a warning and therefore fail parsing the config when the "encapsulation framerelay-gre local-ip" command is used and FR/GRE is disabled. Having this in the config does no harm and allows keeping the same config if it is enabled later. This fixes the currently failing vty tests for osmo-sgsn. Fixes: a0c8195ad37292ab800a6c777fc28383995b4b64 ("vty: Return error if cmd returns CMD_WARNING while reading cfg file") Change-Id: Ic225232fbfca49ba868427eaf898e1f6e34e1ca8
* logging: Introduce mutex API to manage log_target in multi-thread envsPau Espin Pedrol2019-10-091-2/+8
| | | | | | | | | | | | | | | | | | | | log_enable_multithread() enables use of locks inside the implementation. Lock use is disabled by default, this way only multi-thread processes need to enable it and suffer related complexity/performance penalties. Locks are required around osmo_log_target_list and items inside it, since targets can be used, modified and deleted by different threads concurrently (for instance, user writing "logging disable" in VTY while another thread is willing to write into that target). Multithread apps and libraries aiming at being used in multithread apps should update their code to use the locks introduced here when containing code iterating over osmo_log_target_list explictly or implicitly by obtaining a log_target (eg. osmo_log_vty2tgt()). Related: OS#4088 Change-Id: Id7711893b34263baacac6caf4d489467053131bb
* NS: Add support for GPRS NS IP Sub-Network-Service (SNS)Harald Welte2019-02-261-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The NS implementation part of the Gb implementation libosmogb so far implemented a rather classic dialect of Gb, with lots of heritage to FR (Frame Relay) transports. At least since Release 6 of the NS specification, there's an IP Sub-Network Service (SNS), which * permits for dynamic configuration of IP endpoints and their NS-VCs * abandons the concept of a NSVCI on IP transport * forbids the use of RESET/BLOCK/UNBLOCK procedures on IP transport This commit introduces BSS-side IP-SNS support to libosmogb in a minimally invasive way. It adds a corresponding SNS FSM to each NS instance, and implements the new SIZE/CONFIG/ADD/DELETE/CHANGE_WEIGHT procedures very closely aligned with the spec. In order to use the SNS flavor (rather than the classic one), a BSS implementation should use gprs_ns_nsip_connect_sns() instead of the existing gprs_ns_nsip_connect(). This implementation comes with a set of TTCN-3 tests in PCU_Tests_RAW_SNS.ttcn, see Change-ID I0fe3d4579960bab0494c294ec7ab8032feed4fb2 of osmo-ttcn3-hacks.git Closes: OS#3372 Closes: OS#3617 Change-Id: I84786c3b43a8ae34ef3b3ba84b33c90042d234ea
* NS: Don't print information about FR/GRE if not enabled!Harald Welte2019-02-231-3/+4
| | | | Change-Id: I9209ee4ba5ebfc4f96b4c1d42840e1906455bae7
* Fix/Update copyright notices; Add SPDX annotationHarald Welte2017-11-131-1/+4
| | | | | | | | 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
* GPRS: constify NS printing routine parametersMax2017-10-241-2/+2
| | | | Change-Id: I549ab7c26ac1489e01f281594bafe44b0681dc83
* GPRS: add vty command to show only persistent NSMax2017-10-241-8/+23
| | | | | | | | | | | The regular 'sh ns' lists all available NS. Sometimes it's handy to know which of those are persistent. * add "show ns persistent" command * adjust parameters of dump-ns*() functions to use bool where appropriate Change-Id: Ib812864bae3ea414cc107a7b4f49bea4e6161795
* GPRS: check and report local address used for NSEMax2017-10-241-7/+13
| | | | | | | | | | When dumping NSE via vty: * check which local address would be used to communicate with a given NSE and print it * print link layer type last to make output more consistent Change-Id: I6932a29c7899d36bcc275f05dda9670b0e69bef0 Related: SYS#3610
* GPRS: clarify ip/frgre union useMax2017-10-241-6/+5
| | | | | | | | | * add comment about underlying assumption that structs in ip/frgre union members in gprs_nsvc struct have the same memory layout * remove such assumption from gprs_ns_ll_str() * use gprs_ns_ll_str() for NSE dump Change-Id: Idcb912b7b3f7460fd2b058e16650c0bde8f757ee
* GPRS: unify NS state printingMax2017-10-241-4/+4
| | | | | | | | | * introduce defines with NS state names * use them for vty and tests * expand test output to print complete NS state Change-Id: I69f8d536135ae76dbca623c2f1ffba625adcb1e9 Related: SYS#3610
* GPRS: print remote state info for NS peerMax2017-10-201-3/+5
| | | | | Change-Id: I1714c68909507eae6ef2933661a085859aca3b54 Related: SYS#3610
* vty: install 'exit', 'end',... commands on *all* nodesNeels Hofmeyr2017-09-271-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In many callers of the VTY API, we are lacking the vty_install_default() step at certain node levels. This creates nodes that lack the 'exit' command, and hence the only way to exit such a node is to restart the telnet session. Historically, the VTY looked for missing commands on the immediate parent node, and hence possibly found the parent's 'exit' command when the local node was missing it. That is why we so far did not notice the missing default commands. Furthermore, some callers call install_default() instead of vty_install_default(). Only vty_install_default() also includes the 'exit' and 'end' commands. There is no reason why there are two sets of default commands. To end this confusion, to catch all missing 'exit' commands and to prevent this from re-appearing in the future, simply *always* install all default commands implicitly when calling install_node(). In cmd_init(), there are some top-level nodes that apparently do not want the default commands installed. Keep those the way they are, by changing the invocation to new install_node_bare() ({VIEW,AUTH,AUTH_ENABLE}_NODE). Make both install_default() and vty_install_default() no-ops so that users of the API may still call them without harm. Do not yet deprecate yet, which follows in Icf5d83f641e838cebcccc635a043e94ba352abff. Drop all invocations to these two functions found in libosmocore. Change-Id: I5021c64a787b63314e0f2f1cba0b8fc7bff4f09b
* gb: drop special vty exit commands, use vty_install_default()Neels Hofmeyr2017-09-271-3/+1
| | | | | | | | | | | | | | | L_NS_NODE and L_BSSGP_NODE had specialized 'exit' and 'end' vty commands, but all they do is return to the CONFIG and ENABLE_NODEs like the default 'exit' and 'end' commands. Drop them and use the default 'exit' and 'end' cmds. Examining BSSGP and NS node behavior in osmo-sgsn exhibited identical list and exit/end behavior before and after this patch. Prepares for an upcoming commit incorporating vty_install_default() into install_node(), see I5021c64a787b63314e0f2f1cba0b8fc7bff4f09b: this patch changes to the default commands, the upcoming change implies them. Change-Id: I5b0de066b4249d482c22620d5b1bcb03f381293c
* doxygen: unify use of \file across the boardNeels Hofmeyr2017-06-231-3/+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
* libosmogb: Convert to use new endian conversion helpersHarald Welte2017-05-151-11/+12
| | | | Change-Id: I5ed17702cd9487e1cab6bae39802aa11fb6a37b0
* logging.h: fixup: shorter names for LOGGING_FILTER_* and LOGGING_CTX_*Neels Hofmeyr2017-02-231-5/+5
| | | | | | | | | | | | | | | 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-5/+5
| | | | | | | | | | | | | | | | | | | | | | | 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
* gprs_ns_vty: guard against duplicate VTY elementsNeels Hofmeyr2017-01-121-0/+8
| | | | | | | | The TbfTest in osmo-pcu calls gprs_ns_vty_init() repeatedly, which aborts because of duplicate VTY elements. Fix this by skipping the VTY init if it already happened. Change-Id: I05c7f25a4e873ae76b206819180b8b043b60103e
* ns: Add statistics for some eventsJacob Erlbeck2015-10-281-1/+3
| | | | | | | | | | | | The following counters are added to the ns.nsvc counter group: lost.alive The number of missing ALIVE ACK messages lost.reset The number of missing RESET ACK messages The following items are added to the ns.nsvc stat item group: alive.delay The time in ms between sending ALIVE and receiving the next ALIVE ACK Sponsored-by: On-Waves ehf
* Change license of libosmogb from AGPLv3+ to GPLv2+Harald Welte2014-10-261-4/+4
| | | | | | | | | | | The copyright holders Harald Welte, Holger Freyther, Andreas Eversberg and sysmocom - s.f.m.c. GmbH (represented by Holger and Harald) agree that the license of libosmogb should be GPLv2+ and not AGPLv3+. The reason the source files stated AGPLv3+ is due to the history, as they were moved from OpenBSC to libosmocore at the time we needed to use them from osmo-pcu. It was an oversight back then to not re-license them accordingly.
* gb/vty: Fix the VTY node string for L_NS_NODEJacob Erlbeck2013-10-241-1/+1
| | | | | | | Use 'config-ns' instead of plain 'ns' and append a blank after the '#' to make the vty python test script work. Sponsored-by: On-Waves ehf
* gb/vty: Perform NS-VC operations based on NS-VCIJacob Erlbeck2013-10-241-5/+15
| | | | | | | | | This adds a 'nsvc nsvci <0-65535> (block|unblock|reset)' vty command. It selects the NS-VC based on the nsvci instead of using the first with a matching NSEI, like it is done when the 'nsei' keyword is used instead. Sponsored-by: On-Waves ehf
* gprs_ns: Allow to set the DSCP for the UDP socket.Holger Hans Peter Freyther2013-03-251-0/+14
| | | | Allow to tag the NS service with a custom DSCP.
* libosmogb: move files to proper location and fix buildHarald Welte2012-06-171-0/+581