summaryrefslogtreecommitdiffstats
path: root/include/osmocom/core
Commit message (Collapse)AuthorAgeFilesLines
* Add osmo_get_macaddr() function to obtain etherent mac addressHarald Welte2014-08-181-0/+1
| | | | | This used to be private in osmo-bts/common/abis.c, where it really didn't belong.
* osmocore: Add function osmo_macaddr_parse() to parse ETH MAC addressHarald Welte2014-08-181-0/+6
|
* core/bitXXgen: Don't do 'return' in functions returning voidSylvain Munaut2014-06-161-2/+2
| | | | | | ISO C forbids 'return' with expression, in function returning void Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
* core/bitXXgen: Use explicit cast of void* to uint8_tSylvain Munaut2014-06-161-4/+6
| | | | | | Turns out we use this header in C++ code ... Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
* bits: Add left circular shift functionMax2014-06-161-0/+10
| | | | | Submitted-by: Max <max.suraev@fairwaves.co> Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
* core: Add generic LE/BE load/store uint type convertors and use them in msgbMax2014-06-163-10/+121
| | | | | Submitted-by: Max <max.suraev@fairwaves.co> Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
* include: Switch to #pragma once patternSylvain Munaut2014-06-1632-128/+32
| | | | Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
* gsmtap: add LTE defines to GSMTAP v2Max2014-06-151-1/+10
| | | | | Submitted-by: Max <max.suraev@fairwaves.co> Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
* src/socket: Adding unix domain socket supportÁlvaro Neira Ayuso2014-03-261-0/+6
| | | | | | Added some function for adding the unix domain socket support. Signed-off-by: Alvaro Neira Ayuso <anayuso@sysmocom.de>
* ladpm: Fix msgb handling and SAPI=3 establishment delayJacob Erlbeck2014-03-101-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
* msgb: Add msgb_hexdump() functionJacob Erlbeck2014-03-041-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
* vty: Make vty_event dispatch signals and use it in the testcaseHolger Hans Peter Freyther2013-10-101-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.
* core: Remove defined() check for OSMO_DEPRECATEJacob Erlbeck2013-08-151-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)
* core: Fix-up the OSMO_DEPRECATED for older compilersHolger Hans Peter Freyther2013-08-141-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.
* core: Support clang with OSME_DEPRECATEDJacob Erlbeck2013-08-141-4/+15
| | | | | Separate feature checking from implementation. Supported are clang and gcc.
* core: Move OSMO_DEPRECATED to new core/defs.h fileJacob Erlbeck2013-08-141-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.
* utils.h: we need to include utils.h for osmo_generate_backtrace()Harald Welte2013-07-061-0/+2
| | | | | this causes compiler warnings in user code ever since commit 55cf02221f0654a3f48888f3b13766b671a120f0
* misc: Fix compiler warnings about the static_assert macro with gcc 4.8Holger Hans Peter Freyther2013-07-011-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); ^
* utils: Use fprintf to print the assertion and generate a backtraceKaterina Barone-Adesi2013-03-251-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.
* logging: add new log_targets_reopen() functionHarald Welte2013-03-181-0/+1
| | | | | This function will re-open all existing log files in the application, praticularly useful for SIGHUP handlers in case of logrotate
* utils: Introduce OSMO_ASSERT in the utils and use it in the unit testsKaterina Barone-Adesi2013-03-091-0/+7
| | | | | The tests should unconditionally assert, regardless of debug settings. This uses the OSMO_ prefix as it's in the global namespace.
* Added a ring buffer log target to store the last N log messages.Katerina Barone-Adesi2013-02-273-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.
* Revert "Added a ring buffer log target to store the last N log messages."Holger Hans Peter Freyther2013-02-273-103/+0
| | | | | | | I noticed some more issues and it is the easiest to revert and include the fixed version. This reverts commit 73377229bb33ab79682ce4b126a63602d13304ad.
* Added a ring buffer log target to store the last N log messages.Katerina Barone-Adesi2013-02-273-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.
* Add UMTS RRC message typesTobias Engel2013-02-211-0/+68
|
* misc: Doxygen tweaks: fixed some typos and minor errorsKaterina Barone-Adesi2013-02-159-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.
* msgb: fix msgb_pull_u*()Steve Markgraf2012-11-141-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>
* logging: Introduce a print_filename flag for the logtargetHolger Hans Peter Freyther2012-09-111-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.
* logging: Mark the log_info_cat pointer as constsHolger Hans Peter Freyther2012-09-111-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.
* msgb: msgb_get() is supposed to get bytes from END, msgb_pull() from HEADHarald Welte2012-09-081-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.
* gsmtap: add minimal support for encapsulating UMTS RRC in GSMTAPHarald Welte2012-09-021-0/+7
|
* utils: Change semantic of OSMO_MAX/OSMO_MIN to match semantic of a functionHolger Hans Peter Freyther2012-08-151-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.
* backtrace: Add a variant that uses the libosmocore logging frameworkHarald Welte2012-07-141-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.
* timer: Add function osmo_timer_remaining() to determine remainign timeHarald Welte2012-07-131-1/+3
|
* logging: Fix compile breakage introduced by the warning fixesHolger Hans Peter Freyther2012-07-121-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
* logging: Avoid compiler warnings when compiling c++ codeAndreas Eversberg2012-07-101-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.
* build: simplify headers management and remove recursionDiego Elio Pettenò2012-06-301-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>
* linuxrbtree: don't use 'new' as argument name to avoid C++ incompatibilityHarald Welte2012-06-181-1/+1
|
* signal: add SS_L_NS as a signal subsystem for NS code in libosmo-gbHarald Welte2012-06-161-0/+1
|
* doc: Fix the Doxygen section endingsSylvain Munaut2012-04-1816-16/+16
| | | | Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
* misc: Fix warning when compiling telnet_interface.cHolger Hans Peter Freyther2012-03-161-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 *'
* gsmtap: Add GSMTAP_GPRS_CS() / GSMTAP_GPRS_MCS()Harald Welte2012-02-081-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.
* gsmtap: make sure we agree with wireshark on GSMTAP channel typesHarald Welte2012-01-261-2/+2
|
* msgb_trim(): actually trim to an absolute length, as the comment statesHarald Welte2012-01-141-5/+3
| | | | | The previous commit introduced a new msgb_trim() but the implementation differed from the specification.
* msgb: introduce msgb_trim() and msgb_l3trim() to trim msgb'sHarald Welte2012-01-141-0/+28
|
* core/conv: Add utility methods to know length of coded/decoded vectorsSylvain Munaut2011-11-241-0/+6
| | | | Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
* core/conv: Add support for other termination types (trunc & tail biting)Sylvain Munaut2011-11-241-6/+25
| | | | | | | | Note that this breaks the ABI and the low level API. But it shouldn't break the high level API, nor the conv code definitions (because fields default to 0, and for new fields '0' is the previous behavior) Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
* core/conv: Minor documentation improvementsSylvain Munaut2011-11-241-12/+18
| | | | Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
* utils: Add declaration back for osmo_osmo_hexdump_nospcSylvain Munaut2011-11-131-0/+1
| | | | | | | | As it turns out, if a project uses the old name but without a declaration, it'll causes a segfault on 64 bits platform (because of the implicit int return type which doesn't apply since here it's a pointer). Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
* gsm/sms: Added DLSMS debuggingAndreas Eversberg2011-11-121-1/+2
| | | | | Written-by: Andreas Eversberg <jolly@eversberg.eu> Signed-off-by: Sylvain Munaut <tnt@246tNt.com>