Commit Graph

402 Commits

Author SHA1 Message Date
Harald Welte 5e924a31a0 introduce GSM primitive definitions
The idea here is to use the osmocom core primitive code ot abstract out
primitives for inter-layer comunication in GSM.
2011-06-23 15:04:47 +02:00
Harald Welte 9b21e88367 add new 'prim.h' header file for primitives 2011-06-23 14:14:20 +02:00
Pablo Neira Ayuso 0849c9af2a socket: add OSMO_SOCK_F_[CONNECT|BIND|NON_BLOCK] flags
This extends the socket infrastructure in libosmocore to allow
to create non-blocking sockets.

Basically, it replaces the connect0_bind1 parameter by one
flags parameter.
2011-06-13 19:15:59 +02:00
Pablo Neira Ayuso 139e12782c Merge branch 'master' of git.osmocom.org:libosmocore 2011-06-13 19:15:50 +02:00
Harald Welte ee50081daa add missing #include file to sysinfo.h
(otherwise 'struct value_string' would not be defined)
2011-06-05 19:53:56 +02:00
Harald Welte fc90646d48 abis_nm.h: Add include to gsm_utils.h 2011-06-05 11:22:59 +02:00
Harald Welte f9e0746add socket: getaddrinfo(): set AI_PASSIVE if we want to bind
This will tell getaddrinfo() that we want a INADDR_ANY style socket
2011-05-31 17:47:54 +02:00
Holger Hans Peter Freyther 271c43b0ae 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.
2011-05-31 00:42:38 +02:00
Sylvain Munaut 3710e462f8 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>
2011-05-29 19:48:15 +02:00
Sylvain Munaut f2699501bc gsm/sysinfo: Fix rsl2sitype array size
0xff is the maximum value ... so there is 256 elements.

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-05-29 15:39:48 +02:00
Harald Welte 8c6be75d4f gsm/sysinfo: don't include netinet/in.h 2011-05-29 15:37:49 +02:00
Harald Welte cd623ebb56 bitvec: add missing stdint.h 2011-05-29 15:37:38 +02:00
Harald Welte 08de66dd5e socket: remove unused IPv4 related header includes 2011-05-29 15:26:48 +02:00
Harald Welte 4d3a7b124e socket: Skip ifa's without ifa->ifa_addr
Apparently getifaddrs() returns ifa's without an ifa_addr set.
2011-05-24 21:46:07 +02:00
Pablo Neira Ayuso 4761ba9d33 Merge branch 'master' of git.osmocom.org:libosmocore 2011-05-24 18:31:13 +02:00
Harald Welte 11c7193ad8 Import abis_nm_{chcomb4pchan,pchan4chcomb}() from openbsc 2011-05-24 17:22:55 +02:00
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