[SBI] Crash occurs when ENUM in the MAP (#2103)

This commit is contained in:
Sukchan Lee 2023-03-01 17:50:25 +09:00
parent ce668c556c
commit 969c116e77
1097 changed files with 266728 additions and 42047 deletions

View File

@ -2,51 +2,51 @@ name: Meson Continuous Integration
on: [push, pull_request]
jobs:
# macos-latest:
# name: Build and Test on MacOS Latest
# runs-on: macos-latest
# steps:
## - name: Install MongoDB with Package Manager
## run: |
## brew tap mongodb/brew
## brew install mongodb-community
## brew services start mongodb-community
# - name: Create the TUN device with the interface name `ogstun`.
macos-latest:
name: Build and Test on MacOS Latest
runs-on: macos-latest
steps:
# - name: Install MongoDB with Package Manager
# run: |
# sudo ifconfig lo0 alias 127.0.0.2 netmask 255.255.255.255
# sudo ifconfig lo0 alias 127.0.0.3 netmask 255.255.255.255
# sudo ifconfig lo0 alias 127.0.0.4 netmask 255.255.255.255
# sudo ifconfig lo0 alias 127.0.0.5 netmask 255.255.255.255
# sudo ifconfig lo0 alias 127.0.0.5 netmask 255.255.255.255
# sudo ifconfig lo0 alias 127.0.0.6 netmask 255.255.255.255
# sudo ifconfig lo0 alias 127.0.0.7 netmask 255.255.255.255
# sudo ifconfig lo0 alias 127.0.0.8 netmask 255.255.255.255
# sudo ifconfig lo0 alias 127.0.0.9 netmask 255.255.255.255
# sudo ifconfig lo0 alias 127.0.0.10 netmask 255.255.255.255
# sudo ifconfig lo0 alias 127.0.0.11 netmask 255.255.255.255
# sudo ifconfig lo0 alias 127.0.0.12 netmask 255.255.255.255
# sudo ifconfig lo0 alias 127.0.0.13 netmask 255.255.255.255
# sudo ifconfig lo0 alias 127.0.0.14 netmask 255.255.255.255
# sudo ifconfig lo0 alias 127.0.0.15 netmask 255.255.255.255
# sudo ifconfig lo0 alias 127.0.0.16 netmask 255.255.255.255
# sudo ifconfig lo0 alias 127.0.0.17 netmask 255.255.255.255
# sudo ifconfig lo0 alias 127.0.0.18 netmask 255.255.255.255
# sudo ifconfig lo0 alias 127.0.0.19 netmask 255.255.255.255
# sudo ifconfig lo0 alias 127.0.0.20 netmask 255.255.255.255
# sudo ifconfig lo0 alias 127.0.1.10 netmask 255.255.255.255
# - name: Install the dependencies for building the source code.
# run: brew install mongo-c-driver libidn libmicrohttpd nghttp2 bison libusrsctp libtins talloc meson
# - name: Check out repository code
# uses: actions/checkout@main
# - name: Setup Meson Build
# run: PATH="/usr/local/opt/bison/bin:$PATH" PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig:$PKG_CONFIG_PATH" meson setup build
# env:
# CC: gcc
# - name : Build Open5GS
# run: ninja -C build
# - name: Test Open5GS
# run: sudo meson test -C build -v crypt unit
#
# brew tap mongodb/brew
# brew install mongodb-community
# brew services start mongodb-community
- name: Create the TUN device with the interface name `ogstun`.
run: |
sudo ifconfig lo0 alias 127.0.0.2 netmask 255.255.255.255
sudo ifconfig lo0 alias 127.0.0.3 netmask 255.255.255.255
sudo ifconfig lo0 alias 127.0.0.4 netmask 255.255.255.255
sudo ifconfig lo0 alias 127.0.0.5 netmask 255.255.255.255
sudo ifconfig lo0 alias 127.0.0.5 netmask 255.255.255.255
sudo ifconfig lo0 alias 127.0.0.6 netmask 255.255.255.255
sudo ifconfig lo0 alias 127.0.0.7 netmask 255.255.255.255
sudo ifconfig lo0 alias 127.0.0.8 netmask 255.255.255.255
sudo ifconfig lo0 alias 127.0.0.9 netmask 255.255.255.255
sudo ifconfig lo0 alias 127.0.0.10 netmask 255.255.255.255
sudo ifconfig lo0 alias 127.0.0.11 netmask 255.255.255.255
sudo ifconfig lo0 alias 127.0.0.12 netmask 255.255.255.255
sudo ifconfig lo0 alias 127.0.0.13 netmask 255.255.255.255
sudo ifconfig lo0 alias 127.0.0.14 netmask 255.255.255.255
sudo ifconfig lo0 alias 127.0.0.15 netmask 255.255.255.255
sudo ifconfig lo0 alias 127.0.0.16 netmask 255.255.255.255
sudo ifconfig lo0 alias 127.0.0.17 netmask 255.255.255.255
sudo ifconfig lo0 alias 127.0.0.18 netmask 255.255.255.255
sudo ifconfig lo0 alias 127.0.0.19 netmask 255.255.255.255
sudo ifconfig lo0 alias 127.0.0.20 netmask 255.255.255.255
sudo ifconfig lo0 alias 127.0.1.10 netmask 255.255.255.255
- name: Install the dependencies for building the source code.
run: brew install mongo-c-driver libidn libmicrohttpd nghttp2 bison libusrsctp libtins talloc meson
- name: Check out repository code
uses: actions/checkout@main
- name: Setup Meson Build
run: PATH="/usr/local/opt/bison/bin:$PATH" PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig:$PKG_CONFIG_PATH" meson setup build
env:
CC: gcc
- name : Build Open5GS
run: ninja -C build
- name: Test Open5GS
run: sudo meson test -C build -v crypt unit
ubuntu-latest:
name: Build and Test on Ubuntu Latest
runs-on: ubuntu-latest

View File

@ -82,6 +82,29 @@ index 1df33a4d..a74f97ea 100644
};
#endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
Check ExtIEs in ProtocolExtensionContainer
==========================================
diff --git a/src/smf/ngap-build.c b/src/smf/ngap-build.c
index 9554be276..051cb6e8a 100644
--- a/src/smf/ngap-build.c
+++ b/src/smf/ngap-build.c
@@ -180,13 +180,13 @@ ogs_pkbuf_t *ngap_build_pdu_session_resource_setup_request_transfer(
if (smf_self()->security_indication.
maximum_integrity_protected_data_rate_downlink) {
- NGAP_ProtocolExtensionContainer_9625P229_t *extContainer = NULL;
+ NGAP_ProtocolExtensionContainer_11905P297_t *extContainer = NULL;
NGAP_SecurityIndication_ExtIEs_t *extIe = NULL;
NGAP_MaximumIntegrityProtectedDataRate_t
*MaximumIntegrityProtectedDataRate = NULL;
extContainer = CALLOC(1,
- sizeof(NGAP_ProtocolExtensionContainer_9625P229_t));
+ sizeof(NGAP_ProtocolExtensionContainer_11905P297_t));
ogs_assert(extContainer);
SecurityIndication->iE_Extensions =
(struct NGAP_ProtocolExtensionContainer *)extContainer;
Check common file
===========================================
user@host ~/Documents/git/open5gs/lib/asn1c/common$ \

View File

@ -1 +1 @@
5.2.0
6.4.0

View File

@ -588,7 +588,7 @@ static cJSON_bool print_number(const cJSON * const item, printbuffer * const out
}
else
{
/* Try 15 decimal places of precision to avoid nonsignificant nonzero digits */
/* Try 15 decimal places of precision to avoid insignificant nonzero digits */
length = sprintf((char*)number_buffer, "%1.15g", d);
/* Check whether the original double can be recovered */
@ -1679,7 +1679,7 @@ static cJSON_bool parse_object(cJSON * const item, parse_buffer * const input_bu
buffer_skip_whitespace(input_buffer);
if (!parse_string(current_item, input_buffer))
{
goto fail; /* failed to parse name */
goto fail; /* fail to parse name */
}
buffer_skip_whitespace(input_buffer);

View File

@ -151,6 +151,7 @@ libsbi_openapi_sources = files('''
model/cag_data.c
model/cag_info_1.c
model/cag_info.c
model/cancel_relocate_ue_context_request.c
model/candidate_for_replacement.c
model/cause.c
model/ce_mode_b_ind.c
@ -181,6 +182,9 @@ libsbi_openapi_sources = files('''
model/context_data_sets.c
model/context_info.c
model/core_network_type.c
model/create_ue_context_201_response.c
model/create_ue_context_403_response.c
model/create_ue_context_request.c
model/credit_management_status.c
model/data_change_notify.c
model/data_filter.c
@ -215,6 +219,7 @@ libsbi_openapi_sources = files('''
model/downlink_data_notification_control.c
model/downlink_data_notification_control_rm.c
model/dynamic5_qi.c
model/eap_auth_method_200_response.c
model/eap_session.c
model/ebi_arp_mapping.c
model/ecgi_1.c
@ -284,6 +289,7 @@ libsbi_openapi_sources = files('''
model/gbr_qos_flow_information.c
model/geographical_coordinates.c
model/geographic_area.c
model/get_nf_instances_200_response.c
model/global_ran_node_id_1.c
model/global_ran_node_id.c
model/gmlc_info.c
@ -310,12 +316,6 @@ libsbi_openapi_sources = files('''
model/imsi_range.c
model/ims_vo_ps.c
model/indirect_data_forwarding_tunnel_info.c
model/inline_object_1.c
model/inline_object_2.c
model/inline_object_3.c
model/inline_object_4.c
model/inline_object.c
model/inline_response_200.c
model/integrity_algorithm.c
model/interface_upf_info_item.c
model/inter_freq_target_info_1.c
@ -395,6 +395,7 @@ libsbi_openapi_sources = files('''
model/model_5_gvn_group_configuration.c
model/model_5_gvn_group_data.c
model/modification_notification.c
model/modify_200_response.c
model/mo_exp_data_counter.c
model/monitoring_configuration.c
model/mtc_provider.c
@ -412,6 +413,7 @@ libsbi_openapi_sources = files('''
model/n2_info_container.c
model/n2_info_content.c
model/n2_info_notification_rsp_data.c
model/n2_info_notify_handover_complete_200_response.c
model/n2_info_notify_reason.c
model/n2_information_class.c
model/n2_information_notification.c
@ -458,8 +460,10 @@ libsbi_openapi_sources = files('''
model/nidd_information.c
model/node_type.c
model/non_dynamic5_qi.c
model/non_ue_n2_info_notify_request.c
model/non_ue_n2_info_subscription_create_data.c
model/non_ue_n2_info_subscription_created_data.c
model/non_ue_n2_message_transfer_request.c
model/notif_condition.c
model/notification_cause.c
model/notification_control.c
@ -469,6 +473,7 @@ libsbi_openapi_sources = files('''
model/notification_item.c
model/notification_type.c
model/notify_item.c
model/npcf_af_event.c
model/npn_access_info.c
model/nrf_info.c
model/nr_location.c
@ -648,6 +653,10 @@ libsbi_openapi_sources = files('''
model/registration_reason.c
model/release_data.c
model/released_data.c
model/release_pdu_session_200_response.c
model/release_pdu_session_request.c
model/release_sm_context_request.c
model/relocate_ue_context_request.c
model/report_amount_mdt.c
model/reporting_frequency.c
model/reporting_level.c
@ -708,6 +717,7 @@ libsbi_openapi_sources = files('''
model/secondary_rat_usage_report.c
model/security_result.c
model/send_mo_data_req_data.c
model/send_mo_data_request.c
model/sensor_measurement.c
model/sequence_number.c
model/serv_auth_info.c
@ -849,8 +859,10 @@ libsbi_openapi_sources = files('''
model/traffic_profile.c
model/traffic_profile_rm.c
model/transfer_mo_data_req_data.c
model/transfer_mo_data_request.c
model/transfer_mt_data_add_info.c
model/transfer_mt_data_error.c
model/transfer_mt_data_ismf_request.c
model/transfer_mt_data_req_data.c
model/transfer_policy.c
model/transfer_reason.c
@ -872,8 +884,8 @@ libsbi_openapi_sources = files('''
model/udr_info.c
model/udsf_info.c
model/ue_auth.c
model/ue_authentication_ctx.c
model/ue_authentication_ctx_5g_auth_data.c
model/ue_authentication_ctx.c
model/ue_camping_rep.c
model/ue_context.c
model/ue_context_cancel_relocate_data.c
@ -889,7 +901,9 @@ libsbi_openapi_sources = files('''
model/ue_context_release.c
model/ue_context_relocate_data.c
model/ue_context_relocated_data.c
model/ue_context_transfer_200_response.c
model/ue_context_transfer_req_data.c
model/ue_context_transfer_request.c
model/ue_context_transfer_rsp_data.c
model/ue_context_transfer_status.c
model/ue_differentiation_info.c
@ -914,6 +928,12 @@ libsbi_openapi_sources = files('''
model/up_cnx_state.c
model/up_confidentiality.c
model/updated_item.c
model/update_pdu_session_200_response.c
model/update_pdu_session_400_response.c
model/update_pdu_session_request.c
model/update_sm_context_200_response.c
model/update_sm_context_400_response.c
model/update_sm_context_request.c
model/upf_cond.c
model/upf_info.c
model/up_integrity.c

View File

@ -24,20 +24,25 @@ OpenAPI_acc_net_ch_id_t *OpenAPI_acc_net_ch_id_create(
void OpenAPI_acc_net_ch_id_free(OpenAPI_acc_net_ch_id_t *acc_net_ch_id)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == acc_net_ch_id) {
return;
}
OpenAPI_lnode_t *node;
OpenAPI_list_for_each(acc_net_ch_id->ref_pcc_rule_ids, node) {
ogs_free(node->data);
if (acc_net_ch_id->ref_pcc_rule_ids) {
OpenAPI_list_for_each(acc_net_ch_id->ref_pcc_rule_ids, node) {
ogs_free(node->data);
}
OpenAPI_list_free(acc_net_ch_id->ref_pcc_rule_ids);
acc_net_ch_id->ref_pcc_rule_ids = NULL;
}
OpenAPI_list_free(acc_net_ch_id->ref_pcc_rule_ids);
ogs_free(acc_net_ch_id);
}
cJSON *OpenAPI_acc_net_ch_id_convertToJSON(OpenAPI_acc_net_ch_id_t *acc_net_ch_id)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (acc_net_ch_id == NULL) {
ogs_error("OpenAPI_acc_net_ch_id_convertToJSON() failed [AccNetChId]");
@ -51,19 +56,17 @@ cJSON *OpenAPI_acc_net_ch_id_convertToJSON(OpenAPI_acc_net_ch_id_t *acc_net_ch_i
}
if (acc_net_ch_id->ref_pcc_rule_ids) {
cJSON *ref_pcc_rule_ids = cJSON_AddArrayToObject(item, "refPccRuleIds");
if (ref_pcc_rule_ids == NULL) {
cJSON *ref_pcc_rule_idsList = cJSON_AddArrayToObject(item, "refPccRuleIds");
if (ref_pcc_rule_idsList == NULL) {
ogs_error("OpenAPI_acc_net_ch_id_convertToJSON() failed [ref_pcc_rule_ids]");
goto end;
}
OpenAPI_lnode_t *ref_pcc_rule_ids_node;
OpenAPI_list_for_each(acc_net_ch_id->ref_pcc_rule_ids, ref_pcc_rule_ids_node) {
if (cJSON_AddStringToObject(ref_pcc_rule_ids, "", (char*)ref_pcc_rule_ids_node->data) == NULL) {
ogs_error("OpenAPI_acc_net_ch_id_convertToJSON() failed [ref_pcc_rule_ids]");
goto end;
OpenAPI_list_for_each(acc_net_ch_id->ref_pcc_rule_ids, node) {
if (cJSON_AddStringToObject(ref_pcc_rule_idsList, "", (char*)node->data) == NULL) {
ogs_error("OpenAPI_acc_net_ch_id_convertToJSON() failed [ref_pcc_rule_ids]");
goto end;
}
}
}
}
if (acc_net_ch_id->is_session_ch_scope) {
@ -80,39 +83,43 @@ end:
OpenAPI_acc_net_ch_id_t *OpenAPI_acc_net_ch_id_parseFromJSON(cJSON *acc_net_ch_idJSON)
{
OpenAPI_acc_net_ch_id_t *acc_net_ch_id_local_var = NULL;
cJSON *acc_net_cha_id_value = cJSON_GetObjectItemCaseSensitive(acc_net_ch_idJSON, "accNetChaIdValue");
OpenAPI_lnode_t *node = NULL;
cJSON *acc_net_cha_id_value = NULL;
cJSON *ref_pcc_rule_ids = NULL;
OpenAPI_list_t *ref_pcc_rule_idsList = NULL;
cJSON *session_ch_scope = NULL;
acc_net_cha_id_value = cJSON_GetObjectItemCaseSensitive(acc_net_ch_idJSON, "accNetChaIdValue");
if (!acc_net_cha_id_value) {
ogs_error("OpenAPI_acc_net_ch_id_parseFromJSON() failed [acc_net_cha_id_value]");
goto end;
}
if (!cJSON_IsNumber(acc_net_cha_id_value)) {
ogs_error("OpenAPI_acc_net_ch_id_parseFromJSON() failed [acc_net_cha_id_value]");
goto end;
}
cJSON *ref_pcc_rule_ids = cJSON_GetObjectItemCaseSensitive(acc_net_ch_idJSON, "refPccRuleIds");
OpenAPI_list_t *ref_pcc_rule_idsList;
ref_pcc_rule_ids = cJSON_GetObjectItemCaseSensitive(acc_net_ch_idJSON, "refPccRuleIds");
if (ref_pcc_rule_ids) {
cJSON *ref_pcc_rule_ids_local;
if (!cJSON_IsArray(ref_pcc_rule_ids)) {
ogs_error("OpenAPI_acc_net_ch_id_parseFromJSON() failed [ref_pcc_rule_ids]");
goto end;
}
ref_pcc_rule_idsList = OpenAPI_list_create();
cJSON *ref_pcc_rule_ids_local = NULL;
if (!cJSON_IsArray(ref_pcc_rule_ids)) {
ogs_error("OpenAPI_acc_net_ch_id_parseFromJSON() failed [ref_pcc_rule_ids]");
goto end;
}
cJSON_ArrayForEach(ref_pcc_rule_ids_local, ref_pcc_rule_ids) {
if (!cJSON_IsString(ref_pcc_rule_ids_local)) {
ogs_error("OpenAPI_acc_net_ch_id_parseFromJSON() failed [ref_pcc_rule_ids]");
goto end;
}
OpenAPI_list_add(ref_pcc_rule_idsList, ogs_strdup(ref_pcc_rule_ids_local->valuestring));
}
ref_pcc_rule_idsList = OpenAPI_list_create();
cJSON_ArrayForEach(ref_pcc_rule_ids_local, ref_pcc_rule_ids) {
double *localDouble = NULL;
int *localInt = NULL;
if (!cJSON_IsString(ref_pcc_rule_ids_local)) {
ogs_error("OpenAPI_acc_net_ch_id_parseFromJSON() failed [ref_pcc_rule_ids]");
goto end;
}
OpenAPI_list_add(ref_pcc_rule_idsList, ogs_strdup(ref_pcc_rule_ids_local->valuestring));
}
}
cJSON *session_ch_scope = cJSON_GetObjectItemCaseSensitive(acc_net_ch_idJSON, "sessionChScope");
session_ch_scope = cJSON_GetObjectItemCaseSensitive(acc_net_ch_idJSON, "sessionChScope");
if (session_ch_scope) {
if (!cJSON_IsBool(session_ch_scope)) {
ogs_error("OpenAPI_acc_net_ch_id_parseFromJSON() failed [session_ch_scope]");
@ -130,6 +137,13 @@ OpenAPI_acc_net_ch_id_t *OpenAPI_acc_net_ch_id_parseFromJSON(cJSON *acc_net_ch_i
return acc_net_ch_id_local_var;
end:
if (ref_pcc_rule_idsList) {
OpenAPI_list_for_each(ref_pcc_rule_idsList, node) {
ogs_free(node->data);
}
OpenAPI_list_free(ref_pcc_rule_idsList);
ref_pcc_rule_idsList = NULL;
}
return NULL;
}

View File

@ -20,18 +20,26 @@ OpenAPI_acc_net_charging_address_t *OpenAPI_acc_net_charging_address_create(
void OpenAPI_acc_net_charging_address_free(OpenAPI_acc_net_charging_address_t *acc_net_charging_address)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == acc_net_charging_address) {
return;
}
OpenAPI_lnode_t *node;
ogs_free(acc_net_charging_address->an_charg_ipv4_addr);
ogs_free(acc_net_charging_address->an_charg_ipv6_addr);
if (acc_net_charging_address->an_charg_ipv4_addr) {
ogs_free(acc_net_charging_address->an_charg_ipv4_addr);
acc_net_charging_address->an_charg_ipv4_addr = NULL;
}
if (acc_net_charging_address->an_charg_ipv6_addr) {
ogs_free(acc_net_charging_address->an_charg_ipv6_addr);
acc_net_charging_address->an_charg_ipv6_addr = NULL;
}
ogs_free(acc_net_charging_address);
}
cJSON *OpenAPI_acc_net_charging_address_convertToJSON(OpenAPI_acc_net_charging_address_t *acc_net_charging_address)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (acc_net_charging_address == NULL) {
ogs_error("OpenAPI_acc_net_charging_address_convertToJSON() failed [AccNetChargingAddress]");
@ -60,27 +68,28 @@ end:
OpenAPI_acc_net_charging_address_t *OpenAPI_acc_net_charging_address_parseFromJSON(cJSON *acc_net_charging_addressJSON)
{
OpenAPI_acc_net_charging_address_t *acc_net_charging_address_local_var = NULL;
cJSON *an_charg_ipv4_addr = cJSON_GetObjectItemCaseSensitive(acc_net_charging_addressJSON, "anChargIpv4Addr");
OpenAPI_lnode_t *node = NULL;
cJSON *an_charg_ipv4_addr = NULL;
cJSON *an_charg_ipv6_addr = NULL;
an_charg_ipv4_addr = cJSON_GetObjectItemCaseSensitive(acc_net_charging_addressJSON, "anChargIpv4Addr");
if (an_charg_ipv4_addr) {
if (!cJSON_IsString(an_charg_ipv4_addr)) {
if (!cJSON_IsString(an_charg_ipv4_addr) && !cJSON_IsNull(an_charg_ipv4_addr)) {
ogs_error("OpenAPI_acc_net_charging_address_parseFromJSON() failed [an_charg_ipv4_addr]");
goto end;
}
}
cJSON *an_charg_ipv6_addr = cJSON_GetObjectItemCaseSensitive(acc_net_charging_addressJSON, "anChargIpv6Addr");
an_charg_ipv6_addr = cJSON_GetObjectItemCaseSensitive(acc_net_charging_addressJSON, "anChargIpv6Addr");
if (an_charg_ipv6_addr) {
if (!cJSON_IsString(an_charg_ipv6_addr)) {
if (!cJSON_IsString(an_charg_ipv6_addr) && !cJSON_IsNull(an_charg_ipv6_addr)) {
ogs_error("OpenAPI_acc_net_charging_address_parseFromJSON() failed [an_charg_ipv6_addr]");
goto end;
}
}
acc_net_charging_address_local_var = OpenAPI_acc_net_charging_address_create (
an_charg_ipv4_addr ? ogs_strdup(an_charg_ipv4_addr->valuestring) : NULL,
an_charg_ipv6_addr ? ogs_strdup(an_charg_ipv6_addr->valuestring) : NULL
an_charg_ipv4_addr && !cJSON_IsNull(an_charg_ipv4_addr) ? ogs_strdup(an_charg_ipv4_addr->valuestring) : NULL,
an_charg_ipv6_addr && !cJSON_IsNull(an_charg_ipv6_addr) ? ogs_strdup(an_charg_ipv6_addr->valuestring) : NULL
);
return acc_net_charging_address_local_var;

View File

@ -22,25 +22,36 @@ OpenAPI_acceptable_service_info_t *OpenAPI_acceptable_service_info_create(
void OpenAPI_acceptable_service_info_free(OpenAPI_acceptable_service_info_t *acceptable_service_info)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == acceptable_service_info) {
return;
}
OpenAPI_lnode_t *node;
OpenAPI_list_for_each(acceptable_service_info->acc_bw_med_comps, node) {
OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data;
ogs_free(localKeyValue->key);
OpenAPI_media_component_free(localKeyValue->value);
ogs_free(localKeyValue);
if (acceptable_service_info->acc_bw_med_comps) {
OpenAPI_list_for_each(acceptable_service_info->acc_bw_med_comps, node) {
OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data;
ogs_free(localKeyValue->key);
OpenAPI_media_component_free(localKeyValue->value);
OpenAPI_map_free(localKeyValue);
}
OpenAPI_list_free(acceptable_service_info->acc_bw_med_comps);
acceptable_service_info->acc_bw_med_comps = NULL;
}
if (acceptable_service_info->mar_bw_ul) {
ogs_free(acceptable_service_info->mar_bw_ul);
acceptable_service_info->mar_bw_ul = NULL;
}
if (acceptable_service_info->mar_bw_dl) {
ogs_free(acceptable_service_info->mar_bw_dl);
acceptable_service_info->mar_bw_dl = NULL;
}
OpenAPI_list_free(acceptable_service_info->acc_bw_med_comps);
ogs_free(acceptable_service_info->mar_bw_ul);
ogs_free(acceptable_service_info->mar_bw_dl);
ogs_free(acceptable_service_info);
}
cJSON *OpenAPI_acceptable_service_info_convertToJSON(OpenAPI_acceptable_service_info_t *acceptable_service_info)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (acceptable_service_info == NULL) {
ogs_error("OpenAPI_acceptable_service_info_convertToJSON() failed [AcceptableServiceInfo]");
@ -55,21 +66,20 @@ cJSON *OpenAPI_acceptable_service_info_convertToJSON(OpenAPI_acceptable_service_
goto end;
}
cJSON *localMapObject = acc_bw_med_comps;
OpenAPI_lnode_t *acc_bw_med_comps_node;
if (acceptable_service_info->acc_bw_med_comps) {
OpenAPI_list_for_each(acceptable_service_info->acc_bw_med_comps, acc_bw_med_comps_node) {
OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)acc_bw_med_comps_node->data;
cJSON *itemLocal = localKeyValue->value ?
OpenAPI_media_component_convertToJSON(localKeyValue->value) :
cJSON_CreateNull();
if (itemLocal == NULL) {
ogs_error("OpenAPI_acceptable_service_info_convertToJSON() failed [inner]");
goto end;
}
cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal);
OpenAPI_list_for_each(acceptable_service_info->acc_bw_med_comps, node) {
OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data;
cJSON *itemLocal = localKeyValue->value ?
OpenAPI_media_component_convertToJSON(localKeyValue->value) :
cJSON_CreateNull();
if (itemLocal == NULL) {
ogs_error("OpenAPI_acceptable_service_info_convertToJSON() failed [inner]");
goto end;
}
cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal);
}
}
}
if (acceptable_service_info->mar_bw_ul) {
if (cJSON_AddStringToObject(item, "marBwUl", acceptable_service_info->mar_bw_ul) == NULL) {
@ -92,45 +102,48 @@ end:
OpenAPI_acceptable_service_info_t *OpenAPI_acceptable_service_info_parseFromJSON(cJSON *acceptable_service_infoJSON)
{
OpenAPI_acceptable_service_info_t *acceptable_service_info_local_var = NULL;
cJSON *acc_bw_med_comps = cJSON_GetObjectItemCaseSensitive(acceptable_service_infoJSON, "accBwMedComps");
OpenAPI_list_t *acc_bw_med_compsList;
OpenAPI_lnode_t *node = NULL;
cJSON *acc_bw_med_comps = NULL;
OpenAPI_list_t *acc_bw_med_compsList = NULL;
cJSON *mar_bw_ul = NULL;
cJSON *mar_bw_dl = NULL;
acc_bw_med_comps = cJSON_GetObjectItemCaseSensitive(acceptable_service_infoJSON, "accBwMedComps");
if (acc_bw_med_comps) {
cJSON *acc_bw_med_comps_local_map;
if (!cJSON_IsObject(acc_bw_med_comps)) {
ogs_error("OpenAPI_acceptable_service_info_parseFromJSON() failed [acc_bw_med_comps]");
goto end;
}
acc_bw_med_compsList = OpenAPI_list_create();
OpenAPI_map_t *localMapKeyPair = NULL;
cJSON_ArrayForEach(acc_bw_med_comps_local_map, acc_bw_med_comps) {
cJSON *localMapObject = acc_bw_med_comps_local_map;
if (cJSON_IsObject(localMapObject)) {
localMapKeyPair = OpenAPI_map_create(
ogs_strdup(localMapObject->string), OpenAPI_media_component_parseFromJSON(localMapObject));
} else if (cJSON_IsNull(localMapObject)) {
localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL);
} else {
ogs_error("OpenAPI_acceptable_service_info_parseFromJSON() failed [inner]");
cJSON *acc_bw_med_comps_local_map = NULL;
if (!cJSON_IsObject(acc_bw_med_comps) && !cJSON_IsNull(acc_bw_med_comps)) {
ogs_error("OpenAPI_acceptable_service_info_parseFromJSON() failed [acc_bw_med_comps]");
goto end;
}
OpenAPI_list_add(acc_bw_med_compsList, localMapKeyPair);
}
if (cJSON_IsObject(acc_bw_med_comps)) {
acc_bw_med_compsList = OpenAPI_list_create();
OpenAPI_map_t *localMapKeyPair = NULL;
cJSON_ArrayForEach(acc_bw_med_comps_local_map, acc_bw_med_comps) {
cJSON *localMapObject = acc_bw_med_comps_local_map;
if (cJSON_IsObject(localMapObject)) {
localMapKeyPair = OpenAPI_map_create(
ogs_strdup(localMapObject->string), OpenAPI_media_component_parseFromJSON(localMapObject));
} else if (cJSON_IsNull(localMapObject)) {
localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL);
} else {
ogs_error("OpenAPI_acceptable_service_info_parseFromJSON() failed [inner]");
goto end;
}
OpenAPI_list_add(acc_bw_med_compsList, localMapKeyPair);
}
}
}
cJSON *mar_bw_ul = cJSON_GetObjectItemCaseSensitive(acceptable_service_infoJSON, "marBwUl");
mar_bw_ul = cJSON_GetObjectItemCaseSensitive(acceptable_service_infoJSON, "marBwUl");
if (mar_bw_ul) {
if (!cJSON_IsString(mar_bw_ul)) {
if (!cJSON_IsString(mar_bw_ul) && !cJSON_IsNull(mar_bw_ul)) {
ogs_error("OpenAPI_acceptable_service_info_parseFromJSON() failed [mar_bw_ul]");
goto end;
}
}
cJSON *mar_bw_dl = cJSON_GetObjectItemCaseSensitive(acceptable_service_infoJSON, "marBwDl");
mar_bw_dl = cJSON_GetObjectItemCaseSensitive(acceptable_service_infoJSON, "marBwDl");
if (mar_bw_dl) {
if (!cJSON_IsString(mar_bw_dl)) {
if (!cJSON_IsString(mar_bw_dl) && !cJSON_IsNull(mar_bw_dl)) {
ogs_error("OpenAPI_acceptable_service_info_parseFromJSON() failed [mar_bw_dl]");
goto end;
}
@ -138,12 +151,22 @@ OpenAPI_acceptable_service_info_t *OpenAPI_acceptable_service_info_parseFromJSON
acceptable_service_info_local_var = OpenAPI_acceptable_service_info_create (
acc_bw_med_comps ? acc_bw_med_compsList : NULL,
mar_bw_ul ? ogs_strdup(mar_bw_ul->valuestring) : NULL,
mar_bw_dl ? ogs_strdup(mar_bw_dl->valuestring) : NULL
mar_bw_ul && !cJSON_IsNull(mar_bw_ul) ? ogs_strdup(mar_bw_ul->valuestring) : NULL,
mar_bw_dl && !cJSON_IsNull(mar_bw_dl) ? ogs_strdup(mar_bw_dl->valuestring) : NULL
);
return acceptable_service_info_local_var;
end:
if (acc_bw_med_compsList) {
OpenAPI_list_for_each(acc_bw_med_compsList, node) {
OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data;
ogs_free(localKeyValue->key);
OpenAPI_media_component_free(localKeyValue->value);
OpenAPI_map_free(localKeyValue);
}
OpenAPI_list_free(acc_bw_med_compsList);
acc_bw_med_compsList = NULL;
}
return NULL;
}

View File

@ -58,39 +58,92 @@ OpenAPI_access_and_mobility_data_t *OpenAPI_access_and_mobility_data_create(
void OpenAPI_access_and_mobility_data_free(OpenAPI_access_and_mobility_data_t *access_and_mobility_data)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == access_and_mobility_data) {
return;
}
OpenAPI_lnode_t *node;
OpenAPI_user_location_free(access_and_mobility_data->location);
ogs_free(access_and_mobility_data->location_ts);
ogs_free(access_and_mobility_data->time_zone);
ogs_free(access_and_mobility_data->time_zone_ts);
OpenAPI_list_for_each(access_and_mobility_data->reg_states, node) {
OpenAPI_rm_info_free(node->data);
if (access_and_mobility_data->location) {
OpenAPI_user_location_free(access_and_mobility_data->location);
access_and_mobility_data->location = NULL;
}
OpenAPI_list_free(access_and_mobility_data->reg_states);
ogs_free(access_and_mobility_data->reg_states_ts);
OpenAPI_list_for_each(access_and_mobility_data->conn_states, node) {
OpenAPI_cm_info_free(node->data);
if (access_and_mobility_data->location_ts) {
ogs_free(access_and_mobility_data->location_ts);
access_and_mobility_data->location_ts = NULL;
}
if (access_and_mobility_data->time_zone) {
ogs_free(access_and_mobility_data->time_zone);
access_and_mobility_data->time_zone = NULL;
}
if (access_and_mobility_data->time_zone_ts) {
ogs_free(access_and_mobility_data->time_zone_ts);
access_and_mobility_data->time_zone_ts = NULL;
}
if (access_and_mobility_data->reg_states) {
OpenAPI_list_for_each(access_and_mobility_data->reg_states, node) {
OpenAPI_rm_info_free(node->data);
}
OpenAPI_list_free(access_and_mobility_data->reg_states);
access_and_mobility_data->reg_states = NULL;
}
if (access_and_mobility_data->reg_states_ts) {
ogs_free(access_and_mobility_data->reg_states_ts);
access_and_mobility_data->reg_states_ts = NULL;
}
if (access_and_mobility_data->conn_states) {
OpenAPI_list_for_each(access_and_mobility_data->conn_states, node) {
OpenAPI_cm_info_free(node->data);
}
OpenAPI_list_free(access_and_mobility_data->conn_states);
access_and_mobility_data->conn_states = NULL;
}
if (access_and_mobility_data->conn_states_ts) {
ogs_free(access_and_mobility_data->conn_states_ts);
access_and_mobility_data->conn_states_ts = NULL;
}
if (access_and_mobility_data->reachability_status) {
OpenAPI_ue_reachability_free(access_and_mobility_data->reachability_status);
access_and_mobility_data->reachability_status = NULL;
}
if (access_and_mobility_data->reachability_status_ts) {
ogs_free(access_and_mobility_data->reachability_status_ts);
access_and_mobility_data->reachability_status_ts = NULL;
}
if (access_and_mobility_data->sms_over_nas_status_ts) {
ogs_free(access_and_mobility_data->sms_over_nas_status_ts);
access_and_mobility_data->sms_over_nas_status_ts = NULL;
}
if (access_and_mobility_data->roaming_status_ts) {
ogs_free(access_and_mobility_data->roaming_status_ts);
access_and_mobility_data->roaming_status_ts = NULL;
}
if (access_and_mobility_data->current_plmn) {
OpenAPI_plmn_id_1_free(access_and_mobility_data->current_plmn);
access_and_mobility_data->current_plmn = NULL;
}
if (access_and_mobility_data->current_plmn_ts) {
ogs_free(access_and_mobility_data->current_plmn_ts);
access_and_mobility_data->current_plmn_ts = NULL;
}
if (access_and_mobility_data->rat_type) {
OpenAPI_list_free(access_and_mobility_data->rat_type);
access_and_mobility_data->rat_type = NULL;
}
if (access_and_mobility_data->rat_types_ts) {
ogs_free(access_and_mobility_data->rat_types_ts);
access_and_mobility_data->rat_types_ts = NULL;
}
if (access_and_mobility_data->supp_feat) {
ogs_free(access_and_mobility_data->supp_feat);
access_and_mobility_data->supp_feat = NULL;
}
OpenAPI_list_free(access_and_mobility_data->conn_states);
ogs_free(access_and_mobility_data->conn_states_ts);
OpenAPI_ue_reachability_free(access_and_mobility_data->reachability_status);
ogs_free(access_and_mobility_data->reachability_status_ts);
ogs_free(access_and_mobility_data->sms_over_nas_status_ts);
ogs_free(access_and_mobility_data->roaming_status_ts);
OpenAPI_plmn_id_1_free(access_and_mobility_data->current_plmn);
ogs_free(access_and_mobility_data->current_plmn_ts);
OpenAPI_list_free(access_and_mobility_data->rat_type);
ogs_free(access_and_mobility_data->rat_types_ts);
ogs_free(access_and_mobility_data->supp_feat);
ogs_free(access_and_mobility_data);
}
cJSON *OpenAPI_access_and_mobility_data_convertToJSON(OpenAPI_access_and_mobility_data_t *access_and_mobility_data)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (access_and_mobility_data == NULL) {
ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [AccessAndMobilityData]");
@ -132,7 +185,7 @@ cJSON *OpenAPI_access_and_mobility_data_convertToJSON(OpenAPI_access_and_mobilit
}
}
if (access_and_mobility_data->access_type) {
if (access_and_mobility_data->access_type != OpenAPI_access_type_NULL) {
if (cJSON_AddStringToObject(item, "accessType", OpenAPI_access_type_ToString(access_and_mobility_data->access_type)) == NULL) {
ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [access_type]");
goto end;
@ -145,17 +198,13 @@ cJSON *OpenAPI_access_and_mobility_data_convertToJSON(OpenAPI_access_and_mobilit
ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [reg_states]");
goto end;
}
OpenAPI_lnode_t *reg_states_node;
if (access_and_mobility_data->reg_states) {
OpenAPI_list_for_each(access_and_mobility_data->reg_states, reg_states_node) {
cJSON *itemLocal = OpenAPI_rm_info_convertToJSON(reg_states_node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [reg_states]");
goto end;
}
cJSON_AddItemToArray(reg_statesList, itemLocal);
OpenAPI_list_for_each(access_and_mobility_data->reg_states, node) {
cJSON *itemLocal = OpenAPI_rm_info_convertToJSON(node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [reg_states]");
goto end;
}
cJSON_AddItemToArray(reg_statesList, itemLocal);
}
}
@ -172,17 +221,13 @@ cJSON *OpenAPI_access_and_mobility_data_convertToJSON(OpenAPI_access_and_mobilit
ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [conn_states]");
goto end;
}
OpenAPI_lnode_t *conn_states_node;
if (access_and_mobility_data->conn_states) {
OpenAPI_list_for_each(access_and_mobility_data->conn_states, conn_states_node) {
cJSON *itemLocal = OpenAPI_cm_info_convertToJSON(conn_states_node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [conn_states]");
goto end;
}
cJSON_AddItemToArray(conn_statesList, itemLocal);
OpenAPI_list_for_each(access_and_mobility_data->conn_states, node) {
cJSON *itemLocal = OpenAPI_cm_info_convertToJSON(node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [conn_states]");
goto end;
}
cJSON_AddItemToArray(conn_statesList, itemLocal);
}
}
@ -213,7 +258,7 @@ cJSON *OpenAPI_access_and_mobility_data_convertToJSON(OpenAPI_access_and_mobilit
}
}
if (access_and_mobility_data->sms_over_nas_status) {
if (access_and_mobility_data->sms_over_nas_status != OpenAPI_sms_support_NULL) {
if (cJSON_AddStringToObject(item, "smsOverNasStatus", OpenAPI_sms_support_ToString(access_and_mobility_data->sms_over_nas_status)) == NULL) {
ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [sms_over_nas_status]");
goto end;
@ -261,15 +306,14 @@ cJSON *OpenAPI_access_and_mobility_data_convertToJSON(OpenAPI_access_and_mobilit
}
}
if (access_and_mobility_data->rat_type) {
cJSON *rat_type = cJSON_AddArrayToObject(item, "ratType");
if (rat_type == NULL) {
if (access_and_mobility_data->rat_type != OpenAPI_rat_type_NULL) {
cJSON *rat_typeList = cJSON_AddArrayToObject(item, "ratType");
if (rat_typeList == NULL) {
ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [rat_type]");
goto end;
}
OpenAPI_lnode_t *rat_type_node;
OpenAPI_list_for_each(access_and_mobility_data->rat_type, rat_type_node) {
if (cJSON_AddStringToObject(rat_type, "", OpenAPI_rat_type_ToString((intptr_t)rat_type_node->data)) == NULL) {
OpenAPI_list_for_each(access_and_mobility_data->rat_type, node) {
if (cJSON_AddStringToObject(rat_typeList, "", OpenAPI_rat_type_ToString((intptr_t)node->data)) == NULL) {
ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [rat_type]");
goto end;
}
@ -297,43 +341,65 @@ end:
OpenAPI_access_and_mobility_data_t *OpenAPI_access_and_mobility_data_parseFromJSON(cJSON *access_and_mobility_dataJSON)
{
OpenAPI_access_and_mobility_data_t *access_and_mobility_data_local_var = NULL;
cJSON *location = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "location");
OpenAPI_lnode_t *node = NULL;
cJSON *location = NULL;
OpenAPI_user_location_t *location_local_nonprim = NULL;
cJSON *location_ts = NULL;
cJSON *time_zone = NULL;
cJSON *time_zone_ts = NULL;
cJSON *access_type = NULL;
OpenAPI_access_type_e access_typeVariable = 0;
cJSON *reg_states = NULL;
OpenAPI_list_t *reg_statesList = NULL;
cJSON *reg_states_ts = NULL;
cJSON *conn_states = NULL;
OpenAPI_list_t *conn_statesList = NULL;
cJSON *conn_states_ts = NULL;
cJSON *reachability_status = NULL;
OpenAPI_ue_reachability_t *reachability_status_local_nonprim = NULL;
cJSON *reachability_status_ts = NULL;
cJSON *sms_over_nas_status = NULL;
OpenAPI_sms_support_e sms_over_nas_statusVariable = 0;
cJSON *sms_over_nas_status_ts = NULL;
cJSON *roaming_status = NULL;
cJSON *roaming_status_ts = NULL;
cJSON *current_plmn = NULL;
OpenAPI_plmn_id_1_t *current_plmn_local_nonprim = NULL;
cJSON *current_plmn_ts = NULL;
cJSON *rat_type = NULL;
OpenAPI_list_t *rat_typeList = NULL;
cJSON *rat_types_ts = NULL;
cJSON *supp_feat = NULL;
location = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "location");
if (location) {
location_local_nonprim = OpenAPI_user_location_parseFromJSON(location);
}
cJSON *location_ts = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "locationTs");
location_ts = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "locationTs");
if (location_ts) {
if (!cJSON_IsString(location_ts)) {
if (!cJSON_IsString(location_ts) && !cJSON_IsNull(location_ts)) {
ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [location_ts]");
goto end;
}
}
cJSON *time_zone = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "timeZone");
time_zone = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "timeZone");
if (time_zone) {
if (!cJSON_IsString(time_zone)) {
if (!cJSON_IsString(time_zone) && !cJSON_IsNull(time_zone)) {
ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [time_zone]");
goto end;
}
}
cJSON *time_zone_ts = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "timeZoneTs");
time_zone_ts = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "timeZoneTs");
if (time_zone_ts) {
if (!cJSON_IsString(time_zone_ts)) {
if (!cJSON_IsString(time_zone_ts) && !cJSON_IsNull(time_zone_ts)) {
ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [time_zone_ts]");
goto end;
}
}
cJSON *access_type = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "accessType");
OpenAPI_access_type_e access_typeVariable;
access_type = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "accessType");
if (access_type) {
if (!cJSON_IsString(access_type)) {
ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [access_type]");
@ -342,101 +408,86 @@ OpenAPI_access_and_mobility_data_t *OpenAPI_access_and_mobility_data_parseFromJS
access_typeVariable = OpenAPI_access_type_FromString(access_type->valuestring);
}
cJSON *reg_states = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "regStates");
OpenAPI_list_t *reg_statesList;
reg_states = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "regStates");
if (reg_states) {
cJSON *reg_states_local_nonprimitive;
if (!cJSON_IsArray(reg_states)){
ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [reg_states]");
goto end;
}
reg_statesList = OpenAPI_list_create();
cJSON_ArrayForEach(reg_states_local_nonprimitive, reg_states ) {
if (!cJSON_IsObject(reg_states_local_nonprimitive)) {
cJSON *reg_states_local = NULL;
if (!cJSON_IsArray(reg_states)) {
ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [reg_states]");
goto end;
}
OpenAPI_rm_info_t *reg_statesItem = OpenAPI_rm_info_parseFromJSON(reg_states_local_nonprimitive);
if (!reg_statesItem) {
ogs_error("No reg_statesItem");
OpenAPI_list_free(reg_statesList);
goto end;
reg_statesList = OpenAPI_list_create();
cJSON_ArrayForEach(reg_states_local, reg_states) {
if (!cJSON_IsObject(reg_states_local)) {
ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [reg_states]");
goto end;
}
OpenAPI_rm_info_t *reg_statesItem = OpenAPI_rm_info_parseFromJSON(reg_states_local);
if (!reg_statesItem) {
ogs_error("No reg_statesItem");
OpenAPI_list_free(reg_statesList);
goto end;
}
OpenAPI_list_add(reg_statesList, reg_statesItem);
}
OpenAPI_list_add(reg_statesList, reg_statesItem);
}
}
cJSON *reg_states_ts = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "regStatesTs");
reg_states_ts = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "regStatesTs");
if (reg_states_ts) {
if (!cJSON_IsString(reg_states_ts)) {
if (!cJSON_IsString(reg_states_ts) && !cJSON_IsNull(reg_states_ts)) {
ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [reg_states_ts]");
goto end;
}
}
cJSON *conn_states = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "connStates");
OpenAPI_list_t *conn_statesList;
conn_states = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "connStates");
if (conn_states) {
cJSON *conn_states_local_nonprimitive;
if (!cJSON_IsArray(conn_states)){
ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [conn_states]");
goto end;
}
conn_statesList = OpenAPI_list_create();
cJSON_ArrayForEach(conn_states_local_nonprimitive, conn_states ) {
if (!cJSON_IsObject(conn_states_local_nonprimitive)) {
cJSON *conn_states_local = NULL;
if (!cJSON_IsArray(conn_states)) {
ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [conn_states]");
goto end;
}
OpenAPI_cm_info_t *conn_statesItem = OpenAPI_cm_info_parseFromJSON(conn_states_local_nonprimitive);
if (!conn_statesItem) {
ogs_error("No conn_statesItem");
OpenAPI_list_free(conn_statesList);
goto end;
conn_statesList = OpenAPI_list_create();
cJSON_ArrayForEach(conn_states_local, conn_states) {
if (!cJSON_IsObject(conn_states_local)) {
ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [conn_states]");
goto end;
}
OpenAPI_cm_info_t *conn_statesItem = OpenAPI_cm_info_parseFromJSON(conn_states_local);
if (!conn_statesItem) {
ogs_error("No conn_statesItem");
OpenAPI_list_free(conn_statesList);
goto end;
}
OpenAPI_list_add(conn_statesList, conn_statesItem);
}
OpenAPI_list_add(conn_statesList, conn_statesItem);
}
}
cJSON *conn_states_ts = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "connStatesTs");
conn_states_ts = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "connStatesTs");
if (conn_states_ts) {
if (!cJSON_IsString(conn_states_ts)) {
if (!cJSON_IsString(conn_states_ts) && !cJSON_IsNull(conn_states_ts)) {
ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [conn_states_ts]");
goto end;
}
}
cJSON *reachability_status = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "reachabilityStatus");
OpenAPI_ue_reachability_t *reachability_status_local_nonprim = NULL;
reachability_status = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "reachabilityStatus");
if (reachability_status) {
reachability_status_local_nonprim = OpenAPI_ue_reachability_parseFromJSON(reachability_status);
}
cJSON *reachability_status_ts = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "reachabilityStatusTs");
reachability_status_ts = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "reachabilityStatusTs");
if (reachability_status_ts) {
if (!cJSON_IsString(reachability_status_ts)) {
if (!cJSON_IsString(reachability_status_ts) && !cJSON_IsNull(reachability_status_ts)) {
ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [reachability_status_ts]");
goto end;
}
}
cJSON *sms_over_nas_status = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "smsOverNasStatus");
OpenAPI_sms_support_e sms_over_nas_statusVariable;
sms_over_nas_status = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "smsOverNasStatus");
if (sms_over_nas_status) {
if (!cJSON_IsString(sms_over_nas_status)) {
ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [sms_over_nas_status]");
@ -445,17 +496,15 @@ OpenAPI_access_and_mobility_data_t *OpenAPI_access_and_mobility_data_parseFromJS
sms_over_nas_statusVariable = OpenAPI_sms_support_FromString(sms_over_nas_status->valuestring);
}
cJSON *sms_over_nas_status_ts = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "smsOverNasStatusTs");
sms_over_nas_status_ts = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "smsOverNasStatusTs");
if (sms_over_nas_status_ts) {
if (!cJSON_IsString(sms_over_nas_status_ts)) {
if (!cJSON_IsString(sms_over_nas_status_ts) && !cJSON_IsNull(sms_over_nas_status_ts)) {
ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [sms_over_nas_status_ts]");
goto end;
}
}
cJSON *roaming_status = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "roamingStatus");
roaming_status = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "roamingStatus");
if (roaming_status) {
if (!cJSON_IsBool(roaming_status)) {
ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [roaming_status]");
@ -463,66 +512,57 @@ OpenAPI_access_and_mobility_data_t *OpenAPI_access_and_mobility_data_parseFromJS
}
}
cJSON *roaming_status_ts = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "roamingStatusTs");
roaming_status_ts = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "roamingStatusTs");
if (roaming_status_ts) {
if (!cJSON_IsString(roaming_status_ts)) {
if (!cJSON_IsString(roaming_status_ts) && !cJSON_IsNull(roaming_status_ts)) {
ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [roaming_status_ts]");
goto end;
}
}
cJSON *current_plmn = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "currentPlmn");
OpenAPI_plmn_id_1_t *current_plmn_local_nonprim = NULL;
current_plmn = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "currentPlmn");
if (current_plmn) {
current_plmn_local_nonprim = OpenAPI_plmn_id_1_parseFromJSON(current_plmn);
}
cJSON *current_plmn_ts = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "currentPlmnTs");
current_plmn_ts = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "currentPlmnTs");
if (current_plmn_ts) {
if (!cJSON_IsString(current_plmn_ts)) {
if (!cJSON_IsString(current_plmn_ts) && !cJSON_IsNull(current_plmn_ts)) {
ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [current_plmn_ts]");
goto end;
}
}
cJSON *rat_type = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "ratType");
OpenAPI_list_t *rat_typeList;
rat_type = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "ratType");
if (rat_type) {
cJSON *rat_type_local_nonprimitive;
if (!cJSON_IsArray(rat_type)) {
ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [rat_type]");
goto end;
}
rat_typeList = OpenAPI_list_create();
cJSON_ArrayForEach(rat_type_local_nonprimitive, rat_type ) {
if (!cJSON_IsString(rat_type_local_nonprimitive)){
cJSON *rat_type_local = NULL;
if (!cJSON_IsArray(rat_type)) {
ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [rat_type]");
goto end;
}
OpenAPI_list_add(rat_typeList, (void *)OpenAPI_rat_type_FromString(rat_type_local_nonprimitive->valuestring));
}
rat_typeList = OpenAPI_list_create();
cJSON_ArrayForEach(rat_type_local, rat_type) {
if (!cJSON_IsString(rat_type_local)) {
ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [rat_type]");
goto end;
}
OpenAPI_list_add(rat_typeList, (void *)OpenAPI_rat_type_FromString(rat_type_local->valuestring));
}
}
cJSON *rat_types_ts = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "ratTypesTs");
rat_types_ts = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "ratTypesTs");
if (rat_types_ts) {
if (!cJSON_IsString(rat_types_ts)) {
if (!cJSON_IsString(rat_types_ts) && !cJSON_IsNull(rat_types_ts)) {
ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [rat_types_ts]");
goto end;
}
}
cJSON *supp_feat = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "suppFeat");
supp_feat = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "suppFeat");
if (supp_feat) {
if (!cJSON_IsString(supp_feat)) {
if (!cJSON_IsString(supp_feat) && !cJSON_IsNull(supp_feat)) {
ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [supp_feat]");
goto end;
}
@ -530,30 +570,60 @@ OpenAPI_access_and_mobility_data_t *OpenAPI_access_and_mobility_data_parseFromJS
access_and_mobility_data_local_var = OpenAPI_access_and_mobility_data_create (
location ? location_local_nonprim : NULL,
location_ts ? ogs_strdup(location_ts->valuestring) : NULL,
time_zone ? ogs_strdup(time_zone->valuestring) : NULL,
time_zone_ts ? ogs_strdup(time_zone_ts->valuestring) : NULL,
location_ts && !cJSON_IsNull(location_ts) ? ogs_strdup(location_ts->valuestring) : NULL,
time_zone && !cJSON_IsNull(time_zone) ? ogs_strdup(time_zone->valuestring) : NULL,
time_zone_ts && !cJSON_IsNull(time_zone_ts) ? ogs_strdup(time_zone_ts->valuestring) : NULL,
access_type ? access_typeVariable : 0,
reg_states ? reg_statesList : NULL,
reg_states_ts ? ogs_strdup(reg_states_ts->valuestring) : NULL,
reg_states_ts && !cJSON_IsNull(reg_states_ts) ? ogs_strdup(reg_states_ts->valuestring) : NULL,
conn_states ? conn_statesList : NULL,
conn_states_ts ? ogs_strdup(conn_states_ts->valuestring) : NULL,
conn_states_ts && !cJSON_IsNull(conn_states_ts) ? ogs_strdup(conn_states_ts->valuestring) : NULL,
reachability_status ? reachability_status_local_nonprim : NULL,
reachability_status_ts ? ogs_strdup(reachability_status_ts->valuestring) : NULL,
reachability_status_ts && !cJSON_IsNull(reachability_status_ts) ? ogs_strdup(reachability_status_ts->valuestring) : NULL,
sms_over_nas_status ? sms_over_nas_statusVariable : 0,
sms_over_nas_status_ts ? ogs_strdup(sms_over_nas_status_ts->valuestring) : NULL,
sms_over_nas_status_ts && !cJSON_IsNull(sms_over_nas_status_ts) ? ogs_strdup(sms_over_nas_status_ts->valuestring) : NULL,
roaming_status ? true : false,
roaming_status ? roaming_status->valueint : 0,
roaming_status_ts ? ogs_strdup(roaming_status_ts->valuestring) : NULL,
roaming_status_ts && !cJSON_IsNull(roaming_status_ts) ? ogs_strdup(roaming_status_ts->valuestring) : NULL,
current_plmn ? current_plmn_local_nonprim : NULL,
current_plmn_ts ? ogs_strdup(current_plmn_ts->valuestring) : NULL,
current_plmn_ts && !cJSON_IsNull(current_plmn_ts) ? ogs_strdup(current_plmn_ts->valuestring) : NULL,
rat_type ? rat_typeList : NULL,
rat_types_ts ? ogs_strdup(rat_types_ts->valuestring) : NULL,
supp_feat ? ogs_strdup(supp_feat->valuestring) : NULL
rat_types_ts && !cJSON_IsNull(rat_types_ts) ? ogs_strdup(rat_types_ts->valuestring) : NULL,
supp_feat && !cJSON_IsNull(supp_feat) ? ogs_strdup(supp_feat->valuestring) : NULL
);
return access_and_mobility_data_local_var;
end:
if (location_local_nonprim) {
OpenAPI_user_location_free(location_local_nonprim);
location_local_nonprim = NULL;
}
if (reg_statesList) {
OpenAPI_list_for_each(reg_statesList, node) {
OpenAPI_rm_info_free(node->data);
}
OpenAPI_list_free(reg_statesList);
reg_statesList = NULL;
}
if (conn_statesList) {
OpenAPI_list_for_each(conn_statesList, node) {
OpenAPI_cm_info_free(node->data);
}
OpenAPI_list_free(conn_statesList);
conn_statesList = NULL;
}
if (reachability_status_local_nonprim) {
OpenAPI_ue_reachability_free(reachability_status_local_nonprim);
reachability_status_local_nonprim = NULL;
}
if (current_plmn_local_nonprim) {
OpenAPI_plmn_id_1_free(current_plmn_local_nonprim);
current_plmn_local_nonprim = NULL;
}
if (rat_typeList) {
OpenAPI_list_free(rat_typeList);
rat_typeList = NULL;
}
return NULL;
}

File diff suppressed because it is too large Load Diff

View File

@ -28,7 +28,7 @@
#include "service_area_restriction.h"
#include "sor_info.h"
#include "sor_update_indicator.h"
#include "trace_data_1.h"
#include "trace_data.h"
#include "upu_info.h"
#include "wireline_area.h"
#include "wireline_service_area_restriction.h"
@ -77,7 +77,7 @@ typedef struct OpenAPI_access_and_mobility_subscription_data_s {
int service_gap_time;
OpenAPI_mdt_user_consent_e mdt_user_consent;
struct OpenAPI_mdt_configuration_s *mdt_configuration;
struct OpenAPI_trace_data_1_s *trace_data;
struct OpenAPI_trace_data_s *trace_data;
struct OpenAPI_cag_data_s *cag_data;
char *stn_sr;
char *c_msisdn;
@ -139,7 +139,7 @@ OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_sub
int service_gap_time,
OpenAPI_mdt_user_consent_e mdt_user_consent,
OpenAPI_mdt_configuration_t *mdt_configuration,
OpenAPI_trace_data_1_t *trace_data,
OpenAPI_trace_data_t *trace_data,
OpenAPI_cag_data_t *cag_data,
char *stn_sr,
char *c_msisdn,

File diff suppressed because it is too large Load Diff

View File

@ -20,20 +20,25 @@ OpenAPI_access_net_charging_identifier_t *OpenAPI_access_net_charging_identifier
void OpenAPI_access_net_charging_identifier_free(OpenAPI_access_net_charging_identifier_t *access_net_charging_identifier)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == access_net_charging_identifier) {
return;
}
OpenAPI_lnode_t *node;
OpenAPI_list_for_each(access_net_charging_identifier->flows, node) {
OpenAPI_flows_free(node->data);
if (access_net_charging_identifier->flows) {
OpenAPI_list_for_each(access_net_charging_identifier->flows, node) {
OpenAPI_flows_free(node->data);
}
OpenAPI_list_free(access_net_charging_identifier->flows);
access_net_charging_identifier->flows = NULL;
}
OpenAPI_list_free(access_net_charging_identifier->flows);
ogs_free(access_net_charging_identifier);
}
cJSON *OpenAPI_access_net_charging_identifier_convertToJSON(OpenAPI_access_net_charging_identifier_t *access_net_charging_identifier)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (access_net_charging_identifier == NULL) {
ogs_error("OpenAPI_access_net_charging_identifier_convertToJSON() failed [AccessNetChargingIdentifier]");
@ -52,17 +57,13 @@ cJSON *OpenAPI_access_net_charging_identifier_convertToJSON(OpenAPI_access_net_c
ogs_error("OpenAPI_access_net_charging_identifier_convertToJSON() failed [flows]");
goto end;
}
OpenAPI_lnode_t *flows_node;
if (access_net_charging_identifier->flows) {
OpenAPI_list_for_each(access_net_charging_identifier->flows, flows_node) {
cJSON *itemLocal = OpenAPI_flows_convertToJSON(flows_node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_access_net_charging_identifier_convertToJSON() failed [flows]");
goto end;
}
cJSON_AddItemToArray(flowsList, itemLocal);
OpenAPI_list_for_each(access_net_charging_identifier->flows, node) {
cJSON *itemLocal = OpenAPI_flows_convertToJSON(node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_access_net_charging_identifier_convertToJSON() failed [flows]");
goto end;
}
cJSON_AddItemToArray(flowsList, itemLocal);
}
}
@ -73,44 +74,43 @@ end:
OpenAPI_access_net_charging_identifier_t *OpenAPI_access_net_charging_identifier_parseFromJSON(cJSON *access_net_charging_identifierJSON)
{
OpenAPI_access_net_charging_identifier_t *access_net_charging_identifier_local_var = NULL;
cJSON *acc_net_cha_id_value = cJSON_GetObjectItemCaseSensitive(access_net_charging_identifierJSON, "accNetChaIdValue");
OpenAPI_lnode_t *node = NULL;
cJSON *acc_net_cha_id_value = NULL;
cJSON *flows = NULL;
OpenAPI_list_t *flowsList = NULL;
acc_net_cha_id_value = cJSON_GetObjectItemCaseSensitive(access_net_charging_identifierJSON, "accNetChaIdValue");
if (!acc_net_cha_id_value) {
ogs_error("OpenAPI_access_net_charging_identifier_parseFromJSON() failed [acc_net_cha_id_value]");
goto end;
}
if (!cJSON_IsNumber(acc_net_cha_id_value)) {
ogs_error("OpenAPI_access_net_charging_identifier_parseFromJSON() failed [acc_net_cha_id_value]");
goto end;
}
cJSON *flows = cJSON_GetObjectItemCaseSensitive(access_net_charging_identifierJSON, "flows");
OpenAPI_list_t *flowsList;
flows = cJSON_GetObjectItemCaseSensitive(access_net_charging_identifierJSON, "flows");
if (flows) {
cJSON *flows_local_nonprimitive;
if (!cJSON_IsArray(flows)){
ogs_error("OpenAPI_access_net_charging_identifier_parseFromJSON() failed [flows]");
goto end;
}
flowsList = OpenAPI_list_create();
cJSON_ArrayForEach(flows_local_nonprimitive, flows ) {
if (!cJSON_IsObject(flows_local_nonprimitive)) {
cJSON *flows_local = NULL;
if (!cJSON_IsArray(flows)) {
ogs_error("OpenAPI_access_net_charging_identifier_parseFromJSON() failed [flows]");
goto end;
}
OpenAPI_flows_t *flowsItem = OpenAPI_flows_parseFromJSON(flows_local_nonprimitive);
if (!flowsItem) {
ogs_error("No flowsItem");
OpenAPI_list_free(flowsList);
goto end;
flowsList = OpenAPI_list_create();
cJSON_ArrayForEach(flows_local, flows) {
if (!cJSON_IsObject(flows_local)) {
ogs_error("OpenAPI_access_net_charging_identifier_parseFromJSON() failed [flows]");
goto end;
}
OpenAPI_flows_t *flowsItem = OpenAPI_flows_parseFromJSON(flows_local);
if (!flowsItem) {
ogs_error("No flowsItem");
OpenAPI_list_free(flowsList);
goto end;
}
OpenAPI_list_add(flowsList, flowsItem);
}
OpenAPI_list_add(flowsList, flowsItem);
}
}
access_net_charging_identifier_local_var = OpenAPI_access_net_charging_identifier_create (
@ -121,6 +121,13 @@ OpenAPI_access_net_charging_identifier_t *OpenAPI_access_net_charging_identifier
return access_net_charging_identifier_local_var;
end:
if (flowsList) {
OpenAPI_list_for_each(flowsList, node) {
OpenAPI_flows_free(node->data);
}
OpenAPI_list_free(flowsList);
flowsList = NULL;
}
return NULL;
}

View File

@ -16,16 +16,18 @@ OpenAPI_access_right_status_t *OpenAPI_access_right_status_create(
void OpenAPI_access_right_status_free(OpenAPI_access_right_status_t *access_right_status)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == access_right_status) {
return;
}
OpenAPI_lnode_t *node;
ogs_free(access_right_status);
}
cJSON *OpenAPI_access_right_status_convertToJSON(OpenAPI_access_right_status_t *access_right_status)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (access_right_status == NULL) {
ogs_error("OpenAPI_access_right_status_convertToJSON() failed [AccessRightStatus]");
@ -40,6 +42,7 @@ end:
OpenAPI_access_right_status_t *OpenAPI_access_right_status_parseFromJSON(cJSON *access_right_statusJSON)
{
OpenAPI_access_right_status_t *access_right_status_local_var = NULL;
OpenAPI_lnode_t *node = NULL;
access_right_status_local_var = OpenAPI_access_right_status_create (
);

View File

@ -16,16 +16,18 @@ OpenAPI_access_tech_t *OpenAPI_access_tech_create(
void OpenAPI_access_tech_free(OpenAPI_access_tech_t *access_tech)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == access_tech) {
return;
}
OpenAPI_lnode_t *node;
ogs_free(access_tech);
}
cJSON *OpenAPI_access_tech_convertToJSON(OpenAPI_access_tech_t *access_tech)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (access_tech == NULL) {
ogs_error("OpenAPI_access_tech_convertToJSON() failed [AccessTech]");
@ -40,6 +42,7 @@ end:
OpenAPI_access_tech_t *OpenAPI_access_tech_parseFromJSON(cJSON *access_techJSON)
{
OpenAPI_access_tech_t *access_tech_local_var = NULL;
OpenAPI_lnode_t *node = NULL;
access_tech_local_var = OpenAPI_access_tech_create (
);

View File

@ -45,18 +45,26 @@ OpenAPI_access_token_err_t *OpenAPI_access_token_err_create(
void OpenAPI_access_token_err_free(OpenAPI_access_token_err_t *access_token_err)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == access_token_err) {
return;
}
OpenAPI_lnode_t *node;
ogs_free(access_token_err->error_description);
ogs_free(access_token_err->error_uri);
if (access_token_err->error_description) {
ogs_free(access_token_err->error_description);
access_token_err->error_description = NULL;
}
if (access_token_err->error_uri) {
ogs_free(access_token_err->error_uri);
access_token_err->error_uri = NULL;
}
ogs_free(access_token_err);
}
cJSON *OpenAPI_access_token_err_convertToJSON(OpenAPI_access_token_err_t *access_token_err)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (access_token_err == NULL) {
ogs_error("OpenAPI_access_token_err_convertToJSON() failed [AccessTokenErr]");
@ -64,6 +72,10 @@ cJSON *OpenAPI_access_token_err_convertToJSON(OpenAPI_access_token_err_t *access
}
item = cJSON_CreateObject();
if (access_token_err->error == OpenAPI_access_token_err_ERROR_NULL) {
ogs_error("OpenAPI_access_token_err_convertToJSON() failed [error]");
return NULL;
}
if (cJSON_AddStringToObject(item, "error", OpenAPI_erroraccess_token_err_ToString(access_token_err->error)) == NULL) {
ogs_error("OpenAPI_access_token_err_convertToJSON() failed [error]");
goto end;
@ -90,32 +102,33 @@ end:
OpenAPI_access_token_err_t *OpenAPI_access_token_err_parseFromJSON(cJSON *access_token_errJSON)
{
OpenAPI_access_token_err_t *access_token_err_local_var = NULL;
cJSON *error = cJSON_GetObjectItemCaseSensitive(access_token_errJSON, "error");
OpenAPI_lnode_t *node = NULL;
cJSON *error = NULL;
OpenAPI_access_token_err_error_e errorVariable = 0;
cJSON *error_description = NULL;
cJSON *error_uri = NULL;
error = cJSON_GetObjectItemCaseSensitive(access_token_errJSON, "error");
if (!error) {
ogs_error("OpenAPI_access_token_err_parseFromJSON() failed [error]");
goto end;
}
OpenAPI_access_token_err_error_e errorVariable;
if (!cJSON_IsString(error)) {
ogs_error("OpenAPI_access_token_err_parseFromJSON() failed [error]");
goto end;
}
errorVariable = OpenAPI_erroraccess_token_err_FromString(error->valuestring);
cJSON *error_description = cJSON_GetObjectItemCaseSensitive(access_token_errJSON, "error_description");
error_description = cJSON_GetObjectItemCaseSensitive(access_token_errJSON, "error_description");
if (error_description) {
if (!cJSON_IsString(error_description)) {
if (!cJSON_IsString(error_description) && !cJSON_IsNull(error_description)) {
ogs_error("OpenAPI_access_token_err_parseFromJSON() failed [error_description]");
goto end;
}
}
cJSON *error_uri = cJSON_GetObjectItemCaseSensitive(access_token_errJSON, "error_uri");
error_uri = cJSON_GetObjectItemCaseSensitive(access_token_errJSON, "error_uri");
if (error_uri) {
if (!cJSON_IsString(error_uri)) {
if (!cJSON_IsString(error_uri) && !cJSON_IsNull(error_uri)) {
ogs_error("OpenAPI_access_token_err_parseFromJSON() failed [error_uri]");
goto end;
}
@ -123,8 +136,8 @@ OpenAPI_access_token_err_t *OpenAPI_access_token_err_parseFromJSON(cJSON *access
access_token_err_local_var = OpenAPI_access_token_err_create (
errorVariable,
error_description ? ogs_strdup(error_description->valuestring) : NULL,
error_uri ? ogs_strdup(error_uri->valuestring) : NULL
error_description && !cJSON_IsNull(error_description) ? ogs_strdup(error_description->valuestring) : NULL,
error_uri && !cJSON_IsNull(error_uri) ? ogs_strdup(error_uri->valuestring) : NULL
);
return access_token_err_local_var;

View File

@ -71,44 +71,85 @@ OpenAPI_access_token_req_t *OpenAPI_access_token_req_create(
void OpenAPI_access_token_req_free(OpenAPI_access_token_req_t *access_token_req)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == access_token_req) {
return;
}
OpenAPI_lnode_t *node;
ogs_free(access_token_req->nf_instance_id);
ogs_free(access_token_req->scope);
ogs_free(access_token_req->target_nf_instance_id);
OpenAPI_plmn_id_free(access_token_req->requester_plmn);
OpenAPI_list_for_each(access_token_req->requester_plmn_list, node) {
OpenAPI_plmn_id_free(node->data);
if (access_token_req->nf_instance_id) {
ogs_free(access_token_req->nf_instance_id);
access_token_req->nf_instance_id = NULL;
}
OpenAPI_list_free(access_token_req->requester_plmn_list);
OpenAPI_list_for_each(access_token_req->requester_snssai_list, node) {
OpenAPI_snssai_free(node->data);
if (access_token_req->scope) {
ogs_free(access_token_req->scope);
access_token_req->scope = NULL;
}
OpenAPI_list_free(access_token_req->requester_snssai_list);
ogs_free(access_token_req->requester_fqdn);
OpenAPI_list_for_each(access_token_req->requester_snpn_list, node) {
OpenAPI_plmn_id_nid_free(node->data);
if (access_token_req->target_nf_instance_id) {
ogs_free(access_token_req->target_nf_instance_id);
access_token_req->target_nf_instance_id = NULL;
}
OpenAPI_list_free(access_token_req->requester_snpn_list);
OpenAPI_plmn_id_free(access_token_req->target_plmn);
OpenAPI_list_for_each(access_token_req->target_snssai_list, node) {
OpenAPI_snssai_free(node->data);
if (access_token_req->requester_plmn) {
OpenAPI_plmn_id_free(access_token_req->requester_plmn);
access_token_req->requester_plmn = NULL;
}
OpenAPI_list_free(access_token_req->target_snssai_list);
OpenAPI_list_for_each(access_token_req->target_nsi_list, node) {
ogs_free(node->data);
if (access_token_req->requester_plmn_list) {
OpenAPI_list_for_each(access_token_req->requester_plmn_list, node) {
OpenAPI_plmn_id_free(node->data);
}
OpenAPI_list_free(access_token_req->requester_plmn_list);
access_token_req->requester_plmn_list = NULL;
}
if (access_token_req->requester_snssai_list) {
OpenAPI_list_for_each(access_token_req->requester_snssai_list, node) {
OpenAPI_snssai_free(node->data);
}
OpenAPI_list_free(access_token_req->requester_snssai_list);
access_token_req->requester_snssai_list = NULL;
}
if (access_token_req->requester_fqdn) {
ogs_free(access_token_req->requester_fqdn);
access_token_req->requester_fqdn = NULL;
}
if (access_token_req->requester_snpn_list) {
OpenAPI_list_for_each(access_token_req->requester_snpn_list, node) {
OpenAPI_plmn_id_nid_free(node->data);
}
OpenAPI_list_free(access_token_req->requester_snpn_list);
access_token_req->requester_snpn_list = NULL;
}
if (access_token_req->target_plmn) {
OpenAPI_plmn_id_free(access_token_req->target_plmn);
access_token_req->target_plmn = NULL;
}
if (access_token_req->target_snssai_list) {
OpenAPI_list_for_each(access_token_req->target_snssai_list, node) {
OpenAPI_snssai_free(node->data);
}
OpenAPI_list_free(access_token_req->target_snssai_list);
access_token_req->target_snssai_list = NULL;
}
if (access_token_req->target_nsi_list) {
OpenAPI_list_for_each(access_token_req->target_nsi_list, node) {
ogs_free(node->data);
}
OpenAPI_list_free(access_token_req->target_nsi_list);
access_token_req->target_nsi_list = NULL;
}
if (access_token_req->target_nf_set_id) {
ogs_free(access_token_req->target_nf_set_id);
access_token_req->target_nf_set_id = NULL;
}
if (access_token_req->target_nf_service_set_id) {
ogs_free(access_token_req->target_nf_service_set_id);
access_token_req->target_nf_service_set_id = NULL;
}
OpenAPI_list_free(access_token_req->target_nsi_list);
ogs_free(access_token_req->target_nf_set_id);
ogs_free(access_token_req->target_nf_service_set_id);
ogs_free(access_token_req);
}
cJSON *OpenAPI_access_token_req_convertToJSON(OpenAPI_access_token_req_t *access_token_req)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (access_token_req == NULL) {
ogs_error("OpenAPI_access_token_req_convertToJSON() failed [AccessTokenReq]");
@ -116,30 +157,42 @@ cJSON *OpenAPI_access_token_req_convertToJSON(OpenAPI_access_token_req_t *access
}
item = cJSON_CreateObject();
if (access_token_req->grant_type == OpenAPI_access_token_req_GRANTTYPE_NULL) {
ogs_error("OpenAPI_access_token_req_convertToJSON() failed [grant_type]");
return NULL;
}
if (cJSON_AddStringToObject(item, "grant_type", OpenAPI_grant_typeaccess_token_req_ToString(access_token_req->grant_type)) == NULL) {
ogs_error("OpenAPI_access_token_req_convertToJSON() failed [grant_type]");
goto end;
}
if (!access_token_req->nf_instance_id) {
ogs_error("OpenAPI_access_token_req_convertToJSON() failed [nf_instance_id]");
return NULL;
}
if (cJSON_AddStringToObject(item, "nfInstanceId", access_token_req->nf_instance_id) == NULL) {
ogs_error("OpenAPI_access_token_req_convertToJSON() failed [nf_instance_id]");
goto end;
}
if (access_token_req->nf_type) {
if (access_token_req->nf_type != OpenAPI_nf_type_NULL) {
if (cJSON_AddStringToObject(item, "nfType", OpenAPI_nf_type_ToString(access_token_req->nf_type)) == NULL) {
ogs_error("OpenAPI_access_token_req_convertToJSON() failed [nf_type]");
goto end;
}
}
if (access_token_req->target_nf_type) {
if (access_token_req->target_nf_type != OpenAPI_nf_type_NULL) {
if (cJSON_AddStringToObject(item, "targetNfType", OpenAPI_nf_type_ToString(access_token_req->target_nf_type)) == NULL) {
ogs_error("OpenAPI_access_token_req_convertToJSON() failed [target_nf_type]");
goto end;
}
}
if (!access_token_req->scope) {
ogs_error("OpenAPI_access_token_req_convertToJSON() failed [scope]");
return NULL;
}
if (cJSON_AddStringToObject(item, "scope", access_token_req->scope) == NULL) {
ogs_error("OpenAPI_access_token_req_convertToJSON() failed [scope]");
goto end;
@ -171,17 +224,13 @@ cJSON *OpenAPI_access_token_req_convertToJSON(OpenAPI_access_token_req_t *access
ogs_error("OpenAPI_access_token_req_convertToJSON() failed [requester_plmn_list]");
goto end;
}
OpenAPI_lnode_t *requester_plmn_list_node;
if (access_token_req->requester_plmn_list) {
OpenAPI_list_for_each(access_token_req->requester_plmn_list, requester_plmn_list_node) {
cJSON *itemLocal = OpenAPI_plmn_id_convertToJSON(requester_plmn_list_node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_access_token_req_convertToJSON() failed [requester_plmn_list]");
goto end;
}
cJSON_AddItemToArray(requester_plmn_listList, itemLocal);
OpenAPI_list_for_each(access_token_req->requester_plmn_list, node) {
cJSON *itemLocal = OpenAPI_plmn_id_convertToJSON(node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_access_token_req_convertToJSON() failed [requester_plmn_list]");
goto end;
}
cJSON_AddItemToArray(requester_plmn_listList, itemLocal);
}
}
@ -191,17 +240,13 @@ cJSON *OpenAPI_access_token_req_convertToJSON(OpenAPI_access_token_req_t *access
ogs_error("OpenAPI_access_token_req_convertToJSON() failed [requester_snssai_list]");
goto end;
}
OpenAPI_lnode_t *requester_snssai_list_node;
if (access_token_req->requester_snssai_list) {
OpenAPI_list_for_each(access_token_req->requester_snssai_list, requester_snssai_list_node) {
cJSON *itemLocal = OpenAPI_snssai_convertToJSON(requester_snssai_list_node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_access_token_req_convertToJSON() failed [requester_snssai_list]");
goto end;
}
cJSON_AddItemToArray(requester_snssai_listList, itemLocal);
OpenAPI_list_for_each(access_token_req->requester_snssai_list, node) {
cJSON *itemLocal = OpenAPI_snssai_convertToJSON(node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_access_token_req_convertToJSON() failed [requester_snssai_list]");
goto end;
}
cJSON_AddItemToArray(requester_snssai_listList, itemLocal);
}
}
@ -218,17 +263,13 @@ cJSON *OpenAPI_access_token_req_convertToJSON(OpenAPI_access_token_req_t *access
ogs_error("OpenAPI_access_token_req_convertToJSON() failed [requester_snpn_list]");
goto end;
}
OpenAPI_lnode_t *requester_snpn_list_node;
if (access_token_req->requester_snpn_list) {
OpenAPI_list_for_each(access_token_req->requester_snpn_list, requester_snpn_list_node) {
cJSON *itemLocal = OpenAPI_plmn_id_nid_convertToJSON(requester_snpn_list_node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_access_token_req_convertToJSON() failed [requester_snpn_list]");
goto end;
}
cJSON_AddItemToArray(requester_snpn_listList, itemLocal);
OpenAPI_list_for_each(access_token_req->requester_snpn_list, node) {
cJSON *itemLocal = OpenAPI_plmn_id_nid_convertToJSON(node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_access_token_req_convertToJSON() failed [requester_snpn_list]");
goto end;
}
cJSON_AddItemToArray(requester_snpn_listList, itemLocal);
}
}
@ -251,34 +292,28 @@ cJSON *OpenAPI_access_token_req_convertToJSON(OpenAPI_access_token_req_t *access
ogs_error("OpenAPI_access_token_req_convertToJSON() failed [target_snssai_list]");
goto end;
}
OpenAPI_lnode_t *target_snssai_list_node;
if (access_token_req->target_snssai_list) {
OpenAPI_list_for_each(access_token_req->target_snssai_list, target_snssai_list_node) {
cJSON *itemLocal = OpenAPI_snssai_convertToJSON(target_snssai_list_node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_access_token_req_convertToJSON() failed [target_snssai_list]");
goto end;
}
cJSON_AddItemToArray(target_snssai_listList, itemLocal);
OpenAPI_list_for_each(access_token_req->target_snssai_list, node) {
cJSON *itemLocal = OpenAPI_snssai_convertToJSON(node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_access_token_req_convertToJSON() failed [target_snssai_list]");
goto end;
}
cJSON_AddItemToArray(target_snssai_listList, itemLocal);
}
}
if (access_token_req->target_nsi_list) {
cJSON *target_nsi_list = cJSON_AddArrayToObject(item, "targetNsiList");
if (target_nsi_list == NULL) {
cJSON *target_nsi_listList = cJSON_AddArrayToObject(item, "targetNsiList");
if (target_nsi_listList == NULL) {
ogs_error("OpenAPI_access_token_req_convertToJSON() failed [target_nsi_list]");
goto end;
}
OpenAPI_lnode_t *target_nsi_list_node;
OpenAPI_list_for_each(access_token_req->target_nsi_list, target_nsi_list_node) {
if (cJSON_AddStringToObject(target_nsi_list, "", (char*)target_nsi_list_node->data) == NULL) {
ogs_error("OpenAPI_access_token_req_convertToJSON() failed [target_nsi_list]");
goto end;
OpenAPI_list_for_each(access_token_req->target_nsi_list, node) {
if (cJSON_AddStringToObject(target_nsi_listList, "", (char*)node->data) == NULL) {
ogs_error("OpenAPI_access_token_req_convertToJSON() failed [target_nsi_list]");
goto end;
}
}
}
}
if (access_token_req->target_nf_set_id) {
@ -302,33 +337,55 @@ end:
OpenAPI_access_token_req_t *OpenAPI_access_token_req_parseFromJSON(cJSON *access_token_reqJSON)
{
OpenAPI_access_token_req_t *access_token_req_local_var = NULL;
cJSON *grant_type = cJSON_GetObjectItemCaseSensitive(access_token_reqJSON, "grant_type");
OpenAPI_lnode_t *node = NULL;
cJSON *grant_type = NULL;
OpenAPI_access_token_req_grant_type_e grant_typeVariable = 0;
cJSON *nf_instance_id = NULL;
cJSON *nf_type = NULL;
OpenAPI_nf_type_e nf_typeVariable = 0;
cJSON *target_nf_type = NULL;
OpenAPI_nf_type_e target_nf_typeVariable = 0;
cJSON *scope = NULL;
cJSON *target_nf_instance_id = NULL;
cJSON *requester_plmn = NULL;
OpenAPI_plmn_id_t *requester_plmn_local_nonprim = NULL;
cJSON *requester_plmn_list = NULL;
OpenAPI_list_t *requester_plmn_listList = NULL;
cJSON *requester_snssai_list = NULL;
OpenAPI_list_t *requester_snssai_listList = NULL;
cJSON *requester_fqdn = NULL;
cJSON *requester_snpn_list = NULL;
OpenAPI_list_t *requester_snpn_listList = NULL;
cJSON *target_plmn = NULL;
OpenAPI_plmn_id_t *target_plmn_local_nonprim = NULL;
cJSON *target_snssai_list = NULL;
OpenAPI_list_t *target_snssai_listList = NULL;
cJSON *target_nsi_list = NULL;
OpenAPI_list_t *target_nsi_listList = NULL;
cJSON *target_nf_set_id = NULL;
cJSON *target_nf_service_set_id = NULL;
grant_type = cJSON_GetObjectItemCaseSensitive(access_token_reqJSON, "grant_type");
if (!grant_type) {
ogs_error("OpenAPI_access_token_req_parseFromJSON() failed [grant_type]");
goto end;
}
OpenAPI_access_token_req_grant_type_e grant_typeVariable;
if (!cJSON_IsString(grant_type)) {
ogs_error("OpenAPI_access_token_req_parseFromJSON() failed [grant_type]");
goto end;
}
grant_typeVariable = OpenAPI_grant_typeaccess_token_req_FromString(grant_type->valuestring);
cJSON *nf_instance_id = cJSON_GetObjectItemCaseSensitive(access_token_reqJSON, "nfInstanceId");
nf_instance_id = cJSON_GetObjectItemCaseSensitive(access_token_reqJSON, "nfInstanceId");
if (!nf_instance_id) {
ogs_error("OpenAPI_access_token_req_parseFromJSON() failed [nf_instance_id]");
goto end;
}
if (!cJSON_IsString(nf_instance_id)) {
ogs_error("OpenAPI_access_token_req_parseFromJSON() failed [nf_instance_id]");
goto end;
}
cJSON *nf_type = cJSON_GetObjectItemCaseSensitive(access_token_reqJSON, "nfType");
OpenAPI_nf_type_e nf_typeVariable;
nf_type = cJSON_GetObjectItemCaseSensitive(access_token_reqJSON, "nfType");
if (nf_type) {
if (!cJSON_IsString(nf_type)) {
ogs_error("OpenAPI_access_token_req_parseFromJSON() failed [nf_type]");
@ -337,9 +394,7 @@ OpenAPI_access_token_req_t *OpenAPI_access_token_req_parseFromJSON(cJSON *access
nf_typeVariable = OpenAPI_nf_type_FromString(nf_type->valuestring);
}
cJSON *target_nf_type = cJSON_GetObjectItemCaseSensitive(access_token_reqJSON, "targetNfType");
OpenAPI_nf_type_e target_nf_typeVariable;
target_nf_type = cJSON_GetObjectItemCaseSensitive(access_token_reqJSON, "targetNfType");
if (target_nf_type) {
if (!cJSON_IsString(target_nf_type)) {
ogs_error("OpenAPI_access_token_req_parseFromJSON() failed [target_nf_type]");
@ -348,198 +403,174 @@ OpenAPI_access_token_req_t *OpenAPI_access_token_req_parseFromJSON(cJSON *access
target_nf_typeVariable = OpenAPI_nf_type_FromString(target_nf_type->valuestring);
}
cJSON *scope = cJSON_GetObjectItemCaseSensitive(access_token_reqJSON, "scope");
scope = cJSON_GetObjectItemCaseSensitive(access_token_reqJSON, "scope");
if (!scope) {
ogs_error("OpenAPI_access_token_req_parseFromJSON() failed [scope]");
goto end;
}
if (!cJSON_IsString(scope)) {
ogs_error("OpenAPI_access_token_req_parseFromJSON() failed [scope]");
goto end;
}
cJSON *target_nf_instance_id = cJSON_GetObjectItemCaseSensitive(access_token_reqJSON, "targetNfInstanceId");
target_nf_instance_id = cJSON_GetObjectItemCaseSensitive(access_token_reqJSON, "targetNfInstanceId");
if (target_nf_instance_id) {
if (!cJSON_IsString(target_nf_instance_id)) {
if (!cJSON_IsString(target_nf_instance_id) && !cJSON_IsNull(target_nf_instance_id)) {
ogs_error("OpenAPI_access_token_req_parseFromJSON() failed [target_nf_instance_id]");
goto end;
}
}
cJSON *requester_plmn = cJSON_GetObjectItemCaseSensitive(access_token_reqJSON, "requesterPlmn");
OpenAPI_plmn_id_t *requester_plmn_local_nonprim = NULL;
requester_plmn = cJSON_GetObjectItemCaseSensitive(access_token_reqJSON, "requesterPlmn");
if (requester_plmn) {
requester_plmn_local_nonprim = OpenAPI_plmn_id_parseFromJSON(requester_plmn);
}
cJSON *requester_plmn_list = cJSON_GetObjectItemCaseSensitive(access_token_reqJSON, "requesterPlmnList");
OpenAPI_list_t *requester_plmn_listList;
requester_plmn_list = cJSON_GetObjectItemCaseSensitive(access_token_reqJSON, "requesterPlmnList");
if (requester_plmn_list) {
cJSON *requester_plmn_list_local_nonprimitive;
if (!cJSON_IsArray(requester_plmn_list)){
ogs_error("OpenAPI_access_token_req_parseFromJSON() failed [requester_plmn_list]");
goto end;
}
requester_plmn_listList = OpenAPI_list_create();
cJSON_ArrayForEach(requester_plmn_list_local_nonprimitive, requester_plmn_list ) {
if (!cJSON_IsObject(requester_plmn_list_local_nonprimitive)) {
cJSON *requester_plmn_list_local = NULL;
if (!cJSON_IsArray(requester_plmn_list)) {
ogs_error("OpenAPI_access_token_req_parseFromJSON() failed [requester_plmn_list]");
goto end;
}
OpenAPI_plmn_id_t *requester_plmn_listItem = OpenAPI_plmn_id_parseFromJSON(requester_plmn_list_local_nonprimitive);
if (!requester_plmn_listItem) {
ogs_error("No requester_plmn_listItem");
OpenAPI_list_free(requester_plmn_listList);
goto end;
requester_plmn_listList = OpenAPI_list_create();
cJSON_ArrayForEach(requester_plmn_list_local, requester_plmn_list) {
if (!cJSON_IsObject(requester_plmn_list_local)) {
ogs_error("OpenAPI_access_token_req_parseFromJSON() failed [requester_plmn_list]");
goto end;
}
OpenAPI_plmn_id_t *requester_plmn_listItem = OpenAPI_plmn_id_parseFromJSON(requester_plmn_list_local);
if (!requester_plmn_listItem) {
ogs_error("No requester_plmn_listItem");
OpenAPI_list_free(requester_plmn_listList);
goto end;
}
OpenAPI_list_add(requester_plmn_listList, requester_plmn_listItem);
}
OpenAPI_list_add(requester_plmn_listList, requester_plmn_listItem);
}
}
cJSON *requester_snssai_list = cJSON_GetObjectItemCaseSensitive(access_token_reqJSON, "requesterSnssaiList");
OpenAPI_list_t *requester_snssai_listList;
requester_snssai_list = cJSON_GetObjectItemCaseSensitive(access_token_reqJSON, "requesterSnssaiList");
if (requester_snssai_list) {
cJSON *requester_snssai_list_local_nonprimitive;
if (!cJSON_IsArray(requester_snssai_list)){
ogs_error("OpenAPI_access_token_req_parseFromJSON() failed [requester_snssai_list]");
goto end;
}
requester_snssai_listList = OpenAPI_list_create();
cJSON_ArrayForEach(requester_snssai_list_local_nonprimitive, requester_snssai_list ) {
if (!cJSON_IsObject(requester_snssai_list_local_nonprimitive)) {
cJSON *requester_snssai_list_local = NULL;
if (!cJSON_IsArray(requester_snssai_list)) {
ogs_error("OpenAPI_access_token_req_parseFromJSON() failed [requester_snssai_list]");
goto end;
}
OpenAPI_snssai_t *requester_snssai_listItem = OpenAPI_snssai_parseFromJSON(requester_snssai_list_local_nonprimitive);
if (!requester_snssai_listItem) {
ogs_error("No requester_snssai_listItem");
OpenAPI_list_free(requester_snssai_listList);
goto end;
requester_snssai_listList = OpenAPI_list_create();
cJSON_ArrayForEach(requester_snssai_list_local, requester_snssai_list) {
if (!cJSON_IsObject(requester_snssai_list_local)) {
ogs_error("OpenAPI_access_token_req_parseFromJSON() failed [requester_snssai_list]");
goto end;
}
OpenAPI_snssai_t *requester_snssai_listItem = OpenAPI_snssai_parseFromJSON(requester_snssai_list_local);
if (!requester_snssai_listItem) {
ogs_error("No requester_snssai_listItem");
OpenAPI_list_free(requester_snssai_listList);
goto end;
}
OpenAPI_list_add(requester_snssai_listList, requester_snssai_listItem);
}
OpenAPI_list_add(requester_snssai_listList, requester_snssai_listItem);
}
}
cJSON *requester_fqdn = cJSON_GetObjectItemCaseSensitive(access_token_reqJSON, "requesterFqdn");
requester_fqdn = cJSON_GetObjectItemCaseSensitive(access_token_reqJSON, "requesterFqdn");
if (requester_fqdn) {
if (!cJSON_IsString(requester_fqdn)) {
if (!cJSON_IsString(requester_fqdn) && !cJSON_IsNull(requester_fqdn)) {
ogs_error("OpenAPI_access_token_req_parseFromJSON() failed [requester_fqdn]");
goto end;
}
}
cJSON *requester_snpn_list = cJSON_GetObjectItemCaseSensitive(access_token_reqJSON, "requesterSnpnList");
OpenAPI_list_t *requester_snpn_listList;
requester_snpn_list = cJSON_GetObjectItemCaseSensitive(access_token_reqJSON, "requesterSnpnList");
if (requester_snpn_list) {
cJSON *requester_snpn_list_local_nonprimitive;
if (!cJSON_IsArray(requester_snpn_list)){
ogs_error("OpenAPI_access_token_req_parseFromJSON() failed [requester_snpn_list]");
goto end;
}
requester_snpn_listList = OpenAPI_list_create();
cJSON_ArrayForEach(requester_snpn_list_local_nonprimitive, requester_snpn_list ) {
if (!cJSON_IsObject(requester_snpn_list_local_nonprimitive)) {
cJSON *requester_snpn_list_local = NULL;
if (!cJSON_IsArray(requester_snpn_list)) {
ogs_error("OpenAPI_access_token_req_parseFromJSON() failed [requester_snpn_list]");
goto end;
}
OpenAPI_plmn_id_nid_t *requester_snpn_listItem = OpenAPI_plmn_id_nid_parseFromJSON(requester_snpn_list_local_nonprimitive);
if (!requester_snpn_listItem) {
ogs_error("No requester_snpn_listItem");
OpenAPI_list_free(requester_snpn_listList);
goto end;
requester_snpn_listList = OpenAPI_list_create();
cJSON_ArrayForEach(requester_snpn_list_local, requester_snpn_list) {
if (!cJSON_IsObject(requester_snpn_list_local)) {
ogs_error("OpenAPI_access_token_req_parseFromJSON() failed [requester_snpn_list]");
goto end;
}
OpenAPI_plmn_id_nid_t *requester_snpn_listItem = OpenAPI_plmn_id_nid_parseFromJSON(requester_snpn_list_local);
if (!requester_snpn_listItem) {
ogs_error("No requester_snpn_listItem");
OpenAPI_list_free(requester_snpn_listList);
goto end;
}
OpenAPI_list_add(requester_snpn_listList, requester_snpn_listItem);
}
OpenAPI_list_add(requester_snpn_listList, requester_snpn_listItem);
}
}
cJSON *target_plmn = cJSON_GetObjectItemCaseSensitive(access_token_reqJSON, "targetPlmn");
OpenAPI_plmn_id_t *target_plmn_local_nonprim = NULL;
target_plmn = cJSON_GetObjectItemCaseSensitive(access_token_reqJSON, "targetPlmn");
if (target_plmn) {
target_plmn_local_nonprim = OpenAPI_plmn_id_parseFromJSON(target_plmn);
}
cJSON *target_snssai_list = cJSON_GetObjectItemCaseSensitive(access_token_reqJSON, "targetSnssaiList");
OpenAPI_list_t *target_snssai_listList;
target_snssai_list = cJSON_GetObjectItemCaseSensitive(access_token_reqJSON, "targetSnssaiList");
if (target_snssai_list) {
cJSON *target_snssai_list_local_nonprimitive;
if (!cJSON_IsArray(target_snssai_list)){
ogs_error("OpenAPI_access_token_req_parseFromJSON() failed [target_snssai_list]");
goto end;
}
target_snssai_listList = OpenAPI_list_create();
cJSON_ArrayForEach(target_snssai_list_local_nonprimitive, target_snssai_list ) {
if (!cJSON_IsObject(target_snssai_list_local_nonprimitive)) {
cJSON *target_snssai_list_local = NULL;
if (!cJSON_IsArray(target_snssai_list)) {
ogs_error("OpenAPI_access_token_req_parseFromJSON() failed [target_snssai_list]");
goto end;
}
OpenAPI_snssai_t *target_snssai_listItem = OpenAPI_snssai_parseFromJSON(target_snssai_list_local_nonprimitive);
if (!target_snssai_listItem) {
ogs_error("No target_snssai_listItem");
OpenAPI_list_free(target_snssai_listList);
target_snssai_listList = OpenAPI_list_create();
cJSON_ArrayForEach(target_snssai_list_local, target_snssai_list) {
if (!cJSON_IsObject(target_snssai_list_local)) {
ogs_error("OpenAPI_access_token_req_parseFromJSON() failed [target_snssai_list]");
goto end;
}
OpenAPI_snssai_t *target_snssai_listItem = OpenAPI_snssai_parseFromJSON(target_snssai_list_local);
if (!target_snssai_listItem) {
ogs_error("No target_snssai_listItem");
OpenAPI_list_free(target_snssai_listList);
goto end;
}
OpenAPI_list_add(target_snssai_listList, target_snssai_listItem);
}
}
target_nsi_list = cJSON_GetObjectItemCaseSensitive(access_token_reqJSON, "targetNsiList");
if (target_nsi_list) {
cJSON *target_nsi_list_local = NULL;
if (!cJSON_IsArray(target_nsi_list)) {
ogs_error("OpenAPI_access_token_req_parseFromJSON() failed [target_nsi_list]");
goto end;
}
OpenAPI_list_add(target_snssai_listList, target_snssai_listItem);
}
target_nsi_listList = OpenAPI_list_create();
cJSON_ArrayForEach(target_nsi_list_local, target_nsi_list) {
double *localDouble = NULL;
int *localInt = NULL;
if (!cJSON_IsString(target_nsi_list_local)) {
ogs_error("OpenAPI_access_token_req_parseFromJSON() failed [target_nsi_list]");
goto end;
}
OpenAPI_list_add(target_nsi_listList, ogs_strdup(target_nsi_list_local->valuestring));
}
}
cJSON *target_nsi_list = cJSON_GetObjectItemCaseSensitive(access_token_reqJSON, "targetNsiList");
OpenAPI_list_t *target_nsi_listList;
if (target_nsi_list) {
cJSON *target_nsi_list_local;
if (!cJSON_IsArray(target_nsi_list)) {
ogs_error("OpenAPI_access_token_req_parseFromJSON() failed [target_nsi_list]");
goto end;
}
target_nsi_listList = OpenAPI_list_create();
cJSON_ArrayForEach(target_nsi_list_local, target_nsi_list) {
if (!cJSON_IsString(target_nsi_list_local)) {
ogs_error("OpenAPI_access_token_req_parseFromJSON() failed [target_nsi_list]");
goto end;
}
OpenAPI_list_add(target_nsi_listList, ogs_strdup(target_nsi_list_local->valuestring));
}
}
cJSON *target_nf_set_id = cJSON_GetObjectItemCaseSensitive(access_token_reqJSON, "targetNfSetId");
target_nf_set_id = cJSON_GetObjectItemCaseSensitive(access_token_reqJSON, "targetNfSetId");
if (target_nf_set_id) {
if (!cJSON_IsString(target_nf_set_id)) {
if (!cJSON_IsString(target_nf_set_id) && !cJSON_IsNull(target_nf_set_id)) {
ogs_error("OpenAPI_access_token_req_parseFromJSON() failed [target_nf_set_id]");
goto end;
}
}
cJSON *target_nf_service_set_id = cJSON_GetObjectItemCaseSensitive(access_token_reqJSON, "targetNfServiceSetId");
target_nf_service_set_id = cJSON_GetObjectItemCaseSensitive(access_token_reqJSON, "targetNfServiceSetId");
if (target_nf_service_set_id) {
if (!cJSON_IsString(target_nf_service_set_id)) {
if (!cJSON_IsString(target_nf_service_set_id) && !cJSON_IsNull(target_nf_service_set_id)) {
ogs_error("OpenAPI_access_token_req_parseFromJSON() failed [target_nf_service_set_id]");
goto end;
}
@ -551,21 +582,64 @@ OpenAPI_access_token_req_t *OpenAPI_access_token_req_parseFromJSON(cJSON *access
nf_type ? nf_typeVariable : 0,
target_nf_type ? target_nf_typeVariable : 0,
ogs_strdup(scope->valuestring),
target_nf_instance_id ? ogs_strdup(target_nf_instance_id->valuestring) : NULL,
target_nf_instance_id && !cJSON_IsNull(target_nf_instance_id) ? ogs_strdup(target_nf_instance_id->valuestring) : NULL,
requester_plmn ? requester_plmn_local_nonprim : NULL,
requester_plmn_list ? requester_plmn_listList : NULL,
requester_snssai_list ? requester_snssai_listList : NULL,
requester_fqdn ? ogs_strdup(requester_fqdn->valuestring) : NULL,
requester_fqdn && !cJSON_IsNull(requester_fqdn) ? ogs_strdup(requester_fqdn->valuestring) : NULL,
requester_snpn_list ? requester_snpn_listList : NULL,
target_plmn ? target_plmn_local_nonprim : NULL,
target_snssai_list ? target_snssai_listList : NULL,
target_nsi_list ? target_nsi_listList : NULL,
target_nf_set_id ? ogs_strdup(target_nf_set_id->valuestring) : NULL,
target_nf_service_set_id ? ogs_strdup(target_nf_service_set_id->valuestring) : NULL
target_nf_set_id && !cJSON_IsNull(target_nf_set_id) ? ogs_strdup(target_nf_set_id->valuestring) : NULL,
target_nf_service_set_id && !cJSON_IsNull(target_nf_service_set_id) ? ogs_strdup(target_nf_service_set_id->valuestring) : NULL
);
return access_token_req_local_var;
end:
if (requester_plmn_local_nonprim) {
OpenAPI_plmn_id_free(requester_plmn_local_nonprim);
requester_plmn_local_nonprim = NULL;
}
if (requester_plmn_listList) {
OpenAPI_list_for_each(requester_plmn_listList, node) {
OpenAPI_plmn_id_free(node->data);
}
OpenAPI_list_free(requester_plmn_listList);
requester_plmn_listList = NULL;
}
if (requester_snssai_listList) {
OpenAPI_list_for_each(requester_snssai_listList, node) {
OpenAPI_snssai_free(node->data);
}
OpenAPI_list_free(requester_snssai_listList);
requester_snssai_listList = NULL;
}
if (requester_snpn_listList) {
OpenAPI_list_for_each(requester_snpn_listList, node) {
OpenAPI_plmn_id_nid_free(node->data);
}
OpenAPI_list_free(requester_snpn_listList);
requester_snpn_listList = NULL;
}
if (target_plmn_local_nonprim) {
OpenAPI_plmn_id_free(target_plmn_local_nonprim);
target_plmn_local_nonprim = NULL;
}
if (target_snssai_listList) {
OpenAPI_list_for_each(target_snssai_listList, node) {
OpenAPI_snssai_free(node->data);
}
OpenAPI_list_free(target_snssai_listList);
target_snssai_listList = NULL;
}
if (target_nsi_listList) {
OpenAPI_list_for_each(target_nsi_listList, node) {
ogs_free(node->data);
}
OpenAPI_list_free(target_nsi_listList);
target_nsi_listList = NULL;
}
return NULL;
}

View File

@ -16,16 +16,18 @@ OpenAPI_access_type_rm_t *OpenAPI_access_type_rm_create(
void OpenAPI_access_type_rm_free(OpenAPI_access_type_rm_t *access_type_rm)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == access_type_rm) {
return;
}
OpenAPI_lnode_t *node;
ogs_free(access_type_rm);
}
cJSON *OpenAPI_access_type_rm_convertToJSON(OpenAPI_access_type_rm_t *access_type_rm)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (access_type_rm == NULL) {
ogs_error("OpenAPI_access_type_rm_convertToJSON() failed [AccessTypeRm]");
@ -40,6 +42,7 @@ end:
OpenAPI_access_type_rm_t *OpenAPI_access_type_rm_parseFromJSON(cJSON *access_type_rmJSON)
{
OpenAPI_access_type_rm_t *access_type_rm_local_var = NULL;
OpenAPI_lnode_t *node = NULL;
access_type_rm_local_var = OpenAPI_access_type_rm_create (
);

View File

@ -50,17 +50,22 @@ OpenAPI_accu_usage_report_t *OpenAPI_accu_usage_report_create(
void OpenAPI_accu_usage_report_free(OpenAPI_accu_usage_report_t *accu_usage_report)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == accu_usage_report) {
return;
}
OpenAPI_lnode_t *node;
ogs_free(accu_usage_report->ref_um_ids);
if (accu_usage_report->ref_um_ids) {
ogs_free(accu_usage_report->ref_um_ids);
accu_usage_report->ref_um_ids = NULL;
}
ogs_free(accu_usage_report);
}
cJSON *OpenAPI_accu_usage_report_convertToJSON(OpenAPI_accu_usage_report_t *accu_usage_report)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (accu_usage_report == NULL) {
ogs_error("OpenAPI_accu_usage_report_convertToJSON() failed [AccuUsageReport]");
@ -68,6 +73,10 @@ cJSON *OpenAPI_accu_usage_report_convertToJSON(OpenAPI_accu_usage_report_t *accu
}
item = cJSON_CreateObject();
if (!accu_usage_report->ref_um_ids) {
ogs_error("OpenAPI_accu_usage_report_convertToJSON() failed [ref_um_ids]");
return NULL;
}
if (cJSON_AddStringToObject(item, "refUmIds", accu_usage_report->ref_um_ids) == NULL) {
ogs_error("OpenAPI_accu_usage_report_convertToJSON() failed [ref_um_ids]");
goto end;
@ -136,19 +145,27 @@ end:
OpenAPI_accu_usage_report_t *OpenAPI_accu_usage_report_parseFromJSON(cJSON *accu_usage_reportJSON)
{
OpenAPI_accu_usage_report_t *accu_usage_report_local_var = NULL;
cJSON *ref_um_ids = cJSON_GetObjectItemCaseSensitive(accu_usage_reportJSON, "refUmIds");
OpenAPI_lnode_t *node = NULL;
cJSON *ref_um_ids = NULL;
cJSON *vol_usage = NULL;
cJSON *vol_usage_uplink = NULL;
cJSON *vol_usage_downlink = NULL;
cJSON *time_usage = NULL;
cJSON *next_vol_usage = NULL;
cJSON *next_vol_usage_uplink = NULL;
cJSON *next_vol_usage_downlink = NULL;
cJSON *next_time_usage = NULL;
ref_um_ids = cJSON_GetObjectItemCaseSensitive(accu_usage_reportJSON, "refUmIds");
if (!ref_um_ids) {
ogs_error("OpenAPI_accu_usage_report_parseFromJSON() failed [ref_um_ids]");
goto end;
}
if (!cJSON_IsString(ref_um_ids)) {
ogs_error("OpenAPI_accu_usage_report_parseFromJSON() failed [ref_um_ids]");
goto end;
}
cJSON *vol_usage = cJSON_GetObjectItemCaseSensitive(accu_usage_reportJSON, "volUsage");
vol_usage = cJSON_GetObjectItemCaseSensitive(accu_usage_reportJSON, "volUsage");
if (vol_usage) {
if (!cJSON_IsNumber(vol_usage)) {
ogs_error("OpenAPI_accu_usage_report_parseFromJSON() failed [vol_usage]");
@ -156,8 +173,7 @@ OpenAPI_accu_usage_report_t *OpenAPI_accu_usage_report_parseFromJSON(cJSON *accu
}
}
cJSON *vol_usage_uplink = cJSON_GetObjectItemCaseSensitive(accu_usage_reportJSON, "volUsageUplink");
vol_usage_uplink = cJSON_GetObjectItemCaseSensitive(accu_usage_reportJSON, "volUsageUplink");
if (vol_usage_uplink) {
if (!cJSON_IsNumber(vol_usage_uplink)) {
ogs_error("OpenAPI_accu_usage_report_parseFromJSON() failed [vol_usage_uplink]");
@ -165,8 +181,7 @@ OpenAPI_accu_usage_report_t *OpenAPI_accu_usage_report_parseFromJSON(cJSON *accu
}
}
cJSON *vol_usage_downlink = cJSON_GetObjectItemCaseSensitive(accu_usage_reportJSON, "volUsageDownlink");
vol_usage_downlink = cJSON_GetObjectItemCaseSensitive(accu_usage_reportJSON, "volUsageDownlink");
if (vol_usage_downlink) {
if (!cJSON_IsNumber(vol_usage_downlink)) {
ogs_error("OpenAPI_accu_usage_report_parseFromJSON() failed [vol_usage_downlink]");
@ -174,8 +189,7 @@ OpenAPI_accu_usage_report_t *OpenAPI_accu_usage_report_parseFromJSON(cJSON *accu
}
}
cJSON *time_usage = cJSON_GetObjectItemCaseSensitive(accu_usage_reportJSON, "timeUsage");
time_usage = cJSON_GetObjectItemCaseSensitive(accu_usage_reportJSON, "timeUsage");
if (time_usage) {
if (!cJSON_IsNumber(time_usage)) {
ogs_error("OpenAPI_accu_usage_report_parseFromJSON() failed [time_usage]");
@ -183,8 +197,7 @@ OpenAPI_accu_usage_report_t *OpenAPI_accu_usage_report_parseFromJSON(cJSON *accu
}
}
cJSON *next_vol_usage = cJSON_GetObjectItemCaseSensitive(accu_usage_reportJSON, "nextVolUsage");
next_vol_usage = cJSON_GetObjectItemCaseSensitive(accu_usage_reportJSON, "nextVolUsage");
if (next_vol_usage) {
if (!cJSON_IsNumber(next_vol_usage)) {
ogs_error("OpenAPI_accu_usage_report_parseFromJSON() failed [next_vol_usage]");
@ -192,8 +205,7 @@ OpenAPI_accu_usage_report_t *OpenAPI_accu_usage_report_parseFromJSON(cJSON *accu
}
}
cJSON *next_vol_usage_uplink = cJSON_GetObjectItemCaseSensitive(accu_usage_reportJSON, "nextVolUsageUplink");
next_vol_usage_uplink = cJSON_GetObjectItemCaseSensitive(accu_usage_reportJSON, "nextVolUsageUplink");
if (next_vol_usage_uplink) {
if (!cJSON_IsNumber(next_vol_usage_uplink)) {
ogs_error("OpenAPI_accu_usage_report_parseFromJSON() failed [next_vol_usage_uplink]");
@ -201,8 +213,7 @@ OpenAPI_accu_usage_report_t *OpenAPI_accu_usage_report_parseFromJSON(cJSON *accu
}
}
cJSON *next_vol_usage_downlink = cJSON_GetObjectItemCaseSensitive(accu_usage_reportJSON, "nextVolUsageDownlink");
next_vol_usage_downlink = cJSON_GetObjectItemCaseSensitive(accu_usage_reportJSON, "nextVolUsageDownlink");
if (next_vol_usage_downlink) {
if (!cJSON_IsNumber(next_vol_usage_downlink)) {
ogs_error("OpenAPI_accu_usage_report_parseFromJSON() failed [next_vol_usage_downlink]");
@ -210,8 +221,7 @@ OpenAPI_accu_usage_report_t *OpenAPI_accu_usage_report_parseFromJSON(cJSON *accu
}
}
cJSON *next_time_usage = cJSON_GetObjectItemCaseSensitive(accu_usage_reportJSON, "nextTimeUsage");
next_time_usage = cJSON_GetObjectItemCaseSensitive(accu_usage_reportJSON, "nextTimeUsage");
if (next_time_usage) {
if (!cJSON_IsNumber(next_time_usage)) {
ogs_error("OpenAPI_accu_usage_report_parseFromJSON() failed [next_time_usage]");

View File

@ -32,16 +32,18 @@ OpenAPI_accumulated_usage_t *OpenAPI_accumulated_usage_create(
void OpenAPI_accumulated_usage_free(OpenAPI_accumulated_usage_t *accumulated_usage)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == accumulated_usage) {
return;
}
OpenAPI_lnode_t *node;
ogs_free(accumulated_usage);
}
cJSON *OpenAPI_accumulated_usage_convertToJSON(OpenAPI_accumulated_usage_t *accumulated_usage)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (accumulated_usage == NULL) {
ogs_error("OpenAPI_accumulated_usage_convertToJSON() failed [AccumulatedUsage]");
@ -84,8 +86,12 @@ end:
OpenAPI_accumulated_usage_t *OpenAPI_accumulated_usage_parseFromJSON(cJSON *accumulated_usageJSON)
{
OpenAPI_accumulated_usage_t *accumulated_usage_local_var = NULL;
cJSON *duration = cJSON_GetObjectItemCaseSensitive(accumulated_usageJSON, "duration");
OpenAPI_lnode_t *node = NULL;
cJSON *duration = NULL;
cJSON *total_volume = NULL;
cJSON *downlink_volume = NULL;
cJSON *uplink_volume = NULL;
duration = cJSON_GetObjectItemCaseSensitive(accumulated_usageJSON, "duration");
if (duration) {
if (!cJSON_IsNumber(duration)) {
ogs_error("OpenAPI_accumulated_usage_parseFromJSON() failed [duration]");
@ -93,8 +99,7 @@ OpenAPI_accumulated_usage_t *OpenAPI_accumulated_usage_parseFromJSON(cJSON *accu
}
}
cJSON *total_volume = cJSON_GetObjectItemCaseSensitive(accumulated_usageJSON, "totalVolume");
total_volume = cJSON_GetObjectItemCaseSensitive(accumulated_usageJSON, "totalVolume");
if (total_volume) {
if (!cJSON_IsNumber(total_volume)) {
ogs_error("OpenAPI_accumulated_usage_parseFromJSON() failed [total_volume]");
@ -102,8 +107,7 @@ OpenAPI_accumulated_usage_t *OpenAPI_accumulated_usage_parseFromJSON(cJSON *accu
}
}
cJSON *downlink_volume = cJSON_GetObjectItemCaseSensitive(accumulated_usageJSON, "downlinkVolume");
downlink_volume = cJSON_GetObjectItemCaseSensitive(accumulated_usageJSON, "downlinkVolume");
if (downlink_volume) {
if (!cJSON_IsNumber(downlink_volume)) {
ogs_error("OpenAPI_accumulated_usage_parseFromJSON() failed [downlink_volume]");
@ -111,8 +115,7 @@ OpenAPI_accumulated_usage_t *OpenAPI_accumulated_usage_parseFromJSON(cJSON *accu
}
}
cJSON *uplink_volume = cJSON_GetObjectItemCaseSensitive(accumulated_usageJSON, "uplinkVolume");
uplink_volume = cJSON_GetObjectItemCaseSensitive(accumulated_usageJSON, "uplinkVolume");
if (uplink_volume) {
if (!cJSON_IsNumber(uplink_volume)) {
ogs_error("OpenAPI_accumulated_usage_parseFromJSON() failed [uplink_volume]");

View File

@ -28,20 +28,34 @@ OpenAPI_acknowledge_info_t *OpenAPI_acknowledge_info_create(
void OpenAPI_acknowledge_info_free(OpenAPI_acknowledge_info_t *acknowledge_info)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == acknowledge_info) {
return;
}
OpenAPI_lnode_t *node;
ogs_free(acknowledge_info->sor_mac_iue);
ogs_free(acknowledge_info->upu_mac_iue);
ogs_free(acknowledge_info->secured_packet);
ogs_free(acknowledge_info->provisioning_time);
if (acknowledge_info->sor_mac_iue) {
ogs_free(acknowledge_info->sor_mac_iue);
acknowledge_info->sor_mac_iue = NULL;
}
if (acknowledge_info->upu_mac_iue) {
ogs_free(acknowledge_info->upu_mac_iue);
acknowledge_info->upu_mac_iue = NULL;
}
if (acknowledge_info->secured_packet) {
ogs_free(acknowledge_info->secured_packet);
acknowledge_info->secured_packet = NULL;
}
if (acknowledge_info->provisioning_time) {
ogs_free(acknowledge_info->provisioning_time);
acknowledge_info->provisioning_time = NULL;
}
ogs_free(acknowledge_info);
}
cJSON *OpenAPI_acknowledge_info_convertToJSON(OpenAPI_acknowledge_info_t *acknowledge_info)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (acknowledge_info == NULL) {
ogs_error("OpenAPI_acknowledge_info_convertToJSON() failed [AcknowledgeInfo]");
@ -70,6 +84,10 @@ cJSON *OpenAPI_acknowledge_info_convertToJSON(OpenAPI_acknowledge_info_t *acknow
}
}
if (!acknowledge_info->provisioning_time) {
ogs_error("OpenAPI_acknowledge_info_convertToJSON() failed [provisioning_time]");
return NULL;
}
if (cJSON_AddStringToObject(item, "provisioningTime", acknowledge_info->provisioning_time) == NULL) {
ogs_error("OpenAPI_acknowledge_info_convertToJSON() failed [provisioning_time]");
goto end;
@ -89,46 +107,47 @@ end:
OpenAPI_acknowledge_info_t *OpenAPI_acknowledge_info_parseFromJSON(cJSON *acknowledge_infoJSON)
{
OpenAPI_acknowledge_info_t *acknowledge_info_local_var = NULL;
cJSON *sor_mac_iue = cJSON_GetObjectItemCaseSensitive(acknowledge_infoJSON, "sorMacIue");
OpenAPI_lnode_t *node = NULL;
cJSON *sor_mac_iue = NULL;
cJSON *upu_mac_iue = NULL;
cJSON *secured_packet = NULL;
cJSON *provisioning_time = NULL;
cJSON *ue_not_reachable = NULL;
sor_mac_iue = cJSON_GetObjectItemCaseSensitive(acknowledge_infoJSON, "sorMacIue");
if (sor_mac_iue) {
if (!cJSON_IsString(sor_mac_iue)) {
if (!cJSON_IsString(sor_mac_iue) && !cJSON_IsNull(sor_mac_iue)) {
ogs_error("OpenAPI_acknowledge_info_parseFromJSON() failed [sor_mac_iue]");
goto end;
}
}
cJSON *upu_mac_iue = cJSON_GetObjectItemCaseSensitive(acknowledge_infoJSON, "upuMacIue");
upu_mac_iue = cJSON_GetObjectItemCaseSensitive(acknowledge_infoJSON, "upuMacIue");
if (upu_mac_iue) {
if (!cJSON_IsString(upu_mac_iue)) {
if (!cJSON_IsString(upu_mac_iue) && !cJSON_IsNull(upu_mac_iue)) {
ogs_error("OpenAPI_acknowledge_info_parseFromJSON() failed [upu_mac_iue]");
goto end;
}
}
cJSON *secured_packet = cJSON_GetObjectItemCaseSensitive(acknowledge_infoJSON, "securedPacket");
secured_packet = cJSON_GetObjectItemCaseSensitive(acknowledge_infoJSON, "securedPacket");
if (secured_packet) {
if (!cJSON_IsString(secured_packet)) {
if (!cJSON_IsString(secured_packet) && !cJSON_IsNull(secured_packet)) {
ogs_error("OpenAPI_acknowledge_info_parseFromJSON() failed [secured_packet]");
goto end;
}
}
cJSON *provisioning_time = cJSON_GetObjectItemCaseSensitive(acknowledge_infoJSON, "provisioningTime");
provisioning_time = cJSON_GetObjectItemCaseSensitive(acknowledge_infoJSON, "provisioningTime");
if (!provisioning_time) {
ogs_error("OpenAPI_acknowledge_info_parseFromJSON() failed [provisioning_time]");
goto end;
}
if (!cJSON_IsString(provisioning_time)) {
if (!cJSON_IsString(provisioning_time) && !cJSON_IsNull(provisioning_time)) {
ogs_error("OpenAPI_acknowledge_info_parseFromJSON() failed [provisioning_time]");
goto end;
}
cJSON *ue_not_reachable = cJSON_GetObjectItemCaseSensitive(acknowledge_infoJSON, "ueNotReachable");
ue_not_reachable = cJSON_GetObjectItemCaseSensitive(acknowledge_infoJSON, "ueNotReachable");
if (ue_not_reachable) {
if (!cJSON_IsBool(ue_not_reachable)) {
ogs_error("OpenAPI_acknowledge_info_parseFromJSON() failed [ue_not_reachable]");
@ -137,9 +156,9 @@ OpenAPI_acknowledge_info_t *OpenAPI_acknowledge_info_parseFromJSON(cJSON *acknow
}
acknowledge_info_local_var = OpenAPI_acknowledge_info_create (
sor_mac_iue ? ogs_strdup(sor_mac_iue->valuestring) : NULL,
upu_mac_iue ? ogs_strdup(upu_mac_iue->valuestring) : NULL,
secured_packet ? ogs_strdup(secured_packet->valuestring) : NULL,
sor_mac_iue && !cJSON_IsNull(sor_mac_iue) ? ogs_strdup(sor_mac_iue->valuestring) : NULL,
upu_mac_iue && !cJSON_IsNull(upu_mac_iue) ? ogs_strdup(upu_mac_iue->valuestring) : NULL,
secured_packet && !cJSON_IsNull(secured_packet) ? ogs_strdup(secured_packet->valuestring) : NULL,
ogs_strdup(provisioning_time->valuestring),
ue_not_reachable ? true : false,
ue_not_reachable ? ue_not_reachable->valueint : 0

View File

@ -22,19 +22,30 @@ OpenAPI_acs_info_t *OpenAPI_acs_info_create(
void OpenAPI_acs_info_free(OpenAPI_acs_info_t *acs_info)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == acs_info) {
return;
}
OpenAPI_lnode_t *node;
ogs_free(acs_info->acs_url);
ogs_free(acs_info->acs_ipv4_addr);
ogs_free(acs_info->acs_ipv6_addr);
if (acs_info->acs_url) {
ogs_free(acs_info->acs_url);
acs_info->acs_url = NULL;
}
if (acs_info->acs_ipv4_addr) {
ogs_free(acs_info->acs_ipv4_addr);
acs_info->acs_ipv4_addr = NULL;
}
if (acs_info->acs_ipv6_addr) {
ogs_free(acs_info->acs_ipv6_addr);
acs_info->acs_ipv6_addr = NULL;
}
ogs_free(acs_info);
}
cJSON *OpenAPI_acs_info_convertToJSON(OpenAPI_acs_info_t *acs_info)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (acs_info == NULL) {
ogs_error("OpenAPI_acs_info_convertToJSON() failed [AcsInfo]");
@ -70,37 +81,38 @@ end:
OpenAPI_acs_info_t *OpenAPI_acs_info_parseFromJSON(cJSON *acs_infoJSON)
{
OpenAPI_acs_info_t *acs_info_local_var = NULL;
cJSON *acs_url = cJSON_GetObjectItemCaseSensitive(acs_infoJSON, "acsUrl");
OpenAPI_lnode_t *node = NULL;
cJSON *acs_url = NULL;
cJSON *acs_ipv4_addr = NULL;
cJSON *acs_ipv6_addr = NULL;
acs_url = cJSON_GetObjectItemCaseSensitive(acs_infoJSON, "acsUrl");
if (acs_url) {
if (!cJSON_IsString(acs_url)) {
if (!cJSON_IsString(acs_url) && !cJSON_IsNull(acs_url)) {
ogs_error("OpenAPI_acs_info_parseFromJSON() failed [acs_url]");
goto end;
}
}
cJSON *acs_ipv4_addr = cJSON_GetObjectItemCaseSensitive(acs_infoJSON, "acsIpv4Addr");
acs_ipv4_addr = cJSON_GetObjectItemCaseSensitive(acs_infoJSON, "acsIpv4Addr");
if (acs_ipv4_addr) {
if (!cJSON_IsString(acs_ipv4_addr)) {
if (!cJSON_IsString(acs_ipv4_addr) && !cJSON_IsNull(acs_ipv4_addr)) {
ogs_error("OpenAPI_acs_info_parseFromJSON() failed [acs_ipv4_addr]");
goto end;
}
}
cJSON *acs_ipv6_addr = cJSON_GetObjectItemCaseSensitive(acs_infoJSON, "acsIpv6Addr");
acs_ipv6_addr = cJSON_GetObjectItemCaseSensitive(acs_infoJSON, "acsIpv6Addr");
if (acs_ipv6_addr) {
if (!cJSON_IsString(acs_ipv6_addr)) {
if (!cJSON_IsString(acs_ipv6_addr) && !cJSON_IsNull(acs_ipv6_addr)) {
ogs_error("OpenAPI_acs_info_parseFromJSON() failed [acs_ipv6_addr]");
goto end;
}
}
acs_info_local_var = OpenAPI_acs_info_create (
acs_url ? ogs_strdup(acs_url->valuestring) : NULL,
acs_ipv4_addr ? ogs_strdup(acs_ipv4_addr->valuestring) : NULL,
acs_ipv6_addr ? ogs_strdup(acs_ipv6_addr->valuestring) : NULL
acs_url && !cJSON_IsNull(acs_url) ? ogs_strdup(acs_url->valuestring) : NULL,
acs_ipv4_addr && !cJSON_IsNull(acs_ipv4_addr) ? ogs_strdup(acs_ipv4_addr->valuestring) : NULL,
acs_ipv6_addr && !cJSON_IsNull(acs_ipv6_addr) ? ogs_strdup(acs_ipv6_addr->valuestring) : NULL
);
return acs_info_local_var;

View File

@ -22,19 +22,30 @@ OpenAPI_acs_info_1_t *OpenAPI_acs_info_1_create(
void OpenAPI_acs_info_1_free(OpenAPI_acs_info_1_t *acs_info_1)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == acs_info_1) {
return;
}
OpenAPI_lnode_t *node;
ogs_free(acs_info_1->acs_url);
ogs_free(acs_info_1->acs_ipv4_addr);
ogs_free(acs_info_1->acs_ipv6_addr);
if (acs_info_1->acs_url) {
ogs_free(acs_info_1->acs_url);
acs_info_1->acs_url = NULL;
}
if (acs_info_1->acs_ipv4_addr) {
ogs_free(acs_info_1->acs_ipv4_addr);
acs_info_1->acs_ipv4_addr = NULL;
}
if (acs_info_1->acs_ipv6_addr) {
ogs_free(acs_info_1->acs_ipv6_addr);
acs_info_1->acs_ipv6_addr = NULL;
}
ogs_free(acs_info_1);
}
cJSON *OpenAPI_acs_info_1_convertToJSON(OpenAPI_acs_info_1_t *acs_info_1)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (acs_info_1 == NULL) {
ogs_error("OpenAPI_acs_info_1_convertToJSON() failed [AcsInfo_1]");
@ -70,37 +81,38 @@ end:
OpenAPI_acs_info_1_t *OpenAPI_acs_info_1_parseFromJSON(cJSON *acs_info_1JSON)
{
OpenAPI_acs_info_1_t *acs_info_1_local_var = NULL;
cJSON *acs_url = cJSON_GetObjectItemCaseSensitive(acs_info_1JSON, "acsUrl");
OpenAPI_lnode_t *node = NULL;
cJSON *acs_url = NULL;
cJSON *acs_ipv4_addr = NULL;
cJSON *acs_ipv6_addr = NULL;
acs_url = cJSON_GetObjectItemCaseSensitive(acs_info_1JSON, "acsUrl");
if (acs_url) {
if (!cJSON_IsString(acs_url)) {
if (!cJSON_IsString(acs_url) && !cJSON_IsNull(acs_url)) {
ogs_error("OpenAPI_acs_info_1_parseFromJSON() failed [acs_url]");
goto end;
}
}
cJSON *acs_ipv4_addr = cJSON_GetObjectItemCaseSensitive(acs_info_1JSON, "acsIpv4Addr");
acs_ipv4_addr = cJSON_GetObjectItemCaseSensitive(acs_info_1JSON, "acsIpv4Addr");
if (acs_ipv4_addr) {
if (!cJSON_IsString(acs_ipv4_addr)) {
if (!cJSON_IsString(acs_ipv4_addr) && !cJSON_IsNull(acs_ipv4_addr)) {
ogs_error("OpenAPI_acs_info_1_parseFromJSON() failed [acs_ipv4_addr]");
goto end;
}
}
cJSON *acs_ipv6_addr = cJSON_GetObjectItemCaseSensitive(acs_info_1JSON, "acsIpv6Addr");
acs_ipv6_addr = cJSON_GetObjectItemCaseSensitive(acs_info_1JSON, "acsIpv6Addr");
if (acs_ipv6_addr) {
if (!cJSON_IsString(acs_ipv6_addr)) {
if (!cJSON_IsString(acs_ipv6_addr) && !cJSON_IsNull(acs_ipv6_addr)) {
ogs_error("OpenAPI_acs_info_1_parseFromJSON() failed [acs_ipv6_addr]");
goto end;
}
}
acs_info_1_local_var = OpenAPI_acs_info_1_create (
acs_url ? ogs_strdup(acs_url->valuestring) : NULL,
acs_ipv4_addr ? ogs_strdup(acs_ipv4_addr->valuestring) : NULL,
acs_ipv6_addr ? ogs_strdup(acs_ipv6_addr->valuestring) : NULL
acs_url && !cJSON_IsNull(acs_url) ? ogs_strdup(acs_url->valuestring) : NULL,
acs_ipv4_addr && !cJSON_IsNull(acs_ipv4_addr) ? ogs_strdup(acs_ipv4_addr->valuestring) : NULL,
acs_ipv6_addr && !cJSON_IsNull(acs_ipv6_addr) ? ogs_strdup(acs_ipv6_addr->valuestring) : NULL
);
return acs_info_1_local_var;

View File

@ -22,19 +22,30 @@ OpenAPI_acs_info_rm_t *OpenAPI_acs_info_rm_create(
void OpenAPI_acs_info_rm_free(OpenAPI_acs_info_rm_t *acs_info_rm)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == acs_info_rm) {
return;
}
OpenAPI_lnode_t *node;
ogs_free(acs_info_rm->acs_url);
ogs_free(acs_info_rm->acs_ipv4_addr);
ogs_free(acs_info_rm->acs_ipv6_addr);
if (acs_info_rm->acs_url) {
ogs_free(acs_info_rm->acs_url);
acs_info_rm->acs_url = NULL;
}
if (acs_info_rm->acs_ipv4_addr) {
ogs_free(acs_info_rm->acs_ipv4_addr);
acs_info_rm->acs_ipv4_addr = NULL;
}
if (acs_info_rm->acs_ipv6_addr) {
ogs_free(acs_info_rm->acs_ipv6_addr);
acs_info_rm->acs_ipv6_addr = NULL;
}
ogs_free(acs_info_rm);
}
cJSON *OpenAPI_acs_info_rm_convertToJSON(OpenAPI_acs_info_rm_t *acs_info_rm)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (acs_info_rm == NULL) {
ogs_error("OpenAPI_acs_info_rm_convertToJSON() failed [AcsInfoRm]");
@ -70,37 +81,38 @@ end:
OpenAPI_acs_info_rm_t *OpenAPI_acs_info_rm_parseFromJSON(cJSON *acs_info_rmJSON)
{
OpenAPI_acs_info_rm_t *acs_info_rm_local_var = NULL;
cJSON *acs_url = cJSON_GetObjectItemCaseSensitive(acs_info_rmJSON, "acsUrl");
OpenAPI_lnode_t *node = NULL;
cJSON *acs_url = NULL;
cJSON *acs_ipv4_addr = NULL;
cJSON *acs_ipv6_addr = NULL;
acs_url = cJSON_GetObjectItemCaseSensitive(acs_info_rmJSON, "acsUrl");
if (acs_url) {
if (!cJSON_IsString(acs_url)) {
if (!cJSON_IsString(acs_url) && !cJSON_IsNull(acs_url)) {
ogs_error("OpenAPI_acs_info_rm_parseFromJSON() failed [acs_url]");
goto end;
}
}
cJSON *acs_ipv4_addr = cJSON_GetObjectItemCaseSensitive(acs_info_rmJSON, "acsIpv4Addr");
acs_ipv4_addr = cJSON_GetObjectItemCaseSensitive(acs_info_rmJSON, "acsIpv4Addr");
if (acs_ipv4_addr) {
if (!cJSON_IsString(acs_ipv4_addr)) {
if (!cJSON_IsString(acs_ipv4_addr) && !cJSON_IsNull(acs_ipv4_addr)) {
ogs_error("OpenAPI_acs_info_rm_parseFromJSON() failed [acs_ipv4_addr]");
goto end;
}
}
cJSON *acs_ipv6_addr = cJSON_GetObjectItemCaseSensitive(acs_info_rmJSON, "acsIpv6Addr");
acs_ipv6_addr = cJSON_GetObjectItemCaseSensitive(acs_info_rmJSON, "acsIpv6Addr");
if (acs_ipv6_addr) {
if (!cJSON_IsString(acs_ipv6_addr)) {
if (!cJSON_IsString(acs_ipv6_addr) && !cJSON_IsNull(acs_ipv6_addr)) {
ogs_error("OpenAPI_acs_info_rm_parseFromJSON() failed [acs_ipv6_addr]");
goto end;
}
}
acs_info_rm_local_var = OpenAPI_acs_info_rm_create (
acs_url ? ogs_strdup(acs_url->valuestring) : NULL,
acs_ipv4_addr ? ogs_strdup(acs_ipv4_addr->valuestring) : NULL,
acs_ipv6_addr ? ogs_strdup(acs_ipv6_addr->valuestring) : NULL
acs_url && !cJSON_IsNull(acs_url) ? ogs_strdup(acs_url->valuestring) : NULL,
acs_ipv4_addr && !cJSON_IsNull(acs_ipv4_addr) ? ogs_strdup(acs_ipv4_addr->valuestring) : NULL,
acs_ipv6_addr && !cJSON_IsNull(acs_ipv6_addr) ? ogs_strdup(acs_ipv6_addr->valuestring) : NULL
);
return acs_info_rm_local_var;

View File

@ -20,16 +20,18 @@ OpenAPI_additional_access_info_t *OpenAPI_additional_access_info_create(
void OpenAPI_additional_access_info_free(OpenAPI_additional_access_info_t *additional_access_info)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == additional_access_info) {
return;
}
OpenAPI_lnode_t *node;
ogs_free(additional_access_info);
}
cJSON *OpenAPI_additional_access_info_convertToJSON(OpenAPI_additional_access_info_t *additional_access_info)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (additional_access_info == NULL) {
ogs_error("OpenAPI_additional_access_info_convertToJSON() failed [AdditionalAccessInfo]");
@ -37,12 +39,16 @@ cJSON *OpenAPI_additional_access_info_convertToJSON(OpenAPI_additional_access_in
}
item = cJSON_CreateObject();
if (additional_access_info->access_type == OpenAPI_access_type_NULL) {
ogs_error("OpenAPI_additional_access_info_convertToJSON() failed [access_type]");
return NULL;
}
if (cJSON_AddStringToObject(item, "accessType", OpenAPI_access_type_ToString(additional_access_info->access_type)) == NULL) {
ogs_error("OpenAPI_additional_access_info_convertToJSON() failed [access_type]");
goto end;
}
if (additional_access_info->rat_type) {
if (additional_access_info->rat_type != OpenAPI_rat_type_NULL) {
if (cJSON_AddStringToObject(item, "ratType", OpenAPI_rat_type_ToString(additional_access_info->rat_type)) == NULL) {
ogs_error("OpenAPI_additional_access_info_convertToJSON() failed [rat_type]");
goto end;
@ -56,22 +62,23 @@ end:
OpenAPI_additional_access_info_t *OpenAPI_additional_access_info_parseFromJSON(cJSON *additional_access_infoJSON)
{
OpenAPI_additional_access_info_t *additional_access_info_local_var = NULL;
cJSON *access_type = cJSON_GetObjectItemCaseSensitive(additional_access_infoJSON, "accessType");
OpenAPI_lnode_t *node = NULL;
cJSON *access_type = NULL;
OpenAPI_access_type_e access_typeVariable = 0;
cJSON *rat_type = NULL;
OpenAPI_rat_type_e rat_typeVariable = 0;
access_type = cJSON_GetObjectItemCaseSensitive(additional_access_infoJSON, "accessType");
if (!access_type) {
ogs_error("OpenAPI_additional_access_info_parseFromJSON() failed [access_type]");
goto end;
}
OpenAPI_access_type_e access_typeVariable;
if (!cJSON_IsString(access_type)) {
ogs_error("OpenAPI_additional_access_info_parseFromJSON() failed [access_type]");
goto end;
}
access_typeVariable = OpenAPI_access_type_FromString(access_type->valuestring);
cJSON *rat_type = cJSON_GetObjectItemCaseSensitive(additional_access_infoJSON, "ratType");
OpenAPI_rat_type_e rat_typeVariable;
rat_type = cJSON_GetObjectItemCaseSensitive(additional_access_infoJSON, "ratType");
if (rat_type) {
if (!cJSON_IsString(rat_type)) {
ogs_error("OpenAPI_additional_access_info_parseFromJSON() failed [rat_type]");

View File

@ -20,16 +20,18 @@ OpenAPI_additional_snssai_data_t *OpenAPI_additional_snssai_data_create(
void OpenAPI_additional_snssai_data_free(OpenAPI_additional_snssai_data_t *additional_snssai_data)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == additional_snssai_data) {
return;
}
OpenAPI_lnode_t *node;
ogs_free(additional_snssai_data);
}
cJSON *OpenAPI_additional_snssai_data_convertToJSON(OpenAPI_additional_snssai_data_t *additional_snssai_data)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (additional_snssai_data == NULL) {
ogs_error("OpenAPI_additional_snssai_data_convertToJSON() failed [AdditionalSnssaiData]");
@ -51,8 +53,9 @@ end:
OpenAPI_additional_snssai_data_t *OpenAPI_additional_snssai_data_parseFromJSON(cJSON *additional_snssai_dataJSON)
{
OpenAPI_additional_snssai_data_t *additional_snssai_data_local_var = NULL;
cJSON *required_authn_authz = cJSON_GetObjectItemCaseSensitive(additional_snssai_dataJSON, "requiredAuthnAuthz");
OpenAPI_lnode_t *node = NULL;
cJSON *required_authn_authz = NULL;
required_authn_authz = cJSON_GetObjectItemCaseSensitive(additional_snssai_dataJSON, "requiredAuthnAuthz");
if (required_authn_authz) {
if (!cJSON_IsBool(required_authn_authz)) {
ogs_error("OpenAPI_additional_snssai_data_parseFromJSON() failed [required_authn_authz]");

View File

@ -6,7 +6,7 @@
char* OpenAPI_af_event_ToString(OpenAPI_af_event_e af_event)
{
const char *af_eventArray[] = { "NULL", "ACCESS_TYPE_CHANGE", "ANI_REPORT", "CHARGING_CORRELATION", "EPS_FALLBACK", "FAILED_RESOURCES_ALLOCATION", "OUT_OF_CREDIT", "PLMN_CHG", "QOS_MONITORING", "QOS_NOTIF", "RAN_NAS_CAUSE", "REALLOCATION_OF_CREDIT", "SUCCESSFUL_RESOURCES_ALLOCATION", "TSN_BRIDGE_INFO", "USAGE_REPORT" };
const char *af_eventArray[] = { "NULL", "SVC_EXPERIENCE", "UE_MOBILITY", "UE_COMM", "EXCEPTIONS" };
size_t sizeofArray = sizeof(af_eventArray) / sizeof(af_eventArray[0]);
if (af_event < sizeofArray)
return (char *)af_eventArray[af_event];
@ -17,7 +17,7 @@ char* OpenAPI_af_event_ToString(OpenAPI_af_event_e af_event)
OpenAPI_af_event_e OpenAPI_af_event_FromString(char* af_event)
{
int stringToReturn = 0;
const char *af_eventArray[] = { "NULL", "ACCESS_TYPE_CHANGE", "ANI_REPORT", "CHARGING_CORRELATION", "EPS_FALLBACK", "FAILED_RESOURCES_ALLOCATION", "OUT_OF_CREDIT", "PLMN_CHG", "QOS_MONITORING", "QOS_NOTIF", "RAN_NAS_CAUSE", "REALLOCATION_OF_CREDIT", "SUCCESSFUL_RESOURCES_ALLOCATION", "TSN_BRIDGE_INFO", "USAGE_REPORT" };
const char *af_eventArray[] = { "NULL", "SVC_EXPERIENCE", "UE_MOBILITY", "UE_COMM", "EXCEPTIONS" };
size_t sizeofArray = sizeof(af_eventArray) / sizeof(af_eventArray[0]);
while (stringToReturn < sizeofArray) {
if (strcmp(af_event, af_eventArray[stringToReturn]) == 0) {

View File

@ -17,7 +17,7 @@
extern "C" {
#endif
typedef enum { OpenAPI_af_event_NULL = 0, OpenAPI_af_event_ACCESS_TYPE_CHANGE, OpenAPI_af_event_ANI_REPORT, OpenAPI_af_event_CHARGING_CORRELATION, OpenAPI_af_event_EPS_FALLBACK, OpenAPI_af_event_FAILED_RESOURCES_ALLOCATION, OpenAPI_af_event_OUT_OF_CREDIT, OpenAPI_af_event_PLMN_CHG, OpenAPI_af_event_QOS_MONITORING, OpenAPI_af_event_QOS_NOTIF, OpenAPI_af_event_RAN_NAS_CAUSE, OpenAPI_af_event_REALLOCATION_OF_CREDIT, OpenAPI_af_event_SUCCESSFUL_RESOURCES_ALLOCATION, OpenAPI_af_event_TSN_BRIDGE_INFO, OpenAPI_af_event_USAGE_REPORT } OpenAPI_af_event_e;
typedef enum { OpenAPI_af_event_NULL = 0, OpenAPI_af_event_SVC_EXPERIENCE, OpenAPI_af_event_UE_MOBILITY, OpenAPI_af_event_UE_COMM, OpenAPI_af_event_EXCEPTIONS } OpenAPI_af_event_e;
char* OpenAPI_af_event_ToString(OpenAPI_af_event_e af_event);

View File

@ -22,25 +22,36 @@ OpenAPI_af_event_exposure_data_t *OpenAPI_af_event_exposure_data_create(
void OpenAPI_af_event_exposure_data_free(OpenAPI_af_event_exposure_data_t *af_event_exposure_data)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == af_event_exposure_data) {
return;
}
OpenAPI_lnode_t *node;
OpenAPI_list_free(af_event_exposure_data->af_events);
OpenAPI_list_for_each(af_event_exposure_data->af_ids, node) {
ogs_free(node->data);
if (af_event_exposure_data->af_events) {
OpenAPI_list_free(af_event_exposure_data->af_events);
af_event_exposure_data->af_events = NULL;
}
OpenAPI_list_free(af_event_exposure_data->af_ids);
OpenAPI_list_for_each(af_event_exposure_data->app_ids, node) {
ogs_free(node->data);
if (af_event_exposure_data->af_ids) {
OpenAPI_list_for_each(af_event_exposure_data->af_ids, node) {
ogs_free(node->data);
}
OpenAPI_list_free(af_event_exposure_data->af_ids);
af_event_exposure_data->af_ids = NULL;
}
if (af_event_exposure_data->app_ids) {
OpenAPI_list_for_each(af_event_exposure_data->app_ids, node) {
ogs_free(node->data);
}
OpenAPI_list_free(af_event_exposure_data->app_ids);
af_event_exposure_data->app_ids = NULL;
}
OpenAPI_list_free(af_event_exposure_data->app_ids);
ogs_free(af_event_exposure_data);
}
cJSON *OpenAPI_af_event_exposure_data_convertToJSON(OpenAPI_af_event_exposure_data_t *af_event_exposure_data)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (af_event_exposure_data == NULL) {
ogs_error("OpenAPI_af_event_exposure_data_convertToJSON() failed [AfEventExposureData]");
@ -48,49 +59,48 @@ cJSON *OpenAPI_af_event_exposure_data_convertToJSON(OpenAPI_af_event_exposure_da
}
item = cJSON_CreateObject();
cJSON *af_events = cJSON_AddArrayToObject(item, "afEvents");
if (af_events == NULL) {
if (af_event_exposure_data->af_events == OpenAPI_af_event_NULL) {
ogs_error("OpenAPI_af_event_exposure_data_convertToJSON() failed [af_events]");
return NULL;
}
cJSON *af_eventsList = cJSON_AddArrayToObject(item, "afEvents");
if (af_eventsList == NULL) {
ogs_error("OpenAPI_af_event_exposure_data_convertToJSON() failed [af_events]");
goto end;
}
OpenAPI_lnode_t *af_events_node;
OpenAPI_list_for_each(af_event_exposure_data->af_events, af_events_node) {
if (cJSON_AddStringToObject(af_events, "", OpenAPI_af_event_ToString((intptr_t)af_events_node->data)) == NULL) {
OpenAPI_list_for_each(af_event_exposure_data->af_events, node) {
if (cJSON_AddStringToObject(af_eventsList, "", OpenAPI_af_event_ToString((intptr_t)node->data)) == NULL) {
ogs_error("OpenAPI_af_event_exposure_data_convertToJSON() failed [af_events]");
goto end;
}
}
if (af_event_exposure_data->af_ids) {
cJSON *af_ids = cJSON_AddArrayToObject(item, "afIds");
if (af_ids == NULL) {
cJSON *af_idsList = cJSON_AddArrayToObject(item, "afIds");
if (af_idsList == NULL) {
ogs_error("OpenAPI_af_event_exposure_data_convertToJSON() failed [af_ids]");
goto end;
}
OpenAPI_lnode_t *af_ids_node;
OpenAPI_list_for_each(af_event_exposure_data->af_ids, af_ids_node) {
if (cJSON_AddStringToObject(af_ids, "", (char*)af_ids_node->data) == NULL) {
ogs_error("OpenAPI_af_event_exposure_data_convertToJSON() failed [af_ids]");
goto end;
OpenAPI_list_for_each(af_event_exposure_data->af_ids, node) {
if (cJSON_AddStringToObject(af_idsList, "", (char*)node->data) == NULL) {
ogs_error("OpenAPI_af_event_exposure_data_convertToJSON() failed [af_ids]");
goto end;
}
}
}
}
if (af_event_exposure_data->app_ids) {
cJSON *app_ids = cJSON_AddArrayToObject(item, "appIds");
if (app_ids == NULL) {
cJSON *app_idsList = cJSON_AddArrayToObject(item, "appIds");
if (app_idsList == NULL) {
ogs_error("OpenAPI_af_event_exposure_data_convertToJSON() failed [app_ids]");
goto end;
}
OpenAPI_lnode_t *app_ids_node;
OpenAPI_list_for_each(af_event_exposure_data->app_ids, app_ids_node) {
if (cJSON_AddStringToObject(app_ids, "", (char*)app_ids_node->data) == NULL) {
ogs_error("OpenAPI_af_event_exposure_data_convertToJSON() failed [app_ids]");
goto end;
OpenAPI_list_for_each(af_event_exposure_data->app_ids, node) {
if (cJSON_AddStringToObject(app_idsList, "", (char*)node->data) == NULL) {
ogs_error("OpenAPI_af_event_exposure_data_convertToJSON() failed [app_ids]");
goto end;
}
}
}
}
end:
@ -100,68 +110,74 @@ end:
OpenAPI_af_event_exposure_data_t *OpenAPI_af_event_exposure_data_parseFromJSON(cJSON *af_event_exposure_dataJSON)
{
OpenAPI_af_event_exposure_data_t *af_event_exposure_data_local_var = NULL;
cJSON *af_events = cJSON_GetObjectItemCaseSensitive(af_event_exposure_dataJSON, "afEvents");
OpenAPI_lnode_t *node = NULL;
cJSON *af_events = NULL;
OpenAPI_list_t *af_eventsList = NULL;
cJSON *af_ids = NULL;
OpenAPI_list_t *af_idsList = NULL;
cJSON *app_ids = NULL;
OpenAPI_list_t *app_idsList = NULL;
af_events = cJSON_GetObjectItemCaseSensitive(af_event_exposure_dataJSON, "afEvents");
if (!af_events) {
ogs_error("OpenAPI_af_event_exposure_data_parseFromJSON() failed [af_events]");
goto end;
}
OpenAPI_list_t *af_eventsList;
cJSON *af_events_local_nonprimitive;
if (!cJSON_IsArray(af_events)) {
ogs_error("OpenAPI_af_event_exposure_data_parseFromJSON() failed [af_events]");
goto end;
}
af_eventsList = OpenAPI_list_create();
cJSON_ArrayForEach(af_events_local_nonprimitive, af_events ) {
if (!cJSON_IsString(af_events_local_nonprimitive)){
cJSON *af_events_local = NULL;
if (!cJSON_IsArray(af_events)) {
ogs_error("OpenAPI_af_event_exposure_data_parseFromJSON() failed [af_events]");
goto end;
}
OpenAPI_list_add(af_eventsList, (void *)OpenAPI_af_event_FromString(af_events_local_nonprimitive->valuestring));
}
af_eventsList = OpenAPI_list_create();
cJSON *af_ids = cJSON_GetObjectItemCaseSensitive(af_event_exposure_dataJSON, "afIds");
cJSON_ArrayForEach(af_events_local, af_events) {
if (!cJSON_IsString(af_events_local)) {
ogs_error("OpenAPI_af_event_exposure_data_parseFromJSON() failed [af_events]");
goto end;
}
OpenAPI_list_add(af_eventsList, (void *)OpenAPI_af_event_FromString(af_events_local->valuestring));
}
OpenAPI_list_t *af_idsList;
af_ids = cJSON_GetObjectItemCaseSensitive(af_event_exposure_dataJSON, "afIds");
if (af_ids) {
cJSON *af_ids_local;
if (!cJSON_IsArray(af_ids)) {
ogs_error("OpenAPI_af_event_exposure_data_parseFromJSON() failed [af_ids]");
goto end;
}
af_idsList = OpenAPI_list_create();
cJSON *af_ids_local = NULL;
if (!cJSON_IsArray(af_ids)) {
ogs_error("OpenAPI_af_event_exposure_data_parseFromJSON() failed [af_ids]");
goto end;
}
cJSON_ArrayForEach(af_ids_local, af_ids) {
if (!cJSON_IsString(af_ids_local)) {
ogs_error("OpenAPI_af_event_exposure_data_parseFromJSON() failed [af_ids]");
goto end;
}
OpenAPI_list_add(af_idsList, ogs_strdup(af_ids_local->valuestring));
}
af_idsList = OpenAPI_list_create();
cJSON_ArrayForEach(af_ids_local, af_ids) {
double *localDouble = NULL;
int *localInt = NULL;
if (!cJSON_IsString(af_ids_local)) {
ogs_error("OpenAPI_af_event_exposure_data_parseFromJSON() failed [af_ids]");
goto end;
}
OpenAPI_list_add(af_idsList, ogs_strdup(af_ids_local->valuestring));
}
}
cJSON *app_ids = cJSON_GetObjectItemCaseSensitive(af_event_exposure_dataJSON, "appIds");
OpenAPI_list_t *app_idsList;
app_ids = cJSON_GetObjectItemCaseSensitive(af_event_exposure_dataJSON, "appIds");
if (app_ids) {
cJSON *app_ids_local;
if (!cJSON_IsArray(app_ids)) {
ogs_error("OpenAPI_af_event_exposure_data_parseFromJSON() failed [app_ids]");
goto end;
}
app_idsList = OpenAPI_list_create();
cJSON *app_ids_local = NULL;
if (!cJSON_IsArray(app_ids)) {
ogs_error("OpenAPI_af_event_exposure_data_parseFromJSON() failed [app_ids]");
goto end;
}
cJSON_ArrayForEach(app_ids_local, app_ids) {
if (!cJSON_IsString(app_ids_local)) {
ogs_error("OpenAPI_af_event_exposure_data_parseFromJSON() failed [app_ids]");
goto end;
}
OpenAPI_list_add(app_idsList, ogs_strdup(app_ids_local->valuestring));
}
app_idsList = OpenAPI_list_create();
cJSON_ArrayForEach(app_ids_local, app_ids) {
double *localDouble = NULL;
int *localInt = NULL;
if (!cJSON_IsString(app_ids_local)) {
ogs_error("OpenAPI_af_event_exposure_data_parseFromJSON() failed [app_ids]");
goto end;
}
OpenAPI_list_add(app_idsList, ogs_strdup(app_ids_local->valuestring));
}
}
af_event_exposure_data_local_var = OpenAPI_af_event_exposure_data_create (
@ -172,6 +188,24 @@ OpenAPI_af_event_exposure_data_t *OpenAPI_af_event_exposure_data_parseFromJSON(c
return af_event_exposure_data_local_var;
end:
if (af_eventsList) {
OpenAPI_list_free(af_eventsList);
af_eventsList = NULL;
}
if (af_idsList) {
OpenAPI_list_for_each(af_idsList, node) {
ogs_free(node->data);
}
OpenAPI_list_free(af_idsList);
af_idsList = NULL;
}
if (app_idsList) {
OpenAPI_list_for_each(app_idsList, node) {
ogs_free(node->data);
}
OpenAPI_list_free(app_idsList);
app_idsList = NULL;
}
return NULL;
}

View File

@ -5,7 +5,7 @@
#include "af_event_notification.h"
OpenAPI_af_event_notification_t *OpenAPI_af_event_notification_create(
OpenAPI_af_event_e event,
OpenAPI_npcf_af_event_e event,
OpenAPI_list_t *flows
)
{
@ -20,20 +20,25 @@ OpenAPI_af_event_notification_t *OpenAPI_af_event_notification_create(
void OpenAPI_af_event_notification_free(OpenAPI_af_event_notification_t *af_event_notification)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == af_event_notification) {
return;
}
OpenAPI_lnode_t *node;
OpenAPI_list_for_each(af_event_notification->flows, node) {
OpenAPI_flows_free(node->data);
if (af_event_notification->flows) {
OpenAPI_list_for_each(af_event_notification->flows, node) {
OpenAPI_flows_free(node->data);
}
OpenAPI_list_free(af_event_notification->flows);
af_event_notification->flows = NULL;
}
OpenAPI_list_free(af_event_notification->flows);
ogs_free(af_event_notification);
}
cJSON *OpenAPI_af_event_notification_convertToJSON(OpenAPI_af_event_notification_t *af_event_notification)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (af_event_notification == NULL) {
ogs_error("OpenAPI_af_event_notification_convertToJSON() failed [AfEventNotification]");
@ -41,7 +46,11 @@ cJSON *OpenAPI_af_event_notification_convertToJSON(OpenAPI_af_event_notification
}
item = cJSON_CreateObject();
if (cJSON_AddStringToObject(item, "event", OpenAPI_af_event_ToString(af_event_notification->event)) == NULL) {
if (af_event_notification->event == OpenAPI_npcf_af_event_NULL) {
ogs_error("OpenAPI_af_event_notification_convertToJSON() failed [event]");
return NULL;
}
if (cJSON_AddStringToObject(item, "event", OpenAPI_npcf_af_event_ToString(af_event_notification->event)) == NULL) {
ogs_error("OpenAPI_af_event_notification_convertToJSON() failed [event]");
goto end;
}
@ -52,17 +61,13 @@ cJSON *OpenAPI_af_event_notification_convertToJSON(OpenAPI_af_event_notification
ogs_error("OpenAPI_af_event_notification_convertToJSON() failed [flows]");
goto end;
}
OpenAPI_lnode_t *flows_node;
if (af_event_notification->flows) {
OpenAPI_list_for_each(af_event_notification->flows, flows_node) {
cJSON *itemLocal = OpenAPI_flows_convertToJSON(flows_node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_af_event_notification_convertToJSON() failed [flows]");
goto end;
}
cJSON_AddItemToArray(flowsList, itemLocal);
OpenAPI_list_for_each(af_event_notification->flows, node) {
cJSON *itemLocal = OpenAPI_flows_convertToJSON(node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_af_event_notification_convertToJSON() failed [flows]");
goto end;
}
cJSON_AddItemToArray(flowsList, itemLocal);
}
}
@ -73,46 +78,45 @@ end:
OpenAPI_af_event_notification_t *OpenAPI_af_event_notification_parseFromJSON(cJSON *af_event_notificationJSON)
{
OpenAPI_af_event_notification_t *af_event_notification_local_var = NULL;
cJSON *event = cJSON_GetObjectItemCaseSensitive(af_event_notificationJSON, "event");
OpenAPI_lnode_t *node = NULL;
cJSON *event = NULL;
OpenAPI_npcf_af_event_e eventVariable = 0;
cJSON *flows = NULL;
OpenAPI_list_t *flowsList = NULL;
event = cJSON_GetObjectItemCaseSensitive(af_event_notificationJSON, "event");
if (!event) {
ogs_error("OpenAPI_af_event_notification_parseFromJSON() failed [event]");
goto end;
}
OpenAPI_af_event_e eventVariable;
if (!cJSON_IsString(event)) {
ogs_error("OpenAPI_af_event_notification_parseFromJSON() failed [event]");
goto end;
}
eventVariable = OpenAPI_af_event_FromString(event->valuestring);
eventVariable = OpenAPI_npcf_af_event_FromString(event->valuestring);
cJSON *flows = cJSON_GetObjectItemCaseSensitive(af_event_notificationJSON, "flows");
OpenAPI_list_t *flowsList;
flows = cJSON_GetObjectItemCaseSensitive(af_event_notificationJSON, "flows");
if (flows) {
cJSON *flows_local_nonprimitive;
if (!cJSON_IsArray(flows)){
ogs_error("OpenAPI_af_event_notification_parseFromJSON() failed [flows]");
goto end;
}
flowsList = OpenAPI_list_create();
cJSON_ArrayForEach(flows_local_nonprimitive, flows ) {
if (!cJSON_IsObject(flows_local_nonprimitive)) {
cJSON *flows_local = NULL;
if (!cJSON_IsArray(flows)) {
ogs_error("OpenAPI_af_event_notification_parseFromJSON() failed [flows]");
goto end;
}
OpenAPI_flows_t *flowsItem = OpenAPI_flows_parseFromJSON(flows_local_nonprimitive);
if (!flowsItem) {
ogs_error("No flowsItem");
OpenAPI_list_free(flowsList);
goto end;
flowsList = OpenAPI_list_create();
cJSON_ArrayForEach(flows_local, flows) {
if (!cJSON_IsObject(flows_local)) {
ogs_error("OpenAPI_af_event_notification_parseFromJSON() failed [flows]");
goto end;
}
OpenAPI_flows_t *flowsItem = OpenAPI_flows_parseFromJSON(flows_local);
if (!flowsItem) {
ogs_error("No flowsItem");
OpenAPI_list_free(flowsList);
goto end;
}
OpenAPI_list_add(flowsList, flowsItem);
}
OpenAPI_list_add(flowsList, flowsItem);
}
}
af_event_notification_local_var = OpenAPI_af_event_notification_create (
@ -122,6 +126,13 @@ OpenAPI_af_event_notification_t *OpenAPI_af_event_notification_parseFromJSON(cJS
return af_event_notification_local_var;
end:
if (flowsList) {
OpenAPI_list_for_each(flowsList, node) {
OpenAPI_flows_free(node->data);
}
OpenAPI_list_free(flowsList);
flowsList = NULL;
}
return NULL;
}

View File

@ -12,8 +12,8 @@
#include "../include/list.h"
#include "../include/keyValuePair.h"
#include "../include/binary.h"
#include "af_event.h"
#include "flows.h"
#include "npcf_af_event.h"
#ifdef __cplusplus
extern "C" {
@ -21,12 +21,12 @@ extern "C" {
typedef struct OpenAPI_af_event_notification_s OpenAPI_af_event_notification_t;
typedef struct OpenAPI_af_event_notification_s {
OpenAPI_af_event_e event;
OpenAPI_npcf_af_event_e event;
OpenAPI_list_t *flows;
} OpenAPI_af_event_notification_t;
OpenAPI_af_event_notification_t *OpenAPI_af_event_notification_create(
OpenAPI_af_event_e event,
OpenAPI_npcf_af_event_e event,
OpenAPI_list_t *flows
);
void OpenAPI_af_event_notification_free(OpenAPI_af_event_notification_t *af_event_notification);

View File

@ -5,7 +5,7 @@
#include "af_event_subscription.h"
OpenAPI_af_event_subscription_t *OpenAPI_af_event_subscription_create(
OpenAPI_af_event_e event,
OpenAPI_npcf_af_event_e event,
OpenAPI_af_notif_method_e notif_method,
bool is_rep_period,
int rep_period,
@ -28,16 +28,18 @@ OpenAPI_af_event_subscription_t *OpenAPI_af_event_subscription_create(
void OpenAPI_af_event_subscription_free(OpenAPI_af_event_subscription_t *af_event_subscription)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == af_event_subscription) {
return;
}
OpenAPI_lnode_t *node;
ogs_free(af_event_subscription);
}
cJSON *OpenAPI_af_event_subscription_convertToJSON(OpenAPI_af_event_subscription_t *af_event_subscription)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (af_event_subscription == NULL) {
ogs_error("OpenAPI_af_event_subscription_convertToJSON() failed [AfEventSubscription]");
@ -45,12 +47,16 @@ cJSON *OpenAPI_af_event_subscription_convertToJSON(OpenAPI_af_event_subscription
}
item = cJSON_CreateObject();
if (cJSON_AddStringToObject(item, "event", OpenAPI_af_event_ToString(af_event_subscription->event)) == NULL) {
if (af_event_subscription->event == OpenAPI_npcf_af_event_NULL) {
ogs_error("OpenAPI_af_event_subscription_convertToJSON() failed [event]");
return NULL;
}
if (cJSON_AddStringToObject(item, "event", OpenAPI_npcf_af_event_ToString(af_event_subscription->event)) == NULL) {
ogs_error("OpenAPI_af_event_subscription_convertToJSON() failed [event]");
goto end;
}
if (af_event_subscription->notif_method) {
if (af_event_subscription->notif_method != OpenAPI_af_notif_method_NULL) {
if (cJSON_AddStringToObject(item, "notifMethod", OpenAPI_af_notif_method_ToString(af_event_subscription->notif_method)) == NULL) {
ogs_error("OpenAPI_af_event_subscription_convertToJSON() failed [notif_method]");
goto end;
@ -78,22 +84,25 @@ end:
OpenAPI_af_event_subscription_t *OpenAPI_af_event_subscription_parseFromJSON(cJSON *af_event_subscriptionJSON)
{
OpenAPI_af_event_subscription_t *af_event_subscription_local_var = NULL;
cJSON *event = cJSON_GetObjectItemCaseSensitive(af_event_subscriptionJSON, "event");
OpenAPI_lnode_t *node = NULL;
cJSON *event = NULL;
OpenAPI_npcf_af_event_e eventVariable = 0;
cJSON *notif_method = NULL;
OpenAPI_af_notif_method_e notif_methodVariable = 0;
cJSON *rep_period = NULL;
cJSON *wait_time = NULL;
event = cJSON_GetObjectItemCaseSensitive(af_event_subscriptionJSON, "event");
if (!event) {
ogs_error("OpenAPI_af_event_subscription_parseFromJSON() failed [event]");
goto end;
}
OpenAPI_af_event_e eventVariable;
if (!cJSON_IsString(event)) {
ogs_error("OpenAPI_af_event_subscription_parseFromJSON() failed [event]");
goto end;
}
eventVariable = OpenAPI_af_event_FromString(event->valuestring);
eventVariable = OpenAPI_npcf_af_event_FromString(event->valuestring);
cJSON *notif_method = cJSON_GetObjectItemCaseSensitive(af_event_subscriptionJSON, "notifMethod");
OpenAPI_af_notif_method_e notif_methodVariable;
notif_method = cJSON_GetObjectItemCaseSensitive(af_event_subscriptionJSON, "notifMethod");
if (notif_method) {
if (!cJSON_IsString(notif_method)) {
ogs_error("OpenAPI_af_event_subscription_parseFromJSON() failed [notif_method]");
@ -102,8 +111,7 @@ OpenAPI_af_event_subscription_t *OpenAPI_af_event_subscription_parseFromJSON(cJS
notif_methodVariable = OpenAPI_af_notif_method_FromString(notif_method->valuestring);
}
cJSON *rep_period = cJSON_GetObjectItemCaseSensitive(af_event_subscriptionJSON, "repPeriod");
rep_period = cJSON_GetObjectItemCaseSensitive(af_event_subscriptionJSON, "repPeriod");
if (rep_period) {
if (!cJSON_IsNumber(rep_period)) {
ogs_error("OpenAPI_af_event_subscription_parseFromJSON() failed [rep_period]");
@ -111,8 +119,7 @@ OpenAPI_af_event_subscription_t *OpenAPI_af_event_subscription_parseFromJSON(cJS
}
}
cJSON *wait_time = cJSON_GetObjectItemCaseSensitive(af_event_subscriptionJSON, "waitTime");
wait_time = cJSON_GetObjectItemCaseSensitive(af_event_subscriptionJSON, "waitTime");
if (wait_time) {
if (!cJSON_IsNumber(wait_time)) {
ogs_error("OpenAPI_af_event_subscription_parseFromJSON() failed [wait_time]");

View File

@ -12,8 +12,8 @@
#include "../include/list.h"
#include "../include/keyValuePair.h"
#include "../include/binary.h"
#include "af_event.h"
#include "af_notif_method.h"
#include "npcf_af_event.h"
#ifdef __cplusplus
extern "C" {
@ -21,7 +21,7 @@ extern "C" {
typedef struct OpenAPI_af_event_subscription_s OpenAPI_af_event_subscription_t;
typedef struct OpenAPI_af_event_subscription_s {
OpenAPI_af_event_e event;
OpenAPI_npcf_af_event_e event;
OpenAPI_af_notif_method_e notif_method;
bool is_rep_period;
int rep_period;
@ -30,7 +30,7 @@ typedef struct OpenAPI_af_event_subscription_s {
} OpenAPI_af_event_subscription_t;
OpenAPI_af_event_subscription_t *OpenAPI_af_event_subscription_create(
OpenAPI_af_event_e event,
OpenAPI_npcf_af_event_e event,
OpenAPI_af_notif_method_e notif_method,
bool is_rep_period,
int rep_period,

View File

@ -24,22 +24,33 @@ OpenAPI_af_external_t *OpenAPI_af_external_create(
void OpenAPI_af_external_free(OpenAPI_af_external_t *af_external)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == af_external) {
return;
}
OpenAPI_lnode_t *node;
ogs_free(af_external->af_id);
OpenAPI_list_for_each(af_external->allowed_geographic_area, node) {
OpenAPI_geographic_area_free(node->data);
if (af_external->af_id) {
ogs_free(af_external->af_id);
af_external->af_id = NULL;
}
if (af_external->allowed_geographic_area) {
OpenAPI_list_for_each(af_external->allowed_geographic_area, node) {
OpenAPI_geographic_area_free(node->data);
}
OpenAPI_list_free(af_external->allowed_geographic_area);
af_external->allowed_geographic_area = NULL;
}
if (af_external->valid_time_period) {
OpenAPI_valid_time_period_free(af_external->valid_time_period);
af_external->valid_time_period = NULL;
}
OpenAPI_list_free(af_external->allowed_geographic_area);
OpenAPI_valid_time_period_free(af_external->valid_time_period);
ogs_free(af_external);
}
cJSON *OpenAPI_af_external_convertToJSON(OpenAPI_af_external_t *af_external)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (af_external == NULL) {
ogs_error("OpenAPI_af_external_convertToJSON() failed [AfExternal]");
@ -60,21 +71,17 @@ cJSON *OpenAPI_af_external_convertToJSON(OpenAPI_af_external_t *af_external)
ogs_error("OpenAPI_af_external_convertToJSON() failed [allowed_geographic_area]");
goto end;
}
OpenAPI_lnode_t *allowed_geographic_area_node;
if (af_external->allowed_geographic_area) {
OpenAPI_list_for_each(af_external->allowed_geographic_area, allowed_geographic_area_node) {
cJSON *itemLocal = OpenAPI_geographic_area_convertToJSON(allowed_geographic_area_node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_af_external_convertToJSON() failed [allowed_geographic_area]");
goto end;
}
cJSON_AddItemToArray(allowed_geographic_areaList, itemLocal);
OpenAPI_list_for_each(af_external->allowed_geographic_area, node) {
cJSON *itemLocal = OpenAPI_geographic_area_convertToJSON(node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_af_external_convertToJSON() failed [allowed_geographic_area]");
goto end;
}
cJSON_AddItemToArray(allowed_geographic_areaList, itemLocal);
}
}
if (af_external->privacy_check_related_action) {
if (af_external->privacy_check_related_action != OpenAPI_privacy_check_related_action_NULL) {
if (cJSON_AddStringToObject(item, "privacyCheckRelatedAction", OpenAPI_privacy_check_related_action_ToString(af_external->privacy_check_related_action)) == NULL) {
ogs_error("OpenAPI_af_external_convertToJSON() failed [privacy_check_related_action]");
goto end;
@ -101,47 +108,48 @@ end:
OpenAPI_af_external_t *OpenAPI_af_external_parseFromJSON(cJSON *af_externalJSON)
{
OpenAPI_af_external_t *af_external_local_var = NULL;
cJSON *af_id = cJSON_GetObjectItemCaseSensitive(af_externalJSON, "afId");
OpenAPI_lnode_t *node = NULL;
cJSON *af_id = NULL;
cJSON *allowed_geographic_area = NULL;
OpenAPI_list_t *allowed_geographic_areaList = NULL;
cJSON *privacy_check_related_action = NULL;
OpenAPI_privacy_check_related_action_e privacy_check_related_actionVariable = 0;
cJSON *valid_time_period = NULL;
OpenAPI_valid_time_period_t *valid_time_period_local_nonprim = NULL;
af_id = cJSON_GetObjectItemCaseSensitive(af_externalJSON, "afId");
if (af_id) {
if (!cJSON_IsString(af_id)) {
if (!cJSON_IsString(af_id) && !cJSON_IsNull(af_id)) {
ogs_error("OpenAPI_af_external_parseFromJSON() failed [af_id]");
goto end;
}
}
cJSON *allowed_geographic_area = cJSON_GetObjectItemCaseSensitive(af_externalJSON, "allowedGeographicArea");
OpenAPI_list_t *allowed_geographic_areaList;
allowed_geographic_area = cJSON_GetObjectItemCaseSensitive(af_externalJSON, "allowedGeographicArea");
if (allowed_geographic_area) {
cJSON *allowed_geographic_area_local_nonprimitive;
if (!cJSON_IsArray(allowed_geographic_area)){
ogs_error("OpenAPI_af_external_parseFromJSON() failed [allowed_geographic_area]");
goto end;
}
allowed_geographic_areaList = OpenAPI_list_create();
cJSON_ArrayForEach(allowed_geographic_area_local_nonprimitive, allowed_geographic_area ) {
if (!cJSON_IsObject(allowed_geographic_area_local_nonprimitive)) {
cJSON *allowed_geographic_area_local = NULL;
if (!cJSON_IsArray(allowed_geographic_area)) {
ogs_error("OpenAPI_af_external_parseFromJSON() failed [allowed_geographic_area]");
goto end;
}
OpenAPI_geographic_area_t *allowed_geographic_areaItem = OpenAPI_geographic_area_parseFromJSON(allowed_geographic_area_local_nonprimitive);
if (!allowed_geographic_areaItem) {
ogs_error("No allowed_geographic_areaItem");
OpenAPI_list_free(allowed_geographic_areaList);
goto end;
allowed_geographic_areaList = OpenAPI_list_create();
cJSON_ArrayForEach(allowed_geographic_area_local, allowed_geographic_area) {
if (!cJSON_IsObject(allowed_geographic_area_local)) {
ogs_error("OpenAPI_af_external_parseFromJSON() failed [allowed_geographic_area]");
goto end;
}
OpenAPI_geographic_area_t *allowed_geographic_areaItem = OpenAPI_geographic_area_parseFromJSON(allowed_geographic_area_local);
if (!allowed_geographic_areaItem) {
ogs_error("No allowed_geographic_areaItem");
OpenAPI_list_free(allowed_geographic_areaList);
goto end;
}
OpenAPI_list_add(allowed_geographic_areaList, allowed_geographic_areaItem);
}
OpenAPI_list_add(allowed_geographic_areaList, allowed_geographic_areaItem);
}
}
cJSON *privacy_check_related_action = cJSON_GetObjectItemCaseSensitive(af_externalJSON, "privacyCheckRelatedAction");
OpenAPI_privacy_check_related_action_e privacy_check_related_actionVariable;
privacy_check_related_action = cJSON_GetObjectItemCaseSensitive(af_externalJSON, "privacyCheckRelatedAction");
if (privacy_check_related_action) {
if (!cJSON_IsString(privacy_check_related_action)) {
ogs_error("OpenAPI_af_external_parseFromJSON() failed [privacy_check_related_action]");
@ -150,15 +158,13 @@ OpenAPI_af_external_t *OpenAPI_af_external_parseFromJSON(cJSON *af_externalJSON)
privacy_check_related_actionVariable = OpenAPI_privacy_check_related_action_FromString(privacy_check_related_action->valuestring);
}
cJSON *valid_time_period = cJSON_GetObjectItemCaseSensitive(af_externalJSON, "validTimePeriod");
OpenAPI_valid_time_period_t *valid_time_period_local_nonprim = NULL;
valid_time_period = cJSON_GetObjectItemCaseSensitive(af_externalJSON, "validTimePeriod");
if (valid_time_period) {
valid_time_period_local_nonprim = OpenAPI_valid_time_period_parseFromJSON(valid_time_period);
}
af_external_local_var = OpenAPI_af_external_create (
af_id ? ogs_strdup(af_id->valuestring) : NULL,
af_id && !cJSON_IsNull(af_id) ? ogs_strdup(af_id->valuestring) : NULL,
allowed_geographic_area ? allowed_geographic_areaList : NULL,
privacy_check_related_action ? privacy_check_related_actionVariable : 0,
valid_time_period ? valid_time_period_local_nonprim : NULL
@ -166,6 +172,17 @@ OpenAPI_af_external_t *OpenAPI_af_external_parseFromJSON(cJSON *af_externalJSON)
return af_external_local_var;
end:
if (allowed_geographic_areaList) {
OpenAPI_list_for_each(allowed_geographic_areaList, node) {
OpenAPI_geographic_area_free(node->data);
}
OpenAPI_list_free(allowed_geographic_areaList);
allowed_geographic_areaList = NULL;
}
if (valid_time_period_local_nonprim) {
OpenAPI_valid_time_period_free(valid_time_period_local_nonprim);
valid_time_period_local_nonprim = NULL;
}
return NULL;
}

View File

@ -32,26 +32,40 @@ OpenAPI_af_routing_requirement_t *OpenAPI_af_routing_requirement_create(
void OpenAPI_af_routing_requirement_free(OpenAPI_af_routing_requirement_t *af_routing_requirement)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == af_routing_requirement) {
return;
}
OpenAPI_lnode_t *node;
OpenAPI_list_for_each(af_routing_requirement->route_to_locs, node) {
OpenAPI_route_to_location_free(node->data);
if (af_routing_requirement->route_to_locs) {
OpenAPI_list_for_each(af_routing_requirement->route_to_locs, node) {
OpenAPI_route_to_location_free(node->data);
}
OpenAPI_list_free(af_routing_requirement->route_to_locs);
af_routing_requirement->route_to_locs = NULL;
}
OpenAPI_list_free(af_routing_requirement->route_to_locs);
OpenAPI_spatial_validity_free(af_routing_requirement->sp_val);
OpenAPI_list_for_each(af_routing_requirement->temp_vals, node) {
OpenAPI_temporal_validity_free(node->data);
if (af_routing_requirement->sp_val) {
OpenAPI_spatial_validity_free(af_routing_requirement->sp_val);
af_routing_requirement->sp_val = NULL;
}
if (af_routing_requirement->temp_vals) {
OpenAPI_list_for_each(af_routing_requirement->temp_vals, node) {
OpenAPI_temporal_validity_free(node->data);
}
OpenAPI_list_free(af_routing_requirement->temp_vals);
af_routing_requirement->temp_vals = NULL;
}
if (af_routing_requirement->up_path_chg_sub) {
OpenAPI_up_path_chg_event_free(af_routing_requirement->up_path_chg_sub);
af_routing_requirement->up_path_chg_sub = NULL;
}
OpenAPI_list_free(af_routing_requirement->temp_vals);
OpenAPI_up_path_chg_event_free(af_routing_requirement->up_path_chg_sub);
ogs_free(af_routing_requirement);
}
cJSON *OpenAPI_af_routing_requirement_convertToJSON(OpenAPI_af_routing_requirement_t *af_routing_requirement)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (af_routing_requirement == NULL) {
ogs_error("OpenAPI_af_routing_requirement_convertToJSON() failed [AfRoutingRequirement]");
@ -72,17 +86,13 @@ cJSON *OpenAPI_af_routing_requirement_convertToJSON(OpenAPI_af_routing_requireme
ogs_error("OpenAPI_af_routing_requirement_convertToJSON() failed [route_to_locs]");
goto end;
}
OpenAPI_lnode_t *route_to_locs_node;
if (af_routing_requirement->route_to_locs) {
OpenAPI_list_for_each(af_routing_requirement->route_to_locs, route_to_locs_node) {
cJSON *itemLocal = OpenAPI_route_to_location_convertToJSON(route_to_locs_node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_af_routing_requirement_convertToJSON() failed [route_to_locs]");
goto end;
}
cJSON_AddItemToArray(route_to_locsList, itemLocal);
OpenAPI_list_for_each(af_routing_requirement->route_to_locs, node) {
cJSON *itemLocal = OpenAPI_route_to_location_convertToJSON(node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_af_routing_requirement_convertToJSON() failed [route_to_locs]");
goto end;
}
cJSON_AddItemToArray(route_to_locsList, itemLocal);
}
}
@ -105,17 +115,13 @@ cJSON *OpenAPI_af_routing_requirement_convertToJSON(OpenAPI_af_routing_requireme
ogs_error("OpenAPI_af_routing_requirement_convertToJSON() failed [temp_vals]");
goto end;
}
OpenAPI_lnode_t *temp_vals_node;
if (af_routing_requirement->temp_vals) {
OpenAPI_list_for_each(af_routing_requirement->temp_vals, temp_vals_node) {
cJSON *itemLocal = OpenAPI_temporal_validity_convertToJSON(temp_vals_node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_af_routing_requirement_convertToJSON() failed [temp_vals]");
goto end;
}
cJSON_AddItemToArray(temp_valsList, itemLocal);
OpenAPI_list_for_each(af_routing_requirement->temp_vals, node) {
cJSON *itemLocal = OpenAPI_temporal_validity_convertToJSON(node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_af_routing_requirement_convertToJSON() failed [temp_vals]");
goto end;
}
cJSON_AddItemToArray(temp_valsList, itemLocal);
}
}
@ -146,8 +152,18 @@ end:
OpenAPI_af_routing_requirement_t *OpenAPI_af_routing_requirement_parseFromJSON(cJSON *af_routing_requirementJSON)
{
OpenAPI_af_routing_requirement_t *af_routing_requirement_local_var = NULL;
cJSON *app_reloc = cJSON_GetObjectItemCaseSensitive(af_routing_requirementJSON, "appReloc");
OpenAPI_lnode_t *node = NULL;
cJSON *app_reloc = NULL;
cJSON *route_to_locs = NULL;
OpenAPI_list_t *route_to_locsList = NULL;
cJSON *sp_val = NULL;
OpenAPI_spatial_validity_t *sp_val_local_nonprim = NULL;
cJSON *temp_vals = NULL;
OpenAPI_list_t *temp_valsList = NULL;
cJSON *up_path_chg_sub = NULL;
OpenAPI_up_path_chg_event_t *up_path_chg_sub_local_nonprim = NULL;
cJSON *addr_preser_ind = NULL;
app_reloc = cJSON_GetObjectItemCaseSensitive(af_routing_requirementJSON, "appReloc");
if (app_reloc) {
if (!cJSON_IsBool(app_reloc)) {
ogs_error("OpenAPI_af_routing_requirement_parseFromJSON() failed [app_reloc]");
@ -155,80 +171,67 @@ OpenAPI_af_routing_requirement_t *OpenAPI_af_routing_requirement_parseFromJSON(c
}
}
cJSON *route_to_locs = cJSON_GetObjectItemCaseSensitive(af_routing_requirementJSON, "routeToLocs");
OpenAPI_list_t *route_to_locsList;
route_to_locs = cJSON_GetObjectItemCaseSensitive(af_routing_requirementJSON, "routeToLocs");
if (route_to_locs) {
cJSON *route_to_locs_local_nonprimitive;
if (!cJSON_IsArray(route_to_locs)){
ogs_error("OpenAPI_af_routing_requirement_parseFromJSON() failed [route_to_locs]");
goto end;
}
route_to_locsList = OpenAPI_list_create();
cJSON_ArrayForEach(route_to_locs_local_nonprimitive, route_to_locs ) {
if (!cJSON_IsObject(route_to_locs_local_nonprimitive)) {
cJSON *route_to_locs_local = NULL;
if (!cJSON_IsArray(route_to_locs)) {
ogs_error("OpenAPI_af_routing_requirement_parseFromJSON() failed [route_to_locs]");
goto end;
}
OpenAPI_route_to_location_t *route_to_locsItem = OpenAPI_route_to_location_parseFromJSON(route_to_locs_local_nonprimitive);
if (!route_to_locsItem) {
ogs_error("No route_to_locsItem");
OpenAPI_list_free(route_to_locsList);
goto end;
route_to_locsList = OpenAPI_list_create();
cJSON_ArrayForEach(route_to_locs_local, route_to_locs) {
if (!cJSON_IsObject(route_to_locs_local)) {
ogs_error("OpenAPI_af_routing_requirement_parseFromJSON() failed [route_to_locs]");
goto end;
}
OpenAPI_route_to_location_t *route_to_locsItem = OpenAPI_route_to_location_parseFromJSON(route_to_locs_local);
if (!route_to_locsItem) {
ogs_error("No route_to_locsItem");
OpenAPI_list_free(route_to_locsList);
goto end;
}
OpenAPI_list_add(route_to_locsList, route_to_locsItem);
}
OpenAPI_list_add(route_to_locsList, route_to_locsItem);
}
}
cJSON *sp_val = cJSON_GetObjectItemCaseSensitive(af_routing_requirementJSON, "spVal");
OpenAPI_spatial_validity_t *sp_val_local_nonprim = NULL;
sp_val = cJSON_GetObjectItemCaseSensitive(af_routing_requirementJSON, "spVal");
if (sp_val) {
sp_val_local_nonprim = OpenAPI_spatial_validity_parseFromJSON(sp_val);
}
cJSON *temp_vals = cJSON_GetObjectItemCaseSensitive(af_routing_requirementJSON, "tempVals");
OpenAPI_list_t *temp_valsList;
temp_vals = cJSON_GetObjectItemCaseSensitive(af_routing_requirementJSON, "tempVals");
if (temp_vals) {
cJSON *temp_vals_local_nonprimitive;
if (!cJSON_IsArray(temp_vals)){
ogs_error("OpenAPI_af_routing_requirement_parseFromJSON() failed [temp_vals]");
goto end;
}
temp_valsList = OpenAPI_list_create();
cJSON_ArrayForEach(temp_vals_local_nonprimitive, temp_vals ) {
if (!cJSON_IsObject(temp_vals_local_nonprimitive)) {
cJSON *temp_vals_local = NULL;
if (!cJSON_IsArray(temp_vals)) {
ogs_error("OpenAPI_af_routing_requirement_parseFromJSON() failed [temp_vals]");
goto end;
}
OpenAPI_temporal_validity_t *temp_valsItem = OpenAPI_temporal_validity_parseFromJSON(temp_vals_local_nonprimitive);
if (!temp_valsItem) {
ogs_error("No temp_valsItem");
OpenAPI_list_free(temp_valsList);
goto end;
temp_valsList = OpenAPI_list_create();
cJSON_ArrayForEach(temp_vals_local, temp_vals) {
if (!cJSON_IsObject(temp_vals_local)) {
ogs_error("OpenAPI_af_routing_requirement_parseFromJSON() failed [temp_vals]");
goto end;
}
OpenAPI_temporal_validity_t *temp_valsItem = OpenAPI_temporal_validity_parseFromJSON(temp_vals_local);
if (!temp_valsItem) {
ogs_error("No temp_valsItem");
OpenAPI_list_free(temp_valsList);
goto end;
}
OpenAPI_list_add(temp_valsList, temp_valsItem);
}
OpenAPI_list_add(temp_valsList, temp_valsItem);
}
}
cJSON *up_path_chg_sub = cJSON_GetObjectItemCaseSensitive(af_routing_requirementJSON, "upPathChgSub");
OpenAPI_up_path_chg_event_t *up_path_chg_sub_local_nonprim = NULL;
up_path_chg_sub = cJSON_GetObjectItemCaseSensitive(af_routing_requirementJSON, "upPathChgSub");
if (up_path_chg_sub) {
up_path_chg_sub_local_nonprim = OpenAPI_up_path_chg_event_parseFromJSON(up_path_chg_sub);
}
cJSON *addr_preser_ind = cJSON_GetObjectItemCaseSensitive(af_routing_requirementJSON, "addrPreserInd");
addr_preser_ind = cJSON_GetObjectItemCaseSensitive(af_routing_requirementJSON, "addrPreserInd");
if (addr_preser_ind) {
if (!cJSON_IsBool(addr_preser_ind)) {
ogs_error("OpenAPI_af_routing_requirement_parseFromJSON() failed [addr_preser_ind]");
@ -249,6 +252,28 @@ OpenAPI_af_routing_requirement_t *OpenAPI_af_routing_requirement_parseFromJSON(c
return af_routing_requirement_local_var;
end:
if (route_to_locsList) {
OpenAPI_list_for_each(route_to_locsList, node) {
OpenAPI_route_to_location_free(node->data);
}
OpenAPI_list_free(route_to_locsList);
route_to_locsList = NULL;
}
if (sp_val_local_nonprim) {
OpenAPI_spatial_validity_free(sp_val_local_nonprim);
sp_val_local_nonprim = NULL;
}
if (temp_valsList) {
OpenAPI_list_for_each(temp_valsList, node) {
OpenAPI_temporal_validity_free(node->data);
}
OpenAPI_list_free(temp_valsList);
temp_valsList = NULL;
}
if (up_path_chg_sub_local_nonprim) {
OpenAPI_up_path_chg_event_free(up_path_chg_sub_local_nonprim);
up_path_chg_sub_local_nonprim = NULL;
}
return NULL;
}

View File

@ -32,26 +32,40 @@ OpenAPI_af_routing_requirement_rm_t *OpenAPI_af_routing_requirement_rm_create(
void OpenAPI_af_routing_requirement_rm_free(OpenAPI_af_routing_requirement_rm_t *af_routing_requirement_rm)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == af_routing_requirement_rm) {
return;
}
OpenAPI_lnode_t *node;
OpenAPI_list_for_each(af_routing_requirement_rm->route_to_locs, node) {
OpenAPI_route_to_location_free(node->data);
if (af_routing_requirement_rm->route_to_locs) {
OpenAPI_list_for_each(af_routing_requirement_rm->route_to_locs, node) {
OpenAPI_route_to_location_free(node->data);
}
OpenAPI_list_free(af_routing_requirement_rm->route_to_locs);
af_routing_requirement_rm->route_to_locs = NULL;
}
OpenAPI_list_free(af_routing_requirement_rm->route_to_locs);
OpenAPI_spatial_validity_rm_free(af_routing_requirement_rm->sp_val);
OpenAPI_list_for_each(af_routing_requirement_rm->temp_vals, node) {
OpenAPI_temporal_validity_free(node->data);
if (af_routing_requirement_rm->sp_val) {
OpenAPI_spatial_validity_rm_free(af_routing_requirement_rm->sp_val);
af_routing_requirement_rm->sp_val = NULL;
}
if (af_routing_requirement_rm->temp_vals) {
OpenAPI_list_for_each(af_routing_requirement_rm->temp_vals, node) {
OpenAPI_temporal_validity_free(node->data);
}
OpenAPI_list_free(af_routing_requirement_rm->temp_vals);
af_routing_requirement_rm->temp_vals = NULL;
}
if (af_routing_requirement_rm->up_path_chg_sub) {
OpenAPI_up_path_chg_event_free(af_routing_requirement_rm->up_path_chg_sub);
af_routing_requirement_rm->up_path_chg_sub = NULL;
}
OpenAPI_list_free(af_routing_requirement_rm->temp_vals);
OpenAPI_up_path_chg_event_free(af_routing_requirement_rm->up_path_chg_sub);
ogs_free(af_routing_requirement_rm);
}
cJSON *OpenAPI_af_routing_requirement_rm_convertToJSON(OpenAPI_af_routing_requirement_rm_t *af_routing_requirement_rm)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (af_routing_requirement_rm == NULL) {
ogs_error("OpenAPI_af_routing_requirement_rm_convertToJSON() failed [AfRoutingRequirementRm]");
@ -72,17 +86,13 @@ cJSON *OpenAPI_af_routing_requirement_rm_convertToJSON(OpenAPI_af_routing_requir
ogs_error("OpenAPI_af_routing_requirement_rm_convertToJSON() failed [route_to_locs]");
goto end;
}
OpenAPI_lnode_t *route_to_locs_node;
if (af_routing_requirement_rm->route_to_locs) {
OpenAPI_list_for_each(af_routing_requirement_rm->route_to_locs, route_to_locs_node) {
cJSON *itemLocal = OpenAPI_route_to_location_convertToJSON(route_to_locs_node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_af_routing_requirement_rm_convertToJSON() failed [route_to_locs]");
goto end;
}
cJSON_AddItemToArray(route_to_locsList, itemLocal);
OpenAPI_list_for_each(af_routing_requirement_rm->route_to_locs, node) {
cJSON *itemLocal = OpenAPI_route_to_location_convertToJSON(node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_af_routing_requirement_rm_convertToJSON() failed [route_to_locs]");
goto end;
}
cJSON_AddItemToArray(route_to_locsList, itemLocal);
}
}
@ -105,17 +115,13 @@ cJSON *OpenAPI_af_routing_requirement_rm_convertToJSON(OpenAPI_af_routing_requir
ogs_error("OpenAPI_af_routing_requirement_rm_convertToJSON() failed [temp_vals]");
goto end;
}
OpenAPI_lnode_t *temp_vals_node;
if (af_routing_requirement_rm->temp_vals) {
OpenAPI_list_for_each(af_routing_requirement_rm->temp_vals, temp_vals_node) {
cJSON *itemLocal = OpenAPI_temporal_validity_convertToJSON(temp_vals_node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_af_routing_requirement_rm_convertToJSON() failed [temp_vals]");
goto end;
}
cJSON_AddItemToArray(temp_valsList, itemLocal);
OpenAPI_list_for_each(af_routing_requirement_rm->temp_vals, node) {
cJSON *itemLocal = OpenAPI_temporal_validity_convertToJSON(node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_af_routing_requirement_rm_convertToJSON() failed [temp_vals]");
goto end;
}
cJSON_AddItemToArray(temp_valsList, itemLocal);
}
}
@ -146,8 +152,18 @@ end:
OpenAPI_af_routing_requirement_rm_t *OpenAPI_af_routing_requirement_rm_parseFromJSON(cJSON *af_routing_requirement_rmJSON)
{
OpenAPI_af_routing_requirement_rm_t *af_routing_requirement_rm_local_var = NULL;
cJSON *app_reloc = cJSON_GetObjectItemCaseSensitive(af_routing_requirement_rmJSON, "appReloc");
OpenAPI_lnode_t *node = NULL;
cJSON *app_reloc = NULL;
cJSON *route_to_locs = NULL;
OpenAPI_list_t *route_to_locsList = NULL;
cJSON *sp_val = NULL;
OpenAPI_spatial_validity_rm_t *sp_val_local_nonprim = NULL;
cJSON *temp_vals = NULL;
OpenAPI_list_t *temp_valsList = NULL;
cJSON *up_path_chg_sub = NULL;
OpenAPI_up_path_chg_event_t *up_path_chg_sub_local_nonprim = NULL;
cJSON *addr_preser_ind = NULL;
app_reloc = cJSON_GetObjectItemCaseSensitive(af_routing_requirement_rmJSON, "appReloc");
if (app_reloc) {
if (!cJSON_IsBool(app_reloc)) {
ogs_error("OpenAPI_af_routing_requirement_rm_parseFromJSON() failed [app_reloc]");
@ -155,80 +171,67 @@ OpenAPI_af_routing_requirement_rm_t *OpenAPI_af_routing_requirement_rm_parseFrom
}
}
cJSON *route_to_locs = cJSON_GetObjectItemCaseSensitive(af_routing_requirement_rmJSON, "routeToLocs");
OpenAPI_list_t *route_to_locsList;
route_to_locs = cJSON_GetObjectItemCaseSensitive(af_routing_requirement_rmJSON, "routeToLocs");
if (route_to_locs) {
cJSON *route_to_locs_local_nonprimitive;
if (!cJSON_IsArray(route_to_locs)){
ogs_error("OpenAPI_af_routing_requirement_rm_parseFromJSON() failed [route_to_locs]");
goto end;
}
route_to_locsList = OpenAPI_list_create();
cJSON_ArrayForEach(route_to_locs_local_nonprimitive, route_to_locs ) {
if (!cJSON_IsObject(route_to_locs_local_nonprimitive)) {
cJSON *route_to_locs_local = NULL;
if (!cJSON_IsArray(route_to_locs)) {
ogs_error("OpenAPI_af_routing_requirement_rm_parseFromJSON() failed [route_to_locs]");
goto end;
}
OpenAPI_route_to_location_t *route_to_locsItem = OpenAPI_route_to_location_parseFromJSON(route_to_locs_local_nonprimitive);
if (!route_to_locsItem) {
ogs_error("No route_to_locsItem");
OpenAPI_list_free(route_to_locsList);
goto end;
route_to_locsList = OpenAPI_list_create();
cJSON_ArrayForEach(route_to_locs_local, route_to_locs) {
if (!cJSON_IsObject(route_to_locs_local)) {
ogs_error("OpenAPI_af_routing_requirement_rm_parseFromJSON() failed [route_to_locs]");
goto end;
}
OpenAPI_route_to_location_t *route_to_locsItem = OpenAPI_route_to_location_parseFromJSON(route_to_locs_local);
if (!route_to_locsItem) {
ogs_error("No route_to_locsItem");
OpenAPI_list_free(route_to_locsList);
goto end;
}
OpenAPI_list_add(route_to_locsList, route_to_locsItem);
}
OpenAPI_list_add(route_to_locsList, route_to_locsItem);
}
}
cJSON *sp_val = cJSON_GetObjectItemCaseSensitive(af_routing_requirement_rmJSON, "spVal");
OpenAPI_spatial_validity_rm_t *sp_val_local_nonprim = NULL;
sp_val = cJSON_GetObjectItemCaseSensitive(af_routing_requirement_rmJSON, "spVal");
if (sp_val) {
sp_val_local_nonprim = OpenAPI_spatial_validity_rm_parseFromJSON(sp_val);
}
cJSON *temp_vals = cJSON_GetObjectItemCaseSensitive(af_routing_requirement_rmJSON, "tempVals");
OpenAPI_list_t *temp_valsList;
temp_vals = cJSON_GetObjectItemCaseSensitive(af_routing_requirement_rmJSON, "tempVals");
if (temp_vals) {
cJSON *temp_vals_local_nonprimitive;
if (!cJSON_IsArray(temp_vals)){
ogs_error("OpenAPI_af_routing_requirement_rm_parseFromJSON() failed [temp_vals]");
goto end;
}
temp_valsList = OpenAPI_list_create();
cJSON_ArrayForEach(temp_vals_local_nonprimitive, temp_vals ) {
if (!cJSON_IsObject(temp_vals_local_nonprimitive)) {
cJSON *temp_vals_local = NULL;
if (!cJSON_IsArray(temp_vals)) {
ogs_error("OpenAPI_af_routing_requirement_rm_parseFromJSON() failed [temp_vals]");
goto end;
}
OpenAPI_temporal_validity_t *temp_valsItem = OpenAPI_temporal_validity_parseFromJSON(temp_vals_local_nonprimitive);
if (!temp_valsItem) {
ogs_error("No temp_valsItem");
OpenAPI_list_free(temp_valsList);
goto end;
temp_valsList = OpenAPI_list_create();
cJSON_ArrayForEach(temp_vals_local, temp_vals) {
if (!cJSON_IsObject(temp_vals_local)) {
ogs_error("OpenAPI_af_routing_requirement_rm_parseFromJSON() failed [temp_vals]");
goto end;
}
OpenAPI_temporal_validity_t *temp_valsItem = OpenAPI_temporal_validity_parseFromJSON(temp_vals_local);
if (!temp_valsItem) {
ogs_error("No temp_valsItem");
OpenAPI_list_free(temp_valsList);
goto end;
}
OpenAPI_list_add(temp_valsList, temp_valsItem);
}
OpenAPI_list_add(temp_valsList, temp_valsItem);
}
}
cJSON *up_path_chg_sub = cJSON_GetObjectItemCaseSensitive(af_routing_requirement_rmJSON, "upPathChgSub");
OpenAPI_up_path_chg_event_t *up_path_chg_sub_local_nonprim = NULL;
up_path_chg_sub = cJSON_GetObjectItemCaseSensitive(af_routing_requirement_rmJSON, "upPathChgSub");
if (up_path_chg_sub) {
up_path_chg_sub_local_nonprim = OpenAPI_up_path_chg_event_parseFromJSON(up_path_chg_sub);
}
cJSON *addr_preser_ind = cJSON_GetObjectItemCaseSensitive(af_routing_requirement_rmJSON, "addrPreserInd");
addr_preser_ind = cJSON_GetObjectItemCaseSensitive(af_routing_requirement_rmJSON, "addrPreserInd");
if (addr_preser_ind) {
if (!cJSON_IsBool(addr_preser_ind)) {
ogs_error("OpenAPI_af_routing_requirement_rm_parseFromJSON() failed [addr_preser_ind]");
@ -249,6 +252,28 @@ OpenAPI_af_routing_requirement_rm_t *OpenAPI_af_routing_requirement_rm_parseFrom
return af_routing_requirement_rm_local_var;
end:
if (route_to_locsList) {
OpenAPI_list_for_each(route_to_locsList, node) {
OpenAPI_route_to_location_free(node->data);
}
OpenAPI_list_free(route_to_locsList);
route_to_locsList = NULL;
}
if (sp_val_local_nonprim) {
OpenAPI_spatial_validity_rm_free(sp_val_local_nonprim);
sp_val_local_nonprim = NULL;
}
if (temp_valsList) {
OpenAPI_list_for_each(temp_valsList, node) {
OpenAPI_temporal_validity_free(node->data);
}
OpenAPI_list_free(temp_valsList);
temp_valsList = NULL;
}
if (up_path_chg_sub_local_nonprim) {
OpenAPI_up_path_chg_event_free(up_path_chg_sub_local_nonprim);
up_path_chg_sub_local_nonprim = NULL;
}
return NULL;
}

View File

@ -20,18 +20,26 @@ OpenAPI_allowed_mtc_provider_info_t *OpenAPI_allowed_mtc_provider_info_create(
void OpenAPI_allowed_mtc_provider_info_free(OpenAPI_allowed_mtc_provider_info_t *allowed_mtc_provider_info)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == allowed_mtc_provider_info) {
return;
}
OpenAPI_lnode_t *node;
ogs_free(allowed_mtc_provider_info->mtc_provider_information);
ogs_free(allowed_mtc_provider_info->af_id);
if (allowed_mtc_provider_info->mtc_provider_information) {
ogs_free(allowed_mtc_provider_info->mtc_provider_information);
allowed_mtc_provider_info->mtc_provider_information = NULL;
}
if (allowed_mtc_provider_info->af_id) {
ogs_free(allowed_mtc_provider_info->af_id);
allowed_mtc_provider_info->af_id = NULL;
}
ogs_free(allowed_mtc_provider_info);
}
cJSON *OpenAPI_allowed_mtc_provider_info_convertToJSON(OpenAPI_allowed_mtc_provider_info_t *allowed_mtc_provider_info)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (allowed_mtc_provider_info == NULL) {
ogs_error("OpenAPI_allowed_mtc_provider_info_convertToJSON() failed [AllowedMtcProviderInfo]");
@ -60,27 +68,28 @@ end:
OpenAPI_allowed_mtc_provider_info_t *OpenAPI_allowed_mtc_provider_info_parseFromJSON(cJSON *allowed_mtc_provider_infoJSON)
{
OpenAPI_allowed_mtc_provider_info_t *allowed_mtc_provider_info_local_var = NULL;
cJSON *mtc_provider_information = cJSON_GetObjectItemCaseSensitive(allowed_mtc_provider_infoJSON, "mtcProviderInformation");
OpenAPI_lnode_t *node = NULL;
cJSON *mtc_provider_information = NULL;
cJSON *af_id = NULL;
mtc_provider_information = cJSON_GetObjectItemCaseSensitive(allowed_mtc_provider_infoJSON, "mtcProviderInformation");
if (mtc_provider_information) {
if (!cJSON_IsString(mtc_provider_information)) {
if (!cJSON_IsString(mtc_provider_information) && !cJSON_IsNull(mtc_provider_information)) {
ogs_error("OpenAPI_allowed_mtc_provider_info_parseFromJSON() failed [mtc_provider_information]");
goto end;
}
}
cJSON *af_id = cJSON_GetObjectItemCaseSensitive(allowed_mtc_provider_infoJSON, "afId");
af_id = cJSON_GetObjectItemCaseSensitive(allowed_mtc_provider_infoJSON, "afId");
if (af_id) {
if (!cJSON_IsString(af_id)) {
if (!cJSON_IsString(af_id) && !cJSON_IsNull(af_id)) {
ogs_error("OpenAPI_allowed_mtc_provider_info_parseFromJSON() failed [af_id]");
goto end;
}
}
allowed_mtc_provider_info_local_var = OpenAPI_allowed_mtc_provider_info_create (
mtc_provider_information ? ogs_strdup(mtc_provider_information->valuestring) : NULL,
af_id ? ogs_strdup(af_id->valuestring) : NULL
mtc_provider_information && !cJSON_IsNull(mtc_provider_information) ? ogs_strdup(mtc_provider_information->valuestring) : NULL,
af_id && !cJSON_IsNull(af_id) ? ogs_strdup(af_id->valuestring) : NULL
);
return allowed_mtc_provider_info_local_var;

View File

@ -20,20 +20,25 @@ OpenAPI_allowed_nssai_t *OpenAPI_allowed_nssai_create(
void OpenAPI_allowed_nssai_free(OpenAPI_allowed_nssai_t *allowed_nssai)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == allowed_nssai) {
return;
}
OpenAPI_lnode_t *node;
OpenAPI_list_for_each(allowed_nssai->allowed_snssai_list, node) {
OpenAPI_allowed_snssai_free(node->data);
if (allowed_nssai->allowed_snssai_list) {
OpenAPI_list_for_each(allowed_nssai->allowed_snssai_list, node) {
OpenAPI_allowed_snssai_free(node->data);
}
OpenAPI_list_free(allowed_nssai->allowed_snssai_list);
allowed_nssai->allowed_snssai_list = NULL;
}
OpenAPI_list_free(allowed_nssai->allowed_snssai_list);
ogs_free(allowed_nssai);
}
cJSON *OpenAPI_allowed_nssai_convertToJSON(OpenAPI_allowed_nssai_t *allowed_nssai)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (allowed_nssai == NULL) {
ogs_error("OpenAPI_allowed_nssai_convertToJSON() failed [AllowedNssai]");
@ -41,24 +46,28 @@ cJSON *OpenAPI_allowed_nssai_convertToJSON(OpenAPI_allowed_nssai_t *allowed_nssa
}
item = cJSON_CreateObject();
if (!allowed_nssai->allowed_snssai_list) {
ogs_error("OpenAPI_allowed_nssai_convertToJSON() failed [allowed_snssai_list]");
return NULL;
}
cJSON *allowed_snssai_listList = cJSON_AddArrayToObject(item, "allowedSnssaiList");
if (allowed_snssai_listList == NULL) {
ogs_error("OpenAPI_allowed_nssai_convertToJSON() failed [allowed_snssai_list]");
goto end;
}
OpenAPI_lnode_t *allowed_snssai_list_node;
if (allowed_nssai->allowed_snssai_list) {
OpenAPI_list_for_each(allowed_nssai->allowed_snssai_list, allowed_snssai_list_node) {
cJSON *itemLocal = OpenAPI_allowed_snssai_convertToJSON(allowed_snssai_list_node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_allowed_nssai_convertToJSON() failed [allowed_snssai_list]");
goto end;
}
cJSON_AddItemToArray(allowed_snssai_listList, itemLocal);
OpenAPI_list_for_each(allowed_nssai->allowed_snssai_list, node) {
cJSON *itemLocal = OpenAPI_allowed_snssai_convertToJSON(node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_allowed_nssai_convertToJSON() failed [allowed_snssai_list]");
goto end;
}
cJSON_AddItemToArray(allowed_snssai_listList, itemLocal);
}
if (allowed_nssai->access_type == OpenAPI_access_type_NULL) {
ogs_error("OpenAPI_allowed_nssai_convertToJSON() failed [access_type]");
return NULL;
}
if (cJSON_AddStringToObject(item, "accessType", OpenAPI_access_type_ToString(allowed_nssai->access_type)) == NULL) {
ogs_error("OpenAPI_allowed_nssai_convertToJSON() failed [access_type]");
goto end;
@ -71,44 +80,43 @@ end:
OpenAPI_allowed_nssai_t *OpenAPI_allowed_nssai_parseFromJSON(cJSON *allowed_nssaiJSON)
{
OpenAPI_allowed_nssai_t *allowed_nssai_local_var = NULL;
cJSON *allowed_snssai_list = cJSON_GetObjectItemCaseSensitive(allowed_nssaiJSON, "allowedSnssaiList");
OpenAPI_lnode_t *node = NULL;
cJSON *allowed_snssai_list = NULL;
OpenAPI_list_t *allowed_snssai_listList = NULL;
cJSON *access_type = NULL;
OpenAPI_access_type_e access_typeVariable = 0;
allowed_snssai_list = cJSON_GetObjectItemCaseSensitive(allowed_nssaiJSON, "allowedSnssaiList");
if (!allowed_snssai_list) {
ogs_error("OpenAPI_allowed_nssai_parseFromJSON() failed [allowed_snssai_list]");
goto end;
}
OpenAPI_list_t *allowed_snssai_listList;
cJSON *allowed_snssai_list_local_nonprimitive;
if (!cJSON_IsArray(allowed_snssai_list)){
ogs_error("OpenAPI_allowed_nssai_parseFromJSON() failed [allowed_snssai_list]");
goto end;
}
allowed_snssai_listList = OpenAPI_list_create();
cJSON_ArrayForEach(allowed_snssai_list_local_nonprimitive, allowed_snssai_list ) {
if (!cJSON_IsObject(allowed_snssai_list_local_nonprimitive)) {
cJSON *allowed_snssai_list_local = NULL;
if (!cJSON_IsArray(allowed_snssai_list)) {
ogs_error("OpenAPI_allowed_nssai_parseFromJSON() failed [allowed_snssai_list]");
goto end;
}
OpenAPI_allowed_snssai_t *allowed_snssai_listItem = OpenAPI_allowed_snssai_parseFromJSON(allowed_snssai_list_local_nonprimitive);
if (!allowed_snssai_listItem) {
ogs_error("No allowed_snssai_listItem");
OpenAPI_list_free(allowed_snssai_listList);
goto end;
allowed_snssai_listList = OpenAPI_list_create();
cJSON_ArrayForEach(allowed_snssai_list_local, allowed_snssai_list) {
if (!cJSON_IsObject(allowed_snssai_list_local)) {
ogs_error("OpenAPI_allowed_nssai_parseFromJSON() failed [allowed_snssai_list]");
goto end;
}
OpenAPI_allowed_snssai_t *allowed_snssai_listItem = OpenAPI_allowed_snssai_parseFromJSON(allowed_snssai_list_local);
if (!allowed_snssai_listItem) {
ogs_error("No allowed_snssai_listItem");
OpenAPI_list_free(allowed_snssai_listList);
goto end;
}
OpenAPI_list_add(allowed_snssai_listList, allowed_snssai_listItem);
}
OpenAPI_list_add(allowed_snssai_listList, allowed_snssai_listItem);
}
cJSON *access_type = cJSON_GetObjectItemCaseSensitive(allowed_nssaiJSON, "accessType");
access_type = cJSON_GetObjectItemCaseSensitive(allowed_nssaiJSON, "accessType");
if (!access_type) {
ogs_error("OpenAPI_allowed_nssai_parseFromJSON() failed [access_type]");
goto end;
}
OpenAPI_access_type_e access_typeVariable;
if (!cJSON_IsString(access_type)) {
ogs_error("OpenAPI_allowed_nssai_parseFromJSON() failed [access_type]");
goto end;
@ -122,6 +130,13 @@ OpenAPI_allowed_nssai_t *OpenAPI_allowed_nssai_parseFromJSON(cJSON *allowed_nssa
return allowed_nssai_local_var;
end:
if (allowed_snssai_listList) {
OpenAPI_list_for_each(allowed_snssai_listList, node) {
OpenAPI_allowed_snssai_free(node->data);
}
OpenAPI_list_free(allowed_snssai_listList);
allowed_snssai_listList = NULL;
}
return NULL;
}

View File

@ -22,22 +22,33 @@ OpenAPI_allowed_snssai_t *OpenAPI_allowed_snssai_create(
void OpenAPI_allowed_snssai_free(OpenAPI_allowed_snssai_t *allowed_snssai)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == allowed_snssai) {
return;
}
OpenAPI_lnode_t *node;
OpenAPI_snssai_free(allowed_snssai->allowed_snssai);
OpenAPI_list_for_each(allowed_snssai->nsi_information_list, node) {
OpenAPI_nsi_information_free(node->data);
if (allowed_snssai->allowed_snssai) {
OpenAPI_snssai_free(allowed_snssai->allowed_snssai);
allowed_snssai->allowed_snssai = NULL;
}
if (allowed_snssai->nsi_information_list) {
OpenAPI_list_for_each(allowed_snssai->nsi_information_list, node) {
OpenAPI_nsi_information_free(node->data);
}
OpenAPI_list_free(allowed_snssai->nsi_information_list);
allowed_snssai->nsi_information_list = NULL;
}
if (allowed_snssai->mapped_home_snssai) {
OpenAPI_snssai_free(allowed_snssai->mapped_home_snssai);
allowed_snssai->mapped_home_snssai = NULL;
}
OpenAPI_list_free(allowed_snssai->nsi_information_list);
OpenAPI_snssai_free(allowed_snssai->mapped_home_snssai);
ogs_free(allowed_snssai);
}
cJSON *OpenAPI_allowed_snssai_convertToJSON(OpenAPI_allowed_snssai_t *allowed_snssai)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (allowed_snssai == NULL) {
ogs_error("OpenAPI_allowed_snssai_convertToJSON() failed [AllowedSnssai]");
@ -45,6 +56,10 @@ cJSON *OpenAPI_allowed_snssai_convertToJSON(OpenAPI_allowed_snssai_t *allowed_sn
}
item = cJSON_CreateObject();
if (!allowed_snssai->allowed_snssai) {
ogs_error("OpenAPI_allowed_snssai_convertToJSON() failed [allowed_snssai]");
return NULL;
}
cJSON *allowed_snssai_local_JSON = OpenAPI_snssai_convertToJSON(allowed_snssai->allowed_snssai);
if (allowed_snssai_local_JSON == NULL) {
ogs_error("OpenAPI_allowed_snssai_convertToJSON() failed [allowed_snssai]");
@ -62,17 +77,13 @@ cJSON *OpenAPI_allowed_snssai_convertToJSON(OpenAPI_allowed_snssai_t *allowed_sn
ogs_error("OpenAPI_allowed_snssai_convertToJSON() failed [nsi_information_list]");
goto end;
}
OpenAPI_lnode_t *nsi_information_list_node;
if (allowed_snssai->nsi_information_list) {
OpenAPI_list_for_each(allowed_snssai->nsi_information_list, nsi_information_list_node) {
cJSON *itemLocal = OpenAPI_nsi_information_convertToJSON(nsi_information_list_node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_allowed_snssai_convertToJSON() failed [nsi_information_list]");
goto end;
}
cJSON_AddItemToArray(nsi_information_listList, itemLocal);
OpenAPI_list_for_each(allowed_snssai->nsi_information_list, node) {
cJSON *itemLocal = OpenAPI_nsi_information_convertToJSON(node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_allowed_snssai_convertToJSON() failed [nsi_information_list]");
goto end;
}
cJSON_AddItemToArray(nsi_information_listList, itemLocal);
}
}
@ -96,47 +107,46 @@ end:
OpenAPI_allowed_snssai_t *OpenAPI_allowed_snssai_parseFromJSON(cJSON *allowed_snssaiJSON)
{
OpenAPI_allowed_snssai_t *allowed_snssai_local_var = NULL;
cJSON *allowed_snssai = cJSON_GetObjectItemCaseSensitive(allowed_snssaiJSON, "allowedSnssai");
OpenAPI_lnode_t *node = NULL;
cJSON *allowed_snssai = NULL;
OpenAPI_snssai_t *allowed_snssai_local_nonprim = NULL;
cJSON *nsi_information_list = NULL;
OpenAPI_list_t *nsi_information_listList = NULL;
cJSON *mapped_home_snssai = NULL;
OpenAPI_snssai_t *mapped_home_snssai_local_nonprim = NULL;
allowed_snssai = cJSON_GetObjectItemCaseSensitive(allowed_snssaiJSON, "allowedSnssai");
if (!allowed_snssai) {
ogs_error("OpenAPI_allowed_snssai_parseFromJSON() failed [allowed_snssai]");
goto end;
}
OpenAPI_snssai_t *allowed_snssai_local_nonprim = NULL;
allowed_snssai_local_nonprim = OpenAPI_snssai_parseFromJSON(allowed_snssai);
cJSON *nsi_information_list = cJSON_GetObjectItemCaseSensitive(allowed_snssaiJSON, "nsiInformationList");
OpenAPI_list_t *nsi_information_listList;
nsi_information_list = cJSON_GetObjectItemCaseSensitive(allowed_snssaiJSON, "nsiInformationList");
if (nsi_information_list) {
cJSON *nsi_information_list_local_nonprimitive;
if (!cJSON_IsArray(nsi_information_list)){
ogs_error("OpenAPI_allowed_snssai_parseFromJSON() failed [nsi_information_list]");
goto end;
}
nsi_information_listList = OpenAPI_list_create();
cJSON_ArrayForEach(nsi_information_list_local_nonprimitive, nsi_information_list ) {
if (!cJSON_IsObject(nsi_information_list_local_nonprimitive)) {
cJSON *nsi_information_list_local = NULL;
if (!cJSON_IsArray(nsi_information_list)) {
ogs_error("OpenAPI_allowed_snssai_parseFromJSON() failed [nsi_information_list]");
goto end;
}
OpenAPI_nsi_information_t *nsi_information_listItem = OpenAPI_nsi_information_parseFromJSON(nsi_information_list_local_nonprimitive);
if (!nsi_information_listItem) {
ogs_error("No nsi_information_listItem");
OpenAPI_list_free(nsi_information_listList);
goto end;
nsi_information_listList = OpenAPI_list_create();
cJSON_ArrayForEach(nsi_information_list_local, nsi_information_list) {
if (!cJSON_IsObject(nsi_information_list_local)) {
ogs_error("OpenAPI_allowed_snssai_parseFromJSON() failed [nsi_information_list]");
goto end;
}
OpenAPI_nsi_information_t *nsi_information_listItem = OpenAPI_nsi_information_parseFromJSON(nsi_information_list_local);
if (!nsi_information_listItem) {
ogs_error("No nsi_information_listItem");
OpenAPI_list_free(nsi_information_listList);
goto end;
}
OpenAPI_list_add(nsi_information_listList, nsi_information_listItem);
}
OpenAPI_list_add(nsi_information_listList, nsi_information_listItem);
}
}
cJSON *mapped_home_snssai = cJSON_GetObjectItemCaseSensitive(allowed_snssaiJSON, "mappedHomeSnssai");
OpenAPI_snssai_t *mapped_home_snssai_local_nonprim = NULL;
mapped_home_snssai = cJSON_GetObjectItemCaseSensitive(allowed_snssaiJSON, "mappedHomeSnssai");
if (mapped_home_snssai) {
mapped_home_snssai_local_nonprim = OpenAPI_snssai_parseFromJSON(mapped_home_snssai);
}
@ -149,6 +159,21 @@ OpenAPI_allowed_snssai_t *OpenAPI_allowed_snssai_parseFromJSON(cJSON *allowed_sn
return allowed_snssai_local_var;
end:
if (allowed_snssai_local_nonprim) {
OpenAPI_snssai_free(allowed_snssai_local_nonprim);
allowed_snssai_local_nonprim = NULL;
}
if (nsi_information_listList) {
OpenAPI_list_for_each(nsi_information_listList, node) {
OpenAPI_nsi_information_free(node->data);
}
OpenAPI_list_free(nsi_information_listList);
nsi_information_listList = NULL;
}
if (mapped_home_snssai_local_nonprim) {
OpenAPI_snssai_free(mapped_home_snssai_local_nonprim);
mapped_home_snssai_local_nonprim = NULL;
}
return NULL;
}

View File

@ -28,19 +28,30 @@ OpenAPI_alternative_qos_profile_t *OpenAPI_alternative_qos_profile_create(
void OpenAPI_alternative_qos_profile_free(OpenAPI_alternative_qos_profile_t *alternative_qos_profile)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == alternative_qos_profile) {
return;
}
OpenAPI_lnode_t *node;
ogs_free(alternative_qos_profile->gua_fbr_dl);
ogs_free(alternative_qos_profile->gua_fbr_ul);
ogs_free(alternative_qos_profile->packet_err_rate);
if (alternative_qos_profile->gua_fbr_dl) {
ogs_free(alternative_qos_profile->gua_fbr_dl);
alternative_qos_profile->gua_fbr_dl = NULL;
}
if (alternative_qos_profile->gua_fbr_ul) {
ogs_free(alternative_qos_profile->gua_fbr_ul);
alternative_qos_profile->gua_fbr_ul = NULL;
}
if (alternative_qos_profile->packet_err_rate) {
ogs_free(alternative_qos_profile->packet_err_rate);
alternative_qos_profile->packet_err_rate = NULL;
}
ogs_free(alternative_qos_profile);
}
cJSON *OpenAPI_alternative_qos_profile_convertToJSON(OpenAPI_alternative_qos_profile_t *alternative_qos_profile)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (alternative_qos_profile == NULL) {
ogs_error("OpenAPI_alternative_qos_profile_convertToJSON() failed [AlternativeQosProfile]");
@ -88,37 +99,39 @@ end:
OpenAPI_alternative_qos_profile_t *OpenAPI_alternative_qos_profile_parseFromJSON(cJSON *alternative_qos_profileJSON)
{
OpenAPI_alternative_qos_profile_t *alternative_qos_profile_local_var = NULL;
cJSON *index = cJSON_GetObjectItemCaseSensitive(alternative_qos_profileJSON, "index");
OpenAPI_lnode_t *node = NULL;
cJSON *index = NULL;
cJSON *gua_fbr_dl = NULL;
cJSON *gua_fbr_ul = NULL;
cJSON *packet_delay_budget = NULL;
cJSON *packet_err_rate = NULL;
index = cJSON_GetObjectItemCaseSensitive(alternative_qos_profileJSON, "index");
if (!index) {
ogs_error("OpenAPI_alternative_qos_profile_parseFromJSON() failed [index]");
goto end;
}
if (!cJSON_IsNumber(index)) {
ogs_error("OpenAPI_alternative_qos_profile_parseFromJSON() failed [index]");
goto end;
}
cJSON *gua_fbr_dl = cJSON_GetObjectItemCaseSensitive(alternative_qos_profileJSON, "guaFbrDl");
gua_fbr_dl = cJSON_GetObjectItemCaseSensitive(alternative_qos_profileJSON, "guaFbrDl");
if (gua_fbr_dl) {
if (!cJSON_IsString(gua_fbr_dl)) {
if (!cJSON_IsString(gua_fbr_dl) && !cJSON_IsNull(gua_fbr_dl)) {
ogs_error("OpenAPI_alternative_qos_profile_parseFromJSON() failed [gua_fbr_dl]");
goto end;
}
}
cJSON *gua_fbr_ul = cJSON_GetObjectItemCaseSensitive(alternative_qos_profileJSON, "guaFbrUl");
gua_fbr_ul = cJSON_GetObjectItemCaseSensitive(alternative_qos_profileJSON, "guaFbrUl");
if (gua_fbr_ul) {
if (!cJSON_IsString(gua_fbr_ul)) {
if (!cJSON_IsString(gua_fbr_ul) && !cJSON_IsNull(gua_fbr_ul)) {
ogs_error("OpenAPI_alternative_qos_profile_parseFromJSON() failed [gua_fbr_ul]");
goto end;
}
}
cJSON *packet_delay_budget = cJSON_GetObjectItemCaseSensitive(alternative_qos_profileJSON, "packetDelayBudget");
packet_delay_budget = cJSON_GetObjectItemCaseSensitive(alternative_qos_profileJSON, "packetDelayBudget");
if (packet_delay_budget) {
if (!cJSON_IsNumber(packet_delay_budget)) {
ogs_error("OpenAPI_alternative_qos_profile_parseFromJSON() failed [packet_delay_budget]");
@ -126,10 +139,9 @@ OpenAPI_alternative_qos_profile_t *OpenAPI_alternative_qos_profile_parseFromJSON
}
}
cJSON *packet_err_rate = cJSON_GetObjectItemCaseSensitive(alternative_qos_profileJSON, "packetErrRate");
packet_err_rate = cJSON_GetObjectItemCaseSensitive(alternative_qos_profileJSON, "packetErrRate");
if (packet_err_rate) {
if (!cJSON_IsString(packet_err_rate)) {
if (!cJSON_IsString(packet_err_rate) && !cJSON_IsNull(packet_err_rate)) {
ogs_error("OpenAPI_alternative_qos_profile_parseFromJSON() failed [packet_err_rate]");
goto end;
}
@ -138,11 +150,11 @@ OpenAPI_alternative_qos_profile_t *OpenAPI_alternative_qos_profile_parseFromJSON
alternative_qos_profile_local_var = OpenAPI_alternative_qos_profile_create (
index->valuedouble,
gua_fbr_dl ? ogs_strdup(gua_fbr_dl->valuestring) : NULL,
gua_fbr_ul ? ogs_strdup(gua_fbr_ul->valuestring) : NULL,
gua_fbr_dl && !cJSON_IsNull(gua_fbr_dl) ? ogs_strdup(gua_fbr_dl->valuestring) : NULL,
gua_fbr_ul && !cJSON_IsNull(gua_fbr_ul) ? ogs_strdup(gua_fbr_ul->valuestring) : NULL,
packet_delay_budget ? true : false,
packet_delay_budget ? packet_delay_budget->valuedouble : 0,
packet_err_rate ? ogs_strdup(packet_err_rate->valuestring) : NULL
packet_err_rate && !cJSON_IsNull(packet_err_rate) ? ogs_strdup(packet_err_rate->valuestring) : NULL
);
return alternative_qos_profile_local_var;

View File

@ -20,27 +20,35 @@ OpenAPI_am_policy_data_t *OpenAPI_am_policy_data_create(
void OpenAPI_am_policy_data_free(OpenAPI_am_policy_data_t *am_policy_data)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == am_policy_data) {
return;
}
OpenAPI_lnode_t *node;
OpenAPI_list_for_each(am_policy_data->pra_infos, node) {
OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data;
ogs_free(localKeyValue->key);
OpenAPI_presence_info_free(localKeyValue->value);
ogs_free(localKeyValue);
if (am_policy_data->pra_infos) {
OpenAPI_list_for_each(am_policy_data->pra_infos, node) {
OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data;
ogs_free(localKeyValue->key);
OpenAPI_presence_info_free(localKeyValue->value);
OpenAPI_map_free(localKeyValue);
}
OpenAPI_list_free(am_policy_data->pra_infos);
am_policy_data->pra_infos = NULL;
}
OpenAPI_list_free(am_policy_data->pra_infos);
OpenAPI_list_for_each(am_policy_data->subsc_cats, node) {
ogs_free(node->data);
if (am_policy_data->subsc_cats) {
OpenAPI_list_for_each(am_policy_data->subsc_cats, node) {
ogs_free(node->data);
}
OpenAPI_list_free(am_policy_data->subsc_cats);
am_policy_data->subsc_cats = NULL;
}
OpenAPI_list_free(am_policy_data->subsc_cats);
ogs_free(am_policy_data);
}
cJSON *OpenAPI_am_policy_data_convertToJSON(OpenAPI_am_policy_data_t *am_policy_data)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (am_policy_data == NULL) {
ogs_error("OpenAPI_am_policy_data_convertToJSON() failed [AmPolicyData]");
@ -55,36 +63,33 @@ cJSON *OpenAPI_am_policy_data_convertToJSON(OpenAPI_am_policy_data_t *am_policy_
goto end;
}
cJSON *localMapObject = pra_infos;
OpenAPI_lnode_t *pra_infos_node;
if (am_policy_data->pra_infos) {
OpenAPI_list_for_each(am_policy_data->pra_infos, pra_infos_node) {
OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)pra_infos_node->data;
cJSON *itemLocal = localKeyValue->value ?
OpenAPI_presence_info_convertToJSON(localKeyValue->value) :
cJSON_CreateNull();
if (itemLocal == NULL) {
ogs_error("OpenAPI_am_policy_data_convertToJSON() failed [inner]");
goto end;
}
cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal);
OpenAPI_list_for_each(am_policy_data->pra_infos, node) {
OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data;
cJSON *itemLocal = localKeyValue->value ?
OpenAPI_presence_info_convertToJSON(localKeyValue->value) :
cJSON_CreateNull();
if (itemLocal == NULL) {
ogs_error("OpenAPI_am_policy_data_convertToJSON() failed [inner]");
goto end;
}
cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal);
}
}
}
if (am_policy_data->subsc_cats) {
cJSON *subsc_cats = cJSON_AddArrayToObject(item, "subscCats");
if (subsc_cats == NULL) {
cJSON *subsc_catsList = cJSON_AddArrayToObject(item, "subscCats");
if (subsc_catsList == NULL) {
ogs_error("OpenAPI_am_policy_data_convertToJSON() failed [subsc_cats]");
goto end;
}
OpenAPI_lnode_t *subsc_cats_node;
OpenAPI_list_for_each(am_policy_data->subsc_cats, subsc_cats_node) {
if (cJSON_AddStringToObject(subsc_cats, "", (char*)subsc_cats_node->data) == NULL) {
ogs_error("OpenAPI_am_policy_data_convertToJSON() failed [subsc_cats]");
goto end;
OpenAPI_list_for_each(am_policy_data->subsc_cats, node) {
if (cJSON_AddStringToObject(subsc_catsList, "", (char*)node->data) == NULL) {
ogs_error("OpenAPI_am_policy_data_convertToJSON() failed [subsc_cats]");
goto end;
}
}
}
}
end:
@ -94,50 +99,56 @@ end:
OpenAPI_am_policy_data_t *OpenAPI_am_policy_data_parseFromJSON(cJSON *am_policy_dataJSON)
{
OpenAPI_am_policy_data_t *am_policy_data_local_var = NULL;
cJSON *pra_infos = cJSON_GetObjectItemCaseSensitive(am_policy_dataJSON, "praInfos");
OpenAPI_list_t *pra_infosList;
OpenAPI_lnode_t *node = NULL;
cJSON *pra_infos = NULL;
OpenAPI_list_t *pra_infosList = NULL;
cJSON *subsc_cats = NULL;
OpenAPI_list_t *subsc_catsList = NULL;
pra_infos = cJSON_GetObjectItemCaseSensitive(am_policy_dataJSON, "praInfos");
if (pra_infos) {
cJSON *pra_infos_local_map;
if (!cJSON_IsObject(pra_infos)) {
ogs_error("OpenAPI_am_policy_data_parseFromJSON() failed [pra_infos]");
goto end;
}
pra_infosList = OpenAPI_list_create();
OpenAPI_map_t *localMapKeyPair = NULL;
cJSON_ArrayForEach(pra_infos_local_map, pra_infos) {
cJSON *localMapObject = pra_infos_local_map;
if (cJSON_IsObject(localMapObject)) {
localMapKeyPair = OpenAPI_map_create(
ogs_strdup(localMapObject->string), OpenAPI_presence_info_parseFromJSON(localMapObject));
} else if (cJSON_IsNull(localMapObject)) {
localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL);
} else {
ogs_error("OpenAPI_am_policy_data_parseFromJSON() failed [inner]");
cJSON *pra_infos_local_map = NULL;
if (!cJSON_IsObject(pra_infos) && !cJSON_IsNull(pra_infos)) {
ogs_error("OpenAPI_am_policy_data_parseFromJSON() failed [pra_infos]");
goto end;
}
OpenAPI_list_add(pra_infosList, localMapKeyPair);
}
if (cJSON_IsObject(pra_infos)) {
pra_infosList = OpenAPI_list_create();
OpenAPI_map_t *localMapKeyPair = NULL;
cJSON_ArrayForEach(pra_infos_local_map, pra_infos) {
cJSON *localMapObject = pra_infos_local_map;
if (cJSON_IsObject(localMapObject)) {
localMapKeyPair = OpenAPI_map_create(
ogs_strdup(localMapObject->string), OpenAPI_presence_info_parseFromJSON(localMapObject));
} else if (cJSON_IsNull(localMapObject)) {
localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL);
} else {
ogs_error("OpenAPI_am_policy_data_parseFromJSON() failed [inner]");
goto end;
}
OpenAPI_list_add(pra_infosList, localMapKeyPair);
}
}
}
cJSON *subsc_cats = cJSON_GetObjectItemCaseSensitive(am_policy_dataJSON, "subscCats");
OpenAPI_list_t *subsc_catsList;
subsc_cats = cJSON_GetObjectItemCaseSensitive(am_policy_dataJSON, "subscCats");
if (subsc_cats) {
cJSON *subsc_cats_local;
if (!cJSON_IsArray(subsc_cats)) {
ogs_error("OpenAPI_am_policy_data_parseFromJSON() failed [subsc_cats]");
goto end;
}
subsc_catsList = OpenAPI_list_create();
cJSON *subsc_cats_local = NULL;
if (!cJSON_IsArray(subsc_cats)) {
ogs_error("OpenAPI_am_policy_data_parseFromJSON() failed [subsc_cats]");
goto end;
}
cJSON_ArrayForEach(subsc_cats_local, subsc_cats) {
if (!cJSON_IsString(subsc_cats_local)) {
ogs_error("OpenAPI_am_policy_data_parseFromJSON() failed [subsc_cats]");
goto end;
}
OpenAPI_list_add(subsc_catsList, ogs_strdup(subsc_cats_local->valuestring));
}
subsc_catsList = OpenAPI_list_create();
cJSON_ArrayForEach(subsc_cats_local, subsc_cats) {
double *localDouble = NULL;
int *localInt = NULL;
if (!cJSON_IsString(subsc_cats_local)) {
ogs_error("OpenAPI_am_policy_data_parseFromJSON() failed [subsc_cats]");
goto end;
}
OpenAPI_list_add(subsc_catsList, ogs_strdup(subsc_cats_local->valuestring));
}
}
am_policy_data_local_var = OpenAPI_am_policy_data_create (
@ -147,6 +158,23 @@ OpenAPI_am_policy_data_t *OpenAPI_am_policy_data_parseFromJSON(cJSON *am_policy_
return am_policy_data_local_var;
end:
if (pra_infosList) {
OpenAPI_list_for_each(pra_infosList, node) {
OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data;
ogs_free(localKeyValue->key);
OpenAPI_presence_info_free(localKeyValue->value);
OpenAPI_map_free(localKeyValue);
}
OpenAPI_list_free(pra_infosList);
pra_infosList = NULL;
}
if (subsc_catsList) {
OpenAPI_list_for_each(subsc_catsList, node) {
ogs_free(node->data);
}
OpenAPI_list_free(subsc_catsList);
subsc_catsList = NULL;
}
return NULL;
}

View File

@ -20,18 +20,26 @@ OpenAPI_ambr_t *OpenAPI_ambr_create(
void OpenAPI_ambr_free(OpenAPI_ambr_t *ambr)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == ambr) {
return;
}
OpenAPI_lnode_t *node;
ogs_free(ambr->uplink);
ogs_free(ambr->downlink);
if (ambr->uplink) {
ogs_free(ambr->uplink);
ambr->uplink = NULL;
}
if (ambr->downlink) {
ogs_free(ambr->downlink);
ambr->downlink = NULL;
}
ogs_free(ambr);
}
cJSON *OpenAPI_ambr_convertToJSON(OpenAPI_ambr_t *ambr)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (ambr == NULL) {
ogs_error("OpenAPI_ambr_convertToJSON() failed [Ambr]");
@ -39,11 +47,19 @@ cJSON *OpenAPI_ambr_convertToJSON(OpenAPI_ambr_t *ambr)
}
item = cJSON_CreateObject();
if (!ambr->uplink) {
ogs_error("OpenAPI_ambr_convertToJSON() failed [uplink]");
return NULL;
}
if (cJSON_AddStringToObject(item, "uplink", ambr->uplink) == NULL) {
ogs_error("OpenAPI_ambr_convertToJSON() failed [uplink]");
goto end;
}
if (!ambr->downlink) {
ogs_error("OpenAPI_ambr_convertToJSON() failed [downlink]");
return NULL;
}
if (cJSON_AddStringToObject(item, "downlink", ambr->downlink) == NULL) {
ogs_error("OpenAPI_ambr_convertToJSON() failed [downlink]");
goto end;
@ -56,23 +72,24 @@ end:
OpenAPI_ambr_t *OpenAPI_ambr_parseFromJSON(cJSON *ambrJSON)
{
OpenAPI_ambr_t *ambr_local_var = NULL;
cJSON *uplink = cJSON_GetObjectItemCaseSensitive(ambrJSON, "uplink");
OpenAPI_lnode_t *node = NULL;
cJSON *uplink = NULL;
cJSON *downlink = NULL;
uplink = cJSON_GetObjectItemCaseSensitive(ambrJSON, "uplink");
if (!uplink) {
ogs_error("OpenAPI_ambr_parseFromJSON() failed [uplink]");
goto end;
}
if (!cJSON_IsString(uplink)) {
ogs_error("OpenAPI_ambr_parseFromJSON() failed [uplink]");
goto end;
}
cJSON *downlink = cJSON_GetObjectItemCaseSensitive(ambrJSON, "downlink");
downlink = cJSON_GetObjectItemCaseSensitive(ambrJSON, "downlink");
if (!downlink) {
ogs_error("OpenAPI_ambr_parseFromJSON() failed [downlink]");
goto end;
}
if (!cJSON_IsString(downlink)) {
ogs_error("OpenAPI_ambr_parseFromJSON() failed [downlink]");
goto end;

View File

@ -20,18 +20,26 @@ OpenAPI_ambr_1_t *OpenAPI_ambr_1_create(
void OpenAPI_ambr_1_free(OpenAPI_ambr_1_t *ambr_1)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == ambr_1) {
return;
}
OpenAPI_lnode_t *node;
ogs_free(ambr_1->uplink);
ogs_free(ambr_1->downlink);
if (ambr_1->uplink) {
ogs_free(ambr_1->uplink);
ambr_1->uplink = NULL;
}
if (ambr_1->downlink) {
ogs_free(ambr_1->downlink);
ambr_1->downlink = NULL;
}
ogs_free(ambr_1);
}
cJSON *OpenAPI_ambr_1_convertToJSON(OpenAPI_ambr_1_t *ambr_1)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (ambr_1 == NULL) {
ogs_error("OpenAPI_ambr_1_convertToJSON() failed [Ambr_1]");
@ -39,11 +47,19 @@ cJSON *OpenAPI_ambr_1_convertToJSON(OpenAPI_ambr_1_t *ambr_1)
}
item = cJSON_CreateObject();
if (!ambr_1->uplink) {
ogs_error("OpenAPI_ambr_1_convertToJSON() failed [uplink]");
return NULL;
}
if (cJSON_AddStringToObject(item, "uplink", ambr_1->uplink) == NULL) {
ogs_error("OpenAPI_ambr_1_convertToJSON() failed [uplink]");
goto end;
}
if (!ambr_1->downlink) {
ogs_error("OpenAPI_ambr_1_convertToJSON() failed [downlink]");
return NULL;
}
if (cJSON_AddStringToObject(item, "downlink", ambr_1->downlink) == NULL) {
ogs_error("OpenAPI_ambr_1_convertToJSON() failed [downlink]");
goto end;
@ -56,23 +72,24 @@ end:
OpenAPI_ambr_1_t *OpenAPI_ambr_1_parseFromJSON(cJSON *ambr_1JSON)
{
OpenAPI_ambr_1_t *ambr_1_local_var = NULL;
cJSON *uplink = cJSON_GetObjectItemCaseSensitive(ambr_1JSON, "uplink");
OpenAPI_lnode_t *node = NULL;
cJSON *uplink = NULL;
cJSON *downlink = NULL;
uplink = cJSON_GetObjectItemCaseSensitive(ambr_1JSON, "uplink");
if (!uplink) {
ogs_error("OpenAPI_ambr_1_parseFromJSON() failed [uplink]");
goto end;
}
if (!cJSON_IsString(uplink)) {
ogs_error("OpenAPI_ambr_1_parseFromJSON() failed [uplink]");
goto end;
}
cJSON *downlink = cJSON_GetObjectItemCaseSensitive(ambr_1JSON, "downlink");
downlink = cJSON_GetObjectItemCaseSensitive(ambr_1JSON, "downlink");
if (!downlink) {
ogs_error("OpenAPI_ambr_1_parseFromJSON() failed [downlink]");
goto end;
}
if (!cJSON_IsString(downlink)) {
ogs_error("OpenAPI_ambr_1_parseFromJSON() failed [downlink]");
goto end;

View File

@ -20,18 +20,26 @@ OpenAPI_ambr_rm_t *OpenAPI_ambr_rm_create(
void OpenAPI_ambr_rm_free(OpenAPI_ambr_rm_t *ambr_rm)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == ambr_rm) {
return;
}
OpenAPI_lnode_t *node;
ogs_free(ambr_rm->uplink);
ogs_free(ambr_rm->downlink);
if (ambr_rm->uplink) {
ogs_free(ambr_rm->uplink);
ambr_rm->uplink = NULL;
}
if (ambr_rm->downlink) {
ogs_free(ambr_rm->downlink);
ambr_rm->downlink = NULL;
}
ogs_free(ambr_rm);
}
cJSON *OpenAPI_ambr_rm_convertToJSON(OpenAPI_ambr_rm_t *ambr_rm)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (ambr_rm == NULL) {
ogs_error("OpenAPI_ambr_rm_convertToJSON() failed [AmbrRm]");
@ -39,11 +47,19 @@ cJSON *OpenAPI_ambr_rm_convertToJSON(OpenAPI_ambr_rm_t *ambr_rm)
}
item = cJSON_CreateObject();
if (!ambr_rm->uplink) {
ogs_error("OpenAPI_ambr_rm_convertToJSON() failed [uplink]");
return NULL;
}
if (cJSON_AddStringToObject(item, "uplink", ambr_rm->uplink) == NULL) {
ogs_error("OpenAPI_ambr_rm_convertToJSON() failed [uplink]");
goto end;
}
if (!ambr_rm->downlink) {
ogs_error("OpenAPI_ambr_rm_convertToJSON() failed [downlink]");
return NULL;
}
if (cJSON_AddStringToObject(item, "downlink", ambr_rm->downlink) == NULL) {
ogs_error("OpenAPI_ambr_rm_convertToJSON() failed [downlink]");
goto end;
@ -56,23 +72,24 @@ end:
OpenAPI_ambr_rm_t *OpenAPI_ambr_rm_parseFromJSON(cJSON *ambr_rmJSON)
{
OpenAPI_ambr_rm_t *ambr_rm_local_var = NULL;
cJSON *uplink = cJSON_GetObjectItemCaseSensitive(ambr_rmJSON, "uplink");
OpenAPI_lnode_t *node = NULL;
cJSON *uplink = NULL;
cJSON *downlink = NULL;
uplink = cJSON_GetObjectItemCaseSensitive(ambr_rmJSON, "uplink");
if (!uplink) {
ogs_error("OpenAPI_ambr_rm_parseFromJSON() failed [uplink]");
goto end;
}
if (!cJSON_IsString(uplink)) {
ogs_error("OpenAPI_ambr_rm_parseFromJSON() failed [uplink]");
goto end;
}
cJSON *downlink = cJSON_GetObjectItemCaseSensitive(ambr_rmJSON, "downlink");
downlink = cJSON_GetObjectItemCaseSensitive(ambr_rmJSON, "downlink");
if (!downlink) {
ogs_error("OpenAPI_ambr_rm_parseFromJSON() failed [downlink]");
goto end;
}
if (!cJSON_IsString(downlink)) {
ogs_error("OpenAPI_ambr_rm_parseFromJSON() failed [downlink]");
goto end;

View File

@ -74,34 +74,81 @@ OpenAPI_amf3_gpp_access_registration_t *OpenAPI_amf3_gpp_access_registration_cre
void OpenAPI_amf3_gpp_access_registration_free(OpenAPI_amf3_gpp_access_registration_t *amf3_gpp_access_registration)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == amf3_gpp_access_registration) {
return;
}
OpenAPI_lnode_t *node;
ogs_free(amf3_gpp_access_registration->amf_instance_id);
ogs_free(amf3_gpp_access_registration->supported_features);
ogs_free(amf3_gpp_access_registration->pei);
ogs_free(amf3_gpp_access_registration->dereg_callback_uri);
ogs_free(amf3_gpp_access_registration->amf_service_name_dereg);
ogs_free(amf3_gpp_access_registration->pcscf_restoration_callback_uri);
ogs_free(amf3_gpp_access_registration->amf_service_name_pcscf_rest);
OpenAPI_guami_free(amf3_gpp_access_registration->guami);
OpenAPI_list_for_each(amf3_gpp_access_registration->backup_amf_info, node) {
OpenAPI_backup_amf_info_free(node->data);
if (amf3_gpp_access_registration->amf_instance_id) {
ogs_free(amf3_gpp_access_registration->amf_instance_id);
amf3_gpp_access_registration->amf_instance_id = NULL;
}
if (amf3_gpp_access_registration->supported_features) {
ogs_free(amf3_gpp_access_registration->supported_features);
amf3_gpp_access_registration->supported_features = NULL;
}
if (amf3_gpp_access_registration->pei) {
ogs_free(amf3_gpp_access_registration->pei);
amf3_gpp_access_registration->pei = NULL;
}
if (amf3_gpp_access_registration->dereg_callback_uri) {
ogs_free(amf3_gpp_access_registration->dereg_callback_uri);
amf3_gpp_access_registration->dereg_callback_uri = NULL;
}
if (amf3_gpp_access_registration->amf_service_name_dereg) {
ogs_free(amf3_gpp_access_registration->amf_service_name_dereg);
amf3_gpp_access_registration->amf_service_name_dereg = NULL;
}
if (amf3_gpp_access_registration->pcscf_restoration_callback_uri) {
ogs_free(amf3_gpp_access_registration->pcscf_restoration_callback_uri);
amf3_gpp_access_registration->pcscf_restoration_callback_uri = NULL;
}
if (amf3_gpp_access_registration->amf_service_name_pcscf_rest) {
ogs_free(amf3_gpp_access_registration->amf_service_name_pcscf_rest);
amf3_gpp_access_registration->amf_service_name_pcscf_rest = NULL;
}
if (amf3_gpp_access_registration->guami) {
OpenAPI_guami_free(amf3_gpp_access_registration->guami);
amf3_gpp_access_registration->guami = NULL;
}
if (amf3_gpp_access_registration->backup_amf_info) {
OpenAPI_list_for_each(amf3_gpp_access_registration->backup_amf_info, node) {
OpenAPI_backup_amf_info_free(node->data);
}
OpenAPI_list_free(amf3_gpp_access_registration->backup_amf_info);
amf3_gpp_access_registration->backup_amf_info = NULL;
}
if (amf3_gpp_access_registration->amf_ee_subscription_id) {
ogs_free(amf3_gpp_access_registration->amf_ee_subscription_id);
amf3_gpp_access_registration->amf_ee_subscription_id = NULL;
}
if (amf3_gpp_access_registration->eps_interworking_info) {
OpenAPI_eps_interworking_info_free(amf3_gpp_access_registration->eps_interworking_info);
amf3_gpp_access_registration->eps_interworking_info = NULL;
}
if (amf3_gpp_access_registration->registration_time) {
ogs_free(amf3_gpp_access_registration->registration_time);
amf3_gpp_access_registration->registration_time = NULL;
}
if (amf3_gpp_access_registration->vgmlc_address) {
OpenAPI_vgmlc_address_free(amf3_gpp_access_registration->vgmlc_address);
amf3_gpp_access_registration->vgmlc_address = NULL;
}
if (amf3_gpp_access_registration->context_info) {
OpenAPI_context_info_free(amf3_gpp_access_registration->context_info);
amf3_gpp_access_registration->context_info = NULL;
}
if (amf3_gpp_access_registration->supi) {
ogs_free(amf3_gpp_access_registration->supi);
amf3_gpp_access_registration->supi = NULL;
}
OpenAPI_list_free(amf3_gpp_access_registration->backup_amf_info);
ogs_free(amf3_gpp_access_registration->amf_ee_subscription_id);
OpenAPI_eps_interworking_info_free(amf3_gpp_access_registration->eps_interworking_info);
ogs_free(amf3_gpp_access_registration->registration_time);
OpenAPI_vgmlc_address_free(amf3_gpp_access_registration->vgmlc_address);
OpenAPI_context_info_free(amf3_gpp_access_registration->context_info);
ogs_free(amf3_gpp_access_registration->supi);
ogs_free(amf3_gpp_access_registration);
}
cJSON *OpenAPI_amf3_gpp_access_registration_convertToJSON(OpenAPI_amf3_gpp_access_registration_t *amf3_gpp_access_registration)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (amf3_gpp_access_registration == NULL) {
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [Amf3GppAccessRegistration]");
@ -109,6 +156,10 @@ cJSON *OpenAPI_amf3_gpp_access_registration_convertToJSON(OpenAPI_amf3_gpp_acces
}
item = cJSON_CreateObject();
if (!amf3_gpp_access_registration->amf_instance_id) {
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [amf_instance_id]");
return NULL;
}
if (cJSON_AddStringToObject(item, "amfInstanceId", amf3_gpp_access_registration->amf_instance_id) == NULL) {
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [amf_instance_id]");
goto end;
@ -135,13 +186,17 @@ cJSON *OpenAPI_amf3_gpp_access_registration_convertToJSON(OpenAPI_amf3_gpp_acces
}
}
if (amf3_gpp_access_registration->ims_vo_ps) {
if (amf3_gpp_access_registration->ims_vo_ps != OpenAPI_ims_vo_ps_NULL) {
if (cJSON_AddStringToObject(item, "imsVoPs", OpenAPI_ims_vo_ps_ToString(amf3_gpp_access_registration->ims_vo_ps)) == NULL) {
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [ims_vo_ps]");
goto end;
}
}
if (!amf3_gpp_access_registration->dereg_callback_uri) {
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [dereg_callback_uri]");
return NULL;
}
if (cJSON_AddStringToObject(item, "deregCallbackUri", amf3_gpp_access_registration->dereg_callback_uri) == NULL) {
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [dereg_callback_uri]");
goto end;
@ -175,6 +230,10 @@ cJSON *OpenAPI_amf3_gpp_access_registration_convertToJSON(OpenAPI_amf3_gpp_acces
}
}
if (!amf3_gpp_access_registration->guami) {
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [guami]");
return NULL;
}
cJSON *guami_local_JSON = OpenAPI_guami_convertToJSON(amf3_gpp_access_registration->guami);
if (guami_local_JSON == NULL) {
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [guami]");
@ -192,17 +251,13 @@ cJSON *OpenAPI_amf3_gpp_access_registration_convertToJSON(OpenAPI_amf3_gpp_acces
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [backup_amf_info]");
goto end;
}
OpenAPI_lnode_t *backup_amf_info_node;
if (amf3_gpp_access_registration->backup_amf_info) {
OpenAPI_list_for_each(amf3_gpp_access_registration->backup_amf_info, backup_amf_info_node) {
cJSON *itemLocal = OpenAPI_backup_amf_info_convertToJSON(backup_amf_info_node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [backup_amf_info]");
goto end;
}
cJSON_AddItemToArray(backup_amf_infoList, itemLocal);
OpenAPI_list_for_each(amf3_gpp_access_registration->backup_amf_info, node) {
cJSON *itemLocal = OpenAPI_backup_amf_info_convertToJSON(node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [backup_amf_info]");
goto end;
}
cJSON_AddItemToArray(backup_amf_infoList, itemLocal);
}
}
@ -213,6 +268,10 @@ cJSON *OpenAPI_amf3_gpp_access_registration_convertToJSON(OpenAPI_amf3_gpp_acces
}
}
if (amf3_gpp_access_registration->rat_type == OpenAPI_rat_type_NULL) {
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [rat_type]");
return NULL;
}
if (cJSON_AddStringToObject(item, "ratType", OpenAPI_rat_type_ToString(amf3_gpp_access_registration->rat_type)) == NULL) {
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [rat_type]");
goto end;
@ -306,28 +365,56 @@ end:
OpenAPI_amf3_gpp_access_registration_t *OpenAPI_amf3_gpp_access_registration_parseFromJSON(cJSON *amf3_gpp_access_registrationJSON)
{
OpenAPI_amf3_gpp_access_registration_t *amf3_gpp_access_registration_local_var = NULL;
cJSON *amf_instance_id = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "amfInstanceId");
OpenAPI_lnode_t *node = NULL;
cJSON *amf_instance_id = NULL;
cJSON *supported_features = NULL;
cJSON *purge_flag = NULL;
cJSON *pei = NULL;
cJSON *ims_vo_ps = NULL;
OpenAPI_ims_vo_ps_e ims_vo_psVariable = 0;
cJSON *dereg_callback_uri = NULL;
cJSON *amf_service_name_dereg = NULL;
cJSON *pcscf_restoration_callback_uri = NULL;
cJSON *amf_service_name_pcscf_rest = NULL;
cJSON *initial_registration_ind = NULL;
cJSON *guami = NULL;
OpenAPI_guami_t *guami_local_nonprim = NULL;
cJSON *backup_amf_info = NULL;
OpenAPI_list_t *backup_amf_infoList = NULL;
cJSON *dr_flag = NULL;
cJSON *rat_type = NULL;
OpenAPI_rat_type_e rat_typeVariable = 0;
cJSON *urrp_indicator = NULL;
cJSON *amf_ee_subscription_id = NULL;
cJSON *eps_interworking_info = NULL;
OpenAPI_eps_interworking_info_t *eps_interworking_info_local_nonprim = NULL;
cJSON *ue_srvcc_capability = NULL;
cJSON *registration_time = NULL;
cJSON *vgmlc_address = NULL;
OpenAPI_vgmlc_address_t *vgmlc_address_local_nonprim = NULL;
cJSON *context_info = NULL;
OpenAPI_context_info_t *context_info_local_nonprim = NULL;
cJSON *no_ee_subscription_ind = NULL;
cJSON *supi = NULL;
amf_instance_id = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "amfInstanceId");
if (!amf_instance_id) {
ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [amf_instance_id]");
goto end;
}
if (!cJSON_IsString(amf_instance_id)) {
ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [amf_instance_id]");
goto end;
}
cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "supportedFeatures");
supported_features = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "supportedFeatures");
if (supported_features) {
if (!cJSON_IsString(supported_features)) {
if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) {
ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [supported_features]");
goto end;
}
}
cJSON *purge_flag = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "purgeFlag");
purge_flag = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "purgeFlag");
if (purge_flag) {
if (!cJSON_IsBool(purge_flag)) {
ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [purge_flag]");
@ -335,18 +422,15 @@ OpenAPI_amf3_gpp_access_registration_t *OpenAPI_amf3_gpp_access_registration_par
}
}
cJSON *pei = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "pei");
pei = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "pei");
if (pei) {
if (!cJSON_IsString(pei)) {
if (!cJSON_IsString(pei) && !cJSON_IsNull(pei)) {
ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [pei]");
goto end;
}
}
cJSON *ims_vo_ps = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "imsVoPs");
OpenAPI_ims_vo_ps_e ims_vo_psVariable;
ims_vo_ps = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "imsVoPs");
if (ims_vo_ps) {
if (!cJSON_IsString(ims_vo_ps)) {
ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [ims_vo_ps]");
@ -355,46 +439,41 @@ OpenAPI_amf3_gpp_access_registration_t *OpenAPI_amf3_gpp_access_registration_par
ims_vo_psVariable = OpenAPI_ims_vo_ps_FromString(ims_vo_ps->valuestring);
}
cJSON *dereg_callback_uri = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "deregCallbackUri");
dereg_callback_uri = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "deregCallbackUri");
if (!dereg_callback_uri) {
ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [dereg_callback_uri]");
goto end;
}
if (!cJSON_IsString(dereg_callback_uri)) {
ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [dereg_callback_uri]");
goto end;
}
cJSON *amf_service_name_dereg = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "amfServiceNameDereg");
amf_service_name_dereg = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "amfServiceNameDereg");
if (amf_service_name_dereg) {
if (!cJSON_IsString(amf_service_name_dereg)) {
if (!cJSON_IsString(amf_service_name_dereg) && !cJSON_IsNull(amf_service_name_dereg)) {
ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [amf_service_name_dereg]");
goto end;
}
}
cJSON *pcscf_restoration_callback_uri = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "pcscfRestorationCallbackUri");
pcscf_restoration_callback_uri = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "pcscfRestorationCallbackUri");
if (pcscf_restoration_callback_uri) {
if (!cJSON_IsString(pcscf_restoration_callback_uri)) {
if (!cJSON_IsString(pcscf_restoration_callback_uri) && !cJSON_IsNull(pcscf_restoration_callback_uri)) {
ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [pcscf_restoration_callback_uri]");
goto end;
}
}
cJSON *amf_service_name_pcscf_rest = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "amfServiceNamePcscfRest");
amf_service_name_pcscf_rest = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "amfServiceNamePcscfRest");
if (amf_service_name_pcscf_rest) {
if (!cJSON_IsString(amf_service_name_pcscf_rest)) {
if (!cJSON_IsString(amf_service_name_pcscf_rest) && !cJSON_IsNull(amf_service_name_pcscf_rest)) {
ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [amf_service_name_pcscf_rest]");
goto end;
}
}
cJSON *initial_registration_ind = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "initialRegistrationInd");
initial_registration_ind = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "initialRegistrationInd");
if (initial_registration_ind) {
if (!cJSON_IsBool(initial_registration_ind)) {
ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [initial_registration_ind]");
@ -402,46 +481,39 @@ OpenAPI_amf3_gpp_access_registration_t *OpenAPI_amf3_gpp_access_registration_par
}
}
cJSON *guami = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "guami");
guami = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "guami");
if (!guami) {
ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [guami]");
goto end;
}
OpenAPI_guami_t *guami_local_nonprim = NULL;
guami_local_nonprim = OpenAPI_guami_parseFromJSON(guami);
cJSON *backup_amf_info = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "backupAmfInfo");
OpenAPI_list_t *backup_amf_infoList;
backup_amf_info = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "backupAmfInfo");
if (backup_amf_info) {
cJSON *backup_amf_info_local_nonprimitive;
if (!cJSON_IsArray(backup_amf_info)){
ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [backup_amf_info]");
goto end;
}
backup_amf_infoList = OpenAPI_list_create();
cJSON_ArrayForEach(backup_amf_info_local_nonprimitive, backup_amf_info ) {
if (!cJSON_IsObject(backup_amf_info_local_nonprimitive)) {
cJSON *backup_amf_info_local = NULL;
if (!cJSON_IsArray(backup_amf_info)) {
ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [backup_amf_info]");
goto end;
}
OpenAPI_backup_amf_info_t *backup_amf_infoItem = OpenAPI_backup_amf_info_parseFromJSON(backup_amf_info_local_nonprimitive);
if (!backup_amf_infoItem) {
ogs_error("No backup_amf_infoItem");
OpenAPI_list_free(backup_amf_infoList);
goto end;
backup_amf_infoList = OpenAPI_list_create();
cJSON_ArrayForEach(backup_amf_info_local, backup_amf_info) {
if (!cJSON_IsObject(backup_amf_info_local)) {
ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [backup_amf_info]");
goto end;
}
OpenAPI_backup_amf_info_t *backup_amf_infoItem = OpenAPI_backup_amf_info_parseFromJSON(backup_amf_info_local);
if (!backup_amf_infoItem) {
ogs_error("No backup_amf_infoItem");
OpenAPI_list_free(backup_amf_infoList);
goto end;
}
OpenAPI_list_add(backup_amf_infoList, backup_amf_infoItem);
}
OpenAPI_list_add(backup_amf_infoList, backup_amf_infoItem);
}
}
cJSON *dr_flag = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "drFlag");
dr_flag = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "drFlag");
if (dr_flag) {
if (!cJSON_IsBool(dr_flag)) {
ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [dr_flag]");
@ -449,21 +521,18 @@ OpenAPI_amf3_gpp_access_registration_t *OpenAPI_amf3_gpp_access_registration_par
}
}
cJSON *rat_type = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "ratType");
rat_type = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "ratType");
if (!rat_type) {
ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [rat_type]");
goto end;
}
OpenAPI_rat_type_e rat_typeVariable;
if (!cJSON_IsString(rat_type)) {
ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [rat_type]");
goto end;
}
rat_typeVariable = OpenAPI_rat_type_FromString(rat_type->valuestring);
cJSON *urrp_indicator = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "urrpIndicator");
urrp_indicator = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "urrpIndicator");
if (urrp_indicator) {
if (!cJSON_IsBool(urrp_indicator)) {
ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [urrp_indicator]");
@ -471,24 +540,20 @@ OpenAPI_amf3_gpp_access_registration_t *OpenAPI_amf3_gpp_access_registration_par
}
}
cJSON *amf_ee_subscription_id = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "amfEeSubscriptionId");
amf_ee_subscription_id = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "amfEeSubscriptionId");
if (amf_ee_subscription_id) {
if (!cJSON_IsString(amf_ee_subscription_id)) {
if (!cJSON_IsString(amf_ee_subscription_id) && !cJSON_IsNull(amf_ee_subscription_id)) {
ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [amf_ee_subscription_id]");
goto end;
}
}
cJSON *eps_interworking_info = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "epsInterworkingInfo");
OpenAPI_eps_interworking_info_t *eps_interworking_info_local_nonprim = NULL;
eps_interworking_info = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "epsInterworkingInfo");
if (eps_interworking_info) {
eps_interworking_info_local_nonprim = OpenAPI_eps_interworking_info_parseFromJSON(eps_interworking_info);
}
cJSON *ue_srvcc_capability = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "ueSrvccCapability");
ue_srvcc_capability = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "ueSrvccCapability");
if (ue_srvcc_capability) {
if (!cJSON_IsBool(ue_srvcc_capability)) {
ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [ue_srvcc_capability]");
@ -496,31 +561,25 @@ OpenAPI_amf3_gpp_access_registration_t *OpenAPI_amf3_gpp_access_registration_par
}
}
cJSON *registration_time = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "registrationTime");
registration_time = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "registrationTime");
if (registration_time) {
if (!cJSON_IsString(registration_time)) {
if (!cJSON_IsString(registration_time) && !cJSON_IsNull(registration_time)) {
ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [registration_time]");
goto end;
}
}
cJSON *vgmlc_address = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "vgmlcAddress");
OpenAPI_vgmlc_address_t *vgmlc_address_local_nonprim = NULL;
vgmlc_address = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "vgmlcAddress");
if (vgmlc_address) {
vgmlc_address_local_nonprim = OpenAPI_vgmlc_address_parseFromJSON(vgmlc_address);
}
cJSON *context_info = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "contextInfo");
OpenAPI_context_info_t *context_info_local_nonprim = NULL;
context_info = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "contextInfo");
if (context_info) {
context_info_local_nonprim = OpenAPI_context_info_parseFromJSON(context_info);
}
cJSON *no_ee_subscription_ind = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "noEeSubscriptionInd");
no_ee_subscription_ind = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "noEeSubscriptionInd");
if (no_ee_subscription_ind) {
if (!cJSON_IsBool(no_ee_subscription_ind)) {
ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [no_ee_subscription_ind]");
@ -528,10 +587,9 @@ OpenAPI_amf3_gpp_access_registration_t *OpenAPI_amf3_gpp_access_registration_par
}
}
cJSON *supi = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "supi");
supi = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "supi");
if (supi) {
if (!cJSON_IsString(supi)) {
if (!cJSON_IsString(supi) && !cJSON_IsNull(supi)) {
ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [supi]");
goto end;
}
@ -539,15 +597,15 @@ OpenAPI_amf3_gpp_access_registration_t *OpenAPI_amf3_gpp_access_registration_par
amf3_gpp_access_registration_local_var = OpenAPI_amf3_gpp_access_registration_create (
ogs_strdup(amf_instance_id->valuestring),
supported_features ? ogs_strdup(supported_features->valuestring) : NULL,
supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL,
purge_flag ? true : false,
purge_flag ? purge_flag->valueint : 0,
pei ? ogs_strdup(pei->valuestring) : NULL,
pei && !cJSON_IsNull(pei) ? ogs_strdup(pei->valuestring) : NULL,
ims_vo_ps ? ims_vo_psVariable : 0,
ogs_strdup(dereg_callback_uri->valuestring),
amf_service_name_dereg ? ogs_strdup(amf_service_name_dereg->valuestring) : NULL,
pcscf_restoration_callback_uri ? ogs_strdup(pcscf_restoration_callback_uri->valuestring) : NULL,
amf_service_name_pcscf_rest ? ogs_strdup(amf_service_name_pcscf_rest->valuestring) : NULL,
amf_service_name_dereg && !cJSON_IsNull(amf_service_name_dereg) ? ogs_strdup(amf_service_name_dereg->valuestring) : NULL,
pcscf_restoration_callback_uri && !cJSON_IsNull(pcscf_restoration_callback_uri) ? ogs_strdup(pcscf_restoration_callback_uri->valuestring) : NULL,
amf_service_name_pcscf_rest && !cJSON_IsNull(amf_service_name_pcscf_rest) ? ogs_strdup(amf_service_name_pcscf_rest->valuestring) : NULL,
initial_registration_ind ? true : false,
initial_registration_ind ? initial_registration_ind->valueint : 0,
guami_local_nonprim,
@ -557,20 +615,43 @@ OpenAPI_amf3_gpp_access_registration_t *OpenAPI_amf3_gpp_access_registration_par
rat_typeVariable,
urrp_indicator ? true : false,
urrp_indicator ? urrp_indicator->valueint : 0,
amf_ee_subscription_id ? ogs_strdup(amf_ee_subscription_id->valuestring) : NULL,
amf_ee_subscription_id && !cJSON_IsNull(amf_ee_subscription_id) ? ogs_strdup(amf_ee_subscription_id->valuestring) : NULL,
eps_interworking_info ? eps_interworking_info_local_nonprim : NULL,
ue_srvcc_capability ? true : false,
ue_srvcc_capability ? ue_srvcc_capability->valueint : 0,
registration_time ? ogs_strdup(registration_time->valuestring) : NULL,
registration_time && !cJSON_IsNull(registration_time) ? ogs_strdup(registration_time->valuestring) : NULL,
vgmlc_address ? vgmlc_address_local_nonprim : NULL,
context_info ? context_info_local_nonprim : NULL,
no_ee_subscription_ind ? true : false,
no_ee_subscription_ind ? no_ee_subscription_ind->valueint : 0,
supi ? ogs_strdup(supi->valuestring) : NULL
supi && !cJSON_IsNull(supi) ? ogs_strdup(supi->valuestring) : NULL
);
return amf3_gpp_access_registration_local_var;
end:
if (guami_local_nonprim) {
OpenAPI_guami_free(guami_local_nonprim);
guami_local_nonprim = NULL;
}
if (backup_amf_infoList) {
OpenAPI_list_for_each(backup_amf_infoList, node) {
OpenAPI_backup_amf_info_free(node->data);
}
OpenAPI_list_free(backup_amf_infoList);
backup_amf_infoList = NULL;
}
if (eps_interworking_info_local_nonprim) {
OpenAPI_eps_interworking_info_free(eps_interworking_info_local_nonprim);
eps_interworking_info_local_nonprim = NULL;
}
if (vgmlc_address_local_nonprim) {
OpenAPI_vgmlc_address_free(vgmlc_address_local_nonprim);
vgmlc_address_local_nonprim = NULL;
}
if (context_info_local_nonprim) {
OpenAPI_context_info_free(context_info_local_nonprim);
context_info_local_nonprim = NULL;
}
return NULL;
}

View File

@ -34,23 +34,37 @@ OpenAPI_amf3_gpp_access_registration_modification_t *OpenAPI_amf3_gpp_access_reg
void OpenAPI_amf3_gpp_access_registration_modification_free(OpenAPI_amf3_gpp_access_registration_modification_t *amf3_gpp_access_registration_modification)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == amf3_gpp_access_registration_modification) {
return;
}
OpenAPI_lnode_t *node;
OpenAPI_guami_free(amf3_gpp_access_registration_modification->guami);
ogs_free(amf3_gpp_access_registration_modification->pei);
OpenAPI_list_for_each(amf3_gpp_access_registration_modification->backup_amf_info, node) {
OpenAPI_backup_amf_info_free(node->data);
if (amf3_gpp_access_registration_modification->guami) {
OpenAPI_guami_free(amf3_gpp_access_registration_modification->guami);
amf3_gpp_access_registration_modification->guami = NULL;
}
if (amf3_gpp_access_registration_modification->pei) {
ogs_free(amf3_gpp_access_registration_modification->pei);
amf3_gpp_access_registration_modification->pei = NULL;
}
if (amf3_gpp_access_registration_modification->backup_amf_info) {
OpenAPI_list_for_each(amf3_gpp_access_registration_modification->backup_amf_info, node) {
OpenAPI_backup_amf_info_free(node->data);
}
OpenAPI_list_free(amf3_gpp_access_registration_modification->backup_amf_info);
amf3_gpp_access_registration_modification->backup_amf_info = NULL;
}
if (amf3_gpp_access_registration_modification->eps_interworking_info) {
OpenAPI_eps_interworking_info_free(amf3_gpp_access_registration_modification->eps_interworking_info);
amf3_gpp_access_registration_modification->eps_interworking_info = NULL;
}
OpenAPI_list_free(amf3_gpp_access_registration_modification->backup_amf_info);
OpenAPI_eps_interworking_info_free(amf3_gpp_access_registration_modification->eps_interworking_info);
ogs_free(amf3_gpp_access_registration_modification);
}
cJSON *OpenAPI_amf3_gpp_access_registration_modification_convertToJSON(OpenAPI_amf3_gpp_access_registration_modification_t *amf3_gpp_access_registration_modification)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (amf3_gpp_access_registration_modification == NULL) {
ogs_error("OpenAPI_amf3_gpp_access_registration_modification_convertToJSON() failed [Amf3GppAccessRegistrationModification]");
@ -58,6 +72,10 @@ cJSON *OpenAPI_amf3_gpp_access_registration_modification_convertToJSON(OpenAPI_a
}
item = cJSON_CreateObject();
if (!amf3_gpp_access_registration_modification->guami) {
ogs_error("OpenAPI_amf3_gpp_access_registration_modification_convertToJSON() failed [guami]");
return NULL;
}
cJSON *guami_local_JSON = OpenAPI_guami_convertToJSON(amf3_gpp_access_registration_modification->guami);
if (guami_local_JSON == NULL) {
ogs_error("OpenAPI_amf3_gpp_access_registration_modification_convertToJSON() failed [guami]");
@ -83,7 +101,7 @@ cJSON *OpenAPI_amf3_gpp_access_registration_modification_convertToJSON(OpenAPI_a
}
}
if (amf3_gpp_access_registration_modification->ims_vo_ps) {
if (amf3_gpp_access_registration_modification->ims_vo_ps != OpenAPI_ims_vo_ps_NULL) {
if (cJSON_AddStringToObject(item, "imsVoPs", OpenAPI_ims_vo_ps_ToString(amf3_gpp_access_registration_modification->ims_vo_ps)) == NULL) {
ogs_error("OpenAPI_amf3_gpp_access_registration_modification_convertToJSON() failed [ims_vo_ps]");
goto end;
@ -96,17 +114,13 @@ cJSON *OpenAPI_amf3_gpp_access_registration_modification_convertToJSON(OpenAPI_a
ogs_error("OpenAPI_amf3_gpp_access_registration_modification_convertToJSON() failed [backup_amf_info]");
goto end;
}
OpenAPI_lnode_t *backup_amf_info_node;
if (amf3_gpp_access_registration_modification->backup_amf_info) {
OpenAPI_list_for_each(amf3_gpp_access_registration_modification->backup_amf_info, backup_amf_info_node) {
cJSON *itemLocal = OpenAPI_backup_amf_info_convertToJSON(backup_amf_info_node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_amf3_gpp_access_registration_modification_convertToJSON() failed [backup_amf_info]");
goto end;
}
cJSON_AddItemToArray(backup_amf_infoList, itemLocal);
OpenAPI_list_for_each(amf3_gpp_access_registration_modification->backup_amf_info, node) {
cJSON *itemLocal = OpenAPI_backup_amf_info_convertToJSON(node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_amf3_gpp_access_registration_modification_convertToJSON() failed [backup_amf_info]");
goto end;
}
cJSON_AddItemToArray(backup_amf_infoList, itemLocal);
}
}
@ -137,17 +151,26 @@ end:
OpenAPI_amf3_gpp_access_registration_modification_t *OpenAPI_amf3_gpp_access_registration_modification_parseFromJSON(cJSON *amf3_gpp_access_registration_modificationJSON)
{
OpenAPI_amf3_gpp_access_registration_modification_t *amf3_gpp_access_registration_modification_local_var = NULL;
cJSON *guami = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registration_modificationJSON, "guami");
OpenAPI_lnode_t *node = NULL;
cJSON *guami = NULL;
OpenAPI_guami_t *guami_local_nonprim = NULL;
cJSON *purge_flag = NULL;
cJSON *pei = NULL;
cJSON *ims_vo_ps = NULL;
OpenAPI_ims_vo_ps_e ims_vo_psVariable = 0;
cJSON *backup_amf_info = NULL;
OpenAPI_list_t *backup_amf_infoList = NULL;
cJSON *eps_interworking_info = NULL;
OpenAPI_eps_interworking_info_t *eps_interworking_info_local_nonprim = NULL;
cJSON *ue_srvcc_capability = NULL;
guami = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registration_modificationJSON, "guami");
if (!guami) {
ogs_error("OpenAPI_amf3_gpp_access_registration_modification_parseFromJSON() failed [guami]");
goto end;
}
OpenAPI_guami_t *guami_local_nonprim = NULL;
guami_local_nonprim = OpenAPI_guami_parseFromJSON(guami);
cJSON *purge_flag = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registration_modificationJSON, "purgeFlag");
purge_flag = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registration_modificationJSON, "purgeFlag");
if (purge_flag) {
if (!cJSON_IsBool(purge_flag)) {
ogs_error("OpenAPI_amf3_gpp_access_registration_modification_parseFromJSON() failed [purge_flag]");
@ -155,18 +178,15 @@ OpenAPI_amf3_gpp_access_registration_modification_t *OpenAPI_amf3_gpp_access_reg
}
}
cJSON *pei = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registration_modificationJSON, "pei");
pei = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registration_modificationJSON, "pei");
if (pei) {
if (!cJSON_IsString(pei)) {
if (!cJSON_IsString(pei) && !cJSON_IsNull(pei)) {
ogs_error("OpenAPI_amf3_gpp_access_registration_modification_parseFromJSON() failed [pei]");
goto end;
}
}
cJSON *ims_vo_ps = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registration_modificationJSON, "imsVoPs");
OpenAPI_ims_vo_ps_e ims_vo_psVariable;
ims_vo_ps = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registration_modificationJSON, "imsVoPs");
if (ims_vo_ps) {
if (!cJSON_IsString(ims_vo_ps)) {
ogs_error("OpenAPI_amf3_gpp_access_registration_modification_parseFromJSON() failed [ims_vo_ps]");
@ -175,44 +195,37 @@ OpenAPI_amf3_gpp_access_registration_modification_t *OpenAPI_amf3_gpp_access_reg
ims_vo_psVariable = OpenAPI_ims_vo_ps_FromString(ims_vo_ps->valuestring);
}
cJSON *backup_amf_info = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registration_modificationJSON, "backupAmfInfo");
OpenAPI_list_t *backup_amf_infoList;
backup_amf_info = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registration_modificationJSON, "backupAmfInfo");
if (backup_amf_info) {
cJSON *backup_amf_info_local_nonprimitive;
if (!cJSON_IsArray(backup_amf_info)){
ogs_error("OpenAPI_amf3_gpp_access_registration_modification_parseFromJSON() failed [backup_amf_info]");
goto end;
}
backup_amf_infoList = OpenAPI_list_create();
cJSON_ArrayForEach(backup_amf_info_local_nonprimitive, backup_amf_info ) {
if (!cJSON_IsObject(backup_amf_info_local_nonprimitive)) {
cJSON *backup_amf_info_local = NULL;
if (!cJSON_IsArray(backup_amf_info)) {
ogs_error("OpenAPI_amf3_gpp_access_registration_modification_parseFromJSON() failed [backup_amf_info]");
goto end;
}
OpenAPI_backup_amf_info_t *backup_amf_infoItem = OpenAPI_backup_amf_info_parseFromJSON(backup_amf_info_local_nonprimitive);
if (!backup_amf_infoItem) {
ogs_error("No backup_amf_infoItem");
OpenAPI_list_free(backup_amf_infoList);
goto end;
backup_amf_infoList = OpenAPI_list_create();
cJSON_ArrayForEach(backup_amf_info_local, backup_amf_info) {
if (!cJSON_IsObject(backup_amf_info_local)) {
ogs_error("OpenAPI_amf3_gpp_access_registration_modification_parseFromJSON() failed [backup_amf_info]");
goto end;
}
OpenAPI_backup_amf_info_t *backup_amf_infoItem = OpenAPI_backup_amf_info_parseFromJSON(backup_amf_info_local);
if (!backup_amf_infoItem) {
ogs_error("No backup_amf_infoItem");
OpenAPI_list_free(backup_amf_infoList);
goto end;
}
OpenAPI_list_add(backup_amf_infoList, backup_amf_infoItem);
}
OpenAPI_list_add(backup_amf_infoList, backup_amf_infoItem);
}
}
cJSON *eps_interworking_info = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registration_modificationJSON, "epsInterworkingInfo");
OpenAPI_eps_interworking_info_t *eps_interworking_info_local_nonprim = NULL;
eps_interworking_info = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registration_modificationJSON, "epsInterworkingInfo");
if (eps_interworking_info) {
eps_interworking_info_local_nonprim = OpenAPI_eps_interworking_info_parseFromJSON(eps_interworking_info);
}
cJSON *ue_srvcc_capability = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registration_modificationJSON, "ueSrvccCapability");
ue_srvcc_capability = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registration_modificationJSON, "ueSrvccCapability");
if (ue_srvcc_capability) {
if (!cJSON_IsBool(ue_srvcc_capability)) {
ogs_error("OpenAPI_amf3_gpp_access_registration_modification_parseFromJSON() failed [ue_srvcc_capability]");
@ -224,7 +237,7 @@ OpenAPI_amf3_gpp_access_registration_modification_t *OpenAPI_amf3_gpp_access_reg
guami_local_nonprim,
purge_flag ? true : false,
purge_flag ? purge_flag->valueint : 0,
pei ? ogs_strdup(pei->valuestring) : NULL,
pei && !cJSON_IsNull(pei) ? ogs_strdup(pei->valuestring) : NULL,
ims_vo_ps ? ims_vo_psVariable : 0,
backup_amf_info ? backup_amf_infoList : NULL,
eps_interworking_info ? eps_interworking_info_local_nonprim : NULL,
@ -234,6 +247,21 @@ OpenAPI_amf3_gpp_access_registration_modification_t *OpenAPI_amf3_gpp_access_reg
return amf3_gpp_access_registration_modification_local_var;
end:
if (guami_local_nonprim) {
OpenAPI_guami_free(guami_local_nonprim);
guami_local_nonprim = NULL;
}
if (backup_amf_infoList) {
OpenAPI_list_for_each(backup_amf_infoList, node) {
OpenAPI_backup_amf_info_free(node->data);
}
OpenAPI_list_free(backup_amf_infoList);
backup_amf_infoList = NULL;
}
if (eps_interworking_info_local_nonprim) {
OpenAPI_eps_interworking_info_free(eps_interworking_info_local_nonprim);
eps_interworking_info_local_nonprim = NULL;
}
return NULL;
}

View File

@ -20,18 +20,26 @@ OpenAPI_amf_cond_t *OpenAPI_amf_cond_create(
void OpenAPI_amf_cond_free(OpenAPI_amf_cond_t *amf_cond)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == amf_cond) {
return;
}
OpenAPI_lnode_t *node;
ogs_free(amf_cond->amf_set_id);
ogs_free(amf_cond->amf_region_id);
if (amf_cond->amf_set_id) {
ogs_free(amf_cond->amf_set_id);
amf_cond->amf_set_id = NULL;
}
if (amf_cond->amf_region_id) {
ogs_free(amf_cond->amf_region_id);
amf_cond->amf_region_id = NULL;
}
ogs_free(amf_cond);
}
cJSON *OpenAPI_amf_cond_convertToJSON(OpenAPI_amf_cond_t *amf_cond)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (amf_cond == NULL) {
ogs_error("OpenAPI_amf_cond_convertToJSON() failed [AmfCond]");
@ -60,27 +68,28 @@ end:
OpenAPI_amf_cond_t *OpenAPI_amf_cond_parseFromJSON(cJSON *amf_condJSON)
{
OpenAPI_amf_cond_t *amf_cond_local_var = NULL;
cJSON *amf_set_id = cJSON_GetObjectItemCaseSensitive(amf_condJSON, "amfSetId");
OpenAPI_lnode_t *node = NULL;
cJSON *amf_set_id = NULL;
cJSON *amf_region_id = NULL;
amf_set_id = cJSON_GetObjectItemCaseSensitive(amf_condJSON, "amfSetId");
if (amf_set_id) {
if (!cJSON_IsString(amf_set_id)) {
if (!cJSON_IsString(amf_set_id) && !cJSON_IsNull(amf_set_id)) {
ogs_error("OpenAPI_amf_cond_parseFromJSON() failed [amf_set_id]");
goto end;
}
}
cJSON *amf_region_id = cJSON_GetObjectItemCaseSensitive(amf_condJSON, "amfRegionId");
amf_region_id = cJSON_GetObjectItemCaseSensitive(amf_condJSON, "amfRegionId");
if (amf_region_id) {
if (!cJSON_IsString(amf_region_id)) {
if (!cJSON_IsString(amf_region_id) && !cJSON_IsNull(amf_region_id)) {
ogs_error("OpenAPI_amf_cond_parseFromJSON() failed [amf_region_id]");
goto end;
}
}
amf_cond_local_var = OpenAPI_amf_cond_create (
amf_set_id ? ogs_strdup(amf_set_id->valuestring) : NULL,
amf_region_id ? ogs_strdup(amf_region_id->valuestring) : NULL
amf_set_id && !cJSON_IsNull(amf_set_id) ? ogs_strdup(amf_set_id->valuestring) : NULL,
amf_region_id && !cJSON_IsNull(amf_region_id) ? ogs_strdup(amf_region_id->valuestring) : NULL
);
return amf_cond_local_var;

View File

@ -18,16 +18,18 @@ OpenAPI_amf_dereg_info_t *OpenAPI_amf_dereg_info_create(
void OpenAPI_amf_dereg_info_free(OpenAPI_amf_dereg_info_t *amf_dereg_info)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == amf_dereg_info) {
return;
}
OpenAPI_lnode_t *node;
ogs_free(amf_dereg_info);
}
cJSON *OpenAPI_amf_dereg_info_convertToJSON(OpenAPI_amf_dereg_info_t *amf_dereg_info)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (amf_dereg_info == NULL) {
ogs_error("OpenAPI_amf_dereg_info_convertToJSON() failed [AmfDeregInfo]");
@ -35,6 +37,10 @@ cJSON *OpenAPI_amf_dereg_info_convertToJSON(OpenAPI_amf_dereg_info_t *amf_dereg_
}
item = cJSON_CreateObject();
if (amf_dereg_info->dereg_reason == OpenAPI_deregistration_reason_NULL) {
ogs_error("OpenAPI_amf_dereg_info_convertToJSON() failed [dereg_reason]");
return NULL;
}
if (cJSON_AddStringToObject(item, "deregReason", OpenAPI_deregistration_reason_ToString(amf_dereg_info->dereg_reason)) == NULL) {
ogs_error("OpenAPI_amf_dereg_info_convertToJSON() failed [dereg_reason]");
goto end;
@ -47,13 +53,14 @@ end:
OpenAPI_amf_dereg_info_t *OpenAPI_amf_dereg_info_parseFromJSON(cJSON *amf_dereg_infoJSON)
{
OpenAPI_amf_dereg_info_t *amf_dereg_info_local_var = NULL;
cJSON *dereg_reason = cJSON_GetObjectItemCaseSensitive(amf_dereg_infoJSON, "deregReason");
OpenAPI_lnode_t *node = NULL;
cJSON *dereg_reason = NULL;
OpenAPI_deregistration_reason_e dereg_reasonVariable = 0;
dereg_reason = cJSON_GetObjectItemCaseSensitive(amf_dereg_infoJSON, "deregReason");
if (!dereg_reason) {
ogs_error("OpenAPI_amf_dereg_info_parseFromJSON() failed [dereg_reason]");
goto end;
}
OpenAPI_deregistration_reason_e dereg_reasonVariable;
if (!cJSON_IsString(dereg_reason)) {
ogs_error("OpenAPI_amf_dereg_info_parseFromJSON() failed [dereg_reason]");
goto end;

View File

@ -46,30 +46,47 @@ OpenAPI_amf_event_t *OpenAPI_amf_event_create(
void OpenAPI_amf_event_free(OpenAPI_amf_event_t *amf_event)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == amf_event) {
return;
}
OpenAPI_lnode_t *node;
OpenAPI_amf_event_type_free(amf_event->type);
OpenAPI_list_for_each(amf_event->area_list, node) {
OpenAPI_amf_event_area_free(node->data);
if (amf_event->type) {
OpenAPI_amf_event_type_free(amf_event->type);
amf_event->type = NULL;
}
OpenAPI_list_free(amf_event->area_list);
OpenAPI_list_for_each(amf_event->location_filter_list, node) {
OpenAPI_location_filter_free(node->data);
if (amf_event->area_list) {
OpenAPI_list_for_each(amf_event->area_list, node) {
OpenAPI_amf_event_area_free(node->data);
}
OpenAPI_list_free(amf_event->area_list);
amf_event->area_list = NULL;
}
OpenAPI_list_free(amf_event->location_filter_list);
OpenAPI_list_for_each(amf_event->traffic_descriptor_list, node) {
OpenAPI_traffic_descriptor_free(node->data);
if (amf_event->location_filter_list) {
OpenAPI_list_for_each(amf_event->location_filter_list, node) {
OpenAPI_location_filter_free(node->data);
}
OpenAPI_list_free(amf_event->location_filter_list);
amf_event->location_filter_list = NULL;
}
if (amf_event->traffic_descriptor_list) {
OpenAPI_list_for_each(amf_event->traffic_descriptor_list, node) {
OpenAPI_traffic_descriptor_free(node->data);
}
OpenAPI_list_free(amf_event->traffic_descriptor_list);
amf_event->traffic_descriptor_list = NULL;
}
if (amf_event->reachability_filter) {
OpenAPI_reachability_filter_free(amf_event->reachability_filter);
amf_event->reachability_filter = NULL;
}
OpenAPI_list_free(amf_event->traffic_descriptor_list);
OpenAPI_reachability_filter_free(amf_event->reachability_filter);
ogs_free(amf_event);
}
cJSON *OpenAPI_amf_event_convertToJSON(OpenAPI_amf_event_t *amf_event)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (amf_event == NULL) {
ogs_error("OpenAPI_amf_event_convertToJSON() failed [AmfEvent]");
@ -77,6 +94,10 @@ cJSON *OpenAPI_amf_event_convertToJSON(OpenAPI_amf_event_t *amf_event)
}
item = cJSON_CreateObject();
if (!amf_event->type) {
ogs_error("OpenAPI_amf_event_convertToJSON() failed [type]");
return NULL;
}
cJSON *type_local_JSON = OpenAPI_amf_event_type_convertToJSON(amf_event->type);
if (type_local_JSON == NULL) {
ogs_error("OpenAPI_amf_event_convertToJSON() failed [type]");
@ -101,17 +122,13 @@ cJSON *OpenAPI_amf_event_convertToJSON(OpenAPI_amf_event_t *amf_event)
ogs_error("OpenAPI_amf_event_convertToJSON() failed [area_list]");
goto end;
}
OpenAPI_lnode_t *area_list_node;
if (amf_event->area_list) {
OpenAPI_list_for_each(amf_event->area_list, area_list_node) {
cJSON *itemLocal = OpenAPI_amf_event_area_convertToJSON(area_list_node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_amf_event_convertToJSON() failed [area_list]");
goto end;
}
cJSON_AddItemToArray(area_listList, itemLocal);
OpenAPI_list_for_each(amf_event->area_list, node) {
cJSON *itemLocal = OpenAPI_amf_event_area_convertToJSON(node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_amf_event_convertToJSON() failed [area_list]");
goto end;
}
cJSON_AddItemToArray(area_listList, itemLocal);
}
}
@ -121,17 +138,13 @@ cJSON *OpenAPI_amf_event_convertToJSON(OpenAPI_amf_event_t *amf_event)
ogs_error("OpenAPI_amf_event_convertToJSON() failed [location_filter_list]");
goto end;
}
OpenAPI_lnode_t *location_filter_list_node;
if (amf_event->location_filter_list) {
OpenAPI_list_for_each(amf_event->location_filter_list, location_filter_list_node) {
cJSON *itemLocal = OpenAPI_location_filter_convertToJSON(location_filter_list_node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_amf_event_convertToJSON() failed [location_filter_list]");
goto end;
}
cJSON_AddItemToArray(location_filter_listList, itemLocal);
OpenAPI_list_for_each(amf_event->location_filter_list, node) {
cJSON *itemLocal = OpenAPI_location_filter_convertToJSON(node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_amf_event_convertToJSON() failed [location_filter_list]");
goto end;
}
cJSON_AddItemToArray(location_filter_listList, itemLocal);
}
}
@ -148,17 +161,13 @@ cJSON *OpenAPI_amf_event_convertToJSON(OpenAPI_amf_event_t *amf_event)
ogs_error("OpenAPI_amf_event_convertToJSON() failed [traffic_descriptor_list]");
goto end;
}
OpenAPI_lnode_t *traffic_descriptor_list_node;
if (amf_event->traffic_descriptor_list) {
OpenAPI_list_for_each(amf_event->traffic_descriptor_list, traffic_descriptor_list_node) {
cJSON *itemLocal = OpenAPI_traffic_descriptor_convertToJSON(traffic_descriptor_list_node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_amf_event_convertToJSON() failed [traffic_descriptor_list]");
goto end;
}
cJSON_AddItemToArray(traffic_descriptor_listList, itemLocal);
OpenAPI_list_for_each(amf_event->traffic_descriptor_list, node) {
cJSON *itemLocal = OpenAPI_traffic_descriptor_convertToJSON(node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_amf_event_convertToJSON() failed [traffic_descriptor_list]");
goto end;
}
cJSON_AddItemToArray(traffic_descriptor_listList, itemLocal);
}
}
@ -203,17 +212,30 @@ end:
OpenAPI_amf_event_t *OpenAPI_amf_event_parseFromJSON(cJSON *amf_eventJSON)
{
OpenAPI_amf_event_t *amf_event_local_var = NULL;
cJSON *type = cJSON_GetObjectItemCaseSensitive(amf_eventJSON, "type");
OpenAPI_lnode_t *node = NULL;
cJSON *type = NULL;
OpenAPI_amf_event_type_t *type_local_nonprim = NULL;
cJSON *immediate_flag = NULL;
cJSON *area_list = NULL;
OpenAPI_list_t *area_listList = NULL;
cJSON *location_filter_list = NULL;
OpenAPI_list_t *location_filter_listList = NULL;
cJSON *ref_id = NULL;
cJSON *traffic_descriptor_list = NULL;
OpenAPI_list_t *traffic_descriptor_listList = NULL;
cJSON *report_ue_reachable = NULL;
cJSON *reachability_filter = NULL;
OpenAPI_reachability_filter_t *reachability_filter_local_nonprim = NULL;
cJSON *max_reports = NULL;
cJSON *max_response_time = NULL;
type = cJSON_GetObjectItemCaseSensitive(amf_eventJSON, "type");
if (!type) {
ogs_error("OpenAPI_amf_event_parseFromJSON() failed [type]");
goto end;
}
OpenAPI_amf_event_type_t *type_local_nonprim = NULL;
type_local_nonprim = OpenAPI_amf_event_type_parseFromJSON(type);
cJSON *immediate_flag = cJSON_GetObjectItemCaseSensitive(amf_eventJSON, "immediateFlag");
immediate_flag = cJSON_GetObjectItemCaseSensitive(amf_eventJSON, "immediateFlag");
if (immediate_flag) {
if (!cJSON_IsBool(immediate_flag)) {
ogs_error("OpenAPI_amf_event_parseFromJSON() failed [immediate_flag]");
@ -221,66 +243,57 @@ OpenAPI_amf_event_t *OpenAPI_amf_event_parseFromJSON(cJSON *amf_eventJSON)
}
}
cJSON *area_list = cJSON_GetObjectItemCaseSensitive(amf_eventJSON, "areaList");
OpenAPI_list_t *area_listList;
area_list = cJSON_GetObjectItemCaseSensitive(amf_eventJSON, "areaList");
if (area_list) {
cJSON *area_list_local_nonprimitive;
if (!cJSON_IsArray(area_list)){
ogs_error("OpenAPI_amf_event_parseFromJSON() failed [area_list]");
goto end;
}
area_listList = OpenAPI_list_create();
cJSON_ArrayForEach(area_list_local_nonprimitive, area_list ) {
if (!cJSON_IsObject(area_list_local_nonprimitive)) {
cJSON *area_list_local = NULL;
if (!cJSON_IsArray(area_list)) {
ogs_error("OpenAPI_amf_event_parseFromJSON() failed [area_list]");
goto end;
}
OpenAPI_amf_event_area_t *area_listItem = OpenAPI_amf_event_area_parseFromJSON(area_list_local_nonprimitive);
if (!area_listItem) {
ogs_error("No area_listItem");
OpenAPI_list_free(area_listList);
goto end;
area_listList = OpenAPI_list_create();
cJSON_ArrayForEach(area_list_local, area_list) {
if (!cJSON_IsObject(area_list_local)) {
ogs_error("OpenAPI_amf_event_parseFromJSON() failed [area_list]");
goto end;
}
OpenAPI_amf_event_area_t *area_listItem = OpenAPI_amf_event_area_parseFromJSON(area_list_local);
if (!area_listItem) {
ogs_error("No area_listItem");
OpenAPI_list_free(area_listList);
goto end;
}
OpenAPI_list_add(area_listList, area_listItem);
}
OpenAPI_list_add(area_listList, area_listItem);
}
}
cJSON *location_filter_list = cJSON_GetObjectItemCaseSensitive(amf_eventJSON, "locationFilterList");
OpenAPI_list_t *location_filter_listList;
location_filter_list = cJSON_GetObjectItemCaseSensitive(amf_eventJSON, "locationFilterList");
if (location_filter_list) {
cJSON *location_filter_list_local_nonprimitive;
if (!cJSON_IsArray(location_filter_list)){
ogs_error("OpenAPI_amf_event_parseFromJSON() failed [location_filter_list]");
goto end;
}
location_filter_listList = OpenAPI_list_create();
cJSON_ArrayForEach(location_filter_list_local_nonprimitive, location_filter_list ) {
if (!cJSON_IsObject(location_filter_list_local_nonprimitive)) {
cJSON *location_filter_list_local = NULL;
if (!cJSON_IsArray(location_filter_list)) {
ogs_error("OpenAPI_amf_event_parseFromJSON() failed [location_filter_list]");
goto end;
}
OpenAPI_location_filter_t *location_filter_listItem = OpenAPI_location_filter_parseFromJSON(location_filter_list_local_nonprimitive);
if (!location_filter_listItem) {
ogs_error("No location_filter_listItem");
OpenAPI_list_free(location_filter_listList);
goto end;
location_filter_listList = OpenAPI_list_create();
cJSON_ArrayForEach(location_filter_list_local, location_filter_list) {
if (!cJSON_IsObject(location_filter_list_local)) {
ogs_error("OpenAPI_amf_event_parseFromJSON() failed [location_filter_list]");
goto end;
}
OpenAPI_location_filter_t *location_filter_listItem = OpenAPI_location_filter_parseFromJSON(location_filter_list_local);
if (!location_filter_listItem) {
ogs_error("No location_filter_listItem");
OpenAPI_list_free(location_filter_listList);
goto end;
}
OpenAPI_list_add(location_filter_listList, location_filter_listItem);
}
OpenAPI_list_add(location_filter_listList, location_filter_listItem);
}
}
cJSON *ref_id = cJSON_GetObjectItemCaseSensitive(amf_eventJSON, "refId");
ref_id = cJSON_GetObjectItemCaseSensitive(amf_eventJSON, "refId");
if (ref_id) {
if (!cJSON_IsNumber(ref_id)) {
ogs_error("OpenAPI_amf_event_parseFromJSON() failed [ref_id]");
@ -288,37 +301,32 @@ OpenAPI_amf_event_t *OpenAPI_amf_event_parseFromJSON(cJSON *amf_eventJSON)
}
}
cJSON *traffic_descriptor_list = cJSON_GetObjectItemCaseSensitive(amf_eventJSON, "trafficDescriptorList");
OpenAPI_list_t *traffic_descriptor_listList;
traffic_descriptor_list = cJSON_GetObjectItemCaseSensitive(amf_eventJSON, "trafficDescriptorList");
if (traffic_descriptor_list) {
cJSON *traffic_descriptor_list_local_nonprimitive;
if (!cJSON_IsArray(traffic_descriptor_list)){
ogs_error("OpenAPI_amf_event_parseFromJSON() failed [traffic_descriptor_list]");
goto end;
}
traffic_descriptor_listList = OpenAPI_list_create();
cJSON_ArrayForEach(traffic_descriptor_list_local_nonprimitive, traffic_descriptor_list ) {
if (!cJSON_IsObject(traffic_descriptor_list_local_nonprimitive)) {
cJSON *traffic_descriptor_list_local = NULL;
if (!cJSON_IsArray(traffic_descriptor_list)) {
ogs_error("OpenAPI_amf_event_parseFromJSON() failed [traffic_descriptor_list]");
goto end;
}
OpenAPI_traffic_descriptor_t *traffic_descriptor_listItem = OpenAPI_traffic_descriptor_parseFromJSON(traffic_descriptor_list_local_nonprimitive);
if (!traffic_descriptor_listItem) {
ogs_error("No traffic_descriptor_listItem");
OpenAPI_list_free(traffic_descriptor_listList);
goto end;
traffic_descriptor_listList = OpenAPI_list_create();
cJSON_ArrayForEach(traffic_descriptor_list_local, traffic_descriptor_list) {
if (!cJSON_IsObject(traffic_descriptor_list_local)) {
ogs_error("OpenAPI_amf_event_parseFromJSON() failed [traffic_descriptor_list]");
goto end;
}
OpenAPI_traffic_descriptor_t *traffic_descriptor_listItem = OpenAPI_traffic_descriptor_parseFromJSON(traffic_descriptor_list_local);
if (!traffic_descriptor_listItem) {
ogs_error("No traffic_descriptor_listItem");
OpenAPI_list_free(traffic_descriptor_listList);
goto end;
}
OpenAPI_list_add(traffic_descriptor_listList, traffic_descriptor_listItem);
}
OpenAPI_list_add(traffic_descriptor_listList, traffic_descriptor_listItem);
}
}
cJSON *report_ue_reachable = cJSON_GetObjectItemCaseSensitive(amf_eventJSON, "reportUeReachable");
report_ue_reachable = cJSON_GetObjectItemCaseSensitive(amf_eventJSON, "reportUeReachable");
if (report_ue_reachable) {
if (!cJSON_IsBool(report_ue_reachable)) {
ogs_error("OpenAPI_amf_event_parseFromJSON() failed [report_ue_reachable]");
@ -326,15 +334,12 @@ OpenAPI_amf_event_t *OpenAPI_amf_event_parseFromJSON(cJSON *amf_eventJSON)
}
}
cJSON *reachability_filter = cJSON_GetObjectItemCaseSensitive(amf_eventJSON, "reachabilityFilter");
OpenAPI_reachability_filter_t *reachability_filter_local_nonprim = NULL;
reachability_filter = cJSON_GetObjectItemCaseSensitive(amf_eventJSON, "reachabilityFilter");
if (reachability_filter) {
reachability_filter_local_nonprim = OpenAPI_reachability_filter_parseFromJSON(reachability_filter);
}
cJSON *max_reports = cJSON_GetObjectItemCaseSensitive(amf_eventJSON, "maxReports");
max_reports = cJSON_GetObjectItemCaseSensitive(amf_eventJSON, "maxReports");
if (max_reports) {
if (!cJSON_IsNumber(max_reports)) {
ogs_error("OpenAPI_amf_event_parseFromJSON() failed [max_reports]");
@ -342,8 +347,7 @@ OpenAPI_amf_event_t *OpenAPI_amf_event_parseFromJSON(cJSON *amf_eventJSON)
}
}
cJSON *max_response_time = cJSON_GetObjectItemCaseSensitive(amf_eventJSON, "maxResponseTime");
max_response_time = cJSON_GetObjectItemCaseSensitive(amf_eventJSON, "maxResponseTime");
if (max_response_time) {
if (!cJSON_IsNumber(max_response_time)) {
ogs_error("OpenAPI_amf_event_parseFromJSON() failed [max_response_time]");
@ -371,6 +375,35 @@ OpenAPI_amf_event_t *OpenAPI_amf_event_parseFromJSON(cJSON *amf_eventJSON)
return amf_event_local_var;
end:
if (type_local_nonprim) {
OpenAPI_amf_event_type_free(type_local_nonprim);
type_local_nonprim = NULL;
}
if (area_listList) {
OpenAPI_list_for_each(area_listList, node) {
OpenAPI_amf_event_area_free(node->data);
}
OpenAPI_list_free(area_listList);
area_listList = NULL;
}
if (location_filter_listList) {
OpenAPI_list_for_each(location_filter_listList, node) {
OpenAPI_location_filter_free(node->data);
}
OpenAPI_list_free(location_filter_listList);
location_filter_listList = NULL;
}
if (traffic_descriptor_listList) {
OpenAPI_list_for_each(traffic_descriptor_listList, node) {
OpenAPI_traffic_descriptor_free(node->data);
}
OpenAPI_list_free(traffic_descriptor_listList);
traffic_descriptor_listList = NULL;
}
if (reachability_filter_local_nonprim) {
OpenAPI_reachability_filter_free(reachability_filter_local_nonprim);
reachability_filter_local_nonprim = NULL;
}
return NULL;
}

View File

@ -24,20 +24,34 @@ OpenAPI_amf_event_area_t *OpenAPI_amf_event_area_create(
void OpenAPI_amf_event_area_free(OpenAPI_amf_event_area_t *amf_event_area)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == amf_event_area) {
return;
}
OpenAPI_lnode_t *node;
OpenAPI_presence_info_free(amf_event_area->presence_info);
OpenAPI_ladn_info_free(amf_event_area->ladn_info);
OpenAPI_snssai_free(amf_event_area->s_nssai);
ogs_free(amf_event_area->nsi_id);
if (amf_event_area->presence_info) {
OpenAPI_presence_info_free(amf_event_area->presence_info);
amf_event_area->presence_info = NULL;
}
if (amf_event_area->ladn_info) {
OpenAPI_ladn_info_free(amf_event_area->ladn_info);
amf_event_area->ladn_info = NULL;
}
if (amf_event_area->s_nssai) {
OpenAPI_snssai_free(amf_event_area->s_nssai);
amf_event_area->s_nssai = NULL;
}
if (amf_event_area->nsi_id) {
ogs_free(amf_event_area->nsi_id);
amf_event_area->nsi_id = NULL;
}
ogs_free(amf_event_area);
}
cJSON *OpenAPI_amf_event_area_convertToJSON(OpenAPI_amf_event_area_t *amf_event_area)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (amf_event_area == NULL) {
ogs_error("OpenAPI_amf_event_area_convertToJSON() failed [AmfEventArea]");
@ -98,31 +112,32 @@ end:
OpenAPI_amf_event_area_t *OpenAPI_amf_event_area_parseFromJSON(cJSON *amf_event_areaJSON)
{
OpenAPI_amf_event_area_t *amf_event_area_local_var = NULL;
cJSON *presence_info = cJSON_GetObjectItemCaseSensitive(amf_event_areaJSON, "presenceInfo");
OpenAPI_lnode_t *node = NULL;
cJSON *presence_info = NULL;
OpenAPI_presence_info_t *presence_info_local_nonprim = NULL;
cJSON *ladn_info = NULL;
OpenAPI_ladn_info_t *ladn_info_local_nonprim = NULL;
cJSON *s_nssai = NULL;
OpenAPI_snssai_t *s_nssai_local_nonprim = NULL;
cJSON *nsi_id = NULL;
presence_info = cJSON_GetObjectItemCaseSensitive(amf_event_areaJSON, "presenceInfo");
if (presence_info) {
presence_info_local_nonprim = OpenAPI_presence_info_parseFromJSON(presence_info);
}
cJSON *ladn_info = cJSON_GetObjectItemCaseSensitive(amf_event_areaJSON, "ladnInfo");
OpenAPI_ladn_info_t *ladn_info_local_nonprim = NULL;
ladn_info = cJSON_GetObjectItemCaseSensitive(amf_event_areaJSON, "ladnInfo");
if (ladn_info) {
ladn_info_local_nonprim = OpenAPI_ladn_info_parseFromJSON(ladn_info);
}
cJSON *s_nssai = cJSON_GetObjectItemCaseSensitive(amf_event_areaJSON, "sNssai");
OpenAPI_snssai_t *s_nssai_local_nonprim = NULL;
s_nssai = cJSON_GetObjectItemCaseSensitive(amf_event_areaJSON, "sNssai");
if (s_nssai) {
s_nssai_local_nonprim = OpenAPI_snssai_parseFromJSON(s_nssai);
}
cJSON *nsi_id = cJSON_GetObjectItemCaseSensitive(amf_event_areaJSON, "nsiId");
nsi_id = cJSON_GetObjectItemCaseSensitive(amf_event_areaJSON, "nsiId");
if (nsi_id) {
if (!cJSON_IsString(nsi_id)) {
if (!cJSON_IsString(nsi_id) && !cJSON_IsNull(nsi_id)) {
ogs_error("OpenAPI_amf_event_area_parseFromJSON() failed [nsi_id]");
goto end;
}
@ -132,11 +147,23 @@ OpenAPI_amf_event_area_t *OpenAPI_amf_event_area_parseFromJSON(cJSON *amf_event_
presence_info ? presence_info_local_nonprim : NULL,
ladn_info ? ladn_info_local_nonprim : NULL,
s_nssai ? s_nssai_local_nonprim : NULL,
nsi_id ? ogs_strdup(nsi_id->valuestring) : NULL
nsi_id && !cJSON_IsNull(nsi_id) ? ogs_strdup(nsi_id->valuestring) : NULL
);
return amf_event_area_local_var;
end:
if (presence_info_local_nonprim) {
OpenAPI_presence_info_free(presence_info_local_nonprim);
presence_info_local_nonprim = NULL;
}
if (ladn_info_local_nonprim) {
OpenAPI_ladn_info_free(ladn_info_local_nonprim);
ladn_info_local_nonprim = NULL;
}
if (s_nssai_local_nonprim) {
OpenAPI_snssai_free(s_nssai_local_nonprim);
s_nssai_local_nonprim = NULL;
}
return NULL;
}

View File

@ -32,18 +32,26 @@ OpenAPI_amf_event_mode_t *OpenAPI_amf_event_mode_create(
void OpenAPI_amf_event_mode_free(OpenAPI_amf_event_mode_t *amf_event_mode)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == amf_event_mode) {
return;
}
OpenAPI_lnode_t *node;
OpenAPI_amf_event_trigger_free(amf_event_mode->trigger);
ogs_free(amf_event_mode->expiry);
if (amf_event_mode->trigger) {
OpenAPI_amf_event_trigger_free(amf_event_mode->trigger);
amf_event_mode->trigger = NULL;
}
if (amf_event_mode->expiry) {
ogs_free(amf_event_mode->expiry);
amf_event_mode->expiry = NULL;
}
ogs_free(amf_event_mode);
}
cJSON *OpenAPI_amf_event_mode_convertToJSON(OpenAPI_amf_event_mode_t *amf_event_mode)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (amf_event_mode == NULL) {
ogs_error("OpenAPI_amf_event_mode_convertToJSON() failed [AmfEventMode]");
@ -51,6 +59,10 @@ cJSON *OpenAPI_amf_event_mode_convertToJSON(OpenAPI_amf_event_mode_t *amf_event_
}
item = cJSON_CreateObject();
if (!amf_event_mode->trigger) {
ogs_error("OpenAPI_amf_event_mode_convertToJSON() failed [trigger]");
return NULL;
}
cJSON *trigger_local_JSON = OpenAPI_amf_event_trigger_convertToJSON(amf_event_mode->trigger);
if (trigger_local_JSON == NULL) {
ogs_error("OpenAPI_amf_event_mode_convertToJSON() failed [trigger]");
@ -97,17 +109,21 @@ end:
OpenAPI_amf_event_mode_t *OpenAPI_amf_event_mode_parseFromJSON(cJSON *amf_event_modeJSON)
{
OpenAPI_amf_event_mode_t *amf_event_mode_local_var = NULL;
cJSON *trigger = cJSON_GetObjectItemCaseSensitive(amf_event_modeJSON, "trigger");
OpenAPI_lnode_t *node = NULL;
cJSON *trigger = NULL;
OpenAPI_amf_event_trigger_t *trigger_local_nonprim = NULL;
cJSON *max_reports = NULL;
cJSON *expiry = NULL;
cJSON *rep_period = NULL;
cJSON *samp_ratio = NULL;
trigger = cJSON_GetObjectItemCaseSensitive(amf_event_modeJSON, "trigger");
if (!trigger) {
ogs_error("OpenAPI_amf_event_mode_parseFromJSON() failed [trigger]");
goto end;
}
OpenAPI_amf_event_trigger_t *trigger_local_nonprim = NULL;
trigger_local_nonprim = OpenAPI_amf_event_trigger_parseFromJSON(trigger);
cJSON *max_reports = cJSON_GetObjectItemCaseSensitive(amf_event_modeJSON, "maxReports");
max_reports = cJSON_GetObjectItemCaseSensitive(amf_event_modeJSON, "maxReports");
if (max_reports) {
if (!cJSON_IsNumber(max_reports)) {
ogs_error("OpenAPI_amf_event_mode_parseFromJSON() failed [max_reports]");
@ -115,17 +131,15 @@ OpenAPI_amf_event_mode_t *OpenAPI_amf_event_mode_parseFromJSON(cJSON *amf_event_
}
}
cJSON *expiry = cJSON_GetObjectItemCaseSensitive(amf_event_modeJSON, "expiry");
expiry = cJSON_GetObjectItemCaseSensitive(amf_event_modeJSON, "expiry");
if (expiry) {
if (!cJSON_IsString(expiry)) {
if (!cJSON_IsString(expiry) && !cJSON_IsNull(expiry)) {
ogs_error("OpenAPI_amf_event_mode_parseFromJSON() failed [expiry]");
goto end;
}
}
cJSON *rep_period = cJSON_GetObjectItemCaseSensitive(amf_event_modeJSON, "repPeriod");
rep_period = cJSON_GetObjectItemCaseSensitive(amf_event_modeJSON, "repPeriod");
if (rep_period) {
if (!cJSON_IsNumber(rep_period)) {
ogs_error("OpenAPI_amf_event_mode_parseFromJSON() failed [rep_period]");
@ -133,8 +147,7 @@ OpenAPI_amf_event_mode_t *OpenAPI_amf_event_mode_parseFromJSON(cJSON *amf_event_
}
}
cJSON *samp_ratio = cJSON_GetObjectItemCaseSensitive(amf_event_modeJSON, "sampRatio");
samp_ratio = cJSON_GetObjectItemCaseSensitive(amf_event_modeJSON, "sampRatio");
if (samp_ratio) {
if (!cJSON_IsNumber(samp_ratio)) {
ogs_error("OpenAPI_amf_event_mode_parseFromJSON() failed [samp_ratio]");
@ -146,7 +159,7 @@ OpenAPI_amf_event_mode_t *OpenAPI_amf_event_mode_parseFromJSON(cJSON *amf_event_
trigger_local_nonprim,
max_reports ? true : false,
max_reports ? max_reports->valuedouble : 0,
expiry ? ogs_strdup(expiry->valuestring) : NULL,
expiry && !cJSON_IsNull(expiry) ? ogs_strdup(expiry->valuestring) : NULL,
rep_period ? true : false,
rep_period ? rep_period->valuedouble : 0,
samp_ratio ? true : false,
@ -155,6 +168,10 @@ OpenAPI_amf_event_mode_t *OpenAPI_amf_event_mode_parseFromJSON(cJSON *amf_event_
return amf_event_mode_local_var;
end:
if (trigger_local_nonprim) {
OpenAPI_amf_event_trigger_free(trigger_local_nonprim);
trigger_local_nonprim = NULL;
}
return NULL;
}

View File

@ -44,30 +44,65 @@ OpenAPI_amf_event_subscription_t *OpenAPI_amf_event_subscription_create(
void OpenAPI_amf_event_subscription_free(OpenAPI_amf_event_subscription_t *amf_event_subscription)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == amf_event_subscription) {
return;
}
OpenAPI_lnode_t *node;
OpenAPI_list_for_each(amf_event_subscription->event_list, node) {
OpenAPI_amf_event_free(node->data);
if (amf_event_subscription->event_list) {
OpenAPI_list_for_each(amf_event_subscription->event_list, node) {
OpenAPI_amf_event_free(node->data);
}
OpenAPI_list_free(amf_event_subscription->event_list);
amf_event_subscription->event_list = NULL;
}
if (amf_event_subscription->event_notify_uri) {
ogs_free(amf_event_subscription->event_notify_uri);
amf_event_subscription->event_notify_uri = NULL;
}
if (amf_event_subscription->notify_correlation_id) {
ogs_free(amf_event_subscription->notify_correlation_id);
amf_event_subscription->notify_correlation_id = NULL;
}
if (amf_event_subscription->nf_id) {
ogs_free(amf_event_subscription->nf_id);
amf_event_subscription->nf_id = NULL;
}
if (amf_event_subscription->subs_change_notify_uri) {
ogs_free(amf_event_subscription->subs_change_notify_uri);
amf_event_subscription->subs_change_notify_uri = NULL;
}
if (amf_event_subscription->subs_change_notify_correlation_id) {
ogs_free(amf_event_subscription->subs_change_notify_correlation_id);
amf_event_subscription->subs_change_notify_correlation_id = NULL;
}
if (amf_event_subscription->supi) {
ogs_free(amf_event_subscription->supi);
amf_event_subscription->supi = NULL;
}
if (amf_event_subscription->group_id) {
ogs_free(amf_event_subscription->group_id);
amf_event_subscription->group_id = NULL;
}
if (amf_event_subscription->gpsi) {
ogs_free(amf_event_subscription->gpsi);
amf_event_subscription->gpsi = NULL;
}
if (amf_event_subscription->pei) {
ogs_free(amf_event_subscription->pei);
amf_event_subscription->pei = NULL;
}
if (amf_event_subscription->options) {
OpenAPI_amf_event_mode_free(amf_event_subscription->options);
amf_event_subscription->options = NULL;
}
OpenAPI_list_free(amf_event_subscription->event_list);
ogs_free(amf_event_subscription->event_notify_uri);
ogs_free(amf_event_subscription->notify_correlation_id);
ogs_free(amf_event_subscription->nf_id);
ogs_free(amf_event_subscription->subs_change_notify_uri);
ogs_free(amf_event_subscription->subs_change_notify_correlation_id);
ogs_free(amf_event_subscription->supi);
ogs_free(amf_event_subscription->group_id);
ogs_free(amf_event_subscription->gpsi);
ogs_free(amf_event_subscription->pei);
OpenAPI_amf_event_mode_free(amf_event_subscription->options);
ogs_free(amf_event_subscription);
}
cJSON *OpenAPI_amf_event_subscription_convertToJSON(OpenAPI_amf_event_subscription_t *amf_event_subscription)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (amf_event_subscription == NULL) {
ogs_error("OpenAPI_amf_event_subscription_convertToJSON() failed [AmfEventSubscription]");
@ -75,34 +110,46 @@ cJSON *OpenAPI_amf_event_subscription_convertToJSON(OpenAPI_amf_event_subscripti
}
item = cJSON_CreateObject();
if (!amf_event_subscription->event_list) {
ogs_error("OpenAPI_amf_event_subscription_convertToJSON() failed [event_list]");
return NULL;
}
cJSON *event_listList = cJSON_AddArrayToObject(item, "eventList");
if (event_listList == NULL) {
ogs_error("OpenAPI_amf_event_subscription_convertToJSON() failed [event_list]");
goto end;
}
OpenAPI_lnode_t *event_list_node;
if (amf_event_subscription->event_list) {
OpenAPI_list_for_each(amf_event_subscription->event_list, event_list_node) {
cJSON *itemLocal = OpenAPI_amf_event_convertToJSON(event_list_node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_amf_event_subscription_convertToJSON() failed [event_list]");
goto end;
}
cJSON_AddItemToArray(event_listList, itemLocal);
OpenAPI_list_for_each(amf_event_subscription->event_list, node) {
cJSON *itemLocal = OpenAPI_amf_event_convertToJSON(node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_amf_event_subscription_convertToJSON() failed [event_list]");
goto end;
}
cJSON_AddItemToArray(event_listList, itemLocal);
}
if (!amf_event_subscription->event_notify_uri) {
ogs_error("OpenAPI_amf_event_subscription_convertToJSON() failed [event_notify_uri]");
return NULL;
}
if (cJSON_AddStringToObject(item, "eventNotifyUri", amf_event_subscription->event_notify_uri) == NULL) {
ogs_error("OpenAPI_amf_event_subscription_convertToJSON() failed [event_notify_uri]");
goto end;
}
if (!amf_event_subscription->notify_correlation_id) {
ogs_error("OpenAPI_amf_event_subscription_convertToJSON() failed [notify_correlation_id]");
return NULL;
}
if (cJSON_AddStringToObject(item, "notifyCorrelationId", amf_event_subscription->notify_correlation_id) == NULL) {
ogs_error("OpenAPI_amf_event_subscription_convertToJSON() failed [notify_correlation_id]");
goto end;
}
if (!amf_event_subscription->nf_id) {
ogs_error("OpenAPI_amf_event_subscription_convertToJSON() failed [nf_id]");
return NULL;
}
if (cJSON_AddStringToObject(item, "nfId", amf_event_subscription->nf_id) == NULL) {
ogs_error("OpenAPI_amf_event_subscription_convertToJSON() failed [nf_id]");
goto end;
@ -170,7 +217,7 @@ cJSON *OpenAPI_amf_event_subscription_convertToJSON(OpenAPI_amf_event_subscripti
}
}
if (amf_event_subscription->source_nf_type) {
if (amf_event_subscription->source_nf_type != OpenAPI_nf_type_NULL) {
if (cJSON_AddStringToObject(item, "sourceNfType", OpenAPI_nf_type_ToString(amf_event_subscription->source_nf_type)) == NULL) {
ogs_error("OpenAPI_amf_event_subscription_convertToJSON() failed [source_nf_type]");
goto end;
@ -184,126 +231,129 @@ end:
OpenAPI_amf_event_subscription_t *OpenAPI_amf_event_subscription_parseFromJSON(cJSON *amf_event_subscriptionJSON)
{
OpenAPI_amf_event_subscription_t *amf_event_subscription_local_var = NULL;
cJSON *event_list = cJSON_GetObjectItemCaseSensitive(amf_event_subscriptionJSON, "eventList");
OpenAPI_lnode_t *node = NULL;
cJSON *event_list = NULL;
OpenAPI_list_t *event_listList = NULL;
cJSON *event_notify_uri = NULL;
cJSON *notify_correlation_id = NULL;
cJSON *nf_id = NULL;
cJSON *subs_change_notify_uri = NULL;
cJSON *subs_change_notify_correlation_id = NULL;
cJSON *supi = NULL;
cJSON *group_id = NULL;
cJSON *gpsi = NULL;
cJSON *pei = NULL;
cJSON *any_ue = NULL;
cJSON *options = NULL;
OpenAPI_amf_event_mode_t *options_local_nonprim = NULL;
cJSON *source_nf_type = NULL;
OpenAPI_nf_type_e source_nf_typeVariable = 0;
event_list = cJSON_GetObjectItemCaseSensitive(amf_event_subscriptionJSON, "eventList");
if (!event_list) {
ogs_error("OpenAPI_amf_event_subscription_parseFromJSON() failed [event_list]");
goto end;
}
OpenAPI_list_t *event_listList;
cJSON *event_list_local_nonprimitive;
if (!cJSON_IsArray(event_list)){
ogs_error("OpenAPI_amf_event_subscription_parseFromJSON() failed [event_list]");
goto end;
}
event_listList = OpenAPI_list_create();
cJSON_ArrayForEach(event_list_local_nonprimitive, event_list ) {
if (!cJSON_IsObject(event_list_local_nonprimitive)) {
cJSON *event_list_local = NULL;
if (!cJSON_IsArray(event_list)) {
ogs_error("OpenAPI_amf_event_subscription_parseFromJSON() failed [event_list]");
goto end;
}
OpenAPI_amf_event_t *event_listItem = OpenAPI_amf_event_parseFromJSON(event_list_local_nonprimitive);
if (!event_listItem) {
ogs_error("No event_listItem");
OpenAPI_list_free(event_listList);
goto end;
event_listList = OpenAPI_list_create();
cJSON_ArrayForEach(event_list_local, event_list) {
if (!cJSON_IsObject(event_list_local)) {
ogs_error("OpenAPI_amf_event_subscription_parseFromJSON() failed [event_list]");
goto end;
}
OpenAPI_amf_event_t *event_listItem = OpenAPI_amf_event_parseFromJSON(event_list_local);
if (!event_listItem) {
ogs_error("No event_listItem");
OpenAPI_list_free(event_listList);
goto end;
}
OpenAPI_list_add(event_listList, event_listItem);
}
OpenAPI_list_add(event_listList, event_listItem);
}
cJSON *event_notify_uri = cJSON_GetObjectItemCaseSensitive(amf_event_subscriptionJSON, "eventNotifyUri");
event_notify_uri = cJSON_GetObjectItemCaseSensitive(amf_event_subscriptionJSON, "eventNotifyUri");
if (!event_notify_uri) {
ogs_error("OpenAPI_amf_event_subscription_parseFromJSON() failed [event_notify_uri]");
goto end;
}
if (!cJSON_IsString(event_notify_uri)) {
ogs_error("OpenAPI_amf_event_subscription_parseFromJSON() failed [event_notify_uri]");
goto end;
}
cJSON *notify_correlation_id = cJSON_GetObjectItemCaseSensitive(amf_event_subscriptionJSON, "notifyCorrelationId");
notify_correlation_id = cJSON_GetObjectItemCaseSensitive(amf_event_subscriptionJSON, "notifyCorrelationId");
if (!notify_correlation_id) {
ogs_error("OpenAPI_amf_event_subscription_parseFromJSON() failed [notify_correlation_id]");
goto end;
}
if (!cJSON_IsString(notify_correlation_id)) {
ogs_error("OpenAPI_amf_event_subscription_parseFromJSON() failed [notify_correlation_id]");
goto end;
}
cJSON *nf_id = cJSON_GetObjectItemCaseSensitive(amf_event_subscriptionJSON, "nfId");
nf_id = cJSON_GetObjectItemCaseSensitive(amf_event_subscriptionJSON, "nfId");
if (!nf_id) {
ogs_error("OpenAPI_amf_event_subscription_parseFromJSON() failed [nf_id]");
goto end;
}
if (!cJSON_IsString(nf_id)) {
ogs_error("OpenAPI_amf_event_subscription_parseFromJSON() failed [nf_id]");
goto end;
}
cJSON *subs_change_notify_uri = cJSON_GetObjectItemCaseSensitive(amf_event_subscriptionJSON, "subsChangeNotifyUri");
subs_change_notify_uri = cJSON_GetObjectItemCaseSensitive(amf_event_subscriptionJSON, "subsChangeNotifyUri");
if (subs_change_notify_uri) {
if (!cJSON_IsString(subs_change_notify_uri)) {
if (!cJSON_IsString(subs_change_notify_uri) && !cJSON_IsNull(subs_change_notify_uri)) {
ogs_error("OpenAPI_amf_event_subscription_parseFromJSON() failed [subs_change_notify_uri]");
goto end;
}
}
cJSON *subs_change_notify_correlation_id = cJSON_GetObjectItemCaseSensitive(amf_event_subscriptionJSON, "subsChangeNotifyCorrelationId");
subs_change_notify_correlation_id = cJSON_GetObjectItemCaseSensitive(amf_event_subscriptionJSON, "subsChangeNotifyCorrelationId");
if (subs_change_notify_correlation_id) {
if (!cJSON_IsString(subs_change_notify_correlation_id)) {
if (!cJSON_IsString(subs_change_notify_correlation_id) && !cJSON_IsNull(subs_change_notify_correlation_id)) {
ogs_error("OpenAPI_amf_event_subscription_parseFromJSON() failed [subs_change_notify_correlation_id]");
goto end;
}
}
cJSON *supi = cJSON_GetObjectItemCaseSensitive(amf_event_subscriptionJSON, "supi");
supi = cJSON_GetObjectItemCaseSensitive(amf_event_subscriptionJSON, "supi");
if (supi) {
if (!cJSON_IsString(supi)) {
if (!cJSON_IsString(supi) && !cJSON_IsNull(supi)) {
ogs_error("OpenAPI_amf_event_subscription_parseFromJSON() failed [supi]");
goto end;
}
}
cJSON *group_id = cJSON_GetObjectItemCaseSensitive(amf_event_subscriptionJSON, "groupId");
group_id = cJSON_GetObjectItemCaseSensitive(amf_event_subscriptionJSON, "groupId");
if (group_id) {
if (!cJSON_IsString(group_id)) {
if (!cJSON_IsString(group_id) && !cJSON_IsNull(group_id)) {
ogs_error("OpenAPI_amf_event_subscription_parseFromJSON() failed [group_id]");
goto end;
}
}
cJSON *gpsi = cJSON_GetObjectItemCaseSensitive(amf_event_subscriptionJSON, "gpsi");
gpsi = cJSON_GetObjectItemCaseSensitive(amf_event_subscriptionJSON, "gpsi");
if (gpsi) {
if (!cJSON_IsString(gpsi)) {
if (!cJSON_IsString(gpsi) && !cJSON_IsNull(gpsi)) {
ogs_error("OpenAPI_amf_event_subscription_parseFromJSON() failed [gpsi]");
goto end;
}
}
cJSON *pei = cJSON_GetObjectItemCaseSensitive(amf_event_subscriptionJSON, "pei");
pei = cJSON_GetObjectItemCaseSensitive(amf_event_subscriptionJSON, "pei");
if (pei) {
if (!cJSON_IsString(pei)) {
if (!cJSON_IsString(pei) && !cJSON_IsNull(pei)) {
ogs_error("OpenAPI_amf_event_subscription_parseFromJSON() failed [pei]");
goto end;
}
}
cJSON *any_ue = cJSON_GetObjectItemCaseSensitive(amf_event_subscriptionJSON, "anyUE");
any_ue = cJSON_GetObjectItemCaseSensitive(amf_event_subscriptionJSON, "anyUE");
if (any_ue) {
if (!cJSON_IsBool(any_ue)) {
ogs_error("OpenAPI_amf_event_subscription_parseFromJSON() failed [any_ue]");
@ -311,16 +361,12 @@ OpenAPI_amf_event_subscription_t *OpenAPI_amf_event_subscription_parseFromJSON(c
}
}
cJSON *options = cJSON_GetObjectItemCaseSensitive(amf_event_subscriptionJSON, "options");
OpenAPI_amf_event_mode_t *options_local_nonprim = NULL;
options = cJSON_GetObjectItemCaseSensitive(amf_event_subscriptionJSON, "options");
if (options) {
options_local_nonprim = OpenAPI_amf_event_mode_parseFromJSON(options);
}
cJSON *source_nf_type = cJSON_GetObjectItemCaseSensitive(amf_event_subscriptionJSON, "sourceNfType");
OpenAPI_nf_type_e source_nf_typeVariable;
source_nf_type = cJSON_GetObjectItemCaseSensitive(amf_event_subscriptionJSON, "sourceNfType");
if (source_nf_type) {
if (!cJSON_IsString(source_nf_type)) {
ogs_error("OpenAPI_amf_event_subscription_parseFromJSON() failed [source_nf_type]");
@ -334,12 +380,12 @@ OpenAPI_amf_event_subscription_t *OpenAPI_amf_event_subscription_parseFromJSON(c
ogs_strdup(event_notify_uri->valuestring),
ogs_strdup(notify_correlation_id->valuestring),
ogs_strdup(nf_id->valuestring),
subs_change_notify_uri ? ogs_strdup(subs_change_notify_uri->valuestring) : NULL,
subs_change_notify_correlation_id ? ogs_strdup(subs_change_notify_correlation_id->valuestring) : NULL,
supi ? ogs_strdup(supi->valuestring) : NULL,
group_id ? ogs_strdup(group_id->valuestring) : NULL,
gpsi ? ogs_strdup(gpsi->valuestring) : NULL,
pei ? ogs_strdup(pei->valuestring) : NULL,
subs_change_notify_uri && !cJSON_IsNull(subs_change_notify_uri) ? ogs_strdup(subs_change_notify_uri->valuestring) : NULL,
subs_change_notify_correlation_id && !cJSON_IsNull(subs_change_notify_correlation_id) ? ogs_strdup(subs_change_notify_correlation_id->valuestring) : NULL,
supi && !cJSON_IsNull(supi) ? ogs_strdup(supi->valuestring) : NULL,
group_id && !cJSON_IsNull(group_id) ? ogs_strdup(group_id->valuestring) : NULL,
gpsi && !cJSON_IsNull(gpsi) ? ogs_strdup(gpsi->valuestring) : NULL,
pei && !cJSON_IsNull(pei) ? ogs_strdup(pei->valuestring) : NULL,
any_ue ? true : false,
any_ue ? any_ue->valueint : 0,
options ? options_local_nonprim : NULL,
@ -348,6 +394,17 @@ OpenAPI_amf_event_subscription_t *OpenAPI_amf_event_subscription_parseFromJSON(c
return amf_event_subscription_local_var;
end:
if (event_listList) {
OpenAPI_list_for_each(event_listList, node) {
OpenAPI_amf_event_free(node->data);
}
OpenAPI_list_free(event_listList);
event_listList = NULL;
}
if (options_local_nonprim) {
OpenAPI_amf_event_mode_free(options_local_nonprim);
options_local_nonprim = NULL;
}
return NULL;
}

View File

@ -20,20 +20,25 @@ OpenAPI_amf_event_subscription_add_info_t *OpenAPI_amf_event_subscription_add_in
void OpenAPI_amf_event_subscription_add_info_free(OpenAPI_amf_event_subscription_add_info_t *amf_event_subscription_add_info)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == amf_event_subscription_add_info) {
return;
}
OpenAPI_lnode_t *node;
OpenAPI_list_for_each(amf_event_subscription_add_info->binding_info, node) {
ogs_free(node->data);
if (amf_event_subscription_add_info->binding_info) {
OpenAPI_list_for_each(amf_event_subscription_add_info->binding_info, node) {
ogs_free(node->data);
}
OpenAPI_list_free(amf_event_subscription_add_info->binding_info);
amf_event_subscription_add_info->binding_info = NULL;
}
OpenAPI_list_free(amf_event_subscription_add_info->binding_info);
ogs_free(amf_event_subscription_add_info);
}
cJSON *OpenAPI_amf_event_subscription_add_info_convertToJSON(OpenAPI_amf_event_subscription_add_info_t *amf_event_subscription_add_info)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (amf_event_subscription_add_info == NULL) {
ogs_error("OpenAPI_amf_event_subscription_add_info_convertToJSON() failed [AmfEventSubscriptionAddInfo]");
@ -42,22 +47,20 @@ cJSON *OpenAPI_amf_event_subscription_add_info_convertToJSON(OpenAPI_amf_event_s
item = cJSON_CreateObject();
if (amf_event_subscription_add_info->binding_info) {
cJSON *binding_info = cJSON_AddArrayToObject(item, "bindingInfo");
if (binding_info == NULL) {
cJSON *binding_infoList = cJSON_AddArrayToObject(item, "bindingInfo");
if (binding_infoList == NULL) {
ogs_error("OpenAPI_amf_event_subscription_add_info_convertToJSON() failed [binding_info]");
goto end;
}
OpenAPI_lnode_t *binding_info_node;
OpenAPI_list_for_each(amf_event_subscription_add_info->binding_info, binding_info_node) {
if (cJSON_AddStringToObject(binding_info, "", (char*)binding_info_node->data) == NULL) {
ogs_error("OpenAPI_amf_event_subscription_add_info_convertToJSON() failed [binding_info]");
goto end;
OpenAPI_list_for_each(amf_event_subscription_add_info->binding_info, node) {
if (cJSON_AddStringToObject(binding_infoList, "", (char*)node->data) == NULL) {
ogs_error("OpenAPI_amf_event_subscription_add_info_convertToJSON() failed [binding_info]");
goto end;
}
}
}
}
if (amf_event_subscription_add_info->subscribing_nf_type) {
if (amf_event_subscription_add_info->subscribing_nf_type != OpenAPI_nf_type_NULL) {
if (cJSON_AddStringToObject(item, "subscribingNfType", OpenAPI_nf_type_ToString(amf_event_subscription_add_info->subscribing_nf_type)) == NULL) {
ogs_error("OpenAPI_amf_event_subscription_add_info_convertToJSON() failed [subscribing_nf_type]");
goto end;
@ -71,29 +74,33 @@ end:
OpenAPI_amf_event_subscription_add_info_t *OpenAPI_amf_event_subscription_add_info_parseFromJSON(cJSON *amf_event_subscription_add_infoJSON)
{
OpenAPI_amf_event_subscription_add_info_t *amf_event_subscription_add_info_local_var = NULL;
cJSON *binding_info = cJSON_GetObjectItemCaseSensitive(amf_event_subscription_add_infoJSON, "bindingInfo");
OpenAPI_list_t *binding_infoList;
OpenAPI_lnode_t *node = NULL;
cJSON *binding_info = NULL;
OpenAPI_list_t *binding_infoList = NULL;
cJSON *subscribing_nf_type = NULL;
OpenAPI_nf_type_e subscribing_nf_typeVariable = 0;
binding_info = cJSON_GetObjectItemCaseSensitive(amf_event_subscription_add_infoJSON, "bindingInfo");
if (binding_info) {
cJSON *binding_info_local;
if (!cJSON_IsArray(binding_info)) {
ogs_error("OpenAPI_amf_event_subscription_add_info_parseFromJSON() failed [binding_info]");
goto end;
}
binding_infoList = OpenAPI_list_create();
cJSON *binding_info_local = NULL;
if (!cJSON_IsArray(binding_info)) {
ogs_error("OpenAPI_amf_event_subscription_add_info_parseFromJSON() failed [binding_info]");
goto end;
}
cJSON_ArrayForEach(binding_info_local, binding_info) {
if (!cJSON_IsString(binding_info_local)) {
ogs_error("OpenAPI_amf_event_subscription_add_info_parseFromJSON() failed [binding_info]");
goto end;
}
OpenAPI_list_add(binding_infoList, ogs_strdup(binding_info_local->valuestring));
}
binding_infoList = OpenAPI_list_create();
cJSON_ArrayForEach(binding_info_local, binding_info) {
double *localDouble = NULL;
int *localInt = NULL;
if (!cJSON_IsString(binding_info_local)) {
ogs_error("OpenAPI_amf_event_subscription_add_info_parseFromJSON() failed [binding_info]");
goto end;
}
OpenAPI_list_add(binding_infoList, ogs_strdup(binding_info_local->valuestring));
}
}
cJSON *subscribing_nf_type = cJSON_GetObjectItemCaseSensitive(amf_event_subscription_add_infoJSON, "subscribingNfType");
OpenAPI_nf_type_e subscribing_nf_typeVariable;
subscribing_nf_type = cJSON_GetObjectItemCaseSensitive(amf_event_subscription_add_infoJSON, "subscribingNfType");
if (subscribing_nf_type) {
if (!cJSON_IsString(subscribing_nf_type)) {
ogs_error("OpenAPI_amf_event_subscription_add_info_parseFromJSON() failed [subscribing_nf_type]");
@ -109,6 +116,13 @@ OpenAPI_amf_event_subscription_add_info_t *OpenAPI_amf_event_subscription_add_in
return amf_event_subscription_add_info_local_var;
end:
if (binding_infoList) {
OpenAPI_list_for_each(binding_infoList, node) {
ogs_free(node->data);
}
OpenAPI_list_free(binding_infoList);
binding_infoList = NULL;
}
return NULL;
}

View File

@ -16,16 +16,18 @@ OpenAPI_amf_event_trigger_t *OpenAPI_amf_event_trigger_create(
void OpenAPI_amf_event_trigger_free(OpenAPI_amf_event_trigger_t *amf_event_trigger)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == amf_event_trigger) {
return;
}
OpenAPI_lnode_t *node;
ogs_free(amf_event_trigger);
}
cJSON *OpenAPI_amf_event_trigger_convertToJSON(OpenAPI_amf_event_trigger_t *amf_event_trigger)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (amf_event_trigger == NULL) {
ogs_error("OpenAPI_amf_event_trigger_convertToJSON() failed [AmfEventTrigger]");
@ -40,6 +42,7 @@ end:
OpenAPI_amf_event_trigger_t *OpenAPI_amf_event_trigger_parseFromJSON(cJSON *amf_event_triggerJSON)
{
OpenAPI_amf_event_trigger_t *amf_event_trigger_local_var = NULL;
OpenAPI_lnode_t *node = NULL;
amf_event_trigger_local_var = OpenAPI_amf_event_trigger_create (
);

View File

@ -16,16 +16,18 @@ OpenAPI_amf_event_type_t *OpenAPI_amf_event_type_create(
void OpenAPI_amf_event_type_free(OpenAPI_amf_event_type_t *amf_event_type)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == amf_event_type) {
return;
}
OpenAPI_lnode_t *node;
ogs_free(amf_event_type);
}
cJSON *OpenAPI_amf_event_type_convertToJSON(OpenAPI_amf_event_type_t *amf_event_type)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (amf_event_type == NULL) {
ogs_error("OpenAPI_amf_event_type_convertToJSON() failed [AmfEventType]");
@ -40,6 +42,7 @@ end:
OpenAPI_amf_event_type_t *OpenAPI_amf_event_type_parseFromJSON(cJSON *amf_event_typeJSON)
{
OpenAPI_amf_event_type_t *amf_event_type_local_var = NULL;
OpenAPI_lnode_t *node = NULL;
amf_event_type_local_var = OpenAPI_amf_event_type_create (
);

View File

@ -6,7 +6,7 @@
char* OpenAPI_amf_event_type_any_of_ToString(OpenAPI_amf_event_type_any_of_e amf_event_type_any_of)
{
const char *amf_event_type_any_ofArray[] = { "NULL", "LOCATION_REPORT", "PRESENCE_IN_AOI_REPORT", "TIMEZONE_REPORT", "ACCESS_TYPE_REPORT", "REGISTRATION_STATE_REPORT", "CONNECTIVITY_STATE_REPORT", "REACHABILITY_REPORT", "COMMUNICATION_FAILURE_REPORT", "UES_IN_AREA_REPORT", "SUBSCRIPTION_ID_CHANGE", "SUBSCRIPTION_ID_ADDITION", "LOSS_OF_CONNECTIVITY", "_5GS_USER_STATE_REPORT", "AVAILABILITY_AFTER_DDN_FAILURE", "TYPE_ALLOCATION_CODE_REPORT", "FREQUENT_MOBILITY_REGISTRATION_REPORT" };
const char *amf_event_type_any_ofArray[] = { "NULL", "LOCATION_REPORT", "PRESENCE_IN_AOI_REPORT", "TIMEZONE_REPORT", "ACCESS_TYPE_REPORT", "REGISTRATION_STATE_REPORT", "CONNECTIVITY_STATE_REPORT", "REACHABILITY_REPORT", "COMMUNICATION_FAILURE_REPORT", "UES_IN_AREA_REPORT", "SUBSCRIPTION_ID_CHANGE", "SUBSCRIPTION_ID_ADDITION", "LOSS_OF_CONNECTIVITY", "5GS_USER_STATE_REPORT", "AVAILABILITY_AFTER_DDN_FAILURE", "TYPE_ALLOCATION_CODE_REPORT", "FREQUENT_MOBILITY_REGISTRATION_REPORT" };
size_t sizeofArray = sizeof(amf_event_type_any_ofArray) / sizeof(amf_event_type_any_ofArray[0]);
if (amf_event_type_any_of < sizeofArray)
return (char *)amf_event_type_any_ofArray[amf_event_type_any_of];
@ -17,7 +17,7 @@ char* OpenAPI_amf_event_type_any_of_ToString(OpenAPI_amf_event_type_any_of_e amf
OpenAPI_amf_event_type_any_of_e OpenAPI_amf_event_type_any_of_FromString(char* amf_event_type_any_of)
{
int stringToReturn = 0;
const char *amf_event_type_any_ofArray[] = { "NULL", "LOCATION_REPORT", "PRESENCE_IN_AOI_REPORT", "TIMEZONE_REPORT", "ACCESS_TYPE_REPORT", "REGISTRATION_STATE_REPORT", "CONNECTIVITY_STATE_REPORT", "REACHABILITY_REPORT", "COMMUNICATION_FAILURE_REPORT", "UES_IN_AREA_REPORT", "SUBSCRIPTION_ID_CHANGE", "SUBSCRIPTION_ID_ADDITION", "LOSS_OF_CONNECTIVITY", "_5GS_USER_STATE_REPORT", "AVAILABILITY_AFTER_DDN_FAILURE", "TYPE_ALLOCATION_CODE_REPORT", "FREQUENT_MOBILITY_REGISTRATION_REPORT" };
const char *amf_event_type_any_ofArray[] = { "NULL", "LOCATION_REPORT", "PRESENCE_IN_AOI_REPORT", "TIMEZONE_REPORT", "ACCESS_TYPE_REPORT", "REGISTRATION_STATE_REPORT", "CONNECTIVITY_STATE_REPORT", "REACHABILITY_REPORT", "COMMUNICATION_FAILURE_REPORT", "UES_IN_AREA_REPORT", "SUBSCRIPTION_ID_CHANGE", "SUBSCRIPTION_ID_ADDITION", "LOSS_OF_CONNECTIVITY", "5GS_USER_STATE_REPORT", "AVAILABILITY_AFTER_DDN_FAILURE", "TYPE_ALLOCATION_CODE_REPORT", "FREQUENT_MOBILITY_REGISTRATION_REPORT" };
size_t sizeofArray = sizeof(amf_event_type_any_ofArray) / sizeof(amf_event_type_any_ofArray[0]);
while (stringToReturn < sizeofArray) {
if (strcmp(amf_event_type_any_of, amf_event_type_any_ofArray[stringToReturn]) == 0) {

View File

@ -32,39 +32,65 @@ OpenAPI_amf_info_t *OpenAPI_amf_info_create(
void OpenAPI_amf_info_free(OpenAPI_amf_info_t *amf_info)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == amf_info) {
return;
}
OpenAPI_lnode_t *node;
ogs_free(amf_info->amf_set_id);
ogs_free(amf_info->amf_region_id);
OpenAPI_list_for_each(amf_info->guami_list, node) {
OpenAPI_guami_free(node->data);
if (amf_info->amf_set_id) {
ogs_free(amf_info->amf_set_id);
amf_info->amf_set_id = NULL;
}
OpenAPI_list_free(amf_info->guami_list);
OpenAPI_list_for_each(amf_info->tai_list, node) {
OpenAPI_tai_free(node->data);
if (amf_info->amf_region_id) {
ogs_free(amf_info->amf_region_id);
amf_info->amf_region_id = NULL;
}
OpenAPI_list_free(amf_info->tai_list);
OpenAPI_list_for_each(amf_info->tai_range_list, node) {
OpenAPI_tai_range_free(node->data);
if (amf_info->guami_list) {
OpenAPI_list_for_each(amf_info->guami_list, node) {
OpenAPI_guami_free(node->data);
}
OpenAPI_list_free(amf_info->guami_list);
amf_info->guami_list = NULL;
}
OpenAPI_list_free(amf_info->tai_range_list);
OpenAPI_list_for_each(amf_info->backup_info_amf_failure, node) {
OpenAPI_guami_free(node->data);
if (amf_info->tai_list) {
OpenAPI_list_for_each(amf_info->tai_list, node) {
OpenAPI_tai_free(node->data);
}
OpenAPI_list_free(amf_info->tai_list);
amf_info->tai_list = NULL;
}
OpenAPI_list_free(amf_info->backup_info_amf_failure);
OpenAPI_list_for_each(amf_info->backup_info_amf_removal, node) {
OpenAPI_guami_free(node->data);
if (amf_info->tai_range_list) {
OpenAPI_list_for_each(amf_info->tai_range_list, node) {
OpenAPI_tai_range_free(node->data);
}
OpenAPI_list_free(amf_info->tai_range_list);
amf_info->tai_range_list = NULL;
}
if (amf_info->backup_info_amf_failure) {
OpenAPI_list_for_each(amf_info->backup_info_amf_failure, node) {
OpenAPI_guami_free(node->data);
}
OpenAPI_list_free(amf_info->backup_info_amf_failure);
amf_info->backup_info_amf_failure = NULL;
}
if (amf_info->backup_info_amf_removal) {
OpenAPI_list_for_each(amf_info->backup_info_amf_removal, node) {
OpenAPI_guami_free(node->data);
}
OpenAPI_list_free(amf_info->backup_info_amf_removal);
amf_info->backup_info_amf_removal = NULL;
}
if (amf_info->n2_interface_amf_info) {
OpenAPI_n2_interface_amf_info_free(amf_info->n2_interface_amf_info);
amf_info->n2_interface_amf_info = NULL;
}
OpenAPI_list_free(amf_info->backup_info_amf_removal);
OpenAPI_n2_interface_amf_info_free(amf_info->n2_interface_amf_info);
ogs_free(amf_info);
}
cJSON *OpenAPI_amf_info_convertToJSON(OpenAPI_amf_info_t *amf_info)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (amf_info == NULL) {
ogs_error("OpenAPI_amf_info_convertToJSON() failed [AmfInfo]");
@ -72,32 +98,40 @@ cJSON *OpenAPI_amf_info_convertToJSON(OpenAPI_amf_info_t *amf_info)
}
item = cJSON_CreateObject();
if (!amf_info->amf_set_id) {
ogs_error("OpenAPI_amf_info_convertToJSON() failed [amf_set_id]");
return NULL;
}
if (cJSON_AddStringToObject(item, "amfSetId", amf_info->amf_set_id) == NULL) {
ogs_error("OpenAPI_amf_info_convertToJSON() failed [amf_set_id]");
goto end;
}
if (!amf_info->amf_region_id) {
ogs_error("OpenAPI_amf_info_convertToJSON() failed [amf_region_id]");
return NULL;
}
if (cJSON_AddStringToObject(item, "amfRegionId", amf_info->amf_region_id) == NULL) {
ogs_error("OpenAPI_amf_info_convertToJSON() failed [amf_region_id]");
goto end;
}
if (!amf_info->guami_list) {
ogs_error("OpenAPI_amf_info_convertToJSON() failed [guami_list]");
return NULL;
}
cJSON *guami_listList = cJSON_AddArrayToObject(item, "guamiList");
if (guami_listList == NULL) {
ogs_error("OpenAPI_amf_info_convertToJSON() failed [guami_list]");
goto end;
}
OpenAPI_lnode_t *guami_list_node;
if (amf_info->guami_list) {
OpenAPI_list_for_each(amf_info->guami_list, guami_list_node) {
cJSON *itemLocal = OpenAPI_guami_convertToJSON(guami_list_node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_amf_info_convertToJSON() failed [guami_list]");
goto end;
}
cJSON_AddItemToArray(guami_listList, itemLocal);
OpenAPI_list_for_each(amf_info->guami_list, node) {
cJSON *itemLocal = OpenAPI_guami_convertToJSON(node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_amf_info_convertToJSON() failed [guami_list]");
goto end;
}
cJSON_AddItemToArray(guami_listList, itemLocal);
}
if (amf_info->tai_list) {
@ -106,17 +140,13 @@ cJSON *OpenAPI_amf_info_convertToJSON(OpenAPI_amf_info_t *amf_info)
ogs_error("OpenAPI_amf_info_convertToJSON() failed [tai_list]");
goto end;
}
OpenAPI_lnode_t *tai_list_node;
if (amf_info->tai_list) {
OpenAPI_list_for_each(amf_info->tai_list, tai_list_node) {
cJSON *itemLocal = OpenAPI_tai_convertToJSON(tai_list_node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_amf_info_convertToJSON() failed [tai_list]");
goto end;
}
cJSON_AddItemToArray(tai_listList, itemLocal);
OpenAPI_list_for_each(amf_info->tai_list, node) {
cJSON *itemLocal = OpenAPI_tai_convertToJSON(node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_amf_info_convertToJSON() failed [tai_list]");
goto end;
}
cJSON_AddItemToArray(tai_listList, itemLocal);
}
}
@ -126,17 +156,13 @@ cJSON *OpenAPI_amf_info_convertToJSON(OpenAPI_amf_info_t *amf_info)
ogs_error("OpenAPI_amf_info_convertToJSON() failed [tai_range_list]");
goto end;
}
OpenAPI_lnode_t *tai_range_list_node;
if (amf_info->tai_range_list) {
OpenAPI_list_for_each(amf_info->tai_range_list, tai_range_list_node) {
cJSON *itemLocal = OpenAPI_tai_range_convertToJSON(tai_range_list_node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_amf_info_convertToJSON() failed [tai_range_list]");
goto end;
}
cJSON_AddItemToArray(tai_range_listList, itemLocal);
OpenAPI_list_for_each(amf_info->tai_range_list, node) {
cJSON *itemLocal = OpenAPI_tai_range_convertToJSON(node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_amf_info_convertToJSON() failed [tai_range_list]");
goto end;
}
cJSON_AddItemToArray(tai_range_listList, itemLocal);
}
}
@ -146,17 +172,13 @@ cJSON *OpenAPI_amf_info_convertToJSON(OpenAPI_amf_info_t *amf_info)
ogs_error("OpenAPI_amf_info_convertToJSON() failed [backup_info_amf_failure]");
goto end;
}
OpenAPI_lnode_t *backup_info_amf_failure_node;
if (amf_info->backup_info_amf_failure) {
OpenAPI_list_for_each(amf_info->backup_info_amf_failure, backup_info_amf_failure_node) {
cJSON *itemLocal = OpenAPI_guami_convertToJSON(backup_info_amf_failure_node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_amf_info_convertToJSON() failed [backup_info_amf_failure]");
goto end;
}
cJSON_AddItemToArray(backup_info_amf_failureList, itemLocal);
OpenAPI_list_for_each(amf_info->backup_info_amf_failure, node) {
cJSON *itemLocal = OpenAPI_guami_convertToJSON(node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_amf_info_convertToJSON() failed [backup_info_amf_failure]");
goto end;
}
cJSON_AddItemToArray(backup_info_amf_failureList, itemLocal);
}
}
@ -166,17 +188,13 @@ cJSON *OpenAPI_amf_info_convertToJSON(OpenAPI_amf_info_t *amf_info)
ogs_error("OpenAPI_amf_info_convertToJSON() failed [backup_info_amf_removal]");
goto end;
}
OpenAPI_lnode_t *backup_info_amf_removal_node;
if (amf_info->backup_info_amf_removal) {
OpenAPI_list_for_each(amf_info->backup_info_amf_removal, backup_info_amf_removal_node) {
cJSON *itemLocal = OpenAPI_guami_convertToJSON(backup_info_amf_removal_node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_amf_info_convertToJSON() failed [backup_info_amf_removal]");
goto end;
}
cJSON_AddItemToArray(backup_info_amf_removalList, itemLocal);
OpenAPI_list_for_each(amf_info->backup_info_amf_removal, node) {
cJSON *itemLocal = OpenAPI_guami_convertToJSON(node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_amf_info_convertToJSON() failed [backup_info_amf_removal]");
goto end;
}
cJSON_AddItemToArray(backup_info_amf_removalList, itemLocal);
}
}
@ -200,178 +218,169 @@ end:
OpenAPI_amf_info_t *OpenAPI_amf_info_parseFromJSON(cJSON *amf_infoJSON)
{
OpenAPI_amf_info_t *amf_info_local_var = NULL;
cJSON *amf_set_id = cJSON_GetObjectItemCaseSensitive(amf_infoJSON, "amfSetId");
OpenAPI_lnode_t *node = NULL;
cJSON *amf_set_id = NULL;
cJSON *amf_region_id = NULL;
cJSON *guami_list = NULL;
OpenAPI_list_t *guami_listList = NULL;
cJSON *tai_list = NULL;
OpenAPI_list_t *tai_listList = NULL;
cJSON *tai_range_list = NULL;
OpenAPI_list_t *tai_range_listList = NULL;
cJSON *backup_info_amf_failure = NULL;
OpenAPI_list_t *backup_info_amf_failureList = NULL;
cJSON *backup_info_amf_removal = NULL;
OpenAPI_list_t *backup_info_amf_removalList = NULL;
cJSON *n2_interface_amf_info = NULL;
OpenAPI_n2_interface_amf_info_t *n2_interface_amf_info_local_nonprim = NULL;
amf_set_id = cJSON_GetObjectItemCaseSensitive(amf_infoJSON, "amfSetId");
if (!amf_set_id) {
ogs_error("OpenAPI_amf_info_parseFromJSON() failed [amf_set_id]");
goto end;
}
if (!cJSON_IsString(amf_set_id)) {
ogs_error("OpenAPI_amf_info_parseFromJSON() failed [amf_set_id]");
goto end;
}
cJSON *amf_region_id = cJSON_GetObjectItemCaseSensitive(amf_infoJSON, "amfRegionId");
amf_region_id = cJSON_GetObjectItemCaseSensitive(amf_infoJSON, "amfRegionId");
if (!amf_region_id) {
ogs_error("OpenAPI_amf_info_parseFromJSON() failed [amf_region_id]");
goto end;
}
if (!cJSON_IsString(amf_region_id)) {
ogs_error("OpenAPI_amf_info_parseFromJSON() failed [amf_region_id]");
goto end;
}
cJSON *guami_list = cJSON_GetObjectItemCaseSensitive(amf_infoJSON, "guamiList");
guami_list = cJSON_GetObjectItemCaseSensitive(amf_infoJSON, "guamiList");
if (!guami_list) {
ogs_error("OpenAPI_amf_info_parseFromJSON() failed [guami_list]");
goto end;
}
OpenAPI_list_t *guami_listList;
cJSON *guami_list_local_nonprimitive;
if (!cJSON_IsArray(guami_list)){
ogs_error("OpenAPI_amf_info_parseFromJSON() failed [guami_list]");
goto end;
}
guami_listList = OpenAPI_list_create();
cJSON_ArrayForEach(guami_list_local_nonprimitive, guami_list ) {
if (!cJSON_IsObject(guami_list_local_nonprimitive)) {
cJSON *guami_list_local = NULL;
if (!cJSON_IsArray(guami_list)) {
ogs_error("OpenAPI_amf_info_parseFromJSON() failed [guami_list]");
goto end;
}
OpenAPI_guami_t *guami_listItem = OpenAPI_guami_parseFromJSON(guami_list_local_nonprimitive);
if (!guami_listItem) {
ogs_error("No guami_listItem");
OpenAPI_list_free(guami_listList);
goto end;
guami_listList = OpenAPI_list_create();
cJSON_ArrayForEach(guami_list_local, guami_list) {
if (!cJSON_IsObject(guami_list_local)) {
ogs_error("OpenAPI_amf_info_parseFromJSON() failed [guami_list]");
goto end;
}
OpenAPI_guami_t *guami_listItem = OpenAPI_guami_parseFromJSON(guami_list_local);
if (!guami_listItem) {
ogs_error("No guami_listItem");
OpenAPI_list_free(guami_listList);
goto end;
}
OpenAPI_list_add(guami_listList, guami_listItem);
}
OpenAPI_list_add(guami_listList, guami_listItem);
}
cJSON *tai_list = cJSON_GetObjectItemCaseSensitive(amf_infoJSON, "taiList");
OpenAPI_list_t *tai_listList;
tai_list = cJSON_GetObjectItemCaseSensitive(amf_infoJSON, "taiList");
if (tai_list) {
cJSON *tai_list_local_nonprimitive;
if (!cJSON_IsArray(tai_list)){
ogs_error("OpenAPI_amf_info_parseFromJSON() failed [tai_list]");
goto end;
}
tai_listList = OpenAPI_list_create();
cJSON_ArrayForEach(tai_list_local_nonprimitive, tai_list ) {
if (!cJSON_IsObject(tai_list_local_nonprimitive)) {
cJSON *tai_list_local = NULL;
if (!cJSON_IsArray(tai_list)) {
ogs_error("OpenAPI_amf_info_parseFromJSON() failed [tai_list]");
goto end;
}
OpenAPI_tai_t *tai_listItem = OpenAPI_tai_parseFromJSON(tai_list_local_nonprimitive);
if (!tai_listItem) {
ogs_error("No tai_listItem");
OpenAPI_list_free(tai_listList);
goto end;
tai_listList = OpenAPI_list_create();
cJSON_ArrayForEach(tai_list_local, tai_list) {
if (!cJSON_IsObject(tai_list_local)) {
ogs_error("OpenAPI_amf_info_parseFromJSON() failed [tai_list]");
goto end;
}
OpenAPI_tai_t *tai_listItem = OpenAPI_tai_parseFromJSON(tai_list_local);
if (!tai_listItem) {
ogs_error("No tai_listItem");
OpenAPI_list_free(tai_listList);
goto end;
}
OpenAPI_list_add(tai_listList, tai_listItem);
}
OpenAPI_list_add(tai_listList, tai_listItem);
}
}
cJSON *tai_range_list = cJSON_GetObjectItemCaseSensitive(amf_infoJSON, "taiRangeList");
OpenAPI_list_t *tai_range_listList;
tai_range_list = cJSON_GetObjectItemCaseSensitive(amf_infoJSON, "taiRangeList");
if (tai_range_list) {
cJSON *tai_range_list_local_nonprimitive;
if (!cJSON_IsArray(tai_range_list)){
ogs_error("OpenAPI_amf_info_parseFromJSON() failed [tai_range_list]");
goto end;
}
tai_range_listList = OpenAPI_list_create();
cJSON_ArrayForEach(tai_range_list_local_nonprimitive, tai_range_list ) {
if (!cJSON_IsObject(tai_range_list_local_nonprimitive)) {
cJSON *tai_range_list_local = NULL;
if (!cJSON_IsArray(tai_range_list)) {
ogs_error("OpenAPI_amf_info_parseFromJSON() failed [tai_range_list]");
goto end;
}
OpenAPI_tai_range_t *tai_range_listItem = OpenAPI_tai_range_parseFromJSON(tai_range_list_local_nonprimitive);
if (!tai_range_listItem) {
ogs_error("No tai_range_listItem");
OpenAPI_list_free(tai_range_listList);
goto end;
tai_range_listList = OpenAPI_list_create();
cJSON_ArrayForEach(tai_range_list_local, tai_range_list) {
if (!cJSON_IsObject(tai_range_list_local)) {
ogs_error("OpenAPI_amf_info_parseFromJSON() failed [tai_range_list]");
goto end;
}
OpenAPI_tai_range_t *tai_range_listItem = OpenAPI_tai_range_parseFromJSON(tai_range_list_local);
if (!tai_range_listItem) {
ogs_error("No tai_range_listItem");
OpenAPI_list_free(tai_range_listList);
goto end;
}
OpenAPI_list_add(tai_range_listList, tai_range_listItem);
}
OpenAPI_list_add(tai_range_listList, tai_range_listItem);
}
}
cJSON *backup_info_amf_failure = cJSON_GetObjectItemCaseSensitive(amf_infoJSON, "backupInfoAmfFailure");
OpenAPI_list_t *backup_info_amf_failureList;
backup_info_amf_failure = cJSON_GetObjectItemCaseSensitive(amf_infoJSON, "backupInfoAmfFailure");
if (backup_info_amf_failure) {
cJSON *backup_info_amf_failure_local_nonprimitive;
if (!cJSON_IsArray(backup_info_amf_failure)){
ogs_error("OpenAPI_amf_info_parseFromJSON() failed [backup_info_amf_failure]");
goto end;
}
backup_info_amf_failureList = OpenAPI_list_create();
cJSON_ArrayForEach(backup_info_amf_failure_local_nonprimitive, backup_info_amf_failure ) {
if (!cJSON_IsObject(backup_info_amf_failure_local_nonprimitive)) {
cJSON *backup_info_amf_failure_local = NULL;
if (!cJSON_IsArray(backup_info_amf_failure)) {
ogs_error("OpenAPI_amf_info_parseFromJSON() failed [backup_info_amf_failure]");
goto end;
}
OpenAPI_guami_t *backup_info_amf_failureItem = OpenAPI_guami_parseFromJSON(backup_info_amf_failure_local_nonprimitive);
if (!backup_info_amf_failureItem) {
ogs_error("No backup_info_amf_failureItem");
OpenAPI_list_free(backup_info_amf_failureList);
goto end;
backup_info_amf_failureList = OpenAPI_list_create();
cJSON_ArrayForEach(backup_info_amf_failure_local, backup_info_amf_failure) {
if (!cJSON_IsObject(backup_info_amf_failure_local)) {
ogs_error("OpenAPI_amf_info_parseFromJSON() failed [backup_info_amf_failure]");
goto end;
}
OpenAPI_guami_t *backup_info_amf_failureItem = OpenAPI_guami_parseFromJSON(backup_info_amf_failure_local);
if (!backup_info_amf_failureItem) {
ogs_error("No backup_info_amf_failureItem");
OpenAPI_list_free(backup_info_amf_failureList);
goto end;
}
OpenAPI_list_add(backup_info_amf_failureList, backup_info_amf_failureItem);
}
OpenAPI_list_add(backup_info_amf_failureList, backup_info_amf_failureItem);
}
}
cJSON *backup_info_amf_removal = cJSON_GetObjectItemCaseSensitive(amf_infoJSON, "backupInfoAmfRemoval");
OpenAPI_list_t *backup_info_amf_removalList;
backup_info_amf_removal = cJSON_GetObjectItemCaseSensitive(amf_infoJSON, "backupInfoAmfRemoval");
if (backup_info_amf_removal) {
cJSON *backup_info_amf_removal_local_nonprimitive;
if (!cJSON_IsArray(backup_info_amf_removal)){
ogs_error("OpenAPI_amf_info_parseFromJSON() failed [backup_info_amf_removal]");
goto end;
}
backup_info_amf_removalList = OpenAPI_list_create();
cJSON_ArrayForEach(backup_info_amf_removal_local_nonprimitive, backup_info_amf_removal ) {
if (!cJSON_IsObject(backup_info_amf_removal_local_nonprimitive)) {
cJSON *backup_info_amf_removal_local = NULL;
if (!cJSON_IsArray(backup_info_amf_removal)) {
ogs_error("OpenAPI_amf_info_parseFromJSON() failed [backup_info_amf_removal]");
goto end;
}
OpenAPI_guami_t *backup_info_amf_removalItem = OpenAPI_guami_parseFromJSON(backup_info_amf_removal_local_nonprimitive);
if (!backup_info_amf_removalItem) {
ogs_error("No backup_info_amf_removalItem");
OpenAPI_list_free(backup_info_amf_removalList);
goto end;
backup_info_amf_removalList = OpenAPI_list_create();
cJSON_ArrayForEach(backup_info_amf_removal_local, backup_info_amf_removal) {
if (!cJSON_IsObject(backup_info_amf_removal_local)) {
ogs_error("OpenAPI_amf_info_parseFromJSON() failed [backup_info_amf_removal]");
goto end;
}
OpenAPI_guami_t *backup_info_amf_removalItem = OpenAPI_guami_parseFromJSON(backup_info_amf_removal_local);
if (!backup_info_amf_removalItem) {
ogs_error("No backup_info_amf_removalItem");
OpenAPI_list_free(backup_info_amf_removalList);
goto end;
}
OpenAPI_list_add(backup_info_amf_removalList, backup_info_amf_removalItem);
}
OpenAPI_list_add(backup_info_amf_removalList, backup_info_amf_removalItem);
}
}
cJSON *n2_interface_amf_info = cJSON_GetObjectItemCaseSensitive(amf_infoJSON, "n2InterfaceAmfInfo");
OpenAPI_n2_interface_amf_info_t *n2_interface_amf_info_local_nonprim = NULL;
n2_interface_amf_info = cJSON_GetObjectItemCaseSensitive(amf_infoJSON, "n2InterfaceAmfInfo");
if (n2_interface_amf_info) {
n2_interface_amf_info_local_nonprim = OpenAPI_n2_interface_amf_info_parseFromJSON(n2_interface_amf_info);
}
@ -389,6 +398,45 @@ OpenAPI_amf_info_t *OpenAPI_amf_info_parseFromJSON(cJSON *amf_infoJSON)
return amf_info_local_var;
end:
if (guami_listList) {
OpenAPI_list_for_each(guami_listList, node) {
OpenAPI_guami_free(node->data);
}
OpenAPI_list_free(guami_listList);
guami_listList = NULL;
}
if (tai_listList) {
OpenAPI_list_for_each(tai_listList, node) {
OpenAPI_tai_free(node->data);
}
OpenAPI_list_free(tai_listList);
tai_listList = NULL;
}
if (tai_range_listList) {
OpenAPI_list_for_each(tai_range_listList, node) {
OpenAPI_tai_range_free(node->data);
}
OpenAPI_list_free(tai_range_listList);
tai_range_listList = NULL;
}
if (backup_info_amf_failureList) {
OpenAPI_list_for_each(backup_info_amf_failureList, node) {
OpenAPI_guami_free(node->data);
}
OpenAPI_list_free(backup_info_amf_failureList);
backup_info_amf_failureList = NULL;
}
if (backup_info_amf_removalList) {
OpenAPI_list_for_each(backup_info_amf_removalList, node) {
OpenAPI_guami_free(node->data);
}
OpenAPI_list_free(backup_info_amf_removalList);
backup_info_amf_removalList = NULL;
}
if (n2_interface_amf_info_local_nonprim) {
OpenAPI_n2_interface_amf_info_free(n2_interface_amf_info_local_nonprim);
n2_interface_amf_info_local_nonprim = NULL;
}
return NULL;
}

View File

@ -60,33 +60,77 @@ OpenAPI_amf_non3_gpp_access_registration_t *OpenAPI_amf_non3_gpp_access_registra
void OpenAPI_amf_non3_gpp_access_registration_free(OpenAPI_amf_non3_gpp_access_registration_t *amf_non3_gpp_access_registration)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == amf_non3_gpp_access_registration) {
return;
}
OpenAPI_lnode_t *node;
ogs_free(amf_non3_gpp_access_registration->amf_instance_id);
ogs_free(amf_non3_gpp_access_registration->supported_features);
ogs_free(amf_non3_gpp_access_registration->pei);
ogs_free(amf_non3_gpp_access_registration->dereg_callback_uri);
ogs_free(amf_non3_gpp_access_registration->amf_service_name_dereg);
ogs_free(amf_non3_gpp_access_registration->pcscf_restoration_callback_uri);
ogs_free(amf_non3_gpp_access_registration->amf_service_name_pcscf_rest);
OpenAPI_guami_free(amf_non3_gpp_access_registration->guami);
OpenAPI_list_for_each(amf_non3_gpp_access_registration->backup_amf_info, node) {
OpenAPI_backup_amf_info_free(node->data);
if (amf_non3_gpp_access_registration->amf_instance_id) {
ogs_free(amf_non3_gpp_access_registration->amf_instance_id);
amf_non3_gpp_access_registration->amf_instance_id = NULL;
}
if (amf_non3_gpp_access_registration->supported_features) {
ogs_free(amf_non3_gpp_access_registration->supported_features);
amf_non3_gpp_access_registration->supported_features = NULL;
}
if (amf_non3_gpp_access_registration->pei) {
ogs_free(amf_non3_gpp_access_registration->pei);
amf_non3_gpp_access_registration->pei = NULL;
}
if (amf_non3_gpp_access_registration->dereg_callback_uri) {
ogs_free(amf_non3_gpp_access_registration->dereg_callback_uri);
amf_non3_gpp_access_registration->dereg_callback_uri = NULL;
}
if (amf_non3_gpp_access_registration->amf_service_name_dereg) {
ogs_free(amf_non3_gpp_access_registration->amf_service_name_dereg);
amf_non3_gpp_access_registration->amf_service_name_dereg = NULL;
}
if (amf_non3_gpp_access_registration->pcscf_restoration_callback_uri) {
ogs_free(amf_non3_gpp_access_registration->pcscf_restoration_callback_uri);
amf_non3_gpp_access_registration->pcscf_restoration_callback_uri = NULL;
}
if (amf_non3_gpp_access_registration->amf_service_name_pcscf_rest) {
ogs_free(amf_non3_gpp_access_registration->amf_service_name_pcscf_rest);
amf_non3_gpp_access_registration->amf_service_name_pcscf_rest = NULL;
}
if (amf_non3_gpp_access_registration->guami) {
OpenAPI_guami_free(amf_non3_gpp_access_registration->guami);
amf_non3_gpp_access_registration->guami = NULL;
}
if (amf_non3_gpp_access_registration->backup_amf_info) {
OpenAPI_list_for_each(amf_non3_gpp_access_registration->backup_amf_info, node) {
OpenAPI_backup_amf_info_free(node->data);
}
OpenAPI_list_free(amf_non3_gpp_access_registration->backup_amf_info);
amf_non3_gpp_access_registration->backup_amf_info = NULL;
}
if (amf_non3_gpp_access_registration->amf_ee_subscription_id) {
ogs_free(amf_non3_gpp_access_registration->amf_ee_subscription_id);
amf_non3_gpp_access_registration->amf_ee_subscription_id = NULL;
}
if (amf_non3_gpp_access_registration->registration_time) {
ogs_free(amf_non3_gpp_access_registration->registration_time);
amf_non3_gpp_access_registration->registration_time = NULL;
}
if (amf_non3_gpp_access_registration->vgmlc_address) {
OpenAPI_vgmlc_address_free(amf_non3_gpp_access_registration->vgmlc_address);
amf_non3_gpp_access_registration->vgmlc_address = NULL;
}
if (amf_non3_gpp_access_registration->context_info) {
OpenAPI_context_info_free(amf_non3_gpp_access_registration->context_info);
amf_non3_gpp_access_registration->context_info = NULL;
}
if (amf_non3_gpp_access_registration->supi) {
ogs_free(amf_non3_gpp_access_registration->supi);
amf_non3_gpp_access_registration->supi = NULL;
}
OpenAPI_list_free(amf_non3_gpp_access_registration->backup_amf_info);
ogs_free(amf_non3_gpp_access_registration->amf_ee_subscription_id);
ogs_free(amf_non3_gpp_access_registration->registration_time);
OpenAPI_vgmlc_address_free(amf_non3_gpp_access_registration->vgmlc_address);
OpenAPI_context_info_free(amf_non3_gpp_access_registration->context_info);
ogs_free(amf_non3_gpp_access_registration->supi);
ogs_free(amf_non3_gpp_access_registration);
}
cJSON *OpenAPI_amf_non3_gpp_access_registration_convertToJSON(OpenAPI_amf_non3_gpp_access_registration_t *amf_non3_gpp_access_registration)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (amf_non3_gpp_access_registration == NULL) {
ogs_error("OpenAPI_amf_non3_gpp_access_registration_convertToJSON() failed [AmfNon3GppAccessRegistration]");
@ -94,6 +138,10 @@ cJSON *OpenAPI_amf_non3_gpp_access_registration_convertToJSON(OpenAPI_amf_non3_g
}
item = cJSON_CreateObject();
if (!amf_non3_gpp_access_registration->amf_instance_id) {
ogs_error("OpenAPI_amf_non3_gpp_access_registration_convertToJSON() failed [amf_instance_id]");
return NULL;
}
if (cJSON_AddStringToObject(item, "amfInstanceId", amf_non3_gpp_access_registration->amf_instance_id) == NULL) {
ogs_error("OpenAPI_amf_non3_gpp_access_registration_convertToJSON() failed [amf_instance_id]");
goto end;
@ -120,11 +168,19 @@ cJSON *OpenAPI_amf_non3_gpp_access_registration_convertToJSON(OpenAPI_amf_non3_g
}
}
if (amf_non3_gpp_access_registration->ims_vo_ps == OpenAPI_ims_vo_ps_NULL) {
ogs_error("OpenAPI_amf_non3_gpp_access_registration_convertToJSON() failed [ims_vo_ps]");
return NULL;
}
if (cJSON_AddStringToObject(item, "imsVoPs", OpenAPI_ims_vo_ps_ToString(amf_non3_gpp_access_registration->ims_vo_ps)) == NULL) {
ogs_error("OpenAPI_amf_non3_gpp_access_registration_convertToJSON() failed [ims_vo_ps]");
goto end;
}
if (!amf_non3_gpp_access_registration->dereg_callback_uri) {
ogs_error("OpenAPI_amf_non3_gpp_access_registration_convertToJSON() failed [dereg_callback_uri]");
return NULL;
}
if (cJSON_AddStringToObject(item, "deregCallbackUri", amf_non3_gpp_access_registration->dereg_callback_uri) == NULL) {
ogs_error("OpenAPI_amf_non3_gpp_access_registration_convertToJSON() failed [dereg_callback_uri]");
goto end;
@ -151,6 +207,10 @@ cJSON *OpenAPI_amf_non3_gpp_access_registration_convertToJSON(OpenAPI_amf_non3_g
}
}
if (!amf_non3_gpp_access_registration->guami) {
ogs_error("OpenAPI_amf_non3_gpp_access_registration_convertToJSON() failed [guami]");
return NULL;
}
cJSON *guami_local_JSON = OpenAPI_guami_convertToJSON(amf_non3_gpp_access_registration->guami);
if (guami_local_JSON == NULL) {
ogs_error("OpenAPI_amf_non3_gpp_access_registration_convertToJSON() failed [guami]");
@ -168,20 +228,20 @@ cJSON *OpenAPI_amf_non3_gpp_access_registration_convertToJSON(OpenAPI_amf_non3_g
ogs_error("OpenAPI_amf_non3_gpp_access_registration_convertToJSON() failed [backup_amf_info]");
goto end;
}
OpenAPI_lnode_t *backup_amf_info_node;
if (amf_non3_gpp_access_registration->backup_amf_info) {
OpenAPI_list_for_each(amf_non3_gpp_access_registration->backup_amf_info, backup_amf_info_node) {
cJSON *itemLocal = OpenAPI_backup_amf_info_convertToJSON(backup_amf_info_node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_amf_non3_gpp_access_registration_convertToJSON() failed [backup_amf_info]");
goto end;
}
cJSON_AddItemToArray(backup_amf_infoList, itemLocal);
OpenAPI_list_for_each(amf_non3_gpp_access_registration->backup_amf_info, node) {
cJSON *itemLocal = OpenAPI_backup_amf_info_convertToJSON(node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_amf_non3_gpp_access_registration_convertToJSON() failed [backup_amf_info]");
goto end;
}
cJSON_AddItemToArray(backup_amf_infoList, itemLocal);
}
}
if (amf_non3_gpp_access_registration->rat_type == OpenAPI_rat_type_NULL) {
ogs_error("OpenAPI_amf_non3_gpp_access_registration_convertToJSON() failed [rat_type]");
return NULL;
}
if (cJSON_AddStringToObject(item, "ratType", OpenAPI_rat_type_ToString(amf_non3_gpp_access_registration->rat_type)) == NULL) {
ogs_error("OpenAPI_amf_non3_gpp_access_registration_convertToJSON() failed [rat_type]");
goto end;
@ -255,28 +315,51 @@ end:
OpenAPI_amf_non3_gpp_access_registration_t *OpenAPI_amf_non3_gpp_access_registration_parseFromJSON(cJSON *amf_non3_gpp_access_registrationJSON)
{
OpenAPI_amf_non3_gpp_access_registration_t *amf_non3_gpp_access_registration_local_var = NULL;
cJSON *amf_instance_id = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "amfInstanceId");
OpenAPI_lnode_t *node = NULL;
cJSON *amf_instance_id = NULL;
cJSON *supported_features = NULL;
cJSON *purge_flag = NULL;
cJSON *pei = NULL;
cJSON *ims_vo_ps = NULL;
OpenAPI_ims_vo_ps_e ims_vo_psVariable = 0;
cJSON *dereg_callback_uri = NULL;
cJSON *amf_service_name_dereg = NULL;
cJSON *pcscf_restoration_callback_uri = NULL;
cJSON *amf_service_name_pcscf_rest = NULL;
cJSON *guami = NULL;
OpenAPI_guami_t *guami_local_nonprim = NULL;
cJSON *backup_amf_info = NULL;
OpenAPI_list_t *backup_amf_infoList = NULL;
cJSON *rat_type = NULL;
OpenAPI_rat_type_e rat_typeVariable = 0;
cJSON *urrp_indicator = NULL;
cJSON *amf_ee_subscription_id = NULL;
cJSON *registration_time = NULL;
cJSON *vgmlc_address = NULL;
OpenAPI_vgmlc_address_t *vgmlc_address_local_nonprim = NULL;
cJSON *context_info = NULL;
OpenAPI_context_info_t *context_info_local_nonprim = NULL;
cJSON *no_ee_subscription_ind = NULL;
cJSON *supi = NULL;
amf_instance_id = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "amfInstanceId");
if (!amf_instance_id) {
ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [amf_instance_id]");
goto end;
}
if (!cJSON_IsString(amf_instance_id)) {
ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [amf_instance_id]");
goto end;
}
cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "supportedFeatures");
supported_features = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "supportedFeatures");
if (supported_features) {
if (!cJSON_IsString(supported_features)) {
if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) {
ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [supported_features]");
goto end;
}
}
cJSON *purge_flag = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "purgeFlag");
purge_flag = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "purgeFlag");
if (purge_flag) {
if (!cJSON_IsBool(purge_flag)) {
ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [purge_flag]");
@ -284,119 +367,103 @@ OpenAPI_amf_non3_gpp_access_registration_t *OpenAPI_amf_non3_gpp_access_registra
}
}
cJSON *pei = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "pei");
pei = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "pei");
if (pei) {
if (!cJSON_IsString(pei)) {
if (!cJSON_IsString(pei) && !cJSON_IsNull(pei)) {
ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [pei]");
goto end;
}
}
cJSON *ims_vo_ps = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "imsVoPs");
ims_vo_ps = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "imsVoPs");
if (!ims_vo_ps) {
ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [ims_vo_ps]");
goto end;
}
OpenAPI_ims_vo_ps_e ims_vo_psVariable;
if (!cJSON_IsString(ims_vo_ps)) {
ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [ims_vo_ps]");
goto end;
}
ims_vo_psVariable = OpenAPI_ims_vo_ps_FromString(ims_vo_ps->valuestring);
cJSON *dereg_callback_uri = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "deregCallbackUri");
dereg_callback_uri = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "deregCallbackUri");
if (!dereg_callback_uri) {
ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [dereg_callback_uri]");
goto end;
}
if (!cJSON_IsString(dereg_callback_uri)) {
ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [dereg_callback_uri]");
goto end;
}
cJSON *amf_service_name_dereg = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "amfServiceNameDereg");
amf_service_name_dereg = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "amfServiceNameDereg");
if (amf_service_name_dereg) {
if (!cJSON_IsString(amf_service_name_dereg)) {
if (!cJSON_IsString(amf_service_name_dereg) && !cJSON_IsNull(amf_service_name_dereg)) {
ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [amf_service_name_dereg]");
goto end;
}
}
cJSON *pcscf_restoration_callback_uri = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "pcscfRestorationCallbackUri");
pcscf_restoration_callback_uri = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "pcscfRestorationCallbackUri");
if (pcscf_restoration_callback_uri) {
if (!cJSON_IsString(pcscf_restoration_callback_uri)) {
if (!cJSON_IsString(pcscf_restoration_callback_uri) && !cJSON_IsNull(pcscf_restoration_callback_uri)) {
ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [pcscf_restoration_callback_uri]");
goto end;
}
}
cJSON *amf_service_name_pcscf_rest = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "amfServiceNamePcscfRest");
amf_service_name_pcscf_rest = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "amfServiceNamePcscfRest");
if (amf_service_name_pcscf_rest) {
if (!cJSON_IsString(amf_service_name_pcscf_rest)) {
if (!cJSON_IsString(amf_service_name_pcscf_rest) && !cJSON_IsNull(amf_service_name_pcscf_rest)) {
ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [amf_service_name_pcscf_rest]");
goto end;
}
}
cJSON *guami = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "guami");
guami = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "guami");
if (!guami) {
ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [guami]");
goto end;
}
OpenAPI_guami_t *guami_local_nonprim = NULL;
guami_local_nonprim = OpenAPI_guami_parseFromJSON(guami);
cJSON *backup_amf_info = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "backupAmfInfo");
OpenAPI_list_t *backup_amf_infoList;
backup_amf_info = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "backupAmfInfo");
if (backup_amf_info) {
cJSON *backup_amf_info_local_nonprimitive;
if (!cJSON_IsArray(backup_amf_info)){
ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [backup_amf_info]");
goto end;
}
backup_amf_infoList = OpenAPI_list_create();
cJSON_ArrayForEach(backup_amf_info_local_nonprimitive, backup_amf_info ) {
if (!cJSON_IsObject(backup_amf_info_local_nonprimitive)) {
cJSON *backup_amf_info_local = NULL;
if (!cJSON_IsArray(backup_amf_info)) {
ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [backup_amf_info]");
goto end;
}
OpenAPI_backup_amf_info_t *backup_amf_infoItem = OpenAPI_backup_amf_info_parseFromJSON(backup_amf_info_local_nonprimitive);
if (!backup_amf_infoItem) {
ogs_error("No backup_amf_infoItem");
OpenAPI_list_free(backup_amf_infoList);
goto end;
backup_amf_infoList = OpenAPI_list_create();
cJSON_ArrayForEach(backup_amf_info_local, backup_amf_info) {
if (!cJSON_IsObject(backup_amf_info_local)) {
ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [backup_amf_info]");
goto end;
}
OpenAPI_backup_amf_info_t *backup_amf_infoItem = OpenAPI_backup_amf_info_parseFromJSON(backup_amf_info_local);
if (!backup_amf_infoItem) {
ogs_error("No backup_amf_infoItem");
OpenAPI_list_free(backup_amf_infoList);
goto end;
}
OpenAPI_list_add(backup_amf_infoList, backup_amf_infoItem);
}
OpenAPI_list_add(backup_amf_infoList, backup_amf_infoItem);
}
}
cJSON *rat_type = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "ratType");
rat_type = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "ratType");
if (!rat_type) {
ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [rat_type]");
goto end;
}
OpenAPI_rat_type_e rat_typeVariable;
if (!cJSON_IsString(rat_type)) {
ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [rat_type]");
goto end;
}
rat_typeVariable = OpenAPI_rat_type_FromString(rat_type->valuestring);
cJSON *urrp_indicator = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "urrpIndicator");
urrp_indicator = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "urrpIndicator");
if (urrp_indicator) {
if (!cJSON_IsBool(urrp_indicator)) {
ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [urrp_indicator]");
@ -404,40 +471,33 @@ OpenAPI_amf_non3_gpp_access_registration_t *OpenAPI_amf_non3_gpp_access_registra
}
}
cJSON *amf_ee_subscription_id = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "amfEeSubscriptionId");
amf_ee_subscription_id = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "amfEeSubscriptionId");
if (amf_ee_subscription_id) {
if (!cJSON_IsString(amf_ee_subscription_id)) {
if (!cJSON_IsString(amf_ee_subscription_id) && !cJSON_IsNull(amf_ee_subscription_id)) {
ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [amf_ee_subscription_id]");
goto end;
}
}
cJSON *registration_time = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "registrationTime");
registration_time = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "registrationTime");
if (registration_time) {
if (!cJSON_IsString(registration_time)) {
if (!cJSON_IsString(registration_time) && !cJSON_IsNull(registration_time)) {
ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [registration_time]");
goto end;
}
}
cJSON *vgmlc_address = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "vgmlcAddress");
OpenAPI_vgmlc_address_t *vgmlc_address_local_nonprim = NULL;
vgmlc_address = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "vgmlcAddress");
if (vgmlc_address) {
vgmlc_address_local_nonprim = OpenAPI_vgmlc_address_parseFromJSON(vgmlc_address);
}
cJSON *context_info = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "contextInfo");
OpenAPI_context_info_t *context_info_local_nonprim = NULL;
context_info = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "contextInfo");
if (context_info) {
context_info_local_nonprim = OpenAPI_context_info_parseFromJSON(context_info);
}
cJSON *no_ee_subscription_ind = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "noEeSubscriptionInd");
no_ee_subscription_ind = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "noEeSubscriptionInd");
if (no_ee_subscription_ind) {
if (!cJSON_IsBool(no_ee_subscription_ind)) {
ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [no_ee_subscription_ind]");
@ -445,10 +505,9 @@ OpenAPI_amf_non3_gpp_access_registration_t *OpenAPI_amf_non3_gpp_access_registra
}
}
cJSON *supi = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "supi");
supi = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "supi");
if (supi) {
if (!cJSON_IsString(supi)) {
if (!cJSON_IsString(supi) && !cJSON_IsNull(supi)) {
ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [supi]");
goto end;
}
@ -456,31 +515,50 @@ OpenAPI_amf_non3_gpp_access_registration_t *OpenAPI_amf_non3_gpp_access_registra
amf_non3_gpp_access_registration_local_var = OpenAPI_amf_non3_gpp_access_registration_create (
ogs_strdup(amf_instance_id->valuestring),
supported_features ? ogs_strdup(supported_features->valuestring) : NULL,
supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL,
purge_flag ? true : false,
purge_flag ? purge_flag->valueint : 0,
pei ? ogs_strdup(pei->valuestring) : NULL,
pei && !cJSON_IsNull(pei) ? ogs_strdup(pei->valuestring) : NULL,
ims_vo_psVariable,
ogs_strdup(dereg_callback_uri->valuestring),
amf_service_name_dereg ? ogs_strdup(amf_service_name_dereg->valuestring) : NULL,
pcscf_restoration_callback_uri ? ogs_strdup(pcscf_restoration_callback_uri->valuestring) : NULL,
amf_service_name_pcscf_rest ? ogs_strdup(amf_service_name_pcscf_rest->valuestring) : NULL,
amf_service_name_dereg && !cJSON_IsNull(amf_service_name_dereg) ? ogs_strdup(amf_service_name_dereg->valuestring) : NULL,
pcscf_restoration_callback_uri && !cJSON_IsNull(pcscf_restoration_callback_uri) ? ogs_strdup(pcscf_restoration_callback_uri->valuestring) : NULL,
amf_service_name_pcscf_rest && !cJSON_IsNull(amf_service_name_pcscf_rest) ? ogs_strdup(amf_service_name_pcscf_rest->valuestring) : NULL,
guami_local_nonprim,
backup_amf_info ? backup_amf_infoList : NULL,
rat_typeVariable,
urrp_indicator ? true : false,
urrp_indicator ? urrp_indicator->valueint : 0,
amf_ee_subscription_id ? ogs_strdup(amf_ee_subscription_id->valuestring) : NULL,
registration_time ? ogs_strdup(registration_time->valuestring) : NULL,
amf_ee_subscription_id && !cJSON_IsNull(amf_ee_subscription_id) ? ogs_strdup(amf_ee_subscription_id->valuestring) : NULL,
registration_time && !cJSON_IsNull(registration_time) ? ogs_strdup(registration_time->valuestring) : NULL,
vgmlc_address ? vgmlc_address_local_nonprim : NULL,
context_info ? context_info_local_nonprim : NULL,
no_ee_subscription_ind ? true : false,
no_ee_subscription_ind ? no_ee_subscription_ind->valueint : 0,
supi ? ogs_strdup(supi->valuestring) : NULL
supi && !cJSON_IsNull(supi) ? ogs_strdup(supi->valuestring) : NULL
);
return amf_non3_gpp_access_registration_local_var;
end:
if (guami_local_nonprim) {
OpenAPI_guami_free(guami_local_nonprim);
guami_local_nonprim = NULL;
}
if (backup_amf_infoList) {
OpenAPI_list_for_each(backup_amf_infoList, node) {
OpenAPI_backup_amf_info_free(node->data);
}
OpenAPI_list_free(backup_amf_infoList);
backup_amf_infoList = NULL;
}
if (vgmlc_address_local_nonprim) {
OpenAPI_vgmlc_address_free(vgmlc_address_local_nonprim);
vgmlc_address_local_nonprim = NULL;
}
if (context_info_local_nonprim) {
OpenAPI_context_info_free(context_info_local_nonprim);
context_info_local_nonprim = NULL;
}
return NULL;
}

View File

@ -28,22 +28,33 @@ OpenAPI_amf_non3_gpp_access_registration_modification_t *OpenAPI_amf_non3_gpp_ac
void OpenAPI_amf_non3_gpp_access_registration_modification_free(OpenAPI_amf_non3_gpp_access_registration_modification_t *amf_non3_gpp_access_registration_modification)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == amf_non3_gpp_access_registration_modification) {
return;
}
OpenAPI_lnode_t *node;
OpenAPI_guami_free(amf_non3_gpp_access_registration_modification->guami);
ogs_free(amf_non3_gpp_access_registration_modification->pei);
OpenAPI_list_for_each(amf_non3_gpp_access_registration_modification->backup_amf_info, node) {
OpenAPI_backup_amf_info_free(node->data);
if (amf_non3_gpp_access_registration_modification->guami) {
OpenAPI_guami_free(amf_non3_gpp_access_registration_modification->guami);
amf_non3_gpp_access_registration_modification->guami = NULL;
}
if (amf_non3_gpp_access_registration_modification->pei) {
ogs_free(amf_non3_gpp_access_registration_modification->pei);
amf_non3_gpp_access_registration_modification->pei = NULL;
}
if (amf_non3_gpp_access_registration_modification->backup_amf_info) {
OpenAPI_list_for_each(amf_non3_gpp_access_registration_modification->backup_amf_info, node) {
OpenAPI_backup_amf_info_free(node->data);
}
OpenAPI_list_free(amf_non3_gpp_access_registration_modification->backup_amf_info);
amf_non3_gpp_access_registration_modification->backup_amf_info = NULL;
}
OpenAPI_list_free(amf_non3_gpp_access_registration_modification->backup_amf_info);
ogs_free(amf_non3_gpp_access_registration_modification);
}
cJSON *OpenAPI_amf_non3_gpp_access_registration_modification_convertToJSON(OpenAPI_amf_non3_gpp_access_registration_modification_t *amf_non3_gpp_access_registration_modification)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (amf_non3_gpp_access_registration_modification == NULL) {
ogs_error("OpenAPI_amf_non3_gpp_access_registration_modification_convertToJSON() failed [AmfNon3GppAccessRegistrationModification]");
@ -51,6 +62,10 @@ cJSON *OpenAPI_amf_non3_gpp_access_registration_modification_convertToJSON(OpenA
}
item = cJSON_CreateObject();
if (!amf_non3_gpp_access_registration_modification->guami) {
ogs_error("OpenAPI_amf_non3_gpp_access_registration_modification_convertToJSON() failed [guami]");
return NULL;
}
cJSON *guami_local_JSON = OpenAPI_guami_convertToJSON(amf_non3_gpp_access_registration_modification->guami);
if (guami_local_JSON == NULL) {
ogs_error("OpenAPI_amf_non3_gpp_access_registration_modification_convertToJSON() failed [guami]");
@ -76,7 +91,7 @@ cJSON *OpenAPI_amf_non3_gpp_access_registration_modification_convertToJSON(OpenA
}
}
if (amf_non3_gpp_access_registration_modification->ims_vo_ps) {
if (amf_non3_gpp_access_registration_modification->ims_vo_ps != OpenAPI_ims_vo_ps_NULL) {
if (cJSON_AddStringToObject(item, "imsVoPs", OpenAPI_ims_vo_ps_ToString(amf_non3_gpp_access_registration_modification->ims_vo_ps)) == NULL) {
ogs_error("OpenAPI_amf_non3_gpp_access_registration_modification_convertToJSON() failed [ims_vo_ps]");
goto end;
@ -89,17 +104,13 @@ cJSON *OpenAPI_amf_non3_gpp_access_registration_modification_convertToJSON(OpenA
ogs_error("OpenAPI_amf_non3_gpp_access_registration_modification_convertToJSON() failed [backup_amf_info]");
goto end;
}
OpenAPI_lnode_t *backup_amf_info_node;
if (amf_non3_gpp_access_registration_modification->backup_amf_info) {
OpenAPI_list_for_each(amf_non3_gpp_access_registration_modification->backup_amf_info, backup_amf_info_node) {
cJSON *itemLocal = OpenAPI_backup_amf_info_convertToJSON(backup_amf_info_node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_amf_non3_gpp_access_registration_modification_convertToJSON() failed [backup_amf_info]");
goto end;
}
cJSON_AddItemToArray(backup_amf_infoList, itemLocal);
OpenAPI_list_for_each(amf_non3_gpp_access_registration_modification->backup_amf_info, node) {
cJSON *itemLocal = OpenAPI_backup_amf_info_convertToJSON(node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_amf_non3_gpp_access_registration_modification_convertToJSON() failed [backup_amf_info]");
goto end;
}
cJSON_AddItemToArray(backup_amf_infoList, itemLocal);
}
}
@ -110,17 +121,23 @@ end:
OpenAPI_amf_non3_gpp_access_registration_modification_t *OpenAPI_amf_non3_gpp_access_registration_modification_parseFromJSON(cJSON *amf_non3_gpp_access_registration_modificationJSON)
{
OpenAPI_amf_non3_gpp_access_registration_modification_t *amf_non3_gpp_access_registration_modification_local_var = NULL;
cJSON *guami = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registration_modificationJSON, "guami");
OpenAPI_lnode_t *node = NULL;
cJSON *guami = NULL;
OpenAPI_guami_t *guami_local_nonprim = NULL;
cJSON *purge_flag = NULL;
cJSON *pei = NULL;
cJSON *ims_vo_ps = NULL;
OpenAPI_ims_vo_ps_e ims_vo_psVariable = 0;
cJSON *backup_amf_info = NULL;
OpenAPI_list_t *backup_amf_infoList = NULL;
guami = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registration_modificationJSON, "guami");
if (!guami) {
ogs_error("OpenAPI_amf_non3_gpp_access_registration_modification_parseFromJSON() failed [guami]");
goto end;
}
OpenAPI_guami_t *guami_local_nonprim = NULL;
guami_local_nonprim = OpenAPI_guami_parseFromJSON(guami);
cJSON *purge_flag = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registration_modificationJSON, "purgeFlag");
purge_flag = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registration_modificationJSON, "purgeFlag");
if (purge_flag) {
if (!cJSON_IsBool(purge_flag)) {
ogs_error("OpenAPI_amf_non3_gpp_access_registration_modification_parseFromJSON() failed [purge_flag]");
@ -128,18 +145,15 @@ OpenAPI_amf_non3_gpp_access_registration_modification_t *OpenAPI_amf_non3_gpp_ac
}
}
cJSON *pei = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registration_modificationJSON, "pei");
pei = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registration_modificationJSON, "pei");
if (pei) {
if (!cJSON_IsString(pei)) {
if (!cJSON_IsString(pei) && !cJSON_IsNull(pei)) {
ogs_error("OpenAPI_amf_non3_gpp_access_registration_modification_parseFromJSON() failed [pei]");
goto end;
}
}
cJSON *ims_vo_ps = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registration_modificationJSON, "imsVoPs");
OpenAPI_ims_vo_ps_e ims_vo_psVariable;
ims_vo_ps = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registration_modificationJSON, "imsVoPs");
if (ims_vo_ps) {
if (!cJSON_IsString(ims_vo_ps)) {
ogs_error("OpenAPI_amf_non3_gpp_access_registration_modification_parseFromJSON() failed [ims_vo_ps]");
@ -148,46 +162,53 @@ OpenAPI_amf_non3_gpp_access_registration_modification_t *OpenAPI_amf_non3_gpp_ac
ims_vo_psVariable = OpenAPI_ims_vo_ps_FromString(ims_vo_ps->valuestring);
}
cJSON *backup_amf_info = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registration_modificationJSON, "backupAmfInfo");
OpenAPI_list_t *backup_amf_infoList;
backup_amf_info = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registration_modificationJSON, "backupAmfInfo");
if (backup_amf_info) {
cJSON *backup_amf_info_local_nonprimitive;
if (!cJSON_IsArray(backup_amf_info)){
ogs_error("OpenAPI_amf_non3_gpp_access_registration_modification_parseFromJSON() failed [backup_amf_info]");
goto end;
}
backup_amf_infoList = OpenAPI_list_create();
cJSON_ArrayForEach(backup_amf_info_local_nonprimitive, backup_amf_info ) {
if (!cJSON_IsObject(backup_amf_info_local_nonprimitive)) {
cJSON *backup_amf_info_local = NULL;
if (!cJSON_IsArray(backup_amf_info)) {
ogs_error("OpenAPI_amf_non3_gpp_access_registration_modification_parseFromJSON() failed [backup_amf_info]");
goto end;
}
OpenAPI_backup_amf_info_t *backup_amf_infoItem = OpenAPI_backup_amf_info_parseFromJSON(backup_amf_info_local_nonprimitive);
if (!backup_amf_infoItem) {
ogs_error("No backup_amf_infoItem");
OpenAPI_list_free(backup_amf_infoList);
goto end;
backup_amf_infoList = OpenAPI_list_create();
cJSON_ArrayForEach(backup_amf_info_local, backup_amf_info) {
if (!cJSON_IsObject(backup_amf_info_local)) {
ogs_error("OpenAPI_amf_non3_gpp_access_registration_modification_parseFromJSON() failed [backup_amf_info]");
goto end;
}
OpenAPI_backup_amf_info_t *backup_amf_infoItem = OpenAPI_backup_amf_info_parseFromJSON(backup_amf_info_local);
if (!backup_amf_infoItem) {
ogs_error("No backup_amf_infoItem");
OpenAPI_list_free(backup_amf_infoList);
goto end;
}
OpenAPI_list_add(backup_amf_infoList, backup_amf_infoItem);
}
OpenAPI_list_add(backup_amf_infoList, backup_amf_infoItem);
}
}
amf_non3_gpp_access_registration_modification_local_var = OpenAPI_amf_non3_gpp_access_registration_modification_create (
guami_local_nonprim,
purge_flag ? true : false,
purge_flag ? purge_flag->valueint : 0,
pei ? ogs_strdup(pei->valuestring) : NULL,
pei && !cJSON_IsNull(pei) ? ogs_strdup(pei->valuestring) : NULL,
ims_vo_ps ? ims_vo_psVariable : 0,
backup_amf_info ? backup_amf_infoList : NULL
);
return amf_non3_gpp_access_registration_modification_local_var;
end:
if (guami_local_nonprim) {
OpenAPI_guami_free(guami_local_nonprim);
guami_local_nonprim = NULL;
}
if (backup_amf_infoList) {
OpenAPI_list_for_each(backup_amf_infoList, node) {
OpenAPI_backup_amf_info_free(node->data);
}
OpenAPI_list_free(backup_amf_infoList);
backup_amf_infoList = NULL;
}
return NULL;
}

View File

@ -18,20 +18,25 @@ OpenAPI_amf_status_change_notification_t *OpenAPI_amf_status_change_notification
void OpenAPI_amf_status_change_notification_free(OpenAPI_amf_status_change_notification_t *amf_status_change_notification)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == amf_status_change_notification) {
return;
}
OpenAPI_lnode_t *node;
OpenAPI_list_for_each(amf_status_change_notification->amf_status_info_list, node) {
OpenAPI_amf_status_info_free(node->data);
if (amf_status_change_notification->amf_status_info_list) {
OpenAPI_list_for_each(amf_status_change_notification->amf_status_info_list, node) {
OpenAPI_amf_status_info_free(node->data);
}
OpenAPI_list_free(amf_status_change_notification->amf_status_info_list);
amf_status_change_notification->amf_status_info_list = NULL;
}
OpenAPI_list_free(amf_status_change_notification->amf_status_info_list);
ogs_free(amf_status_change_notification);
}
cJSON *OpenAPI_amf_status_change_notification_convertToJSON(OpenAPI_amf_status_change_notification_t *amf_status_change_notification)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (amf_status_change_notification == NULL) {
ogs_error("OpenAPI_amf_status_change_notification_convertToJSON() failed [AmfStatusChangeNotification]");
@ -39,22 +44,22 @@ cJSON *OpenAPI_amf_status_change_notification_convertToJSON(OpenAPI_amf_status_c
}
item = cJSON_CreateObject();
if (!amf_status_change_notification->amf_status_info_list) {
ogs_error("OpenAPI_amf_status_change_notification_convertToJSON() failed [amf_status_info_list]");
return NULL;
}
cJSON *amf_status_info_listList = cJSON_AddArrayToObject(item, "amfStatusInfoList");
if (amf_status_info_listList == NULL) {
ogs_error("OpenAPI_amf_status_change_notification_convertToJSON() failed [amf_status_info_list]");
goto end;
}
OpenAPI_lnode_t *amf_status_info_list_node;
if (amf_status_change_notification->amf_status_info_list) {
OpenAPI_list_for_each(amf_status_change_notification->amf_status_info_list, amf_status_info_list_node) {
cJSON *itemLocal = OpenAPI_amf_status_info_convertToJSON(amf_status_info_list_node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_amf_status_change_notification_convertToJSON() failed [amf_status_info_list]");
goto end;
}
cJSON_AddItemToArray(amf_status_info_listList, itemLocal);
OpenAPI_list_for_each(amf_status_change_notification->amf_status_info_list, node) {
cJSON *itemLocal = OpenAPI_amf_status_info_convertToJSON(node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_amf_status_change_notification_convertToJSON() failed [amf_status_info_list]");
goto end;
}
cJSON_AddItemToArray(amf_status_info_listList, itemLocal);
}
end:
@ -64,43 +69,49 @@ end:
OpenAPI_amf_status_change_notification_t *OpenAPI_amf_status_change_notification_parseFromJSON(cJSON *amf_status_change_notificationJSON)
{
OpenAPI_amf_status_change_notification_t *amf_status_change_notification_local_var = NULL;
cJSON *amf_status_info_list = cJSON_GetObjectItemCaseSensitive(amf_status_change_notificationJSON, "amfStatusInfoList");
OpenAPI_lnode_t *node = NULL;
cJSON *amf_status_info_list = NULL;
OpenAPI_list_t *amf_status_info_listList = NULL;
amf_status_info_list = cJSON_GetObjectItemCaseSensitive(amf_status_change_notificationJSON, "amfStatusInfoList");
if (!amf_status_info_list) {
ogs_error("OpenAPI_amf_status_change_notification_parseFromJSON() failed [amf_status_info_list]");
goto end;
}
OpenAPI_list_t *amf_status_info_listList;
cJSON *amf_status_info_list_local_nonprimitive;
if (!cJSON_IsArray(amf_status_info_list)){
ogs_error("OpenAPI_amf_status_change_notification_parseFromJSON() failed [amf_status_info_list]");
goto end;
}
amf_status_info_listList = OpenAPI_list_create();
cJSON_ArrayForEach(amf_status_info_list_local_nonprimitive, amf_status_info_list ) {
if (!cJSON_IsObject(amf_status_info_list_local_nonprimitive)) {
cJSON *amf_status_info_list_local = NULL;
if (!cJSON_IsArray(amf_status_info_list)) {
ogs_error("OpenAPI_amf_status_change_notification_parseFromJSON() failed [amf_status_info_list]");
goto end;
}
OpenAPI_amf_status_info_t *amf_status_info_listItem = OpenAPI_amf_status_info_parseFromJSON(amf_status_info_list_local_nonprimitive);
if (!amf_status_info_listItem) {
ogs_error("No amf_status_info_listItem");
OpenAPI_list_free(amf_status_info_listList);
goto end;
amf_status_info_listList = OpenAPI_list_create();
cJSON_ArrayForEach(amf_status_info_list_local, amf_status_info_list) {
if (!cJSON_IsObject(amf_status_info_list_local)) {
ogs_error("OpenAPI_amf_status_change_notification_parseFromJSON() failed [amf_status_info_list]");
goto end;
}
OpenAPI_amf_status_info_t *amf_status_info_listItem = OpenAPI_amf_status_info_parseFromJSON(amf_status_info_list_local);
if (!amf_status_info_listItem) {
ogs_error("No amf_status_info_listItem");
OpenAPI_list_free(amf_status_info_listList);
goto end;
}
OpenAPI_list_add(amf_status_info_listList, amf_status_info_listItem);
}
OpenAPI_list_add(amf_status_info_listList, amf_status_info_listItem);
}
amf_status_change_notification_local_var = OpenAPI_amf_status_change_notification_create (
amf_status_info_listList
);
return amf_status_change_notification_local_var;
end:
if (amf_status_info_listList) {
OpenAPI_list_for_each(amf_status_info_listList, node) {
OpenAPI_amf_status_info_free(node->data);
}
OpenAPI_list_free(amf_status_info_listList);
amf_status_info_listList = NULL;
}
return NULL;
}

View File

@ -20,21 +20,29 @@ OpenAPI_amf_status_change_subscription_data_t *OpenAPI_amf_status_change_subscri
void OpenAPI_amf_status_change_subscription_data_free(OpenAPI_amf_status_change_subscription_data_t *amf_status_change_subscription_data)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == amf_status_change_subscription_data) {
return;
}
OpenAPI_lnode_t *node;
ogs_free(amf_status_change_subscription_data->amf_status_uri);
OpenAPI_list_for_each(amf_status_change_subscription_data->guami_list, node) {
OpenAPI_guami_free(node->data);
if (amf_status_change_subscription_data->amf_status_uri) {
ogs_free(amf_status_change_subscription_data->amf_status_uri);
amf_status_change_subscription_data->amf_status_uri = NULL;
}
if (amf_status_change_subscription_data->guami_list) {
OpenAPI_list_for_each(amf_status_change_subscription_data->guami_list, node) {
OpenAPI_guami_free(node->data);
}
OpenAPI_list_free(amf_status_change_subscription_data->guami_list);
amf_status_change_subscription_data->guami_list = NULL;
}
OpenAPI_list_free(amf_status_change_subscription_data->guami_list);
ogs_free(amf_status_change_subscription_data);
}
cJSON *OpenAPI_amf_status_change_subscription_data_convertToJSON(OpenAPI_amf_status_change_subscription_data_t *amf_status_change_subscription_data)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (amf_status_change_subscription_data == NULL) {
ogs_error("OpenAPI_amf_status_change_subscription_data_convertToJSON() failed [AMFStatusChangeSubscriptionData]");
@ -42,6 +50,10 @@ cJSON *OpenAPI_amf_status_change_subscription_data_convertToJSON(OpenAPI_amf_sta
}
item = cJSON_CreateObject();
if (!amf_status_change_subscription_data->amf_status_uri) {
ogs_error("OpenAPI_amf_status_change_subscription_data_convertToJSON() failed [amf_status_uri]");
return NULL;
}
if (cJSON_AddStringToObject(item, "amfStatusUri", amf_status_change_subscription_data->amf_status_uri) == NULL) {
ogs_error("OpenAPI_amf_status_change_subscription_data_convertToJSON() failed [amf_status_uri]");
goto end;
@ -53,17 +65,13 @@ cJSON *OpenAPI_amf_status_change_subscription_data_convertToJSON(OpenAPI_amf_sta
ogs_error("OpenAPI_amf_status_change_subscription_data_convertToJSON() failed [guami_list]");
goto end;
}
OpenAPI_lnode_t *guami_list_node;
if (amf_status_change_subscription_data->guami_list) {
OpenAPI_list_for_each(amf_status_change_subscription_data->guami_list, guami_list_node) {
cJSON *itemLocal = OpenAPI_guami_convertToJSON(guami_list_node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_amf_status_change_subscription_data_convertToJSON() failed [guami_list]");
goto end;
}
cJSON_AddItemToArray(guami_listList, itemLocal);
OpenAPI_list_for_each(amf_status_change_subscription_data->guami_list, node) {
cJSON *itemLocal = OpenAPI_guami_convertToJSON(node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_amf_status_change_subscription_data_convertToJSON() failed [guami_list]");
goto end;
}
cJSON_AddItemToArray(guami_listList, itemLocal);
}
}
@ -74,44 +82,43 @@ end:
OpenAPI_amf_status_change_subscription_data_t *OpenAPI_amf_status_change_subscription_data_parseFromJSON(cJSON *amf_status_change_subscription_dataJSON)
{
OpenAPI_amf_status_change_subscription_data_t *amf_status_change_subscription_data_local_var = NULL;
cJSON *amf_status_uri = cJSON_GetObjectItemCaseSensitive(amf_status_change_subscription_dataJSON, "amfStatusUri");
OpenAPI_lnode_t *node = NULL;
cJSON *amf_status_uri = NULL;
cJSON *guami_list = NULL;
OpenAPI_list_t *guami_listList = NULL;
amf_status_uri = cJSON_GetObjectItemCaseSensitive(amf_status_change_subscription_dataJSON, "amfStatusUri");
if (!amf_status_uri) {
ogs_error("OpenAPI_amf_status_change_subscription_data_parseFromJSON() failed [amf_status_uri]");
goto end;
}
if (!cJSON_IsString(amf_status_uri)) {
ogs_error("OpenAPI_amf_status_change_subscription_data_parseFromJSON() failed [amf_status_uri]");
goto end;
}
cJSON *guami_list = cJSON_GetObjectItemCaseSensitive(amf_status_change_subscription_dataJSON, "guamiList");
OpenAPI_list_t *guami_listList;
guami_list = cJSON_GetObjectItemCaseSensitive(amf_status_change_subscription_dataJSON, "guamiList");
if (guami_list) {
cJSON *guami_list_local_nonprimitive;
if (!cJSON_IsArray(guami_list)){
ogs_error("OpenAPI_amf_status_change_subscription_data_parseFromJSON() failed [guami_list]");
goto end;
}
guami_listList = OpenAPI_list_create();
cJSON_ArrayForEach(guami_list_local_nonprimitive, guami_list ) {
if (!cJSON_IsObject(guami_list_local_nonprimitive)) {
cJSON *guami_list_local = NULL;
if (!cJSON_IsArray(guami_list)) {
ogs_error("OpenAPI_amf_status_change_subscription_data_parseFromJSON() failed [guami_list]");
goto end;
}
OpenAPI_guami_t *guami_listItem = OpenAPI_guami_parseFromJSON(guami_list_local_nonprimitive);
if (!guami_listItem) {
ogs_error("No guami_listItem");
OpenAPI_list_free(guami_listList);
goto end;
guami_listList = OpenAPI_list_create();
cJSON_ArrayForEach(guami_list_local, guami_list) {
if (!cJSON_IsObject(guami_list_local)) {
ogs_error("OpenAPI_amf_status_change_subscription_data_parseFromJSON() failed [guami_list]");
goto end;
}
OpenAPI_guami_t *guami_listItem = OpenAPI_guami_parseFromJSON(guami_list_local);
if (!guami_listItem) {
ogs_error("No guami_listItem");
OpenAPI_list_free(guami_listList);
goto end;
}
OpenAPI_list_add(guami_listList, guami_listItem);
}
OpenAPI_list_add(guami_listList, guami_listItem);
}
}
amf_status_change_subscription_data_local_var = OpenAPI_amf_status_change_subscription_data_create (
@ -121,6 +128,13 @@ OpenAPI_amf_status_change_subscription_data_t *OpenAPI_amf_status_change_subscri
return amf_status_change_subscription_data_local_var;
end:
if (guami_listList) {
OpenAPI_list_for_each(guami_listList, node) {
OpenAPI_guami_free(node->data);
}
OpenAPI_list_free(guami_listList);
guami_listList = NULL;
}
return NULL;
}

View File

@ -24,22 +24,33 @@ OpenAPI_amf_status_info_t *OpenAPI_amf_status_info_create(
void OpenAPI_amf_status_info_free(OpenAPI_amf_status_info_t *amf_status_info)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == amf_status_info) {
return;
}
OpenAPI_lnode_t *node;
OpenAPI_list_for_each(amf_status_info->guami_list, node) {
OpenAPI_guami_free(node->data);
if (amf_status_info->guami_list) {
OpenAPI_list_for_each(amf_status_info->guami_list, node) {
OpenAPI_guami_free(node->data);
}
OpenAPI_list_free(amf_status_info->guami_list);
amf_status_info->guami_list = NULL;
}
if (amf_status_info->target_amf_removal) {
ogs_free(amf_status_info->target_amf_removal);
amf_status_info->target_amf_removal = NULL;
}
if (amf_status_info->target_amf_failure) {
ogs_free(amf_status_info->target_amf_failure);
amf_status_info->target_amf_failure = NULL;
}
OpenAPI_list_free(amf_status_info->guami_list);
ogs_free(amf_status_info->target_amf_removal);
ogs_free(amf_status_info->target_amf_failure);
ogs_free(amf_status_info);
}
cJSON *OpenAPI_amf_status_info_convertToJSON(OpenAPI_amf_status_info_t *amf_status_info)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (amf_status_info == NULL) {
ogs_error("OpenAPI_amf_status_info_convertToJSON() failed [AmfStatusInfo]");
@ -47,24 +58,28 @@ cJSON *OpenAPI_amf_status_info_convertToJSON(OpenAPI_amf_status_info_t *amf_stat
}
item = cJSON_CreateObject();
if (!amf_status_info->guami_list) {
ogs_error("OpenAPI_amf_status_info_convertToJSON() failed [guami_list]");
return NULL;
}
cJSON *guami_listList = cJSON_AddArrayToObject(item, "guamiList");
if (guami_listList == NULL) {
ogs_error("OpenAPI_amf_status_info_convertToJSON() failed [guami_list]");
goto end;
}
OpenAPI_lnode_t *guami_list_node;
if (amf_status_info->guami_list) {
OpenAPI_list_for_each(amf_status_info->guami_list, guami_list_node) {
cJSON *itemLocal = OpenAPI_guami_convertToJSON(guami_list_node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_amf_status_info_convertToJSON() failed [guami_list]");
goto end;
}
cJSON_AddItemToArray(guami_listList, itemLocal);
OpenAPI_list_for_each(amf_status_info->guami_list, node) {
cJSON *itemLocal = OpenAPI_guami_convertToJSON(node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_amf_status_info_convertToJSON() failed [guami_list]");
goto end;
}
cJSON_AddItemToArray(guami_listList, itemLocal);
}
if (amf_status_info->status_change == OpenAPI_status_change_NULL) {
ogs_error("OpenAPI_amf_status_info_convertToJSON() failed [status_change]");
return NULL;
}
if (cJSON_AddStringToObject(item, "statusChange", OpenAPI_status_change_ToString(amf_status_info->status_change)) == NULL) {
ogs_error("OpenAPI_amf_status_info_convertToJSON() failed [status_change]");
goto end;
@ -91,63 +106,62 @@ end:
OpenAPI_amf_status_info_t *OpenAPI_amf_status_info_parseFromJSON(cJSON *amf_status_infoJSON)
{
OpenAPI_amf_status_info_t *amf_status_info_local_var = NULL;
cJSON *guami_list = cJSON_GetObjectItemCaseSensitive(amf_status_infoJSON, "guamiList");
OpenAPI_lnode_t *node = NULL;
cJSON *guami_list = NULL;
OpenAPI_list_t *guami_listList = NULL;
cJSON *status_change = NULL;
OpenAPI_status_change_e status_changeVariable = 0;
cJSON *target_amf_removal = NULL;
cJSON *target_amf_failure = NULL;
guami_list = cJSON_GetObjectItemCaseSensitive(amf_status_infoJSON, "guamiList");
if (!guami_list) {
ogs_error("OpenAPI_amf_status_info_parseFromJSON() failed [guami_list]");
goto end;
}
OpenAPI_list_t *guami_listList;
cJSON *guami_list_local_nonprimitive;
if (!cJSON_IsArray(guami_list)){
ogs_error("OpenAPI_amf_status_info_parseFromJSON() failed [guami_list]");
goto end;
}
guami_listList = OpenAPI_list_create();
cJSON_ArrayForEach(guami_list_local_nonprimitive, guami_list ) {
if (!cJSON_IsObject(guami_list_local_nonprimitive)) {
cJSON *guami_list_local = NULL;
if (!cJSON_IsArray(guami_list)) {
ogs_error("OpenAPI_amf_status_info_parseFromJSON() failed [guami_list]");
goto end;
}
OpenAPI_guami_t *guami_listItem = OpenAPI_guami_parseFromJSON(guami_list_local_nonprimitive);
if (!guami_listItem) {
ogs_error("No guami_listItem");
OpenAPI_list_free(guami_listList);
goto end;
guami_listList = OpenAPI_list_create();
cJSON_ArrayForEach(guami_list_local, guami_list) {
if (!cJSON_IsObject(guami_list_local)) {
ogs_error("OpenAPI_amf_status_info_parseFromJSON() failed [guami_list]");
goto end;
}
OpenAPI_guami_t *guami_listItem = OpenAPI_guami_parseFromJSON(guami_list_local);
if (!guami_listItem) {
ogs_error("No guami_listItem");
OpenAPI_list_free(guami_listList);
goto end;
}
OpenAPI_list_add(guami_listList, guami_listItem);
}
OpenAPI_list_add(guami_listList, guami_listItem);
}
cJSON *status_change = cJSON_GetObjectItemCaseSensitive(amf_status_infoJSON, "statusChange");
status_change = cJSON_GetObjectItemCaseSensitive(amf_status_infoJSON, "statusChange");
if (!status_change) {
ogs_error("OpenAPI_amf_status_info_parseFromJSON() failed [status_change]");
goto end;
}
OpenAPI_status_change_e status_changeVariable;
if (!cJSON_IsString(status_change)) {
ogs_error("OpenAPI_amf_status_info_parseFromJSON() failed [status_change]");
goto end;
}
status_changeVariable = OpenAPI_status_change_FromString(status_change->valuestring);
cJSON *target_amf_removal = cJSON_GetObjectItemCaseSensitive(amf_status_infoJSON, "targetAmfRemoval");
target_amf_removal = cJSON_GetObjectItemCaseSensitive(amf_status_infoJSON, "targetAmfRemoval");
if (target_amf_removal) {
if (!cJSON_IsString(target_amf_removal)) {
if (!cJSON_IsString(target_amf_removal) && !cJSON_IsNull(target_amf_removal)) {
ogs_error("OpenAPI_amf_status_info_parseFromJSON() failed [target_amf_removal]");
goto end;
}
}
cJSON *target_amf_failure = cJSON_GetObjectItemCaseSensitive(amf_status_infoJSON, "targetAmfFailure");
target_amf_failure = cJSON_GetObjectItemCaseSensitive(amf_status_infoJSON, "targetAmfFailure");
if (target_amf_failure) {
if (!cJSON_IsString(target_amf_failure)) {
if (!cJSON_IsString(target_amf_failure) && !cJSON_IsNull(target_amf_failure)) {
ogs_error("OpenAPI_amf_status_info_parseFromJSON() failed [target_amf_failure]");
goto end;
}
@ -156,12 +170,19 @@ OpenAPI_amf_status_info_t *OpenAPI_amf_status_info_parseFromJSON(cJSON *amf_stat
amf_status_info_local_var = OpenAPI_amf_status_info_create (
guami_listList,
status_changeVariable,
target_amf_removal ? ogs_strdup(target_amf_removal->valuestring) : NULL,
target_amf_failure ? ogs_strdup(target_amf_failure->valuestring) : NULL
target_amf_removal && !cJSON_IsNull(target_amf_removal) ? ogs_strdup(target_amf_removal->valuestring) : NULL,
target_amf_failure && !cJSON_IsNull(target_amf_failure) ? ogs_strdup(target_amf_failure->valuestring) : NULL
);
return amf_status_info_local_var;
end:
if (guami_listList) {
OpenAPI_list_for_each(guami_listList, node) {
OpenAPI_guami_free(node->data);
}
OpenAPI_list_free(guami_listList);
guami_listList = NULL;
}
return NULL;
}

View File

@ -22,19 +22,30 @@ OpenAPI_amf_subscription_info_t *OpenAPI_amf_subscription_info_create(
void OpenAPI_amf_subscription_info_free(OpenAPI_amf_subscription_info_t *amf_subscription_info)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == amf_subscription_info) {
return;
}
OpenAPI_lnode_t *node;
ogs_free(amf_subscription_info->amf_instance_id);
ogs_free(amf_subscription_info->subscription_id);
ogs_free(amf_subscription_info->subs_change_notify_correlation_id);
if (amf_subscription_info->amf_instance_id) {
ogs_free(amf_subscription_info->amf_instance_id);
amf_subscription_info->amf_instance_id = NULL;
}
if (amf_subscription_info->subscription_id) {
ogs_free(amf_subscription_info->subscription_id);
amf_subscription_info->subscription_id = NULL;
}
if (amf_subscription_info->subs_change_notify_correlation_id) {
ogs_free(amf_subscription_info->subs_change_notify_correlation_id);
amf_subscription_info->subs_change_notify_correlation_id = NULL;
}
ogs_free(amf_subscription_info);
}
cJSON *OpenAPI_amf_subscription_info_convertToJSON(OpenAPI_amf_subscription_info_t *amf_subscription_info)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (amf_subscription_info == NULL) {
ogs_error("OpenAPI_amf_subscription_info_convertToJSON() failed [AmfSubscriptionInfo]");
@ -42,11 +53,19 @@ cJSON *OpenAPI_amf_subscription_info_convertToJSON(OpenAPI_amf_subscription_info
}
item = cJSON_CreateObject();
if (!amf_subscription_info->amf_instance_id) {
ogs_error("OpenAPI_amf_subscription_info_convertToJSON() failed [amf_instance_id]");
return NULL;
}
if (cJSON_AddStringToObject(item, "amfInstanceId", amf_subscription_info->amf_instance_id) == NULL) {
ogs_error("OpenAPI_amf_subscription_info_convertToJSON() failed [amf_instance_id]");
goto end;
}
if (!amf_subscription_info->subscription_id) {
ogs_error("OpenAPI_amf_subscription_info_convertToJSON() failed [subscription_id]");
return NULL;
}
if (cJSON_AddStringToObject(item, "subscriptionId", amf_subscription_info->subscription_id) == NULL) {
ogs_error("OpenAPI_amf_subscription_info_convertToJSON() failed [subscription_id]");
goto end;
@ -66,32 +85,33 @@ end:
OpenAPI_amf_subscription_info_t *OpenAPI_amf_subscription_info_parseFromJSON(cJSON *amf_subscription_infoJSON)
{
OpenAPI_amf_subscription_info_t *amf_subscription_info_local_var = NULL;
cJSON *amf_instance_id = cJSON_GetObjectItemCaseSensitive(amf_subscription_infoJSON, "amfInstanceId");
OpenAPI_lnode_t *node = NULL;
cJSON *amf_instance_id = NULL;
cJSON *subscription_id = NULL;
cJSON *subs_change_notify_correlation_id = NULL;
amf_instance_id = cJSON_GetObjectItemCaseSensitive(amf_subscription_infoJSON, "amfInstanceId");
if (!amf_instance_id) {
ogs_error("OpenAPI_amf_subscription_info_parseFromJSON() failed [amf_instance_id]");
goto end;
}
if (!cJSON_IsString(amf_instance_id)) {
ogs_error("OpenAPI_amf_subscription_info_parseFromJSON() failed [amf_instance_id]");
goto end;
}
cJSON *subscription_id = cJSON_GetObjectItemCaseSensitive(amf_subscription_infoJSON, "subscriptionId");
subscription_id = cJSON_GetObjectItemCaseSensitive(amf_subscription_infoJSON, "subscriptionId");
if (!subscription_id) {
ogs_error("OpenAPI_amf_subscription_info_parseFromJSON() failed [subscription_id]");
goto end;
}
if (!cJSON_IsString(subscription_id)) {
ogs_error("OpenAPI_amf_subscription_info_parseFromJSON() failed [subscription_id]");
goto end;
}
cJSON *subs_change_notify_correlation_id = cJSON_GetObjectItemCaseSensitive(amf_subscription_infoJSON, "subsChangeNotifyCorrelationId");
subs_change_notify_correlation_id = cJSON_GetObjectItemCaseSensitive(amf_subscription_infoJSON, "subsChangeNotifyCorrelationId");
if (subs_change_notify_correlation_id) {
if (!cJSON_IsString(subs_change_notify_correlation_id)) {
if (!cJSON_IsString(subs_change_notify_correlation_id) && !cJSON_IsNull(subs_change_notify_correlation_id)) {
ogs_error("OpenAPI_amf_subscription_info_parseFromJSON() failed [subs_change_notify_correlation_id]");
goto end;
}
@ -100,7 +120,7 @@ OpenAPI_amf_subscription_info_t *OpenAPI_amf_subscription_info_parseFromJSON(cJS
amf_subscription_info_local_var = OpenAPI_amf_subscription_info_create (
ogs_strdup(amf_instance_id->valuestring),
ogs_strdup(subscription_id->valuestring),
subs_change_notify_correlation_id ? ogs_strdup(subs_change_notify_correlation_id->valuestring) : NULL
subs_change_notify_correlation_id && !cJSON_IsNull(subs_change_notify_correlation_id) ? ogs_strdup(subs_change_notify_correlation_id->valuestring) : NULL
);
return amf_subscription_info_local_var;

View File

@ -20,18 +20,26 @@ OpenAPI_an_gw_address_t *OpenAPI_an_gw_address_create(
void OpenAPI_an_gw_address_free(OpenAPI_an_gw_address_t *an_gw_address)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == an_gw_address) {
return;
}
OpenAPI_lnode_t *node;
ogs_free(an_gw_address->an_gw_ipv4_addr);
ogs_free(an_gw_address->an_gw_ipv6_addr);
if (an_gw_address->an_gw_ipv4_addr) {
ogs_free(an_gw_address->an_gw_ipv4_addr);
an_gw_address->an_gw_ipv4_addr = NULL;
}
if (an_gw_address->an_gw_ipv6_addr) {
ogs_free(an_gw_address->an_gw_ipv6_addr);
an_gw_address->an_gw_ipv6_addr = NULL;
}
ogs_free(an_gw_address);
}
cJSON *OpenAPI_an_gw_address_convertToJSON(OpenAPI_an_gw_address_t *an_gw_address)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (an_gw_address == NULL) {
ogs_error("OpenAPI_an_gw_address_convertToJSON() failed [AnGwAddress]");
@ -60,27 +68,28 @@ end:
OpenAPI_an_gw_address_t *OpenAPI_an_gw_address_parseFromJSON(cJSON *an_gw_addressJSON)
{
OpenAPI_an_gw_address_t *an_gw_address_local_var = NULL;
cJSON *an_gw_ipv4_addr = cJSON_GetObjectItemCaseSensitive(an_gw_addressJSON, "anGwIpv4Addr");
OpenAPI_lnode_t *node = NULL;
cJSON *an_gw_ipv4_addr = NULL;
cJSON *an_gw_ipv6_addr = NULL;
an_gw_ipv4_addr = cJSON_GetObjectItemCaseSensitive(an_gw_addressJSON, "anGwIpv4Addr");
if (an_gw_ipv4_addr) {
if (!cJSON_IsString(an_gw_ipv4_addr)) {
if (!cJSON_IsString(an_gw_ipv4_addr) && !cJSON_IsNull(an_gw_ipv4_addr)) {
ogs_error("OpenAPI_an_gw_address_parseFromJSON() failed [an_gw_ipv4_addr]");
goto end;
}
}
cJSON *an_gw_ipv6_addr = cJSON_GetObjectItemCaseSensitive(an_gw_addressJSON, "anGwIpv6Addr");
an_gw_ipv6_addr = cJSON_GetObjectItemCaseSensitive(an_gw_addressJSON, "anGwIpv6Addr");
if (an_gw_ipv6_addr) {
if (!cJSON_IsString(an_gw_ipv6_addr)) {
if (!cJSON_IsString(an_gw_ipv6_addr) && !cJSON_IsNull(an_gw_ipv6_addr)) {
ogs_error("OpenAPI_an_gw_address_parseFromJSON() failed [an_gw_ipv6_addr]");
goto end;
}
}
an_gw_address_local_var = OpenAPI_an_gw_address_create (
an_gw_ipv4_addr ? ogs_strdup(an_gw_ipv4_addr->valuestring) : NULL,
an_gw_ipv6_addr ? ogs_strdup(an_gw_ipv6_addr->valuestring) : NULL
an_gw_ipv4_addr && !cJSON_IsNull(an_gw_ipv4_addr) ? ogs_strdup(an_gw_ipv4_addr->valuestring) : NULL,
an_gw_ipv6_addr && !cJSON_IsNull(an_gw_ipv6_addr) ? ogs_strdup(an_gw_ipv6_addr->valuestring) : NULL
);
return an_gw_address_local_var;

View File

@ -34,17 +34,22 @@ OpenAPI_apn_rate_status_t *OpenAPI_apn_rate_status_create(
void OpenAPI_apn_rate_status_free(OpenAPI_apn_rate_status_t *apn_rate_status)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == apn_rate_status) {
return;
}
OpenAPI_lnode_t *node;
ogs_free(apn_rate_status->validity_time);
if (apn_rate_status->validity_time) {
ogs_free(apn_rate_status->validity_time);
apn_rate_status->validity_time = NULL;
}
ogs_free(apn_rate_status);
}
cJSON *OpenAPI_apn_rate_status_convertToJSON(OpenAPI_apn_rate_status_t *apn_rate_status)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (apn_rate_status == NULL) {
ogs_error("OpenAPI_apn_rate_status_convertToJSON() failed [ApnRateStatus]");
@ -94,8 +99,13 @@ end:
OpenAPI_apn_rate_status_t *OpenAPI_apn_rate_status_parseFromJSON(cJSON *apn_rate_statusJSON)
{
OpenAPI_apn_rate_status_t *apn_rate_status_local_var = NULL;
cJSON *remain_packets_ul = cJSON_GetObjectItemCaseSensitive(apn_rate_statusJSON, "remainPacketsUl");
OpenAPI_lnode_t *node = NULL;
cJSON *remain_packets_ul = NULL;
cJSON *remain_packets_dl = NULL;
cJSON *validity_time = NULL;
cJSON *remain_ex_reports_ul = NULL;
cJSON *remain_ex_reports_dl = NULL;
remain_packets_ul = cJSON_GetObjectItemCaseSensitive(apn_rate_statusJSON, "remainPacketsUl");
if (remain_packets_ul) {
if (!cJSON_IsNumber(remain_packets_ul)) {
ogs_error("OpenAPI_apn_rate_status_parseFromJSON() failed [remain_packets_ul]");
@ -103,8 +113,7 @@ OpenAPI_apn_rate_status_t *OpenAPI_apn_rate_status_parseFromJSON(cJSON *apn_rate
}
}
cJSON *remain_packets_dl = cJSON_GetObjectItemCaseSensitive(apn_rate_statusJSON, "remainPacketsDl");
remain_packets_dl = cJSON_GetObjectItemCaseSensitive(apn_rate_statusJSON, "remainPacketsDl");
if (remain_packets_dl) {
if (!cJSON_IsNumber(remain_packets_dl)) {
ogs_error("OpenAPI_apn_rate_status_parseFromJSON() failed [remain_packets_dl]");
@ -112,17 +121,15 @@ OpenAPI_apn_rate_status_t *OpenAPI_apn_rate_status_parseFromJSON(cJSON *apn_rate
}
}
cJSON *validity_time = cJSON_GetObjectItemCaseSensitive(apn_rate_statusJSON, "validityTime");
validity_time = cJSON_GetObjectItemCaseSensitive(apn_rate_statusJSON, "validityTime");
if (validity_time) {
if (!cJSON_IsString(validity_time)) {
if (!cJSON_IsString(validity_time) && !cJSON_IsNull(validity_time)) {
ogs_error("OpenAPI_apn_rate_status_parseFromJSON() failed [validity_time]");
goto end;
}
}
cJSON *remain_ex_reports_ul = cJSON_GetObjectItemCaseSensitive(apn_rate_statusJSON, "remainExReportsUl");
remain_ex_reports_ul = cJSON_GetObjectItemCaseSensitive(apn_rate_statusJSON, "remainExReportsUl");
if (remain_ex_reports_ul) {
if (!cJSON_IsNumber(remain_ex_reports_ul)) {
ogs_error("OpenAPI_apn_rate_status_parseFromJSON() failed [remain_ex_reports_ul]");
@ -130,8 +137,7 @@ OpenAPI_apn_rate_status_t *OpenAPI_apn_rate_status_parseFromJSON(cJSON *apn_rate
}
}
cJSON *remain_ex_reports_dl = cJSON_GetObjectItemCaseSensitive(apn_rate_statusJSON, "remainExReportsDl");
remain_ex_reports_dl = cJSON_GetObjectItemCaseSensitive(apn_rate_statusJSON, "remainExReportsDl");
if (remain_ex_reports_dl) {
if (!cJSON_IsNumber(remain_ex_reports_dl)) {
ogs_error("OpenAPI_apn_rate_status_parseFromJSON() failed [remain_ex_reports_dl]");
@ -144,7 +150,7 @@ OpenAPI_apn_rate_status_t *OpenAPI_apn_rate_status_parseFromJSON(cJSON *apn_rate
remain_packets_ul ? remain_packets_ul->valuedouble : 0,
remain_packets_dl ? true : false,
remain_packets_dl ? remain_packets_dl->valuedouble : 0,
validity_time ? ogs_strdup(validity_time->valuestring) : NULL,
validity_time && !cJSON_IsNull(validity_time) ? ogs_strdup(validity_time->valuestring) : NULL,
remain_ex_reports_ul ? true : false,
remain_ex_reports_ul ? remain_ex_reports_ul->valuedouble : 0,
remain_ex_reports_dl ? true : false,

View File

@ -20,18 +20,26 @@ OpenAPI_app_descriptor_t *OpenAPI_app_descriptor_create(
void OpenAPI_app_descriptor_free(OpenAPI_app_descriptor_t *app_descriptor)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == app_descriptor) {
return;
}
OpenAPI_lnode_t *node;
ogs_free(app_descriptor->os_id);
ogs_free(app_descriptor->app_id);
if (app_descriptor->os_id) {
ogs_free(app_descriptor->os_id);
app_descriptor->os_id = NULL;
}
if (app_descriptor->app_id) {
ogs_free(app_descriptor->app_id);
app_descriptor->app_id = NULL;
}
ogs_free(app_descriptor);
}
cJSON *OpenAPI_app_descriptor_convertToJSON(OpenAPI_app_descriptor_t *app_descriptor)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (app_descriptor == NULL) {
ogs_error("OpenAPI_app_descriptor_convertToJSON() failed [AppDescriptor]");
@ -60,27 +68,28 @@ end:
OpenAPI_app_descriptor_t *OpenAPI_app_descriptor_parseFromJSON(cJSON *app_descriptorJSON)
{
OpenAPI_app_descriptor_t *app_descriptor_local_var = NULL;
cJSON *os_id = cJSON_GetObjectItemCaseSensitive(app_descriptorJSON, "osId");
OpenAPI_lnode_t *node = NULL;
cJSON *os_id = NULL;
cJSON *app_id = NULL;
os_id = cJSON_GetObjectItemCaseSensitive(app_descriptorJSON, "osId");
if (os_id) {
if (!cJSON_IsString(os_id)) {
if (!cJSON_IsString(os_id) && !cJSON_IsNull(os_id)) {
ogs_error("OpenAPI_app_descriptor_parseFromJSON() failed [os_id]");
goto end;
}
}
cJSON *app_id = cJSON_GetObjectItemCaseSensitive(app_descriptorJSON, "appId");
app_id = cJSON_GetObjectItemCaseSensitive(app_descriptorJSON, "appId");
if (app_id) {
if (!cJSON_IsString(app_id)) {
if (!cJSON_IsString(app_id) && !cJSON_IsNull(app_id)) {
ogs_error("OpenAPI_app_descriptor_parseFromJSON() failed [app_id]");
goto end;
}
}
app_descriptor_local_var = OpenAPI_app_descriptor_create (
os_id ? ogs_strdup(os_id->valuestring) : NULL,
app_id ? ogs_strdup(app_id->valuestring) : NULL
os_id && !cJSON_IsNull(os_id) ? ogs_strdup(os_id->valuestring) : NULL,
app_id && !cJSON_IsNull(app_id) ? ogs_strdup(app_id->valuestring) : NULL
);
return app_descriptor_local_var;

View File

@ -22,22 +22,33 @@ OpenAPI_app_detection_info_t *OpenAPI_app_detection_info_create(
void OpenAPI_app_detection_info_free(OpenAPI_app_detection_info_t *app_detection_info)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == app_detection_info) {
return;
}
OpenAPI_lnode_t *node;
ogs_free(app_detection_info->app_id);
ogs_free(app_detection_info->instance_id);
OpenAPI_list_for_each(app_detection_info->sdf_descriptions, node) {
OpenAPI_flow_information_free(node->data);
if (app_detection_info->app_id) {
ogs_free(app_detection_info->app_id);
app_detection_info->app_id = NULL;
}
if (app_detection_info->instance_id) {
ogs_free(app_detection_info->instance_id);
app_detection_info->instance_id = NULL;
}
if (app_detection_info->sdf_descriptions) {
OpenAPI_list_for_each(app_detection_info->sdf_descriptions, node) {
OpenAPI_flow_information_free(node->data);
}
OpenAPI_list_free(app_detection_info->sdf_descriptions);
app_detection_info->sdf_descriptions = NULL;
}
OpenAPI_list_free(app_detection_info->sdf_descriptions);
ogs_free(app_detection_info);
}
cJSON *OpenAPI_app_detection_info_convertToJSON(OpenAPI_app_detection_info_t *app_detection_info)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (app_detection_info == NULL) {
ogs_error("OpenAPI_app_detection_info_convertToJSON() failed [AppDetectionInfo]");
@ -45,6 +56,10 @@ cJSON *OpenAPI_app_detection_info_convertToJSON(OpenAPI_app_detection_info_t *ap
}
item = cJSON_CreateObject();
if (!app_detection_info->app_id) {
ogs_error("OpenAPI_app_detection_info_convertToJSON() failed [app_id]");
return NULL;
}
if (cJSON_AddStringToObject(item, "appId", app_detection_info->app_id) == NULL) {
ogs_error("OpenAPI_app_detection_info_convertToJSON() failed [app_id]");
goto end;
@ -63,17 +78,13 @@ cJSON *OpenAPI_app_detection_info_convertToJSON(OpenAPI_app_detection_info_t *ap
ogs_error("OpenAPI_app_detection_info_convertToJSON() failed [sdf_descriptions]");
goto end;
}
OpenAPI_lnode_t *sdf_descriptions_node;
if (app_detection_info->sdf_descriptions) {
OpenAPI_list_for_each(app_detection_info->sdf_descriptions, sdf_descriptions_node) {
cJSON *itemLocal = OpenAPI_flow_information_convertToJSON(sdf_descriptions_node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_app_detection_info_convertToJSON() failed [sdf_descriptions]");
goto end;
}
cJSON_AddItemToArray(sdf_descriptionsList, itemLocal);
OpenAPI_list_for_each(app_detection_info->sdf_descriptions, node) {
cJSON *itemLocal = OpenAPI_flow_information_convertToJSON(node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_app_detection_info_convertToJSON() failed [sdf_descriptions]");
goto end;
}
cJSON_AddItemToArray(sdf_descriptionsList, itemLocal);
}
}
@ -84,63 +95,69 @@ end:
OpenAPI_app_detection_info_t *OpenAPI_app_detection_info_parseFromJSON(cJSON *app_detection_infoJSON)
{
OpenAPI_app_detection_info_t *app_detection_info_local_var = NULL;
cJSON *app_id = cJSON_GetObjectItemCaseSensitive(app_detection_infoJSON, "appId");
OpenAPI_lnode_t *node = NULL;
cJSON *app_id = NULL;
cJSON *instance_id = NULL;
cJSON *sdf_descriptions = NULL;
OpenAPI_list_t *sdf_descriptionsList = NULL;
app_id = cJSON_GetObjectItemCaseSensitive(app_detection_infoJSON, "appId");
if (!app_id) {
ogs_error("OpenAPI_app_detection_info_parseFromJSON() failed [app_id]");
goto end;
}
if (!cJSON_IsString(app_id)) {
ogs_error("OpenAPI_app_detection_info_parseFromJSON() failed [app_id]");
goto end;
}
cJSON *instance_id = cJSON_GetObjectItemCaseSensitive(app_detection_infoJSON, "instanceId");
instance_id = cJSON_GetObjectItemCaseSensitive(app_detection_infoJSON, "instanceId");
if (instance_id) {
if (!cJSON_IsString(instance_id)) {
if (!cJSON_IsString(instance_id) && !cJSON_IsNull(instance_id)) {
ogs_error("OpenAPI_app_detection_info_parseFromJSON() failed [instance_id]");
goto end;
}
}
cJSON *sdf_descriptions = cJSON_GetObjectItemCaseSensitive(app_detection_infoJSON, "sdfDescriptions");
OpenAPI_list_t *sdf_descriptionsList;
sdf_descriptions = cJSON_GetObjectItemCaseSensitive(app_detection_infoJSON, "sdfDescriptions");
if (sdf_descriptions) {
cJSON *sdf_descriptions_local_nonprimitive;
if (!cJSON_IsArray(sdf_descriptions)){
ogs_error("OpenAPI_app_detection_info_parseFromJSON() failed [sdf_descriptions]");
goto end;
}
sdf_descriptionsList = OpenAPI_list_create();
cJSON_ArrayForEach(sdf_descriptions_local_nonprimitive, sdf_descriptions ) {
if (!cJSON_IsObject(sdf_descriptions_local_nonprimitive)) {
cJSON *sdf_descriptions_local = NULL;
if (!cJSON_IsArray(sdf_descriptions)) {
ogs_error("OpenAPI_app_detection_info_parseFromJSON() failed [sdf_descriptions]");
goto end;
}
OpenAPI_flow_information_t *sdf_descriptionsItem = OpenAPI_flow_information_parseFromJSON(sdf_descriptions_local_nonprimitive);
if (!sdf_descriptionsItem) {
ogs_error("No sdf_descriptionsItem");
OpenAPI_list_free(sdf_descriptionsList);
goto end;
sdf_descriptionsList = OpenAPI_list_create();
cJSON_ArrayForEach(sdf_descriptions_local, sdf_descriptions) {
if (!cJSON_IsObject(sdf_descriptions_local)) {
ogs_error("OpenAPI_app_detection_info_parseFromJSON() failed [sdf_descriptions]");
goto end;
}
OpenAPI_flow_information_t *sdf_descriptionsItem = OpenAPI_flow_information_parseFromJSON(sdf_descriptions_local);
if (!sdf_descriptionsItem) {
ogs_error("No sdf_descriptionsItem");
OpenAPI_list_free(sdf_descriptionsList);
goto end;
}
OpenAPI_list_add(sdf_descriptionsList, sdf_descriptionsItem);
}
OpenAPI_list_add(sdf_descriptionsList, sdf_descriptionsItem);
}
}
app_detection_info_local_var = OpenAPI_app_detection_info_create (
ogs_strdup(app_id->valuestring),
instance_id ? ogs_strdup(instance_id->valuestring) : NULL,
instance_id && !cJSON_IsNull(instance_id) ? ogs_strdup(instance_id->valuestring) : NULL,
sdf_descriptions ? sdf_descriptionsList : NULL
);
return app_detection_info_local_var;
end:
if (sdf_descriptionsList) {
OpenAPI_list_for_each(sdf_descriptionsList, node) {
OpenAPI_flow_information_free(node->data);
}
OpenAPI_list_free(sdf_descriptionsList);
sdf_descriptionsList = NULL;
}
return NULL;
}

View File

@ -24,16 +24,18 @@ OpenAPI_app_port_id_t *OpenAPI_app_port_id_create(
void OpenAPI_app_port_id_free(OpenAPI_app_port_id_t *app_port_id)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == app_port_id) {
return;
}
OpenAPI_lnode_t *node;
ogs_free(app_port_id);
}
cJSON *OpenAPI_app_port_id_convertToJSON(OpenAPI_app_port_id_t *app_port_id)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (app_port_id == NULL) {
ogs_error("OpenAPI_app_port_id_convertToJSON() failed [AppPortId]");
@ -62,8 +64,10 @@ end:
OpenAPI_app_port_id_t *OpenAPI_app_port_id_parseFromJSON(cJSON *app_port_idJSON)
{
OpenAPI_app_port_id_t *app_port_id_local_var = NULL;
cJSON *destination_port = cJSON_GetObjectItemCaseSensitive(app_port_idJSON, "destinationPort");
OpenAPI_lnode_t *node = NULL;
cJSON *destination_port = NULL;
cJSON *originator_port = NULL;
destination_port = cJSON_GetObjectItemCaseSensitive(app_port_idJSON, "destinationPort");
if (destination_port) {
if (!cJSON_IsNumber(destination_port)) {
ogs_error("OpenAPI_app_port_id_parseFromJSON() failed [destination_port]");
@ -71,8 +75,7 @@ OpenAPI_app_port_id_t *OpenAPI_app_port_id_parseFromJSON(cJSON *app_port_idJSON)
}
}
cJSON *originator_port = cJSON_GetObjectItemCaseSensitive(app_port_idJSON, "originatorPort");
originator_port = cJSON_GetObjectItemCaseSensitive(app_port_idJSON, "originatorPort");
if (originator_port) {
if (!cJSON_IsNumber(originator_port)) {
ogs_error("OpenAPI_app_port_id_parseFromJSON() failed [originator_port]");

View File

@ -22,19 +22,30 @@ OpenAPI_app_session_context_t *OpenAPI_app_session_context_create(
void OpenAPI_app_session_context_free(OpenAPI_app_session_context_t *app_session_context)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == app_session_context) {
return;
}
OpenAPI_lnode_t *node;
OpenAPI_app_session_context_req_data_free(app_session_context->asc_req_data);
OpenAPI_app_session_context_resp_data_free(app_session_context->asc_resp_data);
OpenAPI_events_notification_free(app_session_context->evs_notif);
if (app_session_context->asc_req_data) {
OpenAPI_app_session_context_req_data_free(app_session_context->asc_req_data);
app_session_context->asc_req_data = NULL;
}
if (app_session_context->asc_resp_data) {
OpenAPI_app_session_context_resp_data_free(app_session_context->asc_resp_data);
app_session_context->asc_resp_data = NULL;
}
if (app_session_context->evs_notif) {
OpenAPI_events_notification_free(app_session_context->evs_notif);
app_session_context->evs_notif = NULL;
}
ogs_free(app_session_context);
}
cJSON *OpenAPI_app_session_context_convertToJSON(OpenAPI_app_session_context_t *app_session_context)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (app_session_context == NULL) {
ogs_error("OpenAPI_app_session_context_convertToJSON() failed [AppSessionContext]");
@ -88,23 +99,24 @@ end:
OpenAPI_app_session_context_t *OpenAPI_app_session_context_parseFromJSON(cJSON *app_session_contextJSON)
{
OpenAPI_app_session_context_t *app_session_context_local_var = NULL;
cJSON *asc_req_data = cJSON_GetObjectItemCaseSensitive(app_session_contextJSON, "ascReqData");
OpenAPI_lnode_t *node = NULL;
cJSON *asc_req_data = NULL;
OpenAPI_app_session_context_req_data_t *asc_req_data_local_nonprim = NULL;
cJSON *asc_resp_data = NULL;
OpenAPI_app_session_context_resp_data_t *asc_resp_data_local_nonprim = NULL;
cJSON *evs_notif = NULL;
OpenAPI_events_notification_t *evs_notif_local_nonprim = NULL;
asc_req_data = cJSON_GetObjectItemCaseSensitive(app_session_contextJSON, "ascReqData");
if (asc_req_data) {
asc_req_data_local_nonprim = OpenAPI_app_session_context_req_data_parseFromJSON(asc_req_data);
}
cJSON *asc_resp_data = cJSON_GetObjectItemCaseSensitive(app_session_contextJSON, "ascRespData");
OpenAPI_app_session_context_resp_data_t *asc_resp_data_local_nonprim = NULL;
asc_resp_data = cJSON_GetObjectItemCaseSensitive(app_session_contextJSON, "ascRespData");
if (asc_resp_data) {
asc_resp_data_local_nonprim = OpenAPI_app_session_context_resp_data_parseFromJSON(asc_resp_data);
}
cJSON *evs_notif = cJSON_GetObjectItemCaseSensitive(app_session_contextJSON, "evsNotif");
OpenAPI_events_notification_t *evs_notif_local_nonprim = NULL;
evs_notif = cJSON_GetObjectItemCaseSensitive(app_session_contextJSON, "evsNotif");
if (evs_notif) {
evs_notif_local_nonprim = OpenAPI_events_notification_parseFromJSON(evs_notif);
}
@ -117,6 +129,18 @@ OpenAPI_app_session_context_t *OpenAPI_app_session_context_parseFromJSON(cJSON *
return app_session_context_local_var;
end:
if (asc_req_data_local_nonprim) {
OpenAPI_app_session_context_req_data_free(asc_req_data_local_nonprim);
asc_req_data_local_nonprim = NULL;
}
if (asc_resp_data_local_nonprim) {
OpenAPI_app_session_context_resp_data_free(asc_resp_data_local_nonprim);
asc_resp_data_local_nonprim = NULL;
}
if (evs_notif_local_nonprim) {
OpenAPI_events_notification_free(evs_notif_local_nonprim);
evs_notif_local_nonprim = NULL;
}
return NULL;
}

View File

@ -78,51 +78,131 @@ OpenAPI_app_session_context_req_data_t *OpenAPI_app_session_context_req_data_cre
void OpenAPI_app_session_context_req_data_free(OpenAPI_app_session_context_req_data_t *app_session_context_req_data)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == app_session_context_req_data) {
return;
}
OpenAPI_lnode_t *node;
ogs_free(app_session_context_req_data->af_app_id);
ogs_free(app_session_context_req_data->af_charg_id);
OpenAPI_af_routing_requirement_free(app_session_context_req_data->af_rout_req);
ogs_free(app_session_context_req_data->asp_id);
ogs_free(app_session_context_req_data->bdt_ref_id);
ogs_free(app_session_context_req_data->dnn);
OpenAPI_events_subsc_req_data_free(app_session_context_req_data->ev_subsc);
ogs_free(app_session_context_req_data->mcptt_id);
ogs_free(app_session_context_req_data->mc_video_id);
OpenAPI_list_for_each(app_session_context_req_data->med_components, node) {
OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data;
ogs_free(localKeyValue->key);
OpenAPI_media_component_free(localKeyValue->value);
ogs_free(localKeyValue);
if (app_session_context_req_data->af_app_id) {
ogs_free(app_session_context_req_data->af_app_id);
app_session_context_req_data->af_app_id = NULL;
}
OpenAPI_list_free(app_session_context_req_data->med_components);
ogs_free(app_session_context_req_data->ip_domain);
ogs_free(app_session_context_req_data->mps_id);
ogs_free(app_session_context_req_data->mcs_id);
ogs_free(app_session_context_req_data->notif_uri);
ogs_free(app_session_context_req_data->serv_urn);
OpenAPI_snssai_free(app_session_context_req_data->slice_info);
ogs_free(app_session_context_req_data->spon_id);
ogs_free(app_session_context_req_data->supi);
ogs_free(app_session_context_req_data->gpsi);
ogs_free(app_session_context_req_data->supp_feat);
ogs_free(app_session_context_req_data->ue_ipv4);
ogs_free(app_session_context_req_data->ue_ipv6);
ogs_free(app_session_context_req_data->ue_mac);
OpenAPI_bridge_management_container_free(app_session_context_req_data->tsn_bridge_man_cont);
OpenAPI_port_management_container_free(app_session_context_req_data->tsn_port_man_cont_dstt);
OpenAPI_list_for_each(app_session_context_req_data->tsn_port_man_cont_nwtts, node) {
OpenAPI_port_management_container_free(node->data);
if (app_session_context_req_data->af_charg_id) {
ogs_free(app_session_context_req_data->af_charg_id);
app_session_context_req_data->af_charg_id = NULL;
}
if (app_session_context_req_data->af_rout_req) {
OpenAPI_af_routing_requirement_free(app_session_context_req_data->af_rout_req);
app_session_context_req_data->af_rout_req = NULL;
}
if (app_session_context_req_data->asp_id) {
ogs_free(app_session_context_req_data->asp_id);
app_session_context_req_data->asp_id = NULL;
}
if (app_session_context_req_data->bdt_ref_id) {
ogs_free(app_session_context_req_data->bdt_ref_id);
app_session_context_req_data->bdt_ref_id = NULL;
}
if (app_session_context_req_data->dnn) {
ogs_free(app_session_context_req_data->dnn);
app_session_context_req_data->dnn = NULL;
}
if (app_session_context_req_data->ev_subsc) {
OpenAPI_events_subsc_req_data_free(app_session_context_req_data->ev_subsc);
app_session_context_req_data->ev_subsc = NULL;
}
if (app_session_context_req_data->mcptt_id) {
ogs_free(app_session_context_req_data->mcptt_id);
app_session_context_req_data->mcptt_id = NULL;
}
if (app_session_context_req_data->mc_video_id) {
ogs_free(app_session_context_req_data->mc_video_id);
app_session_context_req_data->mc_video_id = NULL;
}
if (app_session_context_req_data->med_components) {
OpenAPI_list_for_each(app_session_context_req_data->med_components, node) {
OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data;
ogs_free(localKeyValue->key);
OpenAPI_media_component_free(localKeyValue->value);
OpenAPI_map_free(localKeyValue);
}
OpenAPI_list_free(app_session_context_req_data->med_components);
app_session_context_req_data->med_components = NULL;
}
if (app_session_context_req_data->ip_domain) {
ogs_free(app_session_context_req_data->ip_domain);
app_session_context_req_data->ip_domain = NULL;
}
if (app_session_context_req_data->mps_id) {
ogs_free(app_session_context_req_data->mps_id);
app_session_context_req_data->mps_id = NULL;
}
if (app_session_context_req_data->mcs_id) {
ogs_free(app_session_context_req_data->mcs_id);
app_session_context_req_data->mcs_id = NULL;
}
if (app_session_context_req_data->notif_uri) {
ogs_free(app_session_context_req_data->notif_uri);
app_session_context_req_data->notif_uri = NULL;
}
if (app_session_context_req_data->serv_urn) {
ogs_free(app_session_context_req_data->serv_urn);
app_session_context_req_data->serv_urn = NULL;
}
if (app_session_context_req_data->slice_info) {
OpenAPI_snssai_free(app_session_context_req_data->slice_info);
app_session_context_req_data->slice_info = NULL;
}
if (app_session_context_req_data->spon_id) {
ogs_free(app_session_context_req_data->spon_id);
app_session_context_req_data->spon_id = NULL;
}
if (app_session_context_req_data->supi) {
ogs_free(app_session_context_req_data->supi);
app_session_context_req_data->supi = NULL;
}
if (app_session_context_req_data->gpsi) {
ogs_free(app_session_context_req_data->gpsi);
app_session_context_req_data->gpsi = NULL;
}
if (app_session_context_req_data->supp_feat) {
ogs_free(app_session_context_req_data->supp_feat);
app_session_context_req_data->supp_feat = NULL;
}
if (app_session_context_req_data->ue_ipv4) {
ogs_free(app_session_context_req_data->ue_ipv4);
app_session_context_req_data->ue_ipv4 = NULL;
}
if (app_session_context_req_data->ue_ipv6) {
ogs_free(app_session_context_req_data->ue_ipv6);
app_session_context_req_data->ue_ipv6 = NULL;
}
if (app_session_context_req_data->ue_mac) {
ogs_free(app_session_context_req_data->ue_mac);
app_session_context_req_data->ue_mac = NULL;
}
if (app_session_context_req_data->tsn_bridge_man_cont) {
OpenAPI_bridge_management_container_free(app_session_context_req_data->tsn_bridge_man_cont);
app_session_context_req_data->tsn_bridge_man_cont = NULL;
}
if (app_session_context_req_data->tsn_port_man_cont_dstt) {
OpenAPI_port_management_container_free(app_session_context_req_data->tsn_port_man_cont_dstt);
app_session_context_req_data->tsn_port_man_cont_dstt = NULL;
}
if (app_session_context_req_data->tsn_port_man_cont_nwtts) {
OpenAPI_list_for_each(app_session_context_req_data->tsn_port_man_cont_nwtts, node) {
OpenAPI_port_management_container_free(node->data);
}
OpenAPI_list_free(app_session_context_req_data->tsn_port_man_cont_nwtts);
app_session_context_req_data->tsn_port_man_cont_nwtts = NULL;
}
OpenAPI_list_free(app_session_context_req_data->tsn_port_man_cont_nwtts);
ogs_free(app_session_context_req_data);
}
cJSON *OpenAPI_app_session_context_req_data_convertToJSON(OpenAPI_app_session_context_req_data_t *app_session_context_req_data)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (app_session_context_req_data == NULL) {
ogs_error("OpenAPI_app_session_context_req_data_convertToJSON() failed [AppSessionContextReqData]");
@ -144,7 +224,7 @@ cJSON *OpenAPI_app_session_context_req_data_convertToJSON(OpenAPI_app_session_co
}
}
if (app_session_context_req_data->af_req_data) {
if (app_session_context_req_data->af_req_data != OpenAPI_af_requested_data_NULL) {
if (cJSON_AddStringToObject(item, "afReqData", OpenAPI_af_requested_data_ToString(app_session_context_req_data->af_req_data)) == NULL) {
ogs_error("OpenAPI_app_session_context_req_data_convertToJSON() failed [af_req_data]");
goto end;
@ -219,21 +299,20 @@ cJSON *OpenAPI_app_session_context_req_data_convertToJSON(OpenAPI_app_session_co
goto end;
}
cJSON *localMapObject = med_components;
OpenAPI_lnode_t *med_components_node;
if (app_session_context_req_data->med_components) {
OpenAPI_list_for_each(app_session_context_req_data->med_components, med_components_node) {
OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)med_components_node->data;
cJSON *itemLocal = localKeyValue->value ?
OpenAPI_media_component_convertToJSON(localKeyValue->value) :
cJSON_CreateNull();
if (itemLocal == NULL) {
ogs_error("OpenAPI_app_session_context_req_data_convertToJSON() failed [inner]");
goto end;
}
cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal);
OpenAPI_list_for_each(app_session_context_req_data->med_components, node) {
OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data;
cJSON *itemLocal = localKeyValue->value ?
OpenAPI_media_component_convertToJSON(localKeyValue->value) :
cJSON_CreateNull();
if (itemLocal == NULL) {
ogs_error("OpenAPI_app_session_context_req_data_convertToJSON() failed [inner]");
goto end;
}
cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal);
}
}
}
if (app_session_context_req_data->ip_domain) {
if (cJSON_AddStringToObject(item, "ipDomain", app_session_context_req_data->ip_domain) == NULL) {
@ -256,27 +335,31 @@ cJSON *OpenAPI_app_session_context_req_data_convertToJSON(OpenAPI_app_session_co
}
}
if (app_session_context_req_data->preempt_control_info) {
if (app_session_context_req_data->preempt_control_info != OpenAPI_preemption_control_information_NULL) {
if (cJSON_AddStringToObject(item, "preemptControlInfo", OpenAPI_preemption_control_information_ToString(app_session_context_req_data->preempt_control_info)) == NULL) {
ogs_error("OpenAPI_app_session_context_req_data_convertToJSON() failed [preempt_control_info]");
goto end;
}
}
if (app_session_context_req_data->res_prio) {
if (app_session_context_req_data->res_prio != OpenAPI_reserv_priority_NULL) {
if (cJSON_AddStringToObject(item, "resPrio", OpenAPI_reserv_priority_ToString(app_session_context_req_data->res_prio)) == NULL) {
ogs_error("OpenAPI_app_session_context_req_data_convertToJSON() failed [res_prio]");
goto end;
}
}
if (app_session_context_req_data->serv_inf_status) {
if (app_session_context_req_data->serv_inf_status != OpenAPI_service_info_status_NULL) {
if (cJSON_AddStringToObject(item, "servInfStatus", OpenAPI_service_info_status_ToString(app_session_context_req_data->serv_inf_status)) == NULL) {
ogs_error("OpenAPI_app_session_context_req_data_convertToJSON() failed [serv_inf_status]");
goto end;
}
}
if (!app_session_context_req_data->notif_uri) {
ogs_error("OpenAPI_app_session_context_req_data_convertToJSON() failed [notif_uri]");
return NULL;
}
if (cJSON_AddStringToObject(item, "notifUri", app_session_context_req_data->notif_uri) == NULL) {
ogs_error("OpenAPI_app_session_context_req_data_convertToJSON() failed [notif_uri]");
goto end;
@ -309,7 +392,7 @@ cJSON *OpenAPI_app_session_context_req_data_convertToJSON(OpenAPI_app_session_co
}
}
if (app_session_context_req_data->spon_status) {
if (app_session_context_req_data->spon_status != OpenAPI_sponsoring_status_NULL) {
if (cJSON_AddStringToObject(item, "sponStatus", OpenAPI_sponsoring_status_ToString(app_session_context_req_data->spon_status)) == NULL) {
ogs_error("OpenAPI_app_session_context_req_data_convertToJSON() failed [spon_status]");
goto end;
@ -330,6 +413,10 @@ cJSON *OpenAPI_app_session_context_req_data_convertToJSON(OpenAPI_app_session_co
}
}
if (!app_session_context_req_data->supp_feat) {
ogs_error("OpenAPI_app_session_context_req_data_convertToJSON() failed [supp_feat]");
return NULL;
}
if (cJSON_AddStringToObject(item, "suppFeat", app_session_context_req_data->supp_feat) == NULL) {
ogs_error("OpenAPI_app_session_context_req_data_convertToJSON() failed [supp_feat]");
goto end;
@ -388,17 +475,13 @@ cJSON *OpenAPI_app_session_context_req_data_convertToJSON(OpenAPI_app_session_co
ogs_error("OpenAPI_app_session_context_req_data_convertToJSON() failed [tsn_port_man_cont_nwtts]");
goto end;
}
OpenAPI_lnode_t *tsn_port_man_cont_nwtts_node;
if (app_session_context_req_data->tsn_port_man_cont_nwtts) {
OpenAPI_list_for_each(app_session_context_req_data->tsn_port_man_cont_nwtts, tsn_port_man_cont_nwtts_node) {
cJSON *itemLocal = OpenAPI_port_management_container_convertToJSON(tsn_port_man_cont_nwtts_node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_app_session_context_req_data_convertToJSON() failed [tsn_port_man_cont_nwtts]");
goto end;
}
cJSON_AddItemToArray(tsn_port_man_cont_nwttsList, itemLocal);
OpenAPI_list_for_each(app_session_context_req_data->tsn_port_man_cont_nwtts, node) {
cJSON *itemLocal = OpenAPI_port_management_container_convertToJSON(node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_app_session_context_req_data_convertToJSON() failed [tsn_port_man_cont_nwtts]");
goto end;
}
cJSON_AddItemToArray(tsn_port_man_cont_nwttsList, itemLocal);
}
}
@ -409,27 +492,67 @@ end:
OpenAPI_app_session_context_req_data_t *OpenAPI_app_session_context_req_data_parseFromJSON(cJSON *app_session_context_req_dataJSON)
{
OpenAPI_app_session_context_req_data_t *app_session_context_req_data_local_var = NULL;
cJSON *af_app_id = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "afAppId");
OpenAPI_lnode_t *node = NULL;
cJSON *af_app_id = NULL;
cJSON *af_charg_id = NULL;
cJSON *af_req_data = NULL;
OpenAPI_af_requested_data_e af_req_dataVariable = 0;
cJSON *af_rout_req = NULL;
OpenAPI_af_routing_requirement_t *af_rout_req_local_nonprim = NULL;
cJSON *asp_id = NULL;
cJSON *bdt_ref_id = NULL;
cJSON *dnn = NULL;
cJSON *ev_subsc = NULL;
OpenAPI_events_subsc_req_data_t *ev_subsc_local_nonprim = NULL;
cJSON *mcptt_id = NULL;
cJSON *mc_video_id = NULL;
cJSON *med_components = NULL;
OpenAPI_list_t *med_componentsList = NULL;
cJSON *ip_domain = NULL;
cJSON *mps_id = NULL;
cJSON *mcs_id = NULL;
cJSON *preempt_control_info = NULL;
OpenAPI_preemption_control_information_e preempt_control_infoVariable = 0;
cJSON *res_prio = NULL;
OpenAPI_reserv_priority_e res_prioVariable = 0;
cJSON *serv_inf_status = NULL;
OpenAPI_service_info_status_e serv_inf_statusVariable = 0;
cJSON *notif_uri = NULL;
cJSON *serv_urn = NULL;
cJSON *slice_info = NULL;
OpenAPI_snssai_t *slice_info_local_nonprim = NULL;
cJSON *spon_id = NULL;
cJSON *spon_status = NULL;
OpenAPI_sponsoring_status_e spon_statusVariable = 0;
cJSON *supi = NULL;
cJSON *gpsi = NULL;
cJSON *supp_feat = NULL;
cJSON *ue_ipv4 = NULL;
cJSON *ue_ipv6 = NULL;
cJSON *ue_mac = NULL;
cJSON *tsn_bridge_man_cont = NULL;
OpenAPI_bridge_management_container_t *tsn_bridge_man_cont_local_nonprim = NULL;
cJSON *tsn_port_man_cont_dstt = NULL;
OpenAPI_port_management_container_t *tsn_port_man_cont_dstt_local_nonprim = NULL;
cJSON *tsn_port_man_cont_nwtts = NULL;
OpenAPI_list_t *tsn_port_man_cont_nwttsList = NULL;
af_app_id = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "afAppId");
if (af_app_id) {
if (!cJSON_IsString(af_app_id)) {
if (!cJSON_IsString(af_app_id) && !cJSON_IsNull(af_app_id)) {
ogs_error("OpenAPI_app_session_context_req_data_parseFromJSON() failed [af_app_id]");
goto end;
}
}
cJSON *af_charg_id = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "afChargId");
af_charg_id = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "afChargId");
if (af_charg_id) {
if (!cJSON_IsString(af_charg_id)) {
if (!cJSON_IsString(af_charg_id) && !cJSON_IsNull(af_charg_id)) {
ogs_error("OpenAPI_app_session_context_req_data_parseFromJSON() failed [af_charg_id]");
goto end;
}
}
cJSON *af_req_data = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "afReqData");
OpenAPI_af_requested_data_e af_req_dataVariable;
af_req_data = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "afReqData");
if (af_req_data) {
if (!cJSON_IsString(af_req_data)) {
ogs_error("OpenAPI_app_session_context_req_data_parseFromJSON() failed [af_req_data]");
@ -438,121 +561,107 @@ OpenAPI_app_session_context_req_data_t *OpenAPI_app_session_context_req_data_par
af_req_dataVariable = OpenAPI_af_requested_data_FromString(af_req_data->valuestring);
}
cJSON *af_rout_req = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "afRoutReq");
OpenAPI_af_routing_requirement_t *af_rout_req_local_nonprim = NULL;
af_rout_req = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "afRoutReq");
if (af_rout_req) {
af_rout_req_local_nonprim = OpenAPI_af_routing_requirement_parseFromJSON(af_rout_req);
}
cJSON *asp_id = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "aspId");
asp_id = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "aspId");
if (asp_id) {
if (!cJSON_IsString(asp_id)) {
if (!cJSON_IsString(asp_id) && !cJSON_IsNull(asp_id)) {
ogs_error("OpenAPI_app_session_context_req_data_parseFromJSON() failed [asp_id]");
goto end;
}
}
cJSON *bdt_ref_id = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "bdtRefId");
bdt_ref_id = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "bdtRefId");
if (bdt_ref_id) {
if (!cJSON_IsString(bdt_ref_id)) {
if (!cJSON_IsString(bdt_ref_id) && !cJSON_IsNull(bdt_ref_id)) {
ogs_error("OpenAPI_app_session_context_req_data_parseFromJSON() failed [bdt_ref_id]");
goto end;
}
}
cJSON *dnn = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "dnn");
dnn = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "dnn");
if (dnn) {
if (!cJSON_IsString(dnn)) {
if (!cJSON_IsString(dnn) && !cJSON_IsNull(dnn)) {
ogs_error("OpenAPI_app_session_context_req_data_parseFromJSON() failed [dnn]");
goto end;
}
}
cJSON *ev_subsc = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "evSubsc");
OpenAPI_events_subsc_req_data_t *ev_subsc_local_nonprim = NULL;
ev_subsc = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "evSubsc");
if (ev_subsc) {
ev_subsc_local_nonprim = OpenAPI_events_subsc_req_data_parseFromJSON(ev_subsc);
}
cJSON *mcptt_id = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "mcpttId");
mcptt_id = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "mcpttId");
if (mcptt_id) {
if (!cJSON_IsString(mcptt_id)) {
if (!cJSON_IsString(mcptt_id) && !cJSON_IsNull(mcptt_id)) {
ogs_error("OpenAPI_app_session_context_req_data_parseFromJSON() failed [mcptt_id]");
goto end;
}
}
cJSON *mc_video_id = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "mcVideoId");
mc_video_id = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "mcVideoId");
if (mc_video_id) {
if (!cJSON_IsString(mc_video_id)) {
if (!cJSON_IsString(mc_video_id) && !cJSON_IsNull(mc_video_id)) {
ogs_error("OpenAPI_app_session_context_req_data_parseFromJSON() failed [mc_video_id]");
goto end;
}
}
cJSON *med_components = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "medComponents");
OpenAPI_list_t *med_componentsList;
med_components = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "medComponents");
if (med_components) {
cJSON *med_components_local_map;
if (!cJSON_IsObject(med_components)) {
ogs_error("OpenAPI_app_session_context_req_data_parseFromJSON() failed [med_components]");
goto end;
}
med_componentsList = OpenAPI_list_create();
OpenAPI_map_t *localMapKeyPair = NULL;
cJSON_ArrayForEach(med_components_local_map, med_components) {
cJSON *localMapObject = med_components_local_map;
if (cJSON_IsObject(localMapObject)) {
localMapKeyPair = OpenAPI_map_create(
ogs_strdup(localMapObject->string), OpenAPI_media_component_parseFromJSON(localMapObject));
} else if (cJSON_IsNull(localMapObject)) {
localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL);
} else {
ogs_error("OpenAPI_app_session_context_req_data_parseFromJSON() failed [inner]");
cJSON *med_components_local_map = NULL;
if (!cJSON_IsObject(med_components) && !cJSON_IsNull(med_components)) {
ogs_error("OpenAPI_app_session_context_req_data_parseFromJSON() failed [med_components]");
goto end;
}
OpenAPI_list_add(med_componentsList, localMapKeyPair);
}
if (cJSON_IsObject(med_components)) {
med_componentsList = OpenAPI_list_create();
OpenAPI_map_t *localMapKeyPair = NULL;
cJSON_ArrayForEach(med_components_local_map, med_components) {
cJSON *localMapObject = med_components_local_map;
if (cJSON_IsObject(localMapObject)) {
localMapKeyPair = OpenAPI_map_create(
ogs_strdup(localMapObject->string), OpenAPI_media_component_parseFromJSON(localMapObject));
} else if (cJSON_IsNull(localMapObject)) {
localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL);
} else {
ogs_error("OpenAPI_app_session_context_req_data_parseFromJSON() failed [inner]");
goto end;
}
OpenAPI_list_add(med_componentsList, localMapKeyPair);
}
}
}
cJSON *ip_domain = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "ipDomain");
ip_domain = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "ipDomain");
if (ip_domain) {
if (!cJSON_IsString(ip_domain)) {
if (!cJSON_IsString(ip_domain) && !cJSON_IsNull(ip_domain)) {
ogs_error("OpenAPI_app_session_context_req_data_parseFromJSON() failed [ip_domain]");
goto end;
}
}
cJSON *mps_id = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "mpsId");
mps_id = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "mpsId");
if (mps_id) {
if (!cJSON_IsString(mps_id)) {
if (!cJSON_IsString(mps_id) && !cJSON_IsNull(mps_id)) {
ogs_error("OpenAPI_app_session_context_req_data_parseFromJSON() failed [mps_id]");
goto end;
}
}
cJSON *mcs_id = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "mcsId");
mcs_id = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "mcsId");
if (mcs_id) {
if (!cJSON_IsString(mcs_id)) {
if (!cJSON_IsString(mcs_id) && !cJSON_IsNull(mcs_id)) {
ogs_error("OpenAPI_app_session_context_req_data_parseFromJSON() failed [mcs_id]");
goto end;
}
}
cJSON *preempt_control_info = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "preemptControlInfo");
OpenAPI_preemption_control_information_e preempt_control_infoVariable;
preempt_control_info = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "preemptControlInfo");
if (preempt_control_info) {
if (!cJSON_IsString(preempt_control_info)) {
ogs_error("OpenAPI_app_session_context_req_data_parseFromJSON() failed [preempt_control_info]");
@ -561,9 +670,7 @@ OpenAPI_app_session_context_req_data_t *OpenAPI_app_session_context_req_data_par
preempt_control_infoVariable = OpenAPI_preemption_control_information_FromString(preempt_control_info->valuestring);
}
cJSON *res_prio = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "resPrio");
OpenAPI_reserv_priority_e res_prioVariable;
res_prio = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "resPrio");
if (res_prio) {
if (!cJSON_IsString(res_prio)) {
ogs_error("OpenAPI_app_session_context_req_data_parseFromJSON() failed [res_prio]");
@ -572,9 +679,7 @@ OpenAPI_app_session_context_req_data_t *OpenAPI_app_session_context_req_data_par
res_prioVariable = OpenAPI_reserv_priority_FromString(res_prio->valuestring);
}
cJSON *serv_inf_status = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "servInfStatus");
OpenAPI_service_info_status_e serv_inf_statusVariable;
serv_inf_status = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "servInfStatus");
if (serv_inf_status) {
if (!cJSON_IsString(serv_inf_status)) {
ogs_error("OpenAPI_app_session_context_req_data_parseFromJSON() failed [serv_inf_status]");
@ -583,45 +688,38 @@ OpenAPI_app_session_context_req_data_t *OpenAPI_app_session_context_req_data_par
serv_inf_statusVariable = OpenAPI_service_info_status_FromString(serv_inf_status->valuestring);
}
cJSON *notif_uri = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "notifUri");
notif_uri = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "notifUri");
if (!notif_uri) {
ogs_error("OpenAPI_app_session_context_req_data_parseFromJSON() failed [notif_uri]");
goto end;
}
if (!cJSON_IsString(notif_uri)) {
ogs_error("OpenAPI_app_session_context_req_data_parseFromJSON() failed [notif_uri]");
goto end;
}
cJSON *serv_urn = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "servUrn");
serv_urn = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "servUrn");
if (serv_urn) {
if (!cJSON_IsString(serv_urn)) {
if (!cJSON_IsString(serv_urn) && !cJSON_IsNull(serv_urn)) {
ogs_error("OpenAPI_app_session_context_req_data_parseFromJSON() failed [serv_urn]");
goto end;
}
}
cJSON *slice_info = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "sliceInfo");
OpenAPI_snssai_t *slice_info_local_nonprim = NULL;
slice_info = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "sliceInfo");
if (slice_info) {
slice_info_local_nonprim = OpenAPI_snssai_parseFromJSON(slice_info);
}
cJSON *spon_id = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "sponId");
spon_id = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "sponId");
if (spon_id) {
if (!cJSON_IsString(spon_id)) {
if (!cJSON_IsString(spon_id) && !cJSON_IsNull(spon_id)) {
ogs_error("OpenAPI_app_session_context_req_data_parseFromJSON() failed [spon_id]");
goto end;
}
}
cJSON *spon_status = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "sponStatus");
OpenAPI_sponsoring_status_e spon_statusVariable;
spon_status = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "sponStatus");
if (spon_status) {
if (!cJSON_IsString(spon_status)) {
ogs_error("OpenAPI_app_session_context_req_data_parseFromJSON() failed [spon_status]");
@ -630,134 +728,120 @@ OpenAPI_app_session_context_req_data_t *OpenAPI_app_session_context_req_data_par
spon_statusVariable = OpenAPI_sponsoring_status_FromString(spon_status->valuestring);
}
cJSON *supi = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "supi");
supi = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "supi");
if (supi) {
if (!cJSON_IsString(supi)) {
if (!cJSON_IsString(supi) && !cJSON_IsNull(supi)) {
ogs_error("OpenAPI_app_session_context_req_data_parseFromJSON() failed [supi]");
goto end;
}
}
cJSON *gpsi = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "gpsi");
gpsi = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "gpsi");
if (gpsi) {
if (!cJSON_IsString(gpsi)) {
if (!cJSON_IsString(gpsi) && !cJSON_IsNull(gpsi)) {
ogs_error("OpenAPI_app_session_context_req_data_parseFromJSON() failed [gpsi]");
goto end;
}
}
cJSON *supp_feat = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "suppFeat");
supp_feat = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "suppFeat");
if (!supp_feat) {
ogs_error("OpenAPI_app_session_context_req_data_parseFromJSON() failed [supp_feat]");
goto end;
}
if (!cJSON_IsString(supp_feat)) {
ogs_error("OpenAPI_app_session_context_req_data_parseFromJSON() failed [supp_feat]");
goto end;
}
cJSON *ue_ipv4 = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "ueIpv4");
ue_ipv4 = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "ueIpv4");
if (ue_ipv4) {
if (!cJSON_IsString(ue_ipv4)) {
if (!cJSON_IsString(ue_ipv4) && !cJSON_IsNull(ue_ipv4)) {
ogs_error("OpenAPI_app_session_context_req_data_parseFromJSON() failed [ue_ipv4]");
goto end;
}
}
cJSON *ue_ipv6 = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "ueIpv6");
ue_ipv6 = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "ueIpv6");
if (ue_ipv6) {
if (!cJSON_IsString(ue_ipv6)) {
if (!cJSON_IsString(ue_ipv6) && !cJSON_IsNull(ue_ipv6)) {
ogs_error("OpenAPI_app_session_context_req_data_parseFromJSON() failed [ue_ipv6]");
goto end;
}
}
cJSON *ue_mac = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "ueMac");
ue_mac = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "ueMac");
if (ue_mac) {
if (!cJSON_IsString(ue_mac)) {
if (!cJSON_IsString(ue_mac) && !cJSON_IsNull(ue_mac)) {
ogs_error("OpenAPI_app_session_context_req_data_parseFromJSON() failed [ue_mac]");
goto end;
}
}
cJSON *tsn_bridge_man_cont = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "tsnBridgeManCont");
OpenAPI_bridge_management_container_t *tsn_bridge_man_cont_local_nonprim = NULL;
tsn_bridge_man_cont = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "tsnBridgeManCont");
if (tsn_bridge_man_cont) {
tsn_bridge_man_cont_local_nonprim = OpenAPI_bridge_management_container_parseFromJSON(tsn_bridge_man_cont);
}
cJSON *tsn_port_man_cont_dstt = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "tsnPortManContDstt");
OpenAPI_port_management_container_t *tsn_port_man_cont_dstt_local_nonprim = NULL;
tsn_port_man_cont_dstt = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "tsnPortManContDstt");
if (tsn_port_man_cont_dstt) {
tsn_port_man_cont_dstt_local_nonprim = OpenAPI_port_management_container_parseFromJSON(tsn_port_man_cont_dstt);
}
cJSON *tsn_port_man_cont_nwtts = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "tsnPortManContNwtts");
OpenAPI_list_t *tsn_port_man_cont_nwttsList;
tsn_port_man_cont_nwtts = cJSON_GetObjectItemCaseSensitive(app_session_context_req_dataJSON, "tsnPortManContNwtts");
if (tsn_port_man_cont_nwtts) {
cJSON *tsn_port_man_cont_nwtts_local_nonprimitive;
if (!cJSON_IsArray(tsn_port_man_cont_nwtts)){
ogs_error("OpenAPI_app_session_context_req_data_parseFromJSON() failed [tsn_port_man_cont_nwtts]");
goto end;
}
tsn_port_man_cont_nwttsList = OpenAPI_list_create();
cJSON_ArrayForEach(tsn_port_man_cont_nwtts_local_nonprimitive, tsn_port_man_cont_nwtts ) {
if (!cJSON_IsObject(tsn_port_man_cont_nwtts_local_nonprimitive)) {
cJSON *tsn_port_man_cont_nwtts_local = NULL;
if (!cJSON_IsArray(tsn_port_man_cont_nwtts)) {
ogs_error("OpenAPI_app_session_context_req_data_parseFromJSON() failed [tsn_port_man_cont_nwtts]");
goto end;
}
OpenAPI_port_management_container_t *tsn_port_man_cont_nwttsItem = OpenAPI_port_management_container_parseFromJSON(tsn_port_man_cont_nwtts_local_nonprimitive);
if (!tsn_port_man_cont_nwttsItem) {
ogs_error("No tsn_port_man_cont_nwttsItem");
OpenAPI_list_free(tsn_port_man_cont_nwttsList);
goto end;
tsn_port_man_cont_nwttsList = OpenAPI_list_create();
cJSON_ArrayForEach(tsn_port_man_cont_nwtts_local, tsn_port_man_cont_nwtts) {
if (!cJSON_IsObject(tsn_port_man_cont_nwtts_local)) {
ogs_error("OpenAPI_app_session_context_req_data_parseFromJSON() failed [tsn_port_man_cont_nwtts]");
goto end;
}
OpenAPI_port_management_container_t *tsn_port_man_cont_nwttsItem = OpenAPI_port_management_container_parseFromJSON(tsn_port_man_cont_nwtts_local);
if (!tsn_port_man_cont_nwttsItem) {
ogs_error("No tsn_port_man_cont_nwttsItem");
OpenAPI_list_free(tsn_port_man_cont_nwttsList);
goto end;
}
OpenAPI_list_add(tsn_port_man_cont_nwttsList, tsn_port_man_cont_nwttsItem);
}
OpenAPI_list_add(tsn_port_man_cont_nwttsList, tsn_port_man_cont_nwttsItem);
}
}
app_session_context_req_data_local_var = OpenAPI_app_session_context_req_data_create (
af_app_id ? ogs_strdup(af_app_id->valuestring) : NULL,
af_charg_id ? ogs_strdup(af_charg_id->valuestring) : NULL,
af_app_id && !cJSON_IsNull(af_app_id) ? ogs_strdup(af_app_id->valuestring) : NULL,
af_charg_id && !cJSON_IsNull(af_charg_id) ? ogs_strdup(af_charg_id->valuestring) : NULL,
af_req_data ? af_req_dataVariable : 0,
af_rout_req ? af_rout_req_local_nonprim : NULL,
asp_id ? ogs_strdup(asp_id->valuestring) : NULL,
bdt_ref_id ? ogs_strdup(bdt_ref_id->valuestring) : NULL,
dnn ? ogs_strdup(dnn->valuestring) : NULL,
asp_id && !cJSON_IsNull(asp_id) ? ogs_strdup(asp_id->valuestring) : NULL,
bdt_ref_id && !cJSON_IsNull(bdt_ref_id) ? ogs_strdup(bdt_ref_id->valuestring) : NULL,
dnn && !cJSON_IsNull(dnn) ? ogs_strdup(dnn->valuestring) : NULL,
ev_subsc ? ev_subsc_local_nonprim : NULL,
mcptt_id ? ogs_strdup(mcptt_id->valuestring) : NULL,
mc_video_id ? ogs_strdup(mc_video_id->valuestring) : NULL,
mcptt_id && !cJSON_IsNull(mcptt_id) ? ogs_strdup(mcptt_id->valuestring) : NULL,
mc_video_id && !cJSON_IsNull(mc_video_id) ? ogs_strdup(mc_video_id->valuestring) : NULL,
med_components ? med_componentsList : NULL,
ip_domain ? ogs_strdup(ip_domain->valuestring) : NULL,
mps_id ? ogs_strdup(mps_id->valuestring) : NULL,
mcs_id ? ogs_strdup(mcs_id->valuestring) : NULL,
ip_domain && !cJSON_IsNull(ip_domain) ? ogs_strdup(ip_domain->valuestring) : NULL,
mps_id && !cJSON_IsNull(mps_id) ? ogs_strdup(mps_id->valuestring) : NULL,
mcs_id && !cJSON_IsNull(mcs_id) ? ogs_strdup(mcs_id->valuestring) : NULL,
preempt_control_info ? preempt_control_infoVariable : 0,
res_prio ? res_prioVariable : 0,
serv_inf_status ? serv_inf_statusVariable : 0,
ogs_strdup(notif_uri->valuestring),
serv_urn ? ogs_strdup(serv_urn->valuestring) : NULL,
serv_urn && !cJSON_IsNull(serv_urn) ? ogs_strdup(serv_urn->valuestring) : NULL,
slice_info ? slice_info_local_nonprim : NULL,
spon_id ? ogs_strdup(spon_id->valuestring) : NULL,
spon_id && !cJSON_IsNull(spon_id) ? ogs_strdup(spon_id->valuestring) : NULL,
spon_status ? spon_statusVariable : 0,
supi ? ogs_strdup(supi->valuestring) : NULL,
gpsi ? ogs_strdup(gpsi->valuestring) : NULL,
supi && !cJSON_IsNull(supi) ? ogs_strdup(supi->valuestring) : NULL,
gpsi && !cJSON_IsNull(gpsi) ? ogs_strdup(gpsi->valuestring) : NULL,
ogs_strdup(supp_feat->valuestring),
ue_ipv4 ? ogs_strdup(ue_ipv4->valuestring) : NULL,
ue_ipv6 ? ogs_strdup(ue_ipv6->valuestring) : NULL,
ue_mac ? ogs_strdup(ue_mac->valuestring) : NULL,
ue_ipv4 && !cJSON_IsNull(ue_ipv4) ? ogs_strdup(ue_ipv4->valuestring) : NULL,
ue_ipv6 && !cJSON_IsNull(ue_ipv6) ? ogs_strdup(ue_ipv6->valuestring) : NULL,
ue_mac && !cJSON_IsNull(ue_mac) ? ogs_strdup(ue_mac->valuestring) : NULL,
tsn_bridge_man_cont ? tsn_bridge_man_cont_local_nonprim : NULL,
tsn_port_man_cont_dstt ? tsn_port_man_cont_dstt_local_nonprim : NULL,
tsn_port_man_cont_nwtts ? tsn_port_man_cont_nwttsList : NULL
@ -765,6 +849,43 @@ OpenAPI_app_session_context_req_data_t *OpenAPI_app_session_context_req_data_par
return app_session_context_req_data_local_var;
end:
if (af_rout_req_local_nonprim) {
OpenAPI_af_routing_requirement_free(af_rout_req_local_nonprim);
af_rout_req_local_nonprim = NULL;
}
if (ev_subsc_local_nonprim) {
OpenAPI_events_subsc_req_data_free(ev_subsc_local_nonprim);
ev_subsc_local_nonprim = NULL;
}
if (med_componentsList) {
OpenAPI_list_for_each(med_componentsList, node) {
OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data;
ogs_free(localKeyValue->key);
OpenAPI_media_component_free(localKeyValue->value);
OpenAPI_map_free(localKeyValue);
}
OpenAPI_list_free(med_componentsList);
med_componentsList = NULL;
}
if (slice_info_local_nonprim) {
OpenAPI_snssai_free(slice_info_local_nonprim);
slice_info_local_nonprim = NULL;
}
if (tsn_bridge_man_cont_local_nonprim) {
OpenAPI_bridge_management_container_free(tsn_bridge_man_cont_local_nonprim);
tsn_bridge_man_cont_local_nonprim = NULL;
}
if (tsn_port_man_cont_dstt_local_nonprim) {
OpenAPI_port_management_container_free(tsn_port_man_cont_dstt_local_nonprim);
tsn_port_man_cont_dstt_local_nonprim = NULL;
}
if (tsn_port_man_cont_nwttsList) {
OpenAPI_list_for_each(tsn_port_man_cont_nwttsList, node) {
OpenAPI_port_management_container_free(node->data);
}
OpenAPI_list_free(tsn_port_man_cont_nwttsList);
tsn_port_man_cont_nwttsList = NULL;
}
return NULL;
}

View File

@ -22,21 +22,29 @@ OpenAPI_app_session_context_resp_data_t *OpenAPI_app_session_context_resp_data_c
void OpenAPI_app_session_context_resp_data_free(OpenAPI_app_session_context_resp_data_t *app_session_context_resp_data)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == app_session_context_resp_data) {
return;
}
OpenAPI_lnode_t *node;
OpenAPI_list_for_each(app_session_context_resp_data->ue_ids, node) {
OpenAPI_ue_identity_info_free(node->data);
if (app_session_context_resp_data->ue_ids) {
OpenAPI_list_for_each(app_session_context_resp_data->ue_ids, node) {
OpenAPI_ue_identity_info_free(node->data);
}
OpenAPI_list_free(app_session_context_resp_data->ue_ids);
app_session_context_resp_data->ue_ids = NULL;
}
if (app_session_context_resp_data->supp_feat) {
ogs_free(app_session_context_resp_data->supp_feat);
app_session_context_resp_data->supp_feat = NULL;
}
OpenAPI_list_free(app_session_context_resp_data->ue_ids);
ogs_free(app_session_context_resp_data->supp_feat);
ogs_free(app_session_context_resp_data);
}
cJSON *OpenAPI_app_session_context_resp_data_convertToJSON(OpenAPI_app_session_context_resp_data_t *app_session_context_resp_data)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (app_session_context_resp_data == NULL) {
ogs_error("OpenAPI_app_session_context_resp_data_convertToJSON() failed [AppSessionContextRespData]");
@ -44,7 +52,7 @@ cJSON *OpenAPI_app_session_context_resp_data_convertToJSON(OpenAPI_app_session_c
}
item = cJSON_CreateObject();
if (app_session_context_resp_data->serv_auth_info) {
if (app_session_context_resp_data->serv_auth_info != OpenAPI_serv_auth_info_NULL) {
if (cJSON_AddStringToObject(item, "servAuthInfo", OpenAPI_serv_auth_info_ToString(app_session_context_resp_data->serv_auth_info)) == NULL) {
ogs_error("OpenAPI_app_session_context_resp_data_convertToJSON() failed [serv_auth_info]");
goto end;
@ -57,17 +65,13 @@ cJSON *OpenAPI_app_session_context_resp_data_convertToJSON(OpenAPI_app_session_c
ogs_error("OpenAPI_app_session_context_resp_data_convertToJSON() failed [ue_ids]");
goto end;
}
OpenAPI_lnode_t *ue_ids_node;
if (app_session_context_resp_data->ue_ids) {
OpenAPI_list_for_each(app_session_context_resp_data->ue_ids, ue_ids_node) {
cJSON *itemLocal = OpenAPI_ue_identity_info_convertToJSON(ue_ids_node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_app_session_context_resp_data_convertToJSON() failed [ue_ids]");
goto end;
}
cJSON_AddItemToArray(ue_idsList, itemLocal);
OpenAPI_list_for_each(app_session_context_resp_data->ue_ids, node) {
cJSON *itemLocal = OpenAPI_ue_identity_info_convertToJSON(node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_app_session_context_resp_data_convertToJSON() failed [ue_ids]");
goto end;
}
cJSON_AddItemToArray(ue_idsList, itemLocal);
}
}
@ -85,9 +89,13 @@ end:
OpenAPI_app_session_context_resp_data_t *OpenAPI_app_session_context_resp_data_parseFromJSON(cJSON *app_session_context_resp_dataJSON)
{
OpenAPI_app_session_context_resp_data_t *app_session_context_resp_data_local_var = NULL;
cJSON *serv_auth_info = cJSON_GetObjectItemCaseSensitive(app_session_context_resp_dataJSON, "servAuthInfo");
OpenAPI_serv_auth_info_e serv_auth_infoVariable;
OpenAPI_lnode_t *node = NULL;
cJSON *serv_auth_info = NULL;
OpenAPI_serv_auth_info_e serv_auth_infoVariable = 0;
cJSON *ue_ids = NULL;
OpenAPI_list_t *ue_idsList = NULL;
cJSON *supp_feat = NULL;
serv_auth_info = cJSON_GetObjectItemCaseSensitive(app_session_context_resp_dataJSON, "servAuthInfo");
if (serv_auth_info) {
if (!cJSON_IsString(serv_auth_info)) {
ogs_error("OpenAPI_app_session_context_resp_data_parseFromJSON() failed [serv_auth_info]");
@ -96,39 +104,34 @@ OpenAPI_app_session_context_resp_data_t *OpenAPI_app_session_context_resp_data_p
serv_auth_infoVariable = OpenAPI_serv_auth_info_FromString(serv_auth_info->valuestring);
}
cJSON *ue_ids = cJSON_GetObjectItemCaseSensitive(app_session_context_resp_dataJSON, "ueIds");
OpenAPI_list_t *ue_idsList;
ue_ids = cJSON_GetObjectItemCaseSensitive(app_session_context_resp_dataJSON, "ueIds");
if (ue_ids) {
cJSON *ue_ids_local_nonprimitive;
if (!cJSON_IsArray(ue_ids)){
ogs_error("OpenAPI_app_session_context_resp_data_parseFromJSON() failed [ue_ids]");
goto end;
}
ue_idsList = OpenAPI_list_create();
cJSON_ArrayForEach(ue_ids_local_nonprimitive, ue_ids ) {
if (!cJSON_IsObject(ue_ids_local_nonprimitive)) {
cJSON *ue_ids_local = NULL;
if (!cJSON_IsArray(ue_ids)) {
ogs_error("OpenAPI_app_session_context_resp_data_parseFromJSON() failed [ue_ids]");
goto end;
}
OpenAPI_ue_identity_info_t *ue_idsItem = OpenAPI_ue_identity_info_parseFromJSON(ue_ids_local_nonprimitive);
if (!ue_idsItem) {
ogs_error("No ue_idsItem");
OpenAPI_list_free(ue_idsList);
goto end;
ue_idsList = OpenAPI_list_create();
cJSON_ArrayForEach(ue_ids_local, ue_ids) {
if (!cJSON_IsObject(ue_ids_local)) {
ogs_error("OpenAPI_app_session_context_resp_data_parseFromJSON() failed [ue_ids]");
goto end;
}
OpenAPI_ue_identity_info_t *ue_idsItem = OpenAPI_ue_identity_info_parseFromJSON(ue_ids_local);
if (!ue_idsItem) {
ogs_error("No ue_idsItem");
OpenAPI_list_free(ue_idsList);
goto end;
}
OpenAPI_list_add(ue_idsList, ue_idsItem);
}
OpenAPI_list_add(ue_idsList, ue_idsItem);
}
}
cJSON *supp_feat = cJSON_GetObjectItemCaseSensitive(app_session_context_resp_dataJSON, "suppFeat");
supp_feat = cJSON_GetObjectItemCaseSensitive(app_session_context_resp_dataJSON, "suppFeat");
if (supp_feat) {
if (!cJSON_IsString(supp_feat)) {
if (!cJSON_IsString(supp_feat) && !cJSON_IsNull(supp_feat)) {
ogs_error("OpenAPI_app_session_context_resp_data_parseFromJSON() failed [supp_feat]");
goto end;
}
@ -137,11 +140,18 @@ OpenAPI_app_session_context_resp_data_t *OpenAPI_app_session_context_resp_data_p
app_session_context_resp_data_local_var = OpenAPI_app_session_context_resp_data_create (
serv_auth_info ? serv_auth_infoVariable : 0,
ue_ids ? ue_idsList : NULL,
supp_feat ? ogs_strdup(supp_feat->valuestring) : NULL
supp_feat && !cJSON_IsNull(supp_feat) ? ogs_strdup(supp_feat->valuestring) : NULL
);
return app_session_context_resp_data_local_var;
end:
if (ue_idsList) {
OpenAPI_list_for_each(ue_idsList, node) {
OpenAPI_ue_identity_info_free(node->data);
}
OpenAPI_list_free(ue_idsList);
ue_idsList = NULL;
}
return NULL;
}

View File

@ -54,40 +54,87 @@ OpenAPI_app_session_context_update_data_t *OpenAPI_app_session_context_update_da
void OpenAPI_app_session_context_update_data_free(OpenAPI_app_session_context_update_data_t *app_session_context_update_data)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == app_session_context_update_data) {
return;
}
OpenAPI_lnode_t *node;
ogs_free(app_session_context_update_data->af_app_id);
OpenAPI_af_routing_requirement_rm_free(app_session_context_update_data->af_rout_req);
ogs_free(app_session_context_update_data->asp_id);
ogs_free(app_session_context_update_data->bdt_ref_id);
OpenAPI_events_subsc_req_data_rm_free(app_session_context_update_data->ev_subsc);
ogs_free(app_session_context_update_data->mcptt_id);
ogs_free(app_session_context_update_data->mc_video_id);
OpenAPI_list_for_each(app_session_context_update_data->med_components, node) {
OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data;
ogs_free(localKeyValue->key);
OpenAPI_media_component_rm_free(localKeyValue->value);
ogs_free(localKeyValue);
if (app_session_context_update_data->af_app_id) {
ogs_free(app_session_context_update_data->af_app_id);
app_session_context_update_data->af_app_id = NULL;
}
OpenAPI_list_free(app_session_context_update_data->med_components);
ogs_free(app_session_context_update_data->mps_id);
ogs_free(app_session_context_update_data->mcs_id);
OpenAPI_preemption_control_information_rm_free(app_session_context_update_data->preempt_control_info);
ogs_free(app_session_context_update_data->spon_id);
OpenAPI_bridge_management_container_free(app_session_context_update_data->tsn_bridge_man_cont);
OpenAPI_port_management_container_free(app_session_context_update_data->tsn_port_man_cont_dstt);
OpenAPI_list_for_each(app_session_context_update_data->tsn_port_man_cont_nwtts, node) {
OpenAPI_port_management_container_free(node->data);
if (app_session_context_update_data->af_rout_req) {
OpenAPI_af_routing_requirement_rm_free(app_session_context_update_data->af_rout_req);
app_session_context_update_data->af_rout_req = NULL;
}
if (app_session_context_update_data->asp_id) {
ogs_free(app_session_context_update_data->asp_id);
app_session_context_update_data->asp_id = NULL;
}
if (app_session_context_update_data->bdt_ref_id) {
ogs_free(app_session_context_update_data->bdt_ref_id);
app_session_context_update_data->bdt_ref_id = NULL;
}
if (app_session_context_update_data->ev_subsc) {
OpenAPI_events_subsc_req_data_rm_free(app_session_context_update_data->ev_subsc);
app_session_context_update_data->ev_subsc = NULL;
}
if (app_session_context_update_data->mcptt_id) {
ogs_free(app_session_context_update_data->mcptt_id);
app_session_context_update_data->mcptt_id = NULL;
}
if (app_session_context_update_data->mc_video_id) {
ogs_free(app_session_context_update_data->mc_video_id);
app_session_context_update_data->mc_video_id = NULL;
}
if (app_session_context_update_data->med_components) {
OpenAPI_list_for_each(app_session_context_update_data->med_components, node) {
OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data;
ogs_free(localKeyValue->key);
OpenAPI_media_component_rm_free(localKeyValue->value);
OpenAPI_map_free(localKeyValue);
}
OpenAPI_list_free(app_session_context_update_data->med_components);
app_session_context_update_data->med_components = NULL;
}
if (app_session_context_update_data->mps_id) {
ogs_free(app_session_context_update_data->mps_id);
app_session_context_update_data->mps_id = NULL;
}
if (app_session_context_update_data->mcs_id) {
ogs_free(app_session_context_update_data->mcs_id);
app_session_context_update_data->mcs_id = NULL;
}
if (app_session_context_update_data->preempt_control_info) {
OpenAPI_preemption_control_information_rm_free(app_session_context_update_data->preempt_control_info);
app_session_context_update_data->preempt_control_info = NULL;
}
if (app_session_context_update_data->spon_id) {
ogs_free(app_session_context_update_data->spon_id);
app_session_context_update_data->spon_id = NULL;
}
if (app_session_context_update_data->tsn_bridge_man_cont) {
OpenAPI_bridge_management_container_free(app_session_context_update_data->tsn_bridge_man_cont);
app_session_context_update_data->tsn_bridge_man_cont = NULL;
}
if (app_session_context_update_data->tsn_port_man_cont_dstt) {
OpenAPI_port_management_container_free(app_session_context_update_data->tsn_port_man_cont_dstt);
app_session_context_update_data->tsn_port_man_cont_dstt = NULL;
}
if (app_session_context_update_data->tsn_port_man_cont_nwtts) {
OpenAPI_list_for_each(app_session_context_update_data->tsn_port_man_cont_nwtts, node) {
OpenAPI_port_management_container_free(node->data);
}
OpenAPI_list_free(app_session_context_update_data->tsn_port_man_cont_nwtts);
app_session_context_update_data->tsn_port_man_cont_nwtts = NULL;
}
OpenAPI_list_free(app_session_context_update_data->tsn_port_man_cont_nwtts);
ogs_free(app_session_context_update_data);
}
cJSON *OpenAPI_app_session_context_update_data_convertToJSON(OpenAPI_app_session_context_update_data_t *app_session_context_update_data)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (app_session_context_update_data == NULL) {
ogs_error("OpenAPI_app_session_context_update_data_convertToJSON() failed [AppSessionContextUpdateData]");
@ -163,21 +210,20 @@ cJSON *OpenAPI_app_session_context_update_data_convertToJSON(OpenAPI_app_session
goto end;
}
cJSON *localMapObject = med_components;
OpenAPI_lnode_t *med_components_node;
if (app_session_context_update_data->med_components) {
OpenAPI_list_for_each(app_session_context_update_data->med_components, med_components_node) {
OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)med_components_node->data;
cJSON *itemLocal = localKeyValue->value ?
OpenAPI_media_component_rm_convertToJSON(localKeyValue->value) :
cJSON_CreateNull();
if (itemLocal == NULL) {
ogs_error("OpenAPI_app_session_context_update_data_convertToJSON() failed [inner]");
goto end;
}
cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal);
OpenAPI_list_for_each(app_session_context_update_data->med_components, node) {
OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data;
cJSON *itemLocal = localKeyValue->value ?
OpenAPI_media_component_rm_convertToJSON(localKeyValue->value) :
cJSON_CreateNull();
if (itemLocal == NULL) {
ogs_error("OpenAPI_app_session_context_update_data_convertToJSON() failed [inner]");
goto end;
}
cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal);
}
}
}
if (app_session_context_update_data->mps_id) {
if (cJSON_AddStringToObject(item, "mpsId", app_session_context_update_data->mps_id) == NULL) {
@ -206,21 +252,21 @@ cJSON *OpenAPI_app_session_context_update_data_convertToJSON(OpenAPI_app_session
}
}
if (app_session_context_update_data->res_prio) {
if (app_session_context_update_data->res_prio != OpenAPI_reserv_priority_NULL) {
if (cJSON_AddStringToObject(item, "resPrio", OpenAPI_reserv_priority_ToString(app_session_context_update_data->res_prio)) == NULL) {
ogs_error("OpenAPI_app_session_context_update_data_convertToJSON() failed [res_prio]");
goto end;
}
}
if (app_session_context_update_data->serv_inf_status) {
if (app_session_context_update_data->serv_inf_status != OpenAPI_service_info_status_NULL) {
if (cJSON_AddStringToObject(item, "servInfStatus", OpenAPI_service_info_status_ToString(app_session_context_update_data->serv_inf_status)) == NULL) {
ogs_error("OpenAPI_app_session_context_update_data_convertToJSON() failed [serv_inf_status]");
goto end;
}
}
if (app_session_context_update_data->sip_fork_ind) {
if (app_session_context_update_data->sip_fork_ind != OpenAPI_sip_forking_indication_NULL) {
if (cJSON_AddStringToObject(item, "sipForkInd", OpenAPI_sip_forking_indication_ToString(app_session_context_update_data->sip_fork_ind)) == NULL) {
ogs_error("OpenAPI_app_session_context_update_data_convertToJSON() failed [sip_fork_ind]");
goto end;
@ -234,7 +280,7 @@ cJSON *OpenAPI_app_session_context_update_data_convertToJSON(OpenAPI_app_session
}
}
if (app_session_context_update_data->spon_status) {
if (app_session_context_update_data->spon_status != OpenAPI_sponsoring_status_NULL) {
if (cJSON_AddStringToObject(item, "sponStatus", OpenAPI_sponsoring_status_ToString(app_session_context_update_data->spon_status)) == NULL) {
ogs_error("OpenAPI_app_session_context_update_data_convertToJSON() failed [spon_status]");
goto end;
@ -273,17 +319,13 @@ cJSON *OpenAPI_app_session_context_update_data_convertToJSON(OpenAPI_app_session
ogs_error("OpenAPI_app_session_context_update_data_convertToJSON() failed [tsn_port_man_cont_nwtts]");
goto end;
}
OpenAPI_lnode_t *tsn_port_man_cont_nwtts_node;
if (app_session_context_update_data->tsn_port_man_cont_nwtts) {
OpenAPI_list_for_each(app_session_context_update_data->tsn_port_man_cont_nwtts, tsn_port_man_cont_nwtts_node) {
cJSON *itemLocal = OpenAPI_port_management_container_convertToJSON(tsn_port_man_cont_nwtts_node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_app_session_context_update_data_convertToJSON() failed [tsn_port_man_cont_nwtts]");
goto end;
}
cJSON_AddItemToArray(tsn_port_man_cont_nwttsList, itemLocal);
OpenAPI_list_for_each(app_session_context_update_data->tsn_port_man_cont_nwtts, node) {
cJSON *itemLocal = OpenAPI_port_management_container_convertToJSON(node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_app_session_context_update_data_convertToJSON() failed [tsn_port_man_cont_nwtts]");
goto end;
}
cJSON_AddItemToArray(tsn_port_man_cont_nwttsList, itemLocal);
}
}
@ -294,119 +336,135 @@ end:
OpenAPI_app_session_context_update_data_t *OpenAPI_app_session_context_update_data_parseFromJSON(cJSON *app_session_context_update_dataJSON)
{
OpenAPI_app_session_context_update_data_t *app_session_context_update_data_local_var = NULL;
cJSON *af_app_id = cJSON_GetObjectItemCaseSensitive(app_session_context_update_dataJSON, "afAppId");
OpenAPI_lnode_t *node = NULL;
cJSON *af_app_id = NULL;
cJSON *af_rout_req = NULL;
OpenAPI_af_routing_requirement_rm_t *af_rout_req_local_nonprim = NULL;
cJSON *asp_id = NULL;
cJSON *bdt_ref_id = NULL;
cJSON *ev_subsc = NULL;
OpenAPI_events_subsc_req_data_rm_t *ev_subsc_local_nonprim = NULL;
cJSON *mcptt_id = NULL;
cJSON *mc_video_id = NULL;
cJSON *med_components = NULL;
OpenAPI_list_t *med_componentsList = NULL;
cJSON *mps_id = NULL;
cJSON *mcs_id = NULL;
cJSON *preempt_control_info = NULL;
OpenAPI_preemption_control_information_rm_t *preempt_control_info_local_nonprim = NULL;
cJSON *res_prio = NULL;
OpenAPI_reserv_priority_e res_prioVariable = 0;
cJSON *serv_inf_status = NULL;
OpenAPI_service_info_status_e serv_inf_statusVariable = 0;
cJSON *sip_fork_ind = NULL;
OpenAPI_sip_forking_indication_e sip_fork_indVariable = 0;
cJSON *spon_id = NULL;
cJSON *spon_status = NULL;
OpenAPI_sponsoring_status_e spon_statusVariable = 0;
cJSON *tsn_bridge_man_cont = NULL;
OpenAPI_bridge_management_container_t *tsn_bridge_man_cont_local_nonprim = NULL;
cJSON *tsn_port_man_cont_dstt = NULL;
OpenAPI_port_management_container_t *tsn_port_man_cont_dstt_local_nonprim = NULL;
cJSON *tsn_port_man_cont_nwtts = NULL;
OpenAPI_list_t *tsn_port_man_cont_nwttsList = NULL;
af_app_id = cJSON_GetObjectItemCaseSensitive(app_session_context_update_dataJSON, "afAppId");
if (af_app_id) {
if (!cJSON_IsString(af_app_id)) {
if (!cJSON_IsString(af_app_id) && !cJSON_IsNull(af_app_id)) {
ogs_error("OpenAPI_app_session_context_update_data_parseFromJSON() failed [af_app_id]");
goto end;
}
}
cJSON *af_rout_req = cJSON_GetObjectItemCaseSensitive(app_session_context_update_dataJSON, "afRoutReq");
OpenAPI_af_routing_requirement_rm_t *af_rout_req_local_nonprim = NULL;
af_rout_req = cJSON_GetObjectItemCaseSensitive(app_session_context_update_dataJSON, "afRoutReq");
if (af_rout_req) {
af_rout_req_local_nonprim = OpenAPI_af_routing_requirement_rm_parseFromJSON(af_rout_req);
}
cJSON *asp_id = cJSON_GetObjectItemCaseSensitive(app_session_context_update_dataJSON, "aspId");
asp_id = cJSON_GetObjectItemCaseSensitive(app_session_context_update_dataJSON, "aspId");
if (asp_id) {
if (!cJSON_IsString(asp_id)) {
if (!cJSON_IsString(asp_id) && !cJSON_IsNull(asp_id)) {
ogs_error("OpenAPI_app_session_context_update_data_parseFromJSON() failed [asp_id]");
goto end;
}
}
cJSON *bdt_ref_id = cJSON_GetObjectItemCaseSensitive(app_session_context_update_dataJSON, "bdtRefId");
bdt_ref_id = cJSON_GetObjectItemCaseSensitive(app_session_context_update_dataJSON, "bdtRefId");
if (bdt_ref_id) {
if (!cJSON_IsString(bdt_ref_id)) {
if (!cJSON_IsString(bdt_ref_id) && !cJSON_IsNull(bdt_ref_id)) {
ogs_error("OpenAPI_app_session_context_update_data_parseFromJSON() failed [bdt_ref_id]");
goto end;
}
}
cJSON *ev_subsc = cJSON_GetObjectItemCaseSensitive(app_session_context_update_dataJSON, "evSubsc");
OpenAPI_events_subsc_req_data_rm_t *ev_subsc_local_nonprim = NULL;
ev_subsc = cJSON_GetObjectItemCaseSensitive(app_session_context_update_dataJSON, "evSubsc");
if (ev_subsc) {
ev_subsc_local_nonprim = OpenAPI_events_subsc_req_data_rm_parseFromJSON(ev_subsc);
}
cJSON *mcptt_id = cJSON_GetObjectItemCaseSensitive(app_session_context_update_dataJSON, "mcpttId");
mcptt_id = cJSON_GetObjectItemCaseSensitive(app_session_context_update_dataJSON, "mcpttId");
if (mcptt_id) {
if (!cJSON_IsString(mcptt_id)) {
if (!cJSON_IsString(mcptt_id) && !cJSON_IsNull(mcptt_id)) {
ogs_error("OpenAPI_app_session_context_update_data_parseFromJSON() failed [mcptt_id]");
goto end;
}
}
cJSON *mc_video_id = cJSON_GetObjectItemCaseSensitive(app_session_context_update_dataJSON, "mcVideoId");
mc_video_id = cJSON_GetObjectItemCaseSensitive(app_session_context_update_dataJSON, "mcVideoId");
if (mc_video_id) {
if (!cJSON_IsString(mc_video_id)) {
if (!cJSON_IsString(mc_video_id) && !cJSON_IsNull(mc_video_id)) {
ogs_error("OpenAPI_app_session_context_update_data_parseFromJSON() failed [mc_video_id]");
goto end;
}
}
cJSON *med_components = cJSON_GetObjectItemCaseSensitive(app_session_context_update_dataJSON, "medComponents");
OpenAPI_list_t *med_componentsList;
med_components = cJSON_GetObjectItemCaseSensitive(app_session_context_update_dataJSON, "medComponents");
if (med_components) {
cJSON *med_components_local_map;
if (!cJSON_IsObject(med_components)) {
ogs_error("OpenAPI_app_session_context_update_data_parseFromJSON() failed [med_components]");
goto end;
}
med_componentsList = OpenAPI_list_create();
OpenAPI_map_t *localMapKeyPair = NULL;
cJSON_ArrayForEach(med_components_local_map, med_components) {
cJSON *localMapObject = med_components_local_map;
if (cJSON_IsObject(localMapObject)) {
localMapKeyPair = OpenAPI_map_create(
ogs_strdup(localMapObject->string), OpenAPI_media_component_rm_parseFromJSON(localMapObject));
} else if (cJSON_IsNull(localMapObject)) {
localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL);
} else {
ogs_error("OpenAPI_app_session_context_update_data_parseFromJSON() failed [inner]");
cJSON *med_components_local_map = NULL;
if (!cJSON_IsObject(med_components) && !cJSON_IsNull(med_components)) {
ogs_error("OpenAPI_app_session_context_update_data_parseFromJSON() failed [med_components]");
goto end;
}
OpenAPI_list_add(med_componentsList, localMapKeyPair);
}
if (cJSON_IsObject(med_components)) {
med_componentsList = OpenAPI_list_create();
OpenAPI_map_t *localMapKeyPair = NULL;
cJSON_ArrayForEach(med_components_local_map, med_components) {
cJSON *localMapObject = med_components_local_map;
if (cJSON_IsObject(localMapObject)) {
localMapKeyPair = OpenAPI_map_create(
ogs_strdup(localMapObject->string), OpenAPI_media_component_rm_parseFromJSON(localMapObject));
} else if (cJSON_IsNull(localMapObject)) {
localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL);
} else {
ogs_error("OpenAPI_app_session_context_update_data_parseFromJSON() failed [inner]");
goto end;
}
OpenAPI_list_add(med_componentsList, localMapKeyPair);
}
}
}
cJSON *mps_id = cJSON_GetObjectItemCaseSensitive(app_session_context_update_dataJSON, "mpsId");
mps_id = cJSON_GetObjectItemCaseSensitive(app_session_context_update_dataJSON, "mpsId");
if (mps_id) {
if (!cJSON_IsString(mps_id)) {
if (!cJSON_IsString(mps_id) && !cJSON_IsNull(mps_id)) {
ogs_error("OpenAPI_app_session_context_update_data_parseFromJSON() failed [mps_id]");
goto end;
}
}
cJSON *mcs_id = cJSON_GetObjectItemCaseSensitive(app_session_context_update_dataJSON, "mcsId");
mcs_id = cJSON_GetObjectItemCaseSensitive(app_session_context_update_dataJSON, "mcsId");
if (mcs_id) {
if (!cJSON_IsString(mcs_id)) {
if (!cJSON_IsString(mcs_id) && !cJSON_IsNull(mcs_id)) {
ogs_error("OpenAPI_app_session_context_update_data_parseFromJSON() failed [mcs_id]");
goto end;
}
}
cJSON *preempt_control_info = cJSON_GetObjectItemCaseSensitive(app_session_context_update_dataJSON, "preemptControlInfo");
OpenAPI_preemption_control_information_rm_t *preempt_control_info_local_nonprim = NULL;
preempt_control_info = cJSON_GetObjectItemCaseSensitive(app_session_context_update_dataJSON, "preemptControlInfo");
if (preempt_control_info) {
preempt_control_info_local_nonprim = OpenAPI_preemption_control_information_rm_parseFromJSON(preempt_control_info);
}
cJSON *res_prio = cJSON_GetObjectItemCaseSensitive(app_session_context_update_dataJSON, "resPrio");
OpenAPI_reserv_priority_e res_prioVariable;
res_prio = cJSON_GetObjectItemCaseSensitive(app_session_context_update_dataJSON, "resPrio");
if (res_prio) {
if (!cJSON_IsString(res_prio)) {
ogs_error("OpenAPI_app_session_context_update_data_parseFromJSON() failed [res_prio]");
@ -415,9 +473,7 @@ OpenAPI_app_session_context_update_data_t *OpenAPI_app_session_context_update_da
res_prioVariable = OpenAPI_reserv_priority_FromString(res_prio->valuestring);
}
cJSON *serv_inf_status = cJSON_GetObjectItemCaseSensitive(app_session_context_update_dataJSON, "servInfStatus");
OpenAPI_service_info_status_e serv_inf_statusVariable;
serv_inf_status = cJSON_GetObjectItemCaseSensitive(app_session_context_update_dataJSON, "servInfStatus");
if (serv_inf_status) {
if (!cJSON_IsString(serv_inf_status)) {
ogs_error("OpenAPI_app_session_context_update_data_parseFromJSON() failed [serv_inf_status]");
@ -426,9 +482,7 @@ OpenAPI_app_session_context_update_data_t *OpenAPI_app_session_context_update_da
serv_inf_statusVariable = OpenAPI_service_info_status_FromString(serv_inf_status->valuestring);
}
cJSON *sip_fork_ind = cJSON_GetObjectItemCaseSensitive(app_session_context_update_dataJSON, "sipForkInd");
OpenAPI_sip_forking_indication_e sip_fork_indVariable;
sip_fork_ind = cJSON_GetObjectItemCaseSensitive(app_session_context_update_dataJSON, "sipForkInd");
if (sip_fork_ind) {
if (!cJSON_IsString(sip_fork_ind)) {
ogs_error("OpenAPI_app_session_context_update_data_parseFromJSON() failed [sip_fork_ind]");
@ -437,18 +491,15 @@ OpenAPI_app_session_context_update_data_t *OpenAPI_app_session_context_update_da
sip_fork_indVariable = OpenAPI_sip_forking_indication_FromString(sip_fork_ind->valuestring);
}
cJSON *spon_id = cJSON_GetObjectItemCaseSensitive(app_session_context_update_dataJSON, "sponId");
spon_id = cJSON_GetObjectItemCaseSensitive(app_session_context_update_dataJSON, "sponId");
if (spon_id) {
if (!cJSON_IsString(spon_id)) {
if (!cJSON_IsString(spon_id) && !cJSON_IsNull(spon_id)) {
ogs_error("OpenAPI_app_session_context_update_data_parseFromJSON() failed [spon_id]");
goto end;
}
}
cJSON *spon_status = cJSON_GetObjectItemCaseSensitive(app_session_context_update_dataJSON, "sponStatus");
OpenAPI_sponsoring_status_e spon_statusVariable;
spon_status = cJSON_GetObjectItemCaseSensitive(app_session_context_update_dataJSON, "sponStatus");
if (spon_status) {
if (!cJSON_IsString(spon_status)) {
ogs_error("OpenAPI_app_session_context_update_data_parseFromJSON() failed [spon_status]");
@ -457,65 +508,57 @@ OpenAPI_app_session_context_update_data_t *OpenAPI_app_session_context_update_da
spon_statusVariable = OpenAPI_sponsoring_status_FromString(spon_status->valuestring);
}
cJSON *tsn_bridge_man_cont = cJSON_GetObjectItemCaseSensitive(app_session_context_update_dataJSON, "tsnBridgeManCont");
OpenAPI_bridge_management_container_t *tsn_bridge_man_cont_local_nonprim = NULL;
tsn_bridge_man_cont = cJSON_GetObjectItemCaseSensitive(app_session_context_update_dataJSON, "tsnBridgeManCont");
if (tsn_bridge_man_cont) {
tsn_bridge_man_cont_local_nonprim = OpenAPI_bridge_management_container_parseFromJSON(tsn_bridge_man_cont);
}
cJSON *tsn_port_man_cont_dstt = cJSON_GetObjectItemCaseSensitive(app_session_context_update_dataJSON, "tsnPortManContDstt");
OpenAPI_port_management_container_t *tsn_port_man_cont_dstt_local_nonprim = NULL;
tsn_port_man_cont_dstt = cJSON_GetObjectItemCaseSensitive(app_session_context_update_dataJSON, "tsnPortManContDstt");
if (tsn_port_man_cont_dstt) {
tsn_port_man_cont_dstt_local_nonprim = OpenAPI_port_management_container_parseFromJSON(tsn_port_man_cont_dstt);
}
cJSON *tsn_port_man_cont_nwtts = cJSON_GetObjectItemCaseSensitive(app_session_context_update_dataJSON, "tsnPortManContNwtts");
OpenAPI_list_t *tsn_port_man_cont_nwttsList;
tsn_port_man_cont_nwtts = cJSON_GetObjectItemCaseSensitive(app_session_context_update_dataJSON, "tsnPortManContNwtts");
if (tsn_port_man_cont_nwtts) {
cJSON *tsn_port_man_cont_nwtts_local_nonprimitive;
if (!cJSON_IsArray(tsn_port_man_cont_nwtts)){
ogs_error("OpenAPI_app_session_context_update_data_parseFromJSON() failed [tsn_port_man_cont_nwtts]");
goto end;
}
tsn_port_man_cont_nwttsList = OpenAPI_list_create();
cJSON_ArrayForEach(tsn_port_man_cont_nwtts_local_nonprimitive, tsn_port_man_cont_nwtts ) {
if (!cJSON_IsObject(tsn_port_man_cont_nwtts_local_nonprimitive)) {
cJSON *tsn_port_man_cont_nwtts_local = NULL;
if (!cJSON_IsArray(tsn_port_man_cont_nwtts)) {
ogs_error("OpenAPI_app_session_context_update_data_parseFromJSON() failed [tsn_port_man_cont_nwtts]");
goto end;
}
OpenAPI_port_management_container_t *tsn_port_man_cont_nwttsItem = OpenAPI_port_management_container_parseFromJSON(tsn_port_man_cont_nwtts_local_nonprimitive);
if (!tsn_port_man_cont_nwttsItem) {
ogs_error("No tsn_port_man_cont_nwttsItem");
OpenAPI_list_free(tsn_port_man_cont_nwttsList);
goto end;
tsn_port_man_cont_nwttsList = OpenAPI_list_create();
cJSON_ArrayForEach(tsn_port_man_cont_nwtts_local, tsn_port_man_cont_nwtts) {
if (!cJSON_IsObject(tsn_port_man_cont_nwtts_local)) {
ogs_error("OpenAPI_app_session_context_update_data_parseFromJSON() failed [tsn_port_man_cont_nwtts]");
goto end;
}
OpenAPI_port_management_container_t *tsn_port_man_cont_nwttsItem = OpenAPI_port_management_container_parseFromJSON(tsn_port_man_cont_nwtts_local);
if (!tsn_port_man_cont_nwttsItem) {
ogs_error("No tsn_port_man_cont_nwttsItem");
OpenAPI_list_free(tsn_port_man_cont_nwttsList);
goto end;
}
OpenAPI_list_add(tsn_port_man_cont_nwttsList, tsn_port_man_cont_nwttsItem);
}
OpenAPI_list_add(tsn_port_man_cont_nwttsList, tsn_port_man_cont_nwttsItem);
}
}
app_session_context_update_data_local_var = OpenAPI_app_session_context_update_data_create (
af_app_id ? ogs_strdup(af_app_id->valuestring) : NULL,
af_app_id && !cJSON_IsNull(af_app_id) ? ogs_strdup(af_app_id->valuestring) : NULL,
af_rout_req ? af_rout_req_local_nonprim : NULL,
asp_id ? ogs_strdup(asp_id->valuestring) : NULL,
bdt_ref_id ? ogs_strdup(bdt_ref_id->valuestring) : NULL,
asp_id && !cJSON_IsNull(asp_id) ? ogs_strdup(asp_id->valuestring) : NULL,
bdt_ref_id && !cJSON_IsNull(bdt_ref_id) ? ogs_strdup(bdt_ref_id->valuestring) : NULL,
ev_subsc ? ev_subsc_local_nonprim : NULL,
mcptt_id ? ogs_strdup(mcptt_id->valuestring) : NULL,
mc_video_id ? ogs_strdup(mc_video_id->valuestring) : NULL,
mcptt_id && !cJSON_IsNull(mcptt_id) ? ogs_strdup(mcptt_id->valuestring) : NULL,
mc_video_id && !cJSON_IsNull(mc_video_id) ? ogs_strdup(mc_video_id->valuestring) : NULL,
med_components ? med_componentsList : NULL,
mps_id ? ogs_strdup(mps_id->valuestring) : NULL,
mcs_id ? ogs_strdup(mcs_id->valuestring) : NULL,
mps_id && !cJSON_IsNull(mps_id) ? ogs_strdup(mps_id->valuestring) : NULL,
mcs_id && !cJSON_IsNull(mcs_id) ? ogs_strdup(mcs_id->valuestring) : NULL,
preempt_control_info ? preempt_control_info_local_nonprim : NULL,
res_prio ? res_prioVariable : 0,
serv_inf_status ? serv_inf_statusVariable : 0,
sip_fork_ind ? sip_fork_indVariable : 0,
spon_id ? ogs_strdup(spon_id->valuestring) : NULL,
spon_id && !cJSON_IsNull(spon_id) ? ogs_strdup(spon_id->valuestring) : NULL,
spon_status ? spon_statusVariable : 0,
tsn_bridge_man_cont ? tsn_bridge_man_cont_local_nonprim : NULL,
tsn_port_man_cont_dstt ? tsn_port_man_cont_dstt_local_nonprim : NULL,
@ -524,6 +567,43 @@ OpenAPI_app_session_context_update_data_t *OpenAPI_app_session_context_update_da
return app_session_context_update_data_local_var;
end:
if (af_rout_req_local_nonprim) {
OpenAPI_af_routing_requirement_rm_free(af_rout_req_local_nonprim);
af_rout_req_local_nonprim = NULL;
}
if (ev_subsc_local_nonprim) {
OpenAPI_events_subsc_req_data_rm_free(ev_subsc_local_nonprim);
ev_subsc_local_nonprim = NULL;
}
if (med_componentsList) {
OpenAPI_list_for_each(med_componentsList, node) {
OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data;
ogs_free(localKeyValue->key);
OpenAPI_media_component_rm_free(localKeyValue->value);
OpenAPI_map_free(localKeyValue);
}
OpenAPI_list_free(med_componentsList);
med_componentsList = NULL;
}
if (preempt_control_info_local_nonprim) {
OpenAPI_preemption_control_information_rm_free(preempt_control_info_local_nonprim);
preempt_control_info_local_nonprim = NULL;
}
if (tsn_bridge_man_cont_local_nonprim) {
OpenAPI_bridge_management_container_free(tsn_bridge_man_cont_local_nonprim);
tsn_bridge_man_cont_local_nonprim = NULL;
}
if (tsn_port_man_cont_dstt_local_nonprim) {
OpenAPI_port_management_container_free(tsn_port_man_cont_dstt_local_nonprim);
tsn_port_man_cont_dstt_local_nonprim = NULL;
}
if (tsn_port_man_cont_nwttsList) {
OpenAPI_list_for_each(tsn_port_man_cont_nwttsList, node) {
OpenAPI_port_management_container_free(node->data);
}
OpenAPI_list_free(tsn_port_man_cont_nwttsList);
tsn_port_man_cont_nwttsList = NULL;
}
return NULL;
}

View File

@ -18,17 +18,22 @@ OpenAPI_app_session_context_update_data_patch_t *OpenAPI_app_session_context_upd
void OpenAPI_app_session_context_update_data_patch_free(OpenAPI_app_session_context_update_data_patch_t *app_session_context_update_data_patch)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == app_session_context_update_data_patch) {
return;
}
OpenAPI_lnode_t *node;
OpenAPI_app_session_context_update_data_free(app_session_context_update_data_patch->asc_req_data);
if (app_session_context_update_data_patch->asc_req_data) {
OpenAPI_app_session_context_update_data_free(app_session_context_update_data_patch->asc_req_data);
app_session_context_update_data_patch->asc_req_data = NULL;
}
ogs_free(app_session_context_update_data_patch);
}
cJSON *OpenAPI_app_session_context_update_data_patch_convertToJSON(OpenAPI_app_session_context_update_data_patch_t *app_session_context_update_data_patch)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (app_session_context_update_data_patch == NULL) {
ogs_error("OpenAPI_app_session_context_update_data_patch_convertToJSON() failed [AppSessionContextUpdateDataPatch]");
@ -56,9 +61,10 @@ end:
OpenAPI_app_session_context_update_data_patch_t *OpenAPI_app_session_context_update_data_patch_parseFromJSON(cJSON *app_session_context_update_data_patchJSON)
{
OpenAPI_app_session_context_update_data_patch_t *app_session_context_update_data_patch_local_var = NULL;
cJSON *asc_req_data = cJSON_GetObjectItemCaseSensitive(app_session_context_update_data_patchJSON, "ascReqData");
OpenAPI_lnode_t *node = NULL;
cJSON *asc_req_data = NULL;
OpenAPI_app_session_context_update_data_t *asc_req_data_local_nonprim = NULL;
asc_req_data = cJSON_GetObjectItemCaseSensitive(app_session_context_update_data_patchJSON, "ascReqData");
if (asc_req_data) {
asc_req_data_local_nonprim = OpenAPI_app_session_context_update_data_parseFromJSON(asc_req_data);
}
@ -69,6 +75,10 @@ OpenAPI_app_session_context_update_data_patch_t *OpenAPI_app_session_context_upd
return app_session_context_update_data_patch_local_var;
end:
if (asc_req_data_local_nonprim) {
OpenAPI_app_session_context_update_data_free(asc_req_data_local_nonprim);
asc_req_data_local_nonprim = NULL;
}
return NULL;
}

View File

@ -26,21 +26,38 @@ OpenAPI_application_data_change_notif_t *OpenAPI_application_data_change_notif_c
void OpenAPI_application_data_change_notif_free(OpenAPI_application_data_change_notif_t *application_data_change_notif)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == application_data_change_notif) {
return;
}
OpenAPI_lnode_t *node;
OpenAPI_iptv_config_data_free(application_data_change_notif->iptv_config_data);
OpenAPI_pfd_change_notification_free(application_data_change_notif->pfd_data);
OpenAPI_bdt_policy_data_free(application_data_change_notif->bdt_policy_data);
ogs_free(application_data_change_notif->res_uri);
OpenAPI_service_parameter_data_free(application_data_change_notif->ser_param_data);
if (application_data_change_notif->iptv_config_data) {
OpenAPI_iptv_config_data_free(application_data_change_notif->iptv_config_data);
application_data_change_notif->iptv_config_data = NULL;
}
if (application_data_change_notif->pfd_data) {
OpenAPI_pfd_change_notification_free(application_data_change_notif->pfd_data);
application_data_change_notif->pfd_data = NULL;
}
if (application_data_change_notif->bdt_policy_data) {
OpenAPI_bdt_policy_data_free(application_data_change_notif->bdt_policy_data);
application_data_change_notif->bdt_policy_data = NULL;
}
if (application_data_change_notif->res_uri) {
ogs_free(application_data_change_notif->res_uri);
application_data_change_notif->res_uri = NULL;
}
if (application_data_change_notif->ser_param_data) {
OpenAPI_service_parameter_data_free(application_data_change_notif->ser_param_data);
application_data_change_notif->ser_param_data = NULL;
}
ogs_free(application_data_change_notif);
}
cJSON *OpenAPI_application_data_change_notif_convertToJSON(OpenAPI_application_data_change_notif_t *application_data_change_notif)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (application_data_change_notif == NULL) {
ogs_error("OpenAPI_application_data_change_notif_convertToJSON() failed [ApplicationDataChangeNotif]");
@ -87,6 +104,10 @@ cJSON *OpenAPI_application_data_change_notif_convertToJSON(OpenAPI_application_d
}
}
if (!application_data_change_notif->res_uri) {
ogs_error("OpenAPI_application_data_change_notif_convertToJSON() failed [res_uri]");
return NULL;
}
if (cJSON_AddStringToObject(item, "resUri", application_data_change_notif->res_uri) == NULL) {
ogs_error("OpenAPI_application_data_change_notif_convertToJSON() failed [res_uri]");
goto end;
@ -112,41 +133,42 @@ end:
OpenAPI_application_data_change_notif_t *OpenAPI_application_data_change_notif_parseFromJSON(cJSON *application_data_change_notifJSON)
{
OpenAPI_application_data_change_notif_t *application_data_change_notif_local_var = NULL;
cJSON *iptv_config_data = cJSON_GetObjectItemCaseSensitive(application_data_change_notifJSON, "iptvConfigData");
OpenAPI_lnode_t *node = NULL;
cJSON *iptv_config_data = NULL;
OpenAPI_iptv_config_data_t *iptv_config_data_local_nonprim = NULL;
cJSON *pfd_data = NULL;
OpenAPI_pfd_change_notification_t *pfd_data_local_nonprim = NULL;
cJSON *bdt_policy_data = NULL;
OpenAPI_bdt_policy_data_t *bdt_policy_data_local_nonprim = NULL;
cJSON *res_uri = NULL;
cJSON *ser_param_data = NULL;
OpenAPI_service_parameter_data_t *ser_param_data_local_nonprim = NULL;
iptv_config_data = cJSON_GetObjectItemCaseSensitive(application_data_change_notifJSON, "iptvConfigData");
if (iptv_config_data) {
iptv_config_data_local_nonprim = OpenAPI_iptv_config_data_parseFromJSON(iptv_config_data);
}
cJSON *pfd_data = cJSON_GetObjectItemCaseSensitive(application_data_change_notifJSON, "pfdData");
OpenAPI_pfd_change_notification_t *pfd_data_local_nonprim = NULL;
pfd_data = cJSON_GetObjectItemCaseSensitive(application_data_change_notifJSON, "pfdData");
if (pfd_data) {
pfd_data_local_nonprim = OpenAPI_pfd_change_notification_parseFromJSON(pfd_data);
}
cJSON *bdt_policy_data = cJSON_GetObjectItemCaseSensitive(application_data_change_notifJSON, "bdtPolicyData");
OpenAPI_bdt_policy_data_t *bdt_policy_data_local_nonprim = NULL;
bdt_policy_data = cJSON_GetObjectItemCaseSensitive(application_data_change_notifJSON, "bdtPolicyData");
if (bdt_policy_data) {
bdt_policy_data_local_nonprim = OpenAPI_bdt_policy_data_parseFromJSON(bdt_policy_data);
}
cJSON *res_uri = cJSON_GetObjectItemCaseSensitive(application_data_change_notifJSON, "resUri");
res_uri = cJSON_GetObjectItemCaseSensitive(application_data_change_notifJSON, "resUri");
if (!res_uri) {
ogs_error("OpenAPI_application_data_change_notif_parseFromJSON() failed [res_uri]");
goto end;
}
if (!cJSON_IsString(res_uri)) {
ogs_error("OpenAPI_application_data_change_notif_parseFromJSON() failed [res_uri]");
goto end;
}
cJSON *ser_param_data = cJSON_GetObjectItemCaseSensitive(application_data_change_notifJSON, "serParamData");
OpenAPI_service_parameter_data_t *ser_param_data_local_nonprim = NULL;
ser_param_data = cJSON_GetObjectItemCaseSensitive(application_data_change_notifJSON, "serParamData");
if (ser_param_data) {
ser_param_data_local_nonprim = OpenAPI_service_parameter_data_parseFromJSON(ser_param_data);
}
@ -161,6 +183,22 @@ OpenAPI_application_data_change_notif_t *OpenAPI_application_data_change_notif_p
return application_data_change_notif_local_var;
end:
if (iptv_config_data_local_nonprim) {
OpenAPI_iptv_config_data_free(iptv_config_data_local_nonprim);
iptv_config_data_local_nonprim = NULL;
}
if (pfd_data_local_nonprim) {
OpenAPI_pfd_change_notification_free(pfd_data_local_nonprim);
pfd_data_local_nonprim = NULL;
}
if (bdt_policy_data_local_nonprim) {
OpenAPI_bdt_policy_data_free(bdt_policy_data_local_nonprim);
bdt_policy_data_local_nonprim = NULL;
}
if (ser_param_data_local_nonprim) {
OpenAPI_service_parameter_data_free(ser_param_data_local_nonprim);
ser_param_data_local_nonprim = NULL;
}
return NULL;
}

View File

@ -24,23 +24,37 @@ OpenAPI_application_data_subs_t *OpenAPI_application_data_subs_create(
void OpenAPI_application_data_subs_free(OpenAPI_application_data_subs_t *application_data_subs)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == application_data_subs) {
return;
}
OpenAPI_lnode_t *node;
ogs_free(application_data_subs->notification_uri);
OpenAPI_list_for_each(application_data_subs->data_filters, node) {
OpenAPI_data_filter_free(node->data);
if (application_data_subs->notification_uri) {
ogs_free(application_data_subs->notification_uri);
application_data_subs->notification_uri = NULL;
}
if (application_data_subs->data_filters) {
OpenAPI_list_for_each(application_data_subs->data_filters, node) {
OpenAPI_data_filter_free(node->data);
}
OpenAPI_list_free(application_data_subs->data_filters);
application_data_subs->data_filters = NULL;
}
if (application_data_subs->expiry) {
ogs_free(application_data_subs->expiry);
application_data_subs->expiry = NULL;
}
if (application_data_subs->supported_features) {
ogs_free(application_data_subs->supported_features);
application_data_subs->supported_features = NULL;
}
OpenAPI_list_free(application_data_subs->data_filters);
ogs_free(application_data_subs->expiry);
ogs_free(application_data_subs->supported_features);
ogs_free(application_data_subs);
}
cJSON *OpenAPI_application_data_subs_convertToJSON(OpenAPI_application_data_subs_t *application_data_subs)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (application_data_subs == NULL) {
ogs_error("OpenAPI_application_data_subs_convertToJSON() failed [ApplicationDataSubs]");
@ -48,6 +62,10 @@ cJSON *OpenAPI_application_data_subs_convertToJSON(OpenAPI_application_data_subs
}
item = cJSON_CreateObject();
if (!application_data_subs->notification_uri) {
ogs_error("OpenAPI_application_data_subs_convertToJSON() failed [notification_uri]");
return NULL;
}
if (cJSON_AddStringToObject(item, "notificationUri", application_data_subs->notification_uri) == NULL) {
ogs_error("OpenAPI_application_data_subs_convertToJSON() failed [notification_uri]");
goto end;
@ -59,17 +77,13 @@ cJSON *OpenAPI_application_data_subs_convertToJSON(OpenAPI_application_data_subs
ogs_error("OpenAPI_application_data_subs_convertToJSON() failed [data_filters]");
goto end;
}
OpenAPI_lnode_t *data_filters_node;
if (application_data_subs->data_filters) {
OpenAPI_list_for_each(application_data_subs->data_filters, data_filters_node) {
cJSON *itemLocal = OpenAPI_data_filter_convertToJSON(data_filters_node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_application_data_subs_convertToJSON() failed [data_filters]");
goto end;
}
cJSON_AddItemToArray(data_filtersList, itemLocal);
OpenAPI_list_for_each(application_data_subs->data_filters, node) {
cJSON *itemLocal = OpenAPI_data_filter_convertToJSON(node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_application_data_subs_convertToJSON() failed [data_filters]");
goto end;
}
cJSON_AddItemToArray(data_filtersList, itemLocal);
}
}
@ -94,59 +108,58 @@ end:
OpenAPI_application_data_subs_t *OpenAPI_application_data_subs_parseFromJSON(cJSON *application_data_subsJSON)
{
OpenAPI_application_data_subs_t *application_data_subs_local_var = NULL;
cJSON *notification_uri = cJSON_GetObjectItemCaseSensitive(application_data_subsJSON, "notificationUri");
OpenAPI_lnode_t *node = NULL;
cJSON *notification_uri = NULL;
cJSON *data_filters = NULL;
OpenAPI_list_t *data_filtersList = NULL;
cJSON *expiry = NULL;
cJSON *supported_features = NULL;
notification_uri = cJSON_GetObjectItemCaseSensitive(application_data_subsJSON, "notificationUri");
if (!notification_uri) {
ogs_error("OpenAPI_application_data_subs_parseFromJSON() failed [notification_uri]");
goto end;
}
if (!cJSON_IsString(notification_uri)) {
ogs_error("OpenAPI_application_data_subs_parseFromJSON() failed [notification_uri]");
goto end;
}
cJSON *data_filters = cJSON_GetObjectItemCaseSensitive(application_data_subsJSON, "dataFilters");
OpenAPI_list_t *data_filtersList;
data_filters = cJSON_GetObjectItemCaseSensitive(application_data_subsJSON, "dataFilters");
if (data_filters) {
cJSON *data_filters_local_nonprimitive;
if (!cJSON_IsArray(data_filters)){
ogs_error("OpenAPI_application_data_subs_parseFromJSON() failed [data_filters]");
goto end;
}
data_filtersList = OpenAPI_list_create();
cJSON_ArrayForEach(data_filters_local_nonprimitive, data_filters ) {
if (!cJSON_IsObject(data_filters_local_nonprimitive)) {
cJSON *data_filters_local = NULL;
if (!cJSON_IsArray(data_filters)) {
ogs_error("OpenAPI_application_data_subs_parseFromJSON() failed [data_filters]");
goto end;
}
OpenAPI_data_filter_t *data_filtersItem = OpenAPI_data_filter_parseFromJSON(data_filters_local_nonprimitive);
if (!data_filtersItem) {
ogs_error("No data_filtersItem");
OpenAPI_list_free(data_filtersList);
goto end;
data_filtersList = OpenAPI_list_create();
cJSON_ArrayForEach(data_filters_local, data_filters) {
if (!cJSON_IsObject(data_filters_local)) {
ogs_error("OpenAPI_application_data_subs_parseFromJSON() failed [data_filters]");
goto end;
}
OpenAPI_data_filter_t *data_filtersItem = OpenAPI_data_filter_parseFromJSON(data_filters_local);
if (!data_filtersItem) {
ogs_error("No data_filtersItem");
OpenAPI_list_free(data_filtersList);
goto end;
}
OpenAPI_list_add(data_filtersList, data_filtersItem);
}
OpenAPI_list_add(data_filtersList, data_filtersItem);
}
}
cJSON *expiry = cJSON_GetObjectItemCaseSensitive(application_data_subsJSON, "expiry");
expiry = cJSON_GetObjectItemCaseSensitive(application_data_subsJSON, "expiry");
if (expiry) {
if (!cJSON_IsString(expiry)) {
if (!cJSON_IsString(expiry) && !cJSON_IsNull(expiry)) {
ogs_error("OpenAPI_application_data_subs_parseFromJSON() failed [expiry]");
goto end;
}
}
cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(application_data_subsJSON, "supportedFeatures");
supported_features = cJSON_GetObjectItemCaseSensitive(application_data_subsJSON, "supportedFeatures");
if (supported_features) {
if (!cJSON_IsString(supported_features)) {
if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) {
ogs_error("OpenAPI_application_data_subs_parseFromJSON() failed [supported_features]");
goto end;
}
@ -155,12 +168,19 @@ OpenAPI_application_data_subs_t *OpenAPI_application_data_subs_parseFromJSON(cJS
application_data_subs_local_var = OpenAPI_application_data_subs_create (
ogs_strdup(notification_uri->valuestring),
data_filters ? data_filtersList : NULL,
expiry ? ogs_strdup(expiry->valuestring) : NULL,
supported_features ? ogs_strdup(supported_features->valuestring) : NULL
expiry && !cJSON_IsNull(expiry) ? ogs_strdup(expiry->valuestring) : NULL,
supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL
);
return application_data_subs_local_var;
end:
if (data_filtersList) {
OpenAPI_list_for_each(data_filtersList, node) {
OpenAPI_data_filter_free(node->data);
}
OpenAPI_list_free(data_filtersList);
data_filtersList = NULL;
}
return NULL;
}

View File

@ -20,21 +20,29 @@ OpenAPI_area_t *OpenAPI_area_create(
void OpenAPI_area_free(OpenAPI_area_t *area)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == area) {
return;
}
OpenAPI_lnode_t *node;
OpenAPI_list_for_each(area->tacs, node) {
ogs_free(node->data);
if (area->tacs) {
OpenAPI_list_for_each(area->tacs, node) {
ogs_free(node->data);
}
OpenAPI_list_free(area->tacs);
area->tacs = NULL;
}
if (area->area_code) {
ogs_free(area->area_code);
area->area_code = NULL;
}
OpenAPI_list_free(area->tacs);
ogs_free(area->area_code);
ogs_free(area);
}
cJSON *OpenAPI_area_convertToJSON(OpenAPI_area_t *area)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (area == NULL) {
ogs_error("OpenAPI_area_convertToJSON() failed [Area]");
@ -43,19 +51,17 @@ cJSON *OpenAPI_area_convertToJSON(OpenAPI_area_t *area)
item = cJSON_CreateObject();
if (area->tacs) {
cJSON *tacs = cJSON_AddArrayToObject(item, "tacs");
if (tacs == NULL) {
cJSON *tacsList = cJSON_AddArrayToObject(item, "tacs");
if (tacsList == NULL) {
ogs_error("OpenAPI_area_convertToJSON() failed [tacs]");
goto end;
}
OpenAPI_lnode_t *tacs_node;
OpenAPI_list_for_each(area->tacs, tacs_node) {
if (cJSON_AddStringToObject(tacs, "", (char*)tacs_node->data) == NULL) {
ogs_error("OpenAPI_area_convertToJSON() failed [tacs]");
goto end;
OpenAPI_list_for_each(area->tacs, node) {
if (cJSON_AddStringToObject(tacsList, "", (char*)node->data) == NULL) {
ogs_error("OpenAPI_area_convertToJSON() failed [tacs]");
goto end;
}
}
}
}
if (area->area_code) {
@ -72,30 +78,34 @@ end:
OpenAPI_area_t *OpenAPI_area_parseFromJSON(cJSON *areaJSON)
{
OpenAPI_area_t *area_local_var = NULL;
cJSON *tacs = cJSON_GetObjectItemCaseSensitive(areaJSON, "tacs");
OpenAPI_list_t *tacsList;
OpenAPI_lnode_t *node = NULL;
cJSON *tacs = NULL;
OpenAPI_list_t *tacsList = NULL;
cJSON *area_code = NULL;
tacs = cJSON_GetObjectItemCaseSensitive(areaJSON, "tacs");
if (tacs) {
cJSON *tacs_local;
if (!cJSON_IsArray(tacs)) {
ogs_error("OpenAPI_area_parseFromJSON() failed [tacs]");
goto end;
}
tacsList = OpenAPI_list_create();
cJSON *tacs_local = NULL;
if (!cJSON_IsArray(tacs)) {
ogs_error("OpenAPI_area_parseFromJSON() failed [tacs]");
goto end;
}
cJSON_ArrayForEach(tacs_local, tacs) {
if (!cJSON_IsString(tacs_local)) {
ogs_error("OpenAPI_area_parseFromJSON() failed [tacs]");
goto end;
}
OpenAPI_list_add(tacsList, ogs_strdup(tacs_local->valuestring));
}
tacsList = OpenAPI_list_create();
cJSON_ArrayForEach(tacs_local, tacs) {
double *localDouble = NULL;
int *localInt = NULL;
if (!cJSON_IsString(tacs_local)) {
ogs_error("OpenAPI_area_parseFromJSON() failed [tacs]");
goto end;
}
OpenAPI_list_add(tacsList, ogs_strdup(tacs_local->valuestring));
}
}
cJSON *area_code = cJSON_GetObjectItemCaseSensitive(areaJSON, "areaCode");
area_code = cJSON_GetObjectItemCaseSensitive(areaJSON, "areaCode");
if (area_code) {
if (!cJSON_IsString(area_code)) {
if (!cJSON_IsString(area_code) && !cJSON_IsNull(area_code)) {
ogs_error("OpenAPI_area_parseFromJSON() failed [area_code]");
goto end;
}
@ -103,11 +113,18 @@ OpenAPI_area_t *OpenAPI_area_parseFromJSON(cJSON *areaJSON)
area_local_var = OpenAPI_area_create (
tacs ? tacsList : NULL,
area_code ? ogs_strdup(area_code->valuestring) : NULL
area_code && !cJSON_IsNull(area_code) ? ogs_strdup(area_code->valuestring) : NULL
);
return area_local_var;
end:
if (tacsList) {
OpenAPI_list_for_each(tacsList, node) {
ogs_free(node->data);
}
OpenAPI_list_free(tacsList);
tacsList = NULL;
}
return NULL;
}

View File

@ -20,21 +20,29 @@ OpenAPI_area_1_t *OpenAPI_area_1_create(
void OpenAPI_area_1_free(OpenAPI_area_1_t *area_1)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == area_1) {
return;
}
OpenAPI_lnode_t *node;
OpenAPI_list_for_each(area_1->tacs, node) {
ogs_free(node->data);
if (area_1->tacs) {
OpenAPI_list_for_each(area_1->tacs, node) {
ogs_free(node->data);
}
OpenAPI_list_free(area_1->tacs);
area_1->tacs = NULL;
}
if (area_1->area_code) {
ogs_free(area_1->area_code);
area_1->area_code = NULL;
}
OpenAPI_list_free(area_1->tacs);
ogs_free(area_1->area_code);
ogs_free(area_1);
}
cJSON *OpenAPI_area_1_convertToJSON(OpenAPI_area_1_t *area_1)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (area_1 == NULL) {
ogs_error("OpenAPI_area_1_convertToJSON() failed [Area_1]");
@ -43,19 +51,17 @@ cJSON *OpenAPI_area_1_convertToJSON(OpenAPI_area_1_t *area_1)
item = cJSON_CreateObject();
if (area_1->tacs) {
cJSON *tacs = cJSON_AddArrayToObject(item, "tacs");
if (tacs == NULL) {
cJSON *tacsList = cJSON_AddArrayToObject(item, "tacs");
if (tacsList == NULL) {
ogs_error("OpenAPI_area_1_convertToJSON() failed [tacs]");
goto end;
}
OpenAPI_lnode_t *tacs_node;
OpenAPI_list_for_each(area_1->tacs, tacs_node) {
if (cJSON_AddStringToObject(tacs, "", (char*)tacs_node->data) == NULL) {
ogs_error("OpenAPI_area_1_convertToJSON() failed [tacs]");
goto end;
OpenAPI_list_for_each(area_1->tacs, node) {
if (cJSON_AddStringToObject(tacsList, "", (char*)node->data) == NULL) {
ogs_error("OpenAPI_area_1_convertToJSON() failed [tacs]");
goto end;
}
}
}
}
if (area_1->area_code) {
@ -72,30 +78,34 @@ end:
OpenAPI_area_1_t *OpenAPI_area_1_parseFromJSON(cJSON *area_1JSON)
{
OpenAPI_area_1_t *area_1_local_var = NULL;
cJSON *tacs = cJSON_GetObjectItemCaseSensitive(area_1JSON, "tacs");
OpenAPI_list_t *tacsList;
OpenAPI_lnode_t *node = NULL;
cJSON *tacs = NULL;
OpenAPI_list_t *tacsList = NULL;
cJSON *area_code = NULL;
tacs = cJSON_GetObjectItemCaseSensitive(area_1JSON, "tacs");
if (tacs) {
cJSON *tacs_local;
if (!cJSON_IsArray(tacs)) {
ogs_error("OpenAPI_area_1_parseFromJSON() failed [tacs]");
goto end;
}
tacsList = OpenAPI_list_create();
cJSON *tacs_local = NULL;
if (!cJSON_IsArray(tacs)) {
ogs_error("OpenAPI_area_1_parseFromJSON() failed [tacs]");
goto end;
}
cJSON_ArrayForEach(tacs_local, tacs) {
if (!cJSON_IsString(tacs_local)) {
ogs_error("OpenAPI_area_1_parseFromJSON() failed [tacs]");
goto end;
}
OpenAPI_list_add(tacsList, ogs_strdup(tacs_local->valuestring));
}
tacsList = OpenAPI_list_create();
cJSON_ArrayForEach(tacs_local, tacs) {
double *localDouble = NULL;
int *localInt = NULL;
if (!cJSON_IsString(tacs_local)) {
ogs_error("OpenAPI_area_1_parseFromJSON() failed [tacs]");
goto end;
}
OpenAPI_list_add(tacsList, ogs_strdup(tacs_local->valuestring));
}
}
cJSON *area_code = cJSON_GetObjectItemCaseSensitive(area_1JSON, "areaCode");
area_code = cJSON_GetObjectItemCaseSensitive(area_1JSON, "areaCode");
if (area_code) {
if (!cJSON_IsString(area_code)) {
if (!cJSON_IsString(area_code) && !cJSON_IsNull(area_code)) {
ogs_error("OpenAPI_area_1_parseFromJSON() failed [area_code]");
goto end;
}
@ -103,11 +113,18 @@ OpenAPI_area_1_t *OpenAPI_area_1_parseFromJSON(cJSON *area_1JSON)
area_1_local_var = OpenAPI_area_1_create (
tacs ? tacsList : NULL,
area_code ? ogs_strdup(area_code->valuestring) : NULL
area_code && !cJSON_IsNull(area_code) ? ogs_strdup(area_code->valuestring) : NULL
);
return area_1_local_var;
end:
if (tacsList) {
OpenAPI_list_for_each(tacsList, node) {
ogs_free(node->data);
}
OpenAPI_list_free(tacsList);
tacsList = NULL;
}
return NULL;
}

View File

@ -18,20 +18,25 @@ OpenAPI_area_of_validity_t *OpenAPI_area_of_validity_create(
void OpenAPI_area_of_validity_free(OpenAPI_area_of_validity_t *area_of_validity)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == area_of_validity) {
return;
}
OpenAPI_lnode_t *node;
OpenAPI_list_for_each(area_of_validity->tai_list, node) {
OpenAPI_tai_free(node->data);
if (area_of_validity->tai_list) {
OpenAPI_list_for_each(area_of_validity->tai_list, node) {
OpenAPI_tai_free(node->data);
}
OpenAPI_list_free(area_of_validity->tai_list);
area_of_validity->tai_list = NULL;
}
OpenAPI_list_free(area_of_validity->tai_list);
ogs_free(area_of_validity);
}
cJSON *OpenAPI_area_of_validity_convertToJSON(OpenAPI_area_of_validity_t *area_of_validity)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (area_of_validity == NULL) {
ogs_error("OpenAPI_area_of_validity_convertToJSON() failed [AreaOfValidity]");
@ -39,22 +44,22 @@ cJSON *OpenAPI_area_of_validity_convertToJSON(OpenAPI_area_of_validity_t *area_o
}
item = cJSON_CreateObject();
if (!area_of_validity->tai_list) {
ogs_error("OpenAPI_area_of_validity_convertToJSON() failed [tai_list]");
return NULL;
}
cJSON *tai_listList = cJSON_AddArrayToObject(item, "taiList");
if (tai_listList == NULL) {
ogs_error("OpenAPI_area_of_validity_convertToJSON() failed [tai_list]");
goto end;
}
OpenAPI_lnode_t *tai_list_node;
if (area_of_validity->tai_list) {
OpenAPI_list_for_each(area_of_validity->tai_list, tai_list_node) {
cJSON *itemLocal = OpenAPI_tai_convertToJSON(tai_list_node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_area_of_validity_convertToJSON() failed [tai_list]");
goto end;
}
cJSON_AddItemToArray(tai_listList, itemLocal);
OpenAPI_list_for_each(area_of_validity->tai_list, node) {
cJSON *itemLocal = OpenAPI_tai_convertToJSON(node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_area_of_validity_convertToJSON() failed [tai_list]");
goto end;
}
cJSON_AddItemToArray(tai_listList, itemLocal);
}
end:
@ -64,43 +69,49 @@ end:
OpenAPI_area_of_validity_t *OpenAPI_area_of_validity_parseFromJSON(cJSON *area_of_validityJSON)
{
OpenAPI_area_of_validity_t *area_of_validity_local_var = NULL;
cJSON *tai_list = cJSON_GetObjectItemCaseSensitive(area_of_validityJSON, "taiList");
OpenAPI_lnode_t *node = NULL;
cJSON *tai_list = NULL;
OpenAPI_list_t *tai_listList = NULL;
tai_list = cJSON_GetObjectItemCaseSensitive(area_of_validityJSON, "taiList");
if (!tai_list) {
ogs_error("OpenAPI_area_of_validity_parseFromJSON() failed [tai_list]");
goto end;
}
OpenAPI_list_t *tai_listList;
cJSON *tai_list_local_nonprimitive;
if (!cJSON_IsArray(tai_list)){
ogs_error("OpenAPI_area_of_validity_parseFromJSON() failed [tai_list]");
goto end;
}
tai_listList = OpenAPI_list_create();
cJSON_ArrayForEach(tai_list_local_nonprimitive, tai_list ) {
if (!cJSON_IsObject(tai_list_local_nonprimitive)) {
cJSON *tai_list_local = NULL;
if (!cJSON_IsArray(tai_list)) {
ogs_error("OpenAPI_area_of_validity_parseFromJSON() failed [tai_list]");
goto end;
}
OpenAPI_tai_t *tai_listItem = OpenAPI_tai_parseFromJSON(tai_list_local_nonprimitive);
if (!tai_listItem) {
ogs_error("No tai_listItem");
OpenAPI_list_free(tai_listList);
goto end;
tai_listList = OpenAPI_list_create();
cJSON_ArrayForEach(tai_list_local, tai_list) {
if (!cJSON_IsObject(tai_list_local)) {
ogs_error("OpenAPI_area_of_validity_parseFromJSON() failed [tai_list]");
goto end;
}
OpenAPI_tai_t *tai_listItem = OpenAPI_tai_parseFromJSON(tai_list_local);
if (!tai_listItem) {
ogs_error("No tai_listItem");
OpenAPI_list_free(tai_listList);
goto end;
}
OpenAPI_list_add(tai_listList, tai_listItem);
}
OpenAPI_list_add(tai_listList, tai_listItem);
}
area_of_validity_local_var = OpenAPI_area_of_validity_create (
tai_listList
);
return area_of_validity_local_var;
end:
if (tai_listList) {
OpenAPI_list_for_each(tai_listList, node) {
OpenAPI_tai_free(node->data);
}
OpenAPI_list_free(tai_listList);
tai_listList = NULL;
}
return NULL;
}

View File

@ -24,35 +24,49 @@ OpenAPI_area_scope_t *OpenAPI_area_scope_create(
void OpenAPI_area_scope_free(OpenAPI_area_scope_t *area_scope)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == area_scope) {
return;
}
OpenAPI_lnode_t *node;
OpenAPI_list_for_each(area_scope->eutra_cell_id_list, node) {
ogs_free(node->data);
if (area_scope->eutra_cell_id_list) {
OpenAPI_list_for_each(area_scope->eutra_cell_id_list, node) {
ogs_free(node->data);
}
OpenAPI_list_free(area_scope->eutra_cell_id_list);
area_scope->eutra_cell_id_list = NULL;
}
OpenAPI_list_free(area_scope->eutra_cell_id_list);
OpenAPI_list_for_each(area_scope->nr_cell_id_list, node) {
ogs_free(node->data);
if (area_scope->nr_cell_id_list) {
OpenAPI_list_for_each(area_scope->nr_cell_id_list, node) {
ogs_free(node->data);
}
OpenAPI_list_free(area_scope->nr_cell_id_list);
area_scope->nr_cell_id_list = NULL;
}
OpenAPI_list_free(area_scope->nr_cell_id_list);
OpenAPI_list_for_each(area_scope->tac_list, node) {
ogs_free(node->data);
if (area_scope->tac_list) {
OpenAPI_list_for_each(area_scope->tac_list, node) {
ogs_free(node->data);
}
OpenAPI_list_free(area_scope->tac_list);
area_scope->tac_list = NULL;
}
OpenAPI_list_free(area_scope->tac_list);
OpenAPI_list_for_each(area_scope->tac_info_per_plmn, node) {
OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data;
ogs_free(localKeyValue->key);
OpenAPI_tac_info_free(localKeyValue->value);
ogs_free(localKeyValue);
if (area_scope->tac_info_per_plmn) {
OpenAPI_list_for_each(area_scope->tac_info_per_plmn, node) {
OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data;
ogs_free(localKeyValue->key);
OpenAPI_tac_info_free(localKeyValue->value);
OpenAPI_map_free(localKeyValue);
}
OpenAPI_list_free(area_scope->tac_info_per_plmn);
area_scope->tac_info_per_plmn = NULL;
}
OpenAPI_list_free(area_scope->tac_info_per_plmn);
ogs_free(area_scope);
}
cJSON *OpenAPI_area_scope_convertToJSON(OpenAPI_area_scope_t *area_scope)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (area_scope == NULL) {
ogs_error("OpenAPI_area_scope_convertToJSON() failed [AreaScope]");
@ -61,51 +75,45 @@ cJSON *OpenAPI_area_scope_convertToJSON(OpenAPI_area_scope_t *area_scope)
item = cJSON_CreateObject();
if (area_scope->eutra_cell_id_list) {
cJSON *eutra_cell_id_list = cJSON_AddArrayToObject(item, "eutraCellIdList");
if (eutra_cell_id_list == NULL) {
cJSON *eutra_cell_id_listList = cJSON_AddArrayToObject(item, "eutraCellIdList");
if (eutra_cell_id_listList == NULL) {
ogs_error("OpenAPI_area_scope_convertToJSON() failed [eutra_cell_id_list]");
goto end;
}
OpenAPI_lnode_t *eutra_cell_id_list_node;
OpenAPI_list_for_each(area_scope->eutra_cell_id_list, eutra_cell_id_list_node) {
if (cJSON_AddStringToObject(eutra_cell_id_list, "", (char*)eutra_cell_id_list_node->data) == NULL) {
ogs_error("OpenAPI_area_scope_convertToJSON() failed [eutra_cell_id_list]");
goto end;
OpenAPI_list_for_each(area_scope->eutra_cell_id_list, node) {
if (cJSON_AddStringToObject(eutra_cell_id_listList, "", (char*)node->data) == NULL) {
ogs_error("OpenAPI_area_scope_convertToJSON() failed [eutra_cell_id_list]");
goto end;
}
}
}
}
if (area_scope->nr_cell_id_list) {
cJSON *nr_cell_id_list = cJSON_AddArrayToObject(item, "nrCellIdList");
if (nr_cell_id_list == NULL) {
cJSON *nr_cell_id_listList = cJSON_AddArrayToObject(item, "nrCellIdList");
if (nr_cell_id_listList == NULL) {
ogs_error("OpenAPI_area_scope_convertToJSON() failed [nr_cell_id_list]");
goto end;
}
OpenAPI_lnode_t *nr_cell_id_list_node;
OpenAPI_list_for_each(area_scope->nr_cell_id_list, nr_cell_id_list_node) {
if (cJSON_AddStringToObject(nr_cell_id_list, "", (char*)nr_cell_id_list_node->data) == NULL) {
ogs_error("OpenAPI_area_scope_convertToJSON() failed [nr_cell_id_list]");
goto end;
OpenAPI_list_for_each(area_scope->nr_cell_id_list, node) {
if (cJSON_AddStringToObject(nr_cell_id_listList, "", (char*)node->data) == NULL) {
ogs_error("OpenAPI_area_scope_convertToJSON() failed [nr_cell_id_list]");
goto end;
}
}
}
}
if (area_scope->tac_list) {
cJSON *tac_list = cJSON_AddArrayToObject(item, "tacList");
if (tac_list == NULL) {
cJSON *tac_listList = cJSON_AddArrayToObject(item, "tacList");
if (tac_listList == NULL) {
ogs_error("OpenAPI_area_scope_convertToJSON() failed [tac_list]");
goto end;
}
OpenAPI_lnode_t *tac_list_node;
OpenAPI_list_for_each(area_scope->tac_list, tac_list_node) {
if (cJSON_AddStringToObject(tac_list, "", (char*)tac_list_node->data) == NULL) {
ogs_error("OpenAPI_area_scope_convertToJSON() failed [tac_list]");
goto end;
OpenAPI_list_for_each(area_scope->tac_list, node) {
if (cJSON_AddStringToObject(tac_listList, "", (char*)node->data) == NULL) {
ogs_error("OpenAPI_area_scope_convertToJSON() failed [tac_list]");
goto end;
}
}
}
}
if (area_scope->tac_info_per_plmn) {
@ -115,21 +123,20 @@ cJSON *OpenAPI_area_scope_convertToJSON(OpenAPI_area_scope_t *area_scope)
goto end;
}
cJSON *localMapObject = tac_info_per_plmn;
OpenAPI_lnode_t *tac_info_per_plmn_node;
if (area_scope->tac_info_per_plmn) {
OpenAPI_list_for_each(area_scope->tac_info_per_plmn, tac_info_per_plmn_node) {
OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)tac_info_per_plmn_node->data;
cJSON *itemLocal = localKeyValue->value ?
OpenAPI_tac_info_convertToJSON(localKeyValue->value) :
cJSON_CreateNull();
if (itemLocal == NULL) {
ogs_error("OpenAPI_area_scope_convertToJSON() failed [inner]");
goto end;
}
cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal);
OpenAPI_list_for_each(area_scope->tac_info_per_plmn, node) {
OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data;
cJSON *itemLocal = localKeyValue->value ?
OpenAPI_tac_info_convertToJSON(localKeyValue->value) :
cJSON_CreateNull();
if (itemLocal == NULL) {
ogs_error("OpenAPI_area_scope_convertToJSON() failed [inner]");
goto end;
}
cJSON_AddItemToObject(localMapObject, localKeyValue->key, itemLocal);
}
}
}
end:
return item;
@ -138,90 +145,102 @@ end:
OpenAPI_area_scope_t *OpenAPI_area_scope_parseFromJSON(cJSON *area_scopeJSON)
{
OpenAPI_area_scope_t *area_scope_local_var = NULL;
cJSON *eutra_cell_id_list = cJSON_GetObjectItemCaseSensitive(area_scopeJSON, "eutraCellIdList");
OpenAPI_list_t *eutra_cell_id_listList;
OpenAPI_lnode_t *node = NULL;
cJSON *eutra_cell_id_list = NULL;
OpenAPI_list_t *eutra_cell_id_listList = NULL;
cJSON *nr_cell_id_list = NULL;
OpenAPI_list_t *nr_cell_id_listList = NULL;
cJSON *tac_list = NULL;
OpenAPI_list_t *tac_listList = NULL;
cJSON *tac_info_per_plmn = NULL;
OpenAPI_list_t *tac_info_per_plmnList = NULL;
eutra_cell_id_list = cJSON_GetObjectItemCaseSensitive(area_scopeJSON, "eutraCellIdList");
if (eutra_cell_id_list) {
cJSON *eutra_cell_id_list_local;
if (!cJSON_IsArray(eutra_cell_id_list)) {
ogs_error("OpenAPI_area_scope_parseFromJSON() failed [eutra_cell_id_list]");
goto end;
}
eutra_cell_id_listList = OpenAPI_list_create();
cJSON_ArrayForEach(eutra_cell_id_list_local, eutra_cell_id_list) {
if (!cJSON_IsString(eutra_cell_id_list_local)) {
ogs_error("OpenAPI_area_scope_parseFromJSON() failed [eutra_cell_id_list]");
goto end;
}
OpenAPI_list_add(eutra_cell_id_listList, ogs_strdup(eutra_cell_id_list_local->valuestring));
}
}
cJSON *nr_cell_id_list = cJSON_GetObjectItemCaseSensitive(area_scopeJSON, "nrCellIdList");
OpenAPI_list_t *nr_cell_id_listList;
if (nr_cell_id_list) {
cJSON *nr_cell_id_list_local;
if (!cJSON_IsArray(nr_cell_id_list)) {
ogs_error("OpenAPI_area_scope_parseFromJSON() failed [nr_cell_id_list]");
goto end;
}
nr_cell_id_listList = OpenAPI_list_create();
cJSON_ArrayForEach(nr_cell_id_list_local, nr_cell_id_list) {
if (!cJSON_IsString(nr_cell_id_list_local)) {
ogs_error("OpenAPI_area_scope_parseFromJSON() failed [nr_cell_id_list]");
goto end;
}
OpenAPI_list_add(nr_cell_id_listList, ogs_strdup(nr_cell_id_list_local->valuestring));
}
}
cJSON *tac_list = cJSON_GetObjectItemCaseSensitive(area_scopeJSON, "tacList");
OpenAPI_list_t *tac_listList;
if (tac_list) {
cJSON *tac_list_local;
if (!cJSON_IsArray(tac_list)) {
ogs_error("OpenAPI_area_scope_parseFromJSON() failed [tac_list]");
goto end;
}
tac_listList = OpenAPI_list_create();
cJSON_ArrayForEach(tac_list_local, tac_list) {
if (!cJSON_IsString(tac_list_local)) {
ogs_error("OpenAPI_area_scope_parseFromJSON() failed [tac_list]");
goto end;
}
OpenAPI_list_add(tac_listList, ogs_strdup(tac_list_local->valuestring));
}
}
cJSON *tac_info_per_plmn = cJSON_GetObjectItemCaseSensitive(area_scopeJSON, "tacInfoPerPlmn");
OpenAPI_list_t *tac_info_per_plmnList;
if (tac_info_per_plmn) {
cJSON *tac_info_per_plmn_local_map;
if (!cJSON_IsObject(tac_info_per_plmn)) {
ogs_error("OpenAPI_area_scope_parseFromJSON() failed [tac_info_per_plmn]");
goto end;
}
tac_info_per_plmnList = OpenAPI_list_create();
OpenAPI_map_t *localMapKeyPair = NULL;
cJSON_ArrayForEach(tac_info_per_plmn_local_map, tac_info_per_plmn) {
cJSON *localMapObject = tac_info_per_plmn_local_map;
if (cJSON_IsObject(localMapObject)) {
localMapKeyPair = OpenAPI_map_create(
ogs_strdup(localMapObject->string), OpenAPI_tac_info_parseFromJSON(localMapObject));
} else if (cJSON_IsNull(localMapObject)) {
localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL);
} else {
ogs_error("OpenAPI_area_scope_parseFromJSON() failed [inner]");
cJSON *eutra_cell_id_list_local = NULL;
if (!cJSON_IsArray(eutra_cell_id_list)) {
ogs_error("OpenAPI_area_scope_parseFromJSON() failed [eutra_cell_id_list]");
goto end;
}
OpenAPI_list_add(tac_info_per_plmnList, localMapKeyPair);
eutra_cell_id_listList = OpenAPI_list_create();
cJSON_ArrayForEach(eutra_cell_id_list_local, eutra_cell_id_list) {
double *localDouble = NULL;
int *localInt = NULL;
if (!cJSON_IsString(eutra_cell_id_list_local)) {
ogs_error("OpenAPI_area_scope_parseFromJSON() failed [eutra_cell_id_list]");
goto end;
}
OpenAPI_list_add(eutra_cell_id_listList, ogs_strdup(eutra_cell_id_list_local->valuestring));
}
}
nr_cell_id_list = cJSON_GetObjectItemCaseSensitive(area_scopeJSON, "nrCellIdList");
if (nr_cell_id_list) {
cJSON *nr_cell_id_list_local = NULL;
if (!cJSON_IsArray(nr_cell_id_list)) {
ogs_error("OpenAPI_area_scope_parseFromJSON() failed [nr_cell_id_list]");
goto end;
}
nr_cell_id_listList = OpenAPI_list_create();
cJSON_ArrayForEach(nr_cell_id_list_local, nr_cell_id_list) {
double *localDouble = NULL;
int *localInt = NULL;
if (!cJSON_IsString(nr_cell_id_list_local)) {
ogs_error("OpenAPI_area_scope_parseFromJSON() failed [nr_cell_id_list]");
goto end;
}
OpenAPI_list_add(nr_cell_id_listList, ogs_strdup(nr_cell_id_list_local->valuestring));
}
}
tac_list = cJSON_GetObjectItemCaseSensitive(area_scopeJSON, "tacList");
if (tac_list) {
cJSON *tac_list_local = NULL;
if (!cJSON_IsArray(tac_list)) {
ogs_error("OpenAPI_area_scope_parseFromJSON() failed [tac_list]");
goto end;
}
tac_listList = OpenAPI_list_create();
cJSON_ArrayForEach(tac_list_local, tac_list) {
double *localDouble = NULL;
int *localInt = NULL;
if (!cJSON_IsString(tac_list_local)) {
ogs_error("OpenAPI_area_scope_parseFromJSON() failed [tac_list]");
goto end;
}
OpenAPI_list_add(tac_listList, ogs_strdup(tac_list_local->valuestring));
}
}
tac_info_per_plmn = cJSON_GetObjectItemCaseSensitive(area_scopeJSON, "tacInfoPerPlmn");
if (tac_info_per_plmn) {
cJSON *tac_info_per_plmn_local_map = NULL;
if (!cJSON_IsObject(tac_info_per_plmn) && !cJSON_IsNull(tac_info_per_plmn)) {
ogs_error("OpenAPI_area_scope_parseFromJSON() failed [tac_info_per_plmn]");
goto end;
}
if (cJSON_IsObject(tac_info_per_plmn)) {
tac_info_per_plmnList = OpenAPI_list_create();
OpenAPI_map_t *localMapKeyPair = NULL;
cJSON_ArrayForEach(tac_info_per_plmn_local_map, tac_info_per_plmn) {
cJSON *localMapObject = tac_info_per_plmn_local_map;
if (cJSON_IsObject(localMapObject)) {
localMapKeyPair = OpenAPI_map_create(
ogs_strdup(localMapObject->string), OpenAPI_tac_info_parseFromJSON(localMapObject));
} else if (cJSON_IsNull(localMapObject)) {
localMapKeyPair = OpenAPI_map_create(ogs_strdup(localMapObject->string), NULL);
} else {
ogs_error("OpenAPI_area_scope_parseFromJSON() failed [inner]");
goto end;
}
OpenAPI_list_add(tac_info_per_plmnList, localMapKeyPair);
}
}
}
area_scope_local_var = OpenAPI_area_scope_create (
@ -233,6 +252,37 @@ OpenAPI_area_scope_t *OpenAPI_area_scope_parseFromJSON(cJSON *area_scopeJSON)
return area_scope_local_var;
end:
if (eutra_cell_id_listList) {
OpenAPI_list_for_each(eutra_cell_id_listList, node) {
ogs_free(node->data);
}
OpenAPI_list_free(eutra_cell_id_listList);
eutra_cell_id_listList = NULL;
}
if (nr_cell_id_listList) {
OpenAPI_list_for_each(nr_cell_id_listList, node) {
ogs_free(node->data);
}
OpenAPI_list_free(nr_cell_id_listList);
nr_cell_id_listList = NULL;
}
if (tac_listList) {
OpenAPI_list_for_each(tac_listList, node) {
ogs_free(node->data);
}
OpenAPI_list_free(tac_listList);
tac_listList = NULL;
}
if (tac_info_per_plmnList) {
OpenAPI_list_for_each(tac_info_per_plmnList, node) {
OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*) node->data;
ogs_free(localKeyValue->key);
OpenAPI_tac_info_free(localKeyValue->value);
OpenAPI_map_free(localKeyValue);
}
OpenAPI_list_free(tac_info_per_plmnList);
tac_info_per_plmnList = NULL;
}
return NULL;
}

View File

@ -22,16 +22,18 @@ OpenAPI_arp_t *OpenAPI_arp_create(
void OpenAPI_arp_free(OpenAPI_arp_t *arp)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == arp) {
return;
}
OpenAPI_lnode_t *node;
ogs_free(arp);
}
cJSON *OpenAPI_arp_convertToJSON(OpenAPI_arp_t *arp)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (arp == NULL) {
ogs_error("OpenAPI_arp_convertToJSON() failed [Arp]");
@ -44,11 +46,19 @@ cJSON *OpenAPI_arp_convertToJSON(OpenAPI_arp_t *arp)
goto end;
}
if (arp->preempt_cap == OpenAPI_preemption_capability_NULL) {
ogs_error("OpenAPI_arp_convertToJSON() failed [preempt_cap]");
return NULL;
}
if (cJSON_AddStringToObject(item, "preemptCap", OpenAPI_preemption_capability_ToString(arp->preempt_cap)) == NULL) {
ogs_error("OpenAPI_arp_convertToJSON() failed [preempt_cap]");
goto end;
}
if (arp->preempt_vuln == OpenAPI_preemption_vulnerability_NULL) {
ogs_error("OpenAPI_arp_convertToJSON() failed [preempt_vuln]");
return NULL;
}
if (cJSON_AddStringToObject(item, "preemptVuln", OpenAPI_preemption_vulnerability_ToString(arp->preempt_vuln)) == NULL) {
ogs_error("OpenAPI_arp_convertToJSON() failed [preempt_vuln]");
goto end;
@ -61,37 +71,38 @@ end:
OpenAPI_arp_t *OpenAPI_arp_parseFromJSON(cJSON *arpJSON)
{
OpenAPI_arp_t *arp_local_var = NULL;
cJSON *priority_level = cJSON_GetObjectItemCaseSensitive(arpJSON, "priorityLevel");
OpenAPI_lnode_t *node = NULL;
cJSON *priority_level = NULL;
cJSON *preempt_cap = NULL;
OpenAPI_preemption_capability_e preempt_capVariable = 0;
cJSON *preempt_vuln = NULL;
OpenAPI_preemption_vulnerability_e preempt_vulnVariable = 0;
priority_level = cJSON_GetObjectItemCaseSensitive(arpJSON, "priorityLevel");
if (!priority_level) {
ogs_error("OpenAPI_arp_parseFromJSON() failed [priority_level]");
goto end;
}
if (!cJSON_IsNumber(priority_level)) {
ogs_error("OpenAPI_arp_parseFromJSON() failed [priority_level]");
goto end;
}
cJSON *preempt_cap = cJSON_GetObjectItemCaseSensitive(arpJSON, "preemptCap");
preempt_cap = cJSON_GetObjectItemCaseSensitive(arpJSON, "preemptCap");
if (!preempt_cap) {
ogs_error("OpenAPI_arp_parseFromJSON() failed [preempt_cap]");
goto end;
}
OpenAPI_preemption_capability_e preempt_capVariable;
if (!cJSON_IsString(preempt_cap)) {
ogs_error("OpenAPI_arp_parseFromJSON() failed [preempt_cap]");
goto end;
}
preempt_capVariable = OpenAPI_preemption_capability_FromString(preempt_cap->valuestring);
cJSON *preempt_vuln = cJSON_GetObjectItemCaseSensitive(arpJSON, "preemptVuln");
preempt_vuln = cJSON_GetObjectItemCaseSensitive(arpJSON, "preemptVuln");
if (!preempt_vuln) {
ogs_error("OpenAPI_arp_parseFromJSON() failed [preempt_vuln]");
goto end;
}
OpenAPI_preemption_vulnerability_e preempt_vulnVariable;
if (!cJSON_IsString(preempt_vuln)) {
ogs_error("OpenAPI_arp_parseFromJSON() failed [preempt_vuln]");
goto end;

View File

@ -22,16 +22,18 @@ OpenAPI_arp_1_t *OpenAPI_arp_1_create(
void OpenAPI_arp_1_free(OpenAPI_arp_1_t *arp_1)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == arp_1) {
return;
}
OpenAPI_lnode_t *node;
ogs_free(arp_1);
}
cJSON *OpenAPI_arp_1_convertToJSON(OpenAPI_arp_1_t *arp_1)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (arp_1 == NULL) {
ogs_error("OpenAPI_arp_1_convertToJSON() failed [Arp_1]");
@ -44,11 +46,19 @@ cJSON *OpenAPI_arp_1_convertToJSON(OpenAPI_arp_1_t *arp_1)
goto end;
}
if (arp_1->preempt_cap == OpenAPI_preemption_capability_NULL) {
ogs_error("OpenAPI_arp_1_convertToJSON() failed [preempt_cap]");
return NULL;
}
if (cJSON_AddStringToObject(item, "preemptCap", OpenAPI_preemption_capability_ToString(arp_1->preempt_cap)) == NULL) {
ogs_error("OpenAPI_arp_1_convertToJSON() failed [preempt_cap]");
goto end;
}
if (arp_1->preempt_vuln == OpenAPI_preemption_vulnerability_NULL) {
ogs_error("OpenAPI_arp_1_convertToJSON() failed [preempt_vuln]");
return NULL;
}
if (cJSON_AddStringToObject(item, "preemptVuln", OpenAPI_preemption_vulnerability_ToString(arp_1->preempt_vuln)) == NULL) {
ogs_error("OpenAPI_arp_1_convertToJSON() failed [preempt_vuln]");
goto end;
@ -61,37 +71,38 @@ end:
OpenAPI_arp_1_t *OpenAPI_arp_1_parseFromJSON(cJSON *arp_1JSON)
{
OpenAPI_arp_1_t *arp_1_local_var = NULL;
cJSON *priority_level = cJSON_GetObjectItemCaseSensitive(arp_1JSON, "priorityLevel");
OpenAPI_lnode_t *node = NULL;
cJSON *priority_level = NULL;
cJSON *preempt_cap = NULL;
OpenAPI_preemption_capability_e preempt_capVariable = 0;
cJSON *preempt_vuln = NULL;
OpenAPI_preemption_vulnerability_e preempt_vulnVariable = 0;
priority_level = cJSON_GetObjectItemCaseSensitive(arp_1JSON, "priorityLevel");
if (!priority_level) {
ogs_error("OpenAPI_arp_1_parseFromJSON() failed [priority_level]");
goto end;
}
if (!cJSON_IsNumber(priority_level)) {
ogs_error("OpenAPI_arp_1_parseFromJSON() failed [priority_level]");
goto end;
}
cJSON *preempt_cap = cJSON_GetObjectItemCaseSensitive(arp_1JSON, "preemptCap");
preempt_cap = cJSON_GetObjectItemCaseSensitive(arp_1JSON, "preemptCap");
if (!preempt_cap) {
ogs_error("OpenAPI_arp_1_parseFromJSON() failed [preempt_cap]");
goto end;
}
OpenAPI_preemption_capability_e preempt_capVariable;
if (!cJSON_IsString(preempt_cap)) {
ogs_error("OpenAPI_arp_1_parseFromJSON() failed [preempt_cap]");
goto end;
}
preempt_capVariable = OpenAPI_preemption_capability_FromString(preempt_cap->valuestring);
cJSON *preempt_vuln = cJSON_GetObjectItemCaseSensitive(arp_1JSON, "preemptVuln");
preempt_vuln = cJSON_GetObjectItemCaseSensitive(arp_1JSON, "preemptVuln");
if (!preempt_vuln) {
ogs_error("OpenAPI_arp_1_parseFromJSON() failed [preempt_vuln]");
goto end;
}
OpenAPI_preemption_vulnerability_e preempt_vulnVariable;
if (!cJSON_IsString(preempt_vuln)) {
ogs_error("OpenAPI_arp_1_parseFromJSON() failed [preempt_vuln]");
goto end;

View File

@ -24,25 +24,36 @@ OpenAPI_assign_ebi_data_t *OpenAPI_assign_ebi_data_create(
void OpenAPI_assign_ebi_data_free(OpenAPI_assign_ebi_data_t *assign_ebi_data)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == assign_ebi_data) {
return;
}
OpenAPI_lnode_t *node;
OpenAPI_list_for_each(assign_ebi_data->arp_list, node) {
OpenAPI_arp_free(node->data);
if (assign_ebi_data->arp_list) {
OpenAPI_list_for_each(assign_ebi_data->arp_list, node) {
OpenAPI_arp_free(node->data);
}
OpenAPI_list_free(assign_ebi_data->arp_list);
assign_ebi_data->arp_list = NULL;
}
OpenAPI_list_free(assign_ebi_data->arp_list);
OpenAPI_list_for_each(assign_ebi_data->released_ebi_list, node) {
ogs_free(node->data);
if (assign_ebi_data->released_ebi_list) {
OpenAPI_list_for_each(assign_ebi_data->released_ebi_list, node) {
ogs_free(node->data);
}
OpenAPI_list_free(assign_ebi_data->released_ebi_list);
assign_ebi_data->released_ebi_list = NULL;
}
if (assign_ebi_data->old_guami) {
OpenAPI_guami_free(assign_ebi_data->old_guami);
assign_ebi_data->old_guami = NULL;
}
OpenAPI_list_free(assign_ebi_data->released_ebi_list);
OpenAPI_guami_free(assign_ebi_data->old_guami);
ogs_free(assign_ebi_data);
}
cJSON *OpenAPI_assign_ebi_data_convertToJSON(OpenAPI_assign_ebi_data_t *assign_ebi_data)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (assign_ebi_data == NULL) {
ogs_error("OpenAPI_assign_ebi_data_convertToJSON() failed [AssignEbiData]");
@ -61,34 +72,28 @@ cJSON *OpenAPI_assign_ebi_data_convertToJSON(OpenAPI_assign_ebi_data_t *assign_e
ogs_error("OpenAPI_assign_ebi_data_convertToJSON() failed [arp_list]");
goto end;
}
OpenAPI_lnode_t *arp_list_node;
if (assign_ebi_data->arp_list) {
OpenAPI_list_for_each(assign_ebi_data->arp_list, arp_list_node) {
cJSON *itemLocal = OpenAPI_arp_convertToJSON(arp_list_node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_assign_ebi_data_convertToJSON() failed [arp_list]");
goto end;
}
cJSON_AddItemToArray(arp_listList, itemLocal);
OpenAPI_list_for_each(assign_ebi_data->arp_list, node) {
cJSON *itemLocal = OpenAPI_arp_convertToJSON(node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_assign_ebi_data_convertToJSON() failed [arp_list]");
goto end;
}
cJSON_AddItemToArray(arp_listList, itemLocal);
}
}
if (assign_ebi_data->released_ebi_list) {
cJSON *released_ebi_list = cJSON_AddArrayToObject(item, "releasedEbiList");
if (released_ebi_list == NULL) {
cJSON *released_ebi_listList = cJSON_AddArrayToObject(item, "releasedEbiList");
if (released_ebi_listList == NULL) {
ogs_error("OpenAPI_assign_ebi_data_convertToJSON() failed [released_ebi_list]");
goto end;
}
OpenAPI_lnode_t *released_ebi_list_node;
OpenAPI_list_for_each(assign_ebi_data->released_ebi_list, released_ebi_list_node) {
if (cJSON_AddNumberToObject(released_ebi_list, "", *(double *)released_ebi_list_node->data) == NULL) {
ogs_error("OpenAPI_assign_ebi_data_convertToJSON() failed [released_ebi_list]");
goto end;
OpenAPI_list_for_each(assign_ebi_data->released_ebi_list, node) {
if (cJSON_AddNumberToObject(released_ebi_listList, "", (uintptr_t)node->data) == NULL) {
ogs_error("OpenAPI_assign_ebi_data_convertToJSON() failed [released_ebi_list]");
goto end;
}
}
}
}
if (assign_ebi_data->old_guami) {
@ -111,69 +116,77 @@ end:
OpenAPI_assign_ebi_data_t *OpenAPI_assign_ebi_data_parseFromJSON(cJSON *assign_ebi_dataJSON)
{
OpenAPI_assign_ebi_data_t *assign_ebi_data_local_var = NULL;
cJSON *pdu_session_id = cJSON_GetObjectItemCaseSensitive(assign_ebi_dataJSON, "pduSessionId");
OpenAPI_lnode_t *node = NULL;
cJSON *pdu_session_id = NULL;
cJSON *arp_list = NULL;
OpenAPI_list_t *arp_listList = NULL;
cJSON *released_ebi_list = NULL;
OpenAPI_list_t *released_ebi_listList = NULL;
cJSON *old_guami = NULL;
OpenAPI_guami_t *old_guami_local_nonprim = NULL;
pdu_session_id = cJSON_GetObjectItemCaseSensitive(assign_ebi_dataJSON, "pduSessionId");
if (!pdu_session_id) {
ogs_error("OpenAPI_assign_ebi_data_parseFromJSON() failed [pdu_session_id]");
goto end;
}
if (!cJSON_IsNumber(pdu_session_id)) {
ogs_error("OpenAPI_assign_ebi_data_parseFromJSON() failed [pdu_session_id]");
goto end;
}
cJSON *arp_list = cJSON_GetObjectItemCaseSensitive(assign_ebi_dataJSON, "arpList");
OpenAPI_list_t *arp_listList;
arp_list = cJSON_GetObjectItemCaseSensitive(assign_ebi_dataJSON, "arpList");
if (arp_list) {
cJSON *arp_list_local_nonprimitive;
if (!cJSON_IsArray(arp_list)){
ogs_error("OpenAPI_assign_ebi_data_parseFromJSON() failed [arp_list]");
goto end;
}
arp_listList = OpenAPI_list_create();
cJSON_ArrayForEach(arp_list_local_nonprimitive, arp_list ) {
if (!cJSON_IsObject(arp_list_local_nonprimitive)) {
cJSON *arp_list_local = NULL;
if (!cJSON_IsArray(arp_list)) {
ogs_error("OpenAPI_assign_ebi_data_parseFromJSON() failed [arp_list]");
goto end;
}
OpenAPI_arp_t *arp_listItem = OpenAPI_arp_parseFromJSON(arp_list_local_nonprimitive);
if (!arp_listItem) {
ogs_error("No arp_listItem");
OpenAPI_list_free(arp_listList);
arp_listList = OpenAPI_list_create();
cJSON_ArrayForEach(arp_list_local, arp_list) {
if (!cJSON_IsObject(arp_list_local)) {
ogs_error("OpenAPI_assign_ebi_data_parseFromJSON() failed [arp_list]");
goto end;
}
OpenAPI_arp_t *arp_listItem = OpenAPI_arp_parseFromJSON(arp_list_local);
if (!arp_listItem) {
ogs_error("No arp_listItem");
OpenAPI_list_free(arp_listList);
goto end;
}
OpenAPI_list_add(arp_listList, arp_listItem);
}
}
released_ebi_list = cJSON_GetObjectItemCaseSensitive(assign_ebi_dataJSON, "releasedEbiList");
if (released_ebi_list) {
cJSON *released_ebi_list_local = NULL;
if (!cJSON_IsArray(released_ebi_list)) {
ogs_error("OpenAPI_assign_ebi_data_parseFromJSON() failed [released_ebi_list]");
goto end;
}
OpenAPI_list_add(arp_listList, arp_listItem);
}
released_ebi_listList = OpenAPI_list_create();
cJSON_ArrayForEach(released_ebi_list_local, released_ebi_list) {
double *localDouble = NULL;
int *localInt = NULL;
if (!cJSON_IsNumber(released_ebi_list_local)) {
ogs_error("OpenAPI_assign_ebi_data_parseFromJSON() failed [released_ebi_list]");
goto end;
}
localDouble = (double *)ogs_calloc(1, sizeof(double));
if (!localDouble) {
ogs_error("OpenAPI_assign_ebi_data_parseFromJSON() failed [released_ebi_list]");
goto end;
}
*localDouble = released_ebi_list_local->valuedouble;
OpenAPI_list_add(released_ebi_listList, localDouble);
}
}
cJSON *released_ebi_list = cJSON_GetObjectItemCaseSensitive(assign_ebi_dataJSON, "releasedEbiList");
OpenAPI_list_t *released_ebi_listList;
if (released_ebi_list) {
cJSON *released_ebi_list_local;
if (!cJSON_IsArray(released_ebi_list)) {
ogs_error("OpenAPI_assign_ebi_data_parseFromJSON() failed [released_ebi_list]");
goto end;
}
released_ebi_listList = OpenAPI_list_create();
cJSON_ArrayForEach(released_ebi_list_local, released_ebi_list) {
if (!cJSON_IsNumber(released_ebi_list_local)) {
ogs_error("OpenAPI_assign_ebi_data_parseFromJSON() failed [released_ebi_list]");
goto end;
}
OpenAPI_list_add(released_ebi_listList, &released_ebi_list_local->valuedouble);
}
}
cJSON *old_guami = cJSON_GetObjectItemCaseSensitive(assign_ebi_dataJSON, "oldGuami");
OpenAPI_guami_t *old_guami_local_nonprim = NULL;
old_guami = cJSON_GetObjectItemCaseSensitive(assign_ebi_dataJSON, "oldGuami");
if (old_guami) {
old_guami_local_nonprim = OpenAPI_guami_parseFromJSON(old_guami);
}
@ -188,6 +201,24 @@ OpenAPI_assign_ebi_data_t *OpenAPI_assign_ebi_data_parseFromJSON(cJSON *assign_e
return assign_ebi_data_local_var;
end:
if (arp_listList) {
OpenAPI_list_for_each(arp_listList, node) {
OpenAPI_arp_free(node->data);
}
OpenAPI_list_free(arp_listList);
arp_listList = NULL;
}
if (released_ebi_listList) {
OpenAPI_list_for_each(released_ebi_listList, node) {
ogs_free(node->data);
}
OpenAPI_list_free(released_ebi_listList);
released_ebi_listList = NULL;
}
if (old_guami_local_nonprim) {
OpenAPI_guami_free(old_guami_local_nonprim);
old_guami_local_nonprim = NULL;
}
return NULL;
}

View File

@ -20,18 +20,26 @@ OpenAPI_assign_ebi_error_t *OpenAPI_assign_ebi_error_create(
void OpenAPI_assign_ebi_error_free(OpenAPI_assign_ebi_error_t *assign_ebi_error)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == assign_ebi_error) {
return;
}
OpenAPI_lnode_t *node;
OpenAPI_problem_details_free(assign_ebi_error->error);
OpenAPI_assign_ebi_failed_free(assign_ebi_error->failure_details);
if (assign_ebi_error->error) {
OpenAPI_problem_details_free(assign_ebi_error->error);
assign_ebi_error->error = NULL;
}
if (assign_ebi_error->failure_details) {
OpenAPI_assign_ebi_failed_free(assign_ebi_error->failure_details);
assign_ebi_error->failure_details = NULL;
}
ogs_free(assign_ebi_error);
}
cJSON *OpenAPI_assign_ebi_error_convertToJSON(OpenAPI_assign_ebi_error_t *assign_ebi_error)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (assign_ebi_error == NULL) {
ogs_error("OpenAPI_assign_ebi_error_convertToJSON() failed [AssignEbiError]");
@ -39,6 +47,10 @@ cJSON *OpenAPI_assign_ebi_error_convertToJSON(OpenAPI_assign_ebi_error_t *assign
}
item = cJSON_CreateObject();
if (!assign_ebi_error->error) {
ogs_error("OpenAPI_assign_ebi_error_convertToJSON() failed [error]");
return NULL;
}
cJSON *error_local_JSON = OpenAPI_problem_details_convertToJSON(assign_ebi_error->error);
if (error_local_JSON == NULL) {
ogs_error("OpenAPI_assign_ebi_error_convertToJSON() failed [error]");
@ -50,6 +62,10 @@ cJSON *OpenAPI_assign_ebi_error_convertToJSON(OpenAPI_assign_ebi_error_t *assign
goto end;
}
if (!assign_ebi_error->failure_details) {
ogs_error("OpenAPI_assign_ebi_error_convertToJSON() failed [failure_details]");
return NULL;
}
cJSON *failure_details_local_JSON = OpenAPI_assign_ebi_failed_convertToJSON(assign_ebi_error->failure_details);
if (failure_details_local_JSON == NULL) {
ogs_error("OpenAPI_assign_ebi_error_convertToJSON() failed [failure_details]");
@ -68,22 +84,23 @@ end:
OpenAPI_assign_ebi_error_t *OpenAPI_assign_ebi_error_parseFromJSON(cJSON *assign_ebi_errorJSON)
{
OpenAPI_assign_ebi_error_t *assign_ebi_error_local_var = NULL;
cJSON *error = cJSON_GetObjectItemCaseSensitive(assign_ebi_errorJSON, "error");
OpenAPI_lnode_t *node = NULL;
cJSON *error = NULL;
OpenAPI_problem_details_t *error_local_nonprim = NULL;
cJSON *failure_details = NULL;
OpenAPI_assign_ebi_failed_t *failure_details_local_nonprim = NULL;
error = cJSON_GetObjectItemCaseSensitive(assign_ebi_errorJSON, "error");
if (!error) {
ogs_error("OpenAPI_assign_ebi_error_parseFromJSON() failed [error]");
goto end;
}
OpenAPI_problem_details_t *error_local_nonprim = NULL;
error_local_nonprim = OpenAPI_problem_details_parseFromJSON(error);
cJSON *failure_details = cJSON_GetObjectItemCaseSensitive(assign_ebi_errorJSON, "failureDetails");
failure_details = cJSON_GetObjectItemCaseSensitive(assign_ebi_errorJSON, "failureDetails");
if (!failure_details) {
ogs_error("OpenAPI_assign_ebi_error_parseFromJSON() failed [failure_details]");
goto end;
}
OpenAPI_assign_ebi_failed_t *failure_details_local_nonprim = NULL;
failure_details_local_nonprim = OpenAPI_assign_ebi_failed_parseFromJSON(failure_details);
assign_ebi_error_local_var = OpenAPI_assign_ebi_error_create (
@ -93,6 +110,14 @@ OpenAPI_assign_ebi_error_t *OpenAPI_assign_ebi_error_parseFromJSON(cJSON *assign
return assign_ebi_error_local_var;
end:
if (error_local_nonprim) {
OpenAPI_problem_details_free(error_local_nonprim);
error_local_nonprim = NULL;
}
if (failure_details_local_nonprim) {
OpenAPI_assign_ebi_failed_free(failure_details_local_nonprim);
failure_details_local_nonprim = NULL;
}
return NULL;
}

View File

@ -20,20 +20,25 @@ OpenAPI_assign_ebi_failed_t *OpenAPI_assign_ebi_failed_create(
void OpenAPI_assign_ebi_failed_free(OpenAPI_assign_ebi_failed_t *assign_ebi_failed)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == assign_ebi_failed) {
return;
}
OpenAPI_lnode_t *node;
OpenAPI_list_for_each(assign_ebi_failed->failed_arp_list, node) {
OpenAPI_arp_free(node->data);
if (assign_ebi_failed->failed_arp_list) {
OpenAPI_list_for_each(assign_ebi_failed->failed_arp_list, node) {
OpenAPI_arp_free(node->data);
}
OpenAPI_list_free(assign_ebi_failed->failed_arp_list);
assign_ebi_failed->failed_arp_list = NULL;
}
OpenAPI_list_free(assign_ebi_failed->failed_arp_list);
ogs_free(assign_ebi_failed);
}
cJSON *OpenAPI_assign_ebi_failed_convertToJSON(OpenAPI_assign_ebi_failed_t *assign_ebi_failed)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (assign_ebi_failed == NULL) {
ogs_error("OpenAPI_assign_ebi_failed_convertToJSON() failed [AssignEbiFailed]");
@ -52,17 +57,13 @@ cJSON *OpenAPI_assign_ebi_failed_convertToJSON(OpenAPI_assign_ebi_failed_t *assi
ogs_error("OpenAPI_assign_ebi_failed_convertToJSON() failed [failed_arp_list]");
goto end;
}
OpenAPI_lnode_t *failed_arp_list_node;
if (assign_ebi_failed->failed_arp_list) {
OpenAPI_list_for_each(assign_ebi_failed->failed_arp_list, failed_arp_list_node) {
cJSON *itemLocal = OpenAPI_arp_convertToJSON(failed_arp_list_node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_assign_ebi_failed_convertToJSON() failed [failed_arp_list]");
goto end;
}
cJSON_AddItemToArray(failed_arp_listList, itemLocal);
OpenAPI_list_for_each(assign_ebi_failed->failed_arp_list, node) {
cJSON *itemLocal = OpenAPI_arp_convertToJSON(node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_assign_ebi_failed_convertToJSON() failed [failed_arp_list]");
goto end;
}
cJSON_AddItemToArray(failed_arp_listList, itemLocal);
}
}
@ -73,44 +74,43 @@ end:
OpenAPI_assign_ebi_failed_t *OpenAPI_assign_ebi_failed_parseFromJSON(cJSON *assign_ebi_failedJSON)
{
OpenAPI_assign_ebi_failed_t *assign_ebi_failed_local_var = NULL;
cJSON *pdu_session_id = cJSON_GetObjectItemCaseSensitive(assign_ebi_failedJSON, "pduSessionId");
OpenAPI_lnode_t *node = NULL;
cJSON *pdu_session_id = NULL;
cJSON *failed_arp_list = NULL;
OpenAPI_list_t *failed_arp_listList = NULL;
pdu_session_id = cJSON_GetObjectItemCaseSensitive(assign_ebi_failedJSON, "pduSessionId");
if (!pdu_session_id) {
ogs_error("OpenAPI_assign_ebi_failed_parseFromJSON() failed [pdu_session_id]");
goto end;
}
if (!cJSON_IsNumber(pdu_session_id)) {
ogs_error("OpenAPI_assign_ebi_failed_parseFromJSON() failed [pdu_session_id]");
goto end;
}
cJSON *failed_arp_list = cJSON_GetObjectItemCaseSensitive(assign_ebi_failedJSON, "failedArpList");
OpenAPI_list_t *failed_arp_listList;
failed_arp_list = cJSON_GetObjectItemCaseSensitive(assign_ebi_failedJSON, "failedArpList");
if (failed_arp_list) {
cJSON *failed_arp_list_local_nonprimitive;
if (!cJSON_IsArray(failed_arp_list)){
ogs_error("OpenAPI_assign_ebi_failed_parseFromJSON() failed [failed_arp_list]");
goto end;
}
failed_arp_listList = OpenAPI_list_create();
cJSON_ArrayForEach(failed_arp_list_local_nonprimitive, failed_arp_list ) {
if (!cJSON_IsObject(failed_arp_list_local_nonprimitive)) {
cJSON *failed_arp_list_local = NULL;
if (!cJSON_IsArray(failed_arp_list)) {
ogs_error("OpenAPI_assign_ebi_failed_parseFromJSON() failed [failed_arp_list]");
goto end;
}
OpenAPI_arp_t *failed_arp_listItem = OpenAPI_arp_parseFromJSON(failed_arp_list_local_nonprimitive);
if (!failed_arp_listItem) {
ogs_error("No failed_arp_listItem");
OpenAPI_list_free(failed_arp_listList);
goto end;
failed_arp_listList = OpenAPI_list_create();
cJSON_ArrayForEach(failed_arp_list_local, failed_arp_list) {
if (!cJSON_IsObject(failed_arp_list_local)) {
ogs_error("OpenAPI_assign_ebi_failed_parseFromJSON() failed [failed_arp_list]");
goto end;
}
OpenAPI_arp_t *failed_arp_listItem = OpenAPI_arp_parseFromJSON(failed_arp_list_local);
if (!failed_arp_listItem) {
ogs_error("No failed_arp_listItem");
OpenAPI_list_free(failed_arp_listList);
goto end;
}
OpenAPI_list_add(failed_arp_listList, failed_arp_listItem);
}
OpenAPI_list_add(failed_arp_listList, failed_arp_listItem);
}
}
assign_ebi_failed_local_var = OpenAPI_assign_ebi_failed_create (
@ -121,6 +121,13 @@ OpenAPI_assign_ebi_failed_t *OpenAPI_assign_ebi_failed_parseFromJSON(cJSON *assi
return assign_ebi_failed_local_var;
end:
if (failed_arp_listList) {
OpenAPI_list_for_each(failed_arp_listList, node) {
OpenAPI_arp_free(node->data);
}
OpenAPI_list_free(failed_arp_listList);
failed_arp_listList = NULL;
}
return NULL;
}

View File

@ -24,28 +24,39 @@ OpenAPI_assigned_ebi_data_t *OpenAPI_assigned_ebi_data_create(
void OpenAPI_assigned_ebi_data_free(OpenAPI_assigned_ebi_data_t *assigned_ebi_data)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == assigned_ebi_data) {
return;
}
OpenAPI_lnode_t *node;
OpenAPI_list_for_each(assigned_ebi_data->assigned_ebi_list, node) {
OpenAPI_ebi_arp_mapping_free(node->data);
if (assigned_ebi_data->assigned_ebi_list) {
OpenAPI_list_for_each(assigned_ebi_data->assigned_ebi_list, node) {
OpenAPI_ebi_arp_mapping_free(node->data);
}
OpenAPI_list_free(assigned_ebi_data->assigned_ebi_list);
assigned_ebi_data->assigned_ebi_list = NULL;
}
OpenAPI_list_free(assigned_ebi_data->assigned_ebi_list);
OpenAPI_list_for_each(assigned_ebi_data->failed_arp_list, node) {
OpenAPI_arp_free(node->data);
if (assigned_ebi_data->failed_arp_list) {
OpenAPI_list_for_each(assigned_ebi_data->failed_arp_list, node) {
OpenAPI_arp_free(node->data);
}
OpenAPI_list_free(assigned_ebi_data->failed_arp_list);
assigned_ebi_data->failed_arp_list = NULL;
}
OpenAPI_list_free(assigned_ebi_data->failed_arp_list);
OpenAPI_list_for_each(assigned_ebi_data->released_ebi_list, node) {
ogs_free(node->data);
if (assigned_ebi_data->released_ebi_list) {
OpenAPI_list_for_each(assigned_ebi_data->released_ebi_list, node) {
ogs_free(node->data);
}
OpenAPI_list_free(assigned_ebi_data->released_ebi_list);
assigned_ebi_data->released_ebi_list = NULL;
}
OpenAPI_list_free(assigned_ebi_data->released_ebi_list);
ogs_free(assigned_ebi_data);
}
cJSON *OpenAPI_assigned_ebi_data_convertToJSON(OpenAPI_assigned_ebi_data_t *assigned_ebi_data)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (assigned_ebi_data == NULL) {
ogs_error("OpenAPI_assigned_ebi_data_convertToJSON() failed [AssignedEbiData]");
@ -58,22 +69,22 @@ cJSON *OpenAPI_assigned_ebi_data_convertToJSON(OpenAPI_assigned_ebi_data_t *assi
goto end;
}
if (!assigned_ebi_data->assigned_ebi_list) {
ogs_error("OpenAPI_assigned_ebi_data_convertToJSON() failed [assigned_ebi_list]");
return NULL;
}
cJSON *assigned_ebi_listList = cJSON_AddArrayToObject(item, "assignedEbiList");
if (assigned_ebi_listList == NULL) {
ogs_error("OpenAPI_assigned_ebi_data_convertToJSON() failed [assigned_ebi_list]");
goto end;
}
OpenAPI_lnode_t *assigned_ebi_list_node;
if (assigned_ebi_data->assigned_ebi_list) {
OpenAPI_list_for_each(assigned_ebi_data->assigned_ebi_list, assigned_ebi_list_node) {
cJSON *itemLocal = OpenAPI_ebi_arp_mapping_convertToJSON(assigned_ebi_list_node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_assigned_ebi_data_convertToJSON() failed [assigned_ebi_list]");
goto end;
}
cJSON_AddItemToArray(assigned_ebi_listList, itemLocal);
OpenAPI_list_for_each(assigned_ebi_data->assigned_ebi_list, node) {
cJSON *itemLocal = OpenAPI_ebi_arp_mapping_convertToJSON(node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_assigned_ebi_data_convertToJSON() failed [assigned_ebi_list]");
goto end;
}
cJSON_AddItemToArray(assigned_ebi_listList, itemLocal);
}
if (assigned_ebi_data->failed_arp_list) {
@ -82,34 +93,28 @@ cJSON *OpenAPI_assigned_ebi_data_convertToJSON(OpenAPI_assigned_ebi_data_t *assi
ogs_error("OpenAPI_assigned_ebi_data_convertToJSON() failed [failed_arp_list]");
goto end;
}
OpenAPI_lnode_t *failed_arp_list_node;
if (assigned_ebi_data->failed_arp_list) {
OpenAPI_list_for_each(assigned_ebi_data->failed_arp_list, failed_arp_list_node) {
cJSON *itemLocal = OpenAPI_arp_convertToJSON(failed_arp_list_node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_assigned_ebi_data_convertToJSON() failed [failed_arp_list]");
goto end;
}
cJSON_AddItemToArray(failed_arp_listList, itemLocal);
OpenAPI_list_for_each(assigned_ebi_data->failed_arp_list, node) {
cJSON *itemLocal = OpenAPI_arp_convertToJSON(node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_assigned_ebi_data_convertToJSON() failed [failed_arp_list]");
goto end;
}
cJSON_AddItemToArray(failed_arp_listList, itemLocal);
}
}
if (assigned_ebi_data->released_ebi_list) {
cJSON *released_ebi_list = cJSON_AddArrayToObject(item, "releasedEbiList");
if (released_ebi_list == NULL) {
cJSON *released_ebi_listList = cJSON_AddArrayToObject(item, "releasedEbiList");
if (released_ebi_listList == NULL) {
ogs_error("OpenAPI_assigned_ebi_data_convertToJSON() failed [released_ebi_list]");
goto end;
}
OpenAPI_lnode_t *released_ebi_list_node;
OpenAPI_list_for_each(assigned_ebi_data->released_ebi_list, released_ebi_list_node) {
if (cJSON_AddNumberToObject(released_ebi_list, "", *(double *)released_ebi_list_node->data) == NULL) {
ogs_error("OpenAPI_assigned_ebi_data_convertToJSON() failed [released_ebi_list]");
goto end;
OpenAPI_list_for_each(assigned_ebi_data->released_ebi_list, node) {
if (cJSON_AddNumberToObject(released_ebi_listList, "", (uintptr_t)node->data) == NULL) {
ogs_error("OpenAPI_assigned_ebi_data_convertToJSON() failed [released_ebi_list]");
goto end;
}
}
}
}
end:
@ -119,95 +124,101 @@ end:
OpenAPI_assigned_ebi_data_t *OpenAPI_assigned_ebi_data_parseFromJSON(cJSON *assigned_ebi_dataJSON)
{
OpenAPI_assigned_ebi_data_t *assigned_ebi_data_local_var = NULL;
cJSON *pdu_session_id = cJSON_GetObjectItemCaseSensitive(assigned_ebi_dataJSON, "pduSessionId");
OpenAPI_lnode_t *node = NULL;
cJSON *pdu_session_id = NULL;
cJSON *assigned_ebi_list = NULL;
OpenAPI_list_t *assigned_ebi_listList = NULL;
cJSON *failed_arp_list = NULL;
OpenAPI_list_t *failed_arp_listList = NULL;
cJSON *released_ebi_list = NULL;
OpenAPI_list_t *released_ebi_listList = NULL;
pdu_session_id = cJSON_GetObjectItemCaseSensitive(assigned_ebi_dataJSON, "pduSessionId");
if (!pdu_session_id) {
ogs_error("OpenAPI_assigned_ebi_data_parseFromJSON() failed [pdu_session_id]");
goto end;
}
if (!cJSON_IsNumber(pdu_session_id)) {
ogs_error("OpenAPI_assigned_ebi_data_parseFromJSON() failed [pdu_session_id]");
goto end;
}
cJSON *assigned_ebi_list = cJSON_GetObjectItemCaseSensitive(assigned_ebi_dataJSON, "assignedEbiList");
assigned_ebi_list = cJSON_GetObjectItemCaseSensitive(assigned_ebi_dataJSON, "assignedEbiList");
if (!assigned_ebi_list) {
ogs_error("OpenAPI_assigned_ebi_data_parseFromJSON() failed [assigned_ebi_list]");
goto end;
}
OpenAPI_list_t *assigned_ebi_listList;
cJSON *assigned_ebi_list_local_nonprimitive;
if (!cJSON_IsArray(assigned_ebi_list)){
ogs_error("OpenAPI_assigned_ebi_data_parseFromJSON() failed [assigned_ebi_list]");
goto end;
}
assigned_ebi_listList = OpenAPI_list_create();
cJSON_ArrayForEach(assigned_ebi_list_local_nonprimitive, assigned_ebi_list ) {
if (!cJSON_IsObject(assigned_ebi_list_local_nonprimitive)) {
cJSON *assigned_ebi_list_local = NULL;
if (!cJSON_IsArray(assigned_ebi_list)) {
ogs_error("OpenAPI_assigned_ebi_data_parseFromJSON() failed [assigned_ebi_list]");
goto end;
}
OpenAPI_ebi_arp_mapping_t *assigned_ebi_listItem = OpenAPI_ebi_arp_mapping_parseFromJSON(assigned_ebi_list_local_nonprimitive);
if (!assigned_ebi_listItem) {
ogs_error("No assigned_ebi_listItem");
OpenAPI_list_free(assigned_ebi_listList);
goto end;
assigned_ebi_listList = OpenAPI_list_create();
cJSON_ArrayForEach(assigned_ebi_list_local, assigned_ebi_list) {
if (!cJSON_IsObject(assigned_ebi_list_local)) {
ogs_error("OpenAPI_assigned_ebi_data_parseFromJSON() failed [assigned_ebi_list]");
goto end;
}
OpenAPI_ebi_arp_mapping_t *assigned_ebi_listItem = OpenAPI_ebi_arp_mapping_parseFromJSON(assigned_ebi_list_local);
if (!assigned_ebi_listItem) {
ogs_error("No assigned_ebi_listItem");
OpenAPI_list_free(assigned_ebi_listList);
goto end;
}
OpenAPI_list_add(assigned_ebi_listList, assigned_ebi_listItem);
}
OpenAPI_list_add(assigned_ebi_listList, assigned_ebi_listItem);
}
cJSON *failed_arp_list = cJSON_GetObjectItemCaseSensitive(assigned_ebi_dataJSON, "failedArpList");
OpenAPI_list_t *failed_arp_listList;
failed_arp_list = cJSON_GetObjectItemCaseSensitive(assigned_ebi_dataJSON, "failedArpList");
if (failed_arp_list) {
cJSON *failed_arp_list_local_nonprimitive;
if (!cJSON_IsArray(failed_arp_list)){
ogs_error("OpenAPI_assigned_ebi_data_parseFromJSON() failed [failed_arp_list]");
goto end;
}
failed_arp_listList = OpenAPI_list_create();
cJSON_ArrayForEach(failed_arp_list_local_nonprimitive, failed_arp_list ) {
if (!cJSON_IsObject(failed_arp_list_local_nonprimitive)) {
cJSON *failed_arp_list_local = NULL;
if (!cJSON_IsArray(failed_arp_list)) {
ogs_error("OpenAPI_assigned_ebi_data_parseFromJSON() failed [failed_arp_list]");
goto end;
}
OpenAPI_arp_t *failed_arp_listItem = OpenAPI_arp_parseFromJSON(failed_arp_list_local_nonprimitive);
if (!failed_arp_listItem) {
ogs_error("No failed_arp_listItem");
OpenAPI_list_free(failed_arp_listList);
failed_arp_listList = OpenAPI_list_create();
cJSON_ArrayForEach(failed_arp_list_local, failed_arp_list) {
if (!cJSON_IsObject(failed_arp_list_local)) {
ogs_error("OpenAPI_assigned_ebi_data_parseFromJSON() failed [failed_arp_list]");
goto end;
}
OpenAPI_arp_t *failed_arp_listItem = OpenAPI_arp_parseFromJSON(failed_arp_list_local);
if (!failed_arp_listItem) {
ogs_error("No failed_arp_listItem");
OpenAPI_list_free(failed_arp_listList);
goto end;
}
OpenAPI_list_add(failed_arp_listList, failed_arp_listItem);
}
}
released_ebi_list = cJSON_GetObjectItemCaseSensitive(assigned_ebi_dataJSON, "releasedEbiList");
if (released_ebi_list) {
cJSON *released_ebi_list_local = NULL;
if (!cJSON_IsArray(released_ebi_list)) {
ogs_error("OpenAPI_assigned_ebi_data_parseFromJSON() failed [released_ebi_list]");
goto end;
}
OpenAPI_list_add(failed_arp_listList, failed_arp_listItem);
}
}
released_ebi_listList = OpenAPI_list_create();
cJSON *released_ebi_list = cJSON_GetObjectItemCaseSensitive(assigned_ebi_dataJSON, "releasedEbiList");
OpenAPI_list_t *released_ebi_listList;
if (released_ebi_list) {
cJSON *released_ebi_list_local;
if (!cJSON_IsArray(released_ebi_list)) {
ogs_error("OpenAPI_assigned_ebi_data_parseFromJSON() failed [released_ebi_list]");
goto end;
}
released_ebi_listList = OpenAPI_list_create();
cJSON_ArrayForEach(released_ebi_list_local, released_ebi_list) {
if (!cJSON_IsNumber(released_ebi_list_local)) {
ogs_error("OpenAPI_assigned_ebi_data_parseFromJSON() failed [released_ebi_list]");
goto end;
}
OpenAPI_list_add(released_ebi_listList, &released_ebi_list_local->valuedouble);
}
cJSON_ArrayForEach(released_ebi_list_local, released_ebi_list) {
double *localDouble = NULL;
int *localInt = NULL;
if (!cJSON_IsNumber(released_ebi_list_local)) {
ogs_error("OpenAPI_assigned_ebi_data_parseFromJSON() failed [released_ebi_list]");
goto end;
}
localDouble = (double *)ogs_calloc(1, sizeof(double));
if (!localDouble) {
ogs_error("OpenAPI_assigned_ebi_data_parseFromJSON() failed [released_ebi_list]");
goto end;
}
*localDouble = released_ebi_list_local->valuedouble;
OpenAPI_list_add(released_ebi_listList, localDouble);
}
}
assigned_ebi_data_local_var = OpenAPI_assigned_ebi_data_create (
@ -220,6 +231,27 @@ OpenAPI_assigned_ebi_data_t *OpenAPI_assigned_ebi_data_parseFromJSON(cJSON *assi
return assigned_ebi_data_local_var;
end:
if (assigned_ebi_listList) {
OpenAPI_list_for_each(assigned_ebi_listList, node) {
OpenAPI_ebi_arp_mapping_free(node->data);
}
OpenAPI_list_free(assigned_ebi_listList);
assigned_ebi_listList = NULL;
}
if (failed_arp_listList) {
OpenAPI_list_for_each(failed_arp_listList, node) {
OpenAPI_arp_free(node->data);
}
OpenAPI_list_free(failed_arp_listList);
failed_arp_listList = NULL;
}
if (released_ebi_listList) {
OpenAPI_list_for_each(released_ebi_listList, node) {
ogs_free(node->data);
}
OpenAPI_list_free(released_ebi_listList);
released_ebi_listList = NULL;
}
return NULL;
}

View File

@ -16,16 +16,18 @@ OpenAPI_association_type_t *OpenAPI_association_type_create(
void OpenAPI_association_type_free(OpenAPI_association_type_t *association_type)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == association_type) {
return;
}
OpenAPI_lnode_t *node;
ogs_free(association_type);
}
cJSON *OpenAPI_association_type_convertToJSON(OpenAPI_association_type_t *association_type)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (association_type == NULL) {
ogs_error("OpenAPI_association_type_convertToJSON() failed [AssociationType]");
@ -40,6 +42,7 @@ end:
OpenAPI_association_type_t *OpenAPI_association_type_parseFromJSON(cJSON *association_typeJSON)
{
OpenAPI_association_type_t *association_type_local_var = NULL;
OpenAPI_lnode_t *node = NULL;
association_type_local_var = OpenAPI_association_type_create (
);

View File

@ -24,18 +24,26 @@ OpenAPI_atom_t *OpenAPI_atom_create(
void OpenAPI_atom_free(OpenAPI_atom_t *atom)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == atom) {
return;
}
OpenAPI_lnode_t *node;
ogs_free(atom->attr);
ogs_free(atom->value);
if (atom->attr) {
ogs_free(atom->attr);
atom->attr = NULL;
}
if (atom->value) {
ogs_free(atom->value);
atom->value = NULL;
}
ogs_free(atom);
}
cJSON *OpenAPI_atom_convertToJSON(OpenAPI_atom_t *atom)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (atom == NULL) {
ogs_error("OpenAPI_atom_convertToJSON() failed [Atom]");
@ -43,11 +51,19 @@ cJSON *OpenAPI_atom_convertToJSON(OpenAPI_atom_t *atom)
}
item = cJSON_CreateObject();
if (!atom->attr) {
ogs_error("OpenAPI_atom_convertToJSON() failed [attr]");
return NULL;
}
if (cJSON_AddStringToObject(item, "attr", atom->attr) == NULL) {
ogs_error("OpenAPI_atom_convertToJSON() failed [attr]");
goto end;
}
if (!atom->value) {
ogs_error("OpenAPI_atom_convertToJSON() failed [value]");
return NULL;
}
if (cJSON_AddStringToObject(item, "value", atom->value) == NULL) {
ogs_error("OpenAPI_atom_convertToJSON() failed [value]");
goto end;
@ -67,30 +83,31 @@ end:
OpenAPI_atom_t *OpenAPI_atom_parseFromJSON(cJSON *atomJSON)
{
OpenAPI_atom_t *atom_local_var = NULL;
cJSON *attr = cJSON_GetObjectItemCaseSensitive(atomJSON, "attr");
OpenAPI_lnode_t *node = NULL;
cJSON *attr = NULL;
cJSON *value = NULL;
cJSON *negative = NULL;
attr = cJSON_GetObjectItemCaseSensitive(atomJSON, "attr");
if (!attr) {
ogs_error("OpenAPI_atom_parseFromJSON() failed [attr]");
goto end;
}
if (!cJSON_IsString(attr)) {
ogs_error("OpenAPI_atom_parseFromJSON() failed [attr]");
goto end;
}
cJSON *value = cJSON_GetObjectItemCaseSensitive(atomJSON, "value");
value = cJSON_GetObjectItemCaseSensitive(atomJSON, "value");
if (!value) {
ogs_error("OpenAPI_atom_parseFromJSON() failed [value]");
goto end;
}
if (!cJSON_IsString(value)) {
ogs_error("OpenAPI_atom_parseFromJSON() failed [value]");
goto end;
}
cJSON *negative = cJSON_GetObjectItemCaseSensitive(atomJSON, "negative");
negative = cJSON_GetObjectItemCaseSensitive(atomJSON, "negative");
if (negative) {
if (!cJSON_IsBool(negative)) {
ogs_error("OpenAPI_atom_parseFromJSON() failed [negative]");

View File

@ -28,16 +28,18 @@ OpenAPI_atsss_capability_t *OpenAPI_atsss_capability_create(
void OpenAPI_atsss_capability_free(OpenAPI_atsss_capability_t *atsss_capability)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == atsss_capability) {
return;
}
OpenAPI_lnode_t *node;
ogs_free(atsss_capability);
}
cJSON *OpenAPI_atsss_capability_convertToJSON(OpenAPI_atsss_capability_t *atsss_capability)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (atsss_capability == NULL) {
ogs_error("OpenAPI_atsss_capability_convertToJSON() failed [AtsssCapability]");
@ -73,8 +75,11 @@ end:
OpenAPI_atsss_capability_t *OpenAPI_atsss_capability_parseFromJSON(cJSON *atsss_capabilityJSON)
{
OpenAPI_atsss_capability_t *atsss_capability_local_var = NULL;
cJSON *atsss_ll = cJSON_GetObjectItemCaseSensitive(atsss_capabilityJSON, "atsssLL");
OpenAPI_lnode_t *node = NULL;
cJSON *atsss_ll = NULL;
cJSON *mptcp = NULL;
cJSON *rtt_without_pmf = NULL;
atsss_ll = cJSON_GetObjectItemCaseSensitive(atsss_capabilityJSON, "atsssLL");
if (atsss_ll) {
if (!cJSON_IsBool(atsss_ll)) {
ogs_error("OpenAPI_atsss_capability_parseFromJSON() failed [atsss_ll]");
@ -82,8 +87,7 @@ OpenAPI_atsss_capability_t *OpenAPI_atsss_capability_parseFromJSON(cJSON *atsss_
}
}
cJSON *mptcp = cJSON_GetObjectItemCaseSensitive(atsss_capabilityJSON, "mptcp");
mptcp = cJSON_GetObjectItemCaseSensitive(atsss_capabilityJSON, "mptcp");
if (mptcp) {
if (!cJSON_IsBool(mptcp)) {
ogs_error("OpenAPI_atsss_capability_parseFromJSON() failed [mptcp]");
@ -91,8 +95,7 @@ OpenAPI_atsss_capability_t *OpenAPI_atsss_capability_parseFromJSON(cJSON *atsss_
}
}
cJSON *rtt_without_pmf = cJSON_GetObjectItemCaseSensitive(atsss_capabilityJSON, "rttWithoutPmf");
rtt_without_pmf = cJSON_GetObjectItemCaseSensitive(atsss_capabilityJSON, "rttWithoutPmf");
if (rtt_without_pmf) {
if (!cJSON_IsBool(rtt_without_pmf)) {
ogs_error("OpenAPI_atsss_capability_parseFromJSON() failed [rtt_without_pmf]");

View File

@ -22,25 +22,36 @@ OpenAPI_ausf_info_t *OpenAPI_ausf_info_create(
void OpenAPI_ausf_info_free(OpenAPI_ausf_info_t *ausf_info)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == ausf_info) {
return;
}
OpenAPI_lnode_t *node;
ogs_free(ausf_info->group_id);
OpenAPI_list_for_each(ausf_info->supi_ranges, node) {
OpenAPI_supi_range_free(node->data);
if (ausf_info->group_id) {
ogs_free(ausf_info->group_id);
ausf_info->group_id = NULL;
}
OpenAPI_list_free(ausf_info->supi_ranges);
OpenAPI_list_for_each(ausf_info->routing_indicators, node) {
ogs_free(node->data);
if (ausf_info->supi_ranges) {
OpenAPI_list_for_each(ausf_info->supi_ranges, node) {
OpenAPI_supi_range_free(node->data);
}
OpenAPI_list_free(ausf_info->supi_ranges);
ausf_info->supi_ranges = NULL;
}
if (ausf_info->routing_indicators) {
OpenAPI_list_for_each(ausf_info->routing_indicators, node) {
ogs_free(node->data);
}
OpenAPI_list_free(ausf_info->routing_indicators);
ausf_info->routing_indicators = NULL;
}
OpenAPI_list_free(ausf_info->routing_indicators);
ogs_free(ausf_info);
}
cJSON *OpenAPI_ausf_info_convertToJSON(OpenAPI_ausf_info_t *ausf_info)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (ausf_info == NULL) {
ogs_error("OpenAPI_ausf_info_convertToJSON() failed [AusfInfo]");
@ -61,34 +72,28 @@ cJSON *OpenAPI_ausf_info_convertToJSON(OpenAPI_ausf_info_t *ausf_info)
ogs_error("OpenAPI_ausf_info_convertToJSON() failed [supi_ranges]");
goto end;
}
OpenAPI_lnode_t *supi_ranges_node;
if (ausf_info->supi_ranges) {
OpenAPI_list_for_each(ausf_info->supi_ranges, supi_ranges_node) {
cJSON *itemLocal = OpenAPI_supi_range_convertToJSON(supi_ranges_node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_ausf_info_convertToJSON() failed [supi_ranges]");
goto end;
}
cJSON_AddItemToArray(supi_rangesList, itemLocal);
OpenAPI_list_for_each(ausf_info->supi_ranges, node) {
cJSON *itemLocal = OpenAPI_supi_range_convertToJSON(node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_ausf_info_convertToJSON() failed [supi_ranges]");
goto end;
}
cJSON_AddItemToArray(supi_rangesList, itemLocal);
}
}
if (ausf_info->routing_indicators) {
cJSON *routing_indicators = cJSON_AddArrayToObject(item, "routingIndicators");
if (routing_indicators == NULL) {
cJSON *routing_indicatorsList = cJSON_AddArrayToObject(item, "routingIndicators");
if (routing_indicatorsList == NULL) {
ogs_error("OpenAPI_ausf_info_convertToJSON() failed [routing_indicators]");
goto end;
}
OpenAPI_lnode_t *routing_indicators_node;
OpenAPI_list_for_each(ausf_info->routing_indicators, routing_indicators_node) {
if (cJSON_AddStringToObject(routing_indicators, "", (char*)routing_indicators_node->data) == NULL) {
ogs_error("OpenAPI_ausf_info_convertToJSON() failed [routing_indicators]");
goto end;
OpenAPI_list_for_each(ausf_info->routing_indicators, node) {
if (cJSON_AddStringToObject(routing_indicatorsList, "", (char*)node->data) == NULL) {
ogs_error("OpenAPI_ausf_info_convertToJSON() failed [routing_indicators]");
goto end;
}
}
}
}
end:
@ -98,72 +103,88 @@ end:
OpenAPI_ausf_info_t *OpenAPI_ausf_info_parseFromJSON(cJSON *ausf_infoJSON)
{
OpenAPI_ausf_info_t *ausf_info_local_var = NULL;
cJSON *group_id = cJSON_GetObjectItemCaseSensitive(ausf_infoJSON, "groupId");
OpenAPI_lnode_t *node = NULL;
cJSON *group_id = NULL;
cJSON *supi_ranges = NULL;
OpenAPI_list_t *supi_rangesList = NULL;
cJSON *routing_indicators = NULL;
OpenAPI_list_t *routing_indicatorsList = NULL;
group_id = cJSON_GetObjectItemCaseSensitive(ausf_infoJSON, "groupId");
if (group_id) {
if (!cJSON_IsString(group_id)) {
if (!cJSON_IsString(group_id) && !cJSON_IsNull(group_id)) {
ogs_error("OpenAPI_ausf_info_parseFromJSON() failed [group_id]");
goto end;
}
}
cJSON *supi_ranges = cJSON_GetObjectItemCaseSensitive(ausf_infoJSON, "supiRanges");
OpenAPI_list_t *supi_rangesList;
supi_ranges = cJSON_GetObjectItemCaseSensitive(ausf_infoJSON, "supiRanges");
if (supi_ranges) {
cJSON *supi_ranges_local_nonprimitive;
if (!cJSON_IsArray(supi_ranges)){
ogs_error("OpenAPI_ausf_info_parseFromJSON() failed [supi_ranges]");
goto end;
}
supi_rangesList = OpenAPI_list_create();
cJSON_ArrayForEach(supi_ranges_local_nonprimitive, supi_ranges ) {
if (!cJSON_IsObject(supi_ranges_local_nonprimitive)) {
cJSON *supi_ranges_local = NULL;
if (!cJSON_IsArray(supi_ranges)) {
ogs_error("OpenAPI_ausf_info_parseFromJSON() failed [supi_ranges]");
goto end;
}
OpenAPI_supi_range_t *supi_rangesItem = OpenAPI_supi_range_parseFromJSON(supi_ranges_local_nonprimitive);
if (!supi_rangesItem) {
ogs_error("No supi_rangesItem");
OpenAPI_list_free(supi_rangesList);
supi_rangesList = OpenAPI_list_create();
cJSON_ArrayForEach(supi_ranges_local, supi_ranges) {
if (!cJSON_IsObject(supi_ranges_local)) {
ogs_error("OpenAPI_ausf_info_parseFromJSON() failed [supi_ranges]");
goto end;
}
OpenAPI_supi_range_t *supi_rangesItem = OpenAPI_supi_range_parseFromJSON(supi_ranges_local);
if (!supi_rangesItem) {
ogs_error("No supi_rangesItem");
OpenAPI_list_free(supi_rangesList);
goto end;
}
OpenAPI_list_add(supi_rangesList, supi_rangesItem);
}
}
routing_indicators = cJSON_GetObjectItemCaseSensitive(ausf_infoJSON, "routingIndicators");
if (routing_indicators) {
cJSON *routing_indicators_local = NULL;
if (!cJSON_IsArray(routing_indicators)) {
ogs_error("OpenAPI_ausf_info_parseFromJSON() failed [routing_indicators]");
goto end;
}
OpenAPI_list_add(supi_rangesList, supi_rangesItem);
}
}
routing_indicatorsList = OpenAPI_list_create();
cJSON *routing_indicators = cJSON_GetObjectItemCaseSensitive(ausf_infoJSON, "routingIndicators");
OpenAPI_list_t *routing_indicatorsList;
if (routing_indicators) {
cJSON *routing_indicators_local;
if (!cJSON_IsArray(routing_indicators)) {
ogs_error("OpenAPI_ausf_info_parseFromJSON() failed [routing_indicators]");
goto end;
}
routing_indicatorsList = OpenAPI_list_create();
cJSON_ArrayForEach(routing_indicators_local, routing_indicators) {
if (!cJSON_IsString(routing_indicators_local)) {
ogs_error("OpenAPI_ausf_info_parseFromJSON() failed [routing_indicators]");
goto end;
}
OpenAPI_list_add(routing_indicatorsList, ogs_strdup(routing_indicators_local->valuestring));
}
cJSON_ArrayForEach(routing_indicators_local, routing_indicators) {
double *localDouble = NULL;
int *localInt = NULL;
if (!cJSON_IsString(routing_indicators_local)) {
ogs_error("OpenAPI_ausf_info_parseFromJSON() failed [routing_indicators]");
goto end;
}
OpenAPI_list_add(routing_indicatorsList, ogs_strdup(routing_indicators_local->valuestring));
}
}
ausf_info_local_var = OpenAPI_ausf_info_create (
group_id ? ogs_strdup(group_id->valuestring) : NULL,
group_id && !cJSON_IsNull(group_id) ? ogs_strdup(group_id->valuestring) : NULL,
supi_ranges ? supi_rangesList : NULL,
routing_indicators ? routing_indicatorsList : NULL
);
return ausf_info_local_var;
end:
if (supi_rangesList) {
OpenAPI_list_for_each(supi_rangesList, node) {
OpenAPI_supi_range_free(node->data);
}
OpenAPI_list_free(supi_rangesList);
supi_rangesList = NULL;
}
if (routing_indicatorsList) {
OpenAPI_list_for_each(routing_indicatorsList, node) {
ogs_free(node->data);
}
OpenAPI_list_free(routing_indicatorsList);
routing_indicatorsList = NULL;
}
return NULL;
}

View File

@ -30,19 +30,30 @@ OpenAPI_auth_event_t *OpenAPI_auth_event_create(
void OpenAPI_auth_event_free(OpenAPI_auth_event_t *auth_event)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == auth_event) {
return;
}
OpenAPI_lnode_t *node;
ogs_free(auth_event->nf_instance_id);
ogs_free(auth_event->time_stamp);
ogs_free(auth_event->serving_network_name);
if (auth_event->nf_instance_id) {
ogs_free(auth_event->nf_instance_id);
auth_event->nf_instance_id = NULL;
}
if (auth_event->time_stamp) {
ogs_free(auth_event->time_stamp);
auth_event->time_stamp = NULL;
}
if (auth_event->serving_network_name) {
ogs_free(auth_event->serving_network_name);
auth_event->serving_network_name = NULL;
}
ogs_free(auth_event);
}
cJSON *OpenAPI_auth_event_convertToJSON(OpenAPI_auth_event_t *auth_event)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (auth_event == NULL) {
ogs_error("OpenAPI_auth_event_convertToJSON() failed [AuthEvent]");
@ -50,6 +61,10 @@ cJSON *OpenAPI_auth_event_convertToJSON(OpenAPI_auth_event_t *auth_event)
}
item = cJSON_CreateObject();
if (!auth_event->nf_instance_id) {
ogs_error("OpenAPI_auth_event_convertToJSON() failed [nf_instance_id]");
return NULL;
}
if (cJSON_AddStringToObject(item, "nfInstanceId", auth_event->nf_instance_id) == NULL) {
ogs_error("OpenAPI_auth_event_convertToJSON() failed [nf_instance_id]");
goto end;
@ -60,16 +75,28 @@ cJSON *OpenAPI_auth_event_convertToJSON(OpenAPI_auth_event_t *auth_event)
goto end;
}
if (!auth_event->time_stamp) {
ogs_error("OpenAPI_auth_event_convertToJSON() failed [time_stamp]");
return NULL;
}
if (cJSON_AddStringToObject(item, "timeStamp", auth_event->time_stamp) == NULL) {
ogs_error("OpenAPI_auth_event_convertToJSON() failed [time_stamp]");
goto end;
}
if (auth_event->auth_type == OpenAPI_auth_type_NULL) {
ogs_error("OpenAPI_auth_event_convertToJSON() failed [auth_type]");
return NULL;
}
if (cJSON_AddStringToObject(item, "authType", OpenAPI_auth_type_ToString(auth_event->auth_type)) == NULL) {
ogs_error("OpenAPI_auth_event_convertToJSON() failed [auth_type]");
goto end;
}
if (!auth_event->serving_network_name) {
ogs_error("OpenAPI_auth_event_convertToJSON() failed [serving_network_name]");
return NULL;
}
if (cJSON_AddStringToObject(item, "servingNetworkName", auth_event->serving_network_name) == NULL) {
ogs_error("OpenAPI_auth_event_convertToJSON() failed [serving_network_name]");
goto end;
@ -89,65 +116,66 @@ end:
OpenAPI_auth_event_t *OpenAPI_auth_event_parseFromJSON(cJSON *auth_eventJSON)
{
OpenAPI_auth_event_t *auth_event_local_var = NULL;
cJSON *nf_instance_id = cJSON_GetObjectItemCaseSensitive(auth_eventJSON, "nfInstanceId");
OpenAPI_lnode_t *node = NULL;
cJSON *nf_instance_id = NULL;
cJSON *success = NULL;
cJSON *time_stamp = NULL;
cJSON *auth_type = NULL;
OpenAPI_auth_type_e auth_typeVariable = 0;
cJSON *serving_network_name = NULL;
cJSON *auth_removal_ind = NULL;
nf_instance_id = cJSON_GetObjectItemCaseSensitive(auth_eventJSON, "nfInstanceId");
if (!nf_instance_id) {
ogs_error("OpenAPI_auth_event_parseFromJSON() failed [nf_instance_id]");
goto end;
}
if (!cJSON_IsString(nf_instance_id)) {
ogs_error("OpenAPI_auth_event_parseFromJSON() failed [nf_instance_id]");
goto end;
}
cJSON *success = cJSON_GetObjectItemCaseSensitive(auth_eventJSON, "success");
success = cJSON_GetObjectItemCaseSensitive(auth_eventJSON, "success");
if (!success) {
ogs_error("OpenAPI_auth_event_parseFromJSON() failed [success]");
goto end;
}
if (!cJSON_IsBool(success)) {
ogs_error("OpenAPI_auth_event_parseFromJSON() failed [success]");
goto end;
}
cJSON *time_stamp = cJSON_GetObjectItemCaseSensitive(auth_eventJSON, "timeStamp");
time_stamp = cJSON_GetObjectItemCaseSensitive(auth_eventJSON, "timeStamp");
if (!time_stamp) {
ogs_error("OpenAPI_auth_event_parseFromJSON() failed [time_stamp]");
goto end;
}
if (!cJSON_IsString(time_stamp)) {
if (!cJSON_IsString(time_stamp) && !cJSON_IsNull(time_stamp)) {
ogs_error("OpenAPI_auth_event_parseFromJSON() failed [time_stamp]");
goto end;
}
cJSON *auth_type = cJSON_GetObjectItemCaseSensitive(auth_eventJSON, "authType");
auth_type = cJSON_GetObjectItemCaseSensitive(auth_eventJSON, "authType");
if (!auth_type) {
ogs_error("OpenAPI_auth_event_parseFromJSON() failed [auth_type]");
goto end;
}
OpenAPI_auth_type_e auth_typeVariable;
if (!cJSON_IsString(auth_type)) {
ogs_error("OpenAPI_auth_event_parseFromJSON() failed [auth_type]");
goto end;
}
auth_typeVariable = OpenAPI_auth_type_FromString(auth_type->valuestring);
cJSON *serving_network_name = cJSON_GetObjectItemCaseSensitive(auth_eventJSON, "servingNetworkName");
serving_network_name = cJSON_GetObjectItemCaseSensitive(auth_eventJSON, "servingNetworkName");
if (!serving_network_name) {
ogs_error("OpenAPI_auth_event_parseFromJSON() failed [serving_network_name]");
goto end;
}
if (!cJSON_IsString(serving_network_name)) {
ogs_error("OpenAPI_auth_event_parseFromJSON() failed [serving_network_name]");
goto end;
}
cJSON *auth_removal_ind = cJSON_GetObjectItemCaseSensitive(auth_eventJSON, "authRemovalInd");
auth_removal_ind = cJSON_GetObjectItemCaseSensitive(auth_eventJSON, "authRemovalInd");
if (auth_removal_ind) {
if (!cJSON_IsBool(auth_removal_ind)) {
ogs_error("OpenAPI_auth_event_parseFromJSON() failed [auth_removal_ind]");

View File

@ -38,28 +38,57 @@ OpenAPI_authentication_info_t *OpenAPI_authentication_info_create(
void OpenAPI_authentication_info_free(OpenAPI_authentication_info_t *authentication_info)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == authentication_info) {
return;
}
OpenAPI_lnode_t *node;
ogs_free(authentication_info->supi_or_suci);
ogs_free(authentication_info->serving_network_name);
OpenAPI_resynchronization_info_free(authentication_info->resynchronization_info);
ogs_free(authentication_info->pei);
OpenAPI_trace_data_free(authentication_info->trace_data);
ogs_free(authentication_info->udm_group_id);
ogs_free(authentication_info->routing_indicator);
OpenAPI_list_for_each(authentication_info->cell_cag_info, node) {
ogs_free(node->data);
if (authentication_info->supi_or_suci) {
ogs_free(authentication_info->supi_or_suci);
authentication_info->supi_or_suci = NULL;
}
if (authentication_info->serving_network_name) {
ogs_free(authentication_info->serving_network_name);
authentication_info->serving_network_name = NULL;
}
if (authentication_info->resynchronization_info) {
OpenAPI_resynchronization_info_free(authentication_info->resynchronization_info);
authentication_info->resynchronization_info = NULL;
}
if (authentication_info->pei) {
ogs_free(authentication_info->pei);
authentication_info->pei = NULL;
}
if (authentication_info->trace_data) {
OpenAPI_trace_data_free(authentication_info->trace_data);
authentication_info->trace_data = NULL;
}
if (authentication_info->udm_group_id) {
ogs_free(authentication_info->udm_group_id);
authentication_info->udm_group_id = NULL;
}
if (authentication_info->routing_indicator) {
ogs_free(authentication_info->routing_indicator);
authentication_info->routing_indicator = NULL;
}
if (authentication_info->cell_cag_info) {
OpenAPI_list_for_each(authentication_info->cell_cag_info, node) {
ogs_free(node->data);
}
OpenAPI_list_free(authentication_info->cell_cag_info);
authentication_info->cell_cag_info = NULL;
}
if (authentication_info->supported_features) {
ogs_free(authentication_info->supported_features);
authentication_info->supported_features = NULL;
}
OpenAPI_list_free(authentication_info->cell_cag_info);
ogs_free(authentication_info->supported_features);
ogs_free(authentication_info);
}
cJSON *OpenAPI_authentication_info_convertToJSON(OpenAPI_authentication_info_t *authentication_info)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (authentication_info == NULL) {
ogs_error("OpenAPI_authentication_info_convertToJSON() failed [AuthenticationInfo]");
@ -67,11 +96,19 @@ cJSON *OpenAPI_authentication_info_convertToJSON(OpenAPI_authentication_info_t *
}
item = cJSON_CreateObject();
if (!authentication_info->supi_or_suci) {
ogs_error("OpenAPI_authentication_info_convertToJSON() failed [supi_or_suci]");
return NULL;
}
if (cJSON_AddStringToObject(item, "supiOrSuci", authentication_info->supi_or_suci) == NULL) {
ogs_error("OpenAPI_authentication_info_convertToJSON() failed [supi_or_suci]");
goto end;
}
if (!authentication_info->serving_network_name) {
ogs_error("OpenAPI_authentication_info_convertToJSON() failed [serving_network_name]");
return NULL;
}
if (cJSON_AddStringToObject(item, "servingNetworkName", authentication_info->serving_network_name) == NULL) {
ogs_error("OpenAPI_authentication_info_convertToJSON() failed [serving_network_name]");
goto end;
@ -125,19 +162,17 @@ cJSON *OpenAPI_authentication_info_convertToJSON(OpenAPI_authentication_info_t *
}
if (authentication_info->cell_cag_info) {
cJSON *cell_cag_info = cJSON_AddArrayToObject(item, "cellCagInfo");
if (cell_cag_info == NULL) {
cJSON *cell_cag_infoList = cJSON_AddArrayToObject(item, "cellCagInfo");
if (cell_cag_infoList == NULL) {
ogs_error("OpenAPI_authentication_info_convertToJSON() failed [cell_cag_info]");
goto end;
}
OpenAPI_lnode_t *cell_cag_info_node;
OpenAPI_list_for_each(authentication_info->cell_cag_info, cell_cag_info_node) {
if (cJSON_AddStringToObject(cell_cag_info, "", (char*)cell_cag_info_node->data) == NULL) {
ogs_error("OpenAPI_authentication_info_convertToJSON() failed [cell_cag_info]");
goto end;
OpenAPI_list_for_each(authentication_info->cell_cag_info, node) {
if (cJSON_AddStringToObject(cell_cag_infoList, "", (char*)node->data) == NULL) {
ogs_error("OpenAPI_authentication_info_convertToJSON() failed [cell_cag_info]");
goto end;
}
}
}
}
if (authentication_info->is_n5gc_ind) {
@ -161,91 +196,96 @@ end:
OpenAPI_authentication_info_t *OpenAPI_authentication_info_parseFromJSON(cJSON *authentication_infoJSON)
{
OpenAPI_authentication_info_t *authentication_info_local_var = NULL;
cJSON *supi_or_suci = cJSON_GetObjectItemCaseSensitive(authentication_infoJSON, "supiOrSuci");
OpenAPI_lnode_t *node = NULL;
cJSON *supi_or_suci = NULL;
cJSON *serving_network_name = NULL;
cJSON *resynchronization_info = NULL;
OpenAPI_resynchronization_info_t *resynchronization_info_local_nonprim = NULL;
cJSON *pei = NULL;
cJSON *trace_data = NULL;
OpenAPI_trace_data_t *trace_data_local_nonprim = NULL;
cJSON *udm_group_id = NULL;
cJSON *routing_indicator = NULL;
cJSON *cell_cag_info = NULL;
OpenAPI_list_t *cell_cag_infoList = NULL;
cJSON *n5gc_ind = NULL;
cJSON *supported_features = NULL;
supi_or_suci = cJSON_GetObjectItemCaseSensitive(authentication_infoJSON, "supiOrSuci");
if (!supi_or_suci) {
ogs_error("OpenAPI_authentication_info_parseFromJSON() failed [supi_or_suci]");
goto end;
}
if (!cJSON_IsString(supi_or_suci)) {
ogs_error("OpenAPI_authentication_info_parseFromJSON() failed [supi_or_suci]");
goto end;
}
cJSON *serving_network_name = cJSON_GetObjectItemCaseSensitive(authentication_infoJSON, "servingNetworkName");
serving_network_name = cJSON_GetObjectItemCaseSensitive(authentication_infoJSON, "servingNetworkName");
if (!serving_network_name) {
ogs_error("OpenAPI_authentication_info_parseFromJSON() failed [serving_network_name]");
goto end;
}
if (!cJSON_IsString(serving_network_name)) {
ogs_error("OpenAPI_authentication_info_parseFromJSON() failed [serving_network_name]");
goto end;
}
cJSON *resynchronization_info = cJSON_GetObjectItemCaseSensitive(authentication_infoJSON, "resynchronizationInfo");
OpenAPI_resynchronization_info_t *resynchronization_info_local_nonprim = NULL;
resynchronization_info = cJSON_GetObjectItemCaseSensitive(authentication_infoJSON, "resynchronizationInfo");
if (resynchronization_info) {
resynchronization_info_local_nonprim = OpenAPI_resynchronization_info_parseFromJSON(resynchronization_info);
}
cJSON *pei = cJSON_GetObjectItemCaseSensitive(authentication_infoJSON, "pei");
pei = cJSON_GetObjectItemCaseSensitive(authentication_infoJSON, "pei");
if (pei) {
if (!cJSON_IsString(pei)) {
if (!cJSON_IsString(pei) && !cJSON_IsNull(pei)) {
ogs_error("OpenAPI_authentication_info_parseFromJSON() failed [pei]");
goto end;
}
}
cJSON *trace_data = cJSON_GetObjectItemCaseSensitive(authentication_infoJSON, "traceData");
OpenAPI_trace_data_t *trace_data_local_nonprim = NULL;
trace_data = cJSON_GetObjectItemCaseSensitive(authentication_infoJSON, "traceData");
if (trace_data) {
trace_data_local_nonprim = OpenAPI_trace_data_parseFromJSON(trace_data);
}
cJSON *udm_group_id = cJSON_GetObjectItemCaseSensitive(authentication_infoJSON, "udmGroupId");
udm_group_id = cJSON_GetObjectItemCaseSensitive(authentication_infoJSON, "udmGroupId");
if (udm_group_id) {
if (!cJSON_IsString(udm_group_id)) {
if (!cJSON_IsString(udm_group_id) && !cJSON_IsNull(udm_group_id)) {
ogs_error("OpenAPI_authentication_info_parseFromJSON() failed [udm_group_id]");
goto end;
}
}
cJSON *routing_indicator = cJSON_GetObjectItemCaseSensitive(authentication_infoJSON, "routingIndicator");
routing_indicator = cJSON_GetObjectItemCaseSensitive(authentication_infoJSON, "routingIndicator");
if (routing_indicator) {
if (!cJSON_IsString(routing_indicator)) {
if (!cJSON_IsString(routing_indicator) && !cJSON_IsNull(routing_indicator)) {
ogs_error("OpenAPI_authentication_info_parseFromJSON() failed [routing_indicator]");
goto end;
}
}
cJSON *cell_cag_info = cJSON_GetObjectItemCaseSensitive(authentication_infoJSON, "cellCagInfo");
OpenAPI_list_t *cell_cag_infoList;
cell_cag_info = cJSON_GetObjectItemCaseSensitive(authentication_infoJSON, "cellCagInfo");
if (cell_cag_info) {
cJSON *cell_cag_info_local;
if (!cJSON_IsArray(cell_cag_info)) {
ogs_error("OpenAPI_authentication_info_parseFromJSON() failed [cell_cag_info]");
goto end;
}
cell_cag_infoList = OpenAPI_list_create();
cJSON *cell_cag_info_local = NULL;
if (!cJSON_IsArray(cell_cag_info)) {
ogs_error("OpenAPI_authentication_info_parseFromJSON() failed [cell_cag_info]");
goto end;
}
cJSON_ArrayForEach(cell_cag_info_local, cell_cag_info) {
if (!cJSON_IsString(cell_cag_info_local)) {
ogs_error("OpenAPI_authentication_info_parseFromJSON() failed [cell_cag_info]");
goto end;
}
OpenAPI_list_add(cell_cag_infoList, ogs_strdup(cell_cag_info_local->valuestring));
}
cell_cag_infoList = OpenAPI_list_create();
cJSON_ArrayForEach(cell_cag_info_local, cell_cag_info) {
double *localDouble = NULL;
int *localInt = NULL;
if (!cJSON_IsString(cell_cag_info_local)) {
ogs_error("OpenAPI_authentication_info_parseFromJSON() failed [cell_cag_info]");
goto end;
}
OpenAPI_list_add(cell_cag_infoList, ogs_strdup(cell_cag_info_local->valuestring));
}
}
cJSON *n5gc_ind = cJSON_GetObjectItemCaseSensitive(authentication_infoJSON, "n5gcInd");
n5gc_ind = cJSON_GetObjectItemCaseSensitive(authentication_infoJSON, "n5gcInd");
if (n5gc_ind) {
if (!cJSON_IsBool(n5gc_ind)) {
ogs_error("OpenAPI_authentication_info_parseFromJSON() failed [n5gc_ind]");
@ -253,10 +293,9 @@ OpenAPI_authentication_info_t *OpenAPI_authentication_info_parseFromJSON(cJSON *
}
}
cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(authentication_infoJSON, "supportedFeatures");
supported_features = cJSON_GetObjectItemCaseSensitive(authentication_infoJSON, "supportedFeatures");
if (supported_features) {
if (!cJSON_IsString(supported_features)) {
if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) {
ogs_error("OpenAPI_authentication_info_parseFromJSON() failed [supported_features]");
goto end;
}
@ -266,18 +305,33 @@ OpenAPI_authentication_info_t *OpenAPI_authentication_info_parseFromJSON(cJSON *
ogs_strdup(supi_or_suci->valuestring),
ogs_strdup(serving_network_name->valuestring),
resynchronization_info ? resynchronization_info_local_nonprim : NULL,
pei ? ogs_strdup(pei->valuestring) : NULL,
pei && !cJSON_IsNull(pei) ? ogs_strdup(pei->valuestring) : NULL,
trace_data ? trace_data_local_nonprim : NULL,
udm_group_id ? ogs_strdup(udm_group_id->valuestring) : NULL,
routing_indicator ? ogs_strdup(routing_indicator->valuestring) : NULL,
udm_group_id && !cJSON_IsNull(udm_group_id) ? ogs_strdup(udm_group_id->valuestring) : NULL,
routing_indicator && !cJSON_IsNull(routing_indicator) ? ogs_strdup(routing_indicator->valuestring) : NULL,
cell_cag_info ? cell_cag_infoList : NULL,
n5gc_ind ? true : false,
n5gc_ind ? n5gc_ind->valueint : 0,
supported_features ? ogs_strdup(supported_features->valuestring) : NULL
supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL
);
return authentication_info_local_var;
end:
if (resynchronization_info_local_nonprim) {
OpenAPI_resynchronization_info_free(resynchronization_info_local_nonprim);
resynchronization_info_local_nonprim = NULL;
}
if (trace_data_local_nonprim) {
OpenAPI_trace_data_free(trace_data_local_nonprim);
trace_data_local_nonprim = NULL;
}
if (cell_cag_infoList) {
OpenAPI_list_for_each(cell_cag_infoList, node) {
ogs_free(node->data);
}
OpenAPI_list_free(cell_cag_infoList);
cell_cag_infoList = NULL;
}
return NULL;
}

View File

@ -30,24 +30,41 @@ OpenAPI_authentication_info_request_t *OpenAPI_authentication_info_request_creat
void OpenAPI_authentication_info_request_free(OpenAPI_authentication_info_request_t *authentication_info_request)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == authentication_info_request) {
return;
}
OpenAPI_lnode_t *node;
ogs_free(authentication_info_request->supported_features);
ogs_free(authentication_info_request->serving_network_name);
OpenAPI_resynchronization_info_free(authentication_info_request->resynchronization_info);
ogs_free(authentication_info_request->ausf_instance_id);
OpenAPI_list_for_each(authentication_info_request->cell_cag_info, node) {
ogs_free(node->data);
if (authentication_info_request->supported_features) {
ogs_free(authentication_info_request->supported_features);
authentication_info_request->supported_features = NULL;
}
if (authentication_info_request->serving_network_name) {
ogs_free(authentication_info_request->serving_network_name);
authentication_info_request->serving_network_name = NULL;
}
if (authentication_info_request->resynchronization_info) {
OpenAPI_resynchronization_info_free(authentication_info_request->resynchronization_info);
authentication_info_request->resynchronization_info = NULL;
}
if (authentication_info_request->ausf_instance_id) {
ogs_free(authentication_info_request->ausf_instance_id);
authentication_info_request->ausf_instance_id = NULL;
}
if (authentication_info_request->cell_cag_info) {
OpenAPI_list_for_each(authentication_info_request->cell_cag_info, node) {
ogs_free(node->data);
}
OpenAPI_list_free(authentication_info_request->cell_cag_info);
authentication_info_request->cell_cag_info = NULL;
}
OpenAPI_list_free(authentication_info_request->cell_cag_info);
ogs_free(authentication_info_request);
}
cJSON *OpenAPI_authentication_info_request_convertToJSON(OpenAPI_authentication_info_request_t *authentication_info_request)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (authentication_info_request == NULL) {
ogs_error("OpenAPI_authentication_info_request_convertToJSON() failed [AuthenticationInfoRequest]");
@ -62,6 +79,10 @@ cJSON *OpenAPI_authentication_info_request_convertToJSON(OpenAPI_authentication_
}
}
if (!authentication_info_request->serving_network_name) {
ogs_error("OpenAPI_authentication_info_request_convertToJSON() failed [serving_network_name]");
return NULL;
}
if (cJSON_AddStringToObject(item, "servingNetworkName", authentication_info_request->serving_network_name) == NULL) {
ogs_error("OpenAPI_authentication_info_request_convertToJSON() failed [serving_network_name]");
goto end;
@ -80,25 +101,27 @@ cJSON *OpenAPI_authentication_info_request_convertToJSON(OpenAPI_authentication_
}
}
if (!authentication_info_request->ausf_instance_id) {
ogs_error("OpenAPI_authentication_info_request_convertToJSON() failed [ausf_instance_id]");
return NULL;
}
if (cJSON_AddStringToObject(item, "ausfInstanceId", authentication_info_request->ausf_instance_id) == NULL) {
ogs_error("OpenAPI_authentication_info_request_convertToJSON() failed [ausf_instance_id]");
goto end;
}
if (authentication_info_request->cell_cag_info) {
cJSON *cell_cag_info = cJSON_AddArrayToObject(item, "cellCagInfo");
if (cell_cag_info == NULL) {
cJSON *cell_cag_infoList = cJSON_AddArrayToObject(item, "cellCagInfo");
if (cell_cag_infoList == NULL) {
ogs_error("OpenAPI_authentication_info_request_convertToJSON() failed [cell_cag_info]");
goto end;
}
OpenAPI_lnode_t *cell_cag_info_node;
OpenAPI_list_for_each(authentication_info_request->cell_cag_info, cell_cag_info_node) {
if (cJSON_AddStringToObject(cell_cag_info, "", (char*)cell_cag_info_node->data) == NULL) {
ogs_error("OpenAPI_authentication_info_request_convertToJSON() failed [cell_cag_info]");
goto end;
OpenAPI_list_for_each(authentication_info_request->cell_cag_info, node) {
if (cJSON_AddStringToObject(cell_cag_infoList, "", (char*)node->data) == NULL) {
ogs_error("OpenAPI_authentication_info_request_convertToJSON() failed [cell_cag_info]");
goto end;
}
}
}
}
if (authentication_info_request->is_n5gc_ind) {
@ -115,66 +138,70 @@ end:
OpenAPI_authentication_info_request_t *OpenAPI_authentication_info_request_parseFromJSON(cJSON *authentication_info_requestJSON)
{
OpenAPI_authentication_info_request_t *authentication_info_request_local_var = NULL;
cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(authentication_info_requestJSON, "supportedFeatures");
OpenAPI_lnode_t *node = NULL;
cJSON *supported_features = NULL;
cJSON *serving_network_name = NULL;
cJSON *resynchronization_info = NULL;
OpenAPI_resynchronization_info_t *resynchronization_info_local_nonprim = NULL;
cJSON *ausf_instance_id = NULL;
cJSON *cell_cag_info = NULL;
OpenAPI_list_t *cell_cag_infoList = NULL;
cJSON *n5gc_ind = NULL;
supported_features = cJSON_GetObjectItemCaseSensitive(authentication_info_requestJSON, "supportedFeatures");
if (supported_features) {
if (!cJSON_IsString(supported_features)) {
if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) {
ogs_error("OpenAPI_authentication_info_request_parseFromJSON() failed [supported_features]");
goto end;
}
}
cJSON *serving_network_name = cJSON_GetObjectItemCaseSensitive(authentication_info_requestJSON, "servingNetworkName");
serving_network_name = cJSON_GetObjectItemCaseSensitive(authentication_info_requestJSON, "servingNetworkName");
if (!serving_network_name) {
ogs_error("OpenAPI_authentication_info_request_parseFromJSON() failed [serving_network_name]");
goto end;
}
if (!cJSON_IsString(serving_network_name)) {
ogs_error("OpenAPI_authentication_info_request_parseFromJSON() failed [serving_network_name]");
goto end;
}
cJSON *resynchronization_info = cJSON_GetObjectItemCaseSensitive(authentication_info_requestJSON, "resynchronizationInfo");
OpenAPI_resynchronization_info_t *resynchronization_info_local_nonprim = NULL;
resynchronization_info = cJSON_GetObjectItemCaseSensitive(authentication_info_requestJSON, "resynchronizationInfo");
if (resynchronization_info) {
resynchronization_info_local_nonprim = OpenAPI_resynchronization_info_parseFromJSON(resynchronization_info);
}
cJSON *ausf_instance_id = cJSON_GetObjectItemCaseSensitive(authentication_info_requestJSON, "ausfInstanceId");
ausf_instance_id = cJSON_GetObjectItemCaseSensitive(authentication_info_requestJSON, "ausfInstanceId");
if (!ausf_instance_id) {
ogs_error("OpenAPI_authentication_info_request_parseFromJSON() failed [ausf_instance_id]");
goto end;
}
if (!cJSON_IsString(ausf_instance_id)) {
ogs_error("OpenAPI_authentication_info_request_parseFromJSON() failed [ausf_instance_id]");
goto end;
}
cJSON *cell_cag_info = cJSON_GetObjectItemCaseSensitive(authentication_info_requestJSON, "cellCagInfo");
OpenAPI_list_t *cell_cag_infoList;
cell_cag_info = cJSON_GetObjectItemCaseSensitive(authentication_info_requestJSON, "cellCagInfo");
if (cell_cag_info) {
cJSON *cell_cag_info_local;
if (!cJSON_IsArray(cell_cag_info)) {
ogs_error("OpenAPI_authentication_info_request_parseFromJSON() failed [cell_cag_info]");
goto end;
}
cell_cag_infoList = OpenAPI_list_create();
cJSON *cell_cag_info_local = NULL;
if (!cJSON_IsArray(cell_cag_info)) {
ogs_error("OpenAPI_authentication_info_request_parseFromJSON() failed [cell_cag_info]");
goto end;
}
cJSON_ArrayForEach(cell_cag_info_local, cell_cag_info) {
if (!cJSON_IsString(cell_cag_info_local)) {
ogs_error("OpenAPI_authentication_info_request_parseFromJSON() failed [cell_cag_info]");
goto end;
}
OpenAPI_list_add(cell_cag_infoList, ogs_strdup(cell_cag_info_local->valuestring));
}
cell_cag_infoList = OpenAPI_list_create();
cJSON_ArrayForEach(cell_cag_info_local, cell_cag_info) {
double *localDouble = NULL;
int *localInt = NULL;
if (!cJSON_IsString(cell_cag_info_local)) {
ogs_error("OpenAPI_authentication_info_request_parseFromJSON() failed [cell_cag_info]");
goto end;
}
OpenAPI_list_add(cell_cag_infoList, ogs_strdup(cell_cag_info_local->valuestring));
}
}
cJSON *n5gc_ind = cJSON_GetObjectItemCaseSensitive(authentication_info_requestJSON, "n5gcInd");
n5gc_ind = cJSON_GetObjectItemCaseSensitive(authentication_info_requestJSON, "n5gcInd");
if (n5gc_ind) {
if (!cJSON_IsBool(n5gc_ind)) {
ogs_error("OpenAPI_authentication_info_request_parseFromJSON() failed [n5gc_ind]");
@ -183,7 +210,7 @@ OpenAPI_authentication_info_request_t *OpenAPI_authentication_info_request_parse
}
authentication_info_request_local_var = OpenAPI_authentication_info_request_create (
supported_features ? ogs_strdup(supported_features->valuestring) : NULL,
supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL,
ogs_strdup(serving_network_name->valuestring),
resynchronization_info ? resynchronization_info_local_nonprim : NULL,
ogs_strdup(ausf_instance_id->valuestring),
@ -194,6 +221,17 @@ OpenAPI_authentication_info_request_t *OpenAPI_authentication_info_request_parse
return authentication_info_request_local_var;
end:
if (resynchronization_info_local_nonprim) {
OpenAPI_resynchronization_info_free(resynchronization_info_local_nonprim);
resynchronization_info_local_nonprim = NULL;
}
if (cell_cag_infoList) {
OpenAPI_list_for_each(cell_cag_infoList, node) {
ogs_free(node->data);
}
OpenAPI_list_free(cell_cag_infoList);
cell_cag_infoList = NULL;
}
return NULL;
}

View File

@ -24,19 +24,30 @@ OpenAPI_authentication_info_result_t *OpenAPI_authentication_info_result_create(
void OpenAPI_authentication_info_result_free(OpenAPI_authentication_info_result_t *authentication_info_result)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == authentication_info_result) {
return;
}
OpenAPI_lnode_t *node;
ogs_free(authentication_info_result->supported_features);
OpenAPI_authentication_vector_free(authentication_info_result->authentication_vector);
ogs_free(authentication_info_result->supi);
if (authentication_info_result->supported_features) {
ogs_free(authentication_info_result->supported_features);
authentication_info_result->supported_features = NULL;
}
if (authentication_info_result->authentication_vector) {
OpenAPI_authentication_vector_free(authentication_info_result->authentication_vector);
authentication_info_result->authentication_vector = NULL;
}
if (authentication_info_result->supi) {
ogs_free(authentication_info_result->supi);
authentication_info_result->supi = NULL;
}
ogs_free(authentication_info_result);
}
cJSON *OpenAPI_authentication_info_result_convertToJSON(OpenAPI_authentication_info_result_t *authentication_info_result)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (authentication_info_result == NULL) {
ogs_error("OpenAPI_authentication_info_result_convertToJSON() failed [AuthenticationInfoResult]");
@ -44,6 +55,10 @@ cJSON *OpenAPI_authentication_info_result_convertToJSON(OpenAPI_authentication_i
}
item = cJSON_CreateObject();
if (authentication_info_result->auth_type == OpenAPI_auth_type_NULL) {
ogs_error("OpenAPI_authentication_info_result_convertToJSON() failed [auth_type]");
return NULL;
}
if (cJSON_AddStringToObject(item, "authType", OpenAPI_auth_type_ToString(authentication_info_result->auth_type)) == NULL) {
ogs_error("OpenAPI_authentication_info_result_convertToJSON() failed [auth_type]");
goto end;
@ -83,39 +98,40 @@ end:
OpenAPI_authentication_info_result_t *OpenAPI_authentication_info_result_parseFromJSON(cJSON *authentication_info_resultJSON)
{
OpenAPI_authentication_info_result_t *authentication_info_result_local_var = NULL;
cJSON *auth_type = cJSON_GetObjectItemCaseSensitive(authentication_info_resultJSON, "authType");
OpenAPI_lnode_t *node = NULL;
cJSON *auth_type = NULL;
OpenAPI_auth_type_e auth_typeVariable = 0;
cJSON *supported_features = NULL;
cJSON *authentication_vector = NULL;
OpenAPI_authentication_vector_t *authentication_vector_local_nonprim = NULL;
cJSON *supi = NULL;
auth_type = cJSON_GetObjectItemCaseSensitive(authentication_info_resultJSON, "authType");
if (!auth_type) {
ogs_error("OpenAPI_authentication_info_result_parseFromJSON() failed [auth_type]");
goto end;
}
OpenAPI_auth_type_e auth_typeVariable;
if (!cJSON_IsString(auth_type)) {
ogs_error("OpenAPI_authentication_info_result_parseFromJSON() failed [auth_type]");
goto end;
}
auth_typeVariable = OpenAPI_auth_type_FromString(auth_type->valuestring);
cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(authentication_info_resultJSON, "supportedFeatures");
supported_features = cJSON_GetObjectItemCaseSensitive(authentication_info_resultJSON, "supportedFeatures");
if (supported_features) {
if (!cJSON_IsString(supported_features)) {
if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) {
ogs_error("OpenAPI_authentication_info_result_parseFromJSON() failed [supported_features]");
goto end;
}
}
cJSON *authentication_vector = cJSON_GetObjectItemCaseSensitive(authentication_info_resultJSON, "authenticationVector");
OpenAPI_authentication_vector_t *authentication_vector_local_nonprim = NULL;
authentication_vector = cJSON_GetObjectItemCaseSensitive(authentication_info_resultJSON, "authenticationVector");
if (authentication_vector) {
authentication_vector_local_nonprim = OpenAPI_authentication_vector_parseFromJSON(authentication_vector);
}
cJSON *supi = cJSON_GetObjectItemCaseSensitive(authentication_info_resultJSON, "supi");
supi = cJSON_GetObjectItemCaseSensitive(authentication_info_resultJSON, "supi");
if (supi) {
if (!cJSON_IsString(supi)) {
if (!cJSON_IsString(supi) && !cJSON_IsNull(supi)) {
ogs_error("OpenAPI_authentication_info_result_parseFromJSON() failed [supi]");
goto end;
}
@ -123,13 +139,17 @@ OpenAPI_authentication_info_result_t *OpenAPI_authentication_info_result_parseFr
authentication_info_result_local_var = OpenAPI_authentication_info_result_create (
auth_typeVariable,
supported_features ? ogs_strdup(supported_features->valuestring) : NULL,
supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL,
authentication_vector ? authentication_vector_local_nonprim : NULL,
supi ? ogs_strdup(supi->valuestring) : NULL
supi && !cJSON_IsNull(supi) ? ogs_strdup(supi->valuestring) : NULL
);
return authentication_info_result_local_var;
end:
if (authentication_vector_local_nonprim) {
OpenAPI_authentication_vector_free(authentication_vector_local_nonprim);
authentication_vector_local_nonprim = NULL;
}
return NULL;
}

View File

@ -44,24 +44,50 @@ OpenAPI_authentication_subscription_t *OpenAPI_authentication_subscription_creat
void OpenAPI_authentication_subscription_free(OpenAPI_authentication_subscription_t *authentication_subscription)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == authentication_subscription) {
return;
}
OpenAPI_lnode_t *node;
ogs_free(authentication_subscription->enc_permanent_key);
ogs_free(authentication_subscription->protection_parameter_id);
OpenAPI_sequence_number_free(authentication_subscription->sequence_number);
ogs_free(authentication_subscription->authentication_management_field);
ogs_free(authentication_subscription->algorithm_id);
ogs_free(authentication_subscription->enc_opc_key);
ogs_free(authentication_subscription->enc_topc_key);
ogs_free(authentication_subscription->supi);
if (authentication_subscription->enc_permanent_key) {
ogs_free(authentication_subscription->enc_permanent_key);
authentication_subscription->enc_permanent_key = NULL;
}
if (authentication_subscription->protection_parameter_id) {
ogs_free(authentication_subscription->protection_parameter_id);
authentication_subscription->protection_parameter_id = NULL;
}
if (authentication_subscription->sequence_number) {
OpenAPI_sequence_number_free(authentication_subscription->sequence_number);
authentication_subscription->sequence_number = NULL;
}
if (authentication_subscription->authentication_management_field) {
ogs_free(authentication_subscription->authentication_management_field);
authentication_subscription->authentication_management_field = NULL;
}
if (authentication_subscription->algorithm_id) {
ogs_free(authentication_subscription->algorithm_id);
authentication_subscription->algorithm_id = NULL;
}
if (authentication_subscription->enc_opc_key) {
ogs_free(authentication_subscription->enc_opc_key);
authentication_subscription->enc_opc_key = NULL;
}
if (authentication_subscription->enc_topc_key) {
ogs_free(authentication_subscription->enc_topc_key);
authentication_subscription->enc_topc_key = NULL;
}
if (authentication_subscription->supi) {
ogs_free(authentication_subscription->supi);
authentication_subscription->supi = NULL;
}
ogs_free(authentication_subscription);
}
cJSON *OpenAPI_authentication_subscription_convertToJSON(OpenAPI_authentication_subscription_t *authentication_subscription)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (authentication_subscription == NULL) {
ogs_error("OpenAPI_authentication_subscription_convertToJSON() failed [AuthenticationSubscription]");
@ -69,6 +95,10 @@ cJSON *OpenAPI_authentication_subscription_convertToJSON(OpenAPI_authentication_
}
item = cJSON_CreateObject();
if (authentication_subscription->authentication_method == OpenAPI_auth_method_NULL) {
ogs_error("OpenAPI_authentication_subscription_convertToJSON() failed [authentication_method]");
return NULL;
}
if (cJSON_AddStringToObject(item, "authenticationMethod", OpenAPI_auth_method_ToString(authentication_subscription->authentication_method)) == NULL) {
ogs_error("OpenAPI_authentication_subscription_convertToJSON() failed [authentication_method]");
goto end;
@ -136,7 +166,7 @@ cJSON *OpenAPI_authentication_subscription_convertToJSON(OpenAPI_authentication_
}
}
if (authentication_subscription->n5gc_auth_method) {
if (authentication_subscription->n5gc_auth_method != OpenAPI_auth_method_NULL) {
if (cJSON_AddStringToObject(item, "n5gcAuthMethod", OpenAPI_auth_method_ToString(authentication_subscription->n5gc_auth_method)) == NULL) {
ogs_error("OpenAPI_authentication_subscription_convertToJSON() failed [n5gc_auth_method]");
goto end;
@ -164,82 +194,87 @@ end:
OpenAPI_authentication_subscription_t *OpenAPI_authentication_subscription_parseFromJSON(cJSON *authentication_subscriptionJSON)
{
OpenAPI_authentication_subscription_t *authentication_subscription_local_var = NULL;
cJSON *authentication_method = cJSON_GetObjectItemCaseSensitive(authentication_subscriptionJSON, "authenticationMethod");
OpenAPI_lnode_t *node = NULL;
cJSON *authentication_method = NULL;
OpenAPI_auth_method_e authentication_methodVariable = 0;
cJSON *enc_permanent_key = NULL;
cJSON *protection_parameter_id = NULL;
cJSON *sequence_number = NULL;
OpenAPI_sequence_number_t *sequence_number_local_nonprim = NULL;
cJSON *authentication_management_field = NULL;
cJSON *algorithm_id = NULL;
cJSON *enc_opc_key = NULL;
cJSON *enc_topc_key = NULL;
cJSON *vector_generation_in_hss = NULL;
cJSON *n5gc_auth_method = NULL;
OpenAPI_auth_method_e n5gc_auth_methodVariable = 0;
cJSON *rg_authentication_ind = NULL;
cJSON *supi = NULL;
authentication_method = cJSON_GetObjectItemCaseSensitive(authentication_subscriptionJSON, "authenticationMethod");
if (!authentication_method) {
ogs_error("OpenAPI_authentication_subscription_parseFromJSON() failed [authentication_method]");
goto end;
}
OpenAPI_auth_method_e authentication_methodVariable;
if (!cJSON_IsString(authentication_method)) {
ogs_error("OpenAPI_authentication_subscription_parseFromJSON() failed [authentication_method]");
goto end;
}
authentication_methodVariable = OpenAPI_auth_method_FromString(authentication_method->valuestring);
cJSON *enc_permanent_key = cJSON_GetObjectItemCaseSensitive(authentication_subscriptionJSON, "encPermanentKey");
enc_permanent_key = cJSON_GetObjectItemCaseSensitive(authentication_subscriptionJSON, "encPermanentKey");
if (enc_permanent_key) {
if (!cJSON_IsString(enc_permanent_key)) {
if (!cJSON_IsString(enc_permanent_key) && !cJSON_IsNull(enc_permanent_key)) {
ogs_error("OpenAPI_authentication_subscription_parseFromJSON() failed [enc_permanent_key]");
goto end;
}
}
cJSON *protection_parameter_id = cJSON_GetObjectItemCaseSensitive(authentication_subscriptionJSON, "protectionParameterId");
protection_parameter_id = cJSON_GetObjectItemCaseSensitive(authentication_subscriptionJSON, "protectionParameterId");
if (protection_parameter_id) {
if (!cJSON_IsString(protection_parameter_id)) {
if (!cJSON_IsString(protection_parameter_id) && !cJSON_IsNull(protection_parameter_id)) {
ogs_error("OpenAPI_authentication_subscription_parseFromJSON() failed [protection_parameter_id]");
goto end;
}
}
cJSON *sequence_number = cJSON_GetObjectItemCaseSensitive(authentication_subscriptionJSON, "sequenceNumber");
OpenAPI_sequence_number_t *sequence_number_local_nonprim = NULL;
sequence_number = cJSON_GetObjectItemCaseSensitive(authentication_subscriptionJSON, "sequenceNumber");
if (sequence_number) {
sequence_number_local_nonprim = OpenAPI_sequence_number_parseFromJSON(sequence_number);
}
cJSON *authentication_management_field = cJSON_GetObjectItemCaseSensitive(authentication_subscriptionJSON, "authenticationManagementField");
authentication_management_field = cJSON_GetObjectItemCaseSensitive(authentication_subscriptionJSON, "authenticationManagementField");
if (authentication_management_field) {
if (!cJSON_IsString(authentication_management_field)) {
if (!cJSON_IsString(authentication_management_field) && !cJSON_IsNull(authentication_management_field)) {
ogs_error("OpenAPI_authentication_subscription_parseFromJSON() failed [authentication_management_field]");
goto end;
}
}
cJSON *algorithm_id = cJSON_GetObjectItemCaseSensitive(authentication_subscriptionJSON, "algorithmId");
algorithm_id = cJSON_GetObjectItemCaseSensitive(authentication_subscriptionJSON, "algorithmId");
if (algorithm_id) {
if (!cJSON_IsString(algorithm_id)) {
if (!cJSON_IsString(algorithm_id) && !cJSON_IsNull(algorithm_id)) {
ogs_error("OpenAPI_authentication_subscription_parseFromJSON() failed [algorithm_id]");
goto end;
}
}
cJSON *enc_opc_key = cJSON_GetObjectItemCaseSensitive(authentication_subscriptionJSON, "encOpcKey");
enc_opc_key = cJSON_GetObjectItemCaseSensitive(authentication_subscriptionJSON, "encOpcKey");
if (enc_opc_key) {
if (!cJSON_IsString(enc_opc_key)) {
if (!cJSON_IsString(enc_opc_key) && !cJSON_IsNull(enc_opc_key)) {
ogs_error("OpenAPI_authentication_subscription_parseFromJSON() failed [enc_opc_key]");
goto end;
}
}
cJSON *enc_topc_key = cJSON_GetObjectItemCaseSensitive(authentication_subscriptionJSON, "encTopcKey");
enc_topc_key = cJSON_GetObjectItemCaseSensitive(authentication_subscriptionJSON, "encTopcKey");
if (enc_topc_key) {
if (!cJSON_IsString(enc_topc_key)) {
if (!cJSON_IsString(enc_topc_key) && !cJSON_IsNull(enc_topc_key)) {
ogs_error("OpenAPI_authentication_subscription_parseFromJSON() failed [enc_topc_key]");
goto end;
}
}
cJSON *vector_generation_in_hss = cJSON_GetObjectItemCaseSensitive(authentication_subscriptionJSON, "vectorGenerationInHss");
vector_generation_in_hss = cJSON_GetObjectItemCaseSensitive(authentication_subscriptionJSON, "vectorGenerationInHss");
if (vector_generation_in_hss) {
if (!cJSON_IsBool(vector_generation_in_hss)) {
ogs_error("OpenAPI_authentication_subscription_parseFromJSON() failed [vector_generation_in_hss]");
@ -247,9 +282,7 @@ OpenAPI_authentication_subscription_t *OpenAPI_authentication_subscription_parse
}
}
cJSON *n5gc_auth_method = cJSON_GetObjectItemCaseSensitive(authentication_subscriptionJSON, "n5gcAuthMethod");
OpenAPI_auth_method_e n5gc_auth_methodVariable;
n5gc_auth_method = cJSON_GetObjectItemCaseSensitive(authentication_subscriptionJSON, "n5gcAuthMethod");
if (n5gc_auth_method) {
if (!cJSON_IsString(n5gc_auth_method)) {
ogs_error("OpenAPI_authentication_subscription_parseFromJSON() failed [n5gc_auth_method]");
@ -258,8 +291,7 @@ OpenAPI_authentication_subscription_t *OpenAPI_authentication_subscription_parse
n5gc_auth_methodVariable = OpenAPI_auth_method_FromString(n5gc_auth_method->valuestring);
}
cJSON *rg_authentication_ind = cJSON_GetObjectItemCaseSensitive(authentication_subscriptionJSON, "rgAuthenticationInd");
rg_authentication_ind = cJSON_GetObjectItemCaseSensitive(authentication_subscriptionJSON, "rgAuthenticationInd");
if (rg_authentication_ind) {
if (!cJSON_IsBool(rg_authentication_ind)) {
ogs_error("OpenAPI_authentication_subscription_parseFromJSON() failed [rg_authentication_ind]");
@ -267,10 +299,9 @@ OpenAPI_authentication_subscription_t *OpenAPI_authentication_subscription_parse
}
}
cJSON *supi = cJSON_GetObjectItemCaseSensitive(authentication_subscriptionJSON, "supi");
supi = cJSON_GetObjectItemCaseSensitive(authentication_subscriptionJSON, "supi");
if (supi) {
if (!cJSON_IsString(supi)) {
if (!cJSON_IsString(supi) && !cJSON_IsNull(supi)) {
ogs_error("OpenAPI_authentication_subscription_parseFromJSON() failed [supi]");
goto end;
}
@ -278,23 +309,27 @@ OpenAPI_authentication_subscription_t *OpenAPI_authentication_subscription_parse
authentication_subscription_local_var = OpenAPI_authentication_subscription_create (
authentication_methodVariable,
enc_permanent_key ? ogs_strdup(enc_permanent_key->valuestring) : NULL,
protection_parameter_id ? ogs_strdup(protection_parameter_id->valuestring) : NULL,
enc_permanent_key && !cJSON_IsNull(enc_permanent_key) ? ogs_strdup(enc_permanent_key->valuestring) : NULL,
protection_parameter_id && !cJSON_IsNull(protection_parameter_id) ? ogs_strdup(protection_parameter_id->valuestring) : NULL,
sequence_number ? sequence_number_local_nonprim : NULL,
authentication_management_field ? ogs_strdup(authentication_management_field->valuestring) : NULL,
algorithm_id ? ogs_strdup(algorithm_id->valuestring) : NULL,
enc_opc_key ? ogs_strdup(enc_opc_key->valuestring) : NULL,
enc_topc_key ? ogs_strdup(enc_topc_key->valuestring) : NULL,
authentication_management_field && !cJSON_IsNull(authentication_management_field) ? ogs_strdup(authentication_management_field->valuestring) : NULL,
algorithm_id && !cJSON_IsNull(algorithm_id) ? ogs_strdup(algorithm_id->valuestring) : NULL,
enc_opc_key && !cJSON_IsNull(enc_opc_key) ? ogs_strdup(enc_opc_key->valuestring) : NULL,
enc_topc_key && !cJSON_IsNull(enc_topc_key) ? ogs_strdup(enc_topc_key->valuestring) : NULL,
vector_generation_in_hss ? true : false,
vector_generation_in_hss ? vector_generation_in_hss->valueint : 0,
n5gc_auth_method ? n5gc_auth_methodVariable : 0,
rg_authentication_ind ? true : false,
rg_authentication_ind ? rg_authentication_ind->valueint : 0,
supi ? ogs_strdup(supi->valuestring) : NULL
supi && !cJSON_IsNull(supi) ? ogs_strdup(supi->valuestring) : NULL
);
return authentication_subscription_local_var;
end:
if (sequence_number_local_nonprim) {
OpenAPI_sequence_number_free(sequence_number_local_nonprim);
sequence_number_local_nonprim = NULL;
}
return NULL;
}

View File

@ -32,23 +32,46 @@ OpenAPI_authentication_vector_t *OpenAPI_authentication_vector_create(
void OpenAPI_authentication_vector_free(OpenAPI_authentication_vector_t *authentication_vector)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == authentication_vector) {
return;
}
OpenAPI_lnode_t *node;
ogs_free(authentication_vector->rand);
ogs_free(authentication_vector->xres);
ogs_free(authentication_vector->autn);
ogs_free(authentication_vector->ck_prime);
ogs_free(authentication_vector->ik_prime);
ogs_free(authentication_vector->xres_star);
ogs_free(authentication_vector->kausf);
if (authentication_vector->rand) {
ogs_free(authentication_vector->rand);
authentication_vector->rand = NULL;
}
if (authentication_vector->xres) {
ogs_free(authentication_vector->xres);
authentication_vector->xres = NULL;
}
if (authentication_vector->autn) {
ogs_free(authentication_vector->autn);
authentication_vector->autn = NULL;
}
if (authentication_vector->ck_prime) {
ogs_free(authentication_vector->ck_prime);
authentication_vector->ck_prime = NULL;
}
if (authentication_vector->ik_prime) {
ogs_free(authentication_vector->ik_prime);
authentication_vector->ik_prime = NULL;
}
if (authentication_vector->xres_star) {
ogs_free(authentication_vector->xres_star);
authentication_vector->xres_star = NULL;
}
if (authentication_vector->kausf) {
ogs_free(authentication_vector->kausf);
authentication_vector->kausf = NULL;
}
ogs_free(authentication_vector);
}
cJSON *OpenAPI_authentication_vector_convertToJSON(OpenAPI_authentication_vector_t *authentication_vector)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (authentication_vector == NULL) {
ogs_error("OpenAPI_authentication_vector_convertToJSON() failed [AuthenticationVector]");
@ -56,11 +79,19 @@ cJSON *OpenAPI_authentication_vector_convertToJSON(OpenAPI_authentication_vector
}
item = cJSON_CreateObject();
if (authentication_vector->av_type == OpenAPI_av_type_NULL) {
ogs_error("OpenAPI_authentication_vector_convertToJSON() failed [av_type]");
return NULL;
}
if (cJSON_AddStringToObject(item, "avType", OpenAPI_av_type_ToString(authentication_vector->av_type)) == NULL) {
ogs_error("OpenAPI_authentication_vector_convertToJSON() failed [av_type]");
goto end;
}
if (!authentication_vector->rand) {
ogs_error("OpenAPI_authentication_vector_convertToJSON() failed [rand]");
return NULL;
}
if (cJSON_AddStringToObject(item, "rand", authentication_vector->rand) == NULL) {
ogs_error("OpenAPI_authentication_vector_convertToJSON() failed [rand]");
goto end;
@ -73,6 +104,10 @@ cJSON *OpenAPI_authentication_vector_convertToJSON(OpenAPI_authentication_vector
}
}
if (!authentication_vector->autn) {
ogs_error("OpenAPI_authentication_vector_convertToJSON() failed [autn]");
return NULL;
}
if (cJSON_AddStringToObject(item, "autn", authentication_vector->autn) == NULL) {
ogs_error("OpenAPI_authentication_vector_convertToJSON() failed [autn]");
goto end;
@ -113,81 +148,82 @@ end:
OpenAPI_authentication_vector_t *OpenAPI_authentication_vector_parseFromJSON(cJSON *authentication_vectorJSON)
{
OpenAPI_authentication_vector_t *authentication_vector_local_var = NULL;
cJSON *av_type = cJSON_GetObjectItemCaseSensitive(authentication_vectorJSON, "avType");
OpenAPI_lnode_t *node = NULL;
cJSON *av_type = NULL;
OpenAPI_av_type_e av_typeVariable = 0;
cJSON *rand = NULL;
cJSON *xres = NULL;
cJSON *autn = NULL;
cJSON *ck_prime = NULL;
cJSON *ik_prime = NULL;
cJSON *xres_star = NULL;
cJSON *kausf = NULL;
av_type = cJSON_GetObjectItemCaseSensitive(authentication_vectorJSON, "avType");
if (!av_type) {
ogs_error("OpenAPI_authentication_vector_parseFromJSON() failed [av_type]");
goto end;
}
OpenAPI_av_type_e av_typeVariable;
if (!cJSON_IsString(av_type)) {
ogs_error("OpenAPI_authentication_vector_parseFromJSON() failed [av_type]");
goto end;
}
av_typeVariable = OpenAPI_av_type_FromString(av_type->valuestring);
cJSON *rand = cJSON_GetObjectItemCaseSensitive(authentication_vectorJSON, "rand");
rand = cJSON_GetObjectItemCaseSensitive(authentication_vectorJSON, "rand");
if (!rand) {
ogs_error("OpenAPI_authentication_vector_parseFromJSON() failed [rand]");
goto end;
}
if (!cJSON_IsString(rand)) {
ogs_error("OpenAPI_authentication_vector_parseFromJSON() failed [rand]");
goto end;
}
cJSON *xres = cJSON_GetObjectItemCaseSensitive(authentication_vectorJSON, "xres");
xres = cJSON_GetObjectItemCaseSensitive(authentication_vectorJSON, "xres");
if (xres) {
if (!cJSON_IsString(xres)) {
if (!cJSON_IsString(xres) && !cJSON_IsNull(xres)) {
ogs_error("OpenAPI_authentication_vector_parseFromJSON() failed [xres]");
goto end;
}
}
cJSON *autn = cJSON_GetObjectItemCaseSensitive(authentication_vectorJSON, "autn");
autn = cJSON_GetObjectItemCaseSensitive(authentication_vectorJSON, "autn");
if (!autn) {
ogs_error("OpenAPI_authentication_vector_parseFromJSON() failed [autn]");
goto end;
}
if (!cJSON_IsString(autn)) {
ogs_error("OpenAPI_authentication_vector_parseFromJSON() failed [autn]");
goto end;
}
cJSON *ck_prime = cJSON_GetObjectItemCaseSensitive(authentication_vectorJSON, "ckPrime");
ck_prime = cJSON_GetObjectItemCaseSensitive(authentication_vectorJSON, "ckPrime");
if (ck_prime) {
if (!cJSON_IsString(ck_prime)) {
if (!cJSON_IsString(ck_prime) && !cJSON_IsNull(ck_prime)) {
ogs_error("OpenAPI_authentication_vector_parseFromJSON() failed [ck_prime]");
goto end;
}
}
cJSON *ik_prime = cJSON_GetObjectItemCaseSensitive(authentication_vectorJSON, "ikPrime");
ik_prime = cJSON_GetObjectItemCaseSensitive(authentication_vectorJSON, "ikPrime");
if (ik_prime) {
if (!cJSON_IsString(ik_prime)) {
if (!cJSON_IsString(ik_prime) && !cJSON_IsNull(ik_prime)) {
ogs_error("OpenAPI_authentication_vector_parseFromJSON() failed [ik_prime]");
goto end;
}
}
cJSON *xres_star = cJSON_GetObjectItemCaseSensitive(authentication_vectorJSON, "xresStar");
xres_star = cJSON_GetObjectItemCaseSensitive(authentication_vectorJSON, "xresStar");
if (xres_star) {
if (!cJSON_IsString(xres_star)) {
if (!cJSON_IsString(xres_star) && !cJSON_IsNull(xres_star)) {
ogs_error("OpenAPI_authentication_vector_parseFromJSON() failed [xres_star]");
goto end;
}
}
cJSON *kausf = cJSON_GetObjectItemCaseSensitive(authentication_vectorJSON, "kausf");
kausf = cJSON_GetObjectItemCaseSensitive(authentication_vectorJSON, "kausf");
if (kausf) {
if (!cJSON_IsString(kausf)) {
if (!cJSON_IsString(kausf) && !cJSON_IsNull(kausf)) {
ogs_error("OpenAPI_authentication_vector_parseFromJSON() failed [kausf]");
goto end;
}
@ -196,12 +232,12 @@ OpenAPI_authentication_vector_t *OpenAPI_authentication_vector_parseFromJSON(cJS
authentication_vector_local_var = OpenAPI_authentication_vector_create (
av_typeVariable,
ogs_strdup(rand->valuestring),
xres ? ogs_strdup(xres->valuestring) : NULL,
xres && !cJSON_IsNull(xres) ? ogs_strdup(xres->valuestring) : NULL,
ogs_strdup(autn->valuestring),
ck_prime ? ogs_strdup(ck_prime->valuestring) : NULL,
ik_prime ? ogs_strdup(ik_prime->valuestring) : NULL,
xres_star ? ogs_strdup(xres_star->valuestring) : NULL,
kausf ? ogs_strdup(kausf->valuestring) : NULL
ck_prime && !cJSON_IsNull(ck_prime) ? ogs_strdup(ck_prime->valuestring) : NULL,
ik_prime && !cJSON_IsNull(ik_prime) ? ogs_strdup(ik_prime->valuestring) : NULL,
xres_star && !cJSON_IsNull(xres_star) ? ogs_strdup(xres_star->valuestring) : NULL,
kausf && !cJSON_IsNull(kausf) ? ogs_strdup(kausf->valuestring) : NULL
);
return authentication_vector_local_var;

View File

@ -20,21 +20,29 @@ OpenAPI_authorization_data_t *OpenAPI_authorization_data_create(
void OpenAPI_authorization_data_free(OpenAPI_authorization_data_t *authorization_data)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == authorization_data) {
return;
}
OpenAPI_lnode_t *node;
OpenAPI_list_for_each(authorization_data->authorization_data, node) {
OpenAPI_user_identifier_free(node->data);
if (authorization_data->authorization_data) {
OpenAPI_list_for_each(authorization_data->authorization_data, node) {
OpenAPI_user_identifier_free(node->data);
}
OpenAPI_list_free(authorization_data->authorization_data);
authorization_data->authorization_data = NULL;
}
if (authorization_data->validity_time) {
ogs_free(authorization_data->validity_time);
authorization_data->validity_time = NULL;
}
OpenAPI_list_free(authorization_data->authorization_data);
ogs_free(authorization_data->validity_time);
ogs_free(authorization_data);
}
cJSON *OpenAPI_authorization_data_convertToJSON(OpenAPI_authorization_data_t *authorization_data)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (authorization_data == NULL) {
ogs_error("OpenAPI_authorization_data_convertToJSON() failed [AuthorizationData]");
@ -42,22 +50,22 @@ cJSON *OpenAPI_authorization_data_convertToJSON(OpenAPI_authorization_data_t *au
}
item = cJSON_CreateObject();
if (!authorization_data->authorization_data) {
ogs_error("OpenAPI_authorization_data_convertToJSON() failed [authorization_data]");
return NULL;
}
cJSON *authorization_dataList = cJSON_AddArrayToObject(item, "authorizationData");
if (authorization_dataList == NULL) {
ogs_error("OpenAPI_authorization_data_convertToJSON() failed [authorization_data]");
goto end;
}
OpenAPI_lnode_t *authorization_data_node;
if (authorization_data->authorization_data) {
OpenAPI_list_for_each(authorization_data->authorization_data, authorization_data_node) {
cJSON *itemLocal = OpenAPI_user_identifier_convertToJSON(authorization_data_node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_authorization_data_convertToJSON() failed [authorization_data]");
goto end;
}
cJSON_AddItemToArray(authorization_dataList, itemLocal);
OpenAPI_list_for_each(authorization_data->authorization_data, node) {
cJSON *itemLocal = OpenAPI_user_identifier_convertToJSON(node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_authorization_data_convertToJSON() failed [authorization_data]");
goto end;
}
cJSON_AddItemToArray(authorization_dataList, itemLocal);
}
if (authorization_data->validity_time) {
@ -74,41 +82,40 @@ end:
OpenAPI_authorization_data_t *OpenAPI_authorization_data_parseFromJSON(cJSON *authorization_dataJSON)
{
OpenAPI_authorization_data_t *authorization_data_local_var = NULL;
cJSON *authorization_data = cJSON_GetObjectItemCaseSensitive(authorization_dataJSON, "authorizationData");
OpenAPI_lnode_t *node = NULL;
cJSON *authorization_data = NULL;
OpenAPI_list_t *authorization_dataList = NULL;
cJSON *validity_time = NULL;
authorization_data = cJSON_GetObjectItemCaseSensitive(authorization_dataJSON, "authorizationData");
if (!authorization_data) {
ogs_error("OpenAPI_authorization_data_parseFromJSON() failed [authorization_data]");
goto end;
}
OpenAPI_list_t *authorization_dataList;
cJSON *authorization_data_local_nonprimitive;
if (!cJSON_IsArray(authorization_data)){
ogs_error("OpenAPI_authorization_data_parseFromJSON() failed [authorization_data]");
goto end;
}
authorization_dataList = OpenAPI_list_create();
cJSON_ArrayForEach(authorization_data_local_nonprimitive, authorization_data ) {
if (!cJSON_IsObject(authorization_data_local_nonprimitive)) {
cJSON *authorization_data_local = NULL;
if (!cJSON_IsArray(authorization_data)) {
ogs_error("OpenAPI_authorization_data_parseFromJSON() failed [authorization_data]");
goto end;
}
OpenAPI_user_identifier_t *authorization_dataItem = OpenAPI_user_identifier_parseFromJSON(authorization_data_local_nonprimitive);
if (!authorization_dataItem) {
ogs_error("No authorization_dataItem");
OpenAPI_list_free(authorization_dataList);
goto end;
authorization_dataList = OpenAPI_list_create();
cJSON_ArrayForEach(authorization_data_local, authorization_data) {
if (!cJSON_IsObject(authorization_data_local)) {
ogs_error("OpenAPI_authorization_data_parseFromJSON() failed [authorization_data]");
goto end;
}
OpenAPI_user_identifier_t *authorization_dataItem = OpenAPI_user_identifier_parseFromJSON(authorization_data_local);
if (!authorization_dataItem) {
ogs_error("No authorization_dataItem");
OpenAPI_list_free(authorization_dataList);
goto end;
}
OpenAPI_list_add(authorization_dataList, authorization_dataItem);
}
OpenAPI_list_add(authorization_dataList, authorization_dataItem);
}
cJSON *validity_time = cJSON_GetObjectItemCaseSensitive(authorization_dataJSON, "validityTime");
validity_time = cJSON_GetObjectItemCaseSensitive(authorization_dataJSON, "validityTime");
if (validity_time) {
if (!cJSON_IsString(validity_time)) {
if (!cJSON_IsString(validity_time) && !cJSON_IsNull(validity_time)) {
ogs_error("OpenAPI_authorization_data_parseFromJSON() failed [validity_time]");
goto end;
}
@ -116,11 +123,18 @@ OpenAPI_authorization_data_t *OpenAPI_authorization_data_parseFromJSON(cJSON *au
authorization_data_local_var = OpenAPI_authorization_data_create (
authorization_dataList,
validity_time ? ogs_strdup(validity_time->valuestring) : NULL
validity_time && !cJSON_IsNull(validity_time) ? ogs_strdup(validity_time->valuestring) : NULL
);
return authorization_data_local_var;
end:
if (authorization_dataList) {
OpenAPI_list_for_each(authorization_dataList, node) {
OpenAPI_user_identifier_free(node->data);
}
OpenAPI_list_free(authorization_dataList);
authorization_dataList = NULL;
}
return NULL;
}

View File

@ -46,21 +46,38 @@ OpenAPI_authorized_default_qos_t *OpenAPI_authorized_default_qos_create(
void OpenAPI_authorized_default_qos_free(OpenAPI_authorized_default_qos_t *authorized_default_qos)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == authorized_default_qos) {
return;
}
OpenAPI_lnode_t *node;
OpenAPI_arp_free(authorized_default_qos->arp);
ogs_free(authorized_default_qos->maxbr_ul);
ogs_free(authorized_default_qos->maxbr_dl);
ogs_free(authorized_default_qos->gbr_ul);
ogs_free(authorized_default_qos->gbr_dl);
if (authorized_default_qos->arp) {
OpenAPI_arp_free(authorized_default_qos->arp);
authorized_default_qos->arp = NULL;
}
if (authorized_default_qos->maxbr_ul) {
ogs_free(authorized_default_qos->maxbr_ul);
authorized_default_qos->maxbr_ul = NULL;
}
if (authorized_default_qos->maxbr_dl) {
ogs_free(authorized_default_qos->maxbr_dl);
authorized_default_qos->maxbr_dl = NULL;
}
if (authorized_default_qos->gbr_ul) {
ogs_free(authorized_default_qos->gbr_ul);
authorized_default_qos->gbr_ul = NULL;
}
if (authorized_default_qos->gbr_dl) {
ogs_free(authorized_default_qos->gbr_dl);
authorized_default_qos->gbr_dl = NULL;
}
ogs_free(authorized_default_qos);
}
cJSON *OpenAPI_authorized_default_qos_convertToJSON(OpenAPI_authorized_default_qos_t *authorized_default_qos)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (authorized_default_qos == NULL) {
ogs_error("OpenAPI_authorized_default_qos_convertToJSON() failed [AuthorizedDefaultQos]");
@ -151,8 +168,19 @@ end:
OpenAPI_authorized_default_qos_t *OpenAPI_authorized_default_qos_parseFromJSON(cJSON *authorized_default_qosJSON)
{
OpenAPI_authorized_default_qos_t *authorized_default_qos_local_var = NULL;
cJSON *_5qi = cJSON_GetObjectItemCaseSensitive(authorized_default_qosJSON, "5qi");
OpenAPI_lnode_t *node = NULL;
cJSON *_5qi = NULL;
cJSON *arp = NULL;
OpenAPI_arp_t *arp_local_nonprim = NULL;
cJSON *priority_level = NULL;
cJSON *aver_window = NULL;
cJSON *max_data_burst_vol = NULL;
cJSON *maxbr_ul = NULL;
cJSON *maxbr_dl = NULL;
cJSON *gbr_ul = NULL;
cJSON *gbr_dl = NULL;
cJSON *ext_max_data_burst_vol = NULL;
_5qi = cJSON_GetObjectItemCaseSensitive(authorized_default_qosJSON, "5qi");
if (_5qi) {
if (!cJSON_IsNumber(_5qi)) {
ogs_error("OpenAPI_authorized_default_qos_parseFromJSON() failed [_5qi]");
@ -160,15 +188,12 @@ OpenAPI_authorized_default_qos_t *OpenAPI_authorized_default_qos_parseFromJSON(c
}
}
cJSON *arp = cJSON_GetObjectItemCaseSensitive(authorized_default_qosJSON, "arp");
OpenAPI_arp_t *arp_local_nonprim = NULL;
arp = cJSON_GetObjectItemCaseSensitive(authorized_default_qosJSON, "arp");
if (arp) {
arp_local_nonprim = OpenAPI_arp_parseFromJSON(arp);
}
cJSON *priority_level = cJSON_GetObjectItemCaseSensitive(authorized_default_qosJSON, "priorityLevel");
priority_level = cJSON_GetObjectItemCaseSensitive(authorized_default_qosJSON, "priorityLevel");
if (priority_level) {
if (!cJSON_IsNumber(priority_level)) {
ogs_error("OpenAPI_authorized_default_qos_parseFromJSON() failed [priority_level]");
@ -176,8 +201,7 @@ OpenAPI_authorized_default_qos_t *OpenAPI_authorized_default_qos_parseFromJSON(c
}
}
cJSON *aver_window = cJSON_GetObjectItemCaseSensitive(authorized_default_qosJSON, "averWindow");
aver_window = cJSON_GetObjectItemCaseSensitive(authorized_default_qosJSON, "averWindow");
if (aver_window) {
if (!cJSON_IsNumber(aver_window)) {
ogs_error("OpenAPI_authorized_default_qos_parseFromJSON() failed [aver_window]");
@ -185,8 +209,7 @@ OpenAPI_authorized_default_qos_t *OpenAPI_authorized_default_qos_parseFromJSON(c
}
}
cJSON *max_data_burst_vol = cJSON_GetObjectItemCaseSensitive(authorized_default_qosJSON, "maxDataBurstVol");
max_data_burst_vol = cJSON_GetObjectItemCaseSensitive(authorized_default_qosJSON, "maxDataBurstVol");
if (max_data_burst_vol) {
if (!cJSON_IsNumber(max_data_burst_vol)) {
ogs_error("OpenAPI_authorized_default_qos_parseFromJSON() failed [max_data_burst_vol]");
@ -194,44 +217,39 @@ OpenAPI_authorized_default_qos_t *OpenAPI_authorized_default_qos_parseFromJSON(c
}
}
cJSON *maxbr_ul = cJSON_GetObjectItemCaseSensitive(authorized_default_qosJSON, "maxbrUl");
maxbr_ul = cJSON_GetObjectItemCaseSensitive(authorized_default_qosJSON, "maxbrUl");
if (maxbr_ul) {
if (!cJSON_IsString(maxbr_ul)) {
if (!cJSON_IsString(maxbr_ul) && !cJSON_IsNull(maxbr_ul)) {
ogs_error("OpenAPI_authorized_default_qos_parseFromJSON() failed [maxbr_ul]");
goto end;
}
}
cJSON *maxbr_dl = cJSON_GetObjectItemCaseSensitive(authorized_default_qosJSON, "maxbrDl");
maxbr_dl = cJSON_GetObjectItemCaseSensitive(authorized_default_qosJSON, "maxbrDl");
if (maxbr_dl) {
if (!cJSON_IsString(maxbr_dl)) {
if (!cJSON_IsString(maxbr_dl) && !cJSON_IsNull(maxbr_dl)) {
ogs_error("OpenAPI_authorized_default_qos_parseFromJSON() failed [maxbr_dl]");
goto end;
}
}
cJSON *gbr_ul = cJSON_GetObjectItemCaseSensitive(authorized_default_qosJSON, "gbrUl");
gbr_ul = cJSON_GetObjectItemCaseSensitive(authorized_default_qosJSON, "gbrUl");
if (gbr_ul) {
if (!cJSON_IsString(gbr_ul)) {
if (!cJSON_IsString(gbr_ul) && !cJSON_IsNull(gbr_ul)) {
ogs_error("OpenAPI_authorized_default_qos_parseFromJSON() failed [gbr_ul]");
goto end;
}
}
cJSON *gbr_dl = cJSON_GetObjectItemCaseSensitive(authorized_default_qosJSON, "gbrDl");
gbr_dl = cJSON_GetObjectItemCaseSensitive(authorized_default_qosJSON, "gbrDl");
if (gbr_dl) {
if (!cJSON_IsString(gbr_dl)) {
if (!cJSON_IsString(gbr_dl) && !cJSON_IsNull(gbr_dl)) {
ogs_error("OpenAPI_authorized_default_qos_parseFromJSON() failed [gbr_dl]");
goto end;
}
}
cJSON *ext_max_data_burst_vol = cJSON_GetObjectItemCaseSensitive(authorized_default_qosJSON, "extMaxDataBurstVol");
ext_max_data_burst_vol = cJSON_GetObjectItemCaseSensitive(authorized_default_qosJSON, "extMaxDataBurstVol");
if (ext_max_data_burst_vol) {
if (!cJSON_IsNumber(ext_max_data_burst_vol)) {
ogs_error("OpenAPI_authorized_default_qos_parseFromJSON() failed [ext_max_data_burst_vol]");
@ -249,16 +267,20 @@ OpenAPI_authorized_default_qos_t *OpenAPI_authorized_default_qos_parseFromJSON(c
aver_window ? aver_window->valuedouble : 0,
max_data_burst_vol ? true : false,
max_data_burst_vol ? max_data_burst_vol->valuedouble : 0,
maxbr_ul ? ogs_strdup(maxbr_ul->valuestring) : NULL,
maxbr_dl ? ogs_strdup(maxbr_dl->valuestring) : NULL,
gbr_ul ? ogs_strdup(gbr_ul->valuestring) : NULL,
gbr_dl ? ogs_strdup(gbr_dl->valuestring) : NULL,
maxbr_ul && !cJSON_IsNull(maxbr_ul) ? ogs_strdup(maxbr_ul->valuestring) : NULL,
maxbr_dl && !cJSON_IsNull(maxbr_dl) ? ogs_strdup(maxbr_dl->valuestring) : NULL,
gbr_ul && !cJSON_IsNull(gbr_ul) ? ogs_strdup(gbr_ul->valuestring) : NULL,
gbr_dl && !cJSON_IsNull(gbr_dl) ? ogs_strdup(gbr_dl->valuestring) : NULL,
ext_max_data_burst_vol ? true : false,
ext_max_data_burst_vol ? ext_max_data_burst_vol->valuedouble : 0
);
return authorized_default_qos_local_var;
end:
if (arp_local_nonprim) {
OpenAPI_arp_free(arp_local_nonprim);
arp_local_nonprim = NULL;
}
return NULL;
}

View File

@ -40,43 +40,81 @@ OpenAPI_authorized_network_slice_info_t *OpenAPI_authorized_network_slice_info_c
void OpenAPI_authorized_network_slice_info_free(OpenAPI_authorized_network_slice_info_t *authorized_network_slice_info)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == authorized_network_slice_info) {
return;
}
OpenAPI_lnode_t *node;
OpenAPI_list_for_each(authorized_network_slice_info->allowed_nssai_list, node) {
OpenAPI_allowed_nssai_free(node->data);
if (authorized_network_slice_info->allowed_nssai_list) {
OpenAPI_list_for_each(authorized_network_slice_info->allowed_nssai_list, node) {
OpenAPI_allowed_nssai_free(node->data);
}
OpenAPI_list_free(authorized_network_slice_info->allowed_nssai_list);
authorized_network_slice_info->allowed_nssai_list = NULL;
}
OpenAPI_list_free(authorized_network_slice_info->allowed_nssai_list);
OpenAPI_list_for_each(authorized_network_slice_info->configured_nssai, node) {
OpenAPI_configured_snssai_free(node->data);
if (authorized_network_slice_info->configured_nssai) {
OpenAPI_list_for_each(authorized_network_slice_info->configured_nssai, node) {
OpenAPI_configured_snssai_free(node->data);
}
OpenAPI_list_free(authorized_network_slice_info->configured_nssai);
authorized_network_slice_info->configured_nssai = NULL;
}
OpenAPI_list_free(authorized_network_slice_info->configured_nssai);
ogs_free(authorized_network_slice_info->target_amf_set);
OpenAPI_list_for_each(authorized_network_slice_info->candidate_amf_list, node) {
ogs_free(node->data);
if (authorized_network_slice_info->target_amf_set) {
ogs_free(authorized_network_slice_info->target_amf_set);
authorized_network_slice_info->target_amf_set = NULL;
}
OpenAPI_list_free(authorized_network_slice_info->candidate_amf_list);
OpenAPI_list_for_each(authorized_network_slice_info->rejected_nssai_in_plmn, node) {
OpenAPI_snssai_free(node->data);
if (authorized_network_slice_info->candidate_amf_list) {
OpenAPI_list_for_each(authorized_network_slice_info->candidate_amf_list, node) {
ogs_free(node->data);
}
OpenAPI_list_free(authorized_network_slice_info->candidate_amf_list);
authorized_network_slice_info->candidate_amf_list = NULL;
}
OpenAPI_list_free(authorized_network_slice_info->rejected_nssai_in_plmn);
OpenAPI_list_for_each(authorized_network_slice_info->rejected_nssai_in_ta, node) {
OpenAPI_snssai_free(node->data);
if (authorized_network_slice_info->rejected_nssai_in_plmn) {
OpenAPI_list_for_each(authorized_network_slice_info->rejected_nssai_in_plmn, node) {
OpenAPI_snssai_free(node->data);
}
OpenAPI_list_free(authorized_network_slice_info->rejected_nssai_in_plmn);
authorized_network_slice_info->rejected_nssai_in_plmn = NULL;
}
if (authorized_network_slice_info->rejected_nssai_in_ta) {
OpenAPI_list_for_each(authorized_network_slice_info->rejected_nssai_in_ta, node) {
OpenAPI_snssai_free(node->data);
}
OpenAPI_list_free(authorized_network_slice_info->rejected_nssai_in_ta);
authorized_network_slice_info->rejected_nssai_in_ta = NULL;
}
if (authorized_network_slice_info->nsi_information) {
OpenAPI_nsi_information_free(authorized_network_slice_info->nsi_information);
authorized_network_slice_info->nsi_information = NULL;
}
if (authorized_network_slice_info->supported_features) {
ogs_free(authorized_network_slice_info->supported_features);
authorized_network_slice_info->supported_features = NULL;
}
if (authorized_network_slice_info->nrf_amf_set) {
ogs_free(authorized_network_slice_info->nrf_amf_set);
authorized_network_slice_info->nrf_amf_set = NULL;
}
if (authorized_network_slice_info->nrf_amf_set_nf_mgt_uri) {
ogs_free(authorized_network_slice_info->nrf_amf_set_nf_mgt_uri);
authorized_network_slice_info->nrf_amf_set_nf_mgt_uri = NULL;
}
if (authorized_network_slice_info->nrf_amf_set_access_token_uri) {
ogs_free(authorized_network_slice_info->nrf_amf_set_access_token_uri);
authorized_network_slice_info->nrf_amf_set_access_token_uri = NULL;
}
if (authorized_network_slice_info->target_amf_service_set) {
ogs_free(authorized_network_slice_info->target_amf_service_set);
authorized_network_slice_info->target_amf_service_set = NULL;
}
OpenAPI_list_free(authorized_network_slice_info->rejected_nssai_in_ta);
OpenAPI_nsi_information_free(authorized_network_slice_info->nsi_information);
ogs_free(authorized_network_slice_info->supported_features);
ogs_free(authorized_network_slice_info->nrf_amf_set);
ogs_free(authorized_network_slice_info->nrf_amf_set_nf_mgt_uri);
ogs_free(authorized_network_slice_info->nrf_amf_set_access_token_uri);
ogs_free(authorized_network_slice_info->target_amf_service_set);
ogs_free(authorized_network_slice_info);
}
cJSON *OpenAPI_authorized_network_slice_info_convertToJSON(OpenAPI_authorized_network_slice_info_t *authorized_network_slice_info)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (authorized_network_slice_info == NULL) {
ogs_error("OpenAPI_authorized_network_slice_info_convertToJSON() failed [AuthorizedNetworkSliceInfo]");
@ -90,17 +128,13 @@ cJSON *OpenAPI_authorized_network_slice_info_convertToJSON(OpenAPI_authorized_ne
ogs_error("OpenAPI_authorized_network_slice_info_convertToJSON() failed [allowed_nssai_list]");
goto end;
}
OpenAPI_lnode_t *allowed_nssai_list_node;
if (authorized_network_slice_info->allowed_nssai_list) {
OpenAPI_list_for_each(authorized_network_slice_info->allowed_nssai_list, allowed_nssai_list_node) {
cJSON *itemLocal = OpenAPI_allowed_nssai_convertToJSON(allowed_nssai_list_node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_authorized_network_slice_info_convertToJSON() failed [allowed_nssai_list]");
goto end;
}
cJSON_AddItemToArray(allowed_nssai_listList, itemLocal);
OpenAPI_list_for_each(authorized_network_slice_info->allowed_nssai_list, node) {
cJSON *itemLocal = OpenAPI_allowed_nssai_convertToJSON(node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_authorized_network_slice_info_convertToJSON() failed [allowed_nssai_list]");
goto end;
}
cJSON_AddItemToArray(allowed_nssai_listList, itemLocal);
}
}
@ -110,17 +144,13 @@ cJSON *OpenAPI_authorized_network_slice_info_convertToJSON(OpenAPI_authorized_ne
ogs_error("OpenAPI_authorized_network_slice_info_convertToJSON() failed [configured_nssai]");
goto end;
}
OpenAPI_lnode_t *configured_nssai_node;
if (authorized_network_slice_info->configured_nssai) {
OpenAPI_list_for_each(authorized_network_slice_info->configured_nssai, configured_nssai_node) {
cJSON *itemLocal = OpenAPI_configured_snssai_convertToJSON(configured_nssai_node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_authorized_network_slice_info_convertToJSON() failed [configured_nssai]");
goto end;
}
cJSON_AddItemToArray(configured_nssaiList, itemLocal);
OpenAPI_list_for_each(authorized_network_slice_info->configured_nssai, node) {
cJSON *itemLocal = OpenAPI_configured_snssai_convertToJSON(node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_authorized_network_slice_info_convertToJSON() failed [configured_nssai]");
goto end;
}
cJSON_AddItemToArray(configured_nssaiList, itemLocal);
}
}
@ -132,19 +162,17 @@ cJSON *OpenAPI_authorized_network_slice_info_convertToJSON(OpenAPI_authorized_ne
}
if (authorized_network_slice_info->candidate_amf_list) {
cJSON *candidate_amf_list = cJSON_AddArrayToObject(item, "candidateAmfList");
if (candidate_amf_list == NULL) {
cJSON *candidate_amf_listList = cJSON_AddArrayToObject(item, "candidateAmfList");
if (candidate_amf_listList == NULL) {
ogs_error("OpenAPI_authorized_network_slice_info_convertToJSON() failed [candidate_amf_list]");
goto end;
}
OpenAPI_lnode_t *candidate_amf_list_node;
OpenAPI_list_for_each(authorized_network_slice_info->candidate_amf_list, candidate_amf_list_node) {
if (cJSON_AddStringToObject(candidate_amf_list, "", (char*)candidate_amf_list_node->data) == NULL) {
ogs_error("OpenAPI_authorized_network_slice_info_convertToJSON() failed [candidate_amf_list]");
goto end;
OpenAPI_list_for_each(authorized_network_slice_info->candidate_amf_list, node) {
if (cJSON_AddStringToObject(candidate_amf_listList, "", (char*)node->data) == NULL) {
ogs_error("OpenAPI_authorized_network_slice_info_convertToJSON() failed [candidate_amf_list]");
goto end;
}
}
}
}
if (authorized_network_slice_info->rejected_nssai_in_plmn) {
@ -153,17 +181,13 @@ cJSON *OpenAPI_authorized_network_slice_info_convertToJSON(OpenAPI_authorized_ne
ogs_error("OpenAPI_authorized_network_slice_info_convertToJSON() failed [rejected_nssai_in_plmn]");
goto end;
}
OpenAPI_lnode_t *rejected_nssai_in_plmn_node;
if (authorized_network_slice_info->rejected_nssai_in_plmn) {
OpenAPI_list_for_each(authorized_network_slice_info->rejected_nssai_in_plmn, rejected_nssai_in_plmn_node) {
cJSON *itemLocal = OpenAPI_snssai_convertToJSON(rejected_nssai_in_plmn_node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_authorized_network_slice_info_convertToJSON() failed [rejected_nssai_in_plmn]");
goto end;
}
cJSON_AddItemToArray(rejected_nssai_in_plmnList, itemLocal);
OpenAPI_list_for_each(authorized_network_slice_info->rejected_nssai_in_plmn, node) {
cJSON *itemLocal = OpenAPI_snssai_convertToJSON(node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_authorized_network_slice_info_convertToJSON() failed [rejected_nssai_in_plmn]");
goto end;
}
cJSON_AddItemToArray(rejected_nssai_in_plmnList, itemLocal);
}
}
@ -173,17 +197,13 @@ cJSON *OpenAPI_authorized_network_slice_info_convertToJSON(OpenAPI_authorized_ne
ogs_error("OpenAPI_authorized_network_slice_info_convertToJSON() failed [rejected_nssai_in_ta]");
goto end;
}
OpenAPI_lnode_t *rejected_nssai_in_ta_node;
if (authorized_network_slice_info->rejected_nssai_in_ta) {
OpenAPI_list_for_each(authorized_network_slice_info->rejected_nssai_in_ta, rejected_nssai_in_ta_node) {
cJSON *itemLocal = OpenAPI_snssai_convertToJSON(rejected_nssai_in_ta_node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_authorized_network_slice_info_convertToJSON() failed [rejected_nssai_in_ta]");
goto end;
}
cJSON_AddItemToArray(rejected_nssai_in_taList, itemLocal);
OpenAPI_list_for_each(authorized_network_slice_info->rejected_nssai_in_ta, node) {
cJSON *itemLocal = OpenAPI_snssai_convertToJSON(node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_authorized_network_slice_info_convertToJSON() failed [rejected_nssai_in_ta]");
goto end;
}
cJSON_AddItemToArray(rejected_nssai_in_taList, itemLocal);
}
}
@ -242,198 +262,194 @@ end:
OpenAPI_authorized_network_slice_info_t *OpenAPI_authorized_network_slice_info_parseFromJSON(cJSON *authorized_network_slice_infoJSON)
{
OpenAPI_authorized_network_slice_info_t *authorized_network_slice_info_local_var = NULL;
cJSON *allowed_nssai_list = cJSON_GetObjectItemCaseSensitive(authorized_network_slice_infoJSON, "allowedNssaiList");
OpenAPI_list_t *allowed_nssai_listList;
OpenAPI_lnode_t *node = NULL;
cJSON *allowed_nssai_list = NULL;
OpenAPI_list_t *allowed_nssai_listList = NULL;
cJSON *configured_nssai = NULL;
OpenAPI_list_t *configured_nssaiList = NULL;
cJSON *target_amf_set = NULL;
cJSON *candidate_amf_list = NULL;
OpenAPI_list_t *candidate_amf_listList = NULL;
cJSON *rejected_nssai_in_plmn = NULL;
OpenAPI_list_t *rejected_nssai_in_plmnList = NULL;
cJSON *rejected_nssai_in_ta = NULL;
OpenAPI_list_t *rejected_nssai_in_taList = NULL;
cJSON *nsi_information = NULL;
OpenAPI_nsi_information_t *nsi_information_local_nonprim = NULL;
cJSON *supported_features = NULL;
cJSON *nrf_amf_set = NULL;
cJSON *nrf_amf_set_nf_mgt_uri = NULL;
cJSON *nrf_amf_set_access_token_uri = NULL;
cJSON *target_amf_service_set = NULL;
allowed_nssai_list = cJSON_GetObjectItemCaseSensitive(authorized_network_slice_infoJSON, "allowedNssaiList");
if (allowed_nssai_list) {
cJSON *allowed_nssai_list_local_nonprimitive;
if (!cJSON_IsArray(allowed_nssai_list)){
ogs_error("OpenAPI_authorized_network_slice_info_parseFromJSON() failed [allowed_nssai_list]");
goto end;
}
allowed_nssai_listList = OpenAPI_list_create();
cJSON_ArrayForEach(allowed_nssai_list_local_nonprimitive, allowed_nssai_list ) {
if (!cJSON_IsObject(allowed_nssai_list_local_nonprimitive)) {
cJSON *allowed_nssai_list_local = NULL;
if (!cJSON_IsArray(allowed_nssai_list)) {
ogs_error("OpenAPI_authorized_network_slice_info_parseFromJSON() failed [allowed_nssai_list]");
goto end;
}
OpenAPI_allowed_nssai_t *allowed_nssai_listItem = OpenAPI_allowed_nssai_parseFromJSON(allowed_nssai_list_local_nonprimitive);
if (!allowed_nssai_listItem) {
ogs_error("No allowed_nssai_listItem");
OpenAPI_list_free(allowed_nssai_listList);
goto end;
allowed_nssai_listList = OpenAPI_list_create();
cJSON_ArrayForEach(allowed_nssai_list_local, allowed_nssai_list) {
if (!cJSON_IsObject(allowed_nssai_list_local)) {
ogs_error("OpenAPI_authorized_network_slice_info_parseFromJSON() failed [allowed_nssai_list]");
goto end;
}
OpenAPI_allowed_nssai_t *allowed_nssai_listItem = OpenAPI_allowed_nssai_parseFromJSON(allowed_nssai_list_local);
if (!allowed_nssai_listItem) {
ogs_error("No allowed_nssai_listItem");
OpenAPI_list_free(allowed_nssai_listList);
goto end;
}
OpenAPI_list_add(allowed_nssai_listList, allowed_nssai_listItem);
}
OpenAPI_list_add(allowed_nssai_listList, allowed_nssai_listItem);
}
}
cJSON *configured_nssai = cJSON_GetObjectItemCaseSensitive(authorized_network_slice_infoJSON, "configuredNssai");
OpenAPI_list_t *configured_nssaiList;
configured_nssai = cJSON_GetObjectItemCaseSensitive(authorized_network_slice_infoJSON, "configuredNssai");
if (configured_nssai) {
cJSON *configured_nssai_local_nonprimitive;
if (!cJSON_IsArray(configured_nssai)){
ogs_error("OpenAPI_authorized_network_slice_info_parseFromJSON() failed [configured_nssai]");
goto end;
}
configured_nssaiList = OpenAPI_list_create();
cJSON_ArrayForEach(configured_nssai_local_nonprimitive, configured_nssai ) {
if (!cJSON_IsObject(configured_nssai_local_nonprimitive)) {
cJSON *configured_nssai_local = NULL;
if (!cJSON_IsArray(configured_nssai)) {
ogs_error("OpenAPI_authorized_network_slice_info_parseFromJSON() failed [configured_nssai]");
goto end;
}
OpenAPI_configured_snssai_t *configured_nssaiItem = OpenAPI_configured_snssai_parseFromJSON(configured_nssai_local_nonprimitive);
if (!configured_nssaiItem) {
ogs_error("No configured_nssaiItem");
OpenAPI_list_free(configured_nssaiList);
goto end;
configured_nssaiList = OpenAPI_list_create();
cJSON_ArrayForEach(configured_nssai_local, configured_nssai) {
if (!cJSON_IsObject(configured_nssai_local)) {
ogs_error("OpenAPI_authorized_network_slice_info_parseFromJSON() failed [configured_nssai]");
goto end;
}
OpenAPI_configured_snssai_t *configured_nssaiItem = OpenAPI_configured_snssai_parseFromJSON(configured_nssai_local);
if (!configured_nssaiItem) {
ogs_error("No configured_nssaiItem");
OpenAPI_list_free(configured_nssaiList);
goto end;
}
OpenAPI_list_add(configured_nssaiList, configured_nssaiItem);
}
OpenAPI_list_add(configured_nssaiList, configured_nssaiItem);
}
}
cJSON *target_amf_set = cJSON_GetObjectItemCaseSensitive(authorized_network_slice_infoJSON, "targetAmfSet");
target_amf_set = cJSON_GetObjectItemCaseSensitive(authorized_network_slice_infoJSON, "targetAmfSet");
if (target_amf_set) {
if (!cJSON_IsString(target_amf_set)) {
if (!cJSON_IsString(target_amf_set) && !cJSON_IsNull(target_amf_set)) {
ogs_error("OpenAPI_authorized_network_slice_info_parseFromJSON() failed [target_amf_set]");
goto end;
}
}
cJSON *candidate_amf_list = cJSON_GetObjectItemCaseSensitive(authorized_network_slice_infoJSON, "candidateAmfList");
OpenAPI_list_t *candidate_amf_listList;
candidate_amf_list = cJSON_GetObjectItemCaseSensitive(authorized_network_slice_infoJSON, "candidateAmfList");
if (candidate_amf_list) {
cJSON *candidate_amf_list_local;
if (!cJSON_IsArray(candidate_amf_list)) {
ogs_error("OpenAPI_authorized_network_slice_info_parseFromJSON() failed [candidate_amf_list]");
goto end;
}
candidate_amf_listList = OpenAPI_list_create();
cJSON *candidate_amf_list_local = NULL;
if (!cJSON_IsArray(candidate_amf_list)) {
ogs_error("OpenAPI_authorized_network_slice_info_parseFromJSON() failed [candidate_amf_list]");
goto end;
}
cJSON_ArrayForEach(candidate_amf_list_local, candidate_amf_list) {
if (!cJSON_IsString(candidate_amf_list_local)) {
ogs_error("OpenAPI_authorized_network_slice_info_parseFromJSON() failed [candidate_amf_list]");
goto end;
}
OpenAPI_list_add(candidate_amf_listList, ogs_strdup(candidate_amf_list_local->valuestring));
}
candidate_amf_listList = OpenAPI_list_create();
cJSON_ArrayForEach(candidate_amf_list_local, candidate_amf_list) {
double *localDouble = NULL;
int *localInt = NULL;
if (!cJSON_IsString(candidate_amf_list_local)) {
ogs_error("OpenAPI_authorized_network_slice_info_parseFromJSON() failed [candidate_amf_list]");
goto end;
}
OpenAPI_list_add(candidate_amf_listList, ogs_strdup(candidate_amf_list_local->valuestring));
}
}
cJSON *rejected_nssai_in_plmn = cJSON_GetObjectItemCaseSensitive(authorized_network_slice_infoJSON, "rejectedNssaiInPlmn");
OpenAPI_list_t *rejected_nssai_in_plmnList;
rejected_nssai_in_plmn = cJSON_GetObjectItemCaseSensitive(authorized_network_slice_infoJSON, "rejectedNssaiInPlmn");
if (rejected_nssai_in_plmn) {
cJSON *rejected_nssai_in_plmn_local_nonprimitive;
if (!cJSON_IsArray(rejected_nssai_in_plmn)){
ogs_error("OpenAPI_authorized_network_slice_info_parseFromJSON() failed [rejected_nssai_in_plmn]");
goto end;
}
rejected_nssai_in_plmnList = OpenAPI_list_create();
cJSON_ArrayForEach(rejected_nssai_in_plmn_local_nonprimitive, rejected_nssai_in_plmn ) {
if (!cJSON_IsObject(rejected_nssai_in_plmn_local_nonprimitive)) {
cJSON *rejected_nssai_in_plmn_local = NULL;
if (!cJSON_IsArray(rejected_nssai_in_plmn)) {
ogs_error("OpenAPI_authorized_network_slice_info_parseFromJSON() failed [rejected_nssai_in_plmn]");
goto end;
}
OpenAPI_snssai_t *rejected_nssai_in_plmnItem = OpenAPI_snssai_parseFromJSON(rejected_nssai_in_plmn_local_nonprimitive);
if (!rejected_nssai_in_plmnItem) {
ogs_error("No rejected_nssai_in_plmnItem");
OpenAPI_list_free(rejected_nssai_in_plmnList);
goto end;
rejected_nssai_in_plmnList = OpenAPI_list_create();
cJSON_ArrayForEach(rejected_nssai_in_plmn_local, rejected_nssai_in_plmn) {
if (!cJSON_IsObject(rejected_nssai_in_plmn_local)) {
ogs_error("OpenAPI_authorized_network_slice_info_parseFromJSON() failed [rejected_nssai_in_plmn]");
goto end;
}
OpenAPI_snssai_t *rejected_nssai_in_plmnItem = OpenAPI_snssai_parseFromJSON(rejected_nssai_in_plmn_local);
if (!rejected_nssai_in_plmnItem) {
ogs_error("No rejected_nssai_in_plmnItem");
OpenAPI_list_free(rejected_nssai_in_plmnList);
goto end;
}
OpenAPI_list_add(rejected_nssai_in_plmnList, rejected_nssai_in_plmnItem);
}
OpenAPI_list_add(rejected_nssai_in_plmnList, rejected_nssai_in_plmnItem);
}
}
cJSON *rejected_nssai_in_ta = cJSON_GetObjectItemCaseSensitive(authorized_network_slice_infoJSON, "rejectedNssaiInTa");
OpenAPI_list_t *rejected_nssai_in_taList;
rejected_nssai_in_ta = cJSON_GetObjectItemCaseSensitive(authorized_network_slice_infoJSON, "rejectedNssaiInTa");
if (rejected_nssai_in_ta) {
cJSON *rejected_nssai_in_ta_local_nonprimitive;
if (!cJSON_IsArray(rejected_nssai_in_ta)){
ogs_error("OpenAPI_authorized_network_slice_info_parseFromJSON() failed [rejected_nssai_in_ta]");
goto end;
}
rejected_nssai_in_taList = OpenAPI_list_create();
cJSON_ArrayForEach(rejected_nssai_in_ta_local_nonprimitive, rejected_nssai_in_ta ) {
if (!cJSON_IsObject(rejected_nssai_in_ta_local_nonprimitive)) {
cJSON *rejected_nssai_in_ta_local = NULL;
if (!cJSON_IsArray(rejected_nssai_in_ta)) {
ogs_error("OpenAPI_authorized_network_slice_info_parseFromJSON() failed [rejected_nssai_in_ta]");
goto end;
}
OpenAPI_snssai_t *rejected_nssai_in_taItem = OpenAPI_snssai_parseFromJSON(rejected_nssai_in_ta_local_nonprimitive);
if (!rejected_nssai_in_taItem) {
ogs_error("No rejected_nssai_in_taItem");
OpenAPI_list_free(rejected_nssai_in_taList);
goto end;
rejected_nssai_in_taList = OpenAPI_list_create();
cJSON_ArrayForEach(rejected_nssai_in_ta_local, rejected_nssai_in_ta) {
if (!cJSON_IsObject(rejected_nssai_in_ta_local)) {
ogs_error("OpenAPI_authorized_network_slice_info_parseFromJSON() failed [rejected_nssai_in_ta]");
goto end;
}
OpenAPI_snssai_t *rejected_nssai_in_taItem = OpenAPI_snssai_parseFromJSON(rejected_nssai_in_ta_local);
if (!rejected_nssai_in_taItem) {
ogs_error("No rejected_nssai_in_taItem");
OpenAPI_list_free(rejected_nssai_in_taList);
goto end;
}
OpenAPI_list_add(rejected_nssai_in_taList, rejected_nssai_in_taItem);
}
OpenAPI_list_add(rejected_nssai_in_taList, rejected_nssai_in_taItem);
}
}
cJSON *nsi_information = cJSON_GetObjectItemCaseSensitive(authorized_network_slice_infoJSON, "nsiInformation");
OpenAPI_nsi_information_t *nsi_information_local_nonprim = NULL;
nsi_information = cJSON_GetObjectItemCaseSensitive(authorized_network_slice_infoJSON, "nsiInformation");
if (nsi_information) {
nsi_information_local_nonprim = OpenAPI_nsi_information_parseFromJSON(nsi_information);
}
cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(authorized_network_slice_infoJSON, "supportedFeatures");
supported_features = cJSON_GetObjectItemCaseSensitive(authorized_network_slice_infoJSON, "supportedFeatures");
if (supported_features) {
if (!cJSON_IsString(supported_features)) {
if (!cJSON_IsString(supported_features) && !cJSON_IsNull(supported_features)) {
ogs_error("OpenAPI_authorized_network_slice_info_parseFromJSON() failed [supported_features]");
goto end;
}
}
cJSON *nrf_amf_set = cJSON_GetObjectItemCaseSensitive(authorized_network_slice_infoJSON, "nrfAmfSet");
nrf_amf_set = cJSON_GetObjectItemCaseSensitive(authorized_network_slice_infoJSON, "nrfAmfSet");
if (nrf_amf_set) {
if (!cJSON_IsString(nrf_amf_set)) {
if (!cJSON_IsString(nrf_amf_set) && !cJSON_IsNull(nrf_amf_set)) {
ogs_error("OpenAPI_authorized_network_slice_info_parseFromJSON() failed [nrf_amf_set]");
goto end;
}
}
cJSON *nrf_amf_set_nf_mgt_uri = cJSON_GetObjectItemCaseSensitive(authorized_network_slice_infoJSON, "nrfAmfSetNfMgtUri");
nrf_amf_set_nf_mgt_uri = cJSON_GetObjectItemCaseSensitive(authorized_network_slice_infoJSON, "nrfAmfSetNfMgtUri");
if (nrf_amf_set_nf_mgt_uri) {
if (!cJSON_IsString(nrf_amf_set_nf_mgt_uri)) {
if (!cJSON_IsString(nrf_amf_set_nf_mgt_uri) && !cJSON_IsNull(nrf_amf_set_nf_mgt_uri)) {
ogs_error("OpenAPI_authorized_network_slice_info_parseFromJSON() failed [nrf_amf_set_nf_mgt_uri]");
goto end;
}
}
cJSON *nrf_amf_set_access_token_uri = cJSON_GetObjectItemCaseSensitive(authorized_network_slice_infoJSON, "nrfAmfSetAccessTokenUri");
nrf_amf_set_access_token_uri = cJSON_GetObjectItemCaseSensitive(authorized_network_slice_infoJSON, "nrfAmfSetAccessTokenUri");
if (nrf_amf_set_access_token_uri) {
if (!cJSON_IsString(nrf_amf_set_access_token_uri)) {
if (!cJSON_IsString(nrf_amf_set_access_token_uri) && !cJSON_IsNull(nrf_amf_set_access_token_uri)) {
ogs_error("OpenAPI_authorized_network_slice_info_parseFromJSON() failed [nrf_amf_set_access_token_uri]");
goto end;
}
}
cJSON *target_amf_service_set = cJSON_GetObjectItemCaseSensitive(authorized_network_slice_infoJSON, "targetAmfServiceSet");
target_amf_service_set = cJSON_GetObjectItemCaseSensitive(authorized_network_slice_infoJSON, "targetAmfServiceSet");
if (target_amf_service_set) {
if (!cJSON_IsString(target_amf_service_set)) {
if (!cJSON_IsString(target_amf_service_set) && !cJSON_IsNull(target_amf_service_set)) {
ogs_error("OpenAPI_authorized_network_slice_info_parseFromJSON() failed [target_amf_service_set]");
goto end;
}
@ -442,20 +458,59 @@ OpenAPI_authorized_network_slice_info_t *OpenAPI_authorized_network_slice_info_p
authorized_network_slice_info_local_var = OpenAPI_authorized_network_slice_info_create (
allowed_nssai_list ? allowed_nssai_listList : NULL,
configured_nssai ? configured_nssaiList : NULL,
target_amf_set ? ogs_strdup(target_amf_set->valuestring) : NULL,
target_amf_set && !cJSON_IsNull(target_amf_set) ? ogs_strdup(target_amf_set->valuestring) : NULL,
candidate_amf_list ? candidate_amf_listList : NULL,
rejected_nssai_in_plmn ? rejected_nssai_in_plmnList : NULL,
rejected_nssai_in_ta ? rejected_nssai_in_taList : NULL,
nsi_information ? nsi_information_local_nonprim : NULL,
supported_features ? ogs_strdup(supported_features->valuestring) : NULL,
nrf_amf_set ? ogs_strdup(nrf_amf_set->valuestring) : NULL,
nrf_amf_set_nf_mgt_uri ? ogs_strdup(nrf_amf_set_nf_mgt_uri->valuestring) : NULL,
nrf_amf_set_access_token_uri ? ogs_strdup(nrf_amf_set_access_token_uri->valuestring) : NULL,
target_amf_service_set ? ogs_strdup(target_amf_service_set->valuestring) : NULL
supported_features && !cJSON_IsNull(supported_features) ? ogs_strdup(supported_features->valuestring) : NULL,
nrf_amf_set && !cJSON_IsNull(nrf_amf_set) ? ogs_strdup(nrf_amf_set->valuestring) : NULL,
nrf_amf_set_nf_mgt_uri && !cJSON_IsNull(nrf_amf_set_nf_mgt_uri) ? ogs_strdup(nrf_amf_set_nf_mgt_uri->valuestring) : NULL,
nrf_amf_set_access_token_uri && !cJSON_IsNull(nrf_amf_set_access_token_uri) ? ogs_strdup(nrf_amf_set_access_token_uri->valuestring) : NULL,
target_amf_service_set && !cJSON_IsNull(target_amf_service_set) ? ogs_strdup(target_amf_service_set->valuestring) : NULL
);
return authorized_network_slice_info_local_var;
end:
if (allowed_nssai_listList) {
OpenAPI_list_for_each(allowed_nssai_listList, node) {
OpenAPI_allowed_nssai_free(node->data);
}
OpenAPI_list_free(allowed_nssai_listList);
allowed_nssai_listList = NULL;
}
if (configured_nssaiList) {
OpenAPI_list_for_each(configured_nssaiList, node) {
OpenAPI_configured_snssai_free(node->data);
}
OpenAPI_list_free(configured_nssaiList);
configured_nssaiList = NULL;
}
if (candidate_amf_listList) {
OpenAPI_list_for_each(candidate_amf_listList, node) {
ogs_free(node->data);
}
OpenAPI_list_free(candidate_amf_listList);
candidate_amf_listList = NULL;
}
if (rejected_nssai_in_plmnList) {
OpenAPI_list_for_each(rejected_nssai_in_plmnList, node) {
OpenAPI_snssai_free(node->data);
}
OpenAPI_list_free(rejected_nssai_in_plmnList);
rejected_nssai_in_plmnList = NULL;
}
if (rejected_nssai_in_taList) {
OpenAPI_list_for_each(rejected_nssai_in_taList, node) {
OpenAPI_snssai_free(node->data);
}
OpenAPI_list_free(rejected_nssai_in_taList);
rejected_nssai_in_taList = NULL;
}
if (nsi_information_local_nonprim) {
OpenAPI_nsi_information_free(nsi_information_local_nonprim);
nsi_information_local_nonprim = NULL;
}
return NULL;
}

View File

@ -26,20 +26,34 @@ OpenAPI_av5_ghe_aka_t *OpenAPI_av5_ghe_aka_create(
void OpenAPI_av5_ghe_aka_free(OpenAPI_av5_ghe_aka_t *av5_ghe_aka)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == av5_ghe_aka) {
return;
}
OpenAPI_lnode_t *node;
ogs_free(av5_ghe_aka->rand);
ogs_free(av5_ghe_aka->xres_star);
ogs_free(av5_ghe_aka->autn);
ogs_free(av5_ghe_aka->kausf);
if (av5_ghe_aka->rand) {
ogs_free(av5_ghe_aka->rand);
av5_ghe_aka->rand = NULL;
}
if (av5_ghe_aka->xres_star) {
ogs_free(av5_ghe_aka->xres_star);
av5_ghe_aka->xres_star = NULL;
}
if (av5_ghe_aka->autn) {
ogs_free(av5_ghe_aka->autn);
av5_ghe_aka->autn = NULL;
}
if (av5_ghe_aka->kausf) {
ogs_free(av5_ghe_aka->kausf);
av5_ghe_aka->kausf = NULL;
}
ogs_free(av5_ghe_aka);
}
cJSON *OpenAPI_av5_ghe_aka_convertToJSON(OpenAPI_av5_ghe_aka_t *av5_ghe_aka)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (av5_ghe_aka == NULL) {
ogs_error("OpenAPI_av5_ghe_aka_convertToJSON() failed [Av5GHeAka]");
@ -47,11 +61,19 @@ cJSON *OpenAPI_av5_ghe_aka_convertToJSON(OpenAPI_av5_ghe_aka_t *av5_ghe_aka)
}
item = cJSON_CreateObject();
if (av5_ghe_aka->av_type == OpenAPI_av_type_NULL) {
ogs_error("OpenAPI_av5_ghe_aka_convertToJSON() failed [av_type]");
return NULL;
}
if (cJSON_AddStringToObject(item, "avType", OpenAPI_av_type_ToString(av5_ghe_aka->av_type)) == NULL) {
ogs_error("OpenAPI_av5_ghe_aka_convertToJSON() failed [av_type]");
goto end;
}
if (!av5_ghe_aka->rand) {
ogs_error("OpenAPI_av5_ghe_aka_convertToJSON() failed [rand]");
return NULL;
}
if (cJSON_AddStringToObject(item, "rand", av5_ghe_aka->rand) == NULL) {
ogs_error("OpenAPI_av5_ghe_aka_convertToJSON() failed [rand]");
goto end;
@ -64,6 +86,10 @@ cJSON *OpenAPI_av5_ghe_aka_convertToJSON(OpenAPI_av5_ghe_aka_t *av5_ghe_aka)
}
}
if (!av5_ghe_aka->autn) {
ogs_error("OpenAPI_av5_ghe_aka_convertToJSON() failed [autn]");
return NULL;
}
if (cJSON_AddStringToObject(item, "autn", av5_ghe_aka->autn) == NULL) {
ogs_error("OpenAPI_av5_ghe_aka_convertToJSON() failed [autn]");
goto end;
@ -83,54 +109,55 @@ end:
OpenAPI_av5_ghe_aka_t *OpenAPI_av5_ghe_aka_parseFromJSON(cJSON *av5_ghe_akaJSON)
{
OpenAPI_av5_ghe_aka_t *av5_ghe_aka_local_var = NULL;
cJSON *av_type = cJSON_GetObjectItemCaseSensitive(av5_ghe_akaJSON, "avType");
OpenAPI_lnode_t *node = NULL;
cJSON *av_type = NULL;
OpenAPI_av_type_e av_typeVariable = 0;
cJSON *rand = NULL;
cJSON *xres_star = NULL;
cJSON *autn = NULL;
cJSON *kausf = NULL;
av_type = cJSON_GetObjectItemCaseSensitive(av5_ghe_akaJSON, "avType");
if (!av_type) {
ogs_error("OpenAPI_av5_ghe_aka_parseFromJSON() failed [av_type]");
goto end;
}
OpenAPI_av_type_e av_typeVariable;
if (!cJSON_IsString(av_type)) {
ogs_error("OpenAPI_av5_ghe_aka_parseFromJSON() failed [av_type]");
goto end;
}
av_typeVariable = OpenAPI_av_type_FromString(av_type->valuestring);
cJSON *rand = cJSON_GetObjectItemCaseSensitive(av5_ghe_akaJSON, "rand");
rand = cJSON_GetObjectItemCaseSensitive(av5_ghe_akaJSON, "rand");
if (!rand) {
ogs_error("OpenAPI_av5_ghe_aka_parseFromJSON() failed [rand]");
goto end;
}
if (!cJSON_IsString(rand)) {
ogs_error("OpenAPI_av5_ghe_aka_parseFromJSON() failed [rand]");
goto end;
}
cJSON *xres_star = cJSON_GetObjectItemCaseSensitive(av5_ghe_akaJSON, "xresStar");
xres_star = cJSON_GetObjectItemCaseSensitive(av5_ghe_akaJSON, "xresStar");
if (xres_star) {
if (!cJSON_IsString(xres_star)) {
if (!cJSON_IsString(xres_star) && !cJSON_IsNull(xres_star)) {
ogs_error("OpenAPI_av5_ghe_aka_parseFromJSON() failed [xres_star]");
goto end;
}
}
cJSON *autn = cJSON_GetObjectItemCaseSensitive(av5_ghe_akaJSON, "autn");
autn = cJSON_GetObjectItemCaseSensitive(av5_ghe_akaJSON, "autn");
if (!autn) {
ogs_error("OpenAPI_av5_ghe_aka_parseFromJSON() failed [autn]");
goto end;
}
if (!cJSON_IsString(autn)) {
ogs_error("OpenAPI_av5_ghe_aka_parseFromJSON() failed [autn]");
goto end;
}
cJSON *kausf = cJSON_GetObjectItemCaseSensitive(av5_ghe_akaJSON, "kausf");
kausf = cJSON_GetObjectItemCaseSensitive(av5_ghe_akaJSON, "kausf");
if (kausf) {
if (!cJSON_IsString(kausf)) {
if (!cJSON_IsString(kausf) && !cJSON_IsNull(kausf)) {
ogs_error("OpenAPI_av5_ghe_aka_parseFromJSON() failed [kausf]");
goto end;
}
@ -139,9 +166,9 @@ OpenAPI_av5_ghe_aka_t *OpenAPI_av5_ghe_aka_parseFromJSON(cJSON *av5_ghe_akaJSON)
av5_ghe_aka_local_var = OpenAPI_av5_ghe_aka_create (
av_typeVariable,
ogs_strdup(rand->valuestring),
xres_star ? ogs_strdup(xres_star->valuestring) : NULL,
xres_star && !cJSON_IsNull(xres_star) ? ogs_strdup(xres_star->valuestring) : NULL,
ogs_strdup(autn->valuestring),
kausf ? ogs_strdup(kausf->valuestring) : NULL
kausf && !cJSON_IsNull(kausf) ? ogs_strdup(kausf->valuestring) : NULL
);
return av5_ghe_aka_local_var;

View File

@ -22,19 +22,30 @@ OpenAPI_av5g_aka_t *OpenAPI_av5g_aka_create(
void OpenAPI_av5g_aka_free(OpenAPI_av5g_aka_t *av5g_aka)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == av5g_aka) {
return;
}
OpenAPI_lnode_t *node;
ogs_free(av5g_aka->rand);
ogs_free(av5g_aka->hxres_star);
ogs_free(av5g_aka->autn);
if (av5g_aka->rand) {
ogs_free(av5g_aka->rand);
av5g_aka->rand = NULL;
}
if (av5g_aka->hxres_star) {
ogs_free(av5g_aka->hxres_star);
av5g_aka->hxres_star = NULL;
}
if (av5g_aka->autn) {
ogs_free(av5g_aka->autn);
av5g_aka->autn = NULL;
}
ogs_free(av5g_aka);
}
cJSON *OpenAPI_av5g_aka_convertToJSON(OpenAPI_av5g_aka_t *av5g_aka)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (av5g_aka == NULL) {
ogs_error("OpenAPI_av5g_aka_convertToJSON() failed [Av5gAka]");
@ -42,16 +53,28 @@ cJSON *OpenAPI_av5g_aka_convertToJSON(OpenAPI_av5g_aka_t *av5g_aka)
}
item = cJSON_CreateObject();
if (!av5g_aka->rand) {
ogs_error("OpenAPI_av5g_aka_convertToJSON() failed [rand]");
return NULL;
}
if (cJSON_AddStringToObject(item, "rand", av5g_aka->rand) == NULL) {
ogs_error("OpenAPI_av5g_aka_convertToJSON() failed [rand]");
goto end;
}
if (!av5g_aka->hxres_star) {
ogs_error("OpenAPI_av5g_aka_convertToJSON() failed [hxres_star]");
return NULL;
}
if (cJSON_AddStringToObject(item, "hxresStar", av5g_aka->hxres_star) == NULL) {
ogs_error("OpenAPI_av5g_aka_convertToJSON() failed [hxres_star]");
goto end;
}
if (!av5g_aka->autn) {
ogs_error("OpenAPI_av5g_aka_convertToJSON() failed [autn]");
return NULL;
}
if (cJSON_AddStringToObject(item, "autn", av5g_aka->autn) == NULL) {
ogs_error("OpenAPI_av5g_aka_convertToJSON() failed [autn]");
goto end;
@ -64,34 +87,35 @@ end:
OpenAPI_av5g_aka_t *OpenAPI_av5g_aka_parseFromJSON(cJSON *av5g_akaJSON)
{
OpenAPI_av5g_aka_t *av5g_aka_local_var = NULL;
cJSON *rand = cJSON_GetObjectItemCaseSensitive(av5g_akaJSON, "rand");
OpenAPI_lnode_t *node = NULL;
cJSON *rand = NULL;
cJSON *hxres_star = NULL;
cJSON *autn = NULL;
rand = cJSON_GetObjectItemCaseSensitive(av5g_akaJSON, "rand");
if (!rand) {
ogs_error("OpenAPI_av5g_aka_parseFromJSON() failed [rand]");
goto end;
}
if (!cJSON_IsString(rand)) {
ogs_error("OpenAPI_av5g_aka_parseFromJSON() failed [rand]");
goto end;
}
cJSON *hxres_star = cJSON_GetObjectItemCaseSensitive(av5g_akaJSON, "hxresStar");
hxres_star = cJSON_GetObjectItemCaseSensitive(av5g_akaJSON, "hxresStar");
if (!hxres_star) {
ogs_error("OpenAPI_av5g_aka_parseFromJSON() failed [hxres_star]");
goto end;
}
if (!cJSON_IsString(hxres_star)) {
ogs_error("OpenAPI_av5g_aka_parseFromJSON() failed [hxres_star]");
goto end;
}
cJSON *autn = cJSON_GetObjectItemCaseSensitive(av5g_akaJSON, "autn");
autn = cJSON_GetObjectItemCaseSensitive(av5g_akaJSON, "autn");
if (!autn) {
ogs_error("OpenAPI_av5g_aka_parseFromJSON() failed [autn]");
goto end;
}
if (!cJSON_IsString(autn)) {
ogs_error("OpenAPI_av5g_aka_parseFromJSON() failed [autn]");
goto end;

Some files were not shown because too many files have changed in this diff Show More