aboutsummaryrefslogtreecommitdiffstats
path: root/src/db_hlr.c
AgeCommit message (Collapse)AuthorFilesLines
2017-10-11cosmetic: db_hlr: SL3_TXT: clarify indentingNeels Hofmeyr1-6/+7
Before, it looked like the nul term was within the if () body (despite no body being present). While at it, also remove one of the two tabs of indenting and put the opening 'do {' on its own line. Change-Id: I8d03433b6fba90f4e46814bc54636bc3a444cc46
2017-10-10cosmetic: log IMSI='<imsi>', log "no such subscriber"Neels Hofmeyr1-1/+1
In LOGHLR and LOGAUC, log IMSI='<imsi>' instead of just <imsi>: In the log, it is not always obvious to the reader that the printed number refers to an IMSI (vs. an MSISDN or in the future an IMEI). In db_get_auth_data(), log "No such subscriber" instead of just "Unknown", to clarify what exactly is meant. Change-Id: I2ec8ab5e67d4e95083f6e39232fc91ebaa080cb8
2017-10-10cosmetic: refactor db_bind_imsi() as db_bind_text()Neels Hofmeyr1-3/+3
There are more uses for a generalized db_bind_text(), and in an upcoming patch there will be similar functions like db_bind_int(). Also, add argument param_name, optionally indicating a named SQL parameter to bind to, which will be used in subsequent patches. So far, all callers pass NULL to yield previous db_bind_imsi() behavior of binding to the first param. Change-Id: I87bc46a23a724677e8319d6a4b032976b7ba9394
2017-10-10cosmetic: rename db_subscr_get() to db_subscr_get_by_imsi()Neels Hofmeyr1-2/+2
There will be more additions, _by_msisdn() and _by_id(), to serve the upcoming VTY commands, to allow flexibly selecting subscribers as in the old OsmoNITB. Change-Id: I32fa676ccc5c10eba834c4390c8a42476b9c1961
2017-10-10cosmetic: prepend DB_STMT_ to enum stmt_idx entriesNeels Hofmeyr1-8/+8
There are upcoming additions, and some seem too general without a proper common prefix in the identifiers, like 'CREATE'. Change-Id: I51b677db31a1ebbbc45dc7925074de7493fbde1f
2017-03-20fix db_subscr_ps error handlingNeels Hofmeyr1-1/+2
Reset stmt and return right away on failure to execute. Change-Id: I27e8b46915efd678c72138e250a9cbb4c9c8ac20 Fixes: Coverity Scan CID#164747
2017-03-05Make subscr parameter to db_subscr_get() optionalMax1-5/+9
This allows to check for subscriber's presence in DB without the need to bother with unused structure allocation. While at it also call to db_remove_reset() and return explicitly instead of using goto to make it a bit easier to follow the code. Change-Id: I83b0f4a5dacb97614721690ef55bc1311624a58e
2017-02-21Add routines to update nam_psMax1-0/+26
Add SQL queries to change nam_ps value and function which uses them. Change-Id: I24fb79e084b2dfa6a81b52f448b94a86e47014ef
2017-02-20db: move duplicated code into helper functionsMax1-46/+14
* move common cleanup code into separate function * add helper function for IMSI binding * use errno.h instead of numbers Change-Id: Iec81b56ab1ccc948807854a3947b04355a555c10
2016-06-10fix PURGE_MS sqlite3 accessHarald Welte1-8/+2
2016-05-05implement PURGE-MS from VLR/SGSN to HLRHarald Welte1-0/+45
Using this procedure, the VLR/SGSN can set the cs/ps purged flag for the subscriber. We might not even need to store this persistent in the database according to spec, but let's do it anyway, at least until it turns out to be a performance issue.
2016-05-05some more comment / todo updatesHarald Welte1-0/+1
2016-05-03Major update; Code now supports SAI, LU and ISD transactionsHarald Welte1-0/+136
We also introduce a 'gsup_router' which enables us to route a transaction to a given VLR. It works based on the SERIAL attribute communicated at time of the IPA multiplex setup as part of the CCM sub-protocol.