2019-06-07 02:56:37 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2019 by Sukchan Lee <acetcom@gmail.com>
|
|
|
|
*
|
|
|
|
* This file is part of Open5GS.
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Affero General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef APP_CONTEXT_H
|
|
|
|
#define APP_CONTEXT_H
|
2019-04-27 14:54:30 +00:00
|
|
|
|
|
|
|
#include "ogs-core.h"
|
|
|
|
#include "ogs-yaml.h"
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif /* __cplusplus */
|
|
|
|
|
|
|
|
typedef struct _config_t {
|
2019-08-25 11:15:20 +00:00
|
|
|
const char *file;
|
2019-04-27 14:54:30 +00:00
|
|
|
void *document;
|
|
|
|
|
|
|
|
const char *db_uri;
|
|
|
|
struct {
|
|
|
|
const char *file;
|
|
|
|
const char *level;
|
|
|
|
const char *domain;
|
|
|
|
} logger;
|
|
|
|
|
|
|
|
struct {
|
|
|
|
/* Element */
|
|
|
|
int no_hss;
|
|
|
|
int no_sgw;
|
|
|
|
int no_pgw;
|
|
|
|
int no_pcrf;
|
|
|
|
|
|
|
|
/* Network */
|
|
|
|
int no_ipv4;
|
|
|
|
int no_ipv6;
|
|
|
|
int prefer_ipv4;
|
|
|
|
int multicast;
|
|
|
|
int no_slaac;
|
|
|
|
} parameter;
|
|
|
|
|
2019-05-31 07:33:09 +00:00
|
|
|
ogs_sockopt_t sockopt;
|
2019-06-01 12:30:13 +00:00
|
|
|
struct {
|
|
|
|
int udp_port;
|
|
|
|
} usrsctp;
|
2019-05-31 07:33:09 +00:00
|
|
|
|
2019-06-07 02:56:37 +00:00
|
|
|
struct {
|
2019-06-07 06:19:09 +00:00
|
|
|
int sgw;
|
|
|
|
int pgw;
|
|
|
|
int vlr;
|
2019-07-21 11:06:08 +00:00
|
|
|
int csmap;
|
2019-06-07 02:56:37 +00:00
|
|
|
int enb;
|
|
|
|
int ue;
|
|
|
|
} max;
|
2019-04-27 14:54:30 +00:00
|
|
|
|
2019-08-09 14:28:58 +00:00
|
|
|
struct {
|
|
|
|
ogs_pkbuf_config_t defconfig;
|
|
|
|
int packet;
|
|
|
|
} pool;
|
2019-06-07 02:56:37 +00:00
|
|
|
} config_t;
|
2019-04-27 14:54:30 +00:00
|
|
|
|
|
|
|
typedef struct _context_t {
|
|
|
|
config_t config;
|
|
|
|
|
|
|
|
struct {
|
2019-05-03 12:41:57 +00:00
|
|
|
bool initialized;
|
2019-04-27 14:54:30 +00:00
|
|
|
const char *name;
|
|
|
|
void *uri;
|
|
|
|
void *client;
|
|
|
|
void *database;
|
|
|
|
} db;
|
|
|
|
|
2019-06-07 02:56:37 +00:00
|
|
|
struct {
|
|
|
|
int ue;
|
|
|
|
int sess;
|
|
|
|
int bearer;
|
|
|
|
int tunnel;
|
|
|
|
int pf;
|
|
|
|
} pool;
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
} context_t;
|
|
|
|
|
|
|
|
int context_init(void);
|
|
|
|
int context_final(void);
|
|
|
|
context_t *context_self(void);
|
|
|
|
|
|
|
|
int context_read_file(void);
|
|
|
|
int context_parse_config(void);
|
|
|
|
|
|
|
|
int context_db_init(const char *db_uri);
|
|
|
|
int context_db_final(void);
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif /* __cplusplus */
|
|
|
|
|
2019-06-07 02:56:37 +00:00
|
|
|
#endif /* APP_CONTEXT_H */
|