aboutsummaryrefslogtreecommitdiffstats
path: root/include
AgeCommit message (Collapse)AuthorFilesLines
2019-10-04API doc tweaks (mncc.h, gsm_08_08.h)Neels Hofmeyr2-5/+7
Change-Id: I9b4c7e737c83c65e358496e4540c14be5abc5474
2019-09-28gsup: add OSMO_GSUP_SUPPORTED_RAT_TYPES_IE and OSMO_GSUP_CURRENT_RAT_TYPE_IENeels Hofmeyr1-0/+7
OSMO_GSUP_SUPPORTED_RAT_TYPES_IE corresponds to the Supported RAT Types Indicator from 3GPP TS 29.002. See 8.1.2 MAP_UPDATE_LOCATION service, which indicates the capabilities of the MSC/VLR to the HLR. So far, have room for eight RAT types in the gsup_msg. That is an arbitrary random choice without any rationale. OSMO_GSUP_CURRENT_RAT_TYPE_IE is useful to communicate the currently used RAN / RAT type of the current subscriber during Location Updating Request. Change-Id: I93850710ab55a605bf61b95063a69682a2899bb1
2019-09-26msgb: Allow size==headroom in msgb_alloc_headroom*()Pau Espin Pedrol1-2/+2
Nothinh really forbids this case, it's totally fine allocating all space of msgb as headroom. osmo-pcu actually does that in gprs_rlcmac_ul_tbf::snd_ul_ud(). Related: OS#4029 Change-Id: Ibe05d08e3169a2603e891f76682a3b352a93ec7a
2019-09-20logging: Move extern declaration of osmo_log_target_list from logging.h to ↵Pau Espin Pedrol2-1/+1
logging_internal.h This list is really not needed by applications and currently only used internally in logging.c and logging_vty.c. Change-Id: I5dca069512bfcd0826194427c5482fad8bfd0232
2019-09-20ecu_fr: increase test coverage for FR ECU implementationPhilipp Maier1-2/+4
The ECU implementation for FR is currently tested by calling the related functions directly and by using the generic ECU abstraction layer. However, the test "test_fr_concealment" only tests directly. Lets add a version that uses the generic ECU abstraction layer as well. The generic ECU abstraction layer obsolets the public API functions osmo_ecu_fr_reset() and osmo_ecu_fr_conceal(), lets tag those functions as dprecated. Change-Id: Ib0c8a9b164f14ea4fa00688f760a76cdb4890af4
2019-09-20cosmetic: Add comment on GSM-FR ECU structPhilipp Maier1-0/+1
Change-Id: Ic0a3a407c592262104af315f845f0bbd116ab26b
2019-09-20cosmetic: Move comment to the right placePhilipp Maier1-1/+1
Change-Id: I3d548fcc7d500baf37134b14af91bc7b284ce6ad
2019-09-18logging.h: add L1 SAPI related context and filterOliver Smith1-0/+2
First user is osmo-bts in I6b7bb2e1d61502b61214f854a4ec5cbb7267545b. Related: OS#2356 Change-Id: I814cb3328d99faca9220adb5a80ffb934f219d7d
2019-09-17logging_internal.h: Fix osmo_log_info definitionPau Espin Pedrol1-1/+1
Global symbol osmo_log_info is declared in logging.c as non-const, because it is modified. As soon as logging_internal.h is included into logging.c, the compiler warns about osmo_log_info being declared twice differently. Change-Id: Iea961c3caeb12ddf60c99d4dca644bb9ab538767
2019-09-11tdef: fixup osmo_tdef_set()Neels Hofmeyr1-1/+1
I missed code review, so here are my comments in form of a follow-up patch for Id56a1226d724a374f04231df85fe5b49ffd2c43c. - Fix 'as_unit' arg name to 'val_unit' as in the C file and API doc. - Explain rounding-up behavior of value conversion in API doc. - Use osmo_tdef_get_entry() instead of a loop. Related: OS#4190 Change-Id: Ia91c2f17e40fb9e79ffa5a7f28ce9c3605664402
2019-09-07tdef_vty.h: Add missing header dependenciesPau Espin Pedrol1-0/+3
enum node_type is defined in osmocom/vty/command.h va_list is defined in stdarg.h Change-Id: Ia439a7097ae7a9765e229e5f66e07af3fe490ecc
2019-09-07tdef: Introduce API osmo_tdef_set()Pau Espin Pedrol1-0/+1
This API is already useful for users willing to set a given timer to a given value. It will also contain code later that checks for value being inside valid range for that timer. Related: OS#4190 Change-Id: Id56a1226d724a374f04231df85fe5b49ffd2c43c
2019-09-05Introduce BTS_FEAT_ETWS_PN for communicating ETWS PN capabilityHarald Welte1-0/+1
As 3GPP doesn't specify how the BSC shall communicate ETWS Primary Notifications over Abis/RSL, we have to use a vendor-specific RSL message for this. And in order to know if the peer supports this feature, we introduces BTS_FEAT_ETWS_PN. Change-Id: I89c24a81ada6627694a9632e87485a61cbd3e680 Related: OS#4046, OS#4047
2019-09-05gsm_08_58: Add vendor-specific Message Type for ETWS Primary WarningHarald Welte1-0/+2
Change-Id: I36fc2ffc22728887d1cb8768c7fcd9739a8ec0fc Related: OS#4046, OS#4047
2019-09-02codec/ecu: Introduce new generic Error Concealment Unit abstractionHarald Welte1-0/+54
We don't want to expose the details of a given ECU implementation to the user (e.g. osmo-bts), but have a generic abstraction layer where an ECU implementation can simply register a few call-back functions with the generic core. As the developer and copyright holder of the related code, I hereby state that any ECU implementation using 'struct osmo_ecu_ops' and registering with the 'osmo_ecu_register()' function shall not be considered as a derivative work under any applicable copyright law; the copyleft terms of GPLv2 shall hence not apply to any such ECU implementation. The intent of the above exception is to allow anyone to combine third party Error Concealment Unit implementations with libosmocore, including but not limited to such published by ETSI. Change-Id: I4d33c9c7c2d4c7462ff38a49c178b65accae1915
2019-08-31cbsp: Fix endless loop iteration when decoding cell list IEsHarald Welte1-0/+1
The CBSP code assumed that gsm0808_decode_cell_id_u() would return the number of bytes it has consumed/parsed. But it actually always returns '0', whcih makes us run in an endless loop :( Change-Id: I5758af4ec11a827d4b888a3a16c4ec22de90a7d6
2019-08-30OSMO_SOCKADDR_STR_FMT_ARGS: guard against NULL pointerNeels Hofmeyr1-1/+1
The pointless '(R)->ip?' condition of the previous commit made me want to protect against R == NULL instead. Change-Id: Ie2f47ad8ae585aaf67a6476c67f8e014820a72bc
2019-08-30OSMO_SOCKADDR_STR_FMT_ARGS: remove useless conditionNeels Hofmeyr1-1/+1
Since (R)->ip is a char[], it is always non-NULL. The (x ? : "") condition is completely pointless. Remove it. Change-Id: I13ed06776a784cfa99bbdfca2bb4dfe12913a1ec
2019-08-27context: Add support for [per-thread] global talloc contextsHarald Welte2-3/+26
Rather than having applications maintain their own talloc cotexts, let's offer some root talloc contexts in libosmocore. Let's also make them per thread right from the beginning. This will help some multi-threaded applications to use talloc in a thread-safe way. Change-Id: Iae39cd57274bf6753ecaf186f229e582b42662e3
2019-08-23Cosmetic: l1sap.h: change /* !< to /*!<Oliver Smith1-5/+5
Change-Id: Icaec95a9c6105fd17bc1151fdc77394f4efd3b70
2019-08-15osmo_tdef_get(): allow passing -1 as default timeoutNeels Hofmeyr1-1/+1
The intention of osmo_tdef_get()'s val_if_not_present argument was to return a default timeout, or to optionally abort the program for missing timer definitions if the default timeout is < 0. This was the case in the original implementation of this API in osmo-bsc, but in the migration to libosmocore, the argument was by accident changed to an unsigned type. In consequence, the assertion in the implementation that was intended to abort the program seemed bogus to coverity, and was fixed by removal in I7a544d2d43b83135def296674f777e48fe5fd80a -- the wrong direction, as is obvious from the API doc for osmo_tdef_get(). Note that osmo-bsc master passes -1 in various places and expects the program-abort behavior that was missing from the libosmocore implementation. Change the val_if_not_present argument to a signed type, and revert removal of the assertion, so that passing -1 has the effect described in the API doc: program abort on missing timer definition. This bug was not detected because it is hard to write tests that expect a program abort to happen, hence no tests for this API feature exist. Related: OS#4152 Change-Id: Ie61c3c85069916336e6dbd91a2c16f7634816417
2019-08-12codec/ecu_fr: Mark input TCH frame as 'const' as we only read itHarald Welte1-1/+1
Change-Id: I64c6d3dc08ff87b673ba6225f98546e86f91bcfd
2019-07-26gsm/gsm48.h: drop meaningless 'const' from gsm48_mi_to_string()Vadim Yanitskiy1-2/+1
Change-Id: I5eb17edadf89ac47b4ca86c9e822037f7c0e518e
2019-07-20Add Cell Broadcast related definitions from 3GPP TS 23.041Harald Welte2-0/+90
Change-Id: I1e2c62cb9047648907c91b99f764f6caba8f4493
2019-07-20cbsp: Introduce osmo_cbsp_errstrHarald Welte1-0/+2
Rather than having the encoder/decoder library print some log messages in case of encoding/decoding errors, let's provide something akin to 'errno', but with a string instead of a numeric error code. The 'osmo_cbsp_errstr' global variable (if set) contains a human-readable string describing the most recent encoding/decoding error. It exists separately for each thread and hence can be used safely in multi-threaded environments. Change-Id: Id9a5a595a76ba278647aee9470ded213d8464103
2019-07-20CBSP (Cell Broadcast Service Protocol; 3GPP TS 48.049) supportHarald Welte3-0/+422
This introduces definitions as well as a parser+encoder for the Cell Broadcast Service Protocol (CBSP) as specified in 3GPP TS 48.049. CBSP is used on the interface between CBC and BSC. Related: OS#3537 Change-Id: I5b7ae08f67e415967b60ac4b824db9e22ca00935
2019-07-10libosmogsm/l1sap.h: extend ph_rach_ind_param with lqual_cbVadim Yanitskiy1-0/+1
The link quality, defined by C/I (Carrier-to-Interference) ratio, can be computed from the training sequence of each burst, where we can compare the "ideal" training sequence with the actual training sequence and then express that in cB (centiBels, dB * 10). By analogy with both RSSI and ToA, it can be used to filter out false-positive detections and ghost Access Bursts. Change-Id: Ie2a66ebd040b61d6daf49e04bf8a84d3d64764ee
2019-07-09Revert "utils.h: require a semi colon after OSMO_ASSERT"Vadim Yanitskiy1-2/+2
This reverts commit 4e284b637943980a405a8c44f2712b749ded428f. Unfortunately, some projects such as OsmoMSC, OsmoBTS and OpenBSC do contain OSMO_ASSERT statements without a semi colon. Thus, this change causes compilation errors when building them. Please note that only the OSMO_ASSERT's definition is reverted, while changes to other files (adding missing semicolons) are kept. Change-Id: I6da4d7397d993f6c1af658cb5ae1e49c92a1b350
2019-07-08utils.h: require a semi colon after OSMO_ASSERTAlexander Couzens1-2/+2
When using `OSMO_ASSERT(exp);` clang will warn about an empty expression because the semi colon was superflous. Use do {} while (0) to enfore the need of a semi colon. This might break other test. Change-Id: I2272d29a81496164bebd1696a694383a28a86434
2019-06-17add define for magic tmsi constantEric Wild1-0/+1
Change-Id: I52b9f6b5f3e96d85a390ba2af21d7814df8aaeec
2019-06-13(minor) fix typo in commentsKévin Redon1-3/+3
Change-Id: I697af428a2ea9a0ccd3f04ba8ec4664935ae29f8
2019-06-13minor: don't redefine macrosKévin Redon2-0/+4
the DEBUG macro name and ARRAY_SIZE macro function are frequently used in other projects. If these projects also use libosmocore, the macros will be redefined. This also generates a warning message during compilation. Not redefining the macros removes the warning message and possible (but unlikely) mis-redefinition. Change-Id: I0ba91eae8eacc5542d1647601b372e417ed1713c
2019-06-12protocol/gsm_04_08.h: do not check if unsigned is positiveVadim Yanitskiy1-3/+3
Change-Id: I6b486b52a3733d5fd5e8ba18acbc9374e2e8bd7e
2019-06-12core/utils: drop meaningless const from return value of osmo_luhn()Vadim Yanitskiy1-1/+1
Change-Id: I085da06f31a0a6862ae2ba041fafc134cc240f7e
2019-06-05fsm: Allow millisecond granularity in osmo_fsm built-in timerHarald Welte1-0/+15
So far, the public API of osmo_fsm only allowed integral seconds as timeout. Let's change that to milli-seconds in order to cover more use cases. This introduces * osmo_fsm_inst_state_chg_ms() * osmo_fsm_inst_state_chg_keep_or_start_timer_ms() Which both work exactly like their previous counterparts without the _ms suffix - the only difference being that the timeout parameter is specified in milli-seconds, not in seconds. The value range for an unsigned long in milli-seconds even on a 32bit platform extends to about 48 days. This patch also removes the documentation notice about limiting the maximum value to 0x7fffffff due to time_t signed-ness. We don't use time_t but unsigned long. Change-Id: I35b330e460e80bb67376c77e997e464439ac5397
2019-06-05lapdm: Allow user to specify T200 values; Use correct N200 valuesHarald Welte1-3/+9
TS 04.06 specifies a N200 re-transmission counter that depends on the channel type, which we didn't care about at all so far. Let's have the caller tell us the channel type so we can internally look up the correct N200 value for it. At the same time, permit the user to specify T200 re-transmission timer values for each SAPI on both DCCH and ACCH, which is required at least in the BTS as per GSM TS 12.21. Also, extend the timer resolution of the API from seconds to milli-seconds, which is more applicable as particularly on the FACCH the recommended values are in the 200ms range. Change-Id: I90fdc4dd4720d4e02213197c894eb0a55a39158c Related: OS#3906 Related: OS#2294 Related: OS#4037
2019-06-04gsm0808_utils: Add gsm0808_decode_cell_id_u()Harald Welte1-0/+1
This function parses a single Cell ID list element into a 'union gsm0808_cell_id_u'. This function is going to be used by the upcoming CBSP support. Related: OS#3537 Change-Id: I08b33881667aa32f01e53ccb70d44d5b79c7c986
2019-05-28rest_octets: Remove SI2ter + SI2bis encoders that don't do anythingHarald Welte1-2/+0
The library should either provide functions that implement encoding of those rest octets, or it shouldn't. Providing a function that doesn't do anything but pad the buffer is useless. Change-Id: Ie10684de6a6b2663e2a871fcdb2b275b6ad7a1e7
2019-05-28rest_octets: Implement actual SI6 rest octets encodingHarald Welte1-1/+38
There's very little sense behind introducing a function into libosmogsm which doesn't implement 90% of the spec. Let's allow the caller to provide the various optional bits of information to the encoder, rather than generating mostly static SI6 rest octets. Change-Id: Id75005a0c4a02ce7f809692d58b3bd226bc582b2
2019-05-28rest_octets: Add function to parse SI3 rest octetsHarald Welte1-0/+3
Change-Id: I690cf308311f910005a325d50f5d5d825678d2b2 Related: OS#3075 Related: OS#4023
2019-05-28rest_octets: Suffix encoder functiosn with _encodeHarald Welte1-10/+12
... otherwise it's not really clear what they do. Change-Id: I08e0ca9a8d13c7aa40b9d90f34f0e13adb87d4e0
2019-05-27tdef: Fix license: GPLv2+ instead of AGPLv3+Harald Welte1-4/+6
libosmo{core,gsm,vty} code is GPLv2+. The tdef code originated in osmo-msc.git and was moved here without changing the license. That was a mistake, it always was meant to be under GPLv2-or-later after moving to libosmocore.git. Copyright is with sysmocom, so I as the managing director can approve the license change. Change-Id: Ie483ff6f6ea0a56c477649677b4b163c49df11d7
2019-05-27oap_client: Fix license: GPLv2+ instead of AGPLv3+Harald Welte1-4/+5
libosmo{core,gsm,vty} code is GPLv2+. The OAP code originated in osmo-msc.git and was moved here without changing the license. That was a mistake, it always was meant to be under GPLv2-or-later after moving to libosmocore.git. Copyright is with sysmocom, so I as the managing director can approve the license change. Change-Id: I08311fa8214c15f8df8945b9894226608cf96f15
2019-05-27rsl: Add osmocom-specific extensions to RSL channel numbers for CBCHHarald Welte1-0/+4
We don't really *need* it in libosmocore as such, but the lack of having all osmocom extensions listed here lead to using overlapping definitions: 0x18 was used for dynamic PDCH on the Abis side, but also for CBCH on the L1SAP side. Let's list them all here to increase visibility in case anyone wants to extend this further... Related: OS#4027 Change-Id: I93e557358cf1c1b622f77f906959df7ca6d5cb12
2019-05-24protocol/gsm_12_21.h: fix copy-pasted struct descriptionVadim Yanitskiy1-1/+1
Change-Id: Ic6d32c886f6f8f859e382d48f9e1b509000db9ba
2019-05-19TLV: Add one-shot TLV encoderHarald Welte1-0/+6
So far, the TLV code contained two types of functions * tlp_parse() to parse all TLVs according to definition into tlvp_parsed * various helper functions to encode individual TLVs during message generation This patch implements the inverse of tlv_parse(): tlv_encode(), which takes a full 'struct tlv_pared' and encodes all IEs found in it. The order of IEs is in numerically ascending order of the tag. As many protocols have different IE/TLV ordering requirements, let's add a tlv_encode_ordered() function where the caller can specify the TLV ordering during the one-shot encode. Change-Id: I761a30bf20355a9f80a4a8e0c60b0b0f78515efe
2019-05-19Cosmetic: GSUP: fix too long comment lineOliver Smith1-2/+2
Change-Id: I60ba8fef8924e58bc73cff5c7ff77ebb76d8bfaa
2019-05-19Deprecate usage of osmo_counter_*Daniel Willmann1-2/+10
There's not many of those around any more, let's try to move them to osmo_stat_items Change-Id: If67f64c6ec7a3f3114c962df9db50107d9ea86e2
2019-05-18Revert "Change GSM48_PDISC_* to enum type"Harald Welte1-20/+18
This reverts commit ece1d8509d5c5af7a60ab5e1a5dddade1b181dc9 which causes build failures due to compile warnings everywhere. Change-Id: Ic131439ea206a0b0f57968ef701667da73711b51
2019-05-17Change GSM48_PDISC_* to enum typeMax1-18/+20
An enum is more clear than an int and #defines for passing around, also in case you have a switch () statement, the compiler will issue warnings for unhandled cases. Change-Id: Icbbe8786a776081d7643193f154e6270224399e6