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/>.
|
|
|
|
*/
|
|
|
|
|
2019-09-13 12:07:47 +00:00
|
|
|
#if !defined(OGS_APP_INSIDE) && !defined(OGS_APP_COMPILATION)
|
|
|
|
#error "This header cannot be included directly."
|
|
|
|
#endif
|
2019-04-27 14:54:30 +00:00
|
|
|
|
2020-08-26 03:05:01 +00:00
|
|
|
#ifndef OGS_APP_CONTEXT_H
|
|
|
|
#define OGS_APP_CONTEXT_H
|
2019-09-13 12:07:47 +00:00
|
|
|
|
|
|
|
#include "ogs-app.h"
|
2019-04-27 14:54:30 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
2019-09-13 12:07:47 +00:00
|
|
|
#endif
|
2019-04-27 14:54:30 +00:00
|
|
|
|
2020-08-26 03:05:01 +00:00
|
|
|
typedef struct ogs_app_context_s {
|
2020-11-27 02:44:37 +00:00
|
|
|
const char *version;
|
|
|
|
|
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;
|
|
|
|
|
2020-08-26 03:05:01 +00:00
|
|
|
ogs_queue_t *queue;
|
|
|
|
ogs_timer_mgr_t *timer_mgr;
|
|
|
|
ogs_pollset_t *pollset;
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
struct {
|
|
|
|
/* Element */
|
2020-08-13 00:31:22 +00:00
|
|
|
int no_mme;
|
2019-04-27 14:54:30 +00:00
|
|
|
int no_hss;
|
|
|
|
int no_sgw;
|
2020-08-13 00:31:22 +00:00
|
|
|
int no_sgwc;
|
|
|
|
int no_sgwu;
|
2019-04-27 14:54:30 +00:00
|
|
|
int no_pgw;
|
|
|
|
int no_pcrf;
|
|
|
|
|
2020-05-25 16:15:22 +00:00
|
|
|
int no_amf;
|
|
|
|
int no_smf;
|
|
|
|
int no_upf;
|
2020-06-04 18:12:05 +00:00
|
|
|
int no_ausf;
|
|
|
|
int no_udm;
|
2020-12-11 19:03:20 +00:00
|
|
|
int no_pcf;
|
2021-03-08 12:25:09 +00:00
|
|
|
int no_nssf;
|
2020-06-04 18:12:05 +00:00
|
|
|
int no_udr;
|
2020-05-25 16:15:22 +00:00
|
|
|
int no_nrf;
|
|
|
|
|
2019-04-27 14:54:30 +00:00
|
|
|
/* Network */
|
|
|
|
int no_ipv4;
|
|
|
|
int no_ipv6;
|
|
|
|
int prefer_ipv4;
|
|
|
|
int multicast;
|
2020-11-10 15:04:09 +00:00
|
|
|
|
|
|
|
int use_openair;
|
2021-01-11 13:03:52 +00:00
|
|
|
int no_ipv4v6_local_addr_in_packet_filter;
|
2021-03-26 14:12:43 +00:00
|
|
|
int ignore_requested_nssai;
|
2019-04-27 14:54:30 +00:00
|
|
|
} 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 {
|
2020-08-26 03:05:01 +00:00
|
|
|
uint64_t ue;
|
|
|
|
uint64_t gnb;
|
2019-06-07 02:56:37 +00:00
|
|
|
} max;
|
2019-04-27 14:54:30 +00:00
|
|
|
|
2019-08-09 14:28:58 +00:00
|
|
|
struct {
|
|
|
|
ogs_pkbuf_config_t defconfig;
|
2020-08-26 03:05:01 +00:00
|
|
|
uint64_t packet;
|
|
|
|
|
|
|
|
uint64_t nf;
|
|
|
|
|
|
|
|
uint64_t sess;
|
|
|
|
uint64_t bearer;
|
|
|
|
uint64_t tunnel;
|
|
|
|
uint64_t nf_service;
|
|
|
|
uint64_t nf_subscription;
|
|
|
|
uint64_t sbi_message;
|
|
|
|
|
|
|
|
uint64_t csmap;
|
|
|
|
|
|
|
|
uint64_t event;
|
|
|
|
uint64_t timer;
|
|
|
|
uint64_t socket;
|
|
|
|
uint64_t gtp_xact;
|
|
|
|
uint64_t gtp_node;
|
|
|
|
uint64_t pfcp_xact;
|
|
|
|
uint64_t pfcp_node;
|
2019-06-07 02:56:37 +00:00
|
|
|
} pool;
|
2020-05-18 21:00:37 +00:00
|
|
|
|
|
|
|
struct {
|
|
|
|
struct {
|
2020-07-27 01:02:40 +00:00
|
|
|
int heartbeat_interval;
|
|
|
|
int no_heartbeat_margin;
|
|
|
|
int validity_duration;
|
2020-05-18 21:00:37 +00:00
|
|
|
} nf_instance;
|
|
|
|
struct {
|
2020-07-27 01:02:40 +00:00
|
|
|
int validity_duration;
|
2020-05-18 21:00:37 +00:00
|
|
|
} subscription;
|
2020-07-27 01:02:40 +00:00
|
|
|
|
|
|
|
struct {
|
|
|
|
ogs_time_t duration;
|
|
|
|
struct {
|
|
|
|
ogs_time_t client_wait_duration;
|
2020-07-27 04:20:01 +00:00
|
|
|
ogs_time_t connection_deadline;
|
2020-07-27 01:02:40 +00:00
|
|
|
ogs_time_t nf_register_interval;
|
|
|
|
ogs_time_t nf_register_interval_in_exception;
|
|
|
|
} sbi;
|
|
|
|
|
|
|
|
struct {
|
|
|
|
ogs_time_t t3_response_duration;
|
|
|
|
int n3_response_rcount;
|
|
|
|
ogs_time_t t3_holding_duration;
|
|
|
|
int n3_holding_rcount;
|
|
|
|
} gtp;
|
|
|
|
|
|
|
|
struct {
|
|
|
|
ogs_time_t t1_response_duration;
|
|
|
|
int n1_response_rcount;
|
|
|
|
ogs_time_t t1_holding_duration;
|
|
|
|
int n1_holding_rcount;
|
|
|
|
ogs_time_t association_interval;
|
|
|
|
ogs_time_t no_heartbeat_duration;
|
|
|
|
} pfcp;
|
|
|
|
} message;
|
2021-02-01 04:01:15 +00:00
|
|
|
|
|
|
|
struct {
|
|
|
|
ogs_time_t duration;
|
|
|
|
ogs_time_t complete_delay;
|
|
|
|
} handover;
|
|
|
|
|
2020-05-18 21:00:37 +00:00
|
|
|
} time;
|
2020-08-26 03:05:01 +00:00
|
|
|
} ogs_app_context_t;
|
2019-06-07 02:56:37 +00:00
|
|
|
|
2020-08-26 03:05:01 +00:00
|
|
|
int ogs_app_context_init(void);
|
|
|
|
void ogs_app_context_final(void);
|
|
|
|
ogs_app_context_t *ogs_app(void);
|
2019-04-27 14:54:30 +00:00
|
|
|
|
2020-08-26 03:05:01 +00:00
|
|
|
int ogs_app_context_parse_config(void);
|
2019-04-27 14:54:30 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
2019-09-13 12:07:47 +00:00
|
|
|
#endif
|
2019-04-27 14:54:30 +00:00
|
|
|
|
2020-08-26 03:05:01 +00:00
|
|
|
#endif /* OGS_APP_CONTEXT_H */
|