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
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
Previous SI10 patch added function without exposing it via public header.
Let's fix this.
Fixes: 600d4eeab7
Change-Id: Ia7530e9c8a21f6f99f3aac7baea5cbb38763c4f3
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
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
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
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
C/C++ only implements a so called "truncated modulo" function. Lets also
add a floored and an euclidian modulo function to be more complete.
The functions will be used to generalize the following Change:
I5fb2b0ada8d409730ac22963741fb4ab0026abdd
Change-Id: If61cd54f43643325c45f64531c57fe4c5802a9cf
So far ctrl interface did not allow to specify port to bind to.
Let's fix this and make it consistent with the way vty bind works.
N. B: the functions which ignore port configured via vty are marked as deprecated,
the sw which uses them should be ported to either newly added ctrl_init_default()
or simplified ctrl_interface_setup()
The similar change for vty interface will be addressed via separate patch series.
Related: OS#5809
Change-Id: I0fd87fd41fd3ac975273968d24f477daa3cd3aa9
The problem with most of the existing gsm0808_* functions in this file
is that they assert() too much, assuming that their callers always pass
perfectly valid input parameters. But this is impossible on practice,
as there can be bugs in complex projects using them, liks osmo-bsc.
It was reported by a customer that a heavily loaded osmo-bsc crashed a
few times, dropping more than 100 sites without network coverage for
a few minutes. As was revealed during the investigaion, it crashed
due to a failing assert at the end of enc_speech_codec():
OSMO_ASSERT(sc->cfg == 0);
The problem is that somehow osmo-bsc is passing an unexpected sc->cfg
value to gsm0808_create_ass_compl2(), in particular 0x02, while the
given sc->type value (GSM0808_SCT_HR1) implies that there cannot be
any configuration bits on the wire.
The reason why and under which circumstances this can be happening
is not clear yet, but what we agreed on so far is that the library
API should be enforcing correctness of the input parameters in a
less agressive way, rather than aborting the process without
letting it any chance to recover.
Modify the original gsm0808_enc_speech_codec[_list]() functions, so
that a negative value is returned in case of an error. Rename them
and add backwards compatibility wrappers, because it's public API.
A separate patch making use of the new API follows next.
Change-Id: I199ffa0ba4a64813238519178155dfc767aa3975
Related: SYS#6229
We've started to encapsulate a varieth of ISDN related formats
as sub-types to GSMTAP_TYPE_E1T1 for quite some time. Let's add
some more formats, such as V5EF, V.110, V.120, X.75 and H.221
For the HDLC based V5EF, V.110, V.120 and X.75 the payload format is
clear. For V.110 and H.221 we will need to specify how the actual
payload looks like.
Change-Id: I8dee0f730cf91d6f9133d5c57f653e669ec8d598
The newly-introdiced pragma to disable strict-prototypes checking works
in C, but creates a -Werror=pragmas error in C++ code:
In file included from osmo-trx.cpp:45:
/build/deps/install/stow/libosmocore/include/osmocom/vty/logging.h:10:32: error: option
‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ [-Werror=pragmas]
#pragma GCC diagnostic ignored "-Wstrict-prototypes"
So let's also suppress those errors for that one line of code...
Change-Id: I85596cf4538d7a8c522f4bce1620a2d19e2a910e
Since March 15th 2017, libosmocore API logging_vty_add_cmds() had its
parameter removed (c65c5b4ea0). However,
its declaration in C file didn't contain "(void)", which meant the
number of parameters is undefined and thus compiler doesn't complain.
However, in recent Change-Id I84fd99442d0cc400fa562fa33623c142649230e2
we changed the declaration to '(void)' to allow building with
-Wstrict-prototypes. This caused downstream build-failures of osmo-mgw (1.4.0)
and osmo-e1-recorder (master).
So let's make one very small-scoped exception here.
Change-Id: Iadb54848b67db937b640dc2102dddb6e708a6a9f
Unfortunately "-std=c99" is not sufficient to make gcc ignore code that
uses constructs of earlier C standards, which were abandoned in C99.
See https://lwn.net/ml/fedora-devel/Y1kvF35WozzGBpc8@redhat.com/ for
some related discussion.
Change-Id: I84fd99442d0cc400fa562fa33623c142649230e2
Those are similar to existing *msgb_alloc*() functions but allows
to change the size of destination msgb provided it fits the
data from source msgb.
Change-Id: I36d4c16241d19f0f73c325be4d0e0bdef6813615
Signed-off-by: Max <msuraev@sysmocom.de>
The macro msgb_sms() is basically an alias for msgb_l4(). Lets use
msgb_l4() in msgb_l4len() instead of msgb_sms().
Change-Id: I90d4f5c07fbaadd9e022752a2c64c4855f0b4227
When any of l1h, l2h, l2h or l4h is set to NULL (which is the default
for newly allocated message buffers). Then the msgb_lXhlen() functions
will return the address value of msgb->tail. This can lead to unexpected
results at a later point. We should have an OSMO_ASSERT to catch the
problem early.
Change-Id: I1795c559f190713ebbabfbabf3453ab77da46a49
Related: OS#5645
This makes it possible to pass expressions to the abovementioned
macros without any side-effects. Strictly speaking, this is only
necessary for argument 'b' of GSM_TDMA_FN_SUB, but let's also add
them to GSM_TDMA_FN_SUM for consistency.
Change-Id: I7f26156813139bbb7774e1eb342c91bc84fdad38
While at it, drop 8-1 in favour of 7. I don't think it is really more
understandable for readers to see some subtraction there...
Change-Id: I8b21eba9b9aa952f86abe7a6d4cdb1d1a61d9deb
This reverts commit a4063efa7d.
Reason for revert: It is not possible to guess the IP address
family from uninitialized memory. This function simply glorifies
random noise into an IPv6 address. It makes no sense to have it.
Change-Id: Ifadd614604cf9d0c2ed1a405493c1c3fcb37ae23
This reverts commit e145e28a91.
Reason for revert:
The function osmo_sockaddr_strs_to_str() should not be part of the
osmo_sockaddr_str API. The implementation of this should live in
the function multiaddr_snprintf() added in patch
Icef53fe4b6e51563d97a1bc48001d67679b3b6e9
and should not use dynamic allocation.
Change-Id: I263dfd68313b896c5b474025fbca13c22ce41cdc
Sometimes we receive generic "struct sockaddr" with unspecified (AF_UNSPEC)
address family. It's handy to try to guess
the proper address (there're just 2 variants ATM in most practical applications).
Use the added function to relax input checks in osmo_sockaddr_str_from_in*()
Related: OS#5581
Change-Id: I1c90c56ce832f53b65e0d18d3cea94621c02a69a
This is similar to what we already do between BSC<->MSC to pass Osmux
CID (GSM0808_IE_OSMO_OSMUX_CID).
We now want to support Osmux between BSC and Osmocom BTS, hence add an
extension IE which will be used in ipaccess CRCX messages to tell the
BTS to use Osmux.
Change-Id: I580fe99c01bc0a844d877994ec6cd954310e265d
This feature is used by the BTS to signal to the BSC that it supports
using Osmux instead of RTP on the BTS<->BSC(MGW) data plane.
Related: SYS#5987
Change-Id: Ie79bfb6d0a7a8fe2842d2596b3244e7b74a0d5b6
I was warned by gcc about comparing a pointer with an integer when using
TLVP_PRESENT with something like:
bool expect = ...;
if (expect != TLV_PRESENT(...))
That's indeed dangerous because TLV_PRESENT is considered to return a
boolean, as opposite to TLV_VAL.
Change-Id: I45cc2745c695e30c37b10f592903ec3775a55492