mirror of
https://github.com/open5gs/open5gs.git
synced 2026-05-02 21:30:10 +00:00
Add AUSF, UDM, and UDR
This commit is contained in:
parent
0c0241d5e5
commit
72370ff0b2
1151 changed files with 140173 additions and 24799 deletions
101
lib/sbi/openapi/model/resynchronization_info.c
Normal file
101
lib/sbi/openapi/model/resynchronization_info.c
Normal file
|
|
@ -0,0 +1,101 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include "resynchronization_info.h"
|
||||
|
||||
OpenAPI_resynchronization_info_t *OpenAPI_resynchronization_info_create(
|
||||
char *rand,
|
||||
char *auts
|
||||
)
|
||||
{
|
||||
OpenAPI_resynchronization_info_t *resynchronization_info_local_var = OpenAPI_malloc(sizeof(OpenAPI_resynchronization_info_t));
|
||||
if (!resynchronization_info_local_var) {
|
||||
return NULL;
|
||||
}
|
||||
resynchronization_info_local_var->rand = rand;
|
||||
resynchronization_info_local_var->auts = auts;
|
||||
|
||||
return resynchronization_info_local_var;
|
||||
}
|
||||
|
||||
void OpenAPI_resynchronization_info_free(OpenAPI_resynchronization_info_t *resynchronization_info)
|
||||
{
|
||||
if (NULL == resynchronization_info) {
|
||||
return;
|
||||
}
|
||||
OpenAPI_lnode_t *node;
|
||||
ogs_free(resynchronization_info->rand);
|
||||
ogs_free(resynchronization_info->auts);
|
||||
ogs_free(resynchronization_info);
|
||||
}
|
||||
|
||||
cJSON *OpenAPI_resynchronization_info_convertToJSON(OpenAPI_resynchronization_info_t *resynchronization_info)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
|
||||
if (resynchronization_info == NULL) {
|
||||
ogs_error("OpenAPI_resynchronization_info_convertToJSON() failed [ResynchronizationInfo]");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
item = cJSON_CreateObject();
|
||||
if (!resynchronization_info->rand) {
|
||||
ogs_error("OpenAPI_resynchronization_info_convertToJSON() failed [rand]");
|
||||
goto end;
|
||||
}
|
||||
if (cJSON_AddStringToObject(item, "rand", resynchronization_info->rand) == NULL) {
|
||||
ogs_error("OpenAPI_resynchronization_info_convertToJSON() failed [rand]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (!resynchronization_info->auts) {
|
||||
ogs_error("OpenAPI_resynchronization_info_convertToJSON() failed [auts]");
|
||||
goto end;
|
||||
}
|
||||
if (cJSON_AddStringToObject(item, "auts", resynchronization_info->auts) == NULL) {
|
||||
ogs_error("OpenAPI_resynchronization_info_convertToJSON() failed [auts]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
||||
OpenAPI_resynchronization_info_t *OpenAPI_resynchronization_info_parseFromJSON(cJSON *resynchronization_infoJSON)
|
||||
{
|
||||
OpenAPI_resynchronization_info_t *resynchronization_info_local_var = NULL;
|
||||
cJSON *rand = cJSON_GetObjectItemCaseSensitive(resynchronization_infoJSON, "rand");
|
||||
if (!rand) {
|
||||
ogs_error("OpenAPI_resynchronization_info_parseFromJSON() failed [rand]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
|
||||
if (!cJSON_IsString(rand)) {
|
||||
ogs_error("OpenAPI_resynchronization_info_parseFromJSON() failed [rand]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
cJSON *auts = cJSON_GetObjectItemCaseSensitive(resynchronization_infoJSON, "auts");
|
||||
if (!auts) {
|
||||
ogs_error("OpenAPI_resynchronization_info_parseFromJSON() failed [auts]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
|
||||
if (!cJSON_IsString(auts)) {
|
||||
ogs_error("OpenAPI_resynchronization_info_parseFromJSON() failed [auts]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
resynchronization_info_local_var = OpenAPI_resynchronization_info_create (
|
||||
ogs_strdup(rand->valuestring),
|
||||
ogs_strdup(auts->valuestring)
|
||||
);
|
||||
|
||||
return resynchronization_info_local_var;
|
||||
end:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue