mirror of
https://github.com/open5gs/open5gs.git
synced 2026-05-04 06:10:11 +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
99
lib/sbi/openapi/model/ue_context_in_smsf_data.c
Normal file
99
lib/sbi/openapi/model/ue_context_in_smsf_data.c
Normal file
|
|
@ -0,0 +1,99 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include "ue_context_in_smsf_data.h"
|
||||
|
||||
OpenAPI_ue_context_in_smsf_data_t *OpenAPI_ue_context_in_smsf_data_create(
|
||||
OpenAPI_smsf_info_t *smsf_info3_gpp_access,
|
||||
OpenAPI_smsf_info_t *smsf_info_non3_gpp_access
|
||||
)
|
||||
{
|
||||
OpenAPI_ue_context_in_smsf_data_t *ue_context_in_smsf_data_local_var = OpenAPI_malloc(sizeof(OpenAPI_ue_context_in_smsf_data_t));
|
||||
if (!ue_context_in_smsf_data_local_var) {
|
||||
return NULL;
|
||||
}
|
||||
ue_context_in_smsf_data_local_var->smsf_info3_gpp_access = smsf_info3_gpp_access;
|
||||
ue_context_in_smsf_data_local_var->smsf_info_non3_gpp_access = smsf_info_non3_gpp_access;
|
||||
|
||||
return ue_context_in_smsf_data_local_var;
|
||||
}
|
||||
|
||||
void OpenAPI_ue_context_in_smsf_data_free(OpenAPI_ue_context_in_smsf_data_t *ue_context_in_smsf_data)
|
||||
{
|
||||
if (NULL == ue_context_in_smsf_data) {
|
||||
return;
|
||||
}
|
||||
OpenAPI_lnode_t *node;
|
||||
OpenAPI_smsf_info_free(ue_context_in_smsf_data->smsf_info3_gpp_access);
|
||||
OpenAPI_smsf_info_free(ue_context_in_smsf_data->smsf_info_non3_gpp_access);
|
||||
ogs_free(ue_context_in_smsf_data);
|
||||
}
|
||||
|
||||
cJSON *OpenAPI_ue_context_in_smsf_data_convertToJSON(OpenAPI_ue_context_in_smsf_data_t *ue_context_in_smsf_data)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
|
||||
if (ue_context_in_smsf_data == NULL) {
|
||||
ogs_error("OpenAPI_ue_context_in_smsf_data_convertToJSON() failed [UeContextInSmsfData]");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
item = cJSON_CreateObject();
|
||||
if (ue_context_in_smsf_data->smsf_info3_gpp_access) {
|
||||
cJSON *smsf_info3_gpp_access_local_JSON = OpenAPI_smsf_info_convertToJSON(ue_context_in_smsf_data->smsf_info3_gpp_access);
|
||||
if (smsf_info3_gpp_access_local_JSON == NULL) {
|
||||
ogs_error("OpenAPI_ue_context_in_smsf_data_convertToJSON() failed [smsf_info3_gpp_access]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToObject(item, "smsfInfo3GppAccess", smsf_info3_gpp_access_local_JSON);
|
||||
if (item->child == NULL) {
|
||||
ogs_error("OpenAPI_ue_context_in_smsf_data_convertToJSON() failed [smsf_info3_gpp_access]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (ue_context_in_smsf_data->smsf_info_non3_gpp_access) {
|
||||
cJSON *smsf_info_non3_gpp_access_local_JSON = OpenAPI_smsf_info_convertToJSON(ue_context_in_smsf_data->smsf_info_non3_gpp_access);
|
||||
if (smsf_info_non3_gpp_access_local_JSON == NULL) {
|
||||
ogs_error("OpenAPI_ue_context_in_smsf_data_convertToJSON() failed [smsf_info_non3_gpp_access]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToObject(item, "smsfInfoNon3GppAccess", smsf_info_non3_gpp_access_local_JSON);
|
||||
if (item->child == NULL) {
|
||||
ogs_error("OpenAPI_ue_context_in_smsf_data_convertToJSON() failed [smsf_info_non3_gpp_access]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
||||
OpenAPI_ue_context_in_smsf_data_t *OpenAPI_ue_context_in_smsf_data_parseFromJSON(cJSON *ue_context_in_smsf_dataJSON)
|
||||
{
|
||||
OpenAPI_ue_context_in_smsf_data_t *ue_context_in_smsf_data_local_var = NULL;
|
||||
cJSON *smsf_info3_gpp_access = cJSON_GetObjectItemCaseSensitive(ue_context_in_smsf_dataJSON, "smsfInfo3GppAccess");
|
||||
|
||||
OpenAPI_smsf_info_t *smsf_info3_gpp_access_local_nonprim = NULL;
|
||||
if (smsf_info3_gpp_access) {
|
||||
smsf_info3_gpp_access_local_nonprim = OpenAPI_smsf_info_parseFromJSON(smsf_info3_gpp_access);
|
||||
}
|
||||
|
||||
cJSON *smsf_info_non3_gpp_access = cJSON_GetObjectItemCaseSensitive(ue_context_in_smsf_dataJSON, "smsfInfoNon3GppAccess");
|
||||
|
||||
OpenAPI_smsf_info_t *smsf_info_non3_gpp_access_local_nonprim = NULL;
|
||||
if (smsf_info_non3_gpp_access) {
|
||||
smsf_info_non3_gpp_access_local_nonprim = OpenAPI_smsf_info_parseFromJSON(smsf_info_non3_gpp_access);
|
||||
}
|
||||
|
||||
ue_context_in_smsf_data_local_var = OpenAPI_ue_context_in_smsf_data_create (
|
||||
smsf_info3_gpp_access ? smsf_info3_gpp_access_local_nonprim : NULL,
|
||||
smsf_info_non3_gpp_access ? smsf_info_non3_gpp_access_local_nonprim : NULL
|
||||
);
|
||||
|
||||
return ue_context_in_smsf_data_local_var;
|
||||
end:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue