aboutsummaryrefslogtreecommitdiffstats
path: root/include
AgeCommit message (Collapse)AuthorFilesLines
2023-02-04Add SI10 supportMax1-0/+14
Add data structures and checks for System information Type 10. Related: OS#5783 Change-Id: I3a5da543f083f31e873c67b5ec1b5a439187d8f3
2023-01-31gsm_08_08.h: fix typo in GSM0808_DATA_FULL_PREFOliver Smith1-1/+2
Change-Id: I25f46bf3893bb68203414300587756cf2fdb04f7
2023-01-30SI: add missing headerMax1-0/+1
Previous SI10 patch added function without exposing it via public header. Let's fix this. Fixes: 600d4eeab71665c0aec0a11a226d231f109534ca Change-Id: Ia7530e9c8a21f6f99f3aac7baea5cbb38763c4f3
2023-01-25Introduce tundev APIPau Espin Pedrol2-0/+44
The data structre is held private so that it can be easily extended in the future. Change-Id: I6f8324da9ba49b9249682e2ec5b45297f18dd8c2
2023-01-25Introduce netdev APIPau Espin Pedrol2-0/+50
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
2023-01-25SI: add RR short PD message typesMax1-0/+15
Related: OS#5783 Change-Id: Ifbd0aabe826298fa4715eb4eb2ff8363e765933d
2023-01-25ASCI: add VBS/VGCS support to BTS features listMax1-0/+2
Related: OS#5783 Change-Id: I583a170070c192c6c47fae41ce923a7439561b4f
2023-01-24Introduce netns APIPau Espin Pedrol2-0/+25
Write a new API and implementation to manage network namespace related operations. This will be used by the upcoming tundev module. Change-Id: I0f2fba2fa42250a07211a7b7f479498f27c529da
2023-01-21create libosmoisdn sub-libraryHarald Welte6-291/+301
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
2023-01-18Split include/Makefile.am content into subdirsPau Espin Pedrol14-225/+292
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
2023-01-17socket.h: Introduce API osmo_sockaddr_netmask_to_prefixlen()Pau Espin Pedrol1-0/+2
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
2023-01-12uitils: add floored and euclidian modulo functionsPhilipp Maier1-0/+12
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
2023-01-09libosmocore: Deprecate APIs telnet_init(_dynip)()arehbein1-2/+6
Related: OS#5809 Change-Id: Ibd05d3bc2736256aa45e9e7ec15a98bd14a10454
2023-01-02gsm48_ie: gsm48_decode_freq_list(): make 'cd' argument const2023q1Vadim Yanitskiy1-2/+3
Change-Id: Ide9110b984d3302aec6b439c563eb10e2dcdec9e
2022-12-20ctrl: add optional port to bind commandMax2-3/+9
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
2022-12-14gsm0808: add gsm0808_enc_speech_codec[_list]2()Vadim Yanitskiy1-3/+8
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
2022-12-02gsmtap.h: Add definitions for various ISDN sub-typesHarald Welte1-0/+5
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
2022-11-24gsm: constify several readonly paramsPau Espin Pedrol2-3/+3
Change-Id: Ib11bfe57f546a5618f70152b9b75115808e54bf6
2022-11-20Add define for unset Frame NumberMax1-0/+1
It's handy for OsmoPCU as well as upcoming LAPD T200 code. Related: OS#4074 Change-Id: I641f1a1bf1e86ced8ffe89e88bc48afb79823393
2022-11-07vty/logging.h: Avoid -Werror=pragmas error in C++ codeHarald Welte1-0/+1
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
2022-11-06Disable -Wstrict-prototypes for logging_vty_add_cmds()Harald Welte1-1/+6
Since March 15th 2017, libosmocore API logging_vty_add_cmds() had its parameter removed (c65c5b4ea075ef6cef11fff9442ae0b15c1d6af7). 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
2022-11-03Support building with -Werror=strict-prototypes / -Werror=old-style-definitionHarald Welte6-11/+11
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
2022-10-25msgb: introduce extended copy functionsMax1-0/+2
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>
2022-10-16logging.h: Allocate DLM2PA and DLM2UA for libosmo-sigtranHarald Welte1-1/+3
Change-Id: I106b7586bfe8ee03c052b6f8b33da4c466e05abd
2022-10-16allocate VTY port number 4270 for osmo-isdntapHarald Welte1-0/+1
osmo-isdntap is a ISDN protocol + call tracing utility currently under development, see https://gitea.osmocom.org/retronetworking/osmo-isdntap Change-Id: I25ca4565e326ee9b0b32eeabc4a76756e2fde4ac
2022-10-11cosmetic: remove trailing spaceMax1-1/+1
Change-Id: Ibecfcccd3eabd81979b2296a2dbca1ffbbec8f1c
2022-10-06msgb: do not use msgb_l4 instead of msgb_smsPhilipp Maier1-1/+1
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
2022-10-06msgb: assert msgb->lXh to be not NULLPhilipp Maier1-0/+4
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
2022-10-04socket: Introduce API osmo_sockaddr_is_anyPau Espin Pedrol1-0/+1
Change-Id: I2810a889fc14052d0e0be6a2b500ad4e5088ffa9
2022-10-04socket.h: Reorder sockaddr APIs to have them all togetherPau Espin Pedrol1-25/+25
Change-Id: Iab2ee2854be8027ee5978e06a83248b530a39bf7
2022-10-04gsm0502: use parentheses in GSM_TDMA_FN_{SUM,SUB} macrosVadim Yanitskiy1-2/+2
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
2022-09-29include: use '#pragma once' everywhereVadim Yanitskiy5-20/+5
Change-Id: Iecc1754caae401aca28444d3e3d0cca04b398f26
2022-09-28gb: add bssgp2_enc_flush_ll encode FLUSH-LLAlexander Couzens1-0/+2
Change-Id: I76dc3b08a63cfd78c9f7657fb58c2ddfa9b4b7e2
2022-09-25comments: gsm_08_08.h: AMR cfg: explain in much more detailNeels Hofmeyr1-5/+48
Change-Id: I1864a6beeeedc301c6dc7e2e0c52a3f94b2fef01
2022-09-08utils.h: protect param with parenthesis in OSMO_BYTES_FOR_BITS()Pau Espin Pedrol1-1/+1
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
2022-08-17Revert "Add function to guess AF_UNSPEC address"neels1-1/+0
This reverts commit a4063efa7deb6632c228037c47effca22ad0f781. 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
2022-08-17Revert "Add osmo_sockaddr_strs_to_str()"neels1-9/+6
This reverts commit e145e28a91eeca65d34d7b82caa2190fa89492b4. 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
2022-08-14Add osmo_sockaddr_strs_to_str()Max1-6/+9
This will come in handy for working with multihomes sockets like SCTP. Related: OS#5581 Change-Id: Ic0d7c08f669994e37a2314555ecac85d28c42c89
2022-08-09Add function to guess AF_UNSPEC addressMax1-0/+1
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
2022-08-09gsm: rsl: Define new osmocom extension TLV IE to pass Osmux CIDPau Espin Pedrol1-0/+1
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
2022-08-09gsm: Add BTS feature for OsmuxPau Espin Pedrol1-0/+1
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
2022-08-08tlv.h: Fix TLVP_PRESENT returning a pointer instead of a booleanPau Espin Pedrol1-1/+1
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
2022-08-08cosmetic: tlv.h: Fix trailing whistespacePau Espin Pedrol1-2/+2
Change-Id: Ief318882def539b35ef15c85566f69220e7edbfe
2022-08-08enrich API doc for gsm0808_speech_codecNeels Hofmeyr1-1/+6
Change-Id: Iee52f38c1040b7f7ee37aaa58cfdb0cb6cf33f4d
2022-08-04logging: add a new category DLCSN1 for libosmo-csn1Vadim Yanitskiy1-1/+2
This new category is going to be used by CSN.1 codec in libosmo-csn1. Change-Id: Ie8c0effb764547a0f9cc8c6825e11a6617501e95
2022-07-29fsm: osmo_fsm_{event,inst,state}_name(): make *fi pointer constVadim Yanitskiy1-3/+3
Change-Id: I98cde213deb5a3bf39eb9f5e5451f40223632844
2022-07-25gsm_23_041.h: Define CBS ETWS Warning Type valuesPau Espin Pedrol1-0/+10
Change-Id: I3a5bb9b2c77b8e4a984631d199fc073183691c31
2022-06-09cbsp: Add enum and value string for CausePau Espin Pedrol1-1/+25
Change-Id: I35592bb4fff2e7b442d0e0cd537b66687862baf2
2022-05-27coding: add gsm0503_detect_a[fh]s_dtx_frame2()Vadim Yanitskiy1-2/+9
The new functions accept an additional mode_id poiner, which is currently set for the following frames: AFS_ONSET, AHS_ONSET, AHS_SID_FIRST_P2 with N * 16 - M bit pattern. Also, the new API accepts soft-bits instead of hard-bits. Converting bits from soft to hard is now performed internally. Change-Id: Ibcac395f800bb64150c97fcdaca3523ecfc5fcee Related: OS#5570
2022-05-25cosmetic: iuup.h: Fix indentationPau Espin Pedrol1-3/+3
Change-Id: I10a2d2a872fd6fdae8b4af94995300af3144b551