aboutsummaryrefslogtreecommitdiffstats
path: root/src/db_hlr.c
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2017-10-24 23:26:53 +0200
committerHarald Welte <laforge@gnumonks.org>2017-10-28 20:34:01 +0200
commit73d14af2789c95270a2bc3b5a3b8890be42ca28f (patch)
tree943965fb75e53c78b7e5cbcc7ccef67b6501f7c4 /src/db_hlr.c
parent6eb231eccc38c0d90ab09e9456212d28d6c5d5e6 (diff)
add osmo-hlr-db-tool, program to migrate from osmo-nitb db
Move macro copy_sqlite3_text_to_buf() to db.h, so it can be used in hlr_db_tool.c. Add _dbd_decode_binary() from libdbi to avoid depending on the entire libdbi just for KI BLOB decoding. Add it in a separate file, copying its own license, the lGPL. Offer commandline option "import-nitb-db" to read in an old osmo-nitb database and copy subscriber IMSIs and 2G auth data to OsmoHLR db format. Anticipate future command line options like "import-csv", so keep the code generalized. Change-Id: I0dfa6ec033dd93161c1adc2ce1637195fe5b7a63
Diffstat (limited to 'src/db_hlr.c')
-rw-r--r--src/db_hlr.c11
1 files changed, 0 insertions, 11 deletions
diff --git a/src/db_hlr.c b/src/db_hlr.c
index bae9a5a..c4d4974 100644
--- a/src/db_hlr.c
+++ b/src/db_hlr.c
@@ -35,17 +35,6 @@
#define LOGHLR(imsi, level, fmt, args ...) LOGP(DAUC, level, "IMSI='%s': " fmt, imsi, ## args)
-/*! Call sqlite3_column_text() and copy result to a char[].
- * \param[out] buf A char[] used as sizeof() arg(!) and osmo_strlcpy() target.
- * \param[in] stmt An sqlite3_stmt*.
- * \param[in] idx Index in stmt's returned columns.
- */
-#define copy_sqlite3_text_to_buf(buf, stmt, idx) \
- do { \
- const char *_txt = (const char *) sqlite3_column_text(stmt, idx); \
- osmo_strlcpy(buf, _txt, sizeof(buf)); \
- } while (0)
-
/*! Add new subscriber record to the HLR database.
* \param[in,out] dbc database context.
* \param[in] imsi ASCII string of IMSI digits, is validated.