open5gs/src/smf/fd-path.c

59 lines
1.5 KiB
C
Raw Normal View History

2020-04-26 19:36:05 +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/>.
*/
#include "fd-path.h"
int smf_fd_init(void)
{
2021-06-21 13:36:38 +00:00
int rv;
2020-04-26 19:36:05 +00:00
2020-08-27 01:03:15 +00:00
if (smf_self()->diam_conf_path == NULL &&
(smf_self()->diam_config->cnf_diamid == NULL ||
smf_self()->diam_config->cnf_diamrlm == NULL ||
smf_self()->diam_config->cnf_addr == NULL)) {
ogs_warn("No diameter configuration");
return OGS_OK;
}
2021-06-21 13:36:38 +00:00
rv = ogs_diam_init(FD_MODE_CLIENT|FD_MODE_SERVER,
2020-04-26 19:36:05 +00:00
smf_self()->diam_conf_path, smf_self()->diam_config);
2021-06-21 13:36:38 +00:00
ogs_assert(rv == 0);
2020-04-26 19:36:05 +00:00
2021-06-21 13:36:38 +00:00
rv = smf_gx_init();
ogs_assert(rv == OGS_OK);
2020-04-26 19:36:05 +00:00
2021-06-21 13:36:38 +00:00
rv = ogs_diam_rx_init();
ogs_assert(rv == 0);
rv = smf_s6b_init();
ogs_assert(rv == OGS_OK);
2020-04-26 19:36:05 +00:00
2021-06-21 13:36:38 +00:00
rv = ogs_diam_start();
ogs_assert(rv == 0);
2020-04-26 19:36:05 +00:00
return OGS_OK;
}
void smf_fd_final(void)
{
2021-06-21 13:36:38 +00:00
smf_gx_final();
smf_s6b_final();
2020-04-26 19:36:05 +00:00
ogs_diam_final();
}