aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2020-03-16HACK: Disable the use of thread-local storagelaforge/notls-hackHarald Welte18-39/+39
This will disable the thread-safe use of many libosmo* featues, but it seems even in 2020 there are still systems out there wthat don't support thread-local-storage. Related: OS#4456 Related: OS#4062 Change-Id: I9baa7047fc4ff1a595ee318dcdb1247f1460da1b
2020-03-16usb: Add osmo_libusb_find_open_claim() all-in-one APIHarald Welte2-0/+126
This function offers the highest level of API among all libosmousb helper functions. It is intended as a one-stop shop for everything related to grabbing an interface. Change-Id: I748ded6cc7b73a73625588bd7a34a017a905b6bf
2020-03-16libosmosim: Build irrespective of PC/SC supportHarald Welte3-8/+14
libosmosim contains a variety of definitions and utility fuinctions useful when working with SIM card [protocol]. They can not only be used with PC/SC readers but also in other contexts. Change-Id: I741940d3dc2a5653c760e9d1597d7f08afb3b631
2020-03-13gsm690: Fix amr speech bit length tablePhilipp Maier2-3/+4
The table amr_len_by_ft represents the length of the raw AMR speech bits in bytes. The table is based on the Table found in RFC 4867 §3.6, Table 1, Column "Total speech bits". The number of bits is divided by 8 and then rounded up to get the number of consumed octets. An AMR SID frame (including STI and MI) takes up 39 bits, this will result in 5 octets, not in 7. Lets correct this. Related: OS#2978 Change-Id: Icf330450981b32be5d1cee5b10aa92bac4cb72f5
2020-03-10socket: Add osmo_sock_mcast_iface_set() to bind multicast to deviceHarald Welte2-0/+23
Change-Id: Ib52d22710020b56965aefcef09bde8247ace4a9c Related: OS#2966
2020-03-09conv: add convolutional coder for AMR SID UPDATE framesPhilipp Maier3-0/+28
AMR SID update frames are protected using an 1/4 convolutional coder, wich is similar to the one used with 6,7 kbit voice frames. Except that there is no puncturing and the length is different. Change-Id: Ia35ed4178a7f0d816052b7e5d6478b93a1d9744f Related: OS#2978
2020-03-09parity: add amr crc14 definitionPhilipp Maier3-0/+13
AMR not only specifies a 6 bit CRC for regular voice information. It also specifies a 14 bit CRC to protect the comfort noise updates contained in the SID_UPDATE frames. Change-Id: I5cfd8ca806aba8d42cb9787f69605cea7de6e900 Related: OS#2978
2020-03-08fixup depreciation warningHarald Welte1-2/+2
Change-Id: Id2d016939c3a6185cc3cfa8631da0c8d187a8c5a
2020-03-08gsmtap: Solve TCH / FACCH confusion once and for allHarald Welte3-13/+40
* What we used to call TCH/F and TCH/H in gsmtap are actually only FACCH/F and FACCH/H, i.e. the signaling part of Bm/Lm channels * Give them proper names with backwards compatibility #define * Split VOICE into VOICE_F and VOICE_H. If we don't differentiate this, a receiver is not able to determine the RSL channel ID of a frame without looking at external state/context. That in turn has been a design feature of GSMTAP Um format so far, and programs like osmo-bts-virtual rely on it. Change-Id: I952044a17334f35712e087dc41781805000aebc1 Related: OS#2557
2020-03-08Add CTRL port number for osmo-mgwHarald Welte1-0/+2
Related: OS#4441 Change-Id: I70ae237ea27972f6819fd217c3d5059dda009486
2020-03-08Add GSMTAP_CHANNEL_VOICE to gsmtap_gsm_channel_names[] value_stringHarald Welte1-0/+1
In Change-Id If223020933b083fe359a2e8ff5fab1ce64a363d8 we introduced GSMTAP_CHANNEL_VOICE, but we didn't add it to gsmtap_gsm_channel_names[] Change-Id: I7ab696d3e0edb13632e048a9e05be03612d3d28c Related: OS#2557
2020-03-05gsmtap.h: Add definitions for voice inside GSMTAPHarald Welte1-2/+26
We so far are only able to transmit signalling data inside GSMTAP, but not actual voice / user plane payload data. we cannot use the existing TCHF/TCHH sub-types, as those are already used [without further discrimination] for FACCH + SACCH Data on those channels. Instead, we will introduce a new GSMTAP_CHANNEL_VOICE sub-type, which then will have the first byte for a sub-sub-type specifying the payload format in detail. Change-Id: If223020933b083fe359a2e8ff5fab1ce64a363d8 Related: OS#2557
2020-03-04osmo-sim-test: check tlv_parsed struct tp before accessPhilipp Maier1-4/+8
The variable struct tlv_parsed tp in dump_file() conditionally initalized by tlv_parse() but later it is accessed under a different condition without a check that makes sure that tp is only accessed when tlv_parse() was called beforehand. Lets introduce a check that makes sure tp can not be accessed when it is uninitalized. Change-Id: I6b0209b966127a4195e6f4bcb43d49387c7646ce Fixes: CID#208435
2020-03-04gb: Print signalling and data weights on NS-VC creation.Alexander Chemeris1-1/+2
Change-Id: Ieebec5487f5d995a453d15bc024931299d5cf5bf
2020-03-04gb: Fix typos in gprs_ns.c commentsAlexander Chemeris1-2/+2
Change-Id: I24605c8616015b5f7d45297afc65d6a93d2edbaf
2020-02-28chantype_rsl2gsmtap(): Add entries for CBCHHarald Welte1-0/+6
This adds missing entries for CBCH in the conversion between RSL-style channel numbers and GSMTAP channel types. Without this change, you will see tons of messages like virtphy[19865]: Wed Feb 26 16:16:28 2020 DVIRPHY <0002> gsmtapl1_if.c:267 MS 0000: Ignoring unknown channel type UNKNOWN (0) if running virtphy of osmocom-bb with a BTS that broadcasts CBCH. Change-Id: I19bbd2942adf441f58955ac896ef968bfd8aec5f
2020-02-19bitvec: avoid redundant zero-initialization in bitvec_alloc()Vadim Yanitskiy1-1/+1
All the fields of the structure are set explicitly anyway. Change-Id: I40c0322d5f2febd98bae6fbe0ec2132eda6fb35b
2020-02-19bitvec: cosmetic: init i only once in bitvec_[un]pack()Vadim Yanitskiy1-2/+2
Change-Id: I5606ca34a72d42a9b6aafed662b995f9fa77be09
2020-02-19bitvec: fix misleading description of bitvec_spare_padding()Vadim Yanitskiy1-1/+1
Change-Id: Ie60bf7d993fe80d3c0fcd04e4c3dd81da4a2ea0b
2020-02-19bitvec: fix bitvec_unhex(): do not return 1 on successVadim Yanitskiy2-15/+12
This function is supposed to return 0 on success or 1 in case of error. However, it used to return 1 even in case of success. The reason is that length of the input string was not taken into account and sscanf() was failing on '\0'. Let's use osmo_hexparse() and rely on its return value. P.S. Funny that the unit test expectations were wrong too. Change-Id: I441a22c7964bb31688071d8bcf6a282d8c0187ff
2020-02-19tests/bitvec: add a unit test for bitvec_read_field()Vadim Yanitskiy2-0/+60
The aim of this unit test is to demonstrate the problem described in OS#4388: bitvec_read_field() can never return negative value on error (e.g. out of bounds access). Change-Id: I340ab5799fa53d5345edb02f3e2a3655527705c0 Related: OS#4388
2020-02-15osmo-sim-test: Fall-back to classic SIMHarald Welte2-20/+104
If selection of ADF_USIM fails, let's fall-back to reading/dumping a classic TS 11.11 (51.011) SIM card. Change-Id: I5a986fc65de76c24c5af52ce7e8c699cf302fda9
2020-02-15osmo-sim-test: Recurse through subdirectoriesHarald Welte1-13/+39
Don't just iterate over all files in the current working directory (cwd), but also recurse through all sub-directories. Change-Id: I737b01d9a845e37d8be9d4709ef0de04e749daec
2020-02-10bitvec: make bitvec_free() safe against NULLVadim Yanitskiy1-0/+2
Change-Id: Ifafb65e9d0adc286e16104274db440f38a86d800 Related: CID#208181, CID#208179
2020-02-09exec: propogate errors from osmo_environment_[filter|append]Vadim Yanitskiy1-4/+10
Change-Id: If7d6e0441f73092a4fb455340c076ba4dc60af3f
2020-02-09exec: prevent uninitialized memory access in osmo_system_nowait()Vadim Yanitskiy1-0/+3
If (!env_whitelist && addl_env), osmo_environment_append() would access uninitialized memory. If both are false, execle() would also deal with garbage values. Let's ensure that at least the first element of new_env[] is initialized. Change-Id: Id3901de4692ef44e9e9c67b1804e027fc4ce7c18 Fixes: CID#206571
2020-02-09osmo_libusb: check return value of osmo_fd_register()Vadim Yanitskiy1-1/+4
Most likely, we should not assert() here, but let's at least log an error message in case if osmo_fd_register() fails. Change-Id: Ia20755ec12ee9fb0eba8322551642a96e68e1570 Related: CID#206572
2020-02-09conv: prevent theoretical NULL pointer dereference in osmo_conv_encode()Vadim Yanitskiy1-0/+2
A caller shall never pass NULL to osmo_conv_encode(). Change-Id: Ice0050cd7c7e3fcbf57c2c73682ca28843a92d8b Fixes: CID#208174
2020-02-06tdef_vty: do not enforce enum 'node_type' in osmo_tdef_vty_groups_init()Vadim Yanitskiy2-4/+4
Some osmo-* applications may need to use their own VTY node as a parent for the timer configuration commands. Therefore it makes more sense to use 'unsigned int' instead of 'enum node_type'. Let's also clarify that osmo_tdef_vty_groups_init() accepts parent node for configuration commands only: 'parent_node' -> 'parent_cfg_node'. Change-Id: Ifb4c406c85d76a25fc53fc235484599aa87dc77c
2020-02-04value_string: Switch val from unsigned to intPau Espin Pedrol1-1/+1
There's nothing really preventing a user from user negative values. Otherwise if we keep it like this then g++ is not happy when passing eg. { -2, "foobar" } when initializing a value_string array. Change-Id: I754fa7e054cb89801ef82edc82199dcfbe59c6ab
2020-01-29pcsc: don't leak memoryEric Wild1-1/+4
Change-Id: I183882ff2eae82754d55189b154863fad9cce4aa
2020-01-21gsm/gsm48049.c: fix use of GNU 'missing =' extension in designatorVadim Yanitskiy1-1/+1
Found by clang with enabled LTO (Link Time Optimization). Change-Id: Ibda4600b4d23b93cf79ff13bb934dfc396aa7d93
2020-01-21usb/Makefile.am: fix copy-pasted library name: s/libosmosim/libosmousb/Vadim Yanitskiy1-2/+2
src/usb/Makefile.am:16: warning: variable 'libosmosim_la_LIBADD' is defined but no program or src/usb/Makefile.am:16: library has 'libosmosim_la' as canonical name (possible typo) src/usb/Makefile.am:15: warning: variable 'libosmosim_la_LDFLAGS' is defined but no program or src/usb/Makefile.am:15: library has 'libosmosim_la' as canonical name (possible typo) Change-Id: I062ea640a75f4521818ba71d5ffea2d08bf3052a
2020-01-18osmo_libusb: Check return of libusb_get_string_descriptor_ascii()Harald Welte1-0/+6
Change-Id: Ifc0133737627a8277635f8f3662b3f6e922be149 Closes: CID#207713
2020-01-12usb: Add osmo_libusb_find_matching_dev_{path,serial}Harald Welte2-0/+154
Thise two helper functions allow the user application to find a unique match among the existing USB devices, using either a user- provided iSerial string, or a user-provided physical USB path. Change-Id: I8ff3fb3e1a77e10cb313473480ce5e7673749a93
2020-01-07l1sap: add measurement related struct membersPhilipp Maier2-0/+4
In order to dissolve info_meas_ind_param in ph_data_param and ph_tch_param we need to add the measurement related struct members to ph_data_param and ph_tch_param as well so that those indications can also carry measurement data. Change-Id: I2c34b02d329f9df190c5035c396403ca0a4f9c42 Related: OS#2977
2020-01-07jenkins.sh: simpler invocation of verify_value_string_...Neels Hofmeyr1-1/+1
The script osmo-ci/scripts/verify_value_string_arrays_are_terminated.py is able to find .c/.h files in directory trees by itself. Shorten the cmdline invocation of this script for libosmocore. Change-Id: I888c20b9b19d777cd6581a541536842292f434b9
2020-01-07add crcXXgen.c.tpl to EXTRA_DISTNeels Hofmeyr2-1/+2
'make distcheck' distributes the generated .c files, but it is good GPL practice to also distribute the template. Change-Id: I988acd3bc629e98985a99780d3142112125d13f7
2020-01-06usb: Use OSMO_STRLCPY where appropriateHarald Welte1-1/+1
Change-Id: I6b2a90fd8f4b042a1e38dbf8e99414a94a290375
2020-01-03logging_vty.c: Avoid acquiring log tgt lock in logging level cmd when not neededPau Espin Pedrol1-4/+4
Change-Id: Ia6780221174070cee408625e24513f2c11cc9dfc
2020-01-03gb: Fix typo in bssgp_cause_strings descriptionPau Espin Pedrol1-1/+1
Change-Id: I2474bbe99bf0aa35aab046a1987047a8368beff6
2020-01-03bitvec: Fix return value in doc for bitvec_write_field()Pau Espin Pedrol1-1/+1
Change-Id: I629e71242cb6bafa3c1b1d65ae7ec6687ec203d1
2020-01-02Bump version: 1.2.0.108-c6a8-dirty → 1.3.01.3.0Pau Espin Pedrol8-14/+140
Change-Id: I5698bfe45467a8b0e44549105aaf27b8da500de8
2020-01-02Drop empty file debian/patches/seriesPau Espin Pedrol1-0/+0
Change-Id: I1a4aa5d6785aa7ff7dc454930a84d73fe1114726
2020-01-02osmo-release.sh: Improve of PKG_CHECK_MODULES from configure.acPau Espin Pedrol1-1/+1
Remove brackets and check for "(" after PKG_CHECK_MODULES to avoid getting comments containing the keyword. Change-Id: Ie2b9a65d42615aa3cce6906ddd53758bc3052942
2019-12-17Introduce helper functions for safe fork+exec of processesHarald Welte10-4/+487
In some situations, we want to execute an external shell command in a non-blocking way. Similar to 'system', but without waiting for the child to complete. We also want to close all file descriptors ahead of the exec() and filter + modify the environment. Change-Id: Ib24ac8a083db32e55402ce496a5eabd8749cc888 Related: OS#4332
2019-12-17debian/control: Add missing libusb-1.0-0-dev dependencyHarald Welte1-0/+1
In Change-Id I656a1a38cbb5b1f3a9145d2869d3b4d0adefcae3 we introduced USB support and also updated debian pacakaging informatio for this new package - however, I missed to add a realted Build-Depends line :( Change-Id: Ib0446510c8ba49623914b6103ea9cfa88c208d50 Related: #4299
2019-12-16usb: Import a variety of libusb utility functions from simtraceHarald Welte2-1/+452
Those functions were originally developed as part of simtrace; let's import them to libosmousb as they are truly generic. Change-Id: I2c18b938e4e1ea5b8a521a386f00db3a7389e47a Related: OS#4299
2019-12-16libosmocore libusb integrationHarald Welte10-2/+218
Osmocom applications typically use libosmocore select.[ch] event loop code as their main event dispatch mechanism. When they want to deal with libusb in a non-blocking/asynchronous way, they need to integrate libusb into that select(). The new libosmousb is doing exactly that: Providing a shared utility library for Osmocom programs that wish to use libusb. This is useful for example in simtrace2 host utilitie as well as osmo-e1d. Change-Id: I656a1a38cbb5b1f3a9145d2869d3b4d0adefcae3 Closes: OS#4299
2019-12-15gprs_bssgp: Work around gcc-9 claiming "error=stringop-overflow"Harald Welte2-0/+3
gcc-9.2.1 issues the following errror when compiling with -Werror: In function ‘tl16v_put’, inlined from ‘tvlv_put’ at ../../include/osmocom/gsm/tlv.h:156:9, inlined from ‘tvlv_put’ at ../../include/osmocom/gsm/tlv.h:147:24, inlined from ‘msgb_tvlv_put’ at ../../include/osmocom/gsm/tlv.h:223:9, inlined from ‘bssgp_tx_paging’ at gprs_bssgp.c:1250:2: ../../include/osmocom/gsm/tlv.h:131:2: error: ‘memcpy’ reading between 128 and 65535 bytes from a region of size 9 [-Werror=stringop-overflow=] 131 | memcpy(buf, val, len); | ^~~~~~~~~~~~~~~~~~~~~ Unfortunately I've not been able to work around it with some nice GCC #pragma GCC diagnostic ignored "-Wstringop-overflow" Change-Id: I22a0c399c6c00eaf87277002096a82844c9e198e