aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcommon
AgeCommit message (Collapse)AuthorFilesLines
2017-12-14Fix per-BTS counter group indexHarald Welte1-1/+1
I discovered that the per-BTS counter group could only be requested for BTS 0 but didn't work for any further BTSs. This is a bug introduced in Change-Id I5bd9e6e333b1c396beae46630986b17e7f8b82ef where we introudce the per-BTS counters,t but allocate all of them with index '0'. Change-Id: I1b56f8d7b47597ed263e6808074483edca0895de
2017-12-13fix segfault upon release paging on BSSMAP Reset: init llistNeels Hofmeyr1-0/+3
Initialize the llist head gsm_bts->paging.pending_requests at the time gsm_bts is allocated, not only at paging_init_if_needed(). The gsm_bts->paging sub-struct is invalid as long as gsm_bts->paging.bts doesn't point back to bts. Hence the recently added iteration of gsm_bts->paging.pending_requests should have checked whether bts is NULL. The llist_head pending_requests is not initialized unless paging_init_if_needed() has been called (and paging.bts is hence set). However, this fix is a safer way to prevent errors like this in general. The segfault was introduced by d382bf63e2b7e28fe41c5310c26fe584f0356897 / If3f53d3bb66ad2dc02db823cb813590c6b59c700 Related: OS#2747 Change-Id: Idfafac4e2c0e0a241a62aecbbdc22be71febf840
2017-12-09Move many counters from BSC-global to per-BTS granularityHarald Welte1-0/+8
We used to have a lot of counters only globlly per BSC, but they're much more useful on a per-BTS level. Change-Id: I954b9dda72b83b91d46a934c221a8b3375743599
2017-11-29HO prep: pass gsm_network to gsm_bts_alloc() alreadyNeels Hofmeyr2-3/+4
Prepare for a future change that accesses bts->network during gsm_bts_alloc(). Currently, gsm_bts_alloc() takes a ctx parameter, and gsm_bts_alloc_register() then gets the gsm_network pointer and sets bts->network to it. All callers anyway pass gsm_network as ctx to gsm_bts_alloc(), and anything else would not make sense anyway. So enforce passing exactly gsm_network to gsm_bts_alloc() and already set the bts->network pointer from there. Prepares-for: I00870a5828703cf397776668d3301c0c3a4e033a Change-Id: Ie590c14aa08df4c4f345596b23e5226c5577057a
2017-11-29cosmetic: mark gsm_objclass2mo as staticMax1-1/+1
It's only used once in the same file so there's no need to put it into global header. Change-Id: Id9674cad54bab6cc04475719678efc2c25d058a9
2017-11-29cosmetic: remove obsolete ROLE_BSCMax1-13/+0
It's leftover from the time when gsm_data_shared.* was actually shared with OsmoBTS. Nowadays ROLE_BSC is always defined so we can just drop it entirely and make working with gsm_data_shared.h slightly easier. Change-Id: I34fc9ee5955c14bbbde68d5499cf2acfd329afbc
2017-11-24vty: Add cmd to configure 3g Early Classmark SendingPau Espin Pedrol1-0/+1
In state prior to this patch, "3G Early Classmark Sending Restriction" bit in SI3 rest octets was always set to H, which is a sane default as the policy to send the information is then controlled by "Early Classmark Sending Control" bit in the same octet. However, it seems Quortus SoftCore can have some issues decoding the option, so let's add a vty cmd to be able to disable it for those having any issues. Related: SYS#4021 Change-Id: Ic1afe071038a3bb5871d7ff40f665c8644f801ec
2017-09-06move include/openbsc to include/osmocom/bscNeels Hofmeyr6-16/+16
Change-Id: I39e7b882caa98334636d19ccd104fd83d07d5055
2017-09-06drop files unrelated to osmo-bscNeels Hofmeyr1-280/+0
These either remain from openbsc.git or slipped in while applying recent patches from openbsc.git and do not belong in osmo-bsc. Empty out contrib: remove things that are either obviously unrelated to osmo-bsc, or seem old and/or esoteric. osmoappdesc.py: drop nitb_e1_configs (and some ws) Change-Id: Ib20064f35e623d99c7d59496a3156e84b8a0d07a
2017-08-30split off osmo-bsc: remove files, apply buildNeels Hofmeyr5-690/+1
Change-Id: I64d84c52f6e38e98144eb9be8f0ab82e0e1f6cca
2017-08-30gsup client: move not-connected to error loglevelNeels Hofmeyr1-10/+2
Change-Id: I8290963aedb7237da89c9ff98adf4cd33beb5031
2017-08-30Implement AoIP, port to M3UA SIGTRAN (large addition and refactoring)Philipp Maier2-6/+20
This was originally a long series of commits converging to the final result seen in this patch. It does not make much sense to review the smaller steps' trial and error, we need to review this entire change as a whole. Implement AoIP in osmo-msc and osmo-bsc. Change over to the new libosmo-sigtran API with support for proper SCCP/M3UA/SCTP stacking, as mandated by 3GPP specifications for the IuCS and IuPS interfaces. From here on, a separate osmo-stp process is required for SCCP routing between OsmoBSC / OsmoHNBGW <-> OsmoMSC / OsmoSGSN jenkins.sh: build from libosmo-sccp and osmo-iuh master branches now for new M3UA SIGTRAN. Patch-by: pmaier, nhofmeyr, laforge Change-Id: I5ae4e05ee7c57cad341ea5e86af37c1f6b0ffa77
2017-08-27Fix gsm_pchan2chan_nr() to use RSL_CHAN_OSMO_PDCHHarald Welte1-1/+4
When converting from GSM_PCHAN_PDCH, we should generate a RSL channel number IE with the osmocom extension RSL_CHAN_OSMO_PDCH rather than claiming it is a regular TCH/F channel. This is important as this function is used by osmo-bts, too - and it decides which channel number IE is put in the GSMTAP header for both GSMTAP tracing as well as the GSMTAP based osmo-bts-virtual. In order to avoid any unintended effect on libbsc, we make sure to modify rsl_ipacc_pdch_activate() to always use GSM_PCHAN_TCH_F in related RSL message. Change-Id: Ie34219e64a6d89da4a79f2db8ec73d1909fb8280
2017-08-27libcommon: Fix log output for bts>0.Alexander Chemeris2-3/+5
Fixes regression probably introduced in c696cc28. For bts>0 logging doesn't show bts number correctly when printing lchan identification string - it will always show it as "bts=0". The reason for this is that the identification string is cached before bts->nr value is set to a proper value. This patch sets bts->nr as part of the first step of the bts structure initialization, before caching happens thus making sure the cached identification string is cached with the correct values. Change-Id: I61c18a7f021fcb1ec00d34a745f4e3ab03416c2d
2017-08-27Implement IuCS (large refactoring and addition)Neels Hofmeyr2-0/+12
osmo-nitb becomes osmo-msc add DIUCS debug log constant add iucs.[hc] add msc vty, remove nitb vty add libiudummy, to avoid linking Iu deps in tests Use new msc_tx_dtap() instead of gsm0808_submit_dtap() libmgcp: add mgcpgw client API bridge calls via mgcpgw Enable MSC specific CTRL commands, bsc_base_ctrl_cmds_install() still needs to be split up. Change-Id: I5b5b6a9678b458affa86800afb1ec726e66eed88
2017-08-27mscsplit: various preparations to separate MSC from BSCNeels Hofmeyr2-34/+1
Disable large parts of the code that depend on BSC presence. The code sections disabled by #if BEFORE_MSCSPLIT shall be modified or dropped in the course of adding the A-interface. Don't set msg->lchan nor msg->dst. Don't use lchan in libmsc. Decouple lac from bts. Prepare entry/exit point for MSC -> BSC and MSC -> RNC communication: Add msc_ifaces.[hc], a_iface.c, with a general msc_tx_dtap() to redirect to different interfaces depending on the actual subscriber connection. While iu_tx() is going to be functional fairly soon, the a_tx() is going to be just a dummy for some time (see comment). Add Iu specific fields in gsm_subscriber_connection: the UE connection pointer and an indicator for the Integrity Protection status on Iu (to be fully implemented in later commits). Add lac member to gsm_subscriber_connection, to allow decoupling from bts->location_area_code. The conn->lac will actually be set in iu.c in an upcoming commit ("add iucs.[hc]"). move to libcommon-cs: gsm48_extract_mi(), gsm48_paging_extract_mi(). libmsc: duplicate gsm0808 / gsm48 functions (towards BSC). In osmo-nitb, libmsc would directly call the functions on the BSC level, not always via the bsc_api. When separating libmsc from libbsc, some functions are missing from the linkage. Hence duplicate these functions to libmsc, add an msc_ prefix for clarity, also add a _tx to gsm0808_cipher_mode(): * add msc_gsm0808_tx_cipher_mode() (dummy/stub) * add msc_gsm48_tx_mm_serv_ack() * add msc_gsm48_tx_mm_serv_rej() Call these from libmsc instead of * gsm0808_cipher_mode() * gsm48_tx_mm_serv_ack() * gsm48_tx_mm_serv_rej() Also add a comment related to msc_gsm0808_tx_cipher_mode() in two places. Remove internal RTP streaming code; OsmoNITB supported that, but for OsmoMSC, this will be done with an external MGCP gateway. Remove LCHAN_MODIFY from internal MNCC state machine. Temporarily disable all paging to be able to link libmsc without libbsc. Skip the paging part of channel_test because the paging is now disabled. Employ fake paging shims in order for msc_vlr_tests to still work. msc_compl_l3(): publish in .h, tweak return value. Use new libmsc enum values for return val, to avoid dependency on libbsc headers. Make callable from other scopes: publish in osmo_msc.h and remove 'static' in osmo_msc.c add gsm_encr to subscr_conn move subscr_request to gsm_subscriber.h subscr_request_channel() -> subscr_request_conn() move to libmsc: osmo_stats_vty_add_cmds() gsm_04_08: remove apply_codec_restrictions() gsm0408_test: use NULL for root ctx move to libbsc: gsm_bts_neighbor() move to libbsc: lchan_next_meas_rep() move vty config for t3212 to network level (periodic lu) remove unneccessary linking from some tests remove handle_abisip_signal() abis_rsl.c: don't use libvlr from libbsc gsm_subscriber_connection: put the LAC here, so that it is available without accessing conn->bts. In bsc_api.c, place this lac in conn for the sake of transition: Iu and A will use this new field to pass the LAC around, but in a completely separate OsmoBSC this is not actually needed. It can be removed again from osmo-bsc.git when the time has come. Siemens MRPCI: completely drop sending the MRPCI messages for now, they shall be added in osmo-bsc once the A-Interface code has settled. See OS#2389. Related: OS#1845 OS#2257 OS#2389 Change-Id: Id3705236350d5f69e447046b0a764bbabc3d493c
2017-08-27Use libvlr in libmsc (large refactoring)Harald Welte5-144/+40
Original libvlr code is by Harald Welte <laforge@gnumonks.org>, polished and tweaked by Neels Hofmeyr <nhofmeyr@sysmocom.de>. This is a long series of trial-and-error development collapsed in one patch. This may be split in smaller commits if reviewers prefer that. If we can keep it as one, we have saved ourselves the additional separation work. SMS: The SQL based lookup of SMS for attached subscribers no longer works since the SQL database no longer has the subscriber data. Replace with a round-robin on the SMS recipient MSISDNs paired with a VLR subscriber RAM lookup whether the subscriber is currently attached. If there are many SMS for not-attached subscribers in the SMS database, this will become inefficient: a DB hit returns a pending SMS, the RAM lookup will reveal that the subscriber is not attached, after which the DB is hit for the next SMS. It would become more efficient e.g. by having an MSISDN based hash list for the VLR subscribers and by marking non-attached SMS recipients in the SMS database so that they can be excluded with the SQL query already. There is a sanity limit to do at most 100 db hits per attempt to find a pending SMS. So if there are more than 100 stored SMS waiting for their recipients to actually attach to the MSC, it may take more than one SMS queue trigger to deliver SMS for subscribers that are actually attached. This is not very beautiful, but is merely intended to carry us over to a time when we have a proper separate SMSC entity. Introduce gsm_subscriber_connection ref-counting in libmsc. Remove/Disable VTY and CTRL commands to create subscribers, which is now a task of the OsmoHLR. Adjust the python tests accordingly. Remove VTY cmd subscriber-keep-in-ram. Use OSMO_GSUP_PORT = 4222 instead of 2222. See I4222e21686c823985be8ff1f16b1182be8ad6175. So far use the LAC from conn->bts, will be replaced by conn->lac in Id3705236350d5f69e447046b0a764bbabc3d493c. Related: OS#1592 OS#1974 Change-Id: I639544a6cdda77a3aafc4e3446a55393f60e4050
2017-08-27Add libvlr implementationHarald Welte1-0/+5
Original libvlr code is by Harald Welte <laforge@gnumonks.org>, polished and tweaked by Neels Hofmeyr <nhofmeyr@sysmocom.de>. This is a long series of trial-and-error development collapsed in one patch. This may be split in smaller commits if reviewers prefer that. If we can keep it as one, we have saved ourselves the additional separation work. Related: OS#1592 Change-Id: Ie303c98f8c18e40c87c1b68474b35de332033622
2017-08-27gsup_client: allow passing a unit id to identify with HLRNeels Hofmeyr2-5/+15
Before, each GSUP client would contact the HLR with an identical unit id, i.e. "SGSN-00-00-00-00-00-00", with the result that some messages were sucked off by the wrong client. Pass explicit unit name from each gsup client user, so that OsmoMSC is "MSC" and OsmoSGSN is "SGSN". Hence the HLR can properly route the messages. Todo: also set some values instead of the zeros. Unrelated cosmetic change while editing the arguments: gsup_client_create()'s definition's oap client config arg name mismatched the one used in the declaration. Use oapc_config in both. Change-Id: I0a60681ab4a4d73e26fe8f0637447db4b6fe6eb2
2017-08-27move openbsc/* to repos rootNeels Hofmeyr12-0/+3028
This is the first step in creating this repository from the legacy openbsc.git. Like all other Osmocom repositories, keep the autoconf and automake files in the repository root. openbsc.git has been the sole exception, which ends now. Change-Id: I9c6f2a448d9cb1cc088cf1cf6918b69d7e69b4e7