aboutsummaryrefslogtreecommitdiffstats
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2016-09-19remove unused function get_rate_ctr_group()Neels Hofmeyr1-37/+0
Unused after 22886d9e320ecf734d2827d825a191b977f70d2c "Fix retrieving rate_ctr over control interface" Change-Id: I405367ef6ba5833957778a79dd398ce5ea29307e
2016-09-09libosmocodec link fix on MacOSXAnatoly Orlov1-0/+1
Fixes the following bug: CCLD libosmocodec.la Undefined symbols for architecture x86_64: "_bitvec_get_bit_pos", referenced from: _osmo_fr_check_sid in gsm610.o "_bitvec_get_uint", referenced from: _osmo_hr_check_sid in gsm620.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make[2]: *** [libosmocodec.la] Error 1 Change-Id: Id7358b94e274b529a8da38a0b2ef8c892b6dd7a5
2016-08-29IuPS: add GMM Service Request related constants and value_strNeels Hofmeyr2-0/+12
Change-Id: Ie023fc78099932f95cc8f1b3a04fe25dfd14bc35
2016-08-29fix printf format for commit 'osmo_sock_init(): include host and port in ↵Neels Hofmeyr1-1/+1
error messages' Related: CID#143566 Change-Id: I75c542089749a0875d3d1913151fe838d7722ff2
2016-08-27osmo_sock_init(): include host and port in error messagesNeels Hofmeyr1-5/+16
For programs like osmo-hnbgw with numerous sockets, the message that some unspecified connection was refused is not very helpful. Also output the host and port where an error occured. Instead of perror, use fprintf(stderr, ..., strerror()) to be able to include a format string and print host and port as passed to osmo_sock_init(). Change-Id: I8d0343f51310699b78fcb83fd76fd93764acf3dc
2016-08-20vty: use VTY_BIND_ADDR_DEFAULT instead of "127.0.0.1"Neels Hofmeyr1-1/+1
Change-Id: Ice0688ac9847524cb546f6d41547090b6a3cb3d8
2016-08-01fsm: Make sure we call 'onenter' of new state, not old stateHarald Welte1-0/+1
Change-Id: I1a0181c25d9debe935e86d97ddffc24675e56a5f
2016-08-01lapd_core: Fix crash in lapd_dl_flush_hist()Harald Welte1-1/+1
When lapd_dl_flush_hist() was called before we actually had started a transmit history from lapd_dl_init(), we woul segfault before this patch. Change-Id: Ifa677c9b335dd2884b4f3e44699d901957a0500b
2016-07-25egprs: Add CPS tables from TS 04.60Tom Tsou3-1/+109
Includes EGPRS coding and puncturing scheme (CPS) tables from 3GPP TS 04.60. Currently osmo-bts-trx is the only user of CPS table values, but this may change with gprsdecode and other utilities. Change-Id: I09fe6514a0e2e51bb3206f8387633f7e0255345f
2016-07-23rsl: add rsl_act_type_name()Neels Hofmeyr2-0/+14
Change-Id: Ie90c76d8aef42d5e2c9be94f4b206d4994e305f8
2016-07-23dyn TS: add definitions for dynamic TCH/F_TCH/H_PDCHNeels Hofmeyr1-0/+1
Add: * GSM_PCHAN_TCH_F_TCH_H_PDCH * NM_CHANC_OSMO_TCHFull_TCHHalf_PDCH * RSL_CHAN_OSMO_PDCH * RSL_ACT_OSMO_PDCH Related: OS#1776 Change-Id: Ib1a8b11f37af4686d00ac88beba38557aa29edc2
2016-07-17fix compiler warning: gsup.c: missing bracesNeels Hofmeyr1-1/+1
osmo_auth_vector's first member is an array, so for a zero initializer, we should add a second set of array braces. Change-Id: Iace448caca8152e46244f26c3af250f2035c99eb
2016-07-16bitvec: Force inlining of bitvec_set_bit_pos/bitvec_set_bitHolger Hans Peter Freyther1-2/+2
The PCU is using bitvec_write_field a lot but on the arm-poky-linux-gnueabi-gcc v4.8.1 the calls to set_bit and set_bit_pos are not inlined. The inlined variant has been a more quick for the PCU compressed bitmap decompression testcase. Used objdump -d to look at the bitvec_write_field before and after the change. The branch to bitvec_set_bit is gone and a inlined version has been used. Change-Id: I0b6b90610f4c17f02e4efa064c3bf1ac2dccb22a
2016-07-11Add GEA3 & GEA4 ciphersMax3-2/+110
Corresponding test code include both official test vectors from the specs and data from over-the-air tests. This obsoletes libosmo-crypt-a53 as it was last missing piece unimplemented in libosmogsm. Change-Id: I939e4f6b91b4a7c591ef3761fe2d46ed1c2fb2d3 Related: OS#1582
2016-07-10fsm: delete the timer when changing stateHarald Welte1-0/+3
In osmo_fsm_inst_state_chg(), we need to stop any not-yet-expired timer of the old state before transitioning into the new state. Change-Id: I2558f9a7027a877ea8263785ed3c8d70d2513996
2016-07-10fsm: talloc + copy the 'id' passed into a FSMHarald Welte1-1/+2
The 'id' is used to generate the human-readable name of the FSM. However, when the FSM creates slave FSMs later, the caller-passed "ID" mgiht long be gone again (e.g. it was on stack memory). So let's copy the 'id' string to a chunk of dynamically-allocated memory at time of FSM start to ensure we have it later when creating child FSMs. Change-Id: Ib88a2c02c5c91f17b4ec1e9db57a06d6d66465fb
2016-07-10fsm: call 'onenter' as last step of a state changeHarald Welte1-3/+4
This is useful to allow the user to terinate the fsm from the onenter() callback. Change-Id: Ia45a1f3279e702028250e10dc54b2d46a4039905
2016-07-08Add strings with GPRS GMM messagesMax2-0/+25
Change-Id: I48477b733e2da72f59349c00554dd3e080c9f445 Related: OS#1582
2016-07-07Add function to check GMM encryptabilityMax2-0/+26
Check if particular GMM message can be encrypted according to 3GPP TS 24.008 § 4.7.1.2 Related: OS#1582 Change-Id: I7ad0e03c2c738d174dd6bc3453f332eeb8da1e7d
2016-07-07Add missing osmo_c4 exportMax1-0/+1
Change-Id: Iaf53b31b4fa3860301054e970907ada061360b28 Related: OS#1741
2016-07-03lapd_dl_flush_hist(): Don't flush a non-existant historyHarald Welte1-0/+3
If lapd_dl_flush_hist() is called after lapd_dl_exit(), dl->tx_hist has already been free'd and set to NULL. Check for this before attempting to de-reference a NULL pointer. This bug breaks OpenBSC with any E1 based BTSs using DAHDI. Change-Id: I117ba3445fa5e8097e21c11c5a6337de6ba46c7d Related: OS#1760
2016-06-29Add function to check MS GEA capabilitiesMax2-1/+31
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-29Make C4 function globally availableMax2-4/+4
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-29Add strings for GPRS ciphersMax2-0/+10
Change-Id: I050bda5fb50aad42fe2d72de39f8256b4fb12fb2 Related: OS#1582
2016-06-27Mark input parameter to bitvec_set_bits() as 'const'Harald Welte1-1/+1
The input data is accessed in a read-only manner, so it should be marked with the const qualifier. Change-Id: I0d6b86289fa647594f3da1f1c0e0168685307a37
2016-06-27fsm: Introduce default time-out handlingHarald Welte1-8/+13
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-23Fix potential segfault in msg_dequeueMax1-3/+6
Change-Id: I06e9c5ba3e00c73a4e52d2583ce3492f236275ce
2016-06-20Add octet-aligned/unaligned shift functionsMax1-0/+48
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-16Add Finite State Machine abstraction codeHarald Welte2-1/+423
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-16Add UMTS AKA related MM/GMM message type and IE definitionsHarald Welte1-1/+9
Change-Id: Id45ea2c631ee589a4df1f8213da6f7e7d1bf6616 Reviewed-on: https://gerrit.osmocom.org/305 Reviewed-by: Harald Welte <laforge@gnumonks.org> Tested-by: Jenkins Builder
2016-06-16gsup.c: Fix encoding of UMTS auth vectorsHarald Welte1-6/+22
Encoding auth vectors worked fine for GSM authentication, but didn't yet include the new IEs for UMTS authentication yet. Change-Id: I7fa5ba1c950292bd0a9874b3102a27f221ce390d Reviewed-on: https://gerrit.osmocom.org/302 Reviewed-by: Harald Welte <laforge@gnumonks.org> Tested-by: Jenkins Builder
2016-06-15vty: Fix documentation of 'show asciidoc counters' VTY commandHarald Welte1-1/+1
VTY documentations strings follow a certain structure, and we need to follow that to make the interactive help work. Change-Id: I0bb0bda68dbbf9995338ec555ff99d73a223162c Reviewed-on: https://gerrit.osmocom.org/276 Reviewed-by: Harald Welte <laforge@gnumonks.org> Tested-by: Harald Welte <laforge@gnumonks.org>
2016-06-14Fix retrieving rate_ctr over control interfaceMax1-13/+7
Allow getting either particular counter (e. g. rate_ctr.per_hour.e1inp.0.hdlc.abort) or entire rate counter group for a given index (e. g. rate_ctr.per_hour.e1inp.0). Change-Id: I2b0109536170f7b5388d3236df30b98f457aa98d Fixes: OS#1730 Reviewed-on: https://gerrit.osmocom.org/274 Tested-by: Jenkins Builder Reviewed-by: Harald Welte <laforge@gnumonks.org>
2016-06-14add vty call show asciidoc: generate a documentation for countersAlexander Couzens2-0/+195
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-13add rsl_or_ipac_msg_name() for both standard and ip.access msg typesNeels Hofmeyr2-0/+12
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-13add get_value_string_or_null() to handle unknown itemsNeels Hofmeyr1-3/+18
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-13api doc: get_value_string(): mention composition in static bufferNeels Hofmeyr1-0/+4
Change-Id: I93dad98711ef69f8a1e196efa029a842a1ff5bd6 Reviewed-on: https://gerrit.osmocom.org/229 Reviewed-by: Harald Welte <laforge@gnumonks.org> Tested-by: Jenkins Builder
2016-06-01Add functions to detect HR/FR SID framesMax2-0/+71
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-05-31Add helper functions for AMR codecMax2-1/+107
* 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-30Add strings with PH primitive namesMax2-0/+14
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-25misc: Some spelling errors correctedRuben Undheim2-2/+2
Change-Id: Ibfc239b84879556624ca6020ae6a63d102640c94 Reviewed-on: https://gerrit.osmocom.org/114 Tested-by: Jenkins Builder Reviewed-by: Neels Hofmeyr <nhofmeyr@sysmocom.de>
2016-05-20Revert "gsm48: move to hex TMSI representation"Holger Freyther1-1/+2
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 78ad042f94afd5bf7de477ae634e9d2fdd9c9dc4. Change-Id: I2f61e626f2f9088b492e1b643c3dcc9bce77d52b Reviewed-on: https://gerrit.osmocom.org/86 Tested-by: Jenkins Builder Reviewed-by: Holger Freyther <holger@freyther.de>
2016-05-20Fix build for OSXArran Cudbard-Bell1-1/+13
Change-Id: I580a500edcf4812e570be586890abef746083a8c Reviewed-on: https://gerrit.osmocom.org/74 Tested-by: Jenkins Builder Reviewed-by: Holger Freyther <holger@freyther.de>
2016-05-20gsm48: move to hex TMSI representationVadim Yanitskiy1-2/+1
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-17Add function to make Uplink MeasurementMax2-0/+22
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-12Set DTX in Cell OptionsMax2-1/+47
* 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-10api doc: auth_core.c: add \returns, cosmeticNeels Hofmeyr1-2/+9
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-06GSUP: Add support for RAND in SendAuthInfo.reqHarald Welte1-1/+12
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-06GSUP: Add OSMO_GSUP_CN_DOMAIN_IE to differentiate CS and PS planeHarald Welte1-0/+9
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-06import gprs_gsup_message.[ch] from openbsc as gsup.[ch]0.9.4Harald Welte3-1/+477
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.