arch: DB schema Changes (#796)

- New function : NSSF
- New feature : SMF selection
This commit is contained in:
Sukchan Lee 2021-03-08 21:25:09 +09:00
parent c6bfbed922
commit 9af4268bab
691 changed files with 40727 additions and 18985 deletions

View file

@ -5,8 +5,10 @@
#include "sm_context_create_error.h"
OpenAPI_sm_context_create_error_t *OpenAPI_sm_context_create_error_create(
OpenAPI_problem_details_t *error,
OpenAPI_ext_problem_details_t *error,
OpenAPI_ref_to_binary_data_t *n1_sm_msg,
OpenAPI_ref_to_binary_data_t *n2_sm_info,
OpenAPI_n2_sm_info_type_e n2_sm_info_type,
char *recovery_time
)
{
@ -16,6 +18,8 @@ OpenAPI_sm_context_create_error_t *OpenAPI_sm_context_create_error_create(
}
sm_context_create_error_local_var->error = error;
sm_context_create_error_local_var->n1_sm_msg = n1_sm_msg;
sm_context_create_error_local_var->n2_sm_info = n2_sm_info;
sm_context_create_error_local_var->n2_sm_info_type = n2_sm_info_type;
sm_context_create_error_local_var->recovery_time = recovery_time;
return sm_context_create_error_local_var;
@ -27,8 +31,9 @@ void OpenAPI_sm_context_create_error_free(OpenAPI_sm_context_create_error_t *sm_
return;
}
OpenAPI_lnode_t *node;
OpenAPI_problem_details_free(sm_context_create_error->error);
OpenAPI_ext_problem_details_free(sm_context_create_error->error);
OpenAPI_ref_to_binary_data_free(sm_context_create_error->n1_sm_msg);
OpenAPI_ref_to_binary_data_free(sm_context_create_error->n2_sm_info);
ogs_free(sm_context_create_error->recovery_time);
ogs_free(sm_context_create_error);
}
@ -47,7 +52,7 @@ cJSON *OpenAPI_sm_context_create_error_convertToJSON(OpenAPI_sm_context_create_e
ogs_error("OpenAPI_sm_context_create_error_convertToJSON() failed [error]");
goto end;
}
cJSON *error_local_JSON = OpenAPI_problem_details_convertToJSON(sm_context_create_error->error);
cJSON *error_local_JSON = OpenAPI_ext_problem_details_convertToJSON(sm_context_create_error->error);
if (error_local_JSON == NULL) {
ogs_error("OpenAPI_sm_context_create_error_convertToJSON() failed [error]");
goto end;
@ -71,6 +76,26 @@ cJSON *OpenAPI_sm_context_create_error_convertToJSON(OpenAPI_sm_context_create_e
}
}
if (sm_context_create_error->n2_sm_info) {
cJSON *n2_sm_info_local_JSON = OpenAPI_ref_to_binary_data_convertToJSON(sm_context_create_error->n2_sm_info);
if (n2_sm_info_local_JSON == NULL) {
ogs_error("OpenAPI_sm_context_create_error_convertToJSON() failed [n2_sm_info]");
goto end;
}
cJSON_AddItemToObject(item, "n2SmInfo", n2_sm_info_local_JSON);
if (item->child == NULL) {
ogs_error("OpenAPI_sm_context_create_error_convertToJSON() failed [n2_sm_info]");
goto end;
}
}
if (sm_context_create_error->n2_sm_info_type) {
if (cJSON_AddStringToObject(item, "n2SmInfoType", OpenAPI_n2_sm_info_type_ToString(sm_context_create_error->n2_sm_info_type)) == NULL) {
ogs_error("OpenAPI_sm_context_create_error_convertToJSON() failed [n2_sm_info_type]");
goto end;
}
}
if (sm_context_create_error->recovery_time) {
if (cJSON_AddStringToObject(item, "recoveryTime", sm_context_create_error->recovery_time) == NULL) {
ogs_error("OpenAPI_sm_context_create_error_convertToJSON() failed [recovery_time]");
@ -91,9 +116,9 @@ OpenAPI_sm_context_create_error_t *OpenAPI_sm_context_create_error_parseFromJSON
goto end;
}
OpenAPI_problem_details_t *error_local_nonprim = NULL;
OpenAPI_ext_problem_details_t *error_local_nonprim = NULL;
error_local_nonprim = OpenAPI_problem_details_parseFromJSON(error);
error_local_nonprim = OpenAPI_ext_problem_details_parseFromJSON(error);
cJSON *n1_sm_msg = cJSON_GetObjectItemCaseSensitive(sm_context_create_errorJSON, "n1SmMsg");
@ -102,6 +127,24 @@ OpenAPI_sm_context_create_error_t *OpenAPI_sm_context_create_error_parseFromJSON
n1_sm_msg_local_nonprim = OpenAPI_ref_to_binary_data_parseFromJSON(n1_sm_msg);
}
cJSON *n2_sm_info = cJSON_GetObjectItemCaseSensitive(sm_context_create_errorJSON, "n2SmInfo");
OpenAPI_ref_to_binary_data_t *n2_sm_info_local_nonprim = NULL;
if (n2_sm_info) {
n2_sm_info_local_nonprim = OpenAPI_ref_to_binary_data_parseFromJSON(n2_sm_info);
}
cJSON *n2_sm_info_type = cJSON_GetObjectItemCaseSensitive(sm_context_create_errorJSON, "n2SmInfoType");
OpenAPI_n2_sm_info_type_e n2_sm_info_typeVariable;
if (n2_sm_info_type) {
if (!cJSON_IsString(n2_sm_info_type)) {
ogs_error("OpenAPI_sm_context_create_error_parseFromJSON() failed [n2_sm_info_type]");
goto end;
}
n2_sm_info_typeVariable = OpenAPI_n2_sm_info_type_FromString(n2_sm_info_type->valuestring);
}
cJSON *recovery_time = cJSON_GetObjectItemCaseSensitive(sm_context_create_errorJSON, "recoveryTime");
if (recovery_time) {
@ -114,6 +157,8 @@ OpenAPI_sm_context_create_error_t *OpenAPI_sm_context_create_error_parseFromJSON
sm_context_create_error_local_var = OpenAPI_sm_context_create_error_create (
error_local_nonprim,
n1_sm_msg ? n1_sm_msg_local_nonprim : NULL,
n2_sm_info ? n2_sm_info_local_nonprim : NULL,
n2_sm_info_type ? n2_sm_info_typeVariable : 0,
recovery_time ? ogs_strdup(recovery_time->valuestring) : NULL
);