mirror of
https://github.com/open5gs/open5gs.git
synced 2026-05-04 22:30:09 +00:00
[Release-17] Upgrade SBI to v17.x.0
This commit is contained in:
parent
969c116e77
commit
4d44b1843e
1687 changed files with 121604 additions and 9310 deletions
|
|
@ -5,13 +5,15 @@
|
|||
#include "ue_context_in_amf_data.h"
|
||||
|
||||
OpenAPI_ue_context_in_amf_data_t *OpenAPI_ue_context_in_amf_data_create(
|
||||
OpenAPI_eps_interworking_info_t *eps_interworking_info
|
||||
OpenAPI_eps_interworking_info_t *eps_interworking_info,
|
||||
OpenAPI_list_t *amf_info
|
||||
)
|
||||
{
|
||||
OpenAPI_ue_context_in_amf_data_t *ue_context_in_amf_data_local_var = ogs_malloc(sizeof(OpenAPI_ue_context_in_amf_data_t));
|
||||
ogs_assert(ue_context_in_amf_data_local_var);
|
||||
|
||||
ue_context_in_amf_data_local_var->eps_interworking_info = eps_interworking_info;
|
||||
ue_context_in_amf_data_local_var->amf_info = amf_info;
|
||||
|
||||
return ue_context_in_amf_data_local_var;
|
||||
}
|
||||
|
|
@ -27,6 +29,13 @@ void OpenAPI_ue_context_in_amf_data_free(OpenAPI_ue_context_in_amf_data_t *ue_co
|
|||
OpenAPI_eps_interworking_info_free(ue_context_in_amf_data->eps_interworking_info);
|
||||
ue_context_in_amf_data->eps_interworking_info = NULL;
|
||||
}
|
||||
if (ue_context_in_amf_data->amf_info) {
|
||||
OpenAPI_list_for_each(ue_context_in_amf_data->amf_info, node) {
|
||||
OpenAPI_nudm_amf_info_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(ue_context_in_amf_data->amf_info);
|
||||
ue_context_in_amf_data->amf_info = NULL;
|
||||
}
|
||||
ogs_free(ue_context_in_amf_data);
|
||||
}
|
||||
|
||||
|
|
@ -54,6 +63,22 @@ cJSON *OpenAPI_ue_context_in_amf_data_convertToJSON(OpenAPI_ue_context_in_amf_da
|
|||
}
|
||||
}
|
||||
|
||||
if (ue_context_in_amf_data->amf_info) {
|
||||
cJSON *amf_infoList = cJSON_AddArrayToObject(item, "amfInfo");
|
||||
if (amf_infoList == NULL) {
|
||||
ogs_error("OpenAPI_ue_context_in_amf_data_convertToJSON() failed [amf_info]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_for_each(ue_context_in_amf_data->amf_info, node) {
|
||||
cJSON *itemLocal = OpenAPI_nudm_amf_info_convertToJSON(node->data);
|
||||
if (itemLocal == NULL) {
|
||||
ogs_error("OpenAPI_ue_context_in_amf_data_convertToJSON() failed [amf_info]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToArray(amf_infoList, itemLocal);
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
|
@ -64,13 +89,41 @@ OpenAPI_ue_context_in_amf_data_t *OpenAPI_ue_context_in_amf_data_parseFromJSON(c
|
|||
OpenAPI_lnode_t *node = NULL;
|
||||
cJSON *eps_interworking_info = NULL;
|
||||
OpenAPI_eps_interworking_info_t *eps_interworking_info_local_nonprim = NULL;
|
||||
cJSON *amf_info = NULL;
|
||||
OpenAPI_list_t *amf_infoList = NULL;
|
||||
eps_interworking_info = cJSON_GetObjectItemCaseSensitive(ue_context_in_amf_dataJSON, "epsInterworkingInfo");
|
||||
if (eps_interworking_info) {
|
||||
eps_interworking_info_local_nonprim = OpenAPI_eps_interworking_info_parseFromJSON(eps_interworking_info);
|
||||
}
|
||||
|
||||
amf_info = cJSON_GetObjectItemCaseSensitive(ue_context_in_amf_dataJSON, "amfInfo");
|
||||
if (amf_info) {
|
||||
cJSON *amf_info_local = NULL;
|
||||
if (!cJSON_IsArray(amf_info)) {
|
||||
ogs_error("OpenAPI_ue_context_in_amf_data_parseFromJSON() failed [amf_info]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
amf_infoList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(amf_info_local, amf_info) {
|
||||
if (!cJSON_IsObject(amf_info_local)) {
|
||||
ogs_error("OpenAPI_ue_context_in_amf_data_parseFromJSON() failed [amf_info]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_nudm_amf_info_t *amf_infoItem = OpenAPI_nudm_amf_info_parseFromJSON(amf_info_local);
|
||||
if (!amf_infoItem) {
|
||||
ogs_error("No amf_infoItem");
|
||||
OpenAPI_list_free(amf_infoList);
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_add(amf_infoList, amf_infoItem);
|
||||
}
|
||||
}
|
||||
|
||||
ue_context_in_amf_data_local_var = OpenAPI_ue_context_in_amf_data_create (
|
||||
eps_interworking_info ? eps_interworking_info_local_nonprim : NULL
|
||||
eps_interworking_info ? eps_interworking_info_local_nonprim : NULL,
|
||||
amf_info ? amf_infoList : NULL
|
||||
);
|
||||
|
||||
return ue_context_in_amf_data_local_var;
|
||||
|
|
@ -79,6 +132,13 @@ end:
|
|||
OpenAPI_eps_interworking_info_free(eps_interworking_info_local_nonprim);
|
||||
eps_interworking_info_local_nonprim = NULL;
|
||||
}
|
||||
if (amf_infoList) {
|
||||
OpenAPI_list_for_each(amf_infoList, node) {
|
||||
OpenAPI_nudm_amf_info_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(amf_infoList);
|
||||
amf_infoList = NULL;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue