diff options
author | Harald Welte <laforge@gnumonks.org> | 2016-12-21 11:23:36 +0100 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2016-12-21 11:23:36 +0100 |
commit | d54de7d35303428babffd779ef0e4ff9a0bb9b95 (patch) | |
tree | e4f5ce9885c7afadeb84f090a197964bc50e30be /osmo-gsup-hlr/src/db.h | |
parent | 8076c87c6b79af008511d20534edfed0eb9eb1b7 (diff) |
remove osmo-gsup-hlr, which was moving to its own osmo-hlr.git on
November 11, 2016.
Diffstat (limited to 'osmo-gsup-hlr/src/db.h')
-rw-r--r-- | osmo-gsup-hlr/src/db.h | 78 |
1 files changed, 0 insertions, 78 deletions
diff --git a/osmo-gsup-hlr/src/db.h b/osmo-gsup-hlr/src/db.h deleted file mode 100644 index d569fb0..0000000 --- a/osmo-gsup-hlr/src/db.h +++ /dev/null @@ -1,78 +0,0 @@ -#pragma once - -#include <stdbool.h> -#include <sqlite3.h> - -enum stmt_idx { - SEL_BY_IMSI = 0, - UPD_VLR_BY_ID = 1, - UPD_SGSN_BY_ID = 2, - AUC_BY_IMSI = 3, - AUC_UPD_SQN = 4, - UPD_PURGE_CS_BY_IMSI, - UPD_PURGE_PS_BY_IMSI, - _NUM_STMT -}; - -struct db_context { - char *fname; - sqlite3 *db; - sqlite3_stmt *stmt[_NUM_STMT]; -}; - -void db_close(struct db_context *dbc); -struct db_context *db_open(void *ctx, const char *fname); - -#include <osmocom/crypt/auth.h> - -/* obtain the authentication data for a given imsi */ -int db_get_auth_data(struct db_context *dbc, const char *imsi, - struct osmo_sub_auth_data *aud2g, - struct osmo_sub_auth_data *aud3g, - uint64_t *suscr_id); - -int db_update_sqn(struct db_context *dbc, uint64_t id, - uint64_t new_sqn); - -int db_get_auc(struct db_context *dbc, const char *imsi, - struct osmo_auth_vector *vec, unsigned int num_vec, - const uint8_t *rand_auts, const uint8_t *auts); - -#include <osmocom/core/linuxlist.h> -#include <osmocom/gsm/protocol/gsm_23_003.h> - -/* TODO: Get this from somewhere? */ -#define GT_MAX_DIGITS 15 - -struct hlr_subscriber { - struct llist_head list; - - uint64_t id; - char imsi[GSM23003_IMSI_MAX_DIGITS+1]; - char msisdn[GT_MAX_DIGITS+1]; - /* imeisv? */ - char vlr_number[GT_MAX_DIGITS+1]; - char sgsn_number[GT_MAX_DIGITS+1]; - char sgsn_address[GT_MAX_DIGITS+1]; - /* ggsn number + address */ - /* gmlc number */ - /* smsc number */ - uint32_t periodic_lu_timer; - uint32_t periodic_rau_tau_timer; - bool nam_cs; - bool nam_ps; - uint32_t lmsi; - bool ms_purged_cs; - bool ms_purged_ps; -}; - -int db_subscr_get(struct db_context *dbc, const char *imsi, - struct hlr_subscriber *subscr); - -int db_subscr_lu(struct db_context *dbc, - const struct hlr_subscriber *subscr, - const char *vlr_or_sgsn_number, - bool lu_is_ps); - -int db_subscr_purge(struct db_context *dbc, - const char *imsi, bool is_ps); |