aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/include/openbsc/gsm_subscriber.h
AgeCommit message (Collapse)AuthorFilesLines
2016-05-09Merge branch 'master' into sysmocom/iu, with tweakssysmocom/iu_orig_historyNeels Hofmeyr1-4/+3
Numerous manual adjustments are included to make sense on the sysmocom/iu branch: * gsm_04_08_gprs.h has moved to libosmocore on the master branch, but sysmocom/iu has added some entries. Until it is clear whether to move the additions to libosmocore as well, keep gsm_04_08_gprs.h on sysmocom/iu with merely the additions. * Thus, keep using the old gsm_04_08_gprs.[hc] from openbsc in the Makefiles, but only where the sysmocom/iu additions are needed. * In openbsc's gsm_04_08_gprs.h, * include the libosmocore gsm_04_08_gprs.h, * use '#pragma once' instead of #ifndef and * add a TODO comment about moving the rest to libosmocore. * Apply the addition of an osmo_auth_vector to gsm_auth_tuple: in the Iu auth vector hacks, use the gsm_auth_tuple.vec instead of a local struct. See iu_hack__get_hardcoded_auth_tuple() and gsm48_rx_gmm_att_req(). * In the si2q tests, pass NULL as ctx to gsm_network_init(). * In cscn_main.c, add a debug log that was originally added to osmo-nitb. * openbsc/.gitignore: keep only one addition of 'writtenconfig' Conflicts: openbsc/include/openbsc/gprs_sgsn.h openbsc/include/openbsc/gsm_04_08_gprs.h openbsc/src/gprs/gsm_04_08_gprs.c openbsc/src/libmsc/gsm_04_08.c openbsc/src/osmo-cscn/cscn_main.c openbsc/tests/gsm0408/Makefile.am
2016-05-04msc subscr: add paging timeoutNeels Hofmeyr1-0/+1
In NITB, the paging timeout would be handled from the BSC side. In IuCS, we need to invalidate the paging request from libmsc alone, so add a paging timer to gsm_subscriber. Possibly, the HNB-GW should respond with a paging failure and libmsc could trigger on that, nevertheless libmsc should not rely on a failure message to expire pending pagings.
2016-05-02paging: change subscr_paging_cb() into subscr_rx_paging_response()Neels Hofmeyr1-0/+2
Remove one layer of callback indirection in paging. When a paging response arrives, we always want to first secure the connection, thus a fixed subscr_rx_paging_response() function is more appropriate and avoids having to store a cbfn. The actual actions to be taken upon successful paging are of course still in callback functions stored with each subscriber.
2016-05-02gsm_04_08 mscsplit: subscr_request_channel() -> subscr_request_conn()Neels Hofmeyr1-2/+2
Rename subscr_request_channel() to _conn() and remove the channel_type arg. The "channel" is a term from closely tied MSC+BSC code, after separation we shall call it a "connection", i.e. over IuCS or A. The channel_type arg is already unused from a previous MSCSPLIT commit.
2016-05-02gsm_04_08: factor out subscr authorization checkNeels Hofmeyr1-0/+4
Add function subscr_authorized(), absorbing the guts of static authorize_subscriber() from gsm_04_08.c, except the parts specific to Location Updating. subscr_authorized() is a check that is to be added to validation of a paging response.
2016-04-29use new libosmocore gsm_23_003.h for IMEI/IMSI lengthHarald Welte1-4/+3
... rather than our private definitions everwhere. As an added benefit, gprs_gsup_messages.h is now free of any header dependencies within openbsc.
2016-04-20add preliminary paging response handling, incompleteNeels Hofmeyr1-0/+14
In gsm_04_08.c, add a static handle_paging_resp() to take over from the libbsc function gsm48_handle_paging_resp(). Use the subscr->requests listing to handle a Paging Response and call the pending cbfn. In NITB, this used to be done via BTS, and I haven't entirely resolved yet how exactly to rewire this in standalone libmsc. So far, this "works for me", but is worth another visit. Still missing: enable Integrity Protection.
2016-03-17Revert "move to hex TMSI representation"Harald Welte1-1/+1
This reverts commit 044fbe6568f82a12bf4e3addc7e3d6db529b6548.
2016-03-17move to hex TMSI representationVadim Yanitskiy1-1/+1
In OpenBSC, we traditionally displayed a TMSI in its integer representation, which is quite unusual in the telecom world. A TMSI is normally printed as a series of 8 hex digits. This patch aligns OpenBSC with the telecom industry standard. Signed-off-by: Vadim Yanitskiy <axilirator@gmail.com>
2016-03-03mscsplit: remove bts and lchan pointers from libmscNeels Hofmeyr1-2/+3
The diff between this and master will probably need a lot of review and fixes. The current state does compile, but I expect pretty much everything to be broken now. Future development will reinstate proper functionality piecemeal. The first goal is to get basic signalling to work, then SMS. The voice control (RTP) is completely disabled now (see "#if BEFORE_MSCSPLIT") and will be fixed last AFAICT.
2015-04-29sub: Remove the queue from the subscriber codeHolger Hans Peter Freyther1-4/+10
The idea of "subscriber_get_channel" was that different requests would be coordinated. At the same time we have seen that the "queue" can get stuck at both 31C3 and the rhizomatica installations. Voice calls and SMS do not need coordination. We should be able to send SMS on a voice channel and switch the MS from a SDCCH to a TCH in case we establish a voice call. The SMS code itself needs to coordinate to obey the limit of one SMS per direction but this should be enforced in the sms layer and not on the subscriber. Modify the code to have a simple paging coordination. The subscriber code will schedule the paging and register who would like to know about success/failure. This allowed to greatly simplify the paging response handling for the transaction code (and in fact we could move the transaction list into the subscriber structure now). The code gained to support to cancel the notification of a request (but not the paging itself yet). TODO: Cancel paging request in case no one cares about it anymore.
2015-04-29sub: Remove introspection of the "channel queue"Holger Hans Peter Freyther1-5/+0
Over the next commits the queuing of commits will be completely modified to remove the queue and move the scheduling/limits to the outer callers.
2014-12-09sgsn: Put SGSN related subscriber data into separate structJacob Erlbeck1-1/+2
There will be an increasing number of SGSN related fields per subscriber. Instead of extending gsm_subscriber accordingly, a single struct sgsn_subscriber_data object is assigned to it. The talloc context used to allocated that object is the subscr object itself. Therefore it will be freed automatically along with the subscr object. Sponsored-by: On-Waves ehf
2014-12-09sgsn: Add gprs_subscriber.cJacob Erlbeck1-0/+1
This patch adds GPRS specific functions for gsm_subscriber objects (allocation, retrieval, deletion) and subscriber data requests/updates. The sgsn_update_subscriber_data callback is used to notify the sgsn about updates and is extended by a parameter that passes a reference to a gsm_subscriber. Sponsored-by: On-Waves ehf
2014-12-09msc: Add per subscriber keep_in_ram flagJacob Erlbeck1-0/+3
Currently the keep_subscr flag in gsm_subscriber_group refers to a whole group of subscribers which makes it difficult to really delete single entries if the flag is set. This patch adds a keep_in_ram field to gsm_subscriber which allows for keeping subscriber objects in RAM while deleting others. Note that really deleting an entry requires that both flags (subscr_group->keep_subscr and subscr->keep_in_ram) are set to 0. So only the latter should be used if a specification requires the deletion of a subscriber entry. Sponsored-by: On-Waves ehf
2014-12-05msc: Add and use gsm_subscriber_groupJacob Erlbeck1-11/+17
Currently every subcriber object directly refers to the gsm_network which contains a flag shared by every related subscriber (keep_subscr). This adds a dependency on gsm_network even if only the function defined in gsm_subscriber_base.c are used. This patch adds a new struct gsm_subscriber_group which contains the keep_subscr flag and a back reference to the network object. The latter is not dereferenced in gsm_subscriber_base.c, so it can safely be set to NULL when only that part of the gsm_subscriber API is being used. It also changes that API to use gsm_subscriber_group instead of gsm_network parameters. Since there are some places where a pointer to the gsm_network is needed but where only a gsm_subscriber is available, a 'net' back pointer is added to the group struct, too. Nevertheless subscr group and network could be separated completely, but this is not the topic of this commit. Sponsored-by: On-Waves ehf
2014-11-14sgsn: Cross-link gsm_subscriber and sgsn_mm_ctxJacob Erlbeck1-0/+4
To implement subscriber based authorization a data structure is needed that keeps the subscriber data. The MSC already uses a similar struct named gsm_subscriber whose implementation is split into a generic part (allocation, retrieval, reference counting, list maintenance) and MSC related parts. For GPRS, only the generic part will be used and specific fields may be added when needed. This patch adds a field mm to struct gsm_subscriber that will be used by the SGSN to store a reference to the current MM context (or NULL if there is none). This also adds a field subscr to struct sgsn_mm_ctx that reversely points to a gsm_subscriber (or NULL if there is none). Either both fields are NULL or both fields are non-NULL. Note that subscr is being reference counted. Sponsored-by: On-Waves ehf
2013-10-13db: Remove the struct gsm_network from the database layerHolger Hans Peter Freyther1-0/+2
The database code should not know about the network. Move the setting of the network pointer into the subscriber layer.
2013-07-27expiration: Allow to disable the periodic location updating procedureHolger Hans Peter Freyther1-0/+2
Disable the periodic LU using "no periodic location update" VTY command. In that case set the expire_lu to 0 which will then be translated to a NULL in the database layer. This leads to a bit of copy and paste in the db_sync_subscriber method but I don't see how we could easily use 'datetime(%i, 'unixepoch')' and 'NULL' at the same time. Change the query to find expired queries to check for NOT NULL and the time being in the past. This means if there are still old subscribers in the database they might not be expired. One would need to execute a query like "UPATE Subscriber SET expire_lu = 0 WHERE expire_lu is null". The same applies when disabling the periodic LU. One would need to update the database by hand. Manual tests executed/passed: 1.) periodic LU enabled: * use gst LUTest.st to do a LU * UPDATE Subscriber SET expire_lu=datetime('now'); * observe the subscriber being expired (it was) 2.) periodic LU disabled: * use gst LUTest.st to do a LU * verify that the expire_lu is NULL in the database
2013-07-27expiration: Speculative fixes for the periodic expiring handlingHolger Hans Peter Freyther1-0/+1
We were expiring subscribers during active calls. This is because the T3212 is stopped under certain conditions but we didn't stop that timer at all. Remember if T3212 timer was stopped due something done by NITB and update the expiration time at the end of the radio connection, as the phone should restart it when returning to MM Idle. It is a bit difficult to decide when we should set the flag. E.g. in a CM Service Request we don't know if we accept the service and during a LU we already send MM messages before we accept or reject the subscriber. The easiest is to set the flag when receiving a paging response on known subscribers and at the end of the authentication process. Do not expire a subscriber that has an active connection that is marked with the flag, e.g. we would still expire a subscriber that is being paged. Manual tests executed/passed: * gst LUTest.st verified that a expiration date was set * gst SMSTest.st (doing another LU but forcing a timeout on the SMS sending). Verified that the expire_lu was updated.
2013-01-01libmsc: Track and update the location update expiryJan Luebbe1-0/+2
Set the subscriber expiry timeout to twice the duration of the location update period and provide functions subscr_expire() and db_subscriber_expire() to mark subscribers offline that have missed two location update periods. This patch increases the DB revision to 3, so the hlr will be incompatible with prior versions. We should allow 0 for T3212 as well to disable the location update period. In that case we will need a way to indicate that in the database.
2011-04-18misc: Remove sys/types.h includes from the filesHolger Hans Peter Freyther1-1/+0
These are not needed any more. We used them for u_int types but we now use uint which comes from stdint.h
2011-04-18misc: Move from u_int to uint types of stdint.hHolger Hans Peter Freyther1-8/+8
This was done with sed on the files.
2011-03-23src: use new library libosmogsm and new path to headers in libosmocorePablo Neira Ayuso1-1/+1
libosmogsm is a new library that is distributed in the libosmocore. Now, openbsc depends on it. This patch gets openbsc with this change. This patch also rewrites all include path to the new osmocom/[gsm|core] Signed-off-by: Pablo Neira Ayuso <pablo@gnumonks.org>
2011-01-06subscr: Add a vty option to kick the queue.Holger Hans Peter Freyther1-0/+1
2011-01-06subscr: Dump the pending requests to help with debugging state.Holger Hans Peter Freyther1-0/+3
2011-01-06subscr: Make it possible to clear pending requests for a subscriberHolger Hans Peter Freyther1-0/+1
2011-01-06subscr: Show the number of pending requests on this subscriber.Holger Hans Peter Freyther1-0/+2
2011-01-06subscr: Make the subscr_put_channel work with the subscrHolger Hans Peter Freyther1-1/+1
The active channel might or might not be gone when the transaction has been released. Instead of passing an invalid subscriber conn we will pass the subscr that is ref-counted and guranteed to be valid at this point. subscr_put_channel could search the connections for an active connection if that is ever needed.
2010-12-24subscr: Add a VTY command to update the subscriber from the database.Holger Hans Peter Freyther1-0/+1
2010-12-24subscr: Introduce subscr_purge_inactive to free unused subscribersHolger Hans Peter Freyther1-0/+2
Introduce a method that will remove all subscribers that have a zero use count. This is useful if someone wants to purge subscribers from memory or wants to disable the everything in RAM feature.
2010-11-15subscr: Add method to find an active subscriberHolger Hans Peter Freyther1-0/+4
This is used by the paging code of the osmo_bsc. When we get a paging response there should be an active subscriber with the TMSI or IMSI and we can stop paging. There is no need to allocate a new subscriber.
2010-11-15subscr: Add the subscr_get_or_create from the on-waves/bsc-master branchHolger Hans Peter Freyther1-0/+2
Create a subscriber based on a known IMSI, search the list of active subscribers if there is already someone like this.
2010-11-15subscr: Move the TMSI reserved into the gsm_dataHolger Hans Peter Freyther1-4/+0
Put it into the gsm_data.h to avoid requiring MSC code in the BSC code paths.
2010-07-26gsm_subscriber: Increase the name to 160 charachtersHolger Hans Peter Freyther1-1/+1
160 charachters is the limit of the subscriber name inside the notifySS nameIndicator/callingName.
2010-06-16bsc_api: Operate on the subscriber connection for subscriber managementHolger Hans Peter Freyther1-1/+1
2010-02-20split 'libosmocore' from openbsc codebaseHarald Welte1-1/+1
This library is intended to collect all generic/common funcitionality of all Osmocom.org projects, including OpenBSC but also OsmocomBB The library currently includes the following modules: bitvec, comp128, gsm_utils, msgb, select, signal, statistics, talloc, timer, tlv_parse, linuxlist msgb allocation error debugging had to be temporarily disabled as it depends on 'debug.c' functionality which at the moment remains in OpenBSC
2009-12-24add (and use) new subscr_name() function to get name or IMSIHarald Welte1-0/+2
2009-10-26[USSD] various USSD improvementsMike Haben1-3/+4
- Improved handling of extension-number string (as per review) - Guard against a buffer-overflow if mobile sends a too-long USSD - declare some function-parameters const - fix gsm_ts_name function to display the right BTS number (bts->nr rather than bts->bts_nr)
2009-09-28[tmsi] Make the tmsi a 4 octet numberHolger Hans Peter Freyther1-3/+6
tmsi is four octets long, there is no need to make it a string and then jump through hoops to convert it to a number. Keep the database using it as a string to benefit from the NULL handling of the db. Introduce the reserved tmsi which has all bits set to 1 according to GSM 03.03 ยง2.4 and start checking for it and make sure the db code will never allocate such a tmsi.
2009-08-20[subscr] Change the signature... the gsm_network is in the subscrHolger Hans Peter Freyther1-2/+1
Remove the extra parameter from the method, the network can be taken from the subscriber.
2009-08-14add 'show subscriber cache' vty command to debug subscriber refcount leaksHarald Welte (local)1-0/+1
2009-08-12allocate an extension when creating the subscriberJan Luebbe1-0/+3
2009-08-12flag new subscriber structs in memory and send a signalJan Luebbe1-0/+5
2009-08-08first 'working' SMS implementationHarald Welte1-0/+2
we now have the full path from the MS into the database (SUBMIT), as well as back from the database to the MS (DELIVER). The database gets correctly updated once a SMS has been successfully delivered. What's still missing is the periodic scan over all undelivered messages, trying to deliver them to the respective MS. So far, you have to manually trigger this on the telnet interface with 'sms send pending 1'
2009-07-23make sure subscr->net is always setHarald Welte1-3/+6
since a subscriber is an element of the gsm_network, we have to ensure subscr->net is always set correctly. We do this by using gsm_network as an argument to all functions that resolve or create a subscriber.
2009-07-05Merge branch 'master' into smsHarald Welte1-8/+17
2009-07-05Store classmark1/2/3 in equipment SQL tableHarald Welte1-8/+17
For further evaluation/analysis, this patch stores the classmark 1, 2 and 3 values of every equipment in the SQL database. We can use this non-volatile data to determine the supported features for each handset that we've ever seen on our network.
2009-07-05further SMS workHarald Welte1-0/+1
* implement ID based lookup of gsm_subscriber from database * look-up recipient and sender subscribers from database
2009-06-10reworked MNCC codebaseHarald Welte1-0/+1
This is Harald's reworked MNCC base, slowly heading towards integration into master. The key changes are: * provide much more structure to the data in gsm_mncc * encode_* and decode_* functions now take a structure rather than tons of individual arguments (whose order nobody can remember) * make sure we don't have copies of the same code everywhere by introducing mncc_set_cause() and mncc_release_ind() * save horizontal screen space if possible * make sure we break lines > 80 characters