Commit Graph

890 Commits

Author SHA1 Message Date
Sylvain Munaut 07f1103782 timer: Add compatibility header with timer helpers
Some of these are not always present, especially when cross compiling

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-10-21 21:55:29 +02: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
Sylvain Munaut 0061dedaae timer: Simplify osmo_timers_nearest even more
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-10-18 20:11:03 +02:00
Sylvain Munaut 955fdb039e timer: Fix implementation of osmo_timers_nearest causing high CPU load
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-10-17 23:03:57 +02:00
Harald Welte 16df917131 Merge branch 'pablo_timer' 2011-10-17 13:30:56 +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 9ebc5056b4 tests: add new torture test for timer infrastructure
This is a new test for the timer infrastructure. It basically consists
of adding 2^N timers per step (where N is the number of step) that
expire in (random() % 10) + 1 seconds. Moreover, we randomly delete
timers that fulfill (random() % 100) < 10 everytime one timer expires.

The default number of steps is 16, the test also allows to check for
timer imprecisions (currently, defaulting to 10ms as aceptable).

The list-based implementation crashes or it seems loop forever with
this test (I guess due to some memory corruption).

BTW, this patch contains one cosmetic clean up since we go back to
8-chars per indentations, which seems to be the policy in osmocom.
2011-10-17 13:25:29 +02:00
Pablo Neira Ayuso 066c912fd3 timer: add scalable RB-tree based timer infrastructure
This patch adds RB-tree based timers which scales better than the
previous list-based implementation.

It does not require any API changes. It breaks ABI because the
osmo_timer_list structure has changed though (to avoid this in
the future, we can put internal data in some private structure).

The following table summarizes the worst-case computational complexity
of this new implementation versus the previous one:

                                rb-tree         list-based
                                -------         ----------
calculate next timer to expire  O(1)            O(n)
insertion of new timer          O(log n)        O(n)
deletion of timer               O(log n)        O(1)
timer-fired scheduler           O(log n)        O(3n)

The most repeated cases are:

* the calculation of the next timer to expire, that happens in every
  loop of our select function.

* the timer-fired scheduler execution.

This new implementation only loses in the deletion of timer scenario,
this happens because we may need to rebalance the tree after the
removal.

So I think there is some real gain if we have some situation in which
we have to handle lots of timers.
2011-10-17 13:25:29 +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 226ef1d143 add header file containing UMA/GAN protocol definitions 2011-10-10 09:21:27 +02:00
Harald Welte 27dc1b130b update .gitignore (crc*gen.[ch], some autotools stuff) 2011-10-10 09:20:19 +02:00
Harald Welte 17f56f385b update LIBVERSION to reflect new API additions 2011-10-10 08:46:40 +02:00
Andreas Eversberg 78122ab568 Added defines to use primitive/operation tuples in switch/case statements 2011-10-10 08:38:58 +02:00
Andreas Eversberg 742fc79d58 LAPD: Moved timer handling into seperate functions 2011-10-10 08:38:58 +02:00
root af48bed556 Split of LAPDm into a core part and a GSM specific part
Instead of mixing together the GSM layer 1 interface and RSL interface
with the implementation of LAPD, the core function of LAPD is now
extracted from LAPDm. The core implementation is now in lapd_core.c
and lapd_core.h respectively.

The lapd_core.c implements exactly one datalink instance for one SAP.
The surrounding implementation "lapdm.c" codes/decodes the layer 2
headers and handles multiplexing and datalink instances, as well as
translates primitives from/to RSL layer.

lapd_core.c can now be used for other LAPD implementations. (ISDN/ABIS)
2011-10-10 08:38:58 +02:00
root 8a996b4844 Changed logging of LAPD from DLLAPDM to DLLAPD 2011-10-10 08:38:58 +02:00
Sylvain Munaut f84571d0f4 gsmtap: Add type/subtypes for GMR-1 protocol
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-10-09 16:57:33 +02:00
Harald Welte ccd040f61e GSMTAP: Add comments to explain how to make GSMTAP changes 2011-10-08 14:40:14 +02:00
Harald Welte fae779ac54 GSMTAP: Import changes from Wireshark
There have been some changes in the wireshark source code that have
never been submitted to gsmtap.h

GSMTAP_CHANNEL_PACCH has been defined in an incompatible way in mainline
wirshark :(
2011-10-08 14:40:09 +02:00
Holger Hans Peter Freyther a4463fd23b vty: Provide documentation for all logging facilities
Document all facilities in the log syslog command.
2011-10-03 23:20:15 +02:00
Holger Hans Peter Freyther 146d1d3c35 vty: Provide logging set-log-mask, deprecate set log mask
There are no other commands on the set, log and mask level,
create a simple set-log-mask command and deprecate the old
way.
2011-10-03 23:20:15 +02:00
Sylvain Munaut e40549a0ae core/serial: Fix typo
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-09-28 10:55:22 +02:00
Sylvain Munaut 9631184399 core/serial: support custom baud rates on OS X
Thanks to Richard James <xyzzy@mm.st> for the patch

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-09-28 09:11:09 +02:00
Sylvain Munaut abf66e75cb gsmtap: Fix doxygen doc for the recent additions
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-09-26 13:23:19 +02:00
Sylvain Munaut 15ae715b0d gsmtap: Add a _ex version of gsmtap_{makemsg,send} to specify content type
From: iZsh <izsh@fail0verflow.com>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-09-26 13:05:07 +02:00
Harald Welte aa244bfe63 bring gsmtap.h in sync with recent wireshark additions 2011-09-26 00:24:59 +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
Alexander Huemer def0afed23 update .gitignore 2011-09-05 09:50:50 +02:00
Alexander Huemer 4d7bcea870 correct declaration of osmo_sitype2rsl 2011-09-05 09:50:47 +02:00
Harald Welte d61d517a2e add missing declarations of cfg_description_cmd to vty/vty.h 2011-09-04 22:56:10 +02:00
Harald Welte ee876c9172 LAPDm: Fix encoding of RLL ERROR IE 2011-09-03 10:43:41 +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
Sylvain Munaut bf9d25039c build/include: Only install headers for enabled options
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-09-02 20:41:42 +02:00
Sylvain Munaut 49767228f7 build: Remove docdir, don't comment it
The revision control is there to show the history, no point in
leaving commented out bits

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-09-02 20:23:42 +02:00
Andreas.Eversberg eaac0cfe77 gsm/gsm48_ie: Fix other range format decoding
As it turns out, the other range were affected too, so Anreas wrote
the fix for them as well.

Written-by: Andreas.Eversberg <jolly@eversberg.eu>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-09-02 20:12:19 +02:00
Harald Welte a24026a499 RSL: add rsl_ipac_msg_name() for ipa specific RSL extension names 2011-09-02 12:26:50 +02:00
job 8e4deb677a Added autoconf option for utilities and embedded 2011-09-02 09:10:37 +02:00
job 36b4a20acd Adapted configure options to autoconf default behaviour 2011-09-02 09:10:37 +02:00
Sylvain Munaut 71fd42fede gsm/gsm48_ie: Fix Range 256 format decoding
From the mail:

---
appended is another patch for fixing a bug in the calculation of the
frequency lists. This time the patch is for the "Range 256 format".
The problem is that the operand for the "smod" operation might be
negative, in this case the simplified version won't work as expected.

In the patch I introduced a separate function for "smod" which takes
care of the sign. I have not yet checked if the other formats are also
affected, this would be the case if the "smod" operand can be negative.

There might be other solutions to fix the problem without the need
for a separate function, however I have not thought further about it.

A test vector is the following frequency list ("Range 256 format",
first byte is the length):

 09 8b 1c 83 8c 15 ef 02 2d 30

The correct ARFCNs are

 569 571 576 578 586 608 712 715 719

The uncorrected version would instead return:

 444 457 460 464 569 576 578 586 608

This means four ARFCNs are wrong which will cause problems if for
example the frequency list contains the ARFCNs for hopping.
----

Written-by: Dieter Spaar <spaar@mirider.augusta.de>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-09-01 22:05:29 +02:00
Christoph Fritz ab7c9c766b logging: include stdarg.h for va_list
fixes tiny compile error:

  CC     socket.lo
  In file included from socket.c:13:
  ../include/osmocom/core/logging.h:31: error: expected declaration
specifiers or ‘...’ before ‘va_list’
  make[3]: *** [socket.lo] Error 1
2011-09-01 17:44:35 +02:00
Harald Welte 712691d8d8 add functions for bit-reversal
Sometimes we need stuff like reversing every bit in each byte (but not
the byte-order).
2011-09-01 14:47:31 +02:00
Harald Welte 36c5a3e285 logging: add osmo_vlogp() as vararg / va_list compatible function 2011-08-31 19:40:03 +02:00
Harald Welte d38c8b88d7 doxygen: Add main page for all three libraries 2011-08-30 11:32:56 +02:00
Holger Hans Peter Freyther c2c0ad7832 signal: Fix compiler warning about signedness of constant
Use the u suffix to mark the constant as unsiged integer.

This fixes:
warning: this decimal constant is unsigned only in ISO C90
2011-08-22 15:31:17 +02:00
Harald Welte 924b04072f update .gitignore with Doxyfile.core 2011-08-20 17:40:13 +02:00
Harald Welte 429d2e454d add script to generate http://www.osmocom.org/doc tree structure 2011-08-20 17:40:08 +02:00
Harald Welte 47945f0a8b Make sure 'make distclean' works for doxygen 2011-08-20 17:40:04 +02:00
Harald Welte c7859edf51 consistent Doxyfile naming 2011-08-20 17:39:58 +02:00
Harald Welte 09b4c2275e update makefile.am to support out-of-tree builds
Conflicts:

	Makefile.am
2011-08-20 17:39:45 +02:00