mirror of
https://github.com/open5gs/open5gs.git
synced 2026-05-04 22:30:09 +00:00
Add only one 5GC scenario (call-flow)
This commit is contained in:
parent
20008b6a13
commit
dbee687a75
1415 changed files with 86635 additions and 5877 deletions
|
|
@ -41,9 +41,6 @@ void OpenAPI_lmf_info_free(OpenAPI_lmf_info_t *lmf_info)
|
|||
OpenAPI_an_node_type_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(lmf_info->serving_an_node_types);
|
||||
OpenAPI_list_for_each(lmf_info->serving_rat_types, node) {
|
||||
OpenAPI_rat_type_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(lmf_info->serving_rat_types);
|
||||
ogs_free(lmf_info);
|
||||
}
|
||||
|
|
@ -121,21 +118,16 @@ cJSON *OpenAPI_lmf_info_convertToJSON(OpenAPI_lmf_info_t *lmf_info)
|
|||
}
|
||||
|
||||
if (lmf_info->serving_rat_types) {
|
||||
cJSON *serving_rat_typesList = cJSON_AddArrayToObject(item, "servingRatTypes");
|
||||
if (serving_rat_typesList == NULL) {
|
||||
cJSON *serving_rat_types = cJSON_AddArrayToObject(item, "servingRatTypes");
|
||||
if (serving_rat_types == NULL) {
|
||||
ogs_error("OpenAPI_lmf_info_convertToJSON() failed [serving_rat_types]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
OpenAPI_lnode_t *serving_rat_types_node;
|
||||
if (lmf_info->serving_rat_types) {
|
||||
OpenAPI_list_for_each(lmf_info->serving_rat_types, serving_rat_types_node) {
|
||||
cJSON *itemLocal = OpenAPI_rat_type_convertToJSON(serving_rat_types_node->data);
|
||||
if (itemLocal == NULL) {
|
||||
ogs_error("OpenAPI_lmf_info_convertToJSON() failed [serving_rat_types]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToArray(serving_rat_typesList, itemLocal);
|
||||
OpenAPI_list_for_each(lmf_info->serving_rat_types, serving_rat_types_node) {
|
||||
if (cJSON_AddStringToObject(serving_rat_types, "", OpenAPI_rat_type_ToString((OpenAPI_rat_type_e)serving_rat_types_node->data)) == NULL) {
|
||||
ogs_error("OpenAPI_lmf_info_convertToJSON() failed [serving_rat_types]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -237,13 +229,12 @@ OpenAPI_lmf_info_t *OpenAPI_lmf_info_parseFromJSON(cJSON *lmf_infoJSON)
|
|||
serving_rat_typesList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(serving_rat_types_local_nonprimitive, serving_rat_types ) {
|
||||
if (!cJSON_IsObject(serving_rat_types_local_nonprimitive)) {
|
||||
if (!cJSON_IsString(serving_rat_types_local_nonprimitive)) {
|
||||
ogs_error("OpenAPI_lmf_info_parseFromJSON() failed [serving_rat_types]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_rat_type_t *serving_rat_typesItem = OpenAPI_rat_type_parseFromJSON(serving_rat_types_local_nonprimitive);
|
||||
|
||||
OpenAPI_list_add(serving_rat_typesList, serving_rat_typesItem);
|
||||
OpenAPI_list_add(serving_rat_typesList, (void *)OpenAPI_rat_type_FromString(serving_rat_types_local_nonprimitive->valuestring));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -260,3 +251,37 @@ end:
|
|||
return NULL;
|
||||
}
|
||||
|
||||
OpenAPI_lmf_info_t *OpenAPI_lmf_info_copy(OpenAPI_lmf_info_t *dst, OpenAPI_lmf_info_t *src)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
char *content = NULL;
|
||||
|
||||
ogs_assert(src);
|
||||
item = OpenAPI_lmf_info_convertToJSON(src);
|
||||
if (!item) {
|
||||
ogs_error("OpenAPI_lmf_info_convertToJSON() failed");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
content = cJSON_Print(item);
|
||||
cJSON_Delete(item);
|
||||
|
||||
if (!content) {
|
||||
ogs_error("cJSON_Print() failed");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
item = cJSON_Parse(content);
|
||||
ogs_free(content);
|
||||
if (!item) {
|
||||
ogs_error("cJSON_Parse() failed");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
OpenAPI_lmf_info_free(dst);
|
||||
dst = OpenAPI_lmf_info_parseFromJSON(item);
|
||||
cJSON_Delete(item);
|
||||
|
||||
return dst;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue