summaryrefslogtreecommitdiffstats
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
* logging: Extend log_target with call-back for un-formatted log lineHarald Welte2016-12-021-1/+17
| | | | | | | | | | | Some targets might not want to receive only an opaque, pre-formatted string, but rather the unformatted arguments with metadata like sub-system/level/file/line. We solve this by introducing a log_target->output_raw() function pointer. If a target specifies this function, it takes precedence over the regular log_target->output() function. Change-Id: I9dc9205d70dce9581458e7e9dc2d8a92991897bd
* Revert "gsm0408: add chreq_type for CHREQ_T_PDCH_ONE_PHASE and ↵Neels Hofmeyr2016-12-021-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | CHREQ_T_PDCH_TWO_PHASE" This reverts commit c3c28528de78fd5d50c3a141c2176c0da5dd7075. The reason is that this breaks a static assert in openbsc. See https://lists.osmocom.org/pipermail/openbsc/2016-December/009906.html Enlarging the ctype_by_chreq struct and breaks the static assert for gsm_network->ctype_by_chreq's size: ../../../src/libbsc/gsm_04_08_utils.c:138:1: error: size of array ‘dummyassert_size’ is negative osmo_static_assert(sizeof(ctype_by_chreq) == ^ What this patch lacks is, in openbsc.git: * adjustment of ctype_by_chreq[] according to the new additions in libbsc/gsm_04_08_utils.c * same for reason_by_chreq[], also in libbsc/gsm_04_08_utils.c * enlarge ctype_by_chreq[] in gsm_network to 18, in openbsc/gsm_data.h. Leaving it up to the original authors to follow up and commit a complete patch series in one go.
* gsm0480: add gsm0480_create_ussd_notify() and *_release_complete()Neels Hofmeyr2016-12-011-0/+2
| | | | | | | | | | | Add two functions to create USSD messages. Moves and generalizes code from openbsc. Pending: use the new functions in openbsc. It looks like _release_complete() should also set trans_id and direction flag; but since this is moving code from openbsc that is apparently working, just place a fixme comment and don't change the functionality. Change-Id: Ia80e32c7105359915bfad3cc5621a1c09caf20f0
* gsm0480: code dup: introduce and use gsm0480_l3hdr_push()Neels Hofmeyr2016-12-011-0/+3
| | | | | | | | Add function gsm0480_l3hdr_push() to push a struct gsm48_hdr to the start of a msgb. Use in gsm0480.c and gsm0411_utils.c. Further callers of the new function will follow in openbsc as well as another libosmocore patch for ussd. Change-Id: I54fce6053ab8362015686fe22dbcd38bf1366700
* gsm0408: add chreq_type for CHREQ_T_PDCH_ONE_PHASE and CHREQ_T_PDCH_TWO_PHASEAlexander Couzens2016-12-011-0/+2
| | | | | | For BSC-located pcu the BSC must understand the PDCH chan request. Change-Id: Ice44dcaaf798f93af3652a96c567f8e16a6cf784
* Introduce osmo_strlcpy() function so we can stop using strncpy()Harald Welte2016-11-261-0/+2
| | | | | | | | | | | | | | | | I'm aware of the existing criticism on stlrcpy(), but I think it is still better than what we have now: stnrcpy(), sometimes with Coverity warnings and sometimes with a manual setting of the termination byte. The implementation follows the linux kernel strlcpy() which is claimed to be BSD compatible. We could of course link against libbsd on Linux instead, but I think it's reasonably small and simple to provide our own implementation. Future versions of libosmocore could use some autoconf magic and preprocessor macros to use the system-provided strlcpy() if it exists. Change-Id: Ifdc99b0e3b8631f1e771e58acaf9efb00a9cd493
* gsm_08_58.h: Add more Ericsson specific RSL IE IdentifiersHarald Welte2016-11-161-3/+22
| | | | Change-Id: Ib43948da956f23609b1b0995ecac0c796cc7c629
* RSL: Add defines for ericsson systinfo SI13Philipp2016-11-161-0/+4
| | | | | | | | | | | | | | Ericsson uses non standard information element tags when setting up the SI13 system information configuration. This applies to RSL_SYSTEM_INFO_13, which is normally 0x28, instead Ericsson uses RSL_ERIC_SYSTEM_INFO_13, which is set to 0x0C. Furthermore, Ericsson adds a propritary field called BCCH-Mapping, which is tagged as 0xf2 (RSL_IE_ERIC_BCCH_MAPPING) This patch addes these two information element tags in gsm_08_58.h Change-Id: Idc27352e286b9b8bbcbf0b31bdb676c3d13487a9
* msgb: add msgb_push_u{8,16,32}() functionsHarald Welte2016-11-111-0/+30
| | | | | | | Those work analoguous to msgb_put_*() but pre-pend the given value into the msg headroom, rather than appending it to the end. Change-Id: I7de63e9d04c2d2b678f1f20eef37f9be2c4f5ec2
* statsd: Fix compiler warning (int32_t vs. int64_t)Harald Welte2016-11-111-1/+1
| | | | | | | | | Fixes the following compiler warning: stats_statsd.c: In function ‘osmo_stats_reporter_create_statsd’: stats_statsd.c:54:18: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types] srep->send_item = osmo_stats_reporter_statsd_send_item; Change-Id: Id36914906e0982f6ac092a311210727de66b343a
* bitcomp: Remove the t4 decoding from libosmocoreHolger Hans Peter Freyther2016-11-101-1/+0
| | | | | | | | | | | | As outlined by mail on the 13th of July the tree based approach to decoding in the PCU is faster by order of magnitude. Instead of having a slow implementation in the library and a quick one in the PCU, let's only have a quick one in the PCU and at some point in the future move it to libosmocore. Execute the plan and remove t4_decode. Change-Id: I021424444625a097560d086c217c81eac4a5ee44
* Add osmo_fsm_unregister() to headerMax2016-11-021-1/+1
| | | | | | | Previously function was defined but not exposed so there were a way to register FSM but no way to unregister it. Change-Id: I2e749d896009784b77d6d5952fcc38e1c131db2b
* gsm0408: Completing GSM 04.08 RR message typesPhilipp2016-10-272-2/+14
| | | | | | | | | | | - Add missing message types to be up to date with the latest specification release (3GPP TS 04.18) - Add value strings to translate RR message type identifiers into human readable strings. (see gsm48_rr_msg_name() in gsm48.h Change-Id: I3ceb070bf4dc8f5a071a5d43c6aa2d4e84c2dec6
* utils/conv_gen.py: add EDGE MCS 1-9 definitionsVadim Yanitskiy2016-10-231-0/+60
| | | | Change-Id: Ie1452342f524a8b60f2babc07398a1d9c9e06aa3
* utils/conv_gen.py: add RACH, SCH and TCH/AHS definitionsVadim Yanitskiy2016-10-231-0/+40
| | | | Change-Id: I0ea7151f4e8119a8798a9e129b951559e56b0d93
* gsm/gsm0503.h: fix typoVadim Yanitskiy2016-10-231-1/+1
| | | | Change-Id: I263d61111544eeb7227e1e0e8f2d14479eae2079
* Revert "Constify ctrl_cmd struct fields where appropriate"Neels Hofmeyr2016-10-201-3/+3
| | | | | | | | | | | | | This reverts commit ed9d6da5df98538adc70aa03cb569eb9505d04b6. The commit is good as such, but it causes many compiler warnings in the OpenBSC build. We want this to be re-applied as soon as we have patches ready that fix the fallout in openbsc.git. See also https://lists.osmocom.org/pipermail/openbsc/2016-October/009802.html Related: OS#1829 Change-Id: I722ad60232a6ef5b4cb984b92c42851de26b3ccd
* Add function to send TRAP over Control InterfaceMax2016-10-121-0/+1
| | | | | Change-Id: Ic0b8d88c4f5c4d42c3f8fb754f8eabf049c9e388 Related: OS#1646
* gsm0408: Adding 3g spcific RR message typesPhilipp2016-10-121-0/+5
| | | | | | | | | | GSM 04.18, which is the successor of GSM 04.08, describes additional RR 3g specific message types. This commit adds four new message types related to paging and notifiction See also 3GPP TS 04.18, section 10.4, table 10.4.1 Change-Id: I071cc9ecac342b5221fa0ec0b782b04b51b40e93
* Constify ctrl_cmd struct fields where appropriateMax2016-10-111-3/+3
| | | | Change-Id: I3f55c1d4b965d215dc9b16f4b284b7fea4bde9e9
* Mark inline header function as staticMax2016-09-301-1/+1
| | | | Change-Id: Ib751f7467d54cbcae76f72448a38e30f2ecc63d4
* AMR: add function to check speech framesMax2016-09-281-0/+21
| | | | | | | | Add convenience function osmo_amr_is_speech() to check if given AMR frame is speech frame: non-speech frames often require special processing. Change-Id: Ifaab02a2f581acc302b367d34fd2fc28a4d1e2e3
* msgb: add msgb_talloc_ctx_init(), deprecate msgb_set_talloc_ctx()Neels Hofmeyr2016-09-271-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | So far each and every main() scope creates a msgb talloc context and either passes it to msgb_set_talloc_ctx() or sets tall_msgb_ctx directly (by defining it extern first). Remove some code duplication: add one central function that creates the "msgb" talloc context for all. Most users of msgb employ a talloc_named_const(), but osmo-bts uses a talloc_pool() instead. Offer both ways by means of the pool_size argument, and for both ways make sure the context is called "msgb". Suggest that msgb users should move to this new function: deprecate msgb_set_talloc_ctx(). To be able to do so, include core/defs.h in msgb.h. There's a tradeoff between hiding the msgb talloc context behind API that tries to guess all use cases versus avoiding code dup. This patch opts against code dup and boldly assumes that all future use is covered. Also, the new function suggests to not access tall_msgb_ctx directly, which can be considered a style improvement. It seems that not all main scopes that use msgb actually initialize the msgb ctx. As a fallback for these, explicitly initialize tall_msgb_ctx to NULL. Change-Id: I747fbbf977c4d2c868c8dead64cfc5fd86eb8d4c
* gprs: Increase NS_ALLOC_SIZE to 3kDaniel Willmann2016-09-231-1/+2
| | | | | | | | | 2k can be insufficient when responding with a STATUS message to a long LLC packet because the original message is included in the STATUS. Change-Id: I6f76751cfadf61e87ce4367a38907083e1c98562 Ticket: SYS#2967 Sponsored-by: On-Waves ehf
* add osmo_gettimeofday as a shim around gettimeofdayNeels Hofmeyr2016-09-221-0/+11
| | | | | | | This allows feeding a custom time for unit tests by overriding osmo_gettimeofday. Change-Id: Ic7a81a6eb51f27fe452962b91f2eae2070d87089
* fix GGSN Ctrl port to 4257Neels Hofmeyr2016-09-092-1/+2
| | | | | | | 4253 used to collide with the sysmobts-mgr VTY port. Note, openggsn does not actually have a Ctrl interface yet. Change-Id: If0fa0e606dabd5bc89907a56ef18cdbbbdedb4b7
* comment: */ports.h: link to wiki + manuals, indicate used portsNeels Hofmeyr2016-09-092-2/+16
| | | | Change-Id: I6a7bf04e589ccfaea98f20900a9bfe9dd4808dce
* Add Marker to ph_tch_paramMax2016-09-091-0/+1
| | | | | | | | Extend struct ph_tch_param with Marker bit from RTP header to indicate speech onset in case of DTX. Change-Id: Ic664902630b9d335ff9abc7a9ca7249eaf80e05f Related: OS#1750
* fix error msg: msgb_put(): say "msgb_put", not "msgb_push"Neels Hofmeyr2016-09-091-1/+1
| | | | Change-Id: I72f31ebad693f98eb088a99b83aeb10cf9acc29e
* core/counter: add osmo_counter_dec()Alexander Couzens2016-08-301-0/+6
| | | | Change-Id: I030140a45afa295c3ebc4d3ccaffd437b984f515
* IuPS: add GMM Service Request related constants and value_strNeels Hofmeyr2016-08-291-0/+16
| | | | Change-Id: Ie023fc78099932f95cc8f1b3a04fe25dfd14bc35
* Add control interface port for GGSNMax2016-08-081-0/+1
| | | | | Change-Id: Ie7232189fe3265a8631fd3652b2c8c152cdee918 Related: OS#1646
* Extend L1SAP with MeasurementsMax2016-08-041-0/+3
| | | | | | | | We already have RSSI parameter in PH-DATA. Add other measurement information (BER, BTO, Link Quality). Change-Id: I2b127eb1856c4cd1bc46490a89592a595f1ee86b Related: OS#1616
* Mark input string to osmo_talloc_replace_string() as constHarald Welte2016-07-281-1/+1
| | | | | | | This allows us to pass in strings that are 'const', which for the source of a copy should be the normal/regular case anyway. Change-Id: Icee6a5f88babd3a4e30bf0886f0f8d3b865d80ce
* egprs: Add CPS tables from TS 04.60Tom Tsou2016-07-252-0/+28
| | | | | | | | 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
* Update structure in libosmocore for 11 bit RACHbhargava2016-07-241-1/+11
| | | | | | | | Parameters are added to the structure ph_rach_ind_param to differentiate the type of RACH received from Layer 1. This is to further support the 11 bit RACH. Change-Id: Ic4f0f2424a3af7599d986044be25ea4fcc0ca477
* Add define for invalid TAMax2016-07-231-0/+2
| | | | | | | | Add GSM48_TA_INVALID which is invalid Timing Advance value according to 3GPP TS 44.018 § 10.5.2.40. Change-Id: I061760ccac656f39164562a7883f8ab522cd0911 Related: OS#1526
* rsl: add rsl_act_type_name()Neels Hofmeyr2016-07-231-0/+8
| | | | Change-Id: Ie90c76d8aef42d5e2c9be94f4b206d4994e305f8
* dyn TS: add definitions for dynamic TCH/F_TCH/H_PDCHNeels Hofmeyr2016-07-233-0/+5
| | | | | | | | | | | 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
* gsm_08_58.h: introduce RSL_CHAN_NR_1 constantNeels Hofmeyr2016-07-231-0/+1
| | | | | | | | | | | Using the RSL_CHAN_* constants, we sometimes need to add 1 to the chan bits to indicate e.g. the second TCH/H channel. RSL_CHAN_NR_1 marks this lowest channel bit that needs to be added. The name is analogous to RSL_CHAN_NR_MASK. Change-Id: Iea06432039d1cd23cc6b5acec308bb829b596d47
* Add function to check TA validityMax2016-07-161-0/+10
| | | | | | | | Check if given Timing Advance is valid according to 3GPP TS 44.018 § 10.5.2.40. Change-Id: I5cb6149d6e36fda8cb3f557e4d6d3a724da805a5 Related: OS#1545
* Add EGPRS RLC/MAC headers from 3GPP TS 04.60Tom Tsou2016-07-122-0/+209
| | | | | | For shared use by osmo-pcu and osmo-bts-trx. Change-Id: I500cdc87cd30faf36c8cd92d234642f809c8f2aa
* Add GEA3 & GEA4 ciphersMax2016-07-113-1/+20
| | | | | | | | | | | 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
* Add strings with GPRS GMM messagesMax2016-07-081-0/+1
| | | | | Change-Id: I48477b733e2da72f59349c00554dd3e080c9f445 Related: OS#1582
* Add function to check GMM encryptabilityMax2016-07-071-1/+2
| | | | | | | | Check if particular GMM message can be encrypted according to 3GPP TS 24.008 § 4.7.1.2 Related: OS#1582 Change-Id: I7ad0e03c2c738d174dd6bc3453f332eeb8da1e7d
* Clarify GPRS algorithmMax2016-06-291-5/+6
| | | | | | | | Add spec reference and set explicit values for enum representing ciphering algorithm for GPRS encryption. Change-Id: Ia9ee429b73a37d52599fce70778cfe87b767411c Related: OS#1582
* Clarify GPRS ciphering directionMax2016-06-291-2/+3
| | | | | | | | Add spec reference and set explicit values for enum representing direction parameter for GPRS encryption. Change-Id: Iaf1b13da2e889d55cc9dd7516710104dba48c992 Related: OS#1582
* Add function to check MS GEA capabilitiesMax2016-06-291-0/+5
| | | | | | | | Add function which parses MS network capability IE value for bits indicating support for particular version of GEA. Change-Id: I785cef37dd272a2fab9b172f6e1392f865174e9a Relates: OS#1582
* Make C4 function globally availableMax2016-06-291-1/+1
| | | | | | | | | 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
* Add strings for GPRS ciphersMax2016-06-291-0/+3
| | | | | Change-Id: I050bda5fb50aad42fe2d72de39f8256b4fb12fb2 Related: OS#1582