Commit Graph

17 Commits

Author SHA1 Message Date
Eric Wild 55dcfd0730 configure.ac: fix libtool issue with clang and sanitizer
[this fix already exists in most of the other repos]

As pointed out at https://github.com/libexpat/libexpat/issues/312
libtool does not play nice with clang sanitizer builds at all.
For those builds LD shoud be set to clang too (and LDFLAGS needs the
sanitizer flags as well), because the clang compiler driver knows how
linking to the sanitizer libs works, but then at a later stage libtool
fails to actually produce the shared libraries and the build fails. This
is fixed by this patch.

Addtionally LD_LIBRARY_PATH has no effect on conftest runs during
configure time, so the rpath needs to be set to the asan library path to
ensure the configure run does not fail due to a missing asan library,
i.e.:

SANS='-fsanitize=memory -fsanitize-recover=all -shared-libsan'
export CC=clang-10
ASANPATH=$(dirname `$CC -print-file-name=libclang_rt.asan-x86_64.so`)
export LDFLAGS="-Wl,-rpath,$ASANPATH $SANS $LDFLAGS"

Change-Id: I577e7d7b07acf76e5d97dcce5da206d10f5e2aeb
2023-08-24 13:04:17 +02:00
Pau Espin bd7964f101 sm: Introduce APIs to enc/dec QoS Profile
Ported from  open5gs.git/lib/gtp/v1/types.{c,h} 5764f7267d16a8ea6aeedc6c227552575915def5,
for which I was the author too.
The ARP extra byte field at the start of the IE val which is introduced in the
GTP variant is dropped when porting to SM, since it's not present there
(and offsets/sizes are adjusted).

The QoS code is moved is moved into a common/ directory where a new
libosmo-gprs-common.la private static library is created.
This is done in order to be able to resuse the QoS dec/enc code in
several libraries since it's actually planned to use it in SNDCP and SM
layers.
The most natural place to add the APIs is SM, and that's where the
public API to accees the enc/dec is provided, since the user app will
have to use them in the SM SAP.
However, the SNDCP will also have to decode the QoS recived by SM
through the SNSM SAP, and we don't really want libosmo-gprs-sndcp depend
on libosmo-gprs-sm. This way libosmo-gprs-sndcp will be able to use the
private APIs directly in a follow-up commit.

Change-Id: I6c0676e55bb1f0f424f41d8d04d4f5e5bf376f4f
2023-07-28 13:49:46 +02:00
Pau Espin 5e205c8375 Introduce libosmo-gprs-sm
This patch itnroduces all the boilerplate required to build and package
a new libosmo-gprs-sm.so library, which aims to contain the SM layer
implementation.
A minimal implementation is provided together with a unit test,
showcasing Activation of a PDP Context and requesting implicit GPRS
attach to GMM if it is not yet attached.
This commit also adds/improves code in GMM layer implementing the GMMSM
SAP which is used to interact SM<->GMM.

Related: OS#5501
Change-Id: I9b4a9a6364f7799540475e7e1d10ab2310768281
2023-03-30 13:49:29 +02:00
Pau Espin 146643b0f3 Create skeleton for libosmo-gprs-gmm
The library itself only contains a bunch of boilerplate to build the
library and have usual initialization, logging, prim APIs.
There's not yet much logic specific in it yet, but will make next
commits easier to review.

Related: OS#5501
Change-Id: Ie098576954a55e5046c2463390ab7133511c1eb3
2023-03-15 10:43:49 +01:00
Pau Espin 24a100bac8 sndcp: Initial libosmo-gprs-sndcp support
This commit follows a similar approach to Change-Id
I588eb576b2703262f4ab9566ec362920d8390cfd, this time targeting the SNDCP
layer, creating a new library for it.
This new library depends on headers from libosmo-gprs-llc since the
SNDCP spec takes the interface towards lower interfaces from same
llc_prim. It doesn't really call any API from the libosmo-gprs-llc
library to dispatch the primitive, that's left for the application, so
that it can be reused against other implementations.

Most of the SNDCP data structures and APIs are kept private and used
only internally. The Higher/lower layers are expected to interact with
it through the sndcp_prim API.

This commit also implements some of the code paths of the public API by
means on importing SNDCP code from osmo-sgsn.git commit
57b63875c762a784127a13becd1c2549ca6c5454.
The import of code cannot be done in a separate commit since existing code
in osmo-sgsn.git is low quality and has tons of layer violations in all
directions.
Hence, this commit aims at being an initial point of having some working
SNDCP stack by means of a few unit tests, but by no means aims to be a
total working implementation. Some code paths are missing; bugs are
expected at this point.

Change-Id: Ie05b5d721cf0a6147ed45c1feb75ad829865252b
2023-01-04 14:54:04 +00:00
Pau Espin 1868001ee0 llc: add libosmogsm dependency
libosmogsm is needed for the follow-up patch [1].

Change-Id: Iee45fb87905ea29df02a48003396bde27e6c550c
Related: [1] I588eb576b2703262f4ab9566ec362920d8390cfd
Related: OS#5502
2022-12-21 03:46:08 +07:00
Vadim Yanitskiy 4f1ee42c60 Add -Werror=implicit-int -Werror=int-conversion -Werror=old-style-definition
... if --enable-werror is used

Change-Id: I6d37291f66afacfc2d9cb7133f7240bbf87c0003
2022-11-05 03:52:41 +07:00
Vadim Yanitskiy 19799d106e tests: reorganize llc/rlcmac specific dirs and files
Change-Id: I8592cea020dbbf64940266cd6af14b14d34be3a6
2022-09-22 01:02:21 +07:00
Vadim Yanitskiy c1ca5406bc llc: implement LLC PDU codec based on code from osmo-sgsn.git
osmo-sgsn.git 13ccbc1e6120fe78f6f9f950d7242090920ca41b

Change-Id: I61d7e2e6d0a8f2cdfc2113e637e447dc428cc70d
2022-09-22 00:56:15 +07:00
Vadim Yanitskiy 2639b78795 Initial libosmo-gprs-llc library skeleton
Change-Id: Ia537acc6f4e6ab576dc7959d427b80f62c474296
2022-09-02 00:58:05 +07:00
Vadim Yanitskiy 74ec6d9cb6 rlcmac: add osmo_gprs_rlcmac_decode_si13ro()
Change-Id: Ic8446509ef474b8496e5557aab3d2a9e94e11897
2022-08-24 21:15:56 +07:00
Vadim Yanitskiy 931b64ee79 rlcmac: split gprs_rlcmac.c onto ts_44_{060,018}.c
Change-Id: I2b941f06a70a25e92ba3fd2638f87360a5aa5435
2022-08-24 21:03:51 +07:00
Vadim Yanitskiy 3653ef2d50 configure: generate libosmo-gprs.spec from libosmo-gprs.spec.in
Change-Id: Ie15c136d9f1919da0217b17d1afa9268f7ceaab1
2022-08-18 09:16:18 +00:00
Vadim Yanitskiy 5715dd5d7c configure.ac: do require unused dlopen
Change-Id: Iaf9729156ace5f8dc9134094ab3c0a185c7184d5
2022-08-18 08:36:31 +00:00
Vadim Yanitskiy 03c0a14c7a tests: adopt RLC/MAC tests from osmo-pcu.git
Change-Id: I8cb5364b7311e004c2afc9438cbfac8d43c86cf7
2022-08-07 17:51:26 +07:00
Vadim Yanitskiy ed06cbbfbc libosmo-gprs-rlcmac: check-in PDU definitions from osmo-pcu.git
This commit introduces a new library called 'libosmo-gprs-rlcmac',
which is going to be used by osmo-pcu and osmocom-bb for parsing
and generation of PDUs defined using CSN.1 (see 3GPP TS 24.007).

The actual RLC/MAC definitions are imported from osmo-pcu.git [1].

Change-Id: Ic322543e6d9a870beec83fa1166352e4a51366e7
Related: [1] osmo-pcu.git 0eaa3d379828517b5478d0202a26f6f3eb561a4e
2022-08-07 17:51:26 +07:00
Vadim Yanitskiy 40f95ed7c4 libosmo-csn1: check-in CSN.1 codec from osmo-pcu.git
This commit introduces a new library called 'libosmo-csn1', which
is going to be used by osmo-pcu and osmocom-bb for parsing and
generation of PDUs defined using CSN.1 (see 3GPP TS 24.007).

The actual CSN.1 codec is imported from osmo-pcu.git [1].

Change-Id: Ib195d1e2a53aead4f89c799cef1e5f1be110aad9
Related: [1] osmo-pcu.git 0eaa3d379828517b5478d0202a26f6f3eb561a4e
Depends: libosmocore.git Ie8c0effb764547a0f9cc8c6825e11a6617501e95
2022-08-07 17:51:26 +07:00