2020-06-04 18:12:05 +00:00
|
|
|
/*
|
2022-08-12 05:03:53 +00:00
|
|
|
* Copyright (C) 2019-2022 by Sukchan Lee <acetcom@gmail.com>
|
2020-06-04 18:12:05 +00:00
|
|
|
*
|
|
|
|
* 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 "sbi-path.h"
|
|
|
|
#include "nnrf-handler.h"
|
|
|
|
|
|
|
|
void ausf_nnrf_handle_nf_discover(
|
2020-12-24 20:41:31 +00:00
|
|
|
ogs_sbi_xact_t *xact, ogs_sbi_message_t *recvmsg)
|
2020-06-04 18:12:05 +00:00
|
|
|
{
|
2020-08-03 03:22:41 +00:00
|
|
|
ogs_sbi_object_t *sbi_object = NULL;
|
2022-08-26 15:12:22 +00:00
|
|
|
ogs_sbi_service_type_e service_type = OGS_SBI_SERVICE_TYPE_NULL;
|
2022-07-24 06:10:09 +00:00
|
|
|
ogs_sbi_discovery_option_t *discovery_option = NULL;
|
2020-06-04 18:12:05 +00:00
|
|
|
|
|
|
|
OpenAPI_search_result_t *SearchResult = NULL;
|
|
|
|
|
2022-07-24 06:10:09 +00:00
|
|
|
ogs_assert(recvmsg);
|
2020-08-03 03:22:41 +00:00
|
|
|
ogs_assert(xact);
|
|
|
|
sbi_object = xact->sbi_object;
|
2020-06-17 05:22:28 +00:00
|
|
|
ogs_assert(sbi_object);
|
2022-08-26 15:12:22 +00:00
|
|
|
service_type = xact->service_type;
|
|
|
|
ogs_assert(service_type);
|
2022-07-24 06:10:09 +00:00
|
|
|
|
|
|
|
discovery_option = xact->discovery_option;
|
2020-06-04 18:12:05 +00:00
|
|
|
|
2020-12-24 20:41:31 +00:00
|
|
|
SearchResult = recvmsg->SearchResult;
|
2020-06-04 18:12:05 +00:00
|
|
|
if (!SearchResult) {
|
|
|
|
ogs_error("No SearchResult");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2022-08-26 15:12:22 +00:00
|
|
|
ogs_nnrf_handle_nf_discover_search_result(SearchResult);
|
2020-06-04 18:12:05 +00:00
|
|
|
|
2022-08-26 15:12:22 +00:00
|
|
|
ogs_sbi_select_nf(sbi_object, service_type, discovery_option);
|
2022-07-24 06:10:09 +00:00
|
|
|
|
2022-08-26 15:12:22 +00:00
|
|
|
ogs_expect(true == ausf_sbi_send_request(sbi_object, service_type, xact));
|
2020-06-04 18:12:05 +00:00
|
|
|
}
|