|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef HSS_CONTEXT_H |
|
|
#define HSS_CONTEXT_H |
|
|
|
|
|
#include "ogs-diameter-s6a.h" |
|
|
#include "ogs-diameter-cx.h" |
|
|
#include "ogs-diameter-swx.h" |
|
|
#include "ogs-dbi.h" |
|
|
#include "ogs-app.h" |
|
|
#include "metrics.h" |
|
|
|
|
|
#ifdef __cplusplus |
|
|
extern "C" { |
|
|
#endif |
|
|
|
|
|
extern int __hss_log_domain; |
|
|
|
|
|
#undef OGS_LOG_DOMAIN |
|
|
#define OGS_LOG_DOMAIN __hss_log_domain |
|
|
|
|
|
typedef struct _hss_context_t { |
|
|
const char *diam_conf_path; |
|
|
ogs_diam_config_t *diam_config; |
|
|
const char *sms_over_ims; |
|
|
int use_mongodb_change_stream; |
|
|
|
|
|
ogs_thread_mutex_t db_lock; |
|
|
ogs_thread_mutex_t cx_lock; |
|
|
|
|
|
|
|
|
ogs_list_t imsi_list; |
|
|
ogs_hash_t *imsi_hash; |
|
|
|
|
|
|
|
|
ogs_list_t impi_list; |
|
|
ogs_hash_t *impi_hash; |
|
|
ogs_hash_t *impu_hash; |
|
|
} hss_context_t; |
|
|
|
|
|
void hss_context_init(void); |
|
|
void hss_context_final(void); |
|
|
hss_context_t *hss_self(void); |
|
|
|
|
|
int hss_context_parse_config(void); |
|
|
|
|
|
int hss_db_auth_info(char *imsi_bcd, ogs_dbi_auth_info_t *auth_info); |
|
|
int hss_db_update_sqn(char *imsi_bcd, uint8_t *rand, uint64_t sqn); |
|
|
int hss_db_increment_sqn(char *imsi_bcd); |
|
|
int hss_db_update_imeisv(char *imsi_bcd, char *imeisv); |
|
|
int hss_db_update_mme(char *imsi_bcd, char *mme_host, char *mme_realm, |
|
|
bool purge_flag); |
|
|
|
|
|
int hss_db_subscription_data( |
|
|
char *imsi_bcd, ogs_subscription_data_t *subscription_data); |
|
|
|
|
|
int hss_db_msisdn_data( |
|
|
char *imsi_or_msisdn_bcd, ogs_msisdn_data_t *msisdn_data); |
|
|
|
|
|
int hss_db_ims_data(char *imsi_bcd, ogs_ims_data_t *ims_data); |
|
|
|
|
|
void hss_cx_associate_identity(char *user_name, char *public_identity); |
|
|
bool hss_cx_identity_is_associated(char *user_name, char *public_identity); |
|
|
|
|
|
void hss_cx_set_imsi_bcd(char *user_name, |
|
|
char *imsi_bcd, char *visited_network_identifier); |
|
|
|
|
|
char *hss_cx_get_imsi_bcd(char *public_identity); |
|
|
char *hss_cx_get_visited_network_identifier(char *public_identity); |
|
|
char *hss_cx_get_user_name(char *public_identity); |
|
|
|
|
|
char *hss_cx_get_server_name(char *public_identity); |
|
|
void hss_cx_set_server_name( |
|
|
char *public_identity, char *server_name, bool overwrite); |
|
|
|
|
|
char *hss_cx_download_user_data( |
|
|
char *user_name, char *visited_network_identifier, |
|
|
ogs_ims_data_t *ims_data); |
|
|
|
|
|
int hss_db_poll_change_stream(void); |
|
|
int hss_handle_change_event(const bson_t *document); |
|
|
|
|
|
|
|
|
#ifdef __cplusplus |
|
|
} |
|
|
#endif |
|
|
|
|
|
#endif |
|
|
|