Commit Graph

67 Commits

Author SHA1 Message Date
Harald Welte 898ffefde4 add libpseudotalloc as super-simplistic talloc replacement
In tightly embedded builds (--enable-embedded), we want the ability to
replace talloc with a very simple heap allocator to avoid the complexity
of talloc without modifying all our code that assumes talloc.

This will break the hierarchical notion of the allocator, but
libosmo{core,gsm,coding,codec} don't rely on that anyway.

Change-Id: Ie341034076f242a813f081919dd09d845775ad35
2017-05-17 15:15:52 +01:00
Harald Welte 7af6d22a4e sercomm: Include in libosmocore Makefile
Change-Id: If9d50d634381f43b2c67b97fea36a462a66e4559
2017-05-17 15:15:09 +01:00
Tom Tsou 35536807ab core/conv: implement optimized Viterbi decoder
Add a separate, faster convolution decoding implementation for rates
up to N=4 and constraint lengths of K=5 and K=7, which covers the
most GSM code uses. The decoding algorithm exploits the symmetric
structure of the Viterbi add-compare-select (ACS) operation - commonly
known as the ACS butterfly. This shift-register optimization can be
found in the well-known text by Dave Forney.

Forney, G.D., "The Viterbi Algorithm," Proc. of the IEEE, March 1973.

Implementation is non-architecture specific and improves performance on
x86 as well as ARM processors. Existing API is unchanged with optimized
code being called internally for supported codes.

The original code was relicensed under GPLv2-or-later with permission
of copyright holder - Tom Tsou.

Change-Id: I74d355274b4176a7d924f91ef3c96912ce338fb2
2017-04-11 00:36:08 +00:00
Max 4e72ee0d0f Catch-up with git version tags
* update debian/changelog
* update TODO-RELEASE
* add comments to Makefile.am and TODO-RELEASE to simplify the process
  in future
* add link to libtool docs to Makefile.am to simplify LIBVERSION
  maintenance

Related: OS#1861
Change-Id: I22c257e357f597519120232d742d6a61289db021
2016-12-21 10:31:17 +00:00
Harald Welte aa00f99be2 Implement GSMTAP log target
This target wraps the to-be-logged string (With metadata) into a GSMTAP
packet and sends it to the configured destination address.

Change-Id: I9a7e72b8c9c6f6f2d76d1ea2332dcdee12394625
2016-12-09 17:59:58 +01:00
Neels Hofmeyr 8e2f7e87f4 add osmo_gettimeofday as a shim around gettimeofday
This allows feeding a custom time for unit tests by overriding
osmo_gettimeofday.

Change-Id: Ic7a81a6eb51f27fe452962b91f2eae2070d87089
2016-09-22 07:18:39 +02:00
Harald Welte 136e73764e Add Finite State Machine abstraction code
This code is supposed to formalize some of the state machine handling in
Osmocom code.

Change-Id: I0b0965a912598c1f6b84042a99fea9d522642466
Reviewed-on: https://gerrit.osmocom.org/163
Tested-by: Jenkins Builder
Reviewed-by: Harald Welte <laforge@gnumonks.org>
2016-06-16 21:43:45 +00:00
Max 5c18e26bc2 Add T4 bit map compression routines
Add bit map encoder and decoder functions: decoder is fully functional
while encoder is good enough for testing - no backtracking to find
the best possible compression is implemented. If somebody is willing to
implement MS side of EDGE than this has to be expanded.
Add corresponding tests.
N. B: the encoding is implemented according to ETSI TS 44.060 which is
slightly different from T4 used for fax according to CCITT G31D (RFC 804).

Ticket: OW#2407
Sponsored-by: On-Waves ehf

Signed-off-by: Max <msuraev@sysmocom.de>
2016-02-18 19:45:44 +01:00
Harald Welte a2db75f28c Add osmo_prim_op_names[] symbol and _SAP_SS7_BASE define 2015-12-23 14:11:54 +01:00
Harald Welte 90e614f7cc remove our internal copy of talloc, use system libtalloc
Shipping our own private copy of talloc was a good idea in 2008,
when it was not readily available on most target platforms.  Today,
the situation is quite different, as it is a standard library on
major Linux distributions.
2015-12-05 23:38:18 +01:00
Jacob Erlbeck b6e6bea4ec stats: Move statsd related code into a separate file
This commit moves the stats specific code parts into stats_statsd.c
while keeping the generic parts in stats.c. The code in stats.c no
longer contains references to statsd symbols.

Note that the VTY code still needs to know about every stats reporter
backend.

Sponsored-by: On-Waves ehf
2015-11-26 12:52:24 +01:00
Jacob Erlbeck 95bf828003 stats: Add the reporting framework
This commit provides the stats reporting framework that can manage
several types of measurement reporters. Initially support for
rate_ctr and the statsd protocol is included.

Sponsored-by: On-Waves ehf
2015-10-29 01:10:03 +01:00
Jacob Erlbeck 9732cb4a92 stats: Add stat_item for value monitoring
This commit adds instrumentation function to gather measurement
and statistical values similar to counter groups.

Multiple values can be stored per item, which can be retrieved in
FIFO order. Getting values from the item does not modify its state to
allow for multiple independant backends (e.g. VTY and statd).

When a new value is set, the oldest value gets silently overwritten.
Lost values are skipped when getting values from the item.

Sponsored-by: On-Waves ehf
2015-10-28 23:51:04 +01:00
Holger Hans Peter Freyther 25aeab7a82 Prepare a new libosmocore release 2015-01-18 19:20:42 +01:00
Jan Engelhardt 9ffeb9756a build: remove unused all_includes and use AM_CPPFLAGS
Preprocessor flags are best placed in AM_CPPFLAGS. Remove use of the
unused all_includes variable, which is never set.
2014-10-03 08:48:31 +02:00
Harald Welte fb84f325b8 logging: Add ability to save/print current log filters
This enables the persistent configuration of let's say
'log filter imsi 012345678' for a given log file in the config
file.
2014-08-25 10:09:42 +02:00
Harald Welte 40d56f96b9 osmocore: Add function osmo_macaddr_parse() to parse ETH MAC address 2014-08-18 19:03:40 +02:00
Holger Hans Peter Freyther c2c042dfd7 backtrace: Speculative fix for FreeBSD10.0 and execinfo.h
FreeBSD 10.0 ships an execinfo.h but one needs to link to an
additional library for the backtrace functions. Check if there
is a backtrace symbol in libexecinfo and if so link to that
library.
2014-04-17 23:19:10 +02:00
Holger Hans Peter Freyther 45cdaa095a cygwin: Link many libraries with -no-undefined to create a dll
Only the Gb library relies on having undefined references to a
symbol that needs to be provided by the host application. For
all other libraries we can link with -no-undefined.
2013-03-03 10:10:07 +01:00
Katerina Barone-Adesi 3309a43ef5 Added a ring buffer log target to store the last N log messages.
The log target can be used via log alarms and show alarms.
Why? This feature was proposed/requested at
http://openbsc.osmocom.org/trac/wiki/Tasks/ErrorLogTarget
All messages use the same amount of space, prioritizing simplicity.
2013-02-27 15:13:45 +01:00
Holger Hans Peter Freyther efd2bd691f Revert "Added a ring buffer log target to store the last N log messages."
I noticed some more issues and it is the easiest to revert and include
the fixed version.

This reverts commit 73377229bb.
2013-02-27 14:51:33 +01:00
Katerina Barone-Adesi 73377229bb Added a ring buffer log target to store the last N log messages.
The log target can be used via log alarms and show alarms.
Why? This feature was proposed/requested at
http://openbsc.osmocom.org/trac/wiki/Tasks/ErrorLogTarget
All messages use the same amount of space, prioritizing simplicity.
2013-02-27 14:45:48 +01:00
Sylvain Munaut 5689a3b744 build: Don't use the deprecated INCLUDES in the various Makefile.am
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2012-12-11 23:59:31 +01:00
Diego Elio Pettenò c5f055f9e5 build: use LT_INIT(pic-only) instead of forcing -fPIC.
This actually allows for the user to override the decision and at the
same time supports compilers that might not be able to use -fPIC at
all.

Signed-off-by: Diego Elio Pettenò <flameeyes@flameeyes.eu>
2012-06-30 22:01:44 +02:00
Diego Elio Pettenò 7e007e0f87 build: avoid multi-level recursion for src/ directory.
Signed-off-by: Diego Elio Pettenò <flameeyes@flameeyes.eu>
2012-06-30 22:01:43 +02:00
Diego Elio Pettenò a1ed2f0bb1 build: use BUILT_SOURCES for the generated source files.
This avoids possible race conditions on heavily multi-core systems.

Signed-off-by: Diego Elio Pettenò <flameeyes@flameeyes.eu>
2012-06-30 22:01:43 +02:00
Diego Elio Pettenò f5df9ab549 build: use the standard AM_V_GEN definition for output.
This actually allows for the command to be printed if using `make V=1`

Signed-off-by: Diego Elio Pettenò <flameeyes@flameeyes.eu>
2012-06-30 22:01:43 +02:00
Harald Welte 641f7cee5d libosmogb: move files to proper location and fix build 2012-06-17 23:05:26 +08:00
Sylvain Munaut 40a8700247 libosmocore: Update LIBVERSION because of ABI chaanges
The recent convolutional code changes break the ABI.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-24 17:53:53 +01:00
Holger Hans Peter Freyther 4772348b4f freebsd: Fixes for the compilation of libosmocore on FreeBSD
alloca.h is not available on FreeBSD, use the default autoconf
function to check for it, there is a complete list[1] of what to
do for using alloca but let us see how far we get with this test.

Include netinet/in.h for the IPv4 and IPv6 socket address. Check
for dlopen in libraries and use this instead of linking -dl.

[1] http://www.gnu.org/s/hello/manual/autoconf/Particular-Functions.html
2011-11-09 11:56:56 +01:00
Sylvain Munaut dec48005cc core: Fix include path to use top_builddir as well for generated headers
With the new generated headers for the CRC code, we need to include
the builddir as well in case we're building out of tree.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-10-21 21:23:05 +02:00
Harald Welte 4a0a163d81 bump major library version / breaking the ABI with the rb_tree timers 2011-10-17 13:26:52 +02:00
Pablo Neira Ayuso f74db0b33d add rb-tree implementation to libosmocore
This patch adds red black trees implementation to libosmocore.
This data structure is very useful to search for elements in
ordered sets in O(log n) instead of O(n) that lists provide.

The first client of this code will be one follow up patch that
implements rbtree-based timer scheduler.
2011-10-17 13:25:29 +02:00
Jan Engelhardt e2bcaceee6 build: resolve link failure when --disable-talloc is used 2011-10-10 18:10:06 +02:00
Harald Welte 17f56f385b update LIBVERSION to reflect new API additions 2011-10-10 08:46:40 +02:00
Sylvain Munaut 2749c0bfbf core: Add generic CRC functions (templates expended to 8 16 32 64 bits)
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-09-16 22:59:18 +02:00
Sylvain Munaut fe28dedd4c core/serial: Add utilities to deal with serial ports
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-09-02 22:21:09 +02:00
Harald Welte 32e1f239b3 merge process.[ch] with application.[ch] 2011-06-26 14:14:05 +02:00
Harald Welte 33cb71ac91 gsmtap: rework GSMTAP API to be more future-proof
* use write_queue where applicable
* provide functions that work on raw FD and those with osmo_fd
* add support for multiple gsmtap instances (no global variables)
2011-05-22 11:43:23 +02:00
Holger Hans Peter Freyther ba01fa44fe app: Introduce some routines to help with application startup
The plan is to collect structs and routines for application
setup and remove many copies of the boilerplate code we have
right now. This starts with routines to ignore certain signals
and the stderr init code.

Increment the age of the library because a new interface was added.
2011-05-12 15:43:47 +02:00
Harald Welte 7533705ab1 libosmocore: bump library interface version to '1' for new osmo_ names 2011-05-08 14:35:40 +02:00
Sylvain Munaut 19dc5c9cca core/conv: Add some generic code for convolutional coding/decoding
Far from perfect but suits our need thus far.

The viterbi with softbit input is quite cpu-intensive. Since
most received bursts are often mostly error free, you could
use a less cpu intensive algorithm (Fano ?) and with hard bit
input. Then only switch to viterbi soft bit input if the channel
is bad enough to justify it.

Soft output is not implemented as its usefulness for the block
coding is limited.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-04-26 14:40:49 +02:00
Pablo Neira Ayuso fba495e5f6 This patch moves the GSM-specific functions to the new library
libosmogsm which is provided by libosmocore.

I have also moved generate_backtrace() to backtrace.c instead
of gsm_utils.c, otherwise the timer and msgfile tests depend on
libosmogsm.

Signed-off-by: Pablo Neira Ayuso <pablo@gnumonks.org>
2011-03-23 18:08:08 +01:00
Harald Welte 46cfd77f75 LOGGING: Add syslog log target 2011-02-17 15:56:56 +01:00
Harald Welte 2230c133a6 [BITS] introduce new packed/unpacked bit conversion routines 2011-01-19 10:10:16 +01:00
Sylvain Munaut 1a4ea5b436 codec: Add bit ordering tables from specs for HR,FR,EFR & AMR
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-10-15 09:45:04 +02:00
Holger Hans Peter Freyther c87f266522 msgfile: Add a file parser for a simple file format
This file format will be used to store per country code,
per network code messages. This will be used for various
things ranging from access control, to messages...
2010-10-08 19:23:18 +08:00
Holger Hans Peter Freyther 55aea5099c gsm0480: Add USSD format functions to libosmocore
These routines come from OpenBSC, the msgb_wrap_* functions
belong to Mike Haben, the rest is mine. The msgb allocation
is compatible to the GSM48 allocation in OpenBSC.
2010-09-30 19:00:58 +08:00
Holger Hans Peter Freyther e25b18aa29 vty: Link osmovty to osmocore as it is using the symbols
Use SUBDIRS to build src first and the src/vty. We will need
to find the right way add the dependencies.
2010-09-11 03:58:37 +08:00
Harald Welte b6cb023c7b Add helper function 'osmo_daemonize()' to convert process into daemon 2010-08-25 19:24:26 +02:00