Commit Graph

386 Commits

Author SHA1 Message Date
Alexander Huemer 7d4e2d7a84 libosmocore: rename configure.in -> configure.ac
rename autoconf input file to align with osmocom-bb host applications,
and because that suffix is preferred nowadays.
2011-05-24 17:19:35 +02:00
Alexander Huemer 3d79f53284 libosmocore: add missing AC_LANG_SOURCE for current autoconf
autoconf >=2.68 demands the body of an AC_COMPILE_IFELSE to be wrapped in
an AC_LANG_SOURCE macro, otherwise outputs annoying warnings on the
invocation of `autoreconf -i`. this patch follows that demand.
2011-05-24 17:19:35 +02:00
Harald Welte b5503136fa Import sytem information related definitions + code from openbsc 2011-05-24 15:01:53 +02:00
Holger Hans Peter Freyther 3036612d59 abis_nm: Mark the structs as extern to avoid compiler warning
warning: array ‘abis_nm_obj_class_names’ assumed to have one element
2011-05-23 21:41:34 +02:00
Harald Welte ea4b12aa5d abis_nm: remove abis_nm_obj_class_name / abis_nm_adm_state_name
and export the underlying raw value_string arrays instead:
abis_nm_obj_class_names / abis_nm_adm_state_names.

This permits the caller to use get_string_value() as well as
get_value_string().
2011-05-23 20:41:31 +02:00
Harald Welte 61dc63e354 rename abis_nm_adm_name() to abis_nm_adm_state_name() 2011-05-23 20:30:17 +02:00
Pablo Neira Ayuso 3056d012d3 Merge branch 'master' of git.osmocom.org:libosmocore 2011-05-23 19:01:34 +02:00
Harald Welte f7a1bcce0c abis_nm: import definitions and common code on A-bis OML from OpenBSC 2011-05-22 22:45:16 +02:00
Harald Welte 4185fa5d9b libosmogsm: add ipaccess related header file 2011-05-22 21:57:15 +02:00
Harald Welte 68b1574257 socket: use listen() and SO_REUSEADDR, new osmo_sock_init_ofd() function
osmo_sock_init_ofd() is a wrapper around osmo_sock_init() which will
take care of initializing and registering a 'struct osmo_fd' for the
newly-created socket.
2011-05-22 21:47:29 +02:00
Harald Welte 8265939c5e remove debug printf from socket.c 2011-05-22 20:30:18 +02:00
Harald Welte 13692a6bd3 gsmtap: deal with apps that call gsmtap_send*() with NULL gsmtap_inst 2011-05-22 20:06:11 +02:00
Harald Welte b62b04bbf3 vty: print actual application name rather than always OpenBSC on connect 2011-05-22 19:15:07 +02:00
Harald Welte e476442cf0 GSMTAP/socket code: Check for sys/socket.h and conditionally compile 2011-05-22 12:25:57 +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
Pablo Neira Ayuso 8256076722 logging: fix corrupted output
Harald reported a problem in the logging:
http://lists.osmocom.org/pipermail/openbsc/2011-May/002896.html

Reverting 81e9636454 seems to
fix the problem. However, that workaround looks ugly.

Holger gives us another clue on what was wrong:
http://lists.osmocom.org/pipermail/openbsc/2011-May/002905.html

While digging in the manpage, I found this:

"The functions vprintf(), vfprintf(), vsprintf(), vsnprintf()
are equivalent to the functions printf(), fprintf(), sprintf(),
snprintf(), respectively, except that they are called with a
va_list instead of a variable number of arguments. These functions
do not call the va_end macro. Consequently, the value of ap is
undefined after the call. The application should call va_end(ap)
itself afterwards."
2011-05-19 08:55:32 +02:00
Pablo Neira Ayuso dd93bf46ed logging: fix corrupted output
Harald reported a problem in the logging:
http://lists.osmocom.org/pipermail/openbsc/2011-May/002896.html

Reverting 81e9636454 seems to
fix the problem. However, that workaround looks ugly.

Holger gives us another clue on what was wrong:
http://lists.osmocom.org/pipermail/openbsc/2011-May/002905.html

While digging in the manpage, I found this:

"The functions vprintf(), vfprintf(), vsprintf(), vsnprintf()
are equivalent to the functions printf(), fprintf(), sprintf(),
snprintf(), respectively, except that they are called with a
va_list instead of a variable number of arguments. These functions
do not call the va_end macro. Consequently, the value of ap is
undefined after the call. The application should call va_end(ap)
itself afterwards."
2011-05-19 01:40:43 +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 f5afa18d09 update debian changelog to 0.3.0 2011-05-10 17:29:01 +02:00
Harald Welte b4a78d237c update include paths in debian packaging spec 2011-05-10 11:28:02 +02:00
Harald Welte 7533705ab1 libosmocore: bump library interface version to '1' for new osmo_ names 2011-05-08 14:35:40 +02:00
Pablo Neira Ayuso 1b4a42c3b1 msgfile: use namespace prefix osmo_* and use more descriptive names
Summary of changes:

s/msg_entry/osmo_config_entry/g
s/msg_entries/osmo_config_list/g
s/msg_entry_parse/osmo_config_list_parse/g

minor glitch included in this patch while I was at it:

-#include "linuxlist.h"
+#include <osmocom/core/linuxlist.h>
2011-05-07 13:14:41 +02:00
Pablo Neira Ayuso 2c34867fc3 plugin: use namespace prefix osmo_*
Summary of changes:

s/plugin_load_all/osmo_plugin_load_all/g
2011-05-07 13:00:52 +02:00
Pablo Neira Ayuso 619b8b3292 backtrace: use namespace prefix osmo_*
Summary of changes:

s/backtrace/osmo_backtrace/g
2011-05-07 13:00:52 +02:00
Pablo Neira Ayuso ddcd2afc82 crc: use namespace prefix osmo_*
Summary of changes:

s/crc16_table/osmo_crc16_table/g
s/crc16/osmo_crc16/g
s/crc16_byte/osmo_crc16_byte/g
2011-05-07 13:00:51 +02:00
Pablo Neira Ayuso 87f7b25e56 utils: use namespace prefix osmo_*
Summary of changes:

s/bcd2char/osmo_bcd2char/g
s/char2bcd/osmo_char2bcd/g
s/hexparse/osmo_hexparse/g
s/hexdump/osmo_hexdump/g
s/hexdump_nospc/osmo_hexdump_nospc/g
s/ubit_dump/osmo_ubit_dump/g
s/static_assert/osmo_static_assert/g
2011-05-07 13:00:51 +02:00
Pablo Neira Ayuso 220abab3fa statistics: use namespace prefix osmo_counter*
Summary of changes:

s/struct counter/struct osmo_counter/g
s/counter_inc/osmo_counter_inc/g
s/counter_get/osmo_counter_get/g
s/counter_reset/osmo_counter_reset/g
s/counter_alloc/osmo_counter_alloc/g
s/counter_free/osmo_counter_free/g
s/counters_for_each/osmo_counters_for_each/g
2011-05-07 13:00:51 +02:00
Pablo Neira Ayuso 9111d930a5 write-queue: use namespace prefix osmo_wqueue*
Summary of changes:

s/struct write_queue/struct osmo_wqueue/g
s/write_queue_init/osmo_wqueue_init/g
s/void write_queue_clear/osmo_wqueue_clear/g
s/write_queue_enqueue/osmo_wqueue_enqueue/g
s/write_queue_bfd_cb/osmo_wqueue_bfd_cb/g
2011-05-07 13:00:51 +02:00
Pablo Neira Ayuso a10dd35566 signal: use namespace prefix osmo_signal*
Summary of changes:

s/signal_cbfn/osmo_signal_cbfn/g
s/register_signal_handler/osmo_signal_register_handler/g
s/unregister_signal_handler/osmo_signal_unregister_handler/g
s/dispatch_signal/osmo_signal_dispatch/g
2011-05-07 13:00:51 +02:00
Pablo Neira Ayuso f7f89d0cfe select: use namespace prefix osmo_fd* and osmo_select*
Summary of changes:

s/struct bsc_fd/struct osmo_fd/g
s/bsc_register_fd/osmo_fd_register/g
s/bsc_unregister_fd/osmo_fd_unregister/g
s/bsc_select_main/osmo_select_main/g
2011-05-07 13:00:51 +02:00
Pablo Neira Ayuso 0b21c1c885 timer: use namespace prefix osmo_timer*
Summary of changes:

s/struct timer_list/struct osmo_timer_list/g
s/bsc_add_timer/osmo_timer_add/g
s/bsc_schedule_timer/osmo_timer_schedule/g
s/bsc_del_timer/osmo_timer_del/g
s/bsc_timer_pending/osmo_timer_pending/g
s/bsc_nearest_timer/osmo_timers_nearest/g
s/bsc_prepare_timers/osmo_timers_prepare/g
s/bsc_update_timers/osmo_timers_update/g
s/bsc_timer_check/osmo_timers_check/g
2011-05-07 13:00:51 +02:00
Harald Welte d58ba465f1 GSMTAP: add function to create a 'sink' for gsmtap packets
This can be helpful where we send GSMTAP messages to the loopback
device (localhost, 127.0.0.1) from where the kernel would then
send ICMP reject packets as nobody is listening on that port.
2011-05-04 11:09:21 +02:00
Pablo Neira Ayuso 534ba81328 logging: make sure the output is null-terminated
If we reach the buffer size or snprintf fails, we want to make sure
that the output is null-terminated.
2011-05-04 11:07:13 +02:00
Pablo Neira Ayuso 81e9636454 logging: remove workaround now that _output() has been reworked
This patch removes a workaround to fix some strange memory corruption
now that _output() has been completely reworked and we make use of
snprintf appropriately.
2011-05-04 11:07:13 +02:00
Pablo Neira Ayuso 7503fb8e3e logging: rework _output() function
This patch reworks _output() to handle snprintf() return value
appropriately and to use one single buffer to build the logging
string, instead of four.
2011-05-04 11:07:13 +02:00
Pablo Neira Ayuso f1fae4dd06 logging: several memory allocation belong to tall_log_ctx context
Several talloc_zero in logging use NULL context, use tall_log_ctx
instead.
2011-05-04 11:07:13 +02:00
Pablo Neira Ayuso d6b5195be2 logging: fix missing description of global loglevel
OpenBSC> logging level
  all    Global setting for all subsystems <----- this description was missing
  rll    A-bis Radio Link Layer (RLL)
[...]

This problem was introduced by myself in:
"vty: integration with logging framework"
04139f14b6
2011-05-04 11:07:13 +02:00
Sylvain Munaut 1dd7c84733 core/conv: Only consider error for non-zero soft values
If the input value is '0' it should not really affect the error
since it's just an indecisive bit. We accept this either an internal
'0' (generated via puncture) or as an external '0' (generated via an
external puncturing scheme). A real received bit should never be '0',
it's always gonna be closer to 1 or the other value ...

(thanks to mad@auth.se on the ML for the idea)

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-04-28 22:30:30 +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
Sylvain Munaut f1d3344781 gsm/a5: Add a A5 1&2 implementation
It's always useful to have around

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-04-26 14:40:49 +02:00
Pablo Neira Ayuso 240f01cfa7 include: fix missing extern in osmo_panic* declarations
This patch adds the missing extern to osmo_panic* declarations.
2011-04-26 14:36:52 +02:00
Holger Hans Peter Freyther 28dbfe9bf7 misc: Remove the sys/types.h include from various files
We used this include for the u_int{8,16,32}_t types but we do
not need this anymore.
2011-04-18 16:57:04 +02:00
Holger Hans Peter Freyther a9f526a1ab stats: Fix the compiler warnings
Do not remove the const, include strings.h for strcmp
2011-04-18 16:46:35 +02:00
Daniel Willmann 334c8e1780 Add a function to search for a counter by name 2011-04-09 20:52:18 +02:00
Daniel Willmann 2d42ddeba3 Add functions to search for rate counters by name
* rate_ctr_get_group_by_name_idx, rate_ctr_get_by_name
2011-04-09 20:52:12 +02:00
Holger Hans Peter Freyther 952a18ed19 logging: Add the 'all' category back to the log level command
This is required to be able to set a global log level. The all
command is emitted by the VTY logging code.
2011-03-29 17:03:56 +02:00
Holger Hans Peter Freyther ff0670edf3 vty: Fix a memory leak in the vty description command
Before assigning a new string, free the previous one. This
assume that it was allocated with talloc which should be true
for the osmocom users.
2011-03-29 13:24:21 +02:00
Pablo Neira Ayuso 3abad6a6f9 utils: move OSMO_SNPRINT_RET() macro definition to osmocom/core/utils.h
This is used by the logging to vty conversion functions by now, but it
may be of help for other functions that plan to use snprintf().
2011-03-28 20:00:45 +02:00
Pablo Neira Ayuso 70004fcc6d vty: move vty_out_rate_ctr_group prototype to osmocom/vty/misc.h
Before this patch, it was in osmocom/core/rate_ctr.h
2011-03-28 20:00:45 +02:00
Pablo Neira Ayuso dc35dbee95 write_queue: use full path of includes in osmocom/core/write_queue.h 2011-03-28 20:00:45 +02:00