| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As part of fixing issue OS#3075, we want to migrate support
for encoding system information from osmo-bsc to libosmocore.
This change ports osmo-bsc code for encoding SI rest octets.
The conversion was a bit tricky in some places because some
functions receive a 'struct gsm_bts' parameter in osmo-bsc.
In this libosmocore version, such functions expect parameters
which correspond to the individual fields of 'struct gsm_bts'
which are used by these functions.
Several structs from osmo-bsc's system_information.h are now
also declared in libosmocore headers, with an added osmo_ prefix
to avoid collisions with existing definitions in osmo-bsc.
Some helpers were ported from osmo-bsc's system_information.c
to libosmocore's gsm48_rest_octets.c. Contrary to osmo-bsc's
implementation they are now only visible within this file.
Unfortunately, this code ported from osmo-bsc lacks unit tests.
Change-Id: I47888965ab11bba1186c21987f1365c9270abeab
Related: OS#3075
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is 1:1 the result of doing
cd libosmocore
./contrib/struct_endianess.py
git commit -a
Running struct_endianess.py again should result in no changes.
That means we could include such a check in the gerrit verification job now.
Change-Id: Ia0b99d76932aeb03e93bd0c62d3bf025dec5f9d2
|
|
|
|
|
|
|
|
|
|
|
|
| |
To reset the state of BSSGP allow to flush the BSSGP queues.
When testing (with TTCN3) the test object should be resetted between
each test.
Introduce the functions:
bssgp_fc_flush_queue() - flushs a single flow control object
bssgp_flush_all_queues() - flushs queues of all BSSGP connections
Change-Id: I29b6ad6742ddf9b0b58b4af37d9a1cf18e019325
|
|
|
|
| |
Change-Id: Ia95f0cc8d110f95814173bb5a1c11bd85d8cd533
|
|
|
|
|
|
| |
A common function to append the nsvc state from osmo-sgsn or osmo-gbproxy
Change-Id: I7f0eaff7329ab98cad792d30b20ab053007aab85
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add gsm48_encode_ra() which takes appropriate struct as [out] parameter
instead of generic buffer. Using uint8_t buffer instead of proper struct
type prooved to be error-prone - see Coverity CID57877, CID57876.
Old gsm48_construct_ra() is made into tiny wrapper around new
function. The test output is adjusted because of the change in function
return value which was constant and hence ignored anyway.
Related: OS#1640
Change-Id: I31f9605277f4945f207c2c44ff82e62399f8db74
|
|
|
|
| |
Change-Id: I549ab7c26ac1489e01f281594bafe44b0681dc83
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
Change-Id: I6c1f47d13c5b7a9cb2281de9f017df4f1ed88ba7
|
|
|
|
|
|
| |
Those functions can be used to look up the size of (E)GPRS blocks.
Change-Id: I05ff75ef7dfae639886bbd09fe35f03a8af9d988
|
|
|
|
|
| |
Change-Id: I9bf8f4dd784ccddbb9926492a85fff3293a0e913
Related: OS#1638
|
|
|
|
|
|
| |
Add values from 3GPP TS 48.018
Change-Id: Ie39a6c91a46d179392d861805a106743a07c6fb0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
| |
Change-Id: Id664355eb8305fb287e4dae0800fb20dc2f9b8cd
Related: SYS#3610
|
|
|
|
|
|
|
|
| |
Add value strings for Service Control PDUs according to 3GPP TS 48.016 §9
and use them for logging.
Change-Id: I0ea3a45f35d68619d4cfa9735ef77abd9f9f0d58
Related: SYS#3610
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It is too easy for calling code to use the same filter and context indexes for
different filters and structs. For example, openbsc's IMSI filter and libgb's
GPRS_BVC filter both fall on index 1 even though there are plenty more indexes
to choose from. To alleviate this, have one central definition here, sort of
like ports.h does for VTY and CTRL port numbers.
Add static asserts to make sure the indexes fit in the available array and bit
mask space.
Calling code like openbsc.git and osmo-pcu need adjustments and/or should move
to using these enum values instead of their local definitions.
Taking this opportunity to also prepare for a split of struct gsm_subscriber in
openbsc into bsc_subsciber and vlr_subscriber with appropriate separate filter
index constants for both subscriber types.
Include previous LOG_FILTER_ALL in the LOGGING_FILTER_* enum, and replace its
use by (1 << LOGGING_FILTER_ALL).
Change-Id: I5c343630020f4b108099696fd96c2111614c8067
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
Includes EGPRS coding and puncturing scheme (CPS) tables from 3GPP
TS 04.60. Currently osmo-bts-trx is the only user of CPS table
values, but this may change with gprsdecode and other utilities.
Change-Id: I09fe6514a0e2e51bb3206f8387633f7e0255345f
|
|
|
|
|
|
| |
For shared use by osmo-pcu and osmo-bts-trx.
Change-Id: I500cdc87cd30faf36c8cd92d234642f809c8f2aa
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This function originates from openbsc/src/gprs but is just specific
to BSSGP/Gb on the same level like bssgp_msgb_alloc.
This commit puts the former gprs_msgb_copy function beside
bssgp_msgb_alloc.
Renamed function:
gprs_msgb_copy -> bssgp_msgb_copy
Sponsored-by: On-Waves ehf
|
|
|
|
|
|
|
|
|
|
| |
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]
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently large values for Bmax default MS get sliced since a uint16_t is
used as the type of the corresponding parameter of bssgp_tx_fc_bvc.
GSM 48.018, 11.3.2 which in turn refers to 11.3.5 specifies a maximum
of 6MB (0xffff * 100).
This commit changes the type to uint32_t to cover the full value
range.
Sponsored-by: On-Waves ehf
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently incoming BSSGP STATUS messages are just logged and no other
action is taken. This makes it impossible for higher layers to react
to failures which are indicated by corresponding STATUS messages
unless a timeout is triggered as a result of that failure later on.
This commit adds a bssgp_rx_status() function and calls it on
incoming STATUS messages. That function logs a message, increments the
new BSSGP_CTR_STATUS counter if the bctx context exists and invokes
an NM_STATUS status indication. The latter will allow the application
to handle failures immediately. Since all STATUS messages should be
handled, the function is already called in bssgp_rcvmsg and the
message is no longer handled in (and will not reach) bssgp_rx_sign
and bssgp_rx_ptp.
Ticket: OW#1414
Sponsored-by: On-Waves ehf
|
|
|
|
|
|
|
|
|
|
|
| |
The copyright holders Harald Welte, Holger Freyther, Andreas Eversberg
and sysmocom - s.f.m.c. GmbH (represented by Holger and Harald) agree
that the license of libosmogb should be GPLv2+ and not AGPLv3+.
The reason the source files stated AGPLv3+ is due to the history, as
they were moved from OpenBSC to libosmocore at the time we needed to use
them from osmo-pcu. It was an oversight back then to not re-license
them accordingly.
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
This explicitely allows aliasing of this struct to avoid the warning
shown below. Note, that this warning isn't show when
'-fno-strict-aliasing' is used.
Addresses:
gb/gprs_ns_test.c:85:54: warning: dereferencing type-punned pointer will
break strict-aliasing rules [-Wstrict-aliasing]
|
| |
|
|
|
|
| |
Allow to tag the NS service with a custom DSCP.
|
| |
|
| |
|
|
|
|
| |
.. not sure how we could have missed that so far.
|
|
|
|
|
| |
this ensures that we can talloc the flow-control queue entries
as siblings off the bvc_ctx.
|
|
|
|
|
|
|
| |
* add more comments on units of struct members
* make sure to parsre FC-BVC message correctly
* add error message in case user passes PDU larger than bucket size
* add new function to initialize flow control struct
|
|
|
|
|
|
|
|
| |
This code is supposed to implement the BSSGP flow control algorithm,
both for the per-BSS and for the per-MS flow control.
The code currently has no test cases, they will come in a separate
commit.
|
|
|
|
|
|
| |
The OpenSUSE build is not happy about the uint8_t to uint8_t*
assignment. As the suspend_ref is a mandatory field we can make
it a plain uint8_t. Increase the LIBVERSION as the ABI has changed.
|
|
|
|
|
|
|
|
|
|
|
|
| |
There is no real reason to keep the include directory a multi-level
recursion, so instead declare everything within include (so that we
can use proper nobase_ declarations) and be it.
Please note that since we removed the sub-Makefile.am, ./configure
will not create the directory structure for us on out-of-tree builds,
so we have to make sure the directory we're generating to exists first.
Signed-off-by: Diego Elio Pettenò <flameeyes@flameeyes.eu>
|
|
|