aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2020-12-28gbproxy: Add VTY command to override the node selection functiondaniel/gbproxyDaniel Willmann2-1/+39
This is mainly useful when testing SGSN pooling Change-Id: I2894320413dbd0b9aec9a9bc9b88ce7cdeed206b Related: SYS#5115, OS#4472
2020-12-28gbproxy: Add SGSN nameDaniel Willmann5-7/+68
This is useful for logging and configuration to identify an SGSN by name Change-Id: I2a3410dd9bebb242957e13a63ed70e447204203c Related: SYS#5115, OS#4472
2020-12-28gbproxy: Add SGSN pooling supportDaniel Willmann4-29/+195
Change-Id: I58b9f55065f6bd43450e4b07cffe7ba132b1fd9b Related: OS#4472
2020-12-27gbproxy: Add SGSN NRI configurationDaniel Willmann8-21/+495
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-22gbproxy: Add "show gbproxy cell ..." VTY commandHarald Welte1-0/+42
This allows the user to inspect CELL related gb-proxy state. Change-Id: Iad1e8bbc358df9a3b3392404a70445a169dfebd5
2020-12-22gbproxy: Fix confusing log message in gbprox_relay2nseDaniel Willmann1-2/+2
This function is now used to transmit messages in both directions, BSS->SGSN and SGSN->BSS. Print the actual direction in the logs Change-Id: I31682156dfe88f7ca121a711968e625caed8bd5e Related: OS#4472
2020-12-21osmo-gbproxy: Initialize all hash_mapsDaniel Willmann1-0/+2
Change-Id: I9578af77a7b2f61b57c918a703768ca20221c294 Related: OS#4472
2020-12-15sgsn: check for NULL of gprs_subscr_get_or_create()Alexander Couzens2-0/+10
gprs_subscr_get_or_create() can return NULL if no memory can be allocated. Detected by the compiler on Ubuntu s390x. Signed-off-by: Steve Langasek <steve.langasek@ubuntu.com> Signed-off-by: Alexander Couzens <lynxis@fe80.eu> Change-Id: I86b3652d46bdd581fe6cbab16b52395a0daaa082
2020-12-14gbproxy: rename vty command "show gbproxy ..." to "show gbproxy bvc ..."Harald Welte2-3/+4
we have other objects to show, and the orthogoanl way to do this is to rename the existing one. Change-Id: I7836a37533a2de81720acedda712d61f429df12c
2020-12-12gbproxy: Improve VTY state introspectionHarald Welte2-20/+35
* allow to print not only BSS-side BVCs, but also SGSN-side * differentiate between SIG and PTP BVC * print the actual BVC FSM state name instead of just UNBLOCKED/nothing Change-Id: I8e09a9dc296b15094d191b0451d04457c815d116
2020-12-12gbproxy: Implement scaling of BVC flow control in SGSN poolHarald Welte4-3/+65
When there are multiple SGSNs inside a pool, we need to decide how much of the per-BVC capacity advertised by the BSS in its BVC-FLOW-CONTROL we should announce to each of the pool members. A conservative approach would be to advertise 1/num_sgsn, but there may also be use case where over-provisioning (announcing more than an equal share of the capacity) is useful. Hence, let's introduce "pool bvc-flow-control-ratio <1-100>" in order to allow the administrator to decide. Related: OS#4891 Change-Id: Ibe5addf657e7237499ca0205bacfe999ecd1e771
2020-12-12gbproxy: Add FSM related VTY commandsHarald Welte1-0/+1
Change-Id: Id84ce52722d705eb25a12ee6f108ad3107a9f8d2
2020-12-12gbproxy: Fix segfault when receiving PAGING for unknown destinationHarald Welte1-6/+7
The 'nse' variable had been used both as the input argument of the SGSN-side NSE, as well as a loop iteration variable. Let's separate this clearly. Closes: OS#4904 Change-Id: I375a219cd72eb11a9a0cb7d55a3efb7b83b771ac
2020-12-12gbproxy: (Re)allocate SGSN-side PTP BVC even if CELL already existsHarald Welte1-22/+20
After a SGSN-side RESET of the SIG-BVC, all PTP BVC on the SGSN side are gone. However, the CELLs and the BSS side BVCs continue to exist (as there may be other SGSNs). So if a PTP-BVC RESET from the BSS side arrives in such a situation, and we can find a matching CELL, we still need to check if we need to create any SGSN-side PTP BVCs instead of simply being happy with the CELLs already existing. Change-Id: I1d1562e421082fa4399c73ac31290e4c95718e49 Closes: OS#4903
2020-12-12gbproxy: Copy RA-ID from BSS side BVC to CELL and SGSN-side BVCHarald Welte1-0/+2
Change-Id: I18669f269c4a959fcfa51885aafb719b662a7f8a Related: OS#4894
2020-12-10gbproxy: Fix bvci check in gbprox_rx_ptp_from_*Daniel Willmann1-2/+2
The check for bvci in _rx_ptp_from_* was always false. Change-Id: I16a0284ba3201c146c307db6997a416589d7e693 Related: OS#4472
2020-12-10gbproxy: Implement handling of BVC Flow ControlHarald Welte1-4/+50
We must locally terminate + acknowledge any inbound BSSGP-FC-BVC, and ourselves trigger the transmission of BSSGP-FC-BVC to each SGSN in the pool. Related: OS#4891 Depends: libosmcoore.git Ie59be6761177c43456898be9148727f15861a622 Change-Id: Ib6495e5de4bfcf748a98e08743d1a8f2565f8b69
2020-12-10gbproxy: Don't create an extra msgb copy for SGSN DL SIGHarald Welte1-17/+9
That copy may have made sense while we were doing patching/buffering, but we're not doing any of that anymore. Related: OS#4472 Change-Id: I207a869ffac8bf60104f80f9ed58faf0021e5e95
2020-12-10gbproxy: Introduce new DOBJ log category; log object allocation/releaseHarald Welte4-0/+29
Related: OS#4472 Change-Id: I43bcbcda8667d193e7a17fd8e8e9109597b01484
2020-12-10gbproxy: Use "(nsei << 16) | bvci" as rate_ctr_group indexHarald Welte1-1/+1
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-10gbproxy major rewrite for SGSN pool supportHarald Welte7-467/+855
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-10mm_state_gb_fsm: Handle implicit detach from mm_standbyDaniel Willmann1-1/+4
Change-Id: I63d04a2dcdc17b4df6616c515641c435d919c787 Related: OS#2737
2020-12-10migrate to DLBSSGP as log sub-system for BSSGPHarald Welte4-18/+2
Change-Id: I69ee10b6fad1da2053cf6f3ae99d3ecf62a144ce Depends: libosmocore.git Change-Id I506190aae9217c0956e4b5764d1a0c0772268e93
2020-12-07gbproxy: Log FSM timeoutsHarald Welte1-0/+1
Change-Id: I5c48e42083ab6f8622808457ca3f017adf35cdff
2020-12-07gb_proxy: Use osmo_tlv_prot_parse() to validate mandatory IEsHarald Welte1-12/+45
We recently introduced code to libosmocore which allows us to validate the mandatory IE presence (and length) in a generic way. Let's use it. Change-Id: I0ea3f5f9566d9bf5a8429c3ee748e3e90cda6cd7 Depends: libosmocore.git I7e4226463f3c935134b5c2c737696fbfd1dd5815
2020-12-07gbproxy: use gbprox_relay2peer() whenever possibleHarald Welte1-3/+3
gbprox_relay2peer() is a small wrapper around gbprox_relay2nse(), but as it manages the transmit error counter, we should use it whenever possible. Change-Id: I85ab49ca0a25dd7c54b88c4fdc8838843e6d2209
2020-12-07gb_proxy: Introduce more validation / constraint checksHarald Welte1-22/+62
* ensure the BSSGP PDU header length before reading pdu_type field * ensure we never process uplink PDUs in downlink and vice-versa * ensure we never proceses PTP PDUs on SIGNALING BVCI and vice-versa Change-Id: I6e40aed0283f1a0860ab273606605f7fb28717cf Depends: libosmocore.git I7e4226463f3c935134b5c2c737696fbfd1dd5815
2020-12-07gbproxy: Delete gbproxy_testHarald Welte6-1487/+0
The test is actually performing invalid operations such as sending empty NS packets without even a BSSGP header - and assumes that gbproxy should route those. Given that we have a much more comprehensive tset suite in GBProxy_Tests.ttcn in osmo-ttch3-hacks.git, it makes sense to remove the testsuite. It may contain many more wrong assumptions, or assumptions that no longer hold true with the "gbproxy 2020". Change-Id: I053aebab6bf5d0ee955f2221bf27925b36140cf3
2020-12-05gb_proxy: cosmetic: Use function rather than open-coding is_sgsnHarald Welte1-7/+8
Change-Id: Id41d74ebd41e5084377a986f4a1acd53cae12bc1
2020-12-05gbproxy: Remove patching, TLLI-tracking and SGSN2 supportHarald Welte15-12310/+4
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-05gbproxy: convert nse->bvcs from llist_head to hashtableHarald Welte7-64/+79
For the common lookup-by-bvci, this should reduce the computational complexity significantly. Depends: libosmocore.git I8ef73a62fe9846ce45058eb21cf999dd3eed5741 Change-Id: Ic8e9279fd61a3c514fc3203429f36a468f0e81d3
2020-12-05gbproxy: convert bss_nses from llist_head to hashtableHarald Welte7-35/+56
For the common lookup-by-nsei, this should reduce the computational complexity significantly. Depends: libosmocore.git I8ef73a62fe9846ce45058eb21cf999dd3eed5741 Change-Id: Idbb6a362332bb6e3ce22102e7409ae80d0980f44
2020-12-05gbproxy: Rename gbproxy_cfg.nses to gbproxy_cfg.bss_nsesHarald Welte6-27/+27
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-05gb_proxy: Rename gbproxy_peer to gbproxy_bvcHarald Welte8-592/+596
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-05gb_proxy: Use TLVP_PRES_LEN instead of TLVP_PRESENTHarald Welte2-17/+17
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-05gbproxy: Send BVC-STATUS if BSS sends us BVC-RESET without mandatory IEsHarald Welte1-2/+4
Change-Id: I198ca70f5e0947735f76d32cd9d3eed159349a94
2020-12-04gbproxy: Delete gbproxy_nse in delete-gbproxy-peer VTY commandDaniel Willmann1-2/+4
The gbproxy_nse is created when the signalling BVC is resetted. When we delete all bvcs of an nsei we need to remove it as well. Change-Id: I997b29fef93188565f81bd403bc68840473958c3 Related: SYS#5002
2020-12-04gbproxy: Allow gbproxy_nse_free(NULL)Daniel Willmann1-2/+4
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-04gbproxy: Add newline to log messageDaniel Willmann1-1/+1
Change-Id: I91a076872b5d744a237f6d325857b95362455e8d
2020-12-04gbproxy: Add BVC log filtersDaniel Willmann4-1/+46
Since gbproxy doesn't use bssgp_rcvmsg from libosmocore we need to implement our own filtering. Change-Id: I4d1b57b89990945d307f27a58a7f630be0253d5b Related: SYS#5232
2020-12-02gbproxy: Cosmetics: use longer linesHarald Welte1-9/+5
Change-Id: I9426bf4be2faa0da7848cb102b20cc539948b3f5
2020-12-02gb_proxy: Slightly restructure processing of BSS-originated BVC-RESETHarald Welte1-21/+24
* explicit else clause rather than implicit * don't continue processing if mandatory BVCI missing from message Change-Id: I038576b91ae1ece149149d8663de7b8495d24e06
2020-12-02gbproxy: Move BSS-side BVC-RESET processing to its own functionHarald Welte1-70/+87
The switch clause was getting a bit too long/nested, let's add a separate gbprox_rx_bvc_reset_from_bss() function. Change-Id: If262566e275cca96035045d1194ce102c0942eb6
2020-12-02gb_proxy: Broadcast SGSN-INVOKE-TRACE and OVERLOADHarald Welte1-5/+8
Both BSSGP messages appear from the SGSN in downlink on BVCI=0. We must send a copy of this message to each of the BSS side NSEs. Change-Id: Ia19791b143989eb1490f461d88b9edbd8e3b82be Closes: OS#4875
2020-12-02gbproxy: Add todos encountered while going through the codeDaniel Willmann1-1/+2
Change-Id: I8c3a788f008d3cb2d067d974c2b1b9ca45185d8d
2020-12-02gbproxy: Change generic LOG messages so BVCI/NSEI fmt is consistentDaniel Willmann3-42/+44
We actually need to alter our compiler flags to avoid -Werror=trigraphs creating trouble: gb_proxy.c: In function ‘block_unblock_peer’: gb_proxy.c:875:37: error: trigraph ??) ignored, use -trigraphs to enable [-Werror=trigraphs] 875 | LOGP(DGPRS, LOGL_ERROR, "BVC(%05u/??) Cannot find BSS\n", | Fixes: SYS#5233 Change-Id: I93296353dd964602699480faae1248096e331c6a
2020-12-02gbproxy: Use LOG macros for NSE/BVCDaniel Willmann3-77/+86
Change-Id: If445f18bc8390c338b5aeb9085951ea392e68b3a Related: SYS#5233
2020-12-02gbproxy: Add logging macros for NSE and BVCDaniel Willmann1-0/+11
Change-Id: Ibb2bcf3344bdc750869223b4c4861b4bbc6f417c Related: SYS#5233
2020-12-01gb_proxy: More precise + readable log messagesHarald Welte1-11/+7
* use string representations instead of magic numbers whenever possible * make text actually describe the specific case, rather than copy+paste * proper order (foobar indication) not (indication ..... foobar) Change-Id: I232038da26a9963763c5fc9051b87c9182b27d94
2020-12-01gmm: Introduce comment to ease addition of Network feature support IE laterPau Espin Pedrol1-0/+3
Change-Id: I131cba3de3c80c61d5549e7c31b4eacaaeddb040