Commit Graph

574 Commits

Author SHA1 Message Date
Max a337b9c37a Add function to check MS GEA capabilities
Add function which parses MS network capability IE value for bits
indicating support for particular version of GEA.

Change-Id: I785cef37dd272a2fab9b172f6e1392f865174e9a
Relates: OS#1582
2016-06-29 16:33:25 +00:00
Max ceae123752 Make C4 function globally available
This function perform 64 -> 128 bit key expansion which useful for
converting between UMTS CK and GSM Kc, A5/3 and A5/4, GEA3 and GEA4
keys.

Change-Id: I5a6c6deef6027cd6af144c9062d4c9166be26904
Related: OS#1582
2016-06-29 16:32:55 +00:00
Max b897c42993 Add strings for GPRS ciphers
Change-Id: I050bda5fb50aad42fe2d72de39f8256b4fb12fb2
Related: OS#1582
2016-06-29 16:32:27 +00:00
Harald Welte 14bf28a43d Mark input parameter to bitvec_set_bits() as 'const'
The input data is accessed in a read-only manner, so it should be marked
with the const qualifier.

Change-Id: I0d6b86289fa647594f3da1f1c0e0168685307a37
2016-06-27 15:19:10 +02:00
Harald Welte f627c0f0af fsm: Introduce default time-out handling
If a FSM doesn't specify any timer_cb, simply terminate the FSM by
default on time-out.  This is a reasonable default for most cases, and
avoids copy+pasting a one-line timer_cb function in every FSM.

Also, even if there is a timer_cb, let it have a return value to decide
if the core should terminate after return from timer_cb or not.

Change-Id: I0461a9593bfb729c82b7d1d1cf9f30b1079d0212
2016-06-27 15:17:53 +02:00
Max e0a7d9e2c2 Add octet-aligned/unaligned shift functions
The actual code is from OsmoBTS' tch.c by Harald Welte. Add unit tests,
doxygen annotation and extra memory safety check. Those functions are
used in several BTS implementations but seems generic enough to be
generally useful.

Change-Id: I2b1901c4161e8035f059585901dca593b661556d
2016-06-20 19:02:56 +02:00
Harald Welte 136e73764e Add Finite State Machine abstraction code
This code is supposed to formalize some of the state machine handling in
Osmocom code.

Change-Id: I0b0965a912598c1f6b84042a99fea9d522642466
Reviewed-on: https://gerrit.osmocom.org/163
Tested-by: Jenkins Builder
Reviewed-by: Harald Welte <laforge@gnumonks.org>
2016-06-16 21:43:45 +00:00
Harald Welte 82f94ef50f Add UMTS AKA related MM/GMM message type and IE definitions
Change-Id: Id45ea2c631ee589a4df1f8213da6f7e7d1bf6616
Reviewed-on: https://gerrit.osmocom.org/305
Reviewed-by: Harald Welte <laforge@gnumonks.org>
Tested-by: Jenkins Builder
2016-06-16 21:43:21 +00:00
Harald Welte bda26c0901 Add structures defining decoded TS 23.003 identities
Change-Id: I6423f8d75bb3e7aeca285854ab3232a087d62b57
Reviewed-on: https://gerrit.osmocom.org/304
Reviewed-by: Harald Welte <laforge@gnumonks.org>
Tested-by: Jenkins Builder
2016-06-16 21:25:26 +00:00
Harald Welte de960cbc0c gsup: Add OSMO_GSUP_MSGT_AUTH_FAIL_REPORT
The VLR must be able to notify the HLR of authentication failures.

Change-Id: I156cff76e092b3548b05534141b61887ee6be3f3
Reviewed-on: https://gerrit.osmocom.org/303
Reviewed-by: Harald Welte <laforge@gnumonks.org>
Tested-by: Jenkins Builder
2016-06-16 21:25:22 +00:00
Alexander Couzens ad580ba7c4 add vty call show asciidoc: generate a documentation for counters
For each counter group a ascii doc table is generated
containing all single counter with a reference to a section to
add additional information to the counter

Change-Id: Ia8af883167e5ee631059299b107ea83c8bbffdfb
Reviewed-on: https://gerrit.osmocom.org/70
Reviewed-by: Harald Welte <laforge@gnumonks.org>
Tested-by: Harald Welte <laforge@gnumonks.org>
2016-06-14 10:38:17 +00:00
Neels Hofmeyr 0167e3f355 add rsl_or_ipac_msg_name() for both standard and ip.access msg types
Context: in osmo-bts, I want to look up an RSL message name in rsl_msgt_names
and fall back to rsl_ipac_msgt_names if not found, because the IPAC PDCH ACT
and DEACT messages are sent in a standard ABIS_RSL_MDISC_DED_CHAN.

Change-Id: Ic9ba721a1469cf51aed97ab0f44a7fe055c94b1f
Reviewed-on: https://gerrit.osmocom.org/231
Reviewed-by: Harald Welte <laforge@gnumonks.org>
Tested-by: Jenkins Builder
2016-06-13 17:46:48 +00:00
Neels Hofmeyr 8d6dcd9bca add get_value_string_or_null() to handle unknown items
Add get_value_string_or_null() to return NULL in case the given value is not
found in the list of strings, to be able to cleanly fall back to another list
of strings. Absorb the lookup loop from get_value_string().

Context: in osmo-bts, I want to look up an RSL message name in rsl_msgt_names
and fall back to rsl_ipac_msgt_names if not found, because the IPAC PDCH ACT
and DEACT messages are sent in a standard ABIS_RSL_MDISC_DED_CHAN.
In a subsequent commit, get_value_string_or_null() will be used by new
rsl_or_ipac_msg_name().

Change-Id: I1fa3907e28d528d2758bc3eae9d19e6c1168f5e5
Reviewed-on: https://gerrit.osmocom.org/230
Reviewed-by: Harald Welte <laforge@gnumonks.org>
Tested-by: Jenkins Builder
2016-06-13 17:46:20 +00:00
Max ec8f192fec Add functions to detect HR/FR SID frames
Add functions which check if given FR or HR frame (packed in RTP)
contains SID (SIlence Descriptor) and corresponding tests.

Related: OS#22
Change-Id: I4051e3c0d4fb9ee93d7e9e0ef4abaf9f18e227ca
Reviewed-on: https://gerrit.osmocom.org/160
Tested-by: Jenkins Builder
Reviewed-by: Harald Welte <laforge@gnumonks.org>
2016-06-01 10:44:06 +00:00
Ruben Undheim 720ac4a4e1 Patched structs for big-endian architectures
Change-Id: I29eafe481e112d18c624b1c83add0d53c354dbe4
Reviewed-on: https://gerrit.osmocom.org/124
Tested-by: Jenkins Builder
Reviewed-by: Neels Hofmeyr <nhofmeyr@sysmocom.de>
Reviewed-by: Harald Welte <laforge@gnumonks.org>
2016-05-31 11:52:12 +00:00
Max 92db150488 Add helper functions for AMR codec
* add functions to encode/decode various codec paramters from RTP payload with
  AMR frame according to RFC 4867
* those functions are extended version based on code from osmo-bts'
  amr.c by Andreas Eversberg
* add corresponding enum types and strings for logging
* add regression tests

It's useful both to replace manual parsing in osmo-bts with fuctions
covered by test suite and as a debugging helpers for issues related to
AMR.

Change-Id: Ia217679a07d3fbc970f435e20f6eac33d34bd597
Related: OS#1562
Reviewed-on: https://gerrit.osmocom.org/118
Tested-by: Jenkins Builder
Reviewed-by: Holger Freyther <holger@freyther.de>
2016-05-31 10:11:51 +00:00
Max adef12a349 Add strings with PH primitive names
It's useful debugging helper while troubleshooting L1-related issues.

Change-Id: Id7a6d478fd725c51f54ad746bdf9b9095579ff77
Reviewed-on: https://gerrit.osmocom.org/117
Tested-by: Jenkins Builder
Reviewed-by: Max <msuraev@sysmocom.de>
Reviewed-by: Holger Freyther <holger@freyther.de>
2016-05-30 21:21:20 +00:00
Beshr Al Nahas e4c294f79b Fixing build on Mac OSX
Fix minor syntax error

Change-Id: I67f9a1e41fa5b1da3a4b10fc76138e153b767241
Reviewed-on: https://gerrit.osmocom.org/125
Tested-by: Jenkins Builder
Reviewed-by: Holger Freyther <holger@freyther.de>
2016-05-28 16:59:56 +00:00
Arran Cudbard-Bell cc3694b650 Fix build for OSX
Change-Id: I580a500edcf4812e570be586890abef746083a8c
Reviewed-on: https://gerrit.osmocom.org/74
Tested-by: Jenkins Builder
Reviewed-by: Holger Freyther <holger@freyther.de>
2016-05-20 16:32:58 +00:00
Max 764b022fc6 Add function to make Uplink Measurement
It assembles RSL Uplink Measurement IE according to 3GPP TS 08.58
§9.3.25. The function is based on lchan_build_rsl_ul_meas() from OsmoBTS
but optionally includes DTX information.

Change-Id: Ib37107bcc9909e5105ea711de42d3fb1db7e8d9e
Reviewed-on: https://gerrit.osmocom.org/44
Tested-by: Jenkins Builder
Reviewed-by: Harald Welte <laforge@gnumonks.org>
2016-05-17 16:10:31 +00:00
Max fe65fa7e36 Set DTX in Cell Options
* rename field of struct gsm48_cell_options to better match the spec
* add comments with spec references
* add function for setting DTX in cell options struct
* add necessary enum type

Change-Id: I5a8924f57669c951b2e51b663d95f1d360062a54
Reviewed-on: https://gerrit.osmocom.org/39
Reviewed-by: Harald Welte <laforge@gnumonks.org>
Tested-by: Jenkins Builder
2016-05-12 15:56:39 +00:00
Harald Welte 3d79240fb4 logging: Use __BASE_FILE__ instead of __FILE__
Apparently __FILE__ expands to nasty '../../..' paths when BUILDDIR !=
SRCDIR.  This in turn leads to ugly log lines like:

<0000> ../../../../osmo-bts/src/common/rsl.c:1642 (bts=0,trx=0,ts=0,ss=0) Handing RLL msg UNIT_DATA_IND from LAPDm to MEAS REP

Where we certainly wouldn't want the "../../../../osmo-bts" part.

Change-Id: If6d2de33c3b6bb2943954bbd81eff261dc279d58
Reviewed-on: https://gerrit.osmocom.org/38
Tested-by: Jenkins Builder
Reviewed-by: Harald Welte <laforge@gnumonks.org>
2016-05-12 11:15:22 +00:00
Harald Welte 766da86877 GSUP: Add support for RAND in SendAuthInfo.req
In the autentication re-sync case, we need not only the AUTS from
the MS/UE, but also the RAND that we sent as part of the failed
authentication challenge.
2016-05-06 11:22:05 +02:00
Harald Welte 48dc1a5a64 GSUP: Add OSMO_GSUP_CN_DOMAIN_IE to differentiate CS and PS plane
We're starting to use GSUP for circuit-switched (CS) plane, so we need
to differentiate the two planes somehow from each other.
2016-05-06 11:21:25 +02:00
Harald Welte 3b6fb0880c import gprs_gsup_message.[ch] from openbsc as gsup.[ch]
Move those routines from OpenBSC to libosmogsm, so they can be
re-used from other programs.  I think it was a mistake to add them only
inside the openbsc repository in the first place.  We need to pay more
attention to this in the future.
2016-05-06 11:21:06 +02:00
Harald Welte 9709b2e6fd Import osmo_{encode,decode}_big_endian() from openbsc 2016-05-05 18:49:27 +02:00
Harald Welte fbd02fa8cc tlv: Import osmo_shift_* and osmo_match_shift_* from openbsc
These routines have nothing to do with specifically the BSC, so import
them to the TLV parser we keep in libosmogsm.
2016-05-05 18:49:27 +02:00
Harald Welte 2d2e2cca0d Update doxygen annotations in libosmocore
This adds and improves doxygen API descriptions all over libosmocore,
reducing the 'white spots' that don't have any documentation.
2016-05-05 18:49:27 +02:00
Harald Welte 0996c87925 add new header file for TS 23.003 2016-05-05 18:49:27 +02:00
Harald Welte 64f38c0410 import gsm_04_08_gprs.[ch] from openbsc.git
The definitions in this header file (and associated strings in the
c file) are generic about the GPRS Layer3 signalling protocols, and
thus should be part of the library.
2016-05-05 18:49:27 +02:00
Harald Welte 69e6c3c7cd Add log_fini() function to release all memory allocated by logging framework
This is e.g. quite useful to call at the end of test code, in order to
show that all memory allocated actually is released before exit().
2016-05-05 18:49:22 +02:00
Harald Welte eea18a6f29 add two missing files (gsm0503.h / conv_gen.py) to previous commit 2016-04-29 15:18:35 +02:00
Max 8a5346ba2f Add function for appending range1024 to bitvec
Add convenience function to append range1024 encoded data (see 3GPP TS
44.018 Annex J) to a given bitvec.
2016-04-23 16:37:05 +02:00
Max 1f9d8183be Deprecate comp128
Mark function as deprecated to discourage its usage: people should use
generic API in osmocom/crypt/auth.h
2016-04-22 15:10:55 +02:00
Max fdb3d8ce78 Deprecate osmo_a5_1 and osmo_a5_2
Mark the functions as deprecated to discourage their use: people should
use unified osmo_a5 which supports all the A5/1-4 ciphers.
2016-04-22 15:10:53 +02:00
Max bf990bb8fd Update internal GPRS cipher API
Update internal API (for GPRS cipher implementors): make it compliant
with ETSI TS 155.22. External API left untouched.
2016-04-22 15:09:27 +02:00
Max 402b9b0555 Addditional classmark check against A5/4 support
Add classmark check function according to GSM 04.08 Chapter 10.5.1.7
Fix interface to use unsigned for unsigned value.
2016-04-22 15:09:09 +02:00
Max fbb8bfa514 Add function to get osmo_earfcn bit size
This function returns the number of bits necessary to pack osmo_earfcn
into Repeated E-UTRAN Neighbour Cells IE (3GPP TS 44.018 Table
10.5.2.33b.1).
2016-04-16 13:41:56 +02:00
Max d8fb14226f Add ubit <-> sbit convertors
Move functions for conversion between soft and unpacked bits to main
library as they are generally useful.
2016-04-12 10:10:44 -04:00
Holger Hans Peter Freyther 793a2907d5 vty: Make a reservation for the osmo-sip-connector
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.
2016-03-31 16:59:23 +02:00
Holger Hans Peter Freyther 61f28880d5 select: Externalize fd_set filling and dispatch
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
2016-03-31 16:56:51 +02:00
Max fb348eeff2 Export names for gsm_chan_t and gsm48_chan_mode
This can be used with get_value_string() to improve debugging output.
2016-03-30 21:50:44 +02:00
Harald Welte 932d2d4ce3 sim: make osim_reader_ops public 2016-03-19 21:18:40 +01:00
Harald Welte 6c33ae2605 Add new osmo_fd_get_by_fd() function
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.
2016-03-19 21:17:58 +01:00
Harald Welte 4acaa13433 sim: add class_tables / card profiles
The tables permit code to determine the APDU class of an APDU
based on it APDU/TPDU header (CLA/INS/P1/P2/P3).
2016-03-17 16:55:11 +01:00
Harald Welte 5bed23c6d2 add missing #include <stdbool.h> 2016-03-17 16:50:50 +01:00
Max ea345cdaaa Rename struct to better match libosmocore conventions 2016-03-17 16:49:15 +01:00
Max 03309b57e8 Add basic EARFCN support
Add structure representing group of EARFCNs with common priority,
threshold etc.
Add functions to populate this structure.
2016-03-17 14:07:19 +01:00
Max d4793212b5 Add function to add bits from array to bitvec
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.
2016-03-17 14:07:19 +01:00
Neels Hofmeyr bdccc1b144 gsm48: factor out MCC+MNC BCD parsing for re-use in UMTS
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.
2016-03-15 14:30:41 +01:00
Neels Hofmeyr da7bf4d55a 04.08: add inline funcs for transaction id bits
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.
2016-03-15 14:11:49 +01:00
Neels Hofmeyr c656faed12 04.08: switch to r99 msg type bitmasks by default
[hfreyther: Separated from the previous patch to allow an easy
revert]
2016-03-15 14:11:13 +01:00
Neels Hofmeyr 282e908434 04.08: add inline funcs for pdisc + msg type bitmasks
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]
2016-03-15 14:10:45 +01:00
Max c0d9a6c083 Add helper function to convert numerical BSSGP PDU type to string 2016-03-11 22:29:39 +07:00
Max e859aec952 Add support for SI2quater messages
Add basic data structure for System information Type 2quater.
2016-03-11 22:09:21 +07:00
Harald Welte 5ffb50371e rename osim_file_find_* to osim_file_desc_find_*
they return an osim_file_desc, and not an osim_file, so fix the naming
2016-03-11 22:05:25 +07:00
Harald Welte c28f4cdd6d sim: Add osim_file_find_{fid,sfid}() functions
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.
2016-03-11 22:05:25 +07:00
Jacob Erlbeck a89d22c0f0 log: Add conditional logging based on log_check_level
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
2016-02-29 14:30:14 +01:00
Jacob Erlbeck de6dd72dbb log: Add log_check_level function
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
2016-02-29 14:30:14 +01:00
Neels Hofmeyr cda988527f fix gsm_7bit_decode API comment: septets, not octets 2016-02-29 09:56:26 +01:00
Max 6a5ef46dd0 Add byte printing macros
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.
2016-02-25 22:35:44 +01:00
Neels Hofmeyr f81eb328b6 vty: add ctrl section for Control interface bind address
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.
2016-02-25 11:02:35 +01:00
Neels Hofmeyr 4934309dab add ctrl_interface_setup_dynip() for bind address
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).
2016-02-25 11:02:35 +01:00
Neels Hofmeyr 96172f0100 vty: add bind command for telnet vty line
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.
2016-02-25 11:02:34 +01:00
Max cc00bf8779 Extend L1SAP PH-DATA with presence information
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.
2016-02-22 11:08:44 +01:00
Jacob Erlbeck f78ec5ce0d gb: Add bssgp_msgb_copy function
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
2016-02-22 10:20:49 +01:00
Max 5c18e26bc2 Add T4 bit map compression routines
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>
2016-02-18 19:45:44 +01:00
Max 0a59e9899f Expand bitvec interface
Add bit filling, shifting and other functions necessary for bit
compression implementation. Add corresponding tests.
2016-02-18 19:45:40 +01:00
Neels Hofmeyr 8684714966 Add CSCN ctrl port defs 2016-02-15 12:02:02 +01:00
Neels Hofmeyr 620dfa6be2 add vty port nr for osmo-cscn 2016-02-10 13:28:00 +01:00
Holger Hans Peter Freyther a9301a1a1f bitvec: Test and fix regression for C++->C conversion
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.
2016-01-30 10:54:43 +01:00
Max a15f05f1b4 Add bitvec-related functions from Osmo-PCU
Allocation, pack/unpack, field access and helper routines used
extensively by Osmo-PCU. Whenever memory allocation happens, alocator
context is passed explicitly by caller.
2016-01-26 11:01:23 +01:00
Max e49af08f5b bitvec: Fix interface to consistently use unsigned int
Use unsigned int for the length throughout the interface. We will
never have a a negative length.

Sponsored-by: On-Waves ehf
2016-01-22 23:22:48 +01:00
Neels Hofmeyr f6d9f3759c comment typo 2016-01-18 10:44:36 +01:00
Jacob Erlbeck ff42b26520 msgb: Assert len >= 0 in msgb_trim
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
2016-01-15 18:11:58 +01:00
Jacob Erlbeck 5f349be820 bitvec: Add get/set byte sequences
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
2016-01-15 14:51:32 +01:00
Jacob Erlbeck 8114294bf2 gsm: Add APN conversion functions
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
2016-01-15 14:46:19 +01:00
Harald Welte c959afdcd9 osmo_prim_op_names should be extern 2015-12-25 17:14:07 +01:00
Harald Welte a2db75f28c Add osmo_prim_op_names[] symbol and _SAP_SS7_BASE define 2015-12-23 14:11:54 +01:00
Jacob Erlbeck 8db1134c72 msgb: Add msgb_test_invariant function
This adds a function that verifies whether a mgsb is consistent.

Sponsored-by: On-Waves ehf
2015-12-21 16:22:57 +01:00
Jacob Erlbeck cdd05f0ed4 msgb: Add msgb_resize_area and msgb_copy
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
2015-12-21 16:14:23 +01:00
Neels Hofmeyr 9e57a5a697 some comments / fixed typos 2015-12-21 11:25:05 +01:00
Harald Welte fad5752ab5 RSL: Add enum + TLV definitions for ip.access style embedded IEs 2015-12-13 21:57:29 +01:00
Ruben Undheim 771a58feee gsm_03_41: Fix structure definitions for big-endian machines
this was detected by debian packaging, as the associated gsm_03_41 test
case fails on big endian machines like ppc.
2015-12-09 20:22:42 +01:00
Jacob Erlbeck ac4ed17dbd stats: Add OSMO prefix to STAT_ITEM_NOVALUE_ID
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
2015-12-08 10:33:15 +01:00
Jacob Erlbeck af5bad5ed0 stat: Explicitly support stat_items without unit
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
2015-12-08 10:33:04 +01:00
Harald Welte 90e614f7cc remove our internal copy of talloc, use system libtalloc
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.
2015-12-05 23:38:18 +01:00
Jacob Erlbeck b6e6bea4ec stats: Move statsd related code into a separate file
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
2015-11-26 12:52:24 +01:00
Harald Welte a10ef29b47 use system-wide libtalloc with --enable-system-talloc
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
2015-11-21 00:50:19 +01:00
Jaroslav Škarvada 2b82c1c6c8 fix FSF address in sources/headers
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
2015-11-12 13:46:05 +01:00
Jacob Erlbeck aed7c125fd stats: Send all values on reporter update
Currently only counter changes and new item values are being
reported. This makes it cumbersome to configure reporting clients,
since there is nothing like a list of all parameters.

This commit changes this behaviour such that all currently existing
counters and items that would be reported eventually, are passed to
the reporter when it has been reconfigured or enabled. If a counter
has not been incremented, 0 is sent. If a stat item value has not
been added, the last item value (or the default value if there is
none) is resent again.

Note that this will not catch transient counters/items that will be
created later on, e.g. triggered by new peers or subscribers.

To just force this kind of dump on a running reporter, it is
sufficient to invoke the 'enable' command in its configuration node.

Sponsored-by: On-Waves ehf
2015-11-09 14:49:49 +01:00
Holger Hans Peter Freyther 495b0dbd24 gprs-ns/stats: When the NSVCI is updated, update the stats counter
The NS object is created with an unknown identity and only after
the reset procedure has progressed (completed?) we know the real
ID for this peer. Before nobody has looked at the idx values (this
could have been seen with the CTRL interface) but with statsd the
wrong NSVCI becomes obvious.

Add routines to update the idx and I don't know if the change of
idx is causing any issues but we will find that out soon.
2015-11-04 14:39:37 +01:00
Jacob Erlbeck 59b90bc444 stats/vty: Add selective show stats command
Currently there is only the 'show stats' command which shows all
counter and stat_item values. This can lead to many lines of output
if there are per-subscriber rate counters.

The new command added by this commit allows it to only show groups of
a certain level (class_id), similar to the 'level' configuration
command for stats reporter.

The new command is

  show stats level (global|peer|subscriber)

Sponsored-by: On-Waves ehf
2015-08-22 01:47:55 +00:00
Holger Hans Peter Freyther c337693c4c stats: Fix build on FreeBSD
include stdint.h for int64_t and use netinet/in.h and not
netinet/ip.h for getting sockaddr_in and such.
2015-08-21 19:56:54 +00:00
Neels Hofmeyr 07cf861e25 gtphub: add OSMO_VTY_PORT_GTPHUB.
This is for gtphub, being developed in openbsc.git.

Sponsored-by: On-Waves ehi
2015-11-02 20:24:06 +01:00
Neels Hofmeyr 667e83d71e fix some typos
Sponsored-by: On-Waves ehi
2015-11-02 20:23:34 +01:00
Jacob Erlbeck 79125ecf7d log: Add new DLSTATS log level
This log level is used by the stats subsystem log reporter to report
statistics to level INFO. Note that the default level of DLSTATS is
NOTICE.

Sponsored-by: On-Waves ehf
2015-11-02 15:39:31 +01:00
Jacob Erlbeck bc9d9aced8 stats: Limit reporting by class id
This commit adds class_id fields to the rate_ctr and stat_item group
descriptions. The stats reporter code is extended to only process
groups whose class_id does not exceed a per reporter max_class level.

If the class_id is not set, the code assumes 'global' for groups with
idx == 0 and 'subscriber' otherwise.

The following vty command is added to config-stats:

  level (global|peer|subscriber)  Set the maximum group level

Sponsored-by: On-Waves ehf
2015-11-02 15:39:31 +01:00
Jacob Erlbeck 34eec7da8d vty: Add reserved nodes to enum node_type
Currently every time a node is added to enum node_type, this
constitutes an ABI change, since _LAST_OSMOVTY_NODE will get
incremented accordingly. In this case, every project that adds new
node type based on that value will have to be recompiled.

This commit adds 4 spare node type values, which can be replaced
one-by-one by new real types until they are exhausted to avoid
this kind of ABI change.

Sponsored-by: On-Waves ehf
2015-11-02 15:39:31 +01:00
Jacob Erlbeck fc9533d6c4 stats: Add osmo_ name prefix to identifiers
Since the the stat_item and stats functions and data types are meant
to be exported, they get an osmo_ prefix.

Sponsored-by: On-Waves ehf

[hfreyther: Prepended the enum values too. This was requested by
Jacob]
2015-11-02 15:39:01 +01:00
Jacob Erlbeck bc4f7ae512 stats: Add log reporter
This reporter passes the measurement values to the logging subsystem
as DSTATS (which is currently DLGLOBAL) level INFO messages.

Sponsored-by: On-Waves ehf
2015-10-29 01:10:07 +01:00
Jacob Erlbeck 490b38f57a stats: Use function pointers in reporter objects
Currently case statements are used to select the right reporter
functions. This makes it difficult to add new reporter types,
especially if they are not going to reside in the same file.

This commit introduces per reporter function pointer for
open, close, send_count, and send_item. They are checked for
non-NULL before being called or skipped.

Sponsored-by: On-Waves ehf
2015-10-29 01:10:07 +01:00
Jacob Erlbeck ed197fd4f9 stats: Make net config optional
To support reporters without network configuration, this commit
introduces the have_net_config flag to provide corresponding error
messages.

Sponsored-by: On-Waves ehf
2015-10-29 01:10:06 +01:00
Jacob Erlbeck d01acfcc75 stats: Support statsd Multi-Metric Packets
If the MTU is given, combine several messages into a single UDP
packet until the limit is reached. Flush all reporters after the
values have been scanned.

New vty commands (node config-stats):
  mtu <100-65535>     Enable multi-metric packets and set the maximum
                      packet size (in byte)
  no mtu              Disable multi-metric packets

Note that single messages that are longer than the given MTU (minus
28 octets protocol overhead) will be dropped.

Sponsored-by: On-Waves ehf
2015-10-29 01:10:06 +01:00
Jacob Erlbeck 80db4ec387 core: Add difference function to osmo_counter
The osmo_counter_difference returns the counter value difference
since the last call of this function with the given counter object.

Sponsored-by: On-Waves ehf
2015-10-29 01:10:06 +01:00
Jacob Erlbeck b1dbfb4c41 stats: Implement timer based reporting
This calls stats_flush in regular intervals which polls the
statistical values and calls the active reporters when values have
changed.

Sponsored-by: On-Waves ehf
2015-10-29 01:10:06 +01:00
Jacob Erlbeck adc900e0e3 stats/vty: Add stats configuration
This commit provides stats configuration similar to the log
configuration.

The following vty commands are added to the config node:
  stats reporter statsd          Create/Modify a statsd reporter
  no stats reporter statsd       Remove a statsd reporter

To actually configure a reporter, the config-stats node is entered
when the "stats reporter" command has succeeded. The following new
vty commands are available there:
  local-ip ADDR          Set the IP address to which we bind locally
  no local-ip            Do not bind to a certain IP address
  remote-ip ADDR         Set the remote IP address to which we connect
  remote-port <1-65535>  Set the remote port to which we connect
  prefix PREFIX          Set the item/counter name prefix
  no prefix              Do not use a prefix
  enable                 Enable the reporter
  disable                Disable the reporter

Sponsored-by: On-Waves ehf
2015-10-29 01:10:06 +01:00
Jacob Erlbeck 95bf828003 stats: Add the reporting framework
This commit provides the stats reporting framework that can manage
several types of measurement reporters. Initially support for
rate_ctr and the statsd protocol is included.

Sponsored-by: On-Waves ehf
2015-10-29 01:10:03 +01:00
Jacob Erlbeck 45513e6040 stats/vty: Add stats_vty.c
This file will contain the VTY code related to statistics.

This commit adds a minimal file with just as single VTY command:

- show stats    This command shows all statistical values

To enable this and future commands, the main program needs to call
stats_vty_add_cmds().

Sponsored-by: On-Waves ehf
2015-10-29 00:09:04 +01:00
Jacob Erlbeck 7211fe157e stat/vty: Add vty_out_statistics_full to show all statistics
This functions shows the state of all osmo_counters, stat_item
groups, and counter groups.

Sponsored-by: On-Waves ehf
2015-10-28 23:53:46 +01:00
Jacob Erlbeck e5b0fe2e3c core: Update osmo_counters_for_each doc
Fix type and add a note about the semantics of the handler's return
code.

Sponsored-by: On-Waves ehf
2015-10-28 23:53:45 +01:00
Jacob Erlbeck c6a7108828 stats: Add stat_item_for_each functions
This commit adds the following functions:

  stat_item_for_each_group     Call a handler for each group
  stat_item_for_each_item      Call a handler for each item of a
                               group

Sponsored-by: On-Waves ehf
2015-10-28 23:51:24 +01:00
Jacob Erlbeck 423c1e5a4f core: Extend rate_ctr by helper functions
For global value reporting, some additional helper functions are
needed. The statsd protocol expects differential counter values,
which are currently not provided by rate_ctr (except for s/m/h/d
intervals).

This commit adds several helper functions to rate_ctr:

- rate_ctr_difference  returns the counter delta since the last
                       call to this function for a given counter
- rate_ctr_for_each_counter
                       iterates through each counter of a group
- rate_ctr_for_each_group
                       iterates through all globally registered
                       counter groups

Note that the rate_ctr_difference function can only be used by a
single backend, since it modifies the 'previous' field in the
rate_ctr obj.

Sponsored-by: On-Waves ehf
2015-10-28 23:51:24 +01:00
Jacob Erlbeck b27b352e93 stats: Use a global index for stat item values
Currently each stat item has a separate index value which basically
counts each single value added to the item and which can be used by
a reporter to get all new values that have not been reported yet.
The drawback is, that such an index must be stored for each stat
item.

This commit introduces a global index which is incremented for each
new stat item value. This index is then stored together with the item
value. So a single stored index per reporter is sufficient to make
sure that only new values are reported.

Sponsored-by: On-Waves ehf
2015-10-28 23:51:24 +01:00
Jacob Erlbeck 0a1400fc83 ns: Add statistics for some events
The following counters are added to the ns.nsvc counter group:
  lost.alive             The number of missing ALIVE ACK messages
  lost.reset             The number of missing RESET ACK messages

The following items are added to the ns.nsvc stat item group:
  alive.delay            The time in ms between sending ALIVE and
                         receiving the next ALIVE ACK

Sponsored-by: On-Waves ehf
2015-10-28 23:51:24 +01:00
Jacob Erlbeck 738d9e2210 stats: Add vty_out_stat_item_group
This functions dumps a whole stat item group to the VTY.

Sponsored-by: On-Waves ehf
2015-10-28 23:51:12 +01:00
Jacob Erlbeck 9732cb4a92 stats: Add stat_item for value monitoring
This commit adds instrumentation function to gather measurement
and statistical values similar to counter groups.

Multiple values can be stored per item, which can be retrieved in
FIFO order. Getting values from the item does not modify its state to
allow for multiple independant backends (e.g. VTY and statd).

When a new value is set, the oldest value gets silently overwritten.
Lost values are skipped when getting values from the item.

Sponsored-by: On-Waves ehf
2015-10-28 23:51:04 +01:00
Neels Hofmeyr c84851bccc comments 2015-10-09 00:01:06 +02:00
Neels Hofmeyr 5eeb17a017 ipaccess: add OAP proto_ext (in design). 2015-09-23 23:18:15 +02:00
Harald Welte 1a8c4e05fb Introduce gsm48_mi_type_name() function 2015-08-18 19:32:33 +02:00
Harald Welte 1f6aad1c04 Add G-RNTI derived TLLI types defined in 23.003 2015-08-18 19:32:33 +02:00
Holger Hans Peter Freyther a9e5252128 vty: Change API to have node installation be done by int
We are mixing enums and hope that no short-enums are used. This
is leading to a lot compiler warnings generated by clang. Change
the API to work with integers.

Porting:
The go_parent_cb implementations in the applications need to be
fixed. The API change leads to a compile time warning.

Fixes:
abis_om2000_vty.c:46:2: warning: implicit conversion from enumeration type 'enum bsc_vty_node' to
      different enumeration type 'enum node_type' [-Wenum-conversion]
        OM2K_NODE,
        ^~~~~~~~~
2015-08-05 04:22:56 +00:00
Holger Hans Peter Freyther f558ed4bb9 ipa: Properly parse LV stream of a ID_GET request
For some reason the structure is closer to be a LV (length
and value). The value is actually a tag but it is counted
inside the length. Introduce an overload of the parse function
to provide an offset for the length. This will be taken from
the returned length.
2015-06-02 15:52:06 +02:00
Harald Welte 908085ccbc Add APN utility function to libosmogsm
The current functions are used to 'qualify' an APN from the
user-supplied APN name (name identifier) towards the fully-qualified
APN name which is used in the .grps DNS zone.
2015-05-25 11:12:16 +08:00
Jacob Erlbeck 9385d1e01b bssgp: Fix bssgp_tx_fc_bvc parameter type
Currently large values for Bmax default MS get sliced since a uint16_t is
used as the type of the corresponding parameter of bssgp_tx_fc_bvc.
GSM 48.018, 11.3.2 which in turn refers to 11.3.5 specifies a maximum
of 6MB (0xffff * 100).

This commit changes the type to uint32_t to cover the full value
range.

Sponsored-by: On-Waves ehf
2015-05-06 17:55:55 +02:00
Holger Hans Peter Freyther 780bba625d linuxlist: Remove casting of ptr from container_of macro
The cast is not present in the original macro and was added
in OpenBSC with commit (be68f6fc6cde1367a4481d2e774a64e2cd657267)
to help using the header with C++. Due the recent issue in
the bssgp flow control code, let's remove the cast to see
wrong pointer usage. In case C++ code doesn't compile anymore
we can see how to add a cast back to it.

Change was proposed by Michael McTernan
2015-05-02 07:59:00 +02:00
Holger Hans Peter Freyther 0f40ae12c8 osmo_static_assert: Put back the typedef in the code
In OSX the int declares linkage and for libosmo-abis we have
two static asserts with the same name in two different compilation
units. When adding the "unused" attribute I removed the typedef.
I verified with a gcc 4.9.2 that no new warnings will be shown
when compiling libosmo-abis.
2015-04-13 09:21:05 +02:00
Holger Hans Peter Freyther c2b4458e07 sim: Use extern for these structs to generate a linkage
Fixes:
duplicate symbol _ts102221_fcp_vals in:
    .libs/core.o
    .libs/card_fs_usim.o
duplicate symbol _pcsc_reader_ops in:
    .libs/reader.o
    .libs/card_fs_usim.o
2015-04-11 19:31:03 +02:00
Jacob Erlbeck 8d192d7153 ns: Log when sending fails (Coverity)
Currently the return value of the gprs_ns_tx family of functions is
often ignored. This is not a serious issue, since the successful
delivery of the messages is neither guaranteed nor acknowledged by
the network layer anyway.

Nevertheless this commit adds logging (level INFO) to gprs_ns_tx and
gprs_ns_msgb_alloc. The definition of the latter has been moved from
the header file to gprs_ns.c.

Fixes: Coverity CID 1040678, 1040679, 1040680, 1040681, 1040682,
   1040683, 1040684, 1040686, 1040687, 1040688, 1111545,
   1240203, 1240204
Sponsored-by: On-Waves ehf
2015-04-07 20:10:23 +02:00
Max f8699ca51e gsm: Add A5/3-4 cipher support
Signed-off-by: Max <max.suraev@fairwaves.co>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2015-03-28 18:07:05 +01:00
Holger Hans Peter Freyther 249a81b7ff endian: Be able to detect endian on GNU and BSD
On GNU __BYTE_ORDER and __LITTLE_ENDIAN is defined and
the include is "endian.h" on FreeBSD it is "sys/endian.h"
and LITTLE_ENDIAN/_LITTLE_ENDIAN and BYTE_ORDER/_BYTE_ORDER
is defined.

Create a header file that defines OSMO_IS_LITTLE_ENDIAN
and OSMO_IS_BIG_ENDIAN and can be used as

 #if OSMO_IS_LITTLE_ENDIAN
   do_little_endian
 #elif OSMO_IS_BIG_ENDIAN
   do_big_endian
 #else
   #error "Unknown endian"
 #endif
2015-03-22 09:03:42 +01:00
Jacob Erlbeck 36153dc61a bssgp: Handle BSSGP STATUS messages
Currently incoming BSSGP STATUS messages are just logged and no other
action is taken. This makes it impossible for higher layers to react
to failures which are indicated by corresponding STATUS messages
unless a timeout is triggered as a result of that failure later on.

This commit adds a bssgp_rx_status() function and calls it on
incoming STATUS messages. That function logs a message, increments the
new BSSGP_CTR_STATUS counter if the bctx context exists and invokes
an NM_STATUS status indication. The latter will allow the application
to handle failures immediately. Since all STATUS messages should be
handled, the function is already called in bssgp_rcvmsg and the
message is no longer handled in (and will not reach) bssgp_rx_sign
and bssgp_rx_ptp.

Ticket: OW#1414
Sponsored-by: On-Waves ehf
2015-03-18 21:54:37 +01:00
altaf f6a0ceb92f core/gsmtap: LTE RRC message types and LTE MAC define
Submitted-by: altaf <altaf329@gmail.com>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2015-01-18 23:16:03 +01:00
Tobias Engel 419684e30c Supplementary Services (de)activation, interrogation added
These patches enhance the Supplementary Service (SS) processing from
only being able to handle USSD to other SS, specifically activation,
deactivation and interrogation of those SS. Registration is not yet
implemented.

include/osmocom/gsm/protocol/gsm_09_02.h has been added with needed
values for SS.

Modified by Harald Welte to keep the old ussd-only functiosn for API/ABI
stability.
2015-01-01 14:19:17 +01:00
Harald Welte c13cf8bbd3 SMS-CB: introduce and use GSM341_7BIT_PADDING 2014-12-30 13:25:44 +01:00
Harald Welte 61ced83a70 SMS-CB: Add #defines for maximum block/msg size and payload chars 2014-12-30 13:18:26 +01:00
Harald Welte be4bbeb01b add missing gsm0341.h 2014-12-30 01:22:26 +01:00
Harald Welte a19717a7c5 Add Cell Broadcast MSGIDs from TS 23.041 v12.6.0 Release 12 2014-12-29 13:14:48 +01:00
Holger Hans Peter Freyther c8c33094af bitvec: Fix typo in the csn1 encoding code
We can curse about CSN.1 and 3GPP but I think we want to call
it cursor here.
2014-12-28 18:22:48 +01:00
Harald Welte 1b12d16c4c libosmo-gsm: Add PCHAN/LCHAN types for CBCH 2014-12-28 13:37:01 +01:00
Jacob Erlbeck 3cd6753a11 ipa: Add forward declaration of struct osmo_fd
A pointer to struct osmo_fd is used in a few prototypes declared in
gsm/ipa.h, but is neither declared explicitly nor is such a
declaration reachable via the given include directives.

This patch adds a forward declaration of this type to ensure proper
compilation.

Sponsored-by: On-Waves ehf
2014-12-22 14:44:52 +01:00
Holger Hans Peter Freyther 4448048828 ipa: Make a reservation for the GSUP protocol
GSUP is a protocol to have the OpenBSC SGSN talk
to an exterbal system for 3GPP MAP connectivity.
2014-12-14 19:01:14 +01:00
Holger Hans Peter Freyther 2d6ad13d8d logging: Make it possible to print category/subsys and timestamps
We want to see from which category/subsystem a certain log message
is coming from and use a different timestamp format as well. Add
two new bitfields. This doesn't change the size of the structure
and on 32bit we still have 27bits left.

The extended timestamp will take preference over the current and
default timestamp format.

Fixes: SYS#602
2014-12-05 10:23:28 +01:00
Holger Hans Peter Freyther a5dc19dc40 gtp: Add a global region for the gtp library of OpenGGSN
We want to use libosmocore/libosmovty in the GGSN sourcecode
and reserve a global region here.
2014-12-04 14:39:14 +01:00
Holger Hans Peter Freyther 9f0f978c8d vty: Check with the application before writing the config
For the BSC/NITB application we see that people modify the band
without modifying the ARFCN. This creates an unbootable config.
Using the new hook the BSC/NITB can check if the config is
consistent and prevent the config file being written.

Related: SYS#739
2014-12-04 14:39:14 +01:00
Harald Welte 7b74dda31b remove references to u_char type, use 'unsigned char' instead
... u_char not being defined on Nuttx.
2014-11-14 15:22:14 +01:00
Harald Welte 33e940b862 sttrb / loggingrb: Use GPLv2+ as license, not AGPLv3+
according to Holger, using AGPLv3+ at the time was a mistake and the
license should always have indicated GPLv2+.
2014-10-26 20:52:25 +01:00
Harald Welte 7fa89c2e88 Change license of libosmogb from AGPLv3+ to GPLv2+
The copyright holders Harald Welte, Holger Freyther, Andreas Eversberg
and sysmocom - s.f.m.c. GmbH (represented by Holger and Harald) agree
that the license of libosmogb should be GPLv2+ and not AGPLv3+.

The reason the source files stated AGPLv3+ is due to the history, as
they were moved from OpenBSC to libosmocore at the time we needed to use
them from osmo-pcu.  It was an oversight back then to not re-license
them accordingly.
2014-10-26 20:50:19 +01:00
Harald Welte 6729a9776a make sure to register DF.TELECOM and DF.GSM for SIM, USIM + TSIM
before we only did it partially, and by exporting data from sim,
rather than the new osim_int_cprof_add_{gsm,telecom}() functions.
2014-10-26 19:50:55 +01:00
Harald Welte 67354b1b4e sim: add missing const to reader_ops member of reader_handle 2014-10-26 19:50:55 +01:00