aboutsummaryrefslogtreecommitdiffstats
path: root/include/osmocom/core
AgeCommit message (Collapse)AuthorFilesLines
2014-08-25logging: Add ability to save/print current log filtersHarald Welte1-0/+16
This enables the persistent configuration of let's say 'log filter imsi 012345678' for a given log file in the config file.
2014-08-21Convert recently-introduced header files to #pragma onceHarald Welte1-4/+1
2014-08-21libctrl: Add DLCTRL as logging context for the control interfaceHarald Welte1-1/+2
... and make libctrl code use it
2014-08-21libctrl: remove reference to bsc_replace_string()Harald Welte1-0/+7
... and rather introduce a general osmo_talloc_replace_string() to libosmocore.
2014-08-18Add osmo_get_macaddr() function to obtain etherent mac addressHarald Welte1-0/+1
This used to be private in osmo-bts/common/abis.c, where it really didn't belong.
2014-08-18osmocore: Add function osmo_macaddr_parse() to parse ETH MAC addressHarald Welte1-0/+6
2014-06-16core/bitXXgen: Don't do 'return' in functions returning voidSylvain Munaut1-2/+2
ISO C forbids 'return' with expression, in function returning void Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-06-16core/bitXXgen: Use explicit cast of void* to uint8_tSylvain Munaut1-4/+6
Turns out we use this header in C++ code ... Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-06-16bits: Add left circular shift functionMax1-0/+10
Submitted-by: Max <max.suraev@fairwaves.co> Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-06-16core: Add generic LE/BE load/store uint type convertors and use them in msgbMax3-10/+121
Submitted-by: Max <max.suraev@fairwaves.co> Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-06-16include: Switch to #pragma once patternSylvain Munaut32-128/+32
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-06-15gsmtap: add LTE defines to GSMTAP v2Max1-1/+10
Submitted-by: Max <max.suraev@fairwaves.co> Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-03-26src/socket: Adding unix domain socket supportÁlvaro Neira Ayuso1-0/+6
Added some function for adding the unix domain socket support. Signed-off-by: Alvaro Neira Ayuso <anayuso@sysmocom.de>
2014-03-10ladpm: Fix msgb handling and SAPI=3 establishment delayJacob Erlbeck1-0/+15
Currently it takes 3s to establish a SAPI 3 SACCH connection with osmo-bts. This is due to the fact, that a broken SABME request is sent first and and is ignored by the MS. Then, after a T200 timeout (2s) the SABME command is sent again (this time correctly) and answered by the MS. The first SABME message is broken (it has a length field of 3 and ends with 3 bytes from the tail of the original RSL message), because of it is expected throughout lapdm.c that msg buffers containing RSL have msg->l2h == msg->data. Some abis input drivers fulfill this but IPA doesn't, thus the 3 bytes of the IPA header are still part of the msg and confuse length computation. Since internal fields of the msg are modified directly, this is difficult to see. This patch adds a new function msgb_pull_to_l3() that explicitely skips over all headers prepending L3 and therefore resets l1h and l2h. This function is then used instead of msgb_pull_l2h() which only worked correctly when msg->l2h == msg->data. In addition, code manipulating msg->tail and msg->len directly has been replaced by calls to msgb_trim(). Note that this patch does not fix all issues of this case in the LADP related code. Ticket: SYS#192 Sponsored-by: On-Waves ehf
2014-03-04msgb: Add msgb_hexdump() functionJacob Erlbeck1-0/+1
This function works like osmo_hexdump() and returns a static buffer containing hex bytes along with markers for the layers. Note that it uses osmo_hexdump() internally, thus a call to msgb_hexdump() invalidates the buffer that has been returned by an earlier call to osmo_hexdump(). In short: don't mix them in a single call printf(). Sponsored-by: On-Waves ehf
2013-10-10vty: Make vty_event dispatch signals and use it in the testcaseHolger Hans Peter Freyther1-0/+1
The testcase didn't work on Ubuntu 12.04 because vty_create will directly call vty_event (e.g. not through the plt). This means that the approach to override vty_event in the testcase failed. Use the signal interface of libosmocore and make the testcase use it. The signals can be generally useful as well.
2013-08-15core: Remove defined() check for OSMO_DEPRECATEJacob Erlbeck1-11/+5
This reverts commit bf991bc0f3006eddf45d494ee7e476a75dbaf36e and fixes the bug instead. It's just sufficient to remove the defined() test, since identifiers that aren't macros are just considered as 0 when used with #if. (see cpp info page, section 4.2.2 'If' in cpp-4.6.info)
2013-08-14core: Fix-up the OSMO_DEPRECATED for older compilersHolger Hans Peter Freyther1-3/+9
The code started to use #if defined(...) but the value was always for GCC/Clang. The only difference was that for older compilers the value of the definition was 0. Conditionally define these macros.
2013-08-14core: Support clang with OSME_DEPRECATEDJacob Erlbeck1-4/+15
Separate feature checking from implementation. Supported are clang and gcc.
2013-08-14core: Move OSMO_DEPRECATED to new core/defs.h fileJacob Erlbeck1-0/+39
Add a new core/defs.h file for definitions that can be used from within header files without including prototypes and extern declarations. It's primarily meant for macro definitions and basic typedefs. Move the definition of OSMO_DEPRECATED there and use compiler version info to avoid compiler errors.
2013-07-06utils.h: we need to include utils.h for osmo_generate_backtrace()Harald Welte1-0/+2
this causes compiler warnings in user code ever since commit 55cf02221f0654a3f48888f3b13766b671a120f0
2013-07-01misc: Fix compiler warnings about the static_assert macro with gcc 4.8Holger Hans Peter Freyther1-1/+1
The modified macro is still working on a gcc 4.7 and gcc 4.8 after the removal of the typedef and addition of the unused attribute. include/osmocom/core/msgb.h: In function ‘msgb_alloc_headroom’: include/osmocom/core/utils.h:40:51: warning: typedef ‘dummyheadroom_bigger’ locally defined but not used [-Wunused-local-typedefs] #define osmo_static_assert(exp, name) typedef int dummy##name [(exp) ? 1 : -1]; ^ include/osmocom/core/msgb.h:386:2: note: in expansion of macro ‘osmo_static_assert’ osmo_static_assert(size > headroom, headroom_bigger); ^
2013-03-25utils: Use fprintf to print the assertion and generate a backtraceKaterina Barone-Adesi1-1/+2
This is changing the semantic of the assert. The regression tests now either need to check the stderr result, the exit status or print a message when all tests are completed. This is not that bad as the osmo_generate_backtrace is printing to the stdout right now.
2013-03-18logging: add new log_targets_reopen() functionHarald Welte1-0/+1
This function will re-open all existing log files in the application, praticularly useful for SIGHUP handlers in case of logrotate
2013-03-09utils: Introduce OSMO_ASSERT in the utils and use it in the unit testsKaterina Barone-Adesi1-0/+7
The tests should unconditionally assert, regardless of debug settings. This uses the OSMO_ prefix as it's in the global namespace.
2013-02-27Added a ring buffer log target to store the last N log messages.Katerina Barone-Adesi3-0/+103
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-27Revert "Added a ring buffer log target to store the last N log messages."Holger Hans Peter Freyther3-103/+0
I noticed some more issues and it is the easiest to revert and include the fixed version. This reverts commit 73377229bb33ab79682ce4b126a63602d13304ad.
2013-02-27Added a ring buffer log target to store the last N log messages.Katerina Barone-Adesi3-0/+103
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-21Add UMTS RRC message typesTobias Engel1-0/+68
2013-02-15misc: Doxygen tweaks: fixed some typos and minor errorsKaterina Barone-Adesi9-9/+13
Doxygen generates quite a lot of warnings on libosmocore. Some of them are obvious typos - this patch aims to fix such low-hanging fruit.
2012-11-14msgb: fix msgb_pull_u*()Steve Markgraf1-3/+3
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-09-11logging: Introduce a print_filename flag for the logtargetHolger Hans Peter Freyther1-0/+3
Introduce a print_filename attribute for each logtarget. Initialize it with 1 to be backward compatible with earlier versions. The bit is taken from an existint bitfield. There were at least six bits left of the byte.
2012-09-11logging: Mark the log_info_cat pointer as constsHolger Hans Peter Freyther1-1/+1
Applications should keep the log area in a static const area. Mark the pointer as const to address compiler warnings in OpenBSC, cast the const away for the osmo_log_info as it is not declared as const.
2012-09-08msgb: msgb_get() is supposed to get bytes from END, msgb_pull() from HEADHarald Welte1-3/+34
msgb_get() has been wrong all the time, despite the documentation being correct. If you've used the broken msgb_get() before, you have to change your code now, sorry.
2012-09-02gsmtap: add minimal support for encapsulating UMTS RRC in GSMTAPHarald Welte1-0/+7
2012-08-15utils: Change semantic of OSMO_MAX/OSMO_MIN to match semantic of a functionHolger Hans Peter Freyther1-2/+2
Add parentheses around the OSMO_MAX and OSMO_MIN macro to match the behaviour of calling a function. The current version does not evaluate to what is expected. (OSMO_MAX(3, 2) + 13) currently results in 3 and not 16.
2012-07-14backtrace: Add a variant that uses the libosmocore logging frameworkHarald Welte1-0/+1
I recently discovered that we can only print backtraces to stdout, which is of course useless in a daemon environment. We'd rather want to use the libosmocore logging framework instead.
2012-07-13timer: Add function osmo_timer_remaining() to determine remainign timeHarald Welte1-1/+3
2012-07-12logging: Fix compile breakage introduced by the warning fixesHolger Hans Peter Freyther1-1/+1
Make sure the declaration and definition match, add const to the functions called by logp/logp2. Compile output: logging.c:317: error: conflicting types for 'logp' ../include/osmocom/core/logging.h:34: note: previous declaration of 'logp' was here logging.c:327: error: conflicting types for 'logp2' ../include/osmocom/core/logging.h:168: note: previous declaration of 'logp2' was here make[3]: *** [logging.lo] Error 1
2012-07-10logging: Avoid compiler warnings when compiling c++ codeAndreas Eversberg1-2/+2
this patch i use to suppress warnings when compiling osmo-pcu (c++). since __FILE__ is constant, the called logging function with parameter "file" must be constant too, in order to avoid compiler warnings.
2012-06-30build: simplify headers management and remove recursionDiego Elio Pettenò1-31/+0
There is no real reason to keep the include directory a multi-level recursion, so instead declare everything within include (so that we can use proper nobase_ declarations) and be it. Please note that since we removed the sub-Makefile.am, ./configure will not create the directory structure for us on out-of-tree builds, so we have to make sure the directory we're generating to exists first. Signed-off-by: Diego Elio Pettenò <flameeyes@flameeyes.eu>
2012-06-18linuxrbtree: don't use 'new' as argument name to avoid C++ incompatibilityHarald Welte1-1/+1
2012-06-16signal: add SS_L_NS as a signal subsystem for NS code in libosmo-gbHarald Welte1-0/+1
2012-04-18doc: Fix the Doxygen section endingsSylvain Munaut16-16/+16
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2012-03-16misc: Fix warning when compiling telnet_interface.cHolger Hans Peter Freyther1-0/+1
In file included from telnet_interface.c:30:0: osmocom/core/socket.h:25:4: warning: 'struct osmo_fd' declared inside parameter list [enabled by default] telnet_interface.c: In function 'telnet_init_dynif': telnet_interface.c:84:4: warning: passing argument 1 of 'osmo_sock_init_ofd' from incompatible pointer type [enabled by default] osmocom/core/socket.h:24:5: note: expected 'struct osmo_fd *' but argument is of type 'struct osmo_fd *'
2012-02-08gsmtap: Add GSMTAP_GPRS_CS() / GSMTAP_GPRS_MCS()Harald Welte1-0/+8
As requested by Mike Morrin <Mike.Morrin@ipaccess.com>, we introduce GSMTAP sub-types for all the different GPRS and EGPRS coding schemes. This is neccessary due to the fact that the RLC PDU doesn't contain any explicit indication of the coding scheme used on the radio layer.
2012-01-26gsmtap: make sure we agree with wireshark on GSMTAP channel typesHarald Welte1-2/+2
2012-01-14msgb_trim(): actually trim to an absolute length, as the comment statesHarald Welte1-5/+3
The previous commit introduced a new msgb_trim() but the implementation differed from the specification.
2012-01-14msgb: introduce msgb_trim() and msgb_l3trim() to trim msgb'sHarald Welte1-0/+28
2011-11-24core/conv: Add utility methods to know length of coded/decoded vectorsSylvain Munaut1-0/+6
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>