Add AUSF, UDM, and UDR

This commit is contained in:
Sukchan Lee 2020-06-04 14:12:05 -04:00
parent 0c0241d5e5
commit 72370ff0b2
1151 changed files with 140173 additions and 24799 deletions

View file

@ -0,0 +1,76 @@
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "pei_update_info.h"
OpenAPI_pei_update_info_t *OpenAPI_pei_update_info_create(
char *pei
)
{
OpenAPI_pei_update_info_t *pei_update_info_local_var = OpenAPI_malloc(sizeof(OpenAPI_pei_update_info_t));
if (!pei_update_info_local_var) {
return NULL;
}
pei_update_info_local_var->pei = pei;
return pei_update_info_local_var;
}
void OpenAPI_pei_update_info_free(OpenAPI_pei_update_info_t *pei_update_info)
{
if (NULL == pei_update_info) {
return;
}
OpenAPI_lnode_t *node;
ogs_free(pei_update_info->pei);
ogs_free(pei_update_info);
}
cJSON *OpenAPI_pei_update_info_convertToJSON(OpenAPI_pei_update_info_t *pei_update_info)
{
cJSON *item = NULL;
if (pei_update_info == NULL) {
ogs_error("OpenAPI_pei_update_info_convertToJSON() failed [PeiUpdateInfo]");
return NULL;
}
item = cJSON_CreateObject();
if (!pei_update_info->pei) {
ogs_error("OpenAPI_pei_update_info_convertToJSON() failed [pei]");
goto end;
}
if (cJSON_AddStringToObject(item, "pei", pei_update_info->pei) == NULL) {
ogs_error("OpenAPI_pei_update_info_convertToJSON() failed [pei]");
goto end;
}
end:
return item;
}
OpenAPI_pei_update_info_t *OpenAPI_pei_update_info_parseFromJSON(cJSON *pei_update_infoJSON)
{
OpenAPI_pei_update_info_t *pei_update_info_local_var = NULL;
cJSON *pei = cJSON_GetObjectItemCaseSensitive(pei_update_infoJSON, "pei");
if (!pei) {
ogs_error("OpenAPI_pei_update_info_parseFromJSON() failed [pei]");
goto end;
}
if (!cJSON_IsString(pei)) {
ogs_error("OpenAPI_pei_update_info_parseFromJSON() failed [pei]");
goto end;
}
pei_update_info_local_var = OpenAPI_pei_update_info_create (
ogs_strdup(pei->valuestring)
);
return pei_update_info_local_var;
end:
return NULL;
}