aboutsummaryrefslogtreecommitdiffstats
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2023-02-07Bump version: 1.7.0.119-b31a-dirty → 1.8.01.8.0osmith/1.8.1Pau Espin Pedrol6-6/+6
Change-Id: I5e953cedc041371a9c192f58348b673a787f542e
2023-02-04Add SI10 supportMax1-1/+1
Add data structures and checks for System information Type 10. Related: OS#5783 Change-Id: I3a5da543f083f31e873c67b5ec1b5a439187d8f3
2023-02-02gprs_ns2_fr: use osmo_netdev to monitor and operate network devicePau Espin Pedrol4-138/+65
As a result libosmogb doesn't depend directly on libmnl anymore, but through libosmocore. Change-Id: Ib0e499e09c50135a5c4a361332d6120f660a1a45
2023-01-30SI: add missing headerMax2-1/+2
Previous SI10 patch added function without exposing it via public header. Let's fix this. Fixes: 600d4eeab71665c0aec0a11a226d231f109534ca Change-Id: Ia7530e9c8a21f6f99f3aac7baea5cbb38763c4f3
2023-01-26tun: Fix potential unpaired call to osmo_netns_switch_exit()Pau Espin Pedrol1-1/+2
Fixes: Coverity CID#307429 Change-Id: Iadfc9eb48c6342433eee8da3e4d00ee496df3c75
2023-01-25netdev: Fix compilation building with --disable-libmnlPau Espin Pedrol1-1/+31
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
2023-01-25Introduce tundev APIPau Espin Pedrol2-0/+572
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/+906
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/+23
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/+209
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-21isdndlc: Fix documentationHarald Welte1-4/+3
The documentation was copied 1:1 from the Linux kernel, where it already was wrong and apparently described an earlier implementation. Change-Id: Ib5def2ae3c79f408f2ee0bb4c20fba1437d30c64
2023-01-21create libosmoisdn sub-libraryHarald Welte6-5/+55
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-18Fix all references to config.hPau Espin Pedrol27-27/+29
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
2023-01-18Makefile.am: Remove unexsiting all_includes variablePau Espin Pedrol4-4/+4
Change-Id: I9bc7de6f85558e55265c6cc965bc7fe97a6736ee
2023-01-18src/core/Makefile.am: reformat SOURCES listPau Espin Pedrol1-23/+62
Have one per line and order items in an alphabetical order. Change-Id: Ib14396e9a1a744cdad2f35f7241eb2ab3212c0cb
2023-01-18Move src/*.{c,h} to src/core/Pau Espin Pedrol70-118/+132
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
2023-01-17socket.h: Introduce API osmo_sockaddr_netmask_to_prefixlen()Pau Espin Pedrol1-0/+57
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-12gsm_utils: improve gsm_gsmtime2fn()Philipp Maier1-2/+13
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
2023-01-11ctrl: error if program forgot to initialize the ctr handler before ↵Pau Espin Pedrol1-0/+10
installing cmds Change-Id: Icf3873f33470499fed3150ff51922a36aa0f023e
2023-01-09libosmocore: Deprecate APIs telnet_init(_dynip)()arehbein1-20/+28
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 commandMax3-3/+27
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-19rate_ctr: drop rate estimation codeMax1-5/+0
Drop the code which tried to estimate the value for the next timeframe: it accumulated error over time which only adds confusion. N. B: this means that long-term intervals (day, hour) will show the rate of 0 until corresponding timeframe passes. This matches how other monitoring software [1] behaves. [1] https://learn.netdata.cloud Fixes: OS#5671 Change-Id: I07232e9ff8bd62403ae82d9bd60d967d40b54ebc
2022-12-14gsm0808: use new gsm0808_enc_speech_codec[_list]2() APIVadim Yanitskiy1-24/+84
The motivation behind adding and using the new API is explained in the preceeding change [1]. Whenever any of the encoding functions fails to encode either a Speech Codec or a Codec List IE, free() the msgb and return NULL. Change-Id: I28219b61b9347f0652f9fd0c717f6cdf3c63e8f9 Related: [1] I199ffa0ba4a64813238519178155dfc767aa3975 Related: SYS#6229
2022-12-14gsm0808: add gsm0808_enc_speech_codec[_list]2()Vadim Yanitskiy2-22/+53
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-14gsm0808: remove over-defensive assert()s for function parametersVadim Yanitskiy1-29/+0
I believe the gsm0808_* API is mature enough to avoid assert()ing pointers accepted via function parameters. We can assume the caller never passes NULL, as we do in almost all public API. Change-Id: If9b4c92ace68191f5ddcc0a8a340fccbfe0f3dc0
2022-12-14gsm0808: remove redundant assert() in enc_speech_codec()Vadim Yanitskiy1-1/+0
This assert can be dropped because the switch statement above does not leave any sc->type >= 0x0f for type_extended == false. Change-Id: Iafb45ed66378f2c9c2480f81371e92c6d1da71a7
2022-12-14gsm0808: remove unneeded assignment in enc_speech_codec()Vadim Yanitskiy1-1/+1
Change-Id: Ifc6d109e27cdada0d08d2a8fc1c354f3de04f15c
2022-12-14gsm0808: cosmetic: switch is not a functionVadim Yanitskiy1-1/+1
Change-Id: I2f58711675c5c9511c4f4fe4bf0d6e6f7dd093b1
2022-12-05rate_ctr: convert to timerfdMax1-12/+46
Use timerfd to schedule 1-second periodic timer once instead rescheduling every second in timer callback. Related: OS#5671 Change-Id: I2525fd691caa380a862d305cfcb4fa3cc50b70d0
2022-12-04telnet_init_dynif: don't allow negative portMax1-0/+3
Binding to a negative port should not be allowed. Using signed value for unsigned parameter is a mistake to begin with. Change-Id: I24f957641f2d8e230ccceb331a719496df0fdb1f
2022-12-04telnet_init_dynif: propagate errorMax1-1/+1
Return actual error from osmo_sock_init_ofd() to the caller. Change-Id: Ib09f4315b3868ec031ecbced8a63069e7c2de7da
2022-12-04vty: fix doc typoMax1-1/+1
Change-Id: I9f1112fc27dfe967b4a007648ddda1050e9bd9fa
2022-11-28osmo_tdef_get(): clarify API doc on val_if_not_presentNeels Hofmeyr1-1/+3
Change-Id: I2301aad86d6d165a3b51c6849bcd8fe02972e0a3
2022-11-26LAPD: move tx_hist code into static functionsMax1-20/+22
Related: OS#4074 Change-Id: Ibf3b08c8d874416796b94ba3a672a02d614313b1
2022-11-24gsm: constify several readonly paramsPau Espin Pedrol2-2/+2
Change-Id: Ib11bfe57f546a5618f70152b9b75115808e54bf6
2022-11-10*/Makefile.am: do not mix up AM_CFLAGS with AM_CPPFLAGSVadim Yanitskiy5-10/+11
Change-Id: I2c1d5f9c61714f487fbbe60603b2682f2c0a4c6b
2022-11-09Fix typos in copyright statements.Harald Welte3-3/+3
Change-Id: I783c56bb1d216ce3a47a19da230ee5f50aca2ab3
2022-11-04bits: fix typoPhilipp Maier1-2/+2
Change-Id: I3d6c30ffffdfe981f50cb755104b033b62e6b0c0
2022-11-03Support building with -Werror=strict-prototypes / -Werror=old-style-definitionHarald Welte8-12/+12
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-27gb/vty: Show if NSVC is blocked locally by O&M/vty or by remotearehbein3-15/+19
Related: OS#5085 Change-Id: I0e8a12c3e54b701c9e697d50de1c9cb0bcc817e0
2022-10-26gsm0502: gsm0502_fn_remap(): use GSM_TDMA_FN_SUB() macroVadim Yanitskiy1-4/+1
Change-Id: Id77644d945ad195733d4bf68c0d1c5b450b16e58
2022-10-25msgb: introduce extended copy functionsMax1-10/+44
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-20{gsm,gb}/Makefile.am: drop undefined $GCC_FVISIBILITY_HIDDENVadim Yanitskiy2-2/+2
Change-Id: I142cf38e8954720ed66b0c242a5527c96626dcaa
2022-10-19doc: correct typo in ticket referenceMax1-1/+1
The OS#4993 has nothing to do with AF_PACKET/ENOBUFS, the proper ticket is OS#4995 as referenced later in the same file. Change-Id: Icf13b351dc74508fc312c535d68b13b7ce9b7e1e
2022-10-11LAPD: use bool for T200 reset flagsMax1-2/+4
Related: OS#4074 Change-Id: I2d1a3dd7938b079a3525c84647f82b7bc6cdfdd6
2022-10-11LAPD: log unknown format valueMax1-1/+1
Change-Id: I9efd433ed128ae1d9df45591b1a93e10f8a3372c
2022-10-11cosmetic: make linter happy with LAPD codeMax1-4/+2
The weird formatting not only makes it hard to read but caused linter to fail in the follow-up patch. Change-Id: Ie4e56b4796c1b8f270a692453faccf102c963db5
2022-10-06Fix Typo in gsm0808_msgt_names[]Keith Whyte1-1/+1
Change-Id: I91585d81efd6e18f4b8f9eaeaaaa50412253d93b