osmocom-bb.git
12 years agoabis_nm: Forward declare the used enums
Holger Hans Peter Freyther [Mon, 30 May 2011 22:42:38 +0000 (00:42 +0200)]
abis_nm: Forward declare the used enums

This file is using enums in that might or might not be
known to the compiler. Forward declare them.

12 years agogsmtap_util: Remove msg_free from the wq call back
Sylvain Munaut [Sun, 29 May 2011 17:48:15 +0000 (19:48 +0200)]
gsmtap_util: Remove msg_free from the wq call back

write_queue already frees the message after the callback is called.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
12 years agogsm/sysinfo: Fix rsl2sitype array size
Sylvain Munaut [Sun, 29 May 2011 13:39:04 +0000 (15:39 +0200)]
gsm/sysinfo: Fix rsl2sitype array size

0xff is the maximum value ... so there is 256 elements.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
12 years agogsm/sysinfo: don't include netinet/in.h
Harald Welte [Sun, 29 May 2011 13:37:49 +0000 (15:37 +0200)]
gsm/sysinfo: don't include netinet/in.h

12 years agobitvec: add missing stdint.h
Harald Welte [Sun, 29 May 2011 13:37:38 +0000 (15:37 +0200)]
bitvec: add missing stdint.h

12 years agosocket: remove unused IPv4 related header includes
Harald Welte [Sun, 29 May 2011 13:26:48 +0000 (15:26 +0200)]
socket: remove unused IPv4 related header includes

12 years agosocket: Skip ifa's without ifa->ifa_addr
Harald Welte [Tue, 24 May 2011 19:31:53 +0000 (21:31 +0200)]
socket: Skip ifa's without ifa->ifa_addr

Apparently getifaddrs() returns ifa's without an ifa_addr set.

12 years agoImport abis_nm_{chcomb4pchan,pchan4chcomb}() from openbsc
Harald Welte [Tue, 24 May 2011 15:15:12 +0000 (17:15 +0200)]
Import abis_nm_{chcomb4pchan,pchan4chcomb}() from openbsc

12 years agolibosmocore: rename configure.in -> configure.ac
Alexander Huemer [Tue, 24 May 2011 13:16:14 +0000 (15:16 +0200)]
libosmocore: rename configure.in -> configure.ac

rename autoconf input file to align with osmocom-bb host applications,
and because that suffix is preferred nowadays.

12 years agolibosmocore: add missing AC_LANG_SOURCE for current autoconf
Alexander Huemer [Tue, 24 May 2011 13:16:13 +0000 (15:16 +0200)]
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.

12 years agoImport sytem information related definitions + code from openbsc
Harald Welte [Tue, 24 May 2011 13:01:53 +0000 (15:01 +0200)]
Import sytem information related definitions + code from openbsc

12 years agoabis_nm: Mark the structs as extern to avoid compiler warning
Holger Hans Peter Freyther [Mon, 23 May 2011 19:41:34 +0000 (21:41 +0200)]
abis_nm: Mark the structs as extern to avoid compiler warning

warning: array ‘abis_nm_obj_class_names’ assumed to have one element

12 years agoabis_nm: remove abis_nm_obj_class_name / abis_nm_adm_state_name
Harald Welte [Mon, 23 May 2011 18:41:31 +0000 (20:41 +0200)]
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().

12 years agorename abis_nm_adm_name() to abis_nm_adm_state_name()
Harald Welte [Mon, 23 May 2011 18:30:17 +0000 (20:30 +0200)]
rename abis_nm_adm_name() to abis_nm_adm_state_name()

13 years agoabis_nm: import definitions and common code on A-bis OML from OpenBSC
Harald Welte [Sun, 22 May 2011 20:45:16 +0000 (22:45 +0200)]
abis_nm: import definitions and common code on A-bis OML from OpenBSC

13 years agolibosmogsm: add ipaccess related header file
Harald Welte [Sun, 22 May 2011 19:57:15 +0000 (21:57 +0200)]
libosmogsm: add ipaccess related header file

13 years agosocket: use listen() and SO_REUSEADDR, new osmo_sock_init_ofd() function
Harald Welte [Sun, 22 May 2011 19:47:29 +0000 (21:47 +0200)]
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.

13 years agoremove debug printf from socket.c
Harald Welte [Sun, 22 May 2011 18:30:18 +0000 (20:30 +0200)]
remove debug printf from socket.c

13 years agogsmtap: deal with apps that call gsmtap_send*() with NULL gsmtap_inst
Harald Welte [Sun, 22 May 2011 18:06:11 +0000 (20:06 +0200)]
gsmtap: deal with apps that call gsmtap_send*() with NULL gsmtap_inst

13 years agovty: print actual application name rather than always OpenBSC on connect
Harald Welte [Sun, 22 May 2011 17:15:07 +0000 (19:15 +0200)]
vty: print actual application name rather than always OpenBSC on connect

13 years agoGSMTAP/socket code: Check for sys/socket.h and conditionally compile
Harald Welte [Sun, 22 May 2011 10:25:57 +0000 (12:25 +0200)]
GSMTAP/socket code: Check for sys/socket.h and conditionally compile

13 years agogsmtap: rework GSMTAP API to be more future-proof
Harald Welte [Sat, 21 May 2011 16:54:32 +0000 (18:54 +0200)]
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)

13 years agologging: fix corrupted output
Pablo Neira Ayuso [Thu, 19 May 2011 06:55:32 +0000 (08:55 +0200)]
logging: fix corrupted output

Harald reported a problem in the logging:
http://lists.osmocom.org/pipermail/openbsc/2011-May/002896.html

Reverting 81e9636454294ae10ef9bc8bf149dd0248afce76 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."

13 years agoapp: Introduce some routines to help with application startup
Holger Hans Peter Freyther [Thu, 12 May 2011 11:46:33 +0000 (13:46 +0200)]
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.

13 years agoupdate debian changelog to 0.3.0
Harald Welte [Tue, 10 May 2011 15:29:01 +0000 (17:29 +0200)]
update debian changelog to 0.3.0

13 years agoupdate include paths in debian packaging spec
Harald Welte [Tue, 10 May 2011 09:28:02 +0000 (11:28 +0200)]
update include paths in debian packaging spec

13 years agolibosmocore: bump library interface version to '1' for new osmo_ names
Harald Welte [Sun, 8 May 2011 12:35:40 +0000 (14:35 +0200)]
libosmocore: bump library interface version to '1' for new osmo_ names

13 years agomsgfile: use namespace prefix osmo_* and use more descriptive names
Pablo Neira Ayuso [Sat, 7 May 2011 11:01:41 +0000 (13:01 +0200)]
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>

13 years agoplugin: use namespace prefix osmo_*
Pablo Neira Ayuso [Sat, 7 May 2011 10:50:08 +0000 (12:50 +0200)]
plugin: use namespace prefix osmo_*

Summary of changes:

s/plugin_load_all/osmo_plugin_load_all/g

13 years agobacktrace: use namespace prefix osmo_*
Pablo Neira Ayuso [Sat, 7 May 2011 10:45:47 +0000 (12:45 +0200)]
backtrace: use namespace prefix osmo_*

Summary of changes:

s/backtrace/osmo_backtrace/g

13 years agocrc: use namespace prefix osmo_*
Pablo Neira Ayuso [Sat, 7 May 2011 10:43:12 +0000 (12:43 +0200)]
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

13 years agoutils: use namespace prefix osmo_*
Pablo Neira Ayuso [Sat, 7 May 2011 10:43:08 +0000 (12:43 +0200)]
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

13 years agostatistics: use namespace prefix osmo_counter*
Pablo Neira Ayuso [Sat, 7 May 2011 10:43:04 +0000 (12:43 +0200)]
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

13 years agowrite-queue: use namespace prefix osmo_wqueue*
Pablo Neira Ayuso [Sat, 7 May 2011 10:42:51 +0000 (12:42 +0200)]
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

13 years agosignal: use namespace prefix osmo_signal*
Pablo Neira Ayuso [Sat, 7 May 2011 10:42:45 +0000 (12:42 +0200)]
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

13 years agoselect: use namespace prefix osmo_fd* and osmo_select*
Pablo Neira Ayuso [Sat, 7 May 2011 10:42:40 +0000 (12:42 +0200)]
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

13 years agotimer: use namespace prefix osmo_timer*
Pablo Neira Ayuso [Sat, 7 May 2011 10:42:28 +0000 (12:42 +0200)]
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

13 years agoGSMTAP: add function to create a 'sink' for gsmtap packets
Harald Welte [Wed, 27 Apr 2011 08:57:49 +0000 (10:57 +0200)]
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.

13 years agologging: make sure the output is null-terminated
Pablo Neira Ayuso [Tue, 3 May 2011 20:32:48 +0000 (22:32 +0200)]
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.

13 years agologging: remove workaround now that _output() has been reworked
Pablo Neira Ayuso [Tue, 3 May 2011 20:32:48 +0000 (22:32 +0200)]
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.

13 years agologging: rework _output() function
Pablo Neira Ayuso [Tue, 3 May 2011 20:32:43 +0000 (22:32 +0200)]
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.

13 years agologging: several memory allocation belong to tall_log_ctx context
Pablo Neira Ayuso [Tue, 3 May 2011 20:32:42 +0000 (22:32 +0200)]
logging: several memory allocation belong to tall_log_ctx context

Several talloc_zero in logging use NULL context, use tall_log_ctx
instead.

13 years agologging: fix missing description of global loglevel
Pablo Neira Ayuso [Tue, 3 May 2011 20:32:32 +0000 (22:32 +0200)]
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"
04139f14b6197e3ec996133a945af3fa8a68fb7a

13 years agocore/conv: Only consider error for non-zero soft values
Sylvain Munaut [Thu, 28 Apr 2011 20:30:30 +0000 (22:30 +0200)]
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>
13 years agocore/conv: Add some generic code for convolutional coding/decoding
Sylvain Munaut [Sat, 23 Apr 2011 14:09:19 +0000 (16:09 +0200)]
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>
13 years agogsm/a5: Add a A5 1&2 implementation
Sylvain Munaut [Sat, 23 Apr 2011 13:34:11 +0000 (15:34 +0200)]
gsm/a5: Add a A5 1&2 implementation

It's always useful to have around

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
13 years agoinclude: fix missing extern in osmo_panic* declarations
Pablo Neira Ayuso [Tue, 26 Apr 2011 01:07:46 +0000 (03:07 +0200)]
include: fix missing extern in osmo_panic* declarations

This patch adds the missing extern to osmo_panic* declarations.

13 years agomisc: Remove the sys/types.h include from various files
Holger Hans Peter Freyther [Mon, 18 Apr 2011 14:52:55 +0000 (16:52 +0200)]
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.

13 years agostats: Fix the compiler warnings
Holger Hans Peter Freyther [Mon, 18 Apr 2011 14:45:45 +0000 (16:45 +0200)]
stats: Fix the compiler warnings

Do not remove the const, include strings.h for strcmp

13 years agoAdd a function to search for a counter by name
Daniel Willmann [Fri, 8 Apr 2011 08:46:19 +0000 (10:46 +0200)]
Add a function to search for a counter by name

13 years agoAdd functions to search for rate counters by name
Daniel Willmann [Fri, 8 Apr 2011 08:46:18 +0000 (10:46 +0200)]
Add functions to search for rate counters by name

* rate_ctr_get_group_by_name_idx, rate_ctr_get_by_name

13 years agologging: Add the 'all' category back to the log level command
Holger Hans Peter Freyther [Tue, 29 Mar 2011 15:03:56 +0000 (17:03 +0200)]
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.

13 years agovty: Fix a memory leak in the vty description command
Holger Hans Peter Freyther [Thu, 24 Feb 2011 13:20:41 +0000 (14:20 +0100)]
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.

13 years agoutils: move OSMO_SNPRINT_RET() macro definition to osmocom/core/utils.h
Pablo Neira Ayuso [Mon, 28 Mar 2011 17:24:22 +0000 (19:24 +0200)]
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().

13 years agovty: move vty_out_rate_ctr_group prototype to osmocom/vty/misc.h
Pablo Neira Ayuso [Mon, 28 Mar 2011 17:24:21 +0000 (19:24 +0200)]
vty: move vty_out_rate_ctr_group prototype to osmocom/vty/misc.h

Before this patch, it was in osmocom/core/rate_ctr.h

13 years agowrite_queue: use full path of includes in osmocom/core/write_queue.h
Pablo Neira Ayuso [Mon, 28 Mar 2011 17:24:20 +0000 (19:24 +0200)]
write_queue: use full path of includes in osmocom/core/write_queue.h

13 years agobitvec: add bitvec_find_first_bit_pos() from gsm/rxlev_stat.c
Pablo Neira Ayuso [Mon, 28 Mar 2011 17:24:19 +0000 (19:24 +0200)]
bitvec: add bitvec_find_first_bit_pos() from gsm/rxlev_stat.c

This patch adds bitvec_find_bit_pos() to bitvec.c where it really
belongs to. Before this patch used to be part of gsm/rxlev_stat.c

13 years agocore/bits: Make sbit_t a signed type (so that the math works)
Sylvain Munaut [Sun, 27 Mar 2011 09:35:40 +0000 (11:35 +0200)]
core/bits: Make sbit_t a signed type (so that the math works)

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
13 years agoinclude: reorganize headers file to include/osmocom/[gsm|core]
Pablo Neira Ayuso [Tue, 22 Mar 2011 15:36:13 +0000 (16:36 +0100)]
include: reorganize headers file to include/osmocom/[gsm|core]

This patch moves all GSM-specific definitions to include/osmocom/gsm.
Moreover, the headers in include/osmocore/ have been moved to
include/osmocom/core.

This has been proposed by Harald Welte and Sylvain Munaunt.

Tested with `make distcheck'.

Signed-off-by: Pablo Neira Ayuso <pablo@gnumonks.org>
13 years agoThis patch moves the GSM-specific functions to the new library
Pablo Neira Ayuso [Wed, 23 Mar 2011 17:08:08 +0000 (18:08 +0100)]
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>
13 years agovty: integration with logging framework
Pablo Neira Ayuso [Wed, 9 Mar 2011 12:05:08 +0000 (13:05 +0100)]
vty: integration with logging framework

The logging categories are registered by the applications, like
osmo-nitb, during startup. Thus, the VTY have to provide the logging
commands according to the logging categories that the application
has registered.

Before this patch, the VTY contained the logging categories
hardcoded. Thus, any change in the logging categories by the
application would not be shown by the VTY.

So far, this was not a problem because all applications used the
same logging categories. However, according to what Harald told
me, this may be a problem in the future.

This patch resolve the lack of integration between the logging
framework and the VTY by generating the VTY logging commands
from the logging categories registered.

Since this patch changes one function of the libosmocore API,
it follows another patch for the openbsc application to get in
sync with the new function layout.

I have reworked and renamed the functions:

 * log_vty_category_string()
 * log_vty_level_string()

to provide the new ones that generate the exact output that VTY
requires.

This patch does not release the memory allocated by
talloc_zero_size() to store the VTY strings for the commands
and the description. I found no exit function that can clean
up resources that were allocated.

13 years agoTLV: Add tv_fixed_put() and msgb_tv_fixed_put()
Harald Welte [Sat, 5 Mar 2011 13:32:50 +0000 (14:32 +0100)]
TLV: Add tv_fixed_put() and msgb_tv_fixed_put()

This is for a Tag-Value type with fixed-length value (len > 1)

13 years agoMerge branch 'master' of git.osmocom.org:libosmocore
Harald Welte [Wed, 2 Mar 2011 23:27:15 +0000 (00:27 +0100)]
Merge branch 'master' of git.osmocom.org:libosmocore

13 years agoLOGGING: Use host.app_info->name instead of FIXME
Harald Welte [Thu, 24 Feb 2011 22:47:57 +0000 (23:47 +0100)]
LOGGING: Use host.app_info->name instead of FIXME

This should put a useful syslog identity in place.

13 years agorxlev_stat: Fix compiler warning
Harald Welte [Sat, 19 Feb 2011 15:35:47 +0000 (16:35 +0100)]
rxlev_stat: Fix compiler warning

13 years agovty: Revert Makefile.am change for libosmocore dependency
Harald Welte [Sat, 19 Feb 2011 07:10:51 +0000 (16:10 +0900)]
vty: Revert Makefile.am change for libosmocore dependency

13 years agoLOGGING: remove duplicated code between vty-logging and cfg-logging
Harald Welte [Fri, 18 Feb 2011 20:03:27 +0000 (21:03 +0100)]
LOGGING: remove duplicated code between vty-logging and cfg-logging

13 years agoLOGGING: Add missing 'nat' subsystem
Harald Welte [Fri, 18 Feb 2011 19:39:36 +0000 (20:39 +0100)]
LOGGING: Add missing 'nat' subsystem

13 years agoLOGGING: configure logging from the vty
Harald Welte [Fri, 18 Feb 2011 19:37:04 +0000 (20:37 +0100)]
LOGGING: configure logging from the vty

We can now configure logging to (multiple) files, stderr and syslog
from the vty command line in a persistent way (config file)

13 years agoLOGGING: Add syslog log target
Harald Welte [Thu, 17 Feb 2011 14:56:56 +0000 (15:56 +0100)]
LOGGING: Add syslog log target

13 years agoLOGGING: Pass the log level down to the log target output function
Harald Welte [Thu, 17 Feb 2011 14:52:39 +0000 (15:52 +0100)]
LOGGING: Pass the log level down to the log target output function

This will be required for mapping osmocore log levels to syslog priorities.

13 years agowrite_queue: Only pop the queue if it is not empty
Holger Hans Peter Freyther [Mon, 14 Feb 2011 23:42:19 +0000 (00:42 +0100)]
write_queue: Only pop the queue if it is not empty

It is possible that the queue is cleared after the select
and before the callback for writable is called. Check if
the list is not empty brefore taking an item out of it.

13 years ago[utils] introduce ubit_dump to dump buffers of unpacked bits
Harald Welte [Tue, 8 Feb 2011 15:56:23 +0000 (16:56 +0100)]
[utils] introduce ubit_dump to dump buffers of unpacked bits

13 years ago[utils] add 'bitdump' function for bitfields
Harald Welte [Tue, 8 Feb 2011 15:55:03 +0000 (16:55 +0100)]
[utils] add 'bitdump' function for bitfields

13 years agogsmtap: The TETRA_AACH was defined twice, remove one, renumber
Holger Hans Peter Freyther [Fri, 28 Jan 2011 09:13:41 +0000 (10:13 +0100)]
gsmtap: The TETRA_AACH was defined twice, remove one, renumber

The GSMTAP_TETRA_AACH was defined twice. On the tetra list we
decided to remove the second entry and renumber the list as no
one is using this yet.

13 years agologging: Add isup,m2ua,pcap from the cellmgr.
Holger Hans Peter Freyther [Sat, 22 Jan 2011 22:17:21 +0000 (23:17 +0100)]
logging: Add isup,m2ua,pcap from the cellmgr.

This is something that we should generate dynamically from
the log_info as well. This is adding bits from the cellmgr_ng.

13 years agoubit2pbit flushes at the wrong moment, added one note to bits.h
Christian Vogel [Sat, 22 Jan 2011 21:48:37 +0000 (22:48 +0100)]
ubit2pbit flushes at the wrong moment, added one note to bits.h

(e.g. input2[] test sequence from testra/crc_test
 decodes incorrectly to packed bits: 90 b0 3e 80 03 87 53 bd 6f 08,
 this patch fixes it)

13 years agobits: Add extended options version of pbit2ubit and ubit2pbit
Sylvain Munaut [Fri, 21 Jan 2011 11:22:30 +0000 (12:22 +0100)]
bits: Add extended options version of pbit2ubit and ubit2pbit

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
13 years ago[BITS] introduce new packed/unpacked bit conversion routines
Harald Welte [Wed, 19 Jan 2011 09:10:16 +0000 (10:10 +0100)]
[BITS] introduce new packed/unpacked bit conversion routines

13 years ago[gsmtap] extend GSMTAP for TETRA
Harald Welte [Wed, 19 Jan 2011 08:40:59 +0000 (09:40 +0100)]
[gsmtap] extend GSMTAP for TETRA

13 years agogsmtap.h: Add some more comments
Harald Welte [Tue, 18 Jan 2011 20:38:12 +0000 (21:38 +0100)]
gsmtap.h: Add some more comments

13 years agomsgb: Make sure at compile time that headroom is smaller than size
Holger Hans Peter Freyther [Sun, 16 Jan 2011 16:38:22 +0000 (17:38 +0100)]
msgb: Make sure at compile time that headroom is smaller than size

All current code is using constants to allocate the msgb with
headroom. Use a static_assert to make sure that the headroom
is smaller than the size. This makes API misusage unlikely to
happen.

13 years agomisc: Move the static_assert from logging to the utils
Holger Hans Peter Freyther [Sun, 16 Jan 2011 16:37:27 +0000 (17:37 +0100)]
misc: Move the static_assert from logging to the utils

This is just an ordinary macro, no specific reason to
have it in logging.h. This was compile tested with code
from our osmo family.

13 years agogsm 03.41: fix GSM341_MSG_CODE macro argument
Alex Badea [Sat, 15 Jan 2011 17:43:42 +0000 (19:43 +0200)]
gsm 03.41: fix GSM341_MSG_CODE macro argument

One usage of the "ms" argument is typoed as "msg".  Fix it to prevent
subtle future failures.  Also paranthesize the macro argument for good
measure.

Signed-off-by: Alex Badea <vamposdecampos@gmail.com>
13 years agodebian: Make the -dev package depend on the normal one
Holger Hans Peter Freyther [Thu, 13 Jan 2011 11:31:25 +0000 (12:31 +0100)]
debian: Make the -dev package depend on the normal one

Make libosmocore-dev depend on libosmocore. Otherwise
we only end up with the libosmocore.a files installed
and then have various issues with the link order when
linking OpenBSC and such.

13 years agodebian: Switch to the 3.0 git format, update version, fix depends
Holger Hans Peter Freyther [Thu, 13 Jan 2011 10:09:44 +0000 (18:09 +0800)]
debian: Switch to the 3.0 git format, update version, fix depends

Switch to the git format as this can generate the source directly
from the git checkout. Increase the version number to 0.1.27 as this
is the latest tag, depend on autoconf, automake and libtool and use
autoreconf when building to be able to directly build from a git
clone.

13 years agovty: Fix typo testing return value of bind
Sylvain Munaut [Mon, 3 Jan 2011 21:19:40 +0000 (22:19 +0100)]
vty: Fix typo testing return value of bind

Thanks to playya__ (Dr. Fred) on IRC for pointing this out

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
13 years agosmscb: Add definition of a warning message
Holger Hans Peter Freyther [Wed, 29 Dec 2010 20:14:20 +0000 (21:14 +0100)]
smscb: Add definition of a warning message

13 years agosmscb: Ignore the very simple test application.
Holger Hans Peter Freyther [Wed, 29 Dec 2010 20:13:44 +0000 (21:13 +0100)]
smscb: Ignore the very simple test application.

13 years agosmscb: Mention 23.041 and fix the size of the update number
Holger Hans Peter Freyther [Wed, 29 Dec 2010 11:00:01 +0000 (12:00 +0100)]
smscb: Mention 23.041 and fix the size of the update number

13 years agosmscb: Add some simple decoding routines for SMSCB.
Holger Hans Peter Freyther [Wed, 29 Dec 2010 10:57:48 +0000 (11:57 +0100)]
smscb: Add some simple decoding routines for SMSCB.

13 years agoUse the app_info->name instead of the hostname
Harald Welte [Fri, 24 Dec 2010 14:10:14 +0000 (15:10 +0100)]
Use the app_info->name instead of the hostname

This makes more sense in case you run BCS, SGSN and other components
on the same host.  Having multiple telnet sessions with the same
prompt can otherwise be confusing.

13 years agorate_ctr: No need to include the inttypes.h
Holger Hans Peter Freyther [Mon, 20 Dec 2010 12:38:22 +0000 (13:38 +0100)]
rate_ctr: No need to include the inttypes.h

There should not be any u_int*_t types in this file, no need
to include this file. It is breaking compilation with the last
x86 build of GNU ARM for GCC 3.4.

13 years agoprotocol: introduce gsm_03_41.h
Alex Badea [Sat, 27 Nov 2010 21:35:08 +0000 (23:35 +0200)]
protocol: introduce gsm_03_41.h

This currently contains definitions for the BTS->MS SMSCB message.

Signed-off-by: Alex Badea <vamposdecampos@gmail.com>
13 years agogsm_08_58: add struct and constants for RSL_IE_CB_CMD_TYPE
Alex Badea [Sat, 27 Nov 2010 21:34:46 +0000 (23:34 +0200)]
gsm_08_58: add struct and constants for RSL_IE_CB_CMD_TYPE

Signed-off-by: Alex Badea <vamposdecampos@gmail.com>
13 years agogsm_04_12: fix 04.13 typos
Alex Badea [Sat, 27 Nov 2010 18:00:39 +0000 (20:00 +0200)]
gsm_04_12: fix 04.13 typos

There are two occurrences of "413" in the 04.12 header file.
These are probably typos; correct them to "412".

Signed-off-by: Alex Badea <vamposdecampos@gmail.com>
13 years agoutils: Fix typo. It is ascii.
Holger Hans Peter Freyther [Fri, 19 Nov 2010 18:20:46 +0000 (19:20 +0100)]
utils: Fix typo. It is ascii.

13 years agogsmtap.h: Add GSMTAP_TYPE_SIM
Harald Welte [Thu, 18 Nov 2010 22:54:20 +0000 (23:54 +0100)]
gsmtap.h: Add GSMTAP_TYPE_SIM

13 years agoMove the generate backtrace call from MSGB_ABORT to osmo_panic handler
Sylvain Munaut [Sat, 13 Nov 2010 21:47:47 +0000 (22:47 +0100)]
Move the generate backtrace call from MSGB_ABORT to osmo_panic handler

This has two benefits:
 - All people calling osmo_panic() will have the backtrace
 - It makes the thing build in 'target' mode in osmocom-bb

And one downside:
 - The osmo_panic handler is now in the backtrace
(I can live with that :)

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
13 years agopanic: Fix type warning - osmo_panic_handler_t is already a pointer ...
Sylvain Munaut [Sat, 13 Nov 2010 17:00:25 +0000 (18:00 +0100)]
panic: Fix type warning - osmo_panic_handler_t is already a pointer ...

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>