2017-08-17 05:15:08 +00:00
|
|
|
#ifndef __PCRF_CONTEXT_H__
|
|
|
|
#define __PCRF_CONTEXT_H__
|
|
|
|
|
2018-01-04 11:38:22 +00:00
|
|
|
#include "fd/gx/gx_message.h"
|
2017-08-17 05:15:08 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif /* __cplusplus */
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
extern int __pcrf_log_domain;
|
|
|
|
|
|
|
|
#undef OGS_LOG_DOMAIN
|
|
|
|
#define OGS_LOG_DOMAIN __pcrf_log_domain
|
|
|
|
|
2018-01-05 07:25:02 +00:00
|
|
|
typedef struct _fd_config_t fd_config_t;
|
2018-01-09 13:53:09 +00:00
|
|
|
struct session;
|
|
|
|
|
2017-08-17 05:15:08 +00:00
|
|
|
typedef struct _pcrf_context_t {
|
2018-01-05 07:25:02 +00:00
|
|
|
const char *fd_conf_path; /* PCRF freeDiameter conf path */
|
|
|
|
fd_config_t *fd_config; /* PCRF freeDiameter config */
|
2017-08-17 05:15:08 +00:00
|
|
|
|
2018-01-05 07:25:02 +00:00
|
|
|
void *subscriberCollection;
|
2019-04-27 14:54:30 +00:00
|
|
|
ogs_thread_mutex_t db_lock;
|
2018-01-08 09:34:51 +00:00
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
ogs_hash_t *ip_hash; /* hash table for Gx Frame IPv4/IPv6 */
|
|
|
|
ogs_thread_mutex_t hash_lock;
|
2017-08-17 05:15:08 +00:00
|
|
|
} pcrf_context_t;
|
|
|
|
|
2019-05-06 11:43:50 +00:00
|
|
|
void pcrf_context_init(void);
|
|
|
|
void pcrf_context_final(void);
|
2019-04-27 14:54:30 +00:00
|
|
|
pcrf_context_t *pcrf_self(void);
|
2017-08-17 05:15:08 +00:00
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
int pcrf_context_parse_config(void);
|
2017-08-17 05:15:08 +00:00
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
int pcrf_db_init(void);
|
|
|
|
int pcrf_db_final(void);
|
2017-08-17 05:15:08 +00:00
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
int pcrf_db_qos_data(char *imsi_bcd, char *apn, gx_message_t *gx_message);
|
2017-08-24 08:05:10 +00:00
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
int pcrf_sess_set_ipv4(const void *key, uint8_t *sid);
|
|
|
|
int pcrf_sess_set_ipv6(const void *key, uint8_t *sid);
|
|
|
|
uint8_t *pcrf_sess_find_by_ipv4(const void *key);
|
|
|
|
uint8_t *pcrf_sess_find_by_ipv6(const void *key);
|
2018-01-08 13:42:44 +00:00
|
|
|
|
2017-08-17 05:15:08 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif /* __cplusplus */
|
|
|
|
|
|
|
|
#endif /* __PCRF_CONTEXT_H__ */
|