aboutsummaryrefslogtreecommitdiffstats
path: root/include/osmocom/msc
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2022-05-14 15:35:49 +0200
committerHarald Welte <laforge@osmocom.org>2022-05-17 14:04:44 +0200
commitd43c22ef65ae645a8babb2907fd8de2be42383a6 (patch)
tree4306db0c7ca15164434e553a58c39924b182b8f1 /include/osmocom/msc
parentd677f51187cf7c58026888a2d314821eba0202cf (diff)
switch from libdbi to lbsqlite3
The choice of libdbi was one of the biggest early mistakes in (back then) OpenBSC development. A database abstraction library that prevents you from using proper prepared statements. Let's finally abandon it and use sqlite3 directly, just like we do in osmo-hlr. I decided to remove the database migration code as it would be relatively cumbersome to port all of it to direct sqlite3 with prepared statements, and it is prone to introduction of all kinds of errors. Since we don't have a body of older database files and comprehensive migration tests, it is safer to not offer migration code of uncertain quality. The last schema revision (5) was introduced 5 years ago in 2017 (osmo-msc v1.1.0), so it is considered an exceptionally rare case. People can install osmo-msc 1.1.0 through 1.8.0 to upgrade to v5 before using this new 'direct sqlite3' version of osmo-msc. Change-Id: Ia334904289f92d014e7bd16b02b3b5817c12c790 Related: OS#5559, OS#5563, OS#5564
Diffstat (limited to 'include/osmocom/msc')
-rw-r--r--include/osmocom/msc/db.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/include/osmocom/msc/db.h b/include/osmocom/msc/db.h
index d9463a684..fc1781bd6 100644
--- a/include/osmocom/msc/db.h
+++ b/include/osmocom/msc/db.h
@@ -1,5 +1,6 @@
/* (C) 2008 by Jan Luebbe <jluebbe@debian.org>
* (C) 2009 by Holger Hans Peter Freyther <zecke@selfish.org>
+ * (C) 2022 by Harald Welte <laforge@osmocom.org>
* All Rights Reserved
*
* This program is free software; you can redistribute it and/or modify
@@ -30,7 +31,7 @@ struct gsm_network;
struct gsm_sms;
/* one time initialisation */
-int db_init(const char *name);
+int db_init(void *ctx, const char *fname, bool enable_sqlite_logging);
int db_prepare(void);
int db_fini(void);
@@ -39,12 +40,12 @@ int db_sms_store(struct gsm_sms *sms);
struct gsm_sms *db_sms_get(struct gsm_network *net, unsigned long long id);
struct gsm_sms *db_sms_get_next_unsent(struct gsm_network *net,
unsigned long long min_sms_id,
- unsigned int max_failed);
+ int max_failed);
struct gsm_sms *db_sms_get_next_unsent_rr_msisdn(struct gsm_network *net,
const char *last_msisdn,
- unsigned int max_failed);
+ int max_failed);
struct gsm_sms *db_sms_get_unsent_for_subscr(struct vlr_subscr *vsub,
- unsigned int max_failed);
+ int max_failed);
int db_sms_mark_delivered(struct gsm_sms *sms);
int db_sms_inc_deliver_attempts(struct gsm_sms *sms);
int db_sms_delete_by_msisdn(const char *msisdn);