aboutsummaryrefslogtreecommitdiffstats
path: root/src/gb/gprs_ns2_vty.c
AgeCommit message (Collapse)AuthorFilesLines
2021-02-02ns2: Don't automatically re-start FSM at FORCE_UNCONFIGUREDHarald Welte1-0/+1
There are use cases in which the NS-VC FSM should go back to unconfigured _without_ being re-started immediately. Let's permit the caller to do that. Change-Id: I31fe695a83d38ea1f10f5444e840633d7fa68442
2021-02-01ns2: Introduce a per-bind stat_item group with backlog lengthHarald Welte1-0/+4
The backlog length indicates the instantaneous length of the backlog. Change-Id: I1c55b4619b1221d7e607ace58649323407faf86b
2021-01-29ns2: Fix assert when removing a bind listenDaniel Willmann1-1/+1
Change-Id: I3edd1e838f7516d9224045710047419039aa0ec0 Fixes: OS#4977
2021-01-28gprs_ns2: correct vty config writeAlexander Couzens1-16/+26
The vty configuration was wrong when any other node was in between the vty configuration (e.g. gb or ss7). The vty code doesn't have a relation between parent and child node. It wasn't detected because this only happened in the sgsn. The pcu doesn't have any binds defined. Change-Id: I8a3d67d41baca36b4d1a951a574cd41e556355c5
2021-01-28gprs_ns2: introduce gprs_ns2_vty_init_reduced() for the PCUAlexander Couzens1-1/+16
The gprs_ns2_vty_init_reduced() call initialized the ns2 vty without configuration nodes (except timeout). The PCU can be only configured by the BTS/BSC. It should not configured by vty. Change-Id: I4437da74bd48ba64d3f16ea67afc26c45b6d3ac9
2021-01-28gprs_ns2: drop gprs_ns2_vty, rename vty2 -> vtyAlexander Couzens1-591/+1266
Drop the vty(1) code and replace it with vty2. The vty(1) was only used as intermediate to not develop a vty while developing a new code base behind. Users of gprs_ns2_ has to use the new vty code. API change which must be synchronized with osmo-pcu, osmo-gbproxy, osmo-sgsn. Change-Id: Ic2059e75d8ede8e5c29c4fef6be608ed79c8a97c
2021-01-28Revert "gprs_ns2: drop gprs_ns2_vty, rename vty2 -> vty"Pau Espin Pedrol1-1266/+591
This reverts commit b306094448564e27bc031b519396f1b0e294b231. It was merged too quickly and patches for projects using related features are not yet prepared. Change-Id: I8a2aaf74a47de8f4f0adb37d16426d199788e3fe
2021-01-28gprs_ns2: drop gprs_ns2_vty, rename vty2 -> vtyAlexander Couzens1-591/+1266
Drop the vty(1) code and replace it with vty2. The vty(1) was only used as intermediate to not develop a vty while developing a new code base behind. Users of gprs_ns2_ has to use the new vty code. API change which must be synchronized with osmo-pcu, osmo-gbproxy, osmo-sgsn. Change-Id: I8c3f2afecc74b78f7f914f7dce166cbcb63444eb
2021-01-28gprs_ns2: refactor: ensure all enums have GPRS_NS2_Alexander Couzens1-12/+12
All public enum should have the prefix GPRS_NS2_. API change which must be synchronized with osmo-pcu, osmo-gbproxy, osmo-sgsn. Change-Id: I548ff12f7277cbb7e1a630a3dc02b738ce89be72
2021-01-25gprs_ns2: drop prefix of all internal exposed functionAlexander Couzens1-2/+2
All functions which are exposed by gprs_ns2_internal.h should not contain the public prefix gprs_. Internal function should only contain ns2_ prefix. Change-Id: Icecc5a918902cd10efac72bbac20780d39aab272
2021-01-20ns2: Properly indent VTY outputHarald Welte1-1/+1
If multiple objects are printed in the VTY, only the first line of each object should be on the first character of the line, all others should be indented. With this patch the "snow ns entities" output becomes much more readable: OsmoGbProxy> show ns entities NSEI 00102: UDP, DEAD FSM Instance Name: 'GPRS-NS2-SNS-BSS(NSE00102-SNS)[0x6120000018a0]', ID: 'NSE00102-SNS' Log-Level: 'DEBUG', State: 'SIZE' Timer: 1 Maximum number of remote NS-VCs: 8, IPv4 Endpoints: 4, IPv6 Endpoints: 0 NSVCI none: UNCONFIGURED DYNAMIC data_weight=1 sig_weight=1 udp)[127.0.0.1]:23000<>[127.0.0.11]:8888 NSEI 00101: UDP, DEAD FSM Instance Name: 'GPRS-NS2-SNS-BSS(NSE00101-SNS)[0x6120000015a0]', ID: 'NSE00101-SNS' Log-Level: 'DEBUG', State: 'SIZE' Timer: 1 Maximum number of remote NS-VCs: 8, IPv4 Endpoints: 4, IPv6 Endpoints: 0 NSVCI none: UNCONFIGURED DYNAMIC data_weight=1 sig_weight=1 udp)[127.0.0.1]:23000<>[127.0.0.10]:7777 Change-Id: Id1b4c80a6caef410076a68b4301adaa01ba7e57a
2020-12-23gprs_ns2: fix force-unconfigured for IP-SNS NSEAlexander Couzens1-2/+6
The IP-SNS need to do a reselection of the IP-SNS remote for testing. Freeing all nsvc will force this. Change-Id: I367c215a830c02eae2a470cba314828b5e0fb5c9
2020-12-22gprs_ns2: add new vty2Alexander Couzens1-0/+4
Change-Id: I163279cf57e84198dc8c53e1c109f5a9474670e9
2020-12-16gprs_ns2_vty: udp: fixup dialect changesAlexander Couzens1-2/+6
Only accept receiving ipaccess style messages when use-reset-block is selected. If use-reset-block is disabled allow static NSVCs. Change-Id: Ia787528b1a6fac6bf1570c21643ef6cd8c209108
2020-12-16gors_ns2_vty: Fix saving of new NS2 timersHarald Welte1-0/+2
In I00e9023a6e7adc6ad48f4016fcaef189ac8b353e we introduced two new timers, but failed to add the related value_string[] entries. This caused the VTY code to save something like timer unknown 0x8 3 timer unknown 0x9 3 which fails to parse on re-start. Change-Id: If5cfdf1ef68d98933985406d0ac071a0a1185646
2020-12-15gprs_ns2: rework gprs_ns2_fr_connect*()Alexander Couzens1-1/+1
Add gprs_ns2_fr_connect2() and change gprs_ns2_fr_connect() to be similar to gprs_ns2_ip_connect() and gprs_ns2_connect2(). This is an API break but there wasn't yet a release with NS2. Change-Id: I4e1374b0e979b3293302c5ed46a91a58f3a5a916
2020-12-15gprs_ns2: add member name to bindAlexander Couzens1-2/+2
Every bind will have a unique name. Add a name argument to all bind creating functions and require them to be unique. This is an API break but there wasn't yet a release with NS2. Change-Id: I8f1d66b7b3b12da12db8b5e6bd08c1beff085b3e
2020-12-15gprs_ns2: introduce NS dialectsAlexander Couzens1-48/+6
A NS dialect describes how the NS Entity interacts with different virtual circuits. E.g. ipaccess use reset/block on udp and is a dynamic connection. A single NS Entity can only support one dialect. This can be later used to protect a NS Entity against dynamic NS virtual circuits of a different type. It further allows a bind to support multiple dialects at the same time. Change-Id: Ia118bb6f994845d84db09de7a94856f5ca573404
2020-12-04ns2: Fix argv index in logging filter VTY commandsDaniel Willmann1-2/+2
Change-Id: I8adaf8094ef028b2d580e918532d6712d2ebbc2c Related: SYS#5232
2020-12-03ns2: Add log filtering by NSE/NSEI, fix NSVC filter on receiveDaniel Willmann1-1/+45
NSVC filtering was only implemented on sending messages, this also adds log_set_context() calls to ns2_recv_vc() Filtering by NSE is implemented similar to NSVC. Change-Id: I63c0e85f82f5d08c5a6f535da94b8648498439d2 Related: SYS#5232
2020-12-02gprs_ns2_vty: Re-introduce a 'show ns' commandHarald Welte1-0/+12
In I157467d6a74d6109bc23521c978c5aac6d29fe50 we introduced a split between 'show ns entities' and 'show ns binds'. However, there is at least one test case in osmo-sgsn.git which depends on 'show ns' working. So let's re-add it as a backwards compatible, hidden command. Change-Id: I7571c6d82f7a712803d09d165abb6c7cb5ae2e5c
2020-12-02ns2: Fix docs for some NS2 vty commandsDaniel Willmann1-5/+6
Change-Id: Ie58607424340c102c930330e444c2e219c1803e0
2020-12-01gprs_ns2_vty: Print all relevant data on each NS-VCHarald Welte1-1/+12
After this patch, we can finally see the BLOCKED/UNBLOCKED state, weights, persistence, etc. in the VTY. Example: OsmoGbProxy> show ns entities NSEI 00101: UDP, DEAD NSVCI 00101: RESET PERSIST data_weight=1 sig_wight=1 udp)[127.0.0.1]:23000<101>[127.0.0.1]:7777 NSEI 00001: FR, ALIVE NSVCI 00001: UNBLOCKED PERSIST data_weight=1 sig_wight=1 fr)netif: hdlcnet1 dlci: 16 NSVCI 00002: UNBLOCKED PERSIST data_weight=1 sig_wight=1 fr)netif: hdlcnet2 dlci: 17 NSVCI 00003: UNBLOCKED PERSIST data_weight=1 sig_wight=1 fr)netif: hdlcnet3 dlci: 18 NSVCI 00004: UNBLOCKED PERSIST data_weight=1 sig_wight=1 fr)netif: hdlcnet4 dlci: 19 Change-Id: I1cf8fe55d1d0cecc46113532c8550880558b0155
2020-12-01gprs_ns2_vty: Show NSVCI in dump_nsvc()Harald Welte1-3/+3
also, indent the statistics one more character Change-Id: I2726d6f1c5f83255925d6a1b22f1ee71b8d6fdc5
2020-12-01gprs_ns2_vty: Differentiate 'show ns binds' and 'show ns entities'Harald Welte1-12/+26
Change-Id: I157467d6a74d6109bc23521c978c5aac6d29fe50
2020-12-01gprs_ns2: Print link layer and global ALIVE/DEAD stateHarald Welte1-2/+2
Change-Id: I56455d1fef2f99d72bc0c4811f307428aec12b96
2020-11-25gprs_ns2_vty: Fix VTY documentation errorsHarald Welte1-1/+4
Those two documentation errors made e.g. gb-proxy VTY tests fail. Change-Id: I487ee3532aed4de38494005106ae9686d590608d
2020-11-25Revert "ns2: permit multiple nsvci in one nse in VTY"Harald Welte1-54/+44
This reverts commit 0bd8a4b5b39797901407c69de2da7992ebecb931, which was causing massive VTY test failures for osmo-pcu.git and osmo-sgsn.git Change-Id: I0236d1e835111604e58c5d8c3f84221e055ce59d
2020-11-24ns2: remove obsolete type GPRS_NS2_LL_E1Alexander Couzens1-2/+0
There is already frame relay type GRPS_NS2_LL_FR to support frame relay. Change-Id: Iabb4608d91ccb32a07cad67519166dabfba76612
2020-11-24ns2: move link layer type into NSEAlexander Couzens1-6/+1
Even it was in theory possible to mix NS-VC ll types within a NSE. This is an unrealistic configuration. Further more to select the correct load sharing mechanism the NSE must know the correct link layer. Change-Id: I18dfd40a2429cd61b7c4a3dad5f226c64296f7d8
2020-11-24ns2: move LL into public apiAlexander Couzens1-16/+16
Also fix prefix. GPRS_NS -> GPRS_NS2. In preparation to move LL into upper layer. Change-Id: I3b5e0d51ce69b095095e5160ca0cf0d4534db1b8
2020-11-24ns2: permit multiple nsvci in one nse in VTYHarald Welte1-44/+54
Change-Id: I4ad454320d0a03e81b399f55e8bd0ee57402dad0
2020-11-24ns2: add support for frame relayAlexander Couzens1-20/+117
Add support for frame relay over dahdi hdlc device. It's supporting lmi by q933 and supports both SGSN and BSS. Change-Id: Id3b49f93d33c271f77cd9c9db03cde6b727a4d30
2020-11-20ns2: Add a VTY command to reset NSVC FSMDaniel Willmann1-0/+33
Mainly useful for testing so implemented as a hidden command Change-Id: I83b9cd7381c25da0e8aa847038a2d422c8dd63cf Related: SYS#5002
2020-11-06ns2: Improve NSVC outputDaniel Willmann1-33/+1
In show ns lots of info was printed many times. We can just use gprs_ns2_ll_str() to get the information about an NSVC so use that and ensure newlines. The NSVC are still printed twice - at least for the UDP bind: Once in dump_nse and once in dump_bind. Change-Id: I6f734d92ec1e17f339f7b32e449ffd614efa7319 Related: SYS#4998
2020-10-12gprs_ns2: rename gprs_ns2_ip_vc_sockaddr -> gprs_ns2_ip_vc_remoteAlexander Couzens1-1/+1
It's more clear which part of the address is returned. In preparation to add a gprs_ns2_ip_vc_local. Change-Id: I6110ff573362961c713a990da7ef3f3dbedf6c57
2020-10-12gprs_ns2: const the return value of gprs_ns2_ip_vc_sockaddr / ↵Alexander Couzens1-1/+1
gprs_ns2_ip_bind_sockaddr The sockaddr should not be changed. free and create the bind/nsvc if the address should be changed. Change-Id: I371ac2361b569e36722b02fc9cd82ec8da2fa9e3
2020-10-09gprs_ns2: make struct osmo_sockaddr pointers constVadim Yanitskiy1-1/+2
Using the 'const' qualifier allows the compiler to spot some programming errors and further optimize the code. Change-Id: I0df6a00ac1830bd64a10b9336b827e113fa772bb
2020-10-07gprs_ns2_vty_create: remove bind pointer checkAlexander Couzens1-10/+8
The bind pointer can't be NULL because gprs_ns2_ip_bind() is either return 0 and bind is valid or != 0 and returning. Found-by: Coverity Fixes: CID#214854 Change-Id: I11d86c9cb36226701e51942f14d7a6412c3eff26
2020-10-06vty: use install_lib_element() and install_lib_element_ve()Vadim Yanitskiy1-21/+21
See https://lists.osmocom.org/pipermail/openbsc/2020-October/013278.html. Change-Id: Ic541126ffd4975daf87199abfafb465e2055e44f Related: SYS#4937
2020-10-05ns2: vty: on `show ns` add information of NS bindsAlexander Couzens1-0/+11
Change-Id: I6cef42749555e577d5573f2ed8b8bce4cf842a98
2020-10-05ns2: vty: allow the users (pcu/sgsn) to set a default bindAlexander Couzens1-1/+9
The SGSN will always bind to 0.0.0.0 in difference the PCU bind is depending on the info indication. Allow to the user to define a default bind address. Change-Id: I2a9dcd14f4ad16211c0f6d98812ad4a13e910c2a
2020-10-03ns2: vty: show all nseAlexander Couzens1-1/+0
Don't stop after dumping the first nse Change-Id: I0ca1807692854b23b77ca9042768529df3f80289
2020-10-01ns2: parse the return code of gprs_ns2_ip_bindAlexander Couzens1-2/+1
Fixes a crash when the bind fails. Change-Id: I96c8e871a350f8f7b9ba2450bb37b90b535f42e2
2020-09-25gprs_ns2: Make reason constDaniel Willmann1-2/+2
Change-Id: Ia0db18703d9fd137a5c5fe4474e2d76868a9af9d
2020-09-25ns2: vty: fix behavior of vtyvc_by_nsei when vtyvc isn't foundAlexander Couzens1-7/+8
Fixes the parsing of persistent nsvcs. Change-Id: I297409f557f17df680ac76018b4202eb99713021
2020-09-24ns2: vty: add missing docs for IPv6 addressAlexander Couzens1-3/+6
Change-Id: I0ac04e1352ceadb7b787bcb3358c70e5bfd7c65b
2020-09-15Gb: add a second NS implementationAlexander Couzens1-0/+833
Reimplement NS with FSM. Change-Id: I3525beef205588dfab9d3880a34115f1a2676e48