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
80
lib/sbi/openapi/model/sor_update_info.c
Normal file
80
lib/sbi/openapi/model/sor_update_info.c
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include "sor_update_info.h"
|
||||
|
||||
OpenAPI_sor_update_info_t *OpenAPI_sor_update_info_create(
|
||||
OpenAPI_plmn_id_t *vplmn_id
|
||||
)
|
||||
{
|
||||
OpenAPI_sor_update_info_t *sor_update_info_local_var = OpenAPI_malloc(sizeof(OpenAPI_sor_update_info_t));
|
||||
if (!sor_update_info_local_var) {
|
||||
return NULL;
|
||||
}
|
||||
sor_update_info_local_var->vplmn_id = vplmn_id;
|
||||
|
||||
return sor_update_info_local_var;
|
||||
}
|
||||
|
||||
void OpenAPI_sor_update_info_free(OpenAPI_sor_update_info_t *sor_update_info)
|
||||
{
|
||||
if (NULL == sor_update_info) {
|
||||
return;
|
||||
}
|
||||
OpenAPI_lnode_t *node;
|
||||
OpenAPI_plmn_id_free(sor_update_info->vplmn_id);
|
||||
ogs_free(sor_update_info);
|
||||
}
|
||||
|
||||
cJSON *OpenAPI_sor_update_info_convertToJSON(OpenAPI_sor_update_info_t *sor_update_info)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
|
||||
if (sor_update_info == NULL) {
|
||||
ogs_error("OpenAPI_sor_update_info_convertToJSON() failed [SorUpdateInfo]");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
item = cJSON_CreateObject();
|
||||
if (!sor_update_info->vplmn_id) {
|
||||
ogs_error("OpenAPI_sor_update_info_convertToJSON() failed [vplmn_id]");
|
||||
goto end;
|
||||
}
|
||||
cJSON *vplmn_id_local_JSON = OpenAPI_plmn_id_convertToJSON(sor_update_info->vplmn_id);
|
||||
if (vplmn_id_local_JSON == NULL) {
|
||||
ogs_error("OpenAPI_sor_update_info_convertToJSON() failed [vplmn_id]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToObject(item, "vplmnId", vplmn_id_local_JSON);
|
||||
if (item->child == NULL) {
|
||||
ogs_error("OpenAPI_sor_update_info_convertToJSON() failed [vplmn_id]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
||||
OpenAPI_sor_update_info_t *OpenAPI_sor_update_info_parseFromJSON(cJSON *sor_update_infoJSON)
|
||||
{
|
||||
OpenAPI_sor_update_info_t *sor_update_info_local_var = NULL;
|
||||
cJSON *vplmn_id = cJSON_GetObjectItemCaseSensitive(sor_update_infoJSON, "vplmnId");
|
||||
if (!vplmn_id) {
|
||||
ogs_error("OpenAPI_sor_update_info_parseFromJSON() failed [vplmn_id]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
OpenAPI_plmn_id_t *vplmn_id_local_nonprim = NULL;
|
||||
|
||||
vplmn_id_local_nonprim = OpenAPI_plmn_id_parseFromJSON(vplmn_id);
|
||||
|
||||
sor_update_info_local_var = OpenAPI_sor_update_info_create (
|
||||
vplmn_id_local_nonprim
|
||||
);
|
||||
|
||||
return sor_update_info_local_var;
|
||||
end:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue