mirror of
https://github.com/open5gs/open5gs.git
synced 2026-05-04 14:20:09 +00:00
arch: DB schema Changes (#796)
- New function : NSSF - New feature : SMF selection
This commit is contained in:
parent
c6bfbed922
commit
9af4268bab
691 changed files with 40727 additions and 18985 deletions
|
|
@ -8,7 +8,6 @@ OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_sub
|
|||
char *supported_features,
|
||||
OpenAPI_list_t *gpsis,
|
||||
OpenAPI_list_t *internal_group_ids,
|
||||
OpenAPI_list_t* vn_group_info,
|
||||
OpenAPI_list_t* shared_vn_group_data_ids,
|
||||
OpenAPI_ambr_rm_t *subscribed_ue_ambr,
|
||||
OpenAPI_nssai_t *nssai,
|
||||
|
|
@ -22,7 +21,6 @@ OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_sub
|
|||
int mps_priority,
|
||||
int mcs_priority,
|
||||
int active_time,
|
||||
int dl_packet_count,
|
||||
OpenAPI_sor_info_t *sor_info,
|
||||
int sor_info_expect_ind,
|
||||
int soraf_retrieval,
|
||||
|
|
@ -30,9 +28,11 @@ OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_sub
|
|||
OpenAPI_upu_info_t *upu_info,
|
||||
int mico_allowed,
|
||||
OpenAPI_list_t *shared_am_data_ids,
|
||||
OpenAPI_odb_packet_services_t *odb_packet_services,
|
||||
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_t *mdt_configuration,
|
||||
OpenAPI_trace_data_t *trace_data,
|
||||
OpenAPI_cag_data_t *cag_data,
|
||||
char *stn_sr,
|
||||
|
|
@ -40,20 +40,16 @@ OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_sub
|
|||
int nb_io_t_ue_priority,
|
||||
int nssai_inclusion_allowed,
|
||||
char rg_wireline_characteristics,
|
||||
OpenAPI_tmbr_t *rg_tmbr,
|
||||
OpenAPI_ec_restriction_data_t *ec_restriction_data,
|
||||
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,
|
||||
OpenAPI_list_t *maximum_response_time_list,
|
||||
OpenAPI_list_t *maximum_latency_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_nr_v2x_auth_t *nr_v2x_services_auth,
|
||||
OpenAPI_lte_v2x_auth_t *lte_v2x_services_auth,
|
||||
char *nr_ue_pc5_ambr,
|
||||
char *lte_pc5_ambr
|
||||
OpenAPI_list_t *wireline_forbidden_areas,
|
||||
OpenAPI_wireline_service_area_restriction_t *wireline_service_area_restriction
|
||||
)
|
||||
{
|
||||
OpenAPI_access_and_mobility_subscription_data_t *access_and_mobility_subscription_data_local_var = OpenAPI_malloc(sizeof(OpenAPI_access_and_mobility_subscription_data_t));
|
||||
|
|
@ -63,7 +59,6 @@ OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_sub
|
|||
access_and_mobility_subscription_data_local_var->supported_features = supported_features;
|
||||
access_and_mobility_subscription_data_local_var->gpsis = gpsis;
|
||||
access_and_mobility_subscription_data_local_var->internal_group_ids = internal_group_ids;
|
||||
access_and_mobility_subscription_data_local_var->vn_group_info = vn_group_info;
|
||||
access_and_mobility_subscription_data_local_var->shared_vn_group_data_ids = shared_vn_group_data_ids;
|
||||
access_and_mobility_subscription_data_local_var->subscribed_ue_ambr = subscribed_ue_ambr;
|
||||
access_and_mobility_subscription_data_local_var->nssai = nssai;
|
||||
|
|
@ -77,7 +72,6 @@ OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_sub
|
|||
access_and_mobility_subscription_data_local_var->mps_priority = mps_priority;
|
||||
access_and_mobility_subscription_data_local_var->mcs_priority = mcs_priority;
|
||||
access_and_mobility_subscription_data_local_var->active_time = active_time;
|
||||
access_and_mobility_subscription_data_local_var->dl_packet_count = dl_packet_count;
|
||||
access_and_mobility_subscription_data_local_var->sor_info = sor_info;
|
||||
access_and_mobility_subscription_data_local_var->sor_info_expect_ind = sor_info_expect_ind;
|
||||
access_and_mobility_subscription_data_local_var->soraf_retrieval = soraf_retrieval;
|
||||
|
|
@ -88,6 +82,8 @@ OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_sub
|
|||
access_and_mobility_subscription_data_local_var->odb_packet_services = odb_packet_services;
|
||||
access_and_mobility_subscription_data_local_var->subscribed_dnn_list = subscribed_dnn_list;
|
||||
access_and_mobility_subscription_data_local_var->service_gap_time = service_gap_time;
|
||||
access_and_mobility_subscription_data_local_var->mdt_user_consent = mdt_user_consent;
|
||||
access_and_mobility_subscription_data_local_var->mdt_configuration = mdt_configuration;
|
||||
access_and_mobility_subscription_data_local_var->trace_data = trace_data;
|
||||
access_and_mobility_subscription_data_local_var->cag_data = cag_data;
|
||||
access_and_mobility_subscription_data_local_var->stn_sr = stn_sr;
|
||||
|
|
@ -95,20 +91,16 @@ OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_sub
|
|||
access_and_mobility_subscription_data_local_var->nb_io_t_ue_priority = nb_io_t_ue_priority;
|
||||
access_and_mobility_subscription_data_local_var->nssai_inclusion_allowed = nssai_inclusion_allowed;
|
||||
access_and_mobility_subscription_data_local_var->rg_wireline_characteristics = rg_wireline_characteristics;
|
||||
access_and_mobility_subscription_data_local_var->rg_tmbr = rg_tmbr;
|
||||
access_and_mobility_subscription_data_local_var->ec_restriction_data = ec_restriction_data;
|
||||
access_and_mobility_subscription_data_local_var->ec_restriction_data_wb = ec_restriction_data_wb;
|
||||
access_and_mobility_subscription_data_local_var->ec_restriction_data_nb = ec_restriction_data_nb;
|
||||
access_and_mobility_subscription_data_local_var->expected_ue_behaviour_list = expected_ue_behaviour_list;
|
||||
access_and_mobility_subscription_data_local_var->maximum_response_time_list = maximum_response_time_list;
|
||||
access_and_mobility_subscription_data_local_var->maximum_latency_list = maximum_latency_list;
|
||||
access_and_mobility_subscription_data_local_var->primary_rat_restrictions = primary_rat_restrictions;
|
||||
access_and_mobility_subscription_data_local_var->secondary_rat_restrictions = secondary_rat_restrictions;
|
||||
access_and_mobility_subscription_data_local_var->edrx_parameters_list = edrx_parameters_list;
|
||||
access_and_mobility_subscription_data_local_var->ptw_parameters_list = ptw_parameters_list;
|
||||
access_and_mobility_subscription_data_local_var->iab_operation_allowed = iab_operation_allowed;
|
||||
access_and_mobility_subscription_data_local_var->nr_v2x_services_auth = nr_v2x_services_auth;
|
||||
access_and_mobility_subscription_data_local_var->lte_v2x_services_auth = lte_v2x_services_auth;
|
||||
access_and_mobility_subscription_data_local_var->nr_ue_pc5_ambr = nr_ue_pc5_ambr;
|
||||
access_and_mobility_subscription_data_local_var->lte_pc5_ambr = lte_pc5_ambr;
|
||||
access_and_mobility_subscription_data_local_var->wireline_forbidden_areas = wireline_forbidden_areas;
|
||||
access_and_mobility_subscription_data_local_var->wireline_service_area_restriction = wireline_service_area_restriction;
|
||||
|
||||
return access_and_mobility_subscription_data_local_var;
|
||||
}
|
||||
|
|
@ -128,12 +120,6 @@ void OpenAPI_access_and_mobility_subscription_data_free(OpenAPI_access_and_mobil
|
|||
ogs_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(access_and_mobility_subscription_data->internal_group_ids);
|
||||
OpenAPI_list_for_each(access_and_mobility_subscription_data->vn_group_info, node) {
|
||||
OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data;
|
||||
OpenAPI_vn_group_data_free(localKeyValue->value);
|
||||
ogs_free(localKeyValue);
|
||||
}
|
||||
OpenAPI_list_free(access_and_mobility_subscription_data->vn_group_info);
|
||||
OpenAPI_list_for_each(access_and_mobility_subscription_data->shared_vn_group_data_ids, node) {
|
||||
OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data;
|
||||
ogs_free(localKeyValue->value);
|
||||
|
|
@ -156,26 +142,17 @@ void OpenAPI_access_and_mobility_subscription_data_free(OpenAPI_access_and_mobil
|
|||
ogs_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(access_and_mobility_subscription_data->shared_am_data_ids);
|
||||
OpenAPI_odb_packet_services_free(access_and_mobility_subscription_data->odb_packet_services);
|
||||
OpenAPI_list_for_each(access_and_mobility_subscription_data->subscribed_dnn_list, node) {
|
||||
ogs_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(access_and_mobility_subscription_data->subscribed_dnn_list);
|
||||
OpenAPI_mdt_configuration_free(access_and_mobility_subscription_data->mdt_configuration);
|
||||
OpenAPI_trace_data_free(access_and_mobility_subscription_data->trace_data);
|
||||
OpenAPI_cag_data_free(access_and_mobility_subscription_data->cag_data);
|
||||
ogs_free(access_and_mobility_subscription_data->stn_sr);
|
||||
ogs_free(access_and_mobility_subscription_data->c_msisdn);
|
||||
OpenAPI_tmbr_free(access_and_mobility_subscription_data->rg_tmbr);
|
||||
OpenAPI_ec_restriction_data_free(access_and_mobility_subscription_data->ec_restriction_data);
|
||||
OpenAPI_ec_restriction_data_wb_free(access_and_mobility_subscription_data->ec_restriction_data_wb);
|
||||
OpenAPI_expected_ue_behaviour_data_free(access_and_mobility_subscription_data->expected_ue_behaviour_list);
|
||||
OpenAPI_list_for_each(access_and_mobility_subscription_data->maximum_response_time_list, node) {
|
||||
OpenAPI_maximum_response_time_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(access_and_mobility_subscription_data->maximum_response_time_list);
|
||||
OpenAPI_list_for_each(access_and_mobility_subscription_data->maximum_latency_list, node) {
|
||||
OpenAPI_maximum_latency_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(access_and_mobility_subscription_data->maximum_latency_list);
|
||||
OpenAPI_list_free(access_and_mobility_subscription_data->primary_rat_restrictions);
|
||||
OpenAPI_list_free(access_and_mobility_subscription_data->secondary_rat_restrictions);
|
||||
OpenAPI_list_for_each(access_and_mobility_subscription_data->edrx_parameters_list, node) {
|
||||
|
|
@ -186,10 +163,11 @@ void OpenAPI_access_and_mobility_subscription_data_free(OpenAPI_access_and_mobil
|
|||
OpenAPI_ptw_parameters_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(access_and_mobility_subscription_data->ptw_parameters_list);
|
||||
OpenAPI_nr_v2x_auth_free(access_and_mobility_subscription_data->nr_v2x_services_auth);
|
||||
OpenAPI_lte_v2x_auth_free(access_and_mobility_subscription_data->lte_v2x_services_auth);
|
||||
ogs_free(access_and_mobility_subscription_data->nr_ue_pc5_ambr);
|
||||
ogs_free(access_and_mobility_subscription_data->lte_pc5_ambr);
|
||||
OpenAPI_list_for_each(access_and_mobility_subscription_data->wireline_forbidden_areas, node) {
|
||||
OpenAPI_wireline_area_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(access_and_mobility_subscription_data->wireline_forbidden_areas);
|
||||
OpenAPI_wireline_service_area_restriction_free(access_and_mobility_subscription_data->wireline_service_area_restriction);
|
||||
ogs_free(access_and_mobility_subscription_data);
|
||||
}
|
||||
|
||||
|
|
@ -242,27 +220,6 @@ cJSON *OpenAPI_access_and_mobility_subscription_data_convertToJSON(OpenAPI_acces
|
|||
}
|
||||
}
|
||||
|
||||
if (access_and_mobility_subscription_data->vn_group_info) {
|
||||
cJSON *vn_group_info = cJSON_AddObjectToObject(item, "vnGroupInfo");
|
||||
if (vn_group_info == NULL) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [vn_group_info]");
|
||||
goto end;
|
||||
}
|
||||
cJSON *localMapObject = vn_group_info;
|
||||
OpenAPI_lnode_t *vn_group_info_node;
|
||||
if (access_and_mobility_subscription_data->vn_group_info) {
|
||||
OpenAPI_list_for_each(access_and_mobility_subscription_data->vn_group_info, vn_group_info_node) {
|
||||
OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)vn_group_info_node->data;
|
||||
cJSON *itemLocal = OpenAPI_vn_group_data_convertToJSON(localKeyValue->value);
|
||||
if (itemLocal == NULL) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [vn_group_info]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToObject(vn_group_info, localKeyValue->key, itemLocal);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (access_and_mobility_subscription_data->shared_vn_group_data_ids) {
|
||||
cJSON *shared_vn_group_data_ids = cJSON_AddObjectToObject(item, "sharedVnGroupDataIds");
|
||||
if (shared_vn_group_data_ids == NULL) {
|
||||
|
|
@ -409,13 +366,6 @@ cJSON *OpenAPI_access_and_mobility_subscription_data_convertToJSON(OpenAPI_acces
|
|||
}
|
||||
}
|
||||
|
||||
if (access_and_mobility_subscription_data->dl_packet_count) {
|
||||
if (cJSON_AddNumberToObject(item, "dlPacketCount", access_and_mobility_subscription_data->dl_packet_count) == NULL) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [dl_packet_count]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (access_and_mobility_subscription_data->sor_info) {
|
||||
cJSON *sor_info_local_JSON = OpenAPI_sor_info_convertToJSON(access_and_mobility_subscription_data->sor_info);
|
||||
if (sor_info_local_JSON == NULL) {
|
||||
|
|
@ -495,13 +445,7 @@ cJSON *OpenAPI_access_and_mobility_subscription_data_convertToJSON(OpenAPI_acces
|
|||
}
|
||||
|
||||
if (access_and_mobility_subscription_data->odb_packet_services) {
|
||||
cJSON *odb_packet_services_local_JSON = OpenAPI_odb_packet_services_convertToJSON(access_and_mobility_subscription_data->odb_packet_services);
|
||||
if (odb_packet_services_local_JSON == NULL) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [odb_packet_services]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToObject(item, "odbPacketServices", odb_packet_services_local_JSON);
|
||||
if (item->child == NULL) {
|
||||
if (cJSON_AddStringToObject(item, "odbPacketServices", OpenAPI_odb_packet_services_ToString(access_and_mobility_subscription_data->odb_packet_services)) == NULL) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [odb_packet_services]");
|
||||
goto end;
|
||||
}
|
||||
|
|
@ -530,6 +474,26 @@ cJSON *OpenAPI_access_and_mobility_subscription_data_convertToJSON(OpenAPI_acces
|
|||
}
|
||||
}
|
||||
|
||||
if (access_and_mobility_subscription_data->mdt_user_consent) {
|
||||
if (cJSON_AddStringToObject(item, "mdtUserConsent", OpenAPI_mdt_user_consent_ToString(access_and_mobility_subscription_data->mdt_user_consent)) == NULL) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [mdt_user_consent]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (access_and_mobility_subscription_data->mdt_configuration) {
|
||||
cJSON *mdt_configuration_local_JSON = OpenAPI_mdt_configuration_convertToJSON(access_and_mobility_subscription_data->mdt_configuration);
|
||||
if (mdt_configuration_local_JSON == NULL) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [mdt_configuration]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToObject(item, "mdtConfiguration", mdt_configuration_local_JSON);
|
||||
if (item->child == NULL) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [mdt_configuration]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (access_and_mobility_subscription_data->trace_data) {
|
||||
cJSON *trace_data_local_JSON = OpenAPI_trace_data_convertToJSON(access_and_mobility_subscription_data->trace_data);
|
||||
if (trace_data_local_JSON == NULL) {
|
||||
|
|
@ -591,28 +555,22 @@ cJSON *OpenAPI_access_and_mobility_subscription_data_convertToJSON(OpenAPI_acces
|
|||
}
|
||||
}
|
||||
|
||||
if (access_and_mobility_subscription_data->rg_tmbr) {
|
||||
cJSON *rg_tmbr_local_JSON = OpenAPI_tmbr_convertToJSON(access_and_mobility_subscription_data->rg_tmbr);
|
||||
if (rg_tmbr_local_JSON == NULL) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [rg_tmbr]");
|
||||
if (access_and_mobility_subscription_data->ec_restriction_data_wb) {
|
||||
cJSON *ec_restriction_data_wb_local_JSON = OpenAPI_ec_restriction_data_wb_convertToJSON(access_and_mobility_subscription_data->ec_restriction_data_wb);
|
||||
if (ec_restriction_data_wb_local_JSON == NULL) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [ec_restriction_data_wb]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToObject(item, "rgTMBR", rg_tmbr_local_JSON);
|
||||
cJSON_AddItemToObject(item, "ecRestrictionDataWb", ec_restriction_data_wb_local_JSON);
|
||||
if (item->child == NULL) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [rg_tmbr]");
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [ec_restriction_data_wb]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (access_and_mobility_subscription_data->ec_restriction_data) {
|
||||
cJSON *ec_restriction_data_local_JSON = OpenAPI_ec_restriction_data_convertToJSON(access_and_mobility_subscription_data->ec_restriction_data);
|
||||
if (ec_restriction_data_local_JSON == NULL) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [ec_restriction_data]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToObject(item, "ecRestrictionData", ec_restriction_data_local_JSON);
|
||||
if (item->child == NULL) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [ec_restriction_data]");
|
||||
if (access_and_mobility_subscription_data->ec_restriction_data_nb) {
|
||||
if (cJSON_AddBoolToObject(item, "ecRestrictionDataNb", access_and_mobility_subscription_data->ec_restriction_data_nb) == NULL) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [ec_restriction_data_nb]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
|
@ -630,46 +588,6 @@ cJSON *OpenAPI_access_and_mobility_subscription_data_convertToJSON(OpenAPI_acces
|
|||
}
|
||||
}
|
||||
|
||||
if (access_and_mobility_subscription_data->maximum_response_time_list) {
|
||||
cJSON *maximum_response_time_listList = cJSON_AddArrayToObject(item, "maximumResponseTimeList");
|
||||
if (maximum_response_time_listList == NULL) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [maximum_response_time_list]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
OpenAPI_lnode_t *maximum_response_time_list_node;
|
||||
if (access_and_mobility_subscription_data->maximum_response_time_list) {
|
||||
OpenAPI_list_for_each(access_and_mobility_subscription_data->maximum_response_time_list, maximum_response_time_list_node) {
|
||||
cJSON *itemLocal = OpenAPI_maximum_response_time_convertToJSON(maximum_response_time_list_node->data);
|
||||
if (itemLocal == NULL) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [maximum_response_time_list]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToArray(maximum_response_time_listList, itemLocal);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (access_and_mobility_subscription_data->maximum_latency_list) {
|
||||
cJSON *maximum_latency_listList = cJSON_AddArrayToObject(item, "maximumLatencyList");
|
||||
if (maximum_latency_listList == NULL) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [maximum_latency_list]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
OpenAPI_lnode_t *maximum_latency_list_node;
|
||||
if (access_and_mobility_subscription_data->maximum_latency_list) {
|
||||
OpenAPI_list_for_each(access_and_mobility_subscription_data->maximum_latency_list, maximum_latency_list_node) {
|
||||
cJSON *itemLocal = OpenAPI_maximum_latency_convertToJSON(maximum_latency_list_node->data);
|
||||
if (itemLocal == NULL) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [maximum_latency_list]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToArray(maximum_latency_listList, itemLocal);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (access_and_mobility_subscription_data->primary_rat_restrictions) {
|
||||
cJSON *primary_rat_restrictions = cJSON_AddArrayToObject(item, "primaryRatRestrictions");
|
||||
if (primary_rat_restrictions == NULL) {
|
||||
|
|
@ -747,42 +665,35 @@ cJSON *OpenAPI_access_and_mobility_subscription_data_convertToJSON(OpenAPI_acces
|
|||
}
|
||||
}
|
||||
|
||||
if (access_and_mobility_subscription_data->nr_v2x_services_auth) {
|
||||
cJSON *nr_v2x_services_auth_local_JSON = OpenAPI_nr_v2x_auth_convertToJSON(access_and_mobility_subscription_data->nr_v2x_services_auth);
|
||||
if (nr_v2x_services_auth_local_JSON == NULL) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [nr_v2x_services_auth]");
|
||||
if (access_and_mobility_subscription_data->wireline_forbidden_areas) {
|
||||
cJSON *wireline_forbidden_areasList = cJSON_AddArrayToObject(item, "wirelineForbiddenAreas");
|
||||
if (wireline_forbidden_areasList == NULL) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [wireline_forbidden_areas]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToObject(item, "nrV2xServicesAuth", nr_v2x_services_auth_local_JSON);
|
||||
|
||||
OpenAPI_lnode_t *wireline_forbidden_areas_node;
|
||||
if (access_and_mobility_subscription_data->wireline_forbidden_areas) {
|
||||
OpenAPI_list_for_each(access_and_mobility_subscription_data->wireline_forbidden_areas, wireline_forbidden_areas_node) {
|
||||
cJSON *itemLocal = OpenAPI_wireline_area_convertToJSON(wireline_forbidden_areas_node->data);
|
||||
if (itemLocal == NULL) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [wireline_forbidden_areas]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToArray(wireline_forbidden_areasList, itemLocal);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (access_and_mobility_subscription_data->wireline_service_area_restriction) {
|
||||
cJSON *wireline_service_area_restriction_local_JSON = OpenAPI_wireline_service_area_restriction_convertToJSON(access_and_mobility_subscription_data->wireline_service_area_restriction);
|
||||
if (wireline_service_area_restriction_local_JSON == NULL) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [wireline_service_area_restriction]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToObject(item, "wirelineServiceAreaRestriction", wireline_service_area_restriction_local_JSON);
|
||||
if (item->child == NULL) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [nr_v2x_services_auth]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (access_and_mobility_subscription_data->lte_v2x_services_auth) {
|
||||
cJSON *lte_v2x_services_auth_local_JSON = OpenAPI_lte_v2x_auth_convertToJSON(access_and_mobility_subscription_data->lte_v2x_services_auth);
|
||||
if (lte_v2x_services_auth_local_JSON == NULL) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [lte_v2x_services_auth]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToObject(item, "lteV2xServicesAuth", lte_v2x_services_auth_local_JSON);
|
||||
if (item->child == NULL) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [lte_v2x_services_auth]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (access_and_mobility_subscription_data->nr_ue_pc5_ambr) {
|
||||
if (cJSON_AddStringToObject(item, "nrUePc5Ambr", access_and_mobility_subscription_data->nr_ue_pc5_ambr) == NULL) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [nr_ue_pc5_ambr]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (access_and_mobility_subscription_data->lte_pc5_ambr) {
|
||||
if (cJSON_AddStringToObject(item, "ltePc5Ambr", access_and_mobility_subscription_data->lte_pc5_ambr) == NULL) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [lte_pc5_ambr]");
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [wireline_service_area_restriction]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
|
@ -843,29 +754,6 @@ OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_sub
|
|||
}
|
||||
}
|
||||
|
||||
cJSON *vn_group_info = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "vnGroupInfo");
|
||||
|
||||
OpenAPI_list_t *vn_group_infoList;
|
||||
if (vn_group_info) {
|
||||
cJSON *vn_group_info_local_map;
|
||||
if (!cJSON_IsObject(vn_group_info)) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [vn_group_info]");
|
||||
goto end;
|
||||
}
|
||||
vn_group_infoList = OpenAPI_list_create();
|
||||
OpenAPI_map_t *localMapKeyPair = NULL;
|
||||
cJSON_ArrayForEach(vn_group_info_local_map, vn_group_info) {
|
||||
cJSON *localMapObject = vn_group_info_local_map;
|
||||
if (!cJSON_IsObject(vn_group_info_local_map)) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [vn_group_info]");
|
||||
goto end;
|
||||
}
|
||||
localMapKeyPair = OpenAPI_map_create(
|
||||
localMapObject->string, OpenAPI_vn_group_data_parseFromJSON(localMapObject));
|
||||
OpenAPI_list_add(vn_group_infoList, localMapKeyPair);
|
||||
}
|
||||
}
|
||||
|
||||
cJSON *shared_vn_group_data_ids = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "sharedVnGroupDataIds");
|
||||
|
||||
OpenAPI_list_t *shared_vn_group_data_idsList;
|
||||
|
|
@ -1025,15 +913,6 @@ OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_sub
|
|||
}
|
||||
}
|
||||
|
||||
cJSON *dl_packet_count = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "dlPacketCount");
|
||||
|
||||
if (dl_packet_count) {
|
||||
if (!cJSON_IsNumber(dl_packet_count)) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [dl_packet_count]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
cJSON *sor_info = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "sorInfo");
|
||||
|
||||
OpenAPI_sor_info_t *sor_info_local_nonprim = NULL;
|
||||
|
|
@ -1119,9 +998,13 @@ OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_sub
|
|||
|
||||
cJSON *odb_packet_services = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "odbPacketServices");
|
||||
|
||||
OpenAPI_odb_packet_services_t *odb_packet_services_local_nonprim = NULL;
|
||||
OpenAPI_odb_packet_services_e odb_packet_servicesVariable;
|
||||
if (odb_packet_services) {
|
||||
odb_packet_services_local_nonprim = OpenAPI_odb_packet_services_parseFromJSON(odb_packet_services);
|
||||
if (!cJSON_IsString(odb_packet_services)) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [odb_packet_services]");
|
||||
goto end;
|
||||
}
|
||||
odb_packet_servicesVariable = OpenAPI_odb_packet_services_FromString(odb_packet_services->valuestring);
|
||||
}
|
||||
|
||||
cJSON *subscribed_dnn_list = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "subscribedDnnList");
|
||||
|
|
@ -1153,6 +1036,24 @@ OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_sub
|
|||
}
|
||||
}
|
||||
|
||||
cJSON *mdt_user_consent = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "mdtUserConsent");
|
||||
|
||||
OpenAPI_mdt_user_consent_e mdt_user_consentVariable;
|
||||
if (mdt_user_consent) {
|
||||
if (!cJSON_IsString(mdt_user_consent)) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [mdt_user_consent]");
|
||||
goto end;
|
||||
}
|
||||
mdt_user_consentVariable = OpenAPI_mdt_user_consent_FromString(mdt_user_consent->valuestring);
|
||||
}
|
||||
|
||||
cJSON *mdt_configuration = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "mdtConfiguration");
|
||||
|
||||
OpenAPI_mdt_configuration_t *mdt_configuration_local_nonprim = NULL;
|
||||
if (mdt_configuration) {
|
||||
mdt_configuration_local_nonprim = OpenAPI_mdt_configuration_parseFromJSON(mdt_configuration);
|
||||
}
|
||||
|
||||
cJSON *trace_data = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "traceData");
|
||||
|
||||
OpenAPI_trace_data_t *trace_data_local_nonprim = NULL;
|
||||
|
|
@ -1212,18 +1113,20 @@ OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_sub
|
|||
}
|
||||
}
|
||||
|
||||
cJSON *rg_tmbr = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "rgTMBR");
|
||||
cJSON *ec_restriction_data_wb = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "ecRestrictionDataWb");
|
||||
|
||||
OpenAPI_tmbr_t *rg_tmbr_local_nonprim = NULL;
|
||||
if (rg_tmbr) {
|
||||
rg_tmbr_local_nonprim = OpenAPI_tmbr_parseFromJSON(rg_tmbr);
|
||||
OpenAPI_ec_restriction_data_wb_t *ec_restriction_data_wb_local_nonprim = NULL;
|
||||
if (ec_restriction_data_wb) {
|
||||
ec_restriction_data_wb_local_nonprim = OpenAPI_ec_restriction_data_wb_parseFromJSON(ec_restriction_data_wb);
|
||||
}
|
||||
|
||||
cJSON *ec_restriction_data = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "ecRestrictionData");
|
||||
cJSON *ec_restriction_data_nb = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "ecRestrictionDataNb");
|
||||
|
||||
OpenAPI_ec_restriction_data_t *ec_restriction_data_local_nonprim = NULL;
|
||||
if (ec_restriction_data) {
|
||||
ec_restriction_data_local_nonprim = OpenAPI_ec_restriction_data_parseFromJSON(ec_restriction_data);
|
||||
if (ec_restriction_data_nb) {
|
||||
if (!cJSON_IsBool(ec_restriction_data_nb)) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [ec_restriction_data_nb]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
cJSON *expected_ue_behaviour_list = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "expectedUeBehaviourList");
|
||||
|
|
@ -1233,52 +1136,6 @@ OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_sub
|
|||
expected_ue_behaviour_list_local_nonprim = OpenAPI_expected_ue_behaviour_data_parseFromJSON(expected_ue_behaviour_list);
|
||||
}
|
||||
|
||||
cJSON *maximum_response_time_list = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "maximumResponseTimeList");
|
||||
|
||||
OpenAPI_list_t *maximum_response_time_listList;
|
||||
if (maximum_response_time_list) {
|
||||
cJSON *maximum_response_time_list_local_nonprimitive;
|
||||
if (!cJSON_IsArray(maximum_response_time_list)) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [maximum_response_time_list]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
maximum_response_time_listList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(maximum_response_time_list_local_nonprimitive, maximum_response_time_list ) {
|
||||
if (!cJSON_IsObject(maximum_response_time_list_local_nonprimitive)) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [maximum_response_time_list]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_maximum_response_time_t *maximum_response_time_listItem = OpenAPI_maximum_response_time_parseFromJSON(maximum_response_time_list_local_nonprimitive);
|
||||
|
||||
OpenAPI_list_add(maximum_response_time_listList, maximum_response_time_listItem);
|
||||
}
|
||||
}
|
||||
|
||||
cJSON *maximum_latency_list = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "maximumLatencyList");
|
||||
|
||||
OpenAPI_list_t *maximum_latency_listList;
|
||||
if (maximum_latency_list) {
|
||||
cJSON *maximum_latency_list_local_nonprimitive;
|
||||
if (!cJSON_IsArray(maximum_latency_list)) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [maximum_latency_list]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
maximum_latency_listList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(maximum_latency_list_local_nonprimitive, maximum_latency_list ) {
|
||||
if (!cJSON_IsObject(maximum_latency_list_local_nonprimitive)) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [maximum_latency_list]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_maximum_latency_t *maximum_latency_listItem = OpenAPI_maximum_latency_parseFromJSON(maximum_latency_list_local_nonprimitive);
|
||||
|
||||
OpenAPI_list_add(maximum_latency_listList, maximum_latency_listItem);
|
||||
}
|
||||
}
|
||||
|
||||
cJSON *primary_rat_restrictions = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "primaryRatRestrictions");
|
||||
|
||||
OpenAPI_list_t *primary_rat_restrictionsList;
|
||||
|
|
@ -1378,43 +1235,40 @@ OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_sub
|
|||
}
|
||||
}
|
||||
|
||||
cJSON *nr_v2x_services_auth = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "nrV2xServicesAuth");
|
||||
cJSON *wireline_forbidden_areas = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "wirelineForbiddenAreas");
|
||||
|
||||
OpenAPI_nr_v2x_auth_t *nr_v2x_services_auth_local_nonprim = NULL;
|
||||
if (nr_v2x_services_auth) {
|
||||
nr_v2x_services_auth_local_nonprim = OpenAPI_nr_v2x_auth_parseFromJSON(nr_v2x_services_auth);
|
||||
}
|
||||
|
||||
cJSON *lte_v2x_services_auth = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "lteV2xServicesAuth");
|
||||
|
||||
OpenAPI_lte_v2x_auth_t *lte_v2x_services_auth_local_nonprim = NULL;
|
||||
if (lte_v2x_services_auth) {
|
||||
lte_v2x_services_auth_local_nonprim = OpenAPI_lte_v2x_auth_parseFromJSON(lte_v2x_services_auth);
|
||||
}
|
||||
|
||||
cJSON *nr_ue_pc5_ambr = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "nrUePc5Ambr");
|
||||
|
||||
if (nr_ue_pc5_ambr) {
|
||||
if (!cJSON_IsString(nr_ue_pc5_ambr)) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [nr_ue_pc5_ambr]");
|
||||
OpenAPI_list_t *wireline_forbidden_areasList;
|
||||
if (wireline_forbidden_areas) {
|
||||
cJSON *wireline_forbidden_areas_local_nonprimitive;
|
||||
if (!cJSON_IsArray(wireline_forbidden_areas)) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [wireline_forbidden_areas]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
wireline_forbidden_areasList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(wireline_forbidden_areas_local_nonprimitive, wireline_forbidden_areas ) {
|
||||
if (!cJSON_IsObject(wireline_forbidden_areas_local_nonprimitive)) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [wireline_forbidden_areas]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_wireline_area_t *wireline_forbidden_areasItem = OpenAPI_wireline_area_parseFromJSON(wireline_forbidden_areas_local_nonprimitive);
|
||||
|
||||
OpenAPI_list_add(wireline_forbidden_areasList, wireline_forbidden_areasItem);
|
||||
}
|
||||
}
|
||||
|
||||
cJSON *lte_pc5_ambr = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "ltePc5Ambr");
|
||||
cJSON *wireline_service_area_restriction = cJSON_GetObjectItemCaseSensitive(access_and_mobility_subscription_dataJSON, "wirelineServiceAreaRestriction");
|
||||
|
||||
if (lte_pc5_ambr) {
|
||||
if (!cJSON_IsString(lte_pc5_ambr)) {
|
||||
ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [lte_pc5_ambr]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_wireline_service_area_restriction_t *wireline_service_area_restriction_local_nonprim = NULL;
|
||||
if (wireline_service_area_restriction) {
|
||||
wireline_service_area_restriction_local_nonprim = OpenAPI_wireline_service_area_restriction_parseFromJSON(wireline_service_area_restriction);
|
||||
}
|
||||
|
||||
access_and_mobility_subscription_data_local_var = OpenAPI_access_and_mobility_subscription_data_create (
|
||||
supported_features ? ogs_strdup(supported_features->valuestring) : NULL,
|
||||
gpsis ? gpsisList : NULL,
|
||||
internal_group_ids ? internal_group_idsList : NULL,
|
||||
vn_group_info ? vn_group_infoList : NULL,
|
||||
shared_vn_group_data_ids ? shared_vn_group_data_idsList : NULL,
|
||||
subscribed_ue_ambr ? subscribed_ue_ambr_local_nonprim : NULL,
|
||||
nssai ? nssai_local_nonprim : NULL,
|
||||
|
|
@ -1428,7 +1282,6 @@ OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_sub
|
|||
mps_priority ? mps_priority->valueint : 0,
|
||||
mcs_priority ? mcs_priority->valueint : 0,
|
||||
active_time ? active_time->valuedouble : 0,
|
||||
dl_packet_count ? dl_packet_count->valuedouble : 0,
|
||||
sor_info ? sor_info_local_nonprim : NULL,
|
||||
sor_info_expect_ind ? sor_info_expect_ind->valueint : 0,
|
||||
soraf_retrieval ? soraf_retrieval->valueint : 0,
|
||||
|
|
@ -1436,9 +1289,11 @@ OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_sub
|
|||
upu_info ? upu_info_local_nonprim : NULL,
|
||||
mico_allowed ? mico_allowed->valueint : 0,
|
||||
shared_am_data_ids ? shared_am_data_idsList : NULL,
|
||||
odb_packet_services ? odb_packet_services_local_nonprim : NULL,
|
||||
odb_packet_services ? odb_packet_servicesVariable : 0,
|
||||
subscribed_dnn_list ? subscribed_dnn_listList : NULL,
|
||||
service_gap_time ? service_gap_time->valuedouble : 0,
|
||||
mdt_user_consent ? mdt_user_consentVariable : 0,
|
||||
mdt_configuration ? mdt_configuration_local_nonprim : NULL,
|
||||
trace_data ? trace_data_local_nonprim : NULL,
|
||||
cag_data ? cag_data_local_nonprim : NULL,
|
||||
stn_sr ? ogs_strdup(stn_sr->valuestring) : NULL,
|
||||
|
|
@ -1446,20 +1301,16 @@ OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_sub
|
|||
nb_io_t_ue_priority ? nb_io_t_ue_priority->valuedouble : 0,
|
||||
nssai_inclusion_allowed ? nssai_inclusion_allowed->valueint : 0,
|
||||
rg_wireline_characteristics ? rg_wireline_characteristics->valueint : 0,
|
||||
rg_tmbr ? rg_tmbr_local_nonprim : NULL,
|
||||
ec_restriction_data ? ec_restriction_data_local_nonprim : NULL,
|
||||
ec_restriction_data_wb ? ec_restriction_data_wb_local_nonprim : NULL,
|
||||
ec_restriction_data_nb ? ec_restriction_data_nb->valueint : 0,
|
||||
expected_ue_behaviour_list ? expected_ue_behaviour_list_local_nonprim : NULL,
|
||||
maximum_response_time_list ? maximum_response_time_listList : NULL,
|
||||
maximum_latency_list ? maximum_latency_listList : NULL,
|
||||
primary_rat_restrictions ? primary_rat_restrictionsList : NULL,
|
||||
secondary_rat_restrictions ? secondary_rat_restrictionsList : NULL,
|
||||
edrx_parameters_list ? edrx_parameters_listList : NULL,
|
||||
ptw_parameters_list ? ptw_parameters_listList : NULL,
|
||||
iab_operation_allowed ? iab_operation_allowed->valueint : 0,
|
||||
nr_v2x_services_auth ? nr_v2x_services_auth_local_nonprim : NULL,
|
||||
lte_v2x_services_auth ? lte_v2x_services_auth_local_nonprim : NULL,
|
||||
nr_ue_pc5_ambr ? ogs_strdup(nr_ue_pc5_ambr->valuestring) : NULL,
|
||||
lte_pc5_ambr ? ogs_strdup(lte_pc5_ambr->valuestring) : NULL
|
||||
wireline_forbidden_areas ? wireline_forbidden_areasList : NULL,
|
||||
wireline_service_area_restriction ? wireline_service_area_restriction_local_nonprim : NULL
|
||||
);
|
||||
|
||||
return access_and_mobility_subscription_data_local_var;
|
||||
|
|
|
|||
|
|
@ -16,13 +16,11 @@
|
|||
#include "area.h"
|
||||
#include "cag_data.h"
|
||||
#include "core_network_type.h"
|
||||
#include "ec_restriction_data.h"
|
||||
#include "ec_restriction_data_wb.h"
|
||||
#include "edrx_parameters.h"
|
||||
#include "expected_ue_behaviour_data.h"
|
||||
#include "lte_v2x_auth.h"
|
||||
#include "maximum_latency.h"
|
||||
#include "maximum_response_time.h"
|
||||
#include "nr_v2x_auth.h"
|
||||
#include "mdt_configuration.h"
|
||||
#include "mdt_user_consent.h"
|
||||
#include "nssai.h"
|
||||
#include "odb_packet_services.h"
|
||||
#include "ptw_parameters.h"
|
||||
|
|
@ -30,10 +28,10 @@
|
|||
#include "service_area_restriction.h"
|
||||
#include "sor_info.h"
|
||||
#include "sor_update_indicator.h"
|
||||
#include "tmbr.h"
|
||||
#include "trace_data.h"
|
||||
#include "upu_info.h"
|
||||
#include "vn_group_data.h"
|
||||
#include "wireline_area.h"
|
||||
#include "wireline_service_area_restriction.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
@ -44,7 +42,6 @@ typedef struct OpenAPI_access_and_mobility_subscription_data_s {
|
|||
char *supported_features;
|
||||
OpenAPI_list_t *gpsis;
|
||||
OpenAPI_list_t *internal_group_ids;
|
||||
OpenAPI_list_t* vn_group_info;
|
||||
OpenAPI_list_t* shared_vn_group_data_ids;
|
||||
struct OpenAPI_ambr_rm_s *subscribed_ue_ambr;
|
||||
struct OpenAPI_nssai_s *nssai;
|
||||
|
|
@ -58,7 +55,6 @@ typedef struct OpenAPI_access_and_mobility_subscription_data_s {
|
|||
int mps_priority;
|
||||
int mcs_priority;
|
||||
int active_time;
|
||||
int dl_packet_count;
|
||||
struct OpenAPI_sor_info_s *sor_info;
|
||||
int sor_info_expect_ind;
|
||||
int soraf_retrieval;
|
||||
|
|
@ -66,9 +62,11 @@ typedef struct OpenAPI_access_and_mobility_subscription_data_s {
|
|||
struct OpenAPI_upu_info_s *upu_info;
|
||||
int mico_allowed;
|
||||
OpenAPI_list_t *shared_am_data_ids;
|
||||
struct OpenAPI_odb_packet_services_s *odb_packet_services;
|
||||
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_s *mdt_configuration;
|
||||
struct OpenAPI_trace_data_s *trace_data;
|
||||
struct OpenAPI_cag_data_s *cag_data;
|
||||
char *stn_sr;
|
||||
|
|
@ -76,27 +74,22 @@ typedef struct OpenAPI_access_and_mobility_subscription_data_s {
|
|||
int nb_io_t_ue_priority;
|
||||
int nssai_inclusion_allowed;
|
||||
char rg_wireline_characteristics;
|
||||
struct OpenAPI_tmbr_s *rg_tmbr;
|
||||
struct OpenAPI_ec_restriction_data_s *ec_restriction_data;
|
||||
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;
|
||||
OpenAPI_list_t *maximum_response_time_list;
|
||||
OpenAPI_list_t *maximum_latency_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;
|
||||
struct OpenAPI_nr_v2x_auth_s *nr_v2x_services_auth;
|
||||
struct OpenAPI_lte_v2x_auth_s *lte_v2x_services_auth;
|
||||
char *nr_ue_pc5_ambr;
|
||||
char *lte_pc5_ambr;
|
||||
OpenAPI_list_t *wireline_forbidden_areas;
|
||||
struct OpenAPI_wireline_service_area_restriction_s *wireline_service_area_restriction;
|
||||
} OpenAPI_access_and_mobility_subscription_data_t;
|
||||
|
||||
OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_subscription_data_create(
|
||||
char *supported_features,
|
||||
OpenAPI_list_t *gpsis,
|
||||
OpenAPI_list_t *internal_group_ids,
|
||||
OpenAPI_list_t* vn_group_info,
|
||||
OpenAPI_list_t* shared_vn_group_data_ids,
|
||||
OpenAPI_ambr_rm_t *subscribed_ue_ambr,
|
||||
OpenAPI_nssai_t *nssai,
|
||||
|
|
@ -110,7 +103,6 @@ OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_sub
|
|||
int mps_priority,
|
||||
int mcs_priority,
|
||||
int active_time,
|
||||
int dl_packet_count,
|
||||
OpenAPI_sor_info_t *sor_info,
|
||||
int sor_info_expect_ind,
|
||||
int soraf_retrieval,
|
||||
|
|
@ -118,9 +110,11 @@ OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_sub
|
|||
OpenAPI_upu_info_t *upu_info,
|
||||
int mico_allowed,
|
||||
OpenAPI_list_t *shared_am_data_ids,
|
||||
OpenAPI_odb_packet_services_t *odb_packet_services,
|
||||
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_t *mdt_configuration,
|
||||
OpenAPI_trace_data_t *trace_data,
|
||||
OpenAPI_cag_data_t *cag_data,
|
||||
char *stn_sr,
|
||||
|
|
@ -128,20 +122,16 @@ OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_sub
|
|||
int nb_io_t_ue_priority,
|
||||
int nssai_inclusion_allowed,
|
||||
char rg_wireline_characteristics,
|
||||
OpenAPI_tmbr_t *rg_tmbr,
|
||||
OpenAPI_ec_restriction_data_t *ec_restriction_data,
|
||||
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,
|
||||
OpenAPI_list_t *maximum_response_time_list,
|
||||
OpenAPI_list_t *maximum_latency_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_nr_v2x_auth_t *nr_v2x_services_auth,
|
||||
OpenAPI_lte_v2x_auth_t *lte_v2x_services_auth,
|
||||
char *nr_ue_pc5_ambr,
|
||||
char *lte_pc5_ambr
|
||||
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);
|
||||
|
|
|
|||
30
lib/sbi/openapi/model/access_network_id.c
Normal file
30
lib/sbi/openapi/model/access_network_id.c
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include "access_network_id.h"
|
||||
|
||||
char* OpenAPI_access_network_id_ToString(OpenAPI_access_network_id_e access_network_id)
|
||||
{
|
||||
const char *access_network_idArray[] = { "NULL", "HRPD", "WIMAX", "WLAN", "ETHERNET" };
|
||||
size_t sizeofArray = sizeof(access_network_idArray) / sizeof(access_network_idArray[0]);
|
||||
if (access_network_id < sizeofArray)
|
||||
return (char *)access_network_idArray[access_network_id];
|
||||
else
|
||||
return (char *)"Unknown";
|
||||
}
|
||||
|
||||
OpenAPI_access_network_id_e OpenAPI_access_network_id_FromString(char* access_network_id)
|
||||
{
|
||||
int stringToReturn = 0;
|
||||
const char *access_network_idArray[] = { "NULL", "HRPD", "WIMAX", "WLAN", "ETHERNET" };
|
||||
size_t sizeofArray = sizeof(access_network_idArray) / sizeof(access_network_idArray[0]);
|
||||
while (stringToReturn < sizeofArray) {
|
||||
if (strcmp(access_network_id, access_network_idArray[stringToReturn]) == 0) {
|
||||
return stringToReturn;
|
||||
}
|
||||
stringToReturn++;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
31
lib/sbi/openapi/model/access_network_id.h
Normal file
31
lib/sbi/openapi/model/access_network_id.h
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
/*
|
||||
* access_network_id.h
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _OpenAPI_access_network_id_H_
|
||||
#define _OpenAPI_access_network_id_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_network_id_NULL = 0, OpenAPI_access_network_id_HRPD, OpenAPI_access_network_id_WIMAX, OpenAPI_access_network_id_WLAN, OpenAPI_access_network_id_ETHERNET } OpenAPI_access_network_id_e;
|
||||
|
||||
char* OpenAPI_access_network_id_ToString(OpenAPI_access_network_id_e access_network_id);
|
||||
|
||||
OpenAPI_access_network_id_e OpenAPI_access_network_id_FromString(char* access_network_id);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _OpenAPI_access_network_id_H_ */
|
||||
|
||||
|
|
@ -4,82 +4,27 @@
|
|||
#include <stdio.h>
|
||||
#include "additional_qos_flow_info.h"
|
||||
|
||||
OpenAPI_additional_qos_flow_info_t *OpenAPI_additional_qos_flow_info_create(
|
||||
)
|
||||
char* OpenAPI_additional_qos_flow_info_ToString(OpenAPI_additional_qos_flow_info_e additional_qos_flow_info)
|
||||
{
|
||||
OpenAPI_additional_qos_flow_info_t *additional_qos_flow_info_local_var = OpenAPI_malloc(sizeof(OpenAPI_additional_qos_flow_info_t));
|
||||
if (!additional_qos_flow_info_local_var) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return additional_qos_flow_info_local_var;
|
||||
const char *additional_qos_flow_infoArray[] = { "NULL", "MORE_LIKELY" };
|
||||
size_t sizeofArray = sizeof(additional_qos_flow_infoArray) / sizeof(additional_qos_flow_infoArray[0]);
|
||||
if (additional_qos_flow_info < sizeofArray)
|
||||
return (char *)additional_qos_flow_infoArray[additional_qos_flow_info];
|
||||
else
|
||||
return (char *)"Unknown";
|
||||
}
|
||||
|
||||
void OpenAPI_additional_qos_flow_info_free(OpenAPI_additional_qos_flow_info_t *additional_qos_flow_info)
|
||||
OpenAPI_additional_qos_flow_info_e OpenAPI_additional_qos_flow_info_FromString(char* additional_qos_flow_info)
|
||||
{
|
||||
if (NULL == additional_qos_flow_info) {
|
||||
return;
|
||||
int stringToReturn = 0;
|
||||
const char *additional_qos_flow_infoArray[] = { "NULL", "MORE_LIKELY" };
|
||||
size_t sizeofArray = sizeof(additional_qos_flow_infoArray) / sizeof(additional_qos_flow_infoArray[0]);
|
||||
while (stringToReturn < sizeofArray) {
|
||||
if (strcmp(additional_qos_flow_info, additional_qos_flow_infoArray[stringToReturn]) == 0) {
|
||||
return stringToReturn;
|
||||
}
|
||||
stringToReturn++;
|
||||
}
|
||||
OpenAPI_lnode_t *node;
|
||||
ogs_free(additional_qos_flow_info);
|
||||
}
|
||||
|
||||
cJSON *OpenAPI_additional_qos_flow_info_convertToJSON(OpenAPI_additional_qos_flow_info_t *additional_qos_flow_info)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
|
||||
if (additional_qos_flow_info == NULL) {
|
||||
ogs_error("OpenAPI_additional_qos_flow_info_convertToJSON() failed [AdditionalQosFlowInfo]");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
item = cJSON_CreateObject();
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
||||
OpenAPI_additional_qos_flow_info_t *OpenAPI_additional_qos_flow_info_parseFromJSON(cJSON *additional_qos_flow_infoJSON)
|
||||
{
|
||||
OpenAPI_additional_qos_flow_info_t *additional_qos_flow_info_local_var = NULL;
|
||||
additional_qos_flow_info_local_var = OpenAPI_additional_qos_flow_info_create (
|
||||
);
|
||||
|
||||
return additional_qos_flow_info_local_var;
|
||||
end:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
OpenAPI_additional_qos_flow_info_t *OpenAPI_additional_qos_flow_info_copy(OpenAPI_additional_qos_flow_info_t *dst, OpenAPI_additional_qos_flow_info_t *src)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
char *content = NULL;
|
||||
|
||||
ogs_assert(src);
|
||||
item = OpenAPI_additional_qos_flow_info_convertToJSON(src);
|
||||
if (!item) {
|
||||
ogs_error("OpenAPI_additional_qos_flow_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_additional_qos_flow_info_free(dst);
|
||||
dst = OpenAPI_additional_qos_flow_info_parseFromJSON(item);
|
||||
cJSON_Delete(item);
|
||||
|
||||
return dst;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -12,22 +12,16 @@
|
|||
#include "../include/list.h"
|
||||
#include "../include/keyValuePair.h"
|
||||
#include "../include/binary.h"
|
||||
#include "null_value.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct OpenAPI_additional_qos_flow_info_s OpenAPI_additional_qos_flow_info_t;
|
||||
typedef struct OpenAPI_additional_qos_flow_info_s {
|
||||
} OpenAPI_additional_qos_flow_info_t;
|
||||
typedef enum { OpenAPI_additional_qos_flow_info_NULL = 0, OpenAPI_additional_qos_flow_info_MORE_LIKELY } OpenAPI_additional_qos_flow_info_e;
|
||||
|
||||
OpenAPI_additional_qos_flow_info_t *OpenAPI_additional_qos_flow_info_create(
|
||||
);
|
||||
void OpenAPI_additional_qos_flow_info_free(OpenAPI_additional_qos_flow_info_t *additional_qos_flow_info);
|
||||
OpenAPI_additional_qos_flow_info_t *OpenAPI_additional_qos_flow_info_parseFromJSON(cJSON *additional_qos_flow_infoJSON);
|
||||
cJSON *OpenAPI_additional_qos_flow_info_convertToJSON(OpenAPI_additional_qos_flow_info_t *additional_qos_flow_info);
|
||||
OpenAPI_additional_qos_flow_info_t *OpenAPI_additional_qos_flow_info_copy(OpenAPI_additional_qos_flow_info_t *dst, OpenAPI_additional_qos_flow_info_t *src);
|
||||
char* OpenAPI_additional_qos_flow_info_ToString(OpenAPI_additional_qos_flow_info_e additional_qos_flow_info);
|
||||
|
||||
OpenAPI_additional_qos_flow_info_e OpenAPI_additional_qos_flow_info_FromString(char* additional_qos_flow_info);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,226 +0,0 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include "af_non_external.h"
|
||||
|
||||
OpenAPI_af_non_external_t *OpenAPI_af_non_external_create(
|
||||
char *af_id,
|
||||
OpenAPI_list_t *allowed_geographic_area,
|
||||
OpenAPI_privacy_check_related_action_e privacy_check_related_action,
|
||||
OpenAPI_code_word_ind_e code_word_ind,
|
||||
OpenAPI_valid_time_period_t *valid_time_period
|
||||
)
|
||||
{
|
||||
OpenAPI_af_non_external_t *af_non_external_local_var = OpenAPI_malloc(sizeof(OpenAPI_af_non_external_t));
|
||||
if (!af_non_external_local_var) {
|
||||
return NULL;
|
||||
}
|
||||
af_non_external_local_var->af_id = af_id;
|
||||
af_non_external_local_var->allowed_geographic_area = allowed_geographic_area;
|
||||
af_non_external_local_var->privacy_check_related_action = privacy_check_related_action;
|
||||
af_non_external_local_var->code_word_ind = code_word_ind;
|
||||
af_non_external_local_var->valid_time_period = valid_time_period;
|
||||
|
||||
return af_non_external_local_var;
|
||||
}
|
||||
|
||||
void OpenAPI_af_non_external_free(OpenAPI_af_non_external_t *af_non_external)
|
||||
{
|
||||
if (NULL == af_non_external) {
|
||||
return;
|
||||
}
|
||||
OpenAPI_lnode_t *node;
|
||||
ogs_free(af_non_external->af_id);
|
||||
OpenAPI_list_for_each(af_non_external->allowed_geographic_area, node) {
|
||||
OpenAPI_geographic_area_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(af_non_external->allowed_geographic_area);
|
||||
OpenAPI_valid_time_period_free(af_non_external->valid_time_period);
|
||||
ogs_free(af_non_external);
|
||||
}
|
||||
|
||||
cJSON *OpenAPI_af_non_external_convertToJSON(OpenAPI_af_non_external_t *af_non_external)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
|
||||
if (af_non_external == NULL) {
|
||||
ogs_error("OpenAPI_af_non_external_convertToJSON() failed [AfNonExternal]");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
item = cJSON_CreateObject();
|
||||
if (!af_non_external->af_id) {
|
||||
ogs_error("OpenAPI_af_non_external_convertToJSON() failed [af_id]");
|
||||
goto end;
|
||||
}
|
||||
if (cJSON_AddStringToObject(item, "afId", af_non_external->af_id) == NULL) {
|
||||
ogs_error("OpenAPI_af_non_external_convertToJSON() failed [af_id]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (af_non_external->allowed_geographic_area) {
|
||||
cJSON *allowed_geographic_areaList = cJSON_AddArrayToObject(item, "allowedGeographicArea");
|
||||
if (allowed_geographic_areaList == NULL) {
|
||||
ogs_error("OpenAPI_af_non_external_convertToJSON() failed [allowed_geographic_area]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
OpenAPI_lnode_t *allowed_geographic_area_node;
|
||||
if (af_non_external->allowed_geographic_area) {
|
||||
OpenAPI_list_for_each(af_non_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_non_external_convertToJSON() failed [allowed_geographic_area]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToArray(allowed_geographic_areaList, itemLocal);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (af_non_external->privacy_check_related_action) {
|
||||
if (cJSON_AddStringToObject(item, "privacyCheckRelatedAction", OpenAPI_privacy_check_related_action_ToString(af_non_external->privacy_check_related_action)) == NULL) {
|
||||
ogs_error("OpenAPI_af_non_external_convertToJSON() failed [privacy_check_related_action]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (af_non_external->code_word_ind) {
|
||||
if (cJSON_AddStringToObject(item, "codeWordInd", OpenAPI_code_word_ind_ToString(af_non_external->code_word_ind)) == NULL) {
|
||||
ogs_error("OpenAPI_af_non_external_convertToJSON() failed [code_word_ind]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (af_non_external->valid_time_period) {
|
||||
cJSON *valid_time_period_local_JSON = OpenAPI_valid_time_period_convertToJSON(af_non_external->valid_time_period);
|
||||
if (valid_time_period_local_JSON == NULL) {
|
||||
ogs_error("OpenAPI_af_non_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_non_external_convertToJSON() failed [valid_time_period]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
||||
OpenAPI_af_non_external_t *OpenAPI_af_non_external_parseFromJSON(cJSON *af_non_externalJSON)
|
||||
{
|
||||
OpenAPI_af_non_external_t *af_non_external_local_var = NULL;
|
||||
cJSON *af_id = cJSON_GetObjectItemCaseSensitive(af_non_externalJSON, "afId");
|
||||
if (!af_id) {
|
||||
ogs_error("OpenAPI_af_non_external_parseFromJSON() failed [af_id]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
|
||||
if (!cJSON_IsString(af_id)) {
|
||||
ogs_error("OpenAPI_af_non_external_parseFromJSON() failed [af_id]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
cJSON *allowed_geographic_area = cJSON_GetObjectItemCaseSensitive(af_non_externalJSON, "allowedGeographicArea");
|
||||
|
||||
OpenAPI_list_t *allowed_geographic_areaList;
|
||||
if (allowed_geographic_area) {
|
||||
cJSON *allowed_geographic_area_local_nonprimitive;
|
||||
if (!cJSON_IsArray(allowed_geographic_area)) {
|
||||
ogs_error("OpenAPI_af_non_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_non_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);
|
||||
}
|
||||
}
|
||||
|
||||
cJSON *privacy_check_related_action = cJSON_GetObjectItemCaseSensitive(af_non_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_non_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 *code_word_ind = cJSON_GetObjectItemCaseSensitive(af_non_externalJSON, "codeWordInd");
|
||||
|
||||
OpenAPI_code_word_ind_e code_word_indVariable;
|
||||
if (code_word_ind) {
|
||||
if (!cJSON_IsString(code_word_ind)) {
|
||||
ogs_error("OpenAPI_af_non_external_parseFromJSON() failed [code_word_ind]");
|
||||
goto end;
|
||||
}
|
||||
code_word_indVariable = OpenAPI_code_word_ind_FromString(code_word_ind->valuestring);
|
||||
}
|
||||
|
||||
cJSON *valid_time_period = cJSON_GetObjectItemCaseSensitive(af_non_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);
|
||||
}
|
||||
|
||||
af_non_external_local_var = OpenAPI_af_non_external_create (
|
||||
ogs_strdup(af_id->valuestring),
|
||||
allowed_geographic_area ? allowed_geographic_areaList : NULL,
|
||||
privacy_check_related_action ? privacy_check_related_actionVariable : 0,
|
||||
code_word_ind ? code_word_indVariable : 0,
|
||||
valid_time_period ? valid_time_period_local_nonprim : NULL
|
||||
);
|
||||
|
||||
return af_non_external_local_var;
|
||||
end:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
OpenAPI_af_non_external_t *OpenAPI_af_non_external_copy(OpenAPI_af_non_external_t *dst, OpenAPI_af_non_external_t *src)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
char *content = NULL;
|
||||
|
||||
ogs_assert(src);
|
||||
item = OpenAPI_af_non_external_convertToJSON(src);
|
||||
if (!item) {
|
||||
ogs_error("OpenAPI_af_non_external_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_non_external_free(dst);
|
||||
dst = OpenAPI_af_non_external_parseFromJSON(item);
|
||||
cJSON_Delete(item);
|
||||
|
||||
return dst;
|
||||
}
|
||||
|
||||
|
|
@ -1,50 +0,0 @@
|
|||
/*
|
||||
* af_non_external.h
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _OpenAPI_af_non_external_H_
|
||||
#define _OpenAPI_af_non_external_H_
|
||||
|
||||
#include <string.h>
|
||||
#include "../external/cJSON.h"
|
||||
#include "../include/list.h"
|
||||
#include "../include/keyValuePair.h"
|
||||
#include "../include/binary.h"
|
||||
#include "code_word_ind.h"
|
||||
#include "geographic_area.h"
|
||||
#include "privacy_check_related_action.h"
|
||||
#include "valid_time_period.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct OpenAPI_af_non_external_s OpenAPI_af_non_external_t;
|
||||
typedef struct OpenAPI_af_non_external_s {
|
||||
char *af_id;
|
||||
OpenAPI_list_t *allowed_geographic_area;
|
||||
OpenAPI_privacy_check_related_action_e privacy_check_related_action;
|
||||
OpenAPI_code_word_ind_e code_word_ind;
|
||||
struct OpenAPI_valid_time_period_s *valid_time_period;
|
||||
} OpenAPI_af_non_external_t;
|
||||
|
||||
OpenAPI_af_non_external_t *OpenAPI_af_non_external_create(
|
||||
char *af_id,
|
||||
OpenAPI_list_t *allowed_geographic_area,
|
||||
OpenAPI_privacy_check_related_action_e privacy_check_related_action,
|
||||
OpenAPI_code_word_ind_e code_word_ind,
|
||||
OpenAPI_valid_time_period_t *valid_time_period
|
||||
);
|
||||
void OpenAPI_af_non_external_free(OpenAPI_af_non_external_t *af_non_external);
|
||||
OpenAPI_af_non_external_t *OpenAPI_af_non_external_parseFromJSON(cJSON *af_non_externalJSON);
|
||||
cJSON *OpenAPI_af_non_external_convertToJSON(OpenAPI_af_non_external_t *af_non_external);
|
||||
OpenAPI_af_non_external_t *OpenAPI_af_non_external_copy(OpenAPI_af_non_external_t *dst, OpenAPI_af_non_external_t *src);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _OpenAPI_af_non_external_H_ */
|
||||
|
||||
188
lib/sbi/openapi/model/alternative_qos_profile.c
Normal file
188
lib/sbi/openapi/model/alternative_qos_profile.c
Normal file
|
|
@ -0,0 +1,188 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include "alternative_qos_profile.h"
|
||||
|
||||
OpenAPI_alternative_qos_profile_t *OpenAPI_alternative_qos_profile_create(
|
||||
int index,
|
||||
char *gua_fbr_dl,
|
||||
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) {
|
||||
return NULL;
|
||||
}
|
||||
alternative_qos_profile_local_var->index = index;
|
||||
alternative_qos_profile_local_var->gua_fbr_dl = gua_fbr_dl;
|
||||
alternative_qos_profile_local_var->gua_fbr_ul = gua_fbr_ul;
|
||||
alternative_qos_profile_local_var->packet_delay_budget = packet_delay_budget;
|
||||
alternative_qos_profile_local_var->packet_err_rate = packet_err_rate;
|
||||
|
||||
return alternative_qos_profile_local_var;
|
||||
}
|
||||
|
||||
void OpenAPI_alternative_qos_profile_free(OpenAPI_alternative_qos_profile_t *alternative_qos_profile)
|
||||
{
|
||||
if (NULL == alternative_qos_profile) {
|
||||
return;
|
||||
}
|
||||
OpenAPI_lnode_t *node;
|
||||
ogs_free(alternative_qos_profile->gua_fbr_dl);
|
||||
ogs_free(alternative_qos_profile->gua_fbr_ul);
|
||||
ogs_free(alternative_qos_profile->packet_err_rate);
|
||||
ogs_free(alternative_qos_profile);
|
||||
}
|
||||
|
||||
cJSON *OpenAPI_alternative_qos_profile_convertToJSON(OpenAPI_alternative_qos_profile_t *alternative_qos_profile)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
|
||||
if (alternative_qos_profile == NULL) {
|
||||
ogs_error("OpenAPI_alternative_qos_profile_convertToJSON() failed [AlternativeQosProfile]");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
item = cJSON_CreateObject();
|
||||
if (!alternative_qos_profile->index) {
|
||||
ogs_error("OpenAPI_alternative_qos_profile_convertToJSON() failed [index]");
|
||||
goto end;
|
||||
}
|
||||
if (cJSON_AddNumberToObject(item, "index", alternative_qos_profile->index) == NULL) {
|
||||
ogs_error("OpenAPI_alternative_qos_profile_convertToJSON() failed [index]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
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 (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 (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 (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;
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
||||
OpenAPI_alternative_qos_profile_t *OpenAPI_alternative_qos_profile_parseFromJSON(cJSON *alternative_qos_profileJSON)
|
||||
{
|
||||
OpenAPI_alternative_qos_profile_t *alternative_qos_profile_local_var = NULL;
|
||||
cJSON *index = cJSON_GetObjectItemCaseSensitive(alternative_qos_profileJSON, "index");
|
||||
if (!index) {
|
||||
ogs_error("OpenAPI_alternative_qos_profile_parseFromJSON() failed [index]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
|
||||
if (!cJSON_IsNumber(index)) {
|
||||
ogs_error("OpenAPI_alternative_qos_profile_parseFromJSON() failed [index]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
cJSON *gua_fbr_dl = cJSON_GetObjectItemCaseSensitive(alternative_qos_profileJSON, "guaFbrDl");
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
alternative_qos_profile_local_var = OpenAPI_alternative_qos_profile_create (
|
||||
index->valuedouble,
|
||||
gua_fbr_dl ? ogs_strdup(gua_fbr_dl->valuestring) : NULL,
|
||||
gua_fbr_ul ? ogs_strdup(gua_fbr_ul->valuestring) : NULL,
|
||||
packet_delay_budget ? packet_delay_budget->valuedouble : 0,
|
||||
packet_err_rate ? ogs_strdup(packet_err_rate->valuestring) : NULL
|
||||
);
|
||||
|
||||
return alternative_qos_profile_local_var;
|
||||
end:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
OpenAPI_alternative_qos_profile_t *OpenAPI_alternative_qos_profile_copy(OpenAPI_alternative_qos_profile_t *dst, OpenAPI_alternative_qos_profile_t *src)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
char *content = NULL;
|
||||
|
||||
ogs_assert(src);
|
||||
item = OpenAPI_alternative_qos_profile_convertToJSON(src);
|
||||
if (!item) {
|
||||
ogs_error("OpenAPI_alternative_qos_profile_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_alternative_qos_profile_free(dst);
|
||||
dst = OpenAPI_alternative_qos_profile_parseFromJSON(item);
|
||||
cJSON_Delete(item);
|
||||
|
||||
return dst;
|
||||
}
|
||||
|
||||
46
lib/sbi/openapi/model/alternative_qos_profile.h
Normal file
46
lib/sbi/openapi/model/alternative_qos_profile.h
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
/*
|
||||
* alternative_qos_profile.h
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _OpenAPI_alternative_qos_profile_H_
|
||||
#define _OpenAPI_alternative_qos_profile_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_alternative_qos_profile_s OpenAPI_alternative_qos_profile_t;
|
||||
typedef struct OpenAPI_alternative_qos_profile_s {
|
||||
int index;
|
||||
char *gua_fbr_dl;
|
||||
char *gua_fbr_ul;
|
||||
int packet_delay_budget;
|
||||
char *packet_err_rate;
|
||||
} OpenAPI_alternative_qos_profile_t;
|
||||
|
||||
OpenAPI_alternative_qos_profile_t *OpenAPI_alternative_qos_profile_create(
|
||||
int index,
|
||||
char *gua_fbr_dl,
|
||||
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);
|
||||
OpenAPI_alternative_qos_profile_t *OpenAPI_alternative_qos_profile_copy(OpenAPI_alternative_qos_profile_t *dst, OpenAPI_alternative_qos_profile_t *src);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _OpenAPI_alternative_qos_profile_H_ */
|
||||
|
||||
|
|
@ -12,6 +12,8 @@
|
|||
#include "../include/list.h"
|
||||
#include "../include/keyValuePair.h"
|
||||
#include "../include/binary.h"
|
||||
#include "ambr.h"
|
||||
#include "null_value.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
|
|||
|
|
@ -21,12 +21,12 @@ OpenAPI_amf3_gpp_access_registration_t *OpenAPI_amf3_gpp_access_registration_cre
|
|||
OpenAPI_rat_type_e rat_type,
|
||||
int urrp_indicator,
|
||||
char *amf_ee_subscription_id,
|
||||
OpenAPI_eps_interworking_info_t *eps_interworking_info,
|
||||
int ue_srvcc_capability,
|
||||
char *nid,
|
||||
char *registration_time,
|
||||
char *vgmlc_address_ipv4,
|
||||
char *vgmlc_address_ipv6,
|
||||
char *vgmlc_fqdn
|
||||
OpenAPI_vgmlc_address_t *vgmlc_address,
|
||||
OpenAPI_context_info_t *context_info,
|
||||
int no_ee_subscription_ind
|
||||
)
|
||||
{
|
||||
OpenAPI_amf3_gpp_access_registration_t *amf3_gpp_access_registration_local_var = OpenAPI_malloc(sizeof(OpenAPI_amf3_gpp_access_registration_t));
|
||||
|
|
@ -49,12 +49,12 @@ OpenAPI_amf3_gpp_access_registration_t *OpenAPI_amf3_gpp_access_registration_cre
|
|||
amf3_gpp_access_registration_local_var->rat_type = rat_type;
|
||||
amf3_gpp_access_registration_local_var->urrp_indicator = urrp_indicator;
|
||||
amf3_gpp_access_registration_local_var->amf_ee_subscription_id = amf_ee_subscription_id;
|
||||
amf3_gpp_access_registration_local_var->eps_interworking_info = eps_interworking_info;
|
||||
amf3_gpp_access_registration_local_var->ue_srvcc_capability = ue_srvcc_capability;
|
||||
amf3_gpp_access_registration_local_var->nid = nid;
|
||||
amf3_gpp_access_registration_local_var->registration_time = registration_time;
|
||||
amf3_gpp_access_registration_local_var->vgmlc_address_ipv4 = vgmlc_address_ipv4;
|
||||
amf3_gpp_access_registration_local_var->vgmlc_address_ipv6 = vgmlc_address_ipv6;
|
||||
amf3_gpp_access_registration_local_var->vgmlc_fqdn = vgmlc_fqdn;
|
||||
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;
|
||||
|
||||
return amf3_gpp_access_registration_local_var;
|
||||
}
|
||||
|
|
@ -79,11 +79,10 @@ void OpenAPI_amf3_gpp_access_registration_free(OpenAPI_amf3_gpp_access_registrat
|
|||
}
|
||||
OpenAPI_list_free(amf3_gpp_access_registration->backup_amf_info);
|
||||
ogs_free(amf3_gpp_access_registration->amf_ee_subscription_id);
|
||||
ogs_free(amf3_gpp_access_registration->nid);
|
||||
OpenAPI_eps_interworking_info_free(amf3_gpp_access_registration->eps_interworking_info);
|
||||
ogs_free(amf3_gpp_access_registration->registration_time);
|
||||
ogs_free(amf3_gpp_access_registration->vgmlc_address_ipv4);
|
||||
ogs_free(amf3_gpp_access_registration->vgmlc_address_ipv6);
|
||||
ogs_free(amf3_gpp_access_registration->vgmlc_fqdn);
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
@ -242,16 +241,22 @@ cJSON *OpenAPI_amf3_gpp_access_registration_convertToJSON(OpenAPI_amf3_gpp_acces
|
|||
}
|
||||
}
|
||||
|
||||
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]");
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
if (amf3_gpp_access_registration->nid) {
|
||||
if (cJSON_AddStringToObject(item, "nid", amf3_gpp_access_registration->nid) == NULL) {
|
||||
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [nid]");
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
@ -263,23 +268,35 @@ cJSON *OpenAPI_amf3_gpp_access_registration_convertToJSON(OpenAPI_amf3_gpp_acces
|
|||
}
|
||||
}
|
||||
|
||||
if (amf3_gpp_access_registration->vgmlc_address_ipv4) {
|
||||
if (cJSON_AddStringToObject(item, "vgmlcAddressIpv4", amf3_gpp_access_registration->vgmlc_address_ipv4) == NULL) {
|
||||
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [vgmlc_address_ipv4]");
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
if (amf3_gpp_access_registration->vgmlc_address_ipv6) {
|
||||
if (cJSON_AddStringToObject(item, "vgmlcAddressIpv6", amf3_gpp_access_registration->vgmlc_address_ipv6) == NULL) {
|
||||
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [vgmlc_address_ipv6]");
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
if (amf3_gpp_access_registration->vgmlc_fqdn) {
|
||||
if (cJSON_AddStringToObject(item, "vgmlcFqdn", amf3_gpp_access_registration->vgmlc_fqdn) == NULL) {
|
||||
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [vgmlc_fqdn]");
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
@ -459,6 +476,13 @@ OpenAPI_amf3_gpp_access_registration_t *OpenAPI_amf3_gpp_access_registration_par
|
|||
}
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
cJSON *ue_srvcc_capability = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "ueSrvccCapability");
|
||||
|
||||
if (ue_srvcc_capability) {
|
||||
|
|
@ -468,15 +492,6 @@ OpenAPI_amf3_gpp_access_registration_t *OpenAPI_amf3_gpp_access_registration_par
|
|||
}
|
||||
}
|
||||
|
||||
cJSON *nid = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "nid");
|
||||
|
||||
if (nid) {
|
||||
if (!cJSON_IsString(nid)) {
|
||||
ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [nid]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
cJSON *registration_time = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "registrationTime");
|
||||
|
||||
if (registration_time) {
|
||||
|
|
@ -486,29 +501,25 @@ OpenAPI_amf3_gpp_access_registration_t *OpenAPI_amf3_gpp_access_registration_par
|
|||
}
|
||||
}
|
||||
|
||||
cJSON *vgmlc_address_ipv4 = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "vgmlcAddressIpv4");
|
||||
cJSON *vgmlc_address = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "vgmlcAddress");
|
||||
|
||||
if (vgmlc_address_ipv4) {
|
||||
if (!cJSON_IsString(vgmlc_address_ipv4)) {
|
||||
ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [vgmlc_address_ipv4]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_vgmlc_address_t *vgmlc_address_local_nonprim = NULL;
|
||||
if (vgmlc_address) {
|
||||
vgmlc_address_local_nonprim = OpenAPI_vgmlc_address_parseFromJSON(vgmlc_address);
|
||||
}
|
||||
|
||||
cJSON *vgmlc_address_ipv6 = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "vgmlcAddressIpv6");
|
||||
cJSON *context_info = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "contextInfo");
|
||||
|
||||
if (vgmlc_address_ipv6) {
|
||||
if (!cJSON_IsString(vgmlc_address_ipv6)) {
|
||||
ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [vgmlc_address_ipv6]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_context_info_t *context_info_local_nonprim = NULL;
|
||||
if (context_info) {
|
||||
context_info_local_nonprim = OpenAPI_context_info_parseFromJSON(context_info);
|
||||
}
|
||||
|
||||
cJSON *vgmlc_fqdn = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "vgmlcFqdn");
|
||||
cJSON *no_ee_subscription_ind = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "noEeSubscriptionInd");
|
||||
|
||||
if (vgmlc_fqdn) {
|
||||
if (!cJSON_IsString(vgmlc_fqdn)) {
|
||||
ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [vgmlc_fqdn]");
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
@ -530,12 +541,12 @@ OpenAPI_amf3_gpp_access_registration_t *OpenAPI_amf3_gpp_access_registration_par
|
|||
rat_typeVariable,
|
||||
urrp_indicator ? urrp_indicator->valueint : 0,
|
||||
amf_ee_subscription_id ? ogs_strdup(amf_ee_subscription_id->valuestring) : NULL,
|
||||
eps_interworking_info ? eps_interworking_info_local_nonprim : NULL,
|
||||
ue_srvcc_capability ? ue_srvcc_capability->valueint : 0,
|
||||
nid ? ogs_strdup(nid->valuestring) : NULL,
|
||||
registration_time ? ogs_strdup(registration_time->valuestring) : NULL,
|
||||
vgmlc_address_ipv4 ? ogs_strdup(vgmlc_address_ipv4->valuestring) : NULL,
|
||||
vgmlc_address_ipv6 ? ogs_strdup(vgmlc_address_ipv6->valuestring) : NULL,
|
||||
vgmlc_fqdn ? ogs_strdup(vgmlc_fqdn->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
|
||||
);
|
||||
|
||||
return amf3_gpp_access_registration_local_var;
|
||||
|
|
|
|||
|
|
@ -13,9 +13,12 @@
|
|||
#include "../include/keyValuePair.h"
|
||||
#include "../include/binary.h"
|
||||
#include "backup_amf_info.h"
|
||||
#include "context_info.h"
|
||||
#include "eps_interworking_info.h"
|
||||
#include "guami.h"
|
||||
#include "ims_vo_ps.h"
|
||||
#include "rat_type.h"
|
||||
#include "vgmlc_address.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
@ -39,12 +42,12 @@ typedef struct OpenAPI_amf3_gpp_access_registration_s {
|
|||
OpenAPI_rat_type_e rat_type;
|
||||
int urrp_indicator;
|
||||
char *amf_ee_subscription_id;
|
||||
struct OpenAPI_eps_interworking_info_s *eps_interworking_info;
|
||||
int ue_srvcc_capability;
|
||||
char *nid;
|
||||
char *registration_time;
|
||||
char *vgmlc_address_ipv4;
|
||||
char *vgmlc_address_ipv6;
|
||||
char *vgmlc_fqdn;
|
||||
struct OpenAPI_vgmlc_address_s *vgmlc_address;
|
||||
struct OpenAPI_context_info_s *context_info;
|
||||
int no_ee_subscription_ind;
|
||||
} OpenAPI_amf3_gpp_access_registration_t;
|
||||
|
||||
OpenAPI_amf3_gpp_access_registration_t *OpenAPI_amf3_gpp_access_registration_create(
|
||||
|
|
@ -64,12 +67,12 @@ OpenAPI_amf3_gpp_access_registration_t *OpenAPI_amf3_gpp_access_registration_cre
|
|||
OpenAPI_rat_type_e rat_type,
|
||||
int urrp_indicator,
|
||||
char *amf_ee_subscription_id,
|
||||
OpenAPI_eps_interworking_info_t *eps_interworking_info,
|
||||
int ue_srvcc_capability,
|
||||
char *nid,
|
||||
char *registration_time,
|
||||
char *vgmlc_address_ipv4,
|
||||
char *vgmlc_address_ipv6,
|
||||
char *vgmlc_fqdn
|
||||
OpenAPI_vgmlc_address_t *vgmlc_address,
|
||||
OpenAPI_context_info_t *context_info,
|
||||
int no_ee_subscription_ind
|
||||
);
|
||||
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);
|
||||
|
|
|
|||
|
|
@ -11,7 +11,8 @@ OpenAPI_amf3_gpp_access_registration_modification_t *OpenAPI_amf3_gpp_access_reg
|
|||
OpenAPI_ims_vo_ps_t *ims_vo_ps,
|
||||
OpenAPI_list_t *backup_amf_info,
|
||||
OpenAPI_eps_interworking_info_t *eps_interworking_info,
|
||||
int ue_srvcc_capability
|
||||
int ue_srvcc_capability,
|
||||
int no_ee_subscription_ind
|
||||
)
|
||||
{
|
||||
OpenAPI_amf3_gpp_access_registration_modification_t *amf3_gpp_access_registration_modification_local_var = OpenAPI_malloc(sizeof(OpenAPI_amf3_gpp_access_registration_modification_t));
|
||||
|
|
@ -25,6 +26,7 @@ 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;
|
||||
}
|
||||
|
|
@ -138,6 +140,13 @@ cJSON *OpenAPI_amf3_gpp_access_registration_modification_convertToJSON(OpenAPI_a
|
|||
}
|
||||
}
|
||||
|
||||
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:
|
||||
return item;
|
||||
}
|
||||
|
|
@ -219,6 +228,15 @@ OpenAPI_amf3_gpp_access_registration_modification_t *OpenAPI_amf3_gpp_access_reg
|
|||
}
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
amf3_gpp_access_registration_modification_local_var = OpenAPI_amf3_gpp_access_registration_modification_create (
|
||||
guami_local_nonprim,
|
||||
purge_flag ? purge_flag->valueint : 0,
|
||||
|
|
@ -226,7 +244,8 @@ OpenAPI_amf3_gpp_access_registration_modification_t *OpenAPI_amf3_gpp_access_reg
|
|||
ims_vo_ps ? ims_vo_ps_local_nonprim : NULL,
|
||||
backup_amf_info ? backup_amf_infoList : NULL,
|
||||
eps_interworking_info ? eps_interworking_info_local_nonprim : NULL,
|
||||
ue_srvcc_capability ? ue_srvcc_capability->valueint : 0
|
||||
ue_srvcc_capability ? ue_srvcc_capability->valueint : 0,
|
||||
no_ee_subscription_ind ? no_ee_subscription_ind->valueint : 0
|
||||
);
|
||||
|
||||
return amf3_gpp_access_registration_modification_local_var;
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ 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(
|
||||
|
|
@ -39,7 +40,8 @@ OpenAPI_amf3_gpp_access_registration_modification_t *OpenAPI_amf3_gpp_access_reg
|
|||
OpenAPI_ims_vo_ps_t *ims_vo_ps,
|
||||
OpenAPI_list_t *backup_amf_info,
|
||||
OpenAPI_eps_interworking_info_t *eps_interworking_info,
|
||||
int ue_srvcc_capability
|
||||
int ue_srvcc_capability,
|
||||
int no_ee_subscription_ind
|
||||
);
|
||||
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);
|
||||
|
|
|
|||
|
|
@ -19,11 +19,9 @@ OpenAPI_amf_non3_gpp_access_registration_t *OpenAPI_amf_non3_gpp_access_registra
|
|||
OpenAPI_rat_type_e rat_type,
|
||||
int urrp_indicator,
|
||||
char *amf_ee_subscription_id,
|
||||
char *nid,
|
||||
char *registration_time,
|
||||
char *vgmlc_address_ipv4,
|
||||
char *vgmlc_address_ipv6,
|
||||
char *vgmlc_fqdn
|
||||
OpenAPI_vgmlc_address_t *vgmlc_address,
|
||||
OpenAPI_context_info_t *context_info
|
||||
)
|
||||
{
|
||||
OpenAPI_amf_non3_gpp_access_registration_t *amf_non3_gpp_access_registration_local_var = OpenAPI_malloc(sizeof(OpenAPI_amf_non3_gpp_access_registration_t));
|
||||
|
|
@ -44,11 +42,9 @@ OpenAPI_amf_non3_gpp_access_registration_t *OpenAPI_amf_non3_gpp_access_registra
|
|||
amf_non3_gpp_access_registration_local_var->rat_type = rat_type;
|
||||
amf_non3_gpp_access_registration_local_var->urrp_indicator = urrp_indicator;
|
||||
amf_non3_gpp_access_registration_local_var->amf_ee_subscription_id = amf_ee_subscription_id;
|
||||
amf_non3_gpp_access_registration_local_var->nid = nid;
|
||||
amf_non3_gpp_access_registration_local_var->registration_time = registration_time;
|
||||
amf_non3_gpp_access_registration_local_var->vgmlc_address_ipv4 = vgmlc_address_ipv4;
|
||||
amf_non3_gpp_access_registration_local_var->vgmlc_address_ipv6 = vgmlc_address_ipv6;
|
||||
amf_non3_gpp_access_registration_local_var->vgmlc_fqdn = vgmlc_fqdn;
|
||||
amf_non3_gpp_access_registration_local_var->vgmlc_address = vgmlc_address;
|
||||
amf_non3_gpp_access_registration_local_var->context_info = context_info;
|
||||
|
||||
return amf_non3_gpp_access_registration_local_var;
|
||||
}
|
||||
|
|
@ -73,11 +69,9 @@ void OpenAPI_amf_non3_gpp_access_registration_free(OpenAPI_amf_non3_gpp_access_r
|
|||
}
|
||||
OpenAPI_list_free(amf_non3_gpp_access_registration->backup_amf_info);
|
||||
ogs_free(amf_non3_gpp_access_registration->amf_ee_subscription_id);
|
||||
ogs_free(amf_non3_gpp_access_registration->nid);
|
||||
ogs_free(amf_non3_gpp_access_registration->registration_time);
|
||||
ogs_free(amf_non3_gpp_access_registration->vgmlc_address_ipv4);
|
||||
ogs_free(amf_non3_gpp_access_registration->vgmlc_address_ipv6);
|
||||
ogs_free(amf_non3_gpp_access_registration->vgmlc_fqdn);
|
||||
OpenAPI_vgmlc_address_free(amf_non3_gpp_access_registration->vgmlc_address);
|
||||
OpenAPI_context_info_free(amf_non3_gpp_access_registration->context_info);
|
||||
ogs_free(amf_non3_gpp_access_registration);
|
||||
}
|
||||
|
||||
|
|
@ -224,13 +218,6 @@ cJSON *OpenAPI_amf_non3_gpp_access_registration_convertToJSON(OpenAPI_amf_non3_g
|
|||
}
|
||||
}
|
||||
|
||||
if (amf_non3_gpp_access_registration->nid) {
|
||||
if (cJSON_AddStringToObject(item, "nid", amf_non3_gpp_access_registration->nid) == NULL) {
|
||||
ogs_error("OpenAPI_amf_non3_gpp_access_registration_convertToJSON() failed [nid]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (amf_non3_gpp_access_registration->registration_time) {
|
||||
if (cJSON_AddStringToObject(item, "registrationTime", amf_non3_gpp_access_registration->registration_time) == NULL) {
|
||||
ogs_error("OpenAPI_amf_non3_gpp_access_registration_convertToJSON() failed [registration_time]");
|
||||
|
|
@ -238,23 +225,28 @@ cJSON *OpenAPI_amf_non3_gpp_access_registration_convertToJSON(OpenAPI_amf_non3_g
|
|||
}
|
||||
}
|
||||
|
||||
if (amf_non3_gpp_access_registration->vgmlc_address_ipv4) {
|
||||
if (cJSON_AddStringToObject(item, "vgmlcAddressIpv4", amf_non3_gpp_access_registration->vgmlc_address_ipv4) == NULL) {
|
||||
ogs_error("OpenAPI_amf_non3_gpp_access_registration_convertToJSON() failed [vgmlc_address_ipv4]");
|
||||
if (amf_non3_gpp_access_registration->vgmlc_address) {
|
||||
cJSON *vgmlc_address_local_JSON = OpenAPI_vgmlc_address_convertToJSON(amf_non3_gpp_access_registration->vgmlc_address);
|
||||
if (vgmlc_address_local_JSON == NULL) {
|
||||
ogs_error("OpenAPI_amf_non3_gpp_access_registration_convertToJSON() failed [vgmlc_address]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToObject(item, "vgmlcAddress", vgmlc_address_local_JSON);
|
||||
if (item->child == NULL) {
|
||||
ogs_error("OpenAPI_amf_non3_gpp_access_registration_convertToJSON() failed [vgmlc_address]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (amf_non3_gpp_access_registration->vgmlc_address_ipv6) {
|
||||
if (cJSON_AddStringToObject(item, "vgmlcAddressIpv6", amf_non3_gpp_access_registration->vgmlc_address_ipv6) == NULL) {
|
||||
ogs_error("OpenAPI_amf_non3_gpp_access_registration_convertToJSON() failed [vgmlc_address_ipv6]");
|
||||
if (amf_non3_gpp_access_registration->context_info) {
|
||||
cJSON *context_info_local_JSON = OpenAPI_context_info_convertToJSON(amf_non3_gpp_access_registration->context_info);
|
||||
if (context_info_local_JSON == NULL) {
|
||||
ogs_error("OpenAPI_amf_non3_gpp_access_registration_convertToJSON() failed [context_info]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (amf_non3_gpp_access_registration->vgmlc_fqdn) {
|
||||
if (cJSON_AddStringToObject(item, "vgmlcFqdn", amf_non3_gpp_access_registration->vgmlc_fqdn) == NULL) {
|
||||
ogs_error("OpenAPI_amf_non3_gpp_access_registration_convertToJSON() failed [vgmlc_fqdn]");
|
||||
cJSON_AddItemToObject(item, "contextInfo", context_info_local_JSON);
|
||||
if (item->child == NULL) {
|
||||
ogs_error("OpenAPI_amf_non3_gpp_access_registration_convertToJSON() failed [context_info]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
|
@ -419,15 +411,6 @@ OpenAPI_amf_non3_gpp_access_registration_t *OpenAPI_amf_non3_gpp_access_registra
|
|||
}
|
||||
}
|
||||
|
||||
cJSON *nid = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "nid");
|
||||
|
||||
if (nid) {
|
||||
if (!cJSON_IsString(nid)) {
|
||||
ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [nid]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
cJSON *registration_time = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "registrationTime");
|
||||
|
||||
if (registration_time) {
|
||||
|
|
@ -437,31 +420,18 @@ OpenAPI_amf_non3_gpp_access_registration_t *OpenAPI_amf_non3_gpp_access_registra
|
|||
}
|
||||
}
|
||||
|
||||
cJSON *vgmlc_address_ipv4 = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "vgmlcAddressIpv4");
|
||||
cJSON *vgmlc_address = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "vgmlcAddress");
|
||||
|
||||
if (vgmlc_address_ipv4) {
|
||||
if (!cJSON_IsString(vgmlc_address_ipv4)) {
|
||||
ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [vgmlc_address_ipv4]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_vgmlc_address_t *vgmlc_address_local_nonprim = NULL;
|
||||
if (vgmlc_address) {
|
||||
vgmlc_address_local_nonprim = OpenAPI_vgmlc_address_parseFromJSON(vgmlc_address);
|
||||
}
|
||||
|
||||
cJSON *vgmlc_address_ipv6 = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "vgmlcAddressIpv6");
|
||||
cJSON *context_info = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "contextInfo");
|
||||
|
||||
if (vgmlc_address_ipv6) {
|
||||
if (!cJSON_IsString(vgmlc_address_ipv6)) {
|
||||
ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [vgmlc_address_ipv6]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
cJSON *vgmlc_fqdn = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "vgmlcFqdn");
|
||||
|
||||
if (vgmlc_fqdn) {
|
||||
if (!cJSON_IsString(vgmlc_fqdn)) {
|
||||
ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [vgmlc_fqdn]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_context_info_t *context_info_local_nonprim = NULL;
|
||||
if (context_info) {
|
||||
context_info_local_nonprim = OpenAPI_context_info_parseFromJSON(context_info);
|
||||
}
|
||||
|
||||
amf_non3_gpp_access_registration_local_var = OpenAPI_amf_non3_gpp_access_registration_create (
|
||||
|
|
@ -479,11 +449,9 @@ OpenAPI_amf_non3_gpp_access_registration_t *OpenAPI_amf_non3_gpp_access_registra
|
|||
rat_typeVariable,
|
||||
urrp_indicator ? urrp_indicator->valueint : 0,
|
||||
amf_ee_subscription_id ? ogs_strdup(amf_ee_subscription_id->valuestring) : NULL,
|
||||
nid ? ogs_strdup(nid->valuestring) : NULL,
|
||||
registration_time ? ogs_strdup(registration_time->valuestring) : NULL,
|
||||
vgmlc_address_ipv4 ? ogs_strdup(vgmlc_address_ipv4->valuestring) : NULL,
|
||||
vgmlc_address_ipv6 ? ogs_strdup(vgmlc_address_ipv6->valuestring) : NULL,
|
||||
vgmlc_fqdn ? ogs_strdup(vgmlc_fqdn->valuestring) : NULL
|
||||
vgmlc_address ? vgmlc_address_local_nonprim : NULL,
|
||||
context_info ? context_info_local_nonprim : NULL
|
||||
);
|
||||
|
||||
return amf_non3_gpp_access_registration_local_var;
|
||||
|
|
|
|||
|
|
@ -13,9 +13,11 @@
|
|||
#include "../include/keyValuePair.h"
|
||||
#include "../include/binary.h"
|
||||
#include "backup_amf_info.h"
|
||||
#include "context_info.h"
|
||||
#include "guami.h"
|
||||
#include "ims_vo_ps.h"
|
||||
#include "rat_type.h"
|
||||
#include "vgmlc_address.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
@ -37,11 +39,9 @@ typedef struct OpenAPI_amf_non3_gpp_access_registration_s {
|
|||
OpenAPI_rat_type_e rat_type;
|
||||
int urrp_indicator;
|
||||
char *amf_ee_subscription_id;
|
||||
char *nid;
|
||||
char *registration_time;
|
||||
char *vgmlc_address_ipv4;
|
||||
char *vgmlc_address_ipv6;
|
||||
char *vgmlc_fqdn;
|
||||
struct OpenAPI_vgmlc_address_s *vgmlc_address;
|
||||
struct OpenAPI_context_info_s *context_info;
|
||||
} OpenAPI_amf_non3_gpp_access_registration_t;
|
||||
|
||||
OpenAPI_amf_non3_gpp_access_registration_t *OpenAPI_amf_non3_gpp_access_registration_create(
|
||||
|
|
@ -59,11 +59,9 @@ OpenAPI_amf_non3_gpp_access_registration_t *OpenAPI_amf_non3_gpp_access_registra
|
|||
OpenAPI_rat_type_e rat_type,
|
||||
int urrp_indicator,
|
||||
char *amf_ee_subscription_id,
|
||||
char *nid,
|
||||
char *registration_time,
|
||||
char *vgmlc_address_ipv4,
|
||||
char *vgmlc_address_ipv6,
|
||||
char *vgmlc_fqdn
|
||||
OpenAPI_vgmlc_address_t *vgmlc_address,
|
||||
OpenAPI_context_info_t *context_info
|
||||
);
|
||||
void OpenAPI_amf_non3_gpp_access_registration_free(OpenAPI_amf_non3_gpp_access_registration_t *amf_non3_gpp_access_registration);
|
||||
OpenAPI_amf_non3_gpp_access_registration_t *OpenAPI_amf_non3_gpp_access_registration_parseFromJSON(cJSON *amf_non3_gpp_access_registrationJSON);
|
||||
|
|
|
|||
|
|
@ -4,82 +4,27 @@
|
|||
#include <stdio.h>
|
||||
#include "an_node_type.h"
|
||||
|
||||
OpenAPI_an_node_type_t *OpenAPI_an_node_type_create(
|
||||
)
|
||||
char* OpenAPI_an_node_type_ToString(OpenAPI_an_node_type_e an_node_type)
|
||||
{
|
||||
OpenAPI_an_node_type_t *an_node_type_local_var = OpenAPI_malloc(sizeof(OpenAPI_an_node_type_t));
|
||||
if (!an_node_type_local_var) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return an_node_type_local_var;
|
||||
const char *an_node_typeArray[] = { "NULL", "GNB", "NG_ENB" };
|
||||
size_t sizeofArray = sizeof(an_node_typeArray) / sizeof(an_node_typeArray[0]);
|
||||
if (an_node_type < sizeofArray)
|
||||
return (char *)an_node_typeArray[an_node_type];
|
||||
else
|
||||
return (char *)"Unknown";
|
||||
}
|
||||
|
||||
void OpenAPI_an_node_type_free(OpenAPI_an_node_type_t *an_node_type)
|
||||
OpenAPI_an_node_type_e OpenAPI_an_node_type_FromString(char* an_node_type)
|
||||
{
|
||||
if (NULL == an_node_type) {
|
||||
return;
|
||||
int stringToReturn = 0;
|
||||
const char *an_node_typeArray[] = { "NULL", "GNB", "NG_ENB" };
|
||||
size_t sizeofArray = sizeof(an_node_typeArray) / sizeof(an_node_typeArray[0]);
|
||||
while (stringToReturn < sizeofArray) {
|
||||
if (strcmp(an_node_type, an_node_typeArray[stringToReturn]) == 0) {
|
||||
return stringToReturn;
|
||||
}
|
||||
stringToReturn++;
|
||||
}
|
||||
OpenAPI_lnode_t *node;
|
||||
ogs_free(an_node_type);
|
||||
}
|
||||
|
||||
cJSON *OpenAPI_an_node_type_convertToJSON(OpenAPI_an_node_type_t *an_node_type)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
|
||||
if (an_node_type == NULL) {
|
||||
ogs_error("OpenAPI_an_node_type_convertToJSON() failed [AnNodeType]");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
item = cJSON_CreateObject();
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
||||
OpenAPI_an_node_type_t *OpenAPI_an_node_type_parseFromJSON(cJSON *an_node_typeJSON)
|
||||
{
|
||||
OpenAPI_an_node_type_t *an_node_type_local_var = NULL;
|
||||
an_node_type_local_var = OpenAPI_an_node_type_create (
|
||||
);
|
||||
|
||||
return an_node_type_local_var;
|
||||
end:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
OpenAPI_an_node_type_t *OpenAPI_an_node_type_copy(OpenAPI_an_node_type_t *dst, OpenAPI_an_node_type_t *src)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
char *content = NULL;
|
||||
|
||||
ogs_assert(src);
|
||||
item = OpenAPI_an_node_type_convertToJSON(src);
|
||||
if (!item) {
|
||||
ogs_error("OpenAPI_an_node_type_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_an_node_type_free(dst);
|
||||
dst = OpenAPI_an_node_type_parseFromJSON(item);
|
||||
cJSON_Delete(item);
|
||||
|
||||
return dst;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -17,16 +17,11 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct OpenAPI_an_node_type_s OpenAPI_an_node_type_t;
|
||||
typedef struct OpenAPI_an_node_type_s {
|
||||
} OpenAPI_an_node_type_t;
|
||||
typedef enum { OpenAPI_an_node_type_NULL = 0, OpenAPI_an_node_type_GNB, OpenAPI_an_node_type_NG_ENB } OpenAPI_an_node_type_e;
|
||||
|
||||
OpenAPI_an_node_type_t *OpenAPI_an_node_type_create(
|
||||
);
|
||||
void OpenAPI_an_node_type_free(OpenAPI_an_node_type_t *an_node_type);
|
||||
OpenAPI_an_node_type_t *OpenAPI_an_node_type_parseFromJSON(cJSON *an_node_typeJSON);
|
||||
cJSON *OpenAPI_an_node_type_convertToJSON(OpenAPI_an_node_type_t *an_node_type);
|
||||
OpenAPI_an_node_type_t *OpenAPI_an_node_type_copy(OpenAPI_an_node_type_t *dst, OpenAPI_an_node_type_t *src);
|
||||
char* OpenAPI_an_node_type_ToString(OpenAPI_an_node_type_e an_node_type);
|
||||
|
||||
OpenAPI_an_node_type_e OpenAPI_an_node_type_FromString(char* an_node_type);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
|||
267
lib/sbi/openapi/model/area_scope.c
Normal file
267
lib/sbi/openapi/model/area_scope.c
Normal file
|
|
@ -0,0 +1,267 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include "area_scope.h"
|
||||
|
||||
OpenAPI_area_scope_t *OpenAPI_area_scope_create(
|
||||
OpenAPI_list_t *eutra_cell_id_list,
|
||||
OpenAPI_list_t *nr_cell_id_list,
|
||||
OpenAPI_list_t *tac_list,
|
||||
OpenAPI_list_t* tac_info_per_plmn
|
||||
)
|
||||
{
|
||||
OpenAPI_area_scope_t *area_scope_local_var = OpenAPI_malloc(sizeof(OpenAPI_area_scope_t));
|
||||
if (!area_scope_local_var) {
|
||||
return NULL;
|
||||
}
|
||||
area_scope_local_var->eutra_cell_id_list = eutra_cell_id_list;
|
||||
area_scope_local_var->nr_cell_id_list = nr_cell_id_list;
|
||||
area_scope_local_var->tac_list = tac_list;
|
||||
area_scope_local_var->tac_info_per_plmn = tac_info_per_plmn;
|
||||
|
||||
return area_scope_local_var;
|
||||
}
|
||||
|
||||
void OpenAPI_area_scope_free(OpenAPI_area_scope_t *area_scope)
|
||||
{
|
||||
if (NULL == area_scope) {
|
||||
return;
|
||||
}
|
||||
OpenAPI_lnode_t *node;
|
||||
OpenAPI_list_for_each(area_scope->eutra_cell_id_list, node) {
|
||||
ogs_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(area_scope->eutra_cell_id_list);
|
||||
OpenAPI_list_for_each(area_scope->nr_cell_id_list, node) {
|
||||
ogs_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(area_scope->nr_cell_id_list);
|
||||
OpenAPI_list_for_each(area_scope->tac_list, node) {
|
||||
ogs_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(area_scope->tac_list);
|
||||
OpenAPI_list_for_each(area_scope->tac_info_per_plmn, node) {
|
||||
OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data;
|
||||
OpenAPI_tac_info_free(localKeyValue->value);
|
||||
ogs_free(localKeyValue);
|
||||
}
|
||||
OpenAPI_list_free(area_scope->tac_info_per_plmn);
|
||||
ogs_free(area_scope);
|
||||
}
|
||||
|
||||
cJSON *OpenAPI_area_scope_convertToJSON(OpenAPI_area_scope_t *area_scope)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
|
||||
if (area_scope == NULL) {
|
||||
ogs_error("OpenAPI_area_scope_convertToJSON() failed [AreaScope]");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
item = cJSON_CreateObject();
|
||||
if (area_scope->eutra_cell_id_list) {
|
||||
cJSON *eutra_cell_id_list = cJSON_AddArrayToObject(item, "eutraCellIdList");
|
||||
if (eutra_cell_id_list == NULL) {
|
||||
ogs_error("OpenAPI_area_scope_convertToJSON() failed [eutra_cell_id_list]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
OpenAPI_lnode_t *eutra_cell_id_list_node;
|
||||
OpenAPI_list_for_each(area_scope->eutra_cell_id_list, eutra_cell_id_list_node) {
|
||||
if (cJSON_AddStringToObject(eutra_cell_id_list, "", (char*)eutra_cell_id_list_node->data) == NULL) {
|
||||
ogs_error("OpenAPI_area_scope_convertToJSON() failed [eutra_cell_id_list]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (area_scope->nr_cell_id_list) {
|
||||
cJSON *nr_cell_id_list = cJSON_AddArrayToObject(item, "nrCellIdList");
|
||||
if (nr_cell_id_list == NULL) {
|
||||
ogs_error("OpenAPI_area_scope_convertToJSON() failed [nr_cell_id_list]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
OpenAPI_lnode_t *nr_cell_id_list_node;
|
||||
OpenAPI_list_for_each(area_scope->nr_cell_id_list, nr_cell_id_list_node) {
|
||||
if (cJSON_AddStringToObject(nr_cell_id_list, "", (char*)nr_cell_id_list_node->data) == NULL) {
|
||||
ogs_error("OpenAPI_area_scope_convertToJSON() failed [nr_cell_id_list]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (area_scope->tac_list) {
|
||||
cJSON *tac_list = cJSON_AddArrayToObject(item, "tacList");
|
||||
if (tac_list == NULL) {
|
||||
ogs_error("OpenAPI_area_scope_convertToJSON() failed [tac_list]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
OpenAPI_lnode_t *tac_list_node;
|
||||
OpenAPI_list_for_each(area_scope->tac_list, tac_list_node) {
|
||||
if (cJSON_AddStringToObject(tac_list, "", (char*)tac_list_node->data) == NULL) {
|
||||
ogs_error("OpenAPI_area_scope_convertToJSON() failed [tac_list]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (area_scope->tac_info_per_plmn) {
|
||||
cJSON *tac_info_per_plmn = cJSON_AddObjectToObject(item, "tacInfoPerPlmn");
|
||||
if (tac_info_per_plmn == NULL) {
|
||||
ogs_error("OpenAPI_area_scope_convertToJSON() failed [tac_info_per_plmn]");
|
||||
goto end;
|
||||
}
|
||||
cJSON *localMapObject = tac_info_per_plmn;
|
||||
OpenAPI_lnode_t *tac_info_per_plmn_node;
|
||||
if (area_scope->tac_info_per_plmn) {
|
||||
OpenAPI_list_for_each(area_scope->tac_info_per_plmn, tac_info_per_plmn_node) {
|
||||
OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)tac_info_per_plmn_node->data;
|
||||
cJSON *itemLocal = OpenAPI_tac_info_convertToJSON(localKeyValue->value);
|
||||
if (itemLocal == NULL) {
|
||||
ogs_error("OpenAPI_area_scope_convertToJSON() failed [tac_info_per_plmn]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToObject(tac_info_per_plmn, localKeyValue->key, itemLocal);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
||||
OpenAPI_area_scope_t *OpenAPI_area_scope_parseFromJSON(cJSON *area_scopeJSON)
|
||||
{
|
||||
OpenAPI_area_scope_t *area_scope_local_var = NULL;
|
||||
cJSON *eutra_cell_id_list = cJSON_GetObjectItemCaseSensitive(area_scopeJSON, "eutraCellIdList");
|
||||
|
||||
OpenAPI_list_t *eutra_cell_id_listList;
|
||||
if (eutra_cell_id_list) {
|
||||
cJSON *eutra_cell_id_list_local;
|
||||
if (!cJSON_IsArray(eutra_cell_id_list)) {
|
||||
ogs_error("OpenAPI_area_scope_parseFromJSON() failed [eutra_cell_id_list]");
|
||||
goto end;
|
||||
}
|
||||
eutra_cell_id_listList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(eutra_cell_id_list_local, eutra_cell_id_list) {
|
||||
if (!cJSON_IsString(eutra_cell_id_list_local)) {
|
||||
ogs_error("OpenAPI_area_scope_parseFromJSON() failed [eutra_cell_id_list]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_add(eutra_cell_id_listList, ogs_strdup(eutra_cell_id_list_local->valuestring));
|
||||
}
|
||||
}
|
||||
|
||||
cJSON *nr_cell_id_list = cJSON_GetObjectItemCaseSensitive(area_scopeJSON, "nrCellIdList");
|
||||
|
||||
OpenAPI_list_t *nr_cell_id_listList;
|
||||
if (nr_cell_id_list) {
|
||||
cJSON *nr_cell_id_list_local;
|
||||
if (!cJSON_IsArray(nr_cell_id_list)) {
|
||||
ogs_error("OpenAPI_area_scope_parseFromJSON() failed [nr_cell_id_list]");
|
||||
goto end;
|
||||
}
|
||||
nr_cell_id_listList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(nr_cell_id_list_local, nr_cell_id_list) {
|
||||
if (!cJSON_IsString(nr_cell_id_list_local)) {
|
||||
ogs_error("OpenAPI_area_scope_parseFromJSON() failed [nr_cell_id_list]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_add(nr_cell_id_listList, ogs_strdup(nr_cell_id_list_local->valuestring));
|
||||
}
|
||||
}
|
||||
|
||||
cJSON *tac_list = cJSON_GetObjectItemCaseSensitive(area_scopeJSON, "tacList");
|
||||
|
||||
OpenAPI_list_t *tac_listList;
|
||||
if (tac_list) {
|
||||
cJSON *tac_list_local;
|
||||
if (!cJSON_IsArray(tac_list)) {
|
||||
ogs_error("OpenAPI_area_scope_parseFromJSON() failed [tac_list]");
|
||||
goto end;
|
||||
}
|
||||
tac_listList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(tac_list_local, tac_list) {
|
||||
if (!cJSON_IsString(tac_list_local)) {
|
||||
ogs_error("OpenAPI_area_scope_parseFromJSON() failed [tac_list]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_add(tac_listList, ogs_strdup(tac_list_local->valuestring));
|
||||
}
|
||||
}
|
||||
|
||||
cJSON *tac_info_per_plmn = cJSON_GetObjectItemCaseSensitive(area_scopeJSON, "tacInfoPerPlmn");
|
||||
|
||||
OpenAPI_list_t *tac_info_per_plmnList;
|
||||
if (tac_info_per_plmn) {
|
||||
cJSON *tac_info_per_plmn_local_map;
|
||||
if (!cJSON_IsObject(tac_info_per_plmn)) {
|
||||
ogs_error("OpenAPI_area_scope_parseFromJSON() failed [tac_info_per_plmn]");
|
||||
goto end;
|
||||
}
|
||||
tac_info_per_plmnList = OpenAPI_list_create();
|
||||
OpenAPI_map_t *localMapKeyPair = NULL;
|
||||
cJSON_ArrayForEach(tac_info_per_plmn_local_map, tac_info_per_plmn) {
|
||||
cJSON *localMapObject = tac_info_per_plmn_local_map;
|
||||
if (!cJSON_IsObject(tac_info_per_plmn_local_map)) {
|
||||
ogs_error("OpenAPI_area_scope_parseFromJSON() failed [tac_info_per_plmn]");
|
||||
goto end;
|
||||
}
|
||||
localMapKeyPair = OpenAPI_map_create(
|
||||
localMapObject->string, OpenAPI_tac_info_parseFromJSON(localMapObject));
|
||||
OpenAPI_list_add(tac_info_per_plmnList, localMapKeyPair);
|
||||
}
|
||||
}
|
||||
|
||||
area_scope_local_var = OpenAPI_area_scope_create (
|
||||
eutra_cell_id_list ? eutra_cell_id_listList : NULL,
|
||||
nr_cell_id_list ? nr_cell_id_listList : NULL,
|
||||
tac_list ? tac_listList : NULL,
|
||||
tac_info_per_plmn ? tac_info_per_plmnList : NULL
|
||||
);
|
||||
|
||||
return area_scope_local_var;
|
||||
end:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
OpenAPI_area_scope_t *OpenAPI_area_scope_copy(OpenAPI_area_scope_t *dst, OpenAPI_area_scope_t *src)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
char *content = NULL;
|
||||
|
||||
ogs_assert(src);
|
||||
item = OpenAPI_area_scope_convertToJSON(src);
|
||||
if (!item) {
|
||||
ogs_error("OpenAPI_area_scope_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_area_scope_free(dst);
|
||||
dst = OpenAPI_area_scope_parseFromJSON(item);
|
||||
cJSON_Delete(item);
|
||||
|
||||
return dst;
|
||||
}
|
||||
|
||||
45
lib/sbi/openapi/model/area_scope.h
Normal file
45
lib/sbi/openapi/model/area_scope.h
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
/*
|
||||
* area_scope.h
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _OpenAPI_area_scope_H_
|
||||
#define _OpenAPI_area_scope_H_
|
||||
|
||||
#include <string.h>
|
||||
#include "../external/cJSON.h"
|
||||
#include "../include/list.h"
|
||||
#include "../include/keyValuePair.h"
|
||||
#include "../include/binary.h"
|
||||
#include "tac_info.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct OpenAPI_area_scope_s OpenAPI_area_scope_t;
|
||||
typedef struct OpenAPI_area_scope_s {
|
||||
OpenAPI_list_t *eutra_cell_id_list;
|
||||
OpenAPI_list_t *nr_cell_id_list;
|
||||
OpenAPI_list_t *tac_list;
|
||||
OpenAPI_list_t* tac_info_per_plmn;
|
||||
} OpenAPI_area_scope_t;
|
||||
|
||||
OpenAPI_area_scope_t *OpenAPI_area_scope_create(
|
||||
OpenAPI_list_t *eutra_cell_id_list,
|
||||
OpenAPI_list_t *nr_cell_id_list,
|
||||
OpenAPI_list_t *tac_list,
|
||||
OpenAPI_list_t* tac_info_per_plmn
|
||||
);
|
||||
void OpenAPI_area_scope_free(OpenAPI_area_scope_t *area_scope);
|
||||
OpenAPI_area_scope_t *OpenAPI_area_scope_parseFromJSON(cJSON *area_scopeJSON);
|
||||
cJSON *OpenAPI_area_scope_convertToJSON(OpenAPI_area_scope_t *area_scope);
|
||||
OpenAPI_area_scope_t *OpenAPI_area_scope_copy(OpenAPI_area_scope_t *dst, OpenAPI_area_scope_t *src);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _OpenAPI_area_scope_H_ */
|
||||
|
||||
|
|
@ -6,7 +6,8 @@
|
|||
|
||||
OpenAPI_atsss_capability_t *OpenAPI_atsss_capability_create(
|
||||
int atsss_ll,
|
||||
int mptcp
|
||||
int mptcp,
|
||||
int rtt_without_pmf
|
||||
)
|
||||
{
|
||||
OpenAPI_atsss_capability_t *atsss_capability_local_var = OpenAPI_malloc(sizeof(OpenAPI_atsss_capability_t));
|
||||
|
|
@ -15,6 +16,7 @@ OpenAPI_atsss_capability_t *OpenAPI_atsss_capability_create(
|
|||
}
|
||||
atsss_capability_local_var->atsss_ll = atsss_ll;
|
||||
atsss_capability_local_var->mptcp = mptcp;
|
||||
atsss_capability_local_var->rtt_without_pmf = rtt_without_pmf;
|
||||
|
||||
return atsss_capability_local_var;
|
||||
}
|
||||
|
|
@ -52,6 +54,13 @@ cJSON *OpenAPI_atsss_capability_convertToJSON(OpenAPI_atsss_capability_t *atsss_
|
|||
}
|
||||
}
|
||||
|
||||
if (atsss_capability->rtt_without_pmf) {
|
||||
if (cJSON_AddBoolToObject(item, "rttWithoutPmf", atsss_capability->rtt_without_pmf) == NULL) {
|
||||
ogs_error("OpenAPI_atsss_capability_convertToJSON() failed [rtt_without_pmf]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
|
@ -77,9 +86,19 @@ OpenAPI_atsss_capability_t *OpenAPI_atsss_capability_parseFromJSON(cJSON *atsss_
|
|||
}
|
||||
}
|
||||
|
||||
cJSON *rtt_without_pmf = cJSON_GetObjectItemCaseSensitive(atsss_capabilityJSON, "rttWithoutPmf");
|
||||
|
||||
if (rtt_without_pmf) {
|
||||
if (!cJSON_IsBool(rtt_without_pmf)) {
|
||||
ogs_error("OpenAPI_atsss_capability_parseFromJSON() failed [rtt_without_pmf]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
atsss_capability_local_var = OpenAPI_atsss_capability_create (
|
||||
atsss_ll ? atsss_ll->valueint : 0,
|
||||
mptcp ? mptcp->valueint : 0
|
||||
mptcp ? mptcp->valueint : 0,
|
||||
rtt_without_pmf ? rtt_without_pmf->valueint : 0
|
||||
);
|
||||
|
||||
return atsss_capability_local_var;
|
||||
|
|
|
|||
|
|
@ -21,11 +21,13 @@ typedef struct OpenAPI_atsss_capability_s OpenAPI_atsss_capability_t;
|
|||
typedef struct OpenAPI_atsss_capability_s {
|
||||
int atsss_ll;
|
||||
int mptcp;
|
||||
int rtt_without_pmf;
|
||||
} OpenAPI_atsss_capability_t;
|
||||
|
||||
OpenAPI_atsss_capability_t *OpenAPI_atsss_capability_create(
|
||||
int atsss_ll,
|
||||
int mptcp
|
||||
int mptcp,
|
||||
int rtt_without_pmf
|
||||
);
|
||||
void OpenAPI_atsss_capability_free(OpenAPI_atsss_capability_t *atsss_capability);
|
||||
OpenAPI_atsss_capability_t *OpenAPI_atsss_capability_parseFromJSON(cJSON *atsss_capabilityJSON);
|
||||
|
|
|
|||
|
|
@ -9,7 +9,8 @@ OpenAPI_auth_event_t *OpenAPI_auth_event_create(
|
|||
int success,
|
||||
char *time_stamp,
|
||||
OpenAPI_auth_type_e auth_type,
|
||||
char *serving_network_name
|
||||
char *serving_network_name,
|
||||
int auth_removal_ind
|
||||
)
|
||||
{
|
||||
OpenAPI_auth_event_t *auth_event_local_var = OpenAPI_malloc(sizeof(OpenAPI_auth_event_t));
|
||||
|
|
@ -21,6 +22,7 @@ OpenAPI_auth_event_t *OpenAPI_auth_event_create(
|
|||
auth_event_local_var->time_stamp = time_stamp;
|
||||
auth_event_local_var->auth_type = auth_type;
|
||||
auth_event_local_var->serving_network_name = serving_network_name;
|
||||
auth_event_local_var->auth_removal_ind = auth_removal_ind;
|
||||
|
||||
return auth_event_local_var;
|
||||
}
|
||||
|
|
@ -88,6 +90,13 @@ cJSON *OpenAPI_auth_event_convertToJSON(OpenAPI_auth_event_t *auth_event)
|
|||
goto end;
|
||||
}
|
||||
|
||||
if (auth_event->auth_removal_ind) {
|
||||
if (cJSON_AddBoolToObject(item, "authRemovalInd", auth_event->auth_removal_ind) == NULL) {
|
||||
ogs_error("OpenAPI_auth_event_convertToJSON() failed [auth_removal_ind]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
|
@ -157,12 +166,22 @@ OpenAPI_auth_event_t *OpenAPI_auth_event_parseFromJSON(cJSON *auth_eventJSON)
|
|||
goto end;
|
||||
}
|
||||
|
||||
cJSON *auth_removal_ind = cJSON_GetObjectItemCaseSensitive(auth_eventJSON, "authRemovalInd");
|
||||
|
||||
if (auth_removal_ind) {
|
||||
if (!cJSON_IsBool(auth_removal_ind)) {
|
||||
ogs_error("OpenAPI_auth_event_parseFromJSON() failed [auth_removal_ind]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
auth_event_local_var = OpenAPI_auth_event_create (
|
||||
ogs_strdup(nf_instance_id->valuestring),
|
||||
success->valueint,
|
||||
ogs_strdup(time_stamp->valuestring),
|
||||
auth_typeVariable,
|
||||
ogs_strdup(serving_network_name->valuestring)
|
||||
ogs_strdup(serving_network_name->valuestring),
|
||||
auth_removal_ind ? auth_removal_ind->valueint : 0
|
||||
);
|
||||
|
||||
return auth_event_local_var;
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ typedef struct OpenAPI_auth_event_s {
|
|||
char *time_stamp;
|
||||
OpenAPI_auth_type_e auth_type;
|
||||
char *serving_network_name;
|
||||
int auth_removal_ind;
|
||||
} OpenAPI_auth_event_t;
|
||||
|
||||
OpenAPI_auth_event_t *OpenAPI_auth_event_create(
|
||||
|
|
@ -32,7 +33,8 @@ OpenAPI_auth_event_t *OpenAPI_auth_event_create(
|
|||
int success,
|
||||
char *time_stamp,
|
||||
OpenAPI_auth_type_e auth_type,
|
||||
char *serving_network_name
|
||||
char *serving_network_name,
|
||||
int auth_removal_ind
|
||||
);
|
||||
void OpenAPI_auth_event_free(OpenAPI_auth_event_t *auth_event);
|
||||
OpenAPI_auth_event_t *OpenAPI_auth_event_parseFromJSON(cJSON *auth_eventJSON);
|
||||
|
|
|
|||
|
|
@ -9,7 +9,8 @@ OpenAPI_authentication_info_request_t *OpenAPI_authentication_info_request_creat
|
|||
char *serving_network_name,
|
||||
OpenAPI_resynchronization_info_t *resynchronization_info,
|
||||
char *ausf_instance_id,
|
||||
char *cag_id
|
||||
OpenAPI_list_t *cell_cag_info,
|
||||
int n5gc_ind
|
||||
)
|
||||
{
|
||||
OpenAPI_authentication_info_request_t *authentication_info_request_local_var = OpenAPI_malloc(sizeof(OpenAPI_authentication_info_request_t));
|
||||
|
|
@ -20,7 +21,8 @@ OpenAPI_authentication_info_request_t *OpenAPI_authentication_info_request_creat
|
|||
authentication_info_request_local_var->serving_network_name = serving_network_name;
|
||||
authentication_info_request_local_var->resynchronization_info = resynchronization_info;
|
||||
authentication_info_request_local_var->ausf_instance_id = ausf_instance_id;
|
||||
authentication_info_request_local_var->cag_id = cag_id;
|
||||
authentication_info_request_local_var->cell_cag_info = cell_cag_info;
|
||||
authentication_info_request_local_var->n5gc_ind = n5gc_ind;
|
||||
|
||||
return authentication_info_request_local_var;
|
||||
}
|
||||
|
|
@ -35,7 +37,10 @@ void OpenAPI_authentication_info_request_free(OpenAPI_authentication_info_reques
|
|||
ogs_free(authentication_info_request->serving_network_name);
|
||||
OpenAPI_resynchronization_info_free(authentication_info_request->resynchronization_info);
|
||||
ogs_free(authentication_info_request->ausf_instance_id);
|
||||
ogs_free(authentication_info_request->cag_id);
|
||||
OpenAPI_list_for_each(authentication_info_request->cell_cag_info, node) {
|
||||
ogs_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(authentication_info_request->cell_cag_info);
|
||||
ogs_free(authentication_info_request);
|
||||
}
|
||||
|
||||
|
|
@ -87,9 +92,25 @@ cJSON *OpenAPI_authentication_info_request_convertToJSON(OpenAPI_authentication_
|
|||
goto end;
|
||||
}
|
||||
|
||||
if (authentication_info_request->cag_id) {
|
||||
if (cJSON_AddStringToObject(item, "cagId", authentication_info_request->cag_id) == NULL) {
|
||||
ogs_error("OpenAPI_authentication_info_request_convertToJSON() failed [cag_id]");
|
||||
if (authentication_info_request->cell_cag_info) {
|
||||
cJSON *cell_cag_info = cJSON_AddArrayToObject(item, "cellCagInfo");
|
||||
if (cell_cag_info == NULL) {
|
||||
ogs_error("OpenAPI_authentication_info_request_convertToJSON() failed [cell_cag_info]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
OpenAPI_lnode_t *cell_cag_info_node;
|
||||
OpenAPI_list_for_each(authentication_info_request->cell_cag_info, cell_cag_info_node) {
|
||||
if (cJSON_AddStringToObject(cell_cag_info, "", (char*)cell_cag_info_node->data) == NULL) {
|
||||
ogs_error("OpenAPI_authentication_info_request_convertToJSON() failed [cell_cag_info]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (authentication_info_request->n5gc_ind) {
|
||||
if (cJSON_AddBoolToObject(item, "n5gcInd", authentication_info_request->n5gc_ind) == NULL) {
|
||||
ogs_error("OpenAPI_authentication_info_request_convertToJSON() failed [n5gc_ind]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
|
@ -141,11 +162,31 @@ OpenAPI_authentication_info_request_t *OpenAPI_authentication_info_request_parse
|
|||
goto end;
|
||||
}
|
||||
|
||||
cJSON *cag_id = cJSON_GetObjectItemCaseSensitive(authentication_info_requestJSON, "cagId");
|
||||
cJSON *cell_cag_info = cJSON_GetObjectItemCaseSensitive(authentication_info_requestJSON, "cellCagInfo");
|
||||
|
||||
if (cag_id) {
|
||||
if (!cJSON_IsString(cag_id)) {
|
||||
ogs_error("OpenAPI_authentication_info_request_parseFromJSON() failed [cag_id]");
|
||||
OpenAPI_list_t *cell_cag_infoList;
|
||||
if (cell_cag_info) {
|
||||
cJSON *cell_cag_info_local;
|
||||
if (!cJSON_IsArray(cell_cag_info)) {
|
||||
ogs_error("OpenAPI_authentication_info_request_parseFromJSON() failed [cell_cag_info]");
|
||||
goto end;
|
||||
}
|
||||
cell_cag_infoList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(cell_cag_info_local, cell_cag_info) {
|
||||
if (!cJSON_IsString(cell_cag_info_local)) {
|
||||
ogs_error("OpenAPI_authentication_info_request_parseFromJSON() failed [cell_cag_info]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_add(cell_cag_infoList, ogs_strdup(cell_cag_info_local->valuestring));
|
||||
}
|
||||
}
|
||||
|
||||
cJSON *n5gc_ind = cJSON_GetObjectItemCaseSensitive(authentication_info_requestJSON, "n5gcInd");
|
||||
|
||||
if (n5gc_ind) {
|
||||
if (!cJSON_IsBool(n5gc_ind)) {
|
||||
ogs_error("OpenAPI_authentication_info_request_parseFromJSON() failed [n5gc_ind]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
|
@ -155,7 +196,8 @@ OpenAPI_authentication_info_request_t *OpenAPI_authentication_info_request_parse
|
|||
ogs_strdup(serving_network_name->valuestring),
|
||||
resynchronization_info ? resynchronization_info_local_nonprim : NULL,
|
||||
ogs_strdup(ausf_instance_id->valuestring),
|
||||
cag_id ? ogs_strdup(cag_id->valuestring) : NULL
|
||||
cell_cag_info ? cell_cag_infoList : NULL,
|
||||
n5gc_ind ? n5gc_ind->valueint : 0
|
||||
);
|
||||
|
||||
return authentication_info_request_local_var;
|
||||
|
|
|
|||
|
|
@ -24,7 +24,8 @@ typedef struct OpenAPI_authentication_info_request_s {
|
|||
char *serving_network_name;
|
||||
struct OpenAPI_resynchronization_info_s *resynchronization_info;
|
||||
char *ausf_instance_id;
|
||||
char *cag_id;
|
||||
OpenAPI_list_t *cell_cag_info;
|
||||
int n5gc_ind;
|
||||
} OpenAPI_authentication_info_request_t;
|
||||
|
||||
OpenAPI_authentication_info_request_t *OpenAPI_authentication_info_request_create(
|
||||
|
|
@ -32,7 +33,8 @@ OpenAPI_authentication_info_request_t *OpenAPI_authentication_info_request_creat
|
|||
char *serving_network_name,
|
||||
OpenAPI_resynchronization_info_t *resynchronization_info,
|
||||
char *ausf_instance_id,
|
||||
char *cag_id
|
||||
OpenAPI_list_t *cell_cag_info,
|
||||
int n5gc_ind
|
||||
);
|
||||
void OpenAPI_authentication_info_request_free(OpenAPI_authentication_info_request_t *authentication_info_request);
|
||||
OpenAPI_authentication_info_request_t *OpenAPI_authentication_info_request_parseFromJSON(cJSON *authentication_info_requestJSON);
|
||||
|
|
|
|||
|
|
@ -13,7 +13,10 @@ OpenAPI_authentication_subscription_t *OpenAPI_authentication_subscription_creat
|
|||
char *algorithm_id,
|
||||
char *enc_opc_key,
|
||||
char *enc_topc_key,
|
||||
int vector_generation_in_hss
|
||||
int vector_generation_in_hss,
|
||||
OpenAPI_auth_method_e n5gc_auth_method,
|
||||
int rg_authentication_ind,
|
||||
char *supi
|
||||
)
|
||||
{
|
||||
OpenAPI_authentication_subscription_t *authentication_subscription_local_var = OpenAPI_malloc(sizeof(OpenAPI_authentication_subscription_t));
|
||||
|
|
@ -29,6 +32,9 @@ OpenAPI_authentication_subscription_t *OpenAPI_authentication_subscription_creat
|
|||
authentication_subscription_local_var->enc_opc_key = enc_opc_key;
|
||||
authentication_subscription_local_var->enc_topc_key = enc_topc_key;
|
||||
authentication_subscription_local_var->vector_generation_in_hss = vector_generation_in_hss;
|
||||
authentication_subscription_local_var->n5gc_auth_method = n5gc_auth_method;
|
||||
authentication_subscription_local_var->rg_authentication_ind = rg_authentication_ind;
|
||||
authentication_subscription_local_var->supi = supi;
|
||||
|
||||
return authentication_subscription_local_var;
|
||||
}
|
||||
|
|
@ -46,6 +52,7 @@ void OpenAPI_authentication_subscription_free(OpenAPI_authentication_subscriptio
|
|||
ogs_free(authentication_subscription->algorithm_id);
|
||||
ogs_free(authentication_subscription->enc_opc_key);
|
||||
ogs_free(authentication_subscription->enc_topc_key);
|
||||
ogs_free(authentication_subscription->supi);
|
||||
ogs_free(authentication_subscription);
|
||||
}
|
||||
|
||||
|
|
@ -130,6 +137,27 @@ cJSON *OpenAPI_authentication_subscription_convertToJSON(OpenAPI_authentication_
|
|||
}
|
||||
}
|
||||
|
||||
if (authentication_subscription->n5gc_auth_method) {
|
||||
if (cJSON_AddStringToObject(item, "n5gcAuthMethod", OpenAPI_auth_method_ToString(authentication_subscription->n5gc_auth_method)) == NULL) {
|
||||
ogs_error("OpenAPI_authentication_subscription_convertToJSON() failed [n5gc_auth_method]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (authentication_subscription->rg_authentication_ind) {
|
||||
if (cJSON_AddBoolToObject(item, "rgAuthenticationInd", authentication_subscription->rg_authentication_ind) == NULL) {
|
||||
ogs_error("OpenAPI_authentication_subscription_convertToJSON() failed [rg_authentication_ind]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (authentication_subscription->supi) {
|
||||
if (cJSON_AddStringToObject(item, "supi", authentication_subscription->supi) == NULL) {
|
||||
ogs_error("OpenAPI_authentication_subscription_convertToJSON() failed [supi]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
|
@ -221,6 +249,35 @@ OpenAPI_authentication_subscription_t *OpenAPI_authentication_subscription_parse
|
|||
}
|
||||
}
|
||||
|
||||
cJSON *n5gc_auth_method = cJSON_GetObjectItemCaseSensitive(authentication_subscriptionJSON, "n5gcAuthMethod");
|
||||
|
||||
OpenAPI_auth_method_e n5gc_auth_methodVariable;
|
||||
if (n5gc_auth_method) {
|
||||
if (!cJSON_IsString(n5gc_auth_method)) {
|
||||
ogs_error("OpenAPI_authentication_subscription_parseFromJSON() failed [n5gc_auth_method]");
|
||||
goto end;
|
||||
}
|
||||
n5gc_auth_methodVariable = OpenAPI_auth_method_FromString(n5gc_auth_method->valuestring);
|
||||
}
|
||||
|
||||
cJSON *rg_authentication_ind = cJSON_GetObjectItemCaseSensitive(authentication_subscriptionJSON, "rgAuthenticationInd");
|
||||
|
||||
if (rg_authentication_ind) {
|
||||
if (!cJSON_IsBool(rg_authentication_ind)) {
|
||||
ogs_error("OpenAPI_authentication_subscription_parseFromJSON() failed [rg_authentication_ind]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
cJSON *supi = cJSON_GetObjectItemCaseSensitive(authentication_subscriptionJSON, "supi");
|
||||
|
||||
if (supi) {
|
||||
if (!cJSON_IsString(supi)) {
|
||||
ogs_error("OpenAPI_authentication_subscription_parseFromJSON() failed [supi]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
authentication_subscription_local_var = OpenAPI_authentication_subscription_create (
|
||||
authentication_methodVariable,
|
||||
enc_permanent_key ? ogs_strdup(enc_permanent_key->valuestring) : NULL,
|
||||
|
|
@ -230,7 +287,10 @@ OpenAPI_authentication_subscription_t *OpenAPI_authentication_subscription_parse
|
|||
algorithm_id ? ogs_strdup(algorithm_id->valuestring) : NULL,
|
||||
enc_opc_key ? ogs_strdup(enc_opc_key->valuestring) : NULL,
|
||||
enc_topc_key ? ogs_strdup(enc_topc_key->valuestring) : NULL,
|
||||
vector_generation_in_hss ? vector_generation_in_hss->valueint : 0
|
||||
vector_generation_in_hss ? vector_generation_in_hss->valueint : 0,
|
||||
n5gc_auth_method ? n5gc_auth_methodVariable : 0,
|
||||
rg_authentication_ind ? rg_authentication_ind->valueint : 0,
|
||||
supi ? ogs_strdup(supi->valuestring) : NULL
|
||||
);
|
||||
|
||||
return authentication_subscription_local_var;
|
||||
|
|
|
|||
|
|
@ -30,6 +30,9 @@ typedef struct OpenAPI_authentication_subscription_s {
|
|||
char *enc_opc_key;
|
||||
char *enc_topc_key;
|
||||
int vector_generation_in_hss;
|
||||
OpenAPI_auth_method_e n5gc_auth_method;
|
||||
int rg_authentication_ind;
|
||||
char *supi;
|
||||
} OpenAPI_authentication_subscription_t;
|
||||
|
||||
OpenAPI_authentication_subscription_t *OpenAPI_authentication_subscription_create(
|
||||
|
|
@ -41,7 +44,10 @@ OpenAPI_authentication_subscription_t *OpenAPI_authentication_subscription_creat
|
|||
char *algorithm_id,
|
||||
char *enc_opc_key,
|
||||
char *enc_topc_key,
|
||||
int vector_generation_in_hss
|
||||
int vector_generation_in_hss,
|
||||
OpenAPI_auth_method_e n5gc_auth_method,
|
||||
int rg_authentication_ind,
|
||||
char *supi
|
||||
);
|
||||
void OpenAPI_authentication_subscription_free(OpenAPI_authentication_subscription_t *authentication_subscription);
|
||||
OpenAPI_authentication_subscription_t *OpenAPI_authentication_subscription_parseFromJSON(cJSON *authentication_subscriptionJSON);
|
||||
|
|
|
|||
472
lib/sbi/openapi/model/authorized_network_slice_info.c
Normal file
472
lib/sbi/openapi/model/authorized_network_slice_info.c
Normal file
|
|
@ -0,0 +1,472 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include "authorized_network_slice_info.h"
|
||||
|
||||
OpenAPI_authorized_network_slice_info_t *OpenAPI_authorized_network_slice_info_create(
|
||||
OpenAPI_list_t *allowed_nssai_list,
|
||||
OpenAPI_list_t *configured_nssai,
|
||||
char *target_amf_set,
|
||||
OpenAPI_list_t *candidate_amf_list,
|
||||
OpenAPI_list_t *rejected_nssai_in_plmn,
|
||||
OpenAPI_list_t *rejected_nssai_in_ta,
|
||||
OpenAPI_nsi_information_t *nsi_information,
|
||||
char *supported_features,
|
||||
char *nrf_amf_set,
|
||||
char *nrf_amf_set_nf_mgt_uri,
|
||||
char *nrf_amf_set_access_token_uri,
|
||||
char *target_amf_service_set
|
||||
)
|
||||
{
|
||||
OpenAPI_authorized_network_slice_info_t *authorized_network_slice_info_local_var = OpenAPI_malloc(sizeof(OpenAPI_authorized_network_slice_info_t));
|
||||
if (!authorized_network_slice_info_local_var) {
|
||||
return NULL;
|
||||
}
|
||||
authorized_network_slice_info_local_var->allowed_nssai_list = allowed_nssai_list;
|
||||
authorized_network_slice_info_local_var->configured_nssai = configured_nssai;
|
||||
authorized_network_slice_info_local_var->target_amf_set = target_amf_set;
|
||||
authorized_network_slice_info_local_var->candidate_amf_list = candidate_amf_list;
|
||||
authorized_network_slice_info_local_var->rejected_nssai_in_plmn = rejected_nssai_in_plmn;
|
||||
authorized_network_slice_info_local_var->rejected_nssai_in_ta = rejected_nssai_in_ta;
|
||||
authorized_network_slice_info_local_var->nsi_information = nsi_information;
|
||||
authorized_network_slice_info_local_var->supported_features = supported_features;
|
||||
authorized_network_slice_info_local_var->nrf_amf_set = nrf_amf_set;
|
||||
authorized_network_slice_info_local_var->nrf_amf_set_nf_mgt_uri = nrf_amf_set_nf_mgt_uri;
|
||||
authorized_network_slice_info_local_var->nrf_amf_set_access_token_uri = nrf_amf_set_access_token_uri;
|
||||
authorized_network_slice_info_local_var->target_amf_service_set = target_amf_service_set;
|
||||
|
||||
return authorized_network_slice_info_local_var;
|
||||
}
|
||||
|
||||
void OpenAPI_authorized_network_slice_info_free(OpenAPI_authorized_network_slice_info_t *authorized_network_slice_info)
|
||||
{
|
||||
if (NULL == authorized_network_slice_info) {
|
||||
return;
|
||||
}
|
||||
OpenAPI_lnode_t *node;
|
||||
OpenAPI_list_for_each(authorized_network_slice_info->allowed_nssai_list, node) {
|
||||
OpenAPI_allowed_nssai_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(authorized_network_slice_info->allowed_nssai_list);
|
||||
OpenAPI_list_for_each(authorized_network_slice_info->configured_nssai, node) {
|
||||
OpenAPI_configured_snssai_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(authorized_network_slice_info->configured_nssai);
|
||||
ogs_free(authorized_network_slice_info->target_amf_set);
|
||||
OpenAPI_list_for_each(authorized_network_slice_info->candidate_amf_list, node) {
|
||||
ogs_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(authorized_network_slice_info->candidate_amf_list);
|
||||
OpenAPI_list_for_each(authorized_network_slice_info->rejected_nssai_in_plmn, node) {
|
||||
OpenAPI_snssai_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(authorized_network_slice_info->rejected_nssai_in_plmn);
|
||||
OpenAPI_list_for_each(authorized_network_slice_info->rejected_nssai_in_ta, node) {
|
||||
OpenAPI_snssai_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(authorized_network_slice_info->rejected_nssai_in_ta);
|
||||
OpenAPI_nsi_information_free(authorized_network_slice_info->nsi_information);
|
||||
ogs_free(authorized_network_slice_info->supported_features);
|
||||
ogs_free(authorized_network_slice_info->nrf_amf_set);
|
||||
ogs_free(authorized_network_slice_info->nrf_amf_set_nf_mgt_uri);
|
||||
ogs_free(authorized_network_slice_info->nrf_amf_set_access_token_uri);
|
||||
ogs_free(authorized_network_slice_info->target_amf_service_set);
|
||||
ogs_free(authorized_network_slice_info);
|
||||
}
|
||||
|
||||
cJSON *OpenAPI_authorized_network_slice_info_convertToJSON(OpenAPI_authorized_network_slice_info_t *authorized_network_slice_info)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
|
||||
if (authorized_network_slice_info == NULL) {
|
||||
ogs_error("OpenAPI_authorized_network_slice_info_convertToJSON() failed [AuthorizedNetworkSliceInfo]");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
item = cJSON_CreateObject();
|
||||
if (authorized_network_slice_info->allowed_nssai_list) {
|
||||
cJSON *allowed_nssai_listList = cJSON_AddArrayToObject(item, "allowedNssaiList");
|
||||
if (allowed_nssai_listList == NULL) {
|
||||
ogs_error("OpenAPI_authorized_network_slice_info_convertToJSON() failed [allowed_nssai_list]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
OpenAPI_lnode_t *allowed_nssai_list_node;
|
||||
if (authorized_network_slice_info->allowed_nssai_list) {
|
||||
OpenAPI_list_for_each(authorized_network_slice_info->allowed_nssai_list, allowed_nssai_list_node) {
|
||||
cJSON *itemLocal = OpenAPI_allowed_nssai_convertToJSON(allowed_nssai_list_node->data);
|
||||
if (itemLocal == NULL) {
|
||||
ogs_error("OpenAPI_authorized_network_slice_info_convertToJSON() failed [allowed_nssai_list]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToArray(allowed_nssai_listList, itemLocal);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (authorized_network_slice_info->configured_nssai) {
|
||||
cJSON *configured_nssaiList = cJSON_AddArrayToObject(item, "configuredNssai");
|
||||
if (configured_nssaiList == NULL) {
|
||||
ogs_error("OpenAPI_authorized_network_slice_info_convertToJSON() failed [configured_nssai]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
OpenAPI_lnode_t *configured_nssai_node;
|
||||
if (authorized_network_slice_info->configured_nssai) {
|
||||
OpenAPI_list_for_each(authorized_network_slice_info->configured_nssai, configured_nssai_node) {
|
||||
cJSON *itemLocal = OpenAPI_configured_snssai_convertToJSON(configured_nssai_node->data);
|
||||
if (itemLocal == NULL) {
|
||||
ogs_error("OpenAPI_authorized_network_slice_info_convertToJSON() failed [configured_nssai]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToArray(configured_nssaiList, itemLocal);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (authorized_network_slice_info->target_amf_set) {
|
||||
if (cJSON_AddStringToObject(item, "targetAmfSet", authorized_network_slice_info->target_amf_set) == NULL) {
|
||||
ogs_error("OpenAPI_authorized_network_slice_info_convertToJSON() failed [target_amf_set]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (authorized_network_slice_info->candidate_amf_list) {
|
||||
cJSON *candidate_amf_list = cJSON_AddArrayToObject(item, "candidateAmfList");
|
||||
if (candidate_amf_list == NULL) {
|
||||
ogs_error("OpenAPI_authorized_network_slice_info_convertToJSON() failed [candidate_amf_list]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
OpenAPI_lnode_t *candidate_amf_list_node;
|
||||
OpenAPI_list_for_each(authorized_network_slice_info->candidate_amf_list, candidate_amf_list_node) {
|
||||
if (cJSON_AddStringToObject(candidate_amf_list, "", (char*)candidate_amf_list_node->data) == NULL) {
|
||||
ogs_error("OpenAPI_authorized_network_slice_info_convertToJSON() failed [candidate_amf_list]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (authorized_network_slice_info->rejected_nssai_in_plmn) {
|
||||
cJSON *rejected_nssai_in_plmnList = cJSON_AddArrayToObject(item, "rejectedNssaiInPlmn");
|
||||
if (rejected_nssai_in_plmnList == NULL) {
|
||||
ogs_error("OpenAPI_authorized_network_slice_info_convertToJSON() failed [rejected_nssai_in_plmn]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
OpenAPI_lnode_t *rejected_nssai_in_plmn_node;
|
||||
if (authorized_network_slice_info->rejected_nssai_in_plmn) {
|
||||
OpenAPI_list_for_each(authorized_network_slice_info->rejected_nssai_in_plmn, rejected_nssai_in_plmn_node) {
|
||||
cJSON *itemLocal = OpenAPI_snssai_convertToJSON(rejected_nssai_in_plmn_node->data);
|
||||
if (itemLocal == NULL) {
|
||||
ogs_error("OpenAPI_authorized_network_slice_info_convertToJSON() failed [rejected_nssai_in_plmn]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToArray(rejected_nssai_in_plmnList, itemLocal);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (authorized_network_slice_info->rejected_nssai_in_ta) {
|
||||
cJSON *rejected_nssai_in_taList = cJSON_AddArrayToObject(item, "rejectedNssaiInTa");
|
||||
if (rejected_nssai_in_taList == NULL) {
|
||||
ogs_error("OpenAPI_authorized_network_slice_info_convertToJSON() failed [rejected_nssai_in_ta]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
OpenAPI_lnode_t *rejected_nssai_in_ta_node;
|
||||
if (authorized_network_slice_info->rejected_nssai_in_ta) {
|
||||
OpenAPI_list_for_each(authorized_network_slice_info->rejected_nssai_in_ta, rejected_nssai_in_ta_node) {
|
||||
cJSON *itemLocal = OpenAPI_snssai_convertToJSON(rejected_nssai_in_ta_node->data);
|
||||
if (itemLocal == NULL) {
|
||||
ogs_error("OpenAPI_authorized_network_slice_info_convertToJSON() failed [rejected_nssai_in_ta]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToArray(rejected_nssai_in_taList, itemLocal);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (authorized_network_slice_info->nsi_information) {
|
||||
cJSON *nsi_information_local_JSON = OpenAPI_nsi_information_convertToJSON(authorized_network_slice_info->nsi_information);
|
||||
if (nsi_information_local_JSON == NULL) {
|
||||
ogs_error("OpenAPI_authorized_network_slice_info_convertToJSON() failed [nsi_information]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToObject(item, "nsiInformation", nsi_information_local_JSON);
|
||||
if (item->child == NULL) {
|
||||
ogs_error("OpenAPI_authorized_network_slice_info_convertToJSON() failed [nsi_information]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (authorized_network_slice_info->supported_features) {
|
||||
if (cJSON_AddStringToObject(item, "supportedFeatures", authorized_network_slice_info->supported_features) == NULL) {
|
||||
ogs_error("OpenAPI_authorized_network_slice_info_convertToJSON() failed [supported_features]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (authorized_network_slice_info->nrf_amf_set) {
|
||||
if (cJSON_AddStringToObject(item, "nrfAmfSet", authorized_network_slice_info->nrf_amf_set) == NULL) {
|
||||
ogs_error("OpenAPI_authorized_network_slice_info_convertToJSON() failed [nrf_amf_set]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (authorized_network_slice_info->nrf_amf_set_nf_mgt_uri) {
|
||||
if (cJSON_AddStringToObject(item, "nrfAmfSetNfMgtUri", authorized_network_slice_info->nrf_amf_set_nf_mgt_uri) == NULL) {
|
||||
ogs_error("OpenAPI_authorized_network_slice_info_convertToJSON() failed [nrf_amf_set_nf_mgt_uri]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (authorized_network_slice_info->nrf_amf_set_access_token_uri) {
|
||||
if (cJSON_AddStringToObject(item, "nrfAmfSetAccessTokenUri", authorized_network_slice_info->nrf_amf_set_access_token_uri) == NULL) {
|
||||
ogs_error("OpenAPI_authorized_network_slice_info_convertToJSON() failed [nrf_amf_set_access_token_uri]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (authorized_network_slice_info->target_amf_service_set) {
|
||||
if (cJSON_AddStringToObject(item, "targetAmfServiceSet", authorized_network_slice_info->target_amf_service_set) == NULL) {
|
||||
ogs_error("OpenAPI_authorized_network_slice_info_convertToJSON() failed [target_amf_service_set]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
||||
OpenAPI_authorized_network_slice_info_t *OpenAPI_authorized_network_slice_info_parseFromJSON(cJSON *authorized_network_slice_infoJSON)
|
||||
{
|
||||
OpenAPI_authorized_network_slice_info_t *authorized_network_slice_info_local_var = NULL;
|
||||
cJSON *allowed_nssai_list = cJSON_GetObjectItemCaseSensitive(authorized_network_slice_infoJSON, "allowedNssaiList");
|
||||
|
||||
OpenAPI_list_t *allowed_nssai_listList;
|
||||
if (allowed_nssai_list) {
|
||||
cJSON *allowed_nssai_list_local_nonprimitive;
|
||||
if (!cJSON_IsArray(allowed_nssai_list)) {
|
||||
ogs_error("OpenAPI_authorized_network_slice_info_parseFromJSON() failed [allowed_nssai_list]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
allowed_nssai_listList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(allowed_nssai_list_local_nonprimitive, allowed_nssai_list ) {
|
||||
if (!cJSON_IsObject(allowed_nssai_list_local_nonprimitive)) {
|
||||
ogs_error("OpenAPI_authorized_network_slice_info_parseFromJSON() failed [allowed_nssai_list]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_allowed_nssai_t *allowed_nssai_listItem = OpenAPI_allowed_nssai_parseFromJSON(allowed_nssai_list_local_nonprimitive);
|
||||
|
||||
OpenAPI_list_add(allowed_nssai_listList, allowed_nssai_listItem);
|
||||
}
|
||||
}
|
||||
|
||||
cJSON *configured_nssai = cJSON_GetObjectItemCaseSensitive(authorized_network_slice_infoJSON, "configuredNssai");
|
||||
|
||||
OpenAPI_list_t *configured_nssaiList;
|
||||
if (configured_nssai) {
|
||||
cJSON *configured_nssai_local_nonprimitive;
|
||||
if (!cJSON_IsArray(configured_nssai)) {
|
||||
ogs_error("OpenAPI_authorized_network_slice_info_parseFromJSON() failed [configured_nssai]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
configured_nssaiList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(configured_nssai_local_nonprimitive, configured_nssai ) {
|
||||
if (!cJSON_IsObject(configured_nssai_local_nonprimitive)) {
|
||||
ogs_error("OpenAPI_authorized_network_slice_info_parseFromJSON() failed [configured_nssai]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_configured_snssai_t *configured_nssaiItem = OpenAPI_configured_snssai_parseFromJSON(configured_nssai_local_nonprimitive);
|
||||
|
||||
OpenAPI_list_add(configured_nssaiList, configured_nssaiItem);
|
||||
}
|
||||
}
|
||||
|
||||
cJSON *target_amf_set = cJSON_GetObjectItemCaseSensitive(authorized_network_slice_infoJSON, "targetAmfSet");
|
||||
|
||||
if (target_amf_set) {
|
||||
if (!cJSON_IsString(target_amf_set)) {
|
||||
ogs_error("OpenAPI_authorized_network_slice_info_parseFromJSON() failed [target_amf_set]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
cJSON *candidate_amf_list = cJSON_GetObjectItemCaseSensitive(authorized_network_slice_infoJSON, "candidateAmfList");
|
||||
|
||||
OpenAPI_list_t *candidate_amf_listList;
|
||||
if (candidate_amf_list) {
|
||||
cJSON *candidate_amf_list_local;
|
||||
if (!cJSON_IsArray(candidate_amf_list)) {
|
||||
ogs_error("OpenAPI_authorized_network_slice_info_parseFromJSON() failed [candidate_amf_list]");
|
||||
goto end;
|
||||
}
|
||||
candidate_amf_listList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(candidate_amf_list_local, candidate_amf_list) {
|
||||
if (!cJSON_IsString(candidate_amf_list_local)) {
|
||||
ogs_error("OpenAPI_authorized_network_slice_info_parseFromJSON() failed [candidate_amf_list]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_add(candidate_amf_listList, ogs_strdup(candidate_amf_list_local->valuestring));
|
||||
}
|
||||
}
|
||||
|
||||
cJSON *rejected_nssai_in_plmn = cJSON_GetObjectItemCaseSensitive(authorized_network_slice_infoJSON, "rejectedNssaiInPlmn");
|
||||
|
||||
OpenAPI_list_t *rejected_nssai_in_plmnList;
|
||||
if (rejected_nssai_in_plmn) {
|
||||
cJSON *rejected_nssai_in_plmn_local_nonprimitive;
|
||||
if (!cJSON_IsArray(rejected_nssai_in_plmn)) {
|
||||
ogs_error("OpenAPI_authorized_network_slice_info_parseFromJSON() failed [rejected_nssai_in_plmn]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
rejected_nssai_in_plmnList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(rejected_nssai_in_plmn_local_nonprimitive, rejected_nssai_in_plmn ) {
|
||||
if (!cJSON_IsObject(rejected_nssai_in_plmn_local_nonprimitive)) {
|
||||
ogs_error("OpenAPI_authorized_network_slice_info_parseFromJSON() failed [rejected_nssai_in_plmn]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_snssai_t *rejected_nssai_in_plmnItem = OpenAPI_snssai_parseFromJSON(rejected_nssai_in_plmn_local_nonprimitive);
|
||||
|
||||
OpenAPI_list_add(rejected_nssai_in_plmnList, rejected_nssai_in_plmnItem);
|
||||
}
|
||||
}
|
||||
|
||||
cJSON *rejected_nssai_in_ta = cJSON_GetObjectItemCaseSensitive(authorized_network_slice_infoJSON, "rejectedNssaiInTa");
|
||||
|
||||
OpenAPI_list_t *rejected_nssai_in_taList;
|
||||
if (rejected_nssai_in_ta) {
|
||||
cJSON *rejected_nssai_in_ta_local_nonprimitive;
|
||||
if (!cJSON_IsArray(rejected_nssai_in_ta)) {
|
||||
ogs_error("OpenAPI_authorized_network_slice_info_parseFromJSON() failed [rejected_nssai_in_ta]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
rejected_nssai_in_taList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(rejected_nssai_in_ta_local_nonprimitive, rejected_nssai_in_ta ) {
|
||||
if (!cJSON_IsObject(rejected_nssai_in_ta_local_nonprimitive)) {
|
||||
ogs_error("OpenAPI_authorized_network_slice_info_parseFromJSON() failed [rejected_nssai_in_ta]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_snssai_t *rejected_nssai_in_taItem = OpenAPI_snssai_parseFromJSON(rejected_nssai_in_ta_local_nonprimitive);
|
||||
|
||||
OpenAPI_list_add(rejected_nssai_in_taList, rejected_nssai_in_taItem);
|
||||
}
|
||||
}
|
||||
|
||||
cJSON *nsi_information = cJSON_GetObjectItemCaseSensitive(authorized_network_slice_infoJSON, "nsiInformation");
|
||||
|
||||
OpenAPI_nsi_information_t *nsi_information_local_nonprim = NULL;
|
||||
if (nsi_information) {
|
||||
nsi_information_local_nonprim = OpenAPI_nsi_information_parseFromJSON(nsi_information);
|
||||
}
|
||||
|
||||
cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(authorized_network_slice_infoJSON, "supportedFeatures");
|
||||
|
||||
if (supported_features) {
|
||||
if (!cJSON_IsString(supported_features)) {
|
||||
ogs_error("OpenAPI_authorized_network_slice_info_parseFromJSON() failed [supported_features]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
cJSON *nrf_amf_set = cJSON_GetObjectItemCaseSensitive(authorized_network_slice_infoJSON, "nrfAmfSet");
|
||||
|
||||
if (nrf_amf_set) {
|
||||
if (!cJSON_IsString(nrf_amf_set)) {
|
||||
ogs_error("OpenAPI_authorized_network_slice_info_parseFromJSON() failed [nrf_amf_set]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
cJSON *nrf_amf_set_nf_mgt_uri = cJSON_GetObjectItemCaseSensitive(authorized_network_slice_infoJSON, "nrfAmfSetNfMgtUri");
|
||||
|
||||
if (nrf_amf_set_nf_mgt_uri) {
|
||||
if (!cJSON_IsString(nrf_amf_set_nf_mgt_uri)) {
|
||||
ogs_error("OpenAPI_authorized_network_slice_info_parseFromJSON() failed [nrf_amf_set_nf_mgt_uri]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
cJSON *nrf_amf_set_access_token_uri = cJSON_GetObjectItemCaseSensitive(authorized_network_slice_infoJSON, "nrfAmfSetAccessTokenUri");
|
||||
|
||||
if (nrf_amf_set_access_token_uri) {
|
||||
if (!cJSON_IsString(nrf_amf_set_access_token_uri)) {
|
||||
ogs_error("OpenAPI_authorized_network_slice_info_parseFromJSON() failed [nrf_amf_set_access_token_uri]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
cJSON *target_amf_service_set = cJSON_GetObjectItemCaseSensitive(authorized_network_slice_infoJSON, "targetAmfServiceSet");
|
||||
|
||||
if (target_amf_service_set) {
|
||||
if (!cJSON_IsString(target_amf_service_set)) {
|
||||
ogs_error("OpenAPI_authorized_network_slice_info_parseFromJSON() failed [target_amf_service_set]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
authorized_network_slice_info_local_var = OpenAPI_authorized_network_slice_info_create (
|
||||
allowed_nssai_list ? allowed_nssai_listList : NULL,
|
||||
configured_nssai ? configured_nssaiList : NULL,
|
||||
target_amf_set ? ogs_strdup(target_amf_set->valuestring) : NULL,
|
||||
candidate_amf_list ? candidate_amf_listList : NULL,
|
||||
rejected_nssai_in_plmn ? rejected_nssai_in_plmnList : NULL,
|
||||
rejected_nssai_in_ta ? rejected_nssai_in_taList : NULL,
|
||||
nsi_information ? nsi_information_local_nonprim : NULL,
|
||||
supported_features ? ogs_strdup(supported_features->valuestring) : NULL,
|
||||
nrf_amf_set ? ogs_strdup(nrf_amf_set->valuestring) : NULL,
|
||||
nrf_amf_set_nf_mgt_uri ? ogs_strdup(nrf_amf_set_nf_mgt_uri->valuestring) : NULL,
|
||||
nrf_amf_set_access_token_uri ? ogs_strdup(nrf_amf_set_access_token_uri->valuestring) : NULL,
|
||||
target_amf_service_set ? ogs_strdup(target_amf_service_set->valuestring) : NULL
|
||||
);
|
||||
|
||||
return authorized_network_slice_info_local_var;
|
||||
end:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
OpenAPI_authorized_network_slice_info_t *OpenAPI_authorized_network_slice_info_copy(OpenAPI_authorized_network_slice_info_t *dst, OpenAPI_authorized_network_slice_info_t *src)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
char *content = NULL;
|
||||
|
||||
ogs_assert(src);
|
||||
item = OpenAPI_authorized_network_slice_info_convertToJSON(src);
|
||||
if (!item) {
|
||||
ogs_error("OpenAPI_authorized_network_slice_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_authorized_network_slice_info_free(dst);
|
||||
dst = OpenAPI_authorized_network_slice_info_parseFromJSON(item);
|
||||
cJSON_Delete(item);
|
||||
|
||||
return dst;
|
||||
}
|
||||
|
||||
64
lib/sbi/openapi/model/authorized_network_slice_info.h
Normal file
64
lib/sbi/openapi/model/authorized_network_slice_info.h
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
/*
|
||||
* authorized_network_slice_info.h
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _OpenAPI_authorized_network_slice_info_H_
|
||||
#define _OpenAPI_authorized_network_slice_info_H_
|
||||
|
||||
#include <string.h>
|
||||
#include "../external/cJSON.h"
|
||||
#include "../include/list.h"
|
||||
#include "../include/keyValuePair.h"
|
||||
#include "../include/binary.h"
|
||||
#include "allowed_nssai.h"
|
||||
#include "configured_snssai.h"
|
||||
#include "nsi_information.h"
|
||||
#include "snssai.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct OpenAPI_authorized_network_slice_info_s OpenAPI_authorized_network_slice_info_t;
|
||||
typedef struct OpenAPI_authorized_network_slice_info_s {
|
||||
OpenAPI_list_t *allowed_nssai_list;
|
||||
OpenAPI_list_t *configured_nssai;
|
||||
char *target_amf_set;
|
||||
OpenAPI_list_t *candidate_amf_list;
|
||||
OpenAPI_list_t *rejected_nssai_in_plmn;
|
||||
OpenAPI_list_t *rejected_nssai_in_ta;
|
||||
struct OpenAPI_nsi_information_s *nsi_information;
|
||||
char *supported_features;
|
||||
char *nrf_amf_set;
|
||||
char *nrf_amf_set_nf_mgt_uri;
|
||||
char *nrf_amf_set_access_token_uri;
|
||||
char *target_amf_service_set;
|
||||
} OpenAPI_authorized_network_slice_info_t;
|
||||
|
||||
OpenAPI_authorized_network_slice_info_t *OpenAPI_authorized_network_slice_info_create(
|
||||
OpenAPI_list_t *allowed_nssai_list,
|
||||
OpenAPI_list_t *configured_nssai,
|
||||
char *target_amf_set,
|
||||
OpenAPI_list_t *candidate_amf_list,
|
||||
OpenAPI_list_t *rejected_nssai_in_plmn,
|
||||
OpenAPI_list_t *rejected_nssai_in_ta,
|
||||
OpenAPI_nsi_information_t *nsi_information,
|
||||
char *supported_features,
|
||||
char *nrf_amf_set,
|
||||
char *nrf_amf_set_nf_mgt_uri,
|
||||
char *nrf_amf_set_access_token_uri,
|
||||
char *target_amf_service_set
|
||||
);
|
||||
void OpenAPI_authorized_network_slice_info_free(OpenAPI_authorized_network_slice_info_t *authorized_network_slice_info);
|
||||
OpenAPI_authorized_network_slice_info_t *OpenAPI_authorized_network_slice_info_parseFromJSON(cJSON *authorized_network_slice_infoJSON);
|
||||
cJSON *OpenAPI_authorized_network_slice_info_convertToJSON(OpenAPI_authorized_network_slice_info_t *authorized_network_slice_info);
|
||||
OpenAPI_authorized_network_slice_info_t *OpenAPI_authorized_network_slice_info_copy(OpenAPI_authorized_network_slice_info_t *dst, OpenAPI_authorized_network_slice_info_t *src);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _OpenAPI_authorized_network_slice_info_H_ */
|
||||
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
#include "av_eps_aka.h"
|
||||
|
||||
OpenAPI_av_eps_aka_t *OpenAPI_av_eps_aka_create(
|
||||
OpenAPI_hss_av_type_t *av_type,
|
||||
OpenAPI_hss_av_type_e av_type,
|
||||
char *rand,
|
||||
char *xres,
|
||||
char *autn,
|
||||
|
|
@ -31,7 +31,6 @@ void OpenAPI_av_eps_aka_free(OpenAPI_av_eps_aka_t *av_eps_aka)
|
|||
return;
|
||||
}
|
||||
OpenAPI_lnode_t *node;
|
||||
OpenAPI_hss_av_type_free(av_eps_aka->av_type);
|
||||
ogs_free(av_eps_aka->rand);
|
||||
ogs_free(av_eps_aka->xres);
|
||||
ogs_free(av_eps_aka->autn);
|
||||
|
|
@ -53,13 +52,7 @@ cJSON *OpenAPI_av_eps_aka_convertToJSON(OpenAPI_av_eps_aka_t *av_eps_aka)
|
|||
ogs_error("OpenAPI_av_eps_aka_convertToJSON() failed [av_type]");
|
||||
goto end;
|
||||
}
|
||||
cJSON *av_type_local_JSON = OpenAPI_hss_av_type_convertToJSON(av_eps_aka->av_type);
|
||||
if (av_type_local_JSON == NULL) {
|
||||
ogs_error("OpenAPI_av_eps_aka_convertToJSON() failed [av_type]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToObject(item, "avType", av_type_local_JSON);
|
||||
if (item->child == NULL) {
|
||||
if (cJSON_AddStringToObject(item, "avType", OpenAPI_hss_av_type_ToString(av_eps_aka->av_type)) == NULL) {
|
||||
ogs_error("OpenAPI_av_eps_aka_convertToJSON() failed [av_type]");
|
||||
goto end;
|
||||
}
|
||||
|
|
@ -113,9 +106,13 @@ OpenAPI_av_eps_aka_t *OpenAPI_av_eps_aka_parseFromJSON(cJSON *av_eps_akaJSON)
|
|||
goto end;
|
||||
}
|
||||
|
||||
OpenAPI_hss_av_type_t *av_type_local_nonprim = NULL;
|
||||
OpenAPI_hss_av_type_e av_typeVariable;
|
||||
|
||||
av_type_local_nonprim = OpenAPI_hss_av_type_parseFromJSON(av_type);
|
||||
if (!cJSON_IsString(av_type)) {
|
||||
ogs_error("OpenAPI_av_eps_aka_parseFromJSON() failed [av_type]");
|
||||
goto end;
|
||||
}
|
||||
av_typeVariable = OpenAPI_hss_av_type_FromString(av_type->valuestring);
|
||||
|
||||
cJSON *rand = cJSON_GetObjectItemCaseSensitive(av_eps_akaJSON, "rand");
|
||||
if (!rand) {
|
||||
|
|
@ -166,7 +163,7 @@ OpenAPI_av_eps_aka_t *OpenAPI_av_eps_aka_parseFromJSON(cJSON *av_eps_akaJSON)
|
|||
}
|
||||
|
||||
av_eps_aka_local_var = OpenAPI_av_eps_aka_create (
|
||||
av_type_local_nonprim,
|
||||
av_typeVariable,
|
||||
ogs_strdup(rand->valuestring),
|
||||
ogs_strdup(xres->valuestring),
|
||||
ogs_strdup(autn->valuestring),
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ extern "C" {
|
|||
|
||||
typedef struct OpenAPI_av_eps_aka_s OpenAPI_av_eps_aka_t;
|
||||
typedef struct OpenAPI_av_eps_aka_s {
|
||||
struct OpenAPI_hss_av_type_s *av_type;
|
||||
OpenAPI_hss_av_type_e av_type;
|
||||
char *rand;
|
||||
char *xres;
|
||||
char *autn;
|
||||
|
|
@ -28,7 +28,7 @@ typedef struct OpenAPI_av_eps_aka_s {
|
|||
} OpenAPI_av_eps_aka_t;
|
||||
|
||||
OpenAPI_av_eps_aka_t *OpenAPI_av_eps_aka_create(
|
||||
OpenAPI_hss_av_type_t *av_type,
|
||||
OpenAPI_hss_av_type_e av_type,
|
||||
char *rand,
|
||||
char *xres,
|
||||
char *autn,
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
#include "av_ims_gba_eap_aka.h"
|
||||
|
||||
OpenAPI_av_ims_gba_eap_aka_t *OpenAPI_av_ims_gba_eap_aka_create(
|
||||
OpenAPI_hss_av_type_t *av_type,
|
||||
OpenAPI_hss_av_type_e av_type,
|
||||
char *rand,
|
||||
char *xres,
|
||||
char *autn,
|
||||
|
|
@ -33,7 +33,6 @@ void OpenAPI_av_ims_gba_eap_aka_free(OpenAPI_av_ims_gba_eap_aka_t *av_ims_gba_ea
|
|||
return;
|
||||
}
|
||||
OpenAPI_lnode_t *node;
|
||||
OpenAPI_hss_av_type_free(av_ims_gba_eap_aka->av_type);
|
||||
ogs_free(av_ims_gba_eap_aka->rand);
|
||||
ogs_free(av_ims_gba_eap_aka->xres);
|
||||
ogs_free(av_ims_gba_eap_aka->autn);
|
||||
|
|
@ -56,13 +55,7 @@ cJSON *OpenAPI_av_ims_gba_eap_aka_convertToJSON(OpenAPI_av_ims_gba_eap_aka_t *av
|
|||
ogs_error("OpenAPI_av_ims_gba_eap_aka_convertToJSON() failed [av_type]");
|
||||
goto end;
|
||||
}
|
||||
cJSON *av_type_local_JSON = OpenAPI_hss_av_type_convertToJSON(av_ims_gba_eap_aka->av_type);
|
||||
if (av_type_local_JSON == NULL) {
|
||||
ogs_error("OpenAPI_av_ims_gba_eap_aka_convertToJSON() failed [av_type]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToObject(item, "avType", av_type_local_JSON);
|
||||
if (item->child == NULL) {
|
||||
if (cJSON_AddStringToObject(item, "avType", OpenAPI_hss_av_type_ToString(av_ims_gba_eap_aka->av_type)) == NULL) {
|
||||
ogs_error("OpenAPI_av_ims_gba_eap_aka_convertToJSON() failed [av_type]");
|
||||
goto end;
|
||||
}
|
||||
|
|
@ -125,9 +118,13 @@ OpenAPI_av_ims_gba_eap_aka_t *OpenAPI_av_ims_gba_eap_aka_parseFromJSON(cJSON *av
|
|||
goto end;
|
||||
}
|
||||
|
||||
OpenAPI_hss_av_type_t *av_type_local_nonprim = NULL;
|
||||
OpenAPI_hss_av_type_e av_typeVariable;
|
||||
|
||||
av_type_local_nonprim = OpenAPI_hss_av_type_parseFromJSON(av_type);
|
||||
if (!cJSON_IsString(av_type)) {
|
||||
ogs_error("OpenAPI_av_ims_gba_eap_aka_parseFromJSON() failed [av_type]");
|
||||
goto end;
|
||||
}
|
||||
av_typeVariable = OpenAPI_hss_av_type_FromString(av_type->valuestring);
|
||||
|
||||
cJSON *rand = cJSON_GetObjectItemCaseSensitive(av_ims_gba_eap_akaJSON, "rand");
|
||||
if (!rand) {
|
||||
|
|
@ -190,7 +187,7 @@ OpenAPI_av_ims_gba_eap_aka_t *OpenAPI_av_ims_gba_eap_aka_parseFromJSON(cJSON *av
|
|||
}
|
||||
|
||||
av_ims_gba_eap_aka_local_var = OpenAPI_av_ims_gba_eap_aka_create (
|
||||
av_type_local_nonprim,
|
||||
av_typeVariable,
|
||||
ogs_strdup(rand->valuestring),
|
||||
ogs_strdup(xres->valuestring),
|
||||
ogs_strdup(autn->valuestring),
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ extern "C" {
|
|||
|
||||
typedef struct OpenAPI_av_ims_gba_eap_aka_s OpenAPI_av_ims_gba_eap_aka_t;
|
||||
typedef struct OpenAPI_av_ims_gba_eap_aka_s {
|
||||
struct OpenAPI_hss_av_type_s *av_type;
|
||||
OpenAPI_hss_av_type_e av_type;
|
||||
char *rand;
|
||||
char *xres;
|
||||
char *autn;
|
||||
|
|
@ -29,7 +29,7 @@ typedef struct OpenAPI_av_ims_gba_eap_aka_s {
|
|||
} OpenAPI_av_ims_gba_eap_aka_t;
|
||||
|
||||
OpenAPI_av_ims_gba_eap_aka_t *OpenAPI_av_ims_gba_eap_aka_create(
|
||||
OpenAPI_hss_av_type_t *av_type,
|
||||
OpenAPI_hss_av_type_e av_type,
|
||||
char *rand,
|
||||
char *xres,
|
||||
char *autn,
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
char* OpenAPI_cause_ToString(OpenAPI_cause_e cause)
|
||||
{
|
||||
const char *causeArray[] = { "NULL", "REL_DUE_TO_HO", "EPS_FALLBACK", "REL_DUE_TO_UP_SEC", "DNN_CONGESTION", "S_NSSAI_CONGESTION", "REL_DUE_TO_REACTIVATION", "_5G_AN_NOT_RESPONDING", "REL_DUE_TO_SLICE_NOT_AVAILABLE", "REL_DUE_TO_DUPLICATE_SESSION_ID", "PDU_SESSION_STATUS_MISMATCH", "HO_FAILURE", "INSUFFICIENT_UP_RESOURCES", "PDU_SESSION_HANDED_OVER", "PDU_SESSION_RESUMED", "CN_ASSISTED_RAN_PARAMETER_TUNING", "ISMF_CONTEXT_TRANSFER", "SMF_CONTEXT_TRANSFER", "REL_DUE_TO_PS_TO_CS_HO", "REL_DUE_TO_SUBSCRIPTION_CHANGE", "HO_CANCEL", "REL_DUE_TO_SLICE_NOT_AUTHORIZED", "PDU_SESSION_HAND_OVER_FAILURE", "DDN_FAILURE_STATUS" };
|
||||
const char *causeArray[] = { "NULL", "REL_DUE_TO_HO", "EPS_FALLBACK", "REL_DUE_TO_UP_SEC", "DNN_CONGESTION", "S_NSSAI_CONGESTION", "REL_DUE_TO_REACTIVATION", "_5G_AN_NOT_RESPONDING", "REL_DUE_TO_SLICE_NOT_AVAILABLE", "REL_DUE_TO_DUPLICATE_SESSION_ID", "PDU_SESSION_STATUS_MISMATCH", "HO_FAILURE", "INSUFFICIENT_UP_RESOURCES", "PDU_SESSION_HANDED_OVER", "PDU_SESSION_RESUMED", "CN_ASSISTED_RAN_PARAMETER_TUNING", "ISMF_CONTEXT_TRANSFER", "SMF_CONTEXT_TRANSFER", "REL_DUE_TO_PS_TO_CS_HO", "REL_DUE_TO_SUBSCRIPTION_CHANGE", "HO_CANCEL", "REL_DUE_TO_SLICE_NOT_AUTHORIZED", "PDU_SESSION_HAND_OVER_FAILURE", "DDN_FAILURE_STATUS", "REL_DUE_TO_CP_ONLY_NOT_APPLICABLE", "NOT_SUPPORTED_WITH_ISMF" };
|
||||
size_t sizeofArray = sizeof(causeArray) / sizeof(causeArray[0]);
|
||||
if (cause < sizeofArray)
|
||||
return (char *)causeArray[cause];
|
||||
|
|
@ -17,7 +17,7 @@ char* OpenAPI_cause_ToString(OpenAPI_cause_e cause)
|
|||
OpenAPI_cause_e OpenAPI_cause_FromString(char* cause)
|
||||
{
|
||||
int stringToReturn = 0;
|
||||
const char *causeArray[] = { "NULL", "REL_DUE_TO_HO", "EPS_FALLBACK", "REL_DUE_TO_UP_SEC", "DNN_CONGESTION", "S_NSSAI_CONGESTION", "REL_DUE_TO_REACTIVATION", "_5G_AN_NOT_RESPONDING", "REL_DUE_TO_SLICE_NOT_AVAILABLE", "REL_DUE_TO_DUPLICATE_SESSION_ID", "PDU_SESSION_STATUS_MISMATCH", "HO_FAILURE", "INSUFFICIENT_UP_RESOURCES", "PDU_SESSION_HANDED_OVER", "PDU_SESSION_RESUMED", "CN_ASSISTED_RAN_PARAMETER_TUNING", "ISMF_CONTEXT_TRANSFER", "SMF_CONTEXT_TRANSFER", "REL_DUE_TO_PS_TO_CS_HO", "REL_DUE_TO_SUBSCRIPTION_CHANGE", "HO_CANCEL", "REL_DUE_TO_SLICE_NOT_AUTHORIZED", "PDU_SESSION_HAND_OVER_FAILURE", "DDN_FAILURE_STATUS" };
|
||||
const char *causeArray[] = { "NULL", "REL_DUE_TO_HO", "EPS_FALLBACK", "REL_DUE_TO_UP_SEC", "DNN_CONGESTION", "S_NSSAI_CONGESTION", "REL_DUE_TO_REACTIVATION", "_5G_AN_NOT_RESPONDING", "REL_DUE_TO_SLICE_NOT_AVAILABLE", "REL_DUE_TO_DUPLICATE_SESSION_ID", "PDU_SESSION_STATUS_MISMATCH", "HO_FAILURE", "INSUFFICIENT_UP_RESOURCES", "PDU_SESSION_HANDED_OVER", "PDU_SESSION_RESUMED", "CN_ASSISTED_RAN_PARAMETER_TUNING", "ISMF_CONTEXT_TRANSFER", "SMF_CONTEXT_TRANSFER", "REL_DUE_TO_PS_TO_CS_HO", "REL_DUE_TO_SUBSCRIPTION_CHANGE", "HO_CANCEL", "REL_DUE_TO_SLICE_NOT_AUTHORIZED", "PDU_SESSION_HAND_OVER_FAILURE", "DDN_FAILURE_STATUS", "REL_DUE_TO_CP_ONLY_NOT_APPLICABLE", "NOT_SUPPORTED_WITH_ISMF" };
|
||||
size_t sizeofArray = sizeof(causeArray) / sizeof(causeArray[0]);
|
||||
while (stringToReturn < sizeofArray) {
|
||||
if (strcmp(cause, causeArray[stringToReturn]) == 0) {
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef enum { OpenAPI_cause_NULL = 0, OpenAPI_cause_REL_DUE_TO_HO, OpenAPI_cause_EPS_FALLBACK, OpenAPI_cause_REL_DUE_TO_UP_SEC, OpenAPI_cause_DNN_CONGESTION, OpenAPI_cause_S_NSSAI_CONGESTION, OpenAPI_cause_REL_DUE_TO_REACTIVATION, OpenAPI_cause__5G_AN_NOT_RESPONDING, OpenAPI_cause_REL_DUE_TO_SLICE_NOT_AVAILABLE, OpenAPI_cause_REL_DUE_TO_DUPLICATE_SESSION_ID, OpenAPI_cause_PDU_SESSION_STATUS_MISMATCH, OpenAPI_cause_HO_FAILURE, OpenAPI_cause_INSUFFICIENT_UP_RESOURCES, OpenAPI_cause_PDU_SESSION_HANDED_OVER, OpenAPI_cause_PDU_SESSION_RESUMED, OpenAPI_cause_CN_ASSISTED_RAN_PARAMETER_TUNING, OpenAPI_cause_ISMF_CONTEXT_TRANSFER, OpenAPI_cause_SMF_CONTEXT_TRANSFER, OpenAPI_cause_REL_DUE_TO_PS_TO_CS_HO, OpenAPI_cause_REL_DUE_TO_SUBSCRIPTION_CHANGE, OpenAPI_cause_HO_CANCEL, OpenAPI_cause_REL_DUE_TO_SLICE_NOT_AUTHORIZED, OpenAPI_cause_PDU_SESSION_HAND_OVER_FAILURE, OpenAPI_cause_DDN_FAILURE_STATUS } OpenAPI_cause_e;
|
||||
typedef enum { OpenAPI_cause_NULL = 0, OpenAPI_cause_REL_DUE_TO_HO, OpenAPI_cause_EPS_FALLBACK, OpenAPI_cause_REL_DUE_TO_UP_SEC, OpenAPI_cause_DNN_CONGESTION, OpenAPI_cause_S_NSSAI_CONGESTION, OpenAPI_cause_REL_DUE_TO_REACTIVATION, OpenAPI_cause__5G_AN_NOT_RESPONDING, OpenAPI_cause_REL_DUE_TO_SLICE_NOT_AVAILABLE, OpenAPI_cause_REL_DUE_TO_DUPLICATE_SESSION_ID, OpenAPI_cause_PDU_SESSION_STATUS_MISMATCH, OpenAPI_cause_HO_FAILURE, OpenAPI_cause_INSUFFICIENT_UP_RESOURCES, OpenAPI_cause_PDU_SESSION_HANDED_OVER, OpenAPI_cause_PDU_SESSION_RESUMED, OpenAPI_cause_CN_ASSISTED_RAN_PARAMETER_TUNING, OpenAPI_cause_ISMF_CONTEXT_TRANSFER, OpenAPI_cause_SMF_CONTEXT_TRANSFER, OpenAPI_cause_REL_DUE_TO_PS_TO_CS_HO, OpenAPI_cause_REL_DUE_TO_SUBSCRIPTION_CHANGE, OpenAPI_cause_HO_CANCEL, OpenAPI_cause_REL_DUE_TO_SLICE_NOT_AUTHORIZED, OpenAPI_cause_PDU_SESSION_HAND_OVER_FAILURE, OpenAPI_cause_DDN_FAILURE_STATUS, OpenAPI_cause_REL_DUE_TO_CP_ONLY_NOT_APPLICABLE, OpenAPI_cause_NOT_SUPPORTED_WITH_ISMF } OpenAPI_cause_e;
|
||||
|
||||
char* OpenAPI_cause_ToString(OpenAPI_cause_e cause);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,190 +0,0 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include "cm_info_report.h"
|
||||
|
||||
OpenAPI_cm_info_report_t *OpenAPI_cm_info_report_create(
|
||||
OpenAPI_list_t *old_cm_info_list,
|
||||
OpenAPI_list_t *new_cm_info_list
|
||||
)
|
||||
{
|
||||
OpenAPI_cm_info_report_t *cm_info_report_local_var = OpenAPI_malloc(sizeof(OpenAPI_cm_info_report_t));
|
||||
if (!cm_info_report_local_var) {
|
||||
return NULL;
|
||||
}
|
||||
cm_info_report_local_var->old_cm_info_list = old_cm_info_list;
|
||||
cm_info_report_local_var->new_cm_info_list = new_cm_info_list;
|
||||
|
||||
return cm_info_report_local_var;
|
||||
}
|
||||
|
||||
void OpenAPI_cm_info_report_free(OpenAPI_cm_info_report_t *cm_info_report)
|
||||
{
|
||||
if (NULL == cm_info_report) {
|
||||
return;
|
||||
}
|
||||
OpenAPI_lnode_t *node;
|
||||
OpenAPI_list_for_each(cm_info_report->old_cm_info_list, node) {
|
||||
OpenAPI_cm_info_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(cm_info_report->old_cm_info_list);
|
||||
OpenAPI_list_for_each(cm_info_report->new_cm_info_list, node) {
|
||||
OpenAPI_cm_info_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(cm_info_report->new_cm_info_list);
|
||||
ogs_free(cm_info_report);
|
||||
}
|
||||
|
||||
cJSON *OpenAPI_cm_info_report_convertToJSON(OpenAPI_cm_info_report_t *cm_info_report)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
|
||||
if (cm_info_report == NULL) {
|
||||
ogs_error("OpenAPI_cm_info_report_convertToJSON() failed [CmInfoReport]");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
item = cJSON_CreateObject();
|
||||
if (cm_info_report->old_cm_info_list) {
|
||||
cJSON *old_cm_info_listList = cJSON_AddArrayToObject(item, "oldCmInfoList");
|
||||
if (old_cm_info_listList == NULL) {
|
||||
ogs_error("OpenAPI_cm_info_report_convertToJSON() failed [old_cm_info_list]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
OpenAPI_lnode_t *old_cm_info_list_node;
|
||||
if (cm_info_report->old_cm_info_list) {
|
||||
OpenAPI_list_for_each(cm_info_report->old_cm_info_list, old_cm_info_list_node) {
|
||||
cJSON *itemLocal = OpenAPI_cm_info_convertToJSON(old_cm_info_list_node->data);
|
||||
if (itemLocal == NULL) {
|
||||
ogs_error("OpenAPI_cm_info_report_convertToJSON() failed [old_cm_info_list]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToArray(old_cm_info_listList, itemLocal);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!cm_info_report->new_cm_info_list) {
|
||||
ogs_error("OpenAPI_cm_info_report_convertToJSON() failed [new_cm_info_list]");
|
||||
goto end;
|
||||
}
|
||||
cJSON *new_cm_info_listList = cJSON_AddArrayToObject(item, "newCmInfoList");
|
||||
if (new_cm_info_listList == NULL) {
|
||||
ogs_error("OpenAPI_cm_info_report_convertToJSON() failed [new_cm_info_list]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
OpenAPI_lnode_t *new_cm_info_list_node;
|
||||
if (cm_info_report->new_cm_info_list) {
|
||||
OpenAPI_list_for_each(cm_info_report->new_cm_info_list, new_cm_info_list_node) {
|
||||
cJSON *itemLocal = OpenAPI_cm_info_convertToJSON(new_cm_info_list_node->data);
|
||||
if (itemLocal == NULL) {
|
||||
ogs_error("OpenAPI_cm_info_report_convertToJSON() failed [new_cm_info_list]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToArray(new_cm_info_listList, itemLocal);
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
||||
OpenAPI_cm_info_report_t *OpenAPI_cm_info_report_parseFromJSON(cJSON *cm_info_reportJSON)
|
||||
{
|
||||
OpenAPI_cm_info_report_t *cm_info_report_local_var = NULL;
|
||||
cJSON *old_cm_info_list = cJSON_GetObjectItemCaseSensitive(cm_info_reportJSON, "oldCmInfoList");
|
||||
|
||||
OpenAPI_list_t *old_cm_info_listList;
|
||||
if (old_cm_info_list) {
|
||||
cJSON *old_cm_info_list_local_nonprimitive;
|
||||
if (!cJSON_IsArray(old_cm_info_list)) {
|
||||
ogs_error("OpenAPI_cm_info_report_parseFromJSON() failed [old_cm_info_list]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
old_cm_info_listList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(old_cm_info_list_local_nonprimitive, old_cm_info_list ) {
|
||||
if (!cJSON_IsObject(old_cm_info_list_local_nonprimitive)) {
|
||||
ogs_error("OpenAPI_cm_info_report_parseFromJSON() failed [old_cm_info_list]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_cm_info_t *old_cm_info_listItem = OpenAPI_cm_info_parseFromJSON(old_cm_info_list_local_nonprimitive);
|
||||
|
||||
OpenAPI_list_add(old_cm_info_listList, old_cm_info_listItem);
|
||||
}
|
||||
}
|
||||
|
||||
cJSON *new_cm_info_list = cJSON_GetObjectItemCaseSensitive(cm_info_reportJSON, "newCmInfoList");
|
||||
if (!new_cm_info_list) {
|
||||
ogs_error("OpenAPI_cm_info_report_parseFromJSON() failed [new_cm_info_list]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
OpenAPI_list_t *new_cm_info_listList;
|
||||
|
||||
cJSON *new_cm_info_list_local_nonprimitive;
|
||||
if (!cJSON_IsArray(new_cm_info_list)) {
|
||||
ogs_error("OpenAPI_cm_info_report_parseFromJSON() failed [new_cm_info_list]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
new_cm_info_listList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(new_cm_info_list_local_nonprimitive, new_cm_info_list ) {
|
||||
if (!cJSON_IsObject(new_cm_info_list_local_nonprimitive)) {
|
||||
ogs_error("OpenAPI_cm_info_report_parseFromJSON() failed [new_cm_info_list]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_cm_info_t *new_cm_info_listItem = OpenAPI_cm_info_parseFromJSON(new_cm_info_list_local_nonprimitive);
|
||||
|
||||
OpenAPI_list_add(new_cm_info_listList, new_cm_info_listItem);
|
||||
}
|
||||
|
||||
cm_info_report_local_var = OpenAPI_cm_info_report_create (
|
||||
old_cm_info_list ? old_cm_info_listList : NULL,
|
||||
new_cm_info_listList
|
||||
);
|
||||
|
||||
return cm_info_report_local_var;
|
||||
end:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
OpenAPI_cm_info_report_t *OpenAPI_cm_info_report_copy(OpenAPI_cm_info_report_t *dst, OpenAPI_cm_info_report_t *src)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
char *content = NULL;
|
||||
|
||||
ogs_assert(src);
|
||||
item = OpenAPI_cm_info_report_convertToJSON(src);
|
||||
if (!item) {
|
||||
ogs_error("OpenAPI_cm_info_report_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_cm_info_report_free(dst);
|
||||
dst = OpenAPI_cm_info_report_parseFromJSON(item);
|
||||
cJSON_Delete(item);
|
||||
|
||||
return dst;
|
||||
}
|
||||
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
/*
|
||||
* cm_info_report.h
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _OpenAPI_cm_info_report_H_
|
||||
#define _OpenAPI_cm_info_report_H_
|
||||
|
||||
#include <string.h>
|
||||
#include "../external/cJSON.h"
|
||||
#include "../include/list.h"
|
||||
#include "../include/keyValuePair.h"
|
||||
#include "../include/binary.h"
|
||||
#include "cm_info.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct OpenAPI_cm_info_report_s OpenAPI_cm_info_report_t;
|
||||
typedef struct OpenAPI_cm_info_report_s {
|
||||
OpenAPI_list_t *old_cm_info_list;
|
||||
OpenAPI_list_t *new_cm_info_list;
|
||||
} OpenAPI_cm_info_report_t;
|
||||
|
||||
OpenAPI_cm_info_report_t *OpenAPI_cm_info_report_create(
|
||||
OpenAPI_list_t *old_cm_info_list,
|
||||
OpenAPI_list_t *new_cm_info_list
|
||||
);
|
||||
void OpenAPI_cm_info_report_free(OpenAPI_cm_info_report_t *cm_info_report);
|
||||
OpenAPI_cm_info_report_t *OpenAPI_cm_info_report_parseFromJSON(cJSON *cm_info_reportJSON);
|
||||
cJSON *OpenAPI_cm_info_report_convertToJSON(OpenAPI_cm_info_report_t *cm_info_report);
|
||||
OpenAPI_cm_info_report_t *OpenAPI_cm_info_report_copy(OpenAPI_cm_info_report_t *dst, OpenAPI_cm_info_report_t *src);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _OpenAPI_cm_info_report_H_ */
|
||||
|
||||
30
lib/sbi/openapi/model/collection_period_rmm_lte_mdt.c
Normal file
30
lib/sbi/openapi/model/collection_period_rmm_lte_mdt.c
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include "collection_period_rmm_lte_mdt.h"
|
||||
|
||||
char* OpenAPI_collection_period_rmm_lte_mdt_ToString(OpenAPI_collection_period_rmm_lte_mdt_e collection_period_rmm_lte_mdt)
|
||||
{
|
||||
const char *collection_period_rmm_lte_mdtArray[] = { "NULL", "_1024", "_1280", "_2048", "_2560", "_5120", "_10240", "_60000" };
|
||||
size_t sizeofArray = sizeof(collection_period_rmm_lte_mdtArray) / sizeof(collection_period_rmm_lte_mdtArray[0]);
|
||||
if (collection_period_rmm_lte_mdt < sizeofArray)
|
||||
return (char *)collection_period_rmm_lte_mdtArray[collection_period_rmm_lte_mdt];
|
||||
else
|
||||
return (char *)"Unknown";
|
||||
}
|
||||
|
||||
OpenAPI_collection_period_rmm_lte_mdt_e OpenAPI_collection_period_rmm_lte_mdt_FromString(char* collection_period_rmm_lte_mdt)
|
||||
{
|
||||
int stringToReturn = 0;
|
||||
const char *collection_period_rmm_lte_mdtArray[] = { "NULL", "_1024", "_1280", "_2048", "_2560", "_5120", "_10240", "_60000" };
|
||||
size_t sizeofArray = sizeof(collection_period_rmm_lte_mdtArray) / sizeof(collection_period_rmm_lte_mdtArray[0]);
|
||||
while (stringToReturn < sizeofArray) {
|
||||
if (strcmp(collection_period_rmm_lte_mdt, collection_period_rmm_lte_mdtArray[stringToReturn]) == 0) {
|
||||
return stringToReturn;
|
||||
}
|
||||
stringToReturn++;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
31
lib/sbi/openapi/model/collection_period_rmm_lte_mdt.h
Normal file
31
lib/sbi/openapi/model/collection_period_rmm_lte_mdt.h
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
/*
|
||||
* collection_period_rmm_lte_mdt.h
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _OpenAPI_collection_period_rmm_lte_mdt_H_
|
||||
#define _OpenAPI_collection_period_rmm_lte_mdt_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_collection_period_rmm_lte_mdt_NULL = 0, OpenAPI_collection_period_rmm_lte_mdt__1024, OpenAPI_collection_period_rmm_lte_mdt__1280, OpenAPI_collection_period_rmm_lte_mdt__2048, OpenAPI_collection_period_rmm_lte_mdt__2560, OpenAPI_collection_period_rmm_lte_mdt__5120, OpenAPI_collection_period_rmm_lte_mdt__10240, OpenAPI_collection_period_rmm_lte_mdt__60000 } OpenAPI_collection_period_rmm_lte_mdt_e;
|
||||
|
||||
char* OpenAPI_collection_period_rmm_lte_mdt_ToString(OpenAPI_collection_period_rmm_lte_mdt_e collection_period_rmm_lte_mdt);
|
||||
|
||||
OpenAPI_collection_period_rmm_lte_mdt_e OpenAPI_collection_period_rmm_lte_mdt_FromString(char* collection_period_rmm_lte_mdt);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _OpenAPI_collection_period_rmm_lte_mdt_H_ */
|
||||
|
||||
30
lib/sbi/openapi/model/collection_period_rmm_nr_mdt.c
Normal file
30
lib/sbi/openapi/model/collection_period_rmm_nr_mdt.c
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include "collection_period_rmm_nr_mdt.h"
|
||||
|
||||
char* OpenAPI_collection_period_rmm_nr_mdt_ToString(OpenAPI_collection_period_rmm_nr_mdt_e collection_period_rmm_nr_mdt)
|
||||
{
|
||||
const char *collection_period_rmm_nr_mdtArray[] = { "NULL", "_1024", "_2048", "_5120", "_10240", "_60000" };
|
||||
size_t sizeofArray = sizeof(collection_period_rmm_nr_mdtArray) / sizeof(collection_period_rmm_nr_mdtArray[0]);
|
||||
if (collection_period_rmm_nr_mdt < sizeofArray)
|
||||
return (char *)collection_period_rmm_nr_mdtArray[collection_period_rmm_nr_mdt];
|
||||
else
|
||||
return (char *)"Unknown";
|
||||
}
|
||||
|
||||
OpenAPI_collection_period_rmm_nr_mdt_e OpenAPI_collection_period_rmm_nr_mdt_FromString(char* collection_period_rmm_nr_mdt)
|
||||
{
|
||||
int stringToReturn = 0;
|
||||
const char *collection_period_rmm_nr_mdtArray[] = { "NULL", "_1024", "_2048", "_5120", "_10240", "_60000" };
|
||||
size_t sizeofArray = sizeof(collection_period_rmm_nr_mdtArray) / sizeof(collection_period_rmm_nr_mdtArray[0]);
|
||||
while (stringToReturn < sizeofArray) {
|
||||
if (strcmp(collection_period_rmm_nr_mdt, collection_period_rmm_nr_mdtArray[stringToReturn]) == 0) {
|
||||
return stringToReturn;
|
||||
}
|
||||
stringToReturn++;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
31
lib/sbi/openapi/model/collection_period_rmm_nr_mdt.h
Normal file
31
lib/sbi/openapi/model/collection_period_rmm_nr_mdt.h
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
/*
|
||||
* collection_period_rmm_nr_mdt.h
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _OpenAPI_collection_period_rmm_nr_mdt_H_
|
||||
#define _OpenAPI_collection_period_rmm_nr_mdt_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_collection_period_rmm_nr_mdt_NULL = 0, OpenAPI_collection_period_rmm_nr_mdt__1024, OpenAPI_collection_period_rmm_nr_mdt__2048, OpenAPI_collection_period_rmm_nr_mdt__5120, OpenAPI_collection_period_rmm_nr_mdt__10240, OpenAPI_collection_period_rmm_nr_mdt__60000 } OpenAPI_collection_period_rmm_nr_mdt_e;
|
||||
|
||||
char* OpenAPI_collection_period_rmm_nr_mdt_ToString(OpenAPI_collection_period_rmm_nr_mdt_e collection_period_rmm_nr_mdt);
|
||||
|
||||
OpenAPI_collection_period_rmm_nr_mdt_e OpenAPI_collection_period_rmm_nr_mdt_FromString(char* collection_period_rmm_nr_mdt);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _OpenAPI_collection_period_rmm_nr_mdt_H_ */
|
||||
|
||||
30
lib/sbi/openapi/model/condition_event_type.c
Normal file
30
lib/sbi/openapi/model/condition_event_type.c
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include "condition_event_type.h"
|
||||
|
||||
char* OpenAPI_condition_event_type_ToString(OpenAPI_condition_event_type_e condition_event_type)
|
||||
{
|
||||
const char *condition_event_typeArray[] = { "NULL", "NF_ADDED", "NF_REMOVED" };
|
||||
size_t sizeofArray = sizeof(condition_event_typeArray) / sizeof(condition_event_typeArray[0]);
|
||||
if (condition_event_type < sizeofArray)
|
||||
return (char *)condition_event_typeArray[condition_event_type];
|
||||
else
|
||||
return (char *)"Unknown";
|
||||
}
|
||||
|
||||
OpenAPI_condition_event_type_e OpenAPI_condition_event_type_FromString(char* condition_event_type)
|
||||
{
|
||||
int stringToReturn = 0;
|
||||
const char *condition_event_typeArray[] = { "NULL", "NF_ADDED", "NF_REMOVED" };
|
||||
size_t sizeofArray = sizeof(condition_event_typeArray) / sizeof(condition_event_typeArray[0]);
|
||||
while (stringToReturn < sizeofArray) {
|
||||
if (strcmp(condition_event_type, condition_event_typeArray[stringToReturn]) == 0) {
|
||||
return stringToReturn;
|
||||
}
|
||||
stringToReturn++;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
31
lib/sbi/openapi/model/condition_event_type.h
Normal file
31
lib/sbi/openapi/model/condition_event_type.h
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
/*
|
||||
* condition_event_type.h
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _OpenAPI_condition_event_type_H_
|
||||
#define _OpenAPI_condition_event_type_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_condition_event_type_NULL = 0, OpenAPI_condition_event_type_NF_ADDED, OpenAPI_condition_event_type_NF_REMOVED } OpenAPI_condition_event_type_e;
|
||||
|
||||
char* OpenAPI_condition_event_type_ToString(OpenAPI_condition_event_type_e condition_event_type);
|
||||
|
||||
OpenAPI_condition_event_type_e OpenAPI_condition_event_type_FromString(char* condition_event_type);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _OpenAPI_condition_event_type_H_ */
|
||||
|
||||
|
|
@ -4,82 +4,27 @@
|
|||
#include <stdio.h>
|
||||
#include "context_data_set_name.h"
|
||||
|
||||
OpenAPI_context_data_set_name_t *OpenAPI_context_data_set_name_create(
|
||||
)
|
||||
char* OpenAPI_context_data_set_name_ToString(OpenAPI_context_data_set_name_e context_data_set_name)
|
||||
{
|
||||
OpenAPI_context_data_set_name_t *context_data_set_name_local_var = OpenAPI_malloc(sizeof(OpenAPI_context_data_set_name_t));
|
||||
if (!context_data_set_name_local_var) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return context_data_set_name_local_var;
|
||||
const char *context_data_set_nameArray[] = { "NULL", "AMF_3GPP", "AMF_NON_3GPP", "SDM_SUBSCRIPTIONS", "EE_SUBSCRIPTIONS", "SMSF_3GPP", "SMSF_NON_3GPP", "SUBS_TO_NOTIFY", "SMF_REG", "IP_SM_GW" };
|
||||
size_t sizeofArray = sizeof(context_data_set_nameArray) / sizeof(context_data_set_nameArray[0]);
|
||||
if (context_data_set_name < sizeofArray)
|
||||
return (char *)context_data_set_nameArray[context_data_set_name];
|
||||
else
|
||||
return (char *)"Unknown";
|
||||
}
|
||||
|
||||
void OpenAPI_context_data_set_name_free(OpenAPI_context_data_set_name_t *context_data_set_name)
|
||||
OpenAPI_context_data_set_name_e OpenAPI_context_data_set_name_FromString(char* context_data_set_name)
|
||||
{
|
||||
if (NULL == context_data_set_name) {
|
||||
return;
|
||||
int stringToReturn = 0;
|
||||
const char *context_data_set_nameArray[] = { "NULL", "AMF_3GPP", "AMF_NON_3GPP", "SDM_SUBSCRIPTIONS", "EE_SUBSCRIPTIONS", "SMSF_3GPP", "SMSF_NON_3GPP", "SUBS_TO_NOTIFY", "SMF_REG", "IP_SM_GW" };
|
||||
size_t sizeofArray = sizeof(context_data_set_nameArray) / sizeof(context_data_set_nameArray[0]);
|
||||
while (stringToReturn < sizeofArray) {
|
||||
if (strcmp(context_data_set_name, context_data_set_nameArray[stringToReturn]) == 0) {
|
||||
return stringToReturn;
|
||||
}
|
||||
stringToReturn++;
|
||||
}
|
||||
OpenAPI_lnode_t *node;
|
||||
ogs_free(context_data_set_name);
|
||||
}
|
||||
|
||||
cJSON *OpenAPI_context_data_set_name_convertToJSON(OpenAPI_context_data_set_name_t *context_data_set_name)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
|
||||
if (context_data_set_name == NULL) {
|
||||
ogs_error("OpenAPI_context_data_set_name_convertToJSON() failed [ContextDataSetName]");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
item = cJSON_CreateObject();
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
||||
OpenAPI_context_data_set_name_t *OpenAPI_context_data_set_name_parseFromJSON(cJSON *context_data_set_nameJSON)
|
||||
{
|
||||
OpenAPI_context_data_set_name_t *context_data_set_name_local_var = NULL;
|
||||
context_data_set_name_local_var = OpenAPI_context_data_set_name_create (
|
||||
);
|
||||
|
||||
return context_data_set_name_local_var;
|
||||
end:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
OpenAPI_context_data_set_name_t *OpenAPI_context_data_set_name_copy(OpenAPI_context_data_set_name_t *dst, OpenAPI_context_data_set_name_t *src)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
char *content = NULL;
|
||||
|
||||
ogs_assert(src);
|
||||
item = OpenAPI_context_data_set_name_convertToJSON(src);
|
||||
if (!item) {
|
||||
ogs_error("OpenAPI_context_data_set_name_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_context_data_set_name_free(dst);
|
||||
dst = OpenAPI_context_data_set_name_parseFromJSON(item);
|
||||
cJSON_Delete(item);
|
||||
|
||||
return dst;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -17,16 +17,11 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct OpenAPI_context_data_set_name_s OpenAPI_context_data_set_name_t;
|
||||
typedef struct OpenAPI_context_data_set_name_s {
|
||||
} OpenAPI_context_data_set_name_t;
|
||||
typedef enum { OpenAPI_context_data_set_name_NULL = 0, OpenAPI_context_data_set_name_AMF_3GPP, OpenAPI_context_data_set_name_AMF_NON_3GPP, OpenAPI_context_data_set_name_SDM_SUBSCRIPTIONS, OpenAPI_context_data_set_name_EE_SUBSCRIPTIONS, OpenAPI_context_data_set_name_SMSF_3GPP, OpenAPI_context_data_set_name_SMSF_NON_3GPP, OpenAPI_context_data_set_name_SUBS_TO_NOTIFY, OpenAPI_context_data_set_name_SMF_REG, OpenAPI_context_data_set_name_IP_SM_GW } OpenAPI_context_data_set_name_e;
|
||||
|
||||
OpenAPI_context_data_set_name_t *OpenAPI_context_data_set_name_create(
|
||||
);
|
||||
void OpenAPI_context_data_set_name_free(OpenAPI_context_data_set_name_t *context_data_set_name);
|
||||
OpenAPI_context_data_set_name_t *OpenAPI_context_data_set_name_parseFromJSON(cJSON *context_data_set_nameJSON);
|
||||
cJSON *OpenAPI_context_data_set_name_convertToJSON(OpenAPI_context_data_set_name_t *context_data_set_name);
|
||||
OpenAPI_context_data_set_name_t *OpenAPI_context_data_set_name_copy(OpenAPI_context_data_set_name_t *dst, OpenAPI_context_data_set_name_t *src);
|
||||
char* OpenAPI_context_data_set_name_ToString(OpenAPI_context_data_set_name_e context_data_set_name);
|
||||
|
||||
OpenAPI_context_data_set_name_e OpenAPI_context_data_set_name_FromString(char* context_data_set_name);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,8 @@ OpenAPI_context_data_sets_t *OpenAPI_context_data_sets_create(
|
|||
OpenAPI_smsf_registration_t *smsf3_gpp_access,
|
||||
OpenAPI_smsf_registration_t *smsf_non3_gpp_access,
|
||||
OpenAPI_list_t *subscription_data_subscriptions,
|
||||
OpenAPI_list_t *smf_registrations
|
||||
OpenAPI_list_t *smf_registrations,
|
||||
OpenAPI_ip_sm_gw_registration_t *ip_sm_gw
|
||||
)
|
||||
{
|
||||
OpenAPI_context_data_sets_t *context_data_sets_local_var = OpenAPI_malloc(sizeof(OpenAPI_context_data_sets_t));
|
||||
|
|
@ -27,6 +28,7 @@ OpenAPI_context_data_sets_t *OpenAPI_context_data_sets_create(
|
|||
context_data_sets_local_var->smsf_non3_gpp_access = smsf_non3_gpp_access;
|
||||
context_data_sets_local_var->subscription_data_subscriptions = subscription_data_subscriptions;
|
||||
context_data_sets_local_var->smf_registrations = smf_registrations;
|
||||
context_data_sets_local_var->ip_sm_gw = ip_sm_gw;
|
||||
|
||||
return context_data_sets_local_var;
|
||||
}
|
||||
|
|
@ -57,6 +59,7 @@ void OpenAPI_context_data_sets_free(OpenAPI_context_data_sets_t *context_data_se
|
|||
OpenAPI_smf_registration_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(context_data_sets->smf_registrations);
|
||||
OpenAPI_ip_sm_gw_registration_free(context_data_sets->ip_sm_gw);
|
||||
ogs_free(context_data_sets);
|
||||
}
|
||||
|
||||
|
|
@ -202,6 +205,19 @@ cJSON *OpenAPI_context_data_sets_convertToJSON(OpenAPI_context_data_sets_t *cont
|
|||
}
|
||||
}
|
||||
|
||||
if (context_data_sets->ip_sm_gw) {
|
||||
cJSON *ip_sm_gw_local_JSON = OpenAPI_ip_sm_gw_registration_convertToJSON(context_data_sets->ip_sm_gw);
|
||||
if (ip_sm_gw_local_JSON == NULL) {
|
||||
ogs_error("OpenAPI_context_data_sets_convertToJSON() failed [ip_sm_gw]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToObject(item, "ipSmGw", ip_sm_gw_local_JSON);
|
||||
if (item->child == NULL) {
|
||||
ogs_error("OpenAPI_context_data_sets_convertToJSON() failed [ip_sm_gw]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
|
@ -329,6 +345,13 @@ OpenAPI_context_data_sets_t *OpenAPI_context_data_sets_parseFromJSON(cJSON *cont
|
|||
}
|
||||
}
|
||||
|
||||
cJSON *ip_sm_gw = cJSON_GetObjectItemCaseSensitive(context_data_setsJSON, "ipSmGw");
|
||||
|
||||
OpenAPI_ip_sm_gw_registration_t *ip_sm_gw_local_nonprim = NULL;
|
||||
if (ip_sm_gw) {
|
||||
ip_sm_gw_local_nonprim = OpenAPI_ip_sm_gw_registration_parseFromJSON(ip_sm_gw);
|
||||
}
|
||||
|
||||
context_data_sets_local_var = OpenAPI_context_data_sets_create (
|
||||
amf3_gpp ? amf3_gpp_local_nonprim : NULL,
|
||||
amf_non3_gpp ? amf_non3_gpp_local_nonprim : NULL,
|
||||
|
|
@ -337,7 +360,8 @@ OpenAPI_context_data_sets_t *OpenAPI_context_data_sets_parseFromJSON(cJSON *cont
|
|||
smsf3_gpp_access ? smsf3_gpp_access_local_nonprim : NULL,
|
||||
smsf_non3_gpp_access ? smsf_non3_gpp_access_local_nonprim : NULL,
|
||||
subscription_data_subscriptions ? subscription_data_subscriptionsList : NULL,
|
||||
smf_registrations ? smf_registrationsList : NULL
|
||||
smf_registrations ? smf_registrationsList : NULL,
|
||||
ip_sm_gw ? ip_sm_gw_local_nonprim : NULL
|
||||
);
|
||||
|
||||
return context_data_sets_local_var;
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@
|
|||
#include "amf3_gpp_access_registration.h"
|
||||
#include "amf_non3_gpp_access_registration.h"
|
||||
#include "ee_subscription.h"
|
||||
#include "ip_sm_gw_registration.h"
|
||||
#include "sdm_subscription.h"
|
||||
#include "smf_registration.h"
|
||||
#include "smsf_registration.h"
|
||||
|
|
@ -34,6 +35,7 @@ typedef struct OpenAPI_context_data_sets_s {
|
|||
struct OpenAPI_smsf_registration_s *smsf_non3_gpp_access;
|
||||
OpenAPI_list_t *subscription_data_subscriptions;
|
||||
OpenAPI_list_t *smf_registrations;
|
||||
struct OpenAPI_ip_sm_gw_registration_s *ip_sm_gw;
|
||||
} OpenAPI_context_data_sets_t;
|
||||
|
||||
OpenAPI_context_data_sets_t *OpenAPI_context_data_sets_create(
|
||||
|
|
@ -44,7 +46,8 @@ OpenAPI_context_data_sets_t *OpenAPI_context_data_sets_create(
|
|||
OpenAPI_smsf_registration_t *smsf3_gpp_access,
|
||||
OpenAPI_smsf_registration_t *smsf_non3_gpp_access,
|
||||
OpenAPI_list_t *subscription_data_subscriptions,
|
||||
OpenAPI_list_t *smf_registrations
|
||||
OpenAPI_list_t *smf_registrations,
|
||||
OpenAPI_ip_sm_gw_registration_t *ip_sm_gw
|
||||
);
|
||||
void OpenAPI_context_data_sets_free(OpenAPI_context_data_sets_t *context_data_sets);
|
||||
OpenAPI_context_data_sets_t *OpenAPI_context_data_sets_parseFromJSON(cJSON *context_data_setsJSON);
|
||||
|
|
|
|||
128
lib/sbi/openapi/model/context_info.c
Normal file
128
lib/sbi/openapi/model/context_info.c
Normal file
|
|
@ -0,0 +1,128 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include "context_info.h"
|
||||
|
||||
OpenAPI_context_info_t *OpenAPI_context_info_create(
|
||||
OpenAPI_list_t *orig_headers
|
||||
)
|
||||
{
|
||||
OpenAPI_context_info_t *context_info_local_var = OpenAPI_malloc(sizeof(OpenAPI_context_info_t));
|
||||
if (!context_info_local_var) {
|
||||
return NULL;
|
||||
}
|
||||
context_info_local_var->orig_headers = orig_headers;
|
||||
|
||||
return context_info_local_var;
|
||||
}
|
||||
|
||||
void OpenAPI_context_info_free(OpenAPI_context_info_t *context_info)
|
||||
{
|
||||
if (NULL == context_info) {
|
||||
return;
|
||||
}
|
||||
OpenAPI_lnode_t *node;
|
||||
OpenAPI_list_for_each(context_info->orig_headers, node) {
|
||||
ogs_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(context_info->orig_headers);
|
||||
ogs_free(context_info);
|
||||
}
|
||||
|
||||
cJSON *OpenAPI_context_info_convertToJSON(OpenAPI_context_info_t *context_info)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
|
||||
if (context_info == NULL) {
|
||||
ogs_error("OpenAPI_context_info_convertToJSON() failed [ContextInfo]");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
item = cJSON_CreateObject();
|
||||
if (context_info->orig_headers) {
|
||||
cJSON *orig_headers = cJSON_AddArrayToObject(item, "origHeaders");
|
||||
if (orig_headers == NULL) {
|
||||
ogs_error("OpenAPI_context_info_convertToJSON() failed [orig_headers]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
OpenAPI_lnode_t *orig_headers_node;
|
||||
OpenAPI_list_for_each(context_info->orig_headers, orig_headers_node) {
|
||||
if (cJSON_AddStringToObject(orig_headers, "", (char*)orig_headers_node->data) == NULL) {
|
||||
ogs_error("OpenAPI_context_info_convertToJSON() failed [orig_headers]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
||||
OpenAPI_context_info_t *OpenAPI_context_info_parseFromJSON(cJSON *context_infoJSON)
|
||||
{
|
||||
OpenAPI_context_info_t *context_info_local_var = NULL;
|
||||
cJSON *orig_headers = cJSON_GetObjectItemCaseSensitive(context_infoJSON, "origHeaders");
|
||||
|
||||
OpenAPI_list_t *orig_headersList;
|
||||
if (orig_headers) {
|
||||
cJSON *orig_headers_local;
|
||||
if (!cJSON_IsArray(orig_headers)) {
|
||||
ogs_error("OpenAPI_context_info_parseFromJSON() failed [orig_headers]");
|
||||
goto end;
|
||||
}
|
||||
orig_headersList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(orig_headers_local, orig_headers) {
|
||||
if (!cJSON_IsString(orig_headers_local)) {
|
||||
ogs_error("OpenAPI_context_info_parseFromJSON() failed [orig_headers]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_add(orig_headersList, ogs_strdup(orig_headers_local->valuestring));
|
||||
}
|
||||
}
|
||||
|
||||
context_info_local_var = OpenAPI_context_info_create (
|
||||
orig_headers ? orig_headersList : NULL
|
||||
);
|
||||
|
||||
return context_info_local_var;
|
||||
end:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
OpenAPI_context_info_t *OpenAPI_context_info_copy(OpenAPI_context_info_t *dst, OpenAPI_context_info_t *src)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
char *content = NULL;
|
||||
|
||||
ogs_assert(src);
|
||||
item = OpenAPI_context_info_convertToJSON(src);
|
||||
if (!item) {
|
||||
ogs_error("OpenAPI_context_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_context_info_free(dst);
|
||||
dst = OpenAPI_context_info_parseFromJSON(item);
|
||||
cJSON_Delete(item);
|
||||
|
||||
return dst;
|
||||
}
|
||||
|
||||
38
lib/sbi/openapi/model/context_info.h
Normal file
38
lib/sbi/openapi/model/context_info.h
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
* context_info.h
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _OpenAPI_context_info_H_
|
||||
#define _OpenAPI_context_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_context_info_s OpenAPI_context_info_t;
|
||||
typedef struct OpenAPI_context_info_s {
|
||||
OpenAPI_list_t *orig_headers;
|
||||
} OpenAPI_context_info_t;
|
||||
|
||||
OpenAPI_context_info_t *OpenAPI_context_info_create(
|
||||
OpenAPI_list_t *orig_headers
|
||||
);
|
||||
void OpenAPI_context_info_free(OpenAPI_context_info_t *context_info);
|
||||
OpenAPI_context_info_t *OpenAPI_context_info_parseFromJSON(cJSON *context_infoJSON);
|
||||
cJSON *OpenAPI_context_info_convertToJSON(OpenAPI_context_info_t *context_info);
|
||||
OpenAPI_context_info_t *OpenAPI_context_info_copy(OpenAPI_context_info_t *dst, OpenAPI_context_info_t *src);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _OpenAPI_context_info_H_ */
|
||||
|
||||
|
|
@ -4,82 +4,27 @@
|
|||
#include <stdio.h>
|
||||
#include "data_set_name.h"
|
||||
|
||||
OpenAPI_data_set_name_t *OpenAPI_data_set_name_create(
|
||||
)
|
||||
char* OpenAPI_data_set_name_ToString(OpenAPI_data_set_name_e data_set_name)
|
||||
{
|
||||
OpenAPI_data_set_name_t *data_set_name_local_var = OpenAPI_malloc(sizeof(OpenAPI_data_set_name_t));
|
||||
if (!data_set_name_local_var) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return data_set_name_local_var;
|
||||
const char *data_set_nameArray[] = { "NULL", "AM", "SMF_SEL", "SMS_SUB", "SM", "TRACE", "SMS_MNG", "LCS_PRIVACY", "LCS_MO", "LCS_BCA", "V2X" };
|
||||
size_t sizeofArray = sizeof(data_set_nameArray) / sizeof(data_set_nameArray[0]);
|
||||
if (data_set_name < sizeofArray)
|
||||
return (char *)data_set_nameArray[data_set_name];
|
||||
else
|
||||
return (char *)"Unknown";
|
||||
}
|
||||
|
||||
void OpenAPI_data_set_name_free(OpenAPI_data_set_name_t *data_set_name)
|
||||
OpenAPI_data_set_name_e OpenAPI_data_set_name_FromString(char* data_set_name)
|
||||
{
|
||||
if (NULL == data_set_name) {
|
||||
return;
|
||||
int stringToReturn = 0;
|
||||
const char *data_set_nameArray[] = { "NULL", "AM", "SMF_SEL", "SMS_SUB", "SM", "TRACE", "SMS_MNG", "LCS_PRIVACY", "LCS_MO", "LCS_BCA", "V2X" };
|
||||
size_t sizeofArray = sizeof(data_set_nameArray) / sizeof(data_set_nameArray[0]);
|
||||
while (stringToReturn < sizeofArray) {
|
||||
if (strcmp(data_set_name, data_set_nameArray[stringToReturn]) == 0) {
|
||||
return stringToReturn;
|
||||
}
|
||||
stringToReturn++;
|
||||
}
|
||||
OpenAPI_lnode_t *node;
|
||||
ogs_free(data_set_name);
|
||||
}
|
||||
|
||||
cJSON *OpenAPI_data_set_name_convertToJSON(OpenAPI_data_set_name_t *data_set_name)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
|
||||
if (data_set_name == NULL) {
|
||||
ogs_error("OpenAPI_data_set_name_convertToJSON() failed [DataSetName]");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
item = cJSON_CreateObject();
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
||||
OpenAPI_data_set_name_t *OpenAPI_data_set_name_parseFromJSON(cJSON *data_set_nameJSON)
|
||||
{
|
||||
OpenAPI_data_set_name_t *data_set_name_local_var = NULL;
|
||||
data_set_name_local_var = OpenAPI_data_set_name_create (
|
||||
);
|
||||
|
||||
return data_set_name_local_var;
|
||||
end:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
OpenAPI_data_set_name_t *OpenAPI_data_set_name_copy(OpenAPI_data_set_name_t *dst, OpenAPI_data_set_name_t *src)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
char *content = NULL;
|
||||
|
||||
ogs_assert(src);
|
||||
item = OpenAPI_data_set_name_convertToJSON(src);
|
||||
if (!item) {
|
||||
ogs_error("OpenAPI_data_set_name_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_data_set_name_free(dst);
|
||||
dst = OpenAPI_data_set_name_parseFromJSON(item);
|
||||
cJSON_Delete(item);
|
||||
|
||||
return dst;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -17,16 +17,11 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct OpenAPI_data_set_name_s OpenAPI_data_set_name_t;
|
||||
typedef struct OpenAPI_data_set_name_s {
|
||||
} OpenAPI_data_set_name_t;
|
||||
typedef enum { OpenAPI_data_set_name_NULL = 0, OpenAPI_data_set_name_AM, OpenAPI_data_set_name_SMF_SEL, OpenAPI_data_set_name_SMS_SUB, OpenAPI_data_set_name_SM, OpenAPI_data_set_name_TRACE, OpenAPI_data_set_name_SMS_MNG, OpenAPI_data_set_name_LCS_PRIVACY, OpenAPI_data_set_name_LCS_MO, OpenAPI_data_set_name_LCS_BCA, OpenAPI_data_set_name_V2X } OpenAPI_data_set_name_e;
|
||||
|
||||
OpenAPI_data_set_name_t *OpenAPI_data_set_name_create(
|
||||
);
|
||||
void OpenAPI_data_set_name_free(OpenAPI_data_set_name_t *data_set_name);
|
||||
OpenAPI_data_set_name_t *OpenAPI_data_set_name_parseFromJSON(cJSON *data_set_nameJSON);
|
||||
cJSON *OpenAPI_data_set_name_convertToJSON(OpenAPI_data_set_name_t *data_set_name);
|
||||
OpenAPI_data_set_name_t *OpenAPI_data_set_name_copy(OpenAPI_data_set_name_t *dst, OpenAPI_data_set_name_t *src);
|
||||
char* OpenAPI_data_set_name_ToString(OpenAPI_data_set_name_e data_set_name);
|
||||
|
||||
OpenAPI_data_set_name_e OpenAPI_data_set_name_FromString(char* data_set_name);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,9 +35,6 @@ void OpenAPI_datalink_reporting_configuration_free(OpenAPI_datalink_reporting_co
|
|||
OpenAPI_list_free(datalink_reporting_configuration->ddd_traffic_des);
|
||||
ogs_free(datalink_reporting_configuration->dnn);
|
||||
OpenAPI_snssai_free(datalink_reporting_configuration->slice);
|
||||
OpenAPI_list_for_each(datalink_reporting_configuration->ddd_status_list, node) {
|
||||
OpenAPI_dl_data_delivery_status_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(datalink_reporting_configuration->ddd_status_list);
|
||||
ogs_free(datalink_reporting_configuration);
|
||||
}
|
||||
|
|
@ -93,21 +90,16 @@ cJSON *OpenAPI_datalink_reporting_configuration_convertToJSON(OpenAPI_datalink_r
|
|||
}
|
||||
|
||||
if (datalink_reporting_configuration->ddd_status_list) {
|
||||
cJSON *ddd_status_listList = cJSON_AddArrayToObject(item, "dddStatusList");
|
||||
if (ddd_status_listList == NULL) {
|
||||
cJSON *ddd_status_list = cJSON_AddArrayToObject(item, "dddStatusList");
|
||||
if (ddd_status_list == NULL) {
|
||||
ogs_error("OpenAPI_datalink_reporting_configuration_convertToJSON() failed [ddd_status_list]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
OpenAPI_lnode_t *ddd_status_list_node;
|
||||
if (datalink_reporting_configuration->ddd_status_list) {
|
||||
OpenAPI_list_for_each(datalink_reporting_configuration->ddd_status_list, ddd_status_list_node) {
|
||||
cJSON *itemLocal = OpenAPI_dl_data_delivery_status_convertToJSON(ddd_status_list_node->data);
|
||||
if (itemLocal == NULL) {
|
||||
ogs_error("OpenAPI_datalink_reporting_configuration_convertToJSON() failed [ddd_status_list]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToArray(ddd_status_listList, itemLocal);
|
||||
OpenAPI_list_for_each(datalink_reporting_configuration->ddd_status_list, ddd_status_list_node) {
|
||||
if (cJSON_AddStringToObject(ddd_status_list, "", OpenAPI_dl_data_delivery_status_ToString((OpenAPI_dl_data_delivery_status_e)ddd_status_list_node->data)) == NULL) {
|
||||
ogs_error("OpenAPI_datalink_reporting_configuration_convertToJSON() failed [ddd_status_list]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -171,13 +163,12 @@ OpenAPI_datalink_reporting_configuration_t *OpenAPI_datalink_reporting_configura
|
|||
ddd_status_listList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(ddd_status_list_local_nonprimitive, ddd_status_list ) {
|
||||
if (!cJSON_IsObject(ddd_status_list_local_nonprimitive)) {
|
||||
if (!cJSON_IsString(ddd_status_list_local_nonprimitive)) {
|
||||
ogs_error("OpenAPI_datalink_reporting_configuration_parseFromJSON() failed [ddd_status_list]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_dl_data_delivery_status_t *ddd_status_listItem = OpenAPI_dl_data_delivery_status_parseFromJSON(ddd_status_list_local_nonprimitive);
|
||||
|
||||
OpenAPI_list_add(ddd_status_listList, ddd_status_listItem);
|
||||
OpenAPI_list_add(ddd_status_listList, (void *)OpenAPI_dl_data_delivery_status_FromString(ddd_status_list_local_nonprimitive->valuestring));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
160
lib/sbi/openapi/model/ddn_failure_sub_info.c
Normal file
160
lib/sbi/openapi/model/ddn_failure_sub_info.c
Normal file
|
|
@ -0,0 +1,160 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include "ddn_failure_sub_info.h"
|
||||
|
||||
OpenAPI_ddn_failure_sub_info_t *OpenAPI_ddn_failure_sub_info_create(
|
||||
char *notify_correlation_id,
|
||||
OpenAPI_list_t *ddd_traffic_descriptor_list
|
||||
)
|
||||
{
|
||||
OpenAPI_ddn_failure_sub_info_t *ddn_failure_sub_info_local_var = OpenAPI_malloc(sizeof(OpenAPI_ddn_failure_sub_info_t));
|
||||
if (!ddn_failure_sub_info_local_var) {
|
||||
return NULL;
|
||||
}
|
||||
ddn_failure_sub_info_local_var->notify_correlation_id = notify_correlation_id;
|
||||
ddn_failure_sub_info_local_var->ddd_traffic_descriptor_list = ddd_traffic_descriptor_list;
|
||||
|
||||
return ddn_failure_sub_info_local_var;
|
||||
}
|
||||
|
||||
void OpenAPI_ddn_failure_sub_info_free(OpenAPI_ddn_failure_sub_info_t *ddn_failure_sub_info)
|
||||
{
|
||||
if (NULL == ddn_failure_sub_info) {
|
||||
return;
|
||||
}
|
||||
OpenAPI_lnode_t *node;
|
||||
ogs_free(ddn_failure_sub_info->notify_correlation_id);
|
||||
OpenAPI_list_for_each(ddn_failure_sub_info->ddd_traffic_descriptor_list, node) {
|
||||
OpenAPI_ddd_traffic_descriptor_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(ddn_failure_sub_info->ddd_traffic_descriptor_list);
|
||||
ogs_free(ddn_failure_sub_info);
|
||||
}
|
||||
|
||||
cJSON *OpenAPI_ddn_failure_sub_info_convertToJSON(OpenAPI_ddn_failure_sub_info_t *ddn_failure_sub_info)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
|
||||
if (ddn_failure_sub_info == NULL) {
|
||||
ogs_error("OpenAPI_ddn_failure_sub_info_convertToJSON() failed [DdnFailureSubInfo]");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
item = cJSON_CreateObject();
|
||||
if (!ddn_failure_sub_info->notify_correlation_id) {
|
||||
ogs_error("OpenAPI_ddn_failure_sub_info_convertToJSON() failed [notify_correlation_id]");
|
||||
goto end;
|
||||
}
|
||||
if (cJSON_AddStringToObject(item, "notifyCorrelationId", ddn_failure_sub_info->notify_correlation_id) == NULL) {
|
||||
ogs_error("OpenAPI_ddn_failure_sub_info_convertToJSON() failed [notify_correlation_id]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (ddn_failure_sub_info->ddd_traffic_descriptor_list) {
|
||||
cJSON *ddd_traffic_descriptor_listList = cJSON_AddArrayToObject(item, "dddTrafficDescriptorList");
|
||||
if (ddd_traffic_descriptor_listList == NULL) {
|
||||
ogs_error("OpenAPI_ddn_failure_sub_info_convertToJSON() failed [ddd_traffic_descriptor_list]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
OpenAPI_lnode_t *ddd_traffic_descriptor_list_node;
|
||||
if (ddn_failure_sub_info->ddd_traffic_descriptor_list) {
|
||||
OpenAPI_list_for_each(ddn_failure_sub_info->ddd_traffic_descriptor_list, ddd_traffic_descriptor_list_node) {
|
||||
cJSON *itemLocal = OpenAPI_ddd_traffic_descriptor_convertToJSON(ddd_traffic_descriptor_list_node->data);
|
||||
if (itemLocal == NULL) {
|
||||
ogs_error("OpenAPI_ddn_failure_sub_info_convertToJSON() failed [ddd_traffic_descriptor_list]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToArray(ddd_traffic_descriptor_listList, itemLocal);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
||||
OpenAPI_ddn_failure_sub_info_t *OpenAPI_ddn_failure_sub_info_parseFromJSON(cJSON *ddn_failure_sub_infoJSON)
|
||||
{
|
||||
OpenAPI_ddn_failure_sub_info_t *ddn_failure_sub_info_local_var = NULL;
|
||||
cJSON *notify_correlation_id = cJSON_GetObjectItemCaseSensitive(ddn_failure_sub_infoJSON, "notifyCorrelationId");
|
||||
if (!notify_correlation_id) {
|
||||
ogs_error("OpenAPI_ddn_failure_sub_info_parseFromJSON() failed [notify_correlation_id]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
|
||||
if (!cJSON_IsString(notify_correlation_id)) {
|
||||
ogs_error("OpenAPI_ddn_failure_sub_info_parseFromJSON() failed [notify_correlation_id]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
cJSON *ddd_traffic_descriptor_list = cJSON_GetObjectItemCaseSensitive(ddn_failure_sub_infoJSON, "dddTrafficDescriptorList");
|
||||
|
||||
OpenAPI_list_t *ddd_traffic_descriptor_listList;
|
||||
if (ddd_traffic_descriptor_list) {
|
||||
cJSON *ddd_traffic_descriptor_list_local_nonprimitive;
|
||||
if (!cJSON_IsArray(ddd_traffic_descriptor_list)) {
|
||||
ogs_error("OpenAPI_ddn_failure_sub_info_parseFromJSON() failed [ddd_traffic_descriptor_list]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
ddd_traffic_descriptor_listList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(ddd_traffic_descriptor_list_local_nonprimitive, ddd_traffic_descriptor_list ) {
|
||||
if (!cJSON_IsObject(ddd_traffic_descriptor_list_local_nonprimitive)) {
|
||||
ogs_error("OpenAPI_ddn_failure_sub_info_parseFromJSON() failed [ddd_traffic_descriptor_list]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_ddd_traffic_descriptor_t *ddd_traffic_descriptor_listItem = OpenAPI_ddd_traffic_descriptor_parseFromJSON(ddd_traffic_descriptor_list_local_nonprimitive);
|
||||
|
||||
OpenAPI_list_add(ddd_traffic_descriptor_listList, ddd_traffic_descriptor_listItem);
|
||||
}
|
||||
}
|
||||
|
||||
ddn_failure_sub_info_local_var = OpenAPI_ddn_failure_sub_info_create (
|
||||
ogs_strdup(notify_correlation_id->valuestring),
|
||||
ddd_traffic_descriptor_list ? ddd_traffic_descriptor_listList : NULL
|
||||
);
|
||||
|
||||
return ddn_failure_sub_info_local_var;
|
||||
end:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
OpenAPI_ddn_failure_sub_info_t *OpenAPI_ddn_failure_sub_info_copy(OpenAPI_ddn_failure_sub_info_t *dst, OpenAPI_ddn_failure_sub_info_t *src)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
char *content = NULL;
|
||||
|
||||
ogs_assert(src);
|
||||
item = OpenAPI_ddn_failure_sub_info_convertToJSON(src);
|
||||
if (!item) {
|
||||
ogs_error("OpenAPI_ddn_failure_sub_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_ddn_failure_sub_info_free(dst);
|
||||
dst = OpenAPI_ddn_failure_sub_info_parseFromJSON(item);
|
||||
cJSON_Delete(item);
|
||||
|
||||
return dst;
|
||||
}
|
||||
|
||||
41
lib/sbi/openapi/model/ddn_failure_sub_info.h
Normal file
41
lib/sbi/openapi/model/ddn_failure_sub_info.h
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
/*
|
||||
* ddn_failure_sub_info.h
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _OpenAPI_ddn_failure_sub_info_H_
|
||||
#define _OpenAPI_ddn_failure_sub_info_H_
|
||||
|
||||
#include <string.h>
|
||||
#include "../external/cJSON.h"
|
||||
#include "../include/list.h"
|
||||
#include "../include/keyValuePair.h"
|
||||
#include "../include/binary.h"
|
||||
#include "ddd_traffic_descriptor.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct OpenAPI_ddn_failure_sub_info_s OpenAPI_ddn_failure_sub_info_t;
|
||||
typedef struct OpenAPI_ddn_failure_sub_info_s {
|
||||
char *notify_correlation_id;
|
||||
OpenAPI_list_t *ddd_traffic_descriptor_list;
|
||||
} OpenAPI_ddn_failure_sub_info_t;
|
||||
|
||||
OpenAPI_ddn_failure_sub_info_t *OpenAPI_ddn_failure_sub_info_create(
|
||||
char *notify_correlation_id,
|
||||
OpenAPI_list_t *ddd_traffic_descriptor_list
|
||||
);
|
||||
void OpenAPI_ddn_failure_sub_info_free(OpenAPI_ddn_failure_sub_info_t *ddn_failure_sub_info);
|
||||
OpenAPI_ddn_failure_sub_info_t *OpenAPI_ddn_failure_sub_info_parseFromJSON(cJSON *ddn_failure_sub_infoJSON);
|
||||
cJSON *OpenAPI_ddn_failure_sub_info_convertToJSON(OpenAPI_ddn_failure_sub_info_t *ddn_failure_sub_info);
|
||||
OpenAPI_ddn_failure_sub_info_t *OpenAPI_ddn_failure_sub_info_copy(OpenAPI_ddn_failure_sub_info_t *dst, OpenAPI_ddn_failure_sub_info_t *src);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _OpenAPI_ddn_failure_sub_info_H_ */
|
||||
|
||||
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
OpenAPI_ddn_failure_subs_t *OpenAPI_ddn_failure_subs_create(
|
||||
int ddn_failure_subs_ind,
|
||||
OpenAPI_list_t *ddd_traffic_descriptor_list
|
||||
OpenAPI_list_t *ddn_failure_subs_info_list
|
||||
)
|
||||
{
|
||||
OpenAPI_ddn_failure_subs_t *ddn_failure_subs_local_var = OpenAPI_malloc(sizeof(OpenAPI_ddn_failure_subs_t));
|
||||
|
|
@ -14,7 +14,7 @@ OpenAPI_ddn_failure_subs_t *OpenAPI_ddn_failure_subs_create(
|
|||
return NULL;
|
||||
}
|
||||
ddn_failure_subs_local_var->ddn_failure_subs_ind = ddn_failure_subs_ind;
|
||||
ddn_failure_subs_local_var->ddd_traffic_descriptor_list = ddd_traffic_descriptor_list;
|
||||
ddn_failure_subs_local_var->ddn_failure_subs_info_list = ddn_failure_subs_info_list;
|
||||
|
||||
return ddn_failure_subs_local_var;
|
||||
}
|
||||
|
|
@ -25,10 +25,10 @@ void OpenAPI_ddn_failure_subs_free(OpenAPI_ddn_failure_subs_t *ddn_failure_subs)
|
|||
return;
|
||||
}
|
||||
OpenAPI_lnode_t *node;
|
||||
OpenAPI_list_for_each(ddn_failure_subs->ddd_traffic_descriptor_list, node) {
|
||||
OpenAPI_ddd_traffic_descriptor_free(node->data);
|
||||
OpenAPI_list_for_each(ddn_failure_subs->ddn_failure_subs_info_list, node) {
|
||||
OpenAPI_ddn_failure_sub_info_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(ddn_failure_subs->ddd_traffic_descriptor_list);
|
||||
OpenAPI_list_free(ddn_failure_subs->ddn_failure_subs_info_list);
|
||||
ogs_free(ddn_failure_subs);
|
||||
}
|
||||
|
||||
|
|
@ -49,22 +49,22 @@ cJSON *OpenAPI_ddn_failure_subs_convertToJSON(OpenAPI_ddn_failure_subs_t *ddn_fa
|
|||
}
|
||||
}
|
||||
|
||||
if (ddn_failure_subs->ddd_traffic_descriptor_list) {
|
||||
cJSON *ddd_traffic_descriptor_listList = cJSON_AddArrayToObject(item, "dddTrafficDescriptorList");
|
||||
if (ddd_traffic_descriptor_listList == NULL) {
|
||||
ogs_error("OpenAPI_ddn_failure_subs_convertToJSON() failed [ddd_traffic_descriptor_list]");
|
||||
if (ddn_failure_subs->ddn_failure_subs_info_list) {
|
||||
cJSON *ddn_failure_subs_info_listList = cJSON_AddArrayToObject(item, "ddnFailureSubsInfoList");
|
||||
if (ddn_failure_subs_info_listList == NULL) {
|
||||
ogs_error("OpenAPI_ddn_failure_subs_convertToJSON() failed [ddn_failure_subs_info_list]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
OpenAPI_lnode_t *ddd_traffic_descriptor_list_node;
|
||||
if (ddn_failure_subs->ddd_traffic_descriptor_list) {
|
||||
OpenAPI_list_for_each(ddn_failure_subs->ddd_traffic_descriptor_list, ddd_traffic_descriptor_list_node) {
|
||||
cJSON *itemLocal = OpenAPI_ddd_traffic_descriptor_convertToJSON(ddd_traffic_descriptor_list_node->data);
|
||||
OpenAPI_lnode_t *ddn_failure_subs_info_list_node;
|
||||
if (ddn_failure_subs->ddn_failure_subs_info_list) {
|
||||
OpenAPI_list_for_each(ddn_failure_subs->ddn_failure_subs_info_list, ddn_failure_subs_info_list_node) {
|
||||
cJSON *itemLocal = OpenAPI_ddn_failure_sub_info_convertToJSON(ddn_failure_subs_info_list_node->data);
|
||||
if (itemLocal == NULL) {
|
||||
ogs_error("OpenAPI_ddn_failure_subs_convertToJSON() failed [ddd_traffic_descriptor_list]");
|
||||
ogs_error("OpenAPI_ddn_failure_subs_convertToJSON() failed [ddn_failure_subs_info_list]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToArray(ddd_traffic_descriptor_listList, itemLocal);
|
||||
cJSON_AddItemToArray(ddn_failure_subs_info_listList, itemLocal);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -85,32 +85,32 @@ OpenAPI_ddn_failure_subs_t *OpenAPI_ddn_failure_subs_parseFromJSON(cJSON *ddn_fa
|
|||
}
|
||||
}
|
||||
|
||||
cJSON *ddd_traffic_descriptor_list = cJSON_GetObjectItemCaseSensitive(ddn_failure_subsJSON, "dddTrafficDescriptorList");
|
||||
cJSON *ddn_failure_subs_info_list = cJSON_GetObjectItemCaseSensitive(ddn_failure_subsJSON, "ddnFailureSubsInfoList");
|
||||
|
||||
OpenAPI_list_t *ddd_traffic_descriptor_listList;
|
||||
if (ddd_traffic_descriptor_list) {
|
||||
cJSON *ddd_traffic_descriptor_list_local_nonprimitive;
|
||||
if (!cJSON_IsArray(ddd_traffic_descriptor_list)) {
|
||||
ogs_error("OpenAPI_ddn_failure_subs_parseFromJSON() failed [ddd_traffic_descriptor_list]");
|
||||
OpenAPI_list_t *ddn_failure_subs_info_listList;
|
||||
if (ddn_failure_subs_info_list) {
|
||||
cJSON *ddn_failure_subs_info_list_local_nonprimitive;
|
||||
if (!cJSON_IsArray(ddn_failure_subs_info_list)) {
|
||||
ogs_error("OpenAPI_ddn_failure_subs_parseFromJSON() failed [ddn_failure_subs_info_list]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
ddd_traffic_descriptor_listList = OpenAPI_list_create();
|
||||
ddn_failure_subs_info_listList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(ddd_traffic_descriptor_list_local_nonprimitive, ddd_traffic_descriptor_list ) {
|
||||
if (!cJSON_IsObject(ddd_traffic_descriptor_list_local_nonprimitive)) {
|
||||
ogs_error("OpenAPI_ddn_failure_subs_parseFromJSON() failed [ddd_traffic_descriptor_list]");
|
||||
cJSON_ArrayForEach(ddn_failure_subs_info_list_local_nonprimitive, ddn_failure_subs_info_list ) {
|
||||
if (!cJSON_IsObject(ddn_failure_subs_info_list_local_nonprimitive)) {
|
||||
ogs_error("OpenAPI_ddn_failure_subs_parseFromJSON() failed [ddn_failure_subs_info_list]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_ddd_traffic_descriptor_t *ddd_traffic_descriptor_listItem = OpenAPI_ddd_traffic_descriptor_parseFromJSON(ddd_traffic_descriptor_list_local_nonprimitive);
|
||||
OpenAPI_ddn_failure_sub_info_t *ddn_failure_subs_info_listItem = OpenAPI_ddn_failure_sub_info_parseFromJSON(ddn_failure_subs_info_list_local_nonprimitive);
|
||||
|
||||
OpenAPI_list_add(ddd_traffic_descriptor_listList, ddd_traffic_descriptor_listItem);
|
||||
OpenAPI_list_add(ddn_failure_subs_info_listList, ddn_failure_subs_info_listItem);
|
||||
}
|
||||
}
|
||||
|
||||
ddn_failure_subs_local_var = OpenAPI_ddn_failure_subs_create (
|
||||
ddn_failure_subs_ind ? ddn_failure_subs_ind->valueint : 0,
|
||||
ddd_traffic_descriptor_list ? ddd_traffic_descriptor_listList : NULL
|
||||
ddn_failure_subs_info_list ? ddn_failure_subs_info_listList : NULL
|
||||
);
|
||||
|
||||
return ddn_failure_subs_local_var;
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
#include "../include/list.h"
|
||||
#include "../include/keyValuePair.h"
|
||||
#include "../include/binary.h"
|
||||
#include "ddd_traffic_descriptor.h"
|
||||
#include "ddn_failure_sub_info.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
@ -21,12 +21,12 @@ extern "C" {
|
|||
typedef struct OpenAPI_ddn_failure_subs_s OpenAPI_ddn_failure_subs_t;
|
||||
typedef struct OpenAPI_ddn_failure_subs_s {
|
||||
int ddn_failure_subs_ind;
|
||||
OpenAPI_list_t *ddd_traffic_descriptor_list;
|
||||
OpenAPI_list_t *ddn_failure_subs_info_list;
|
||||
} OpenAPI_ddn_failure_subs_t;
|
||||
|
||||
OpenAPI_ddn_failure_subs_t *OpenAPI_ddn_failure_subs_create(
|
||||
int ddn_failure_subs_ind,
|
||||
OpenAPI_list_t *ddd_traffic_descriptor_list
|
||||
OpenAPI_list_t *ddn_failure_subs_info_list
|
||||
);
|
||||
void OpenAPI_ddn_failure_subs_free(OpenAPI_ddn_failure_subs_t *ddn_failure_subs);
|
||||
OpenAPI_ddn_failure_subs_t *OpenAPI_ddn_failure_subs_parseFromJSON(cJSON *ddn_failure_subsJSON);
|
||||
|
|
|
|||
|
|
@ -9,7 +9,8 @@ OpenAPI_default_notification_subscription_t *OpenAPI_default_notification_subscr
|
|||
char *callback_uri,
|
||||
OpenAPI_n1_message_class_e n1_message_class,
|
||||
OpenAPI_n2_information_class_e n2_information_class,
|
||||
OpenAPI_list_t *versions
|
||||
OpenAPI_list_t *versions,
|
||||
char *binding
|
||||
)
|
||||
{
|
||||
OpenAPI_default_notification_subscription_t *default_notification_subscription_local_var = OpenAPI_malloc(sizeof(OpenAPI_default_notification_subscription_t));
|
||||
|
|
@ -21,6 +22,7 @@ OpenAPI_default_notification_subscription_t *OpenAPI_default_notification_subscr
|
|||
default_notification_subscription_local_var->n1_message_class = n1_message_class;
|
||||
default_notification_subscription_local_var->n2_information_class = n2_information_class;
|
||||
default_notification_subscription_local_var->versions = versions;
|
||||
default_notification_subscription_local_var->binding = binding;
|
||||
|
||||
return default_notification_subscription_local_var;
|
||||
}
|
||||
|
|
@ -36,6 +38,7 @@ void OpenAPI_default_notification_subscription_free(OpenAPI_default_notification
|
|||
ogs_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(default_notification_subscription->versions);
|
||||
ogs_free(default_notification_subscription->binding);
|
||||
ogs_free(default_notification_subscription);
|
||||
}
|
||||
|
||||
|
|
@ -97,6 +100,13 @@ cJSON *OpenAPI_default_notification_subscription_convertToJSON(OpenAPI_default_n
|
|||
}
|
||||
}
|
||||
|
||||
if (default_notification_subscription->binding) {
|
||||
if (cJSON_AddStringToObject(item, "binding", default_notification_subscription->binding) == NULL) {
|
||||
ogs_error("OpenAPI_default_notification_subscription_convertToJSON() failed [binding]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
|
@ -172,12 +182,22 @@ OpenAPI_default_notification_subscription_t *OpenAPI_default_notification_subscr
|
|||
}
|
||||
}
|
||||
|
||||
cJSON *binding = cJSON_GetObjectItemCaseSensitive(default_notification_subscriptionJSON, "binding");
|
||||
|
||||
if (binding) {
|
||||
if (!cJSON_IsString(binding)) {
|
||||
ogs_error("OpenAPI_default_notification_subscription_parseFromJSON() failed [binding]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
default_notification_subscription_local_var = OpenAPI_default_notification_subscription_create (
|
||||
notification_typeVariable,
|
||||
ogs_strdup(callback_uri->valuestring),
|
||||
n1_message_class ? n1_message_classVariable : 0,
|
||||
n2_information_class ? n2_information_classVariable : 0,
|
||||
versions ? versionsList : NULL
|
||||
versions ? versionsList : NULL,
|
||||
binding ? ogs_strdup(binding->valuestring) : NULL
|
||||
);
|
||||
|
||||
return default_notification_subscription_local_var;
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ typedef struct OpenAPI_default_notification_subscription_s {
|
|||
OpenAPI_n1_message_class_e n1_message_class;
|
||||
OpenAPI_n2_information_class_e n2_information_class;
|
||||
OpenAPI_list_t *versions;
|
||||
char *binding;
|
||||
} OpenAPI_default_notification_subscription_t;
|
||||
|
||||
OpenAPI_default_notification_subscription_t *OpenAPI_default_notification_subscription_create(
|
||||
|
|
@ -34,7 +35,8 @@ OpenAPI_default_notification_subscription_t *OpenAPI_default_notification_subscr
|
|||
char *callback_uri,
|
||||
OpenAPI_n1_message_class_e n1_message_class,
|
||||
OpenAPI_n2_information_class_e n2_information_class,
|
||||
OpenAPI_list_t *versions
|
||||
OpenAPI_list_t *versions,
|
||||
char *binding
|
||||
);
|
||||
void OpenAPI_default_notification_subscription_free(OpenAPI_default_notification_subscription_t *default_notification_subscription);
|
||||
OpenAPI_default_notification_subscription_t *OpenAPI_default_notification_subscription_parseFromJSON(cJSON *default_notification_subscriptionJSON);
|
||||
|
|
|
|||
244
lib/sbi/openapi/model/default_unrelated_class.c
Normal file
244
lib/sbi/openapi/model/default_unrelated_class.c
Normal file
|
|
@ -0,0 +1,244 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include "default_unrelated_class.h"
|
||||
|
||||
OpenAPI_default_unrelated_class_t *OpenAPI_default_unrelated_class_create(
|
||||
OpenAPI_list_t *allowed_geographic_area,
|
||||
OpenAPI_privacy_check_related_action_e privacy_check_related_action,
|
||||
OpenAPI_code_word_ind_e code_word_ind,
|
||||
OpenAPI_valid_time_period_t *valid_time_period,
|
||||
OpenAPI_list_t *code_word_list
|
||||
)
|
||||
{
|
||||
OpenAPI_default_unrelated_class_t *default_unrelated_class_local_var = OpenAPI_malloc(sizeof(OpenAPI_default_unrelated_class_t));
|
||||
if (!default_unrelated_class_local_var) {
|
||||
return NULL;
|
||||
}
|
||||
default_unrelated_class_local_var->allowed_geographic_area = allowed_geographic_area;
|
||||
default_unrelated_class_local_var->privacy_check_related_action = privacy_check_related_action;
|
||||
default_unrelated_class_local_var->code_word_ind = code_word_ind;
|
||||
default_unrelated_class_local_var->valid_time_period = valid_time_period;
|
||||
default_unrelated_class_local_var->code_word_list = code_word_list;
|
||||
|
||||
return default_unrelated_class_local_var;
|
||||
}
|
||||
|
||||
void OpenAPI_default_unrelated_class_free(OpenAPI_default_unrelated_class_t *default_unrelated_class)
|
||||
{
|
||||
if (NULL == default_unrelated_class) {
|
||||
return;
|
||||
}
|
||||
OpenAPI_lnode_t *node;
|
||||
OpenAPI_list_for_each(default_unrelated_class->allowed_geographic_area, node) {
|
||||
OpenAPI_geographic_area_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(default_unrelated_class->allowed_geographic_area);
|
||||
OpenAPI_valid_time_period_free(default_unrelated_class->valid_time_period);
|
||||
OpenAPI_list_for_each(default_unrelated_class->code_word_list, node) {
|
||||
ogs_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(default_unrelated_class->code_word_list);
|
||||
ogs_free(default_unrelated_class);
|
||||
}
|
||||
|
||||
cJSON *OpenAPI_default_unrelated_class_convertToJSON(OpenAPI_default_unrelated_class_t *default_unrelated_class)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
|
||||
if (default_unrelated_class == NULL) {
|
||||
ogs_error("OpenAPI_default_unrelated_class_convertToJSON() failed [DefaultUnrelatedClass]");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
item = cJSON_CreateObject();
|
||||
if (default_unrelated_class->allowed_geographic_area) {
|
||||
cJSON *allowed_geographic_areaList = cJSON_AddArrayToObject(item, "allowedGeographicArea");
|
||||
if (allowed_geographic_areaList == NULL) {
|
||||
ogs_error("OpenAPI_default_unrelated_class_convertToJSON() failed [allowed_geographic_area]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
OpenAPI_lnode_t *allowed_geographic_area_node;
|
||||
if (default_unrelated_class->allowed_geographic_area) {
|
||||
OpenAPI_list_for_each(default_unrelated_class->allowed_geographic_area, allowed_geographic_area_node) {
|
||||
cJSON *itemLocal = OpenAPI_geographic_area_convertToJSON(allowed_geographic_area_node->data);
|
||||
if (itemLocal == NULL) {
|
||||
ogs_error("OpenAPI_default_unrelated_class_convertToJSON() failed [allowed_geographic_area]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToArray(allowed_geographic_areaList, itemLocal);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (default_unrelated_class->privacy_check_related_action) {
|
||||
if (cJSON_AddStringToObject(item, "privacyCheckRelatedAction", OpenAPI_privacy_check_related_action_ToString(default_unrelated_class->privacy_check_related_action)) == NULL) {
|
||||
ogs_error("OpenAPI_default_unrelated_class_convertToJSON() failed [privacy_check_related_action]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (default_unrelated_class->code_word_ind) {
|
||||
if (cJSON_AddStringToObject(item, "codeWordInd", OpenAPI_code_word_ind_ToString(default_unrelated_class->code_word_ind)) == NULL) {
|
||||
ogs_error("OpenAPI_default_unrelated_class_convertToJSON() failed [code_word_ind]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (default_unrelated_class->valid_time_period) {
|
||||
cJSON *valid_time_period_local_JSON = OpenAPI_valid_time_period_convertToJSON(default_unrelated_class->valid_time_period);
|
||||
if (valid_time_period_local_JSON == NULL) {
|
||||
ogs_error("OpenAPI_default_unrelated_class_convertToJSON() failed [valid_time_period]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToObject(item, "validTimePeriod", valid_time_period_local_JSON);
|
||||
if (item->child == NULL) {
|
||||
ogs_error("OpenAPI_default_unrelated_class_convertToJSON() failed [valid_time_period]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (default_unrelated_class->code_word_list) {
|
||||
cJSON *code_word_list = cJSON_AddArrayToObject(item, "codeWordList");
|
||||
if (code_word_list == NULL) {
|
||||
ogs_error("OpenAPI_default_unrelated_class_convertToJSON() failed [code_word_list]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
OpenAPI_lnode_t *code_word_list_node;
|
||||
OpenAPI_list_for_each(default_unrelated_class->code_word_list, code_word_list_node) {
|
||||
if (cJSON_AddStringToObject(code_word_list, "", (char*)code_word_list_node->data) == NULL) {
|
||||
ogs_error("OpenAPI_default_unrelated_class_convertToJSON() failed [code_word_list]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
||||
OpenAPI_default_unrelated_class_t *OpenAPI_default_unrelated_class_parseFromJSON(cJSON *default_unrelated_classJSON)
|
||||
{
|
||||
OpenAPI_default_unrelated_class_t *default_unrelated_class_local_var = NULL;
|
||||
cJSON *allowed_geographic_area = cJSON_GetObjectItemCaseSensitive(default_unrelated_classJSON, "allowedGeographicArea");
|
||||
|
||||
OpenAPI_list_t *allowed_geographic_areaList;
|
||||
if (allowed_geographic_area) {
|
||||
cJSON *allowed_geographic_area_local_nonprimitive;
|
||||
if (!cJSON_IsArray(allowed_geographic_area)) {
|
||||
ogs_error("OpenAPI_default_unrelated_class_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_default_unrelated_class_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);
|
||||
}
|
||||
}
|
||||
|
||||
cJSON *privacy_check_related_action = cJSON_GetObjectItemCaseSensitive(default_unrelated_classJSON, "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_default_unrelated_class_parseFromJSON() failed [privacy_check_related_action]");
|
||||
goto end;
|
||||
}
|
||||
privacy_check_related_actionVariable = OpenAPI_privacy_check_related_action_FromString(privacy_check_related_action->valuestring);
|
||||
}
|
||||
|
||||
cJSON *code_word_ind = cJSON_GetObjectItemCaseSensitive(default_unrelated_classJSON, "codeWordInd");
|
||||
|
||||
OpenAPI_code_word_ind_e code_word_indVariable;
|
||||
if (code_word_ind) {
|
||||
if (!cJSON_IsString(code_word_ind)) {
|
||||
ogs_error("OpenAPI_default_unrelated_class_parseFromJSON() failed [code_word_ind]");
|
||||
goto end;
|
||||
}
|
||||
code_word_indVariable = OpenAPI_code_word_ind_FromString(code_word_ind->valuestring);
|
||||
}
|
||||
|
||||
cJSON *valid_time_period = cJSON_GetObjectItemCaseSensitive(default_unrelated_classJSON, "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);
|
||||
}
|
||||
|
||||
cJSON *code_word_list = cJSON_GetObjectItemCaseSensitive(default_unrelated_classJSON, "codeWordList");
|
||||
|
||||
OpenAPI_list_t *code_word_listList;
|
||||
if (code_word_list) {
|
||||
cJSON *code_word_list_local;
|
||||
if (!cJSON_IsArray(code_word_list)) {
|
||||
ogs_error("OpenAPI_default_unrelated_class_parseFromJSON() failed [code_word_list]");
|
||||
goto end;
|
||||
}
|
||||
code_word_listList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(code_word_list_local, code_word_list) {
|
||||
if (!cJSON_IsString(code_word_list_local)) {
|
||||
ogs_error("OpenAPI_default_unrelated_class_parseFromJSON() failed [code_word_list]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_add(code_word_listList, ogs_strdup(code_word_list_local->valuestring));
|
||||
}
|
||||
}
|
||||
|
||||
default_unrelated_class_local_var = OpenAPI_default_unrelated_class_create (
|
||||
allowed_geographic_area ? allowed_geographic_areaList : NULL,
|
||||
privacy_check_related_action ? privacy_check_related_actionVariable : 0,
|
||||
code_word_ind ? code_word_indVariable : 0,
|
||||
valid_time_period ? valid_time_period_local_nonprim : NULL,
|
||||
code_word_list ? code_word_listList : NULL
|
||||
);
|
||||
|
||||
return default_unrelated_class_local_var;
|
||||
end:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
OpenAPI_default_unrelated_class_t *OpenAPI_default_unrelated_class_copy(OpenAPI_default_unrelated_class_t *dst, OpenAPI_default_unrelated_class_t *src)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
char *content = NULL;
|
||||
|
||||
ogs_assert(src);
|
||||
item = OpenAPI_default_unrelated_class_convertToJSON(src);
|
||||
if (!item) {
|
||||
ogs_error("OpenAPI_default_unrelated_class_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_default_unrelated_class_free(dst);
|
||||
dst = OpenAPI_default_unrelated_class_parseFromJSON(item);
|
||||
cJSON_Delete(item);
|
||||
|
||||
return dst;
|
||||
}
|
||||
|
||||
50
lib/sbi/openapi/model/default_unrelated_class.h
Normal file
50
lib/sbi/openapi/model/default_unrelated_class.h
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
/*
|
||||
* default_unrelated_class.h
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _OpenAPI_default_unrelated_class_H_
|
||||
#define _OpenAPI_default_unrelated_class_H_
|
||||
|
||||
#include <string.h>
|
||||
#include "../external/cJSON.h"
|
||||
#include "../include/list.h"
|
||||
#include "../include/keyValuePair.h"
|
||||
#include "../include/binary.h"
|
||||
#include "code_word_ind.h"
|
||||
#include "geographic_area.h"
|
||||
#include "privacy_check_related_action.h"
|
||||
#include "valid_time_period.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct OpenAPI_default_unrelated_class_s OpenAPI_default_unrelated_class_t;
|
||||
typedef struct OpenAPI_default_unrelated_class_s {
|
||||
OpenAPI_list_t *allowed_geographic_area;
|
||||
OpenAPI_privacy_check_related_action_e privacy_check_related_action;
|
||||
OpenAPI_code_word_ind_e code_word_ind;
|
||||
struct OpenAPI_valid_time_period_s *valid_time_period;
|
||||
OpenAPI_list_t *code_word_list;
|
||||
} OpenAPI_default_unrelated_class_t;
|
||||
|
||||
OpenAPI_default_unrelated_class_t *OpenAPI_default_unrelated_class_create(
|
||||
OpenAPI_list_t *allowed_geographic_area,
|
||||
OpenAPI_privacy_check_related_action_e privacy_check_related_action,
|
||||
OpenAPI_code_word_ind_e code_word_ind,
|
||||
OpenAPI_valid_time_period_t *valid_time_period,
|
||||
OpenAPI_list_t *code_word_list
|
||||
);
|
||||
void OpenAPI_default_unrelated_class_free(OpenAPI_default_unrelated_class_t *default_unrelated_class);
|
||||
OpenAPI_default_unrelated_class_t *OpenAPI_default_unrelated_class_parseFromJSON(cJSON *default_unrelated_classJSON);
|
||||
cJSON *OpenAPI_default_unrelated_class_convertToJSON(OpenAPI_default_unrelated_class_t *default_unrelated_class);
|
||||
OpenAPI_default_unrelated_class_t *OpenAPI_default_unrelated_class_copy(OpenAPI_default_unrelated_class_t *dst, OpenAPI_default_unrelated_class_t *src);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _OpenAPI_default_unrelated_class_H_ */
|
||||
|
||||
|
|
@ -59,13 +59,11 @@ cJSON *OpenAPI_deregistration_data_convertToJSON(OpenAPI_deregistration_data_t *
|
|||
goto end;
|
||||
}
|
||||
|
||||
if (!deregistration_data->access_type) {
|
||||
ogs_error("OpenAPI_deregistration_data_convertToJSON() failed [access_type]");
|
||||
goto end;
|
||||
}
|
||||
if (cJSON_AddStringToObject(item, "accessType", OpenAPI_access_type_ToString(deregistration_data->access_type)) == NULL) {
|
||||
ogs_error("OpenAPI_deregistration_data_convertToJSON() failed [access_type]");
|
||||
goto end;
|
||||
if (deregistration_data->access_type) {
|
||||
if (cJSON_AddStringToObject(item, "accessType", OpenAPI_access_type_ToString(deregistration_data->access_type)) == NULL) {
|
||||
ogs_error("OpenAPI_deregistration_data_convertToJSON() failed [access_type]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (deregistration_data->pdu_session_id) {
|
||||
|
|
@ -100,18 +98,15 @@ OpenAPI_deregistration_data_t *OpenAPI_deregistration_data_parseFromJSON(cJSON *
|
|||
dereg_reason_local_nonprim = OpenAPI_deregistration_reason_parseFromJSON(dereg_reason);
|
||||
|
||||
cJSON *access_type = cJSON_GetObjectItemCaseSensitive(deregistration_dataJSON, "accessType");
|
||||
if (!access_type) {
|
||||
ogs_error("OpenAPI_deregistration_data_parseFromJSON() failed [access_type]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
OpenAPI_access_type_e access_typeVariable;
|
||||
|
||||
if (!cJSON_IsString(access_type)) {
|
||||
ogs_error("OpenAPI_deregistration_data_parseFromJSON() failed [access_type]");
|
||||
goto end;
|
||||
if (access_type) {
|
||||
if (!cJSON_IsString(access_type)) {
|
||||
ogs_error("OpenAPI_deregistration_data_parseFromJSON() failed [access_type]");
|
||||
goto end;
|
||||
}
|
||||
access_typeVariable = OpenAPI_access_type_FromString(access_type->valuestring);
|
||||
}
|
||||
access_typeVariable = OpenAPI_access_type_FromString(access_type->valuestring);
|
||||
|
||||
cJSON *pdu_session_id = cJSON_GetObjectItemCaseSensitive(deregistration_dataJSON, "pduSessionId");
|
||||
|
||||
|
|
@ -133,7 +128,7 @@ OpenAPI_deregistration_data_t *OpenAPI_deregistration_data_parseFromJSON(cJSON *
|
|||
|
||||
deregistration_data_local_var = OpenAPI_deregistration_data_create (
|
||||
dereg_reason_local_nonprim,
|
||||
access_typeVariable,
|
||||
access_type ? access_typeVariable : 0,
|
||||
pdu_session_id ? pdu_session_id->valuedouble : 0,
|
||||
new_smf_instance_id ? ogs_strdup(new_smf_instance_id->valuestring) : NULL
|
||||
);
|
||||
|
|
|
|||
|
|
@ -4,82 +4,27 @@
|
|||
#include <stdio.h>
|
||||
#include "dl_data_delivery_status.h"
|
||||
|
||||
OpenAPI_dl_data_delivery_status_t *OpenAPI_dl_data_delivery_status_create(
|
||||
)
|
||||
char* OpenAPI_dl_data_delivery_status_ToString(OpenAPI_dl_data_delivery_status_e dl_data_delivery_status)
|
||||
{
|
||||
OpenAPI_dl_data_delivery_status_t *dl_data_delivery_status_local_var = OpenAPI_malloc(sizeof(OpenAPI_dl_data_delivery_status_t));
|
||||
if (!dl_data_delivery_status_local_var) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return dl_data_delivery_status_local_var;
|
||||
const char *dl_data_delivery_statusArray[] = { "NULL", "BUFFERED", "TRANSMITTED", "DISCARDED" };
|
||||
size_t sizeofArray = sizeof(dl_data_delivery_statusArray) / sizeof(dl_data_delivery_statusArray[0]);
|
||||
if (dl_data_delivery_status < sizeofArray)
|
||||
return (char *)dl_data_delivery_statusArray[dl_data_delivery_status];
|
||||
else
|
||||
return (char *)"Unknown";
|
||||
}
|
||||
|
||||
void OpenAPI_dl_data_delivery_status_free(OpenAPI_dl_data_delivery_status_t *dl_data_delivery_status)
|
||||
OpenAPI_dl_data_delivery_status_e OpenAPI_dl_data_delivery_status_FromString(char* dl_data_delivery_status)
|
||||
{
|
||||
if (NULL == dl_data_delivery_status) {
|
||||
return;
|
||||
int stringToReturn = 0;
|
||||
const char *dl_data_delivery_statusArray[] = { "NULL", "BUFFERED", "TRANSMITTED", "DISCARDED" };
|
||||
size_t sizeofArray = sizeof(dl_data_delivery_statusArray) / sizeof(dl_data_delivery_statusArray[0]);
|
||||
while (stringToReturn < sizeofArray) {
|
||||
if (strcmp(dl_data_delivery_status, dl_data_delivery_statusArray[stringToReturn]) == 0) {
|
||||
return stringToReturn;
|
||||
}
|
||||
stringToReturn++;
|
||||
}
|
||||
OpenAPI_lnode_t *node;
|
||||
ogs_free(dl_data_delivery_status);
|
||||
}
|
||||
|
||||
cJSON *OpenAPI_dl_data_delivery_status_convertToJSON(OpenAPI_dl_data_delivery_status_t *dl_data_delivery_status)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
|
||||
if (dl_data_delivery_status == NULL) {
|
||||
ogs_error("OpenAPI_dl_data_delivery_status_convertToJSON() failed [DlDataDeliveryStatus]");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
item = cJSON_CreateObject();
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
||||
OpenAPI_dl_data_delivery_status_t *OpenAPI_dl_data_delivery_status_parseFromJSON(cJSON *dl_data_delivery_statusJSON)
|
||||
{
|
||||
OpenAPI_dl_data_delivery_status_t *dl_data_delivery_status_local_var = NULL;
|
||||
dl_data_delivery_status_local_var = OpenAPI_dl_data_delivery_status_create (
|
||||
);
|
||||
|
||||
return dl_data_delivery_status_local_var;
|
||||
end:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
OpenAPI_dl_data_delivery_status_t *OpenAPI_dl_data_delivery_status_copy(OpenAPI_dl_data_delivery_status_t *dst, OpenAPI_dl_data_delivery_status_t *src)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
char *content = NULL;
|
||||
|
||||
ogs_assert(src);
|
||||
item = OpenAPI_dl_data_delivery_status_convertToJSON(src);
|
||||
if (!item) {
|
||||
ogs_error("OpenAPI_dl_data_delivery_status_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_dl_data_delivery_status_free(dst);
|
||||
dst = OpenAPI_dl_data_delivery_status_parseFromJSON(item);
|
||||
cJSON_Delete(item);
|
||||
|
||||
return dst;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* dl_data_delivery_status.h
|
||||
*
|
||||
* Possible values are - BUFFERED: The first downlink data is buffered with extended buffering matching the source of the downlink traffic. - TRANSMITTED: The first downlink data matching the source of the downlink traffic is transmitted after previous buffering or discarding of corresponding packet(s) because the UE of the PDU Session becomes ACTIVE, and buffered data can be delivered to UE. - DISCARDED: The first downlink data matching the source of the downlink traffic is discarded because the Extended Buffering time, as determined by the SMF, expires or the amount of downlink data to be buffered is exceeded.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _OpenAPI_dl_data_delivery_status_H_
|
||||
|
|
@ -17,16 +17,11 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct OpenAPI_dl_data_delivery_status_s OpenAPI_dl_data_delivery_status_t;
|
||||
typedef struct OpenAPI_dl_data_delivery_status_s {
|
||||
} OpenAPI_dl_data_delivery_status_t;
|
||||
typedef enum { OpenAPI_dl_data_delivery_status_NULL = 0, OpenAPI_dl_data_delivery_status_BUFFERED, OpenAPI_dl_data_delivery_status_TRANSMITTED, OpenAPI_dl_data_delivery_status_DISCARDED } OpenAPI_dl_data_delivery_status_e;
|
||||
|
||||
OpenAPI_dl_data_delivery_status_t *OpenAPI_dl_data_delivery_status_create(
|
||||
);
|
||||
void OpenAPI_dl_data_delivery_status_free(OpenAPI_dl_data_delivery_status_t *dl_data_delivery_status);
|
||||
OpenAPI_dl_data_delivery_status_t *OpenAPI_dl_data_delivery_status_parseFromJSON(cJSON *dl_data_delivery_statusJSON);
|
||||
cJSON *OpenAPI_dl_data_delivery_status_convertToJSON(OpenAPI_dl_data_delivery_status_t *dl_data_delivery_status);
|
||||
OpenAPI_dl_data_delivery_status_t *OpenAPI_dl_data_delivery_status_copy(OpenAPI_dl_data_delivery_status_t *dst, OpenAPI_dl_data_delivery_status_t *src);
|
||||
char* OpenAPI_dl_data_delivery_status_ToString(OpenAPI_dl_data_delivery_status_e dl_data_delivery_status);
|
||||
|
||||
OpenAPI_dl_data_delivery_status_e OpenAPI_dl_data_delivery_status_FromString(char* dl_data_delivery_status);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,14 +14,16 @@ OpenAPI_dnn_configuration_t *OpenAPI_dnn_configuration_create(
|
|||
OpenAPI_list_t *static_ip_address,
|
||||
OpenAPI_up_security_t *up_security,
|
||||
OpenAPI_pdu_session_continuity_ind_e pdu_session_continuity_ind,
|
||||
int invoke_nef_selection,
|
||||
char *nidd_nef_id,
|
||||
OpenAPI_nidd_information_t *nidd_info,
|
||||
int redundant_session_allowed,
|
||||
OpenAPI_acs_info_t *acs_info,
|
||||
OpenAPI_list_t *ipv4_frame_route_list,
|
||||
OpenAPI_list_t *ipv6_frame_route_list,
|
||||
int atsss_allowed
|
||||
int atsss_allowed,
|
||||
int secondary_auth,
|
||||
int dn_aaa_ip_address_allocation,
|
||||
OpenAPI_ip_address_t *dn_aaa_address
|
||||
)
|
||||
{
|
||||
OpenAPI_dnn_configuration_t *dnn_configuration_local_var = OpenAPI_malloc(sizeof(OpenAPI_dnn_configuration_t));
|
||||
|
|
@ -37,7 +39,6 @@ OpenAPI_dnn_configuration_t *OpenAPI_dnn_configuration_create(
|
|||
dnn_configuration_local_var->static_ip_address = static_ip_address;
|
||||
dnn_configuration_local_var->up_security = up_security;
|
||||
dnn_configuration_local_var->pdu_session_continuity_ind = pdu_session_continuity_ind;
|
||||
dnn_configuration_local_var->invoke_nef_selection = invoke_nef_selection;
|
||||
dnn_configuration_local_var->nidd_nef_id = nidd_nef_id;
|
||||
dnn_configuration_local_var->nidd_info = nidd_info;
|
||||
dnn_configuration_local_var->redundant_session_allowed = redundant_session_allowed;
|
||||
|
|
@ -45,6 +46,9 @@ OpenAPI_dnn_configuration_t *OpenAPI_dnn_configuration_create(
|
|||
dnn_configuration_local_var->ipv4_frame_route_list = ipv4_frame_route_list;
|
||||
dnn_configuration_local_var->ipv6_frame_route_list = ipv6_frame_route_list;
|
||||
dnn_configuration_local_var->atsss_allowed = atsss_allowed;
|
||||
dnn_configuration_local_var->secondary_auth = secondary_auth;
|
||||
dnn_configuration_local_var->dn_aaa_ip_address_allocation = dn_aaa_ip_address_allocation;
|
||||
dnn_configuration_local_var->dn_aaa_address = dn_aaa_address;
|
||||
|
||||
return dnn_configuration_local_var;
|
||||
}
|
||||
|
|
@ -76,6 +80,7 @@ void OpenAPI_dnn_configuration_free(OpenAPI_dnn_configuration_t *dnn_configurati
|
|||
OpenAPI_frame_route_info_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(dnn_configuration->ipv6_frame_route_list);
|
||||
OpenAPI_ip_address_free(dnn_configuration->dn_aaa_address);
|
||||
ogs_free(dnn_configuration);
|
||||
}
|
||||
|
||||
|
|
@ -199,13 +204,6 @@ cJSON *OpenAPI_dnn_configuration_convertToJSON(OpenAPI_dnn_configuration_t *dnn_
|
|||
}
|
||||
}
|
||||
|
||||
if (dnn_configuration->invoke_nef_selection) {
|
||||
if (cJSON_AddBoolToObject(item, "invokeNefSelection", dnn_configuration->invoke_nef_selection) == NULL) {
|
||||
ogs_error("OpenAPI_dnn_configuration_convertToJSON() failed [invoke_nef_selection]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (dnn_configuration->nidd_nef_id) {
|
||||
if (cJSON_AddStringToObject(item, "niddNefId", dnn_configuration->nidd_nef_id) == NULL) {
|
||||
ogs_error("OpenAPI_dnn_configuration_convertToJSON() failed [nidd_nef_id]");
|
||||
|
|
@ -293,6 +291,33 @@ cJSON *OpenAPI_dnn_configuration_convertToJSON(OpenAPI_dnn_configuration_t *dnn_
|
|||
}
|
||||
}
|
||||
|
||||
if (dnn_configuration->secondary_auth) {
|
||||
if (cJSON_AddBoolToObject(item, "secondaryAuth", dnn_configuration->secondary_auth) == NULL) {
|
||||
ogs_error("OpenAPI_dnn_configuration_convertToJSON() failed [secondary_auth]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (dnn_configuration->dn_aaa_ip_address_allocation) {
|
||||
if (cJSON_AddBoolToObject(item, "dnAaaIpAddressAllocation", dnn_configuration->dn_aaa_ip_address_allocation) == NULL) {
|
||||
ogs_error("OpenAPI_dnn_configuration_convertToJSON() failed [dn_aaa_ip_address_allocation]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (dnn_configuration->dn_aaa_address) {
|
||||
cJSON *dn_aaa_address_local_JSON = OpenAPI_ip_address_convertToJSON(dnn_configuration->dn_aaa_address);
|
||||
if (dn_aaa_address_local_JSON == NULL) {
|
||||
ogs_error("OpenAPI_dnn_configuration_convertToJSON() failed [dn_aaa_address]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToObject(item, "dnAaaAddress", dn_aaa_address_local_JSON);
|
||||
if (item->child == NULL) {
|
||||
ogs_error("OpenAPI_dnn_configuration_convertToJSON() failed [dn_aaa_address]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
|
@ -393,15 +418,6 @@ OpenAPI_dnn_configuration_t *OpenAPI_dnn_configuration_parseFromJSON(cJSON *dnn_
|
|||
pdu_session_continuity_indVariable = OpenAPI_pdu_session_continuity_ind_FromString(pdu_session_continuity_ind->valuestring);
|
||||
}
|
||||
|
||||
cJSON *invoke_nef_selection = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "invokeNefSelection");
|
||||
|
||||
if (invoke_nef_selection) {
|
||||
if (!cJSON_IsBool(invoke_nef_selection)) {
|
||||
ogs_error("OpenAPI_dnn_configuration_parseFromJSON() failed [invoke_nef_selection]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
cJSON *nidd_nef_id = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "niddNefId");
|
||||
|
||||
if (nidd_nef_id) {
|
||||
|
|
@ -489,6 +505,31 @@ OpenAPI_dnn_configuration_t *OpenAPI_dnn_configuration_parseFromJSON(cJSON *dnn_
|
|||
}
|
||||
}
|
||||
|
||||
cJSON *secondary_auth = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "secondaryAuth");
|
||||
|
||||
if (secondary_auth) {
|
||||
if (!cJSON_IsBool(secondary_auth)) {
|
||||
ogs_error("OpenAPI_dnn_configuration_parseFromJSON() failed [secondary_auth]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
cJSON *dn_aaa_ip_address_allocation = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "dnAaaIpAddressAllocation");
|
||||
|
||||
if (dn_aaa_ip_address_allocation) {
|
||||
if (!cJSON_IsBool(dn_aaa_ip_address_allocation)) {
|
||||
ogs_error("OpenAPI_dnn_configuration_parseFromJSON() failed [dn_aaa_ip_address_allocation]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
cJSON *dn_aaa_address = cJSON_GetObjectItemCaseSensitive(dnn_configurationJSON, "dnAaaAddress");
|
||||
|
||||
OpenAPI_ip_address_t *dn_aaa_address_local_nonprim = NULL;
|
||||
if (dn_aaa_address) {
|
||||
dn_aaa_address_local_nonprim = OpenAPI_ip_address_parseFromJSON(dn_aaa_address);
|
||||
}
|
||||
|
||||
dnn_configuration_local_var = OpenAPI_dnn_configuration_create (
|
||||
pdu_session_types_local_nonprim,
|
||||
ssc_modes_local_nonprim,
|
||||
|
|
@ -499,14 +540,16 @@ OpenAPI_dnn_configuration_t *OpenAPI_dnn_configuration_parseFromJSON(cJSON *dnn_
|
|||
static_ip_address ? static_ip_addressList : NULL,
|
||||
up_security ? up_security_local_nonprim : NULL,
|
||||
pdu_session_continuity_ind ? pdu_session_continuity_indVariable : 0,
|
||||
invoke_nef_selection ? invoke_nef_selection->valueint : 0,
|
||||
nidd_nef_id ? ogs_strdup(nidd_nef_id->valuestring) : NULL,
|
||||
nidd_info ? nidd_info_local_nonprim : NULL,
|
||||
redundant_session_allowed ? redundant_session_allowed->valueint : 0,
|
||||
acs_info ? acs_info_local_nonprim : NULL,
|
||||
ipv4_frame_route_list ? ipv4_frame_route_listList : NULL,
|
||||
ipv6_frame_route_list ? ipv6_frame_route_listList : NULL,
|
||||
atsss_allowed ? atsss_allowed->valueint : 0
|
||||
atsss_allowed ? atsss_allowed->valueint : 0,
|
||||
secondary_auth ? secondary_auth->valueint : 0,
|
||||
dn_aaa_ip_address_allocation ? dn_aaa_ip_address_allocation->valueint : 0,
|
||||
dn_aaa_address ? dn_aaa_address_local_nonprim : NULL
|
||||
);
|
||||
|
||||
return dnn_configuration_local_var;
|
||||
|
|
|
|||
|
|
@ -38,7 +38,6 @@ typedef struct OpenAPI_dnn_configuration_s {
|
|||
OpenAPI_list_t *static_ip_address;
|
||||
struct OpenAPI_up_security_s *up_security;
|
||||
OpenAPI_pdu_session_continuity_ind_e pdu_session_continuity_ind;
|
||||
int invoke_nef_selection;
|
||||
char *nidd_nef_id;
|
||||
struct OpenAPI_nidd_information_s *nidd_info;
|
||||
int redundant_session_allowed;
|
||||
|
|
@ -46,6 +45,9 @@ typedef struct OpenAPI_dnn_configuration_s {
|
|||
OpenAPI_list_t *ipv4_frame_route_list;
|
||||
OpenAPI_list_t *ipv6_frame_route_list;
|
||||
int atsss_allowed;
|
||||
int secondary_auth;
|
||||
int dn_aaa_ip_address_allocation;
|
||||
struct OpenAPI_ip_address_s *dn_aaa_address;
|
||||
} OpenAPI_dnn_configuration_t;
|
||||
|
||||
OpenAPI_dnn_configuration_t *OpenAPI_dnn_configuration_create(
|
||||
|
|
@ -58,14 +60,16 @@ OpenAPI_dnn_configuration_t *OpenAPI_dnn_configuration_create(
|
|||
OpenAPI_list_t *static_ip_address,
|
||||
OpenAPI_up_security_t *up_security,
|
||||
OpenAPI_pdu_session_continuity_ind_e pdu_session_continuity_ind,
|
||||
int invoke_nef_selection,
|
||||
char *nidd_nef_id,
|
||||
OpenAPI_nidd_information_t *nidd_info,
|
||||
int redundant_session_allowed,
|
||||
OpenAPI_acs_info_t *acs_info,
|
||||
OpenAPI_list_t *ipv4_frame_route_list,
|
||||
OpenAPI_list_t *ipv6_frame_route_list,
|
||||
int atsss_allowed
|
||||
int atsss_allowed,
|
||||
int secondary_auth,
|
||||
int dn_aaa_ip_address_allocation,
|
||||
OpenAPI_ip_address_t *dn_aaa_address
|
||||
);
|
||||
void OpenAPI_dnn_configuration_free(OpenAPI_dnn_configuration_t *dnn_configuration);
|
||||
OpenAPI_dnn_configuration_t *OpenAPI_dnn_configuration_parseFromJSON(cJSON *dnn_configurationJSON);
|
||||
|
|
|
|||
|
|
@ -9,7 +9,10 @@ OpenAPI_dnn_info_t *OpenAPI_dnn_info_create(
|
|||
int default_dnn_indicator,
|
||||
int lbo_roaming_allowed,
|
||||
int iwk_eps_ind,
|
||||
int dnn_barred
|
||||
int dnn_barred,
|
||||
int invoke_nef_ind,
|
||||
OpenAPI_list_t *smf_list,
|
||||
int same_smf_ind
|
||||
)
|
||||
{
|
||||
OpenAPI_dnn_info_t *dnn_info_local_var = OpenAPI_malloc(sizeof(OpenAPI_dnn_info_t));
|
||||
|
|
@ -21,6 +24,9 @@ OpenAPI_dnn_info_t *OpenAPI_dnn_info_create(
|
|||
dnn_info_local_var->lbo_roaming_allowed = lbo_roaming_allowed;
|
||||
dnn_info_local_var->iwk_eps_ind = iwk_eps_ind;
|
||||
dnn_info_local_var->dnn_barred = dnn_barred;
|
||||
dnn_info_local_var->invoke_nef_ind = invoke_nef_ind;
|
||||
dnn_info_local_var->smf_list = smf_list;
|
||||
dnn_info_local_var->same_smf_ind = same_smf_ind;
|
||||
|
||||
return dnn_info_local_var;
|
||||
}
|
||||
|
|
@ -32,6 +38,10 @@ void OpenAPI_dnn_info_free(OpenAPI_dnn_info_t *dnn_info)
|
|||
}
|
||||
OpenAPI_lnode_t *node;
|
||||
ogs_free(dnn_info->dnn);
|
||||
OpenAPI_list_for_each(dnn_info->smf_list, node) {
|
||||
ogs_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(dnn_info->smf_list);
|
||||
ogs_free(dnn_info);
|
||||
}
|
||||
|
||||
|
|
@ -82,6 +92,36 @@ cJSON *OpenAPI_dnn_info_convertToJSON(OpenAPI_dnn_info_t *dnn_info)
|
|||
}
|
||||
}
|
||||
|
||||
if (dnn_info->invoke_nef_ind) {
|
||||
if (cJSON_AddBoolToObject(item, "invokeNefInd", dnn_info->invoke_nef_ind) == NULL) {
|
||||
ogs_error("OpenAPI_dnn_info_convertToJSON() failed [invoke_nef_ind]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (dnn_info->smf_list) {
|
||||
cJSON *smf_list = cJSON_AddArrayToObject(item, "smfList");
|
||||
if (smf_list == NULL) {
|
||||
ogs_error("OpenAPI_dnn_info_convertToJSON() failed [smf_list]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
OpenAPI_lnode_t *smf_list_node;
|
||||
OpenAPI_list_for_each(dnn_info->smf_list, smf_list_node) {
|
||||
if (cJSON_AddStringToObject(smf_list, "", (char*)smf_list_node->data) == NULL) {
|
||||
ogs_error("OpenAPI_dnn_info_convertToJSON() failed [smf_list]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (dnn_info->same_smf_ind) {
|
||||
if (cJSON_AddBoolToObject(item, "sameSmfInd", dnn_info->same_smf_ind) == NULL) {
|
||||
ogs_error("OpenAPI_dnn_info_convertToJSON() failed [same_smf_ind]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
|
@ -137,12 +177,53 @@ OpenAPI_dnn_info_t *OpenAPI_dnn_info_parseFromJSON(cJSON *dnn_infoJSON)
|
|||
}
|
||||
}
|
||||
|
||||
cJSON *invoke_nef_ind = cJSON_GetObjectItemCaseSensitive(dnn_infoJSON, "invokeNefInd");
|
||||
|
||||
if (invoke_nef_ind) {
|
||||
if (!cJSON_IsBool(invoke_nef_ind)) {
|
||||
ogs_error("OpenAPI_dnn_info_parseFromJSON() failed [invoke_nef_ind]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
cJSON *smf_list = cJSON_GetObjectItemCaseSensitive(dnn_infoJSON, "smfList");
|
||||
|
||||
OpenAPI_list_t *smf_listList;
|
||||
if (smf_list) {
|
||||
cJSON *smf_list_local;
|
||||
if (!cJSON_IsArray(smf_list)) {
|
||||
ogs_error("OpenAPI_dnn_info_parseFromJSON() failed [smf_list]");
|
||||
goto end;
|
||||
}
|
||||
smf_listList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(smf_list_local, smf_list) {
|
||||
if (!cJSON_IsString(smf_list_local)) {
|
||||
ogs_error("OpenAPI_dnn_info_parseFromJSON() failed [smf_list]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_add(smf_listList, ogs_strdup(smf_list_local->valuestring));
|
||||
}
|
||||
}
|
||||
|
||||
cJSON *same_smf_ind = cJSON_GetObjectItemCaseSensitive(dnn_infoJSON, "sameSmfInd");
|
||||
|
||||
if (same_smf_ind) {
|
||||
if (!cJSON_IsBool(same_smf_ind)) {
|
||||
ogs_error("OpenAPI_dnn_info_parseFromJSON() failed [same_smf_ind]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
dnn_info_local_var = OpenAPI_dnn_info_create (
|
||||
ogs_strdup(dnn->valuestring),
|
||||
default_dnn_indicator ? default_dnn_indicator->valueint : 0,
|
||||
lbo_roaming_allowed ? lbo_roaming_allowed->valueint : 0,
|
||||
iwk_eps_ind ? iwk_eps_ind->valueint : 0,
|
||||
dnn_barred ? dnn_barred->valueint : 0
|
||||
dnn_barred ? dnn_barred->valueint : 0,
|
||||
invoke_nef_ind ? invoke_nef_ind->valueint : 0,
|
||||
smf_list ? smf_listList : NULL,
|
||||
same_smf_ind ? same_smf_ind->valueint : 0
|
||||
);
|
||||
|
||||
return dnn_info_local_var;
|
||||
|
|
|
|||
|
|
@ -24,6 +24,9 @@ typedef struct OpenAPI_dnn_info_s {
|
|||
int lbo_roaming_allowed;
|
||||
int iwk_eps_ind;
|
||||
int dnn_barred;
|
||||
int invoke_nef_ind;
|
||||
OpenAPI_list_t *smf_list;
|
||||
int same_smf_ind;
|
||||
} OpenAPI_dnn_info_t;
|
||||
|
||||
OpenAPI_dnn_info_t *OpenAPI_dnn_info_create(
|
||||
|
|
@ -31,7 +34,10 @@ OpenAPI_dnn_info_t *OpenAPI_dnn_info_create(
|
|||
int default_dnn_indicator,
|
||||
int lbo_roaming_allowed,
|
||||
int iwk_eps_ind,
|
||||
int dnn_barred
|
||||
int dnn_barred,
|
||||
int invoke_nef_ind,
|
||||
OpenAPI_list_t *smf_list,
|
||||
int same_smf_ind
|
||||
);
|
||||
void OpenAPI_dnn_info_free(OpenAPI_dnn_info_t *dnn_info);
|
||||
OpenAPI_dnn_info_t *OpenAPI_dnn_info_parseFromJSON(cJSON *dnn_infoJSON);
|
||||
|
|
|
|||
|
|
@ -11,7 +11,10 @@ OpenAPI_dynamic5_qi_t *OpenAPI_dynamic5_qi_create(
|
|||
char *packet_err_rate,
|
||||
int aver_window,
|
||||
int max_data_burst_vol,
|
||||
int ext_max_data_burst_vol
|
||||
int ext_max_data_burst_vol,
|
||||
int ext_packet_del_budget,
|
||||
int cn_packet_delay_budget_dl,
|
||||
int cn_packet_delay_budget_ul
|
||||
)
|
||||
{
|
||||
OpenAPI_dynamic5_qi_t *dynamic5_qi_local_var = OpenAPI_malloc(sizeof(OpenAPI_dynamic5_qi_t));
|
||||
|
|
@ -25,6 +28,9 @@ OpenAPI_dynamic5_qi_t *OpenAPI_dynamic5_qi_create(
|
|||
dynamic5_qi_local_var->aver_window = aver_window;
|
||||
dynamic5_qi_local_var->max_data_burst_vol = max_data_burst_vol;
|
||||
dynamic5_qi_local_var->ext_max_data_burst_vol = ext_max_data_burst_vol;
|
||||
dynamic5_qi_local_var->ext_packet_del_budget = ext_packet_del_budget;
|
||||
dynamic5_qi_local_var->cn_packet_delay_budget_dl = cn_packet_delay_budget_dl;
|
||||
dynamic5_qi_local_var->cn_packet_delay_budget_ul = cn_packet_delay_budget_ul;
|
||||
|
||||
return dynamic5_qi_local_var;
|
||||
}
|
||||
|
|
@ -113,6 +119,27 @@ cJSON *OpenAPI_dynamic5_qi_convertToJSON(OpenAPI_dynamic5_qi_t *dynamic5_qi)
|
|||
}
|
||||
}
|
||||
|
||||
if (dynamic5_qi->ext_packet_del_budget) {
|
||||
if (cJSON_AddNumberToObject(item, "extPacketDelBudget", dynamic5_qi->ext_packet_del_budget) == NULL) {
|
||||
ogs_error("OpenAPI_dynamic5_qi_convertToJSON() failed [ext_packet_del_budget]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (dynamic5_qi->cn_packet_delay_budget_dl) {
|
||||
if (cJSON_AddNumberToObject(item, "cnPacketDelayBudgetDl", dynamic5_qi->cn_packet_delay_budget_dl) == NULL) {
|
||||
ogs_error("OpenAPI_dynamic5_qi_convertToJSON() failed [cn_packet_delay_budget_dl]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (dynamic5_qi->cn_packet_delay_budget_ul) {
|
||||
if (cJSON_AddNumberToObject(item, "cnPacketDelayBudgetUl", dynamic5_qi->cn_packet_delay_budget_ul) == NULL) {
|
||||
ogs_error("OpenAPI_dynamic5_qi_convertToJSON() failed [cn_packet_delay_budget_ul]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
|
@ -193,6 +220,33 @@ OpenAPI_dynamic5_qi_t *OpenAPI_dynamic5_qi_parseFromJSON(cJSON *dynamic5_qiJSON)
|
|||
}
|
||||
}
|
||||
|
||||
cJSON *ext_packet_del_budget = cJSON_GetObjectItemCaseSensitive(dynamic5_qiJSON, "extPacketDelBudget");
|
||||
|
||||
if (ext_packet_del_budget) {
|
||||
if (!cJSON_IsNumber(ext_packet_del_budget)) {
|
||||
ogs_error("OpenAPI_dynamic5_qi_parseFromJSON() failed [ext_packet_del_budget]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
cJSON *cn_packet_delay_budget_dl = cJSON_GetObjectItemCaseSensitive(dynamic5_qiJSON, "cnPacketDelayBudgetDl");
|
||||
|
||||
if (cn_packet_delay_budget_dl) {
|
||||
if (!cJSON_IsNumber(cn_packet_delay_budget_dl)) {
|
||||
ogs_error("OpenAPI_dynamic5_qi_parseFromJSON() failed [cn_packet_delay_budget_dl]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
cJSON *cn_packet_delay_budget_ul = cJSON_GetObjectItemCaseSensitive(dynamic5_qiJSON, "cnPacketDelayBudgetUl");
|
||||
|
||||
if (cn_packet_delay_budget_ul) {
|
||||
if (!cJSON_IsNumber(cn_packet_delay_budget_ul)) {
|
||||
ogs_error("OpenAPI_dynamic5_qi_parseFromJSON() failed [cn_packet_delay_budget_ul]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
dynamic5_qi_local_var = OpenAPI_dynamic5_qi_create (
|
||||
resource_type_local_nonprim,
|
||||
priority_level->valuedouble,
|
||||
|
|
@ -200,7 +254,10 @@ OpenAPI_dynamic5_qi_t *OpenAPI_dynamic5_qi_parseFromJSON(cJSON *dynamic5_qiJSON)
|
|||
ogs_strdup(packet_err_rate->valuestring),
|
||||
aver_window ? aver_window->valuedouble : 0,
|
||||
max_data_burst_vol ? max_data_burst_vol->valuedouble : 0,
|
||||
ext_max_data_burst_vol ? ext_max_data_burst_vol->valuedouble : 0
|
||||
ext_max_data_burst_vol ? ext_max_data_burst_vol->valuedouble : 0,
|
||||
ext_packet_del_budget ? ext_packet_del_budget->valuedouble : 0,
|
||||
cn_packet_delay_budget_dl ? cn_packet_delay_budget_dl->valuedouble : 0,
|
||||
cn_packet_delay_budget_ul ? cn_packet_delay_budget_ul->valuedouble : 0
|
||||
);
|
||||
|
||||
return dynamic5_qi_local_var;
|
||||
|
|
|
|||
|
|
@ -27,6 +27,9 @@ typedef struct OpenAPI_dynamic5_qi_s {
|
|||
int aver_window;
|
||||
int max_data_burst_vol;
|
||||
int ext_max_data_burst_vol;
|
||||
int ext_packet_del_budget;
|
||||
int cn_packet_delay_budget_dl;
|
||||
int cn_packet_delay_budget_ul;
|
||||
} OpenAPI_dynamic5_qi_t;
|
||||
|
||||
OpenAPI_dynamic5_qi_t *OpenAPI_dynamic5_qi_create(
|
||||
|
|
@ -36,7 +39,10 @@ OpenAPI_dynamic5_qi_t *OpenAPI_dynamic5_qi_create(
|
|||
char *packet_err_rate,
|
||||
int aver_window,
|
||||
int max_data_burst_vol,
|
||||
int ext_max_data_burst_vol
|
||||
int ext_max_data_burst_vol,
|
||||
int ext_packet_del_budget,
|
||||
int cn_packet_delay_budget_dl,
|
||||
int cn_packet_delay_budget_ul
|
||||
);
|
||||
void OpenAPI_dynamic5_qi_free(OpenAPI_dynamic5_qi_t *dynamic5_qi);
|
||||
OpenAPI_dynamic5_qi_t *OpenAPI_dynamic5_qi_parseFromJSON(cJSON *dynamic5_qiJSON);
|
||||
|
|
|
|||
|
|
@ -7,7 +7,8 @@
|
|||
OpenAPI_ec_restriction_t *OpenAPI_ec_restriction_create(
|
||||
char *af_instance_id,
|
||||
int reference_id,
|
||||
OpenAPI_list_t *plmn_ec_infos
|
||||
OpenAPI_list_t *plmn_ec_infos,
|
||||
char *mtc_provider_information
|
||||
)
|
||||
{
|
||||
OpenAPI_ec_restriction_t *ec_restriction_local_var = OpenAPI_malloc(sizeof(OpenAPI_ec_restriction_t));
|
||||
|
|
@ -17,6 +18,7 @@ OpenAPI_ec_restriction_t *OpenAPI_ec_restriction_create(
|
|||
ec_restriction_local_var->af_instance_id = af_instance_id;
|
||||
ec_restriction_local_var->reference_id = reference_id;
|
||||
ec_restriction_local_var->plmn_ec_infos = plmn_ec_infos;
|
||||
ec_restriction_local_var->mtc_provider_information = mtc_provider_information;
|
||||
|
||||
return ec_restriction_local_var;
|
||||
}
|
||||
|
|
@ -32,6 +34,7 @@ void OpenAPI_ec_restriction_free(OpenAPI_ec_restriction_t *ec_restriction)
|
|||
OpenAPI_plmn_ec_info_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(ec_restriction->plmn_ec_infos);
|
||||
ogs_free(ec_restriction->mtc_provider_information);
|
||||
ogs_free(ec_restriction);
|
||||
}
|
||||
|
||||
|
|
@ -83,6 +86,13 @@ cJSON *OpenAPI_ec_restriction_convertToJSON(OpenAPI_ec_restriction_t *ec_restric
|
|||
}
|
||||
}
|
||||
|
||||
if (ec_restriction->mtc_provider_information) {
|
||||
if (cJSON_AddStringToObject(item, "mtcProviderInformation", ec_restriction->mtc_provider_information) == NULL) {
|
||||
ogs_error("OpenAPI_ec_restriction_convertToJSON() failed [mtc_provider_information]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
|
@ -137,10 +147,20 @@ OpenAPI_ec_restriction_t *OpenAPI_ec_restriction_parseFromJSON(cJSON *ec_restric
|
|||
}
|
||||
}
|
||||
|
||||
cJSON *mtc_provider_information = cJSON_GetObjectItemCaseSensitive(ec_restrictionJSON, "mtcProviderInformation");
|
||||
|
||||
if (mtc_provider_information) {
|
||||
if (!cJSON_IsString(mtc_provider_information)) {
|
||||
ogs_error("OpenAPI_ec_restriction_parseFromJSON() failed [mtc_provider_information]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
ec_restriction_local_var = OpenAPI_ec_restriction_create (
|
||||
ogs_strdup(af_instance_id->valuestring),
|
||||
reference_id->valuedouble,
|
||||
plmn_ec_infos ? plmn_ec_infosList : NULL
|
||||
plmn_ec_infos ? plmn_ec_infosList : NULL,
|
||||
mtc_provider_information ? ogs_strdup(mtc_provider_information->valuestring) : NULL
|
||||
);
|
||||
|
||||
return ec_restriction_local_var;
|
||||
|
|
|
|||
|
|
@ -23,12 +23,14 @@ typedef struct OpenAPI_ec_restriction_s {
|
|||
char *af_instance_id;
|
||||
int reference_id;
|
||||
OpenAPI_list_t *plmn_ec_infos;
|
||||
char *mtc_provider_information;
|
||||
} OpenAPI_ec_restriction_t;
|
||||
|
||||
OpenAPI_ec_restriction_t *OpenAPI_ec_restriction_create(
|
||||
char *af_instance_id,
|
||||
int reference_id,
|
||||
OpenAPI_list_t *plmn_ec_infos
|
||||
OpenAPI_list_t *plmn_ec_infos,
|
||||
char *mtc_provider_information
|
||||
);
|
||||
void OpenAPI_ec_restriction_free(OpenAPI_ec_restriction_t *ec_restriction);
|
||||
OpenAPI_ec_restriction_t *OpenAPI_ec_restriction_parseFromJSON(cJSON *ec_restrictionJSON);
|
||||
|
|
|
|||
|
|
@ -1,123 +0,0 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include "ec_restriction_data.h"
|
||||
|
||||
OpenAPI_ec_restriction_data_t *OpenAPI_ec_restriction_data_create(
|
||||
int ec_mode_a_restricted,
|
||||
int ec_mode_b_restricted
|
||||
)
|
||||
{
|
||||
OpenAPI_ec_restriction_data_t *ec_restriction_data_local_var = OpenAPI_malloc(sizeof(OpenAPI_ec_restriction_data_t));
|
||||
if (!ec_restriction_data_local_var) {
|
||||
return NULL;
|
||||
}
|
||||
ec_restriction_data_local_var->ec_mode_a_restricted = ec_mode_a_restricted;
|
||||
ec_restriction_data_local_var->ec_mode_b_restricted = ec_mode_b_restricted;
|
||||
|
||||
return ec_restriction_data_local_var;
|
||||
}
|
||||
|
||||
void OpenAPI_ec_restriction_data_free(OpenAPI_ec_restriction_data_t *ec_restriction_data)
|
||||
{
|
||||
if (NULL == ec_restriction_data) {
|
||||
return;
|
||||
}
|
||||
OpenAPI_lnode_t *node;
|
||||
ogs_free(ec_restriction_data);
|
||||
}
|
||||
|
||||
cJSON *OpenAPI_ec_restriction_data_convertToJSON(OpenAPI_ec_restriction_data_t *ec_restriction_data)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
|
||||
if (ec_restriction_data == NULL) {
|
||||
ogs_error("OpenAPI_ec_restriction_data_convertToJSON() failed [EcRestrictionData]");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
item = cJSON_CreateObject();
|
||||
if (ec_restriction_data->ec_mode_a_restricted) {
|
||||
if (cJSON_AddBoolToObject(item, "ecModeARestricted", ec_restriction_data->ec_mode_a_restricted) == NULL) {
|
||||
ogs_error("OpenAPI_ec_restriction_data_convertToJSON() failed [ec_mode_a_restricted]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (ec_restriction_data->ec_mode_b_restricted) {
|
||||
if (cJSON_AddBoolToObject(item, "ecModeBRestricted", ec_restriction_data->ec_mode_b_restricted) == NULL) {
|
||||
ogs_error("OpenAPI_ec_restriction_data_convertToJSON() failed [ec_mode_b_restricted]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
||||
OpenAPI_ec_restriction_data_t *OpenAPI_ec_restriction_data_parseFromJSON(cJSON *ec_restriction_dataJSON)
|
||||
{
|
||||
OpenAPI_ec_restriction_data_t *ec_restriction_data_local_var = NULL;
|
||||
cJSON *ec_mode_a_restricted = cJSON_GetObjectItemCaseSensitive(ec_restriction_dataJSON, "ecModeARestricted");
|
||||
|
||||
if (ec_mode_a_restricted) {
|
||||
if (!cJSON_IsBool(ec_mode_a_restricted)) {
|
||||
ogs_error("OpenAPI_ec_restriction_data_parseFromJSON() failed [ec_mode_a_restricted]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
cJSON *ec_mode_b_restricted = cJSON_GetObjectItemCaseSensitive(ec_restriction_dataJSON, "ecModeBRestricted");
|
||||
|
||||
if (ec_mode_b_restricted) {
|
||||
if (!cJSON_IsBool(ec_mode_b_restricted)) {
|
||||
ogs_error("OpenAPI_ec_restriction_data_parseFromJSON() failed [ec_mode_b_restricted]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
ec_restriction_data_local_var = OpenAPI_ec_restriction_data_create (
|
||||
ec_mode_a_restricted ? ec_mode_a_restricted->valueint : 0,
|
||||
ec_mode_b_restricted ? ec_mode_b_restricted->valueint : 0
|
||||
);
|
||||
|
||||
return ec_restriction_data_local_var;
|
||||
end:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
OpenAPI_ec_restriction_data_t *OpenAPI_ec_restriction_data_copy(OpenAPI_ec_restriction_data_t *dst, OpenAPI_ec_restriction_data_t *src)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
char *content = NULL;
|
||||
|
||||
ogs_assert(src);
|
||||
item = OpenAPI_ec_restriction_data_convertToJSON(src);
|
||||
if (!item) {
|
||||
ogs_error("OpenAPI_ec_restriction_data_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_ec_restriction_data_free(dst);
|
||||
dst = OpenAPI_ec_restriction_data_parseFromJSON(item);
|
||||
cJSON_Delete(item);
|
||||
|
||||
return dst;
|
||||
}
|
||||
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
/*
|
||||
* ec_restriction_data.h
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _OpenAPI_ec_restriction_data_H_
|
||||
#define _OpenAPI_ec_restriction_data_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_ec_restriction_data_s OpenAPI_ec_restriction_data_t;
|
||||
typedef struct OpenAPI_ec_restriction_data_s {
|
||||
int ec_mode_a_restricted;
|
||||
int ec_mode_b_restricted;
|
||||
} OpenAPI_ec_restriction_data_t;
|
||||
|
||||
OpenAPI_ec_restriction_data_t *OpenAPI_ec_restriction_data_create(
|
||||
int ec_mode_a_restricted,
|
||||
int ec_mode_b_restricted
|
||||
);
|
||||
void OpenAPI_ec_restriction_data_free(OpenAPI_ec_restriction_data_t *ec_restriction_data);
|
||||
OpenAPI_ec_restriction_data_t *OpenAPI_ec_restriction_data_parseFromJSON(cJSON *ec_restriction_dataJSON);
|
||||
cJSON *OpenAPI_ec_restriction_data_convertToJSON(OpenAPI_ec_restriction_data_t *ec_restriction_data);
|
||||
OpenAPI_ec_restriction_data_t *OpenAPI_ec_restriction_data_copy(OpenAPI_ec_restriction_data_t *dst, OpenAPI_ec_restriction_data_t *src);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _OpenAPI_ec_restriction_data_H_ */
|
||||
|
||||
123
lib/sbi/openapi/model/ec_restriction_data_wb.c
Normal file
123
lib/sbi/openapi/model/ec_restriction_data_wb.c
Normal file
|
|
@ -0,0 +1,123 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include "ec_restriction_data_wb.h"
|
||||
|
||||
OpenAPI_ec_restriction_data_wb_t *OpenAPI_ec_restriction_data_wb_create(
|
||||
int ec_mode_a_restricted,
|
||||
int ec_mode_b_restricted
|
||||
)
|
||||
{
|
||||
OpenAPI_ec_restriction_data_wb_t *ec_restriction_data_wb_local_var = OpenAPI_malloc(sizeof(OpenAPI_ec_restriction_data_wb_t));
|
||||
if (!ec_restriction_data_wb_local_var) {
|
||||
return NULL;
|
||||
}
|
||||
ec_restriction_data_wb_local_var->ec_mode_a_restricted = ec_mode_a_restricted;
|
||||
ec_restriction_data_wb_local_var->ec_mode_b_restricted = ec_mode_b_restricted;
|
||||
|
||||
return ec_restriction_data_wb_local_var;
|
||||
}
|
||||
|
||||
void OpenAPI_ec_restriction_data_wb_free(OpenAPI_ec_restriction_data_wb_t *ec_restriction_data_wb)
|
||||
{
|
||||
if (NULL == ec_restriction_data_wb) {
|
||||
return;
|
||||
}
|
||||
OpenAPI_lnode_t *node;
|
||||
ogs_free(ec_restriction_data_wb);
|
||||
}
|
||||
|
||||
cJSON *OpenAPI_ec_restriction_data_wb_convertToJSON(OpenAPI_ec_restriction_data_wb_t *ec_restriction_data_wb)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
|
||||
if (ec_restriction_data_wb == NULL) {
|
||||
ogs_error("OpenAPI_ec_restriction_data_wb_convertToJSON() failed [EcRestrictionDataWb]");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
item = cJSON_CreateObject();
|
||||
if (ec_restriction_data_wb->ec_mode_a_restricted) {
|
||||
if (cJSON_AddBoolToObject(item, "ecModeARestricted", ec_restriction_data_wb->ec_mode_a_restricted) == NULL) {
|
||||
ogs_error("OpenAPI_ec_restriction_data_wb_convertToJSON() failed [ec_mode_a_restricted]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (ec_restriction_data_wb->ec_mode_b_restricted) {
|
||||
if (cJSON_AddBoolToObject(item, "ecModeBRestricted", ec_restriction_data_wb->ec_mode_b_restricted) == NULL) {
|
||||
ogs_error("OpenAPI_ec_restriction_data_wb_convertToJSON() failed [ec_mode_b_restricted]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
||||
OpenAPI_ec_restriction_data_wb_t *OpenAPI_ec_restriction_data_wb_parseFromJSON(cJSON *ec_restriction_data_wbJSON)
|
||||
{
|
||||
OpenAPI_ec_restriction_data_wb_t *ec_restriction_data_wb_local_var = NULL;
|
||||
cJSON *ec_mode_a_restricted = cJSON_GetObjectItemCaseSensitive(ec_restriction_data_wbJSON, "ecModeARestricted");
|
||||
|
||||
if (ec_mode_a_restricted) {
|
||||
if (!cJSON_IsBool(ec_mode_a_restricted)) {
|
||||
ogs_error("OpenAPI_ec_restriction_data_wb_parseFromJSON() failed [ec_mode_a_restricted]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
cJSON *ec_mode_b_restricted = cJSON_GetObjectItemCaseSensitive(ec_restriction_data_wbJSON, "ecModeBRestricted");
|
||||
|
||||
if (ec_mode_b_restricted) {
|
||||
if (!cJSON_IsBool(ec_mode_b_restricted)) {
|
||||
ogs_error("OpenAPI_ec_restriction_data_wb_parseFromJSON() failed [ec_mode_b_restricted]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
ec_restriction_data_wb_local_var = OpenAPI_ec_restriction_data_wb_create (
|
||||
ec_mode_a_restricted ? ec_mode_a_restricted->valueint : 0,
|
||||
ec_mode_b_restricted ? ec_mode_b_restricted->valueint : 0
|
||||
);
|
||||
|
||||
return ec_restriction_data_wb_local_var;
|
||||
end:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
OpenAPI_ec_restriction_data_wb_t *OpenAPI_ec_restriction_data_wb_copy(OpenAPI_ec_restriction_data_wb_t *dst, OpenAPI_ec_restriction_data_wb_t *src)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
char *content = NULL;
|
||||
|
||||
ogs_assert(src);
|
||||
item = OpenAPI_ec_restriction_data_wb_convertToJSON(src);
|
||||
if (!item) {
|
||||
ogs_error("OpenAPI_ec_restriction_data_wb_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_ec_restriction_data_wb_free(dst);
|
||||
dst = OpenAPI_ec_restriction_data_wb_parseFromJSON(item);
|
||||
cJSON_Delete(item);
|
||||
|
||||
return dst;
|
||||
}
|
||||
|
||||
40
lib/sbi/openapi/model/ec_restriction_data_wb.h
Normal file
40
lib/sbi/openapi/model/ec_restriction_data_wb.h
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* ec_restriction_data_wb.h
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _OpenAPI_ec_restriction_data_wb_H_
|
||||
#define _OpenAPI_ec_restriction_data_wb_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_ec_restriction_data_wb_s OpenAPI_ec_restriction_data_wb_t;
|
||||
typedef struct OpenAPI_ec_restriction_data_wb_s {
|
||||
int ec_mode_a_restricted;
|
||||
int ec_mode_b_restricted;
|
||||
} OpenAPI_ec_restriction_data_wb_t;
|
||||
|
||||
OpenAPI_ec_restriction_data_wb_t *OpenAPI_ec_restriction_data_wb_create(
|
||||
int ec_mode_a_restricted,
|
||||
int ec_mode_b_restricted
|
||||
);
|
||||
void OpenAPI_ec_restriction_data_wb_free(OpenAPI_ec_restriction_data_wb_t *ec_restriction_data_wb);
|
||||
OpenAPI_ec_restriction_data_wb_t *OpenAPI_ec_restriction_data_wb_parseFromJSON(cJSON *ec_restriction_data_wbJSON);
|
||||
cJSON *OpenAPI_ec_restriction_data_wb_convertToJSON(OpenAPI_ec_restriction_data_wb_t *ec_restriction_data_wb);
|
||||
OpenAPI_ec_restriction_data_wb_t *OpenAPI_ec_restriction_data_wb_copy(OpenAPI_ec_restriction_data_wb_t *dst, OpenAPI_ec_restriction_data_wb_t *src);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _OpenAPI_ec_restriction_data_wb_H_ */
|
||||
|
||||
|
|
@ -9,7 +9,12 @@ OpenAPI_ee_subscription_t *OpenAPI_ee_subscription_create(
|
|||
OpenAPI_list_t* monitoring_configurations,
|
||||
OpenAPI_reporting_options_t *reporting_options,
|
||||
char *supported_features,
|
||||
char *subscription_id
|
||||
char *subscription_id,
|
||||
OpenAPI_context_info_t *context_info,
|
||||
int epc_applied_ind,
|
||||
char *scef_diam_host,
|
||||
char *scef_diam_realm,
|
||||
char *notify_correlation_id
|
||||
)
|
||||
{
|
||||
OpenAPI_ee_subscription_t *ee_subscription_local_var = OpenAPI_malloc(sizeof(OpenAPI_ee_subscription_t));
|
||||
|
|
@ -21,6 +26,11 @@ OpenAPI_ee_subscription_t *OpenAPI_ee_subscription_create(
|
|||
ee_subscription_local_var->reporting_options = reporting_options;
|
||||
ee_subscription_local_var->supported_features = supported_features;
|
||||
ee_subscription_local_var->subscription_id = subscription_id;
|
||||
ee_subscription_local_var->context_info = context_info;
|
||||
ee_subscription_local_var->epc_applied_ind = epc_applied_ind;
|
||||
ee_subscription_local_var->scef_diam_host = scef_diam_host;
|
||||
ee_subscription_local_var->scef_diam_realm = scef_diam_realm;
|
||||
ee_subscription_local_var->notify_correlation_id = notify_correlation_id;
|
||||
|
||||
return ee_subscription_local_var;
|
||||
}
|
||||
|
|
@ -41,6 +51,10 @@ void OpenAPI_ee_subscription_free(OpenAPI_ee_subscription_t *ee_subscription)
|
|||
OpenAPI_reporting_options_free(ee_subscription->reporting_options);
|
||||
ogs_free(ee_subscription->supported_features);
|
||||
ogs_free(ee_subscription->subscription_id);
|
||||
OpenAPI_context_info_free(ee_subscription->context_info);
|
||||
ogs_free(ee_subscription->scef_diam_host);
|
||||
ogs_free(ee_subscription->scef_diam_realm);
|
||||
ogs_free(ee_subscription->notify_correlation_id);
|
||||
ogs_free(ee_subscription);
|
||||
}
|
||||
|
||||
|
|
@ -113,6 +127,47 @@ cJSON *OpenAPI_ee_subscription_convertToJSON(OpenAPI_ee_subscription_t *ee_subsc
|
|||
}
|
||||
}
|
||||
|
||||
if (ee_subscription->context_info) {
|
||||
cJSON *context_info_local_JSON = OpenAPI_context_info_convertToJSON(ee_subscription->context_info);
|
||||
if (context_info_local_JSON == NULL) {
|
||||
ogs_error("OpenAPI_ee_subscription_convertToJSON() failed [context_info]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToObject(item, "contextInfo", context_info_local_JSON);
|
||||
if (item->child == NULL) {
|
||||
ogs_error("OpenAPI_ee_subscription_convertToJSON() failed [context_info]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (ee_subscription->epc_applied_ind) {
|
||||
if (cJSON_AddBoolToObject(item, "epcAppliedInd", ee_subscription->epc_applied_ind) == NULL) {
|
||||
ogs_error("OpenAPI_ee_subscription_convertToJSON() failed [epc_applied_ind]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (ee_subscription->scef_diam_host) {
|
||||
if (cJSON_AddStringToObject(item, "scefDiamHost", ee_subscription->scef_diam_host) == NULL) {
|
||||
ogs_error("OpenAPI_ee_subscription_convertToJSON() failed [scef_diam_host]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (ee_subscription->scef_diam_realm) {
|
||||
if (cJSON_AddStringToObject(item, "scefDiamRealm", ee_subscription->scef_diam_realm) == NULL) {
|
||||
ogs_error("OpenAPI_ee_subscription_convertToJSON() failed [scef_diam_realm]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (ee_subscription->notify_correlation_id) {
|
||||
if (cJSON_AddStringToObject(item, "notifyCorrelationId", ee_subscription->notify_correlation_id) == NULL) {
|
||||
ogs_error("OpenAPI_ee_subscription_convertToJSON() failed [notify_correlation_id]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
|
@ -183,12 +238,60 @@ OpenAPI_ee_subscription_t *OpenAPI_ee_subscription_parseFromJSON(cJSON *ee_subsc
|
|||
}
|
||||
}
|
||||
|
||||
cJSON *context_info = cJSON_GetObjectItemCaseSensitive(ee_subscriptionJSON, "contextInfo");
|
||||
|
||||
OpenAPI_context_info_t *context_info_local_nonprim = NULL;
|
||||
if (context_info) {
|
||||
context_info_local_nonprim = OpenAPI_context_info_parseFromJSON(context_info);
|
||||
}
|
||||
|
||||
cJSON *epc_applied_ind = cJSON_GetObjectItemCaseSensitive(ee_subscriptionJSON, "epcAppliedInd");
|
||||
|
||||
if (epc_applied_ind) {
|
||||
if (!cJSON_IsBool(epc_applied_ind)) {
|
||||
ogs_error("OpenAPI_ee_subscription_parseFromJSON() failed [epc_applied_ind]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
cJSON *scef_diam_host = cJSON_GetObjectItemCaseSensitive(ee_subscriptionJSON, "scefDiamHost");
|
||||
|
||||
if (scef_diam_host) {
|
||||
if (!cJSON_IsString(scef_diam_host)) {
|
||||
ogs_error("OpenAPI_ee_subscription_parseFromJSON() failed [scef_diam_host]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
cJSON *scef_diam_realm = cJSON_GetObjectItemCaseSensitive(ee_subscriptionJSON, "scefDiamRealm");
|
||||
|
||||
if (scef_diam_realm) {
|
||||
if (!cJSON_IsString(scef_diam_realm)) {
|
||||
ogs_error("OpenAPI_ee_subscription_parseFromJSON() failed [scef_diam_realm]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
cJSON *notify_correlation_id = cJSON_GetObjectItemCaseSensitive(ee_subscriptionJSON, "notifyCorrelationId");
|
||||
|
||||
if (notify_correlation_id) {
|
||||
if (!cJSON_IsString(notify_correlation_id)) {
|
||||
ogs_error("OpenAPI_ee_subscription_parseFromJSON() failed [notify_correlation_id]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
ee_subscription_local_var = OpenAPI_ee_subscription_create (
|
||||
ogs_strdup(callback_reference->valuestring),
|
||||
monitoring_configurationsList,
|
||||
reporting_options ? reporting_options_local_nonprim : NULL,
|
||||
supported_features ? ogs_strdup(supported_features->valuestring) : NULL,
|
||||
subscription_id ? ogs_strdup(subscription_id->valuestring) : NULL
|
||||
subscription_id ? ogs_strdup(subscription_id->valuestring) : NULL,
|
||||
context_info ? context_info_local_nonprim : NULL,
|
||||
epc_applied_ind ? epc_applied_ind->valueint : 0,
|
||||
scef_diam_host ? ogs_strdup(scef_diam_host->valuestring) : NULL,
|
||||
scef_diam_realm ? ogs_strdup(scef_diam_realm->valuestring) : NULL,
|
||||
notify_correlation_id ? ogs_strdup(notify_correlation_id->valuestring) : NULL
|
||||
);
|
||||
|
||||
return ee_subscription_local_var;
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@
|
|||
#include "../include/list.h"
|
||||
#include "../include/keyValuePair.h"
|
||||
#include "../include/binary.h"
|
||||
#include "context_info.h"
|
||||
#include "monitoring_configuration.h"
|
||||
#include "reporting_options.h"
|
||||
|
||||
|
|
@ -26,6 +27,11 @@ typedef struct OpenAPI_ee_subscription_s {
|
|||
struct OpenAPI_reporting_options_s *reporting_options;
|
||||
char *supported_features;
|
||||
char *subscription_id;
|
||||
struct OpenAPI_context_info_s *context_info;
|
||||
int epc_applied_ind;
|
||||
char *scef_diam_host;
|
||||
char *scef_diam_realm;
|
||||
char *notify_correlation_id;
|
||||
} OpenAPI_ee_subscription_t;
|
||||
|
||||
OpenAPI_ee_subscription_t *OpenAPI_ee_subscription_create(
|
||||
|
|
@ -33,7 +39,12 @@ OpenAPI_ee_subscription_t *OpenAPI_ee_subscription_create(
|
|||
OpenAPI_list_t* monitoring_configurations,
|
||||
OpenAPI_reporting_options_t *reporting_options,
|
||||
char *supported_features,
|
||||
char *subscription_id
|
||||
char *subscription_id,
|
||||
OpenAPI_context_info_t *context_info,
|
||||
int epc_applied_ind,
|
||||
char *scef_diam_host,
|
||||
char *scef_diam_realm,
|
||||
char *notify_correlation_id
|
||||
);
|
||||
void OpenAPI_ee_subscription_free(OpenAPI_ee_subscription_t *ee_subscription);
|
||||
OpenAPI_ee_subscription_t *OpenAPI_ee_subscription_parseFromJSON(cJSON *ee_subscriptionJSON);
|
||||
|
|
|
|||
|
|
@ -7,7 +7,8 @@
|
|||
OpenAPI_emergency_info_t *OpenAPI_emergency_info_create(
|
||||
char *pgw_fqdn,
|
||||
OpenAPI_ip_address_t *pgw_ip_address,
|
||||
char *smf_instance_id
|
||||
char *smf_instance_id,
|
||||
int epdg_ind
|
||||
)
|
||||
{
|
||||
OpenAPI_emergency_info_t *emergency_info_local_var = OpenAPI_malloc(sizeof(OpenAPI_emergency_info_t));
|
||||
|
|
@ -17,6 +18,7 @@ OpenAPI_emergency_info_t *OpenAPI_emergency_info_create(
|
|||
emergency_info_local_var->pgw_fqdn = pgw_fqdn;
|
||||
emergency_info_local_var->pgw_ip_address = pgw_ip_address;
|
||||
emergency_info_local_var->smf_instance_id = smf_instance_id;
|
||||
emergency_info_local_var->epdg_ind = epdg_ind;
|
||||
|
||||
return emergency_info_local_var;
|
||||
}
|
||||
|
|
@ -70,6 +72,13 @@ cJSON *OpenAPI_emergency_info_convertToJSON(OpenAPI_emergency_info_t *emergency_
|
|||
}
|
||||
}
|
||||
|
||||
if (emergency_info->epdg_ind) {
|
||||
if (cJSON_AddBoolToObject(item, "epdgInd", emergency_info->epdg_ind) == NULL) {
|
||||
ogs_error("OpenAPI_emergency_info_convertToJSON() failed [epdg_ind]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
|
@ -102,10 +111,20 @@ OpenAPI_emergency_info_t *OpenAPI_emergency_info_parseFromJSON(cJSON *emergency_
|
|||
}
|
||||
}
|
||||
|
||||
cJSON *epdg_ind = cJSON_GetObjectItemCaseSensitive(emergency_infoJSON, "epdgInd");
|
||||
|
||||
if (epdg_ind) {
|
||||
if (!cJSON_IsBool(epdg_ind)) {
|
||||
ogs_error("OpenAPI_emergency_info_parseFromJSON() failed [epdg_ind]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
emergency_info_local_var = OpenAPI_emergency_info_create (
|
||||
pgw_fqdn ? ogs_strdup(pgw_fqdn->valuestring) : NULL,
|
||||
pgw_ip_address ? pgw_ip_address_local_nonprim : NULL,
|
||||
smf_instance_id ? ogs_strdup(smf_instance_id->valuestring) : NULL
|
||||
smf_instance_id ? ogs_strdup(smf_instance_id->valuestring) : NULL,
|
||||
epdg_ind ? epdg_ind->valueint : 0
|
||||
);
|
||||
|
||||
return emergency_info_local_var;
|
||||
|
|
|
|||
|
|
@ -23,12 +23,14 @@ typedef struct OpenAPI_emergency_info_s {
|
|||
char *pgw_fqdn;
|
||||
struct OpenAPI_ip_address_s *pgw_ip_address;
|
||||
char *smf_instance_id;
|
||||
int epdg_ind;
|
||||
} OpenAPI_emergency_info_t;
|
||||
|
||||
OpenAPI_emergency_info_t *OpenAPI_emergency_info_create(
|
||||
char *pgw_fqdn,
|
||||
OpenAPI_ip_address_t *pgw_ip_address,
|
||||
char *smf_instance_id
|
||||
char *smf_instance_id,
|
||||
int epdg_ind
|
||||
);
|
||||
void OpenAPI_emergency_info_free(OpenAPI_emergency_info_t *emergency_info);
|
||||
OpenAPI_emergency_info_t *OpenAPI_emergency_info_parseFromJSON(cJSON *emergency_infoJSON);
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ void OpenAPI_eps_interworking_info_free(OpenAPI_eps_interworking_info_t *eps_int
|
|||
OpenAPI_lnode_t *node;
|
||||
OpenAPI_list_for_each(eps_interworking_info->eps_iwk_pgws, node) {
|
||||
OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)node->data;
|
||||
OpenAPI_object_free(localKeyValue->value);
|
||||
OpenAPI_eps_iwk_pgw_free(localKeyValue->value);
|
||||
ogs_free(localKeyValue);
|
||||
}
|
||||
OpenAPI_list_free(eps_interworking_info->eps_iwk_pgws);
|
||||
|
|
@ -53,7 +53,7 @@ cJSON *OpenAPI_eps_interworking_info_convertToJSON(OpenAPI_eps_interworking_info
|
|||
if (eps_interworking_info->eps_iwk_pgws) {
|
||||
OpenAPI_list_for_each(eps_interworking_info->eps_iwk_pgws, eps_iwk_pgws_node) {
|
||||
OpenAPI_map_t *localKeyValue = (OpenAPI_map_t*)eps_iwk_pgws_node->data;
|
||||
cJSON *itemLocal = OpenAPI_object_convertToJSON(localKeyValue->value);
|
||||
cJSON *itemLocal = OpenAPI_eps_iwk_pgw_convertToJSON(localKeyValue->value);
|
||||
if (itemLocal == NULL) {
|
||||
ogs_error("OpenAPI_eps_interworking_info_convertToJSON() failed [eps_iwk_pgws]");
|
||||
goto end;
|
||||
|
|
@ -88,7 +88,7 @@ OpenAPI_eps_interworking_info_t *OpenAPI_eps_interworking_info_parseFromJSON(cJS
|
|||
goto end;
|
||||
}
|
||||
localMapKeyPair = OpenAPI_map_create(
|
||||
localMapObject->string, OpenAPI_object_parseFromJSON(localMapObject));
|
||||
localMapObject->string, OpenAPI_eps_iwk_pgw_parseFromJSON(localMapObject));
|
||||
OpenAPI_list_add(eps_iwk_pgwsList, localMapKeyPair);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
#include "../include/list.h"
|
||||
#include "../include/keyValuePair.h"
|
||||
#include "../include/binary.h"
|
||||
#include "object.h"
|
||||
#include "eps_iwk_pgw.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
|
|||
30
lib/sbi/openapi/model/event_for_mdt.c
Normal file
30
lib/sbi/openapi/model/event_for_mdt.c
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include "event_for_mdt.h"
|
||||
|
||||
char* OpenAPI_event_for_mdt_ToString(OpenAPI_event_for_mdt_e event_for_mdt)
|
||||
{
|
||||
const char *event_for_mdtArray[] = { "NULL", "OUT_OF_COVERAG", "A2_EVENT" };
|
||||
size_t sizeofArray = sizeof(event_for_mdtArray) / sizeof(event_for_mdtArray[0]);
|
||||
if (event_for_mdt < sizeofArray)
|
||||
return (char *)event_for_mdtArray[event_for_mdt];
|
||||
else
|
||||
return (char *)"Unknown";
|
||||
}
|
||||
|
||||
OpenAPI_event_for_mdt_e OpenAPI_event_for_mdt_FromString(char* event_for_mdt)
|
||||
{
|
||||
int stringToReturn = 0;
|
||||
const char *event_for_mdtArray[] = { "NULL", "OUT_OF_COVERAG", "A2_EVENT" };
|
||||
size_t sizeofArray = sizeof(event_for_mdtArray) / sizeof(event_for_mdtArray[0]);
|
||||
while (stringToReturn < sizeofArray) {
|
||||
if (strcmp(event_for_mdt, event_for_mdtArray[stringToReturn]) == 0) {
|
||||
return stringToReturn;
|
||||
}
|
||||
stringToReturn++;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
31
lib/sbi/openapi/model/event_for_mdt.h
Normal file
31
lib/sbi/openapi/model/event_for_mdt.h
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
/*
|
||||
* event_for_mdt.h
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _OpenAPI_event_for_mdt_H_
|
||||
#define _OpenAPI_event_for_mdt_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_event_for_mdt_NULL = 0, OpenAPI_event_for_mdt_OUT_OF_COVERAG, OpenAPI_event_for_mdt_A2_EVENT } OpenAPI_event_for_mdt_e;
|
||||
|
||||
char* OpenAPI_event_for_mdt_ToString(OpenAPI_event_for_mdt_e event_for_mdt);
|
||||
|
||||
OpenAPI_event_for_mdt_e OpenAPI_event_for_mdt_FromString(char* event_for_mdt);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _OpenAPI_event_for_mdt_H_ */
|
||||
|
||||
|
|
@ -15,7 +15,8 @@ OpenAPI_expected_ue_behaviour_t *OpenAPI_expected_ue_behaviour_create(
|
|||
OpenAPI_list_t *expected_umts,
|
||||
OpenAPI_traffic_profile_rm_t *traffic_profile,
|
||||
OpenAPI_battery_indication_rm_t *battery_indication,
|
||||
char *validity_time
|
||||
char *validity_time,
|
||||
char *mtc_provider_information
|
||||
)
|
||||
{
|
||||
OpenAPI_expected_ue_behaviour_t *expected_ue_behaviour_local_var = OpenAPI_malloc(sizeof(OpenAPI_expected_ue_behaviour_t));
|
||||
|
|
@ -33,6 +34,7 @@ OpenAPI_expected_ue_behaviour_t *OpenAPI_expected_ue_behaviour_create(
|
|||
expected_ue_behaviour_local_var->traffic_profile = traffic_profile;
|
||||
expected_ue_behaviour_local_var->battery_indication = battery_indication;
|
||||
expected_ue_behaviour_local_var->validity_time = validity_time;
|
||||
expected_ue_behaviour_local_var->mtc_provider_information = mtc_provider_information;
|
||||
|
||||
return expected_ue_behaviour_local_var;
|
||||
}
|
||||
|
|
@ -54,6 +56,7 @@ void OpenAPI_expected_ue_behaviour_free(OpenAPI_expected_ue_behaviour_t *expecte
|
|||
OpenAPI_traffic_profile_rm_free(expected_ue_behaviour->traffic_profile);
|
||||
OpenAPI_battery_indication_rm_free(expected_ue_behaviour->battery_indication);
|
||||
ogs_free(expected_ue_behaviour->validity_time);
|
||||
ogs_free(expected_ue_behaviour->mtc_provider_information);
|
||||
ogs_free(expected_ue_behaviour);
|
||||
}
|
||||
|
||||
|
|
@ -191,6 +194,13 @@ cJSON *OpenAPI_expected_ue_behaviour_convertToJSON(OpenAPI_expected_ue_behaviour
|
|||
}
|
||||
}
|
||||
|
||||
if (expected_ue_behaviour->mtc_provider_information) {
|
||||
if (cJSON_AddStringToObject(item, "mtcProviderInformation", expected_ue_behaviour->mtc_provider_information) == NULL) {
|
||||
ogs_error("OpenAPI_expected_ue_behaviour_convertToJSON() failed [mtc_provider_information]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
|
@ -307,6 +317,15 @@ OpenAPI_expected_ue_behaviour_t *OpenAPI_expected_ue_behaviour_parseFromJSON(cJS
|
|||
}
|
||||
}
|
||||
|
||||
cJSON *mtc_provider_information = cJSON_GetObjectItemCaseSensitive(expected_ue_behaviourJSON, "mtcProviderInformation");
|
||||
|
||||
if (mtc_provider_information) {
|
||||
if (!cJSON_IsString(mtc_provider_information)) {
|
||||
ogs_error("OpenAPI_expected_ue_behaviour_parseFromJSON() failed [mtc_provider_information]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
expected_ue_behaviour_local_var = OpenAPI_expected_ue_behaviour_create (
|
||||
ogs_strdup(af_instance_id->valuestring),
|
||||
reference_id->valuedouble,
|
||||
|
|
@ -318,7 +337,8 @@ OpenAPI_expected_ue_behaviour_t *OpenAPI_expected_ue_behaviour_parseFromJSON(cJS
|
|||
expected_umts ? expected_umtsList : NULL,
|
||||
traffic_profile ? traffic_profile_local_nonprim : NULL,
|
||||
battery_indication ? battery_indication_local_nonprim : NULL,
|
||||
validity_time ? ogs_strdup(validity_time->valuestring) : NULL
|
||||
validity_time ? ogs_strdup(validity_time->valuestring) : NULL,
|
||||
mtc_provider_information ? ogs_strdup(mtc_provider_information->valuestring) : NULL
|
||||
);
|
||||
|
||||
return expected_ue_behaviour_local_var;
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ typedef struct OpenAPI_expected_ue_behaviour_s {
|
|||
struct OpenAPI_traffic_profile_rm_s *traffic_profile;
|
||||
struct OpenAPI_battery_indication_rm_s *battery_indication;
|
||||
char *validity_time;
|
||||
char *mtc_provider_information;
|
||||
} OpenAPI_expected_ue_behaviour_t;
|
||||
|
||||
OpenAPI_expected_ue_behaviour_t *OpenAPI_expected_ue_behaviour_create(
|
||||
|
|
@ -49,7 +50,8 @@ OpenAPI_expected_ue_behaviour_t *OpenAPI_expected_ue_behaviour_create(
|
|||
OpenAPI_list_t *expected_umts,
|
||||
OpenAPI_traffic_profile_rm_t *traffic_profile,
|
||||
OpenAPI_battery_indication_rm_t *battery_indication,
|
||||
char *validity_time
|
||||
char *validity_time,
|
||||
char *mtc_provider_information
|
||||
);
|
||||
void OpenAPI_expected_ue_behaviour_free(OpenAPI_expected_ue_behaviour_t *expected_ue_behaviour);
|
||||
OpenAPI_expected_ue_behaviour_t *OpenAPI_expected_ue_behaviour_parseFromJSON(cJSON *expected_ue_behaviourJSON);
|
||||
|
|
|
|||
313
lib/sbi/openapi/model/ext_problem_details.c
Normal file
313
lib/sbi/openapi/model/ext_problem_details.c
Normal file
|
|
@ -0,0 +1,313 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include "ext_problem_details.h"
|
||||
|
||||
OpenAPI_ext_problem_details_t *OpenAPI_ext_problem_details_create(
|
||||
char *type,
|
||||
char *title,
|
||||
int status,
|
||||
char *detail,
|
||||
char *instance,
|
||||
char *cause,
|
||||
OpenAPI_list_t *invalid_params,
|
||||
char *supported_features,
|
||||
char *target_scp,
|
||||
int remote_error
|
||||
)
|
||||
{
|
||||
OpenAPI_ext_problem_details_t *ext_problem_details_local_var = OpenAPI_malloc(sizeof(OpenAPI_ext_problem_details_t));
|
||||
if (!ext_problem_details_local_var) {
|
||||
return NULL;
|
||||
}
|
||||
ext_problem_details_local_var->type = type;
|
||||
ext_problem_details_local_var->title = title;
|
||||
ext_problem_details_local_var->status = status;
|
||||
ext_problem_details_local_var->detail = detail;
|
||||
ext_problem_details_local_var->instance = instance;
|
||||
ext_problem_details_local_var->cause = cause;
|
||||
ext_problem_details_local_var->invalid_params = invalid_params;
|
||||
ext_problem_details_local_var->supported_features = supported_features;
|
||||
ext_problem_details_local_var->target_scp = target_scp;
|
||||
ext_problem_details_local_var->remote_error = remote_error;
|
||||
|
||||
return ext_problem_details_local_var;
|
||||
}
|
||||
|
||||
void OpenAPI_ext_problem_details_free(OpenAPI_ext_problem_details_t *ext_problem_details)
|
||||
{
|
||||
if (NULL == ext_problem_details) {
|
||||
return;
|
||||
}
|
||||
OpenAPI_lnode_t *node;
|
||||
ogs_free(ext_problem_details->type);
|
||||
ogs_free(ext_problem_details->title);
|
||||
ogs_free(ext_problem_details->detail);
|
||||
ogs_free(ext_problem_details->instance);
|
||||
ogs_free(ext_problem_details->cause);
|
||||
OpenAPI_list_for_each(ext_problem_details->invalid_params, node) {
|
||||
OpenAPI_invalid_param_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(ext_problem_details->invalid_params);
|
||||
ogs_free(ext_problem_details->supported_features);
|
||||
ogs_free(ext_problem_details->target_scp);
|
||||
ogs_free(ext_problem_details);
|
||||
}
|
||||
|
||||
cJSON *OpenAPI_ext_problem_details_convertToJSON(OpenAPI_ext_problem_details_t *ext_problem_details)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
|
||||
if (ext_problem_details == NULL) {
|
||||
ogs_error("OpenAPI_ext_problem_details_convertToJSON() failed [ExtProblemDetails]");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
item = cJSON_CreateObject();
|
||||
if (ext_problem_details->type) {
|
||||
if (cJSON_AddStringToObject(item, "type", ext_problem_details->type) == NULL) {
|
||||
ogs_error("OpenAPI_ext_problem_details_convertToJSON() failed [type]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (ext_problem_details->title) {
|
||||
if (cJSON_AddStringToObject(item, "title", ext_problem_details->title) == NULL) {
|
||||
ogs_error("OpenAPI_ext_problem_details_convertToJSON() failed [title]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (ext_problem_details->status) {
|
||||
if (cJSON_AddNumberToObject(item, "status", ext_problem_details->status) == NULL) {
|
||||
ogs_error("OpenAPI_ext_problem_details_convertToJSON() failed [status]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (ext_problem_details->detail) {
|
||||
if (cJSON_AddStringToObject(item, "detail", ext_problem_details->detail) == NULL) {
|
||||
ogs_error("OpenAPI_ext_problem_details_convertToJSON() failed [detail]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (ext_problem_details->instance) {
|
||||
if (cJSON_AddStringToObject(item, "instance", ext_problem_details->instance) == NULL) {
|
||||
ogs_error("OpenAPI_ext_problem_details_convertToJSON() failed [instance]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (ext_problem_details->cause) {
|
||||
if (cJSON_AddStringToObject(item, "cause", ext_problem_details->cause) == NULL) {
|
||||
ogs_error("OpenAPI_ext_problem_details_convertToJSON() failed [cause]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (ext_problem_details->invalid_params) {
|
||||
cJSON *invalid_paramsList = cJSON_AddArrayToObject(item, "invalidParams");
|
||||
if (invalid_paramsList == NULL) {
|
||||
ogs_error("OpenAPI_ext_problem_details_convertToJSON() failed [invalid_params]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
OpenAPI_lnode_t *invalid_params_node;
|
||||
if (ext_problem_details->invalid_params) {
|
||||
OpenAPI_list_for_each(ext_problem_details->invalid_params, invalid_params_node) {
|
||||
cJSON *itemLocal = OpenAPI_invalid_param_convertToJSON(invalid_params_node->data);
|
||||
if (itemLocal == NULL) {
|
||||
ogs_error("OpenAPI_ext_problem_details_convertToJSON() failed [invalid_params]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToArray(invalid_paramsList, itemLocal);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (ext_problem_details->supported_features) {
|
||||
if (cJSON_AddStringToObject(item, "supportedFeatures", ext_problem_details->supported_features) == NULL) {
|
||||
ogs_error("OpenAPI_ext_problem_details_convertToJSON() failed [supported_features]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (ext_problem_details->target_scp) {
|
||||
if (cJSON_AddStringToObject(item, "targetScp", ext_problem_details->target_scp) == NULL) {
|
||||
ogs_error("OpenAPI_ext_problem_details_convertToJSON() failed [target_scp]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (ext_problem_details->remote_error) {
|
||||
if (cJSON_AddBoolToObject(item, "remoteError", ext_problem_details->remote_error) == NULL) {
|
||||
ogs_error("OpenAPI_ext_problem_details_convertToJSON() failed [remote_error]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
||||
OpenAPI_ext_problem_details_t *OpenAPI_ext_problem_details_parseFromJSON(cJSON *ext_problem_detailsJSON)
|
||||
{
|
||||
OpenAPI_ext_problem_details_t *ext_problem_details_local_var = NULL;
|
||||
cJSON *type = cJSON_GetObjectItemCaseSensitive(ext_problem_detailsJSON, "type");
|
||||
|
||||
if (type) {
|
||||
if (!cJSON_IsString(type)) {
|
||||
ogs_error("OpenAPI_ext_problem_details_parseFromJSON() failed [type]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
cJSON *title = cJSON_GetObjectItemCaseSensitive(ext_problem_detailsJSON, "title");
|
||||
|
||||
if (title) {
|
||||
if (!cJSON_IsString(title)) {
|
||||
ogs_error("OpenAPI_ext_problem_details_parseFromJSON() failed [title]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
cJSON *status = cJSON_GetObjectItemCaseSensitive(ext_problem_detailsJSON, "status");
|
||||
|
||||
if (status) {
|
||||
if (!cJSON_IsNumber(status)) {
|
||||
ogs_error("OpenAPI_ext_problem_details_parseFromJSON() failed [status]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
cJSON *detail = cJSON_GetObjectItemCaseSensitive(ext_problem_detailsJSON, "detail");
|
||||
|
||||
if (detail) {
|
||||
if (!cJSON_IsString(detail)) {
|
||||
ogs_error("OpenAPI_ext_problem_details_parseFromJSON() failed [detail]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
cJSON *instance = cJSON_GetObjectItemCaseSensitive(ext_problem_detailsJSON, "instance");
|
||||
|
||||
if (instance) {
|
||||
if (!cJSON_IsString(instance)) {
|
||||
ogs_error("OpenAPI_ext_problem_details_parseFromJSON() failed [instance]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
cJSON *cause = cJSON_GetObjectItemCaseSensitive(ext_problem_detailsJSON, "cause");
|
||||
|
||||
if (cause) {
|
||||
if (!cJSON_IsString(cause)) {
|
||||
ogs_error("OpenAPI_ext_problem_details_parseFromJSON() failed [cause]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
cJSON *invalid_params = cJSON_GetObjectItemCaseSensitive(ext_problem_detailsJSON, "invalidParams");
|
||||
|
||||
OpenAPI_list_t *invalid_paramsList;
|
||||
if (invalid_params) {
|
||||
cJSON *invalid_params_local_nonprimitive;
|
||||
if (!cJSON_IsArray(invalid_params)) {
|
||||
ogs_error("OpenAPI_ext_problem_details_parseFromJSON() failed [invalid_params]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
invalid_paramsList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(invalid_params_local_nonprimitive, invalid_params ) {
|
||||
if (!cJSON_IsObject(invalid_params_local_nonprimitive)) {
|
||||
ogs_error("OpenAPI_ext_problem_details_parseFromJSON() failed [invalid_params]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_invalid_param_t *invalid_paramsItem = OpenAPI_invalid_param_parseFromJSON(invalid_params_local_nonprimitive);
|
||||
|
||||
OpenAPI_list_add(invalid_paramsList, invalid_paramsItem);
|
||||
}
|
||||
}
|
||||
|
||||
cJSON *supported_features = cJSON_GetObjectItemCaseSensitive(ext_problem_detailsJSON, "supportedFeatures");
|
||||
|
||||
if (supported_features) {
|
||||
if (!cJSON_IsString(supported_features)) {
|
||||
ogs_error("OpenAPI_ext_problem_details_parseFromJSON() failed [supported_features]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
cJSON *target_scp = cJSON_GetObjectItemCaseSensitive(ext_problem_detailsJSON, "targetScp");
|
||||
|
||||
if (target_scp) {
|
||||
if (!cJSON_IsString(target_scp)) {
|
||||
ogs_error("OpenAPI_ext_problem_details_parseFromJSON() failed [target_scp]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
cJSON *remote_error = cJSON_GetObjectItemCaseSensitive(ext_problem_detailsJSON, "remoteError");
|
||||
|
||||
if (remote_error) {
|
||||
if (!cJSON_IsBool(remote_error)) {
|
||||
ogs_error("OpenAPI_ext_problem_details_parseFromJSON() failed [remote_error]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
ext_problem_details_local_var = OpenAPI_ext_problem_details_create (
|
||||
type ? ogs_strdup(type->valuestring) : NULL,
|
||||
title ? ogs_strdup(title->valuestring) : NULL,
|
||||
status ? status->valuedouble : 0,
|
||||
detail ? ogs_strdup(detail->valuestring) : NULL,
|
||||
instance ? ogs_strdup(instance->valuestring) : NULL,
|
||||
cause ? ogs_strdup(cause->valuestring) : NULL,
|
||||
invalid_params ? invalid_paramsList : NULL,
|
||||
supported_features ? ogs_strdup(supported_features->valuestring) : NULL,
|
||||
target_scp ? ogs_strdup(target_scp->valuestring) : NULL,
|
||||
remote_error ? remote_error->valueint : 0
|
||||
);
|
||||
|
||||
return ext_problem_details_local_var;
|
||||
end:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
OpenAPI_ext_problem_details_t *OpenAPI_ext_problem_details_copy(OpenAPI_ext_problem_details_t *dst, OpenAPI_ext_problem_details_t *src)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
char *content = NULL;
|
||||
|
||||
ogs_assert(src);
|
||||
item = OpenAPI_ext_problem_details_convertToJSON(src);
|
||||
if (!item) {
|
||||
ogs_error("OpenAPI_ext_problem_details_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_ext_problem_details_free(dst);
|
||||
dst = OpenAPI_ext_problem_details_parseFromJSON(item);
|
||||
cJSON_Delete(item);
|
||||
|
||||
return dst;
|
||||
}
|
||||
|
||||
59
lib/sbi/openapi/model/ext_problem_details.h
Normal file
59
lib/sbi/openapi/model/ext_problem_details.h
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
/*
|
||||
* ext_problem_details.h
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _OpenAPI_ext_problem_details_H_
|
||||
#define _OpenAPI_ext_problem_details_H_
|
||||
|
||||
#include <string.h>
|
||||
#include "../external/cJSON.h"
|
||||
#include "../include/list.h"
|
||||
#include "../include/keyValuePair.h"
|
||||
#include "../include/binary.h"
|
||||
#include "invalid_param.h"
|
||||
#include "problem_details.h"
|
||||
#include "problem_details_add_info.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct OpenAPI_ext_problem_details_s OpenAPI_ext_problem_details_t;
|
||||
typedef struct OpenAPI_ext_problem_details_s {
|
||||
char *type;
|
||||
char *title;
|
||||
int status;
|
||||
char *detail;
|
||||
char *instance;
|
||||
char *cause;
|
||||
OpenAPI_list_t *invalid_params;
|
||||
char *supported_features;
|
||||
char *target_scp;
|
||||
int remote_error;
|
||||
} OpenAPI_ext_problem_details_t;
|
||||
|
||||
OpenAPI_ext_problem_details_t *OpenAPI_ext_problem_details_create(
|
||||
char *type,
|
||||
char *title,
|
||||
int status,
|
||||
char *detail,
|
||||
char *instance,
|
||||
char *cause,
|
||||
OpenAPI_list_t *invalid_params,
|
||||
char *supported_features,
|
||||
char *target_scp,
|
||||
int remote_error
|
||||
);
|
||||
void OpenAPI_ext_problem_details_free(OpenAPI_ext_problem_details_t *ext_problem_details);
|
||||
OpenAPI_ext_problem_details_t *OpenAPI_ext_problem_details_parseFromJSON(cJSON *ext_problem_detailsJSON);
|
||||
cJSON *OpenAPI_ext_problem_details_convertToJSON(OpenAPI_ext_problem_details_t *ext_problem_details);
|
||||
OpenAPI_ext_problem_details_t *OpenAPI_ext_problem_details_copy(OpenAPI_ext_problem_details_t *dst, OpenAPI_ext_problem_details_t *src);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _OpenAPI_ext_problem_details_H_ */
|
||||
|
||||
198
lib/sbi/openapi/model/ext_snssai.c
Normal file
198
lib/sbi/openapi/model/ext_snssai.c
Normal file
|
|
@ -0,0 +1,198 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include "ext_snssai.h"
|
||||
|
||||
OpenAPI_ext_snssai_t *OpenAPI_ext_snssai_create(
|
||||
int sst,
|
||||
char *sd,
|
||||
OpenAPI_list_t *sd_ranges,
|
||||
int wildcard_sd
|
||||
)
|
||||
{
|
||||
OpenAPI_ext_snssai_t *ext_snssai_local_var = OpenAPI_malloc(sizeof(OpenAPI_ext_snssai_t));
|
||||
if (!ext_snssai_local_var) {
|
||||
return NULL;
|
||||
}
|
||||
ext_snssai_local_var->sst = sst;
|
||||
ext_snssai_local_var->sd = sd;
|
||||
ext_snssai_local_var->sd_ranges = sd_ranges;
|
||||
ext_snssai_local_var->wildcard_sd = wildcard_sd;
|
||||
|
||||
return ext_snssai_local_var;
|
||||
}
|
||||
|
||||
void OpenAPI_ext_snssai_free(OpenAPI_ext_snssai_t *ext_snssai)
|
||||
{
|
||||
if (NULL == ext_snssai) {
|
||||
return;
|
||||
}
|
||||
OpenAPI_lnode_t *node;
|
||||
ogs_free(ext_snssai->sd);
|
||||
OpenAPI_list_for_each(ext_snssai->sd_ranges, node) {
|
||||
OpenAPI_sd_range_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(ext_snssai->sd_ranges);
|
||||
ogs_free(ext_snssai);
|
||||
}
|
||||
|
||||
cJSON *OpenAPI_ext_snssai_convertToJSON(OpenAPI_ext_snssai_t *ext_snssai)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
|
||||
if (ext_snssai == NULL) {
|
||||
ogs_error("OpenAPI_ext_snssai_convertToJSON() failed [ExtSnssai]");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
item = cJSON_CreateObject();
|
||||
if (!ext_snssai->sst) {
|
||||
ogs_error("OpenAPI_ext_snssai_convertToJSON() failed [sst]");
|
||||
goto end;
|
||||
}
|
||||
if (cJSON_AddNumberToObject(item, "sst", ext_snssai->sst) == NULL) {
|
||||
ogs_error("OpenAPI_ext_snssai_convertToJSON() failed [sst]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (ext_snssai->sd) {
|
||||
if (cJSON_AddStringToObject(item, "sd", ext_snssai->sd) == NULL) {
|
||||
ogs_error("OpenAPI_ext_snssai_convertToJSON() failed [sd]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (ext_snssai->sd_ranges) {
|
||||
cJSON *sd_rangesList = cJSON_AddArrayToObject(item, "sdRanges");
|
||||
if (sd_rangesList == NULL) {
|
||||
ogs_error("OpenAPI_ext_snssai_convertToJSON() failed [sd_ranges]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
OpenAPI_lnode_t *sd_ranges_node;
|
||||
if (ext_snssai->sd_ranges) {
|
||||
OpenAPI_list_for_each(ext_snssai->sd_ranges, sd_ranges_node) {
|
||||
cJSON *itemLocal = OpenAPI_sd_range_convertToJSON(sd_ranges_node->data);
|
||||
if (itemLocal == NULL) {
|
||||
ogs_error("OpenAPI_ext_snssai_convertToJSON() failed [sd_ranges]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToArray(sd_rangesList, itemLocal);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (ext_snssai->wildcard_sd) {
|
||||
if (cJSON_AddBoolToObject(item, "wildcardSd", ext_snssai->wildcard_sd) == NULL) {
|
||||
ogs_error("OpenAPI_ext_snssai_convertToJSON() failed [wildcard_sd]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
||||
OpenAPI_ext_snssai_t *OpenAPI_ext_snssai_parseFromJSON(cJSON *ext_snssaiJSON)
|
||||
{
|
||||
OpenAPI_ext_snssai_t *ext_snssai_local_var = NULL;
|
||||
cJSON *sst = cJSON_GetObjectItemCaseSensitive(ext_snssaiJSON, "sst");
|
||||
if (!sst) {
|
||||
ogs_error("OpenAPI_ext_snssai_parseFromJSON() failed [sst]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
|
||||
if (!cJSON_IsNumber(sst)) {
|
||||
ogs_error("OpenAPI_ext_snssai_parseFromJSON() failed [sst]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
cJSON *sd = cJSON_GetObjectItemCaseSensitive(ext_snssaiJSON, "sd");
|
||||
|
||||
if (sd) {
|
||||
if (!cJSON_IsString(sd)) {
|
||||
ogs_error("OpenAPI_ext_snssai_parseFromJSON() failed [sd]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
cJSON *sd_ranges = cJSON_GetObjectItemCaseSensitive(ext_snssaiJSON, "sdRanges");
|
||||
|
||||
OpenAPI_list_t *sd_rangesList;
|
||||
if (sd_ranges) {
|
||||
cJSON *sd_ranges_local_nonprimitive;
|
||||
if (!cJSON_IsArray(sd_ranges)) {
|
||||
ogs_error("OpenAPI_ext_snssai_parseFromJSON() failed [sd_ranges]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
sd_rangesList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(sd_ranges_local_nonprimitive, sd_ranges ) {
|
||||
if (!cJSON_IsObject(sd_ranges_local_nonprimitive)) {
|
||||
ogs_error("OpenAPI_ext_snssai_parseFromJSON() failed [sd_ranges]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_sd_range_t *sd_rangesItem = OpenAPI_sd_range_parseFromJSON(sd_ranges_local_nonprimitive);
|
||||
|
||||
OpenAPI_list_add(sd_rangesList, sd_rangesItem);
|
||||
}
|
||||
}
|
||||
|
||||
cJSON *wildcard_sd = cJSON_GetObjectItemCaseSensitive(ext_snssaiJSON, "wildcardSd");
|
||||
|
||||
if (wildcard_sd) {
|
||||
if (!cJSON_IsBool(wildcard_sd)) {
|
||||
ogs_error("OpenAPI_ext_snssai_parseFromJSON() failed [wildcard_sd]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
ext_snssai_local_var = OpenAPI_ext_snssai_create (
|
||||
sst->valuedouble,
|
||||
sd ? ogs_strdup(sd->valuestring) : NULL,
|
||||
sd_ranges ? sd_rangesList : NULL,
|
||||
wildcard_sd ? wildcard_sd->valueint : 0
|
||||
);
|
||||
|
||||
return ext_snssai_local_var;
|
||||
end:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
OpenAPI_ext_snssai_t *OpenAPI_ext_snssai_copy(OpenAPI_ext_snssai_t *dst, OpenAPI_ext_snssai_t *src)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
char *content = NULL;
|
||||
|
||||
ogs_assert(src);
|
||||
item = OpenAPI_ext_snssai_convertToJSON(src);
|
||||
if (!item) {
|
||||
ogs_error("OpenAPI_ext_snssai_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_ext_snssai_free(dst);
|
||||
dst = OpenAPI_ext_snssai_parseFromJSON(item);
|
||||
cJSON_Delete(item);
|
||||
|
||||
return dst;
|
||||
}
|
||||
|
||||
47
lib/sbi/openapi/model/ext_snssai.h
Normal file
47
lib/sbi/openapi/model/ext_snssai.h
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
/*
|
||||
* ext_snssai.h
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _OpenAPI_ext_snssai_H_
|
||||
#define _OpenAPI_ext_snssai_H_
|
||||
|
||||
#include <string.h>
|
||||
#include "../external/cJSON.h"
|
||||
#include "../include/list.h"
|
||||
#include "../include/keyValuePair.h"
|
||||
#include "../include/binary.h"
|
||||
#include "sd_range.h"
|
||||
#include "snssai.h"
|
||||
#include "snssai_extension.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct OpenAPI_ext_snssai_s OpenAPI_ext_snssai_t;
|
||||
typedef struct OpenAPI_ext_snssai_s {
|
||||
int sst;
|
||||
char *sd;
|
||||
OpenAPI_list_t *sd_ranges;
|
||||
int wildcard_sd;
|
||||
} OpenAPI_ext_snssai_t;
|
||||
|
||||
OpenAPI_ext_snssai_t *OpenAPI_ext_snssai_create(
|
||||
int sst,
|
||||
char *sd,
|
||||
OpenAPI_list_t *sd_ranges,
|
||||
int wildcard_sd
|
||||
);
|
||||
void OpenAPI_ext_snssai_free(OpenAPI_ext_snssai_t *ext_snssai);
|
||||
OpenAPI_ext_snssai_t *OpenAPI_ext_snssai_parseFromJSON(cJSON *ext_snssaiJSON);
|
||||
cJSON *OpenAPI_ext_snssai_convertToJSON(OpenAPI_ext_snssai_t *ext_snssai);
|
||||
OpenAPI_ext_snssai_t *OpenAPI_ext_snssai_copy(OpenAPI_ext_snssai_t *dst, OpenAPI_ext_snssai_t *src);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _OpenAPI_ext_snssai_H_ */
|
||||
|
||||
|
|
@ -1,85 +0,0 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include "flow_direction_rm.h"
|
||||
|
||||
OpenAPI_flow_direction_rm_t *OpenAPI_flow_direction_rm_create(
|
||||
)
|
||||
{
|
||||
OpenAPI_flow_direction_rm_t *flow_direction_rm_local_var = OpenAPI_malloc(sizeof(OpenAPI_flow_direction_rm_t));
|
||||
if (!flow_direction_rm_local_var) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return flow_direction_rm_local_var;
|
||||
}
|
||||
|
||||
void OpenAPI_flow_direction_rm_free(OpenAPI_flow_direction_rm_t *flow_direction_rm)
|
||||
{
|
||||
if (NULL == flow_direction_rm) {
|
||||
return;
|
||||
}
|
||||
OpenAPI_lnode_t *node;
|
||||
ogs_free(flow_direction_rm);
|
||||
}
|
||||
|
||||
cJSON *OpenAPI_flow_direction_rm_convertToJSON(OpenAPI_flow_direction_rm_t *flow_direction_rm)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
|
||||
if (flow_direction_rm == NULL) {
|
||||
ogs_error("OpenAPI_flow_direction_rm_convertToJSON() failed [FlowDirectionRm]");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
item = cJSON_CreateObject();
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
||||
OpenAPI_flow_direction_rm_t *OpenAPI_flow_direction_rm_parseFromJSON(cJSON *flow_direction_rmJSON)
|
||||
{
|
||||
OpenAPI_flow_direction_rm_t *flow_direction_rm_local_var = NULL;
|
||||
flow_direction_rm_local_var = OpenAPI_flow_direction_rm_create (
|
||||
);
|
||||
|
||||
return flow_direction_rm_local_var;
|
||||
end:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
OpenAPI_flow_direction_rm_t *OpenAPI_flow_direction_rm_copy(OpenAPI_flow_direction_rm_t *dst, OpenAPI_flow_direction_rm_t *src)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
char *content = NULL;
|
||||
|
||||
ogs_assert(src);
|
||||
item = OpenAPI_flow_direction_rm_convertToJSON(src);
|
||||
if (!item) {
|
||||
ogs_error("OpenAPI_flow_direction_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_flow_direction_rm_free(dst);
|
||||
dst = OpenAPI_flow_direction_rm_parseFromJSON(item);
|
||||
cJSON_Delete(item);
|
||||
|
||||
return dst;
|
||||
}
|
||||
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
/*
|
||||
* flow_direction_rm.h
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _OpenAPI_flow_direction_rm_H_
|
||||
#define _OpenAPI_flow_direction_rm_H_
|
||||
|
||||
#include <string.h>
|
||||
#include "../external/cJSON.h"
|
||||
#include "../include/list.h"
|
||||
#include "../include/keyValuePair.h"
|
||||
#include "../include/binary.h"
|
||||
#include "flow_direction.h"
|
||||
#include "null_value.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct OpenAPI_flow_direction_rm_s OpenAPI_flow_direction_rm_t;
|
||||
typedef struct OpenAPI_flow_direction_rm_s {
|
||||
} OpenAPI_flow_direction_rm_t;
|
||||
|
||||
OpenAPI_flow_direction_rm_t *OpenAPI_flow_direction_rm_create(
|
||||
);
|
||||
void OpenAPI_flow_direction_rm_free(OpenAPI_flow_direction_rm_t *flow_direction_rm);
|
||||
OpenAPI_flow_direction_rm_t *OpenAPI_flow_direction_rm_parseFromJSON(cJSON *flow_direction_rmJSON);
|
||||
cJSON *OpenAPI_flow_direction_rm_convertToJSON(OpenAPI_flow_direction_rm_t *flow_direction_rm);
|
||||
OpenAPI_flow_direction_rm_t *OpenAPI_flow_direction_rm_copy(OpenAPI_flow_direction_rm_t *dst, OpenAPI_flow_direction_rm_t *src);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _OpenAPI_flow_direction_rm_H_ */
|
||||
|
||||
|
|
@ -9,9 +9,10 @@ OpenAPI_gbr_qos_flow_information_t *OpenAPI_gbr_qos_flow_information_create(
|
|||
char *max_fbr_ul,
|
||||
char *gua_fbr_dl,
|
||||
char *gua_fbr_ul,
|
||||
OpenAPI_notification_control_t *notif_control,
|
||||
OpenAPI_notification_control_e notif_control,
|
||||
int max_packet_loss_rate_dl,
|
||||
int max_packet_loss_rate_ul
|
||||
int max_packet_loss_rate_ul,
|
||||
OpenAPI_list_t *alternative_qos_profile_list
|
||||
)
|
||||
{
|
||||
OpenAPI_gbr_qos_flow_information_t *gbr_qos_flow_information_local_var = OpenAPI_malloc(sizeof(OpenAPI_gbr_qos_flow_information_t));
|
||||
|
|
@ -25,6 +26,7 @@ OpenAPI_gbr_qos_flow_information_t *OpenAPI_gbr_qos_flow_information_create(
|
|||
gbr_qos_flow_information_local_var->notif_control = notif_control;
|
||||
gbr_qos_flow_information_local_var->max_packet_loss_rate_dl = max_packet_loss_rate_dl;
|
||||
gbr_qos_flow_information_local_var->max_packet_loss_rate_ul = max_packet_loss_rate_ul;
|
||||
gbr_qos_flow_information_local_var->alternative_qos_profile_list = alternative_qos_profile_list;
|
||||
|
||||
return gbr_qos_flow_information_local_var;
|
||||
}
|
||||
|
|
@ -39,7 +41,10 @@ void OpenAPI_gbr_qos_flow_information_free(OpenAPI_gbr_qos_flow_information_t *g
|
|||
ogs_free(gbr_qos_flow_information->max_fbr_ul);
|
||||
ogs_free(gbr_qos_flow_information->gua_fbr_dl);
|
||||
ogs_free(gbr_qos_flow_information->gua_fbr_ul);
|
||||
OpenAPI_notification_control_free(gbr_qos_flow_information->notif_control);
|
||||
OpenAPI_list_for_each(gbr_qos_flow_information->alternative_qos_profile_list, node) {
|
||||
OpenAPI_alternative_qos_profile_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(gbr_qos_flow_information->alternative_qos_profile_list);
|
||||
ogs_free(gbr_qos_flow_information);
|
||||
}
|
||||
|
||||
|
|
@ -90,13 +95,7 @@ cJSON *OpenAPI_gbr_qos_flow_information_convertToJSON(OpenAPI_gbr_qos_flow_infor
|
|||
}
|
||||
|
||||
if (gbr_qos_flow_information->notif_control) {
|
||||
cJSON *notif_control_local_JSON = OpenAPI_notification_control_convertToJSON(gbr_qos_flow_information->notif_control);
|
||||
if (notif_control_local_JSON == NULL) {
|
||||
ogs_error("OpenAPI_gbr_qos_flow_information_convertToJSON() failed [notif_control]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToObject(item, "notifControl", notif_control_local_JSON);
|
||||
if (item->child == NULL) {
|
||||
if (cJSON_AddStringToObject(item, "notifControl", OpenAPI_notification_control_ToString(gbr_qos_flow_information->notif_control)) == NULL) {
|
||||
ogs_error("OpenAPI_gbr_qos_flow_information_convertToJSON() failed [notif_control]");
|
||||
goto end;
|
||||
}
|
||||
|
|
@ -116,6 +115,26 @@ cJSON *OpenAPI_gbr_qos_flow_information_convertToJSON(OpenAPI_gbr_qos_flow_infor
|
|||
}
|
||||
}
|
||||
|
||||
if (gbr_qos_flow_information->alternative_qos_profile_list) {
|
||||
cJSON *alternative_qos_profile_listList = cJSON_AddArrayToObject(item, "alternativeQosProfileList");
|
||||
if (alternative_qos_profile_listList == NULL) {
|
||||
ogs_error("OpenAPI_gbr_qos_flow_information_convertToJSON() failed [alternative_qos_profile_list]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
OpenAPI_lnode_t *alternative_qos_profile_list_node;
|
||||
if (gbr_qos_flow_information->alternative_qos_profile_list) {
|
||||
OpenAPI_list_for_each(gbr_qos_flow_information->alternative_qos_profile_list, alternative_qos_profile_list_node) {
|
||||
cJSON *itemLocal = OpenAPI_alternative_qos_profile_convertToJSON(alternative_qos_profile_list_node->data);
|
||||
if (itemLocal == NULL) {
|
||||
ogs_error("OpenAPI_gbr_qos_flow_information_convertToJSON() failed [alternative_qos_profile_list]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToArray(alternative_qos_profile_listList, itemLocal);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
|
@ -173,9 +192,13 @@ OpenAPI_gbr_qos_flow_information_t *OpenAPI_gbr_qos_flow_information_parseFromJS
|
|||
|
||||
cJSON *notif_control = cJSON_GetObjectItemCaseSensitive(gbr_qos_flow_informationJSON, "notifControl");
|
||||
|
||||
OpenAPI_notification_control_t *notif_control_local_nonprim = NULL;
|
||||
OpenAPI_notification_control_e notif_controlVariable;
|
||||
if (notif_control) {
|
||||
notif_control_local_nonprim = OpenAPI_notification_control_parseFromJSON(notif_control);
|
||||
if (!cJSON_IsString(notif_control)) {
|
||||
ogs_error("OpenAPI_gbr_qos_flow_information_parseFromJSON() failed [notif_control]");
|
||||
goto end;
|
||||
}
|
||||
notif_controlVariable = OpenAPI_notification_control_FromString(notif_control->valuestring);
|
||||
}
|
||||
|
||||
cJSON *max_packet_loss_rate_dl = cJSON_GetObjectItemCaseSensitive(gbr_qos_flow_informationJSON, "maxPacketLossRateDl");
|
||||
|
|
@ -196,14 +219,38 @@ OpenAPI_gbr_qos_flow_information_t *OpenAPI_gbr_qos_flow_information_parseFromJS
|
|||
}
|
||||
}
|
||||
|
||||
cJSON *alternative_qos_profile_list = cJSON_GetObjectItemCaseSensitive(gbr_qos_flow_informationJSON, "alternativeQosProfileList");
|
||||
|
||||
OpenAPI_list_t *alternative_qos_profile_listList;
|
||||
if (alternative_qos_profile_list) {
|
||||
cJSON *alternative_qos_profile_list_local_nonprimitive;
|
||||
if (!cJSON_IsArray(alternative_qos_profile_list)) {
|
||||
ogs_error("OpenAPI_gbr_qos_flow_information_parseFromJSON() failed [alternative_qos_profile_list]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
alternative_qos_profile_listList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(alternative_qos_profile_list_local_nonprimitive, alternative_qos_profile_list ) {
|
||||
if (!cJSON_IsObject(alternative_qos_profile_list_local_nonprimitive)) {
|
||||
ogs_error("OpenAPI_gbr_qos_flow_information_parseFromJSON() failed [alternative_qos_profile_list]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_alternative_qos_profile_t *alternative_qos_profile_listItem = OpenAPI_alternative_qos_profile_parseFromJSON(alternative_qos_profile_list_local_nonprimitive);
|
||||
|
||||
OpenAPI_list_add(alternative_qos_profile_listList, alternative_qos_profile_listItem);
|
||||
}
|
||||
}
|
||||
|
||||
gbr_qos_flow_information_local_var = OpenAPI_gbr_qos_flow_information_create (
|
||||
ogs_strdup(max_fbr_dl->valuestring),
|
||||
ogs_strdup(max_fbr_ul->valuestring),
|
||||
ogs_strdup(gua_fbr_dl->valuestring),
|
||||
ogs_strdup(gua_fbr_ul->valuestring),
|
||||
notif_control ? notif_control_local_nonprim : NULL,
|
||||
notif_control ? notif_controlVariable : 0,
|
||||
max_packet_loss_rate_dl ? max_packet_loss_rate_dl->valuedouble : 0,
|
||||
max_packet_loss_rate_ul ? max_packet_loss_rate_ul->valuedouble : 0
|
||||
max_packet_loss_rate_ul ? max_packet_loss_rate_ul->valuedouble : 0,
|
||||
alternative_qos_profile_list ? alternative_qos_profile_listList : NULL
|
||||
);
|
||||
|
||||
return gbr_qos_flow_information_local_var;
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@
|
|||
#include "../include/list.h"
|
||||
#include "../include/keyValuePair.h"
|
||||
#include "../include/binary.h"
|
||||
#include "alternative_qos_profile.h"
|
||||
#include "notification_control.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
@ -24,9 +25,10 @@ typedef struct OpenAPI_gbr_qos_flow_information_s {
|
|||
char *max_fbr_ul;
|
||||
char *gua_fbr_dl;
|
||||
char *gua_fbr_ul;
|
||||
struct OpenAPI_notification_control_s *notif_control;
|
||||
OpenAPI_notification_control_e notif_control;
|
||||
int max_packet_loss_rate_dl;
|
||||
int max_packet_loss_rate_ul;
|
||||
OpenAPI_list_t *alternative_qos_profile_list;
|
||||
} OpenAPI_gbr_qos_flow_information_t;
|
||||
|
||||
OpenAPI_gbr_qos_flow_information_t *OpenAPI_gbr_qos_flow_information_create(
|
||||
|
|
@ -34,9 +36,10 @@ OpenAPI_gbr_qos_flow_information_t *OpenAPI_gbr_qos_flow_information_create(
|
|||
char *max_fbr_ul,
|
||||
char *gua_fbr_dl,
|
||||
char *gua_fbr_ul,
|
||||
OpenAPI_notification_control_t *notif_control,
|
||||
OpenAPI_notification_control_e notif_control,
|
||||
int max_packet_loss_rate_dl,
|
||||
int max_packet_loss_rate_ul
|
||||
int max_packet_loss_rate_ul,
|
||||
OpenAPI_list_t *alternative_qos_profile_list
|
||||
);
|
||||
void OpenAPI_gbr_qos_flow_information_free(OpenAPI_gbr_qos_flow_information_t *gbr_qos_flow_information);
|
||||
OpenAPI_gbr_qos_flow_information_t *OpenAPI_gbr_qos_flow_information_parseFromJSON(cJSON *gbr_qos_flow_informationJSON);
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@ OpenAPI_global_ran_node_id_t *OpenAPI_global_ran_node_id_create(
|
|||
char *n3_iwf_id,
|
||||
OpenAPI_g_nb_id_t *g_nb_id,
|
||||
char *nge_nb_id,
|
||||
char *wagf_id,
|
||||
char *tngf_id,
|
||||
char *nid,
|
||||
char *e_nb_id
|
||||
)
|
||||
|
|
@ -21,6 +23,8 @@ OpenAPI_global_ran_node_id_t *OpenAPI_global_ran_node_id_create(
|
|||
global_ran_node_id_local_var->n3_iwf_id = n3_iwf_id;
|
||||
global_ran_node_id_local_var->g_nb_id = g_nb_id;
|
||||
global_ran_node_id_local_var->nge_nb_id = nge_nb_id;
|
||||
global_ran_node_id_local_var->wagf_id = wagf_id;
|
||||
global_ran_node_id_local_var->tngf_id = tngf_id;
|
||||
global_ran_node_id_local_var->nid = nid;
|
||||
global_ran_node_id_local_var->e_nb_id = e_nb_id;
|
||||
|
||||
|
|
@ -37,6 +41,8 @@ void OpenAPI_global_ran_node_id_free(OpenAPI_global_ran_node_id_t *global_ran_no
|
|||
ogs_free(global_ran_node_id->n3_iwf_id);
|
||||
OpenAPI_g_nb_id_free(global_ran_node_id->g_nb_id);
|
||||
ogs_free(global_ran_node_id->nge_nb_id);
|
||||
ogs_free(global_ran_node_id->wagf_id);
|
||||
ogs_free(global_ran_node_id->tngf_id);
|
||||
ogs_free(global_ran_node_id->nid);
|
||||
ogs_free(global_ran_node_id->e_nb_id);
|
||||
ogs_free(global_ran_node_id);
|
||||
|
|
@ -94,6 +100,20 @@ cJSON *OpenAPI_global_ran_node_id_convertToJSON(OpenAPI_global_ran_node_id_t *gl
|
|||
}
|
||||
}
|
||||
|
||||
if (global_ran_node_id->wagf_id) {
|
||||
if (cJSON_AddStringToObject(item, "wagfId", global_ran_node_id->wagf_id) == NULL) {
|
||||
ogs_error("OpenAPI_global_ran_node_id_convertToJSON() failed [wagf_id]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (global_ran_node_id->tngf_id) {
|
||||
if (cJSON_AddStringToObject(item, "tngfId", global_ran_node_id->tngf_id) == NULL) {
|
||||
ogs_error("OpenAPI_global_ran_node_id_convertToJSON() failed [tngf_id]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (global_ran_node_id->nid) {
|
||||
if (cJSON_AddStringToObject(item, "nid", global_ran_node_id->nid) == NULL) {
|
||||
ogs_error("OpenAPI_global_ran_node_id_convertToJSON() failed [nid]");
|
||||
|
|
@ -150,6 +170,24 @@ OpenAPI_global_ran_node_id_t *OpenAPI_global_ran_node_id_parseFromJSON(cJSON *gl
|
|||
}
|
||||
}
|
||||
|
||||
cJSON *wagf_id = cJSON_GetObjectItemCaseSensitive(global_ran_node_idJSON, "wagfId");
|
||||
|
||||
if (wagf_id) {
|
||||
if (!cJSON_IsString(wagf_id)) {
|
||||
ogs_error("OpenAPI_global_ran_node_id_parseFromJSON() failed [wagf_id]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
cJSON *tngf_id = cJSON_GetObjectItemCaseSensitive(global_ran_node_idJSON, "tngfId");
|
||||
|
||||
if (tngf_id) {
|
||||
if (!cJSON_IsString(tngf_id)) {
|
||||
ogs_error("OpenAPI_global_ran_node_id_parseFromJSON() failed [tngf_id]");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
cJSON *nid = cJSON_GetObjectItemCaseSensitive(global_ran_node_idJSON, "nid");
|
||||
|
||||
if (nid) {
|
||||
|
|
@ -173,6 +211,8 @@ OpenAPI_global_ran_node_id_t *OpenAPI_global_ran_node_id_parseFromJSON(cJSON *gl
|
|||
n3_iwf_id ? ogs_strdup(n3_iwf_id->valuestring) : NULL,
|
||||
g_nb_id ? g_nb_id_local_nonprim : NULL,
|
||||
nge_nb_id ? ogs_strdup(nge_nb_id->valuestring) : NULL,
|
||||
wagf_id ? ogs_strdup(wagf_id->valuestring) : NULL,
|
||||
tngf_id ? ogs_strdup(tngf_id->valuestring) : NULL,
|
||||
nid ? ogs_strdup(nid->valuestring) : NULL,
|
||||
e_nb_id ? ogs_strdup(e_nb_id->valuestring) : NULL
|
||||
);
|
||||
|
|
|
|||
|
|
@ -25,6 +25,8 @@ typedef struct OpenAPI_global_ran_node_id_s {
|
|||
char *n3_iwf_id;
|
||||
struct OpenAPI_g_nb_id_s *g_nb_id;
|
||||
char *nge_nb_id;
|
||||
char *wagf_id;
|
||||
char *tngf_id;
|
||||
char *nid;
|
||||
char *e_nb_id;
|
||||
} OpenAPI_global_ran_node_id_t;
|
||||
|
|
@ -34,6 +36,8 @@ OpenAPI_global_ran_node_id_t *OpenAPI_global_ran_node_id_create(
|
|||
char *n3_iwf_id,
|
||||
OpenAPI_g_nb_id_t *g_nb_id,
|
||||
char *nge_nb_id,
|
||||
char *wagf_id,
|
||||
char *tngf_id,
|
||||
char *nid,
|
||||
char *e_nb_id
|
||||
);
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* gmlc_info.h
|
||||
*
|
||||
*
|
||||
* Information of a GMLC NF Instance
|
||||
*/
|
||||
|
||||
#ifndef _OpenAPI_gmlc_info_H_
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
#include "guami.h"
|
||||
|
||||
OpenAPI_guami_t *OpenAPI_guami_create(
|
||||
OpenAPI_plmn_id_t *plmn_id,
|
||||
OpenAPI_plmn_id_nid_t *plmn_id,
|
||||
char *amf_id
|
||||
)
|
||||
{
|
||||
|
|
@ -25,7 +25,7 @@ void OpenAPI_guami_free(OpenAPI_guami_t *guami)
|
|||
return;
|
||||
}
|
||||
OpenAPI_lnode_t *node;
|
||||
OpenAPI_plmn_id_free(guami->plmn_id);
|
||||
OpenAPI_plmn_id_nid_free(guami->plmn_id);
|
||||
ogs_free(guami->amf_id);
|
||||
ogs_free(guami);
|
||||
}
|
||||
|
|
@ -44,7 +44,7 @@ cJSON *OpenAPI_guami_convertToJSON(OpenAPI_guami_t *guami)
|
|||
ogs_error("OpenAPI_guami_convertToJSON() failed [plmn_id]");
|
||||
goto end;
|
||||
}
|
||||
cJSON *plmn_id_local_JSON = OpenAPI_plmn_id_convertToJSON(guami->plmn_id);
|
||||
cJSON *plmn_id_local_JSON = OpenAPI_plmn_id_nid_convertToJSON(guami->plmn_id);
|
||||
if (plmn_id_local_JSON == NULL) {
|
||||
ogs_error("OpenAPI_guami_convertToJSON() failed [plmn_id]");
|
||||
goto end;
|
||||
|
|
@ -77,9 +77,9 @@ OpenAPI_guami_t *OpenAPI_guami_parseFromJSON(cJSON *guamiJSON)
|
|||
goto end;
|
||||
}
|
||||
|
||||
OpenAPI_plmn_id_t *plmn_id_local_nonprim = NULL;
|
||||
OpenAPI_plmn_id_nid_t *plmn_id_local_nonprim = NULL;
|
||||
|
||||
plmn_id_local_nonprim = OpenAPI_plmn_id_parseFromJSON(plmn_id);
|
||||
plmn_id_local_nonprim = OpenAPI_plmn_id_nid_parseFromJSON(plmn_id);
|
||||
|
||||
cJSON *amf_id = cJSON_GetObjectItemCaseSensitive(guamiJSON, "amfId");
|
||||
if (!amf_id) {
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
#include "../include/list.h"
|
||||
#include "../include/keyValuePair.h"
|
||||
#include "../include/binary.h"
|
||||
#include "plmn_id.h"
|
||||
#include "plmn_id_nid.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
@ -20,12 +20,12 @@ extern "C" {
|
|||
|
||||
typedef struct OpenAPI_guami_s OpenAPI_guami_t;
|
||||
typedef struct OpenAPI_guami_s {
|
||||
struct OpenAPI_plmn_id_s *plmn_id;
|
||||
struct OpenAPI_plmn_id_nid_s *plmn_id;
|
||||
char *amf_id;
|
||||
} OpenAPI_guami_t;
|
||||
|
||||
OpenAPI_guami_t *OpenAPI_guami_create(
|
||||
OpenAPI_plmn_id_t *plmn_id,
|
||||
OpenAPI_plmn_id_nid_t *plmn_id,
|
||||
char *amf_id
|
||||
);
|
||||
void OpenAPI_guami_free(OpenAPI_guami_t *guami);
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue