open5gs/src/pcrf/pcrf-context.h

69 lines
1.9 KiB
C
Raw Normal View History

2019-07-11 13:22:22 +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 PCRF_CONTEXT_H
#define PCRF_CONTEXT_H
2017-08-17 05:15:08 +00:00
#include "ogs-diameter-gx.h"
#include "ogs-diameter-rx.h"
2021-01-01 02:07:08 +00:00
#include "ogs-dbi.h"
2019-09-13 12:07:47 +00:00
#include "ogs-app.h"
2017-08-17 05:15:08 +00:00
#ifdef __cplusplus
extern "C" {
2019-07-11 13:22:22 +00:00
#endif
2017-08-17 05:15:08 +00:00
2019-04-27 14:54:30 +00:00
extern int __pcrf_log_domain;
#undef OGS_LOG_DOMAIN
#define OGS_LOG_DOMAIN __pcrf_log_domain
2019-05-28 05:47:06 +00:00
typedef struct fd_config_s fd_config_t;
2018-01-09 13:53:09 +00:00
struct session;
2019-05-28 05:47:06 +00:00
typedef struct pcrf_context_s {
2019-09-13 12:07:47 +00:00
const char *diam_conf_path; /* PCRF Diameter conf path */
ogs_diam_config_t *diam_config; /* PCRF Diameter config */
2017-08-17 05:15:08 +00:00
2021-04-05 08:09:39 +00:00
ogs_thread_mutex_t db_lock;
2021-04-05 08:09:39 +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-09-13 12:07:47 +00:00
int pcrf_db_qos_data(char *imsi_bcd, char *apn,
int32_t charging_char, ogs_session_data_t *session_data);
2017-08-24 08:05:10 +00:00
2021-04-05 08:09:39 +00:00
void pcrf_sess_set_ipv4(const void *key, uint8_t *sid);
void pcrf_sess_set_ipv6(const void *key, uint8_t *sid);
2019-04-27 14:54:30 +00:00
uint8_t *pcrf_sess_find_by_ipv4(const void *key);
uint8_t *pcrf_sess_find_by_ipv6(const void *key);
2017-08-17 05:15:08 +00:00
#ifdef __cplusplus
}
2019-07-11 13:22:22 +00:00
#endif
2017-08-17 05:15:08 +00:00
2019-07-11 13:22:22 +00:00
#endif /* PCRF_CONTEXT_H */