2017-08-17 05:15:08 +00:00
|
|
|
#define TRACE_MODULE _pcrf_init
|
|
|
|
|
|
|
|
#include "pcrf_context.h"
|
2017-08-22 15:51:57 +00:00
|
|
|
#include "pcrf_fd_path.h"
|
2017-08-17 05:15:08 +00:00
|
|
|
|
|
|
|
static int initialized = 0;
|
|
|
|
|
|
|
|
status_t pcrf_initialize(void)
|
|
|
|
{
|
|
|
|
status_t rv;
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
rv = pcrf_context_init();
|
|
|
|
if (rv != CORE_OK) return rv;
|
|
|
|
|
|
|
|
rv = pcrf_context_parse_config();
|
|
|
|
if (rv != CORE_OK) return rv;
|
|
|
|
|
|
|
|
rv = pcrf_context_setup_trace_module();
|
|
|
|
if (rv != CORE_OK) return rv;
|
|
|
|
|
|
|
|
rv = pcrf_db_init();
|
|
|
|
if (rv != CORE_OK) return rv;
|
|
|
|
|
2017-08-22 15:51:57 +00:00
|
|
|
ret = pcrf_fd_init();
|
2017-08-17 05:15:08 +00:00
|
|
|
if (ret != CORE_OK) return CORE_ERROR;
|
|
|
|
|
|
|
|
initialized = 1;
|
|
|
|
|
|
|
|
return CORE_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
void pcrf_terminate(void)
|
|
|
|
{
|
|
|
|
if (!initialized) return;
|
|
|
|
|
2017-08-22 15:51:57 +00:00
|
|
|
pcrf_fd_final();
|
2017-08-17 05:15:08 +00:00
|
|
|
|
|
|
|
pcrf_db_final();
|
|
|
|
pcrf_context_final();
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|