open5gs/lib/base/context.h

66 lines
1.3 KiB
C
Raw Normal View History

2017-07-20 14:07:37 +00:00
#ifndef __CONTEXT_H__
#define __CONTEXT_H__
2017-07-13 01:31:07 +00:00
#include "core_debug.h"
#include "core_param.h"
2017-07-13 04:36:16 +00:00
#include "core_jsmn.h"
2017-07-13 01:31:07 +00:00
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
2017-07-14 05:09:31 +00:00
#define MAX_CONFIG_FILE_SIZE 2048
2017-07-13 04:36:16 +00:00
#define MAX_NUM_OF_CONFIG_TOKEN 256
typedef struct _config_t {
2017-07-14 11:04:11 +00:00
char *path;
char json[MAX_CONFIG_FILE_SIZE+1];
jsmntok_t token[MAX_NUM_OF_CONFIG_TOKEN];
2017-07-13 04:36:16 +00:00
} config_t;
2017-07-13 01:31:07 +00:00
#define MAX_DB_URI_LEN 256
typedef struct _context_t {
2017-07-13 04:36:16 +00:00
config_t config;
char *log_path;
2017-07-20 14:07:37 +00:00
2017-07-13 04:36:16 +00:00
char *db_uri;
2017-07-20 14:07:37 +00:00
void *db_client;
char *db_name;
void *database;
2017-07-31 13:35:25 +00:00
struct {
int s1ap;
int nas;
int gtp;
int fd;
int others;
2017-07-31 13:35:25 +00:00
} trace_level;
struct {
int disable_hss;
int disable_sgw;
int disable_pgw;
2017-08-17 05:15:08 +00:00
int disable_pcrf;
} hidden;
2017-07-13 01:31:07 +00:00
} context_t;
CORE_DECLARE(status_t) context_init(void);
CORE_DECLARE(status_t) context_final(void);
CORE_DECLARE(context_t*) context_self(void);
2017-07-13 04:36:16 +00:00
CORE_DECLARE(status_t) context_read_file(char *file_path);
CORE_DECLARE(status_t) context_parse_config(void);
2017-07-31 13:35:25 +00:00
CORE_DECLARE(status_t) context_setup_trace_module(void);
2017-07-13 04:36:16 +00:00
2017-07-20 14:07:37 +00:00
CORE_DECLARE(status_t) context_db_init(char *db_uri);
CORE_DECLARE(status_t) context_db_final(void);
2017-07-13 01:31:07 +00:00
#ifdef __cplusplus
}
#endif /* __cplusplus */
2017-07-20 14:07:37 +00:00
#endif /* __CONTEXT_H__ */