Commit Graph

16 Commits

Author SHA1 Message Date
Daniel Willmann ee834af5d9 gbproxy: Add SGSN NRI configuration
In order to support SGSN pooling we need to configure the various NRI
parameters such as the bitlen, NULL NRI, and which NRIs are assigned to
which SGSN.

Related: OS#4890, OS#4472
Change-Id: Id67592aa7712e5e04e7264b2fb8f26d57eb7e69e
2020-12-29 16:38:49 +01:00
Harald Welte cfc7e8e8b9 gbproxy: Introduce new DOBJ log category; log object allocation/release
Related: OS#4472
Change-Id: I43bcbcda8667d193e7a17fd8e8e9109597b01484
2020-12-10 18:06:34 +01:00
Harald Welte 4bd3e49eb3 gbproxy: Use "(nsei << 16) | bvci" as rate_ctr_group index
As we now have gbproxy_bvc on both the SGSN and the BSS side
with the same BVCI, using the BVCI alone will no longer render
unique indexes.

Related: OS#4472
Change-Id: I13f3c9e69562a56ad7d3742fdeb2ba48f134fdaa
2020-12-10 18:06:06 +01:00
Harald Welte e520964dc2 gbproxy major rewrite for SGSN pool support
Rewrite of a large part of osmo-gbproxy in order to prepare
for SGSN pool support.  The amount of changes are of such fundamental
nature that it doesn't make sense to try to split this into hundreds
of individual changesets.

Related: OS#4472
Change-Id: Ie0746f17927a9509c3806cc80dc1a31d25df7937
2020-12-10 18:05:52 +01:00
Harald Welte 7a0c9ddab0 gbproxy: Remove patching, TLLI-tracking and SGSN2 support
Those features were introduced a long time ago for one specific use
case at one specific user, and they are not needed anymore.  They
complicate the code base significantly and are hard to maintain with
all the upcoming modifications regarding SGSN pool supoprt.

Change-Id: Id9cc2e1c63486491ac5bb68876088a615075fde6
2020-12-05 14:05:36 +01:00
Harald Welte 8b4c794679 gbproxy: convert nse->bvcs from llist_head to hashtable
For the common lookup-by-bvci, this should reduce the computational
complexity significantly.

Depends: libosmocore.git I8ef73a62fe9846ce45058eb21cf999dd3eed5741
Change-Id: Ic8e9279fd61a3c514fc3203429f36a468f0e81d3
2020-12-05 13:55:06 +01:00
Harald Welte d2fef95945 gbproxy: convert bss_nses from llist_head to hashtable
For the common lookup-by-nsei, this should reduce the computational
complexity significantly.

Depends: libosmocore.git I8ef73a62fe9846ce45058eb21cf999dd3eed5741
Change-Id: Idbb6a362332bb6e3ce22102e7409ae80d0980f44
2020-12-05 13:49:37 +01:00
Harald Welte 2b7b1bbbdc gbproxy: Rename gbproxy_cfg.nses to gbproxy_cfg.bss_nses
We will soon also have a list of sgsn-side NSEs, and we need to
differentiate those.

Change-Id: If5accec0c70c01b88927ea07beba6f6488bd9d5a
Related: OS#4472
2020-12-05 12:08:10 +01:00
Harald Welte 560bdb37cc gb_proxy: Rename gbproxy_peer to gbproxy_bvc
I cannot really read the code while it contains its historical weird
naming.  A "peer" used to be a strange amalgamation of NSE + BVC,
while in reality we can have any number of BVC on top of each NSE.

We recently started to split the peer into a gbproxy_nse_peer + gbproxy_peer.
This takes it one step further and renames gbproxy_peer to gbproxy_bvc,
as that's really what it is.

Change-Id: Iae01067282a6401f6af4cab731202872d2cdb080
2020-12-05 12:06:42 +01:00
Harald Welte 173a182d03 gb_proxy: Use TLVP_PRES_LEN instead of TLVP_PRESENT
With TLVP_PRESENT we only check if a tiven TLV/IE is present,
but don't verify that it's length matches our expectation.  This can
lead to out-of-bounds reads, so let's always use TLVP_PRES_LEN.

Change-Id: I1519cff0f6b2fe77f9a91eee17e0055d9df1bce6
2020-12-05 11:44:39 +01:00
Daniel Willmann f6a36cca6f gbproxy: Allow gbproxy_nse_free(NULL)
Calling free() with a null-pointer is usually supported and does
nothing. Change gbproxy_{peer,nse}_free() to reflect that behaviour.

Change-Id: Ia32084f81ca8f8cb9ddea3adabd4b44fd766f1c7
2020-12-04 17:49:19 +01:00
Daniel Willmann 8f407b12a6 gbproxy: Add BVC log filters
Since gbproxy doesn't use bssgp_rcvmsg from libosmocore we need to
implement our own filtering.

Change-Id: I4d1b57b89990945d307f27a58a7f630be0253d5b
Related: SYS#5232
2020-12-04 01:31:05 +01:00
Daniel Willmann 559edac17a gbproxy: Separate function to move gbproxy_peer to different nse
Change-Id: I0a8b1e4b78384ea99d50109f050ca501b18ba5d9
Related: SYS#5226
2020-11-30 18:30:35 +01:00
Daniel Willmann e50550e409 gbproxy: Add NSE peer that can have multiple gbproxy_peers
We want this level of indirection to support multiple BVCs per NSE. The
current code assumes that an NSE only has one BVC which breaks messages
on the signalling BVC which should only be sent once to an NSE
regardless of the number of BVCs it contains.

Change-Id: I97cc6c8f8c0f1b91577ab8f679c4ae217cc88076
Related: SYS#5226
2020-11-30 18:30:35 +01:00
Harald Welte 09ea490a79 gb_proxy_peer: Add some FIXMEs regarding invalid assumptions
Change-Id: Ibf3d4a3bd58e706dfa44e8cc9ff4823a7759dea5
2020-11-27 23:15:18 +01:00
Pau Espin 1ddefb12e4 Move out gbproxy to its own subdir
Change-Id: I2cc98d3a276d953609bbbbaa9782a0112687791e
2019-09-02 14:03:04 +02:00