Upgrade SBI(Service-based Interface)

* OpenAPI Generator version: 4.3.1 ==> 5.5.1
* Specification : r16.8.0 (20210629)
This commit is contained in:
Sukchan Lee 2021-07-07 17:32:55 +09:00
parent 2aaa8200c2
commit f278d58a69
1914 changed files with 91329 additions and 57361 deletions

View File

@ -7,9 +7,10 @@
OpenAPI_ue_authentication_ctx_t *OpenAPI_ue_authentication_ctx_create(
OpenAPI_auth_type_e auth_type,
OpenAPI_av5g_aka_t *_5g_auth_data,
char *eap_payload,
OpenAPI_list_t* _links,
char *serving_network_name
)
)
{
OpenAPI_ue_authentication_ctx_t *ue_authentication_ctx_local_var = OpenAPI_malloc(sizeof(OpenAPI_ue_authentication_ctx_t));
if (!ue_authentication_ctx_local_var) {
@ -17,6 +18,7 @@ OpenAPI_ue_authentication_ctx_t *OpenAPI_ue_authentication_ctx_create(
}
ue_authentication_ctx_local_var->auth_type = auth_type;
ue_authentication_ctx_local_var->_5g_auth_data = _5g_auth_data;
ue_authentication_ctx_local_var->eap_payload = eap_payload;
ue_authentication_ctx_local_var->_links = _links;
ue_authentication_ctx_local_var->serving_network_name = serving_network_name;
@ -29,14 +31,27 @@ void OpenAPI_ue_authentication_ctx_free(OpenAPI_ue_authentication_ctx_t *ue_auth
return;
}
OpenAPI_lnode_t *node;
OpenAPI_av5g_aka_free(ue_authentication_ctx->_5g_auth_data);
OpenAPI_list_for_each(ue_authentication_ctx->_links, node) {
OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data;
OpenAPI_links_value_schema_free(localKeyValue->value);
ogs_free(localKeyValue);
if (ue_authentication_ctx->_5g_auth_data) {
OpenAPI_av5g_aka_free(ue_authentication_ctx->_5g_auth_data);
ue_authentication_ctx->_5g_auth_data = NULL;
}
if (ue_authentication_ctx->eap_payload) {
ogs_free(ue_authentication_ctx->eap_payload);
ue_authentication_ctx->eap_payload = NULL;
}
if (ue_authentication_ctx->_links) {
OpenAPI_list_for_each(ue_authentication_ctx->_links, node) {
OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data;
OpenAPI_links_value_schema_free(localKeyValue->value);
ogs_free(localKeyValue);
}
OpenAPI_list_free(ue_authentication_ctx->_links);
ue_authentication_ctx->_links = NULL;
}
if (ue_authentication_ctx->serving_network_name) {
ogs_free(ue_authentication_ctx->serving_network_name);
ue_authentication_ctx->serving_network_name = NULL;
}
OpenAPI_list_free(ue_authentication_ctx->_links);
ogs_free(ue_authentication_ctx->serving_network_name);
ogs_free(ue_authentication_ctx);
}
@ -55,6 +70,7 @@ cJSON *OpenAPI_ue_authentication_ctx_convertToJSON(OpenAPI_ue_authentication_ctx
goto end;
}
if (ue_authentication_ctx->_5g_auth_data) {
cJSON *_5g_auth_data_local_JSON = OpenAPI_av5g_aka_convertToJSON(ue_authentication_ctx->_5g_auth_data);
if (_5g_auth_data_local_JSON == NULL) {
ogs_error("OpenAPI_ue_authentication_ctx_convertToJSON() failed [_5g_auth_data]");
@ -65,31 +81,38 @@ cJSON *OpenAPI_ue_authentication_ctx_convertToJSON(OpenAPI_ue_authentication_ctx
ogs_error("OpenAPI_ue_authentication_ctx_convertToJSON() failed [_5g_auth_data]");
goto end;
}
}
if (ue_authentication_ctx->eap_payload) {
if (cJSON_AddStringToObject(item, "EapPayload", ue_authentication_ctx->eap_payload) == NULL) {
ogs_error("OpenAPI_ue_authentication_ctx_convertToJSON() failed [eap_payload]");
goto end;
}
}
cJSON *_links = cJSON_AddObjectToObject(item, "_links");
if (_links == NULL) {
ogs_error("OpenAPI_ue_authentication_ctx_convertToJSON() failed [_links]");
goto end;
}
cJSON *localMapObject = _links;
OpenAPI_lnode_t *_links_node;
if (ue_authentication_ctx->_links) {
OpenAPI_list_for_each(ue_authentication_ctx->_links, _links_node) {
OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)_links_node->data;
cJSON *itemLocal = OpenAPI_links_value_schema_convertToJSON(localKeyValue->value);
if (itemLocal == NULL) {
ogs_error("OpenAPI_ue_authentication_ctx_convertToJSON() failed [_links]");
goto end;
}
cJSON_AddItemToObject(_links, localKeyValue->key, itemLocal);
}
}
if (ue_authentication_ctx->serving_network_name) {
if (cJSON_AddStringToObject(item, "servingNetworkName", ue_authentication_ctx->serving_network_name) == NULL) {
ogs_error("OpenAPI_ue_authentication_ctx_convertToJSON() failed [serving_network_name]");
cJSON *itemLocal = OpenAPI_links_value_schema_convertToJSON(localKeyValue->value);
if (itemLocal == NULL) {
ogs_error("OpenAPI_ue_authentication_ctx_convertToJSON() failed [_links]");
goto end;
}
cJSON_AddItemToObject(_links, localKeyValue->key, itemLocal);
}
}
if (ue_authentication_ctx->serving_network_name) {
if (cJSON_AddStringToObject(item, "servingNetworkName", ue_authentication_ctx->serving_network_name) == NULL) {
ogs_error("OpenAPI_ue_authentication_ctx_convertToJSON() failed [serving_network_name]");
goto end;
}
}
end:
@ -106,7 +129,7 @@ OpenAPI_ue_authentication_ctx_t *OpenAPI_ue_authentication_ctx_parseFromJSON(cJS
}
OpenAPI_auth_type_e auth_typeVariable;
if (!cJSON_IsString(auth_type)) {
ogs_error("OpenAPI_ue_authentication_ctx_parseFromJSON() failed [auth_type]");
goto end;
@ -114,14 +137,20 @@ OpenAPI_ue_authentication_ctx_t *OpenAPI_ue_authentication_ctx_parseFromJSON(cJS
auth_typeVariable = OpenAPI_auth_type_FromString(auth_type->valuestring);
cJSON *_5g_auth_data = cJSON_GetObjectItemCaseSensitive(ue_authentication_ctxJSON, "5gAuthData");
if (!_5g_auth_data) {
ogs_error("OpenAPI_ue_authentication_ctx_parseFromJSON() failed [_5g_auth_data]");
goto end;
}
OpenAPI_av5g_aka_t *_5g_auth_data_local_nonprim = NULL;
if (_5g_auth_data) {
_5g_auth_data_local_nonprim = OpenAPI_av5g_aka_parseFromJSON(_5g_auth_data);
}
cJSON *eap_payload = cJSON_GetObjectItemCaseSensitive(ue_authentication_ctxJSON, "EapPayload");
if (eap_payload) {
if (!cJSON_IsString(eap_payload)) {
ogs_error("OpenAPI_ue_authentication_ctx_parseFromJSON() failed [eap_payload]");
goto end;
}
}
cJSON *_links = cJSON_GetObjectItemCaseSensitive(ue_authentication_ctxJSON, "_links");
if (!_links) {
@ -130,7 +159,7 @@ OpenAPI_ue_authentication_ctx_t *OpenAPI_ue_authentication_ctx_parseFromJSON(cJS
}
OpenAPI_list_t *_linksList;
cJSON *_links_local_map;
if (!cJSON_IsObject(_links)) {
ogs_error("OpenAPI_ue_authentication_ctx_parseFromJSON() failed [_links]");
@ -146,24 +175,25 @@ OpenAPI_ue_authentication_ctx_t *OpenAPI_ue_authentication_ctx_parseFromJSON(cJS
}
localMapKeyPair = OpenAPI_map_create(
localMapObject->string, OpenAPI_links_value_schema_parseFromJSON(localMapObject));
OpenAPI_list_add(_linksList, localMapKeyPair);
OpenAPI_list_add(_linksList , localMapKeyPair);
}
cJSON *serving_network_name = cJSON_GetObjectItemCaseSensitive(ue_authentication_ctxJSON, "servingNetworkName");
if (serving_network_name) {
if (!cJSON_IsString(serving_network_name)) {
ogs_error("OpenAPI_ue_authentication_ctx_parseFromJSON() failed [serving_network_name]");
goto end;
}
if (serving_network_name) {
if (!cJSON_IsString(serving_network_name)) {
ogs_error("OpenAPI_ue_authentication_ctx_parseFromJSON() failed [serving_network_name]");
goto end;
}
}
ue_authentication_ctx_local_var = OpenAPI_ue_authentication_ctx_create (
auth_typeVariable,
_5g_auth_data_local_nonprim,
_5g_auth_data ? _5g_auth_data_local_nonprim : NULL,
eap_payload ? ogs_strdup_or_assert(eap_payload->valuestring) : NULL,
_linksList,
serving_network_name ? ogs_strdup_or_assert(serving_network_name->valuestring) : NULL
);
);
return ue_authentication_ctx_local_var;
end:

View File

@ -1,20 +1,20 @@
/*
* ue_authentication_ctx.h
*
*
*
*/
#ifndef _OpenAPI_ue_authentication_ctx_H_
#define _OpenAPI_ue_authentication_ctx_H_
#include <string.h>
#include "../external/cJSON.h"
#include "../include/list.h"
#include "../include/keyValuePair.h"
#include "../include/binary.h"
#include "auth_type.h"
#include "av5g_aka.h"
#include "links_value_schema.h"
#include "../openapi/external/cJSON.h"
#include "../openapi/include/list.h"
#include "../openapi/include/keyValuePair.h"
#include "../openapi/include/binary.h"
#include "../openapi/model/auth_type.h"
#include "../openapi/model/av5g_aka.h"
#include "../openapi/model/links_value_schema.h"
#ifdef __cplusplus
extern "C" {
@ -22,18 +22,20 @@ extern "C" {
typedef struct OpenAPI_ue_authentication_ctx_s OpenAPI_ue_authentication_ctx_t;
typedef struct OpenAPI_ue_authentication_ctx_s {
OpenAPI_auth_type_e auth_type;
struct OpenAPI_av5g_aka_s *_5g_auth_data;
OpenAPI_list_t* _links;
char *serving_network_name;
OpenAPI_auth_type_e auth_type; /* Non-Primitive Enum */
struct OpenAPI_av5g_aka_s *_5g_auth_data; /* Model */
char *eap_payload; /* String */
OpenAPI_list_t* _links; /* Map */
char *serving_network_name; /* String */
} OpenAPI_ue_authentication_ctx_t;
OpenAPI_ue_authentication_ctx_t *OpenAPI_ue_authentication_ctx_create(
OpenAPI_auth_type_e auth_type,
OpenAPI_av5g_aka_t *_5g_auth_data,
char *eap_payload,
OpenAPI_list_t* _links,
char *serving_network_name
);
);
void OpenAPI_ue_authentication_ctx_free(OpenAPI_ue_authentication_ctx_t *ue_authentication_ctx);
OpenAPI_ue_authentication_ctx_t *OpenAPI_ue_authentication_ctx_parseFromJSON(cJSON *ue_authentication_ctxJSON);
cJSON *OpenAPI_ue_authentication_ctx_convertToJSON(OpenAPI_ue_authentication_ctx_t *ue_authentication_ctx);

View File

@ -20,6 +20,7 @@ subdir('openapi')
libsbi_sources = files('''
contrib/multipart_parser.c
custom/links.c
custom/ue_authentication_ctx.c
yuarel.c
conv.c

View File

@ -39,7 +39,6 @@
#include "model/authentication_info_request.h"
#include "model/authentication_info_result.h"
#include "model/authentication_subscription.h"
#include "model/ue_authentication_ctx.h"
#include "model/confirmation_data.h"
#include "model/confirmation_data_response.h"
#include "model/auth_event.h"
@ -74,6 +73,7 @@
#include "model/sm_policy_notification.h"
#include "custom/links.h"
#include "custom/ue_authentication_ctx.h"
#if defined(__GNUC__)
#pragma GCC diagnostic pop

View File

@ -1,15 +1,23 @@
# OpenAPI Generator Ignore
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
api/**
# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.
include/apiClient.h
# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
#ApiClient.cs
src/apiClient.c
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
unit-test/**
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
README.md
libcurl.licence
uncrustify-rules.cfg
CMakeLists.txt
# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md

View File

@ -0,0 +1,697 @@
CMakeLists.txt
README.md
api/IndividualSubscriptionDocumentAPI.c
api/IndividualSubscriptionDocumentAPI.h
api/IndividualUeContextDocumentAPI.c
api/IndividualUeContextDocumentAPI.h
api/N1N2IndividualSubscriptionDocumentAPI.c
api/N1N2IndividualSubscriptionDocumentAPI.h
api/N1N2MessageCollectionDocumentAPI.c
api/N1N2MessageCollectionDocumentAPI.h
api/N1N2SubscriptionsCollectionForIndividualUEContextsDocumentAPI.c
api/N1N2SubscriptionsCollectionForIndividualUEContextsDocumentAPI.h
api/NonUEN2MessageNotificationIndividualSubscriptionDocumentAPI.c
api/NonUEN2MessageNotificationIndividualSubscriptionDocumentAPI.h
api/NonUEN2MessagesCollectionDocumentAPI.c
api/NonUEN2MessagesCollectionDocumentAPI.h
api/NonUEN2MessagesSubscriptionsCollectionDocumentAPI.c
api/NonUEN2MessagesSubscriptionsCollectionDocumentAPI.h
api/SubscriptionsCollectionDocumentAPI.c
api/SubscriptionsCollectionDocumentAPI.h
docs/IndividualSubscriptionDocumentAPI.md
docs/IndividualUeContextDocumentAPI.md
docs/N1N2IndividualSubscriptionDocumentAPI.md
docs/N1N2MessageCollectionDocumentAPI.md
docs/N1N2SubscriptionsCollectionForIndividualUEContextsDocumentAPI.md
docs/NonUEN2MessageNotificationIndividualSubscriptionDocumentAPI.md
docs/NonUEN2MessagesCollectionDocumentAPI.md
docs/NonUEN2MessagesSubscriptionsCollectionDocumentAPI.md
docs/SubscriptionsCollectionDocumentAPI.md
docs/access_token_err.md
docs/access_token_req.md
docs/access_type.md
docs/allowed_nssai.md
docs/allowed_snssai.md
docs/ambr.md
docs/amf_event.md
docs/amf_event_area.md
docs/amf_event_mode.md
docs/amf_event_subscription.md
docs/amf_event_subscription_add_info.md
docs/amf_event_trigger.md
docs/amf_event_trigger_any_of.md
docs/amf_event_type.md
docs/amf_event_type_any_of.md
docs/amf_status_change_notification.md
docs/amf_status_change_subscription_data.md
docs/amf_status_info.md
docs/area.md
docs/area_of_validity.md
docs/area_scope.md
docs/arp.md
docs/assign_ebi_data.md
docs/assign_ebi_error.md
docs/assign_ebi_failed.md
docs/assigned_ebi_data.md
docs/auth_status.md
docs/battery_indication.md
docs/cag_data.md
docs/cag_info.md
docs/ce_mode_b_ind.md
docs/ciphering_algorithm.md
docs/cn_assisted_ran_para.md
docs/collection_period_rmm_lte_mdt.md
docs/collection_period_rmm_nr_mdt.md
docs/configured_snssai.md
docs/core_network_type.md
docs/ddd_traffic_descriptor.md
docs/ebi_arp_mapping.md
docs/ec_restriction_data_wb.md
docs/ecgi.md
docs/eps_nas_ciphering_algorithm.md
docs/eps_nas_integrity_algorithm.md
docs/eps_nas_security_mode.md
docs/eutra_location.md
docs/expected_ue_behavior.md
docs/ext_amf_event_subscription.md
docs/global_ran_node_id.md
docs/gnb_id.md
docs/guami.md
docs/hfc_node_id.md
docs/immediate_mdt_conf.md
docs/inline_object.md
docs/inline_object_1.md
docs/inline_object_2.md
docs/inline_object_3.md
docs/inline_object_4.md
docs/integrity_algorithm.md
docs/invalid_param.md
docs/job_type.md
docs/key_amf.md
docs/key_amf_type.md
docs/ladn_info.md
docs/line_type.md
docs/location_filter.md
docs/location_filter_any_of.md
docs/lte_m_ind.md
docs/lte_v2x_auth.md
docs/measurement_lte_for_mdt.md
docs/measurement_nr_for_mdt.md
docs/measurement_period_lte_mdt.md
docs/mm_context.md
docs/mo_exp_data_counter.md
docs/n1_message_class.md
docs/n1_message_container.md
docs/n1_message_notification.md
docs/n1_n2_message_transfer_cause.md
docs/n1_n2_message_transfer_error.md
docs/n1_n2_message_transfer_req_data.md
docs/n1_n2_message_transfer_rsp_data.md
docs/n1_n2_msg_txfr_err_detail.md
docs/n1_n2_msg_txfr_failure_notification.md
docs/n2_info_container.md
docs/n2_info_content.md
docs/n2_info_notification_rsp_data.md
docs/n2_info_notify_reason.md
docs/n2_information_class.md
docs/n2_information_notification.md
docs/n2_information_transfer_error.md
docs/n2_information_transfer_req_data.md
docs/n2_information_transfer_result.md
docs/n2_information_transfer_rsp_data.md
docs/n2_ran_information.md
docs/n2_sm_information.md
docs/n3ga_location.md
docs/nas_security_mode.md
docs/ncgi.md
docs/nf_type.md
docs/ng_ap_cause.md
docs/ng_ksi.md
docs/ng_ran_target_id.md
docs/ngap_ie_type.md
docs/non_ue_n2_info_subscription_create_data.md
docs/non_ue_n2_info_subscription_created_data.md
docs/npn_access_info.md
docs/nr_location.md
docs/nr_v2x_auth.md
docs/nrppa_information.md
docs/nsi_information.md
docs/nssaa_status.md
docs/nssai_mapping.md
docs/pc5_flow_bit_rates.md
docs/pc5_qo_s_para.md
docs/pc5_qos_flow_item.md
docs/pdu_session_context.md
docs/periodic_communication_indicator.md
docs/plmn_id.md
docs/plmn_id_nid.md
docs/policy_req_trigger.md
docs/positioning_method_mdt.md
docs/preemption_capability.md
docs/preemption_vulnerability.md
docs/presence_info.md
docs/presence_state.md
docs/problem_details.md
docs/pws_error_data.md
docs/pws_information.md
docs/pws_response_data.md
docs/rat_selector.md
docs/rat_type.md
docs/reachability_filter.md
docs/reachability_filter_any_of.md
docs/redirect_response.md
docs/ref_to_binary_data.md
docs/registration_context_container.md
docs/report_amount_mdt.md
docs/report_interval_mdt.md
docs/report_interval_nr_mdt.md
docs/reporting_trigger.md
docs/restriction_type.md
docs/sbi_binding_level.md
docs/sc_type.md
docs/scheduled_communication_time.md
docs/scheduled_communication_type.md
docs/seaf_data.md
docs/sensor_measurement.md
docs/service_area_restriction.md
docs/small_data_rate_status.md
docs/small_data_rate_status_info.md
docs/smf_change_indication.md
docs/smf_change_info.md
docs/sms_support.md
docs/snssai.md
docs/stationary_indication.md
docs/status_change.md
docs/tac_info.md
docs/tai.md
docs/tnap_id.md
docs/trace_data.md
docs/trace_depth.md
docs/traffic_descriptor.md
docs/traffic_profile.md
docs/transfer_reason.md
docs/twap_id.md
docs/ue_auth.md
docs/ue_context.md
docs/ue_context_cancel_relocate_data.md
docs/ue_context_create_data.md
docs/ue_context_create_error.md
docs/ue_context_created_data.md
docs/ue_context_release.md
docs/ue_context_relocate_data.md
docs/ue_context_relocated_data.md
docs/ue_context_transfer_req_data.md
docs/ue_context_transfer_rsp_data.md
docs/ue_context_transfer_status.md
docs/ue_differentiation_info.md
docs/ue_n1_n2_info_subscription_create_data.md
docs/ue_n1_n2_info_subscription_created_data.md
docs/ue_reg_status_update_req_data.md
docs/ue_reg_status_update_rsp_data.md
docs/user_location.md
docs/v2x_context.md
docs/v2x_information.md
external/cJSON.c
external/cJSON.h
external/cJSON.licence
include/apiClient.h
include/binary.h
include/keyValuePair.h
include/list.h
libcurl.licence
model/access_token_err.c
model/access_token_err.h
model/access_token_req.c
model/access_token_req.h
model/access_type.c
model/access_type.h
model/allowed_nssai.c
model/allowed_nssai.h
model/allowed_snssai.c
model/allowed_snssai.h
model/ambr.c
model/ambr.h
model/amf_event.c
model/amf_event.h
model/amf_event_area.c
model/amf_event_area.h
model/amf_event_mode.c
model/amf_event_mode.h
model/amf_event_subscription.c
model/amf_event_subscription.h
model/amf_event_subscription_add_info.c
model/amf_event_subscription_add_info.h
model/amf_event_trigger.c
model/amf_event_trigger.h
model/amf_event_trigger_any_of.c
model/amf_event_trigger_any_of.h
model/amf_event_type.c
model/amf_event_type.h
model/amf_event_type_any_of.c
model/amf_event_type_any_of.h
model/amf_status_change_notification.c
model/amf_status_change_notification.h
model/amf_status_change_subscription_data.c
model/amf_status_change_subscription_data.h
model/amf_status_info.c
model/amf_status_info.h
model/area.c
model/area.h
model/area_of_validity.c
model/area_of_validity.h
model/area_scope.c
model/area_scope.h
model/arp.c
model/arp.h
model/assign_ebi_data.c
model/assign_ebi_data.h
model/assign_ebi_error.c
model/assign_ebi_error.h
model/assign_ebi_failed.c
model/assign_ebi_failed.h
model/assigned_ebi_data.c
model/assigned_ebi_data.h
model/auth_status.c
model/auth_status.h
model/battery_indication.c
model/battery_indication.h
model/cag_data.c
model/cag_data.h
model/cag_info.c
model/cag_info.h
model/ce_mode_b_ind.c
model/ce_mode_b_ind.h
model/ciphering_algorithm.c
model/ciphering_algorithm.h
model/cn_assisted_ran_para.c
model/cn_assisted_ran_para.h
model/collection_period_rmm_lte_mdt.c
model/collection_period_rmm_lte_mdt.h
model/collection_period_rmm_nr_mdt.c
model/collection_period_rmm_nr_mdt.h
model/configured_snssai.c
model/configured_snssai.h
model/core_network_type.c
model/core_network_type.h
model/ddd_traffic_descriptor.c
model/ddd_traffic_descriptor.h
model/ebi_arp_mapping.c
model/ebi_arp_mapping.h
model/ec_restriction_data_wb.c
model/ec_restriction_data_wb.h
model/ecgi.c
model/ecgi.h
model/eps_nas_ciphering_algorithm.c
model/eps_nas_ciphering_algorithm.h
model/eps_nas_integrity_algorithm.c
model/eps_nas_integrity_algorithm.h
model/eps_nas_security_mode.c
model/eps_nas_security_mode.h
model/eutra_location.c
model/eutra_location.h
model/expected_ue_behavior.c
model/expected_ue_behavior.h
model/ext_amf_event_subscription.c
model/ext_amf_event_subscription.h
model/global_ran_node_id.c
model/global_ran_node_id.h
model/gnb_id.c
model/gnb_id.h
model/guami.c
model/guami.h
model/hfc_node_id.c
model/hfc_node_id.h
model/immediate_mdt_conf.c
model/immediate_mdt_conf.h
model/inline_object.c
model/inline_object.h
model/inline_object_1.c
model/inline_object_1.h
model/inline_object_2.c
model/inline_object_2.h
model/inline_object_3.c
model/inline_object_3.h
model/inline_object_4.c
model/inline_object_4.h
model/integrity_algorithm.c
model/integrity_algorithm.h
model/invalid_param.c
model/invalid_param.h
model/job_type.c
model/job_type.h
model/key_amf.c
model/key_amf.h
model/key_amf_type.c
model/key_amf_type.h
model/ladn_info.c
model/ladn_info.h
model/line_type.c
model/line_type.h
model/location_filter.c
model/location_filter.h
model/location_filter_any_of.c
model/location_filter_any_of.h
model/lte_m_ind.c
model/lte_m_ind.h
model/lte_v2x_auth.c
model/lte_v2x_auth.h
model/measurement_lte_for_mdt.c
model/measurement_lte_for_mdt.h
model/measurement_nr_for_mdt.c
model/measurement_nr_for_mdt.h
model/measurement_period_lte_mdt.c
model/measurement_period_lte_mdt.h
model/mm_context.c
model/mm_context.h
model/mo_exp_data_counter.c
model/mo_exp_data_counter.h
model/n1_message_class.c
model/n1_message_class.h
model/n1_message_container.c
model/n1_message_container.h
model/n1_message_notification.c
model/n1_message_notification.h
model/n1_n2_message_transfer_cause.c
model/n1_n2_message_transfer_cause.h
model/n1_n2_message_transfer_error.c
model/n1_n2_message_transfer_error.h
model/n1_n2_message_transfer_req_data.c
model/n1_n2_message_transfer_req_data.h
model/n1_n2_message_transfer_rsp_data.c
model/n1_n2_message_transfer_rsp_data.h
model/n1_n2_msg_txfr_err_detail.c
model/n1_n2_msg_txfr_err_detail.h
model/n1_n2_msg_txfr_failure_notification.c
model/n1_n2_msg_txfr_failure_notification.h
model/n2_info_container.c
model/n2_info_container.h
model/n2_info_content.c
model/n2_info_content.h
model/n2_info_notification_rsp_data.c
model/n2_info_notification_rsp_data.h
model/n2_info_notify_reason.c
model/n2_info_notify_reason.h
model/n2_information_class.c
model/n2_information_class.h
model/n2_information_notification.c
model/n2_information_notification.h
model/n2_information_transfer_error.c
model/n2_information_transfer_error.h
model/n2_information_transfer_req_data.c
model/n2_information_transfer_req_data.h
model/n2_information_transfer_result.c
model/n2_information_transfer_result.h
model/n2_information_transfer_rsp_data.c
model/n2_information_transfer_rsp_data.h
model/n2_ran_information.c
model/n2_ran_information.h
model/n2_sm_information.c
model/n2_sm_information.h
model/n3ga_location.c
model/n3ga_location.h
model/nas_security_mode.c
model/nas_security_mode.h
model/ncgi.c
model/ncgi.h
model/nf_type.c
model/nf_type.h
model/ng_ap_cause.c
model/ng_ap_cause.h
model/ng_ksi.c
model/ng_ksi.h
model/ng_ran_target_id.c
model/ng_ran_target_id.h
model/ngap_ie_type.c
model/ngap_ie_type.h
model/non_ue_n2_info_subscription_create_data.c
model/non_ue_n2_info_subscription_create_data.h
model/non_ue_n2_info_subscription_created_data.c
model/non_ue_n2_info_subscription_created_data.h
model/npn_access_info.c
model/npn_access_info.h
model/nr_location.c
model/nr_location.h
model/nr_v2x_auth.c
model/nr_v2x_auth.h
model/nrppa_information.c
model/nrppa_information.h
model/nsi_information.c
model/nsi_information.h
model/nssaa_status.c
model/nssaa_status.h
model/nssai_mapping.c
model/nssai_mapping.h
model/object.c
model/object.h
model/pc5_flow_bit_rates.c
model/pc5_flow_bit_rates.h
model/pc5_qo_s_para.c
model/pc5_qo_s_para.h
model/pc5_qos_flow_item.c
model/pc5_qos_flow_item.h
model/pdu_session_context.c
model/pdu_session_context.h
model/periodic_communication_indicator.c
model/periodic_communication_indicator.h
model/plmn_id.c
model/plmn_id.h
model/plmn_id_nid.c
model/plmn_id_nid.h
model/policy_req_trigger.c
model/policy_req_trigger.h
model/positioning_method_mdt.c
model/positioning_method_mdt.h
model/preemption_capability.c
model/preemption_capability.h
model/preemption_vulnerability.c
model/preemption_vulnerability.h
model/presence_info.c
model/presence_info.h
model/presence_state.c
model/presence_state.h
model/problem_details.c
model/problem_details.h
model/pws_error_data.c
model/pws_error_data.h
model/pws_information.c
model/pws_information.h
model/pws_response_data.c
model/pws_response_data.h
model/rat_selector.c
model/rat_selector.h
model/rat_type.c
model/rat_type.h
model/reachability_filter.c
model/reachability_filter.h
model/reachability_filter_any_of.c
model/reachability_filter_any_of.h
model/redirect_response.c
model/redirect_response.h
model/ref_to_binary_data.c
model/ref_to_binary_data.h
model/registration_context_container.c
model/registration_context_container.h
model/report_amount_mdt.c
model/report_amount_mdt.h
model/report_interval_mdt.c
model/report_interval_mdt.h
model/report_interval_nr_mdt.c
model/report_interval_nr_mdt.h
model/reporting_trigger.c
model/reporting_trigger.h
model/restriction_type.c
model/restriction_type.h
model/sbi_binding_level.c
model/sbi_binding_level.h
model/sc_type.c
model/sc_type.h
model/scheduled_communication_time.c
model/scheduled_communication_time.h
model/scheduled_communication_type.c
model/scheduled_communication_type.h
model/seaf_data.c
model/seaf_data.h
model/sensor_measurement.c
model/sensor_measurement.h
model/service_area_restriction.c
model/service_area_restriction.h
model/small_data_rate_status.c
model/small_data_rate_status.h
model/small_data_rate_status_info.c
model/small_data_rate_status_info.h
model/smf_change_indication.c
model/smf_change_indication.h
model/smf_change_info.c
model/smf_change_info.h
model/sms_support.c
model/sms_support.h
model/snssai.c
model/snssai.h
model/stationary_indication.c
model/stationary_indication.h
model/status_change.c
model/status_change.h
model/tac_info.c
model/tac_info.h
model/tai.c
model/tai.h
model/tnap_id.c
model/tnap_id.h
model/trace_data.c
model/trace_data.h
model/trace_depth.c
model/trace_depth.h
model/traffic_descriptor.c
model/traffic_descriptor.h
model/traffic_profile.c
model/traffic_profile.h
model/transfer_reason.c
model/transfer_reason.h
model/twap_id.c
model/twap_id.h
model/ue_auth.c
model/ue_auth.h
model/ue_context.c
model/ue_context.h
model/ue_context_cancel_relocate_data.c
model/ue_context_cancel_relocate_data.h
model/ue_context_create_data.c
model/ue_context_create_data.h
model/ue_context_create_error.c
model/ue_context_create_error.h
model/ue_context_created_data.c
model/ue_context_created_data.h
model/ue_context_release.c
model/ue_context_release.h
model/ue_context_relocate_data.c
model/ue_context_relocate_data.h
model/ue_context_relocated_data.c
model/ue_context_relocated_data.h
model/ue_context_transfer_req_data.c
model/ue_context_transfer_req_data.h
model/ue_context_transfer_rsp_data.c
model/ue_context_transfer_rsp_data.h
model/ue_context_transfer_status.c
model/ue_context_transfer_status.h
model/ue_differentiation_info.c
model/ue_differentiation_info.h
model/ue_n1_n2_info_subscription_create_data.c
model/ue_n1_n2_info_subscription_create_data.h
model/ue_n1_n2_info_subscription_created_data.c
model/ue_n1_n2_info_subscription_created_data.h
model/ue_reg_status_update_req_data.c
model/ue_reg_status_update_req_data.h
model/ue_reg_status_update_rsp_data.c
model/ue_reg_status_update_rsp_data.h
model/user_location.c
model/user_location.h
model/v2x_context.c
model/v2x_context.h
model/v2x_information.c
model/v2x_information.h
src/apiClient.c
src/apiKey.c
src/binary.c
src/list.c
uncrustify-rules.cfg
unit-test/test_amf_event.c
unit-test/test_amf_event_area.c
unit-test/test_amf_event_mode.c
unit-test/test_amf_event_subscription.c
unit-test/test_amf_event_subscription_add_info.c
unit-test/test_amf_event_trigger.c
unit-test/test_amf_event_trigger_any_of.c
unit-test/test_amf_event_type.c
unit-test/test_amf_event_type_any_of.c
unit-test/test_amf_status_change_notification.c
unit-test/test_amf_status_change_subscription_data.c
unit-test/test_amf_status_info.c
unit-test/test_area_of_validity.c
unit-test/test_assign_ebi_data.c
unit-test/test_assign_ebi_error.c
unit-test/test_assign_ebi_failed.c
unit-test/test_assigned_ebi_data.c
unit-test/test_auth_status.c
unit-test/test_ce_mode_b_ind.c
unit-test/test_ciphering_algorithm.c
unit-test/test_eps_nas_ciphering_algorithm.c
unit-test/test_eps_nas_integrity_algorithm.c
unit-test/test_eps_nas_security_mode.c
unit-test/test_expected_ue_behavior.c
unit-test/test_ext_amf_event_subscription.c
unit-test/test_immediate_mdt_conf.c
unit-test/test_integrity_algorithm.c
unit-test/test_key_amf.c
unit-test/test_key_amf_type.c
unit-test/test_ladn_info.c
unit-test/test_location_filter.c
unit-test/test_location_filter_any_of.c
unit-test/test_lte_m_ind.c
unit-test/test_mm_context.c
unit-test/test_n1_message_container.c
unit-test/test_n1_message_notification.c
unit-test/test_n1_n2_message_transfer_cause.c
unit-test/test_n1_n2_message_transfer_error.c
unit-test/test_n1_n2_message_transfer_req_data.c
unit-test/test_n1_n2_message_transfer_rsp_data.c
unit-test/test_n1_n2_msg_txfr_err_detail.c
unit-test/test_n1_n2_msg_txfr_failure_notification.c
unit-test/test_n2_info_container.c
unit-test/test_n2_info_content.c
unit-test/test_n2_info_notification_rsp_data.c
unit-test/test_n2_info_notify_reason.c
unit-test/test_n2_information_notification.c
unit-test/test_n2_information_transfer_error.c
unit-test/test_n2_information_transfer_req_data.c
unit-test/test_n2_information_transfer_result.c
unit-test/test_n2_information_transfer_rsp_data.c
unit-test/test_n2_ran_information.c
unit-test/test_n2_sm_information.c
unit-test/test_nas_security_mode.c
unit-test/test_ng_ksi.c
unit-test/test_ngap_ie_type.c
unit-test/test_non_ue_n2_info_subscription_create_data.c
unit-test/test_non_ue_n2_info_subscription_created_data.c
unit-test/test_npn_access_info.c
unit-test/test_nrppa_information.c
unit-test/test_nssaa_status.c
unit-test/test_nssai_mapping.c
unit-test/test_pc5_flow_bit_rates.c
unit-test/test_pc5_qo_s_para.c
unit-test/test_pc5_qos_flow_item.c
unit-test/test_pdu_session_context.c
unit-test/test_periodic_communication_indicator.c
unit-test/test_policy_req_trigger.c
unit-test/test_pws_error_data.c
unit-test/test_pws_information.c
unit-test/test_pws_response_data.c
unit-test/test_rat_selector.c
unit-test/test_reachability_filter.c
unit-test/test_reachability_filter_any_of.c
unit-test/test_registration_context_container.c
unit-test/test_sc_type.c
unit-test/test_seaf_data.c
unit-test/test_small_data_rate_status_info.c
unit-test/test_smf_change_indication.c
unit-test/test_smf_change_info.c
unit-test/test_status_change.c
unit-test/test_traffic_descriptor.c
unit-test/test_transfer_reason.c
unit-test/test_ue_context.c
unit-test/test_ue_context_cancel_relocate_data.c
unit-test/test_ue_context_create_data.c
unit-test/test_ue_context_create_error.c
unit-test/test_ue_context_created_data.c
unit-test/test_ue_context_release.c
unit-test/test_ue_context_relocate_data.c
unit-test/test_ue_context_relocated_data.c
unit-test/test_ue_context_transfer_req_data.c
unit-test/test_ue_context_transfer_rsp_data.c
unit-test/test_ue_context_transfer_status.c
unit-test/test_ue_differentiation_info.c
unit-test/test_ue_n1_n2_info_subscription_create_data.c
unit-test/test_ue_n1_n2_info_subscription_created_data.c
unit-test/test_ue_reg_status_update_req_data.c
unit-test/test_ue_reg_status_update_rsp_data.c
unit-test/test_v2x_context.c
unit-test/test_v2x_information.c

View File

@ -1 +1 @@
4.3.1-SNAPSHOT
5.1.1

View File

@ -1,814 +0,0 @@
{{#models}}{{#model}}
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "{{classname}}.h"
{{#isEnum}}
char* OpenAPI_{{classname}}_ToString(OpenAPI_{{classVarName}}_e {{classname}})
{
const char *{{classname}}Array[] = { "NULL"{{#allowableValues}}{{#enumVars}}, "{{{value}}}"{{/enumVars}}{{/allowableValues}} };
size_t sizeofArray = sizeof({{classname}}Array) / sizeof({{classname}}Array[0]);
if ({{classname}} < sizeofArray)
return (char *){{classname}}Array[{{classname}}];
else
return (char *)"Unknown";
}
OpenAPI_{{classVarName}}_e OpenAPI_{{classname}}_FromString(char* {{classname}})
{
int stringToReturn = 0;
const char *{{classname}}Array[] = { "NULL"{{#allowableValues}}{{#enumVars}}, "{{{value}}}"{{/enumVars}}{{/allowableValues}} };
size_t sizeofArray = sizeof({{classname}}Array) / sizeof({{classname}}Array[0]);
while (stringToReturn < sizeofArray) {
if (strcmp({{classname}}, {{classname}}Array[stringToReturn]) == 0) {
return stringToReturn;
}
stringToReturn++;
}
return 0;
}
{{/isEnum}}
{{^isEnum}}
{{#vars}}
{{^isContainer}}
{{#isPrimitiveType}}
{{#isEnum}}
char *OpenAPI_{{name}}{{classname}}_ToString(OpenAPI_{{classVarName}}_{{name}}_e {{name}})
{
const char *{{name}}Array[] = { "NULL"{{#allowableValues}}{{#enumVars}}, "{{{value}}}"{{/enumVars}}{{/allowableValues}} };
size_t sizeofArray = sizeof({{name}}Array) / sizeof({{name}}Array[0]);
if ({{name}} < sizeofArray)
return (char *){{name}}Array[{{name}}];
else
return (char *)"Unknown";
}
OpenAPI_{{classVarName}}_{{name}}_e OpenAPI_{{name}}{{classname}}_FromString(char* {{name}})
{
int stringToReturn = 0;
const char *{{name}}Array[] = { "NULL"{{#allowableValues}}{{#enumVars}}, "{{{value}}}"{{/enumVars}}{{/allowableValues}} };
size_t sizeofArray = sizeof({{name}}Array) / sizeof({{name}}Array[0]);
while (stringToReturn < sizeofArray) {
if (strcmp({{name}}, {{name}}Array[stringToReturn]) == 0) {
return stringToReturn;
}
stringToReturn++;
}
return 0;
}
{{/isEnum}}
{{/isPrimitiveType}}
{{/isContainer}}
{{/vars}}
OpenAPI_{{classname}}_t *OpenAPI_{{classname}}_create(
{{#vars}}
{{^isContainer}}
{{^isPrimitiveType}}
{{#isEnum}}
OpenAPI_{{datatype}}_e {{name}}{{#hasMore}},{{/hasMore}}
{{/isEnum}}
{{^isEnum}}
{{#isModel}}
OpenAPI_{{datatype}}_t *{{name}}{{#hasMore}},{{/hasMore}}
{{/isModel}}
{{#isUuid}}
{{datatype}} *{{name}}{{#hasMore}},{{/hasMore}}
{{/isUuid}}
{{#isEmail}}
{{datatype}} *{{name}}{{#hasMore}},{{/hasMore}}
{{/isEmail}}
{{#isFreeFormObject}}
OpenAPI_{{datatype}}_t *{{name}}{{#hasMore}},{{/hasMore}}
{{/isFreeFormObject}}
{{/isEnum}}
{{/isPrimitiveType}}
{{#isPrimitiveType}}
{{#isEnum}}
OpenAPI_{{classVarName}}_{{name}}_e {{name}}{{#hasMore}},{{/hasMore}}
{{/isEnum}}
{{^isEnum}}
{{#isNumeric}}
{{datatype}} {{name}}{{#hasMore}},{{/hasMore}}
{{/isNumeric}}
{{#isBoolean}}
{{datatype}} {{name}}{{#hasMore}},{{/hasMore}}
{{/isBoolean}}
{{#isString}}
{{datatype}} *{{name}}{{#hasMore}},{{/hasMore}}
{{/isString}}
{{/isEnum}}
{{#isByteArray}}
{{datatype}} {{name}}{{#hasMore}},{{/hasMore}}
{{/isByteArray}}
{{#isBinary}}
OpenAPI_{{datatype}} {{name}}{{#hasMore}},{{/hasMore}}
{{/isBinary}}
{{#isDate}}
{{datatype}} *{{name}}{{#hasMore}},{{/hasMore}}
{{/isDate}}
{{#isDateTime}}
{{datatype}} *{{name}}{{#hasMore}},{{/hasMore}}
{{/isDateTime}}
{{/isPrimitiveType}}
{{/isContainer}}
{{#isContainer}}
{{#isListContainer}}
OpenAPI_{{datatype}}_t *{{name}}{{#hasMore}},{{/hasMore}}
{{/isListContainer}}
{{#isMapContainer}}
OpenAPI_{{datatype}} {{name}}{{#hasMore}},{{/hasMore}}
{{/isMapContainer}}
{{/isContainer}}
{{/vars}})
{
OpenAPI_{{classname}}_t *{{classname}}_local_var = OpenAPI_malloc(sizeof(OpenAPI_{{classname}}_t));
if (!{{classname}}_local_var) {
return NULL;
}
{{#vars}}
{{classname}}_local_var->{{{name}}} = {{{name}}};
{{/vars}}
return {{classname}}_local_var;
}
void OpenAPI_{{classname}}_free(OpenAPI_{{classname}}_t *{{classname}})
{
if (NULL == {{classname}}) {
return ;
}
OpenAPI_lnode_t *node;
{{#vars}}
{{^isContainer}}
{{^isPrimitiveType}}
{{^isEnum}}
{{#isModel}}
OpenAPI_{{{complexType}}}_free({{{classname}}}->{{{name}}});
{{/isModel}}
{{#isUuid}}
ogs_free({{{classname}}}->{{{name}}});
{{/isUuid}}
{{#isEmail}}
ogs_free({{{classname}}}->{{{name}}});
{{/isEmail}}
{{#isFreeFormObject}}
OpenAPI_object_free({{{classname}}}->{{{name}}});
{{/isFreeFormObject}}
{{/isEnum}}
{{/isPrimitiveType}}
{{#isPrimitiveType}}
{{^isEnum}}
{{#isString}}
ogs_free({{{classname}}}->{{{name}}});
{{/isString}}
{{/isEnum}}
{{#isBinary}}
ogs_free({{{classname}}}->{{{name}}}->data);
{{/isBinary}}
{{#isDate}}
ogs_free({{{classname}}}->{{{name}}});
{{/isDate}}
{{#isDateTime}}
ogs_free({{{classname}}}->{{{name}}});
{{/isDateTime}}
{{/isPrimitiveType}}
{{/isContainer}}
{{#isContainer}}
{{#isListContainer}}
{{#isPrimitiveType}}
{{^isEnum}}
OpenAPI_list_for_each({{classname}}->{{name}}, node) {
ogs_free(node->data);
}
{{/isEnum}}
OpenAPI_list_free({{classname}}->{{name}});
{{/isPrimitiveType}}
{{^isPrimitiveType}}
{{^isEnum}}
OpenAPI_list_for_each({{classname}}->{{name}}, node) {
OpenAPI_{{complexType}}_free(node->data);
}
{{/isEnum}}
OpenAPI_list_free({{classname}}->{{name}});
{{/isPrimitiveType}}
{{/isListContainer}}
{{#isMapContainer}}
{{#isPrimitiveType}}
OpenAPI_list_for_each({{classname}}->{{name}}, node) {
OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data;
ogs_free(localKeyValue->value);
ogs_free(localKeyValue);
}
OpenAPI_list_free({{classname}}->{{name}});
{{/isPrimitiveType}}
{{^isPrimitiveType}}
OpenAPI_list_for_each({{classname}}->{{name}}, node) {
OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data;
OpenAPI_{{complexType}}_free(localKeyValue->value);
ogs_free(localKeyValue);
}
OpenAPI_list_free({{classname}}->{{name}});
{{/isPrimitiveType}}
{{/isMapContainer}}
{{/isContainer}}
{{/vars}}
ogs_free({{classname}});
}
cJSON *OpenAPI_{{classname}}_convertToJSON(OpenAPI_{{classname}}_t *{{classname}})
{
cJSON *item = NULL;
if ({{classname}} == NULL) {
ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]");
return NULL;
}
item = cJSON_CreateObject();
{{#vars}}
{{^required}}
if ({{{classname}}}->{{{name}}}) {
{{/required}}
{{^isContainer}}
{{#isPrimitiveType}}
{{#isEnum}}
if (cJSON_AddStringToObject(item, "{{{baseName}}}", OpenAPI_{{{name}}}{{classname}}_ToString({{{classname}}}->{{{name}}})) == NULL) {
ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]");
goto end;
}
{{/isEnum}}
{{^isEnum}}
{{#isNumeric}}
if (cJSON_AddNumberToObject(item, "{{{baseName}}}", {{{classname}}}->{{{name}}}) == NULL) {
ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]");
goto end;
}
{{/isNumeric}}
{{#isBoolean}}
if (cJSON_AddBoolToObject(item, "{{{baseName}}}", {{{classname}}}->{{{name}}}) == NULL) {
ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]");
goto end;
}
{{/isBoolean}}
{{#isString}}
if (cJSON_AddStringToObject(item, "{{{baseName}}}", {{{classname}}}->{{{name}}}) == NULL) {
ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]");
goto end;
}
{{/isString}}
{{/isEnum}}
{{#isByteArray}}
if (cJSON_AddNumberToObject(item, "{{{baseName}}}", {{{classname}}}->{{{name}}}) == NULL) {
ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]");
goto end;
}
{{/isByteArray}}
{{#isBinary}}
char* encoded_str_{{{name}}} = OpenAPI_base64encode({{{classname}}}->{{{name}}}->data,{{{classname}}}->{{{name}}}->len);
if (cJSON_AddStringToObject(item, "{{{baseName}}}", encoded_str_{{{name}}}) == NULL) {
ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]");
goto end;
}
ogs_free(encoded_str_{{{name}}});
{{/isBinary}}
{{#isDate}}
if (cJSON_AddStringToObject(item, "{{{baseName}}}", {{{classname}}}->{{{name}}}) == NULL) {
ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]");
goto end;
}
{{/isDate}}
{{#isDateTime}}
if (cJSON_AddStringToObject(item, "{{{baseName}}}", {{{classname}}}->{{{name}}}) == NULL) {
ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]");
goto end;
}
{{/isDateTime}}
{{/isPrimitiveType}}
{{^isPrimitiveType}}
{{#isEnum}}
if (cJSON_AddStringToObject(item, "{{{baseName}}}", OpenAPI_{{{complexType}}}_ToString({{{classname}}}->{{{name}}})) == NULL) {
ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]");
goto end;
}
{{/isEnum}}
{{^isEnum}}
{{#isModel}}
cJSON *{{{name}}}_local_JSON = OpenAPI_{{complexType}}{{#isFreeFormObject}}object{{/isFreeFormObject}}_convertToJSON({{{classname}}}->{{{name}}});
if ({{{name}}}_local_JSON == NULL) {
ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]");
goto end;
}
cJSON_AddItemToObject(item, "{{{baseName}}}", {{{name}}}_local_JSON);
if (item->child == NULL) {
ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]");
goto end;
}
{{/isModel}}
{{#isUuid}}
if (cJSON_AddStringToObject(item, "{{{baseName}}}", {{{classname}}}->{{{name}}}) == NULL) {
ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]");
goto end;
}
{{/isUuid}}
{{#isEmail}}
if (cJSON_AddStringToObject(item, "{{{baseName}}}", {{{classname}}}->{{{name}}}) == NULL) {
ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]");
goto end;
}
{{/isEmail}}
{{#isFreeFormObject}}
cJSON *{{{name}}}_object = OpenAPI_object_convertToJSON({{{classname}}}->{{{name}}});
if ({{{name}}}_object == NULL) {
ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]");
goto end;
}
cJSON_AddItemToObject(item, "{{{baseName}}}", {{{name}}}_object);
if (item->child == NULL) {
ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]");
goto end;
}
{{/isFreeFormObject}}
{{/isEnum}}
{{/isPrimitiveType}}
{{/isContainer}}
{{#isContainer}}
{{#isListContainer}}
{{#isPrimitiveType}}
{{^isEnum}}
cJSON *{{{name}}} = cJSON_AddArrayToObject(item, "{{{baseName}}}");
if ({{{name}}} == NULL) {
ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]");
goto end;
}
OpenAPI_lnode_t *{{{name}}}_node;
OpenAPI_list_for_each({{{classname}}}->{{{name}}}, {{{name}}}_node) {
{{#items}}
{{#isString}}
if (cJSON_AddStringToObject({{{name}}}, "", (char*){{{name}}}_node->data) == NULL) {
ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]");
goto end;
}
{{/isString}}
{{#isBoolean}}
if (cJSON_AddBoolToObject({{{name}}}, "", *(cJSON_bool *){{{name}}}_node->data) == NULL) {
ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]");
goto end;
}
{{/isBoolean}}
{{#isNumeric}}
if (cJSON_AddNumberToObject({{{name}}}, "", *(double *){{{name}}}_node->data) == NULL) {
ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]");
goto end;
}
{{/isNumeric}}
{{/items}}
}
{{/isEnum}}
{{/isPrimitiveType}}
{{^isPrimitiveType}}
{{^isEnum}}
cJSON *{{{name}}}List = cJSON_AddArrayToObject(item, "{{{baseName}}}");
if ({{{name}}}List == NULL) {
ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]");
goto end;
}
OpenAPI_lnode_t *{{{name}}}_node;
if ({{{classname}}}->{{{name}}}) {
OpenAPI_list_for_each({{classname}}->{{{name}}}, {{{name}}}_node) {
cJSON *itemLocal = OpenAPI_{{complexType}}_convertToJSON({{#isEnum}}{{#items}}(intptr_t){{/items}}{{/isEnum}}{{{name}}}_node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]");
goto end;
}
cJSON_AddItemToArray({{{name}}}List, itemLocal);
}
}
{{/isEnum}}
{{#isEnum}}
cJSON *{{{name}}} = cJSON_AddArrayToObject(item, "{{{baseName}}}");
if ({{{name}}} == NULL) {
ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]");
goto end;
}
OpenAPI_lnode_t *{{{name}}}_node;
OpenAPI_list_for_each({{classname}}->{{{name}}}, {{{name}}}_node) {
if (cJSON_AddStringToObject({{{name}}}, "", OpenAPI_{{{complexType}}}_ToString((intptr_t){{{name}}}_node->data)) == NULL) {
ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]");
goto end;
}
}
{{/isEnum}}
{{/isPrimitiveType}}
{{/isListContainer}}
{{#isMapContainer}}
cJSON *{{{name}}} = cJSON_AddObjectToObject(item, "{{{baseName}}}");
if ({{{name}}} == NULL) {
ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]");
goto end;
}
cJSON *localMapObject = {{{name}}};
OpenAPI_lnode_t *{{{name}}}_node;
if ({{{classname}}}->{{{name}}}) {
OpenAPI_list_for_each({{{classname}}}->{{{name}}}, {{{name}}}_node) {
OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*){{{name}}}_node->data;
{{#isPrimitiveType}}
{{#isString}}
if (cJSON_AddStringToObject(localMapObject, localKeyValue->key, (char*)localKeyValue->value) == NULL) {
ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]");
goto end;
}
{{/isString}}
{{#isNumeric}}
if (cJSON_AddNumberToObject(localMapObject, localKeyValue->key, *(double *)localKeyValue->value) == NULL) {
ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]");
goto end;
}
{{/isNumeric}}
{{#isBoolean}}
if (cJSON_AddBoolToObject(localMapObject, localKeyValue->key, *(cJSON_bool *)localKeyValue->value) == NULL) {
ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]");
goto end;
}
{{/isBoolean}}
{{/isPrimitiveType}}
{{^isPrimitiveType}}
cJSON *itemLocal = OpenAPI_{{complexType}}_convertToJSON(localKeyValue->value);
if (itemLocal == NULL) {
ogs_error("OpenAPI_{{classname}}_convertToJSON() failed [{{{name}}}]");
goto end;
}
cJSON_AddItemToObject({{{name}}}, localKeyValue->key, itemLocal);
{{/isPrimitiveType}}
}
}
{{/isMapContainer}}
{{/isContainer}}
{{^required}}
}
{{/required}}
{{/vars}}
end:
return item;
}
OpenAPI_{{classname}}_t *OpenAPI_{{classname}}_parseFromJSON(cJSON *{{classname}}JSON)
{
OpenAPI_{{classname}}_t *{{classname}}_local_var = NULL;
{{#vars}}
cJSON *{{{name}}} = cJSON_GetObjectItemCaseSensitive({{classname}}JSON, "{{{baseName}}}");
{{#required}}
if (!{{{name}}}) {
ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]");
goto end;
}
{{/required}}
{{^isContainer}}
{{#isPrimitiveType}}
{{#isEnum}}
OpenAPI_{{classVarName}}_{{name}}_e {{name}}Variable;
{{^required}}if ({{{name}}}) { {{/required}}
if (!cJSON_IsString({{{name}}})) {
ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]");
goto end;
}
{{name}}Variable = OpenAPI_{{name}}{{classname}}_FromString({{{name}}}->valuestring);
{{/isEnum}}
{{^isEnum}}
{{#isNumeric}}
{{^required}}if ({{{name}}}) { {{/required}}
if (!cJSON_IsNumber({{{name}}})) {
ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]");
goto end;
}
{{/isNumeric}}
{{#isBoolean}}
{{^required}}if ({{{name}}}) { {{/required}}
if (!cJSON_IsBool({{{name}}})) {
ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]");
goto end;
}
{{/isBoolean}}
{{#isString}}
{{^required}}if ({{{name}}}) { {{/required}}
if (!cJSON_IsString({{{name}}})) {
ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]");
goto end;
}
{{/isString}}
{{/isEnum}}
{{#isByteArray}}
{{^required}}if ({{{name}}}) { {{/required}}
if (!cJSON_IsNumber({{{name}}})) {
ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]");
goto end;
}
{{/isByteArray}}
{{#isBinary}}
OpenAPI_binary_t* decoded_str_{{{name}}} = OpenAPI_malloc(sizeof(OpenAPI_binary_t));
{{^required}}if ({{{name}}}) { {{/required}}
if (!cJSON_IsString({{{name}}})) {
ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]");
goto end;
}
decoded_str_{{{name}}}->data = OpenAPI_base64decode({{{name}}}->valuestring, strlen({{{name}}}->valuestring), &decoded_str_{{{name}}}->len);
if (!decoded_str_{{{name}}}->data) {
ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]");
goto end;
}
{{/isBinary}}
{{#isDate}}
{{^required}}if ({{{name}}}) { {{/required}}
if (!cJSON_IsString({{{name}}})) {
ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]");
goto end;
}
{{/isDate}}
{{#isDateTime}}
{{^required}}if ({{{name}}}) { {{/required}}
if (!cJSON_IsString({{{name}}})) {
ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]");
goto end;
}
{{/isDateTime}}
{{/isPrimitiveType}}
{{^isPrimitiveType}}
{{#isEnum}}
OpenAPI_{{complexType}}_e {{name}}Variable;
{{^required}}if ({{{name}}}) { {{/required}}
if (!cJSON_IsString({{{name}}})) {
ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]");
goto end;
}
{{name}}Variable = OpenAPI_{{complexType}}_FromString({{{name}}}->valuestring);
{{/isEnum}}
{{^isEnum}}
{{#isModel}}
{{^isFreeFormObject}}OpenAPI_{{complexType}}{{/isFreeFormObject}}{{#isFreeFormObject}}OpenAPI_object{{/isFreeFormObject}}_t *{{name}}_local_nonprim = NULL;
{{^required}}if ({{{name}}}) { {{/required}}
{{{name}}}_local_nonprim = OpenAPI_{{complexType}}{{#isFreeFormObject}}object{{/isFreeFormObject}}_parseFromJSON({{{name}}});
{{/isModel}}
{{#isUuid}}
{{^required}}if ({{{name}}}) { {{/required}}
if (!cJSON_IsString({{{name}}})) {
ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]");
goto end;
}
{{/isUuid}}
{{#isEmail}}
{{^required}}if ({{{name}}}) { {{/required}}
if (!cJSON_IsString({{{name}}})) {
ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]");
goto end;
}
{{/isEmail}}
{{#isFreeFormObject}}
OpenAPI_object_t *{{name}}_local_object = NULL;
{{^required}}if ({{{name}}}) { {{/required}}
{{{name}}}_local_object = OpenAPI_object_parseFromJSON({{{name}}});
{{/isFreeFormObject}}
{{/isEnum}}
{{/isPrimitiveType}}
{{/isContainer}}
{{#isContainer}}
{{#isListContainer}}
{{#isPrimitiveType}}
{{^isEnum}}
OpenAPI_list_t *{{{name}}}List;
{{^required}}if ({{{name}}}) { {{/required}}
cJSON *{{{name}}}_local;
if (!cJSON_IsArray({{{name}}})) {
ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]");
goto end;
}
{{{name}}}List = OpenAPI_list_create();
cJSON_ArrayForEach({{{name}}}_local, {{{name}}}) {
{{#items}}
{{#isString}}
if (!cJSON_IsString({{{name}}}_local)) {
ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]");
goto end;
}
OpenAPI_list_add({{{name}}}List , ogs_strdup_or_assert({{{name}}}_local->valuestring));
{{/isString}}
{{#isNumeric}}
if (!cJSON_IsNumber({{{name}}}_local)) {
ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]");
goto end;
}
OpenAPI_list_add({{{name}}}List , &{{{name}}}_local->valuedouble);
{{/isNumeric}}
{{#isBoolean}}
if (!cJSON_IsBool({{{name}}}_local)) {
ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]");
goto end;
}
OpenAPI_list_add({{{name}}}List , {{{name}}}_local->valueint);
{{/isBoolean}}
{{/items}}
}
{{/isEnum}}
{{/isPrimitiveType}}
{{^isPrimitiveType}}
{{^isEnum}}
OpenAPI_list_t *{{{name}}}List;
{{^required}}if ({{{name}}}) { {{/required}}
cJSON *{{{name}}}_local_nonprimitive;
if (!cJSON_IsArray({{{name}}})){
ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]");
goto end;
}
{{{name}}}List = OpenAPI_list_create();
cJSON_ArrayForEach({{{name}}}_local_nonprimitive, {{{name}}} ) {
if (!cJSON_IsObject({{{name}}}_local_nonprimitive)) {
ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]");
goto end;
}
{{#isEnum}}{{#items}}{{datatypeWithEnum}}_e {{/items}}{{/isEnum}}{{^isEnum}}OpenAPI_{{complexType}}_t *{{/isEnum}}{{{name}}}Item = OpenAPI_{{complexType}}_parseFromJSON({{{name}}}_local_nonprimitive);
OpenAPI_list_add({{{name}}}List, {{#isEnum}}{{#items}}(void *){{/items}}{{/isEnum}}{{{name}}}Item);
}
{{/isEnum}}
{{#isEnum}}
OpenAPI_list_t *{{{name}}}List;
{{^required}}if ({{{name}}}) { {{/required}}
cJSON *{{{name}}}_local_nonprimitive;
if (!cJSON_IsArray({{{name}}})) {
ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]");
goto end;
}
{{{name}}}List = OpenAPI_list_create();
cJSON_ArrayForEach({{{name}}}_local_nonprimitive, {{{name}}} ) {
if (!cJSON_IsString({{{name}}}_local_nonprimitive)){
ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]");
goto end;
}
OpenAPI_list_add({{{name}}}List, (void *)OpenAPI_{{{complexType}}}_FromString({{{name}}}_local_nonprimitive->valuestring));
}
{{/isEnum}}
{{/isPrimitiveType}}
{{/isListContainer}}
{{#isMapContainer}}
OpenAPI_list_t *{{{name}}}List;
{{^required}}if ({{{name}}}) { {{/required}}
cJSON *{{{name}}}_local_map;
if (!cJSON_IsObject({{{name}}})) {
ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]");
goto end;
}
{{{name}}}List = OpenAPI_list_create();
OpenAPI_map_t *localMapKeyPair = NULL;
cJSON_ArrayForEach({{{name}}}_local_map, {{{name}}}) {
cJSON *localMapObject = {{{name}}}_local_map;
{{#isPrimitiveType}}
{{#isString}}
if (!cJSON_IsString(localMapObject)) {
ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]");
goto end;
}
localMapKeyPair = OpenAPI_map_create(ogs_strdup_or_assert(localMapObject->string),ogs_strdup_or_assert(localMapObject->valuestring));
{{/isString}}
{{#isBoolean}}
if (!cJSON_IsBool(localMapObject)) {
ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]");
goto end;
}
localMapKeyPair = OpenAPI_map_create(ogs_strdup_or_assert(localMapObject->string), &localMapObject->valueint);
{{/isBoolean}}
{{#isNumeric}}
if (!cJSON_IsNumber(localMapObject)) {
ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]");
goto end;
}
localMapKeyPair = OpenAPI_map_create(ogs_strdup_or_assert(localMapObject->string),&localMapObject->valuedouble );
{{/isNumeric}}
{{/isPrimitiveType}}
{{^isPrimitiveType}}
if (!cJSON_IsObject({{{name}}}_local_map)) {
ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]");
goto end;
}
localMapKeyPair = OpenAPI_map_create(
localMapObject->string, OpenAPI_{{complexType}}_parseFromJSON(localMapObject));
{{/isPrimitiveType}}
OpenAPI_list_add({{{name}}}List , localMapKeyPair);
}
{{/isMapContainer}}
{{/isContainer}}
{{^required}}
}
{{/required}}
{{/vars}}
{{classname}}_local_var = OpenAPI_{{classname}}_create (
{{#vars}}
{{^isContainer}}
{{^isPrimitiveType}}
{{#isEnum}}
{{^required}}{{{name}}} ? {{/required}}{{{name}}}Variable{{^required}} : 0{{/required}}{{#hasMore}},{{/hasMore}}
{{/isEnum}}
{{^isEnum}}
{{#isModel}}
{{^required}}{{{name}}} ? {{/required}}{{{name}}}_local_nonprim{{^required}} : NULL{{/required}}{{#hasMore}},{{/hasMore}}
{{/isModel}}
{{#isUuid}}
{{^required}}{{{name}}} ? {{/required}}ogs_strdup_or_assert({{{name}}}->valuestring){{^required}} : NULL{{/required}}{{#hasMore}},{{/hasMore}}
{{/isUuid}}
{{#isEmail}}
{{^required}}{{{name}}} ? {{/required}}ogs_strdup_or_assert({{{name}}}->valuestring){{^required}} : NULL{{/required}}{{#hasMore}},{{/hasMore}}
{{/isEmail}}
{{#isFreeFormObject}}
{{^required}}{{{name}}} ? {{/required}}{{{name}}}_local_object{{^required}} : NULL{{/required}}{{#hasMore}},{{/hasMore}}
{{/isFreeFormObject}}
{{/isEnum}}
{{/isPrimitiveType}}
{{#isPrimitiveType}}
{{#isEnum}}
{{^required}}{{{name}}} ? {{/required}}{{name}}Variable{{^required}} : 0{{/required}}{{#hasMore}},{{/hasMore}}
{{/isEnum}}
{{^isEnum}}
{{#isNumeric}}
{{^required}}{{{name}}} ? {{/required}}{{{name}}}->valuedouble{{^required}} : 0{{/required}}{{#hasMore}},{{/hasMore}}
{{/isNumeric}}
{{#isBoolean}}
{{^required}}{{{name}}} ? {{/required}}{{{name}}}->valueint{{^required}} : 0{{/required}}{{#hasMore}},{{/hasMore}}
{{/isBoolean}}
{{#isString}}
{{^required}}{{{name}}} ? {{/required}}ogs_strdup_or_assert({{{name}}}->valuestring){{^required}} : NULL{{/required}}{{#hasMore}},{{/hasMore}}
{{/isString}}
{{/isEnum}}
{{#isByteArray}}
{{^required}}{{{name}}} ? {{/required}}{{{name}}}->valueint{{^required}} : 0{{/required}}{{#hasMore}},{{/hasMore}}
{{/isByteArray}}
{{#isBinary}}
{{^required}}{{{name}}} ? {{/required}}decoded_str_{{{name}}}{{^required}} : NULL{{/required}}{{#hasMore}},{{/hasMore}}
{{/isBinary}}
{{#isDate}}
{{^required}}{{{name}}} ? {{/required}}ogs_strdup_or_assert({{{name}}}->valuestring){{^required}} : NULL{{/required}}{{#hasMore}},{{/hasMore}}
{{/isDate}}
{{#isDateTime}}
{{^required}}{{{name}}} ? {{/required}}ogs_strdup_or_assert({{{name}}}->valuestring){{^required}} : NULL{{/required}}{{#hasMore}},{{/hasMore}}
{{/isDateTime}}
{{/isPrimitiveType}}
{{/isContainer}}
{{#isContainer}}
{{#isListContainer}}
{{^required}}{{{name}}} ? {{/required}}{{{name}}}List{{^required}} : NULL{{/required}}{{#hasMore}},{{/hasMore}}
{{/isListContainer}}
{{#isMapContainer}}
{{^required}}{{{name}}} ? {{/required}}{{{name}}}List{{^required}} : NULL{{/required}}{{#hasMore}},{{/hasMore}}
{{/isMapContainer}}
{{/isContainer}}
{{/vars}}
);
return {{classname}}_local_var;
end:
return NULL;
}
OpenAPI_{{classname}}_t *OpenAPI_{{classname}}_copy(OpenAPI_{{classname}}_t *dst, OpenAPI_{{classname}}_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_{{classname}}_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_{{classname}}_convertToJSON() failed");
return NULL;
}
content = cJSON_Print(item);
cJSON_Delete(item);
if (!content) {
ogs_error("cJSON_Print() failed");
return NULL;
}
item = cJSON_Parse(content);
ogs_free(content);
if (!item) {
ogs_error("cJSON_Parse() failed");
return NULL;
}
OpenAPI_{{classname}}_free(dst);
dst = OpenAPI_{{classname}}_parseFromJSON(item);
cJSON_Delete(item);
return dst;
}
{{/isEnum}}
{{/model}}{{/models}}

File diff suppressed because it is too large Load Diff

View File

@ -1,24 +1,24 @@
/*
Copyright (c) 2009-2017 Dave Gamble and cJSON contributors
Copyright (c) 2009-2017 Dave Gamble and cJSON contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
/* cJSON */
/* JSON parser in C. */
@ -299,29 +299,29 @@ static cJSON_bool parse_number(cJSON * const item, parse_buffer * const input_bu
{
switch (buffer_at_offset(input_buffer)[i])
{
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
case '+':
case '-':
case 'e':
case 'E':
number_c_string[i] = buffer_at_offset(input_buffer)[i];
break;
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
case '+':
case '-':
case 'e':
case 'E':
number_c_string[i] = buffer_at_offset(input_buffer)[i];
break;
case '.':
number_c_string[i] = decimal_point;
break;
case '.':
number_c_string[i] = decimal_point;
break;
default:
goto loop_end;
default:
goto loop_end;
}
}
loop_end:
@ -776,39 +776,39 @@ static cJSON_bool parse_string(cJSON * const item, parse_buffer * const input_bu
switch (input_pointer[1])
{
case 'b':
*output_pointer++ = '\b';
break;
case 'f':
*output_pointer++ = '\f';
break;
case 'n':
*output_pointer++ = '\n';
break;
case 'r':
*output_pointer++ = '\r';
break;
case 't':
*output_pointer++ = '\t';
break;
case '\"':
case '\\':
case '/':
*output_pointer++ = input_pointer[1];
break;
case 'b':
*output_pointer++ = '\b';
break;
case 'f':
*output_pointer++ = '\f';
break;
case 'n':
*output_pointer++ = '\n';
break;
case 'r':
*output_pointer++ = '\r';
break;
case 't':
*output_pointer++ = '\t';
break;
case '\"':
case '\\':
case '/':
*output_pointer++ = input_pointer[1];
break;
/* UTF-16 literal */
case 'u':
sequence_length = utf16_literal_to_utf8(input_pointer, input_end, &output_pointer);
if (sequence_length == 0)
{
/* failed to convert UTF16-literal to UTF-8 */
/* UTF-16 literal */
case 'u':
sequence_length = utf16_literal_to_utf8(input_pointer, input_end, &output_pointer);
if (sequence_length == 0)
{
/* failed to convert UTF16-literal to UTF-8 */
goto fail;
}
break;
default:
goto fail;
}
break;
default:
goto fail;
}
input_pointer += sequence_length;
}
@ -872,23 +872,23 @@ static cJSON_bool print_string_ptr(const unsigned char * const input, printbuffe
{
switch (*input_pointer)
{
case '\"':
case '\\':
case '\b':
case '\f':
case '\n':
case '\r':
case '\t':
/* one character escape sequence */
escape_characters++;
break;
default:
if (*input_pointer < 32)
{
/* UTF-16 escape sequence uXXXX */
escape_characters += 5;
}
break;
case '\"':
case '\\':
case '\b':
case '\f':
case '\n':
case '\r':
case '\t':
/* one character escape sequence */
escape_characters++;
break;
default:
if (*input_pointer < 32)
{
/* UTF-16 escape sequence uXXXX */
escape_characters += 5;
}
break;
}
}
output_length = (size_t)(input_pointer - input) + escape_characters;
@ -926,32 +926,32 @@ static cJSON_bool print_string_ptr(const unsigned char * const input, printbuffe
*output_pointer++ = '\\';
switch (*input_pointer)
{
case '\\':
*output_pointer = '\\';
break;
case '\"':
*output_pointer = '\"';
break;
case '\b':
*output_pointer = 'b';
break;
case '\f':
*output_pointer = 'f';
break;
case '\n':
*output_pointer = 'n';
break;
case '\r':
*output_pointer = 'r';
break;
case '\t':
*output_pointer = 't';
break;
default:
/* escape and print as unicode codepoint */
sprintf((char*)output_pointer, "u%04x", *input_pointer);
output_pointer += 4;
break;
case '\\':
*output_pointer = '\\';
break;
case '\"':
*output_pointer = '\"';
break;
case '\b':
*output_pointer = 'b';
break;
case '\f':
*output_pointer = 'f';
break;
case '\n':
*output_pointer = 'n';
break;
case '\r':
*output_pointer = 'r';
break;
case '\t':
*output_pointer = 't';
break;
default:
/* escape and print as unicode codepoint */
sprintf((char*)output_pointer, "u%04x", *input_pointer);
output_pointer += 4;
break;
}
}
}
@ -985,7 +985,7 @@ static parse_buffer *buffer_skip_whitespace(parse_buffer * const buffer)
while (can_access_at_index(buffer, 0) && (buffer_at_offset(buffer)[0] <= 32))
{
buffer->offset++;
buffer->offset++;
}
if (buffer->offset == buffer->length)
@ -1291,65 +1291,65 @@ static cJSON_bool print_value(const cJSON * const item, printbuffer * const outp
switch ((item->type) & 0xFF)
{
case cJSON_NULL:
output = ensure(output_buffer, 5);
if (output == NULL)
{
return false;
}
strcpy((char*)output, "null");
return true;
case cJSON_NULL:
output = ensure(output_buffer, 5);
if (output == NULL)
{
return false;
}
strcpy((char*)output, "null");
return true;
case cJSON_False:
output = ensure(output_buffer, 6);
if (output == NULL)
{
return false;
}
strcpy((char*)output, "false");
return true;
case cJSON_False:
output = ensure(output_buffer, 6);
if (output == NULL)
{
return false;
}
strcpy((char*)output, "false");
return true;
case cJSON_True:
output = ensure(output_buffer, 5);
if (output == NULL)
{
return false;
}
strcpy((char*)output, "true");
return true;
case cJSON_True:
output = ensure(output_buffer, 5);
if (output == NULL)
{
return false;
}
strcpy((char*)output, "true");
return true;
case cJSON_Number:
return print_number(item, output_buffer);
case cJSON_Number:
return print_number(item, output_buffer);
case cJSON_Raw:
{
size_t raw_length = 0;
if (item->valuestring == NULL)
case cJSON_Raw:
{
return false;
size_t raw_length = 0;
if (item->valuestring == NULL)
{
return false;
}
raw_length = strlen(item->valuestring) + sizeof("");
output = ensure(output_buffer, raw_length);
if (output == NULL)
{
return false;
}
memcpy(output, item->valuestring, raw_length);
return true;
}
raw_length = strlen(item->valuestring) + sizeof("");
output = ensure(output_buffer, raw_length);
if (output == NULL)
{
case cJSON_String:
return print_string(item, output_buffer);
case cJSON_Array:
return print_array(item, output_buffer);
case cJSON_Object:
return print_object(item, output_buffer);
default:
return false;
}
memcpy(output, item->valuestring, raw_length);
return true;
}
case cJSON_String:
return print_string(item, output_buffer);
case cJSON_Array:
return print_array(item, output_buffer);
case cJSON_Object:
return print_object(item, output_buffer);
default:
return false;
}
}
@ -2504,7 +2504,7 @@ CJSON_PUBLIC(cJSON *) cJSON_CreateDoubleArray(const double *numbers, int count)
a = cJSON_CreateArray();
for(i = 0; a && (i < (size_t)count); i++)
for(i = 0;a && (i < (size_t)count); i++)
{
n = cJSON_CreateNumber(numbers[i]);
if(!n)
@ -2822,18 +2822,18 @@ CJSON_PUBLIC(cJSON_bool) cJSON_Compare(const cJSON * const a, const cJSON * cons
/* check if type is valid */
switch (a->type & 0xFF)
{
case cJSON_False:
case cJSON_True:
case cJSON_NULL:
case cJSON_Number:
case cJSON_String:
case cJSON_Raw:
case cJSON_Array:
case cJSON_Object:
break;
case cJSON_False:
case cJSON_True:
case cJSON_NULL:
case cJSON_Number:
case cJSON_String:
case cJSON_Raw:
case cJSON_Array:
case cJSON_Object:
break;
default:
return false;
default:
return false;
}
/* identical objects are equal */
@ -2844,96 +2844,96 @@ CJSON_PUBLIC(cJSON_bool) cJSON_Compare(const cJSON * const a, const cJSON * cons
switch (a->type & 0xFF)
{
/* in these cases and equal type is enough */
case cJSON_False:
case cJSON_True:
case cJSON_NULL:
return true;
case cJSON_Number:
if (a->valuedouble == b->valuedouble)
{
/* in these cases and equal type is enough */
case cJSON_False:
case cJSON_True:
case cJSON_NULL:
return true;
}
return false;
case cJSON_String:
case cJSON_Raw:
if ((a->valuestring == NULL) || (b->valuestring == NULL))
{
case cJSON_Number:
if (a->valuedouble == b->valuedouble)
{
return true;
}
return false;
}
if (strcmp(a->valuestring, b->valuestring) == 0)
case cJSON_String:
case cJSON_Raw:
if ((a->valuestring == NULL) || (b->valuestring == NULL))
{
return false;
}
if (strcmp(a->valuestring, b->valuestring) == 0)
{
return true;
}
return false;
case cJSON_Array:
{
cJSON *a_element = a->child;
cJSON *b_element = b->child;
for (; (a_element != NULL) && (b_element != NULL);)
{
if (!cJSON_Compare(a_element, b_element, case_sensitive))
{
return false;
}
a_element = a_element->next;
b_element = b_element->next;
}
/* one of the arrays is longer than the other */
if (a_element != b_element) {
return false;
}
return true;
}
return false;
case cJSON_Array:
{
cJSON *a_element = a->child;
cJSON *b_element = b->child;
for (; (a_element != NULL) && (b_element != NULL);)
case cJSON_Object:
{
if (!cJSON_Compare(a_element, b_element, case_sensitive))
cJSON *a_element = NULL;
cJSON *b_element = NULL;
cJSON_ArrayForEach(a_element, a)
{
return false;
/* TODO This has O(n^2) runtime, which is horrible! */
b_element = get_object_item(b, a_element->string, case_sensitive);
if (b_element == NULL)
{
return false;
}
if (!cJSON_Compare(a_element, b_element, case_sensitive))
{
return false;
}
}
a_element = a_element->next;
b_element = b_element->next;
/* doing this twice, once on a and b to prevent true comparison if a subset of b
* TODO: Do this the proper way, this is just a fix for now */
cJSON_ArrayForEach(b_element, b)
{
a_element = get_object_item(a, b_element->string, case_sensitive);
if (a_element == NULL)
{
return false;
}
if (!cJSON_Compare(b_element, a_element, case_sensitive))
{
return false;
}
}
return true;
}
/* one of the arrays is longer than the other */
if (a_element != b_element) {
default:
return false;
}
return true;
}
case cJSON_Object:
{
cJSON *a_element = NULL;
cJSON *b_element = NULL;
cJSON_ArrayForEach(a_element, a)
{
/* TODO This has O(n^2) runtime, which is horrible! */
b_element = get_object_item(b, a_element->string, case_sensitive);
if (b_element == NULL)
{
return false;
}
if (!cJSON_Compare(a_element, b_element, case_sensitive))
{
return false;
}
}
/* doing this twice, once on a and b to prevent true comparison if a subset of b
* TODO: Do this the proper way, this is just a fix for now */
cJSON_ArrayForEach(b_element, b)
{
a_element = get_object_item(a, b_element->string, case_sensitive);
if (a_element == NULL)
{
return false;
}
if (!cJSON_Compare(b_element, a_element, case_sensitive))
{
return false;
}
}
return true;
}
default:
return false;
}
}

View File

@ -1,24 +1,24 @@
/*
Copyright (c) 2009-2017 Dave Gamble and cJSON contributors
Copyright (c) 2009-2017 Dave Gamble and cJSON contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#ifndef cJSON__h
#define cJSON__h
@ -74,8 +74,8 @@ typedef struct cJSON
typedef struct cJSON_Hooks
{
void *(*malloc_fn)(size_t sz);
void (*free_fn)(void *ptr);
void *(*malloc_fn)(size_t sz);
void (*free_fn)(void *ptr);
} cJSON_Hooks;
typedef int cJSON_bool;
@ -87,21 +87,21 @@ typedef int cJSON_bool;
/* When compiling for windows, we specify a specific calling convention to avoid issues where we are being called from a project with a different default calling convention. For windows you have 2 define options:
CJSON_HIDE_SYMBOLS - Define this in the case where you don't want to ever dllexport symbols
CJSON_EXPORT_SYMBOLS - Define this on library build when you want to dllexport symbols (default)
CJSON_IMPORT_SYMBOLS - Define this if you want to dllimport symbol
CJSON_HIDE_SYMBOLS - Define this in the case where you don't want to ever dllexport symbols
CJSON_EXPORT_SYMBOLS - Define this on library build when you want to dllexport symbols (default)
CJSON_IMPORT_SYMBOLS - Define this if you want to dllimport symbol
For *nix builds that support visibility attribute, you can define similar behavior by
For *nix builds that support visibility attribute, you can define similar behavior by
setting default visibility to hidden by adding
-fvisibility=hidden (for gcc)
or
-xldscope=hidden (for sun cc)
to CFLAGS
setting default visibility to hidden by adding
-fvisibility=hidden (for gcc)
or
-xldscope=hidden (for sun cc)
to CFLAGS
then using the CJSON_API_VISIBILITY flag to "export" the same symbols the way CJSON_EXPORT_SYMBOLS does
then using the CJSON_API_VISIBILITY flag to "export" the same symbols the way CJSON_EXPORT_SYMBOLS does
*/
*/
/* export symbols by default, this is necessary for copy pasting the C and header file */
#if !defined(CJSON_HIDE_SYMBOLS) && !defined(CJSON_IMPORT_SYMBOLS) && !defined(CJSON_EXPORT_SYMBOLS)
@ -236,8 +236,8 @@ CJSON_PUBLIC(void) cJSON_ReplaceItemInObjectCaseSensitive(cJSON *object,const ch
/* Duplicate a cJSON item */
CJSON_PUBLIC(cJSON *) cJSON_Duplicate(const cJSON *item, cJSON_bool recurse);
/* Duplicate will create a new, identical cJSON item to the one you pass, in new memory that will
need to be released. With recurse!=0, it will duplicate any children connected to the item.
The item->next and ->prev pointers are always zero on return from Duplicate. */
need to be released. With recurse!=0, it will duplicate any children connected to the item.
The item->next and ->prev pointers are always zero on return from Duplicate. */
/* Recursively compare two cJSON items for equality. If either a or b is NULL or invalid, they will be considered unequal.
* case_sensitive determines if object keys are treated case sensitive (1) or case insensitive (0) */
CJSON_PUBLIC(cJSON_bool) cJSON_Compare(const cJSON * const a, const cJSON * const b, const cJSON_bool case_sensitive);

View File

@ -15,10 +15,10 @@ typedef struct OpenAPI_binary_s {
OpenAPI_binary_t *OpenAPI_instantiate_binary_t(char *data, int len);
char *OpenAPI_base64encode(const void *b64_encode_this,
int encode_this_many_bytes);
int encode_this_many_bytes);
char *OpenAPI_base64decode(const void *b64_decode_this,
int decode_this_many_bytes, int *decoded_bytes);
int decode_this_many_bytes, int *decoded_bytes);
#ifdef __cplusplus
}

View File

@ -38,15 +38,18 @@ void OpenAPI_list_remove(
OpenAPI_list_t *list, OpenAPI_lnode_t *elementToRemove);
void OpenAPI_list_iterate_forward(OpenAPI_list_t *list,
void (*operationToPerform)(OpenAPI_lnode_t*, void*),
void *additionalDataNeededForCallbackFunction);
void (*operationToPerform)(OpenAPI_lnode_t*, void*),
void *additionalDataNeededForCallbackFunction);
void OpenAPI_list_iterate_backward(OpenAPI_list_t *list,
void (*operationToPerform)(OpenAPI_lnode_t*, void*),
void *additionalDataNeededForCallbackFunction);
void (*operationToPerform)(OpenAPI_lnode_t*, void*),
void *additionalDataNeededForCallbackFunction);
void OpenAPI_lnode_print(OpenAPI_lnode_t *listEntry, void *additionalData);
void OpenAPI_lnode_free(OpenAPI_lnode_t *listEntry, void *additionalData);
char *OpenAPI_findStrInStrList(OpenAPI_list_t *strList, const char *str);
void OpenAPI_clear_and_free_string_list(OpenAPI_list_t *list);
#ifdef __cplusplus
}
#endif

View File

@ -21,16 +21,26 @@ libsbi_openapi_sources = files('''
src/binary.c
external/cJSON.c
model/acceptable_service_info.c
model/access_and_mobility_data.c
model/access_and_mobility_subscription_data_1.c
model/access_and_mobility_subscription_data.c
model/access_net_charging_identifier.c
model/access_network_id.c
model/access_right_status_any_of.c
model/access_right_status.c
model/access_tech_any_of.c
model/access_tech.c
model/access_token_err.c
model/access_token_req.c
model/access_type.c
model/access_type_rm.c
model/acc_net_charging_address.c
model/acc_net_ch_id.c
model/accumulated_usage.c
model/accu_usage_report.c
model/acknowledge_info.c
model/acs_info_1.c
model/acs_info.c
model/acs_info_rm.c
model/additional_access_info.c
@ -38,11 +48,19 @@ libsbi_openapi_sources = files('''
model/additional_snssai_data.c
model/af_event.c
model/af_event_exposure_data.c
model/af_event_notification.c
model/af_event_subscription.c
model/af_external.c
model/af_notif_method.c
model/af_requested_data.c
model/af_routing_requirement.c
model/af_routing_requirement_rm.c
model/af_sig_protocol.c
model/allowed_mtc_provider_info.c
model/allowed_nssai.c
model/allowed_snssai.c
model/alternative_qos_profile.c
model/ambr_1.c
model/ambr.c
model/ambr_rm.c
model/amf3_gpp_access_registration.c
@ -52,8 +70,11 @@ libsbi_openapi_sources = files('''
model/amf_event_area.c
model/amf_event.c
model/amf_event_mode.c
model/amf_event_subscription_add_info.c
model/amf_event_subscription.c
model/amf_event_trigger_any_of.c
model/amf_event_trigger.c
model/amf_event_type_any_of.c
model/amf_event_type.c
model/amf_info.c
model/amf_non3_gpp_access_registration.c
@ -71,16 +92,25 @@ libsbi_openapi_sources = files('''
model/application_data_change_notif.c
model/application_data_subs.c
model/app_port_id.c
model/app_session_context.c
model/app_session_context_req_data.c
model/app_session_context_resp_data.c
model/app_session_context_update_data.c
model/app_session_context_update_data_patch.c
model/area_1.c
model/area.c
model/area_of_validity.c
model/area_scope.c
model/arp_1.c
model/arp.c
model/assign_ebi_data.c
model/assign_ebi_error.c
model/assign_ebi_failed.c
model/assigned_ebi_data.c
model/association_type_any_of.c
model/association_type.c
model/atom.c
model/atsss_capability_any_of.c
model/atsss_capability.c
model/ausf_info.c
model/authentication_info.c
@ -94,9 +124,10 @@ libsbi_openapi_sources = files('''
model/authorized_default_qos.c
model/authorized_network_slice_info.c
model/auth_result.c
model/auth_status.c
model/auth_type.c
model/av5g_aka.c
model/av5_g_he_aka.c
model/av5_ghe_aka.c
model/av_eap_aka_prime.c
model/av_eps_aka.c
model/av_ims_gba_eap_aka.c
@ -105,23 +136,32 @@ libsbi_openapi_sources = files('''
model/battery_indication.c
model/battery_indication_rm.c
model/bdt_data.c
model/bdt_data_patch.c
model/bdt_policy_data.c
model/bdt_policy_data_patch.c
model/bdt_policy_status_any_of.c
model/bdt_policy_status.c
model/binding_level.c
model/binding_resp.c
model/bridge_management_container.c
model/bsf_info.c
model/cag_ack_data.c
model/cag_data_1.c
model/cag_data.c
model/cag_info_1.c
model/cag_info.c
model/candidate_for_replacement.c
model/cause.c
model/ce_mode_b_ind.c
model/change_item.c
model/change_type.c
model/charging_data.c
model/charging_information.c
model/chf_info.c
model/chf_service_info.c
model/ciphering_algorithm.c
model/civic_address.c
model/cm_info.c
model/cm_state_any_of.c
model/cm_state.c
model/cn_assisted_ran_para.c
model/cnf.c
@ -133,8 +173,6 @@ libsbi_openapi_sources = files('''
model/complex_query.c
model/condition_data.c
model/condition_event_type.c
model/configuration_parameters_eutra.c
model/configuration_parameters_nr.c
model/configured_snssai.c
model/confirmation_data.c
model/confirmation_data_response.c
@ -145,6 +183,7 @@ libsbi_openapi_sources = files('''
model/credit_management_status.c
model/data_change_notify.c
model/data_filter.c
model/data_ind_any_of.c
model/data_ind.c
model/datalink_reporting_configuration.c
model/data_set_id.c
@ -153,71 +192,101 @@ libsbi_openapi_sources = files('''
model/ddn_failure_sub_info.c
model/ddn_failure_subs.c
model/default_notification_subscription.c
model/default_unrelated_class_1.c
model/default_unrelated_class.c
model/deregistration_data.c
model/deregistration_info.c
model/deregistration_reason.c
model/dl_data_delivery_status.c
model/dnai_change_type.c
model/dnai_information.c
model/dnf.c
model/dnf_unit.c
model/dnn_configuration_1.c
model/dnn_configuration.c
model/dnn_info.c
model/dnn_route_selection_descriptor.c
model/dnn_selection_mode.c
model/dnn_smf_info_item.c
model/dnn_upf_info_item.c
model/domain_name_protocol_any_of.c
model/domain_name_protocol.c
model/downlink_data_notification_control.c
model/downlink_data_notification_control_rm.c
model/dynamic5_qi.c
model/eap_session.c
model/ebi_arp_mapping.c
model/ecgi_1.c
model/ecgi.c
model/ec_restriction.c
model/ec_restriction_data_wb.c
model/edrx_parameters_1.c
model/edrx_parameters.c
model/ee_group_profile_data.c
model/ee_profile_data.c
model/ee_subscription.c
model/ellipsoid_arc_all_of.c
model/ellipsoid_arc.c
model/emergency_info_1.c
model/emergency_info.c
model/enhanced_coverage_restriction_data.c
model/eps_bearer_info.c
model/eps_interworking_indication.c
model/eps_interworking_info.c
model/eps_iwk_pgw.c
model/eps_nas_ciphering_algorithm.c
model/eps_nas_integrity_algorithm.c
model/eps_nas_security_mode.c
model/eps_pdn_cnx_info.c
model/error_report.c
model/eth_flow_description.c
model/eutra_location.c
model/event_for_mdt.c
model/event_id_any_of.c
model/event_id.c
model/event_report_mode_any_of.c
model/event_report_mode.c
model/events_notification.c
model/events_subsc_put_data.c
model/events_subsc_req_data.c
model/events_subsc_req_data_rm.c
model/event_type_any_of.c
model/event_type.c
model/exemption_ind.c
model/expected_ue_behavior.c
model/expected_ue_behaviour.c
model/expected_ue_behaviour_data_1.c
model/expected_ue_behaviour_data.c
model/exposure_data_change_notification.c
model/exposure_data_subscription.c
model/ext_amf_event_subscription.c
model/extended_problem_details_all_of.c
model/extended_problem_details.c
model/external_client_type_any_of.c
model/external_client_type.c
model/external_unrelated_class.c
model/ext_problem_details.c
model/ext_snssai.c
model/failure_cause.c
model/failure_code.c
model/final_unit_action_any_of.c
model/final_unit_action.c
model/flow_direction.c
model/flow_info.c
model/flow_information.c
model/flows.c
model/flow_status.c
model/flow_usage.c
model/frame_route_info_1.c
model/frame_route_info.c
model/gad_shape.c
model/gbr_qos_flow_information.c
model/geographical_coordinates.c
model/geographic_area.c
model/global_ran_node_id_1.c
model/global_ran_node_id.c
model/gmlc_info.c
model/g_nb_id.c
model/gnb_id.c
model/group_identifiers.c
model/guami.c
model/guami_list_cond.c
@ -236,6 +305,7 @@ libsbi_openapi_sources = files('''
model/identity_data.c
model/identity_range.c
model/id_translation_result.c
model/immediate_mdt_conf.c
model/imsi_range.c
model/ims_vo_ps.c
model/indirect_data_forwarding_tunnel_info.c
@ -247,12 +317,16 @@ libsbi_openapi_sources = files('''
model/inline_response_200.c
model/integrity_algorithm.c
model/interface_upf_info_item.c
model/inter_freq_target_info_1.c
model/inter_freq_target_info.c
model/internal_group_id_range.c
model/invalid_param_1.c
model/invalid_param.c
model/ip_address_1.c
model/ip_address.c
model/ip_end_point.c
model/ip_multicast_address_info.c
model/ip_reachability.c
model/ip_sm_gw_registration.c
model/iptv_config_data.c
model/iptv_config_data_patch.c
@ -262,6 +336,7 @@ libsbi_openapi_sources = files('''
model/key_amf.c
model/key_amf_type.c
model/ladn_info.c
model/lcs_broadcast_assistance_types_data_1.c
model/lcs_broadcast_assistance_types_data.c
model/lcs_client_class.c
model/lcs_client_external.c
@ -269,14 +344,18 @@ libsbi_openapi_sources = files('''
model/lcs_mo_data.c
model/lcs_mo_service_class.c
model/lcs_privacy.c
model/lcs_privacy_data_1.c
model/lcs_privacy_data.c
model/limit_id_to_monitoring_key.c
model/line_type.c
model/link.c
model/links_value_schema.c
model/lmf_info.c
model/location_accuracy_any_of.c
model/location_accuracy.c
model/location_area_1.c
model/location_area.c
model/location_filter_any_of.c
model/location_filter.c
model/location_info.c
model/location_privacy_ind.c
@ -286,27 +365,39 @@ libsbi_openapi_sources = files('''
model/logging_interval_mdt.c
model/logging_interval_nr_mdt.c
model/loss_connectivity_cfg.c
model/lpi_1.c
model/lpi.c
model/lte_m_ind.c
model/lte_v2x_auth_1.c
model/lte_v2x_auth.c
model/ma_pdu_indication.c
model/mapping_of_snssai.c
model/ma_release_indication.c
model/max_integrity_protected_data_rate.c
model/mbsfn_area.c
model/mdt_configuration_1.c
model/mdt_configuration.c
model/mdt_user_consent.c
model/measurement_lte_for_mdt.c
model/measurement_nr_for_mdt.c
model/measurement_period_lte_mdt.c
model/media_component.c
model/media_component_resources_status.c
model/media_component_rm.c
model/media_sub_component.c
model/media_sub_component_rm.c
model/media_type.c
model/message_waiting_data.c
model/metering_method.c
model/mm_context.c
model/mme_capabilities.c
model/model_5_g_vn_group_configuration.c
model/model_5_g_vn_group_data.c
model/model_5_gvn_group_configuration.c
model/model_5_gvn_group_data.c
model/modification_notification.c
model/mo_exp_data_counter.c
model/monitoring_configuration.c
model/mtc_provider.c
model/multicast_access_control_any_of.c
model/multicast_access_control.c
model/n1_message_class.c
model/n1_message_container.c
@ -335,11 +426,14 @@ libsbi_openapi_sources = files('''
model/n4_information.c
model/n4_message_type.c
model/nas_security_mode.c
model/ncgi_1.c
model/ncgi.c
model/nef_cond.c
model/nef_info.c
model/network_area_info_2.c
model/net_loc_access_support.c
model/network_area_info_1.c
model/network_area_info.c
model/network_node_diameter_address_1.c
model/network_node_diameter_address.c
model/network_slice_cond.c
model/nf_group_cond.c
@ -359,6 +453,7 @@ libsbi_openapi_sources = files('''
model/ngap_ie_type.c
model/ng_ksi.c
model/ng_ran_target_id.c
model/nidd_information_1.c
model/nidd_information.c
model/node_type.c
model/non_dynamic5_qi.c
@ -367,33 +462,39 @@ libsbi_openapi_sources = files('''
model/notif_condition.c
model/notification_cause.c
model/notification_control.c
model/notification_control_indication.c
model/notification_data.c
model/notification_event_type.c
model/notification_item.c
model/notification_type.c
model/notify_item.c
model/npn_access_info.c
model/nrf_info.c
model/nr_location.c
model/nrppa_information.c
model/nr_v2x_auth_1.c
model/nr_v2x_auth.c
model/nsi_information.c
model/nssaa_status.c
model/nssai_1.c
model/nssai_ack_data.c
model/nssai.c
model/nssai_mapping.c
model/null_value.c
model/nwdaf_cond.c
model/nwdaf_event_any_of.c
model/nwdaf_event.c
model/nwdaf_info.c
model/object.c
model/odb_data.c
model/odb_packet_services.c
model/operation_mode.c
model/operator_managed.c
model/operator_specific_data_container.c
model/options_response.c
model/out_of_credit_information.c
model/packet_filter_info.c
model/parameter_over_pc5.c
model/parameter_over_uu.c
model/parameter_combination.c
model/partial_record_method_any_of.c
model/partial_record_method.c
model/partial_success_report.c
model/patch_item.c
@ -401,12 +502,15 @@ libsbi_openapi_sources = files('''
model/patch_result.c
model/pc5_flow_bit_rates.c
model/pc5_qos_flow_item.c
model/pc5_qos_mapping.c
model/pc5_qo_s_para.c
model/pcc_rule.c
model/pcf_binding.c
model/pcf_binding_patch.c
model/pcf_info.c
model/pcscf_info.c
model/pcscf_restoration_notification.c
model/pcscf_restoration_request_data.c
model/pdu_session_1.c
model/pdu_session.c
model/pdu_session_context.c
model/pdu_session_continuity_ind.c
@ -416,11 +520,16 @@ libsbi_openapi_sources = files('''
model/pdu_session_management_data.c
model/pdu_session_notify_item.c
model/pdu_session_rel_cause.c
model/pdu_session_status_any_of.c
model/pdu_session_status.c
model/pdu_session_status_cfg.c
model/pdu_session_tsn_bridge.c
model/pdu_session_type.c
model/pdu_session_types_1.c
model/pdu_session_types.c
model/pei_update_info.c
model/periodic_communication_indicator.c
model/periodicity_any_of.c
model/periodicity.c
model/pfd_change_notification.c
model/pfd_content.c
@ -428,13 +537,16 @@ libsbi_openapi_sources = files('''
model/pfd_data_for_app.c
model/pfd_data_for_app_ext_all_of.c
model/pfd_data_for_app_ext.c
model/pgw_info_1.c
model/pgw_info.c
model/plmn_ec_info.c
model/plmn_id_1.c
model/plmn_id.c
model/plmn_id_nid_1.c
model/plmn_id_nid.c
model/plmn_operator_class_1.c
model/plmn_operator_class.c
model/plmn_range.c
model/plmn_rat_served.c
model/plmn_route_selection_descriptor.c
model/plmn_snssai.c
model/point_all_of.c
@ -454,27 +566,34 @@ libsbi_openapi_sources = files('''
model/policy_control_request_trigger.c
model/policy_data_change_notification.c
model/policy_data_subscription.c
model/policy_decision_failure_code.c
model/policy_req_trigger.c
model/policy_update.c
model/polygon_all_of.c
model/polygon.c
model/port_management_container.c
model/positioning_method_mdt.c
model/pp5g_vn_group_profile_data.c
model/pp_active_time.c
model/pp_data.c
model/pp_dl_packet_count_ext.c
model/pp_maximum_latency.c
model/pp_maximum_response_time.c
model/pppp_to_pdb.c
model/pp_profile_data.c
model/pp_subs_reg_timer.c
model/preemption_capability.c
model/preemption_capability_rm.c
model/preemption_control_information.c
model/preemption_control_information_rm.c
model/preemption_vulnerability.c
model/preemption_vulnerability_rm.c
model/preferred_search.c
model/presence_info.c
model/presence_info_rm.c
model/presence_state.c
model/priority_sharing_indicator.c
model/privacy_check_related_action.c
model/privacy_parameter.c
model/problem_details_1.c
model/problem_details_2.c
model/problem_details_add_info.c
model/problem_details.c
@ -482,6 +601,7 @@ libsbi_openapi_sources = files('''
model/provisioned_data_sets.c
model/psa_indication.c
model/psa_information.c
model/ptw_parameters_1.c
model/ptw_parameters.c
model/pws_error_data.c
model/pws_information.c
@ -495,22 +615,29 @@ libsbi_openapi_sources = files('''
model/qos_flow_profile.c
model/qos_flow_release_request_item.c
model/qos_flow_setup_item.c
model/qos_flow_tunnel.c
model/qos_flow_usage.c
model/qos_flow_usage_report.c
model/qos_monitoring_data.c
model/qos_monitoring_info.c
model/qos_monitoring_information.c
model/qos_monitoring_information_rm.c
model/qos_monitoring_report.c
model/qos_monitoring_req.c
model/qos_notification_control_info.c
model/qos_notif_type.c
model/qos_resource_type.c
model/radio_parameter_not_served.c
model/ran_nas_rel_cause.c
model/rat_selector.c
model/rat_type.c
model/reachability_filter_any_of.c
model/reachability_filter.c
model/reachability_for_sms_configuration_any_of.c
model/reachability_for_sms_configuration.c
model/redirect_address_type.c
model/redirect_information.c
model/redirect_response.c
model/redundant_pdu_session_information.c
model/reflective_qo_s_attribute.c
model/ref_to_binary_data.c
model/registration_context_container.c
@ -537,7 +664,10 @@ libsbi_openapi_sources = files('''
model/request_indication.c
model/request_trigger.c
model/request_type.c
model/required_access_info.c
model/reserv_priority.c
model/resource_item.c
model/resources_allocation_info.c
model/resource_status.c
model/restriction_type.c
model/resynchronization_info.c
@ -546,16 +676,19 @@ libsbi_openapi_sources = files('''
model/rg_auth_ctx.c
model/rg_authentication_info.c
model/rm_info.c
model/rm_state_any_of.c
model/rm_state.c
model/roaming_charging_profile.c
model/roaming_indication.c
model/roaming_odb.c
model/route_information.c
model/route_to_location.c
model/rsn.c
model/rule_operation.c
model/rule_report.c
model/rule_status.c
model/sbi_binding_level.c
model/scheduled_communication_time_1.c
model/scheduled_communication_time.c
model/scheduled_communication_time_rm.c
model/scheduled_communication_type.c
@ -564,6 +697,7 @@ libsbi_openapi_sources = files('''
model/scp_domain_info.c
model/scp_info.c
model/sc_type.c
model/sdm_subscription_1.c
model/sdm_subscription.c
model/sdm_subs_modification.c
model/sd_range.c
@ -575,27 +709,27 @@ libsbi_openapi_sources = files('''
model/send_mo_data_req_data.c
model/sensor_measurement.c
model/sequence_number.c
model/service_application_server_address.c
model/serv_auth_info.c
model/service_area_restriction_1.c
model/service_area_restriction.c
model/service_id_to_frequency.c
model/service_id_to_layer2_id.c
model/service_id_to_pppr.c
model/service_info_status.c
model/service_name_cond.c
model/service_parameter_data.c
model/service_to_pdu_session.c
model/service_to_tx.c
model/service_parameter_data_patch.c
model/service_type_unrelated_class_1.c
model/service_type_unrelated_class.c
model/serving_nf_identity.c
model/session_management_subscription_data_1.c
model/session_management_subscription_data.c
model/session_rule.c
model/session_rule_failure_code.c
model/session_rule_report.c
model/shared_data.c
model/sign.c
model/sip_forking_indication.c
model/slice_info_for_pdu_session.c
model/slice_info_for_registration.c
model/slice_info_for_ue_configuration_update.c
model/slrb_configurations.c
model/small_data_rate_status.c
model/small_data_rate_status_info.c
model/sm_context.c
@ -617,7 +751,10 @@ libsbi_openapi_sources = files('''
model/smf_registration.c
model/smf_registration_info.c
model/smf_selection_data.c
model/smf_selection_subscription_data_1.c
model/smf_selection_subscription_data.c
model/smf_subscription_info.c
model/smf_subscription_item.c
model/sm_policy_association_release_cause.c
model/sm_policy_context_data.c
model/sm_policy_control.c
@ -632,9 +769,12 @@ libsbi_openapi_sources = files('''
model/sm_policy_snssai_data_patch.c
model/sm_policy_update_context_data.c
model/smsc_data.c
model/smsf_info_1.c
model/smsf_info.c
model/smsf_registration.c
model/sms_management_subscription_data_1.c
model/sms_management_subscription_data.c
model/sms_subscription_data_1.c
model/sms_subscription_data.c
model/sms_support.c
model/snssai.c
@ -644,12 +784,17 @@ libsbi_openapi_sources = files('''
model/snssai_smf_info_item.c
model/snssai_upf_info_item.c
model/sor_data.c
model/sor_info_1.c
model/sor_info.c
model/sor_update_indicator.c
model/sor_update_info.c
model/spatial_validity.c
model/spatial_validity_rm.c
model/sponsor_connectivity_data.c
model/sponsoring_status.c
model/sqn_scheme.c
model/ssc_mode.c
model/ssc_modes_1.c
model/ssc_modes.c
model/stationary_indication.c
model/stationary_indication_rm.c
@ -662,26 +807,35 @@ libsbi_openapi_sources = files('''
model/steering_mode.c
model/steer_mode_value.c
model/stored_search_result.c
model/subscribed_default_qos_1.c
model/subscribed_default_qos.c
model/subscribed_event_any_of.c
model/subscribed_event.c
model/subscribed_snssai.c
model/subscription_data.c
model/subscription_data_sets_1.c
model/subscription_data_sets.c
model/subscription_data_subscr_cond.c
model/subscription_data_subscriptions.c
model/suggested_packet_num_dl_1.c
model/suggested_packet_num_dl.c
model/supi_range.c
model/supported_gad_shapes_any_of.c
model/supported_gad_shapes.c
model/tac_info.c
model/tac_range.c
model/tai_1.c
model/tai.c
model/tai_range.c
model/temporal_validity.c
model/termination_cause.c
model/termination_info.c
model/termination_notification.c
model/time_period.c
model/time_window.c
model/tnap_id.c
model/tngf_info.c
model/trace_data_1.c
model/trace_data.c
model/trace_data_response.c
model/trace_depth.c
@ -701,12 +855,15 @@ libsbi_openapi_sources = files('''
model/transfer_reason.c
model/transport_protocol.c
model/trigger.c
model/trigger_category_any_of.c
model/trigger_category.c
model/trigger_request.c
model/trigger_type_any_of.c
model/trigger_type.c
model/tscai_input_container.c
model/tsn_bridge_info.c
model/tsn_port_identifier.c
model/tsn_qos_container.c
model/tsn_qos_container_rm.c
model/tunnel_info.c
model/twap_id.c
model/twif_info.c
@ -714,26 +871,34 @@ libsbi_openapi_sources = files('''
model/udr_info.c
model/udsf_info.c
model/ue_auth.c
model/ue_authentication_ctx.c
model/ue_camping_rep.c
model/ue_context.c
model/ue_context_cancel_relocate_data.c
model/ue_context_create_data.c
model/ue_context_created_data.c
model/ue_context_create_error.c
model/ue_context_in_amf_data_1.c
model/ue_context_in_amf_data.c
model/ue_context_in_smf_data_1.c
model/ue_context_in_smf_data.c
model/ue_context_in_smsf_data_1.c
model/ue_context_in_smsf_data.c
model/ue_context_release.c
model/ue_context_relocate_data.c
model/ue_context_relocated_data.c
model/ue_context_transfer_req_data.c
model/ue_context_transfer_rsp_data.c
model/ue_context_transfer_status.c
model/ue_differentiation_info.c
model/ue_id.c
model/ue_identity_info.c
model/ue_initiated_resource_request.c
model/ue_n1_n2_info_subscription_create_data.c
model/ue_n1_n2_info_subscription_created_data.c
model/ue_policy_section.c
model/ue_policy_set.c
model/ue_policy_set_patch.c
model/ue_reachability_any_of.c
model/ue_reachability.c
model/ue_reg_status_update_req_data.c
model/ue_reg_status_update_rsp_data.c
@ -741,6 +906,7 @@ libsbi_openapi_sources = files('''
model/ulcl_bp_information.c
model/unavailable_access_indication.c
model/uncertainty_ellipse.c
model/unrelated_class_1.c
model/unrelated_class.c
model/up_cnx_state.c
model/up_confidentiality.c
@ -750,23 +916,30 @@ libsbi_openapi_sources = files('''
model/up_integrity.c
model/up_interface_type.c
model/up_path_chg_event.c
model/up_security_1.c
model/up_security.c
model/up_security_info.c
model/upu_data_1.c
model/upu_data_2.c
model/upu_data.c
model/upu_info_1.c
model/upu_info.c
model/uri_scheme.c
model/usage_mon_data.c
model/usage_mon_data_limit.c
model/usage_mon_data_scope.c
model/usage_monitoring_data.c
model/usage_mon_level_any_of.c
model/usage_mon_level.c
model/usage_threshold.c
model/usage_threshold_rm.c
model/user_identifier.c
model/user_location.c
model/v2x_context.c
model/v2x_rat_type.c
model/v2x_information.c
model/v2x_subscription_data_1.c
model/v2x_subscription_data.c
model/valid_time_period_1.c
model/valid_time_period.c
model/vendor_specific_feature.c
model/vgmlc_address.c
@ -777,65 +950,10 @@ libsbi_openapi_sources = files('''
model/vsmf_updated_data.c
model/vsmf_update_error.c
model/w_agf_info.c
model/wireline_area_1.c
model/wireline_area.c
model/wireline_service_area_restriction_1.c
model/wireline_service_area_restriction.c
model/acceptable_service_info.c
model/access_net_charging_identifier.c
model/accumulated_usage.c
model/af_event_notification.c
model/af_event_subscription.c
model/af_notif_method.c
model/af_requested_data.c
model/af_routing_requirement.c
model/af_routing_requirement_rm.c
model/app_session_context.c
model/app_session_context_req_data.c
model/app_session_context_resp_data.c
model/app_session_context_update_data.c
model/binding_level.c
model/binding_resp.c
model/events_notification.c
model/events_subsc_req_data.c
model/events_subsc_req_data_rm.c
model/extended_problem_details.c
model/extended_problem_details_all_of.c
model/flow_usage.c
model/flows.c
model/media_component.c
model/media_component_resources_status.c
model/media_component_rm.c
model/media_sub_component.c
model/media_sub_component_rm.c
model/media_type.c
model/new_tsn_bridge.c
model/out_of_credit_information.c
model/parameter_combination.c
model/pcf_binding.c
model/pcf_binding_patch.c
model/pcscf_restoration_request_data.c
model/preemption_capability_rm.c
model/preemption_control_information.c
model/preemption_control_information_rm.c
model/preemption_vulnerability_rm.c
model/priority_sharing_indicator.c
model/qos_monitoring_information.c
model/qos_monitoring_information_rm.c
model/required_access_info.c
model/reserv_priority.c
model/resources_allocation_info.c
model/serv_auth_info.c
model/service_info_status.c
model/sip_forking_indication.c
model/spatial_validity.c
model/spatial_validity_rm.c
model/sponsoring_status.c
model/termination_cause.c
model/termination_info.c
model/tsn_qos_container.c
model/tsn_qos_container_rm.c
model/ue_identity_info.c
model/usage_threshold_rm.c
'''.split())
libsbi_openapi_inc = include_directories('.')

View File

@ -8,7 +8,7 @@ OpenAPI_acc_net_ch_id_t *OpenAPI_acc_net_ch_id_create(
int acc_net_cha_id_value,
OpenAPI_list_t *ref_pcc_rule_ids,
int session_ch_scope
)
)
{
OpenAPI_acc_net_ch_id_t *acc_net_ch_id_local_var = OpenAPI_malloc(sizeof(OpenAPI_acc_net_ch_id_t));
if (!acc_net_ch_id_local_var) {
@ -50,26 +50,26 @@ 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) {
ogs_error("OpenAPI_acc_net_ch_id_convertToJSON() failed [ref_pcc_rule_ids]");
goto end;
}
cJSON *ref_pcc_rule_ids = cJSON_AddArrayToObject(item, "refPccRuleIds");
if (ref_pcc_rule_ids == 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_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;
}
}
}
if (acc_net_ch_id->session_ch_scope) {
if (cJSON_AddBoolToObject(item, "sessionChScope", acc_net_ch_id->session_ch_scope) == NULL) {
ogs_error("OpenAPI_acc_net_ch_id_convertToJSON() failed [session_ch_scope]");
goto end;
}
if (cJSON_AddBoolToObject(item, "sessionChScope", acc_net_ch_id->session_ch_scope) == NULL) {
ogs_error("OpenAPI_acc_net_ch_id_convertToJSON() failed [session_ch_scope]");
goto end;
}
}
end:
@ -85,7 +85,7 @@ OpenAPI_acc_net_ch_id_t *OpenAPI_acc_net_ch_id_parseFromJSON(cJSON *acc_net_ch_i
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;
@ -94,37 +94,37 @@ OpenAPI_acc_net_ch_id_t *OpenAPI_acc_net_ch_id_parseFromJSON(cJSON *acc_net_ch_i
cJSON *ref_pcc_rule_ids = cJSON_GetObjectItemCaseSensitive(acc_net_ch_idJSON, "refPccRuleIds");
OpenAPI_list_t *ref_pcc_rule_idsList;
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_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_or_assert(ref_pcc_rule_ids_local->valuestring));
}
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_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_or_assert(ref_pcc_rule_ids_local->valuestring));
}
}
cJSON *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]");
goto end;
}
if (session_ch_scope) {
if (!cJSON_IsBool(session_ch_scope)) {
ogs_error("OpenAPI_acc_net_ch_id_parseFromJSON() failed [session_ch_scope]");
goto end;
}
}
acc_net_ch_id_local_var = OpenAPI_acc_net_ch_id_create (
acc_net_cha_id_value->valuedouble,
ref_pcc_rule_ids ? ref_pcc_rule_idsList : NULL,
session_ch_scope ? session_ch_scope->valueint : 0
);
);
return acc_net_ch_id_local_var;
end:

View File

@ -1,7 +1,7 @@
/*
* acc_net_ch_id.h
*
*
*
*/
#ifndef _OpenAPI_acc_net_ch_id_H_
@ -28,7 +28,7 @@ OpenAPI_acc_net_ch_id_t *OpenAPI_acc_net_ch_id_create(
int acc_net_cha_id_value,
OpenAPI_list_t *ref_pcc_rule_ids,
int session_ch_scope
);
);
void OpenAPI_acc_net_ch_id_free(OpenAPI_acc_net_ch_id_t *acc_net_ch_id);
OpenAPI_acc_net_ch_id_t *OpenAPI_acc_net_ch_id_parseFromJSON(cJSON *acc_net_ch_idJSON);
cJSON *OpenAPI_acc_net_ch_id_convertToJSON(OpenAPI_acc_net_ch_id_t *acc_net_ch_id);

View File

@ -7,7 +7,7 @@
OpenAPI_acc_net_charging_address_t *OpenAPI_acc_net_charging_address_create(
char *an_charg_ipv4_addr,
char *an_charg_ipv6_addr
)
)
{
OpenAPI_acc_net_charging_address_t *acc_net_charging_address_local_var = OpenAPI_malloc(sizeof(OpenAPI_acc_net_charging_address_t));
if (!acc_net_charging_address_local_var) {
@ -41,17 +41,17 @@ cJSON *OpenAPI_acc_net_charging_address_convertToJSON(OpenAPI_acc_net_charging_a
item = cJSON_CreateObject();
if (acc_net_charging_address->an_charg_ipv4_addr) {
if (cJSON_AddStringToObject(item, "anChargIpv4Addr", acc_net_charging_address->an_charg_ipv4_addr) == NULL) {
ogs_error("OpenAPI_acc_net_charging_address_convertToJSON() failed [an_charg_ipv4_addr]");
goto end;
}
if (cJSON_AddStringToObject(item, "anChargIpv4Addr", acc_net_charging_address->an_charg_ipv4_addr) == NULL) {
ogs_error("OpenAPI_acc_net_charging_address_convertToJSON() failed [an_charg_ipv4_addr]");
goto end;
}
}
if (acc_net_charging_address->an_charg_ipv6_addr) {
if (cJSON_AddStringToObject(item, "anChargIpv6Addr", acc_net_charging_address->an_charg_ipv6_addr) == NULL) {
ogs_error("OpenAPI_acc_net_charging_address_convertToJSON() failed [an_charg_ipv6_addr]");
goto end;
}
if (cJSON_AddStringToObject(item, "anChargIpv6Addr", acc_net_charging_address->an_charg_ipv6_addr) == NULL) {
ogs_error("OpenAPI_acc_net_charging_address_convertToJSON() failed [an_charg_ipv6_addr]");
goto end;
}
}
end:
@ -63,26 +63,26 @@ OpenAPI_acc_net_charging_address_t *OpenAPI_acc_net_charging_address_parseFromJS
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");
if (an_charg_ipv4_addr) {
if (!cJSON_IsString(an_charg_ipv4_addr)) {
ogs_error("OpenAPI_acc_net_charging_address_parseFromJSON() failed [an_charg_ipv4_addr]");
goto end;
}
if (an_charg_ipv4_addr) {
if (!cJSON_IsString(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");
if (an_charg_ipv6_addr) {
if (!cJSON_IsString(an_charg_ipv6_addr)) {
ogs_error("OpenAPI_acc_net_charging_address_parseFromJSON() failed [an_charg_ipv6_addr]");
goto end;
}
if (an_charg_ipv6_addr) {
if (!cJSON_IsString(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_or_assert(an_charg_ipv4_addr->valuestring) : NULL,
an_charg_ipv6_addr ? ogs_strdup_or_assert(an_charg_ipv6_addr->valuestring) : NULL
);
);
return acc_net_charging_address_local_var;
end:

View File

@ -26,7 +26,7 @@ typedef struct OpenAPI_acc_net_charging_address_s {
OpenAPI_acc_net_charging_address_t *OpenAPI_acc_net_charging_address_create(
char *an_charg_ipv4_addr,
char *an_charg_ipv6_addr
);
);
void OpenAPI_acc_net_charging_address_free(OpenAPI_acc_net_charging_address_t *acc_net_charging_address);
OpenAPI_acc_net_charging_address_t *OpenAPI_acc_net_charging_address_parseFromJSON(cJSON *acc_net_charging_addressJSON);
cJSON *OpenAPI_acc_net_charging_address_convertToJSON(OpenAPI_acc_net_charging_address_t *acc_net_charging_address);

View File

@ -8,7 +8,7 @@ OpenAPI_acceptable_service_info_t *OpenAPI_acceptable_service_info_create(
OpenAPI_list_t* acc_bw_med_comps,
char *mar_bw_ul,
char *mar_bw_dl
)
)
{
OpenAPI_acceptable_service_info_t *acceptable_service_info_local_var = OpenAPI_malloc(sizeof(OpenAPI_acceptable_service_info_t));
if (!acceptable_service_info_local_var) {
@ -49,38 +49,38 @@ cJSON *OpenAPI_acceptable_service_info_convertToJSON(OpenAPI_acceptable_service_
item = cJSON_CreateObject();
if (acceptable_service_info->acc_bw_med_comps) {
cJSON *acc_bw_med_comps = cJSON_AddObjectToObject(item, "accBwMedComps");
if (acc_bw_med_comps == NULL) {
cJSON *acc_bw_med_comps = cJSON_AddObjectToObject(item, "accBwMedComps");
if (acc_bw_med_comps == NULL) {
ogs_error("OpenAPI_acceptable_service_info_convertToJSON() failed [acc_bw_med_comps]");
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 = OpenAPI_media_component_convertToJSON(localKeyValue->value);
if (itemLocal == NULL) {
ogs_error("OpenAPI_acceptable_service_info_convertToJSON() failed [acc_bw_med_comps]");
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 = OpenAPI_media_component_convertToJSON(localKeyValue->value);
if (itemLocal == NULL) {
ogs_error("OpenAPI_acceptable_service_info_convertToJSON() failed [acc_bw_med_comps]");
goto end;
}
cJSON_AddItemToObject(acc_bw_med_comps, localKeyValue->key, itemLocal);
cJSON_AddItemToObject(acc_bw_med_comps, localKeyValue->key, itemLocal);
}
}
}
if (acceptable_service_info->mar_bw_ul) {
if (cJSON_AddStringToObject(item, "marBwUl", acceptable_service_info->mar_bw_ul) == NULL) {
ogs_error("OpenAPI_acceptable_service_info_convertToJSON() failed [mar_bw_ul]");
goto end;
}
if (cJSON_AddStringToObject(item, "marBwUl", acceptable_service_info->mar_bw_ul) == NULL) {
ogs_error("OpenAPI_acceptable_service_info_convertToJSON() failed [mar_bw_ul]");
goto end;
}
}
if (acceptable_service_info->mar_bw_dl) {
if (cJSON_AddStringToObject(item, "marBwDl", acceptable_service_info->mar_bw_dl) == NULL) {
ogs_error("OpenAPI_acceptable_service_info_convertToJSON() failed [mar_bw_dl]");
goto end;
}
if (cJSON_AddStringToObject(item, "marBwDl", acceptable_service_info->mar_bw_dl) == NULL) {
ogs_error("OpenAPI_acceptable_service_info_convertToJSON() failed [mar_bw_dl]");
goto end;
}
}
end:
@ -93,49 +93,49 @@ OpenAPI_acceptable_service_info_t *OpenAPI_acceptable_service_info_parseFromJSON
cJSON *acc_bw_med_comps = cJSON_GetObjectItemCaseSensitive(acceptable_service_infoJSON, "accBwMedComps");
OpenAPI_list_t *acc_bw_med_compsList;
if (acc_bw_med_comps) {
cJSON *acc_bw_med_comps_local_map;
if (!cJSON_IsObject(acc_bw_med_comps)) {
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(acc_bw_med_comps_local_map)) {
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(acc_bw_med_comps_local_map)) {
ogs_error("OpenAPI_acceptable_service_info_parseFromJSON() failed [acc_bw_med_comps]");
goto end;
}
localMapKeyPair = OpenAPI_map_create(
localMapObject->string, OpenAPI_media_component_parseFromJSON(localMapObject));
OpenAPI_list_add(acc_bw_med_compsList, localMapKeyPair);
}
localMapKeyPair = OpenAPI_map_create(
localMapObject->string, OpenAPI_media_component_parseFromJSON(localMapObject));
OpenAPI_list_add(acc_bw_med_compsList , localMapKeyPair);
}
}
cJSON *mar_bw_ul = cJSON_GetObjectItemCaseSensitive(acceptable_service_infoJSON, "marBwUl");
if (mar_bw_ul) {
if (!cJSON_IsString(mar_bw_ul)) {
ogs_error("OpenAPI_acceptable_service_info_parseFromJSON() failed [mar_bw_ul]");
goto end;
}
if (mar_bw_ul) {
if (!cJSON_IsString(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");
if (mar_bw_dl) {
if (!cJSON_IsString(mar_bw_dl)) {
ogs_error("OpenAPI_acceptable_service_info_parseFromJSON() failed [mar_bw_dl]");
goto end;
}
if (mar_bw_dl) {
if (!cJSON_IsString(mar_bw_dl)) {
ogs_error("OpenAPI_acceptable_service_info_parseFromJSON() failed [mar_bw_dl]");
goto end;
}
}
acceptable_service_info_local_var = OpenAPI_acceptable_service_info_create (
acc_bw_med_comps ? acc_bw_med_compsList : NULL,
mar_bw_ul ? ogs_strdup_or_assert(mar_bw_ul->valuestring) : NULL,
mar_bw_dl ? ogs_strdup_or_assert(mar_bw_dl->valuestring) : NULL
);
);
return acceptable_service_info_local_var;
end:

View File

@ -29,7 +29,7 @@ OpenAPI_acceptable_service_info_t *OpenAPI_acceptable_service_info_create(
OpenAPI_list_t* acc_bw_med_comps,
char *mar_bw_ul,
char *mar_bw_dl
);
);
void OpenAPI_acceptable_service_info_free(OpenAPI_acceptable_service_info_t *acceptable_service_info);
OpenAPI_acceptable_service_info_t *OpenAPI_acceptable_service_info_parseFromJSON(cJSON *acceptable_service_infoJSON);
cJSON *OpenAPI_acceptable_service_info_convertToJSON(OpenAPI_acceptable_service_info_t *acceptable_service_info);

View File

@ -20,11 +20,12 @@ OpenAPI_access_and_mobility_data_t *OpenAPI_access_and_mobility_data_create(
char *sms_over_nas_status_ts,
int roaming_status,
char *roaming_status_ts,
OpenAPI_plmn_id_t *current_plmn,
OpenAPI_plmn_id_1_t *current_plmn,
char *current_plmn_ts,
OpenAPI_list_t *rat_type,
char *rat_types_ts
)
char *rat_types_ts,
char *supp_feat
)
{
OpenAPI_access_and_mobility_data_t *access_and_mobility_data_local_var = OpenAPI_malloc(sizeof(OpenAPI_access_and_mobility_data_t));
if (!access_and_mobility_data_local_var) {
@ -49,6 +50,7 @@ OpenAPI_access_and_mobility_data_t *OpenAPI_access_and_mobility_data_create(
access_and_mobility_data_local_var->current_plmn_ts = current_plmn_ts;
access_and_mobility_data_local_var->rat_type = rat_type;
access_and_mobility_data_local_var->rat_types_ts = rat_types_ts;
access_and_mobility_data_local_var->supp_feat = supp_feat;
return access_and_mobility_data_local_var;
}
@ -77,10 +79,11 @@ void OpenAPI_access_and_mobility_data_free(OpenAPI_access_and_mobility_data_t *a
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_free(access_and_mobility_data->current_plmn);
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);
}
@ -95,188 +98,195 @@ cJSON *OpenAPI_access_and_mobility_data_convertToJSON(OpenAPI_access_and_mobilit
item = cJSON_CreateObject();
if (access_and_mobility_data->location) {
cJSON *location_local_JSON = OpenAPI_user_location_convertToJSON(access_and_mobility_data->location);
if (location_local_JSON == NULL) {
ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [location]");
goto end;
}
cJSON_AddItemToObject(item, "location", location_local_JSON);
if (item->child == NULL) {
ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [location]");
goto end;
}
cJSON *location_local_JSON = OpenAPI_user_location_convertToJSON(access_and_mobility_data->location);
if (location_local_JSON == NULL) {
ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [location]");
goto end;
}
cJSON_AddItemToObject(item, "location", location_local_JSON);
if (item->child == NULL) {
ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [location]");
goto end;
}
}
if (access_and_mobility_data->location_ts) {
if (cJSON_AddStringToObject(item, "locationTs", access_and_mobility_data->location_ts) == NULL) {
ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [location_ts]");
goto end;
}
if (cJSON_AddStringToObject(item, "locationTs", access_and_mobility_data->location_ts) == NULL) {
ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [location_ts]");
goto end;
}
}
if (access_and_mobility_data->time_zone) {
if (cJSON_AddStringToObject(item, "timeZone", access_and_mobility_data->time_zone) == NULL) {
ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [time_zone]");
goto end;
}
if (cJSON_AddStringToObject(item, "timeZone", access_and_mobility_data->time_zone) == NULL) {
ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [time_zone]");
goto end;
}
}
if (access_and_mobility_data->time_zone_ts) {
if (cJSON_AddStringToObject(item, "timeZoneTs", access_and_mobility_data->time_zone_ts) == NULL) {
ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [time_zone_ts]");
goto end;
}
if (cJSON_AddStringToObject(item, "timeZoneTs", access_and_mobility_data->time_zone_ts) == NULL) {
ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [time_zone_ts]");
goto end;
}
}
if (access_and_mobility_data->access_type) {
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;
}
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;
}
}
if (access_and_mobility_data->reg_states) {
cJSON *reg_statesList = cJSON_AddArrayToObject(item, "regStates");
if (reg_statesList == NULL) {
ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [reg_states]");
goto end;
}
cJSON *reg_statesList = cJSON_AddArrayToObject(item, "regStates");
if (reg_statesList == NULL) {
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_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);
}
}
}
if (access_and_mobility_data->reg_states_ts) {
if (cJSON_AddStringToObject(item, "regStatesTs", access_and_mobility_data->reg_states_ts) == NULL) {
ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [reg_states_ts]");
goto end;
}
if (cJSON_AddStringToObject(item, "regStatesTs", access_and_mobility_data->reg_states_ts) == NULL) {
ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [reg_states_ts]");
goto end;
}
}
if (access_and_mobility_data->conn_states) {
cJSON *conn_statesList = cJSON_AddArrayToObject(item, "connStates");
if (conn_statesList == NULL) {
ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [conn_states]");
goto end;
}
cJSON *conn_statesList = cJSON_AddArrayToObject(item, "connStates");
if (conn_statesList == NULL) {
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_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);
}
}
}
if (access_and_mobility_data->conn_states_ts) {
if (cJSON_AddStringToObject(item, "connStatesTs", access_and_mobility_data->conn_states_ts) == NULL) {
ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [conn_states_ts]");
goto end;
}
if (cJSON_AddStringToObject(item, "connStatesTs", access_and_mobility_data->conn_states_ts) == NULL) {
ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [conn_states_ts]");
goto end;
}
}
if (access_and_mobility_data->reachability_status) {
cJSON *reachability_status_local_JSON = OpenAPI_ue_reachability_convertToJSON(access_and_mobility_data->reachability_status);
if (reachability_status_local_JSON == NULL) {
ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [reachability_status]");
goto end;
}
cJSON_AddItemToObject(item, "reachabilityStatus", reachability_status_local_JSON);
if (item->child == NULL) {
ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [reachability_status]");
goto end;
}
cJSON *reachability_status_local_JSON = OpenAPI_ue_reachability_convertToJSON(access_and_mobility_data->reachability_status);
if (reachability_status_local_JSON == NULL) {
ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [reachability_status]");
goto end;
}
cJSON_AddItemToObject(item, "reachabilityStatus", reachability_status_local_JSON);
if (item->child == NULL) {
ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [reachability_status]");
goto end;
}
}
if (access_and_mobility_data->reachability_status_ts) {
if (cJSON_AddStringToObject(item, "reachabilityStatusTs", access_and_mobility_data->reachability_status_ts) == NULL) {
ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [reachability_status_ts]");
goto end;
}
if (cJSON_AddStringToObject(item, "reachabilityStatusTs", access_and_mobility_data->reachability_status_ts) == NULL) {
ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [reachability_status_ts]");
goto end;
}
}
if (access_and_mobility_data->sms_over_nas_status) {
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;
}
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;
}
}
if (access_and_mobility_data->sms_over_nas_status_ts) {
if (cJSON_AddStringToObject(item, "smsOverNasStatusTs", access_and_mobility_data->sms_over_nas_status_ts) == NULL) {
ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [sms_over_nas_status_ts]");
goto end;
}
if (cJSON_AddStringToObject(item, "smsOverNasStatusTs", access_and_mobility_data->sms_over_nas_status_ts) == NULL) {
ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [sms_over_nas_status_ts]");
goto end;
}
}
if (access_and_mobility_data->roaming_status) {
if (cJSON_AddBoolToObject(item, "roamingStatus", access_and_mobility_data->roaming_status) == NULL) {
ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [roaming_status]");
goto end;
}
if (cJSON_AddBoolToObject(item, "roamingStatus", access_and_mobility_data->roaming_status) == NULL) {
ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [roaming_status]");
goto end;
}
}
if (access_and_mobility_data->roaming_status_ts) {
if (cJSON_AddStringToObject(item, "roamingStatusTs", access_and_mobility_data->roaming_status_ts) == NULL) {
ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [roaming_status_ts]");
goto end;
}
if (cJSON_AddStringToObject(item, "roamingStatusTs", access_and_mobility_data->roaming_status_ts) == NULL) {
ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [roaming_status_ts]");
goto end;
}
}
if (access_and_mobility_data->current_plmn) {
cJSON *current_plmn_local_JSON = OpenAPI_plmn_id_convertToJSON(access_and_mobility_data->current_plmn);
if (current_plmn_local_JSON == NULL) {
ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [current_plmn]");
goto end;
}
cJSON_AddItemToObject(item, "currentPlmn", current_plmn_local_JSON);
if (item->child == NULL) {
ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [current_plmn]");
goto end;
}
cJSON *current_plmn_local_JSON = OpenAPI_plmn_id_1_convertToJSON(access_and_mobility_data->current_plmn);
if (current_plmn_local_JSON == NULL) {
ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [current_plmn]");
goto end;
}
cJSON_AddItemToObject(item, "currentPlmn", current_plmn_local_JSON);
if (item->child == NULL) {
ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [current_plmn]");
goto end;
}
}
if (access_and_mobility_data->current_plmn_ts) {
if (cJSON_AddStringToObject(item, "currentPlmnTs", access_and_mobility_data->current_plmn_ts) == NULL) {
ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [current_plmn_ts]");
goto end;
}
if (cJSON_AddStringToObject(item, "currentPlmnTs", access_and_mobility_data->current_plmn_ts) == NULL) {
ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [current_plmn_ts]");
goto end;
}
}
if (access_and_mobility_data->rat_type) {
cJSON *rat_type = cJSON_AddArrayToObject(item, "ratType");
if (rat_type == NULL) {
cJSON *rat_type = cJSON_AddArrayToObject(item, "ratType");
if (rat_type == 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) {
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) {
ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [rat_type]");
goto end;
}
}
}
}
if (access_and_mobility_data->rat_types_ts) {
if (cJSON_AddStringToObject(item, "ratTypesTs", access_and_mobility_data->rat_types_ts) == NULL) {
ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [rat_types_ts]");
goto end;
}
if (cJSON_AddStringToObject(item, "ratTypesTs", access_and_mobility_data->rat_types_ts) == NULL) {
ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [rat_types_ts]");
goto end;
}
}
if (access_and_mobility_data->supp_feat) {
if (cJSON_AddStringToObject(item, "suppFeat", access_and_mobility_data->supp_feat) == NULL) {
ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [supp_feat]");
goto end;
}
}
end:
@ -289,212 +299,221 @@ OpenAPI_access_and_mobility_data_t *OpenAPI_access_and_mobility_data_parseFromJS
cJSON *location = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "location");
OpenAPI_user_location_t *location_local_nonprim = NULL;
if (location) {
location_local_nonprim = OpenAPI_user_location_parseFromJSON(location);
}
if (location) {
location_local_nonprim = OpenAPI_user_location_parseFromJSON(location);
}
cJSON *location_ts = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "locationTs");
if (location_ts) {
if (!cJSON_IsString(location_ts)) {
ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [location_ts]");
goto end;
}
if (location_ts) {
if (!cJSON_IsString(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");
if (time_zone) {
if (!cJSON_IsString(time_zone)) {
ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [time_zone]");
goto end;
}
if (time_zone) {
if (!cJSON_IsString(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");
if (time_zone_ts) {
if (!cJSON_IsString(time_zone_ts)) {
ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [time_zone_ts]");
goto end;
}
if (time_zone_ts) {
if (!cJSON_IsString(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;
if (access_type) {
if (!cJSON_IsString(access_type)) {
ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [access_type]");
goto end;
}
access_typeVariable = OpenAPI_access_type_FromString(access_type->valuestring);
if (access_type) {
if (!cJSON_IsString(access_type)) {
ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [access_type]");
goto end;
}
access_typeVariable = OpenAPI_access_type_FromString(access_type->valuestring);
}
cJSON *reg_states = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "regStates");
OpenAPI_list_t *reg_statesList;
if (reg_states) {
cJSON *reg_states_local_nonprimitive;
if (!cJSON_IsArray(reg_states)) {
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)) {
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);
reg_statesList = OpenAPI_list_create();
cJSON_ArrayForEach(reg_states_local_nonprimitive, reg_states ) {
if (!cJSON_IsObject(reg_states_local_nonprimitive)) {
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);
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");
if (reg_states_ts) {
if (!cJSON_IsString(reg_states_ts)) {
ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [reg_states_ts]");
goto end;
}
if (reg_states_ts) {
if (!cJSON_IsString(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;
if (conn_states) {
cJSON *conn_states_local_nonprimitive;
if (!cJSON_IsArray(conn_states)) {
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)) {
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);
conn_statesList = OpenAPI_list_create();
cJSON_ArrayForEach(conn_states_local_nonprimitive, conn_states ) {
if (!cJSON_IsObject(conn_states_local_nonprimitive)) {
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);
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");
if (conn_states_ts) {
if (!cJSON_IsString(conn_states_ts)) {
ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [conn_states_ts]");
goto end;
}
if (conn_states_ts) {
if (!cJSON_IsString(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;
if (reachability_status) {
reachability_status_local_nonprim = OpenAPI_ue_reachability_parseFromJSON(reachability_status);
}
if (reachability_status) {
reachability_status_local_nonprim = OpenAPI_ue_reachability_parseFromJSON(reachability_status);
}
cJSON *reachability_status_ts = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "reachabilityStatusTs");
if (reachability_status_ts) {
if (!cJSON_IsString(reachability_status_ts)) {
ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [reachability_status_ts]");
goto end;
}
if (reachability_status_ts) {
if (!cJSON_IsString(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;
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]");
goto end;
}
sms_over_nas_statusVariable = OpenAPI_sms_support_FromString(sms_over_nas_status->valuestring);
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]");
goto end;
}
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");
if (sms_over_nas_status_ts) {
if (!cJSON_IsString(sms_over_nas_status_ts)) {
ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [sms_over_nas_status_ts]");
goto end;
}
if (sms_over_nas_status_ts) {
if (!cJSON_IsString(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");
if (roaming_status) {
if (!cJSON_IsBool(roaming_status)) {
ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [roaming_status]");
goto end;
}
if (roaming_status) {
if (!cJSON_IsBool(roaming_status)) {
ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [roaming_status]");
goto end;
}
}
cJSON *roaming_status_ts = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "roamingStatusTs");
if (roaming_status_ts) {
if (!cJSON_IsString(roaming_status_ts)) {
ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [roaming_status_ts]");
goto end;
}
if (roaming_status_ts) {
if (!cJSON_IsString(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_t *current_plmn_local_nonprim = NULL;
if (current_plmn) {
current_plmn_local_nonprim = OpenAPI_plmn_id_parseFromJSON(current_plmn);
}
OpenAPI_plmn_id_1_t *current_plmn_local_nonprim = NULL;
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");
if (current_plmn_ts) {
if (!cJSON_IsString(current_plmn_ts)) {
ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [current_plmn_ts]");
goto end;
}
if (current_plmn_ts) {
if (!cJSON_IsString(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;
if (rat_type) {
cJSON *rat_type_local_nonprimitive;
if (!cJSON_IsArray(rat_type)) {
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)){
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)) {
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));
}
OpenAPI_list_add(rat_typeList, (void *)OpenAPI_rat_type_FromString(rat_type_local_nonprimitive->valuestring));
}
}
cJSON *rat_types_ts = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "ratTypesTs");
if (rat_types_ts) {
if (!cJSON_IsString(rat_types_ts)) {
ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [rat_types_ts]");
goto end;
}
if (rat_types_ts) {
if (!cJSON_IsString(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");
if (supp_feat) {
if (!cJSON_IsString(supp_feat)) {
ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [supp_feat]");
goto end;
}
}
access_and_mobility_data_local_var = OpenAPI_access_and_mobility_data_create (
location ? location_local_nonprim : NULL,
@ -515,8 +534,9 @@ OpenAPI_access_and_mobility_data_t *OpenAPI_access_and_mobility_data_parseFromJS
current_plmn ? current_plmn_local_nonprim : NULL,
current_plmn_ts ? ogs_strdup_or_assert(current_plmn_ts->valuestring) : NULL,
rat_type ? rat_typeList : NULL,
rat_types_ts ? ogs_strdup_or_assert(rat_types_ts->valuestring) : NULL
);
rat_types_ts ? ogs_strdup_or_assert(rat_types_ts->valuestring) : NULL,
supp_feat ? ogs_strdup_or_assert(supp_feat->valuestring) : NULL
);
return access_and_mobility_data_local_var;
end:

View File

@ -1,7 +1,7 @@
/*
* access_and_mobility_data.h
*
*
*
*/
#ifndef _OpenAPI_access_and_mobility_data_H_
@ -14,7 +14,7 @@
#include "../include/binary.h"
#include "access_type.h"
#include "cm_info.h"
#include "plmn_id.h"
#include "plmn_id_1.h"
#include "rat_type.h"
#include "rm_info.h"
#include "sms_support.h"
@ -42,10 +42,11 @@ typedef struct OpenAPI_access_and_mobility_data_s {
char *sms_over_nas_status_ts;
int roaming_status;
char *roaming_status_ts;
struct OpenAPI_plmn_id_s *current_plmn;
struct OpenAPI_plmn_id_1_s *current_plmn;
char *current_plmn_ts;
OpenAPI_list_t *rat_type;
char *rat_types_ts;
char *supp_feat;
} OpenAPI_access_and_mobility_data_t;
OpenAPI_access_and_mobility_data_t *OpenAPI_access_and_mobility_data_create(
@ -64,11 +65,12 @@ OpenAPI_access_and_mobility_data_t *OpenAPI_access_and_mobility_data_create(
char *sms_over_nas_status_ts,
int roaming_status,
char *roaming_status_ts,
OpenAPI_plmn_id_t *current_plmn,
OpenAPI_plmn_id_1_t *current_plmn,
char *current_plmn_ts,
OpenAPI_list_t *rat_type,
char *rat_types_ts
);
char *rat_types_ts,
char *supp_feat
);
void OpenAPI_access_and_mobility_data_free(OpenAPI_access_and_mobility_data_t *access_and_mobility_data);
OpenAPI_access_and_mobility_data_t *OpenAPI_access_and_mobility_data_parseFromJSON(cJSON *access_and_mobility_dataJSON);
cJSON *OpenAPI_access_and_mobility_data_convertToJSON(OpenAPI_access_and_mobility_data_t *access_and_mobility_data);

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
/*
* access_and_mobility_subscription_data.h
*
*
*
*/
#ifndef _OpenAPI_access_and_mobility_subscription_data_H_
@ -28,7 +28,7 @@
#include "service_area_restriction.h"
#include "sor_info.h"
#include "sor_update_indicator.h"
#include "trace_data.h"
#include "trace_data_1.h"
#include "upu_info.h"
#include "wireline_area.h"
#include "wireline_service_area_restriction.h"
@ -67,13 +67,13 @@ 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_s *trace_data;
struct OpenAPI_trace_data_1_s *trace_data;
struct OpenAPI_cag_data_s *cag_data;
char *stn_sr;
char *c_msisdn;
int nb_io_t_ue_priority;
int nb_io_tue_priority;
int nssai_inclusion_allowed;
char rg_wireline_characteristics;
char *rg_wireline_characteristics;
struct OpenAPI_ec_restriction_data_wb_s *ec_restriction_data_wb;
int ec_restriction_data_nb;
struct OpenAPI_expected_ue_behaviour_data_s *expected_ue_behaviour_list;
@ -115,13 +115,13 @@ 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_t *trace_data,
OpenAPI_trace_data_1_t *trace_data,
OpenAPI_cag_data_t *cag_data,
char *stn_sr,
char *c_msisdn,
int nb_io_t_ue_priority,
int nb_io_tue_priority,
int nssai_inclusion_allowed,
char rg_wireline_characteristics,
char *rg_wireline_characteristics,
OpenAPI_ec_restriction_data_wb_t *ec_restriction_data_wb,
int ec_restriction_data_nb,
OpenAPI_expected_ue_behaviour_data_t *expected_ue_behaviour_list,
@ -132,7 +132,7 @@ OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_sub
int iab_operation_allowed,
OpenAPI_list_t *wireline_forbidden_areas,
OpenAPI_wireline_service_area_restriction_t *wireline_service_area_restriction
);
);
void OpenAPI_access_and_mobility_subscription_data_free(OpenAPI_access_and_mobility_subscription_data_t *access_and_mobility_subscription_data);
OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_subscription_data_parseFromJSON(cJSON *access_and_mobility_subscription_dataJSON);
cJSON *OpenAPI_access_and_mobility_subscription_data_convertToJSON(OpenAPI_access_and_mobility_subscription_data_t *access_and_mobility_subscription_data);

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,146 @@
/*
* access_and_mobility_subscription_data_1.h
*
*
*/
#ifndef _OpenAPI_access_and_mobility_subscription_data_1_H_
#define _OpenAPI_access_and_mobility_subscription_data_1_H_
#include <string.h>
#include "../external/cJSON.h"
#include "../include/list.h"
#include "../include/keyValuePair.h"
#include "../include/binary.h"
#include "ambr_rm.h"
#include "area_1.h"
#include "cag_data_1.h"
#include "core_network_type.h"
#include "ec_restriction_data_wb.h"
#include "edrx_parameters_1.h"
#include "expected_ue_behaviour_data_1.h"
#include "mdt_configuration_1.h"
#include "mdt_user_consent.h"
#include "nssai_1.h"
#include "odb_packet_services.h"
#include "ptw_parameters_1.h"
#include "rat_type.h"
#include "service_area_restriction_1.h"
#include "sor_info_1.h"
#include "sor_update_indicator.h"
#include "trace_data.h"
#include "upu_info_1.h"
#include "wireline_area_1.h"
#include "wireline_service_area_restriction_1.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct OpenAPI_access_and_mobility_subscription_data_1_s OpenAPI_access_and_mobility_subscription_data_1_t;
typedef struct OpenAPI_access_and_mobility_subscription_data_1_s {
char *supported_features;
OpenAPI_list_t *gpsis;
OpenAPI_list_t *internal_group_ids;
OpenAPI_list_t* shared_vn_group_data_ids;
struct OpenAPI_ambr_rm_s *subscribed_ue_ambr;
struct OpenAPI_nssai_1_s *nssai;
OpenAPI_list_t *rat_restrictions;
OpenAPI_list_t *forbidden_areas;
struct OpenAPI_service_area_restriction_1_s *service_area_restriction;
OpenAPI_list_t *core_network_type_restrictions;
int rfsp_index;
int subs_reg_timer;
int ue_usage_type;
int mps_priority;
int mcs_priority;
int active_time;
struct OpenAPI_sor_info_1_s *sor_info;
int sor_info_expect_ind;
int soraf_retrieval;
OpenAPI_list_t *sor_update_indicator_list;
struct OpenAPI_upu_info_1_s *upu_info;
int mico_allowed;
OpenAPI_list_t *shared_am_data_ids;
OpenAPI_odb_packet_services_e odb_packet_services;
OpenAPI_list_t *subscribed_dnn_list;
int service_gap_time;
OpenAPI_mdt_user_consent_e mdt_user_consent;
struct OpenAPI_mdt_configuration_1_s *mdt_configuration;
struct OpenAPI_trace_data_s *trace_data;
struct OpenAPI_cag_data_1_s *cag_data;
char *stn_sr;
char *c_msisdn;
int nb_io_tue_priority;
int nssai_inclusion_allowed;
char *rg_wireline_characteristics;
struct OpenAPI_ec_restriction_data_wb_s *ec_restriction_data_wb;
int ec_restriction_data_nb;
struct OpenAPI_expected_ue_behaviour_data_1_s *expected_ue_behaviour_list;
OpenAPI_list_t *primary_rat_restrictions;
OpenAPI_list_t *secondary_rat_restrictions;
OpenAPI_list_t *edrx_parameters_list;
OpenAPI_list_t *ptw_parameters_list;
int iab_operation_allowed;
OpenAPI_list_t *wireline_forbidden_areas;
struct OpenAPI_wireline_service_area_restriction_1_s *wireline_service_area_restriction;
} OpenAPI_access_and_mobility_subscription_data_1_t;
OpenAPI_access_and_mobility_subscription_data_1_t *OpenAPI_access_and_mobility_subscription_data_1_create(
char *supported_features,
OpenAPI_list_t *gpsis,
OpenAPI_list_t *internal_group_ids,
OpenAPI_list_t* shared_vn_group_data_ids,
OpenAPI_ambr_rm_t *subscribed_ue_ambr,
OpenAPI_nssai_1_t *nssai,
OpenAPI_list_t *rat_restrictions,
OpenAPI_list_t *forbidden_areas,
OpenAPI_service_area_restriction_1_t *service_area_restriction,
OpenAPI_list_t *core_network_type_restrictions,
int rfsp_index,
int subs_reg_timer,
int ue_usage_type,
int mps_priority,
int mcs_priority,
int active_time,
OpenAPI_sor_info_1_t *sor_info,
int sor_info_expect_ind,
int soraf_retrieval,
OpenAPI_list_t *sor_update_indicator_list,
OpenAPI_upu_info_1_t *upu_info,
int mico_allowed,
OpenAPI_list_t *shared_am_data_ids,
OpenAPI_odb_packet_services_e odb_packet_services,
OpenAPI_list_t *subscribed_dnn_list,
int service_gap_time,
OpenAPI_mdt_user_consent_e mdt_user_consent,
OpenAPI_mdt_configuration_1_t *mdt_configuration,
OpenAPI_trace_data_t *trace_data,
OpenAPI_cag_data_1_t *cag_data,
char *stn_sr,
char *c_msisdn,
int nb_io_tue_priority,
int nssai_inclusion_allowed,
char *rg_wireline_characteristics,
OpenAPI_ec_restriction_data_wb_t *ec_restriction_data_wb,
int ec_restriction_data_nb,
OpenAPI_expected_ue_behaviour_data_1_t *expected_ue_behaviour_list,
OpenAPI_list_t *primary_rat_restrictions,
OpenAPI_list_t *secondary_rat_restrictions,
OpenAPI_list_t *edrx_parameters_list,
OpenAPI_list_t *ptw_parameters_list,
int iab_operation_allowed,
OpenAPI_list_t *wireline_forbidden_areas,
OpenAPI_wireline_service_area_restriction_1_t *wireline_service_area_restriction
);
void OpenAPI_access_and_mobility_subscription_data_1_free(OpenAPI_access_and_mobility_subscription_data_1_t *access_and_mobility_subscription_data_1);
OpenAPI_access_and_mobility_subscription_data_1_t *OpenAPI_access_and_mobility_subscription_data_1_parseFromJSON(cJSON *access_and_mobility_subscription_data_1JSON);
cJSON *OpenAPI_access_and_mobility_subscription_data_1_convertToJSON(OpenAPI_access_and_mobility_subscription_data_1_t *access_and_mobility_subscription_data_1);
OpenAPI_access_and_mobility_subscription_data_1_t *OpenAPI_access_and_mobility_subscription_data_1_copy(OpenAPI_access_and_mobility_subscription_data_1_t *dst, OpenAPI_access_and_mobility_subscription_data_1_t *src);
#ifdef __cplusplus
}
#endif
#endif /* _OpenAPI_access_and_mobility_subscription_data_1_H_ */

View File

@ -7,7 +7,7 @@
OpenAPI_access_net_charging_identifier_t *OpenAPI_access_net_charging_identifier_create(
int acc_net_cha_id_value,
OpenAPI_list_t *flows
)
)
{
OpenAPI_access_net_charging_identifier_t *access_net_charging_identifier_local_var = OpenAPI_malloc(sizeof(OpenAPI_access_net_charging_identifier_t));
if (!access_net_charging_identifier_local_var) {
@ -48,24 +48,24 @@ cJSON *OpenAPI_access_net_charging_identifier_convertToJSON(OpenAPI_access_net_c
}
if (access_net_charging_identifier->flows) {
cJSON *flowsList = cJSON_AddArrayToObject(item, "flows");
if (flowsList == NULL) {
ogs_error("OpenAPI_access_net_charging_identifier_convertToJSON() failed [flows]");
goto end;
}
cJSON *flowsList = cJSON_AddArrayToObject(item, "flows");
if (flowsList == NULL) {
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_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);
}
}
}
end:
return item;
@ -80,7 +80,7 @@ OpenAPI_access_net_charging_identifier_t *OpenAPI_access_net_charging_identifier
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;
@ -89,30 +89,30 @@ OpenAPI_access_net_charging_identifier_t *OpenAPI_access_net_charging_identifier
cJSON *flows = cJSON_GetObjectItemCaseSensitive(access_net_charging_identifierJSON, "flows");
OpenAPI_list_t *flowsList;
if (flows) {
cJSON *flows_local_nonprimitive;
if (!cJSON_IsArray(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)) {
ogs_error("OpenAPI_access_net_charging_identifier_parseFromJSON() failed [flows]");
goto end;
}
OpenAPI_flows_t *flowsItem = OpenAPI_flows_parseFromJSON(flows_local_nonprimitive);
flowsList = OpenAPI_list_create();
cJSON_ArrayForEach(flows_local_nonprimitive, flows ) {
if (!cJSON_IsObject(flows_local_nonprimitive)) {
ogs_error("OpenAPI_access_net_charging_identifier_parseFromJSON() failed [flows]");
goto end;
}
OpenAPI_flows_t *flowsItem = OpenAPI_flows_parseFromJSON(flows_local_nonprimitive);
OpenAPI_list_add(flowsList, flowsItem);
}
OpenAPI_list_add(flowsList, flowsItem);
}
}
access_net_charging_identifier_local_var = OpenAPI_access_net_charging_identifier_create (
acc_net_cha_id_value->valuedouble,
flows ? flowsList : NULL
);
);
return access_net_charging_identifier_local_var;
end:

View File

@ -27,7 +27,7 @@ typedef struct OpenAPI_access_net_charging_identifier_s {
OpenAPI_access_net_charging_identifier_t *OpenAPI_access_net_charging_identifier_create(
int acc_net_cha_id_value,
OpenAPI_list_t *flows
);
);
void OpenAPI_access_net_charging_identifier_free(OpenAPI_access_net_charging_identifier_t *access_net_charging_identifier);
OpenAPI_access_net_charging_identifier_t *OpenAPI_access_net_charging_identifier_parseFromJSON(cJSON *access_net_charging_identifierJSON);
cJSON *OpenAPI_access_net_charging_identifier_convertToJSON(OpenAPI_access_net_charging_identifier_t *access_net_charging_identifier);

View File

@ -1,7 +1,7 @@
/*
* access_network_id.h
*
*
*
*/
#ifndef _OpenAPI_access_network_id_H_

View File

@ -5,7 +5,7 @@
#include "access_right_status.h"
OpenAPI_access_right_status_t *OpenAPI_access_right_status_create(
)
)
{
OpenAPI_access_right_status_t *access_right_status_local_var = OpenAPI_malloc(sizeof(OpenAPI_access_right_status_t));
if (!access_right_status_local_var) {
@ -42,7 +42,7 @@ OpenAPI_access_right_status_t *OpenAPI_access_right_status_parseFromJSON(cJSON *
{
OpenAPI_access_right_status_t *access_right_status_local_var = NULL;
access_right_status_local_var = OpenAPI_access_right_status_create (
);
);
return access_right_status_local_var;
end:

View File

@ -1,7 +1,7 @@
/*
* access_right_status.h
*
* Possible values are - FULLY_ALLOWED: The User is fully allowed to access to the channel. - PREVIEW_ALLOWED: The User is preview allowed to access to the channel. - NO_ALLOWED: The User is not allowed to access to the channel.
* Possible values are - FULLY_ALLOWED: The User is fully allowed to access to the channel. - PREVIEW_ALLOWED: The User is preview allowed to access to the channel. - NO_ALLOWED: The User is not allowed to access to the channel.
*/
#ifndef _OpenAPI_access_right_status_H_
@ -12,6 +12,7 @@
#include "../include/list.h"
#include "../include/keyValuePair.h"
#include "../include/binary.h"
#include "access_right_status_any_of.h"
#ifdef __cplusplus
extern "C" {
@ -22,7 +23,7 @@ typedef struct OpenAPI_access_right_status_s {
} OpenAPI_access_right_status_t;
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_access_right_status_t *OpenAPI_access_right_status_parseFromJSON(cJSON *access_right_statusJSON);
cJSON *OpenAPI_access_right_status_convertToJSON(OpenAPI_access_right_status_t *access_right_status);

View File

@ -0,0 +1,30 @@
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "access_right_status_any_of.h"
char* OpenAPI_access_right_status_any_of_ToString(OpenAPI_access_right_status_any_of_e access_right_status_any_of)
{
const char *access_right_status_any_ofArray[] = { "NULL", "FULLY_ALLOWED", "PREVIEW_ALLOWED", "NO_ALLOWED" };
size_t sizeofArray = sizeof(access_right_status_any_ofArray) / sizeof(access_right_status_any_ofArray[0]);
if (access_right_status_any_of < sizeofArray)
return (char *)access_right_status_any_ofArray[access_right_status_any_of];
else
return (char *)"Unknown";
}
OpenAPI_access_right_status_any_of_e OpenAPI_access_right_status_any_of_FromString(char* access_right_status_any_of)
{
int stringToReturn = 0;
const char *access_right_status_any_ofArray[] = { "NULL", "FULLY_ALLOWED", "PREVIEW_ALLOWED", "NO_ALLOWED" };
size_t sizeofArray = sizeof(access_right_status_any_ofArray) / sizeof(access_right_status_any_ofArray[0]);
while (stringToReturn < sizeofArray) {
if (strcmp(access_right_status_any_of, access_right_status_any_ofArray[stringToReturn]) == 0) {
return stringToReturn;
}
stringToReturn++;
}
return 0;
}

View File

@ -0,0 +1,31 @@
/*
* access_right_status_any_of.h
*
*
*/
#ifndef _OpenAPI_access_right_status_any_of_H_
#define _OpenAPI_access_right_status_any_of_H_
#include <string.h>
#include "../external/cJSON.h"
#include "../include/list.h"
#include "../include/keyValuePair.h"
#include "../include/binary.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef enum { OpenAPI_access_right_status_any_of_NULL = 0, OpenAPI_access_right_status_any_of_FULLY_ALLOWED, OpenAPI_access_right_status_any_of_PREVIEW_ALLOWED, OpenAPI_access_right_status_any_of_NO_ALLOWED } OpenAPI_access_right_status_any_of_e;
char* OpenAPI_access_right_status_any_of_ToString(OpenAPI_access_right_status_any_of_e access_right_status_any_of);
OpenAPI_access_right_status_any_of_e OpenAPI_access_right_status_any_of_FromString(char* access_right_status_any_of);
#ifdef __cplusplus
}
#endif
#endif /* _OpenAPI_access_right_status_any_of_H_ */

View File

@ -5,7 +5,7 @@
#include "access_tech.h"
OpenAPI_access_tech_t *OpenAPI_access_tech_create(
)
)
{
OpenAPI_access_tech_t *access_tech_local_var = OpenAPI_malloc(sizeof(OpenAPI_access_tech_t));
if (!access_tech_local_var) {
@ -42,7 +42,7 @@ OpenAPI_access_tech_t *OpenAPI_access_tech_parseFromJSON(cJSON *access_techJSON)
{
OpenAPI_access_tech_t *access_tech_local_var = NULL;
access_tech_local_var = OpenAPI_access_tech_create (
);
);
return access_tech_local_var;
end:

View File

@ -1,7 +1,7 @@
/*
* access_tech.h
*
*
*
*/
#ifndef _OpenAPI_access_tech_H_
@ -12,6 +12,7 @@
#include "../include/list.h"
#include "../include/keyValuePair.h"
#include "../include/binary.h"
#include "access_tech_any_of.h"
#ifdef __cplusplus
extern "C" {
@ -22,7 +23,7 @@ typedef struct OpenAPI_access_tech_s {
} OpenAPI_access_tech_t;
OpenAPI_access_tech_t *OpenAPI_access_tech_create(
);
);
void OpenAPI_access_tech_free(OpenAPI_access_tech_t *access_tech);
OpenAPI_access_tech_t *OpenAPI_access_tech_parseFromJSON(cJSON *access_techJSON);
cJSON *OpenAPI_access_tech_convertToJSON(OpenAPI_access_tech_t *access_tech);

View File

@ -0,0 +1,30 @@
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "access_tech_any_of.h"
char* OpenAPI_access_tech_any_of_ToString(OpenAPI_access_tech_any_of_e access_tech_any_of)
{
const char *access_tech_any_ofArray[] = { "NULL", "NR", "EUTRAN_IN_WBS1_MODE_AND_NBS1_MODE", "EUTRAN_IN_NBS1_MODE_ONLY", "EUTRAN_IN_WBS1_MODE_ONLY", "UTRAN", "GSM_AND_ECGSM_IoT", "GSM_WITHOUT_ECGSM_IoT", "ECGSM_IoT_ONLY", "CDMA_1xRTT", "CDMA_HRPD", "GSM_COMPACT" };
size_t sizeofArray = sizeof(access_tech_any_ofArray) / sizeof(access_tech_any_ofArray[0]);
if (access_tech_any_of < sizeofArray)
return (char *)access_tech_any_ofArray[access_tech_any_of];
else
return (char *)"Unknown";
}
OpenAPI_access_tech_any_of_e OpenAPI_access_tech_any_of_FromString(char* access_tech_any_of)
{
int stringToReturn = 0;
const char *access_tech_any_ofArray[] = { "NULL", "NR", "EUTRAN_IN_WBS1_MODE_AND_NBS1_MODE", "EUTRAN_IN_NBS1_MODE_ONLY", "EUTRAN_IN_WBS1_MODE_ONLY", "UTRAN", "GSM_AND_ECGSM_IoT", "GSM_WITHOUT_ECGSM_IoT", "ECGSM_IoT_ONLY", "CDMA_1xRTT", "CDMA_HRPD", "GSM_COMPACT" };
size_t sizeofArray = sizeof(access_tech_any_ofArray) / sizeof(access_tech_any_ofArray[0]);
while (stringToReturn < sizeofArray) {
if (strcmp(access_tech_any_of, access_tech_any_ofArray[stringToReturn]) == 0) {
return stringToReturn;
}
stringToReturn++;
}
return 0;
}

View File

@ -0,0 +1,31 @@
/*
* access_tech_any_of.h
*
*
*/
#ifndef _OpenAPI_access_tech_any_of_H_
#define _OpenAPI_access_tech_any_of_H_
#include <string.h>
#include "../external/cJSON.h"
#include "../include/list.h"
#include "../include/keyValuePair.h"
#include "../include/binary.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef enum { OpenAPI_access_tech_any_of_NULL = 0, OpenAPI_access_tech_any_of_NR, OpenAPI_access_tech_any_of_EUTRAN_IN_WBS1_MODE_AND_NBS1_MODE, OpenAPI_access_tech_any_of_EUTRAN_IN_NBS1_MODE_ONLY, OpenAPI_access_tech_any_of_EUTRAN_IN_WBS1_MODE_ONLY, OpenAPI_access_tech_any_of_UTRAN, OpenAPI_access_tech_any_of_GSM_AND_ECGSM_IoT, OpenAPI_access_tech_any_of_GSM_WITHOUT_ECGSM_IoT, OpenAPI_access_tech_any_of_ECGSM_IoT_ONLY, OpenAPI_access_tech_any_of_CDMA_1xRTT, OpenAPI_access_tech_any_of_CDMA_HRPD, OpenAPI_access_tech_any_of_GSM_COMPACT } OpenAPI_access_tech_any_of_e;
char* OpenAPI_access_tech_any_of_ToString(OpenAPI_access_tech_any_of_e access_tech_any_of);
OpenAPI_access_tech_any_of_e OpenAPI_access_tech_any_of_FromString(char* access_tech_any_of);
#ifdef __cplusplus
}
#endif
#endif /* _OpenAPI_access_tech_any_of_H_ */

View File

@ -0,0 +1,170 @@
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "access_token_err.h"
char *OpenAPI_erroraccess_token_err_ToString(OpenAPI_access_token_err_error_e error)
{
const char *errorArray[] = { "NULL", "invalid_request", "invalid_client", "invalid_grant", "unauthorized_client", "unsupported_grant_type", "invalid_scope" };
size_t sizeofArray = sizeof(errorArray) / sizeof(errorArray[0]);
if (error < sizeofArray)
return (char *)errorArray[error];
else
return (char *)"Unknown";
}
OpenAPI_access_token_err_error_e OpenAPI_erroraccess_token_err_FromString(char* error)
{
int stringToReturn = 0;
const char *errorArray[] = { "NULL", "invalid_request", "invalid_client", "invalid_grant", "unauthorized_client", "unsupported_grant_type", "invalid_scope" };
size_t sizeofArray = sizeof(errorArray) / sizeof(errorArray[0]);
while (stringToReturn < sizeofArray) {
if (strcmp(error, errorArray[stringToReturn]) == 0) {
return stringToReturn;
}
stringToReturn++;
}
return 0;
}
OpenAPI_access_token_err_t *OpenAPI_access_token_err_create(
OpenAPI_access_token_err_error_e error,
char *error_description,
char *error_uri
)
{
OpenAPI_access_token_err_t *access_token_err_local_var = OpenAPI_malloc(sizeof(OpenAPI_access_token_err_t));
if (!access_token_err_local_var) {
return NULL;
}
access_token_err_local_var->error = error;
access_token_err_local_var->error_description = error_description;
access_token_err_local_var->error_uri = error_uri;
return access_token_err_local_var;
}
void OpenAPI_access_token_err_free(OpenAPI_access_token_err_t *access_token_err)
{
if (NULL == access_token_err) {
return;
}
OpenAPI_lnode_t *node;
ogs_free(access_token_err->error_description);
ogs_free(access_token_err->error_uri);
ogs_free(access_token_err);
}
cJSON *OpenAPI_access_token_err_convertToJSON(OpenAPI_access_token_err_t *access_token_err)
{
cJSON *item = NULL;
if (access_token_err == NULL) {
ogs_error("OpenAPI_access_token_err_convertToJSON() failed [AccessTokenErr]");
return NULL;
}
item = cJSON_CreateObject();
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;
}
if (access_token_err->error_description) {
if (cJSON_AddStringToObject(item, "error_description", access_token_err->error_description) == NULL) {
ogs_error("OpenAPI_access_token_err_convertToJSON() failed [error_description]");
goto end;
}
}
if (access_token_err->error_uri) {
if (cJSON_AddStringToObject(item, "error_uri", access_token_err->error_uri) == NULL) {
ogs_error("OpenAPI_access_token_err_convertToJSON() failed [error_uri]");
goto end;
}
}
end:
return item;
}
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");
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");
if (error_description) {
if (!cJSON_IsString(error_description)) {
ogs_error("OpenAPI_access_token_err_parseFromJSON() failed [error_description]");
goto end;
}
}
cJSON *error_uri = cJSON_GetObjectItemCaseSensitive(access_token_errJSON, "error_uri");
if (error_uri) {
if (!cJSON_IsString(error_uri)) {
ogs_error("OpenAPI_access_token_err_parseFromJSON() failed [error_uri]");
goto end;
}
}
access_token_err_local_var = OpenAPI_access_token_err_create (
errorVariable,
error_description ? ogs_strdup_or_assert(error_description->valuestring) : NULL,
error_uri ? ogs_strdup_or_assert(error_uri->valuestring) : NULL
);
return access_token_err_local_var;
end:
return NULL;
}
OpenAPI_access_token_err_t *OpenAPI_access_token_err_copy(OpenAPI_access_token_err_t *dst, OpenAPI_access_token_err_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_access_token_err_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_access_token_err_convertToJSON() failed");
return NULL;
}
content = cJSON_Print(item);
cJSON_Delete(item);
if (!content) {
ogs_error("cJSON_Print() failed");
return NULL;
}
item = cJSON_Parse(content);
ogs_free(content);
if (!item) {
ogs_error("cJSON_Parse() failed");
return NULL;
}
OpenAPI_access_token_err_free(dst);
dst = OpenAPI_access_token_err_parseFromJSON(item);
cJSON_Delete(item);
return dst;
}

View File

@ -0,0 +1,47 @@
/*
* access_token_err.h
*
* Error returned in the access token response message
*/
#ifndef _OpenAPI_access_token_err_H_
#define _OpenAPI_access_token_err_H_
#include <string.h>
#include "../external/cJSON.h"
#include "../include/list.h"
#include "../include/keyValuePair.h"
#include "../include/binary.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct OpenAPI_access_token_err_s OpenAPI_access_token_err_t;
typedef enum { OpenAPI_access_token_err_ERROR_NULL = 0, OpenAPI_access_token_err_ERROR_invalid_request, OpenAPI_access_token_err_ERROR_invalid_client, OpenAPI_access_token_err_ERROR_invalid_grant, OpenAPI_access_token_err_ERROR_unauthorized_client, OpenAPI_access_token_err_ERROR_unsupported_grant_type, OpenAPI_access_token_err_ERROR_invalid_scope } OpenAPI_access_token_err_error_e;
char* OpenAPI_access_token_err_error_ToString(OpenAPI_access_token_err_error_e error);
OpenAPI_access_token_err_error_e OpenAPI_access_token_err_error_FromString(char* error);
typedef struct OpenAPI_access_token_err_s {
OpenAPI_access_token_err_error_e error;
char *error_description;
char *error_uri;
} OpenAPI_access_token_err_t;
OpenAPI_access_token_err_t *OpenAPI_access_token_err_create(
OpenAPI_access_token_err_error_e error,
char *error_description,
char *error_uri
);
void OpenAPI_access_token_err_free(OpenAPI_access_token_err_t *access_token_err);
OpenAPI_access_token_err_t *OpenAPI_access_token_err_parseFromJSON(cJSON *access_token_errJSON);
cJSON *OpenAPI_access_token_err_convertToJSON(OpenAPI_access_token_err_t *access_token_err);
OpenAPI_access_token_err_t *OpenAPI_access_token_err_copy(OpenAPI_access_token_err_t *dst, OpenAPI_access_token_err_t *src);
#ifdef __cplusplus
}
#endif
#endif /* _OpenAPI_access_token_err_H_ */

View File

@ -0,0 +1,585 @@
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "access_token_req.h"
char *OpenAPI_grant_typeaccess_token_req_ToString(OpenAPI_access_token_req_grant_type_e grant_type)
{
const char *grant_typeArray[] = { "NULL", "client_credentials" };
size_t sizeofArray = sizeof(grant_typeArray) / sizeof(grant_typeArray[0]);
if (grant_type < sizeofArray)
return (char *)grant_typeArray[grant_type];
else
return (char *)"Unknown";
}
OpenAPI_access_token_req_grant_type_e OpenAPI_grant_typeaccess_token_req_FromString(char* grant_type)
{
int stringToReturn = 0;
const char *grant_typeArray[] = { "NULL", "client_credentials" };
size_t sizeofArray = sizeof(grant_typeArray) / sizeof(grant_typeArray[0]);
while (stringToReturn < sizeofArray) {
if (strcmp(grant_type, grant_typeArray[stringToReturn]) == 0) {
return stringToReturn;
}
stringToReturn++;
}
return 0;
}
OpenAPI_access_token_req_t *OpenAPI_access_token_req_create(
OpenAPI_access_token_req_grant_type_e grant_type,
char *nf_instance_id,
OpenAPI_nf_type_e nf_type,
OpenAPI_nf_type_e target_nf_type,
char *scope,
char *target_nf_instance_id,
OpenAPI_plmn_id_t *requester_plmn,
OpenAPI_list_t *requester_plmn_list,
OpenAPI_list_t *requester_snssai_list,
char *requester_fqdn,
OpenAPI_list_t *requester_snpn_list,
OpenAPI_plmn_id_t *target_plmn,
OpenAPI_list_t *target_snssai_list,
OpenAPI_list_t *target_nsi_list,
char *target_nf_set_id,
char *target_nf_service_set_id
)
{
OpenAPI_access_token_req_t *access_token_req_local_var = OpenAPI_malloc(sizeof(OpenAPI_access_token_req_t));
if (!access_token_req_local_var) {
return NULL;
}
access_token_req_local_var->grant_type = grant_type;
access_token_req_local_var->nf_instance_id = nf_instance_id;
access_token_req_local_var->nf_type = nf_type;
access_token_req_local_var->target_nf_type = target_nf_type;
access_token_req_local_var->scope = scope;
access_token_req_local_var->target_nf_instance_id = target_nf_instance_id;
access_token_req_local_var->requester_plmn = requester_plmn;
access_token_req_local_var->requester_plmn_list = requester_plmn_list;
access_token_req_local_var->requester_snssai_list = requester_snssai_list;
access_token_req_local_var->requester_fqdn = requester_fqdn;
access_token_req_local_var->requester_snpn_list = requester_snpn_list;
access_token_req_local_var->target_plmn = target_plmn;
access_token_req_local_var->target_snssai_list = target_snssai_list;
access_token_req_local_var->target_nsi_list = target_nsi_list;
access_token_req_local_var->target_nf_set_id = target_nf_set_id;
access_token_req_local_var->target_nf_service_set_id = target_nf_service_set_id;
return access_token_req_local_var;
}
void OpenAPI_access_token_req_free(OpenAPI_access_token_req_t *access_token_req)
{
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);
}
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);
}
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);
}
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);
}
OpenAPI_list_free(access_token_req->target_snssai_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);
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;
if (access_token_req == NULL) {
ogs_error("OpenAPI_access_token_req_convertToJSON() failed [AccessTokenReq]");
return NULL;
}
item = cJSON_CreateObject();
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 (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 (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 (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 (cJSON_AddStringToObject(item, "scope", access_token_req->scope) == NULL) {
ogs_error("OpenAPI_access_token_req_convertToJSON() failed [scope]");
goto end;
}
if (access_token_req->target_nf_instance_id) {
if (cJSON_AddStringToObject(item, "targetNfInstanceId", access_token_req->target_nf_instance_id) == NULL) {
ogs_error("OpenAPI_access_token_req_convertToJSON() failed [target_nf_instance_id]");
goto end;
}
}
if (access_token_req->requester_plmn) {
cJSON *requester_plmn_local_JSON = OpenAPI_plmn_id_convertToJSON(access_token_req->requester_plmn);
if (requester_plmn_local_JSON == NULL) {
ogs_error("OpenAPI_access_token_req_convertToJSON() failed [requester_plmn]");
goto end;
}
cJSON_AddItemToObject(item, "requesterPlmn", requester_plmn_local_JSON);
if (item->child == NULL) {
ogs_error("OpenAPI_access_token_req_convertToJSON() failed [requester_plmn]");
goto end;
}
}
if (access_token_req->requester_plmn_list) {
cJSON *requester_plmn_listList = cJSON_AddArrayToObject(item, "requesterPlmnList");
if (requester_plmn_listList == NULL) {
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);
}
}
}
if (access_token_req->requester_snssai_list) {
cJSON *requester_snssai_listList = cJSON_AddArrayToObject(item, "requesterSnssaiList");
if (requester_snssai_listList == NULL) {
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);
}
}
}
if (access_token_req->requester_fqdn) {
if (cJSON_AddStringToObject(item, "requesterFqdn", access_token_req->requester_fqdn) == NULL) {
ogs_error("OpenAPI_access_token_req_convertToJSON() failed [requester_fqdn]");
goto end;
}
}
if (access_token_req->requester_snpn_list) {
cJSON *requester_snpn_listList = cJSON_AddArrayToObject(item, "requesterSnpnList");
if (requester_snpn_listList == NULL) {
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);
}
}
}
if (access_token_req->target_plmn) {
cJSON *target_plmn_local_JSON = OpenAPI_plmn_id_convertToJSON(access_token_req->target_plmn);
if (target_plmn_local_JSON == NULL) {
ogs_error("OpenAPI_access_token_req_convertToJSON() failed [target_plmn]");
goto end;
}
cJSON_AddItemToObject(item, "targetPlmn", target_plmn_local_JSON);
if (item->child == NULL) {
ogs_error("OpenAPI_access_token_req_convertToJSON() failed [target_plmn]");
goto end;
}
}
if (access_token_req->target_snssai_list) {
cJSON *target_snssai_listList = cJSON_AddArrayToObject(item, "targetSnssaiList");
if (target_snssai_listList == NULL) {
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);
}
}
}
if (access_token_req->target_nsi_list) {
cJSON *target_nsi_list = cJSON_AddArrayToObject(item, "targetNsiList");
if (target_nsi_list == 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;
}
}
}
if (access_token_req->target_nf_set_id) {
if (cJSON_AddStringToObject(item, "targetNfSetId", access_token_req->target_nf_set_id) == NULL) {
ogs_error("OpenAPI_access_token_req_convertToJSON() failed [target_nf_set_id]");
goto end;
}
}
if (access_token_req->target_nf_service_set_id) {
if (cJSON_AddStringToObject(item, "targetNfServiceSetId", access_token_req->target_nf_service_set_id) == NULL) {
ogs_error("OpenAPI_access_token_req_convertToJSON() failed [target_nf_service_set_id]");
goto end;
}
}
end:
return item;
}
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");
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");
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;
if (nf_type) {
if (!cJSON_IsString(nf_type)) {
ogs_error("OpenAPI_access_token_req_parseFromJSON() failed [nf_type]");
goto end;
}
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;
if (target_nf_type) {
if (!cJSON_IsString(target_nf_type)) {
ogs_error("OpenAPI_access_token_req_parseFromJSON() failed [target_nf_type]");
goto end;
}
target_nf_typeVariable = OpenAPI_nf_type_FromString(target_nf_type->valuestring);
}
cJSON *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");
if (target_nf_instance_id) {
if (!cJSON_IsString(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;
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;
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)) {
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);
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;
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)) {
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);
OpenAPI_list_add(requester_snssai_listList, requester_snssai_listItem);
}
}
cJSON *requester_fqdn = cJSON_GetObjectItemCaseSensitive(access_token_reqJSON, "requesterFqdn");
if (requester_fqdn) {
if (!cJSON_IsString(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;
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)) {
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);
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;
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;
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)) {
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);
OpenAPI_list_add(target_snssai_listList, target_snssai_listItem);
}
}
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_or_assert(target_nsi_list_local->valuestring));
}
}
cJSON *target_nf_set_id = cJSON_GetObjectItemCaseSensitive(access_token_reqJSON, "targetNfSetId");
if (target_nf_set_id) {
if (!cJSON_IsString(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");
if (target_nf_service_set_id) {
if (!cJSON_IsString(target_nf_service_set_id)) {
ogs_error("OpenAPI_access_token_req_parseFromJSON() failed [target_nf_service_set_id]");
goto end;
}
}
access_token_req_local_var = OpenAPI_access_token_req_create (
grant_typeVariable,
ogs_strdup_or_assert(nf_instance_id->valuestring),
nf_type ? nf_typeVariable : 0,
target_nf_type ? target_nf_typeVariable : 0,
ogs_strdup_or_assert(scope->valuestring),
target_nf_instance_id ? ogs_strdup_or_assert(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_or_assert(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_or_assert(target_nf_set_id->valuestring) : NULL,
target_nf_service_set_id ? ogs_strdup_or_assert(target_nf_service_set_id->valuestring) : NULL
);
return access_token_req_local_var;
end:
return NULL;
}
OpenAPI_access_token_req_t *OpenAPI_access_token_req_copy(OpenAPI_access_token_req_t *dst, OpenAPI_access_token_req_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_access_token_req_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_access_token_req_convertToJSON() failed");
return NULL;
}
content = cJSON_Print(item);
cJSON_Delete(item);
if (!content) {
ogs_error("cJSON_Print() failed");
return NULL;
}
item = cJSON_Parse(content);
ogs_free(content);
if (!item) {
ogs_error("cJSON_Parse() failed");
return NULL;
}
OpenAPI_access_token_req_free(dst);
dst = OpenAPI_access_token_req_parseFromJSON(item);
cJSON_Delete(item);
return dst;
}

View File

@ -0,0 +1,77 @@
/*
* access_token_req.h
*
* Contains information related to the access token request
*/
#ifndef _OpenAPI_access_token_req_H_
#define _OpenAPI_access_token_req_H_
#include <string.h>
#include "../external/cJSON.h"
#include "../include/list.h"
#include "../include/keyValuePair.h"
#include "../include/binary.h"
#include "nf_type.h"
#include "plmn_id.h"
#include "plmn_id_nid.h"
#include "snssai.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct OpenAPI_access_token_req_s OpenAPI_access_token_req_t;
typedef enum { OpenAPI_access_token_req_GRANTTYPE_NULL = 0, OpenAPI_access_token_req_GRANTTYPE_client_credentials } OpenAPI_access_token_req_grant_type_e;
char* OpenAPI_access_token_req_grant_type_ToString(OpenAPI_access_token_req_grant_type_e grant_type);
OpenAPI_access_token_req_grant_type_e OpenAPI_access_token_req_grant_type_FromString(char* grant_type);
typedef struct OpenAPI_access_token_req_s {
OpenAPI_access_token_req_grant_type_e grant_type;
char *nf_instance_id;
OpenAPI_nf_type_e nf_type;
OpenAPI_nf_type_e target_nf_type;
char *scope;
char *target_nf_instance_id;
struct OpenAPI_plmn_id_s *requester_plmn;
OpenAPI_list_t *requester_plmn_list;
OpenAPI_list_t *requester_snssai_list;
char *requester_fqdn;
OpenAPI_list_t *requester_snpn_list;
struct OpenAPI_plmn_id_s *target_plmn;
OpenAPI_list_t *target_snssai_list;
OpenAPI_list_t *target_nsi_list;
char *target_nf_set_id;
char *target_nf_service_set_id;
} OpenAPI_access_token_req_t;
OpenAPI_access_token_req_t *OpenAPI_access_token_req_create(
OpenAPI_access_token_req_grant_type_e grant_type,
char *nf_instance_id,
OpenAPI_nf_type_e nf_type,
OpenAPI_nf_type_e target_nf_type,
char *scope,
char *target_nf_instance_id,
OpenAPI_plmn_id_t *requester_plmn,
OpenAPI_list_t *requester_plmn_list,
OpenAPI_list_t *requester_snssai_list,
char *requester_fqdn,
OpenAPI_list_t *requester_snpn_list,
OpenAPI_plmn_id_t *target_plmn,
OpenAPI_list_t *target_snssai_list,
OpenAPI_list_t *target_nsi_list,
char *target_nf_set_id,
char *target_nf_service_set_id
);
void OpenAPI_access_token_req_free(OpenAPI_access_token_req_t *access_token_req);
OpenAPI_access_token_req_t *OpenAPI_access_token_req_parseFromJSON(cJSON *access_token_reqJSON);
cJSON *OpenAPI_access_token_req_convertToJSON(OpenAPI_access_token_req_t *access_token_req);
OpenAPI_access_token_req_t *OpenAPI_access_token_req_copy(OpenAPI_access_token_req_t *dst, OpenAPI_access_token_req_t *src);
#ifdef __cplusplus
}
#endif
#endif /* _OpenAPI_access_token_req_H_ */

View File

@ -1,7 +1,7 @@
/*
* access_type.h
*
*
*
*/
#ifndef _OpenAPI_access_type_H_

View File

@ -0,0 +1,85 @@
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "access_type_rm.h"
OpenAPI_access_type_rm_t *OpenAPI_access_type_rm_create(
)
{
OpenAPI_access_type_rm_t *access_type_rm_local_var = OpenAPI_malloc(sizeof(OpenAPI_access_type_rm_t));
if (!access_type_rm_local_var) {
return NULL;
}
return access_type_rm_local_var;
}
void OpenAPI_access_type_rm_free(OpenAPI_access_type_rm_t *access_type_rm)
{
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;
if (access_type_rm == NULL) {
ogs_error("OpenAPI_access_type_rm_convertToJSON() failed [AccessTypeRm]");
return NULL;
}
item = cJSON_CreateObject();
end:
return item;
}
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;
access_type_rm_local_var = OpenAPI_access_type_rm_create (
);
return access_type_rm_local_var;
end:
return NULL;
}
OpenAPI_access_type_rm_t *OpenAPI_access_type_rm_copy(OpenAPI_access_type_rm_t *dst, OpenAPI_access_type_rm_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_access_type_rm_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_access_type_rm_convertToJSON() failed");
return NULL;
}
content = cJSON_Print(item);
cJSON_Delete(item);
if (!content) {
ogs_error("cJSON_Print() failed");
return NULL;
}
item = cJSON_Parse(content);
ogs_free(content);
if (!item) {
ogs_error("cJSON_Parse() failed");
return NULL;
}
OpenAPI_access_type_rm_free(dst);
dst = OpenAPI_access_type_rm_parseFromJSON(item);
cJSON_Delete(item);
return dst;
}

View File

@ -0,0 +1,38 @@
/*
* access_type_rm.h
*
*
*/
#ifndef _OpenAPI_access_type_rm_H_
#define _OpenAPI_access_type_rm_H_
#include <string.h>
#include "../external/cJSON.h"
#include "../include/list.h"
#include "../include/keyValuePair.h"
#include "../include/binary.h"
#include "access_type.h"
#include "null_value.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct OpenAPI_access_type_rm_s OpenAPI_access_type_rm_t;
typedef struct OpenAPI_access_type_rm_s {
} OpenAPI_access_type_rm_t;
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_access_type_rm_t *OpenAPI_access_type_rm_parseFromJSON(cJSON *access_type_rmJSON);
cJSON *OpenAPI_access_type_rm_convertToJSON(OpenAPI_access_type_rm_t *access_type_rm);
OpenAPI_access_type_rm_t *OpenAPI_access_type_rm_copy(OpenAPI_access_type_rm_t *dst, OpenAPI_access_type_rm_t *src);
#ifdef __cplusplus
}
#endif
#endif /* _OpenAPI_access_type_rm_H_ */

View File

@ -14,7 +14,7 @@ OpenAPI_accu_usage_report_t *OpenAPI_accu_usage_report_create(
long next_vol_usage_uplink,
long next_vol_usage_downlink,
int next_time_usage
)
)
{
OpenAPI_accu_usage_report_t *accu_usage_report_local_var = OpenAPI_malloc(sizeof(OpenAPI_accu_usage_report_t));
if (!accu_usage_report_local_var) {
@ -59,59 +59,59 @@ cJSON *OpenAPI_accu_usage_report_convertToJSON(OpenAPI_accu_usage_report_t *accu
}
if (accu_usage_report->vol_usage) {
if (cJSON_AddNumberToObject(item, "volUsage", accu_usage_report->vol_usage) == NULL) {
ogs_error("OpenAPI_accu_usage_report_convertToJSON() failed [vol_usage]");
goto end;
}
if (cJSON_AddNumberToObject(item, "volUsage", accu_usage_report->vol_usage) == NULL) {
ogs_error("OpenAPI_accu_usage_report_convertToJSON() failed [vol_usage]");
goto end;
}
}
if (accu_usage_report->vol_usage_uplink) {
if (cJSON_AddNumberToObject(item, "volUsageUplink", accu_usage_report->vol_usage_uplink) == NULL) {
ogs_error("OpenAPI_accu_usage_report_convertToJSON() failed [vol_usage_uplink]");
goto end;
}
if (cJSON_AddNumberToObject(item, "volUsageUplink", accu_usage_report->vol_usage_uplink) == NULL) {
ogs_error("OpenAPI_accu_usage_report_convertToJSON() failed [vol_usage_uplink]");
goto end;
}
}
if (accu_usage_report->vol_usage_downlink) {
if (cJSON_AddNumberToObject(item, "volUsageDownlink", accu_usage_report->vol_usage_downlink) == NULL) {
ogs_error("OpenAPI_accu_usage_report_convertToJSON() failed [vol_usage_downlink]");
goto end;
}
if (cJSON_AddNumberToObject(item, "volUsageDownlink", accu_usage_report->vol_usage_downlink) == NULL) {
ogs_error("OpenAPI_accu_usage_report_convertToJSON() failed [vol_usage_downlink]");
goto end;
}
}
if (accu_usage_report->time_usage) {
if (cJSON_AddNumberToObject(item, "timeUsage", accu_usage_report->time_usage) == NULL) {
ogs_error("OpenAPI_accu_usage_report_convertToJSON() failed [time_usage]");
goto end;
}
if (cJSON_AddNumberToObject(item, "timeUsage", accu_usage_report->time_usage) == NULL) {
ogs_error("OpenAPI_accu_usage_report_convertToJSON() failed [time_usage]");
goto end;
}
}
if (accu_usage_report->next_vol_usage) {
if (cJSON_AddNumberToObject(item, "nextVolUsage", accu_usage_report->next_vol_usage) == NULL) {
ogs_error("OpenAPI_accu_usage_report_convertToJSON() failed [next_vol_usage]");
goto end;
}
if (cJSON_AddNumberToObject(item, "nextVolUsage", accu_usage_report->next_vol_usage) == NULL) {
ogs_error("OpenAPI_accu_usage_report_convertToJSON() failed [next_vol_usage]");
goto end;
}
}
if (accu_usage_report->next_vol_usage_uplink) {
if (cJSON_AddNumberToObject(item, "nextVolUsageUplink", accu_usage_report->next_vol_usage_uplink) == NULL) {
ogs_error("OpenAPI_accu_usage_report_convertToJSON() failed [next_vol_usage_uplink]");
goto end;
}
if (cJSON_AddNumberToObject(item, "nextVolUsageUplink", accu_usage_report->next_vol_usage_uplink) == NULL) {
ogs_error("OpenAPI_accu_usage_report_convertToJSON() failed [next_vol_usage_uplink]");
goto end;
}
}
if (accu_usage_report->next_vol_usage_downlink) {
if (cJSON_AddNumberToObject(item, "nextVolUsageDownlink", accu_usage_report->next_vol_usage_downlink) == NULL) {
ogs_error("OpenAPI_accu_usage_report_convertToJSON() failed [next_vol_usage_downlink]");
goto end;
}
if (cJSON_AddNumberToObject(item, "nextVolUsageDownlink", accu_usage_report->next_vol_usage_downlink) == NULL) {
ogs_error("OpenAPI_accu_usage_report_convertToJSON() failed [next_vol_usage_downlink]");
goto end;
}
}
if (accu_usage_report->next_time_usage) {
if (cJSON_AddNumberToObject(item, "nextTimeUsage", accu_usage_report->next_time_usage) == NULL) {
ogs_error("OpenAPI_accu_usage_report_convertToJSON() failed [next_time_usage]");
goto end;
}
if (cJSON_AddNumberToObject(item, "nextTimeUsage", accu_usage_report->next_time_usage) == NULL) {
ogs_error("OpenAPI_accu_usage_report_convertToJSON() failed [next_time_usage]");
goto end;
}
}
end:
@ -127,7 +127,7 @@ OpenAPI_accu_usage_report_t *OpenAPI_accu_usage_report_parseFromJSON(cJSON *accu
goto end;
}
if (!cJSON_IsString(ref_um_ids)) {
ogs_error("OpenAPI_accu_usage_report_parseFromJSON() failed [ref_um_ids]");
goto end;
@ -135,75 +135,75 @@ OpenAPI_accu_usage_report_t *OpenAPI_accu_usage_report_parseFromJSON(cJSON *accu
cJSON *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]");
goto end;
}
if (vol_usage) {
if (!cJSON_IsNumber(vol_usage)) {
ogs_error("OpenAPI_accu_usage_report_parseFromJSON() failed [vol_usage]");
goto end;
}
}
cJSON *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]");
goto end;
}
if (vol_usage_uplink) {
if (!cJSON_IsNumber(vol_usage_uplink)) {
ogs_error("OpenAPI_accu_usage_report_parseFromJSON() failed [vol_usage_uplink]");
goto end;
}
}
cJSON *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]");
goto end;
}
if (vol_usage_downlink) {
if (!cJSON_IsNumber(vol_usage_downlink)) {
ogs_error("OpenAPI_accu_usage_report_parseFromJSON() failed [vol_usage_downlink]");
goto end;
}
}
cJSON *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]");
goto end;
}
if (time_usage) {
if (!cJSON_IsNumber(time_usage)) {
ogs_error("OpenAPI_accu_usage_report_parseFromJSON() failed [time_usage]");
goto end;
}
}
cJSON *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]");
goto end;
}
if (next_vol_usage) {
if (!cJSON_IsNumber(next_vol_usage)) {
ogs_error("OpenAPI_accu_usage_report_parseFromJSON() failed [next_vol_usage]");
goto end;
}
}
cJSON *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]");
goto end;
}
if (next_vol_usage_uplink) {
if (!cJSON_IsNumber(next_vol_usage_uplink)) {
ogs_error("OpenAPI_accu_usage_report_parseFromJSON() failed [next_vol_usage_uplink]");
goto end;
}
}
cJSON *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]");
goto end;
}
if (next_vol_usage_downlink) {
if (!cJSON_IsNumber(next_vol_usage_downlink)) {
ogs_error("OpenAPI_accu_usage_report_parseFromJSON() failed [next_vol_usage_downlink]");
goto end;
}
}
cJSON *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]");
goto end;
}
if (next_time_usage) {
if (!cJSON_IsNumber(next_time_usage)) {
ogs_error("OpenAPI_accu_usage_report_parseFromJSON() failed [next_time_usage]");
goto end;
}
}
accu_usage_report_local_var = OpenAPI_accu_usage_report_create (
ogs_strdup_or_assert(ref_um_ids->valuestring),
@ -215,7 +215,7 @@ OpenAPI_accu_usage_report_t *OpenAPI_accu_usage_report_parseFromJSON(cJSON *accu
next_vol_usage_uplink ? next_vol_usage_uplink->valuedouble : 0,
next_vol_usage_downlink ? next_vol_usage_downlink->valuedouble : 0,
next_time_usage ? next_time_usage->valuedouble : 0
);
);
return accu_usage_report_local_var;
end:

View File

@ -1,7 +1,7 @@
/*
* accu_usage_report.h
*
*
*
*/
#ifndef _OpenAPI_accu_usage_report_H_
@ -40,7 +40,7 @@ OpenAPI_accu_usage_report_t *OpenAPI_accu_usage_report_create(
long next_vol_usage_uplink,
long next_vol_usage_downlink,
int next_time_usage
);
);
void OpenAPI_accu_usage_report_free(OpenAPI_accu_usage_report_t *accu_usage_report);
OpenAPI_accu_usage_report_t *OpenAPI_accu_usage_report_parseFromJSON(cJSON *accu_usage_reportJSON);
cJSON *OpenAPI_accu_usage_report_convertToJSON(OpenAPI_accu_usage_report_t *accu_usage_report);

View File

@ -9,7 +9,7 @@ OpenAPI_accumulated_usage_t *OpenAPI_accumulated_usage_create(
long total_volume,
long downlink_volume,
long uplink_volume
)
)
{
OpenAPI_accumulated_usage_t *accumulated_usage_local_var = OpenAPI_malloc(sizeof(OpenAPI_accumulated_usage_t));
if (!accumulated_usage_local_var) {
@ -43,31 +43,31 @@ cJSON *OpenAPI_accumulated_usage_convertToJSON(OpenAPI_accumulated_usage_t *accu
item = cJSON_CreateObject();
if (accumulated_usage->duration) {
if (cJSON_AddNumberToObject(item, "duration", accumulated_usage->duration) == NULL) {
ogs_error("OpenAPI_accumulated_usage_convertToJSON() failed [duration]");
goto end;
}
if (cJSON_AddNumberToObject(item, "duration", accumulated_usage->duration) == NULL) {
ogs_error("OpenAPI_accumulated_usage_convertToJSON() failed [duration]");
goto end;
}
}
if (accumulated_usage->total_volume) {
if (cJSON_AddNumberToObject(item, "totalVolume", accumulated_usage->total_volume) == NULL) {
ogs_error("OpenAPI_accumulated_usage_convertToJSON() failed [total_volume]");
goto end;
}
if (cJSON_AddNumberToObject(item, "totalVolume", accumulated_usage->total_volume) == NULL) {
ogs_error("OpenAPI_accumulated_usage_convertToJSON() failed [total_volume]");
goto end;
}
}
if (accumulated_usage->downlink_volume) {
if (cJSON_AddNumberToObject(item, "downlinkVolume", accumulated_usage->downlink_volume) == NULL) {
ogs_error("OpenAPI_accumulated_usage_convertToJSON() failed [downlink_volume]");
goto end;
}
if (cJSON_AddNumberToObject(item, "downlinkVolume", accumulated_usage->downlink_volume) == NULL) {
ogs_error("OpenAPI_accumulated_usage_convertToJSON() failed [downlink_volume]");
goto end;
}
}
if (accumulated_usage->uplink_volume) {
if (cJSON_AddNumberToObject(item, "uplinkVolume", accumulated_usage->uplink_volume) == NULL) {
ogs_error("OpenAPI_accumulated_usage_convertToJSON() failed [uplink_volume]");
goto end;
}
if (cJSON_AddNumberToObject(item, "uplinkVolume", accumulated_usage->uplink_volume) == NULL) {
ogs_error("OpenAPI_accumulated_usage_convertToJSON() failed [uplink_volume]");
goto end;
}
}
end:
@ -79,46 +79,46 @@ OpenAPI_accumulated_usage_t *OpenAPI_accumulated_usage_parseFromJSON(cJSON *accu
OpenAPI_accumulated_usage_t *accumulated_usage_local_var = NULL;
cJSON *duration = cJSON_GetObjectItemCaseSensitive(accumulated_usageJSON, "duration");
if (duration) {
if (!cJSON_IsNumber(duration)) {
ogs_error("OpenAPI_accumulated_usage_parseFromJSON() failed [duration]");
goto end;
}
if (duration) {
if (!cJSON_IsNumber(duration)) {
ogs_error("OpenAPI_accumulated_usage_parseFromJSON() failed [duration]");
goto end;
}
}
cJSON *total_volume = cJSON_GetObjectItemCaseSensitive(accumulated_usageJSON, "totalVolume");
if (total_volume) {
if (!cJSON_IsNumber(total_volume)) {
ogs_error("OpenAPI_accumulated_usage_parseFromJSON() failed [total_volume]");
goto end;
}
if (total_volume) {
if (!cJSON_IsNumber(total_volume)) {
ogs_error("OpenAPI_accumulated_usage_parseFromJSON() failed [total_volume]");
goto end;
}
}
cJSON *downlink_volume = cJSON_GetObjectItemCaseSensitive(accumulated_usageJSON, "downlinkVolume");
if (downlink_volume) {
if (!cJSON_IsNumber(downlink_volume)) {
ogs_error("OpenAPI_accumulated_usage_parseFromJSON() failed [downlink_volume]");
goto end;
}
if (downlink_volume) {
if (!cJSON_IsNumber(downlink_volume)) {
ogs_error("OpenAPI_accumulated_usage_parseFromJSON() failed [downlink_volume]");
goto end;
}
}
cJSON *uplink_volume = cJSON_GetObjectItemCaseSensitive(accumulated_usageJSON, "uplinkVolume");
if (uplink_volume) {
if (!cJSON_IsNumber(uplink_volume)) {
ogs_error("OpenAPI_accumulated_usage_parseFromJSON() failed [uplink_volume]");
goto end;
}
if (uplink_volume) {
if (!cJSON_IsNumber(uplink_volume)) {
ogs_error("OpenAPI_accumulated_usage_parseFromJSON() failed [uplink_volume]");
goto end;
}
}
accumulated_usage_local_var = OpenAPI_accumulated_usage_create (
duration ? duration->valuedouble : 0,
total_volume ? total_volume->valuedouble : 0,
downlink_volume ? downlink_volume->valuedouble : 0,
uplink_volume ? uplink_volume->valuedouble : 0
);
);
return accumulated_usage_local_var;
end:

View File

@ -1,7 +1,7 @@
/*
* accumulated_usage.h
*
*
*
*/
#ifndef _OpenAPI_accumulated_usage_H_
@ -30,7 +30,7 @@ OpenAPI_accumulated_usage_t *OpenAPI_accumulated_usage_create(
long total_volume,
long downlink_volume,
long uplink_volume
);
);
void OpenAPI_accumulated_usage_free(OpenAPI_accumulated_usage_t *accumulated_usage);
OpenAPI_accumulated_usage_t *OpenAPI_accumulated_usage_parseFromJSON(cJSON *accumulated_usageJSON);
cJSON *OpenAPI_accumulated_usage_convertToJSON(OpenAPI_accumulated_usage_t *accumulated_usage);

View File

@ -8,8 +8,9 @@ OpenAPI_acknowledge_info_t *OpenAPI_acknowledge_info_create(
char *sor_mac_iue,
char *upu_mac_iue,
char *secured_packet,
char *provisioning_time
)
char *provisioning_time,
int ue_not_reachable
)
{
OpenAPI_acknowledge_info_t *acknowledge_info_local_var = OpenAPI_malloc(sizeof(OpenAPI_acknowledge_info_t));
if (!acknowledge_info_local_var) {
@ -19,6 +20,7 @@ OpenAPI_acknowledge_info_t *OpenAPI_acknowledge_info_create(
acknowledge_info_local_var->upu_mac_iue = upu_mac_iue;
acknowledge_info_local_var->secured_packet = secured_packet;
acknowledge_info_local_var->provisioning_time = provisioning_time;
acknowledge_info_local_var->ue_not_reachable = ue_not_reachable;
return acknowledge_info_local_var;
}
@ -47,24 +49,24 @@ cJSON *OpenAPI_acknowledge_info_convertToJSON(OpenAPI_acknowledge_info_t *acknow
item = cJSON_CreateObject();
if (acknowledge_info->sor_mac_iue) {
if (cJSON_AddStringToObject(item, "sorMacIue", acknowledge_info->sor_mac_iue) == NULL) {
ogs_error("OpenAPI_acknowledge_info_convertToJSON() failed [sor_mac_iue]");
goto end;
}
if (cJSON_AddStringToObject(item, "sorMacIue", acknowledge_info->sor_mac_iue) == NULL) {
ogs_error("OpenAPI_acknowledge_info_convertToJSON() failed [sor_mac_iue]");
goto end;
}
}
if (acknowledge_info->upu_mac_iue) {
if (cJSON_AddStringToObject(item, "upuMacIue", acknowledge_info->upu_mac_iue) == NULL) {
ogs_error("OpenAPI_acknowledge_info_convertToJSON() failed [upu_mac_iue]");
goto end;
}
if (cJSON_AddStringToObject(item, "upuMacIue", acknowledge_info->upu_mac_iue) == NULL) {
ogs_error("OpenAPI_acknowledge_info_convertToJSON() failed [upu_mac_iue]");
goto end;
}
}
if (acknowledge_info->secured_packet) {
if (cJSON_AddStringToObject(item, "securedPacket", acknowledge_info->secured_packet) == NULL) {
ogs_error("OpenAPI_acknowledge_info_convertToJSON() failed [secured_packet]");
goto end;
}
if (cJSON_AddStringToObject(item, "securedPacket", acknowledge_info->secured_packet) == NULL) {
ogs_error("OpenAPI_acknowledge_info_convertToJSON() failed [secured_packet]");
goto end;
}
}
if (cJSON_AddStringToObject(item, "provisioningTime", acknowledge_info->provisioning_time) == NULL) {
@ -72,6 +74,13 @@ cJSON *OpenAPI_acknowledge_info_convertToJSON(OpenAPI_acknowledge_info_t *acknow
goto end;
}
if (acknowledge_info->ue_not_reachable) {
if (cJSON_AddBoolToObject(item, "ueNotReachable", acknowledge_info->ue_not_reachable) == NULL) {
ogs_error("OpenAPI_acknowledge_info_convertToJSON() failed [ue_not_reachable]");
goto end;
}
}
end:
return item;
}
@ -81,30 +90,30 @@ OpenAPI_acknowledge_info_t *OpenAPI_acknowledge_info_parseFromJSON(cJSON *acknow
OpenAPI_acknowledge_info_t *acknowledge_info_local_var = NULL;
cJSON *sor_mac_iue = cJSON_GetObjectItemCaseSensitive(acknowledge_infoJSON, "sorMacIue");
if (sor_mac_iue) {
if (!cJSON_IsString(sor_mac_iue)) {
ogs_error("OpenAPI_acknowledge_info_parseFromJSON() failed [sor_mac_iue]");
goto end;
}
if (sor_mac_iue) {
if (!cJSON_IsString(sor_mac_iue)) {
ogs_error("OpenAPI_acknowledge_info_parseFromJSON() failed [sor_mac_iue]");
goto end;
}
}
cJSON *upu_mac_iue = cJSON_GetObjectItemCaseSensitive(acknowledge_infoJSON, "upuMacIue");
if (upu_mac_iue) {
if (!cJSON_IsString(upu_mac_iue)) {
ogs_error("OpenAPI_acknowledge_info_parseFromJSON() failed [upu_mac_iue]");
goto end;
}
if (upu_mac_iue) {
if (!cJSON_IsString(upu_mac_iue)) {
ogs_error("OpenAPI_acknowledge_info_parseFromJSON() failed [upu_mac_iue]");
goto end;
}
}
cJSON *secured_packet = cJSON_GetObjectItemCaseSensitive(acknowledge_infoJSON, "securedPacket");
if (secured_packet) {
if (!cJSON_IsString(secured_packet)) {
ogs_error("OpenAPI_acknowledge_info_parseFromJSON() failed [secured_packet]");
goto end;
}
if (secured_packet) {
if (!cJSON_IsString(secured_packet)) {
ogs_error("OpenAPI_acknowledge_info_parseFromJSON() failed [secured_packet]");
goto end;
}
}
cJSON *provisioning_time = cJSON_GetObjectItemCaseSensitive(acknowledge_infoJSON, "provisioningTime");
if (!provisioning_time) {
@ -112,18 +121,28 @@ OpenAPI_acknowledge_info_t *OpenAPI_acknowledge_info_parseFromJSON(cJSON *acknow
goto end;
}
if (!cJSON_IsString(provisioning_time)) {
ogs_error("OpenAPI_acknowledge_info_parseFromJSON() failed [provisioning_time]");
goto end;
}
cJSON *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]");
goto end;
}
}
acknowledge_info_local_var = OpenAPI_acknowledge_info_create (
sor_mac_iue ? ogs_strdup_or_assert(sor_mac_iue->valuestring) : NULL,
upu_mac_iue ? ogs_strdup_or_assert(upu_mac_iue->valuestring) : NULL,
secured_packet ? ogs_strdup_or_assert(secured_packet->valuestring) : NULL,
ogs_strdup_or_assert(provisioning_time->valuestring)
);
ogs_strdup_or_assert(provisioning_time->valuestring),
ue_not_reachable ? ue_not_reachable->valueint : 0
);
return acknowledge_info_local_var;
end:

View File

@ -1,7 +1,7 @@
/*
* acknowledge_info.h
*
*
*
*/
#ifndef _OpenAPI_acknowledge_info_H_
@ -23,14 +23,16 @@ typedef struct OpenAPI_acknowledge_info_s {
char *upu_mac_iue;
char *secured_packet;
char *provisioning_time;
int ue_not_reachable;
} OpenAPI_acknowledge_info_t;
OpenAPI_acknowledge_info_t *OpenAPI_acknowledge_info_create(
char *sor_mac_iue,
char *upu_mac_iue,
char *secured_packet,
char *provisioning_time
);
char *provisioning_time,
int ue_not_reachable
);
void OpenAPI_acknowledge_info_free(OpenAPI_acknowledge_info_t *acknowledge_info);
OpenAPI_acknowledge_info_t *OpenAPI_acknowledge_info_parseFromJSON(cJSON *acknowledge_infoJSON);
cJSON *OpenAPI_acknowledge_info_convertToJSON(OpenAPI_acknowledge_info_t *acknowledge_info);

View File

@ -8,7 +8,7 @@ OpenAPI_acs_info_t *OpenAPI_acs_info_create(
char *acs_url,
char *acs_ipv4_addr,
char *acs_ipv6_addr
)
)
{
OpenAPI_acs_info_t *acs_info_local_var = OpenAPI_malloc(sizeof(OpenAPI_acs_info_t));
if (!acs_info_local_var) {
@ -44,24 +44,24 @@ cJSON *OpenAPI_acs_info_convertToJSON(OpenAPI_acs_info_t *acs_info)
item = cJSON_CreateObject();
if (acs_info->acs_url) {
if (cJSON_AddStringToObject(item, "acsUrl", acs_info->acs_url) == NULL) {
ogs_error("OpenAPI_acs_info_convertToJSON() failed [acs_url]");
goto end;
}
if (cJSON_AddStringToObject(item, "acsUrl", acs_info->acs_url) == NULL) {
ogs_error("OpenAPI_acs_info_convertToJSON() failed [acs_url]");
goto end;
}
}
if (acs_info->acs_ipv4_addr) {
if (cJSON_AddStringToObject(item, "acsIpv4Addr", acs_info->acs_ipv4_addr) == NULL) {
ogs_error("OpenAPI_acs_info_convertToJSON() failed [acs_ipv4_addr]");
goto end;
}
if (cJSON_AddStringToObject(item, "acsIpv4Addr", acs_info->acs_ipv4_addr) == NULL) {
ogs_error("OpenAPI_acs_info_convertToJSON() failed [acs_ipv4_addr]");
goto end;
}
}
if (acs_info->acs_ipv6_addr) {
if (cJSON_AddStringToObject(item, "acsIpv6Addr", acs_info->acs_ipv6_addr) == NULL) {
ogs_error("OpenAPI_acs_info_convertToJSON() failed [acs_ipv6_addr]");
goto end;
}
if (cJSON_AddStringToObject(item, "acsIpv6Addr", acs_info->acs_ipv6_addr) == NULL) {
ogs_error("OpenAPI_acs_info_convertToJSON() failed [acs_ipv6_addr]");
goto end;
}
}
end:
@ -73,36 +73,36 @@ 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");
if (acs_url) {
if (!cJSON_IsString(acs_url)) {
ogs_error("OpenAPI_acs_info_parseFromJSON() failed [acs_url]");
goto end;
}
if (acs_url) {
if (!cJSON_IsString(acs_url)) {
ogs_error("OpenAPI_acs_info_parseFromJSON() failed [acs_url]");
goto end;
}
}
cJSON *acs_ipv4_addr = cJSON_GetObjectItemCaseSensitive(acs_infoJSON, "acsIpv4Addr");
if (acs_ipv4_addr) {
if (!cJSON_IsString(acs_ipv4_addr)) {
ogs_error("OpenAPI_acs_info_parseFromJSON() failed [acs_ipv4_addr]");
goto end;
}
if (acs_ipv4_addr) {
if (!cJSON_IsString(acs_ipv4_addr)) {
ogs_error("OpenAPI_acs_info_parseFromJSON() failed [acs_ipv4_addr]");
goto end;
}
}
cJSON *acs_ipv6_addr = cJSON_GetObjectItemCaseSensitive(acs_infoJSON, "acsIpv6Addr");
if (acs_ipv6_addr) {
if (!cJSON_IsString(acs_ipv6_addr)) {
ogs_error("OpenAPI_acs_info_parseFromJSON() failed [acs_ipv6_addr]");
goto end;
}
if (acs_ipv6_addr) {
if (!cJSON_IsString(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_or_assert(acs_url->valuestring) : NULL,
acs_ipv4_addr ? ogs_strdup_or_assert(acs_ipv4_addr->valuestring) : NULL,
acs_ipv6_addr ? ogs_strdup_or_assert(acs_ipv6_addr->valuestring) : NULL
);
);
return acs_info_local_var;
end:

View File

@ -1,7 +1,7 @@
/*
* acs_info.h
*
*
*
*/
#ifndef _OpenAPI_acs_info_H_
@ -28,7 +28,7 @@ OpenAPI_acs_info_t *OpenAPI_acs_info_create(
char *acs_url,
char *acs_ipv4_addr,
char *acs_ipv6_addr
);
);
void OpenAPI_acs_info_free(OpenAPI_acs_info_t *acs_info);
OpenAPI_acs_info_t *OpenAPI_acs_info_parseFromJSON(cJSON *acs_infoJSON);
cJSON *OpenAPI_acs_info_convertToJSON(OpenAPI_acs_info_t *acs_info);

View File

@ -0,0 +1,145 @@
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "acs_info_1.h"
OpenAPI_acs_info_1_t *OpenAPI_acs_info_1_create(
char *acs_url,
char *acs_ipv4_addr,
char *acs_ipv6_addr
)
{
OpenAPI_acs_info_1_t *acs_info_1_local_var = OpenAPI_malloc(sizeof(OpenAPI_acs_info_1_t));
if (!acs_info_1_local_var) {
return NULL;
}
acs_info_1_local_var->acs_url = acs_url;
acs_info_1_local_var->acs_ipv4_addr = acs_ipv4_addr;
acs_info_1_local_var->acs_ipv6_addr = acs_ipv6_addr;
return acs_info_1_local_var;
}
void OpenAPI_acs_info_1_free(OpenAPI_acs_info_1_t *acs_info_1)
{
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);
ogs_free(acs_info_1);
}
cJSON *OpenAPI_acs_info_1_convertToJSON(OpenAPI_acs_info_1_t *acs_info_1)
{
cJSON *item = NULL;
if (acs_info_1 == NULL) {
ogs_error("OpenAPI_acs_info_1_convertToJSON() failed [AcsInfo_1]");
return NULL;
}
item = cJSON_CreateObject();
if (acs_info_1->acs_url) {
if (cJSON_AddStringToObject(item, "acsUrl", acs_info_1->acs_url) == NULL) {
ogs_error("OpenAPI_acs_info_1_convertToJSON() failed [acs_url]");
goto end;
}
}
if (acs_info_1->acs_ipv4_addr) {
if (cJSON_AddStringToObject(item, "acsIpv4Addr", acs_info_1->acs_ipv4_addr) == NULL) {
ogs_error("OpenAPI_acs_info_1_convertToJSON() failed [acs_ipv4_addr]");
goto end;
}
}
if (acs_info_1->acs_ipv6_addr) {
if (cJSON_AddStringToObject(item, "acsIpv6Addr", acs_info_1->acs_ipv6_addr) == NULL) {
ogs_error("OpenAPI_acs_info_1_convertToJSON() failed [acs_ipv6_addr]");
goto end;
}
}
end:
return item;
}
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");
if (acs_url) {
if (!cJSON_IsString(acs_url)) {
ogs_error("OpenAPI_acs_info_1_parseFromJSON() failed [acs_url]");
goto end;
}
}
cJSON *acs_ipv4_addr = cJSON_GetObjectItemCaseSensitive(acs_info_1JSON, "acsIpv4Addr");
if (acs_ipv4_addr) {
if (!cJSON_IsString(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");
if (acs_ipv6_addr) {
if (!cJSON_IsString(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_or_assert(acs_url->valuestring) : NULL,
acs_ipv4_addr ? ogs_strdup_or_assert(acs_ipv4_addr->valuestring) : NULL,
acs_ipv6_addr ? ogs_strdup_or_assert(acs_ipv6_addr->valuestring) : NULL
);
return acs_info_1_local_var;
end:
return NULL;
}
OpenAPI_acs_info_1_t *OpenAPI_acs_info_1_copy(OpenAPI_acs_info_1_t *dst, OpenAPI_acs_info_1_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_acs_info_1_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_acs_info_1_convertToJSON() failed");
return NULL;
}
content = cJSON_Print(item);
cJSON_Delete(item);
if (!content) {
ogs_error("cJSON_Print() failed");
return NULL;
}
item = cJSON_Parse(content);
ogs_free(content);
if (!item) {
ogs_error("cJSON_Parse() failed");
return NULL;
}
OpenAPI_acs_info_1_free(dst);
dst = OpenAPI_acs_info_1_parseFromJSON(item);
cJSON_Delete(item);
return dst;
}

View File

@ -0,0 +1,42 @@
/*
* acs_info_1.h
*
*
*/
#ifndef _OpenAPI_acs_info_1_H_
#define _OpenAPI_acs_info_1_H_
#include <string.h>
#include "../external/cJSON.h"
#include "../include/list.h"
#include "../include/keyValuePair.h"
#include "../include/binary.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct OpenAPI_acs_info_1_s OpenAPI_acs_info_1_t;
typedef struct OpenAPI_acs_info_1_s {
char *acs_url;
char *acs_ipv4_addr;
char *acs_ipv6_addr;
} OpenAPI_acs_info_1_t;
OpenAPI_acs_info_1_t *OpenAPI_acs_info_1_create(
char *acs_url,
char *acs_ipv4_addr,
char *acs_ipv6_addr
);
void OpenAPI_acs_info_1_free(OpenAPI_acs_info_1_t *acs_info_1);
OpenAPI_acs_info_1_t *OpenAPI_acs_info_1_parseFromJSON(cJSON *acs_info_1JSON);
cJSON *OpenAPI_acs_info_1_convertToJSON(OpenAPI_acs_info_1_t *acs_info_1);
OpenAPI_acs_info_1_t *OpenAPI_acs_info_1_copy(OpenAPI_acs_info_1_t *dst, OpenAPI_acs_info_1_t *src);
#ifdef __cplusplus
}
#endif
#endif /* _OpenAPI_acs_info_1_H_ */

View File

@ -8,7 +8,7 @@ OpenAPI_acs_info_rm_t *OpenAPI_acs_info_rm_create(
char *acs_url,
char *acs_ipv4_addr,
char *acs_ipv6_addr
)
)
{
OpenAPI_acs_info_rm_t *acs_info_rm_local_var = OpenAPI_malloc(sizeof(OpenAPI_acs_info_rm_t));
if (!acs_info_rm_local_var) {
@ -44,24 +44,24 @@ cJSON *OpenAPI_acs_info_rm_convertToJSON(OpenAPI_acs_info_rm_t *acs_info_rm)
item = cJSON_CreateObject();
if (acs_info_rm->acs_url) {
if (cJSON_AddStringToObject(item, "acsUrl", acs_info_rm->acs_url) == NULL) {
ogs_error("OpenAPI_acs_info_rm_convertToJSON() failed [acs_url]");
goto end;
}
if (cJSON_AddStringToObject(item, "acsUrl", acs_info_rm->acs_url) == NULL) {
ogs_error("OpenAPI_acs_info_rm_convertToJSON() failed [acs_url]");
goto end;
}
}
if (acs_info_rm->acs_ipv4_addr) {
if (cJSON_AddStringToObject(item, "acsIpv4Addr", acs_info_rm->acs_ipv4_addr) == NULL) {
ogs_error("OpenAPI_acs_info_rm_convertToJSON() failed [acs_ipv4_addr]");
goto end;
}
if (cJSON_AddStringToObject(item, "acsIpv4Addr", acs_info_rm->acs_ipv4_addr) == NULL) {
ogs_error("OpenAPI_acs_info_rm_convertToJSON() failed [acs_ipv4_addr]");
goto end;
}
}
if (acs_info_rm->acs_ipv6_addr) {
if (cJSON_AddStringToObject(item, "acsIpv6Addr", acs_info_rm->acs_ipv6_addr) == NULL) {
ogs_error("OpenAPI_acs_info_rm_convertToJSON() failed [acs_ipv6_addr]");
goto end;
}
if (cJSON_AddStringToObject(item, "acsIpv6Addr", acs_info_rm->acs_ipv6_addr) == NULL) {
ogs_error("OpenAPI_acs_info_rm_convertToJSON() failed [acs_ipv6_addr]");
goto end;
}
}
end:
@ -73,36 +73,36 @@ 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");
if (acs_url) {
if (!cJSON_IsString(acs_url)) {
ogs_error("OpenAPI_acs_info_rm_parseFromJSON() failed [acs_url]");
goto end;
}
if (acs_url) {
if (!cJSON_IsString(acs_url)) {
ogs_error("OpenAPI_acs_info_rm_parseFromJSON() failed [acs_url]");
goto end;
}
}
cJSON *acs_ipv4_addr = cJSON_GetObjectItemCaseSensitive(acs_info_rmJSON, "acsIpv4Addr");
if (acs_ipv4_addr) {
if (!cJSON_IsString(acs_ipv4_addr)) {
ogs_error("OpenAPI_acs_info_rm_parseFromJSON() failed [acs_ipv4_addr]");
goto end;
}
if (acs_ipv4_addr) {
if (!cJSON_IsString(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");
if (acs_ipv6_addr) {
if (!cJSON_IsString(acs_ipv6_addr)) {
ogs_error("OpenAPI_acs_info_rm_parseFromJSON() failed [acs_ipv6_addr]");
goto end;
}
if (acs_ipv6_addr) {
if (!cJSON_IsString(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_or_assert(acs_url->valuestring) : NULL,
acs_ipv4_addr ? ogs_strdup_or_assert(acs_ipv4_addr->valuestring) : NULL,
acs_ipv6_addr ? ogs_strdup_or_assert(acs_ipv6_addr->valuestring) : NULL
);
);
return acs_info_rm_local_var;
end:

View File

@ -1,7 +1,7 @@
/*
* acs_info_rm.h
*
*
*
*/
#ifndef _OpenAPI_acs_info_rm_H_
@ -30,7 +30,7 @@ OpenAPI_acs_info_rm_t *OpenAPI_acs_info_rm_create(
char *acs_url,
char *acs_ipv4_addr,
char *acs_ipv6_addr
);
);
void OpenAPI_acs_info_rm_free(OpenAPI_acs_info_rm_t *acs_info_rm);
OpenAPI_acs_info_rm_t *OpenAPI_acs_info_rm_parseFromJSON(cJSON *acs_info_rmJSON);
cJSON *OpenAPI_acs_info_rm_convertToJSON(OpenAPI_acs_info_rm_t *acs_info_rm);

View File

@ -7,7 +7,7 @@
OpenAPI_additional_access_info_t *OpenAPI_additional_access_info_create(
OpenAPI_access_type_e access_type,
OpenAPI_rat_type_e rat_type
)
)
{
OpenAPI_additional_access_info_t *additional_access_info_local_var = OpenAPI_malloc(sizeof(OpenAPI_additional_access_info_t));
if (!additional_access_info_local_var) {
@ -44,10 +44,10 @@ cJSON *OpenAPI_additional_access_info_convertToJSON(OpenAPI_additional_access_in
}
if (additional_access_info->rat_type) {
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;
}
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;
}
}
end:
@ -64,7 +64,7 @@ OpenAPI_additional_access_info_t *OpenAPI_additional_access_info_parseFromJSON(c
}
OpenAPI_access_type_e access_typeVariable;
if (!cJSON_IsString(access_type)) {
ogs_error("OpenAPI_additional_access_info_parseFromJSON() failed [access_type]");
goto end;
@ -74,18 +74,18 @@ OpenAPI_additional_access_info_t *OpenAPI_additional_access_info_parseFromJSON(c
cJSON *rat_type = cJSON_GetObjectItemCaseSensitive(additional_access_infoJSON, "ratType");
OpenAPI_rat_type_e rat_typeVariable;
if (rat_type) {
if (!cJSON_IsString(rat_type)) {
ogs_error("OpenAPI_additional_access_info_parseFromJSON() failed [rat_type]");
goto end;
}
rat_typeVariable = OpenAPI_rat_type_FromString(rat_type->valuestring);
if (rat_type) {
if (!cJSON_IsString(rat_type)) {
ogs_error("OpenAPI_additional_access_info_parseFromJSON() failed [rat_type]");
goto end;
}
rat_typeVariable = OpenAPI_rat_type_FromString(rat_type->valuestring);
}
additional_access_info_local_var = OpenAPI_additional_access_info_create (
access_typeVariable,
rat_type ? rat_typeVariable : 0
);
);
return additional_access_info_local_var;
end:

View File

@ -1,7 +1,7 @@
/*
* additional_access_info.h
*
*
*
*/
#ifndef _OpenAPI_additional_access_info_H_
@ -28,7 +28,7 @@ typedef struct OpenAPI_additional_access_info_s {
OpenAPI_additional_access_info_t *OpenAPI_additional_access_info_create(
OpenAPI_access_type_e access_type,
OpenAPI_rat_type_e rat_type
);
);
void OpenAPI_additional_access_info_free(OpenAPI_additional_access_info_t *additional_access_info);
OpenAPI_additional_access_info_t *OpenAPI_additional_access_info_parseFromJSON(cJSON *additional_access_infoJSON);
cJSON *OpenAPI_additional_access_info_convertToJSON(OpenAPI_additional_access_info_t *additional_access_info);

View File

@ -1,7 +1,7 @@
/*
* additional_qos_flow_info.h
*
*
*
*/
#ifndef _OpenAPI_additional_qos_flow_info_H_

View File

@ -6,7 +6,7 @@
OpenAPI_additional_snssai_data_t *OpenAPI_additional_snssai_data_create(
int required_authn_authz
)
)
{
OpenAPI_additional_snssai_data_t *additional_snssai_data_local_var = OpenAPI_malloc(sizeof(OpenAPI_additional_snssai_data_t));
if (!additional_snssai_data_local_var) {
@ -37,10 +37,10 @@ cJSON *OpenAPI_additional_snssai_data_convertToJSON(OpenAPI_additional_snssai_da
item = cJSON_CreateObject();
if (additional_snssai_data->required_authn_authz) {
if (cJSON_AddBoolToObject(item, "requiredAuthnAuthz", additional_snssai_data->required_authn_authz) == NULL) {
ogs_error("OpenAPI_additional_snssai_data_convertToJSON() failed [required_authn_authz]");
goto end;
}
if (cJSON_AddBoolToObject(item, "requiredAuthnAuthz", additional_snssai_data->required_authn_authz) == NULL) {
ogs_error("OpenAPI_additional_snssai_data_convertToJSON() failed [required_authn_authz]");
goto end;
}
}
end:
@ -52,16 +52,16 @@ OpenAPI_additional_snssai_data_t *OpenAPI_additional_snssai_data_parseFromJSON(c
OpenAPI_additional_snssai_data_t *additional_snssai_data_local_var = NULL;
cJSON *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]");
goto end;
}
if (required_authn_authz) {
if (!cJSON_IsBool(required_authn_authz)) {
ogs_error("OpenAPI_additional_snssai_data_parseFromJSON() failed [required_authn_authz]");
goto end;
}
}
additional_snssai_data_local_var = OpenAPI_additional_snssai_data_create (
required_authn_authz ? required_authn_authz->valueint : 0
);
);
return additional_snssai_data_local_var;
end:

View File

@ -1,7 +1,7 @@
/*
* additional_snssai_data.h
*
*
*
*/
#ifndef _OpenAPI_additional_snssai_data_H_
@ -24,7 +24,7 @@ typedef struct OpenAPI_additional_snssai_data_s {
OpenAPI_additional_snssai_data_t *OpenAPI_additional_snssai_data_create(
int required_authn_authz
);
);
void OpenAPI_additional_snssai_data_free(OpenAPI_additional_snssai_data_t *additional_snssai_data);
OpenAPI_additional_snssai_data_t *OpenAPI_additional_snssai_data_parseFromJSON(cJSON *additional_snssai_dataJSON);
cJSON *OpenAPI_additional_snssai_data_convertToJSON(OpenAPI_additional_snssai_data_t *additional_snssai_data);

View File

@ -4,82 +4,27 @@
#include <stdio.h>
#include "af_event.h"
OpenAPI_af_event_t *OpenAPI_af_event_create(
)
char* OpenAPI_af_event_ToString(OpenAPI_af_event_e af_event)
{
OpenAPI_af_event_t *af_event_local_var = OpenAPI_malloc(sizeof(OpenAPI_af_event_t));
if (!af_event_local_var) {
return NULL;
}
return af_event_local_var;
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];
else
return (char *)"Unknown";
}
void OpenAPI_af_event_free(OpenAPI_af_event_t *af_event)
OpenAPI_af_event_e OpenAPI_af_event_FromString(char* af_event)
{
if (NULL == af_event) {
return;
int stringToReturn = 0;
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) {
return stringToReturn;
}
stringToReturn++;
}
OpenAPI_lnode_t *node;
ogs_free(af_event);
}
cJSON *OpenAPI_af_event_convertToJSON(OpenAPI_af_event_t *af_event)
{
cJSON *item = NULL;
if (af_event == NULL) {
ogs_error("OpenAPI_af_event_convertToJSON() failed [AfEvent]");
return NULL;
}
item = cJSON_CreateObject();
end:
return item;
}
OpenAPI_af_event_t *OpenAPI_af_event_parseFromJSON(cJSON *af_eventJSON)
{
OpenAPI_af_event_t *af_event_local_var = NULL;
af_event_local_var = OpenAPI_af_event_create (
);
return af_event_local_var;
end:
return NULL;
}
OpenAPI_af_event_t *OpenAPI_af_event_copy(OpenAPI_af_event_t *dst, OpenAPI_af_event_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_af_event_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_af_event_convertToJSON() failed");
return NULL;
}
content = cJSON_Print(item);
cJSON_Delete(item);
if (!content) {
ogs_error("cJSON_Print() failed");
return NULL;
}
item = cJSON_Parse(content);
ogs_free(content);
if (!item) {
ogs_error("cJSON_Parse() failed");
return NULL;
}
OpenAPI_af_event_free(dst);
dst = OpenAPI_af_event_parseFromJSON(item);
cJSON_Delete(item);
return dst;
return 0;
}

View File

@ -1,7 +1,7 @@
/*
* af_event.h
*
*
*
*/
#ifndef _OpenAPI_af_event_H_
@ -17,16 +17,11 @@
extern "C" {
#endif
typedef struct OpenAPI_af_event_s OpenAPI_af_event_t;
typedef struct OpenAPI_af_event_s {
} OpenAPI_af_event_t;
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;
OpenAPI_af_event_t *OpenAPI_af_event_create(
);
void OpenAPI_af_event_free(OpenAPI_af_event_t *af_event);
OpenAPI_af_event_t *OpenAPI_af_event_parseFromJSON(cJSON *af_eventJSON);
cJSON *OpenAPI_af_event_convertToJSON(OpenAPI_af_event_t *af_event);
OpenAPI_af_event_t *OpenAPI_af_event_copy(OpenAPI_af_event_t *dst, OpenAPI_af_event_t *src);
char* OpenAPI_af_event_ToString(OpenAPI_af_event_e af_event);
OpenAPI_af_event_e OpenAPI_af_event_FromString(char* af_event);
#ifdef __cplusplus
}

View File

@ -8,7 +8,7 @@ OpenAPI_af_event_exposure_data_t *OpenAPI_af_event_exposure_data_create(
OpenAPI_list_t *af_events,
OpenAPI_list_t *af_ids,
OpenAPI_list_t *app_ids
)
)
{
OpenAPI_af_event_exposure_data_t *af_event_exposure_data_local_var = OpenAPI_malloc(sizeof(OpenAPI_af_event_exposure_data_t));
if (!af_event_exposure_data_local_var) {
@ -27,9 +27,6 @@ void OpenAPI_af_event_exposure_data_free(OpenAPI_af_event_exposure_data_t *af_ev
return;
}
OpenAPI_lnode_t *node;
OpenAPI_list_for_each(af_event_exposure_data->af_events, node) {
OpenAPI_af_event_free(node->data);
}
OpenAPI_list_free(af_event_exposure_data->af_events);
OpenAPI_list_for_each(af_event_exposure_data->af_ids, node) {
ogs_free(node->data);
@ -52,54 +49,49 @@ cJSON *OpenAPI_af_event_exposure_data_convertToJSON(OpenAPI_af_event_exposure_da
}
item = cJSON_CreateObject();
cJSON *af_eventsList = cJSON_AddArrayToObject(item, "afEvents");
if (af_eventsList == NULL) {
cJSON *af_events = cJSON_AddArrayToObject(item, "afEvents");
if (af_events == NULL) {
ogs_error("OpenAPI_af_event_exposure_data_convertToJSON() failed [af_events]");
goto end;
}
OpenAPI_lnode_t *af_events_node;
if (af_event_exposure_data->af_events) {
OpenAPI_list_for_each(af_event_exposure_data->af_events, af_events_node) {
cJSON *itemLocal = OpenAPI_af_event_convertToJSON(af_events_node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_af_event_exposure_data_convertToJSON() failed [af_events]");
goto end;
}
cJSON_AddItemToArray(af_eventsList, itemLocal);
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) {
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) {
ogs_error("OpenAPI_af_event_exposure_data_convertToJSON() failed [af_ids]");
goto end;
}
cJSON *af_ids = cJSON_AddArrayToObject(item, "afIds");
if (af_ids == 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_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;
}
}
}
if (af_event_exposure_data->app_ids) {
cJSON *app_ids = cJSON_AddArrayToObject(item, "appIds");
if (app_ids == NULL) {
ogs_error("OpenAPI_af_event_exposure_data_convertToJSON() failed [app_ids]");
goto end;
}
cJSON *app_ids = cJSON_AddArrayToObject(item, "appIds");
if (app_ids == 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_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;
}
}
}
end:
@ -116,7 +108,7 @@ OpenAPI_af_event_exposure_data_t *OpenAPI_af_event_exposure_data_parseFromJSON(c
}
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]");
@ -126,60 +118,59 @@ OpenAPI_af_event_exposure_data_t *OpenAPI_af_event_exposure_data_parseFromJSON(c
af_eventsList = OpenAPI_list_create();
cJSON_ArrayForEach(af_events_local_nonprimitive, af_events ) {
if (!cJSON_IsObject(af_events_local_nonprimitive)) {
if (!cJSON_IsString(af_events_local_nonprimitive)){
ogs_error("OpenAPI_af_event_exposure_data_parseFromJSON() failed [af_events]");
goto end;
}
OpenAPI_af_event_t *af_eventsItem = OpenAPI_af_event_parseFromJSON(af_events_local_nonprimitive);
OpenAPI_list_add(af_eventsList, af_eventsItem);
OpenAPI_list_add(af_eventsList, (void *)OpenAPI_af_event_FromString(af_events_local_nonprimitive->valuestring));
}
cJSON *af_ids = cJSON_GetObjectItemCaseSensitive(af_event_exposure_dataJSON, "afIds");
OpenAPI_list_t *af_idsList;
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_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_or_assert(af_ids_local->valuestring));
}
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_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_or_assert(af_ids_local->valuestring));
}
}
cJSON *app_ids = cJSON_GetObjectItemCaseSensitive(af_event_exposure_dataJSON, "appIds");
OpenAPI_list_t *app_idsList;
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_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_or_assert(app_ids_local->valuestring));
}
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_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_or_assert(app_ids_local->valuestring));
}
}
af_event_exposure_data_local_var = OpenAPI_af_event_exposure_data_create (
af_eventsList,
af_ids ? af_idsList : NULL,
app_ids ? app_idsList : NULL
);
);
return af_event_exposure_data_local_var;
end:

View File

@ -29,7 +29,7 @@ OpenAPI_af_event_exposure_data_t *OpenAPI_af_event_exposure_data_create(
OpenAPI_list_t *af_events,
OpenAPI_list_t *af_ids,
OpenAPI_list_t *app_ids
);
);
void OpenAPI_af_event_exposure_data_free(OpenAPI_af_event_exposure_data_t *af_event_exposure_data);
OpenAPI_af_event_exposure_data_t *OpenAPI_af_event_exposure_data_parseFromJSON(cJSON *af_event_exposure_dataJSON);
cJSON *OpenAPI_af_event_exposure_data_convertToJSON(OpenAPI_af_event_exposure_data_t *af_event_exposure_data);

View File

@ -5,9 +5,9 @@
#include "af_event_notification.h"
OpenAPI_af_event_notification_t *OpenAPI_af_event_notification_create(
OpenAPI_af_event_t *event,
OpenAPI_af_event_e event,
OpenAPI_list_t *flows
)
)
{
OpenAPI_af_event_notification_t *af_event_notification_local_var = OpenAPI_malloc(sizeof(OpenAPI_af_event_notification_t));
if (!af_event_notification_local_var) {
@ -25,7 +25,6 @@ void OpenAPI_af_event_notification_free(OpenAPI_af_event_notification_t *af_even
return;
}
OpenAPI_lnode_t *node;
OpenAPI_af_event_free(af_event_notification->event);
OpenAPI_list_for_each(af_event_notification->flows, node) {
OpenAPI_flows_free(node->data);
}
@ -43,36 +42,30 @@ cJSON *OpenAPI_af_event_notification_convertToJSON(OpenAPI_af_event_notification
}
item = cJSON_CreateObject();
cJSON *event_local_JSON = OpenAPI_af_event_convertToJSON(af_event_notification->event);
if (event_local_JSON == NULL) {
ogs_error("OpenAPI_af_event_notification_convertToJSON() failed [event]");
goto end;
}
cJSON_AddItemToObject(item, "event", event_local_JSON);
if (item->child == NULL) {
if (cJSON_AddStringToObject(item, "event", OpenAPI_af_event_ToString(af_event_notification->event)) == NULL) {
ogs_error("OpenAPI_af_event_notification_convertToJSON() failed [event]");
goto end;
}
if (af_event_notification->flows) {
cJSON *flowsList = cJSON_AddArrayToObject(item, "flows");
if (flowsList == NULL) {
ogs_error("OpenAPI_af_event_notification_convertToJSON() failed [flows]");
goto end;
}
cJSON *flowsList = cJSON_AddArrayToObject(item, "flows");
if (flowsList == NULL) {
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_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);
}
}
}
end:
return item;
@ -87,37 +80,41 @@ OpenAPI_af_event_notification_t *OpenAPI_af_event_notification_parseFromJSON(cJS
goto end;
}
OpenAPI_af_event_t *event_local_nonprim = NULL;
event_local_nonprim = OpenAPI_af_event_parseFromJSON(event);
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);
cJSON *flows = cJSON_GetObjectItemCaseSensitive(af_event_notificationJSON, "flows");
OpenAPI_list_t *flowsList;
if (flows) {
cJSON *flows_local_nonprimitive;
if (!cJSON_IsArray(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)) {
ogs_error("OpenAPI_af_event_notification_parseFromJSON() failed [flows]");
goto end;
}
OpenAPI_flows_t *flowsItem = OpenAPI_flows_parseFromJSON(flows_local_nonprimitive);
flowsList = OpenAPI_list_create();
cJSON_ArrayForEach(flows_local_nonprimitive, flows ) {
if (!cJSON_IsObject(flows_local_nonprimitive)) {
ogs_error("OpenAPI_af_event_notification_parseFromJSON() failed [flows]");
goto end;
}
OpenAPI_flows_t *flowsItem = OpenAPI_flows_parseFromJSON(flows_local_nonprimitive);
OpenAPI_list_add(flowsList, flowsItem);
}
OpenAPI_list_add(flowsList, flowsItem);
}
}
af_event_notification_local_var = OpenAPI_af_event_notification_create (
event_local_nonprim,
eventVariable,
flows ? flowsList : NULL
);
);
return af_event_notification_local_var;
end:

View File

@ -21,14 +21,14 @@ extern "C" {
typedef struct OpenAPI_af_event_notification_s OpenAPI_af_event_notification_t;
typedef struct OpenAPI_af_event_notification_s {
struct OpenAPI_af_event_s *event;
OpenAPI_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_t *event,
OpenAPI_af_event_e event,
OpenAPI_list_t *flows
);
);
void OpenAPI_af_event_notification_free(OpenAPI_af_event_notification_t *af_event_notification);
OpenAPI_af_event_notification_t *OpenAPI_af_event_notification_parseFromJSON(cJSON *af_event_notificationJSON);
cJSON *OpenAPI_af_event_notification_convertToJSON(OpenAPI_af_event_notification_t *af_event_notification);

View File

@ -5,11 +5,11 @@
#include "af_event_subscription.h"
OpenAPI_af_event_subscription_t *OpenAPI_af_event_subscription_create(
OpenAPI_af_event_t *event,
OpenAPI_af_event_e event,
OpenAPI_af_notif_method_e notif_method,
int rep_period,
int wait_time
)
)
{
OpenAPI_af_event_subscription_t *af_event_subscription_local_var = OpenAPI_malloc(sizeof(OpenAPI_af_event_subscription_t));
if (!af_event_subscription_local_var) {
@ -29,7 +29,6 @@ void OpenAPI_af_event_subscription_free(OpenAPI_af_event_subscription_t *af_even
return;
}
OpenAPI_lnode_t *node;
OpenAPI_af_event_free(af_event_subscription->event);
ogs_free(af_event_subscription);
}
@ -43,36 +42,30 @@ cJSON *OpenAPI_af_event_subscription_convertToJSON(OpenAPI_af_event_subscription
}
item = cJSON_CreateObject();
cJSON *event_local_JSON = OpenAPI_af_event_convertToJSON(af_event_subscription->event);
if (event_local_JSON == NULL) {
ogs_error("OpenAPI_af_event_subscription_convertToJSON() failed [event]");
goto end;
}
cJSON_AddItemToObject(item, "event", event_local_JSON);
if (item->child == NULL) {
if (cJSON_AddStringToObject(item, "event", OpenAPI_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 (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;
}
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;
}
}
if (af_event_subscription->rep_period) {
if (cJSON_AddNumberToObject(item, "repPeriod", af_event_subscription->rep_period) == NULL) {
ogs_error("OpenAPI_af_event_subscription_convertToJSON() failed [rep_period]");
goto end;
}
if (cJSON_AddNumberToObject(item, "repPeriod", af_event_subscription->rep_period) == NULL) {
ogs_error("OpenAPI_af_event_subscription_convertToJSON() failed [rep_period]");
goto end;
}
}
if (af_event_subscription->wait_time) {
if (cJSON_AddNumberToObject(item, "waitTime", af_event_subscription->wait_time) == NULL) {
ogs_error("OpenAPI_af_event_subscription_convertToJSON() failed [wait_time]");
goto end;
}
if (cJSON_AddNumberToObject(item, "waitTime", af_event_subscription->wait_time) == NULL) {
ogs_error("OpenAPI_af_event_subscription_convertToJSON() failed [wait_time]");
goto end;
}
}
end:
@ -88,45 +81,49 @@ OpenAPI_af_event_subscription_t *OpenAPI_af_event_subscription_parseFromJSON(cJS
goto end;
}
OpenAPI_af_event_t *event_local_nonprim = NULL;
event_local_nonprim = OpenAPI_af_event_parseFromJSON(event);
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);
cJSON *notif_method = cJSON_GetObjectItemCaseSensitive(af_event_subscriptionJSON, "notifMethod");
OpenAPI_af_notif_method_e notif_methodVariable;
if (notif_method) {
if (!cJSON_IsString(notif_method)) {
ogs_error("OpenAPI_af_event_subscription_parseFromJSON() failed [notif_method]");
goto end;
}
notif_methodVariable = OpenAPI_af_notif_method_FromString(notif_method->valuestring);
if (notif_method) {
if (!cJSON_IsString(notif_method)) {
ogs_error("OpenAPI_af_event_subscription_parseFromJSON() failed [notif_method]");
goto end;
}
notif_methodVariable = OpenAPI_af_notif_method_FromString(notif_method->valuestring);
}
cJSON *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]");
goto end;
}
if (rep_period) {
if (!cJSON_IsNumber(rep_period)) {
ogs_error("OpenAPI_af_event_subscription_parseFromJSON() failed [rep_period]");
goto end;
}
}
cJSON *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]");
goto end;
}
if (wait_time) {
if (!cJSON_IsNumber(wait_time)) {
ogs_error("OpenAPI_af_event_subscription_parseFromJSON() failed [wait_time]");
goto end;
}
}
af_event_subscription_local_var = OpenAPI_af_event_subscription_create (
event_local_nonprim,
eventVariable,
notif_method ? notif_methodVariable : 0,
rep_period ? rep_period->valuedouble : 0,
wait_time ? wait_time->valuedouble : 0
);
);
return af_event_subscription_local_var;
end:

View File

@ -21,18 +21,18 @@ extern "C" {
typedef struct OpenAPI_af_event_subscription_s OpenAPI_af_event_subscription_t;
typedef struct OpenAPI_af_event_subscription_s {
struct OpenAPI_af_event_s *event;
OpenAPI_af_event_e event;
OpenAPI_af_notif_method_e notif_method;
int rep_period;
int wait_time;
} OpenAPI_af_event_subscription_t;
OpenAPI_af_event_subscription_t *OpenAPI_af_event_subscription_create(
OpenAPI_af_event_t *event,
OpenAPI_af_event_e event,
OpenAPI_af_notif_method_e notif_method,
int rep_period,
int wait_time
);
);
void OpenAPI_af_event_subscription_free(OpenAPI_af_event_subscription_t *af_event_subscription);
OpenAPI_af_event_subscription_t *OpenAPI_af_event_subscription_parseFromJSON(cJSON *af_event_subscriptionJSON);
cJSON *OpenAPI_af_event_subscription_convertToJSON(OpenAPI_af_event_subscription_t *af_event_subscription);

View File

@ -9,7 +9,7 @@ OpenAPI_af_external_t *OpenAPI_af_external_create(
OpenAPI_list_t *allowed_geographic_area,
OpenAPI_privacy_check_related_action_e privacy_check_related_action,
OpenAPI_valid_time_period_t *valid_time_period
)
)
{
OpenAPI_af_external_t *af_external_local_var = OpenAPI_malloc(sizeof(OpenAPI_af_external_t));
if (!af_external_local_var) {
@ -49,50 +49,50 @@ cJSON *OpenAPI_af_external_convertToJSON(OpenAPI_af_external_t *af_external)
item = cJSON_CreateObject();
if (af_external->af_id) {
if (cJSON_AddStringToObject(item, "afId", af_external->af_id) == NULL) {
ogs_error("OpenAPI_af_external_convertToJSON() failed [af_id]");
goto end;
}
if (cJSON_AddStringToObject(item, "afId", af_external->af_id) == NULL) {
ogs_error("OpenAPI_af_external_convertToJSON() failed [af_id]");
goto end;
}
}
if (af_external->allowed_geographic_area) {
cJSON *allowed_geographic_areaList = cJSON_AddArrayToObject(item, "allowedGeographicArea");
if (allowed_geographic_areaList == NULL) {
ogs_error("OpenAPI_af_external_convertToJSON() failed [allowed_geographic_area]");
goto end;
}
cJSON *allowed_geographic_areaList = cJSON_AddArrayToObject(item, "allowedGeographicArea");
if (allowed_geographic_areaList == NULL) {
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_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);
}
}
}
if (af_external->privacy_check_related_action) {
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;
}
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;
}
}
if (af_external->valid_time_period) {
cJSON *valid_time_period_local_JSON = OpenAPI_valid_time_period_convertToJSON(af_external->valid_time_period);
if (valid_time_period_local_JSON == NULL) {
ogs_error("OpenAPI_af_external_convertToJSON() failed [valid_time_period]");
goto end;
}
cJSON_AddItemToObject(item, "validTimePeriod", valid_time_period_local_JSON);
if (item->child == NULL) {
ogs_error("OpenAPI_af_external_convertToJSON() failed [valid_time_period]");
goto end;
}
cJSON *valid_time_period_local_JSON = OpenAPI_valid_time_period_convertToJSON(af_external->valid_time_period);
if (valid_time_period_local_JSON == NULL) {
ogs_error("OpenAPI_af_external_convertToJSON() failed [valid_time_period]");
goto end;
}
cJSON_AddItemToObject(item, "validTimePeriod", valid_time_period_local_JSON);
if (item->child == NULL) {
ogs_error("OpenAPI_af_external_convertToJSON() failed [valid_time_period]");
goto end;
}
}
end:
@ -104,60 +104,60 @@ 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");
if (af_id) {
if (!cJSON_IsString(af_id)) {
ogs_error("OpenAPI_af_external_parseFromJSON() failed [af_id]");
goto end;
}
if (af_id) {
if (!cJSON_IsString(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;
if (allowed_geographic_area) {
cJSON *allowed_geographic_area_local_nonprimitive;
if (!cJSON_IsArray(allowed_geographic_area)) {
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)) {
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);
allowed_geographic_areaList = OpenAPI_list_create();
cJSON_ArrayForEach(allowed_geographic_area_local_nonprimitive, allowed_geographic_area ) {
if (!cJSON_IsObject(allowed_geographic_area_local_nonprimitive)) {
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);
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;
if (privacy_check_related_action) {
if (!cJSON_IsString(privacy_check_related_action)) {
ogs_error("OpenAPI_af_external_parseFromJSON() failed [privacy_check_related_action]");
goto end;
}
privacy_check_related_actionVariable = OpenAPI_privacy_check_related_action_FromString(privacy_check_related_action->valuestring);
if (privacy_check_related_action) {
if (!cJSON_IsString(privacy_check_related_action)) {
ogs_error("OpenAPI_af_external_parseFromJSON() failed [privacy_check_related_action]");
goto end;
}
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;
if (valid_time_period) {
valid_time_period_local_nonprim = OpenAPI_valid_time_period_parseFromJSON(valid_time_period);
}
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_or_assert(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
);
);
return af_external_local_var;
end:

View File

@ -1,7 +1,7 @@
/*
* af_external.h
*
*
*
*/
#ifndef _OpenAPI_af_external_H_
@ -33,7 +33,7 @@ OpenAPI_af_external_t *OpenAPI_af_external_create(
OpenAPI_list_t *allowed_geographic_area,
OpenAPI_privacy_check_related_action_e privacy_check_related_action,
OpenAPI_valid_time_period_t *valid_time_period
);
);
void OpenAPI_af_external_free(OpenAPI_af_external_t *af_external);
OpenAPI_af_external_t *OpenAPI_af_external_parseFromJSON(cJSON *af_externalJSON);
cJSON *OpenAPI_af_external_convertToJSON(OpenAPI_af_external_t *af_external);

View File

@ -1,7 +1,7 @@
/*
* af_notif_method.h
*
*
*
*/
#ifndef _OpenAPI_af_notif_method_H_

View File

@ -1,7 +1,7 @@
/*
* af_requested_data.h
*
*
*
*/
#ifndef _OpenAPI_af_requested_data_H_

View File

@ -11,7 +11,7 @@ OpenAPI_af_routing_requirement_t *OpenAPI_af_routing_requirement_create(
OpenAPI_list_t *temp_vals,
OpenAPI_up_path_chg_event_t *up_path_chg_sub,
int addr_preser_ind
)
)
{
OpenAPI_af_routing_requirement_t *af_routing_requirement_local_var = OpenAPI_malloc(sizeof(OpenAPI_af_routing_requirement_t));
if (!af_routing_requirement_local_var) {
@ -57,83 +57,83 @@ cJSON *OpenAPI_af_routing_requirement_convertToJSON(OpenAPI_af_routing_requireme
item = cJSON_CreateObject();
if (af_routing_requirement->app_reloc) {
if (cJSON_AddBoolToObject(item, "appReloc", af_routing_requirement->app_reloc) == NULL) {
ogs_error("OpenAPI_af_routing_requirement_convertToJSON() failed [app_reloc]");
goto end;
}
if (cJSON_AddBoolToObject(item, "appReloc", af_routing_requirement->app_reloc) == NULL) {
ogs_error("OpenAPI_af_routing_requirement_convertToJSON() failed [app_reloc]");
goto end;
}
}
if (af_routing_requirement->route_to_locs) {
cJSON *route_to_locsList = cJSON_AddArrayToObject(item, "routeToLocs");
if (route_to_locsList == NULL) {
ogs_error("OpenAPI_af_routing_requirement_convertToJSON() failed [route_to_locs]");
goto end;
}
cJSON *route_to_locsList = cJSON_AddArrayToObject(item, "routeToLocs");
if (route_to_locsList == NULL) {
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_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);
}
}
}
if (af_routing_requirement->sp_val) {
cJSON *sp_val_local_JSON = OpenAPI_spatial_validity_convertToJSON(af_routing_requirement->sp_val);
if (sp_val_local_JSON == NULL) {
ogs_error("OpenAPI_af_routing_requirement_convertToJSON() failed [sp_val]");
goto end;
}
cJSON_AddItemToObject(item, "spVal", sp_val_local_JSON);
if (item->child == NULL) {
ogs_error("OpenAPI_af_routing_requirement_convertToJSON() failed [sp_val]");
goto end;
}
cJSON *sp_val_local_JSON = OpenAPI_spatial_validity_convertToJSON(af_routing_requirement->sp_val);
if (sp_val_local_JSON == NULL) {
ogs_error("OpenAPI_af_routing_requirement_convertToJSON() failed [sp_val]");
goto end;
}
cJSON_AddItemToObject(item, "spVal", sp_val_local_JSON);
if (item->child == NULL) {
ogs_error("OpenAPI_af_routing_requirement_convertToJSON() failed [sp_val]");
goto end;
}
}
if (af_routing_requirement->temp_vals) {
cJSON *temp_valsList = cJSON_AddArrayToObject(item, "tempVals");
if (temp_valsList == NULL) {
ogs_error("OpenAPI_af_routing_requirement_convertToJSON() failed [temp_vals]");
goto end;
}
cJSON *temp_valsList = cJSON_AddArrayToObject(item, "tempVals");
if (temp_valsList == NULL) {
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_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);
}
}
}
if (af_routing_requirement->up_path_chg_sub) {
cJSON *up_path_chg_sub_local_JSON = OpenAPI_up_path_chg_event_convertToJSON(af_routing_requirement->up_path_chg_sub);
if (up_path_chg_sub_local_JSON == NULL) {
ogs_error("OpenAPI_af_routing_requirement_convertToJSON() failed [up_path_chg_sub]");
goto end;
}
cJSON_AddItemToObject(item, "upPathChgSub", up_path_chg_sub_local_JSON);
if (item->child == NULL) {
ogs_error("OpenAPI_af_routing_requirement_convertToJSON() failed [up_path_chg_sub]");
goto end;
}
cJSON *up_path_chg_sub_local_JSON = OpenAPI_up_path_chg_event_convertToJSON(af_routing_requirement->up_path_chg_sub);
if (up_path_chg_sub_local_JSON == NULL) {
ogs_error("OpenAPI_af_routing_requirement_convertToJSON() failed [up_path_chg_sub]");
goto end;
}
cJSON_AddItemToObject(item, "upPathChgSub", up_path_chg_sub_local_JSON);
if (item->child == NULL) {
ogs_error("OpenAPI_af_routing_requirement_convertToJSON() failed [up_path_chg_sub]");
goto end;
}
}
if (af_routing_requirement->addr_preser_ind) {
if (cJSON_AddBoolToObject(item, "addrPreserInd", af_routing_requirement->addr_preser_ind) == NULL) {
ogs_error("OpenAPI_af_routing_requirement_convertToJSON() failed [addr_preser_ind]");
goto end;
}
if (cJSON_AddBoolToObject(item, "addrPreserInd", af_routing_requirement->addr_preser_ind) == NULL) {
ogs_error("OpenAPI_af_routing_requirement_convertToJSON() failed [addr_preser_ind]");
goto end;
}
}
end:
@ -145,81 +145,81 @@ OpenAPI_af_routing_requirement_t *OpenAPI_af_routing_requirement_parseFromJSON(c
OpenAPI_af_routing_requirement_t *af_routing_requirement_local_var = NULL;
cJSON *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]");
goto end;
}
if (app_reloc) {
if (!cJSON_IsBool(app_reloc)) {
ogs_error("OpenAPI_af_routing_requirement_parseFromJSON() failed [app_reloc]");
goto end;
}
}
cJSON *route_to_locs = cJSON_GetObjectItemCaseSensitive(af_routing_requirementJSON, "routeToLocs");
OpenAPI_list_t *route_to_locsList;
if (route_to_locs) {
cJSON *route_to_locs_local_nonprimitive;
if (!cJSON_IsArray(route_to_locs)) {
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)) {
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);
route_to_locsList = OpenAPI_list_create();
cJSON_ArrayForEach(route_to_locs_local_nonprimitive, route_to_locs ) {
if (!cJSON_IsObject(route_to_locs_local_nonprimitive)) {
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);
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;
if (sp_val) {
sp_val_local_nonprim = OpenAPI_spatial_validity_parseFromJSON(sp_val);
}
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;
if (temp_vals) {
cJSON *temp_vals_local_nonprimitive;
if (!cJSON_IsArray(temp_vals)) {
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)) {
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);
temp_valsList = OpenAPI_list_create();
cJSON_ArrayForEach(temp_vals_local_nonprimitive, temp_vals ) {
if (!cJSON_IsObject(temp_vals_local_nonprimitive)) {
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);
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;
if (up_path_chg_sub) {
up_path_chg_sub_local_nonprim = OpenAPI_up_path_chg_event_parseFromJSON(up_path_chg_sub);
}
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");
if (addr_preser_ind) {
if (!cJSON_IsBool(addr_preser_ind)) {
ogs_error("OpenAPI_af_routing_requirement_parseFromJSON() failed [addr_preser_ind]");
goto end;
}
if (addr_preser_ind) {
if (!cJSON_IsBool(addr_preser_ind)) {
ogs_error("OpenAPI_af_routing_requirement_parseFromJSON() failed [addr_preser_ind]");
goto end;
}
}
af_routing_requirement_local_var = OpenAPI_af_routing_requirement_create (
app_reloc ? app_reloc->valueint : 0,
@ -228,7 +228,7 @@ OpenAPI_af_routing_requirement_t *OpenAPI_af_routing_requirement_parseFromJSON(c
temp_vals ? temp_valsList : NULL,
up_path_chg_sub ? up_path_chg_sub_local_nonprim : NULL,
addr_preser_ind ? addr_preser_ind->valueint : 0
);
);
return af_routing_requirement_local_var;
end:

View File

@ -38,7 +38,7 @@ OpenAPI_af_routing_requirement_t *OpenAPI_af_routing_requirement_create(
OpenAPI_list_t *temp_vals,
OpenAPI_up_path_chg_event_t *up_path_chg_sub,
int addr_preser_ind
);
);
void OpenAPI_af_routing_requirement_free(OpenAPI_af_routing_requirement_t *af_routing_requirement);
OpenAPI_af_routing_requirement_t *OpenAPI_af_routing_requirement_parseFromJSON(cJSON *af_routing_requirementJSON);
cJSON *OpenAPI_af_routing_requirement_convertToJSON(OpenAPI_af_routing_requirement_t *af_routing_requirement);

View File

@ -11,7 +11,7 @@ OpenAPI_af_routing_requirement_rm_t *OpenAPI_af_routing_requirement_rm_create(
OpenAPI_list_t *temp_vals,
OpenAPI_up_path_chg_event_t *up_path_chg_sub,
int addr_preser_ind
)
)
{
OpenAPI_af_routing_requirement_rm_t *af_routing_requirement_rm_local_var = OpenAPI_malloc(sizeof(OpenAPI_af_routing_requirement_rm_t));
if (!af_routing_requirement_rm_local_var) {
@ -57,83 +57,83 @@ cJSON *OpenAPI_af_routing_requirement_rm_convertToJSON(OpenAPI_af_routing_requir
item = cJSON_CreateObject();
if (af_routing_requirement_rm->app_reloc) {
if (cJSON_AddBoolToObject(item, "appReloc", af_routing_requirement_rm->app_reloc) == NULL) {
ogs_error("OpenAPI_af_routing_requirement_rm_convertToJSON() failed [app_reloc]");
goto end;
}
if (cJSON_AddBoolToObject(item, "appReloc", af_routing_requirement_rm->app_reloc) == NULL) {
ogs_error("OpenAPI_af_routing_requirement_rm_convertToJSON() failed [app_reloc]");
goto end;
}
}
if (af_routing_requirement_rm->route_to_locs) {
cJSON *route_to_locsList = cJSON_AddArrayToObject(item, "routeToLocs");
if (route_to_locsList == NULL) {
ogs_error("OpenAPI_af_routing_requirement_rm_convertToJSON() failed [route_to_locs]");
goto end;
}
cJSON *route_to_locsList = cJSON_AddArrayToObject(item, "routeToLocs");
if (route_to_locsList == NULL) {
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_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);
}
}
}
if (af_routing_requirement_rm->sp_val) {
cJSON *sp_val_local_JSON = OpenAPI_spatial_validity_rm_convertToJSON(af_routing_requirement_rm->sp_val);
if (sp_val_local_JSON == NULL) {
ogs_error("OpenAPI_af_routing_requirement_rm_convertToJSON() failed [sp_val]");
goto end;
}
cJSON_AddItemToObject(item, "spVal", sp_val_local_JSON);
if (item->child == NULL) {
ogs_error("OpenAPI_af_routing_requirement_rm_convertToJSON() failed [sp_val]");
goto end;
}
cJSON *sp_val_local_JSON = OpenAPI_spatial_validity_rm_convertToJSON(af_routing_requirement_rm->sp_val);
if (sp_val_local_JSON == NULL) {
ogs_error("OpenAPI_af_routing_requirement_rm_convertToJSON() failed [sp_val]");
goto end;
}
cJSON_AddItemToObject(item, "spVal", sp_val_local_JSON);
if (item->child == NULL) {
ogs_error("OpenAPI_af_routing_requirement_rm_convertToJSON() failed [sp_val]");
goto end;
}
}
if (af_routing_requirement_rm->temp_vals) {
cJSON *temp_valsList = cJSON_AddArrayToObject(item, "tempVals");
if (temp_valsList == NULL) {
ogs_error("OpenAPI_af_routing_requirement_rm_convertToJSON() failed [temp_vals]");
goto end;
}
cJSON *temp_valsList = cJSON_AddArrayToObject(item, "tempVals");
if (temp_valsList == NULL) {
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_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);
}
}
}
if (af_routing_requirement_rm->up_path_chg_sub) {
cJSON *up_path_chg_sub_local_JSON = OpenAPI_up_path_chg_event_convertToJSON(af_routing_requirement_rm->up_path_chg_sub);
if (up_path_chg_sub_local_JSON == NULL) {
ogs_error("OpenAPI_af_routing_requirement_rm_convertToJSON() failed [up_path_chg_sub]");
goto end;
}
cJSON_AddItemToObject(item, "upPathChgSub", up_path_chg_sub_local_JSON);
if (item->child == NULL) {
ogs_error("OpenAPI_af_routing_requirement_rm_convertToJSON() failed [up_path_chg_sub]");
goto end;
}
cJSON *up_path_chg_sub_local_JSON = OpenAPI_up_path_chg_event_convertToJSON(af_routing_requirement_rm->up_path_chg_sub);
if (up_path_chg_sub_local_JSON == NULL) {
ogs_error("OpenAPI_af_routing_requirement_rm_convertToJSON() failed [up_path_chg_sub]");
goto end;
}
cJSON_AddItemToObject(item, "upPathChgSub", up_path_chg_sub_local_JSON);
if (item->child == NULL) {
ogs_error("OpenAPI_af_routing_requirement_rm_convertToJSON() failed [up_path_chg_sub]");
goto end;
}
}
if (af_routing_requirement_rm->addr_preser_ind) {
if (cJSON_AddBoolToObject(item, "addrPreserInd", af_routing_requirement_rm->addr_preser_ind) == NULL) {
ogs_error("OpenAPI_af_routing_requirement_rm_convertToJSON() failed [addr_preser_ind]");
goto end;
}
if (cJSON_AddBoolToObject(item, "addrPreserInd", af_routing_requirement_rm->addr_preser_ind) == NULL) {
ogs_error("OpenAPI_af_routing_requirement_rm_convertToJSON() failed [addr_preser_ind]");
goto end;
}
}
end:
@ -145,81 +145,81 @@ OpenAPI_af_routing_requirement_rm_t *OpenAPI_af_routing_requirement_rm_parseFrom
OpenAPI_af_routing_requirement_rm_t *af_routing_requirement_rm_local_var = NULL;
cJSON *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]");
goto end;
}
if (app_reloc) {
if (!cJSON_IsBool(app_reloc)) {
ogs_error("OpenAPI_af_routing_requirement_rm_parseFromJSON() failed [app_reloc]");
goto end;
}
}
cJSON *route_to_locs = cJSON_GetObjectItemCaseSensitive(af_routing_requirement_rmJSON, "routeToLocs");
OpenAPI_list_t *route_to_locsList;
if (route_to_locs) {
cJSON *route_to_locs_local_nonprimitive;
if (!cJSON_IsArray(route_to_locs)) {
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)) {
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);
route_to_locsList = OpenAPI_list_create();
cJSON_ArrayForEach(route_to_locs_local_nonprimitive, route_to_locs ) {
if (!cJSON_IsObject(route_to_locs_local_nonprimitive)) {
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);
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;
if (sp_val) {
sp_val_local_nonprim = OpenAPI_spatial_validity_rm_parseFromJSON(sp_val);
}
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;
if (temp_vals) {
cJSON *temp_vals_local_nonprimitive;
if (!cJSON_IsArray(temp_vals)) {
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)) {
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);
temp_valsList = OpenAPI_list_create();
cJSON_ArrayForEach(temp_vals_local_nonprimitive, temp_vals ) {
if (!cJSON_IsObject(temp_vals_local_nonprimitive)) {
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);
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;
if (up_path_chg_sub) {
up_path_chg_sub_local_nonprim = OpenAPI_up_path_chg_event_parseFromJSON(up_path_chg_sub);
}
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");
if (addr_preser_ind) {
if (!cJSON_IsBool(addr_preser_ind)) {
ogs_error("OpenAPI_af_routing_requirement_rm_parseFromJSON() failed [addr_preser_ind]");
goto end;
}
if (addr_preser_ind) {
if (!cJSON_IsBool(addr_preser_ind)) {
ogs_error("OpenAPI_af_routing_requirement_rm_parseFromJSON() failed [addr_preser_ind]");
goto end;
}
}
af_routing_requirement_rm_local_var = OpenAPI_af_routing_requirement_rm_create (
app_reloc ? app_reloc->valueint : 0,
@ -228,7 +228,7 @@ OpenAPI_af_routing_requirement_rm_t *OpenAPI_af_routing_requirement_rm_parseFrom
temp_vals ? temp_valsList : NULL,
up_path_chg_sub ? up_path_chg_sub_local_nonprim : NULL,
addr_preser_ind ? addr_preser_ind->valueint : 0
);
);
return af_routing_requirement_rm_local_var;
end:

View File

@ -38,7 +38,7 @@ OpenAPI_af_routing_requirement_rm_t *OpenAPI_af_routing_requirement_rm_create(
OpenAPI_list_t *temp_vals,
OpenAPI_up_path_chg_event_t *up_path_chg_sub,
int addr_preser_ind
);
);
void OpenAPI_af_routing_requirement_rm_free(OpenAPI_af_routing_requirement_rm_t *af_routing_requirement_rm);
OpenAPI_af_routing_requirement_rm_t *OpenAPI_af_routing_requirement_rm_parseFromJSON(cJSON *af_routing_requirement_rmJSON);
cJSON *OpenAPI_af_routing_requirement_rm_convertToJSON(OpenAPI_af_routing_requirement_rm_t *af_routing_requirement_rm);

View File

@ -1,7 +1,7 @@
/*
* af_sig_protocol.h
*
*
*
*/
#ifndef _OpenAPI_af_sig_protocol_H_

View File

@ -0,0 +1,125 @@
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "allowed_mtc_provider_info.h"
OpenAPI_allowed_mtc_provider_info_t *OpenAPI_allowed_mtc_provider_info_create(
char *mtc_provider_information,
char *af_id
)
{
OpenAPI_allowed_mtc_provider_info_t *allowed_mtc_provider_info_local_var = OpenAPI_malloc(sizeof(OpenAPI_allowed_mtc_provider_info_t));
if (!allowed_mtc_provider_info_local_var) {
return NULL;
}
allowed_mtc_provider_info_local_var->mtc_provider_information = mtc_provider_information;
allowed_mtc_provider_info_local_var->af_id = af_id;
return allowed_mtc_provider_info_local_var;
}
void OpenAPI_allowed_mtc_provider_info_free(OpenAPI_allowed_mtc_provider_info_t *allowed_mtc_provider_info)
{
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);
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;
if (allowed_mtc_provider_info == NULL) {
ogs_error("OpenAPI_allowed_mtc_provider_info_convertToJSON() failed [AllowedMtcProviderInfo]");
return NULL;
}
item = cJSON_CreateObject();
if (allowed_mtc_provider_info->mtc_provider_information) {
if (cJSON_AddStringToObject(item, "mtcProviderInformation", allowed_mtc_provider_info->mtc_provider_information) == NULL) {
ogs_error("OpenAPI_allowed_mtc_provider_info_convertToJSON() failed [mtc_provider_information]");
goto end;
}
}
if (allowed_mtc_provider_info->af_id) {
if (cJSON_AddStringToObject(item, "afId", allowed_mtc_provider_info->af_id) == NULL) {
ogs_error("OpenAPI_allowed_mtc_provider_info_convertToJSON() failed [af_id]");
goto end;
}
}
end:
return item;
}
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");
if (mtc_provider_information) {
if (!cJSON_IsString(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");
if (af_id) {
if (!cJSON_IsString(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_or_assert(mtc_provider_information->valuestring) : NULL,
af_id ? ogs_strdup_or_assert(af_id->valuestring) : NULL
);
return allowed_mtc_provider_info_local_var;
end:
return NULL;
}
OpenAPI_allowed_mtc_provider_info_t *OpenAPI_allowed_mtc_provider_info_copy(OpenAPI_allowed_mtc_provider_info_t *dst, OpenAPI_allowed_mtc_provider_info_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_allowed_mtc_provider_info_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_allowed_mtc_provider_info_convertToJSON() failed");
return NULL;
}
content = cJSON_Print(item);
cJSON_Delete(item);
if (!content) {
ogs_error("cJSON_Print() failed");
return NULL;
}
item = cJSON_Parse(content);
ogs_free(content);
if (!item) {
ogs_error("cJSON_Parse() failed");
return NULL;
}
OpenAPI_allowed_mtc_provider_info_free(dst);
dst = OpenAPI_allowed_mtc_provider_info_parseFromJSON(item);
cJSON_Delete(item);
return dst;
}

View File

@ -0,0 +1,40 @@
/*
* allowed_mtc_provider_info.h
*
*
*/
#ifndef _OpenAPI_allowed_mtc_provider_info_H_
#define _OpenAPI_allowed_mtc_provider_info_H_
#include <string.h>
#include "../external/cJSON.h"
#include "../include/list.h"
#include "../include/keyValuePair.h"
#include "../include/binary.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct OpenAPI_allowed_mtc_provider_info_s OpenAPI_allowed_mtc_provider_info_t;
typedef struct OpenAPI_allowed_mtc_provider_info_s {
char *mtc_provider_information;
char *af_id;
} OpenAPI_allowed_mtc_provider_info_t;
OpenAPI_allowed_mtc_provider_info_t *OpenAPI_allowed_mtc_provider_info_create(
char *mtc_provider_information,
char *af_id
);
void OpenAPI_allowed_mtc_provider_info_free(OpenAPI_allowed_mtc_provider_info_t *allowed_mtc_provider_info);
OpenAPI_allowed_mtc_provider_info_t *OpenAPI_allowed_mtc_provider_info_parseFromJSON(cJSON *allowed_mtc_provider_infoJSON);
cJSON *OpenAPI_allowed_mtc_provider_info_convertToJSON(OpenAPI_allowed_mtc_provider_info_t *allowed_mtc_provider_info);
OpenAPI_allowed_mtc_provider_info_t *OpenAPI_allowed_mtc_provider_info_copy(OpenAPI_allowed_mtc_provider_info_t *dst, OpenAPI_allowed_mtc_provider_info_t *src);
#ifdef __cplusplus
}
#endif
#endif /* _OpenAPI_allowed_mtc_provider_info_H_ */

View File

@ -7,7 +7,7 @@
OpenAPI_allowed_nssai_t *OpenAPI_allowed_nssai_create(
OpenAPI_list_t *allowed_snssai_list,
OpenAPI_access_type_e access_type
)
)
{
OpenAPI_allowed_nssai_t *allowed_nssai_local_var = OpenAPI_malloc(sizeof(OpenAPI_allowed_nssai_t));
if (!allowed_nssai_local_var) {
@ -79,9 +79,9 @@ OpenAPI_allowed_nssai_t *OpenAPI_allowed_nssai_parseFromJSON(cJSON *allowed_nssa
}
OpenAPI_list_t *allowed_snssai_listList;
cJSON *allowed_snssai_list_local_nonprimitive;
if (!cJSON_IsArray(allowed_snssai_list)) {
if (!cJSON_IsArray(allowed_snssai_list)){
ogs_error("OpenAPI_allowed_nssai_parseFromJSON() failed [allowed_snssai_list]");
goto end;
}
@ -105,7 +105,7 @@ OpenAPI_allowed_nssai_t *OpenAPI_allowed_nssai_parseFromJSON(cJSON *allowed_nssa
}
OpenAPI_access_type_e access_typeVariable;
if (!cJSON_IsString(access_type)) {
ogs_error("OpenAPI_allowed_nssai_parseFromJSON() failed [access_type]");
goto end;
@ -115,7 +115,7 @@ OpenAPI_allowed_nssai_t *OpenAPI_allowed_nssai_parseFromJSON(cJSON *allowed_nssa
allowed_nssai_local_var = OpenAPI_allowed_nssai_create (
allowed_snssai_listList,
access_typeVariable
);
);
return allowed_nssai_local_var;
end:

View File

@ -1,7 +1,7 @@
/*
* allowed_nssai.h
*
*
*
*/
#ifndef _OpenAPI_allowed_nssai_H_
@ -28,7 +28,7 @@ typedef struct OpenAPI_allowed_nssai_s {
OpenAPI_allowed_nssai_t *OpenAPI_allowed_nssai_create(
OpenAPI_list_t *allowed_snssai_list,
OpenAPI_access_type_e access_type
);
);
void OpenAPI_allowed_nssai_free(OpenAPI_allowed_nssai_t *allowed_nssai);
OpenAPI_allowed_nssai_t *OpenAPI_allowed_nssai_parseFromJSON(cJSON *allowed_nssaiJSON);
cJSON *OpenAPI_allowed_nssai_convertToJSON(OpenAPI_allowed_nssai_t *allowed_nssai);

View File

@ -8,7 +8,7 @@ OpenAPI_allowed_snssai_t *OpenAPI_allowed_snssai_create(
OpenAPI_snssai_t *allowed_snssai,
OpenAPI_list_t *nsi_information_list,
OpenAPI_snssai_t *mapped_home_snssai
)
)
{
OpenAPI_allowed_snssai_t *allowed_snssai_local_var = OpenAPI_malloc(sizeof(OpenAPI_allowed_snssai_t));
if (!allowed_snssai_local_var) {
@ -58,36 +58,36 @@ cJSON *OpenAPI_allowed_snssai_convertToJSON(OpenAPI_allowed_snssai_t *allowed_sn
}
if (allowed_snssai->nsi_information_list) {
cJSON *nsi_information_listList = cJSON_AddArrayToObject(item, "nsiInformationList");
if (nsi_information_listList == NULL) {
ogs_error("OpenAPI_allowed_snssai_convertToJSON() failed [nsi_information_list]");
goto end;
}
cJSON *nsi_information_listList = cJSON_AddArrayToObject(item, "nsiInformationList");
if (nsi_information_listList == NULL) {
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_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);
}
}
}
if (allowed_snssai->mapped_home_snssai) {
cJSON *mapped_home_snssai_local_JSON = OpenAPI_snssai_convertToJSON(allowed_snssai->mapped_home_snssai);
if (mapped_home_snssai_local_JSON == NULL) {
ogs_error("OpenAPI_allowed_snssai_convertToJSON() failed [mapped_home_snssai]");
goto end;
}
cJSON_AddItemToObject(item, "mappedHomeSnssai", mapped_home_snssai_local_JSON);
if (item->child == NULL) {
ogs_error("OpenAPI_allowed_snssai_convertToJSON() failed [mapped_home_snssai]");
goto end;
}
cJSON *mapped_home_snssai_local_JSON = OpenAPI_snssai_convertToJSON(allowed_snssai->mapped_home_snssai);
if (mapped_home_snssai_local_JSON == NULL) {
ogs_error("OpenAPI_allowed_snssai_convertToJSON() failed [mapped_home_snssai]");
goto end;
}
cJSON_AddItemToObject(item, "mappedHomeSnssai", mapped_home_snssai_local_JSON);
if (item->child == NULL) {
ogs_error("OpenAPI_allowed_snssai_convertToJSON() failed [mapped_home_snssai]");
goto end;
}
}
end:
@ -104,44 +104,44 @@ OpenAPI_allowed_snssai_t *OpenAPI_allowed_snssai_parseFromJSON(cJSON *allowed_sn
}
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;
if (nsi_information_list) {
cJSON *nsi_information_list_local_nonprimitive;
if (!cJSON_IsArray(nsi_information_list)) {
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)) {
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);
nsi_information_listList = OpenAPI_list_create();
cJSON_ArrayForEach(nsi_information_list_local_nonprimitive, nsi_information_list ) {
if (!cJSON_IsObject(nsi_information_list_local_nonprimitive)) {
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);
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;
if (mapped_home_snssai) {
mapped_home_snssai_local_nonprim = OpenAPI_snssai_parseFromJSON(mapped_home_snssai);
}
if (mapped_home_snssai) {
mapped_home_snssai_local_nonprim = OpenAPI_snssai_parseFromJSON(mapped_home_snssai);
}
allowed_snssai_local_var = OpenAPI_allowed_snssai_create (
allowed_snssai_local_nonprim,
nsi_information_list ? nsi_information_listList : NULL,
mapped_home_snssai ? mapped_home_snssai_local_nonprim : NULL
);
);
return allowed_snssai_local_var;
end:

View File

@ -1,7 +1,7 @@
/*
* allowed_snssai.h
*
*
*
*/
#ifndef _OpenAPI_allowed_snssai_H_
@ -30,7 +30,7 @@ OpenAPI_allowed_snssai_t *OpenAPI_allowed_snssai_create(
OpenAPI_snssai_t *allowed_snssai,
OpenAPI_list_t *nsi_information_list,
OpenAPI_snssai_t *mapped_home_snssai
);
);
void OpenAPI_allowed_snssai_free(OpenAPI_allowed_snssai_t *allowed_snssai);
OpenAPI_allowed_snssai_t *OpenAPI_allowed_snssai_parseFromJSON(cJSON *allowed_snssaiJSON);
cJSON *OpenAPI_allowed_snssai_convertToJSON(OpenAPI_allowed_snssai_t *allowed_snssai);

View File

@ -10,7 +10,7 @@ OpenAPI_alternative_qos_profile_t *OpenAPI_alternative_qos_profile_create(
char *gua_fbr_ul,
int packet_delay_budget,
char *packet_err_rate
)
)
{
OpenAPI_alternative_qos_profile_t *alternative_qos_profile_local_var = OpenAPI_malloc(sizeof(OpenAPI_alternative_qos_profile_t));
if (!alternative_qos_profile_local_var) {
@ -53,31 +53,31 @@ cJSON *OpenAPI_alternative_qos_profile_convertToJSON(OpenAPI_alternative_qos_pro
}
if (alternative_qos_profile->gua_fbr_dl) {
if (cJSON_AddStringToObject(item, "guaFbrDl", alternative_qos_profile->gua_fbr_dl) == NULL) {
ogs_error("OpenAPI_alternative_qos_profile_convertToJSON() failed [gua_fbr_dl]");
goto end;
}
if (cJSON_AddStringToObject(item, "guaFbrDl", alternative_qos_profile->gua_fbr_dl) == NULL) {
ogs_error("OpenAPI_alternative_qos_profile_convertToJSON() failed [gua_fbr_dl]");
goto end;
}
}
if (alternative_qos_profile->gua_fbr_ul) {
if (cJSON_AddStringToObject(item, "guaFbrUl", alternative_qos_profile->gua_fbr_ul) == NULL) {
ogs_error("OpenAPI_alternative_qos_profile_convertToJSON() failed [gua_fbr_ul]");
goto end;
}
if (cJSON_AddStringToObject(item, "guaFbrUl", alternative_qos_profile->gua_fbr_ul) == NULL) {
ogs_error("OpenAPI_alternative_qos_profile_convertToJSON() failed [gua_fbr_ul]");
goto end;
}
}
if (alternative_qos_profile->packet_delay_budget) {
if (cJSON_AddNumberToObject(item, "packetDelayBudget", alternative_qos_profile->packet_delay_budget) == NULL) {
ogs_error("OpenAPI_alternative_qos_profile_convertToJSON() failed [packet_delay_budget]");
goto end;
}
if (cJSON_AddNumberToObject(item, "packetDelayBudget", alternative_qos_profile->packet_delay_budget) == NULL) {
ogs_error("OpenAPI_alternative_qos_profile_convertToJSON() failed [packet_delay_budget]");
goto end;
}
}
if (alternative_qos_profile->packet_err_rate) {
if (cJSON_AddStringToObject(item, "packetErrRate", alternative_qos_profile->packet_err_rate) == NULL) {
ogs_error("OpenAPI_alternative_qos_profile_convertToJSON() failed [packet_err_rate]");
goto end;
}
if (cJSON_AddStringToObject(item, "packetErrRate", alternative_qos_profile->packet_err_rate) == NULL) {
ogs_error("OpenAPI_alternative_qos_profile_convertToJSON() failed [packet_err_rate]");
goto end;
}
}
end:
@ -93,7 +93,7 @@ OpenAPI_alternative_qos_profile_t *OpenAPI_alternative_qos_profile_parseFromJSON
goto end;
}
if (!cJSON_IsNumber(index)) {
ogs_error("OpenAPI_alternative_qos_profile_parseFromJSON() failed [index]");
goto end;
@ -101,39 +101,39 @@ OpenAPI_alternative_qos_profile_t *OpenAPI_alternative_qos_profile_parseFromJSON
cJSON *gua_fbr_dl = cJSON_GetObjectItemCaseSensitive(alternative_qos_profileJSON, "guaFbrDl");
if (gua_fbr_dl) {
if (!cJSON_IsString(gua_fbr_dl)) {
ogs_error("OpenAPI_alternative_qos_profile_parseFromJSON() failed [gua_fbr_dl]");
goto end;
}
if (gua_fbr_dl) {
if (!cJSON_IsString(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");
if (gua_fbr_ul) {
if (!cJSON_IsString(gua_fbr_ul)) {
ogs_error("OpenAPI_alternative_qos_profile_parseFromJSON() failed [gua_fbr_ul]");
goto end;
}
if (gua_fbr_ul) {
if (!cJSON_IsString(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");
if (packet_delay_budget) {
if (!cJSON_IsNumber(packet_delay_budget)) {
ogs_error("OpenAPI_alternative_qos_profile_parseFromJSON() failed [packet_delay_budget]");
goto end;
}
if (packet_delay_budget) {
if (!cJSON_IsNumber(packet_delay_budget)) {
ogs_error("OpenAPI_alternative_qos_profile_parseFromJSON() failed [packet_delay_budget]");
goto end;
}
}
cJSON *packet_err_rate = cJSON_GetObjectItemCaseSensitive(alternative_qos_profileJSON, "packetErrRate");
if (packet_err_rate) {
if (!cJSON_IsString(packet_err_rate)) {
ogs_error("OpenAPI_alternative_qos_profile_parseFromJSON() failed [packet_err_rate]");
goto end;
}
if (packet_err_rate) {
if (!cJSON_IsString(packet_err_rate)) {
ogs_error("OpenAPI_alternative_qos_profile_parseFromJSON() failed [packet_err_rate]");
goto end;
}
}
alternative_qos_profile_local_var = OpenAPI_alternative_qos_profile_create (
index->valuedouble,
@ -141,7 +141,7 @@ OpenAPI_alternative_qos_profile_t *OpenAPI_alternative_qos_profile_parseFromJSON
gua_fbr_ul ? ogs_strdup_or_assert(gua_fbr_ul->valuestring) : NULL,
packet_delay_budget ? packet_delay_budget->valuedouble : 0,
packet_err_rate ? ogs_strdup_or_assert(packet_err_rate->valuestring) : NULL
);
);
return alternative_qos_profile_local_var;
end:

View File

@ -1,7 +1,7 @@
/*
* alternative_qos_profile.h
*
*
*
*/
#ifndef _OpenAPI_alternative_qos_profile_H_
@ -32,7 +32,7 @@ OpenAPI_alternative_qos_profile_t *OpenAPI_alternative_qos_profile_create(
char *gua_fbr_ul,
int packet_delay_budget,
char *packet_err_rate
);
);
void OpenAPI_alternative_qos_profile_free(OpenAPI_alternative_qos_profile_t *alternative_qos_profile);
OpenAPI_alternative_qos_profile_t *OpenAPI_alternative_qos_profile_parseFromJSON(cJSON *alternative_qos_profileJSON);
cJSON *OpenAPI_alternative_qos_profile_convertToJSON(OpenAPI_alternative_qos_profile_t *alternative_qos_profile);

View File

@ -7,7 +7,7 @@
OpenAPI_am_policy_data_t *OpenAPI_am_policy_data_create(
OpenAPI_list_t* pra_infos,
OpenAPI_list_t *subsc_cats
)
)
{
OpenAPI_am_policy_data_t *am_policy_data_local_var = OpenAPI_malloc(sizeof(OpenAPI_am_policy_data_t));
if (!am_policy_data_local_var) {
@ -49,40 +49,40 @@ cJSON *OpenAPI_am_policy_data_convertToJSON(OpenAPI_am_policy_data_t *am_policy_
item = cJSON_CreateObject();
if (am_policy_data->pra_infos) {
cJSON *pra_infos = cJSON_AddObjectToObject(item, "praInfos");
if (pra_infos == NULL) {
cJSON *pra_infos = cJSON_AddObjectToObject(item, "praInfos");
if (pra_infos == NULL) {
ogs_error("OpenAPI_am_policy_data_convertToJSON() failed [pra_infos]");
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 = OpenAPI_presence_info_convertToJSON(localKeyValue->value);
if (itemLocal == NULL) {
ogs_error("OpenAPI_am_policy_data_convertToJSON() failed [pra_infos]");
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 = OpenAPI_presence_info_convertToJSON(localKeyValue->value);
if (itemLocal == NULL) {
ogs_error("OpenAPI_am_policy_data_convertToJSON() failed [pra_infos]");
goto end;
}
cJSON_AddItemToObject(pra_infos, localKeyValue->key, itemLocal);
cJSON_AddItemToObject(pra_infos, localKeyValue->key, itemLocal);
}
}
}
if (am_policy_data->subsc_cats) {
cJSON *subsc_cats = cJSON_AddArrayToObject(item, "subscCats");
if (subsc_cats == NULL) {
ogs_error("OpenAPI_am_policy_data_convertToJSON() failed [subsc_cats]");
goto end;
}
cJSON *subsc_cats = cJSON_AddArrayToObject(item, "subscCats");
if (subsc_cats == 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_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;
}
}
}
end:
@ -95,50 +95,50 @@ OpenAPI_am_policy_data_t *OpenAPI_am_policy_data_parseFromJSON(cJSON *am_policy_
cJSON *pra_infos = cJSON_GetObjectItemCaseSensitive(am_policy_dataJSON, "praInfos");
OpenAPI_list_t *pra_infosList;
if (pra_infos) {
cJSON *pra_infos_local_map;
if (!cJSON_IsObject(pra_infos)) {
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(pra_infos_local_map)) {
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(pra_infos_local_map)) {
ogs_error("OpenAPI_am_policy_data_parseFromJSON() failed [pra_infos]");
goto end;
}
localMapKeyPair = OpenAPI_map_create(
localMapObject->string, OpenAPI_presence_info_parseFromJSON(localMapObject));
OpenAPI_list_add(pra_infosList, localMapKeyPair);
}
localMapKeyPair = OpenAPI_map_create(
localMapObject->string, OpenAPI_presence_info_parseFromJSON(localMapObject));
OpenAPI_list_add(pra_infosList , localMapKeyPair);
}
}
cJSON *subsc_cats = cJSON_GetObjectItemCaseSensitive(am_policy_dataJSON, "subscCats");
OpenAPI_list_t *subsc_catsList;
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_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_or_assert(subsc_cats_local->valuestring));
}
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_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_or_assert(subsc_cats_local->valuestring));
}
}
am_policy_data_local_var = OpenAPI_am_policy_data_create (
pra_infos ? pra_infosList : NULL,
subsc_cats ? subsc_catsList : NULL
);
);
return am_policy_data_local_var;
end:

View File

@ -27,7 +27,7 @@ typedef struct OpenAPI_am_policy_data_s {
OpenAPI_am_policy_data_t *OpenAPI_am_policy_data_create(
OpenAPI_list_t* pra_infos,
OpenAPI_list_t *subsc_cats
);
);
void OpenAPI_am_policy_data_free(OpenAPI_am_policy_data_t *am_policy_data);
OpenAPI_am_policy_data_t *OpenAPI_am_policy_data_parseFromJSON(cJSON *am_policy_dataJSON);
cJSON *OpenAPI_am_policy_data_convertToJSON(OpenAPI_am_policy_data_t *am_policy_data);

View File

@ -7,7 +7,7 @@
OpenAPI_ambr_t *OpenAPI_ambr_create(
char *uplink,
char *downlink
)
)
{
OpenAPI_ambr_t *ambr_local_var = OpenAPI_malloc(sizeof(OpenAPI_ambr_t));
if (!ambr_local_var) {
@ -63,7 +63,7 @@ OpenAPI_ambr_t *OpenAPI_ambr_parseFromJSON(cJSON *ambrJSON)
goto end;
}
if (!cJSON_IsString(uplink)) {
ogs_error("OpenAPI_ambr_parseFromJSON() failed [uplink]");
goto end;
@ -75,7 +75,7 @@ OpenAPI_ambr_t *OpenAPI_ambr_parseFromJSON(cJSON *ambrJSON)
goto end;
}
if (!cJSON_IsString(downlink)) {
ogs_error("OpenAPI_ambr_parseFromJSON() failed [downlink]");
goto end;
@ -84,7 +84,7 @@ OpenAPI_ambr_t *OpenAPI_ambr_parseFromJSON(cJSON *ambrJSON)
ambr_local_var = OpenAPI_ambr_create (
ogs_strdup_or_assert(uplink->valuestring),
ogs_strdup_or_assert(downlink->valuestring)
);
);
return ambr_local_var;
end:

View File

@ -1,7 +1,7 @@
/*
* ambr.h
*
*
*
*/
#ifndef _OpenAPI_ambr_H_
@ -26,7 +26,7 @@ typedef struct OpenAPI_ambr_s {
OpenAPI_ambr_t *OpenAPI_ambr_create(
char *uplink,
char *downlink
);
);
void OpenAPI_ambr_free(OpenAPI_ambr_t *ambr);
OpenAPI_ambr_t *OpenAPI_ambr_parseFromJSON(cJSON *ambrJSON);
cJSON *OpenAPI_ambr_convertToJSON(OpenAPI_ambr_t *ambr);

View File

@ -0,0 +1,127 @@
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "ambr_1.h"
OpenAPI_ambr_1_t *OpenAPI_ambr_1_create(
char *uplink,
char *downlink
)
{
OpenAPI_ambr_1_t *ambr_1_local_var = OpenAPI_malloc(sizeof(OpenAPI_ambr_1_t));
if (!ambr_1_local_var) {
return NULL;
}
ambr_1_local_var->uplink = uplink;
ambr_1_local_var->downlink = downlink;
return ambr_1_local_var;
}
void OpenAPI_ambr_1_free(OpenAPI_ambr_1_t *ambr_1)
{
if (NULL == ambr_1) {
return;
}
OpenAPI_lnode_t *node;
ogs_free(ambr_1->uplink);
ogs_free(ambr_1->downlink);
ogs_free(ambr_1);
}
cJSON *OpenAPI_ambr_1_convertToJSON(OpenAPI_ambr_1_t *ambr_1)
{
cJSON *item = NULL;
if (ambr_1 == NULL) {
ogs_error("OpenAPI_ambr_1_convertToJSON() failed [Ambr_1]");
return NULL;
}
item = cJSON_CreateObject();
if (cJSON_AddStringToObject(item, "uplink", ambr_1->uplink) == NULL) {
ogs_error("OpenAPI_ambr_1_convertToJSON() failed [uplink]");
goto end;
}
if (cJSON_AddStringToObject(item, "downlink", ambr_1->downlink) == NULL) {
ogs_error("OpenAPI_ambr_1_convertToJSON() failed [downlink]");
goto end;
}
end:
return item;
}
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");
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");
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;
}
ambr_1_local_var = OpenAPI_ambr_1_create (
ogs_strdup_or_assert(uplink->valuestring),
ogs_strdup_or_assert(downlink->valuestring)
);
return ambr_1_local_var;
end:
return NULL;
}
OpenAPI_ambr_1_t *OpenAPI_ambr_1_copy(OpenAPI_ambr_1_t *dst, OpenAPI_ambr_1_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_ambr_1_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_ambr_1_convertToJSON() failed");
return NULL;
}
content = cJSON_Print(item);
cJSON_Delete(item);
if (!content) {
ogs_error("cJSON_Print() failed");
return NULL;
}
item = cJSON_Parse(content);
ogs_free(content);
if (!item) {
ogs_error("cJSON_Parse() failed");
return NULL;
}
OpenAPI_ambr_1_free(dst);
dst = OpenAPI_ambr_1_parseFromJSON(item);
cJSON_Delete(item);
return dst;
}

View File

@ -0,0 +1,40 @@
/*
* ambr_1.h
*
*
*/
#ifndef _OpenAPI_ambr_1_H_
#define _OpenAPI_ambr_1_H_
#include <string.h>
#include "../external/cJSON.h"
#include "../include/list.h"
#include "../include/keyValuePair.h"
#include "../include/binary.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct OpenAPI_ambr_1_s OpenAPI_ambr_1_t;
typedef struct OpenAPI_ambr_1_s {
char *uplink;
char *downlink;
} OpenAPI_ambr_1_t;
OpenAPI_ambr_1_t *OpenAPI_ambr_1_create(
char *uplink,
char *downlink
);
void OpenAPI_ambr_1_free(OpenAPI_ambr_1_t *ambr_1);
OpenAPI_ambr_1_t *OpenAPI_ambr_1_parseFromJSON(cJSON *ambr_1JSON);
cJSON *OpenAPI_ambr_1_convertToJSON(OpenAPI_ambr_1_t *ambr_1);
OpenAPI_ambr_1_t *OpenAPI_ambr_1_copy(OpenAPI_ambr_1_t *dst, OpenAPI_ambr_1_t *src);
#ifdef __cplusplus
}
#endif
#endif /* _OpenAPI_ambr_1_H_ */

View File

@ -7,7 +7,7 @@
OpenAPI_ambr_rm_t *OpenAPI_ambr_rm_create(
char *uplink,
char *downlink
)
)
{
OpenAPI_ambr_rm_t *ambr_rm_local_var = OpenAPI_malloc(sizeof(OpenAPI_ambr_rm_t));
if (!ambr_rm_local_var) {
@ -63,7 +63,7 @@ OpenAPI_ambr_rm_t *OpenAPI_ambr_rm_parseFromJSON(cJSON *ambr_rmJSON)
goto end;
}
if (!cJSON_IsString(uplink)) {
ogs_error("OpenAPI_ambr_rm_parseFromJSON() failed [uplink]");
goto end;
@ -75,7 +75,7 @@ OpenAPI_ambr_rm_t *OpenAPI_ambr_rm_parseFromJSON(cJSON *ambr_rmJSON)
goto end;
}
if (!cJSON_IsString(downlink)) {
ogs_error("OpenAPI_ambr_rm_parseFromJSON() failed [downlink]");
goto end;
@ -84,7 +84,7 @@ OpenAPI_ambr_rm_t *OpenAPI_ambr_rm_parseFromJSON(cJSON *ambr_rmJSON)
ambr_rm_local_var = OpenAPI_ambr_rm_create (
ogs_strdup_or_assert(uplink->valuestring),
ogs_strdup_or_assert(downlink->valuestring)
);
);
return ambr_rm_local_var;
end:

View File

@ -1,7 +1,7 @@
/*
* ambr_rm.h
*
*
*
*/
#ifndef _OpenAPI_ambr_rm_H_
@ -28,7 +28,7 @@ typedef struct OpenAPI_ambr_rm_s {
OpenAPI_ambr_rm_t *OpenAPI_ambr_rm_create(
char *uplink,
char *downlink
);
);
void OpenAPI_ambr_rm_free(OpenAPI_ambr_rm_t *ambr_rm);
OpenAPI_ambr_rm_t *OpenAPI_ambr_rm_parseFromJSON(cJSON *ambr_rmJSON);
cJSON *OpenAPI_ambr_rm_convertToJSON(OpenAPI_ambr_rm_t *ambr_rm);

View File

@ -26,8 +26,9 @@ OpenAPI_amf3_gpp_access_registration_t *OpenAPI_amf3_gpp_access_registration_cre
char *registration_time,
OpenAPI_vgmlc_address_t *vgmlc_address,
OpenAPI_context_info_t *context_info,
int no_ee_subscription_ind
)
int no_ee_subscription_ind,
char *supi
)
{
OpenAPI_amf3_gpp_access_registration_t *amf3_gpp_access_registration_local_var = OpenAPI_malloc(sizeof(OpenAPI_amf3_gpp_access_registration_t));
if (!amf3_gpp_access_registration_local_var) {
@ -55,6 +56,7 @@ OpenAPI_amf3_gpp_access_registration_t *OpenAPI_amf3_gpp_access_registration_cre
amf3_gpp_access_registration_local_var->vgmlc_address = vgmlc_address;
amf3_gpp_access_registration_local_var->context_info = context_info;
amf3_gpp_access_registration_local_var->no_ee_subscription_ind = no_ee_subscription_ind;
amf3_gpp_access_registration_local_var->supi = supi;
return amf3_gpp_access_registration_local_var;
}
@ -82,6 +84,7 @@ void OpenAPI_amf3_gpp_access_registration_free(OpenAPI_amf3_gpp_access_registrat
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);
}
@ -101,31 +104,31 @@ cJSON *OpenAPI_amf3_gpp_access_registration_convertToJSON(OpenAPI_amf3_gpp_acces
}
if (amf3_gpp_access_registration->supported_features) {
if (cJSON_AddStringToObject(item, "supportedFeatures", amf3_gpp_access_registration->supported_features) == NULL) {
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [supported_features]");
goto end;
}
if (cJSON_AddStringToObject(item, "supportedFeatures", amf3_gpp_access_registration->supported_features) == NULL) {
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [supported_features]");
goto end;
}
}
if (amf3_gpp_access_registration->purge_flag) {
if (cJSON_AddBoolToObject(item, "purgeFlag", amf3_gpp_access_registration->purge_flag) == NULL) {
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [purge_flag]");
goto end;
}
if (cJSON_AddBoolToObject(item, "purgeFlag", amf3_gpp_access_registration->purge_flag) == NULL) {
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [purge_flag]");
goto end;
}
}
if (amf3_gpp_access_registration->pei) {
if (cJSON_AddStringToObject(item, "pei", amf3_gpp_access_registration->pei) == NULL) {
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [pei]");
goto end;
}
if (cJSON_AddStringToObject(item, "pei", amf3_gpp_access_registration->pei) == NULL) {
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [pei]");
goto end;
}
}
if (amf3_gpp_access_registration->ims_vo_ps) {
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 (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 (cJSON_AddStringToObject(item, "deregCallbackUri", amf3_gpp_access_registration->dereg_callback_uri) == NULL) {
@ -134,31 +137,31 @@ cJSON *OpenAPI_amf3_gpp_access_registration_convertToJSON(OpenAPI_amf3_gpp_acces
}
if (amf3_gpp_access_registration->amf_service_name_dereg) {
if (cJSON_AddStringToObject(item, "amfServiceNameDereg", amf3_gpp_access_registration->amf_service_name_dereg) == NULL) {
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [amf_service_name_dereg]");
goto end;
}
if (cJSON_AddStringToObject(item, "amfServiceNameDereg", amf3_gpp_access_registration->amf_service_name_dereg) == NULL) {
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [amf_service_name_dereg]");
goto end;
}
}
if (amf3_gpp_access_registration->pcscf_restoration_callback_uri) {
if (cJSON_AddStringToObject(item, "pcscfRestorationCallbackUri", amf3_gpp_access_registration->pcscf_restoration_callback_uri) == NULL) {
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [pcscf_restoration_callback_uri]");
goto end;
}
if (cJSON_AddStringToObject(item, "pcscfRestorationCallbackUri", amf3_gpp_access_registration->pcscf_restoration_callback_uri) == NULL) {
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [pcscf_restoration_callback_uri]");
goto end;
}
}
if (amf3_gpp_access_registration->amf_service_name_pcscf_rest) {
if (cJSON_AddStringToObject(item, "amfServiceNamePcscfRest", amf3_gpp_access_registration->amf_service_name_pcscf_rest) == NULL) {
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [amf_service_name_pcscf_rest]");
goto end;
}
if (cJSON_AddStringToObject(item, "amfServiceNamePcscfRest", amf3_gpp_access_registration->amf_service_name_pcscf_rest) == NULL) {
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [amf_service_name_pcscf_rest]");
goto end;
}
}
if (amf3_gpp_access_registration->initial_registration_ind) {
if (cJSON_AddBoolToObject(item, "initialRegistrationInd", amf3_gpp_access_registration->initial_registration_ind) == NULL) {
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [initial_registration_ind]");
goto end;
}
if (cJSON_AddBoolToObject(item, "initialRegistrationInd", amf3_gpp_access_registration->initial_registration_ind) == NULL) {
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [initial_registration_ind]");
goto end;
}
}
cJSON *guami_local_JSON = OpenAPI_guami_convertToJSON(amf3_gpp_access_registration->guami);
@ -173,30 +176,30 @@ cJSON *OpenAPI_amf3_gpp_access_registration_convertToJSON(OpenAPI_amf3_gpp_acces
}
if (amf3_gpp_access_registration->backup_amf_info) {
cJSON *backup_amf_infoList = cJSON_AddArrayToObject(item, "backupAmfInfo");
if (backup_amf_infoList == NULL) {
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [backup_amf_info]");
goto end;
}
cJSON *backup_amf_infoList = cJSON_AddArrayToObject(item, "backupAmfInfo");
if (backup_amf_infoList == NULL) {
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_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);
}
}
}
if (amf3_gpp_access_registration->dr_flag) {
if (cJSON_AddBoolToObject(item, "drFlag", amf3_gpp_access_registration->dr_flag) == NULL) {
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [dr_flag]");
goto end;
}
if (cJSON_AddBoolToObject(item, "drFlag", amf3_gpp_access_registration->dr_flag) == NULL) {
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [dr_flag]");
goto end;
}
}
if (cJSON_AddStringToObject(item, "ratType", OpenAPI_rat_type_ToString(amf3_gpp_access_registration->rat_type)) == NULL) {
@ -205,77 +208,84 @@ cJSON *OpenAPI_amf3_gpp_access_registration_convertToJSON(OpenAPI_amf3_gpp_acces
}
if (amf3_gpp_access_registration->urrp_indicator) {
if (cJSON_AddBoolToObject(item, "urrpIndicator", amf3_gpp_access_registration->urrp_indicator) == NULL) {
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [urrp_indicator]");
goto end;
}
if (cJSON_AddBoolToObject(item, "urrpIndicator", amf3_gpp_access_registration->urrp_indicator) == NULL) {
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [urrp_indicator]");
goto end;
}
}
if (amf3_gpp_access_registration->amf_ee_subscription_id) {
if (cJSON_AddStringToObject(item, "amfEeSubscriptionId", amf3_gpp_access_registration->amf_ee_subscription_id) == NULL) {
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [amf_ee_subscription_id]");
goto end;
}
if (cJSON_AddStringToObject(item, "amfEeSubscriptionId", amf3_gpp_access_registration->amf_ee_subscription_id) == NULL) {
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [amf_ee_subscription_id]");
goto end;
}
}
if (amf3_gpp_access_registration->eps_interworking_info) {
cJSON *eps_interworking_info_local_JSON = OpenAPI_eps_interworking_info_convertToJSON(amf3_gpp_access_registration->eps_interworking_info);
if (eps_interworking_info_local_JSON == NULL) {
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [eps_interworking_info]");
goto end;
}
cJSON_AddItemToObject(item, "epsInterworkingInfo", eps_interworking_info_local_JSON);
if (item->child == NULL) {
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [eps_interworking_info]");
goto end;
}
cJSON *eps_interworking_info_local_JSON = OpenAPI_eps_interworking_info_convertToJSON(amf3_gpp_access_registration->eps_interworking_info);
if (eps_interworking_info_local_JSON == NULL) {
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [eps_interworking_info]");
goto end;
}
cJSON_AddItemToObject(item, "epsInterworkingInfo", eps_interworking_info_local_JSON);
if (item->child == NULL) {
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [eps_interworking_info]");
goto end;
}
}
if (amf3_gpp_access_registration->ue_srvcc_capability) {
if (cJSON_AddBoolToObject(item, "ueSrvccCapability", amf3_gpp_access_registration->ue_srvcc_capability) == NULL) {
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [ue_srvcc_capability]");
goto end;
}
if (cJSON_AddBoolToObject(item, "ueSrvccCapability", amf3_gpp_access_registration->ue_srvcc_capability) == NULL) {
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [ue_srvcc_capability]");
goto end;
}
}
if (amf3_gpp_access_registration->registration_time) {
if (cJSON_AddStringToObject(item, "registrationTime", amf3_gpp_access_registration->registration_time) == NULL) {
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [registration_time]");
goto end;
}
if (cJSON_AddStringToObject(item, "registrationTime", amf3_gpp_access_registration->registration_time) == NULL) {
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [registration_time]");
goto end;
}
}
if (amf3_gpp_access_registration->vgmlc_address) {
cJSON *vgmlc_address_local_JSON = OpenAPI_vgmlc_address_convertToJSON(amf3_gpp_access_registration->vgmlc_address);
if (vgmlc_address_local_JSON == NULL) {
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [vgmlc_address]");
goto end;
}
cJSON_AddItemToObject(item, "vgmlcAddress", vgmlc_address_local_JSON);
if (item->child == NULL) {
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [vgmlc_address]");
goto end;
}
cJSON *vgmlc_address_local_JSON = OpenAPI_vgmlc_address_convertToJSON(amf3_gpp_access_registration->vgmlc_address);
if (vgmlc_address_local_JSON == NULL) {
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [vgmlc_address]");
goto end;
}
cJSON_AddItemToObject(item, "vgmlcAddress", vgmlc_address_local_JSON);
if (item->child == NULL) {
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [vgmlc_address]");
goto end;
}
}
if (amf3_gpp_access_registration->context_info) {
cJSON *context_info_local_JSON = OpenAPI_context_info_convertToJSON(amf3_gpp_access_registration->context_info);
if (context_info_local_JSON == NULL) {
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [context_info]");
goto end;
}
cJSON_AddItemToObject(item, "contextInfo", context_info_local_JSON);
if (item->child == NULL) {
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [context_info]");
goto end;
}
cJSON *context_info_local_JSON = OpenAPI_context_info_convertToJSON(amf3_gpp_access_registration->context_info);
if (context_info_local_JSON == NULL) {
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [context_info]");
goto end;
}
cJSON_AddItemToObject(item, "contextInfo", context_info_local_JSON);
if (item->child == NULL) {
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [context_info]");
goto end;
}
}
if (amf3_gpp_access_registration->no_ee_subscription_ind) {
if (cJSON_AddBoolToObject(item, "noEeSubscriptionInd", amf3_gpp_access_registration->no_ee_subscription_ind) == NULL) {
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [no_ee_subscription_ind]");
goto end;
}
if (cJSON_AddBoolToObject(item, "noEeSubscriptionInd", amf3_gpp_access_registration->no_ee_subscription_ind) == NULL) {
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [no_ee_subscription_ind]");
goto end;
}
}
if (amf3_gpp_access_registration->supi) {
if (cJSON_AddStringToObject(item, "supi", amf3_gpp_access_registration->supi) == NULL) {
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [supi]");
goto end;
}
}
end:
@ -291,7 +301,7 @@ OpenAPI_amf3_gpp_access_registration_t *OpenAPI_amf3_gpp_access_registration_par
goto end;
}
if (!cJSON_IsString(amf_instance_id)) {
ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [amf_instance_id]");
goto end;
@ -299,41 +309,41 @@ OpenAPI_amf3_gpp_access_registration_t *OpenAPI_amf3_gpp_access_registration_par
cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "supportedFeatures");
if (supported_features) {
if (!cJSON_IsString(supported_features)) {
ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [supported_features]");
goto end;
}
if (supported_features) {
if (!cJSON_IsString(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");
if (purge_flag) {
if (!cJSON_IsBool(purge_flag)) {
ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [purge_flag]");
goto end;
}
if (purge_flag) {
if (!cJSON_IsBool(purge_flag)) {
ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [purge_flag]");
goto end;
}
}
cJSON *pei = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "pei");
if (pei) {
if (!cJSON_IsString(pei)) {
ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [pei]");
goto end;
}
if (pei) {
if (!cJSON_IsString(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;
if (ims_vo_ps) {
if (!cJSON_IsString(ims_vo_ps)) {
ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [ims_vo_ps]");
goto end;
}
ims_vo_psVariable = OpenAPI_ims_vo_ps_FromString(ims_vo_ps->valuestring);
if (ims_vo_ps) {
if (!cJSON_IsString(ims_vo_ps)) {
ogs_error("OpenAPI_amf3_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(amf3_gpp_access_registrationJSON, "deregCallbackUri");
if (!dereg_callback_uri) {
@ -341,7 +351,7 @@ OpenAPI_amf3_gpp_access_registration_t *OpenAPI_amf3_gpp_access_registration_par
goto end;
}
if (!cJSON_IsString(dereg_callback_uri)) {
ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [dereg_callback_uri]");
goto end;
@ -349,39 +359,39 @@ OpenAPI_amf3_gpp_access_registration_t *OpenAPI_amf3_gpp_access_registration_par
cJSON *amf_service_name_dereg = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "amfServiceNameDereg");
if (amf_service_name_dereg) {
if (!cJSON_IsString(amf_service_name_dereg)) {
ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [amf_service_name_dereg]");
goto end;
}
if (amf_service_name_dereg) {
if (!cJSON_IsString(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");
if (pcscf_restoration_callback_uri) {
if (!cJSON_IsString(pcscf_restoration_callback_uri)) {
ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [pcscf_restoration_callback_uri]");
goto end;
}
if (pcscf_restoration_callback_uri) {
if (!cJSON_IsString(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");
if (amf_service_name_pcscf_rest) {
if (!cJSON_IsString(amf_service_name_pcscf_rest)) {
ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [amf_service_name_pcscf_rest]");
goto end;
}
if (amf_service_name_pcscf_rest) {
if (!cJSON_IsString(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");
if (initial_registration_ind) {
if (!cJSON_IsBool(initial_registration_ind)) {
ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [initial_registration_ind]");
goto end;
}
if (initial_registration_ind) {
if (!cJSON_IsBool(initial_registration_ind)) {
ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [initial_registration_ind]");
goto end;
}
}
cJSON *guami = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "guami");
if (!guami) {
@ -390,40 +400,40 @@ OpenAPI_amf3_gpp_access_registration_t *OpenAPI_amf3_gpp_access_registration_par
}
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;
if (backup_amf_info) {
cJSON *backup_amf_info_local_nonprimitive;
if (!cJSON_IsArray(backup_amf_info)) {
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)) {
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);
backup_amf_infoList = OpenAPI_list_create();
cJSON_ArrayForEach(backup_amf_info_local_nonprimitive, backup_amf_info ) {
if (!cJSON_IsObject(backup_amf_info_local_nonprimitive)) {
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);
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");
if (dr_flag) {
if (!cJSON_IsBool(dr_flag)) {
ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [dr_flag]");
goto end;
}
if (dr_flag) {
if (!cJSON_IsBool(dr_flag)) {
ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [dr_flag]");
goto end;
}
}
cJSON *rat_type = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "ratType");
if (!rat_type) {
@ -432,7 +442,7 @@ OpenAPI_amf3_gpp_access_registration_t *OpenAPI_amf3_gpp_access_registration_par
}
OpenAPI_rat_type_e rat_typeVariable;
if (!cJSON_IsString(rat_type)) {
ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [rat_type]");
goto end;
@ -441,69 +451,78 @@ OpenAPI_amf3_gpp_access_registration_t *OpenAPI_amf3_gpp_access_registration_par
cJSON *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]");
goto end;
}
if (urrp_indicator) {
if (!cJSON_IsBool(urrp_indicator)) {
ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [urrp_indicator]");
goto end;
}
}
cJSON *amf_ee_subscription_id = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "amfEeSubscriptionId");
if (amf_ee_subscription_id) {
if (!cJSON_IsString(amf_ee_subscription_id)) {
ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [amf_ee_subscription_id]");
goto end;
}
if (amf_ee_subscription_id) {
if (!cJSON_IsString(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;
if (eps_interworking_info) {
eps_interworking_info_local_nonprim = OpenAPI_eps_interworking_info_parseFromJSON(eps_interworking_info);
}
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");
if (ue_srvcc_capability) {
if (!cJSON_IsBool(ue_srvcc_capability)) {
ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [ue_srvcc_capability]");
goto end;
}
if (ue_srvcc_capability) {
if (!cJSON_IsBool(ue_srvcc_capability)) {
ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [ue_srvcc_capability]");
goto end;
}
}
cJSON *registration_time = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "registrationTime");
if (registration_time) {
if (!cJSON_IsString(registration_time)) {
ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [registration_time]");
goto end;
}
if (registration_time) {
if (!cJSON_IsString(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;
if (vgmlc_address) {
vgmlc_address_local_nonprim = OpenAPI_vgmlc_address_parseFromJSON(vgmlc_address);
}
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;
if (context_info) {
context_info_local_nonprim = OpenAPI_context_info_parseFromJSON(context_info);
}
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");
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]");
goto end;
}
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]");
goto end;
}
}
cJSON *supi = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "supi");
if (supi) {
if (!cJSON_IsString(supi)) {
ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [supi]");
goto end;
}
}
amf3_gpp_access_registration_local_var = OpenAPI_amf3_gpp_access_registration_create (
ogs_strdup_or_assert(amf_instance_id->valuestring),
@ -527,8 +546,9 @@ OpenAPI_amf3_gpp_access_registration_t *OpenAPI_amf3_gpp_access_registration_par
registration_time ? ogs_strdup_or_assert(registration_time->valuestring) : NULL,
vgmlc_address ? vgmlc_address_local_nonprim : NULL,
context_info ? context_info_local_nonprim : NULL,
no_ee_subscription_ind ? no_ee_subscription_ind->valueint : 0
);
no_ee_subscription_ind ? no_ee_subscription_ind->valueint : 0,
supi ? ogs_strdup_or_assert(supi->valuestring) : NULL
);
return amf3_gpp_access_registration_local_var;
end:

View File

@ -1,7 +1,7 @@
/*
* amf3_gpp_access_registration.h
*
*
*
*/
#ifndef _OpenAPI_amf3_gpp_access_registration_H_
@ -48,6 +48,7 @@ typedef struct OpenAPI_amf3_gpp_access_registration_s {
struct OpenAPI_vgmlc_address_s *vgmlc_address;
struct OpenAPI_context_info_s *context_info;
int no_ee_subscription_ind;
char *supi;
} OpenAPI_amf3_gpp_access_registration_t;
OpenAPI_amf3_gpp_access_registration_t *OpenAPI_amf3_gpp_access_registration_create(
@ -72,8 +73,9 @@ OpenAPI_amf3_gpp_access_registration_t *OpenAPI_amf3_gpp_access_registration_cre
char *registration_time,
OpenAPI_vgmlc_address_t *vgmlc_address,
OpenAPI_context_info_t *context_info,
int no_ee_subscription_ind
);
int no_ee_subscription_ind,
char *supi
);
void OpenAPI_amf3_gpp_access_registration_free(OpenAPI_amf3_gpp_access_registration_t *amf3_gpp_access_registration);
OpenAPI_amf3_gpp_access_registration_t *OpenAPI_amf3_gpp_access_registration_parseFromJSON(cJSON *amf3_gpp_access_registrationJSON);
cJSON *OpenAPI_amf3_gpp_access_registration_convertToJSON(OpenAPI_amf3_gpp_access_registration_t *amf3_gpp_access_registration);

View File

@ -11,9 +11,8 @@ OpenAPI_amf3_gpp_access_registration_modification_t *OpenAPI_amf3_gpp_access_reg
OpenAPI_ims_vo_ps_e ims_vo_ps,
OpenAPI_list_t *backup_amf_info,
OpenAPI_eps_interworking_info_t *eps_interworking_info,
int ue_srvcc_capability,
int no_ee_subscription_ind
)
int ue_srvcc_capability
)
{
OpenAPI_amf3_gpp_access_registration_modification_t *amf3_gpp_access_registration_modification_local_var = OpenAPI_malloc(sizeof(OpenAPI_amf3_gpp_access_registration_modification_t));
if (!amf3_gpp_access_registration_modification_local_var) {
@ -26,7 +25,6 @@ OpenAPI_amf3_gpp_access_registration_modification_t *OpenAPI_amf3_gpp_access_reg
amf3_gpp_access_registration_modification_local_var->backup_amf_info = backup_amf_info;
amf3_gpp_access_registration_modification_local_var->eps_interworking_info = eps_interworking_info;
amf3_gpp_access_registration_modification_local_var->ue_srvcc_capability = ue_srvcc_capability;
amf3_gpp_access_registration_modification_local_var->no_ee_subscription_ind = no_ee_subscription_ind;
return amf3_gpp_access_registration_modification_local_var;
}
@ -69,71 +67,64 @@ cJSON *OpenAPI_amf3_gpp_access_registration_modification_convertToJSON(OpenAPI_a
}
if (amf3_gpp_access_registration_modification->purge_flag) {
if (cJSON_AddBoolToObject(item, "purgeFlag", amf3_gpp_access_registration_modification->purge_flag) == NULL) {
ogs_error("OpenAPI_amf3_gpp_access_registration_modification_convertToJSON() failed [purge_flag]");
goto end;
}
if (cJSON_AddBoolToObject(item, "purgeFlag", amf3_gpp_access_registration_modification->purge_flag) == NULL) {
ogs_error("OpenAPI_amf3_gpp_access_registration_modification_convertToJSON() failed [purge_flag]");
goto end;
}
}
if (amf3_gpp_access_registration_modification->pei) {
if (cJSON_AddStringToObject(item, "pei", amf3_gpp_access_registration_modification->pei) == NULL) {
ogs_error("OpenAPI_amf3_gpp_access_registration_modification_convertToJSON() failed [pei]");
goto end;
}
if (cJSON_AddStringToObject(item, "pei", amf3_gpp_access_registration_modification->pei) == NULL) {
ogs_error("OpenAPI_amf3_gpp_access_registration_modification_convertToJSON() failed [pei]");
goto end;
}
}
if (amf3_gpp_access_registration_modification->ims_vo_ps) {
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;
}
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;
}
}
if (amf3_gpp_access_registration_modification->backup_amf_info) {
cJSON *backup_amf_infoList = cJSON_AddArrayToObject(item, "backupAmfInfo");
if (backup_amf_infoList == NULL) {
ogs_error("OpenAPI_amf3_gpp_access_registration_modification_convertToJSON() failed [backup_amf_info]");
goto end;
}
cJSON *backup_amf_infoList = cJSON_AddArrayToObject(item, "backupAmfInfo");
if (backup_amf_infoList == NULL) {
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_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);
}
}
}
if (amf3_gpp_access_registration_modification->eps_interworking_info) {
cJSON *eps_interworking_info_local_JSON = OpenAPI_eps_interworking_info_convertToJSON(amf3_gpp_access_registration_modification->eps_interworking_info);
if (eps_interworking_info_local_JSON == NULL) {
ogs_error("OpenAPI_amf3_gpp_access_registration_modification_convertToJSON() failed [eps_interworking_info]");
goto end;
}
cJSON_AddItemToObject(item, "epsInterworkingInfo", eps_interworking_info_local_JSON);
if (item->child == NULL) {
ogs_error("OpenAPI_amf3_gpp_access_registration_modification_convertToJSON() failed [eps_interworking_info]");
goto end;
}
cJSON *eps_interworking_info_local_JSON = OpenAPI_eps_interworking_info_convertToJSON(amf3_gpp_access_registration_modification->eps_interworking_info);
if (eps_interworking_info_local_JSON == NULL) {
ogs_error("OpenAPI_amf3_gpp_access_registration_modification_convertToJSON() failed [eps_interworking_info]");
goto end;
}
cJSON_AddItemToObject(item, "epsInterworkingInfo", eps_interworking_info_local_JSON);
if (item->child == NULL) {
ogs_error("OpenAPI_amf3_gpp_access_registration_modification_convertToJSON() failed [eps_interworking_info]");
goto end;
}
}
if (amf3_gpp_access_registration_modification->ue_srvcc_capability) {
if (cJSON_AddBoolToObject(item, "ueSrvccCapability", amf3_gpp_access_registration_modification->ue_srvcc_capability) == NULL) {
ogs_error("OpenAPI_amf3_gpp_access_registration_modification_convertToJSON() failed [ue_srvcc_capability]");
goto end;
}
if (cJSON_AddBoolToObject(item, "ueSrvccCapability", amf3_gpp_access_registration_modification->ue_srvcc_capability) == NULL) {
ogs_error("OpenAPI_amf3_gpp_access_registration_modification_convertToJSON() failed [ue_srvcc_capability]");
goto end;
}
if (amf3_gpp_access_registration_modification->no_ee_subscription_ind) {
if (cJSON_AddBoolToObject(item, "noEeSubscriptionInd", amf3_gpp_access_registration_modification->no_ee_subscription_ind) == NULL) {
ogs_error("OpenAPI_amf3_gpp_access_registration_modification_convertToJSON() failed [no_ee_subscription_ind]");
goto end;
}
}
end:
@ -150,85 +141,76 @@ OpenAPI_amf3_gpp_access_registration_modification_t *OpenAPI_amf3_gpp_access_reg
}
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");
if (purge_flag) {
if (!cJSON_IsBool(purge_flag)) {
ogs_error("OpenAPI_amf3_gpp_access_registration_modification_parseFromJSON() failed [purge_flag]");
goto end;
}
if (purge_flag) {
if (!cJSON_IsBool(purge_flag)) {
ogs_error("OpenAPI_amf3_gpp_access_registration_modification_parseFromJSON() failed [purge_flag]");
goto end;
}
}
cJSON *pei = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registration_modificationJSON, "pei");
if (pei) {
if (!cJSON_IsString(pei)) {
ogs_error("OpenAPI_amf3_gpp_access_registration_modification_parseFromJSON() failed [pei]");
goto end;
}
if (pei) {
if (!cJSON_IsString(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;
if (ims_vo_ps) {
if (!cJSON_IsString(ims_vo_ps)) {
ogs_error("OpenAPI_amf3_gpp_access_registration_modification_parseFromJSON() failed [ims_vo_ps]");
goto end;
}
ims_vo_psVariable = OpenAPI_ims_vo_ps_FromString(ims_vo_ps->valuestring);
if (ims_vo_ps) {
if (!cJSON_IsString(ims_vo_ps)) {
ogs_error("OpenAPI_amf3_gpp_access_registration_modification_parseFromJSON() failed [ims_vo_ps]");
goto end;
}
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;
if (backup_amf_info) {
cJSON *backup_amf_info_local_nonprimitive;
if (!cJSON_IsArray(backup_amf_info)) {
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)) {
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);
backup_amf_infoList = OpenAPI_list_create();
cJSON_ArrayForEach(backup_amf_info_local_nonprimitive, backup_amf_info ) {
if (!cJSON_IsObject(backup_amf_info_local_nonprimitive)) {
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);
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;
if (eps_interworking_info) {
eps_interworking_info_local_nonprim = OpenAPI_eps_interworking_info_parseFromJSON(eps_interworking_info);
}
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");
if (ue_srvcc_capability) {
if (!cJSON_IsBool(ue_srvcc_capability)) {
ogs_error("OpenAPI_amf3_gpp_access_registration_modification_parseFromJSON() failed [ue_srvcc_capability]");
goto end;
}
}
cJSON *no_ee_subscription_ind = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registration_modificationJSON, "noEeSubscriptionInd");
if (no_ee_subscription_ind) {
if (!cJSON_IsBool(no_ee_subscription_ind)) {
ogs_error("OpenAPI_amf3_gpp_access_registration_modification_parseFromJSON() failed [no_ee_subscription_ind]");
goto end;
}
if (ue_srvcc_capability) {
if (!cJSON_IsBool(ue_srvcc_capability)) {
ogs_error("OpenAPI_amf3_gpp_access_registration_modification_parseFromJSON() failed [ue_srvcc_capability]");
goto end;
}
}
amf3_gpp_access_registration_modification_local_var = OpenAPI_amf3_gpp_access_registration_modification_create (
guami_local_nonprim,
@ -237,9 +219,8 @@ OpenAPI_amf3_gpp_access_registration_modification_t *OpenAPI_amf3_gpp_access_reg
ims_vo_ps ? ims_vo_psVariable : 0,
backup_amf_info ? backup_amf_infoList : NULL,
eps_interworking_info ? eps_interworking_info_local_nonprim : NULL,
ue_srvcc_capability ? ue_srvcc_capability->valueint : 0,
no_ee_subscription_ind ? no_ee_subscription_ind->valueint : 0
);
ue_srvcc_capability ? ue_srvcc_capability->valueint : 0
);
return amf3_gpp_access_registration_modification_local_var;
end:

View File

@ -1,7 +1,7 @@
/*
* amf3_gpp_access_registration_modification.h
*
*
*
*/
#ifndef _OpenAPI_amf3_gpp_access_registration_modification_H_
@ -30,7 +30,6 @@ typedef struct OpenAPI_amf3_gpp_access_registration_modification_s {
OpenAPI_list_t *backup_amf_info;
struct OpenAPI_eps_interworking_info_s *eps_interworking_info;
int ue_srvcc_capability;
int no_ee_subscription_ind;
} OpenAPI_amf3_gpp_access_registration_modification_t;
OpenAPI_amf3_gpp_access_registration_modification_t *OpenAPI_amf3_gpp_access_registration_modification_create(
@ -40,9 +39,8 @@ OpenAPI_amf3_gpp_access_registration_modification_t *OpenAPI_amf3_gpp_access_reg
OpenAPI_ims_vo_ps_e ims_vo_ps,
OpenAPI_list_t *backup_amf_info,
OpenAPI_eps_interworking_info_t *eps_interworking_info,
int ue_srvcc_capability,
int no_ee_subscription_ind
);
int ue_srvcc_capability
);
void OpenAPI_amf3_gpp_access_registration_modification_free(OpenAPI_amf3_gpp_access_registration_modification_t *amf3_gpp_access_registration_modification);
OpenAPI_amf3_gpp_access_registration_modification_t *OpenAPI_amf3_gpp_access_registration_modification_parseFromJSON(cJSON *amf3_gpp_access_registration_modificationJSON);
cJSON *OpenAPI_amf3_gpp_access_registration_modification_convertToJSON(OpenAPI_amf3_gpp_access_registration_modification_t *amf3_gpp_access_registration_modification);

View File

@ -7,7 +7,7 @@
OpenAPI_amf_cond_t *OpenAPI_amf_cond_create(
char *amf_set_id,
char *amf_region_id
)
)
{
OpenAPI_amf_cond_t *amf_cond_local_var = OpenAPI_malloc(sizeof(OpenAPI_amf_cond_t));
if (!amf_cond_local_var) {
@ -41,17 +41,17 @@ cJSON *OpenAPI_amf_cond_convertToJSON(OpenAPI_amf_cond_t *amf_cond)
item = cJSON_CreateObject();
if (amf_cond->amf_set_id) {
if (cJSON_AddStringToObject(item, "amfSetId", amf_cond->amf_set_id) == NULL) {
ogs_error("OpenAPI_amf_cond_convertToJSON() failed [amf_set_id]");
goto end;
}
if (cJSON_AddStringToObject(item, "amfSetId", amf_cond->amf_set_id) == NULL) {
ogs_error("OpenAPI_amf_cond_convertToJSON() failed [amf_set_id]");
goto end;
}
}
if (amf_cond->amf_region_id) {
if (cJSON_AddStringToObject(item, "amfRegionId", amf_cond->amf_region_id) == NULL) {
ogs_error("OpenAPI_amf_cond_convertToJSON() failed [amf_region_id]");
goto end;
}
if (cJSON_AddStringToObject(item, "amfRegionId", amf_cond->amf_region_id) == NULL) {
ogs_error("OpenAPI_amf_cond_convertToJSON() failed [amf_region_id]");
goto end;
}
}
end:
@ -63,26 +63,26 @@ 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");
if (amf_set_id) {
if (!cJSON_IsString(amf_set_id)) {
ogs_error("OpenAPI_amf_cond_parseFromJSON() failed [amf_set_id]");
goto end;
}
if (amf_set_id) {
if (!cJSON_IsString(amf_set_id)) {
ogs_error("OpenAPI_amf_cond_parseFromJSON() failed [amf_set_id]");
goto end;
}
}
cJSON *amf_region_id = cJSON_GetObjectItemCaseSensitive(amf_condJSON, "amfRegionId");
if (amf_region_id) {
if (!cJSON_IsString(amf_region_id)) {
ogs_error("OpenAPI_amf_cond_parseFromJSON() failed [amf_region_id]");
goto end;
}
if (amf_region_id) {
if (!cJSON_IsString(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_or_assert(amf_set_id->valuestring) : NULL,
amf_region_id ? ogs_strdup_or_assert(amf_region_id->valuestring) : NULL
);
);
return amf_cond_local_var;
end:

View File

@ -26,7 +26,7 @@ typedef struct OpenAPI_amf_cond_s {
OpenAPI_amf_cond_t *OpenAPI_amf_cond_create(
char *amf_set_id,
char *amf_region_id
);
);
void OpenAPI_amf_cond_free(OpenAPI_amf_cond_t *amf_cond);
OpenAPI_amf_cond_t *OpenAPI_amf_cond_parseFromJSON(cJSON *amf_condJSON);
cJSON *OpenAPI_amf_cond_convertToJSON(OpenAPI_amf_cond_t *amf_cond);

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