aboutsummaryrefslogtreecommitdiffstats
path: root/include
AgeCommit message (Collapse)AuthorFilesLines
2017-11-27subscr_conn: introduce usage tokens for ref error trackingNeels Hofmeyr2-4/+22
When hunting a conn use count bug, it was very hard to figure out who's (not) using the conn. To ease tracking down this bug and future bugs, explicitly name what a conn is being reserved for, and track in a bit mask. Show in the DREF logs what uses and un-uses a conn. See the test expectation updates, which nicely show how that clarifies the state of the conn in the logs. On errors, log them, but don't fail hard: if one conn use/un-use fails, we don't want to crash the entire MSC before we have to. Change-Id: I259aa0eec41efebb4c8221275219433eafaa549b
2017-11-20sub_pres_vlr_fsm_start: fix heap use after freeNeels Hofmeyr1-3/+4
When sub_pres_vlr_fsm_start() is called, it dispatches an event which may in some cases already cause tear down and free of the parent FSM instance, after which storing the returned instance pointer in that parent's metadata will use freed memory. Instead, pass the target pointer to remember the instance at to sub_pres_vlr_fsm_start() and assign the pointer *before* firing the event. Explain so in a new comment. I haven't checked whether that pointer is actually used at all -- this is the easiest way to fix the use-after-free without getting sucked into semantic questions. Change-Id: Ibdc0b64cd12ba3e2b9737e3517d8484e67abcf04
2017-11-20rate_ctr: don't use . as separatorNeels Hofmeyr1-19/+19
Use ':' as separator, so that no mangled rate_ctr descriptions are allocated. When '.' is used, the rate_ctr mangling code creates tallocs of mangled counter descriptors, and hence affects the amount of expected talloc contexts in msc_vlr_tests.c. Change-Id: Ib1db8e3dc6c833174f1b0b1ca051b0861f477408
2017-10-31cosmetic: vlr: rename auth_tuple_max_use_count to _reuse_Neels Hofmeyr1-1/+1
The name auth_tuple_max_use_count suggests that if I want to use each auth tuple exactly once, I need to set it to 1. Curiously, so far you need to set to intended uses - 1. Reflect this in its name by renaming to auth_tuple_max_reuse_count. I first considered to not rename but change the if-conditions so that == 1 means each tuple is used once, and upon struct vlr allocation, set the default to 1. That would also logically entail that setting to 0 means to re-use vectors infinitely often, like now a value < 0 does. That means, when allocating a vlr struct zeroed out, we would by default have the most dangerous/unsafe configuration. It's no problem to set a default to 1 upon allocation, but by renaming the variable instead, we get safer alloc-zero behavior and don't need to change any conditionals in the code (even though the patch ends up considerably larger from all the renaming). Change-Id: I0b036cae1536d5d6fb2304f837ed1a6c3713be55
2017-10-16Remove pkg-config fileMax1-10/+1
It's an artefact of split which is unused anyway. Change-Id: I15c0b4457c108c7791b0f30b79660d9e6d09b269
2017-10-03remove further files and autotest/autoconf bits irrelevant to osmo-mscHarald Welte1-523/+0
Change-Id: I68e879e7474cbd3dd053f23bc4d5d22dc2748c5b
2017-09-15Remove unused osmo_bsc_rf.h headerMax2-67/+0
Change-Id: I7a668665b571d00a6a34629626ddbfb60b6c09cc
2017-09-15Remove BTS-specific attributesMax5-158/+2
Remove *bts_model_* functions as they are only useful to BSC. Change-Id: Ic80d11d6f8167b49a94fc9c6edbc5ff9fbe36587
2017-09-15Remove SI-related codeMax2-50/+1
Get rid of unused data structures and functions related to SI handling. Change-Id: I048885e85a9f97b8b071f3a3f1c362b54a44720e
2017-09-15Remove rest_octets.hMax6-144/+4
The MSC should not fiddle with low-level SI details like rest octets anyway. Unfortunately simply removing the header is impossible as it causes massive fallout due to missing includes. Fixed it as well. The only other parameter which required removal is cell_ro_sel_par which is not referenced anywhere in the code anyway. Change-Id: Ibff77330de056fad4288cd4c48d016aad8105354
2017-09-11a_iface: fix memory leaksPhilipp Maier1-1/+1
Fix multiple memory leaske in A/BSSMAP code Change-Id: I90703c96e6a266a1cfa60b184139375aeb9ae32d
2017-09-08use separated libosmo-mgcp-client, apply rename to mgcp_client_*Neels Hofmeyr1-4/+4
After osmo-mgw changes I8e0b2d2a399b77086a36606f5e427271c6242df1 and I99f7faab637cfcc22ece64a1dbcbe590f2042187, apply linking of new libosmo-mgcp-client and renames to drop the "gw" from mgcp_client_*. Also rename the gsm_network.mgcpgw to mgw, to indicate that the MGCP client is used to contact the MGW (Media Gateway). Depends: I8e0b2d2a399b77086a36606f5e427271c6242df1 (osmo-mgw) I99f7faab637cfcc22ece64a1dbcbe590f2042187 (osmo-mgw) Change-Id: I093ad02ca0e532f659447c785e09678b3e6f220d
2017-09-06rename include/openbsc to include/osmocom/mscNeels Hofmeyr76-38/+41
Change-Id: I1f96a1285bbd1b4607614856bca935d5c26e2da9
2017-08-29split off osmo-msc: remove files, apply build, renameNeels Hofmeyr28-3597/+0
Change-Id: Icf025e5ea8d180613b3114282951c9afa67af9a7
2017-08-29move to osmo-mgw.git: osmo-bsc_mgcp and libmgcp as libosmo-legacy-mgcpNeels Hofmeyr7-845/+3
Rewire build and includes to libosmo-legacy-mgcp. Drop osmo-bsc_mgcp and related python tests, now found in osmo-mgw.git. libosmo-legacy-mgcp is installed from osmo-mgw, hence add the dependency to jenkins.sh (so far using the pre_release branch). Change-Id: Ic99d681759edce11564da62500c2aac5cf5fffe2
2017-08-29move libiu to osmo-iuh/libosmo-ranapNeels Hofmeyr8-87/+61
Remove libiu here, use the functions from libosmo-ranap instead, by applying the ranap_ / RANAP_ prefix. Corresponding change-id in osmo-iuh.git is I6a3f7ad15be03fb94689b4af6ccfa828c25f45c0 To be able to run the msc_vlr tests for RAN_UTRAN_IU without Iu client headers available, add iu_dummy.h, containing mere function signatures that match iu_dummy.c and a mostly empty struct ranap_ue_conn_ctx. Make sure we can build with and without --enable-iu: include osmo-iuh headers only with --enable-iu. Change-Id: Ib8c4fcdb4766c5e575618b95ce16dce51063206b
2017-08-29Implement AoIP, port to M3UA SIGTRAN (large addition and refactoring)Philipp Maier18-29/+417
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-27libmsc: Use actual delivery time in delivery reports.Keith1-0/+1
Set the time on the status report to the time the message was delivered, as this may not be the same as the time when we are delivering the report to the originating MS. Change-Id: I9056429d40bf02731f004b7833f1de45a0d1add8
2017-08-27Migrate from gprs_apn_to_str() to libosmocore osmo_apn_to_str()Harald Welte1-1/+0
In 2015, Jacob moved/copied related functions to libosmocore, but for some reason didn't remove the copies here. Let's follow-up on that and remove duplicated code. The libosmocore commit introducing osmo_apn_to_str() was 8114294bf29ac6e44822c0ae43d4b0819f11b022 Change-Id: I7315ffcbed8a54cca2056f313bb7783ad82d0ee9
2017-08-27mgcp_osmux: Remove unused parameterPau Espin Pedrol1-2/+1
Change-Id: Icb1e7cb15fe04642578f5292124ebc1eac9c9aa3
2017-08-27libcommon: Fix log output for bts>0.Alexander Chemeris1-1/+1
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-27libmsc: add support for SMPP delivery receiptsPablo Neira Ayuso1-0/+1
If the mobile phone requests a status report via SMS, send a DELIVER_SM with esm_class = Delivery Receipt to ESME to indicate that the SMS has been already delivered to its destination. MS GSM 03.40 SMSC SMPP 3.4 ESME | | | | SMS-DELIVER | | |<----------------------------| | | GSM 04.11 RP-ACK | | |---------------------------->| | | | DELIVER-SM | | | esm_class = Delivery Receipt | | |------------------------------->| | | DELIVER-SM-RESP | | |<-------------------------------| | | | This patch implements "Appendix B. Delivery Receipt Format" as specified in the SMPP 3.4 specs. This string is conveyed in the SMS message as data, and it is only meaningful to the ESME, for logging purposes. The "submit date" and "done date" are not yet set, and other fields are just sent with dummy values, so they are left to be finished as future work. The new SMPP TLV tag TLVID_user_message_reference is added to the SMPP messages inconditionally now since this information is required by delivery-reports to associate the status-report with the original SMS. Change-Id: Ic1a9023074bfa938099377980b6aff9b262fab2a
2017-08-27GSM timers: User reasonable defaults; don't save if equal defaultHarald Welte1-2/+10
A number of the GSM timers (including T3109) had no reasonable default values if not specified in the VTY / config file. Together with unconditional writing to the config file, this created config files with a persistent setting for important timers as '0'. To make things worse, many of our example cofig files suffered from the same problem. Let's avoid this from happening by * having reasonable defaults if nothing specified in the config file * conditionally savingg timers only if they differ from default * reject any timer values that state zero during start-up (see previous commit) Change-Id: Iaac0bfca423852b61d8b9eb1438157ef00d0d8c8 Closes: OS#2380
2017-08-27Support for TS 04.14 conformance test commandsHarald Welte2-0/+16
Change-Id: Ib27edbfc8ccdedf00589ec715ced7bed435fa94c
2017-08-27sgsn: Fill the cch_pdp with a value coming from the tlv structureHolger Hans Peter Freyther1-0/+5
For some GGSNs we need to insert the PDP Charging Characteristics that were returned. We receive these values from GSUP and will fill them into the tlv structure when finding the ggsn context. Change-Id: I1725bfd2403d29ce3550bfcd6fcc1498426ef906
2017-08-23mgcp: hack RAB success from nano3G: patch first RTP payloadNeels Hofmeyr1-0/+1
The ip.access nano3G needs the first RTP payload's first two bytes to read hex 'e400', or it will reject the RAB assignment. Add flag patched_first_rtp_payload to mgcp_rtp_state to detect the first RTP payload on a stream, and overwrite its first bytes with e400. This should probably be configurable, but seems to not harm other femto cells (as long as we patch only the first RTP payload in each stream). Only do this when sending to the BTS side. Related: OS#2459 Change-Id: I5eff04dcb0936e21690e427ae5e49228cd459bd4
2017-08-08Implement IuCS (large refactoring and addition)Neels Hofmeyr18-20/+229
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-08sgsn init: pass sgsn_config pointer to sgsn_vty_init(), not sgsn_parse_configNeels Hofmeyr1-2/+2
In an upcoming commit, sgsn_vty_init() will require access to the global sgsn config struct to initialize a generic VTY command with the proper config destination address, see Change-Id I5b5b6a9678b458affa86800afb1ec726e66eed88. Change-Id: Ie6b6e5422987586531a898e0c5b867623dbecb0f
2017-08-08mscsplit: various preparations to separate MSC from BSCNeels Hofmeyr7-17/+100
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-07vlr: LU FSM: enable Retrieve_IMEISV_If_RequiredNeels Hofmeyr1-1/+2
Change-Id: I121b95ad6d5ecb7603815eece2b43008de487a8a
2017-07-23Use libvlr in libmsc (large refactoring)Harald Welte18-182/+147
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-07-21Add libvlr implementationHarald Welte4-9/+415
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-07-13gsup_client: allow passing a unit id to identify with HLRNeels Hofmeyr1-2/+5
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-07-12move openbsc/* to repos rootNeels Hofmeyr93-0/+9944
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
2009-06-10move openbsc into its own subdirectoryHarald Welte36-4992/+0
2009-06-09* add support for storing classmark1/2/3 per subscriberHarald Welte2-2/+42
* add support for parsing measurement results (both BTS and MS side)
2009-06-09don't prefix every line with timestamp, this saves some screen real estateHarald Welte1-0/+1
2009-06-08openbscdefines.h: Add header file to control visibility of symbolsHolger Freyther2-1/+36
Add the hooks/configure detection to compile everything with -fvisibility=hidden and then make certain symbols visible. This will be used to make parts of the API public. There are no users yet but we should have some soon.
2009-06-06lchan: Handle the abnormal case of channel getting closedHolger Freyther1-0/+11
The abnormal case is that lchan_free ist getting called due a RSL_MT_CHAN_REL_ACK in the RSL but the refcount of this channel is not zero. This means that some "logical operation" is still going on that needs to be cancelled. Instead of always queuing up all operations in the struct gsm_lchan use the signal framework to inform higher layers about this abnormal case. In gsm_04_08.c a signal handler is installed and in the abnormal case the location updating request operation is freed.
2009-06-06Revert "[db] Keep track of the current gsm_network"Holger Freyther1-1/+1
This was a stupid decision. We will have to assign the network at some other place. The problem will be a problem when we have two gsm_networks in one process and the same subscriber is traveling in both networks.
2009-06-05BS11: add nm_state for EnveBTES, PA and BBSIG physical objectsHarald Welte1-1/+16
2009-06-04[subscr] Remove the struct gsm_bts pointer from subscriberHolger Freyther1-1/+0
The pointer was initially added to support to open a lchan by using the gsm_subscriber structure. We would have restored the struct gsm_bts from the db when loading the subscriber. Instead we will dynamically resolve the gsm_bts and might end up paging multiple bts in the same (stored/old) location area until it answers.
2009-06-04gsm_subscriber.h: Remove trailing whitespace...Holger Freyther1-1/+1
Cosmetic changed
2009-06-02[subscriber] Change id to long long unsigned int (Andreas Eversberg)Holger Freyther1-1/+1
Changes the subscriber id type defintion from "long unsigned int" to "long long unsigned int". Without, printf with '%llu' caused a crash.
2009-06-02[lchan] Log increase/decrease of channel use count (Andreas Eversberg)Holger Freyther1-1/+9
This is part of patch 22 and will log changes in the usecount of the lchan.
2009-05-28* give Siemens ObjClass reasonable names rather than A3/A5/A6Harald Welte2-10/+26
* add nm_state objects for RACK and CCLK * add obj_class human-readable printing for all vendor obj_classes * add human-readable printing of administrative state * add enum for cell_alloc numbers
2009-05-23show and edit subscribers from the vty interfaceHarald Welte2-1/+2
2009-05-23Add user-configurable BSIC settingHarald Welte1-0/+3
2009-05-23* replace some more hex bytes in init msgs by #definesHarald Welte1-0/+4
* when using patch_tables(), use the ARFCN of the BTS, not the cmdline argument
2009-05-23With this patch, the TRAU muxing code supports not just bridging only. Harald Welte2-2/+10
A new function trau_recv_lchan() is used to link a channel to a call reference of a transaction. (Transactions are used in later patches.) TRAU frames will then be forwarded to the application with the given call reference (in later patches). Also the application can send TRAU frames by using trau_send_lchan(). A new list is introduced in trau_mux.c. (upqueue_entry) All subslots that must be sent to application are listed here. Received TRAU frames are written in the upqueue of application interface, if a call reference is found in the upqueue-list. If an entry is found the ss_entry list, the TRAU frames are bridged as before. The frames have a message type (msg_type), a call reference (callref) and a trau frame (data). The length of trau frame is defined by the content of the c-bits inside the frame. There is no support for ip.access yet, as they don't use the traditional TRAU frame format. Harald must add this in order to use application interface with ip-access. The bridging with ip-access works as before. (Andreas Eversberg)