aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/include/openbsc/db.h
AgeCommit message (Collapse)AuthorFilesLines
2017-08-27move openbsc/* to repos rootNeels Hofmeyr1-86/+0
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
2016-07-09Make random MSISDN assignment optionalMax1-1/+3
Previously if subscriber was automatically created it got assigned random MSISDN number. Make it optional (defaulting to previous behavior) by adding following: * new optional no-extension argument for subscriber-create-on-demand vty command * db unit tests * vty test Note: using the db made with new code might result in subscribers with empty extension. Such subscribers cannot be deleted using old code. Make sure not to mix db versions or manually fix it by editing sqlite with external program. Fixes: OS#1658 Change-Id: Ibbc2e88e4722b08854ebc631485f19ed56443cbb
2016-06-14Make random extension range configurableMax1-2/+4
Previously if subscriber was automatically created it got assigned random MSISDN number between 20000 and 49999. Make it configurable with new vty command "subscriber-create-on-demand random" and expand vty tests to check it. Change-Id: I040a1d227b0c7a1601dc7c33eccb0007941408a6 Related: OS#1658
2014-03-23nitb/ctrl: Implement a command to list all active subscribersHolger Hans Peter Freyther1-0/+1
This is only useful for small networks. List the IMSI and MSISDN of all active subscribers. Fixes: SYS#266
2014-03-23nitb/ctrl: Implement creating and deleting subscribersHolger Hans Peter Freyther1-0/+1
Sadly there is no proper foreign key relationship on the tables that related to the Subscriber. This means we can't use a DELETE with Cascade and need to delete everything by hand. To make things worse maybe the SMS/Paging code is still using the subscriber making the operation more dangerous. I had added NULL checks for sender_id/receiver_id at 30C3 so we should not crash in this situation. Fixes: SYS#274
2014-03-09db,sms: Rename db_sms_mark_sent() to db_sms_mark_delivered()Alexander Chemeris1-1/+1
In MT-SMS the message is being delivered. Make the naming follow that. The schema still refers to "sent" while it should be "delivered" too.
2013-10-13db: Remove the struct gsm_network from the database layerHolger Hans Peter Freyther1-4/+2
The database code should not know about the network. Move the setting of the network pointer into the subscriber layer.
2013-01-01libmsc: Track and update the location update expiryJan Luebbe1-0/+1
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-07-16db: use ANSI (void) function declarationsHarald Welte1-2/+2
2011-05-06src: use namespace prefix osmo_counter*Pablo Neira Ayuso1-2/+2
Summary of changes: s/struct counter/struct osmo_counter/g s/counter_inc/osmo_counter_inc/g s/counter_get/osmo_counter_get/g s/counter_reset/osmo_counter_reset/g s/counter_alloc/osmo_counter_alloc/g s/counter_free/osmo_counter_free
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-3/+3
This was done with sed on the files.
2011-04-12db: The forward declaration of the enum does not work with C++Holger Hans Peter Freyther1-2/+1
We need to include this directly to help LCR in building.
2011-01-01License change: We are now AGPLv3+ instead of GPLv2+Harald Welte1-6/+5
The reason for this is quite simple: We want to make sure anyone running a customized version of OpenBSC to operate a network will have to release all custom modifiations to the source code.
2010-12-25db: Introduce a limit in delivery attempts for the SMS searchHolger Hans Peter Freyther1-1/+1
We do not want to attempt submitting SMS that has failed for too many times. The failure could be due RF failure or due a bug in the message handling.
2010-12-25db: Add method to load a SMS by id.Holger Hans Peter Freyther1-0/+1
2010-12-24subscr: Add a VTY command to update the subscriber from the database.Holger Hans Peter Freyther1-0/+1
2010-12-22misc: Remove gsm_subscriber.h from the db.h fileHolger Hans Peter Freyther1-1/+8
Reduce the dependencies on the header files.
2010-10-06db.h: Move the '*' to the other side for the gsm_subscriberHolger Hans Peter Freyther1-7/+7
2010-09-17db: Declare db_sms_inc_deliver_attempts.Holger Hans Peter Freyther1-0/+1
2010-06-14db: Change naming convention for auth info functionsSylvain Munaut1-7/+7
- exported function have a 'db_' prefix - use 'sync' vs 'set' - use 'for' vs 'by' Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-06-14db: Rename AuthTuples to AuthLastTuplesSylvain Munaut1-4/+4
Ultimately, we'll need to store both the last used tuple by a subscriber and a list of known tuples (for unknown Ki). What's currently implemented for AuthTuples is the former behavior, so reflect that. The second use case will be added as a separate table with separate accessors later on. Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-05-13[GPRS] NS: Start to use rate_ctr_group code from libosmocoreHarald Welte1-0/+3
Every NS-VC now has a set of counters for incoming and outgoing number of packets and bytes. We also split the VTY part of the gprs_ns.c implementation into gprs_ns_vty.c to make sure the protocol can actually be used without the VTY code being present.
2010-03-25db: Fix a bug where no pending SMS were foundHolger Hans Peter Freyther1-2/+2
The "sms send pending" VTY command did not work due a mismatch of types. We are specifying a unsigned long long in the query and provided DBI with a signed integer type. The result was a failure do find any information. Change the API to operate on unsigned long long that is matching the id of the SMS and the Subscriber and the mismatch with the query string is gone and pending SMS are sent.
2010-01-03db: Add methods to set auth{info,tuple} for a subscriberSylvain Munaut1-0/+4
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2010-01-03db: Add declaration for get_auth{info,tuple_for_subscriberSylvain Munaut1-0/+6
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2009-12-24db: Fix compile warning, declare db_sms_get_unsent_by_subscrSylvain Munaut1-0/+1
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2009-12-22statistics: Introduce 'struct counter' instead of using unsigned longHarald Welte1-0/+4
This has the advantage that counters can be added all over the code very easily, while having only one routine that stores all of the current counter values to the database. The counters are synced every 60 seconds, providing relatively fine grained statistics about the network usage as time passes by.
2009-08-16store all APDU's received from the MS in the databaseHarald Welte (local)1-0/+5
This helps us to analyze data such as RRLP location information for later analysis.
2009-08-12fix problems with tmsi uniqueness in the subscriber tableJan Luebbe1-0/+1
2009-08-12token support in the DBJan Luebbe1-0/+1
2009-08-10misc: Add prototypes to header files, include more header filesHolger Hans Peter Freyther1-0/+1
Fix various warnings about implicit declarations of functions.
2009-08-09new db_sms_get_unsent_for_subscr() functionHarald Welte1-0/+1
The function retrieves the oldest not-yet-sent SM for the given subscriber
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-06-10move openbsc into its own subdirectoryHarald Welte1-0/+44