Commit Graph

982 Commits

Author SHA1 Message Date
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
Tobias Engel 24e5e05b6f Add UMTS RRC message types 2013-02-21 11:17:10 +01:00
Harald Welte cd6ed82d1f Fix log level "everything" and make it equal to "debug"
As Holger points out "logging level XXX everything" wasn't working, as
it sets category->loglevel to 0, which is checked in osmo_vlogp() and
will never get logged.
2013-02-19 11:57:14 +01:00
Katerina Barone-Adesi c28c6a02d2 misc: Doxygen tweaks: fixed some typos and minor errors
Doxygen generates quite a lot of warnings on libosmocore. Some of them
are obvious typos - this patch aims to fix such low-hanging fruit.
2013-02-15 13:27:59 +01:00
Holger Hans Peter Freyther a5007dbdc5 debian: Re-enable the debug packages
Remove the .dirs/.install as things will go wrong then. debhelper
will try to install the debug symbols before they were created. Thanks
to Jan for pointing that out.
2013-02-13 20:00:54 +01:00
Holger Hans Peter Freyther b3f304bc26 debian: Update the change log for a new package 2013-02-13 18:14:29 +01:00
Harald Welte d17aa59c3e VTY: don't show HIDDEN or DEPRECATED vty commands in ? completion
This hides HIDDEN or DEPRECATED commands from showing up when the
full list of commands is inquired with '?' at any given point in the
command tree.  Only if the hidden/deprecated command is already typed
in partially, then it will still tab-complete.
2013-02-12 11:11:34 +01:00
Harald Welte 80d30fe803 vty/command.c: Cosmetic cleanup
this is just changing some of the code to reduce the way too high level
of indentation and thus improve readability.
2013-02-12 11:08:57 +01:00
Harald Welte 647e39f172 abis_nm: add parenthesis for new abis_nm_debugp_foh() macro
without this, we break e.g. the openbsc build...
2013-02-10 17:02:18 +01:00
Harald Welte 868a5c4782 turn abis_nm_debugp_foh() into a macro
this will avoid printing 'abis_nm.c' as the filename in the log, which
is pretty useless during debugging.  We want to know where
abis_nm_debugp_foh() is being used from, not where it is implemented.
2013-02-10 09:30:28 +01:00
Sylvain Munaut 25bcb6cece doc: Fix typo in Doxyfile.core.in causing sources to be ignored
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-02-08 13:50:13 +01:00
Sylvain Munaut 9adfda2ca3 core/crc: Fix the 64 bits implementation
We used 1ULL at one place and not the other ... at the same time,
we now use (uintXX_t) so that the proper type is used each time.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-02-01 20:37:03 +01:00
Holger Hans Peter Freyther 49f4e5be9f fr_test: Speculative build fix for FreeBSD 2013-01-15 21:18:02 +01:00
Holger Hans Peter Freyther 97602d9734 fr: Begin with a GRE/FrameRelay test due the recent regression
The framerelay code is seldomly used and the socket clean ups introduced
a regression. Create a testcase that will work as a user not having the
right capabilities to create raw sockets.

We have to make sure that this test is working even when not ran as root.
The easiest way to do this is to provide our own socket implementation.
This is done with dlopen/dlsym to convert the raw socket request to an UDP
one.
2013-01-15 20:06:40 +01:00
Pablo Neira Ayuso e04a14d9a2 socket: fix osmo_sock_init with SOCK_RAW and IPPROTO_RAW
getaddrinfo returns EAI_SERVICE (-8) if that combination is used.

More information available in here:

http://sourceware.org/bugzilla/show_bug.cgi?id=15015

Reported by Holger Hans Peter Freyther.

While at it, this patch also removes hints.ai_flags = 0 as memset
to zero already happened just a bit before that.
2013-01-15 20:06:39 +01:00
Evgeny Zverev 06ddf8bd24 Fix build on Cygwin 2013-01-12 15:10:58 +01:00
Harald Welte de6e4983e7 add some missing doxygen annotation for libosmocore functions 2013-01-11 09:43:32 +01:00
Alex Badea 9043fe57e8 doxyfiles: refer paths to @srcdir@
When building out-of-srcdir, paths such as "src/gsm" will not find any
source files.  Since the Doxyfiles are preprocessed, we can prepend
@srcdir@ to fix that.

Signed-off-by: Alex Badea <vamposdecampos@gmail.com>
2013-01-06 00:42:26 +01:00
Alex Badea 695e5fb049 tests/timer: tweak path to config.h
When building out-of-srcdir, "../../config.h" fails to reach config.h
because the compiler is invoked in $builddir/tests/, not
$builddir/tests/timer/.  Use "../config.h" instead; this also works
for in-srcdir builds.

Signed-off-by: Alex Badea <vamposdecampos@gmail.com>
2013-01-06 00:42:26 +01:00
Christian Vogel 854debc32c Replace obsolete automake AM_CONFIG_HEADER.
This fixes the following complaint by autoconf 2.69-1, automake 1.13.1-1.

:  configure.ac:80: error: 'AM_CONFIG_HEADER': this macro is obsolete.
:      You should use the 'AC_CONFIG_HEADERS' macro instead.
:      /usr/share/aclocal-1.13/obsolete-err.m4:12: AM_CONFIG_HEADER is expan
:      configure.ac:80: the top level

Automake 1:1.11.3-1ubuntu2, autoconf 2.68-1ubuntu2 don't even emit a warning
without, and work just fine with this patch.

Signed-off-by: Christian Vogel <vogelchr@vogel.cx>
2013-01-06 00:42:26 +01:00
Holger Hans Peter Freyther b73d191c0b debian: Bump the changelog and package osmo-arfcn 2013-01-04 10:10:52 +01:00
Sylvain Munaut 4d8eea48f2 vty: Do better filtering of arguments, optional args particularly
This is essentially http://patchwork.diac24.net/patch/271/ forward
ported to libosmovty

Original-by: Paul Jakma <paul@quagga.net>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-01-03 22:34:26 +01:00
Sylvain Munaut 01e0604637 core/bits: Prevent osmo_revbytebits_buf stack trashing
The second loop in osmo_revbytebits_buf() in src/bits.c grabs
4 bytes each iteration, which can easily go past the supplied
input in some cases.

Compiled with -fstack-protector , I get a "stack smashing detected"
in the bits test.

From: Nils O. Selåsdal <noselasd@fiane.dyndns.org>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-01-03 09:37:16 +01:00
Daniel Willmann 13bb169d71 tests: Don't delete atconfig in clean
This file is created in ./configure so we shouldn't remove it with make.
Otherwise ./configure && make clean && make check fails with:

make[3]: *** No rule to make target `atconfig', needed by `check-local'.
Stop.
2012-12-26 10:56:14 +01:00
Holger Hans Peter Freyther af723a4ed4 lapd: Fix compiler warnings in the lapd code
lapd_test.c: In function ‘ms_to_bts_l1_cb’:
lapd_test.c:192:6: warning: variable ‘rc’ set but not used [-Wunused-but-set-variable]
lapd_test.c:199:1: warning: no return statement in function returning non-void [-Wreturn-type]
lapd_test.c: In function ‘main’:
lapd_test.c:355:2: warning: implicit declaration of function ‘osmo_init_logging’ [-Wimplicit-function-declaration]
2012-12-26 10:51:00 +01:00
Daniel Willmann e523392c2c lapd: Check in rslms_rx_rll() if lapdm context was initialized earlier
This was found while implementing handover on a sysmobts. When we
receive a channel release request for a channel that was never really
activated (set_lapdm_context() was not called) we segfault in
lapd_recv_dlsap().

We now return early with -EINVAL in rslms_rx_rll() if we receive a
message that assumes set_lapdm_context() was already called.

These are:
* RSL_MT_UNIT_DATA_REQ
* RSL_MT_DATA_REQ
* RSL_MT_SUSP_REQ
* RSL_MT_REL_REQ

A test case was added to trigger the issue.
2012-12-26 10:48:01 +01:00
Andreas Eversberg 0167596c2b Add tlvp_val16_unal() / tlvp_val32_unal() to align 16 and 32 bit values
This is required for CPUs < armv6, to access 16 and 32 values at right
memory locations.
2012-12-18 23:47:45 +01:00
Sylvain Munaut 31659f72cb core: Fix missing include in msgfile.c for getline
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2012-12-12 00:00:43 +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
Sylvain Munaut c44310e351 utils/osmo-arfcn: Implement option to get ARFCN from frequency
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2012-12-11 23:45:03 +01:00
Sylvain Munaut 5572031749 gsm: Add method to find ARFCN based on frequency
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2012-12-11 23:44:41 +01:00
Harald Welte 6e264ae3cd osmo-arfcn: add support for PCS band 2012-12-06 20:58:35 +01:00
Holger Hans Peter Freyther 0357e9b375 rsl: Add the 9.3.20 release mode enum to be used in OpenBSC 2012-12-06 11:58:33 +01:00
Holger Hans Peter Freyther 68f9447744 sms: Print 'network' or 'mobile' when creating the SMC/SMR 2012-12-06 11:58:33 +01:00
Sylvain Munaut c1e9be95c2 gsm/a5: Return -ENOTSUP if the selected cipher is not supported
Extracted from a patch by Max Suraev Max.Suraev@fairwaves.ru>

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2012-12-06 08:23:02 +01:00
Holger Hans Peter Freyther 8c01231681 lapd: Use LOGL_ERROR for messgaes that are wrong in the given context
Log message that are either too big or have the C/R bit set as error.
2012-11-26 16:52:23 +01:00
Holger Hans Peter Freyther 579fb09eac misc: Use static const struct for LAPD and Abis 2012-11-22 10:54:23 +01:00
Holger Hans Peter Freyther 9473c5d75d sms: Mark the state dispatch table as static const
GCC 4.7.2 was already smart enough to see that the table is const
so there is no change in the generated assembly code. For some reason
the dispatch is still going through one relocation.
2012-11-22 10:50:52 +01:00
Holger Hans Peter Freyther 1c4c373b9f sms: Fix typos in the comments and log messages. 2012-11-22 00:41:50 +01:00
Holger Hans Peter Freyther bcf125c524 smr: Introduce an id and prefix all log messages with SMR(ID)
When OpenBSC is handling more than one message at a time it is difficult
to see which log message belongs to which SMR instance. Introduce a
uint64_t id that can be set to the row_id/message_id and prefix all
log messages with SMR(ID).

This change is ABI and API incompatible with previous versions of
libosmogsm.
2012-11-22 00:41:50 +01:00
Holger Hans Peter Freyther 33e8a87cd7 smc: Introduce an id and prefix all log messages with SMC(ID)
When OpenBSC is handling more than one message at a time it is difficult
to see which log message belongs to which SMC. Introduce a uint64_t id
that can be set to the row_id/message_id and prefix all log messages
with SMC(ID).

This change is ABI and API incompatible with previous versions of
libosmogsm.

Example:
SMC(100) instance created
SMC(100) message MNSMS-EST-REQ received in state IDLE
2012-11-22 00:41:49 +01:00
Harald Welte 6643386f3f actually install osmo-arfcn and osmo-auc-gen as part of 'make install' 2012-11-16 21:36:17 +01:00
Steve Markgraf 5905d5be60 msgb: fix msgb_pull_u*()
msgb_pull returns a pointer to the new begin of the
buffer, unlike msgb_get(), where those functions
were originally taken from.

Signed-off-by: Steve Markgraf <steve@steve-m.de>
2012-11-14 20:14:33 +01:00
Holger Hans Peter Freyther 866fc919ac smc: Fix a typo in the smc code 2012-11-14 17:20:33 +01:00
Holger Hans Peter Freyther d38e0ef82a smc: Make it possible to include gsm0411_smc.h as first header file
The code embeds the timer so one needs to include the header file.
2012-11-14 17:20:33 +01:00
Holger Hans Peter Freyther 09161595bd smc: Print the current state of the SMS
When the connection may not released print the name of the current
state to ease with debugging and verification that this is not a
valid state transition.
2012-11-11 10:35:33 +01:00
Holger Hans Peter Freyther e2a7c93da3 sms: Remove the commented out code that was the default in OpenBSC
This code got copied from OpenBSC and we used the network specific
and private numbering plan. Remove it as it can be easily set.
2012-11-11 09:45:40 +01:00
Holger Hans Peter Freyther 7ae3ac8b42 sms: Reduce the logging level to debug
<001c> gsm0411_smr.c:175 TX: MNSMS-REL-REQ adds little value so
I am reducing it to a debug statement.
2012-11-11 09:35:23 +01:00