aboutsummaryrefslogtreecommitdiffstats
path: root/include/osmocom/gprs/gprs_ns.h
AgeCommit message (Collapse)AuthorFilesLines
2020-07-04gprs_ns.h: add missing prototype gprs_ns_rcvmsg()Alexander Couzens1-0/+5
gprs_ns_rcvmsg is already exported, but never declared. Change-Id: I7edc5f4fb6e1fda059e35ea0988d0ef42208aa50
2020-06-08NS: replace use of gprs_nsvc_create() with gprs_nsvc_crate2()Harald Welte1-1/+0
Change-Id: I2b10e1707b0976b685d1c14016481d5565888150
2020-06-08NS: Optionally disable NS-{RESET,BLOCK,UNBLOCK} when using UDP/IPHarald Welte1-0/+2
3GPP TS 48.016 is quite clear in that no NS-{RESET,BLOCK,UNBLOCK} procedures shall be used over an IP based transport. They are only for use in Frame Relay based transport. However, as libosmogb was first developed against ip.access nanoBTS, and their Gb implementation mandates those procedures, we unconditionally implemented those procedures back then. Let's give the user the option of disabling this behavior to become more spec compliant (and interoperate with more other vendors out there). Change-Id: Ic4eba1b4dcbeac00f5879db295e0a9f1a50f71d8
2019-04-10Add _c versions of functions that otherwise return static buffersHarald Welte1-0/+1
We have a habit of returning static buffers from some functions, particularly when generating some kind of string values. This is convenient in terms of memory management, but it comes at the expense of not being thread-safe, and not allowing for two calls of the related function within one printf() statement. Let's introduce _c suffix versions of those functions where the caller passes in a talloc context from which the output buffer shall be allocated. Change-Id: I8481c19b68ff67cfa22abb93c405ebcfcb0ab19b
2019-04-03Add _buf() functions to bypass static string buffersHarald Welte1-0/+2
We have a number of static buffers in use in libosmo*. This means the related functions are not usable in a thread-safe way. While we so far don't have many multi-threaded programs in the osmocom universe, the static buffers also prevent us from calling the same e.g. string-ify function twice within a single printf() call. Let's make sure there's an alternative function in all those cases, where the user can pass in a caller-allocated buffer + size, and make the 'classic' function with the static buffer a wrapper around that _buf() variant. Change-Id: Ibf85f79e93244f53b2684ff6f1095c5b41203e05
2019-02-26NS: Add support for GPRS NS IP Sub-Network-Service (SNS)Harald Welte1-3/+18
The NS implementation part of the Gb implementation libosmogb so far implemented a rather classic dialect of Gb, with lots of heritage to FR (Frame Relay) transports. At least since Release 6 of the NS specification, there's an IP Sub-Network Service (SNS), which * permits for dynamic configuration of IP endpoints and their NS-VCs * abandons the concept of a NSVCI on IP transport * forbids the use of RESET/BLOCK/UNBLOCK procedures on IP transport This commit introduces BSS-side IP-SNS support to libosmogb in a minimally invasive way. It adds a corresponding SNS FSM to each NS instance, and implements the new SIZE/CONFIG/ADD/DELETE/CHANGE_WEIGHT procedures very closely aligned with the spec. In order to use the SNS flavor (rather than the classic one), a BSS implementation should use gprs_ns_nsip_connect_sns() instead of the existing gprs_ns_nsip_connect(). This implementation comes with a set of TTCN-3 tests in PCU_Tests_RAW_SNS.ttcn, see Change-ID I0fe3d4579960bab0494c294ec7ab8032feed4fb2 of osmo-ttcn3-hacks.git Closes: OS#3372 Closes: OS#3617 Change-Id: I84786c3b43a8ae34ef3b3ba84b33c90042d234ea
2019-02-19gprs_ns: Declare gprs_ns_tx_alive*() in header fileHarald Welte1-0/+2
The symbols for those functions were always exported, but we somehow didn't declare them in gprs_ns.h Change-Id: Ib073e9c93fcdf408b63000182e90aabce37f687e
2018-07-22gprs_ns.h: Declare gprs_ns_cause_str() which already existed in c fileHarald Welte1-0/+1
Change-Id: Ia95f0cc8d110f95814173bb5a1c11bd85d8cd533
2018-06-14Add function gprs_nsvc_state_appendDaniel Willmann1-0/+2
A common function to append the nsvc state from osmo-sgsn or osmo-gbproxy Change-Id: I7f0eaff7329ab98cad792d30b20ab053007aab85
2017-10-24GPRS: constify NS printing routine parametersMax1-1/+1
Change-Id: I549ab7c26ac1489e01f281594bafe44b0681dc83
2017-10-24GPRS: clarify ip/frgre union useMax1-0/+2
* add comment about underlying assumption that structs in ip/frgre union members in gprs_nsvc struct have the same memory layout * remove such assumption from gprs_ns_ll_str() * use gprs_ns_ll_str() for NSE dump Change-Id: Idcb912b7b3f7460fd2b058e16650c0bde8f757ee
2017-10-24GPRS: unify NS state printingMax1-0/+4
* introduce defines with NS state names * use them for vty and tests * expand test output to print complete NS state Change-Id: I69f8d536135ae76dbca623c2f1ffba625adcb1e9 Related: SYS#3610
2017-10-24gb: optionally allow nsip packets only from a specific hostPhilipp Maier1-0/+2
When listening for nsip connections is enabled, then every remote host may send packets. This is useful for an SGSN that serves multiple PCUs, but contraproductive for a PCU that awaits packets from a single SGSN. Add struct members remote_ip, and remote_port to struct gprs_ns_inst, when set, then the listening end uses connect() to ensure that only the expected host may send packets. Related: OS#2401 Change-Id: Ifeb201d9006eec275a46708007ff342cdfc14e45
2017-10-17api doc: fix two doxygen group closing bracesNeels Hofmeyr1-1/+1
Change-Id: I6c1f47d13c5b7a9cb2281de9f017df4f1ed88ba7
2017-06-23doxygen: unify use of \file across the boardNeels Hofmeyr1-0/+2
Considering the various styles and implications found in the sources, edit scores of files to follow the same API doc guidelines around the doxygen grouping and the \file tag. Many files now show a short description in the generated API doc that was so far only available as C comment. The guidelines and reasoning behind it is documented at https://osmocom.org/projects/cellular-infrastructure/wiki/Guidelines_for_API_documentation In some instances, remove file comments and add to the corresponding group instead, to be shared among several files (e.g. bitvec). Change-Id: Ifa70e77e90462b5eb2b0457c70fd25275910c72b
2017-06-23doxygen: enable AUTOBRIEF, drop \briefNeels Hofmeyr1-16/+16
Especially for short descriptions, it is annoying to have to type \brief for every single API doc. Drop all \brief and enable the AUTOBRIEF feature of doxygen, which always takes the first sentence of an API doc as the brief description. Change-Id: I11a8a821b065a128108641a2a63fb5a2b1916e87
2017-05-24Add human-readable names for signal_nsMax1-0/+2
Change-Id: Id664355eb8305fb287e4dae0800fb20dc2f9b8cd Related: SYS#3610
2016-09-23gprs: Increase NS_ALLOC_SIZE to 3kDaniel Willmann1-1/+2
2k can be insufficient when responding with a STATUS message to a long LLC packet because the original message is included in the STATUS. Change-Id: I6f76751cfadf61e87ce4367a38907083e1c98562 Ticket: SYS#2967 Sponsored-by: On-Waves ehf
2015-11-02stats: Add osmo_ name prefix to identifiersJacob Erlbeck1-1/+1
Since the the stat_item and stats functions and data types are meant to be exported, they get an osmo_ prefix. Sponsored-by: On-Waves ehf [hfreyther: Prepended the enum values too. This was requested by Jacob]
2015-10-28ns: Add statistics for some eventsJacob Erlbeck1-0/+2
The following counters are added to the ns.nsvc counter group: lost.alive The number of missing ALIVE ACK messages lost.reset The number of missing RESET ACK messages The following items are added to the ns.nsvc stat item group: alive.delay The time in ms between sending ALIVE and receiving the next ALIVE ACK Sponsored-by: On-Waves ehf
2015-04-07ns: Log when sending fails (Coverity)Jacob Erlbeck1-6/+4
Currently the return value of the gprs_ns_tx family of functions is often ignored. This is not a serious issue, since the successful delivery of the messages is neither guaranteed nor acknowledged by the network layer anyway. Nevertheless this commit adds logging (level INFO) to gprs_ns_tx and gprs_ns_msgb_alloc. The definition of the latter has been moved from the header file to gprs_ns.c. Fixes: Coverity CID 1040678, 1040679, 1040680, 1040681, 1040682, 1040683, 1040684, 1040686, 1040687, 1040688, 1111545, 1240203, 1240204 Sponsored-by: On-Waves ehf
2014-10-09gprs-ns: Let gprs_nsvc_reset return a valueJacob Erlbeck1-1/+1
Currently gprs_nsvc_reset does not return any value. This patch changes the function to return an integer, where a value less than zero indicates an error. The value is taken from the gprs_ns_tx_reset function. In case of failure, an error message is logged. Sponsored-by: On-Waves ehf
2014-06-16include: Switch to #pragma once patternSylvain Munaut1-4/+1
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-10-24gb: Fix NS RESET/RESET_ACK abnormal casesJacob Erlbeck1-0/+5
This changes the implementations for the reception of RESET and RESET_ACK to be compatible with 3GPP TS 08.16, 7.3.1: - Just send a RESET_ACK with correct values back to the SGSN when a RESET with an invalid NSVCI or NSEI has been received. - Check RESET_ACK for matching NSEI and NSVCI. - Ignore unexpected RESET_ACKs. In addition, use RESET_ACK from a BSS to update the BSS source address based on the NSVCI to be tolerant with changing UDP source addresses/ports. Sponsored-by: On-Waves ehf
2013-10-15gb: Fix gprs_ns_rx_reset to not create NS-VC duplicatesJacob Erlbeck1-0/+3
Under special circumstances (see below) receiving a NS-RESET leads to duplicated NS-VC entries. This happens when the source port of a NS-VC changes to a new one that has already been used by another NS-VC. This patch changes gprs_ns_rx_reset() to check for this case and to use the existing NS-VC object. The NS-VC object that was associated with the source address before is detached from this source but kept in the NS-VC list so that it can be reattached when a correspondent NS-RESET is received later on. Meanwhile it will have a cleared link layer address which will not match a real link info. A new counter NS_CTR_REPLACED is incremented each time when the NS-VC object is replacing another one. A new signal S_NS_REPLACED is added which gets dispatched in this case, too. Another new counter NS_CTR_NSEI_CHG is incremented each time when the NSEI of a NS-VC object (with fixed NSVCI) changes. Ticket: OW#874 Sponsored-by: On-Waves ehf
2013-10-15gb: Add functions to access the LL part of the NS-VC objectsJacob Erlbeck1-1/+7
Adds the functions gprs_ns_ll_copy() and gprs_ns_ll_clear(). Renames gprs_ns_format_peer() to gprs_ns_ll_str(). All of these functions uniformly access the link layer part within the NS-VC objects. Sponsored-by: On-Waves ehf
2013-10-11tests/gb: Show invoked signals in test outputJacob Erlbeck1-0/+3
Register an osmo signal handler to print a short notice about every SS_L_NS signal that is generated while processing the tests. Sponsored-by: On-Waves ehf
2013-10-08gb: Separate nsvc creation from NS message processingJacob Erlbeck1-0/+9
This patch refactors gprs_ns_rcvmsg() by moving the parts relevant to the NS messages into the new functions gprs_ns_vc_create() (nsvc object creation) and gprs_ns_process_msg() (main NS automaton). These do not contain code that directly depends on the link layer (they call other functions that still do). This reduces the gprs_ns_rcvmsg() function to calling these two functions and optionally setting up the link layer specific fields of the nsvc. Sponsored-by: On-Waves ehf
2013-07-06libosmogb: Add function to close NS instance without destroying itHolger Hans Peter Freyther1-1/+4
2013-03-25gprs_ns: Allow to set the DSCP for the UDP socket.Holger Hans Peter Freyther1-0/+1
Allow to tag the NS service with a custom DSCP.
2012-06-17libosmogb: move files to proper location and fix build0.5.0Harald Welte1-0/+189