Commit Graph

1743 Commits

Author SHA1 Message Date
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
Ruben Undheim 029f5a1c0d misc: Some spelling errors corrected
Change-Id: Ibfc239b84879556624ca6020ae6a63d102640c94
Reviewed-on: https://gerrit.osmocom.org/114
Tested-by: Jenkins Builder
Reviewed-by: Neels Hofmeyr <nhofmeyr@sysmocom.de>
2016-05-25 19:43:56 +00:00
Holger Freyther 45abec20dd Revert "gsm48: move to hex TMSI representation"
This is a "flag" day change. Old OpenBSC break with new libosmocore
because suddenly there is the 0x in front. I am afraid we need to
find a better solution here. I think we will need to create a
gsm48_mi_to_string variant that takes a mode parameter to enable the
TMSI mode and deprecate the old method.

Right now we should not break old versions of OpenBSC.

This reverts commit 78ad042f94.

Change-Id: I2f61e626f2f9088b492e1b643c3dcc9bce77d52b
Reviewed-on: https://gerrit.osmocom.org/86
Tested-by: Jenkins Builder
Reviewed-by: Holger Freyther <holger@freyther.de>
2016-05-20 19:42:50 +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
Vadim Yanitskiy 78ad042f94 gsm48: move to hex TMSI representation
Previously, we traditionally displayed a TMSI in its integer
representation, which is quite unusual in the telecom world.
A TMSI is normally printed as a series of 8 hex digits.

Review at https://gerrit.osmocom.org/57/
Change-Id: Ifd25365bfa3b4ee95b16979740c3229948ce17f2
Reviewed-on: https://gerrit.osmocom.org/57
Tested-by: Jenkins Builder
Reviewed-by: Harald Welte <laforge@gnumonks.org>
Reviewed-by: Holger Freyther <holger@freyther.de>
2016-05-20 16:26:51 +00:00
Alexander Couzens 2da9e11258 add .gitreview
A gitreview file is required to use git review.
More information about git review
https://www.mediawiki.org/wiki/Gerrit/git-review

Change-Id: I95235dddf60670c38a5a7a726c2a77f09d03c303
Reviewed-on: https://gerrit.osmocom.org/69
Tested-by: Jenkins Builder
Reviewed-by: Holger Freyther <holger@freyther.de>
2016-05-19 06:39:13 +00:00
Arran Cudbard-Bell ec012d0999 Ignore config.cache
Change-Id: Ida2294e490eb5eec515aa00742fb6cfc29b11b48
Reviewed-on: https://gerrit.osmocom.org/83
Tested-by: Jenkins Builder
Reviewed-by: Holger Freyther <holger@freyther.de>
2016-05-19 06:31:34 +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
Holger Hans Peter Freyther d71257fdb6 debian: Fix packaging by requiring python-minimal
We require the python2 binary to generate code. In Debian this
is provided by python-minimal. Add it to the build-depends to
fix building packages.

Change-Id: Iaa26f4331966d015b193d2ab1e34621b1e319ef1
Reviewed-on: https://gerrit.osmocom.org/37
Tested-by: Jenkins Builder
Reviewed-by: Holger Freyther <holger@freyther.de>
2016-05-10 11:43:25 +00:00
Neels Hofmeyr c7bf8d0c84 api doc: auth_core.c: add \returns, cosmetic
Add various missing \returns doxygen entries.

In osmo_auth_3g_from_2g(), also adjust two comment-closing instances to
match common style and add a period to end a sentence.

(The recent addition of osmo_auth_3g_from_2g() raised my attention, and I added
more return value docs while at it.)

Change-Id: Iea71eb666bc061acb6b14215f398bd38d17b3ad3
Reviewed-on: https://gerrit.osmocom.org/33
Tested-by: Jenkins Builder
Reviewed-by: Holger Freyther <holger@freyther.de>
2016-05-10 11:05:27 +00:00
Harald Welte 7530d8242e add doc/*.tag to .gitignore 2016-05-06 11:22:06 +02: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 cd9cb90f45 auth_core: Add osmo_auth_3g_from_2g() to compute CK+IK from Kc
This function performs the C5+C4 conversion to derive UMTS key
material from a 2G-only subscriber.
2016-05-05 18:48:05 +02:00
Holger Hans Peter Freyther 3a96d2837c conv_gen: Use python2 to execute the script
The script does not work with python3:

$ python3 utils/conv_gen.py
  File "utils/conv_gen.py", line 124
    def _print_term(self, fi, num_states, pack = False):

Second there is no 'python' on FreeBSD and one needs to select
the major version to use.

  GEN      conv_cs3_gen.c
  GEN      conv_xcch_gen.c
  GEN      conv_cs2_gen.c
python: not found
python: not found
python: not found

By using python2 we solve both issues. On Debian python2 is located
inside the python-minimal package.
2016-04-29 21:24:48 +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
Harald Welte 84da22f964 Add code generator for convolutional codes
Add python utility to generate .c code with convolutional
encoder/decoder based on polynomial description of the code. If argument
given it'll be interpreted as intended output directory, otherwise
current working directory is used.

Codes for *CCH, CS2/3 and TCH/AFS are generated. Corresponding manual
implementations are removed from tests. This introduce build-time
dependency on python.

The main work for this patch was generously contributed by Sylvain
Munaut.

Fixes: OS#1629
2016-04-29 13:17:22 +02:00
Holger Hans Peter Freyther aa16d63c27 milenage/aes: Address undefined behavior on bitshift
Extend the u8 to u32 before going to shift it.

Fixes:
milenage/aes-internal.c:799:4: runtime error: left shift of 128 by 24 places cannot be represented in type 'int'
    #0 0x7f84e9fe86a2 in rijndaelKeySetupEnc (/home/builder/jenkins/workspace/Osmocom_Sanitizer/source/libosmocore/src/gsm/.libs/libosmogsm.so.5+0xfa6a2)
    #1 0x7f84e9febad8 in aes_encrypt_init (/home/builder/jenkins/workspace/Osmocom_Sanitizer/source/libosmocore/src/gsm/.libs/libosmogsm.so.5+0xfdad8)
    #2 0x7f84e9fe7d14 in aes_128_encrypt_block (/home/builder/jenkins/workspace/Osmocom_Sanitizer/source/libosmocore/src/gsm/.libs/libosmogsm.so.5+0xf9d14)
    #3 0x7f84e9febe7d in milenage_f1 (/home/builder/jenkins/workspace/Osmocom_Sanitizer/source/libosmocore/src/gsm/.libs/libosmogsm.so.5+0xfde7d)
    #4 0x7f84e9fee2ce in milenage_generate (/home/builder/jenkins/workspace/Osmocom_Sanitizer/source/libosmocore/src/gsm/.libs/libosmogsm.so.5+0x1002ce)
    #5 0x7f84e9fe76d7 in milenage_gen_vec (/home/builder/jenkins/workspace/Osmocom_Sanitizer/source/libosmocore/src/gsm/.libs/libosmogsm.so.5+0xf96d7)
    #6 0x7f84e9fe6c08 in osmo_auth_gen_vec (/home/builder/jenkins/workspace/Osmocom_Sanitizer/source/libosmocore/src/gsm/.libs/libosmogsm.so.5+0xf8c08)
    #7 0x401441 in main (/home/builder/jenkins/workspace/Osmocom_Sanitizer/source/libosmocore/tests/auth/.libs/lt-milenage_test+0x401441)
    #8 0x7f84e8e33a3f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x20a3f)
    #9 0x400e58 in _start (/home/builder/jenkins/workspace/Osmocom_Sanitizer/source/libosmocore/tests/auth/.libs/lt-milenage_test+0x400e58)
2016-04-24 20:57:30 +02:00
Holger Hans Peter Freyther 7d004a1d69 doxygen: Remove the tag file on uninstall as well
Hopefully last patch:

ERROR: files left in build directory after distclean:
./doc/libosmocore.tag
./doc/libosmovty.tag
./doc/libosmogsm.tag
./doc/libosmocodec.tag
Makefile:800: recipe for target 'distcleancheck' failed
2016-04-24 20:57:30 +02:00
Holger Hans Peter Freyther c63ed3f7c6 doxygen: Next try to fix the uninstall handling
Use /* to remove the files
2016-04-24 20:30:34 +02:00
Holger Hans Peter Freyther faaf2528b1 doxygen: Try to uninstall the search files as well
Try to fix this by putting the search directory first as I don't
know how to pass -r to the RM command.

rm -f doc/{core,gsm,vty,codec}/{html,latex}/* doc/html.tar doc/{core,gsm,vty,codec}/doxygen_sqlite3.db
rm: cannot remove ‘doc/core/html/search’: Is a directory
rm: cannot remove ‘doc/gsm/html/search’: Is a directory
rm: cannot remove ‘doc/vty/html/search’: Is a directory
rm: cannot remove ‘doc/codec/html/search’: Is a directory
2016-04-24 20:18:20 +02:00
Max 936151bbff Add static lib to -dev .deb package
According to https://www.debian.org/doc/debian-policy/ch-sharedlibs.html
and http://packaging.ubuntu.com/html/libraries.html that's where it
belongs.
2016-04-24 19:52:20 +02:00
Sylvain Munaut 610ef99e6d Doxygen: enable tagfile generation and usage for cross-project references
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2016-04-24 19:48:05 +02:00
Sylvain Munaut c7c582a95f Doxygen: Enable client-based search engine
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2016-04-24 19:48:05 +02:00
Max 27e8036d41 Fix unaligned access found by addr. sanitizer
gprs_bssgp.c:461:9: runtime error: load of misaligned address
0x62100001a66b for type 'uint32_t', which requires 4 byte alignment

gprs_ns.c:937:16: runtime error: load of misaligned address
0x61d00002a97f for type 'uint16_t', which requires 2 byte alignment
2016-04-24 11:12:41 +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 aead05da32 Improve code reuse
Use generic functions covered by testsuit for SQN calculations.
2016-04-22 15:09:49 +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
Neels Hofmeyr da1b20cd4f logging.c: assert category_token allocation (CID #57871) 2016-04-16 13:31:15 +02:00
Holger Hans Peter Freyther 700297528c jenkins: Enable tracing and error handling in bash
Like jenkins we want to see what is actually being executed
and fail if a subcommand has failed.
2016-04-13 18:50:41 -04:00
Holger Hans Peter Freyther d16321801d jenkins: Add build script used by jenkins on our public CI
The actual script (removed unused and commented out handling) as
invoked by jenkins. This can be used to locally try to reproduce
the build.
2016-04-13 18:47:15 -04: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
Max 93bc64f99d gb: Add bssgp_pdu_str to libosmogb namespace
[hfreyther: To be used by osmo-pcu]
2016-04-12 10:08:20 -04:00
Max b9bb0b02ac Add missing docs for bssgp bvc reset vty command
Fixes the build failure with extended tests enabled.
2016-04-07 12:38:12 +02:00
Max ea50732df2 Add vty command to explicitly reset given BVCI
It's useful for debugging and is similar to existing reset command for
nsvc.
2016-04-05 22:33:14 +02: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