Commit Graph

23 Commits

Author SHA1 Message Date
Harald Welte 0ff12ad0ba gprs_ns2: Print link layer and global ALIVE/DEAD state
Change-Id: I56455d1fef2f99d72bc0c4811f307428aec12b96
2020-12-01 18:01:43 +01:00
Harald Welte 920491936e gprs_ns2_vty: Fix VTY documentation errors
Those two documentation errors made e.g. gb-proxy VTY tests fail.

Change-Id: I487ee3532aed4de38494005106ae9686d590608d
2020-11-25 20:57:09 +01:00
Harald Welte 6d4db2367d Revert "ns2: permit multiple nsvci in one nse in VTY"
This reverts commit 0bd8a4b5b3, which
was causing massive VTY test failures for osmo-pcu.git and osmo-sgsn.git

Change-Id: I0236d1e835111604e58c5d8c3f84221e055ce59d
2020-11-25 20:56:46 +01:00
Alexander Couzens 10e991b224 ns2: remove obsolete type GPRS_NS2_LL_E1
There is already frame relay type GRPS_NS2_LL_FR
to support frame relay.

Change-Id: Iabb4608d91ccb32a07cad67519166dabfba76612
2020-11-24 03:53:22 +01:00
Alexander Couzens aac9016570 ns2: move link layer type into NSE
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-24 03:53:22 +01:00
Alexander Couzens 24a14ac80c ns2: move LL into public api
Also fix prefix. GPRS_NS -> GPRS_NS2.
In preparation to move LL into upper layer.

Change-Id: I3b5e0d51ce69b095095e5160ca0cf0d4534db1b8
2020-11-24 03:53:22 +01:00
Harald Welte 0bd8a4b5b3 ns2: permit multiple nsvci in one nse in VTY
Change-Id: I4ad454320d0a03e81b399f55e8bd0ee57402dad0
2020-11-24 03:53:22 +01:00
Alexander Couzens 841817ec52 ns2: add support for frame relay
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-24 03:53:22 +01:00
Daniel Willmann dbab714343 ns2: Add a VTY command to reset NSVC FSM
Mainly useful for testing so implemented as a hidden command

Change-Id: I83b9cd7381c25da0e8aa847038a2d422c8dd63cf
Related: SYS#5002
2020-11-20 15:38:00 +01:00
Daniel Willmann ed1fa018c3 ns2: Improve NSVC output
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-11-06 15:40:27 +01:00
Alexander Couzens c4229a458c gprs_ns2: rename gprs_ns2_ip_vc_sockaddr -> gprs_ns2_ip_vc_remote
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-12 15:54:21 +02:00
Alexander Couzens 9a4cf275b2 gprs_ns2: const the return value of gprs_ns2_ip_vc_sockaddr / 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-12 13:08:42 +00:00
Vadim Yanitskiy a07f25e3ba gprs_ns2: make struct osmo_sockaddr pointers const
Using the 'const' qualifier allows the compiler to spot some
programming errors and further optimize the code.

Change-Id: I0df6a00ac1830bd64a10b9336b827e113fa772bb
2020-10-09 15:24:09 +00:00
Alexander Couzens d745a0e7f3 gprs_ns2_vty_create: remove bind pointer check
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-07 10:16:40 +00:00
Vadim Yanitskiy 8e7c49649e vty: use install_lib_element() and install_lib_element_ve()
See https://lists.osmocom.org/pipermail/openbsc/2020-October/013278.html.

Change-Id: Ic541126ffd4975daf87199abfafb465e2055e44f
Related: SYS#4937
2020-10-06 00:22:22 +07:00
Alexander Couzens 22f34710d9 ns2: vty: on `show ns` add information of NS binds
Change-Id: I6cef42749555e577d5573f2ed8b8bce4cf842a98
2020-10-05 14:23:33 +00:00
Alexander Couzens 1fac6f7452 ns2: vty: allow the users (pcu/sgsn) to set a default bind
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-05 14:23:33 +00:00
Alexander Couzens a3373e3394 ns2: vty: show all nse
Don't stop after dumping the first nse

Change-Id: I0ca1807692854b23b77ca9042768529df3f80289
2020-10-03 07:19:59 +00:00
Alexander Couzens 477ffb0e72 ns2: parse the return code of gprs_ns2_ip_bind
Fixes a crash when the bind fails.

Change-Id: I96c8e871a350f8f7b9ba2450bb37b90b535f42e2
2020-10-01 19:33:00 +02:00
Daniel Willmann 4fb27a80d2 gprs_ns2: Make reason const
Change-Id: Ia0db18703d9fd137a5c5fe4474e2d76868a9af9d
2020-09-25 15:39:46 +02:00
Alexander Couzens 1f0625f214 ns2: vty: fix behavior of vtyvc_by_nsei when vtyvc isn't found
Fixes the parsing of persistent nsvcs.

Change-Id: I297409f557f17df680ac76018b4202eb99713021
2020-09-25 09:45:24 +00:00
Alexander Couzens c82c40aa53 ns2: vty: add missing docs for IPv6 address
Change-Id: I0ac04e1352ceadb7b787bcb3358c70e5bfd7c65b
2020-09-24 23:32:18 +00:00
Alexander Couzens 6a161497cf Gb: add a second NS implementation
Reimplement NS with FSM.

Change-Id: I3525beef205588dfab9d3880a34115f1a2676e48
2020-09-15 11:54:41 +00:00