summaryrefslogtreecommitdiffstats
path: root/include/osmocom
Commit message (Collapse)AuthorAgeFilesLines
* vty: Make a reservation for the osmo-sip-connectorHolger Hans Peter Freyther2016-03-311-0/+1
| | | | | The osmo-sip-connector is a new application and is a MNCC to SIP bridge. It is not implementing transcoding or RTP proxying at all.
* select: Externalize fd_set filling and dispatchHolger Hans Peter Freyther2016-03-311-0/+6
| | | | | | | | | | | | | | | | To integrate with an external event loop (in this case glib) we need to allow an application to get a filled out fd_set and then dispatch it. osmo_fds and maxfds are static and I decided to keep it that way and instead create two routines to fill the fdset and then one to dispatch the result. The public header file does not include sys/select.h and we can compile the library without select, so I didn't want to require having to include this file, and used void * for the parameter. Mark the routines as inline to avoid a call from the select function. I have confirmed that inlining has an effect on x86 using Debian's gcc-4.9.2-10 compiler
* Export names for gsm_chan_t and gsm48_chan_modeMax2016-03-302-0/+7
| | | | This can be used with get_value_string() to improve debugging output.
* sim: make osim_reader_ops publicHarald Welte2016-03-191-2/+7
|
* Add new osmo_fd_get_by_fd() functionHarald Welte2016-03-191-0/+2
| | | | | | This function can be used to obtain the osmo_fd corresponding to a given fd. The latter can be useful when integrating libosmocore main loop with other libraries.
* sim: add class_tables / card profilesHarald Welte2016-03-171-0/+42
| | | | | The tables permit code to determine the APDU class of an APDU based on it APDU/TPDU header (CLA/INS/P1/P2/P3).
* add missing #include <stdbool.h>Harald Welte2016-03-171-0/+1
|
* Rename struct to better match libosmocore conventionsMax2016-03-171-4/+4
|
* Add basic EARFCN supportMax2016-03-171-1/+31
| | | | | | Add structure representing group of EARFCNs with common priority, threshold etc. Add functions to populate this structure.
* Add function to add bits from array to bitvecMax2016-03-171-0/+3
| | | | | | | | | Add function which adds specified number of bits from each element of array to the bit vector prefixing each addition with one and finishing entire sequence with adding 0. This is very common patter for various repetitive data structures described with CSN.1 in 3GPP standards. Corresponding test vectors and doxygen headers are added too.
* gsm48: factor out MCC+MNC BCD parsing for re-use in UMTSNeels Hofmeyr2016-03-151-0/+3
| | | | | | | | | | For 3G, I need a BCD composer/parser similar to gsm48_generate_lai()/ gsm48_decode_lai(). Those functions also handle a trivial extra member (lac) which I don't need in this way for 3G. So create new functions to take on the MCC+MNC BCD handling and call those from gsm48_generate_lai() and gsm48_decode_lai(). In this way, the 3G code in openbsc can use only the BCD functionality without code duplication.
* 04.08: add inline funcs for transaction id bitsNeels Hofmeyr2016-03-151-0/+19
| | | | | | Various users of gsm48_hdr apply the same hardcoded shifts/bitmasks to obtain the transaction ID encoded in the upper nibble of the protocol discriminator. Centralize. Patch for openbsc.git will follow.
* 04.08: switch to r99 msg type bitmasks by defaultNeels Hofmeyr2016-03-151-1/+1
| | | | | [hfreyther: Separated from the previous patch to allow an easy revert]
* 04.08: add inline funcs for pdisc + msg type bitmasksNeels Hofmeyr2016-03-151-0/+56
| | | | | | | | | | | | | | | | Add inline functions for both release <= 98 and release >= 99 as well as a default define. Use the release 98 by default since the current code base uses the r98 bitmasks. These inline functions relieve callers of the decision on masking bits of the protocol discriminator and message type octets. Also add a define for the protocol discriminator extension to one octet length (GSM48_PDISC_EXTEND). Apply new pdisc function in gsm0480.c. [hfreyther: Make the hdr param const]
* Add helper function to convert numerical BSSGP PDU type to stringMax2016-03-111-0/+1
|
* Add support for SI2quater messagesMax2016-03-111-0/+7
| | | | Add basic data structure for System information Type 2quater.
* rename osim_file_find_* to osim_file_desc_find_*Harald Welte2016-03-111-3/+3
| | | | they return an osim_file_desc, and not an osim_file, so fix the naming
* sim: Add osim_file_find_{fid,sfid}() functionsHarald Welte2016-03-111-0/+6
| | | | | We don't always want to look-up by name, but the latter is the only implemented 'find' function so far. Let's change that.
* log: Add conditional logging based on log_check_levelJacob Erlbeck2016-02-291-4/+20
| | | | | | | | | | | | | | Currently the LOGP/DEBUGP arguments are always evaluated even if no logging will happen at all. This can be expensive, for instance if hexdumps or pretty printed object names are generated. This causes high base load especially on embedded devices and is a major part of CPU usage e.g. of the osmo-pcu. This commit uses the log_check_level function to avoid the evaluation of the parameters if it is known in advance, that no logging entry will be generated. Sponsored-by: On-Waves ehf
* log: Add log_check_level functionJacob Erlbeck2016-02-291-0/+1
| | | | | | | | | | | | | | | | | | This commit adds this predicate function which can be used to avoid the execution of code if a certain log level is not enabled. The function will only return 0 (false), if it is sure that a logging call for the same facility and level will not produce any output. This safety criterion shall ensure, that no logging output is lost due to the use of this predicate as a guard. On the other hand, even if the predicate returns != 0 (true), no logging output might get generated by a similar logging command. Note that the current implementation is not focussed on performance, which could be improved by using a lookup table instead of iterating through every target. Sponsored-by: On-Waves ehf
* fix gsm_7bit_decode API comment: septets, not octetsNeels Hofmeyr2016-02-291-1/+2
|
* Add byte printing macrosMax2016-02-251-0/+21
| | | | | | It's sometimes handy for debugging to be able to immediately see which bits are set in a given byte. Generalize macro used for that in bitvec tests and make it available for the rest of the library.
* vty: add ctrl section for Control interface bind addressNeels Hofmeyr2016-02-252-1/+10
| | | | | | | | | | | | | | | | | | | | | | | This may seem like overkill for a mere const char * config item, but it makes the Control interface VTY commands reusable in any main() scope (inspired by libosmo-abis' VTY config). Add API functions ctrl_vty_init() and ctrl_vty_get_bind_addr(), in new files src/ctrl/control_vty.c and include/osmocom/ctrl/control_vty.h, compiled and/or installed dependent on ENABLE_VTY. Using these functions allows configuring a static const char* with the VTY commands ctrl bind A.B.C.D which callers shall subsequently use to bind the Control interface to a specific local interface address, by passing the return value of ctrl_vty_get_bind_addr() to control_interface_setup(). Add CTRL_NODE to enum node_type, "eating" RESERVED4_NODE to heed that comment on avoiding ABI changes.
* add ctrl_interface_setup_dynip() for bind addressNeels Hofmeyr2016-02-251-0/+4
| | | | | | Make the ctrl interface bind address configurable, so that it may be made available on other addresses than 127.0.0.1. The specific aim is to allow running multiple osmo-nitbs alongside each other (commits in openbsc follow).
* vty: add bind command for telnet vty lineNeels Hofmeyr2016-02-251-0/+3
| | | | | | | | | | | | | | | | | | | | Add VTY command line vty bind A.B.C.D The command merely stores the configured IP-address, which can then be used by the calling main program to set the telnet port of the VTY line. (Commits in openbsc and osmo-iuh will follow up on this.) Add function vty_get_bind_addr() to publish the address in the vty.h API. Add static vty_bind_addr to store. For allocation/freeing reasons, a NULL address defaults to 127.0.0.1. BTW, I decided against allowing keywords 'any' and 'localhost' in place of an actual IP address to make sure a written config is always identical to the parsed config.
* Extend L1SAP PH-DATA with presence informationMax2016-02-221-0/+11
| | | | | | | | | Previously the presence of header and data blocks were communicated in-band which decreases code readability and makes it unnecessary hard to add support for new hardware. Note: OsmoBTS have to be modified to take advantage of extended ph_data_param structure.
* gb: Add bssgp_msgb_copy functionJacob Erlbeck2016-02-221-0/+1
| | | | | | | | | | | | | | This function originates from openbsc/src/gprs but is just specific to BSSGP/Gb on the same level like bssgp_msgb_alloc. This commit puts the former gprs_msgb_copy function beside bssgp_msgb_alloc. Renamed function: gprs_msgb_copy -> bssgp_msgb_copy Sponsored-by: On-Waves ehf
* Add T4 bit map compression routinesMax2016-02-181-0/+42
| | | | | | | | | | | | | | | Add bit map encoder and decoder functions: decoder is fully functional while encoder is good enough for testing - no backtracking to find the best possible compression is implemented. If somebody is willing to implement MS side of EDGE than this has to be expanded. Add corresponding tests. N. B: the encoding is implemented according to ETSI TS 44.060 which is slightly different from T4 used for fax according to CCITT G31D (RFC 804). Ticket: OW#2407 Sponsored-by: On-Waves ehf Signed-off-by: Max <msuraev@sysmocom.de>
* Expand bitvec interfaceMax2016-02-181-0/+9
| | | | | Add bit filling, shifting and other functions necessary for bit compression implementation. Add corresponding tests.
* Add CSCN ctrl port defsNeels Hofmeyr2016-02-152-0/+2
|
* add vty port nr for osmo-cscnNeels Hofmeyr2016-02-101-0/+1
|
* bitvec: Test and fix regression for C++->C conversionHolger Hans Peter Freyther2016-01-301-2/+2
| | | | | | | | | | | | | bitvec_read_field/bitvec_write_field in the PCU used a C++ reference and when porting to C it was decided to pass the parameter by value and this lost the "back propagation" of the new index. Change the parameter to be an in/out parameter and this way do not have a silent semantic break in the osmo-pcu (where we copy the reference in csn.1 by value) and have a true compile failure. Add Max's simple test for bitvec_unhex function leaving the checking of bitvec_read_field and the side effect in the datastructure about the number of bits still open.
* Add bitvec-related functions from Osmo-PCUMax2016-01-261-0/+9
| | | | | | Allocation, pack/unpack, field access and helper routines used extensively by Osmo-PCU. Whenever memory allocation happens, alocator context is passed explicitly by caller.
* bitvec: Fix interface to consistently use unsigned intMax2016-01-221-5/+5
| | | | | | | Use unsigned int for the length throughout the interface. We will never have a a negative length. Sponsored-by: On-Waves ehf
* comment typoNeels Hofmeyr2016-01-181-1/+1
|
* msgb: Assert len >= 0 in msgb_trimJacob Erlbeck2016-01-151-0/+2
| | | | | | | | | | | Currently msgb_trim only checks for len > data_len and returns -1 in that case, allowing the caller to fix it somehow. Using a negative length will always lead to a corrupt msgb, but this is not being checked. This commit adds a check for len < 0 and a conditional call to MSGB_ABORT. Sponsored-by: On-Waves ehf
* bitvec: Add get/set byte sequencesJacob Erlbeck2016-01-151-0/+10
| | | | | | | | | | | | | | | The new functions bitvec_get_bytes and bitvec_set_bytes copy byte sequences from bitvecs to uint8_t arrays and vice versa. While the bytes in the bitvecs do not need to be aligned, the uint8_t arrays always are. In case the bytes in the bitvec are aligned, the implementation uses memcpy. Note that the implementation like the other existing functions assume MSB first encoding. [hfreyther: Squash the comment fix into this commit as well] Sponsored-by: On-Waves ehf
* gsm: Add APN conversion functionsJacob Erlbeck2016-01-151-0/+3
| | | | | | | | | | | | These functions are currently part of openbsc but also needed by other projects. The function have been renamed as follows: gprs_apn_to_str -> osmo_apn_to_str gprs_str_to_apn -> osmo_apn_from_str Sponsored-by: On-Waves ehf
* osmo_prim_op_names should be externHarald Welte2015-12-251-1/+1
|
* Add osmo_prim_op_names[] symbol and _SAP_SS7_BASE defineHarald Welte2015-12-231-0/+3
|
* msgb: Add msgb_test_invariant functionJacob Erlbeck2015-12-211-0/+40
| | | | | | This adds a function that verifies whether a mgsb is consistent. Sponsored-by: On-Waves ehf
* msgb: Add msgb_resize_area and msgb_copyJacob Erlbeck2015-12-211-0/+3
| | | | | | | | | | | | | | | These functions originate from openbsc/src/gprs but are generic msgb helper functions. msgb_copy: This function allocates a new msgb, copies the data buffer of msg, and adjusts the pointers (incl. l1h-l4h) accordingly. msgb_resize_area: This resizes a sub area of the msgb data and adjusts the pointers (incl. l1h-l4h) accordingly. Sponsored-by: On-Waves ehf
* some comments / fixed typosNeels Hofmeyr2015-12-214-2/+6
|
* RSL: Add enum + TLV definitions for ip.access style embedded IEsHarald Welte2015-12-132-0/+31
|
* gsm_03_41: Fix structure definitions for big-endian machinesRuben Undheim2015-12-091-0/+31
| | | | | this was detected by debian packaging, as the associated gsm_03_41 test case fails on big endian machines like ppc.
* stats: Add OSMO prefix to STAT_ITEM_NOVALUE_IDJacob Erlbeck2015-12-081-1/+1
| | | | | | | This symbol is globally visible and therefore should have an OSMO prefix like the other identifiers exported by stat_item.h. Sponsored-by: On-Waves ehf
* stat: Explicitly support stat_items without unitJacob Erlbeck2015-12-081-0/+1
| | | | | | | Add OSMO_STAT_ITEM_NO_UNIT for stat items without an unit. The statsd reporter uses gauges ("g") to report them. Sponsored-by: On-Waves ehf
* remove our internal copy of talloc, use system libtallocHarald Welte2015-12-052-189/+4
| | | | | | | Shipping our own private copy of talloc was a good idea in 2008, when it was not readily available on most target platforms. Today, the situation is quite different, as it is a standard library on major Linux distributions.
* stats: Move statsd related code into a separate fileJacob Erlbeck2015-11-261-4/+12
| | | | | | | | | | | This commit moves the stats specific code parts into stats_statsd.c while keeping the generic parts in stats.c. The code in stats.c no longer contains references to statsd symbols. Note that the VTY code still needs to know about every stats reporter backend. Sponsored-by: On-Waves ehf
* use system-wide libtalloc with --enable-system-tallocHarald Welte2015-11-211-0/+0
| | | | | | | | | This introduces a new configure flag by which the libosmocore-internal talloc code is not compiled, but rather a system-wide libtalloc is used. When we started openbsc/libosmocore in 2008, libtalloc was not widely present on systems yet. This has changed meanwhile, and we should simply use the system-wide library