Commit Graph

6634 Commits

Author SHA1 Message Date
Oliver Smith a45608fe83 examples/osmo-gbproxy.cfg: fix osmo-sgsn conflict
Adjust the config, so osmo-gbproxy and osmo-sgsn can be started with
their default configs on the same machine.

Fixes: OS#5130
Change-Id: I7959ea8ebd1f5c60177f37dd6eb01724308e0fc0
2021-04-26 09:48:30 +02:00
Daniel Willmann 5b75f85871 examples/manuals: Improve/update ns-related documentation
* example config files with current libosmogb options
* Include NS2-related configuration chapters in manual

Closes: SYS#5115
Change-Id: I57cf5dc4ee686352252086917f5f63d5a69dddd7
2021-04-22 18:18:35 +02:00
Daniel Willmann fff868526d gbproxy_main: Process options after all initialization is done
Previously gprs_ns2_vty_init() was called after handle_options(). This
caused config-ns* commands to be missing when calling
osmo-gbproxy --vty-ref-xml
which is used to generate the vty reference manual.

This commit moves argument handling until after all VTY commands have
been installed.

Change-Id: I0f779c16085a42b308925a676b144999106f2b63
2021-04-22 13:40:13 +02:00
Oliver Smith 27dcd33276 gitignore: add gbproxy_vty_reference.xml
Change-Id: I33a0df37b4446b12b53c9e1eace8e5766278be1f
2021-04-13 08:51:06 +02:00
Oliver Smith 9c46926142 doc: include gb-ns2.adoc, not gb-variants.adoc
Adjust to merge of gb-variants.adoc into gb-ns2.adoc in
osmo-gsm-manuals I902b850528cbc04bd469590babd84cccf64300e8.

Change-Id: I17b182db6068ca583078c66c9576029a28016fd4
2021-04-13 08:44:02 +02:00
Harald Welte 838ebb35d1 vty: Print CellId along with RA-ID
The CellIdentifier IE of a BVC-RESET contains RA-ID and CID.  We only
printed the forer, but not the latter. Let's fix that.

Change-Id: Ic8b26afe98e6fe11b130679201493f6bcbade0f4
2021-04-12 08:18:02 +00:00
Daniel Willmann 6701d27313 gb_proxy: Ensure cell info is up to date when receiving PTP-BVC reset
When a BSS resets its BVC and reuses a BVCI with a differente cell id
the SGSN BVC still has the old cell information.

This results in the SGSN receiving a BVC reset for the old cell which in
turn leads to all sorts of issues (probably also with paging) and
conflicting information since the cell info is also present in the
UL-UNITDATA and this is just passed through from the BSS.

Instead of reusing the old BVC on the SGSN side free any existing and create
new ones.

Change-Id: Ia94090a0133340b7b284df6ec5b36546da698b37
2021-04-12 08:17:51 +00:00
Daniel Willmann 76aa06e988 gbproxy_main: Add ctrl vty commands
osmo-gbproxy already provides a ctrl interface, we should be able to
change ctrl-related configuration.

Change-Id: I3f3aa46aa032c1bd0ec88163bb89701d2250f414
2021-04-09 10:51:19 +02:00
Daniel Willmann 1f3470f69a gbproxy: Don't free NSE/BVC0 if SGSN NSE goes down
SGSN NSEs are static and should not be removed. Instead remove all
PtP-BVCs.
BVC0 can't be blocked and will be reset after the NSE becomes available
again. It might be cleaner to remove BVC0 on NS failure and create it
again, but that change is a bit more complicated.

Fixes ttcn3 test after commit f96cac5077 broke them.

Related: OS#4897
Change-Id: Ie0cef38e4423b672f5cba35ae7fc3eb2c4071d5a
2021-03-11 09:53:42 +01:00
Daniel Willmann a16ecc34cc Remove osmo-sgsn relics
* include/osmocom/sgsn -> gbproxy
* (unused) tests specific to osmo-sgsn

Change-Id: I3704760e8936bdd005a3f73727de5f2b3e8774a0
2021-03-10 13:52:07 +01:00
Daniel Willmann f96cac5077 Handle GPRS_NS2_AFF_CAUSE_FAILURE
When a complete NSE becomes unavailable gbproxy should notify the other
side (bss/sgsn).
The current code blocks every PtP-BVC (belonging to that BSS) on all SGSNs if
a BSS goes down.

The BSS-side should not be blocked unless no more SGSN connections are
present. We could also remove all BSS nse and wait for those to reconnect.
This is not yet implemented.

Related: OS#4897
Change-Id: I6354a190ec1090a35c27671c72dab9126d0ad794
2021-03-10 12:14:56 +00:00
Daniel Willmann 38b9c9a9c1 Update the max_sdu_len from NS
Related: OS#4889
Change-Id: Ie26550198db0cc34ca0a882c137c8685a5662f2a
2021-03-10 12:14:56 +00:00
Daniel Willmann 04075ec198 gb_proxy.h: Use pragma once instead of ifndef
Change-Id: I7eb3b1cbd78c25112abf7d526a2aa42bd952c7c9
2021-03-10 12:11:03 +00:00
Daniel Willmann 429c43ce45 Remove some outdated TODO/comments
Change-Id: Icd72ed92585f5701d293807022255b06e5641005
2021-03-10 11:27:13 +00:00
Daniel Willmann f06b4817b9 manuals: Regenerate counters/VTY through docker
Related: SYS#5115, SYS#5005
Change-Id: I39d60a7fd7ec66f3f20bfcef5c32502598f2708f
2021-03-10 11:04:05 +01:00
Daniel Willmann b643765d0a manual: Update manuals, include sgsn pooling and NS variants
Related: SYS#5005, SYS#5115, OS#4523
Change-Id: I440b0f9a6e18c21b11640ca32403f19d7e83b5c1
2021-03-09 16:55:33 +01:00
Daniel Willmann 349b78e8ea gbproxy_main: Fix naming bsc_hack/nsip_proxy -> (osmo-)gbproxy
Change-Id: I58d75561f93ae5f3b23a07d8836e78f21e079928
2021-03-09 15:51:59 +00:00
Pau Espin 52461cfef3 Support setting rt-prio and cpu-affinity mask through VTY
Related: SYS#4986
Change-Id: Id08f858b7f1bc79cc2958af4ffac3e11d644f210
2021-03-03 16:08:29 +01:00
Pau Espin f89d4f899e Bump version: 0.0.1.21-b968-dirty → 0.1.0
Change-Id: Iaf4e2cc6cfc017f7e2e6b29068c00194fe9cd276
2021-02-24 16:54:13 +01:00
Pau Espin b968c5f0ad gitignore: Ignore autofoo files *~
Change-Id: Ie70295259a0e807019755d5199450a6c9b64fffe
2021-02-24 16:40:07 +01:00
Daniel Willmann f8cba65017 gbproxy: Use bssgp2_enc_status when sending STATUS
bssgp_tx_status() is not aware of the MTU and cannot truncate the PDU if
needed. Use the newer bssgp2_enc_status() which supports truncating the
PDU.

Related: OS#4889
Depends: Ic39d918c56399ceb0431299ce938e3bf276f678a (libosmocore.git)
Change-Id: Id5ddb10385655b339b2a4f04651c1da09b3efb62
2021-02-16 16:42:00 +01:00
Daniel Willmann a8b61659e6 Add SDU length for an NSE (== BSSGP PDU size)
Prepare tracking the SDU from NS. Initialize with a conservative default.
The value is not yet updated, that will happen in a later patch.

Related: OS#4889
Depends: I5016b295db6185ec131d83089cf6c806e34ef1b6 (libosmocore.git)
Depends: I9bb82ead27366b7370c9ff968e03ca2113ec11f0 (libosmocore.git)
Change-Id: Ic1080abde942ec5a2ae7cdee0ffe716a2fbddb1e
2021-02-16 16:39:45 +01:00
Oliver Smith a8fa567117 d/changelog: set epoch=1
Let apt know that the current 0.0.1 release of the split osmo-gbproxy
repository should be preferred over all packages from before the split.

Related: https://www.debian.org/doc/debian-policy/ch-controlfields.html#version
Related: OS#4992
Change-Id: I3e3749cd14bff3b38261ae048b928ea8c54dfcef
2021-02-15 14:44:21 +01:00
Daniel Willmann 2689c6e7d7 Move vty node into gbproxy_vty.c
This is no longer shared with osmo-sgsn and osmo-gtphub

Change-Id: I5329ca39e8ecfe29862b0b1f9afa7d35e678a181
2021-02-12 16:26:22 +01:00
Daniel Willmann 86ee31a7d7 Remove unused log categories
Change-Id: I519a687c07410fa3c1a0fa9a903d6c3ed9cbba45
2021-02-12 15:47:22 +01:00
Daniel Willmann 44fa20182e gbproxy: Use bssgp2_nsi_tx_ptp in gbprox_relay2nse
Use the function provided by bssgp2 instead of setting up the ns2 prim
request ourself.

Related: OS#4889
Change-Id: I0b8926eb903ed972edb2ed7ba3edbb3d77889564
2021-02-12 09:39:50 +00:00
Daniel Willmann 1ac920ba89 Remove trailing whitespace
Change-Id: If8fe9e65056e458e946ff202cf7ae93efc8abf17
2021-02-12 09:39:38 +00:00
Philipp Maier 4499cf49cb gb_proxy: fix wrong usage of bssgp_rim_ri_name()
In some logging statements the function bssgp_rim_ri_name() is used
twice. This is wrong since _name() functions use an internal buffer,
which can not be used twice in the same logging statement, so for the
affected log statements the function bssgp_rim_ri_name_buf() must be
used.

Change-Id: I8b6254a269770ddc141325d67d143f2a8130c519
Related: SYS#5103
2021-02-10 17:57:03 +01:00
Philipp Maier 1c5766b0ec gb_proxy: add support for relaying BSSGP RIM messages
BSSGP RIM messages are routed from a source to a destination cell by a
RIM routing information IE. Add parsing for the routing information and
support for relaying RIM messages to the destination cell/PCU. If the
destination cell/PCU is not directly connected to osmo-gbproxy route the
rim message to the first connected SGSN.

Change-Id: Idd1ea46832e044f0ade15af32250f90517d848d8
Related: SYS#5103
2021-02-10 16:43:33 +00:00
Daniel Willmann 3ea379395f Various comment/whitespace changes
Change-Id: I0eeef3ec16c249d65e9358889d21cc4984b7b51f
2021-02-10 16:41:18 +00:00
Daniel Willmann fe5d3b7a46 gbproxy_vty: Fix NRI overlap behaviour to match osmo-bsc
The MSC-pooling chapter in OsmoBSC mentions that overlapping NRI ranges will
warn if configured though the VTY interface, but fail when started with
such a config.

The manual for OsmoGbProxy promises a similar behaviour, this patch implements
it.

Change-Id: Id3815ed8d1736ea3ba1e498b2bc3cf30b772551d
2021-02-10 16:41:18 +00:00
Daniel Willmann 6cfedc4932 gbproxy_vty: Fix NRI VTY help MSC->SGSN
Change-Id: I33a60578c7dc28ec50b98c9b67b5cdb0d821d3d1
2021-02-10 16:41:18 +00:00
Philipp Maier 74882dc258 gb_proxy: extend TLV parser
In BSSGP RIM the routing information IE is appearing twice (source and
destination). The current one dimensional TLV parsing method would only
give us access to the first routing information IE (destination), so
lets increase the dimension to 2, so that we get also IEs that appear
twice.

Change-Id: Ieed7160e3005210a9cdeb5c4db28bc3ed031449c
Related: SYS#5103
2021-02-10 13:34:28 +01:00
Philipp Maier e4597ece46 gb_proxy_peer: Require ra_id and cid in gbproxy_cell_alloc
pass raid and cell id directly as parameter to gbproxy_cell_alloc so
that we do not need to fill tas parameter to gbproxy_cell_alloc so that
we do not need to fill the struct members later.

Change-Id: Ic7deae5ccf839b941d70557d28451d52f32cebbb
Related: SYS#5103
2021-02-09 22:45:27 +01:00
Pau Espin Pedrol e7eabd3eec debian/copyright: Drop osmo-sgsn.git leftover files from list
Change-Id: Ia8630332a953b6bc3af80b6e0243c4edcfbd30b6
2021-02-09 15:46:25 +00:00
Pau Espin Pedrol a8da650d15 Drop c-ares references
Those are leftovers from osmo-sgsn.git

Change-Id: I2fabaa0d70d8675ba440d2bba6881a4cb0006861
2021-02-09 15:46:25 +00:00
Philipp Maier 99adf1aee1 gb_proxy_peer: Remove unused function gbproxy_cell_by_bvci_or_new
Change-Id: I43ec049540c10c8ded5a668229447ab1acb6c832
Related: SYS#5103
2021-02-09 15:52:55 +01:00
Daniel Willmann fccbef0a28 gb_proxy_peer: Add Function to get gbproxy cell by cell id
Change-Id: I3403736eed9d6819634c26db0b90393ac6f4416a
Related: SYS#5103
2021-02-09 13:32:52 +01:00
Philipp Maier da3af94bf8 gb_proxy: simplify raid data storage
Instead of storing the raw ra_id in its unparsed binary form, store it
as a parsed struct. Also store the cell-id on cell allocation for later
use.

Change-Id: Ib58b9188e3ce4bd3fdadb03f158d56b29778387c
Related: OS#4894
2021-02-09 13:32:31 +01:00
Philipp Maier 55a22b8bc0 gb_proxy_ctrl: use mcc-mnc-lac-rac notation instead mcc,mnc,lac,rac
The notation for the RAI used in the log is not compliant to the spec.

Change-Id: I6c8c3f3c017918fe847bfbcc153a12cf5f408bdb
Related: OS#4894
2021-02-08 17:23:18 +00:00
Oliver Smith 3385506bb6 Bump version: 0.0.0 → 0.0.1
Create initial release tag after splitting the repository from
osmo-sgsn.git to osmo-gbproxy.git. Does not build against latest
libosmocore yet. See OS#5009 for creating the proper first release.

Change-Id: Ib893a485798751571cea8da1ff95acb925cfaad6
2021-02-05 11:52:56 +01:00
Oliver Smith cd3e8e650c contrib/osmo-gbproxy.spec.in: fix config paths
Make the spec file build (verified with own OBS namespace).

Related: OS#4992
Change-Id: I0b90d1e1a270963d5a053c95825c30193655e798
2021-02-02 18:11:26 +00:00
Oliver Smith 882049d30e debian: fix installing pdfs for -doc package
Don't comment out the pdf glob, it works as intended when building the
package on OBS. I had disabled it, because with dpkg-buildpackage,
override_dh_auto_configure from debian/ruls gets ignored, leading to
--enable-manuals missing in ./configure, and to the pdf file not being
present. But apparently, dpkg-buildpackage just always ignores this,
it's the same with other Osmocom repositories.

Related: OS#4992
Change-Id: I67c71af1406516e1262792b0d7566b3a9470e37f
2021-02-01 15:42:52 +01:00
Harald Welte df0507e011 Update README to cover osmo-gbproxy and not osmo-sgsn
While we're at it, also convert it to markdown.

Related: OS#4992
Change-Id: Ic7e86dfed985f98ae87af9adcde6f776c5a15044
2021-02-01 10:51:01 +01:00
Oliver Smith 383bacacf5 contrib/jenkins.sh: adjust to osmo-gbproxy split
Related: OS#4992
Change-Id: Ie82fc7a5a1166507460cf96ddbdf8ca77430ea64
2021-02-01 10:51:01 +01:00
Harald Welte 936dfd720a Further clean-up in osmo-sgsn -> osmo-gbproxy migration
* fix manuals builds, including vty reference generation
* fix vty tests
* remove manuals from osmo-sgsn
* update .gitreview
* update osmoappdesc.py

Related: OS#4992
Change-Id: I80439ab0d21a3fb33f38da42acbfe3fbb0941b91
2021-02-01 10:39:41 +01:00
Oliver Smith 29532c2a06 === Split osmo-gbproxy from osmo-sgsn ===
Adjust the build system, packaging etc. to split osmo-gbproxy into its
own git repository. Remove tests and configs that aren't related to
osmo-gbproxy.

Related: OS#4992
2021-01-29 16:57:29 +01:00
Alexander Couzens 3c75624e1e follow libosmocore/gprs_ns2 API changes (gprs_ns2_dynamic_create_nse)
The call gprs_ns2_dynamic_create_nse has been removed because it
was a workaround for the old/dropped vty api.

Depends-on: Ie924ead6da17657f3da334068c8ada82c8845495 (libosmocore)
Change-Id: Ie636cfd18d6d43da0e42f2c2de68dfa5c571d55c
2021-01-28 21:19:59 +00:00
Alexander Couzens 571eb950c9 sgsn: migrate to the new gprs_ns2_vty configuration
Change the whole vty configuration for NS to be more flexible
and support more setups. Old configurations are invalid.

API change which must be synchronized with libosmocore

For further information see:
https://osmocom.org/projects/libosmocore/wiki/Network_service_(NS)

Depends-on: I8c3f2afecc74b78f7f914f7dce166cbcb63444eb (libosmocore)
Change-Id: Ie9306ab4d4738c2c57a69987086e22771b30657e
2021-01-28 21:19:59 +00:00
Alexander Couzens b363e21022 gbproxy: follow gprs_ns2 API vty changes
The gprs_ns2_vty2 has been renamed to gprs_ns2_vty. The old
vty has been complete dropped.

API change which must be synchronized with libosmocore.

Depends-on: I8c3f2afecc74b78f7f914f7dce166cbcb63444eb (libosmocore)
Change-Id: If5bd6b86e130772e6c93d640b0c637985416136d
2021-01-28 21:19:59 +00:00