aboutsummaryrefslogtreecommitdiffstats
path: root/src/db.c
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2017-10-09 17:55:16 +0200
committerNeels Hofmeyr <neels@hofmeyr.de>2017-10-11 22:28:09 +0200
commitf7c3e6e3a29f67398fdb8790629d0e951a494bc1 (patch)
tree40fa2027ecf16febeb764d4787917d6865745035 /src/db.c
parent28da26ec191b176028c6bad6a43749a8c8926cb2 (diff)
add db_subscr_create(), db_subscr_delete(), db_subscr_update_msisdn_by_imsi()
These will be needed by VTY commands to create, delete and modify subscribers. Auth data editing will follow in another patch. The FIXME "also remove authentication data from auc_2g and auc_3g" will get fixed in change-id Icb11b5e059fb920447a9aa414db1819a0c020529. Change-Id: I725273d36234331093e7fff7d5f12f6be6ab2623
Diffstat (limited to 'src/db.c')
-rw-r--r--src/db.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/db.c b/src/db.c
index 463eeb4..7c25e63 100644
--- a/src/db.c
+++ b/src/db.c
@@ -41,6 +41,9 @@ static const char *stmt_sql[] = {
[DB_STMT_UPD_PURGE_PS_BY_IMSI] = "UPDATE subscriber SET ms_purged_ps=1 WHERE imsi = ?",
[DB_STMT_SET_NAM_PS_BY_IMSI] = "UPDATE subscriber SET nam_ps=1 WHERE imsi = ?",
[DB_STMT_UNSET_NAM_PS_BY_IMSI] = "UPDATE subscriber SET nam_ps=0 WHERE imsi = ?",
+ [DB_STMT_SUBSCR_CREATE] = "INSERT INTO subscriber (imsi) VALUES ($imsi)",
+ [DB_STMT_DEL_BY_ID] = "DELETE FROM subscriber WHERE id = $subscriber_id",
+ [DB_STMT_SET_MSISDN_BY_IMSI] = "UPDATE subscriber SET msisdn = $msisdn WHERE imsi = $imsi",
};
static void sql3_error_log_cb(void *arg, int err_code, const char *msg)