aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/include
AgeCommit message (Collapse)AuthorFilesLines
2016-11-09om2000: Add support for querying RBS capabilitiesroot1-0/+1
Change-Id: Id1fbaf41286f3651ce8f210eb8da05fb51179c96
2016-11-08WIP: OM2000: Full state machine implementation using osmo_fsmHarald Welte2-7/+43
Our existing OM2000 code for initializing all Managed Objects of a BTS at startup was never complete. Rather than trying to fix the old-style code, introudce a hierarchy of osmo_fsm's reflecting the full protocol hand-shake and sequence of bringing up the individual MO's. If this works out well, it mihgt make sense to convert the TS 12.21 OML code for other BTS models, too. Change-Id: I3e11b28ba22b8c227e0401e6207fdda5381dda8c
2016-11-01OML: Improve OML attribute handlingPhilipp2-0/+33
the OML attribute tables are hardcoded. To set variable parameters, the hardcoded data structure (tlv) is patched on byte level during runtime. This patch replaces this mechanism. - Replace hardcoded OML attribute tables with dynamically generated TLV structures. - Add unit tests to check if the OML attribute tables are generated correctly - Put OML attribute table generator code in a separate file: bts_ipaccess_nanobts_omlattr.c Change-Id: Ibeb34a84912d6cf695f553a34c69320fca7d08fa
2016-10-28DTX DL: Add FACCH cacheMax1-0/+3
When DL DTX is active and silent period is in progress dtx.cache is populated by SID UPDATE message which about to be scheduled next. If at that moment FACCH message arrives (which have higher priority) we have to send ONSET message to L1 but we can't invalidate cache with SID UPDATE as it will be used for SID FIRST message to resume silent period after FACCH transmission is over (provided there were no incoming voice in between). Hence the necessity for separate buffer to store content of FACCH message while we're sending ONSET to L1 while keeping SID UPDATE cached. Change-Id: I316e81af893b24766bf259baaed7a0be75a11694 Related: OS#1801
2016-10-27bsc: count the usage of codec by setting the lchan activeAlexander Couzens1-0/+10
We count the codec when the channel was successful setted up Using sign_link->trx->bts instead of msg->trx to get the bts. Add OSMO_ASSERT for bts within count_codecs() Change-Id: Ib49c7c337980a7d6f189d7a0551ca2e4c3822f45
2016-10-18Replace magic number with defineMax1-0/+4
Value 4 used as magic number by both OpenBSC and OsmoBTS so it make sense to add it to shared header. See ebb483b69a5319e522ba5f713e9cb6f68a814a6a in osmo-bts for details. Change-Id: I9c6ad68f4c6aa72d39ec7e5a6968b36ec20e79f4
2016-10-12DTX DL: use FSM for AMRMax1-12/+9
- consolidate all DTX-specific things in a separate struct - rename struct fields to better reflect meaning - add pointer to DL FSM for AMR - remove unused flag - expand buffer to hold cached payload alongside with CMR/CMI Change-Id: Idac8609faf9b5ced818fde899ccfc6ed0c42e8fd
2016-10-10Revert "bsc: count the usage of codec by setting the lchan active"Neels Hofmeyr1-10/+0
This reverts commit 38e9ea3f7f385c6660c5958970af5c71adc1682b. Introduced a reproducable segfault, because msg->trx is not actually set/used in the openbsc code paths. Program received signal SIGSEGV, Segmentation fault. count_codecs (lchan=0x1, bts=<optimized out>) at ../../../src/libbsc/abis_rsl.c:104 104 rate_ctr_inc(&bts->network->bsc_ctrs->ctr[BSC_CTR_CODEC_V1_FR]); (gdb) bt #0 count_codecs (lchan=0x1, bts=<optimized out>) at ../../../src/libbsc/abis_rsl.c:104 #1 0x0000000000425661 in abis_rsl_rx_dchan (msg=<optimized out>) at ../../../src/libbsc/abis_rsl.c:1516 #2 abis_rsl_rcvmsg (msg=0x8143f0) at ../../../src/libbsc/abis_rsl.c:2611 #3 0x00007ffff71420d0 in handle_ts1_read (bfd=<optimized out>) at ../../src/input/ipaccess.c:271 #4 ipaccess_fd_cb (bfd=0x815af8, what=1) at ../../src/input/ipaccess.c:386 #5 0x00007ffff7779b62 in osmo_fd_disp_fds (_eset=0x7fffffffe590, _wset=0x7fffffffe510, _rset=0x7fffffffe490) at ../../src/select.c:149 #6 osmo_select_main (polling=polling@entry=0) at ../../src/select.c:189 #7 0x0000000000406fac in main (argc=<optimized out>, argv=0x7fffffffe738) at ../../../src/osmo-nitb/bsc_hack.c:385
2016-10-05DTX: add flag for AMR HR P*Max1-0/+5
Add flag to explicitly track the state of DTX DL for AMR HR whe SID_FIRST_P1 has been sent to L1 already but no next frame available yet: this can be followed by SID_FIRST_P2 or SID_FIRST_INH depending on arrival of voice frame within next 60 ms. Change-Id: Id28b07b8e83cfe5e84de48a2f124084036580cd4
2016-10-05DTX: extend SID cacheMax1-1/+1
In addition to RTP payload SID cache got to store CMR/CMI prefix. Extend the buffer so it can fit in. Change-Id: Ibd4a63604a82cad3ce65f0752bffefa4b083e1b3 Fixes: Coverity CID#149508
2016-10-04msc: add counters to track call attempts/active/success/failedAlexander Couzens1-1/+7
active_calls describe all calls in active state. call.complete Call got terminated by disconnect requested either by MS or MSC. call.incomplete Call got terminated by any other reason. call.active Calls reached active state. Change-Id: I49b93af2e6a0ba16c2fb00b7b83974e8a6a16df3
2016-10-04bsc: count the usage of codec by setting the lchan activeAlexander Couzens1-0/+10
we count the codec when the channel was successful setted up Change-Id: Ifc8a406a11dce16b9e7f3310841e470545550a2c
2016-09-28dyn TS: fix: e1_config.c: switch(pchan) for dyn TSNeels Hofmeyr1-0/+1
Add ts_is_tch() in gsm_data_shared.h/.c and use it to replace a switch on the pchan in e1_config.c. This patch is not due to an actual observed failure. A general grep for switch on pchan turned up this instance that doesn't handle dyn TS properly. Hence this patch is not actually tested with real equipment. Change-Id: Ide4f156034bab77140d2d9a8c462d68ae6f0d6a6
2016-09-28Revert "bts: extend bts_chan_load to allow counting tch only"Neels Hofmeyr1-1/+1
This reverts commit 308cb0719dca3ba8eed1eff2a2124d44f34d9a28. Problems in this commit: openbsc/src/libbsc/chan_alloc.c:523: case GSM_PCHAN_TCH_F_PDCH: This is actually wrong, GSM_PCHAN_TCH_F_PDCH use ts->flags, not ts->dyn below (due to historical reasons and could be unified). 560: if (only_count_tch && !chan_is_tch(ts)) This has exactly one effect: it excludes GSM_PCHAN_TCH_F_PDCH when in PDCH mode, because for all other PDCH (plain PDCH and TCH/F_TCH/H_PDCH in PDCH mode) below ts_subslots() returns 0 and skips the for() loop. I consider this a bug in TCH/F_PDCH, to be fixed in an upcoming commit. I don't see why we need the only_count_tch argument, because this should normally only count TCH, weren't it for the TCH/F_PDCH bug. If dyn TS should be counted differently, we should do this in a different way. Change-Id: I34dbbaf53a800115e3d03bd44028cad675f3b525
2016-09-26mscsplit: add gsm_network backpointer to gsm_subscriber_connectionNeels Hofmeyr1-0/+2
We want to be able to use a network backpointer without having to go through a gsm_bts struct. This commit adds the network pointer, the subsequent commit applies direct access to the network structure from gsm_subscriber_connection. Change-Id: If8870972f1b3e333c2a4cce97cdc95bdee0382a1
2016-09-26mscsplit: abis vty: decouple from global bsc_gsmnet variableNeels Hofmeyr1-0/+2
Publish gsmnet_from_vty() in openbsc/vty.h and use in the abis VTY functions. Change-Id: Ib65a18db06b8bc4fc7d56bf56dd64a52cc1cd253
2016-09-26mscsplit: bsc_vty_init(): decouple from global bsc_gsmnetNeels Hofmeyr1-1/+1
Add an explicit gsm_network pointer instead of using the bsc_gsmnet global. This allows passing a gsm_network struct from the main() scope, which helps to decouple libmsc from libbsc. Change-Id: I9e2c0d9c18d4cebb5efb71565ad84df2bc2e0251
2016-09-26mscsplit: talloc_ctx_init(): decouple from global tall_bsc_ctxNeels Hofmeyr1-0/+2
Decouple the talloc context allocations from global tall_bsc_ctx pointer. It appears that talloc_ctx_init() was intended for general use, since it is located in libcommon. It is currently used only by osmo-nitb; but the upcoming osmo-cscn will use it as well. Instead of defining in osmo-nitb main file, add definition in gsm_data.h. Change-Id: I168106599b788f586be0ff0af4699b9746c1b103
2016-09-26mscsplit: gsm_network_init(): add explicit root talloc ctxNeels Hofmeyr1-1/+4
Decouple the root talloc context from libbsc's global talloc_bsc_ctx. This allows to define the root talloc ctx from a main() scope, which in turn helps decouple libmsc from libbsc. Change-Id: I92f6b47b1eeea2e8f3fba66f25d7e708e5659f8a
2016-09-26mscsplit: move subscriber conns list into struct gsm_networkNeels Hofmeyr2-2/+3
Replace the global sub_connections llist with gsm_network.subscr_conns. Initialize and apply where applicable. Remove bsc_api_sub_connections(), callers now access gsm_network->subscr_conns directly. This allows using the subscr_conns from libmsc without having to link libbsc. Change-Id: Ice2a7ca04910bcfaaff22539abe68a6349e8631c
2016-09-24SNDCP: add V.42bis data compression functionalityPhilipp3-0/+63
- Add compression control for V.42bis Add code to handle compression (gprs_sndcp_dcomp.c/h) - Add Adjustments in SNDCP - Add VTY commands Change-Id: I6d36cbdf2f5c5f83ca9ba57c70452f02b8582e7e
2016-09-24V.42bis: integration and unit testPhilipp4-2/+11
- Edit previously committed V.42bis implementation to function outside IAXmodem. - Add unit test to verify the correct function of V.42bis Change-Id: I689413f2541b6def0625ce6bd96f1f488f05f99d
2016-09-24V.42bis: add sourcecode from IAXmodem (SPANDSP)Philipp2-0/+267
V.42bis is a data compression method found in modems. It has also been specified for GPRS as data compression algorithm. The implementation has been taken from IAXmodem: https://sourceforge.net/p/iaxmodem/code/HEAD/tree/ svn checkout svn://svn.code.sf.net/p/iaxmodem/code/ iaxmodem-code Revision: r36 Change-Id: Iabedece9f97ca944a1e3f747bb073e532c4e9dca
2016-09-24SNDCP: add RFC1144 header compression functionalityPhilipp6-0/+172
- Add module to handle compression entities - Add module to control header compression - Introduce VTY commands for heade compression configuration - Add changes in sndcp and llc to integrate header compression Change-Id: Ia00260dc09978844c2865957b4d43000b78b5e43
2016-09-24RFC1144: integration and unit-testPhilipp3-1/+7
The previously pushed slhc implementation has been modified to compile and function outside of the kernel. Also debug log messages were added and datatypes ware matched. The implementation is now ready to be used Change-Id: I7a638e88a43b3eb9d006751a03ef2570e36613f0
2016-09-24RFC1144: add slhc code from linux kernelPhilipp1-0/+183
SLHC is an Implementation of RFC1144 TCP/IP header compression. We will need RFC1144 compression to compress GPRS TCP/IP traffic. The implementation pushed with this commit was taken from: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git commit 29b4817d4018df78086157ea3a55c1d9424a7cfc Change-Id: Ied69c143678dc4a64cecc671f5c4dfebe19d8519
2016-09-24SNDCP: add SNDCP-XID encoder/decoder and unit testPhilipp2-0/+217
The SNDCP-XID (or layer-3 xid) is used to exchange layer-3 parameters such as compression. The encoder encodes a bytestream that is then sent as regular XID field from LLC. We will need the SNDCP-XID to negotiate the parameters for our upcomming GPRS data and header compression features Change-Id: If2d63fe2550864cafef3156b1dc0629037c49c1e
2016-09-23bts: extend bts_chan_load to allow counting tch onlyAlexander Couzens1-1/+1
Change-Id: I86f1d502649747b6b9aefcb39081b14110e8f494
2016-09-19cosmetic: transaction.h: 1 comment typo, 1 whitespaceNeels Hofmeyr1-2/+2
Change-Id: Ia2629f9d9887b50b25c6996531b7ef518fb33335
2016-09-18cosmetic: various comment, whitespace tweaksNeels Hofmeyr1-1/+1
Change-Id: I131939cfba4d67d7e2c935341deeb14d09523fee
2016-09-18properly #include <openbsc/gsm_data.h> from gsm_subscriber.hNeels Hofmeyr1-2/+3
Don't use quoted, local include, use <> style include. Cosmetic: also move stdbool.h include to the top to keep osmocom and openbsc includes grouped. Change-Id: Iaa3dc36768f96f6b8c91010a2ba389fdc37f1503
2016-09-17Modify SI 13 field for control_ack_typeMax2-0/+2
Add vty function to explicitly set use of 4xRACH type of ack message for PACKET CONTROL ACKNOWLEDGMENT. Previous hardcoded value (use RLC/MAC control block) is used as a default. This is handy for debugging issues related to Timing Advance in context of GPRS. Change-Id: Ie869ac0a82055110f1e3b875e246750c4e113336 Related: OS#1526
2016-09-17sms: change rp err cause of smpp_try_deliver errorsAlexander Couzens1-0/+2
smpp_try_deliver could fail with rc < 0. In such cases don't send the MS the rp error sms rejected (cause 21). A rejected message should not be sent again. The spec 04 11 recommends sending cause 41 Temporary failure in unknown cases. Add also a log message and rate counter for such cases. Tweaked-By: Neels Hofmeyr <nhofmeyr@sysmocom.de> Change-Id: Ia03e50ce2bd9a7d1054cc5a6000fd73bd3497c03
2016-09-15Consistenly format variables in */Makefile.am filesAlexander Huemer2-26/+93
Change-Id: Ifa21513c007072314097b7bec188579972dc1694
2016-09-02IuPS: Change GTP-U endpoint to SGSN in PMM_IDLE and page UE when data arrivesDaniel Willmann1-0/+1
Change-Id: I47b73a40cbdda6b7c31fb2767f74f9f93d84056b
2016-09-02IuPS: sgsn_mm_ctx: add enum gprs_pmm_state field, track PMM stateDaniel Willmann1-0/+11
Iu needs to page to transfer data in PMM-IDLE state. Change-Id: Id37778cb9a0328a21c8e8246998ecdb43dd687d8
2016-09-01IuPS: add Iu response to create_pdp_conf()Daniel Willmann1-0/+2
Change-Id: Iad65ca9b77c3166d4df9a58af527e6aef7e589ee
2016-09-01IuPS: osmo-sgsn: add core IuPS impl, call iu_init()Daniel Willmann2-0/+5
Add main Iu entry points for IuPS: * gsm0408_gprs_rcvmsg_iu() * sgsn_ranap_iu_event() * sgsn_ranap_rab_ass_resp() Add main MM context management for IuPS: * sgsn_mm_ctx_by_ue_ctx() * sgsn_mm_ctx_alloc_iu() Call iu_init() from sgsn_main.c. Add asn_debug impl ("extern" from libasn1c). Initialize asn_debug VTY command (iu_vty_init()). osmo-sgsn build: add libiu and libasn1c, libosmo-sigtran, libosmo-ranap Change-Id: I469ae6ca9ef254d04ee0d2d79bdd65aebcd027b5
2016-08-31IuPS: add VTY config for asn_debugNeels Hofmeyr1-0/+2
Add file iu_vty.c in libiu, and iu_vty_init() to initialize the new VTY command: log logging asn1-debug (1|0) Change-Id: If4e7d0ab3fc2ed0cdf4fb0a3fa077a9e34890918
2016-08-29libmsc/bsc: split rate counters into bsc and msc groupAlexander Couzens1-32/+47
Tweaked-By: Neels Hofmeyr <nhofmeyr@sysmocom.de> Change-Id: I7361033cd1eb919ec3c2ea2652f40ab8c75b2f99
2016-08-27add libiuNeels Hofmeyr2-1/+62
Co-Authored by dwillmann, laforge, nhofmeyr Change-Id: Iffc26f9c73cb15463948f7435b72ac1747aabdb3
2016-08-27Adding LLC-XID related modifications in LLCPhilipp1-0/+12
With this commit the already existing XID mechanism has been modified to suit the needs for the upcomming SNDCP-XID patches. This commit should not break anything since it does not alter the current behaviour (incoming XID is still just echoed, on GMM-Reset a basic XID message is still echoed) Change-Id: I65b9d625e72d3d61c99abdc7041773701d694d52
2016-08-27Moving grs_sndcp.h header file to includePhilipp2-1/+54
For some reason gprs_sndcp.h is located in src/gprs. This commit moves gprs_sndcp.h to include/openbsc and fixes the include path in gprs_sndcp.c and gprs_sndcp_vty.c Change-Id: If4e4f1252c81d7907c1b4d738c982bb172b128c9
2016-08-27Adding LLC-XID encoder / decoder and unit testPhilipp2-1/+58
The lle-xid encoder/decoder is needed to encode and decode llc xid parameter messages. We need this to exchange sndcp-parameters (SNDCP-XID) and also simple parameters such as encryption IOVs Change-Id: Ia06e4cb08bf9b48c2a4682606d1b1a91d19a9d37
2016-08-27dyn TS: clearly use lchan[0], fixing minor confusionNeels Hofmeyr1-1/+1
The dyn_ts_switchover_*() functions made the impression that they act on a specific lchan of a timeslot. The assumption that we would remember to use e.g. lchan[1] across a PDCH deactivation is brain damaged to begin with; and factually we always use lchan[0] anyway (the only case for using lchan[1] would be when switching to TCH/H, but the channel allocator will always return lchan[0] for that). Instead of the brain damaged lchan args, use a ts arg across all dyn_ts_switchover_*() functions, with one exception: The dyn_ts_switchover_complete() actually receives an RSL activation ack message on a specific lchan and needs to evaluate its lchan type. This will always be lchan[0] as it is now, but we should stick with the lchan the message was sent for. For PDCH, a check to use lchan[0] already existed, when composing the ACT message in rsl_chan_activate_lchan_as_pdch(). Replace with an assertion. Adjust all callers to pass ts instead of lchan. In dyn_ts_switchover_start(), there was a dead code check that jumps to switchover_complete() in case the pchan already matches. This never hits, because we only call dyn_ts_switchover_start() when pchans mismatch. So avoid guessing at passing lchan[0] to dyn_ts_switchover_complete() by not calling it at all but logging an error instead. In rsl_chan_activate_lchan(), we remember some values before going into switchover from PDCH. Explicitly store them in lchan[0], because after a PDCH release we have always and will activate no other than lchan[0]. In dyn_ts_switchover_continue(), move the check for any existing lchan->rqd_ref further above, and more correctly check all lchans that were so far valid on the TS, instead of just one. This partly prepares for a subsequent commit to fix the act_timer use for dyn TS: with the old lchan arg, we might schedule an activation timer on lchan[1] but receive an ack on lchan[0] (for PDCH), leading to an act_timer expiry. Change-Id: I3f5d48a9bdaa49a42a1908d4a03744638c59796a
2016-08-27libbsc/libmsc: convert old osmo counter into rate_ctrgsAlexander Couzens1-50/+78
rate counters support the export to statsd and can have a delta value. Change-Id: Ie749cebd53a0bb618d0e23d375885712078bf8dd
2016-08-27sgsn: add statistics counter for LLC packetsAlexander Couzens1-0/+4
new counters are: llc.dl_bytes llc.ul_bytes llc.dl_packets llc.ul_packets The ip payload bytes are waiting for payload compression because those data are known then. Change-Id: I068376d35e84283cb98523cd3097a12c55cdb709
2016-08-27move ts_sublots() to gsm_data_shared.c, it will be used by osmo-btsNeels Hofmeyr2-2/+2
Change-Id: I8ba06d7dd6e0ceab3d8d18bb565354d6ed461f7e
2016-07-28dyn TS: OS#1778 workaround: disable TCH/F on dyn TS for nitbNeels Hofmeyr1-0/+4
To avoid two phones picking mismatching TCH pchans, never pick TCH/F on dynamic TS in osmo-nitb. Add gsm_network flag dyn_ts_allow_tch_f, set to true by default in gsm_network_init(). Set this flag to false in osmo-nitb's main(). See http://osmocom.org/issues/1778 Reasoning about ways to solve this: * a compile time switch doesn't work because libbsc is first compiled and then linked to both osmo-nitb and osmo-bsc. * we could test net->bsc_api == msc_bsc_api(), but I have the so-called MSC split waiting on branch sysmocom/cscn, which will result in msc_bsc_api() not being linked in the osmo-bsc binary. * have a function am_i_nitb() with different implementations in osmo-nitb and osmo-bsc, but then we'd need to add implementations to all tests and other binaries linking lchan_alloc(). * have a flag in struct bsc_api, but so far there are only function pointers there. Having a "global" flag in gsm_network allows to add a VTY command in case we decide to keep this feature (#1781), has no linking implications and is nicely explicit. Tested that osmo-bsc still picks TCH/F on dyn TS indirectly, since I have no standalone MSC available: when compiling osmo-nitb with the line that sets dyn_ts_allow_tch_f = false commented out, TCH/F is picked as described in OS#1778; and by printf-verifying that dyn_ts_allow_tch_f == true in osmo-bsc main(), only osmo-nitb should have TCH/F disabled. Related: OS#1778, OS#1781 Change-Id: If7e4797a72815fc6e2bbef27756ea5df69f4bde7
2016-07-28dyn TS: split dyn_pdch_init() for new dyn type and renameNeels Hofmeyr1-1/+4
Init both TCH/F_PDCH and TCH/F_TCH/H_PDCH via dyn_ts_init(), which refactors dyn_pdch_init(). Make dyn_ts_switchover_start from abis_rsl.c public in abis_rsl.h, so we can start the initial switchover to PDCH from dyn_ts_init(); in abis_rsl.h include gsm_utils.h for enum gsm_phys_chan_config. Change-Id: I5c0b257ba8ff0e9c9a2268681a84b0681a778368