Let's disambiguate. Our existing OSMO_AUTH_ALG_XOR was always only
the XOR-3G algorithm. Now that we recently introduced XOR-2G,
let's rename (with backwards compatibility #define).
Change-Id: I446e54d0ddf4a18c46ee022b1249af73552e3ce1
We've so far only been supporting XOR-3G algorithm as specified
in TS 34.108 (in both 3G and 2G-derivation mode).
However, XOR-3G used for 2G auth is different from the XOR-2G algorithm
as defined in Annex A of TS 51.010-1. Let's add support for that one,
too.
Change-Id: I0ee0565382c1e4515d44ff9b1752685c0a66ae39
According to 3GPP TS 48.008 V16.0.0 § 3.2.2.11, the "Channel and rate
type" fills the whole octet 4, so don't cut it off.
This fixes decoding of e.g. GSM0808_SIGN_FULL_PREF_NO_CHANGE, which I
noticed while writing a test.
Related: OS#5911
Change-Id: Ib5fba18eb82736c4f52f315ae1197159b7090e69
Currently there's a big mess where include dir osmocom/gprs/ is used by
both libosmogsm and libosmogb.
Most of the header files under osmocom/gprs/ are actually all the
headers of libosmogb (there's no osmocom/gb/ dir). But a couple files
are actually RLC/MAC (TS 44.060) related are are also stored in there.
Those files have no relation/use in Gb, and are actually interused with
GSM (eg System Information 13 Rest Octets).
Hence, it makes sense to have the RLC/MAC related parts inside
osmocom/gsm/ as they should be in libosmogsm (and they actually are,
see gprs_rlc.h function implemented in src/gsm/gsm48_rest_octets.c).
The fact that some libosmogsm headers were placed in osmocom/gprs
instead of osmocom/gsm already created some issues, like
libosmocore.spec.in putting "%_includedir/%name/osmocom/gprs/" under
libosmogb, which is wrong.
As a first step to fix the mess, we move the 2 RLC/MAC headers currently
under osmocom/gprs/{gprs_rlc,protocol/gsm_04_60}.h under a single header
gsm/protocol/gsm_44_060.h
The two old headers are left existing for backward compatibility and now
simply include the new libosmogsm header, plus a warning asking users to
switch to the new header so we can eventually get rid of them.
This means libosmogb depends on libosmogsm, which is fine and was
already the case beforehand (libosmogb using functions like
gsm48_encode_ra() and linking against it in src/gb/Makefile.am).
Change-Id: I70cc21bf25a7081070738abacb409ed19094c3b2
Those allow selecting source host:port for UDP socket sending GSMTAP data.
It's handy when you have several GSMTAP sources operating simultaneously.
Change-Id: I51b3604ba79e42c474aa17007e7e308a12afcea8
There may be situations where we must check if there are still I.460
subchannels active, so lets make the function osmo_i460_subchan_count
public
Change-Id: I0454ffe5809f21504c1e263a781c06596d452d4b
Related: OS#5198
Rename contrib/struct_endianess.py to contrib/struct_endianness.py, and
fix the typo everywhere. This is in preparation to call the script in
CI on all repositories.
Related: OS#5884
Change-Id: Idc4af9098ba1de26243464c772d6ea8be330646a
When a user reports a memory leak with a talloc report, this script is
useful to quickly get a handle of what is being leaked. The alternative
is eyeballing the talloc report for a very long time.
Change-Id: I5b3242dd6e0649925ac6abfd1e96625c682b8934
Add it, so a follow-up patch can use it in gsm0808_dec_channel_type
where 3GPP TS 48.008 § 3.2.2.11 refers to "if octet 3 indicates speech
or speech + CTM Text Telephony".
Related: OS#4393
Change-Id: Iaf12202c89b68290c2121bc016d08b9200a7278a
Stop iterating if the extension bit (0x80) is set but elem is too short
to read another byte.
Related: OS#4393
Change-Id: Id37109dba0f5d40f4b83f0cef9b1dbd9d6bb2c68
Previous SI10 patch added function without exposing it via public header.
Let's fix this.
Fixes: 600d4eeab7
Change-Id: Ia7530e9c8a21f6f99f3aac7baea5cbb38763c4f3
Let libosmocore-dev depend on libmnl-dev, as we build the debian package
without --disable-libmnl and so libosmocore.pc lists libmnl in requires.
This patch should fix the following error when trying to build any
debien package depending on libosmocore-dev:
Package 'libmnl', required by 'libosmocore', not found
A similar change in the rpm spec is not be needed, as rpm adds depends
from pc files automatically.
Fixes: 4eb89afa ("configure --enable-libmnl: Add libmnl to libosmocore.pc.in Requires")
Change-Id: I7fd578fcc22c0ea6ac04bdc26dc1741e4e26767c
netdev.h doesn't expose its use of libmnl publicly. It could actually be
implemented using other subsystems internally, such as ioctl() or other
OS-dependent APIs.
Hence, if --disable-libmnl is used, still make the API available but
make it fail with -ENOTSUP on functionalities which are only implemented
through libmnl so far.
Change-Id: I62bdea075afb9e0cc2bbcec6dd3a930e8f7bbc40
This module provides several operations on network devices
(interfaces), like monitoring changes, setting addresses, routes, link
state, etc.
It also supports managing network interfaces on several different netns
concurrently.
These functionalitites will be used by the tun module included in a
follow-up patch.
Change-Id: I7a00c0445a89e088676a4897061b65196d9197f1
Write a new API and implementation to manage network namespace related
operations.
This will be used by the upcoming tundev module.
Change-Id: I0f2fba2fa42250a07211a7b7f479498f27c529da
The documentation was copied 1:1 from the Linux kernel, where it
already was wrong and apparently described an earlier implementation.
Change-Id: Ib5def2ae3c79f408f2ee0bb4c20fba1437d30c64
There are some parts of libosmogsm which are not really GSM specific,
but rather ISDN bits that were inherited by GSM. This includes the
I.460 multiplex as well as the core LAPD protocol.
Let's move those bits to its own libosmoisdn library, before we add
more ISDN specific bits to the wrong place.
Backwards-compatibility is created by making libosmogsm depend on
libosmoisdn, and by providing wrapper include files for source
compatibility.
Change-Id: Ib1a6c762322fd5047be3188b1df22408ef06aa50
config.h is created in $(top_buildir)/config.h.
Let's make sure all CPPFLAGS add correct -Ipath includes,
and that all code includes the correct file.
Change-Id: Ie9ea38bb009bc715b01cde4d66d181f7bec2e7bd
When someone is modifying a given library there's no need to be looking
at a common file contains tons of lines from different libraries.
Furthermore, this removes the need of "nobase" autofoo prefix, hence
following the usual directive of having one Makefile per directory.
Change-Id: I785891c2f89114bf8303c799094b637d3d25ac71
This way we have all libosmocore.so in an own subdir instead of having
lots of files in the parent dir, which also contains subdirs to other
libraries.
This also matches the schema under include/osmocom/.
Change-Id: I6c76fafebdd5e961aed88bbecd2c16bc69d580e2
Implementation is imported from osmo-ggsn.git
97f60e3dca581797007524e0006ca9fafad59713 in46a_netmasklen() and adapter
to work with an osmo_sockaddr.
This will be used by osmocom-bb's "modem" app.
Change-Id: I75e75e251c6776801fffdde745aebedf21c68799
The function gsm_gsmtime2fn() uses a hack to account for the truncated
modulo implementation of C/C++. libosmocore offers proven modulo
functions, so lets use OSMO_MOD_FLR() instead. Also arrange the formula
so that it looks more like the one in the spec.
Also add better spec references and a final modulo GSM_MAX_FN to
prevent frame number results that exceed the valid range.
Change-Id: Ibf94bca8223f1f7858a6dd67bf27de0ab6feab20