aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/include
AgeCommit message (Collapse)AuthorFilesLines
2016-12-13rename oap.h to oap_client.hNeels Hofmeyr4-3/+3
Related: OS#1592 Change-Id: I05bd65ff81b0f70f68217b2e0a9466e160bdbdec
2016-12-13oap: rename public API from oap_ to oap_client_Neels Hofmeyr3-17/+21
Mainly to differentiate the OAP messaging API (osmo_oap_ in libosmocore) from the OAP client. This is in preparation for moving the oap client to libcommon, which is in turn preparation for libvlr. Add the osmo_ prefix, as all public Osmocom API should have. We also have OAP messages code in libosmocore, so clarify by naming this osmo_oap_client, and by also renaming the oap_test to oap_client_test. This reshuffling will allow an easy move of OAP to libosmocore if we should want to do that. A number of patches will follow up on this. Related: OS#1592 Change-Id: Id447d2bebc026a375567654adafa5f82439ea7e1
2016-12-13move OAP messages implementations to libosmocoreHarald Welte2-71/+0
This corresponds to change-id If5099e60681a215e798b6675f21813f26769c253 in libosmocore, which is now required to build openbsc. Related: OS#1592 Change-Id: I2f06aaa6eb54eafa860cfed8e72e41d82ff1c4cf
2016-12-13rename gprs_gsup_client.h to gsup_client.hNeels Hofmeyr2-1/+1
This is in preparation for moving gsup to libcommon, which is in turn preparation for libvlr. Related: OS#1592 Change-Id: I9c95d00f1a9420887a44c938b1d0ee3e20586f4c
2016-12-13gprs_gsup_client*: remove the gprs_ prefixNeels Hofmeyr2-21/+22
Make sure everything is named gsup_client_ / GSUP_CLIENT_. Rename static gsup_client_send() to client_send() to avoid clash with public gprs_gsup_client_send() being renamed to gsup_client_send(). This is in preparation for moving gsup to libcommon, which is in turn preparation for libvlr. libvlr and osmo-sgsn will use the same GSUP client code. A number of patches will follow up on this, also for the the OAP client. Related: OS#1592 Change-Id: I57433973b1c4f6cc1e12e7b1c96b5f719f418b51
2016-12-13Revert "Support Deactivate PDP Context Request from network"Neels Hofmeyr1-2/+0
This reverts commit 1611df5226199da2bf2fba3d22d93cc1a6c6c777. This is due to a segfault introduced to the asan build only. See: http://lists.osmocom.org/pipermail/openbsc/2016-December/009966.html Subject: new sanitizer breakage: SIGSEGV in sgsn_create_pdp_ctx() Date: Tue Dec 13 12:08:32 UTC 2016 Change-Id: Ic926c0e6778947b516994822e3a21d4fde25bb02
2016-12-12Support Deactivate PDP Context Request from networkPravin Kumarvel1-0/+2
Enable Deactivate PDP context based on the IMSI of the subscriber. When there are PDP contexts present for a MM context, PDP context will be deactivated along with GMM Detach(MM context deletion). If there are no PDP present, MM context will be deleted to avoid further PDP context request from the MS. Test cases is added to check this functionality. Change-Id: Ia0a41aa2218ec2fda4ea17a37c8cc55cba63dd13
2016-12-09lchan release in error state: SACCH deact only for SACCH pchansNeels Hofmeyr1-0/+1
This is useful particularly in case where we deactivate PDCHs which don't have a SACCH associated. The existin code would always attempt to deactivate a SACCH even in those cases, leading to the BTS responsding with related error messages. Change-Id: Iaf46782329b38ba8f3d438e6c75c2d467b852734
2016-12-02gsm_subscriber_connection: mark BSC specific itemsNeels Hofmeyr1-6/+6
This is intended to prepare for splitting gsm_subscriber_connection into BSC and MSC specific structs, to make the splitting patch more readable. Change-Id: Ib9666225fb9bfec2cf1e364343560571869fe6a7
2016-12-02split subscr_con_allocate()/_free() in bsc_ and msc_Neels Hofmeyr1-2/+5
Rename current subscr_con_allocate() and subscr_con_free to bsc_*, and add two separate msc_subscr_con_allocate() and _free(). The msc_subscr_con_free() ignores all lchan members. In libbsc use bsc_*, in libmsc use msc_*. Change-Id: I3cf7c7cafdf4672ec7b26058bba8a77159855257 Future: there will be distinct subscr conns for libbsc and libmsc.
2016-12-02Move timezone settings up to network levelNeels Hofmeyr2-8/+14
Time zone used to be configurable per-BTS. In the upcoming MSC-split, no BTS structures will be available on the MSC level. To simplify, drop the ability to manage several time zones in a core network and place the time zone config on the network VTY level, i.e. in gsm_network. If we are going to re-add fine grained time zone settings, it should probably be tied to the LAC. Adjust time zone VTY config code (to be moved to libcommon-cs in subsequent commit). Adjust time zone Ctrl Interface code. Change-Id: I69848887d92990f3d6f969be80f6ef91f6bdbbe8
2016-12-02move to libcommon-cs: network VTY that isn't BSC-specificNeels Hofmeyr1-1/+2
Keep only BSC specific bits of the 'network' VTY node in bsc_vty.c, move more general VTY commands to common_cs_vty.c. Add arg to common_cs_vty_init() to pass a config_write_net() function. Pass a libbsc specific config_write_net() function. Future: upcoming omso-cscn will re-use the VTY bits moved to libcommon-cs and pass a different config_write_net() function. Change-Id: I871b7b32a0c56fdce983e409cf244ec487d24e71
2016-12-02move to libcommon-cs: global vty gsm_network pointerNeels Hofmeyr1-0/+5
Move gsmnet_from_vty() and the bsc_gsmnet global to common_cs_vty.c. Rename bsc_gsmnet to vty_global_gsm_network and make it static to common_cs_vty.c, to clearly mark the global variable for VTY use only. Introduce common_cs_vty_init() to set vty_global_gsm_network. Change-Id: I26c5c47de08f899b896813d09612d5cb2f8e42d6
2016-12-02split bsc_bootstrap_network() in alloc and configNeels Hofmeyr1-1/+2
For patch clarity, keep some code dup to be removed in a subsequent patch. In the same sense don't change the fact that mncc_sock_init()'s return value is ignored. The global gsm_network instance 'bsc_gsmnet' is basically only used by the VTY, and a future patch will "hide" that global in a vty .c file. In a nutshell, I want to - first allocate a gsm_network, - then initialize the VTY passing the gsm_network pointer, - and then read the config file using the initialized VTY. So far, bsc_bootstrap_network() allocates the gsm_network and reads the config file right away, which only works by sharing the extern bsc_gsmnet pointer, which I would like to uncouple. Change-Id: I480a09a31a79766ad07b627dd5238b7e37f3be7a
2016-12-02sms_next_rp_msg_ref(): use direct pointer to next_rp_ref counterNeels Hofmeyr1-1/+1
libbsc and libmsc will have separate subscriber connection structs. Hence don't rely on gsm_subscriber_connection, but work on a direct pointer to the counter for the next RP reference. The only very thin function in gsm_04_11_helper.c thus becomes obsolete: drop the entire file. Change-Id: I2a2e9ba6a981a385d1f8f07acbe03536ffed0072
2016-12-02factor out & introduce struct gsm_encr, in common_cs.hNeels Hofmeyr2-6/+11
Factor out encryption info from struct gsm_lchan as struct gsm_encr, placed in common_cs.h. Change-Id: I94015fb9dd511c37c1e3058a0963c780b3f700ac Future: this will be used by libmsc's subscriber connection, for osmo-cscn.
2016-12-02factor out gen of USSD notify and release complete to libosmocoreNeels Hofmeyr1-2/+7
Both libmsc and libbsc will need distinct gsm0480_send_ussdNotify() and gsm0480_send_releaseComplete() functions, since there will be distinct subscriber connection structs. Rename to msc_send_ussd_notify() and msc_send_ussd_release_complete(), and add the same in libbsc with bsc_ prefix in new file gsm_04_80_utils.c. In preparation of this patch, the message generation part of these functions has been added to libosmocore as gsm0480_create_ussd_notify() and gsm0480_create_ussd_release_complete(). Use these. Adjust all libmsc and libbsc callers according to use the msc_* or bsc_* implementation, respectively. Change-Id: I33a84e3c28576ced91d2ea24103123431f551173
2016-11-24move to libcommon-cs: net init 3: actual moveNeels Hofmeyr1-0/+7
Reincarnate gsm_network_init() as the parts not specific to libbsc. Move from bsc_network_init() those bits that are not BSC specific (and useful for upcoming osmo-cscn). Add libcommon-cs to all linkages that use gsm_network_init(). Note: the only requirement to allow linking gsm_network_init() without libbsc is to keep the call to gsm_net_update_ctype() out of libcommon-cs. The other items are kept out of libcommon-cs because it makes sense semantically. But the separation is not strong in that the BSC specific data members are of course still omnipresent in struct gsm_network. If bsc_network_init() is not called, these are not initialized properly -- for now no users of uninitialized members exist. So this is just a first step towards a sensible split of the BSC and MSC gsm_network structs. The long term aim should be to have entirely separate structs with some common general items. Change-Id: If06316b97002390dc9a434686750cb96193ea63b
2016-11-24move to libcommon-cs: net init 2: move bsc_network_init decl to new .hNeels Hofmeyr4-5/+12
bsc_network_init() is more fit to live in a BSC specific header, move it to new common_bsc.h. It will probably also absorb the BSC-specific part of gsm_network in the future. Adjust header includes across the board. Particularly, fix abis_nm.h by explicitly including gsm_data.h: it so far relied on other headers to do that, which now is no longer always given. Change-Id: I9edfb1e748bb1cb484fadd48b0406f5b3098e89b
2016-11-24move to libcommon-cs: net init 1: rename to bsc_network_initNeels Hofmeyr1-1/+1
The gsm_network_init() function initializes a whole lot of BSC specific stuff. Aiming to move some of it to libcommon-cs, first rename it to bsc_network_init(). This will retain the BSC specific stuff when the move is done. Adjust all callers. Future: osmo-cscn will call the more generic part and not the BSC specific part. Change-Id: I4816ae19374390fc5c64972f7cad2e9ec3d8bcc3
2016-11-24define mncc_recv_cb_t to avoid code dupNeels Hofmeyr3-4/+11
Put mncc_recv_cb_t in common_cs.h to avoid header include complications: if placing right above struct gsm_network, one must include gsm_data.h to use mncc_recv_cb_t as function parameter in a header, which will include gsm_data_shared.h, which will include common_cs.h (future knowledge). Since I will need to use mncc_recv_cb_t in common_cs.h, including gsm_data.h from there would introduce an #include loop. Avoid that and define mncc_recv_cb_t in common_cs.h to begin with. Change-Id: I2e64cffa563750ce9f3172ffba6f9cf5b9280e9c
2016-11-24Add empty libcommon-csNeels Hofmeyr2-0/+2
This will gradually soak up code shared by libbsc and libmsc. Change-Id: If34e2bd38a099d0799238337468d56e0305ab8ae
2016-11-18ussd: Add band-aid for interrogationSSHolger Hans Peter Freyther1-2/+2
This is a speculative change for interrogateSS and by not answering the request the radio connection would remain open long. The SS/USSD code is from a time where none of knew much about GSM. We do not support SS but should reject it. We have checked for an empty string in the text field to guess if it is a result/release to not send more information. The right way forward is to decode the ASN1 into the fields REQUEST/RESULT(last). Fix an issue and make the code worse. Assume ss_code > 0 to see if this is a interrogate invoke. The issue is that code 0 is a well defined value but unlikely to be used. MAP ASN1 definition: SS-Code ::= OCTET STRING (SIZE (1)) -- This type is used to represent the code identifying a single -- supplementary service, a group of supplementary services, or -- all supplementary services. The services and abbreviations -- used are defined in TS 3GPP TS 22.004 [5]. The internal structure is -- defined as follows: -- -- bits 87654321: group (bits 8765), and specific service -- (bits 4321) allSS SS-Code ::= '00000000'B Change-Id: Ib0dc4485388f030eb172fe21f5327b7ab94751f5
2016-11-15gbproxy: Check whether gbproxy_update_link_state_after() deletes the link_infoDaniel Willmann1-1/+1
In case the link_info is deleted we have to stop handling the stored messages inside link_info. Not doing so can lead to invalid memory being accessed. Change-Id: Ieb8503e9e94e7a5ac450ad8aa1713ec4f21cdea5 Ticket: OW#3049 Sponsored-by: On-Waves ehf
2016-11-13Support configuration of CON MO Groups/Paths from VTYHarald Welte2-0/+34
The code for supporting the configuration of the OM2000 CON (LAPD Concentrator) MO was so far incomplete and not used from the OM2000 FSM initialization. This patch adds * VTY commands for configuration of CON Groups and Paths * The FSM integration to actually configure the CON MO Change-Id: I56dc1b5e35adef3a2078bcf9536537eb0f454192
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