Libosmocore » History » Revision 15
« Previous |
Revision 15/33
(diff)
| Next »
fixeria, 02/19/2016 10:49 PM
- Table of contents
- libosmocore
libosmocore¶
libosmocore is a library with various utility functions that were originally developed as part of
the OpenBSC project, but which are of a more generic nature and thus useful to (at least)
other programs that we develop in the sphere of Free Software / Open Source mobile communications.
There is no clear scope of it. We simply move all shared code between OsmocomBB and OpenBSC
in this library to avoid code duplication.
To build osmocom-bb it is mandatory to install libosmocom in advance.
Browsing its source code¶
You can do that using our cgit installation at http://cgit.osmocom.org/cgit/libosmocore/
Preconditions¶
To compile libosmocore you will need the following tools:
and the following (optional) libraries: <pre> h2. Obtaining it To obtain libosmocore, you can use the following git URL: <pre> h2. Compiling and installing it To compile and install it as standalone: <pre> cd libosmocore/ autoreconf -i ./configure make sudo make install sudo ldconfig -i cd .. </pre> to compile without pcsclite library, run <pre> h2. Licensing This library is GPL licensed, as the code is taken from the similarly GPL-licensed [[OpenBSC]] codebase. This means you *cannot use this library from non-GPL licensed code without infringing copyright! h2. Features h3. Select loop abstraction This is implemented in select.[ch] and enables you to build complex asynchronous/non-blocking I/O programs in a single thread. h3. Message buffer handling <pre> implementation. It provides handling of packet buffers, putting them in queues, prepending and appending data to it, etc. h3. Bitvector A convenient set of routines to deal with bit-vectors in C. This was originally written for rest-octet parsing. h3. TLV handling The GSM Layer3 and above are full of TV / TLV / TL16V and other data fields. Our implementation <pre> h3. Timers Provides a timer core where you can register timers with a callback function. The function is called when the timer expires. h3. COMP128v1-3 A COMP128v1 implementation by Sylvain Munaut and COMP128v23 is included. h3. Rate Counter Provides infrastructure for maintaining _rate counters_, i.e. counters that can be incremented and will also keep track of the rate of events per second, minute, hour and day. A group of rate counters is defined as an abstract _class_, from which you can then allocate instances. The _class_ description includes information about the counter names. h3. Protocol helper code h4. GSM utils * conversion functions for ARFCN, [[RxLevel]], 7bit GSM character set, power level, frame numbers, ... h4. GSM 04.08 * extensive header files for the GSM 04.08 (Layer 3 RR/MM/CC) messages * TLV parser definitions to parse the optional IEs * utility functions such as ** human readable strings for RR cause names ** converting GSM Mobile Identities (MI) to string and back * encoding and decoding functions for call control IEs h4. GSM 08.08 (A Interface) * API to wrap 04.08 messages in BSSMAP/DTAP message * TLV parser definitions h4. GSM 08.58 (A-bis RSL) * header file with structure and enum definitions for GSM 08.58 protocol * TLV parser definitions for RSL optional IEs * human readable strings for RSL Error values and RLM cause values * encoding and decoding of RSL channel number h4. GSM 12.21 (A-bis OML) * header file with structure and enum definitions for GSM 12.21 (and 08.59) protocol h4. GSM 04.11 (SMS) * header file with structure and enum definitions for GSM 04.11 (SMS RP and CP layers) protocol h3. Talloc memory allocator The talloc memory allocator from the Samba project is (optionally) part of libosmocore. It provides hierarchical memory allocation and extensive debugging features such as dumping the currently allocated objects (at runtime) to the console. h3. Logging framework A generic logging implementation, supporting a dynamic number of 'log targets', understanding the notion of log levels and log categories. Filtering based on levels and categories is implemented in the core, while context-specific filtering can be implemented by the application using libosmocore. * logging with various log levels for various subsystems inside the application * logging to stderr, syslog or application-defined targets * runtime reconfigurable per-subsystem log levels * timestamping of log lines * colorized log output h3. Write Queue This is a write queue implementation on top of libosmocore's select loop abstraction. It allows you to simply say "write this msg_buff to this file descriptor as soon as the file descriptor is writable". h2. Development Cycle As we are still developing the GSM protocol stacks on the network side (OpenBSC) and phone side (OsmocomBB), every so often there is a need to add some new code to libosmocore. Even worse, we sometimes need to break the API and ABI of the library. However, by keeping libosmocore in a separate git repository, we run into one problem: Checking out an old version of e.g. [[OpenBSC]] or [[OsmocomBB]] will result in failed builds, as we don't remember which old version of libosmocore was required. This makes debugging and things like git bisect very hard to impossible. In order to solve this problem, we use "git-subtree":http://github.com/apenwarr/git-subtree to import the full libosmocore.git repository into [[OsmocomBB]]. This way, we ensure that there is always a compatible version of libosmocore inside the tree if we check out old [[OsmocomBB]] versions from git. h3. Making changes to libosmocore *NEVER COMMIT CHANGES DIRECTLY TO osmocom-bb.git:src/shared/libosmocore* Instead, use the following process: 1. make your changes to your local copy of libosmocore 1. test them together with [[OsmocomBB]] and [[OpenBSC]] 1. test if libosmocore still builds for both host and target (ARM) 1. create a _diff_ of your local libosmocore changes 1. apply that diff to the libosmocore.git repository 1. use the script in osmocom-bb.git/src/shared/update-libosmocore.sh (uses git-subtree) to import your changes from libosmocore.git 1. test + commit your [[OsmocomBB]] changes that depend on the newly introduced code to libosmocore It is important that the steps are followed in the order state above to ensure consistency of our repositories
Updated by fixeria about 8 years ago · 15 revisions